@malmhq/intermesh-cli 0.1.0
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/LICENSE +198 -0
- package/README.md +77 -0
- package/dist/generation/.opencode/AGENTS.md +38 -0
- package/dist/generation/.opencode/agents/generation-builder.md +9 -0
- package/dist/generation/.opencode/agents/generation-fidelity.md +9 -0
- package/dist/generation/.opencode/agents/generation-source.md +13 -0
- package/dist/generation/.opencode/prompts/analyze-capabilities.md +61 -0
- package/dist/generation/.opencode/prompts/analyze-source.md +41 -0
- package/dist/generation/.opencode/prompts/generate.md +9 -0
- package/dist/generation/.opencode/prompts/repair-capability-proposal.md +5 -0
- package/dist/generation/.opencode/skills/generation-building/SKILL.md +32 -0
- package/dist/generation/.opencode/skills/generation-package-review/SKILL.md +36 -0
- package/dist/generation/.opencode/skills/generation-source-analysis/SKILL.md +36 -0
- package/dist/generation/AGENTS.md +38 -0
- package/dist/generation/agent-skill-installer/index.ts +4 -0
- package/dist/generation/agent-skill-installer/install.ts +503 -0
- package/dist/generation/agent-skill-installer/lock.ts +128 -0
- package/dist/generation/agent-skill-installer/manifest.ts +271 -0
- package/dist/generation/agent-skill-installer/targets.ts +169 -0
- package/dist/generation/runtime-entrypoint.js +39980 -0
- package/dist/generation/scripts/check-package.mjs +45 -0
- package/dist/generation/scripts/installed-help.mjs +98 -0
- package/dist/generation/scripts/lead-input.mjs +584 -0
- package/dist/generation/scripts/prepare-opencode.mjs +33 -0
- package/dist/generation/scripts/prepared-work.mjs +197 -0
- package/dist/generation/scripts/repair-loop.mjs +519 -0
- package/dist/generation/scripts/run-reviewers.mjs +306 -0
- package/dist/generation/scripts/runtime-capture.mjs +119 -0
- package/dist/generation/scripts/stage-timings.mjs +53 -0
- package/dist/generation/scripts/validate-source-brief.mjs +220 -0
- package/dist/generation/scripts/verify-package.mjs +365 -0
- package/dist/generation/templates/npm-cli/CONTRIBUTING.md +20 -0
- package/dist/generation/templates/npm-cli/GENERATION-PATTERNS.md +143 -0
- package/dist/generation/templates/npm-cli/README.md +67 -0
- package/dist/generation/templates/npm-cli/capabilities.json +1 -0
- package/dist/generation/templates/npm-cli/mock/routes.ts +3 -0
- package/dist/generation/templates/npm-cli/mock/server.ts +15 -0
- package/dist/generation/templates/npm-cli/mock/types.ts +7 -0
- package/dist/generation/templates/npm-cli/package.json +36 -0
- package/dist/generation/templates/npm-cli/pnpm-lock.yaml +495 -0
- package/dist/generation/templates/npm-cli/pnpm-workspace.yaml +2 -0
- package/dist/generation/templates/npm-cli/skills/customer-cli-management/SKILL.md +22 -0
- package/dist/generation/templates/npm-cli/skills/customer-workflow/SKILL.md +22 -0
- package/dist/generation/templates/npm-cli/src/auth/commands.ts +77 -0
- package/dist/generation/templates/npm-cli/src/auth/credentials.ts +66 -0
- package/dist/generation/templates/npm-cli/src/auth/prompt.ts +27 -0
- package/dist/generation/templates/npm-cli/src/cli.ts +53 -0
- package/dist/generation/templates/npm-cli/src/commands.ts +6 -0
- package/dist/generation/templates/npm-cli/src/customer.ts +16 -0
- package/dist/generation/templates/npm-cli/src/index.ts +11 -0
- package/dist/generation/templates/npm-cli/src/lifecycle/commands.ts +344 -0
- package/dist/generation/templates/npm-cli/src/lifecycle/config.ts +32 -0
- package/dist/generation/templates/npm-cli/src/shared/dry-run.ts +32 -0
- package/dist/generation/templates/npm-cli/src/shared/errors.ts +162 -0
- package/dist/generation/templates/npm-cli/src/shared/files.ts +45 -0
- package/dist/generation/templates/npm-cli/src/shared/http.ts +125 -0
- package/dist/generation/templates/npm-cli/src/shared/output.ts +33 -0
- package/dist/generation/templates/npm-cli/test/auth.test.ts +113 -0
- package/dist/generation/templates/npm-cli/test/fixture-cli.ts +51 -0
- package/dist/generation/templates/npm-cli/test/foundation.test.ts +316 -0
- package/dist/generation/templates/npm-cli/test/helpers.ts +34 -0
- package/dist/generation/templates/npm-cli/test/mock-lifecycle.test.ts +86 -0
- package/dist/generation/templates/npm-cli/test/run-with-mock.ts +142 -0
- package/dist/generation/templates/npm-cli/tsconfig.build.json +5 -0
- package/dist/generation/templates/npm-cli/tsconfig.json +11 -0
- package/dist/generation/templates/opencode-bootstrap/package-lock.json +402 -0
- package/dist/generation/templates/opencode-bootstrap/package.json +7 -0
- package/dist/index.js +51965 -0
- package/dist/runtime/candidate-inspection/inspect.Dockerfile +4 -0
- package/dist/runtime/candidate-inspection/install.Dockerfile +5 -0
- package/dist/runtime/candidate-inspection/registry-proxy.mjs +37 -0
- package/dist/runtime/harbor/bootstrap/package-lock.json +402 -0
- package/dist/runtime/harbor/bootstrap/package.json +7 -0
- package/dist/runtime/harbor/evaluation.Dockerfile +31 -0
- package/dist/runtime/harbor/harbor_launcher.py +62 -0
- package/dist/runtime/harbor/intermesh_opencode.py +44 -0
- package/dist/runtime/harbor/model-forwarder.mjs +52 -0
- package/dist/runtime/live-task.md +13 -0
- package/package.json +44 -0
- package/skills/inter-cli-management/SKILL.md +38 -0
- package/skills/inter-cli-management/evals/evals.json +40 -0
- package/skills/inter-context/SKILL.md +72 -0
- package/skills/inter-context/evals/cases.json +82 -0
- package/skills/inter-eval-authoring/SKILL.md +70 -0
- package/skills/inter-eval-authoring/evals/evals.json +69 -0
- package/skills/inter-eval-authoring/evals/trigger-queries.json +34 -0
- package/skills/inter-eval-authoring/references/authoring-guide.md +70 -0
- package/skills/inter-eval-authoring/references/eval-plan.example.json +92 -0
- package/skills/inter-eval-authoring/references/eval-plan.schema.json +304 -0
- package/skills/inter-evaluation/SKILL.md +51 -0
- package/skills/inter-evaluation/evals/evals.json +49 -0
- package/skills/inter-evaluation/evals/trigger-queries.json +30 -0
- package/skills/inter-generation/SKILL.md +42 -0
- package/skills/inter-generation/evals/evals.json +81 -0
- package/skills/inter-generation/evals/trigger-queries.json +58 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
import { request } from 'node:https';
|
|
3
|
+
|
|
4
|
+
const maximumBytes = 64 * 1024 * 1024;
|
|
5
|
+
createServer((incoming, response) => {
|
|
6
|
+
if (!['GET', 'HEAD'].includes(incoming.method ?? '') || incoming.headers.authorization) {
|
|
7
|
+
response.writeHead(403).end();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const target = new URL(incoming.url ?? '/', 'https://registry.npmjs.org');
|
|
11
|
+
if (target.origin !== 'https://registry.npmjs.org') {
|
|
12
|
+
response.writeHead(403).end();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const outgoing = request(
|
|
16
|
+
target,
|
|
17
|
+
{ method: incoming.method, headers: { accept: incoming.headers.accept ?? '*/*' } },
|
|
18
|
+
(upstream) => {
|
|
19
|
+
if ((upstream.statusCode ?? 500) >= 300 && (upstream.statusCode ?? 500) < 400) {
|
|
20
|
+
upstream.resume();
|
|
21
|
+
response.writeHead(502).end();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
let bytes = 0;
|
|
25
|
+
response.writeHead(upstream.statusCode ?? 502, upstream.headers);
|
|
26
|
+
upstream.on('data', (chunk) => {
|
|
27
|
+
bytes += chunk.length;
|
|
28
|
+
if (bytes > maximumBytes) upstream.destroy(new Error('response too large'));
|
|
29
|
+
else response.write(chunk);
|
|
30
|
+
});
|
|
31
|
+
upstream.on('end', () => response.end());
|
|
32
|
+
upstream.on('error', () => response.destroy());
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
outgoing.on('error', () => response.writeHead(502).end());
|
|
36
|
+
outgoing.end();
|
|
37
|
+
}).listen(Number(process.env.PORT ?? '4873'), '0.0.0.0');
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "intermesh-opencode-bootstrap",
|
|
3
|
+
"lockfileVersion": 3,
|
|
4
|
+
"requires": true,
|
|
5
|
+
"packages": {
|
|
6
|
+
"": {
|
|
7
|
+
"name": "intermesh-opencode-bootstrap",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@opencode-ai/plugin": "1.18.25"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"node_modules/@ai-sdk/provider": {
|
|
13
|
+
"version": "3.0.8",
|
|
14
|
+
"resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.8.tgz",
|
|
15
|
+
"integrity": "sha512-oGMAgGoQdBXbZqNG0Ze56CHjDZ1IDYOwGYxYjO5KLSlz5HiNQ9udIXsPZ61VWaHGZ5XW/jyjmr6t2xz2jGVwbQ==",
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"json-schema": "^0.4.0"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": {
|
|
25
|
+
"version": "3.0.4",
|
|
26
|
+
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.4.tgz",
|
|
27
|
+
"integrity": "sha512-LCkGo6JDfaBhgST7UpPWgNgLINpcpabaHfyz5OBx75nUYxBsaEPxjnyNjWpeb/xBup/682QnBfRBy2/LvPutZQ==",
|
|
28
|
+
"cpu": [
|
|
29
|
+
"arm64"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"optional": true,
|
|
33
|
+
"os": [
|
|
34
|
+
"darwin"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": {
|
|
38
|
+
"version": "3.0.4",
|
|
39
|
+
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.4.tgz",
|
|
40
|
+
"integrity": "sha512-zExlW9zUJKZH/tOtVMttwjKa4Xm/3KcNjnE3dPN92uCktwavMxpgCA3MoJK/DOnTWsQgo224OaST27/mPNAf+w==",
|
|
41
|
+
"cpu": [
|
|
42
|
+
"x64"
|
|
43
|
+
],
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"optional": true,
|
|
46
|
+
"os": [
|
|
47
|
+
"darwin"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": {
|
|
51
|
+
"version": "3.0.4",
|
|
52
|
+
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.4.tgz",
|
|
53
|
+
"integrity": "sha512-Tg3yX65f5GbtXLkrYEHE5oibZG9epyYWas7FogTTEJeDEF9JlXJzKgXaNhT3UXlTOeA+AfZpYZYZ0uPj7Cfquw==",
|
|
54
|
+
"cpu": [
|
|
55
|
+
"arm"
|
|
56
|
+
],
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"optional": true,
|
|
59
|
+
"os": [
|
|
60
|
+
"linux"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": {
|
|
64
|
+
"version": "3.0.4",
|
|
65
|
+
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.4.tgz",
|
|
66
|
+
"integrity": "sha512-dgX0P/9wGPJeHFBG+ZmhgE6bmtMt7NP5CRBGyyktpopdk/mW4POnrpQsSLtKI1dwpc+pPLuXHDh6vvskyQE/sw==",
|
|
67
|
+
"cpu": [
|
|
68
|
+
"arm64"
|
|
69
|
+
],
|
|
70
|
+
"license": "MIT",
|
|
71
|
+
"optional": true,
|
|
72
|
+
"os": [
|
|
73
|
+
"linux"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": {
|
|
77
|
+
"version": "3.0.4",
|
|
78
|
+
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.4.tgz",
|
|
79
|
+
"integrity": "sha512-8TNXMEjJc3QEy7R/x1INhgiU+XakDAFUzBhaz7+Rbrs8NH5UQeHQxxmzsSBJGyV6I1jW79undiQm8tOI+D+8FQ==",
|
|
80
|
+
"cpu": [
|
|
81
|
+
"x64"
|
|
82
|
+
],
|
|
83
|
+
"license": "MIT",
|
|
84
|
+
"optional": true,
|
|
85
|
+
"os": [
|
|
86
|
+
"linux"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": {
|
|
90
|
+
"version": "3.0.4",
|
|
91
|
+
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.4.tgz",
|
|
92
|
+
"integrity": "sha512-CmCXPQrkbwExx3j946/PtHWHbYJiCRBRDl4BlkRQcJB/YOwQxJRTpoo7aTsortjgoJ1x7opzTSxn7C+ASSLVjQ==",
|
|
93
|
+
"cpu": [
|
|
94
|
+
"x64"
|
|
95
|
+
],
|
|
96
|
+
"license": "MIT",
|
|
97
|
+
"optional": true,
|
|
98
|
+
"os": [
|
|
99
|
+
"win32"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"node_modules/@opencode-ai/plugin": {
|
|
103
|
+
"version": "1.18.25",
|
|
104
|
+
"resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.18.25.tgz",
|
|
105
|
+
"integrity": "sha512-Kb34zFqYosFNiMd1IuYiZGjX17z+18Srm7tHZMCz+uMVRTYNkEw1FTrfAK2FLbggwYdgzifGwKMNF1slLT8eLw==",
|
|
106
|
+
"license": "MIT",
|
|
107
|
+
"dependencies": {
|
|
108
|
+
"@ai-sdk/provider": "3.0.8",
|
|
109
|
+
"@opencode-ai/sdk": "1.18.25",
|
|
110
|
+
"effect": "4.0.0-beta.83",
|
|
111
|
+
"zod": "4.1.8"
|
|
112
|
+
},
|
|
113
|
+
"peerDependencies": {
|
|
114
|
+
"@opentui/core": ">=0.4.5",
|
|
115
|
+
"@opentui/keymap": ">=0.4.5",
|
|
116
|
+
"@opentui/solid": ">=0.4.5"
|
|
117
|
+
},
|
|
118
|
+
"peerDependenciesMeta": {
|
|
119
|
+
"@opentui/core": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
122
|
+
"@opentui/keymap": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"@opentui/solid": {
|
|
126
|
+
"optional": true
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"node_modules/@opencode-ai/sdk": {
|
|
131
|
+
"version": "1.18.25",
|
|
132
|
+
"resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.18.25.tgz",
|
|
133
|
+
"integrity": "sha512-GwgwhW+vE8FWSDw730SjzqNhsWXB0uJjbFOiqFkmM+USFuG13HuTlGe6SR2ixt+WXxoD6FV1hILWqsXyqej9hQ==",
|
|
134
|
+
"license": "MIT",
|
|
135
|
+
"dependencies": {
|
|
136
|
+
"cross-spawn": "7.0.6"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"node_modules/@standard-schema/spec": {
|
|
140
|
+
"version": "1.1.0",
|
|
141
|
+
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
|
|
142
|
+
"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
|
|
143
|
+
"license": "MIT"
|
|
144
|
+
},
|
|
145
|
+
"node_modules/cross-spawn": {
|
|
146
|
+
"version": "7.0.6",
|
|
147
|
+
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
|
148
|
+
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
|
149
|
+
"license": "MIT",
|
|
150
|
+
"dependencies": {
|
|
151
|
+
"path-key": "^3.1.0",
|
|
152
|
+
"shebang-command": "^2.0.0",
|
|
153
|
+
"which": "^2.0.1"
|
|
154
|
+
},
|
|
155
|
+
"engines": {
|
|
156
|
+
"node": ">= 8"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"node_modules/detect-libc": {
|
|
160
|
+
"version": "2.1.2",
|
|
161
|
+
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
|
162
|
+
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
|
163
|
+
"license": "Apache-2.0",
|
|
164
|
+
"optional": true,
|
|
165
|
+
"engines": {
|
|
166
|
+
"node": ">=8"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"node_modules/effect": {
|
|
170
|
+
"version": "4.0.0-beta.83",
|
|
171
|
+
"resolved": "https://registry.npmjs.org/effect/-/effect-4.0.0-beta.83.tgz",
|
|
172
|
+
"integrity": "sha512-0wsak8RtgGAr9UWSbVDgJHZcUqMSvicHcvaZv1MbMM7MCGgW4Rn/137J1MHQbwYPcwYGxT/IqehFd+UbYuj78w==",
|
|
173
|
+
"license": "MIT",
|
|
174
|
+
"dependencies": {
|
|
175
|
+
"@standard-schema/spec": "^1.1.0",
|
|
176
|
+
"fast-check": "^4.8.0",
|
|
177
|
+
"find-my-way-ts": "^0.1.6",
|
|
178
|
+
"ini": "^7.0.0",
|
|
179
|
+
"kubernetes-types": "^1.30.0",
|
|
180
|
+
"msgpackr": "^2.0.1",
|
|
181
|
+
"multipasta": "^0.2.7",
|
|
182
|
+
"toml": "^4.1.1",
|
|
183
|
+
"uuid": "^14.0.0",
|
|
184
|
+
"yaml": "^2.9.0"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"node_modules/fast-check": {
|
|
188
|
+
"version": "4.9.0",
|
|
189
|
+
"resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.9.0.tgz",
|
|
190
|
+
"integrity": "sha512-7ms6T7SybUev/PQITciI0yLM2pOSFy5zpG8Ty7tQofcVaQUvrMXp6CBwqF6fThLCLOrfBtuHAtwq6Yu4XPCllg==",
|
|
191
|
+
"funding": [
|
|
192
|
+
{
|
|
193
|
+
"type": "individual",
|
|
194
|
+
"url": "https://github.com/sponsors/dubzzz"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"type": "opencollective",
|
|
198
|
+
"url": "https://opencollective.com/fast-check"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"license": "MIT",
|
|
202
|
+
"dependencies": {
|
|
203
|
+
"pure-rand": "^8.0.0"
|
|
204
|
+
},
|
|
205
|
+
"engines": {
|
|
206
|
+
"node": ">=12.17.0"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"node_modules/find-my-way-ts": {
|
|
210
|
+
"version": "0.1.6",
|
|
211
|
+
"resolved": "https://registry.npmjs.org/find-my-way-ts/-/find-my-way-ts-0.1.6.tgz",
|
|
212
|
+
"integrity": "sha512-a85L9ZoXtNAey3Y6Z+eBWW658kO/MwR7zIafkIUPUMf3isZG0NCs2pjW2wtjxAKuJPxMAsHUIP4ZPGv0o5gyTA==",
|
|
213
|
+
"license": "MIT"
|
|
214
|
+
},
|
|
215
|
+
"node_modules/ini": {
|
|
216
|
+
"version": "7.0.0",
|
|
217
|
+
"resolved": "https://registry.npmjs.org/ini/-/ini-7.0.0.tgz",
|
|
218
|
+
"integrity": "sha512-ifK0CgjALofS5bkrcTy4RaQ9Vx2Knf/eLeIO+NaswQEpH1UblrtTSCIvN71qQDMq0PeQ/SSPojvEJp9vvvfr+w==",
|
|
219
|
+
"license": "ISC",
|
|
220
|
+
"engines": {
|
|
221
|
+
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"node_modules/isexe": {
|
|
225
|
+
"version": "2.0.0",
|
|
226
|
+
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
|
227
|
+
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
|
228
|
+
"license": "ISC"
|
|
229
|
+
},
|
|
230
|
+
"node_modules/json-schema": {
|
|
231
|
+
"version": "0.4.0",
|
|
232
|
+
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
|
|
233
|
+
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
|
|
234
|
+
"license": "(AFL-2.1 OR BSD-3-Clause)"
|
|
235
|
+
},
|
|
236
|
+
"node_modules/kubernetes-types": {
|
|
237
|
+
"version": "1.30.0",
|
|
238
|
+
"resolved": "https://registry.npmjs.org/kubernetes-types/-/kubernetes-types-1.30.0.tgz",
|
|
239
|
+
"integrity": "sha512-Dew1okvhM/SQcIa2rcgujNndZwU8VnSapDgdxlYoB84ZlpAD43U6KLAFqYo17ykSFGHNPrg0qry0bP+GJd9v7Q==",
|
|
240
|
+
"license": "Apache-2.0"
|
|
241
|
+
},
|
|
242
|
+
"node_modules/msgpackr": {
|
|
243
|
+
"version": "2.1.0",
|
|
244
|
+
"resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-2.1.0.tgz",
|
|
245
|
+
"integrity": "sha512-p/pBCVO63CsvvpkomUnNNag6+n38rULuDA6HHe70o2gtC8ODI52foF/4ko2qQcp6OiErJXTmrZeXmsGGHsIQNQ==",
|
|
246
|
+
"license": "MIT",
|
|
247
|
+
"optionalDependencies": {
|
|
248
|
+
"msgpackr-extract": "^3.0.4"
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"node_modules/msgpackr-extract": {
|
|
252
|
+
"version": "3.0.4",
|
|
253
|
+
"resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.4.tgz",
|
|
254
|
+
"integrity": "sha512-4kmO/MdyUIkLIvTPr8VHLil4AtoKIoniWPIEk5+CDy0xnWC84azhSFmuJ7PxZdsYtiP5kEeQsORAVIeMgxT+Hw==",
|
|
255
|
+
"hasInstallScript": true,
|
|
256
|
+
"license": "MIT",
|
|
257
|
+
"optional": true,
|
|
258
|
+
"dependencies": {
|
|
259
|
+
"node-gyp-build-optional-packages": "5.2.2"
|
|
260
|
+
},
|
|
261
|
+
"bin": {
|
|
262
|
+
"download-msgpackr-prebuilds": "bin/download-prebuilds.js"
|
|
263
|
+
},
|
|
264
|
+
"optionalDependencies": {
|
|
265
|
+
"@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.4",
|
|
266
|
+
"@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.4",
|
|
267
|
+
"@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.4",
|
|
268
|
+
"@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.4",
|
|
269
|
+
"@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.4",
|
|
270
|
+
"@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.4"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"node_modules/multipasta": {
|
|
274
|
+
"version": "0.2.8",
|
|
275
|
+
"resolved": "https://registry.npmjs.org/multipasta/-/multipasta-0.2.8.tgz",
|
|
276
|
+
"integrity": "sha512-ZPWuMKyv0cSO29f7hozp+k6+crZbQijV8ipMvxNxRf2SwtYGTX1ZX89Kd20VV4H9Znonx+EQn+iy1wGQsJ+b+Q==",
|
|
277
|
+
"license": "MIT"
|
|
278
|
+
},
|
|
279
|
+
"node_modules/node-gyp-build-optional-packages": {
|
|
280
|
+
"version": "5.2.2",
|
|
281
|
+
"resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz",
|
|
282
|
+
"integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==",
|
|
283
|
+
"license": "MIT",
|
|
284
|
+
"optional": true,
|
|
285
|
+
"dependencies": {
|
|
286
|
+
"detect-libc": "^2.0.1"
|
|
287
|
+
},
|
|
288
|
+
"bin": {
|
|
289
|
+
"node-gyp-build-optional-packages": "bin.js",
|
|
290
|
+
"node-gyp-build-optional-packages-optional": "optional.js",
|
|
291
|
+
"node-gyp-build-optional-packages-test": "build-test.js"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"node_modules/path-key": {
|
|
295
|
+
"version": "3.1.1",
|
|
296
|
+
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
|
297
|
+
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
|
298
|
+
"license": "MIT",
|
|
299
|
+
"engines": {
|
|
300
|
+
"node": ">=8"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"node_modules/pure-rand": {
|
|
304
|
+
"version": "8.4.2",
|
|
305
|
+
"resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-8.4.2.tgz",
|
|
306
|
+
"integrity": "sha512-vvuOGgcuPJAirlHvuQw1TrOiw7ptaIXXmIbNuiNOY6lNGJJH49PQ1Kj4nd783nPdQhQdicgOjVI2yI/9BD6/Ng==",
|
|
307
|
+
"funding": [
|
|
308
|
+
{
|
|
309
|
+
"type": "individual",
|
|
310
|
+
"url": "https://github.com/sponsors/dubzzz"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"type": "opencollective",
|
|
314
|
+
"url": "https://opencollective.com/fast-check"
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"license": "MIT"
|
|
318
|
+
},
|
|
319
|
+
"node_modules/shebang-command": {
|
|
320
|
+
"version": "2.0.0",
|
|
321
|
+
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
|
322
|
+
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
|
323
|
+
"license": "MIT",
|
|
324
|
+
"dependencies": {
|
|
325
|
+
"shebang-regex": "^3.0.0"
|
|
326
|
+
},
|
|
327
|
+
"engines": {
|
|
328
|
+
"node": ">=8"
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"node_modules/shebang-regex": {
|
|
332
|
+
"version": "3.0.0",
|
|
333
|
+
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
|
334
|
+
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
|
335
|
+
"license": "MIT",
|
|
336
|
+
"engines": {
|
|
337
|
+
"node": ">=8"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"node_modules/toml": {
|
|
341
|
+
"version": "4.3.0",
|
|
342
|
+
"resolved": "https://registry.npmjs.org/toml/-/toml-4.3.0.tgz",
|
|
343
|
+
"integrity": "sha512-lVb8X9BsPVuH0M4BKeS91tXAmJvCjQ5UIyAbQFaxkKGyUFK2RPkhwaFSQH8vbpl1d23eu/IBH+dwVMHWaq9A5A==",
|
|
344
|
+
"license": "MIT",
|
|
345
|
+
"engines": {
|
|
346
|
+
"node": ">=20"
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"node_modules/uuid": {
|
|
350
|
+
"version": "14.0.2",
|
|
351
|
+
"resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.2.tgz",
|
|
352
|
+
"integrity": "sha512-xZe/16rV4aa+HGSOCiY2YeLT1OybRLrrkL/Rqaq7p7GMVXjFh+6wN4oMYgjFmnSnhY8t6Xpdl2l9qmnHYuMHwQ==",
|
|
353
|
+
"funding": [
|
|
354
|
+
"https://github.com/sponsors/broofa",
|
|
355
|
+
"https://github.com/sponsors/ctavan"
|
|
356
|
+
],
|
|
357
|
+
"license": "MIT",
|
|
358
|
+
"bin": {
|
|
359
|
+
"uuid": "dist-node/bin/uuid"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"node_modules/which": {
|
|
363
|
+
"version": "2.0.2",
|
|
364
|
+
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
|
365
|
+
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
|
366
|
+
"license": "ISC",
|
|
367
|
+
"dependencies": {
|
|
368
|
+
"isexe": "^2.0.0"
|
|
369
|
+
},
|
|
370
|
+
"bin": {
|
|
371
|
+
"node-which": "bin/node-which"
|
|
372
|
+
},
|
|
373
|
+
"engines": {
|
|
374
|
+
"node": ">= 8"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"node_modules/yaml": {
|
|
378
|
+
"version": "2.9.0",
|
|
379
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
|
|
380
|
+
"integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
|
|
381
|
+
"license": "ISC",
|
|
382
|
+
"bin": {
|
|
383
|
+
"yaml": "bin.mjs"
|
|
384
|
+
},
|
|
385
|
+
"engines": {
|
|
386
|
+
"node": ">= 14.6"
|
|
387
|
+
},
|
|
388
|
+
"funding": {
|
|
389
|
+
"url": "https://github.com/sponsors/eemeli"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"node_modules/zod": {
|
|
393
|
+
"version": "4.1.8",
|
|
394
|
+
"resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz",
|
|
395
|
+
"integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==",
|
|
396
|
+
"license": "MIT",
|
|
397
|
+
"funding": {
|
|
398
|
+
"url": "https://github.com/sponsors/colinhacks"
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
FROM node:22.23.2-bookworm-slim@sha256:83f487e0a63425e5b4d146fb5e5be574bcbe1b7b843d3ebafdd95eaf7767a7e5
|
|
2
|
+
|
|
3
|
+
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git ripgrep \
|
|
4
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
5
|
+
&& npm install --global --ignore-scripts --no-audit --no-fund opencode-ai@1.18.25 \
|
|
6
|
+
&& cd "$(npm root --global)/opencode-ai" \
|
|
7
|
+
&& node postinstall.mjs \
|
|
8
|
+
&& test "$(opencode --version)" = 1.18.25
|
|
9
|
+
|
|
10
|
+
COPY candidate.tgz /opt/candidate/candidate.tgz
|
|
11
|
+
RUN cd /opt/candidate && npm install --ignore-scripts --omit=dev --no-audit --no-fund ./candidate.tgz \
|
|
12
|
+
&& chmod -R a-w /opt/candidate
|
|
13
|
+
|
|
14
|
+
COPY bootstrap/ /home/node/.config/opencode/
|
|
15
|
+
RUN cd /home/node/.config/opencode && npm ci --ignore-scripts --no-audit --no-fund \
|
|
16
|
+
&& mkdir -p /workspace/outputs /installed-agent /home/node/.cache \
|
|
17
|
+
&& chown -R node:node /workspace /home/node/.config
|
|
18
|
+
ARG CANDIDATE_PACKAGE
|
|
19
|
+
COPY candidate-skills/ /home/node/.config/opencode/skills/
|
|
20
|
+
RUN touch /home/node/.config/opencode/opencode.json
|
|
21
|
+
|
|
22
|
+
ENV PATH="/opt/candidate/node_modules/.bin:${PATH}"
|
|
23
|
+
ENV SHELL=/bin/bash
|
|
24
|
+
ENV XDG_DATA_HOME="/tmp/opencode/data"
|
|
25
|
+
ENV XDG_CACHE_HOME="/home/node/.cache"
|
|
26
|
+
ENV XDG_STATE_HOME="/tmp/opencode/state"
|
|
27
|
+
ENV XDG_CONFIG_HOME="/home/node/.config"
|
|
28
|
+
ENV OPENCODE_DISABLE_AUTOUPDATE=true
|
|
29
|
+
ENV OPENCODE_DISABLE_CLAUDE_CODE=true
|
|
30
|
+
USER node
|
|
31
|
+
WORKDIR /workspace/outputs
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import json
|
|
3
|
+
import signal
|
|
4
|
+
import sys
|
|
5
|
+
from importlib.metadata import version
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from harbor import Job
|
|
9
|
+
from harbor.models.job.config import JobConfig
|
|
10
|
+
from harbor.trial.hooks import TrialEvent
|
|
11
|
+
|
|
12
|
+
async def main():
|
|
13
|
+
"""Run one pinned Harbor job and retain trial mappings and progress without another scheduler."""
|
|
14
|
+
if version("harbor") != "0.22.0":
|
|
15
|
+
raise RuntimeError("Evaluation requires Harbor 0.22.0")
|
|
16
|
+
config = json.loads(Path(sys.argv[1]).read_text())
|
|
17
|
+
job_config = JobConfig.model_validate(config["job"])
|
|
18
|
+
job = await Job.create(job_config)
|
|
19
|
+
if config.get("mapping_path"):
|
|
20
|
+
counters = {}
|
|
21
|
+
slots = []
|
|
22
|
+
# The pinned Job creates all trial names before dispatch; keep this private API use here.
|
|
23
|
+
for trial in job._trial_configs:
|
|
24
|
+
task_path = str(trial.task.path)
|
|
25
|
+
counters[task_path] = counters.get(task_path, 0) + 1
|
|
26
|
+
slots.append({"task_path": task_path, "repetition": counters[task_path], "trial_name": trial.trial_name})
|
|
27
|
+
Path(config["mapping_path"]).write_text(json.dumps(slots) + "\n")
|
|
28
|
+
|
|
29
|
+
async def progress(event):
|
|
30
|
+
"""Persist lifecycle facts only; raw agent output stays in Harbor's evidence files."""
|
|
31
|
+
if not config.get("progress_path"):
|
|
32
|
+
return
|
|
33
|
+
record = {"event": event.event.value, "task_path": str(event.config.task.path), "trial_name": event.trial_name, "trial_id": str(event.trial_id), "timestamp": event.timestamp.isoformat()}
|
|
34
|
+
with Path(config["progress_path"]).open("a") as output:
|
|
35
|
+
output.write(json.dumps(record) + "\n")
|
|
36
|
+
output.flush()
|
|
37
|
+
print(json.dumps(record), flush=True)
|
|
38
|
+
failure = event.result.exception_info
|
|
39
|
+
if event.event == TrialEvent.END and failure and (
|
|
40
|
+
event.result.agent_execution is None
|
|
41
|
+
or failure.exception_type in {"EvaluationSafetyError", "AgentAuthenticationError", "ApiRateLimitError", "AgentSetupTimeoutError", "EnvironmentStartTimeoutError"}
|
|
42
|
+
):
|
|
43
|
+
Path(config["progress_path"]).with_name("stop-reason.json").write_text(
|
|
44
|
+
json.dumps({"stage": "safety" if failure.exception_type == "EvaluationSafetyError" else "infrastructure", "cause": failure.exception_type}) + "\n"
|
|
45
|
+
)
|
|
46
|
+
running.cancel()
|
|
47
|
+
|
|
48
|
+
for event in TrialEvent:
|
|
49
|
+
job.add_hook(event, progress)
|
|
50
|
+
running = asyncio.create_task(job.run())
|
|
51
|
+
loop = asyncio.get_running_loop()
|
|
52
|
+
for name in (signal.SIGINT, signal.SIGTERM):
|
|
53
|
+
loop.add_signal_handler(name, running.cancel)
|
|
54
|
+
try:
|
|
55
|
+
result = await running
|
|
56
|
+
Path(config["result_path"]).write_text(result.model_dump_json(indent=2) + "\n")
|
|
57
|
+
finally:
|
|
58
|
+
for name in (signal.SIGINT, signal.SIGTERM):
|
|
59
|
+
loop.remove_signal_handler(name)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
asyncio.run(main())
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
from harbor.agents.installed.opencode import OpenCode
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EvaluationSafetyError(RuntimeError):
|
|
9
|
+
"""A supplied credential appeared in streamed agent output."""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class IntermeshOpenCode(OpenCode):
|
|
13
|
+
async def run(self, instruction, environment, context):
|
|
14
|
+
"""Stop on observed credential leakage; missing or bypassed output is not proof of safety."""
|
|
15
|
+
keys = [os.environ.get("INTERMESH_MODEL_CREDENTIAL", ""),
|
|
16
|
+
os.environ.get(os.environ.get("INTERMESH_CUSTOMER_CREDENTIAL_NAME", ""), "")]
|
|
17
|
+
forms = {value for key in keys if key for value in
|
|
18
|
+
(key, json.dumps(key, ensure_ascii=False)[1:-1], quote(key, safe="~()*!.'-"))}
|
|
19
|
+
overlap = max(map(len, forms), default=1) - 1
|
|
20
|
+
tails = {}
|
|
21
|
+
|
|
22
|
+
async def check_output(text, stream):
|
|
23
|
+
"""Keep only enough overlap to detect credentials split between chunks."""
|
|
24
|
+
combined = tails.get(stream, "") + text
|
|
25
|
+
if any(value in combined for value in forms):
|
|
26
|
+
raise EvaluationSafetyError("Credential leakage detected in agent output")
|
|
27
|
+
tails[stream] = combined[-overlap:] if overlap else ""
|
|
28
|
+
|
|
29
|
+
with environment.scoped_output_callback(check_output):
|
|
30
|
+
await super().run(instruction, environment, context)
|
|
31
|
+
|
|
32
|
+
def _build_register_config_command(self):
|
|
33
|
+
"""Use the reviewed read-only config mounted by the task instead of rewriting the image."""
|
|
34
|
+
return None
|
|
35
|
+
|
|
36
|
+
async def install(self, environment):
|
|
37
|
+
"""Verify the pinned agent without copying its read-only configuration or Skills."""
|
|
38
|
+
result = await self.exec_as_agent(
|
|
39
|
+
environment,
|
|
40
|
+
command='node --version && opencode --version',
|
|
41
|
+
)
|
|
42
|
+
versions = (result.stdout or "").strip().splitlines()
|
|
43
|
+
if result.return_code != 0 or versions != ["v22.23.2", "1.18.25"]:
|
|
44
|
+
raise RuntimeError("Prepared evaluation image has unexpected Node/OpenCode versions")
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
import { Readable } from 'node:stream';
|
|
3
|
+
import { pipeline } from 'node:stream/promises';
|
|
4
|
+
|
|
5
|
+
const key = process.env.DEEPSEEK_API_KEY;
|
|
6
|
+
if (!key) throw new Error('Model forwarding credential is missing');
|
|
7
|
+
|
|
8
|
+
/** Forward only bounded requests for the approved model; never expose the provider key or proxy arbitrary URLs. */
|
|
9
|
+
async function forward(request, response) {
|
|
10
|
+
if (request.method !== 'POST' || request.url !== '/chat/completions') {
|
|
11
|
+
response.writeHead(403).end();
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const chunks = [];
|
|
15
|
+
let bytes = 0;
|
|
16
|
+
try {
|
|
17
|
+
for await (const chunk of request) {
|
|
18
|
+
bytes += chunk.length;
|
|
19
|
+
if (bytes > 4 * 1024 * 1024) {
|
|
20
|
+
response.writeHead(413).end();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
chunks.push(chunk);
|
|
24
|
+
}
|
|
25
|
+
const body = JSON.parse(Buffer.concat(chunks).toString('utf8'));
|
|
26
|
+
if (body.model !== 'deepseek-v4-pro') {
|
|
27
|
+
response.writeHead(403).end();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const controller = new AbortController();
|
|
31
|
+
response.once('close', () => controller.abort());
|
|
32
|
+
const upstream = await fetch('https://api.deepseek.com/chat/completions', {
|
|
33
|
+
method: 'POST',
|
|
34
|
+
headers: { authorization: `Bearer ${key}`, 'content-type': 'application/json' },
|
|
35
|
+
body: JSON.stringify(body),
|
|
36
|
+
signal: AbortSignal.any([controller.signal, AbortSignal.timeout(600_000)]),
|
|
37
|
+
redirect: 'error',
|
|
38
|
+
});
|
|
39
|
+
response.writeHead(upstream.status, {
|
|
40
|
+
'content-type': upstream.headers.get('content-type') ?? 'application/json',
|
|
41
|
+
});
|
|
42
|
+
if (upstream.body) await pipeline(Readable.fromWeb(upstream.body), response);
|
|
43
|
+
else response.end();
|
|
44
|
+
} catch {
|
|
45
|
+
if (!response.headersSent) response.writeHead(502);
|
|
46
|
+
response.end();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
createServer((request, response) => {
|
|
51
|
+
void forward(request, response);
|
|
52
|
+
}).listen(8787, '0.0.0.0');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# User task
|
|
2
|
+
|
|
3
|
+
{{task}}
|
|
4
|
+
|
|
5
|
+
## Approved inputs
|
|
6
|
+
|
|
7
|
+
{{inputs}}
|
|
8
|
+
|
|
9
|
+
## Approved access
|
|
10
|
+
|
|
11
|
+
{{access}}
|
|
12
|
+
|
|
13
|
+
Use the supplied CLI and Skills. Only approved read-only API actions and local output files are allowed. Report unavailable access or data; do not attempt remote writes.
|