@camox/api-contract 0.77.0 → 0.78.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/dist/drafts.js CHANGED
@@ -225,6 +225,12 @@ const CONTENT_WRITES = {
225
225
  locales: LOCALE_WRITES,
226
226
  collectionDefinitions: COLLECTION_WRITES,
227
227
  files: FILE_WRITES,
228
+ memories: {
229
+ list: false,
230
+ add: true,
231
+ change: true,
232
+ delete: true
233
+ },
228
234
  pages: PAGE_WRITES,
229
235
  specialists: SPECIALISTS_WRITES,
230
236
  patrol: SPECIALISTS_WRITES,
@@ -35,6 +35,9 @@ export declare const queryKeys: {
35
35
  layouts: {
36
36
  all: ["camox", string];
37
37
  };
38
+ memories: {
39
+ list: ["camox", string, string];
40
+ };
38
41
  drafts: {
39
42
  all: ["camox", string];
40
43
  list: ["camox", string, string];
@@ -86,6 +86,11 @@ const queryKeys = {
86
86
  ]
87
87
  },
88
88
  layouts: { all: ["camox", "layouts"] },
89
+ memories: { list: [
90
+ "camox",
91
+ "memories",
92
+ "list"
93
+ ] },
89
94
  drafts: {
90
95
  all: ["camox", "drafts"],
91
96
  list: [
package/dist/router.d.ts CHANGED
@@ -1635,7 +1635,7 @@ type DraftRequest = {
1635
1635
  //#endregion
1636
1636
  //#region ../../apps/api/src/domains/drafts/overlay.d.ts
1637
1637
  /** The kinds of entity drafts hold: what changes and conflicts name. */
1638
- declare const ENTITY_KINDS: readonly ["locale", "page", "block", "sharedContent", "repeatableItem", "file", "record", "exclusion"];
1638
+ declare const ENTITY_KINDS: readonly ["locale", "page", "block", "sharedContent", "repeatableItem", "file", "record", "exclusion", "memory"];
1639
1639
  type EntityKind = (typeof ENTITY_KINDS)[number];
1640
1640
  //#endregion
1641
1641
  //#region ../../apps/api/src/domains/revisions/schema.d.ts
@@ -10696,6 +10696,15 @@ type Field = FieldBase & ({
10696
10696
  kind: "Unknown";
10697
10697
  });
10698
10698
  //#endregion
10699
+ //#region ../../apps/api/src/lib/ai-model.d.ts
10700
+ /** A memory a draft adds, changes or deletes: what Camox's agent remembers about the website. */
10701
+ type OverviewMemoryChange = {
10702
+ change: "added" | "changed" | "deleted";
10703
+ text: string;
10704
+ /** For a changed memory, its text on Live. */
10705
+ before?: string;
10706
+ };
10707
+ //#endregion
10699
10708
  //#region ../../apps/api/src/domains/specialists/findings.d.ts
10700
10709
  /** One subject in one locale a check read. */
10701
10710
  type CheckedSubject = {
@@ -10806,22 +10815,14 @@ declare namespace worker_d_exports {
10806
10815
  export { AiJobScheduler, CamoxPreviews, DraftCode, EdgeCache, EdgeCachePurger, ProjectCode, ProjectCreationWorkflow, ProjectDeletionWorkflow, ProjectRoom, ProjectUpgradeWorkflow, PublishWorkflow, ReleaseWorkflow, Thread, UpgradeWorkflow, _default as default };
10807
10816
  }
10808
10817
  /**
10809
- * What dispatch asks the API before it sends a request to a draft with code's revision, or to a
10810
- * website's user Worker, over its `API` service binding (apps/dispatch/src/previews.ts,
10811
- * apps/dispatch/src/live-script.ts). No public route reaches it.
10818
+ * What dispatch asks the API before it sends a request to a draft with code's revision, over its
10819
+ * `API` service binding (apps/dispatch/src/previews.ts). No public route reaches it.
10812
10820
  */
10813
10821
  declare class CamoxPreviews extends WorkerEntrypoint<Bindings> {
10814
10822
  /** The revision a draft previews, if the request's session can see the draft. */
10815
10823
  previewedRevision(question: PreviewQuestion): Promise<RevisionToLoad | null>;
10816
10824
  /** The revision a draft previews, for a look document carrying a look token for the draft. */
10817
10825
  lookedRevision(question: LookQuestion): Promise<RevisionToLoad | null>;
10818
- /**
10819
- * The user Worker serving the website of the project `project` (its Project ID): a publish's
10820
- * script, or null for the one named after its Project ID.
10821
- */
10822
- liveScript({ project }: {
10823
- project: string;
10824
- }): Promise<string | null>;
10825
10826
  }
10826
10827
  declare const _default: ExportedHandler<Bindings>;
10827
10828
  //#endregion
@@ -11047,6 +11048,38 @@ type Person = {
11047
11048
  name: string;
11048
11049
  };
11049
11050
  //#endregion
11051
+ //#region ../../apps/api/src/domains/memories/memory.d.ts
11052
+ /**
11053
+ * Where a memory comes from, as members see it: for a member's words, whether the draft they were
11054
+ * said in was published since, which takes its thread to its Publication (ADR 0045).
11055
+ */
11056
+ type MemorySourceView = {
11057
+ kind: "studio";
11058
+ } | {
11059
+ kind: "thread";
11060
+ quote: string;
11061
+ draftId: string;
11062
+ published: boolean;
11063
+ };
11064
+ /** One memory, as members and models see it. */
11065
+ type MemoryView = {
11066
+ id: string;
11067
+ text: string;
11068
+ /** The member who taught it. */
11069
+ author: Person;
11070
+ source: MemorySourceView;
11071
+ /** When it was taught. */
11072
+ createdAt: number;
11073
+ updatedAt: number;
11074
+ };
11075
+ /**
11076
+ * A memory a draft adds, changes or deletes, as its review lists it: its text in the draft, or
11077
+ * Live's for one it deletes, and Live's before a change.
11078
+ */
11079
+ type MemoryChange = OverviewMemoryChange & {
11080
+ id: string;
11081
+ };
11082
+ //#endregion
11050
11083
  //#region ../../apps/api/src/domains/drafts/list.d.ts
11051
11084
  type DraftSummary = {
11052
11085
  id: string;
@@ -11174,6 +11207,8 @@ type Problem = Subject & InLocale & ProblemPlace & {
11174
11207
  type PublishPreview = {
11175
11208
  blockers: Problem[];
11176
11209
  changes: Change[];
11210
+ /** The memories among `changes`, with their text and Live's before a change (ADR 0049). */
11211
+ memoryChanges: MemoryChange[];
11177
11212
  /** The tag of the default locale, which the others are translated from (null: none yet). */
11178
11213
  defaultLocale: string | null;
11179
11214
  /** The draft's overview: AI's headline and bullets about its changes. */
@@ -17062,6 +17097,351 @@ declare const router: {
17062
17097
  width: number | null;
17063
17098
  }> | undefined>, Record<never, never>, Record<never, never>>;
17064
17099
  };
17100
+ memories: {
17101
+ list: import("@orpc/server").DecoratedProcedure<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<BaseContext & Record<never, never>, BaseContext, BaseContext>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17102
+ draft: DraftRequest | null;
17103
+ locale: string | undefined;
17104
+ publishingDraft: string | undefined;
17105
+ look: LookGrant | undefined;
17106
+ }>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17107
+ draft: DraftRequest | null;
17108
+ locale: string | undefined;
17109
+ publishingDraft: string | undefined;
17110
+ look: LookGrant | undefined;
17111
+ }>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17112
+ draft: DraftRequest | null;
17113
+ locale: string | undefined;
17114
+ publishingDraft: string | undefined;
17115
+ look: LookGrant | undefined;
17116
+ }>, {
17117
+ db: Database;
17118
+ env: Bindings;
17119
+ headers: Headers;
17120
+ client: string;
17121
+ telemetryDisabled: boolean;
17122
+ waitUntil: (promise: Promise<unknown>) => void;
17123
+ apiOrigin?: string;
17124
+ draft: DraftRequest | null;
17125
+ locale: string | undefined;
17126
+ publishingDraft: string | undefined;
17127
+ look: LookGrant | undefined;
17128
+ user: {
17129
+ id: string;
17130
+ createdAt: Date;
17131
+ updatedAt: Date;
17132
+ email: string;
17133
+ emailVerified: boolean;
17134
+ name: string;
17135
+ image?: string | null | undefined;
17136
+ };
17137
+ session: {
17138
+ id: string;
17139
+ createdAt: Date;
17140
+ updatedAt: Date;
17141
+ userId: string;
17142
+ expiresAt: Date;
17143
+ token: string;
17144
+ ipAddress?: string | null | undefined;
17145
+ userAgent?: string | null | undefined;
17146
+ activeOrganizationId?: string | null | undefined;
17147
+ local?: boolean | null | undefined;
17148
+ studio?: boolean | null | undefined;
17149
+ };
17150
+ }>, import("zod").ZodObject<{
17151
+ projectId: import("zod").ZodNumber;
17152
+ }, import("zod/v4/core").$strip>, import("@orpc/server").Schema<{
17153
+ memories: MemoryView[];
17154
+ usedWords: number;
17155
+ limitWords: number;
17156
+ }, {
17157
+ memories: MemoryView[];
17158
+ usedWords: number;
17159
+ limitWords: number;
17160
+ }>, Record<never, never>, Record<never, never>>;
17161
+ add: import("@orpc/server").DecoratedProcedure<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<BaseContext & Record<never, never>, BaseContext, BaseContext>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17162
+ draft: DraftRequest | null;
17163
+ locale: string | undefined;
17164
+ publishingDraft: string | undefined;
17165
+ look: LookGrant | undefined;
17166
+ }>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17167
+ draft: DraftRequest | null;
17168
+ locale: string | undefined;
17169
+ publishingDraft: string | undefined;
17170
+ look: LookGrant | undefined;
17171
+ }>>, {
17172
+ draft: DraftRequest | null;
17173
+ } & Record<never, never>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17174
+ draft: DraftRequest | null;
17175
+ locale: string | undefined;
17176
+ publishingDraft: string | undefined;
17177
+ look: LookGrant | undefined;
17178
+ }>, {
17179
+ db: Database;
17180
+ env: Bindings;
17181
+ headers: Headers;
17182
+ client: string;
17183
+ telemetryDisabled: boolean;
17184
+ waitUntil: (promise: Promise<unknown>) => void;
17185
+ apiOrigin?: string;
17186
+ draft: DraftRequest | null;
17187
+ locale: string | undefined;
17188
+ publishingDraft: string | undefined;
17189
+ look: LookGrant | undefined;
17190
+ user: {
17191
+ id: string;
17192
+ createdAt: Date;
17193
+ updatedAt: Date;
17194
+ email: string;
17195
+ emailVerified: boolean;
17196
+ name: string;
17197
+ image?: string | null | undefined;
17198
+ };
17199
+ session: {
17200
+ id: string;
17201
+ createdAt: Date;
17202
+ updatedAt: Date;
17203
+ userId: string;
17204
+ expiresAt: Date;
17205
+ token: string;
17206
+ ipAddress?: string | null | undefined;
17207
+ userAgent?: string | null | undefined;
17208
+ activeOrganizationId?: string | null | undefined;
17209
+ local?: boolean | null | undefined;
17210
+ studio?: boolean | null | undefined;
17211
+ };
17212
+ }>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17213
+ draft: DraftRequest | null;
17214
+ locale: string | undefined;
17215
+ publishingDraft: string | undefined;
17216
+ look: LookGrant | undefined;
17217
+ }>, {
17218
+ db: Database;
17219
+ env: Bindings;
17220
+ headers: Headers;
17221
+ client: string;
17222
+ telemetryDisabled: boolean;
17223
+ waitUntil: (promise: Promise<unknown>) => void;
17224
+ apiOrigin?: string;
17225
+ draft: DraftRequest | null;
17226
+ locale: string | undefined;
17227
+ publishingDraft: string | undefined;
17228
+ look: LookGrant | undefined;
17229
+ user: {
17230
+ id: string;
17231
+ createdAt: Date;
17232
+ updatedAt: Date;
17233
+ email: string;
17234
+ emailVerified: boolean;
17235
+ name: string;
17236
+ image?: string | null | undefined;
17237
+ };
17238
+ session: {
17239
+ id: string;
17240
+ createdAt: Date;
17241
+ updatedAt: Date;
17242
+ userId: string;
17243
+ expiresAt: Date;
17244
+ token: string;
17245
+ ipAddress?: string | null | undefined;
17246
+ userAgent?: string | null | undefined;
17247
+ activeOrganizationId?: string | null | undefined;
17248
+ local?: boolean | null | undefined;
17249
+ studio?: boolean | null | undefined;
17250
+ };
17251
+ }>, Record<never, never>>, import("zod").ZodObject<{
17252
+ projectId: import("zod").ZodNumber;
17253
+ text: import("zod").ZodString;
17254
+ }, import("zod/v4/core").$strip>, import("@orpc/server").Schema<MemoryView, MemoryView>, Record<never, never>, Record<never, never>>;
17255
+ change: import("@orpc/server").DecoratedProcedure<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<BaseContext & Record<never, never>, BaseContext, BaseContext>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17256
+ draft: DraftRequest | null;
17257
+ locale: string | undefined;
17258
+ publishingDraft: string | undefined;
17259
+ look: LookGrant | undefined;
17260
+ }>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17261
+ draft: DraftRequest | null;
17262
+ locale: string | undefined;
17263
+ publishingDraft: string | undefined;
17264
+ look: LookGrant | undefined;
17265
+ }>>, {
17266
+ draft: DraftRequest | null;
17267
+ } & Record<never, never>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17268
+ draft: DraftRequest | null;
17269
+ locale: string | undefined;
17270
+ publishingDraft: string | undefined;
17271
+ look: LookGrant | undefined;
17272
+ }>, {
17273
+ db: Database;
17274
+ env: Bindings;
17275
+ headers: Headers;
17276
+ client: string;
17277
+ telemetryDisabled: boolean;
17278
+ waitUntil: (promise: Promise<unknown>) => void;
17279
+ apiOrigin?: string;
17280
+ draft: DraftRequest | null;
17281
+ locale: string | undefined;
17282
+ publishingDraft: string | undefined;
17283
+ look: LookGrant | undefined;
17284
+ user: {
17285
+ id: string;
17286
+ createdAt: Date;
17287
+ updatedAt: Date;
17288
+ email: string;
17289
+ emailVerified: boolean;
17290
+ name: string;
17291
+ image?: string | null | undefined;
17292
+ };
17293
+ session: {
17294
+ id: string;
17295
+ createdAt: Date;
17296
+ updatedAt: Date;
17297
+ userId: string;
17298
+ expiresAt: Date;
17299
+ token: string;
17300
+ ipAddress?: string | null | undefined;
17301
+ userAgent?: string | null | undefined;
17302
+ activeOrganizationId?: string | null | undefined;
17303
+ local?: boolean | null | undefined;
17304
+ studio?: boolean | null | undefined;
17305
+ };
17306
+ }>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17307
+ draft: DraftRequest | null;
17308
+ locale: string | undefined;
17309
+ publishingDraft: string | undefined;
17310
+ look: LookGrant | undefined;
17311
+ }>, {
17312
+ db: Database;
17313
+ env: Bindings;
17314
+ headers: Headers;
17315
+ client: string;
17316
+ telemetryDisabled: boolean;
17317
+ waitUntil: (promise: Promise<unknown>) => void;
17318
+ apiOrigin?: string;
17319
+ draft: DraftRequest | null;
17320
+ locale: string | undefined;
17321
+ publishingDraft: string | undefined;
17322
+ look: LookGrant | undefined;
17323
+ user: {
17324
+ id: string;
17325
+ createdAt: Date;
17326
+ updatedAt: Date;
17327
+ email: string;
17328
+ emailVerified: boolean;
17329
+ name: string;
17330
+ image?: string | null | undefined;
17331
+ };
17332
+ session: {
17333
+ id: string;
17334
+ createdAt: Date;
17335
+ updatedAt: Date;
17336
+ userId: string;
17337
+ expiresAt: Date;
17338
+ token: string;
17339
+ ipAddress?: string | null | undefined;
17340
+ userAgent?: string | null | undefined;
17341
+ activeOrganizationId?: string | null | undefined;
17342
+ local?: boolean | null | undefined;
17343
+ studio?: boolean | null | undefined;
17344
+ };
17345
+ }>, Record<never, never>>, import("zod").ZodObject<{
17346
+ projectId: import("zod").ZodNumber;
17347
+ id: import("zod").ZodString;
17348
+ text: import("zod").ZodString;
17349
+ }, import("zod/v4/core").$strip>, import("@orpc/server").Schema<MemoryView, MemoryView>, Record<never, never>, Record<never, never>>;
17350
+ delete: import("@orpc/server").DecoratedProcedure<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<BaseContext & Record<never, never>, BaseContext, BaseContext>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17351
+ draft: DraftRequest | null;
17352
+ locale: string | undefined;
17353
+ publishingDraft: string | undefined;
17354
+ look: LookGrant | undefined;
17355
+ }>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17356
+ draft: DraftRequest | null;
17357
+ locale: string | undefined;
17358
+ publishingDraft: string | undefined;
17359
+ look: LookGrant | undefined;
17360
+ }>>, {
17361
+ draft: DraftRequest | null;
17362
+ } & Record<never, never>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17363
+ draft: DraftRequest | null;
17364
+ locale: string | undefined;
17365
+ publishingDraft: string | undefined;
17366
+ look: LookGrant | undefined;
17367
+ }>, {
17368
+ db: Database;
17369
+ env: Bindings;
17370
+ headers: Headers;
17371
+ client: string;
17372
+ telemetryDisabled: boolean;
17373
+ waitUntil: (promise: Promise<unknown>) => void;
17374
+ apiOrigin?: string;
17375
+ draft: DraftRequest | null;
17376
+ locale: string | undefined;
17377
+ publishingDraft: string | undefined;
17378
+ look: LookGrant | undefined;
17379
+ user: {
17380
+ id: string;
17381
+ createdAt: Date;
17382
+ updatedAt: Date;
17383
+ email: string;
17384
+ emailVerified: boolean;
17385
+ name: string;
17386
+ image?: string | null | undefined;
17387
+ };
17388
+ session: {
17389
+ id: string;
17390
+ createdAt: Date;
17391
+ updatedAt: Date;
17392
+ userId: string;
17393
+ expiresAt: Date;
17394
+ token: string;
17395
+ ipAddress?: string | null | undefined;
17396
+ userAgent?: string | null | undefined;
17397
+ activeOrganizationId?: string | null | undefined;
17398
+ local?: boolean | null | undefined;
17399
+ studio?: boolean | null | undefined;
17400
+ };
17401
+ }>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17402
+ draft: DraftRequest | null;
17403
+ locale: string | undefined;
17404
+ publishingDraft: string | undefined;
17405
+ look: LookGrant | undefined;
17406
+ }>, {
17407
+ db: Database;
17408
+ env: Bindings;
17409
+ headers: Headers;
17410
+ client: string;
17411
+ telemetryDisabled: boolean;
17412
+ waitUntil: (promise: Promise<unknown>) => void;
17413
+ apiOrigin?: string;
17414
+ draft: DraftRequest | null;
17415
+ locale: string | undefined;
17416
+ publishingDraft: string | undefined;
17417
+ look: LookGrant | undefined;
17418
+ user: {
17419
+ id: string;
17420
+ createdAt: Date;
17421
+ updatedAt: Date;
17422
+ email: string;
17423
+ emailVerified: boolean;
17424
+ name: string;
17425
+ image?: string | null | undefined;
17426
+ };
17427
+ session: {
17428
+ id: string;
17429
+ createdAt: Date;
17430
+ updatedAt: Date;
17431
+ userId: string;
17432
+ expiresAt: Date;
17433
+ token: string;
17434
+ ipAddress?: string | null | undefined;
17435
+ userAgent?: string | null | undefined;
17436
+ activeOrganizationId?: string | null | undefined;
17437
+ local?: boolean | null | undefined;
17438
+ studio?: boolean | null | undefined;
17439
+ };
17440
+ }>, Record<never, never>>, import("zod").ZodObject<{
17441
+ projectId: import("zod").ZodNumber;
17442
+ id: import("zod").ZodString;
17443
+ }, import("zod/v4/core").$strip>, import("@orpc/server").Schema<MemoryView, MemoryView>, Record<never, never>, Record<never, never>>;
17444
+ };
17065
17445
  repeatableItems: {
17066
17446
  get: import("@orpc/server").DecoratedProcedure<import("@orpc/server").MergedInitialContext<import("@orpc/server").MergedInitialContext<BaseContext & Record<never, never>, BaseContext, BaseContext>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
17067
17447
  draft: DraftRequest | null;
@@ -19311,6 +19691,7 @@ declare const router: {
19311
19691
  token: string;
19312
19692
  blockers: Problem[];
19313
19693
  changes: Change[];
19694
+ memoryChanges: MemoryChange[];
19314
19695
  defaultLocale: string;
19315
19696
  overview: {
19316
19697
  status: "pending";
@@ -19336,6 +19717,7 @@ declare const router: {
19336
19717
  token: string;
19337
19718
  blockers: Problem[];
19338
19719
  changes: Change[];
19720
+ memoryChanges: MemoryChange[];
19339
19721
  defaultLocale: string;
19340
19722
  overview: {
19341
19723
  status: "pending";
@@ -19740,6 +20122,7 @@ declare const router: {
19740
20122
  exclusion: "exclusion";
19741
20123
  file: "file";
19742
20124
  locale: "locale";
20125
+ memory: "memory";
19743
20126
  page: "page";
19744
20127
  record: "record";
19745
20128
  repeatableItem: "repeatableItem";
package/dist/threads.d.ts CHANGED
@@ -44,6 +44,11 @@ export declare const BRIEF_ENTRY = "camox.brief";
44
44
  * it at the end of the conversation; editors never see it, since the draft's card says so.
45
45
  */
46
46
  export declare const DRAFT_ENDED_ENTRY = "camox.draft-ended";
47
+ /**
48
+ * The kind of the transcript entry holding Camox's note on memory, as it read when it changed
49
+ * since the model last saw it (ADR 0049). Only the model reads it.
50
+ */
51
+ export declare const MEMORY_ENTRY = "camox.memory";
47
52
  /**
48
53
  * The kind of the transcript entry a Live thread starts afresh from once its agent handed a
49
54
  * request off to a draft (ADR 0036): a reset of Pi's context, with a `startedDraftCardSchema` as
package/dist/threads.js CHANGED
@@ -43,6 +43,11 @@ const BRIEF_ENTRY = "camox.brief";
43
43
  */
44
44
  const DRAFT_ENDED_ENTRY = "camox.draft-ended";
45
45
  /**
46
+ * The kind of the transcript entry holding Camox's note on memory, as it read when it changed
47
+ * since the model last saw it (ADR 0049). Only the model reads it.
48
+ */
49
+ const MEMORY_ENTRY = "camox.memory";
50
+ /**
46
51
  * The kind of the transcript entry a Live thread starts afresh from once its agent handed a
47
52
  * request off to a draft (ADR 0036): a reset of Pi's context, with a `startedDraftCardSchema` as
48
53
  * data. Editors see an empty thread, and the model reads a note naming the draft. Everything
@@ -145,13 +150,16 @@ const handsOff = (name) => HANDING_OFF_TOOLS.has(name);
145
150
  const CHANGING_TOOLS = /* @__PURE__ */ new Set([
146
151
  "addBackToLocale",
147
152
  "addLocale",
153
+ "addMemory",
148
154
  "applyFindingFix",
155
+ "changeMemory",
149
156
  "copyFromPastWork",
150
157
  "createBlock",
151
158
  "createCollectionRecord",
152
159
  "createPage",
153
160
  "deleteBlock",
154
161
  "deleteCollectionRecord",
162
+ "deleteMemory",
155
163
  "deletePage",
156
164
  "editBlock",
157
165
  "editCollectionRecord",
@@ -425,7 +433,7 @@ function threadStepOf(entry) {
425
433
  status: build.status
426
434
  };
427
435
  }
428
- if (entry.kind === "camox.draft-ended") return void 0;
436
+ if (entry.kind === "camox.draft-ended" || entry.kind === "camox.memory") return void 0;
429
437
  if (entry.kind === "camox.push") {
430
438
  const push = pushDataSchema.safeParse(entry.data).data;
431
439
  return push && {
@@ -801,4 +809,4 @@ function reduceThreadFrame(state, frame) {
801
809
  }
802
810
 
803
811
  //#endregion
804
- export { ARTIFACT_REQUEST_ENTRY, ARTIFACT_TOOL, ASK_TOOL, BRIEF_ENTRY, BUILD_STATUS_ENTRY, BUILD_TOOL, CHANGING_TOOLS, CODE_REQUEST_ENTRY, CODE_TOOL, CONNECTED_AGENT_MESSAGE_ENTRY, DRAFT_CARD_ENTRY, DRAFT_ENDED_ENTRY, EDITOR_MESSAGE_ENTRY, EMPTY_THREAD_STATE, EMPTY_THREAD_VIEW, LOOK_TOOL, PUSH_ENTRY, QUESTIONS_ENTRY, RECONCILE_ENTRY, RESTORE_DRAFT_TOOL, RUN_STOPPED_ENTRY, START_DRAFT_TOOL, THREAD_ENDED_CLOSE_CODE, agentActivitySchema, artifactRequestDataSchema, buildStatusDataSchema, buildStatusSchema, codeRequestDataSchema, connectedAgentClientSchema, connectedAgentMessageDataSchema, editorMessageDataSchema, editorSelectionSchema, editorTextOf, editorWhereSchema, handOffDetailsSchema, handsOff, handsOffToDraft, isSender, messageAttachmentSchema, pushDataSchema, pushOutcomeSchema, questionsDataSchema, reconcileDataSchema, reduceThreadEvents, reduceThreadFrame, reduceThreadState, startedDraftCardSchema, startedDraftSchema, textOf, threadClientMessageSchema, threadSenderSchema, threadViewOf, touchKindSchema, touchSchema, touchedBatchSchema };
812
+ export { ARTIFACT_REQUEST_ENTRY, ARTIFACT_TOOL, ASK_TOOL, BRIEF_ENTRY, BUILD_STATUS_ENTRY, BUILD_TOOL, CHANGING_TOOLS, CODE_REQUEST_ENTRY, CODE_TOOL, CONNECTED_AGENT_MESSAGE_ENTRY, DRAFT_CARD_ENTRY, DRAFT_ENDED_ENTRY, EDITOR_MESSAGE_ENTRY, EMPTY_THREAD_STATE, EMPTY_THREAD_VIEW, LOOK_TOOL, MEMORY_ENTRY, PUSH_ENTRY, QUESTIONS_ENTRY, RECONCILE_ENTRY, RESTORE_DRAFT_TOOL, RUN_STOPPED_ENTRY, START_DRAFT_TOOL, THREAD_ENDED_CLOSE_CODE, agentActivitySchema, artifactRequestDataSchema, buildStatusDataSchema, buildStatusSchema, codeRequestDataSchema, connectedAgentClientSchema, connectedAgentMessageDataSchema, editorMessageDataSchema, editorSelectionSchema, editorTextOf, editorWhereSchema, handOffDetailsSchema, handsOff, handsOffToDraft, isSender, messageAttachmentSchema, pushDataSchema, pushOutcomeSchema, questionsDataSchema, reconcileDataSchema, reduceThreadEvents, reduceThreadFrame, reduceThreadState, startedDraftCardSchema, startedDraftSchema, textOf, threadClientMessageSchema, threadSenderSchema, threadViewOf, touchKindSchema, touchSchema, touchedBatchSchema };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@camox/api-contract",
3
- "version": "0.77.0",
4
- "license": "MIT",
3
+ "version": "0.78.0",
4
+ "license": "UNLICENSED",
5
5
  "files": [
6
6
  "src",
7
7
  "dist"
package/src/drafts.ts CHANGED
@@ -335,12 +335,21 @@ const SPECIALISTS_WRITES: Record<keyof Router["specialists"], boolean> = {
335
335
  dismissFinding: false,
336
336
  };
337
337
 
338
+ // Memory changes through drafts, like content (ADR 0049).
339
+ const MEMORY_WRITES: Record<keyof Router["memories"], boolean> = {
340
+ list: false,
341
+ add: true,
342
+ change: true,
343
+ delete: true,
344
+ };
345
+
338
346
  // `definitions` is absent: its sync is a release, never a studio content write.
339
347
  const CONTENT_WRITES: Partial<Record<keyof Router, Record<string, boolean>>> = {
340
348
  blocks: BLOCK_WRITES,
341
349
  locales: LOCALE_WRITES,
342
350
  collectionDefinitions: COLLECTION_WRITES,
343
351
  files: FILE_WRITES,
352
+ memories: MEMORY_WRITES,
344
353
  pages: PAGE_WRITES,
345
354
  specialists: SPECIALISTS_WRITES,
346
355
  // The old name of `specialists`, for studios not yet upgraded (ADR 0019).
package/src/query-keys.ts CHANGED
@@ -52,6 +52,10 @@ export const queryKeys = {
52
52
  layouts: {
53
53
  all: ["camox", "layouts"],
54
54
  },
55
+ // A scope's memory (ADR 0049).
56
+ memories: {
57
+ list: ["camox", "memories", "list"],
58
+ },
55
59
  drafts: {
56
60
  all: ["camox", "drafts"],
57
61
  // Open drafts and Live's latest publish: the same for every viewer, whatever they're in.
package/src/threads.ts CHANGED
@@ -56,6 +56,12 @@ export const BRIEF_ENTRY = "camox.brief";
56
56
  */
57
57
  export const DRAFT_ENDED_ENTRY = "camox.draft-ended";
58
58
 
59
+ /**
60
+ * The kind of the transcript entry holding Camox's note on memory, as it read when it changed
61
+ * since the model last saw it (ADR 0049). Only the model reads it.
62
+ */
63
+ export const MEMORY_ENTRY = "camox.memory";
64
+
59
65
  /**
60
66
  * The kind of the transcript entry a Live thread starts afresh from once its agent handed a
61
67
  * request off to a draft (ADR 0036): a reset of Pi's context, with a `startedDraftCardSchema` as
@@ -179,13 +185,16 @@ export const CHANGING_TOOLS: ReadonlySet<string> = new Set([
179
185
  // Content
180
186
  "addBackToLocale",
181
187
  "addLocale",
188
+ "addMemory",
182
189
  "applyFindingFix",
190
+ "changeMemory",
183
191
  "copyFromPastWork",
184
192
  "createBlock",
185
193
  "createCollectionRecord",
186
194
  "createPage",
187
195
  "deleteBlock",
188
196
  "deleteCollectionRecord",
197
+ "deleteMemory",
189
198
  "deletePage",
190
199
  "editBlock",
191
200
  "editCollectionRecord",
@@ -643,7 +652,7 @@ function threadStepOf(entry: EntryRecord): ThreadStep | undefined {
643
652
  return build && { id, type: "build", status: build.status };
644
653
  }
645
654
  // Only the model reads it: as a user message, it would otherwise read as Pi continuing a run.
646
- if (entry.kind === DRAFT_ENDED_ENTRY) return undefined;
655
+ if (entry.kind === DRAFT_ENDED_ENTRY || entry.kind === MEMORY_ENTRY) return undefined;
647
656
  if (entry.kind === PUSH_ENTRY) {
648
657
  const push = pushDataSchema.safeParse(entry.data).data;
649
658
  return push && { id, type: "push", ...push };
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- # MIT License
2
-
3
- Copyright 2026 Rémi de Juvigny
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
- of the Software, and to permit persons to whom the Software is furnished to do
10
- so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.