feat(web): Document/Endpoint/Resource artifact rewrite (ADR 0007)

Replace the monolithic compose_*/configure author surface with file-level
web|endpoint artifacts, split ext/{web,data,security,net}, and lock
no-degrade rules so the model cannot regress to God-object APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-28 11:06:38 +08:00
1 parent 33f8b94bb0
commit 67bac1bf02
54 files changed
+4642 -2505

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
---
title: ext/net/http
description: HTTP primitives surface for Web Runtime (ADR 0007). Prefer Document/Endpoint Artifacts over raw calls.
import plugin:lib/plugin.mq.md
import sys:lib/sys.mq.md
---
## _load
**p = > plugin.native_path name="web"**
1. `p`
> plugin.load path=`p`
2. *
> print text=ext/net: native web plugin not found
> sys.exit code=1
****
## result
+ `ok`
+ `value`=None
+ `error`=None
Unified Result map `{ok, value, error}`.
`out` =
| ok | value | error |
|----|-------|-------|
| `ok` | `value` | `error` |
*out*
+9
View File
@@ -0,0 +1,9 @@
---
title: ext/net/url
description: URL helpers (stdlib host wrappers). ADR 0007.
---
## encode
+ `text`
*> host_url_encode text=`text`*
+41
View File
@@ -0,0 +1,41 @@
---
title: ext/net/websocket
description: WebSocket client Resource (ADR 0007).
import plugin:lib/plugin.mq.md
import sys:lib/sys.mq.md
import table:lib/table.mq.md
---
## _load
**p = > plugin.native_path name="web"**
1. `p`
> plugin.load path=`p`
2. *
> print text=ext/net: native web plugin not found
> sys.exit code=1
****
# ws
+ `timeout_sec`=30
WebSocket client helper.
> _load
`out` =
| timeout_sec | _type |
|-------------|-------|
| `timeout_sec` | ws |
*out*
## connect
+ `url`
+ `message`=""
+ `headers`=None
Single request–response: connect to `url`, send `message`, collect up to 256 server text replies (each up to 1 MiB), close. Transport errors and timeouts return `{ok:false, error}` instead of looking like an empty successful reply.
**timeout = [timeout_sec](self)**
*> web_ws_connect url=`url` message=`message` headers=`headers` timeout_sec=`timeout`*