@1agents/dsh-a2a 0.0.0-stage → 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/README.md +57 -2
- package/cordis.patch.yml +10 -0
- package/dist/approvals.js +49 -0
- package/dist/cli.js +15 -0
- package/dist/executor.js +121 -0
- package/dist/index.js +18 -0
- package/dist/sdk-runtime.js +116 -0
- package/dist/server.js +46 -0
- package/dist/shared/a2a/workbench-ui.js +182 -0
- package/dist/workbench-ui/app.css +453 -0
- package/dist/workbench-ui/app.js +13 -0
- package/dist/workbench-ui/chunk-23JHGYT3.js +1 -0
- package/dist/workbench-ui/chunk-3H6STGPV.js +1 -0
- package/dist/workbench-ui/chunk-3SNBBMGH.js +1 -0
- package/dist/workbench-ui/chunk-3XJZ6DIE.js +1 -0
- package/dist/workbench-ui/chunk-44KDLLKJ.js +1 -0
- package/dist/workbench-ui/chunk-46H7FU5Y.js +7 -0
- package/dist/workbench-ui/chunk-4N44QPL7.js +1 -0
- package/dist/workbench-ui/chunk-4YN4BS7I.js +1 -0
- package/dist/workbench-ui/chunk-53EG4IVQ.js +96 -0
- package/dist/workbench-ui/chunk-5FIPUNR4.js +1 -0
- package/dist/workbench-ui/chunk-6DWWYA6G.js +2 -0
- package/dist/workbench-ui/chunk-6FU3T633.js +99 -0
- package/dist/workbench-ui/chunk-6XKIHRA4.js +1 -0
- package/dist/workbench-ui/chunk-7GIX43Y5.js +1 -0
- package/dist/workbench-ui/chunk-7Q4WBGX6.js +4 -0
- package/dist/workbench-ui/chunk-A3BQM7HR.js +1 -0
- package/dist/workbench-ui/chunk-AFCFDDOP.js +24 -0
- package/dist/workbench-ui/chunk-AG67EUYD.js +89 -0
- package/dist/workbench-ui/chunk-AGJHMMTN.js +1 -0
- package/dist/workbench-ui/chunk-AO6JUBV6.js +41 -0
- package/dist/workbench-ui/chunk-AUSLTP43.js +72 -0
- package/dist/workbench-ui/chunk-AVZL46TT.js +1 -0
- package/dist/workbench-ui/chunk-AZRIGIV2.js +168 -0
- package/dist/workbench-ui/chunk-B2LIVH37.js +1 -0
- package/dist/workbench-ui/chunk-B7YX5TR5.js +1 -0
- package/dist/workbench-ui/chunk-BCB4X4XX.js +1 -0
- package/dist/workbench-ui/chunk-BCRQUL2A.js +88 -0
- package/dist/workbench-ui/chunk-BI6UHHQP.js +1 -0
- package/dist/workbench-ui/chunk-BLSLQ4AQ.js +120 -0
- package/dist/workbench-ui/chunk-C3QSRS6E.js +1 -0
- package/dist/workbench-ui/chunk-CK7M2PJ3.js +62 -0
- package/dist/workbench-ui/chunk-CM6LZ7TU.js +1 -0
- package/dist/workbench-ui/chunk-CP63H27F.js +36 -0
- package/dist/workbench-ui/chunk-CPUMMIS2.js +70 -0
- package/dist/workbench-ui/chunk-CSEIBI5U.js +2 -0
- package/dist/workbench-ui/chunk-CUS65DKZ.js +161 -0
- package/dist/workbench-ui/chunk-CVQY7TNC.js +1 -0
- package/dist/workbench-ui/chunk-D6S3XBIX.js +106 -0
- package/dist/workbench-ui/chunk-E253Y562.js +1 -0
- package/dist/workbench-ui/chunk-EADDJUDC.js +1 -0
- package/dist/workbench-ui/chunk-EBGJ3YXG.js +206 -0
- package/dist/workbench-ui/chunk-EKPVZ3WY.js +8 -0
- package/dist/workbench-ui/chunk-EQDCEAFY.js +1 -0
- package/dist/workbench-ui/chunk-ES3SSDJY.js +40 -0
- package/dist/workbench-ui/chunk-ESFD2H7N.js +231 -0
- package/dist/workbench-ui/chunk-FVOHPMS6.js +1 -0
- package/dist/workbench-ui/chunk-FXMQAGVT.js +1 -0
- package/dist/workbench-ui/chunk-GGTADRXD.js +24 -0
- package/dist/workbench-ui/chunk-GHIVPGNQ.js +1 -0
- package/dist/workbench-ui/chunk-GLU2YQV2.js +1 -0
- package/dist/workbench-ui/chunk-GOCKBYSM.js +1 -0
- package/dist/workbench-ui/chunk-H2KMMTJB.js +1 -0
- package/dist/workbench-ui/chunk-HGVLDNPP.js +39 -0
- package/dist/workbench-ui/chunk-HSAVC5GY.js +1 -0
- package/dist/workbench-ui/chunk-HSEAD2JH.js +1 -0
- package/dist/workbench-ui/chunk-HSIHOBTY.js +1 -0
- package/dist/workbench-ui/chunk-IZXOKUGG.js +67 -0
- package/dist/workbench-ui/chunk-JFT2LC2T.js +1 -0
- package/dist/workbench-ui/chunk-JHL3ZDYK.js +3 -0
- package/dist/workbench-ui/chunk-JMORLCZG.js +257 -0
- package/dist/workbench-ui/chunk-JR4SIX7A.js +1 -0
- package/dist/workbench-ui/chunk-K23HAGEH.js +30 -0
- package/dist/workbench-ui/chunk-K43JDCBH.js +1 -0
- package/dist/workbench-ui/chunk-KINKFJY7.js +1 -0
- package/dist/workbench-ui/chunk-KKQSA4LI.js +2 -0
- package/dist/workbench-ui/chunk-KOUZX3UX.js +1 -0
- package/dist/workbench-ui/chunk-KR4DRHW2.js +78 -0
- package/dist/workbench-ui/chunk-KT4DJNOR.js +1 -0
- package/dist/workbench-ui/chunk-KTPNKRRZ.js +292 -0
- package/dist/workbench-ui/chunk-LFHIPGSU.js +7 -0
- package/dist/workbench-ui/chunk-LWDL4HZB.js +125 -0
- package/dist/workbench-ui/chunk-MVYC3CY4.js +1 -0
- package/dist/workbench-ui/chunk-NWUPALCY.js +129 -0
- package/dist/workbench-ui/chunk-NY7C662Z.js +1 -0
- package/dist/workbench-ui/chunk-O76WTHWP.js +1 -0
- package/dist/workbench-ui/chunk-OTF7YHRE.js +162 -0
- package/dist/workbench-ui/chunk-P6TKKRKP.js +1 -0
- package/dist/workbench-ui/chunk-PFHOOWV3.js +1 -0
- package/dist/workbench-ui/chunk-PUQLANIM.js +1 -0
- package/dist/workbench-ui/chunk-PZCGBYVO.js +1 -0
- package/dist/workbench-ui/chunk-QOHUZGP4.js +1 -0
- package/dist/workbench-ui/chunk-QSEG3OFF.js +1 -0
- package/dist/workbench-ui/chunk-QYPOXZIA.js +84 -0
- package/dist/workbench-ui/chunk-R6SOF3JC.js +1 -0
- package/dist/workbench-ui/chunk-RCLOYU5F.js +1 -0
- package/dist/workbench-ui/chunk-RSRUP64S.js +1 -0
- package/dist/workbench-ui/chunk-RVAIT6JW.js +1 -0
- package/dist/workbench-ui/chunk-S2CCN3II.js +1 -0
- package/dist/workbench-ui/chunk-S2Q52W46.js +1 -0
- package/dist/workbench-ui/chunk-S2W5THJ5.js +1 -0
- package/dist/workbench-ui/chunk-S6ZQZNOX.js +1 -0
- package/dist/workbench-ui/chunk-S74PLMMS.js +1 -0
- package/dist/workbench-ui/chunk-S7C4HKEY.js +1 -0
- package/dist/workbench-ui/chunk-SDTB3Q65.js +1 -0
- package/dist/workbench-ui/chunk-SLPRGYUV.js +32 -0
- package/dist/workbench-ui/chunk-SQE76S5B.js +1 -0
- package/dist/workbench-ui/chunk-SSDZPVPW.js +1 -0
- package/dist/workbench-ui/chunk-SVI7DGIE.js +1 -0
- package/dist/workbench-ui/chunk-T6QKLZ4H.js +62 -0
- package/dist/workbench-ui/chunk-TJNRPTFL.js +1 -0
- package/dist/workbench-ui/chunk-TP6U4EDH.js +2 -0
- package/dist/workbench-ui/chunk-TYAAT3GQ.js +1 -0
- package/dist/workbench-ui/chunk-U6OCY4ZH.js +1 -0
- package/dist/workbench-ui/chunk-UAN3NLRF.js +1 -0
- package/dist/workbench-ui/chunk-UMLU3FIX.js +1 -0
- package/dist/workbench-ui/chunk-URIY2OTM.js +1 -0
- package/dist/workbench-ui/chunk-V2NUKAA7.js +38 -0
- package/dist/workbench-ui/chunk-V4QLL4TE.js +139 -0
- package/dist/workbench-ui/chunk-VASHXUK4.js +2 -0
- package/dist/workbench-ui/chunk-VJLIWNIU.js +1 -0
- package/dist/workbench-ui/chunk-VQNQFBID.js +1 -0
- package/dist/workbench-ui/chunk-VSIWU7XA.js +3 -0
- package/dist/workbench-ui/chunk-VSJASPUZ.js +321 -0
- package/dist/workbench-ui/chunk-VXPNUNUX.js +3 -0
- package/dist/workbench-ui/chunk-WBKLDCV6.js +1 -0
- package/dist/workbench-ui/chunk-WOKJM3FY.js +1 -0
- package/dist/workbench-ui/chunk-X3U3NA3X.js +34 -0
- package/dist/workbench-ui/chunk-XBYU7M4J.js +1 -0
- package/dist/workbench-ui/chunk-XBZAO4ID.js +10 -0
- package/dist/workbench-ui/chunk-XLLPZ2WO.js +1 -0
- package/dist/workbench-ui/chunk-YFVL4NJL.js +1 -0
- package/dist/workbench-ui/chunk-YRFQENM4.js +1 -0
- package/dist/workbench-ui/chunk-YUADQVB2.js +1 -0
- package/dist/workbench-ui/chunk-Z3TCAKM5.js +1 -0
- package/dist/workbench-ui/chunk-Z6QR6FRE.js +10 -0
- package/dist/workbench-ui/chunk-ZJPSORPP.js +3 -0
- package/dist/workbench-ui/chunk-ZLGCSTR2.js +15 -0
- package/dist/workbench-ui/chunk-ZLR4SG5X.js +1 -0
- package/dist/workbench-ui/chunk-ZND3TTGF.js +1 -0
- package/dist/workbench-ui/chunk-ZOP3ZYH7.js +2 -0
- package/dist/workbench-ui/index.html +14 -0
- package/dist/workbench.js +53 -0
- package/package.json +25 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { WorkbenchUi, WORKBENCH_UI_PATH } from "../dist/shared/a2a/workbench-ui.js";
|
|
2
|
+
const json = (res, status, body) => {
|
|
3
|
+
res.writeHead(status, { "Content-Type": "application/json", "Cache-Control": "no-store" });
|
|
4
|
+
res.end(JSON.stringify(body));
|
|
5
|
+
};
|
|
6
|
+
function createWorkbench(options, loginToken) {
|
|
7
|
+
const ui = new WorkbenchUi(loginToken);
|
|
8
|
+
const gateway = options?.url ? new URL(options.url).origin : void 0;
|
|
9
|
+
return async (req, res, url) => {
|
|
10
|
+
const routed = await ui.handle(req, res, url);
|
|
11
|
+
if (!routed) return;
|
|
12
|
+
const route = routed.route;
|
|
13
|
+
if (/^\/workbench\/dsh\/tasks\/[^/]+$/.test(route)) return json(res, 200, { available: false, reason: "headless_runtime" });
|
|
14
|
+
if (!gateway) return json(res, 503, { error: "workbench_not_configured", message: "\u8BF7\u914D\u7F6E workbench.url \u8FDE\u63A5\u4EFB\u52A1\u7F51\u5173\u3002" });
|
|
15
|
+
if (req.method === "POST" && /^\/workbench\/tasks\/[^/]+\/process-requests$/.test(route)) return json(res, 403, { error: "browser_action_required" });
|
|
16
|
+
const chunks = [];
|
|
17
|
+
let length = 0;
|
|
18
|
+
if (!["GET", "HEAD"].includes(req.method)) {
|
|
19
|
+
for await (const chunk of req) {
|
|
20
|
+
length += chunk.length;
|
|
21
|
+
if (length > 1024 * 1024) return json(res, 413, { error: "Request body too large" });
|
|
22
|
+
chunks.push(chunk);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const headers = {
|
|
26
|
+
...options.token ? { Authorization: `Bearer ${options.token}` } : {},
|
|
27
|
+
...options.pageRelaySecret ? { "X-Workbench-Page-Relay": options.pageRelaySecret } : {},
|
|
28
|
+
...chunks.length ? { "Content-Type": String(req.headers["content-type"] ?? "application/json") } : {}
|
|
29
|
+
};
|
|
30
|
+
try {
|
|
31
|
+
const upstream = await fetch(new URL(`${route}${url.search}`, gateway), {
|
|
32
|
+
method: req.method,
|
|
33
|
+
headers,
|
|
34
|
+
redirect: "error",
|
|
35
|
+
signal: AbortSignal.timeout(6e4),
|
|
36
|
+
...chunks.length ? { body: Buffer.concat(chunks) } : {}
|
|
37
|
+
});
|
|
38
|
+
const passed = { "Cache-Control": "no-store" };
|
|
39
|
+
for (const name of ["content-type", "content-disposition", "x-content-type-options"]) {
|
|
40
|
+
const value = upstream.headers.get(name);
|
|
41
|
+
if (value) passed[name] = value;
|
|
42
|
+
}
|
|
43
|
+
res.writeHead(upstream.status, passed);
|
|
44
|
+
res.end(Buffer.from(await upstream.arrayBuffer()));
|
|
45
|
+
} catch {
|
|
46
|
+
json(res, 502, { error: "gateway_unreachable" });
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
WORKBENCH_UI_PATH,
|
|
52
|
+
createWorkbench
|
|
53
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1agents/dsh-a2a",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "DSH headless runtime execution over a standalone A2A endpoint.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": { "access": "public", "registry": "https://registry.npmjs.org" },
|
|
8
|
+
"repository": { "type": "git", "url": "git+https://github.com/scottzx/agent-workflow.git", "directory": "packages/dsh-a2a" },
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/index.js",
|
|
11
|
+
"./server": "./dist/server.js",
|
|
12
|
+
"./executor": "./dist/executor.js",
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
"./cordis.patch.yml": "./cordis.patch.yml"
|
|
15
|
+
},
|
|
16
|
+
"bin": { "dsh-a2a": "./dist/cli.js" },
|
|
17
|
+
"files": ["dist", "cordis.patch.yml", "README.md"],
|
|
18
|
+
"dsh": { "bundle": { "patch": "./cordis.patch.yml" } },
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "node scripts/build.mjs",
|
|
21
|
+
"typecheck": "node scripts/check.mjs",
|
|
22
|
+
"test": "node scripts/build.mjs && node --test test/*.test.mjs"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": { "@1agents/acp-service": "^0.10.4" },
|
|
25
|
+
"devDependencies": { "esbuild": "^0.28.0" },
|
|
26
|
+
"engines": { "node": ">=22.13.0" }
|
|
27
|
+
}
|