Add object primitives, official ext/llm, and HTTPS/dotenv platform.
Introduce # objects with ## methods (handles + ` x.method `), ship OpenAI-compatible ext/llm, and upgrade net/sys for HTTPS headers and dotenv loading. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b974f10c6e
commit
b00b018056
55 files changed
+1741
-291
No files matched your search
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: ext llm DeepSeek complete (live)
|
||||
description: Live OpenAI-compatible chat via DeepSeek. Needs tests/ext/.env (gitignored). Not in gold suite.
|
||||
> ext/llm.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
> load_env
|
||||
|
||||
*`model` = > llm *
|
||||
|
||||
*`reply` = > `model`.complete prompt=Reply with exactly one English word: pong *
|
||||
|
||||
> print text=`reply`
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: ext llm import
|
||||
> ext/llm.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
> load_env
|
||||
|
||||
> print text=ext-ok
|
||||
@@ -62,6 +62,11 @@ fn structure_hello() {
|
||||
assert_out("tests/structure/hello.mq.md", "Hello World!");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn structure_object_handle() {
|
||||
assert_out("tests/structure/object-handle.mq.md", "counter\n3\n4");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn structure_nested_call() {
|
||||
assert_out("tests/structure/nested-call.mq.md", "Hello World!");
|
||||
@@ -580,6 +585,21 @@ fn lib_sys_cwd() {
|
||||
assert_out("tests/lib/sys-cwd.mq.md", "cwd-ok");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lib_sys_dotenv() {
|
||||
assert_out("tests/lib/sys-dotenv.mq.md", "loaded");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lib_json_quote() {
|
||||
assert_out("tests/lib/json-quote.mq.md", "\"hi\"");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ext_llm_import() {
|
||||
assert_out("tests/ext/llm-import.mq.md", "ext-ok");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lib_net_encode() {
|
||||
assert_out("tests/lib/net-encode.mq.md", "a+b");
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: json quote
|
||||
> lib/json.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*`q` = > quote text=hi *
|
||||
|
||||
> print text=`q`
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: sys dotenv
|
||||
> lib/sys.mq.md
|
||||
> lib/fs.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
> write_text path=dotenv-fixture.env text=MARQDO_DOTENV_FIXTURE=loaded
|
||||
|
||||
> load_dotenv path=dotenv-fixture.env
|
||||
|
||||
*`v` = > env_get name=MARQDO_DOTENV_FIXTURE *
|
||||
|
||||
> print text=`v`
|
||||
@@ -3,12 +3,12 @@ title: 工具函数
|
||||
description: 供 frontmatter > 导入;返回用粗体;副作用用输出函数
|
||||
---
|
||||
|
||||
# 加一
|
||||
## 加一
|
||||
- n
|
||||
|
||||
**`n` + 1**
|
||||
|
||||
# 问候
|
||||
## 问候
|
||||
- 谁
|
||||
|
||||
> print text=你好,`谁`!
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: object handle smoke
|
||||
> lib/json.mq.md
|
||||
---
|
||||
|
||||
# counter
|
||||
- n
|
||||
|
||||
*`t` = > parse text={"p":"{\"n\":","s":"}"} *
|
||||
*`qn` = > str `n` *
|
||||
*`p` = > get value=`t` key=p *
|
||||
*`s` = > get value=`t` key=s *
|
||||
*`raw` = `p` + `qn` + `s` *
|
||||
**> parse text=`raw`**
|
||||
|
||||
## bump
|
||||
|
||||
*`n` = > get value=`self` key=n *
|
||||
*`n2` = `n` + 1*
|
||||
*`t` = > parse text={"p":"{\"n\":","s":"}"} *
|
||||
*`qn` = > str `n2` *
|
||||
*`p` = > get value=`t` key=p *
|
||||
*`s` = > get value=`t` key=s *
|
||||
*`raw` = `p` + `qn` + `s` *
|
||||
*`m` = > parse text=`raw` *
|
||||
**`m`**
|
||||
|
||||
# main
|
||||
|
||||
*`c` = > counter n=3 *
|
||||
*`ty` = > get value=`c` key=_type *
|
||||
> print text=`ty`
|
||||
*`n` = > get value=`c` key=n *
|
||||
> print text=`n`
|
||||
*`c2` = > `c`.bump *
|
||||
*`n2` = > get value=`c2` key=n *
|
||||
> print text=`n2`
|
||||
Reference in new issue
Block a user