@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.
@@ -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
- export { mockModel, finalReply } from "./mock-model.js";
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.6.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 both halves
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
- const { privateKey, publicKey } = await generateKeyPair("EdDSA", {
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("A2A_SIGNING_KEY (private set as a secret, never commit):\n");
37
- console.log(JSON.stringify(priv));
37
+ console.log(`\nGenerated Ed25519 keypair (kid: ${kid})\n`);
38
38
  console.log(
39
- "\nPublic JWKS (served at the card's `jku`, derived at runtime):\n"
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
- `);