@loopingai/core 0.3.0 → 0.3.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.
@@ -5,7 +5,7 @@ export interface RecordedRequest {
5
5
  headers: Record<string, string | string[]>;
6
6
  body: string;
7
7
  }
8
- /** A stored response. `body` is base64, as `SnapshotAgent` wrote it. */
8
+ /** A stored response. `body` is base64, so a binary payload survives the file. */
9
9
  export interface RecordedResponse {
10
10
  statusCode: number;
11
11
  headers: Record<string, string | string[]>;
@@ -48,10 +48,10 @@ export declare function replayable(response: RecordedResponse): ReplayableRespon
48
48
  * One cassette file, loaded lazily and written only when it has changed.
49
49
  *
50
50
  * Playback is **read-only**: nothing here mutates on a replay, which is what
51
- * stops a plain `npm test` from dirtying committed cassettes. `SnapshotAgent`
52
- * persisted its `callCount` and re-saved on close, so every run left the files
53
- * modified; the equivalent counter here ({@link #calls}) is in memory and dies
54
- * with the process.
51
+ * stops a plain `npm test` from dirtying committed cassettes. The sequence
52
+ * counter ({@link #calls}) is in memory and dies with the process, deliberately
53
+ * `SnapshotAgent` persisted its equivalent and re-saved on close, so every
54
+ * run left every cassette modified in git.
55
55
  */
56
56
  export declare class Cassette {
57
57
  #private;
@@ -60,16 +60,13 @@ export declare class Cassette {
60
60
  /** Every request in the file, as `METHOD url`, for error messages. */
61
61
  get recorded(): string[];
62
62
  /**
63
- * Read the file into memory. Tolerates both shapes: `SnapshotAgent` wrapped
64
- * each entry in `{ hash, snapshot: { request, responses } }`, this writes the
65
- * same wrapper (so a re-record diffs cleanly against an old cassette) but
66
- * ignores `hash`, `callCount` and `timestamp` — all three were volatile
67
- * bookkeeping and none is needed to replay.
63
+ * Read the file into memory, keying each entry by its own request rather than
64
+ * trusting anything stored alongside it.
68
65
  *
69
- * Entries are re-keyed on load rather than trusted, which is the point of the
70
- * rewrite. Two legacy entries that differed *only* by a request header now
71
- * collapse onto one key; their responses are concatenated in file order,
72
- * which is exactly the sequential-response semantics {@link match} walks.
66
+ * Two entries that key the same are a mistake rather than a merge: a request
67
+ * that was issued twice belongs in one entry with two `responses`, which is
68
+ * what {@link match} walks. Saying so here turns a hand-edit slip into a named
69
+ * error instead of a replay that silently serves the wrong response second.
73
70
  */
74
71
  load(): void;
75
72
  /**
@@ -77,10 +74,9 @@ export declare class Cassette {
77
74
  * recorded.
78
75
  *
79
76
  * Repeated identical requests walk `responses` in order and then **hold on
80
- * the last one**, matching what `SnapshotAgent` did
81
- * (`responses[min(callCount, length - 1)]`). A recording that captured one
82
- * response therefore replays it for every call, which is what a poll loop
83
- * needs.
77
+ * the last one**, so a recording that captured a single response replays it
78
+ * for every call which is what a poll loop needs when it runs a different
79
+ * number of times on replay than it did while recording.
84
80
  */
85
81
  match(method: string, url: string, body: string): ReplayableResponse | null;
86
82
  /** Append a live response. Repeats of a request extend its `responses`. */
@@ -1 +1 @@
1
- {"version":3,"file":"vcr-store.d.ts","sourceRoot":"","sources":["../../src/testing/vcr-store.ts"],"names":[],"mappings":"AAyBA,uFAAuF;AACvF,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,gBAAgB,EAAE,CAAC;CAC/B;AAsBD,qFAAqF;AACrF,MAAM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,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAqBlE,gFAAgF;IAChF,KAAK,IAAI,IAAI;CAOd"}
@@ -16,8 +16,15 @@
16
16
  * are still stored (minus secrets, see {@link CassetteOptions.excludeHeaders})
17
17
  * because they are useful to read in a diff, but they cannot break a replay.
18
18
  *
19
- * The on-disk format is deliberately unchanged from `SnapshotAgent`'s, so
20
- * cassettes recorded before this rewrite replay untouched see {@link load}.
19
+ * The on-disk format owes `SnapshotAgent` nothing: a flat array of
20
+ * {@link CassetteEntry}. Cassettes it wrote are not readable, and deliberately
21
+ * so — its recorder keyed on `String(opts.body)`, and a Worker's POST body
22
+ * reaches a dispatcher as a `ReadableStream`, so every streamed request it ever
23
+ * captured stored the literal text `[object ReadableStream]` where the payload
24
+ * belonged. Those bodies are not recoverable from the file, and a reader that
25
+ * papered over it would have to match such entries on method + URL alone —
26
+ * quietly reintroducing the ambiguity this store exists to remove. Re-record
27
+ * instead.
21
28
  */
22
29
  import { createHash } from "node:crypto";
23
30
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
@@ -81,10 +88,10 @@ export function replayable(response) {
81
88
  * One cassette file, loaded lazily and written only when it has changed.
82
89
  *
83
90
  * Playback is **read-only**: nothing here mutates on a replay, which is what
84
- * stops a plain `npm test` from dirtying committed cassettes. `SnapshotAgent`
85
- * persisted its `callCount` and re-saved on close, so every run left the files
86
- * modified; the equivalent counter here ({@link #calls}) is in memory and dies
87
- * with the process.
91
+ * stops a plain `npm test` from dirtying committed cassettes. The sequence
92
+ * counter ({@link #calls}) is in memory and dies with the process, deliberately
93
+ * `SnapshotAgent` persisted its equivalent and re-saved on close, so every
94
+ * run left every cassette modified in git.
88
95
  */
89
96
  export class Cassette {
90
97
  #file;
@@ -106,16 +113,13 @@ export class Cassette {
106
113
  return [...this.#entries.values()].map((e) => `${e.request.method} ${e.request.url}`);
107
114
  }
108
115
  /**
109
- * Read the file into memory. Tolerates both shapes: `SnapshotAgent` wrapped
110
- * each entry in `{ hash, snapshot: { request, responses } }`, this writes the
111
- * same wrapper (so a re-record diffs cleanly against an old cassette) but
112
- * ignores `hash`, `callCount` and `timestamp` — all three were volatile
113
- * bookkeeping and none is needed to replay.
116
+ * Read the file into memory, keying each entry by its own request rather than
117
+ * trusting anything stored alongside it.
114
118
  *
115
- * Entries are re-keyed on load rather than trusted, which is the point of the
116
- * rewrite. Two legacy entries that differed *only* by a request header now
117
- * collapse onto one key; their responses are concatenated in file order,
118
- * which is exactly the sequential-response semantics {@link match} walks.
119
+ * Two entries that key the same are a mistake rather than a merge: a request
120
+ * that was issued twice belongs in one entry with two `responses`, which is
121
+ * what {@link match} walks. Saying so here turns a hand-edit slip into a named
122
+ * error instead of a replay that silently serves the wrong response second.
119
123
  */
120
124
  load() {
121
125
  if (!existsSync(this.#file))
@@ -124,16 +128,15 @@ export class Cassette {
124
128
  if (!Array.isArray(raw)) {
125
129
  throw new Error(`VCR cassette ${this.#file} is not a JSON array`);
126
130
  }
127
- for (const item of raw) {
128
- const entry = (item.snapshot ??
129
- item);
131
+ for (const entry of raw) {
130
132
  const { request, responses } = entry;
131
133
  const key = requestKey(request.method, request.url, request.body ?? "");
132
- const existing = this.#entries.get(key);
133
- if (existing)
134
- existing.responses.push(...responses);
135
- else
136
- this.#entries.set(key, { request, responses: [...responses] });
134
+ if (this.#entries.has(key)) {
135
+ throw new Error(`VCR cassette ${path.basename(this.#file)} has two entries for ` +
136
+ `${request.method} ${request.url} with the same body. Put the ` +
137
+ `responses in one entry's \`responses\` array instead.`);
138
+ }
139
+ this.#entries.set(key, { request, responses: [...responses] });
137
140
  }
138
141
  }
139
142
  /**
@@ -141,10 +144,9 @@ export class Cassette {
141
144
  * recorded.
142
145
  *
143
146
  * Repeated identical requests walk `responses` in order and then **hold on
144
- * the last one**, matching what `SnapshotAgent` did
145
- * (`responses[min(callCount, length - 1)]`). A recording that captured one
146
- * response therefore replays it for every call, which is what a poll loop
147
- * needs.
147
+ * the last one**, so a recording that captured a single response replays it
148
+ * for every call which is what a poll loop needs when it runs a different
149
+ * number of times on replay than it did while recording.
148
150
  */
149
151
  match(method, url, body) {
150
152
  const key = requestKey(method, url, body);
@@ -182,9 +184,7 @@ export class Cassette {
182
184
  if (!this.#dirty)
183
185
  return;
184
186
  mkdirSync(path.dirname(this.#file), { recursive: true });
185
- const entries = [...this.#entries.values()].map((snapshot) => ({
186
- snapshot
187
- }));
187
+ const entries = [...this.#entries.values()];
188
188
  writeFileSync(this.#file, `${JSON.stringify(entries, null, 2)}\n`);
189
189
  this.#dirty = false;
190
190
  }
@@ -1 +1 @@
1
- {"version":3,"file":"vcr-store.js","sourceRoot":"","sources":["../../src/testing/vcr-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,IAAI,MAAM,WAAW,CAAC;AA8B7B;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;IAChB,YAAY;IACZ,oBAAoB;IACpB,qBAAqB;IACrB,IAAI;IACJ,SAAS;IACT,mBAAmB;IACnB,SAAS;CACV,CAAC,CAAC;AAcH,sEAAsE;AACtE,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,GAAW,EAAE,IAAY;IAClE,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7E,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,KAAK,MAAM,EAAE,CAAC;AACtD,CAAC;AAED,SAAS,aAAa,CACpB,OAA0C,EAC1C,OAAoB;IAEpB,MA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IAED,gFAAgF;IAChF,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO;QACzB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5C,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACnE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loopingai/core",
3
- "version": "0.3.0",
3
+ "version": "0.3.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",
@@ -100,15 +100,15 @@
100
100
  },
101
101
  "dependencies": {
102
102
  "@a2a-js/sdk": "^1.0.0",
103
- "@cloudflare/workers-types": "^5.20260801.1",
103
+ "@cloudflare/workers-types": "^5.20260804.1",
104
104
  "drizzle-orm": "^0.45.2",
105
- "jose": "^6.2.7",
105
+ "jose": "^6.2.8",
106
106
  "zod": "^4.4.3"
107
107
  },
108
108
  "peerDependencies": {
109
109
  "@cloudflare/vitest-pool-workers": ">=0.18",
110
110
  "agents": "^0.20.0",
111
- "ai": "^7.0.40",
111
+ "ai": "^7.0.51",
112
112
  "vitest": ">=4",
113
113
  "workers-ai-provider": "^4.0.0"
114
114
  },
@@ -129,7 +129,7 @@
129
129
  "eslint": "^10.8.0",
130
130
  "prettier": "^3.9.6",
131
131
  "typescript": "^6.0.3",
132
- "typescript-eslint": "^8.65.0",
132
+ "typescript-eslint": "^8.66.0",
133
133
  "vitest": "^4.1.10",
134
134
  "workers-ai-provider": "^4.0.0",
135
135
  "wrangler": "^4.118.0"
@@ -140,6 +140,11 @@
140
140
  "publishConfig": {
141
141
  "access": "public"
142
142
  },
143
+ "overrides": {
144
+ "@esbuild-kit/core-utils": {
145
+ "esbuild": "^0.25.0"
146
+ }
147
+ },
143
148
  "allowScripts": {
144
149
  "esbuild": false,
145
150
  "fsevents": false,