@mininglamp-oss/octo-runtime 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/apps/cli/dist/adapters.d.ts +19 -1
- package/apps/cli/dist/adapters.js +153 -23
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/codex.d.ts +5 -0
- package/apps/cli/dist/codex.js +36 -0
- package/apps/cli/dist/kernel.d.ts +4 -0
- package/apps/cli/dist/kernel.js +84 -0
- package/apps/cli/dist/main.js +8 -7
- package/apps/cli/dist/manifest.json +33 -22
- package/apps/cli/dist/output.d.ts +1 -0
- package/apps/cli/dist/output.js +8 -4
- package/apps/cli/dist/playboard.js +21 -12
- package/apps/cli/dist/provider-launch.d.ts +28 -0
- package/apps/cli/dist/provider-launch.js +52 -0
- package/apps/cli/dist/providers.d.ts +182 -0
- package/apps/cli/dist/providers.js +34 -0
- package/dist/public/adapter-sdk.d.ts +2 -0
- package/dist/public/adapter-sdk.js +2 -0
- package/dist/public/protocol.d.ts +1 -1
- package/dist/public/protocol.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.d.ts +15 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +24 -28
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.d.ts +10 -35
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.js +22 -29
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.d.ts +14 -68
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.js +60 -43
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +19 -31
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +29 -18
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +6 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +32 -26
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/engine.d.ts +54 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/engine.js +147 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/environment.js +4 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +20 -92
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +104 -216
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/mcp.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/mcp.js +4 -11
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.d.ts +9 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.js +77 -81
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.d.ts +4 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +12 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.d.ts +14 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.js +23 -30
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +4 -7
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.d.ts +13 -21
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.js +48 -26
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.d.ts +16 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.js +15 -7
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.d.ts +16 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.js +14 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.d.ts +16 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.js +15 -7
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +7 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +27 -29
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +16 -25
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +109 -178
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.d.ts +16 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.js +15 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.d.ts +16 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.js +15 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/agent-env.d.ts +49 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/agent-env.js +256 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.js +7 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/environment.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +25 -12
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +116 -58
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/mcp.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.d.ts +11 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.js +89 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/provider-launch.d.ts +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/provider-launch.js +25 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/public-display.js +10 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.d.ts +19 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +153 -23
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/codex.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/codex.js +36 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/kernel.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/kernel.js +84 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +8 -7
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +33 -22
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +8 -4
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +21 -12
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/provider-launch.d.ts +28 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/provider-launch.js +52 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/providers.d.ts +182 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/providers.js +34 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +20 -20
- package/node_modules/@mininglamp-oss/octo-runtime-client/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-client/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc.schema.json +3 -104
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/protocol.schema.json +173 -1295
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +26 -54
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +13 -85
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.d.ts +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +17 -20
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.js +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-catalog.d.ts +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-catalog.js +3 -5
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-configuration.js +1 -8
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.d.ts +1 -2
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +3 -267
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +17 -3
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +102 -396
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.js +32 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +6 -15
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +33 -178
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.d.ts +11 -22
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +38 -78
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/multimodal.js +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.d.ts +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.js +5 -28
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +34 -37
- package/packages/octo-runtime-protocol/schema/kernel-ipc.schema.json +3 -104
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +173 -1295
- package/dist/public/codex.d.ts +0 -1
- package/dist/public/codex.js +0 -1
- package/dist/public/dsh.d.ts +0 -2
- package/dist/public/dsh.js +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-configuration-fixtures.json +0 -1219
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-fixtures.json +0 -5988
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-client.behavior.json +0 -56
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/native-invoke-fixtures.json +0 -116
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/run-protocol-fixtures.json +0 -761
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/runtime-selection-fixtures.json +0 -663
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/session-name-fixtures.json +0 -191
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/context.d.ts +0 -12
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/context.js +0 -89
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/execution-preparation.d.ts +0 -33
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/execution-preparation.js +0 -93
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/execution-plan.d.ts +0 -3
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/execution-plan.js +0 -80
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/model-context.d.ts +0 -3
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/model-context.js +0 -9
- /package/node_modules/@mininglamp-oss/octo-runtime-client/{schema → fixtures}/kernel-ipc-fixtures.json +0 -0
- /package/packages/octo-runtime-protocol/{schema → test/fixtures}/kernel-ipc-fixtures.json +0 -0
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "omitted name",
|
|
4
|
-
"valid": true
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"name": "lowercase name",
|
|
8
|
-
"sessionName": "octo-dm-user-123",
|
|
9
|
-
"valid": true
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"name": "mixed letters digits and hyphens",
|
|
13
|
-
"sessionName": "WebUI-ABC-xyz-019",
|
|
14
|
-
"valid": true
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"name": "one letter",
|
|
18
|
-
"sessionName": "A",
|
|
19
|
-
"valid": true
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"name": "one digit",
|
|
23
|
-
"sessionName": "7",
|
|
24
|
-
"valid": true
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"name": "one hyphen",
|
|
28
|
-
"sessionName": "-",
|
|
29
|
-
"valid": true
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"name": "256 ASCII characters",
|
|
33
|
-
"sessionName": "Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-",
|
|
34
|
-
"valid": true
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"name": "257 ASCII characters",
|
|
38
|
-
"sessionName": "Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-Ab9-x",
|
|
39
|
-
"valid": false
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"name": "empty name",
|
|
43
|
-
"sessionName": "",
|
|
44
|
-
"valid": false
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"name": "whitespace only",
|
|
48
|
-
"sessionName": " \t",
|
|
49
|
-
"valid": false
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"name": "embedded space",
|
|
53
|
-
"sessionName": "Team review",
|
|
54
|
-
"valid": true
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"name": "colon",
|
|
58
|
-
"sessionName": "a:b",
|
|
59
|
-
"valid": true
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"name": "underscore",
|
|
63
|
-
"sessionName": "a_b",
|
|
64
|
-
"valid": true
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"name": "slash",
|
|
68
|
-
"sessionName": "a/b",
|
|
69
|
-
"valid": true
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"name": "percent escape",
|
|
73
|
-
"sessionName": "a%20b",
|
|
74
|
-
"valid": true
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"name": "non ASCII letters",
|
|
78
|
-
"sessionName": "\u540d\u79f0",
|
|
79
|
-
"valid": true
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"name": "emoji",
|
|
83
|
-
"sessionName": "\ud83d\ude00",
|
|
84
|
-
"valid": true
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"name": "Unicode line separator",
|
|
88
|
-
"sessionName": "a\u2028b",
|
|
89
|
-
"valid": true
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"name": "Unicode paragraph separator",
|
|
93
|
-
"sessionName": "a\u2029b",
|
|
94
|
-
"valid": true
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"name": "Unicode BOM whitespace",
|
|
98
|
-
"sessionName": "\ufeff",
|
|
99
|
-
"valid": false
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"name": "Unicode next line",
|
|
103
|
-
"sessionName": "\u0085",
|
|
104
|
-
"valid": false
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"name": "trailing newline",
|
|
108
|
-
"sessionName": "valid-name\n",
|
|
109
|
-
"valid": false
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"name": "trailing carriage return",
|
|
113
|
-
"sessionName": "valid-name\r",
|
|
114
|
-
"valid": false
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"name": "embedded control character",
|
|
118
|
-
"sessionName": "a\u0001b",
|
|
119
|
-
"valid": false
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "DEL",
|
|
123
|
-
"sessionName": "a\u007fb",
|
|
124
|
-
"valid": false
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"name": "null",
|
|
128
|
-
"sessionName": null,
|
|
129
|
-
"valid": false
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"name": "number",
|
|
133
|
-
"sessionName": 42,
|
|
134
|
-
"valid": false
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"name": "boolean",
|
|
138
|
-
"sessionName": true,
|
|
139
|
-
"valid": false
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"name": "object",
|
|
143
|
-
"sessionName": {},
|
|
144
|
-
"valid": false
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"name": "array",
|
|
148
|
-
"sessionName": [],
|
|
149
|
-
"valid": false
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"name": "space only",
|
|
153
|
-
"sessionName": " ",
|
|
154
|
-
"valid": false
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"name": "no-break space only",
|
|
158
|
-
"sessionName": "\u00a0",
|
|
159
|
-
"valid": false
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"name": "Unicode spaces only",
|
|
163
|
-
"sessionName": "\u1680\u2000\u200a\u2028\u2029\u202f\u205f\u3000\ufeff",
|
|
164
|
-
"valid": false
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"name": "all 256 Unicode code points",
|
|
168
|
-
"sessionName": "\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00",
|
|
169
|
-
"valid": true
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"name": "257 Unicode code points",
|
|
173
|
-
"sessionName": "\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00\ud83d\ude00",
|
|
174
|
-
"valid": false
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
"name": "Unicode display with separators",
|
|
178
|
-
"sessionName": "\u4e2d\u6587:my_session-1.\u6b22\u8fce",
|
|
179
|
-
"valid": true
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"name": "preserved surrounding spaces",
|
|
183
|
-
"sessionName": " caller name ",
|
|
184
|
-
"valid": true
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"name": "C1 control suffix",
|
|
188
|
-
"sessionName": "name\u009f",
|
|
189
|
-
"valid": false
|
|
190
|
-
}
|
|
191
|
-
]
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ContextEnvelope, type ResolvedExecutionPlan, type RuntimeLimits } from "@mininglamp-oss/octo-runtime-protocol";
|
|
2
|
-
export declare function assertLocalContext(context: unknown): asserts context is ContextEnvelope;
|
|
3
|
-
/**
|
|
4
|
-
* 合并执行默认值与本轮提交,校验后生成 Provider 无关的执行计划;不扫描宿主文件或准备目录。
|
|
5
|
-
* defaults 仅允许执行/安全配置,业务历史由调用方单独传入,不能变为所有调用的隐式默认。
|
|
6
|
-
*/
|
|
7
|
-
export declare function resolveLocalContext(defaults: ContextEnvelope, submitted: ContextEnvelope, agentSource: "preset" | "provisioned"): {
|
|
8
|
-
effectiveContext: ContextEnvelope;
|
|
9
|
-
resolvedExecutionPlan: ResolvedExecutionPlan;
|
|
10
|
-
};
|
|
11
|
-
/** 将 Context 的 wire 字段映射为 Core 限制;未知键拒绝,避免配置看似生效却被静默忽略。 */
|
|
12
|
-
export declare function localRuntimeLimits(plan: ResolvedExecutionPlan): RuntimeLimits | undefined;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { isAbsolute } from "node:path";
|
|
2
|
-
import { assertAgentSource, assertContextEnvelope, assertResolvedExecutionPlan, assertRuntimeLimits, contextItem, findContextTypeDefinition, mergeContext } from "@mininglamp-oss/octo-runtime-protocol";
|
|
3
|
-
const LIMIT_NAMES = {
|
|
4
|
-
first_frame_timeout_ms: "firstFrameTimeoutMs",
|
|
5
|
-
model_idle_timeout_ms: "modelIdleTimeoutMs",
|
|
6
|
-
model_idle_warning_ms: "modelIdleWarningMs",
|
|
7
|
-
model_idle_policy: "modelIdlePolicy",
|
|
8
|
-
tool_timeout_ms: "toolTimeoutMs",
|
|
9
|
-
tool_wall_timeout_ms: "toolWallTimeoutMs",
|
|
10
|
-
run_timeout_ms: "runTimeoutMs",
|
|
11
|
-
cancel_grace_ms: "cancelGraceMs",
|
|
12
|
-
enforcement: "enforcement"
|
|
13
|
-
};
|
|
14
|
-
export function assertLocalContext(context) {
|
|
15
|
-
assertContextEnvelope(context);
|
|
16
|
-
for (const item of context.items) {
|
|
17
|
-
if (!findContextTypeDefinition(item.namespace, item.name))
|
|
18
|
-
continue;
|
|
19
|
-
if (item.namespace === "octo.execution" ||
|
|
20
|
-
item.namespace === "octo.content" ||
|
|
21
|
-
(item.namespace === "octo.security" && item.name === "approval_policy"))
|
|
22
|
-
continue;
|
|
23
|
-
throw new TypeError(`LOCAL_CONTEXT_TYPE_UNSUPPORTED: ${item.namespace}/${item.name}`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* 合并执行默认值与本轮提交,校验后生成 Provider 无关的执行计划;不扫描宿主文件或准备目录。
|
|
28
|
-
* defaults 仅允许执行/安全配置,业务历史由调用方单独传入,不能变为所有调用的隐式默认。
|
|
29
|
-
*/
|
|
30
|
-
export function resolveLocalContext(defaults, submitted, agentSource) {
|
|
31
|
-
assertAgentSource(agentSource);
|
|
32
|
-
assertLocalContext(defaults);
|
|
33
|
-
assertLocalContext(submitted);
|
|
34
|
-
if (defaults.items.some((item) => item.namespace !== "octo.execution" && item.namespace !== "octo.security"))
|
|
35
|
-
throw new TypeError("CONTEXT_CONFIGURATION_TYPE_FORBIDDEN");
|
|
36
|
-
let effectiveContext = mergeContext(defaults, submitted);
|
|
37
|
-
if (!contextItem(effectiveContext, "octo.security", "approval_policy")) {
|
|
38
|
-
effectiveContext = mergeContext(effectiveContext, {
|
|
39
|
-
schema: effectiveContext.schema,
|
|
40
|
-
items: [{ namespace: "octo.security", name: "approval_policy", payload: { mode: "ask" } }]
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
const adapterPayload = contextItem(effectiveContext, "octo.execution", "adapter")?.payload;
|
|
44
|
-
const adapter = adapterPayload?.type;
|
|
45
|
-
const workspace = contextItem(effectiveContext, "octo.execution", "workspace")?.payload;
|
|
46
|
-
const workdir = workspace?.path ?? "";
|
|
47
|
-
if (typeof adapter !== "string" || !adapter)
|
|
48
|
-
throw new TypeError("LOCAL_ADAPTER_CONTEXT_REQUIRED");
|
|
49
|
-
if ((agentSource !== "preset" || workdir) &&
|
|
50
|
-
(typeof workdir !== "string" || !isAbsolute(workdir)))
|
|
51
|
-
throw new TypeError("LOCAL_ABSOLUTE_WORKSPACE_REQUIRED");
|
|
52
|
-
const choices = contextItem(effectiveContext, "octo.execution", "model")?.payload;
|
|
53
|
-
const model = choices?.selection?.id;
|
|
54
|
-
const effort = choices?.reasoning?.effort;
|
|
55
|
-
const actmode = contextItem(effectiveContext, "octo.execution", "actmode")?.payload.mode;
|
|
56
|
-
const limits = contextItem(effectiveContext, "octo.execution", "limits")?.payload;
|
|
57
|
-
const envs = contextItem(effectiveContext, "octo.execution", "envs")?.payload;
|
|
58
|
-
const mcp = contextItem(effectiveContext, "octo.execution", "mcp")?.payload;
|
|
59
|
-
const plan = {
|
|
60
|
-
agent_source: agentSource,
|
|
61
|
-
adapter_type: adapter,
|
|
62
|
-
...(workspace ? { workspace } : {}),
|
|
63
|
-
...(adapter === "openclaw" ? { provider_agent_id: adapterPayload?.provider_agent_id } : {}),
|
|
64
|
-
workdir,
|
|
65
|
-
approval_mode: contextItem(effectiveContext, "octo.security", "approval_policy").payload.mode,
|
|
66
|
-
...(typeof model === "string" ? { model } : {}),
|
|
67
|
-
...(typeof effort === "string" ? { effort } : {}),
|
|
68
|
-
...(actmode !== undefined ? { actmode } : {}),
|
|
69
|
-
...(limits ? { runtime_limits: structuredClone(limits) } : {}),
|
|
70
|
-
...(envs ? { envs: structuredClone(envs) } : {}),
|
|
71
|
-
...(mcp ? { mcp: structuredClone(mcp) } : {})
|
|
72
|
-
};
|
|
73
|
-
assertResolvedExecutionPlan(plan);
|
|
74
|
-
localRuntimeLimits(plan);
|
|
75
|
-
return { effectiveContext, resolvedExecutionPlan: plan };
|
|
76
|
-
}
|
|
77
|
-
/** 将 Context 的 wire 字段映射为 Core 限制;未知键拒绝,避免配置看似生效却被静默忽略。 */
|
|
78
|
-
export function localRuntimeLimits(plan) {
|
|
79
|
-
if (!plan.runtime_limits)
|
|
80
|
-
return undefined;
|
|
81
|
-
const limits = {};
|
|
82
|
-
for (const [name, value] of Object.entries(plan.runtime_limits)) {
|
|
83
|
-
if (!Object.hasOwn(LIMIT_NAMES, name))
|
|
84
|
-
throw new TypeError("LOCAL_RUNTIME_LIMIT_UNSUPPORTED");
|
|
85
|
-
limits[LIMIT_NAMES[name]] = value;
|
|
86
|
-
}
|
|
87
|
-
assertRuntimeLimits(limits);
|
|
88
|
-
return limits;
|
|
89
|
-
}
|
package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/execution-preparation.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type ResolvedExecutionPlan } from "@mininglamp-oss/octo-runtime-protocol";
|
|
2
|
-
export interface WorkspaceAssignments {
|
|
3
|
-
conversationWorkspace(key: string, candidate: string): {
|
|
4
|
-
path: string;
|
|
5
|
-
created: boolean;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export interface WorkspacePreparationReceipt {
|
|
9
|
-
workspace_mode: "fixed" | "random" | "none";
|
|
10
|
-
workspace_path: string;
|
|
11
|
-
provider_state_dir: string;
|
|
12
|
-
warnings: string[];
|
|
13
|
-
}
|
|
14
|
-
export interface PreparedRunContext {
|
|
15
|
-
workdir: string;
|
|
16
|
-
providerStateDir: string;
|
|
17
|
-
receipt: WorkspacePreparationReceipt;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* 按冻结计划准备实际工作区、Provider 状态目录。
|
|
21
|
-
* random 在 Agent Session 首次运行时创建工作区,后续运行复用;已分配目录丢失时拒绝续接。
|
|
22
|
-
* 返回的路径属于 Runtime 私有视图;本地准备完成不表示 Worker 已确认或 Provider 已应用。
|
|
23
|
-
*/
|
|
24
|
-
export declare function prepareRunContext(plan: ResolvedExecutionPlan, options: {
|
|
25
|
-
stateRoot: string;
|
|
26
|
-
agentSessionId: string;
|
|
27
|
-
agentId: string;
|
|
28
|
-
store: WorkspaceAssignments;
|
|
29
|
-
signal?: AbortSignal;
|
|
30
|
-
registerCleanup?: (path: string) => void;
|
|
31
|
-
workspaceRoot?: string;
|
|
32
|
-
workspace?: boolean;
|
|
33
|
-
}): Promise<PreparedRunContext>;
|
package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/execution-preparation.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
-
import { lstat, mkdir, realpath } from "node:fs/promises";
|
|
3
|
-
import { homedir } from "node:os";
|
|
4
|
-
import { dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
5
|
-
import { assertResolvedExecutionPlan } from "@mininglamp-oss/octo-runtime-protocol";
|
|
6
|
-
/**
|
|
7
|
-
* 按冻结计划准备实际工作区、Provider 状态目录。
|
|
8
|
-
* random 在 Agent Session 首次运行时创建工作区,后续运行复用;已分配目录丢失时拒绝续接。
|
|
9
|
-
* 返回的路径属于 Runtime 私有视图;本地准备完成不表示 Worker 已确认或 Provider 已应用。
|
|
10
|
-
*/
|
|
11
|
-
export async function prepareRunContext(plan, options) {
|
|
12
|
-
assertResolvedExecutionPlan(plan);
|
|
13
|
-
options.signal?.throwIfAborted();
|
|
14
|
-
if (options.workspace === false) {
|
|
15
|
-
return {
|
|
16
|
-
workdir: plan.workdir,
|
|
17
|
-
providerStateDir: "",
|
|
18
|
-
receipt: {
|
|
19
|
-
workspace_mode: "none",
|
|
20
|
-
workspace_path: "",
|
|
21
|
-
provider_state_dir: "",
|
|
22
|
-
warnings: plan.workspace?.mode === "none" || (!plan.workspace && !plan.workdir)
|
|
23
|
-
? []
|
|
24
|
-
: ["CONTEXT_WORKSPACE_IGNORED"]
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
const stateRoot = await privateDirectory(options.stateRoot);
|
|
29
|
-
const workspace = plan.workspace ??
|
|
30
|
-
(plan.agent_source === "preset" && !plan.workdir
|
|
31
|
-
? { mode: "none" }
|
|
32
|
-
: { mode: "fixed", path: plan.workdir });
|
|
33
|
-
let workdir;
|
|
34
|
-
if (workspace.mode === "none") {
|
|
35
|
-
if (plan.agent_source !== "preset" || plan.workdir)
|
|
36
|
-
throw new TypeError("CONTEXT_WORKSPACE_INVALID");
|
|
37
|
-
return {
|
|
38
|
-
workdir: "",
|
|
39
|
-
providerStateDir: "",
|
|
40
|
-
receipt: { workspace_mode: "none", workspace_path: "", provider_state_dir: "", warnings: [] }
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
if (workspace.mode === "random") {
|
|
44
|
-
const workspaces = await privateDirectory(options.workspaceRoot ?? join(homedir(), "OctoWork"));
|
|
45
|
-
const proposed = join(workspaces, `agent-${randomUUID()}`, "workdir");
|
|
46
|
-
const chosen = options.store.conversationWorkspace(options.agentSessionId, proposed);
|
|
47
|
-
if (chosen.created) {
|
|
48
|
-
await privateDirectory(dirname(chosen.path));
|
|
49
|
-
await mkdir(chosen.path, { mode: 0o700 });
|
|
50
|
-
}
|
|
51
|
-
// 续接必须保留原工作区事实;目录丢失时失败,不能静默创建同路径的空目录。
|
|
52
|
-
workdir = await realDirectory(chosen.path);
|
|
53
|
-
// Previously allocated session directories remain valid; never relocate a live session.
|
|
54
|
-
const legacyRoot = join(stateRoot, "workspaces");
|
|
55
|
-
inside(workdir.startsWith(legacyRoot + sep) ? legacyRoot : workspaces, workdir);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
if (!isAbsolute(workspace.path))
|
|
59
|
-
throw new TypeError("CONTEXT_WORKSPACE_INVALID");
|
|
60
|
-
await realDirectory(workspace.path);
|
|
61
|
-
// 保留请求中的固定路径写法,以便 Worker 按冻结合同比较。
|
|
62
|
-
workdir = workspace.path;
|
|
63
|
-
}
|
|
64
|
-
const scope = createHash("sha256").update(options.agentSessionId).digest("hex");
|
|
65
|
-
const providerStateDir = await privateDirectory(join(stateRoot, "providers", scope));
|
|
66
|
-
const prepared = {
|
|
67
|
-
workdir,
|
|
68
|
-
providerStateDir,
|
|
69
|
-
receipt: {
|
|
70
|
-
workspace_mode: workspace.mode,
|
|
71
|
-
workspace_path: workdir,
|
|
72
|
-
provider_state_dir: providerStateDir,
|
|
73
|
-
warnings: []
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
options.signal?.throwIfAborted();
|
|
77
|
-
return prepared;
|
|
78
|
-
}
|
|
79
|
-
async function privateDirectory(path) {
|
|
80
|
-
await mkdir(path, { recursive: true, mode: 0o700 });
|
|
81
|
-
return realDirectory(path);
|
|
82
|
-
}
|
|
83
|
-
async function realDirectory(path) {
|
|
84
|
-
const info = await lstat(path);
|
|
85
|
-
if (!info.isDirectory() || info.isSymbolicLink())
|
|
86
|
-
throw new TypeError("CONTEXT_DIRECTORY_UNAVAILABLE");
|
|
87
|
-
return realpath(path);
|
|
88
|
-
}
|
|
89
|
-
function inside(root, path) {
|
|
90
|
-
const part = relative(root, path);
|
|
91
|
-
if (part === ".." || part.startsWith(".." + sep) || isAbsolute(part))
|
|
92
|
-
throw new TypeError("CONTEXT_PACKAGE_PATH_ESCAPE");
|
|
93
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { assertContextEnvelope, assertContextEnvs, assertResolvedExecutionPlan } from "./context.js";
|
|
2
|
-
function executionValues(context) {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (const item of [...context.items].sort((a, b) => `${a.namespace}/${a.name}` < `${b.namespace}/${b.name}`
|
|
5
|
-
? -1
|
|
6
|
-
: `${a.namespace}/${a.name}` > `${b.namespace}/${b.name}`
|
|
7
|
-
? 1
|
|
8
|
-
: 0)) {
|
|
9
|
-
if (item.namespace === "octo.execution" &&
|
|
10
|
-
["adapter", "workspace", "limits", "envs", "mcp", "actmode"].includes(item.name))
|
|
11
|
-
result[item.name] = item.payload;
|
|
12
|
-
if (item.namespace === "octo.security" && item.name === "approval_policy")
|
|
13
|
-
result.approval_policy = item.payload;
|
|
14
|
-
if (item.namespace === "octo.runtime" && item.name === "selection")
|
|
15
|
-
result.runtime = item.payload;
|
|
16
|
-
if (item.namespace === "octo.execution" && item.name === "model") {
|
|
17
|
-
if (isObject(item.payload.selection))
|
|
18
|
-
result.model = item.payload.selection;
|
|
19
|
-
if (isObject(item.payload.reasoning))
|
|
20
|
-
result.reasoning = item.payload.reasoning;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
/** 验证有效 Context 与冻结执行计划逐项一致;不匹配时禁止进入资源准备。 */
|
|
26
|
-
export function assertFrozenContextPlan(context, plan) {
|
|
27
|
-
assertContextEnvelope(context);
|
|
28
|
-
assertResolvedExecutionPlan(plan);
|
|
29
|
-
const execution = executionValues(context);
|
|
30
|
-
const match = (field, property, actual) => {
|
|
31
|
-
if (execution[field]?.[property] !== actual)
|
|
32
|
-
throw new TypeError("CONTEXT_PLAN_MISMATCH");
|
|
33
|
-
};
|
|
34
|
-
match("adapter", "type", plan.adapter_type);
|
|
35
|
-
match("adapter", "provider_agent_id", plan.provider_agent_id);
|
|
36
|
-
const workspace = execution.workspace;
|
|
37
|
-
if (!workspace)
|
|
38
|
-
throw new TypeError("CONTEXT_PLAN_MISMATCH");
|
|
39
|
-
if (workspace.mode === "fixed") {
|
|
40
|
-
match("workspace", "path", plan.workdir);
|
|
41
|
-
if (plan.workspace &&
|
|
42
|
-
(plan.workspace.mode !== "fixed" || plan.workspace.path !== workspace.path))
|
|
43
|
-
throw new TypeError("CONTEXT_PLAN_MISMATCH");
|
|
44
|
-
}
|
|
45
|
-
if (workspace.mode === "random" && (plan.workdir !== "" || plan.workspace?.mode !== "random"))
|
|
46
|
-
throw new TypeError("CONTEXT_PLAN_MISMATCH");
|
|
47
|
-
if (workspace.mode === "none" &&
|
|
48
|
-
(plan.agent_source !== "preset" || plan.workdir || plan.workspace?.mode !== "none"))
|
|
49
|
-
throw new TypeError("CONTEXT_PLAN_MISMATCH");
|
|
50
|
-
match("approval_policy", "mode", plan.approval_mode);
|
|
51
|
-
match("model", "id", plan.model);
|
|
52
|
-
match("reasoning", "effort", plan.effort);
|
|
53
|
-
match("actmode", "mode", plan.actmode);
|
|
54
|
-
const canonical = (value) => JSON.stringify(value, function (_key, child) {
|
|
55
|
-
return isObject(child)
|
|
56
|
-
? Object.fromEntries(Object.keys(child)
|
|
57
|
-
.sort()
|
|
58
|
-
.map((key) => [key, child[key]]))
|
|
59
|
-
: child;
|
|
60
|
-
});
|
|
61
|
-
if (canonical(execution.mcp ?? { mcpServers: {} }) !== canonical(plan.mcp ?? { mcpServers: {} }))
|
|
62
|
-
throw new TypeError("CONTEXT_PLAN_MISMATCH");
|
|
63
|
-
const envs = execution.envs ?? { env_variables: [] };
|
|
64
|
-
assertContextEnvs(envs);
|
|
65
|
-
const plannedEnvs = new Map((plan.envs?.env_variables ?? []).map((entry) => [entry.key, entry.value]));
|
|
66
|
-
if (envs.env_variables.length !== plannedEnvs.size ||
|
|
67
|
-
envs.env_variables.some((entry) => plannedEnvs.get(entry.key) !== entry.value))
|
|
68
|
-
throw new TypeError("CONTEXT_PLAN_MISMATCH");
|
|
69
|
-
const limits = execution.limits ?? {};
|
|
70
|
-
for (const property of new Set([
|
|
71
|
-
...Object.keys(limits),
|
|
72
|
-
...Object.keys(plan.runtime_limits ?? {})
|
|
73
|
-
])) {
|
|
74
|
-
if (limits[property] !== plan.runtime_limits?.[property])
|
|
75
|
-
throw new TypeError("CONTEXT_PLAN_MISMATCH");
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function isObject(value) {
|
|
79
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
80
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { assertContextEnvelope, contextItem } from "./context.js";
|
|
2
|
-
/** Sources are validated by the producer's authorization boundary, not by rendering. */
|
|
3
|
-
export function contextControlInstructions(context) {
|
|
4
|
-
assertContextEnvelope(context);
|
|
5
|
-
const entries = contextItem(context, "octo.control", "instructions")?.payload.entries;
|
|
6
|
-
return Array.isArray(entries)
|
|
7
|
-
? entries.map((entry) => entry.text).join("\n")
|
|
8
|
-
: "";
|
|
9
|
-
}
|
|
File without changes
|
|
File without changes
|