@cat-factory/worker 0.181.8 → 0.182.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.
@@ -3,16 +3,16 @@ import type { D1Database } from '@cloudflare/workers-types';
3
3
  /**
4
4
  * The PER-USER stores: state keyed on a person rather than on a board or an account.
5
5
  *
6
- * A cohesive group, and the reason it is a mixin rather than four lines in `container.ts` is the
7
- * file-size ratchet on that module but the grouping earns its keep on its own terms. Both tables
8
- * are keyed `user_id`, neither holds secret material, and both are `selfUser`-scoped on the
9
- * mothership persistence allow-list (a caller may only ever reach their OWN row). So the next
10
- * per-user store lands here, beside the two that already share that shape, instead of in the middle
11
- * of the workspace-scoped repositories where nothing about it would suggest the different scoping.
6
+ * A cohesive group, and the reason it is a mixin rather than a few lines in `container.ts` is the
7
+ * file-size ratchet on that module, but the grouping earns its keep on its own terms. Every table
8
+ * is keyed `user_id` and is `selfUser`-scoped on the mothership persistence allow-list (a caller may
9
+ * only ever reach their OWN row). So the next per-user store lands here, beside the ones that
10
+ * already share that shape, instead of in the middle of the workspace-scoped repositories where
11
+ * nothing about it would suggest the different scoping.
12
12
  *
13
- * Unconditional: neither store needs a binding, a key or a flag beyond the main database, so both
14
- * are always wired and their features are never silently off. Mirrored on the Node facade by the
15
- * corresponding entries in `container-core-deps.ts`.
13
+ * Unconditional: no store here needs a binding, a key or a flag beyond the main database, so none of
14
+ * their features is ever silently off. Mirrored on the Node facade by the corresponding entries in
15
+ * `container-core-deps.ts`.
16
16
  */
17
17
  export declare function selectPerUserDeps(db: D1Database): Partial<CoreDependencies>;
18
18
  //# sourceMappingURL=container-per-user-deps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"container-per-user-deps.d.ts","sourceRoot":"","sources":["../../src/infrastructure/container-per-user-deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAI3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAQ3E"}
1
+ {"version":3,"file":"container-per-user-deps.d.ts","sourceRoot":"","sources":["../../src/infrastructure/container-per-user-deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAK3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAa3E"}
@@ -1,18 +1,19 @@
1
+ import { D1LocalModelEndpointRepository } from './repositories/D1LocalModelEndpointRepository';
1
2
  import { D1TutorialProgressRepository } from './repositories/D1TutorialProgressRepository';
2
3
  import { D1UserSettingsRepository } from './repositories/D1UserSettingsRepository';
3
4
  /**
4
5
  * The PER-USER stores: state keyed on a person rather than on a board or an account.
5
6
  *
6
- * A cohesive group, and the reason it is a mixin rather than four lines in `container.ts` is the
7
- * file-size ratchet on that module but the grouping earns its keep on its own terms. Both tables
8
- * are keyed `user_id`, neither holds secret material, and both are `selfUser`-scoped on the
9
- * mothership persistence allow-list (a caller may only ever reach their OWN row). So the next
10
- * per-user store lands here, beside the two that already share that shape, instead of in the middle
11
- * of the workspace-scoped repositories where nothing about it would suggest the different scoping.
7
+ * A cohesive group, and the reason it is a mixin rather than a few lines in `container.ts` is the
8
+ * file-size ratchet on that module, but the grouping earns its keep on its own terms. Every table
9
+ * is keyed `user_id` and is `selfUser`-scoped on the mothership persistence allow-list (a caller may
10
+ * only ever reach their OWN row). So the next per-user store lands here, beside the ones that
11
+ * already share that shape, instead of in the middle of the workspace-scoped repositories where
12
+ * nothing about it would suggest the different scoping.
12
13
  *
13
- * Unconditional: neither store needs a binding, a key or a flag beyond the main database, so both
14
- * are always wired and their features are never silently off. Mirrored on the Node facade by the
15
- * corresponding entries in `container-core-deps.ts`.
14
+ * Unconditional: no store here needs a binding, a key or a flag beyond the main database, so none of
15
+ * their features is ever silently off. Mirrored on the Node facade by the corresponding entries in
16
+ * `container-core-deps.ts`.
16
17
  */
17
18
  export function selectPerUserDeps(db) {
18
19
  return {
@@ -21,6 +22,11 @@ export function selectPerUserDeps(db) {
21
22
  // In-app tutorial progress (migration 0080): which walkthroughs this PERSON has finished and
22
23
  // which contextual offers have been spent, so neither is a fact about a browser profile.
23
24
  tutorialProgressRepository: new D1TutorialProgressRepository({ db }),
25
+ // The locally-run model endpoints (migration 0002). The one store here whose row holds sealed
26
+ // material, and the engine reads NONE of it: what a dispatch wants is the DECLARED half (does
27
+ // this local model read images), which has no key to unseal, which is why this is wired
28
+ // unconditionally while the credential-side service still needs `ENCRYPTION_KEY`.
29
+ localModelEndpointRepository: new D1LocalModelEndpointRepository({ db }),
24
30
  };
25
31
  }
26
32
  //# sourceMappingURL=container-per-user-deps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"container-per-user-deps.js","sourceRoot":"","sources":["../../src/infrastructure/container-per-user-deps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAElF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAc;IAC9C,OAAO;QACL,+CAA+C;QAC/C,sBAAsB,EAAE,IAAI,wBAAwB,CAAC,EAAE,EAAE,EAAE,CAAC;QAC5D,6FAA6F;QAC7F,yFAAyF;QACzF,0BAA0B,EAAE,IAAI,4BAA4B,CAAC,EAAE,EAAE,EAAE,CAAC;KACrE,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"container-per-user-deps.js","sourceRoot":"","sources":["../../src/infrastructure/container-per-user-deps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAA;AAC9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAElF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAc;IAC9C,OAAO;QACL,+CAA+C;QAC/C,sBAAsB,EAAE,IAAI,wBAAwB,CAAC,EAAE,EAAE,EAAE,CAAC;QAC5D,6FAA6F;QAC7F,yFAAyF;QACzF,0BAA0B,EAAE,IAAI,4BAA4B,CAAC,EAAE,EAAE,EAAE,CAAC;QACpE,8FAA8F;QAC9F,8FAA8F;QAC9F,wFAAwF;QACxF,kFAAkF;QAClF,4BAA4B,EAAE,IAAI,8BAA8B,CAAC,EAAE,EAAE,EAAE,CAAC;KACzE,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"D1LocalModelEndpointRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1LocalModelEndpointRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AACjG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAmC3D,gFAAgF;AAChF,qBAAa,8BAA+B,YAAW,4BAA4B;IACjF,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAC/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAMpE;IAEK,iBAAiB,CACrB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,WAAW,GACpB,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAM1C;IAEK,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB5D;IAEK,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjE;CACF"}
1
+ {"version":3,"file":"D1LocalModelEndpointRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1LocalModelEndpointRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAEjG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AA4B3D,gFAAgF;AAChF,qBAAa,8BAA+B,YAAW,4BAA4B;IACjF,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAC/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAMpE;IAEK,iBAAiB,CACrB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,WAAW,GACpB,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAM1C;IAEK,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB5D;IAEK,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjE;CACF"}
@@ -1,24 +1,18 @@
1
+ import { parseLocalModelDeclarations } from '@cat-factory/kernel';
1
2
  function toRecord(row) {
3
+ const { models, unreadable } = parseLocalModelDeclarations(row.models);
2
4
  return {
3
5
  userId: row.user_id,
4
6
  provider: row.provider,
5
7
  label: row.label,
6
8
  baseUrl: row.base_url,
7
9
  apiKeyCipher: row.api_key_cipher,
8
- models: parseModels(row.models),
10
+ models,
11
+ unreadableModels: unreadable,
9
12
  createdAt: row.created_at,
10
13
  updatedAt: row.updated_at,
11
14
  };
12
15
  }
13
- function parseModels(json) {
14
- try {
15
- const parsed = JSON.parse(json);
16
- return Array.isArray(parsed) ? parsed.map(String) : [];
17
- }
18
- catch {
19
- return [];
20
- }
21
- }
22
16
  /** D1-backed store of a user's locally-run model endpoints (migration 0002). */
23
17
  export class D1LocalModelEndpointRepository {
24
18
  db;
@@ -1 +1 @@
1
- {"version":3,"file":"D1LocalModelEndpointRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1LocalModelEndpointRepository.ts"],"names":[],"mappings":"AAeA,SAAS,QAAQ,CAAC,GAA0B;IAC1C,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,QAAQ,EAAE,GAAG,CAAC,QAAuB;QACrC,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,YAAY,EAAE,GAAG,CAAC,cAAc;QAChC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC;QAC/B,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC/B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,gFAAgF;AAChF,MAAM,OAAO,8BAA8B;IACxB,EAAE,CAAY;IAC/B,YAAY,EAAE,EAAE,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LocalModelEndpointRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1LocalModelEndpointRepository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AAejE,SAAS,QAAQ,CAAC,GAA0B;IAC1C,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,2BAA2B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACtE,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,QAAQ,EAAE,GAAG,CAAC,QAAuB;QACrC,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,YAAY,EAAE,GAAG,CAAC,cAAc;QAChC,MAAM;QACN,gBAAgB,EAAE,UAAU;QAC5B,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAA;AACH,CAAC;AAED,gFAAgF;AAChF,MAAM,OAAO,8BAA8B;IACxB,EAAE,CAAY;IAC/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc;QAC7B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,EAAE;aAC9B,OAAO,CAAC,+EAA+E,CAAC;aACxF,IAAI,CAAC,MAAM,CAAC;aACZ,GAAG,EAAyB,CAAA;QAC/B,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,MAAc,EACd,QAAqB;QAErB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE;aACtB,OAAO,CAAC,wEAAwE,CAAC;aACjF,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;aACtB,KAAK,EAAyB,CAAA;QACjC,OAAO,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAgC;QAC3C,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN;;;;;;;;4CAQoC,CACrC;aACA,IAAI,CACH,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,YAAY,EACnB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,EAC7B,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,SAAS,CACjB;aACA,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,QAAqB;QAChD,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CAAC,sEAAsE,CAAC;aAC/E,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;aACtB,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/worker",
3
- "version": "0.181.8",
3
+ "version": "0.182.0",
4
4
  "description": "Reusable Cloudflare Worker library (Hono + D1) exposing the Agent Architecture Board core: the `createApp()` Hono factory, the default fetch/scheduled/queue handler, and the Durable Object + Workflow classes. Deployments (see deploy/backend) supply the wrangler.toml + config and re-export these.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,22 +43,22 @@
43
43
  "pino": "^10.3.1",
44
44
  "valibot": "^1.4.2",
45
45
  "workers-ai-provider": "^4.0.0",
46
- "@cat-factory/caching": "0.19.0",
47
- "@cat-factory/consensus": "0.15.8",
48
- "@cat-factory/agents": "0.125.8",
49
- "@cat-factory/contracts": "0.296.0",
50
- "@cat-factory/eks": "0.1.303",
51
- "@cat-factory/gates": "0.10.30",
52
- "@cat-factory/gitlab": "0.20.0",
53
- "@cat-factory/integrations": "0.157.0",
54
- "@cat-factory/kernel": "0.287.0",
55
- "@cat-factory/observability-langfuse": "0.10.74",
56
- "@cat-factory/observability-otel": "0.18.37",
57
- "@cat-factory/orchestration": "0.259.0",
58
- "@cat-factory/prompt-fragments": "1.0.54",
59
- "@cat-factory/provider-cloudflare": "0.7.452",
60
- "@cat-factory/server": "0.273.0",
61
- "@cat-factory/spend": "0.15.72"
46
+ "@cat-factory/caching": "0.20.0",
47
+ "@cat-factory/agents": "0.126.0",
48
+ "@cat-factory/consensus": "0.16.0",
49
+ "@cat-factory/eks": "0.1.304",
50
+ "@cat-factory/contracts": "0.297.0",
51
+ "@cat-factory/gitlab": "0.20.1",
52
+ "@cat-factory/kernel": "0.288.0",
53
+ "@cat-factory/observability-langfuse": "0.10.75",
54
+ "@cat-factory/observability-otel": "0.18.38",
55
+ "@cat-factory/integrations": "0.158.0",
56
+ "@cat-factory/orchestration": "0.260.0",
57
+ "@cat-factory/gates": "0.10.31",
58
+ "@cat-factory/provider-cloudflare": "0.7.453",
59
+ "@cat-factory/spend": "0.15.73",
60
+ "@cat-factory/server": "0.274.0",
61
+ "@cat-factory/prompt-fragments": "1.0.55"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@cloudflare/vitest-pool-workers": "^0.20.3",
@@ -66,7 +66,7 @@
66
66
  "typescript": "7.0.2",
67
67
  "vitest": "^4.1.10",
68
68
  "wrangler": "^4.120.0",
69
- "@cat-factory/conformance": "0.38.9"
69
+ "@cat-factory/conformance": "0.38.10"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsc -b tsconfig.build.json",