@loopingai/core 0.6.0 → 0.7.1
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 +36 -3
- package/dist/a2a/caller-token.d.ts +44 -0
- package/dist/a2a/caller-token.js +61 -0
- package/dist/a2a/deliver.d.ts +49 -0
- package/dist/a2a/deliver.js +49 -0
- package/dist/a2a/index.d.ts +3 -0
- package/dist/a2a/index.js +3 -0
- package/dist/a2a/self-origin.d.ts +91 -0
- package/dist/a2a/self-origin.js +114 -0
- package/dist/alarm/index.d.ts +77 -0
- package/dist/alarm/index.js +116 -0
- package/dist/host/agent.d.ts +36 -0
- package/dist/host/agent.js +44 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/platform.d.ts +29 -0
- package/dist/platform.js +31 -0
- package/dist/round/agent.js +18 -2
- package/dist/round/workflow.js +23 -78
- package/dist/subagent/index.d.ts +26 -5
- package/dist/subagent/index.js +35 -5
- package/dist/testing/do.d.ts +4 -4
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +5 -1
- package/package.json +5 -1
- package/scripts/generate-keys.mjs +15 -20
package/dist/testing/index.js
CHANGED
|
@@ -24,7 +24,11 @@
|
|
|
24
24
|
export { setupRecording, cassetteNameFor } from "./vcr-spec.js";
|
|
25
25
|
export { VCR_CONTROL_ORIGIN, VCR_MARKER_HEADER, CASSETTE_NAME_RE } from "./vcr-shared.js";
|
|
26
26
|
export { FakeSession } from "./fake-session.js";
|
|
27
|
-
|
|
27
|
+
// `throwingModel`, `countingModel` and `rateLimitedModel` were reachable only
|
|
28
|
+
// through a deep `dist/` path until now, which meant a consumer could not assert
|
|
29
|
+
// the one thing they exist for: that a rate limit is waited out on the *same*
|
|
30
|
+
// model rather than falling through to the fallback slot.
|
|
31
|
+
export { mockModel, finalReply, throwingModel, countingModel, rateLimitedModel } from "./mock-model.js";
|
|
28
32
|
export { makeGatewayToken } from "./auth.js";
|
|
29
33
|
export { AGENT_ORIGIN, GATEWAY_ORIGIN, TEST_AGENT_PRIVATE_JWK, TEST_GATEWAY_PRIVATE_JWK, TEST_MODELS, gatewayPublicJwks, testAgentMessage, testStatus, testTask } from "./fixtures.js";
|
|
30
34
|
export { doStorage, makeDoHelpers } from "./do.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopingai/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Shared, mandatory foundation for Looping agents on Cloudflare Workers: zero-trust A2A, durable task lifecycle, delegation and subagent runtime, test harness.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"a2a",
|
|
@@ -57,6 +57,10 @@
|
|
|
57
57
|
"types": "./dist/host/index.d.ts",
|
|
58
58
|
"import": "./dist/host/index.js"
|
|
59
59
|
},
|
|
60
|
+
"./alarm": {
|
|
61
|
+
"types": "./dist/alarm/index.d.ts",
|
|
62
|
+
"import": "./dist/alarm/index.js"
|
|
63
|
+
},
|
|
60
64
|
"./round": {
|
|
61
65
|
"types": "./dist/round/index.d.ts",
|
|
62
66
|
"import": "./dist/round/index.js"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* registration (Trust-On-First-Use). No secret is shared in either direction —
|
|
8
8
|
* see `src/a2a/verify.ts` for the other half of the contract.
|
|
9
9
|
*
|
|
10
|
-
* node scripts/generate-keys.mjs # print
|
|
10
|
+
* node scripts/generate-keys.mjs # print the private JWK
|
|
11
11
|
* node scripts/generate-keys.mjs --kid my-key # choose the key id
|
|
12
12
|
*
|
|
13
13
|
* The `kid` is required, not decorative: it goes in the JWS protected header and
|
|
@@ -24,30 +24,25 @@ const kid =
|
|
|
24
24
|
? args[kidFlag + 1]
|
|
25
25
|
: `a2a-${new Date().toISOString().slice(0, 10)}`;
|
|
26
26
|
|
|
27
|
-
// `extractable` is required to export the private half at all.
|
|
28
|
-
|
|
27
|
+
// `extractable` is required to export the private half at all. Only the
|
|
28
|
+
// private half is printed: the public one is derived from it at runtime and
|
|
29
|
+
// served at the JWKS route, so there is nothing to copy anywhere.
|
|
30
|
+
const { privateKey } = await generateKeyPair("EdDSA", {
|
|
29
31
|
crv: "Ed25519",
|
|
30
32
|
extractable: true
|
|
31
33
|
});
|
|
32
34
|
|
|
33
35
|
const priv = { ...(await exportJWK(privateKey)), kid };
|
|
34
|
-
const pub = { ...(await exportJWK(publicKey)), kid, use: "sig", alg: "EdDSA" };
|
|
35
36
|
|
|
36
|
-
console.log(
|
|
37
|
-
console.log(JSON.stringify(priv));
|
|
37
|
+
console.log(`\nGenerated Ed25519 keypair (kid: ${kid})\n`);
|
|
38
38
|
console.log(
|
|
39
|
-
"
|
|
39
|
+
"Add this line to .env — it is the private half, never commit it:\n"
|
|
40
|
+
);
|
|
41
|
+
console.log(`A2A_SIGNING_KEY=${JSON.stringify(priv)}\n`);
|
|
42
|
+
console.log(
|
|
43
|
+
"To deploy it, push the whole file or just this one secret:\n\n" +
|
|
44
|
+
" npx wrangler deploy --secrets-file .env\n" +
|
|
45
|
+
" npx wrangler secret put A2A_SIGNING_KEY\n\n" +
|
|
46
|
+
"The public half is not configured anywhere — the Worker derives it from\n" +
|
|
47
|
+
"the private key and serves it at the JWKS route.\n"
|
|
40
48
|
);
|
|
41
|
-
console.log(JSON.stringify({ keys: [pub] }, null, 2));
|
|
42
|
-
console.log(`
|
|
43
|
-
Next:
|
|
44
|
-
|
|
45
|
-
# local
|
|
46
|
-
echo 'A2A_SIGNING_KEY=<the private JSON above>' >> .dev.vars
|
|
47
|
-
|
|
48
|
-
# deployed
|
|
49
|
-
npx wrangler secret put A2A_SIGNING_KEY
|
|
50
|
-
|
|
51
|
-
The public half is not configured anywhere — the Worker derives it from the
|
|
52
|
-
private key and serves it at the JWKS route.
|
|
53
|
-
`);
|