@camox/api-contract 0.76.1 → 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
@@ -209,9 +209,11 @@ const LOCALE_WRITES = {
209
209
  list: false,
210
210
  add: true,
211
211
  remove: true,
212
+ setDefault: true,
212
213
  setDefaultTag: false,
213
214
  listMissing: false,
214
- addBack: true
215
+ addBack: true,
216
+ retranslate: true
215
217
  };
216
218
  const SPECIALISTS_WRITES = {
217
219
  get: false,
@@ -223,6 +225,12 @@ const CONTENT_WRITES = {
223
225
  locales: LOCALE_WRITES,
224
226
  collectionDefinitions: COLLECTION_WRITES,
225
227
  files: FILE_WRITES,
228
+ memories: {
229
+ list: false,
230
+ add: true,
231
+ change: true,
232
+ delete: true
233
+ },
226
234
  pages: PAGE_WRITES,
227
235
  specialists: SPECIALISTS_WRITES,
228
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
@@ -9617,6 +9617,8 @@ type TurnOutcome = TurnEnd | {
9617
9617
  type OpeningSender = {
9618
9618
  kind: "editor";
9619
9619
  editor: ThreadSender;
9620
+ /** The locale the editor was in as they sent it, in the studio. */
9621
+ locale?: string;
9620
9622
  } | {
9621
9623
  kind: "connectedAgent";
9622
9624
  member: ThreadSender;
@@ -10694,6 +10696,15 @@ type Field = FieldBase & ({
10694
10696
  kind: "Unknown";
10695
10697
  });
10696
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
10697
10708
  //#region ../../apps/api/src/domains/specialists/findings.d.ts
10698
10709
  /** One subject in one locale a check read. */
10699
10710
  type CheckedSubject = {
@@ -10804,22 +10815,14 @@ declare namespace worker_d_exports {
10804
10815
  export { AiJobScheduler, CamoxPreviews, DraftCode, EdgeCache, EdgeCachePurger, ProjectCode, ProjectCreationWorkflow, ProjectDeletionWorkflow, ProjectRoom, ProjectUpgradeWorkflow, PublishWorkflow, ReleaseWorkflow, Thread, UpgradeWorkflow, _default as default };
10805
10816
  }
10806
10817
  /**
10807
- * What dispatch asks the API before it sends a request to a draft with code's revision, or to a
10808
- * website's user Worker, over its `API` service binding (apps/dispatch/src/previews.ts,
10809
- * 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.
10810
10820
  */
10811
10821
  declare class CamoxPreviews extends WorkerEntrypoint<Bindings> {
10812
10822
  /** The revision a draft previews, if the request's session can see the draft. */
10813
10823
  previewedRevision(question: PreviewQuestion): Promise<RevisionToLoad | null>;
10814
10824
  /** The revision a draft previews, for a look document carrying a look token for the draft. */
10815
10825
  lookedRevision(question: LookQuestion): Promise<RevisionToLoad | null>;
10816
- /**
10817
- * The user Worker serving the website of the project `project` (its Project ID): a publish's
10818
- * script, or null for the one named after its Project ID.
10819
- */
10820
- liveScript({ project }: {
10821
- project: string;
10822
- }): Promise<string | null>;
10823
10826
  }
10824
10827
  declare const _default: ExportedHandler<Bindings>;
10825
10828
  //#endregion
@@ -11045,6 +11048,38 @@ type Person = {
11045
11048
  name: string;
11046
11049
  };
11047
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
11048
11083
  //#region ../../apps/api/src/domains/drafts/list.d.ts
11049
11084
  type DraftSummary = {
11050
11085
  id: string;
@@ -11172,6 +11207,8 @@ type Problem = Subject & InLocale & ProblemPlace & {
11172
11207
  type PublishPreview = {
11173
11208
  blockers: Problem[];
11174
11209
  changes: Change[];
11210
+ /** The memories among `changes`, with their text and Live's before a change (ADR 0049). */
11211
+ memoryChanges: MemoryChange[];
11175
11212
  /** The tag of the default locale, which the others are translated from (null: none yet). */
11176
11213
  defaultLocale: string | null;
11177
11214
  /** The draft's overview: AI's headline and bullets about its changes. */
@@ -15742,6 +15779,100 @@ declare const router: {
15742
15779
  projectId: import("zod").ZodNumber;
15743
15780
  tag: import("zod").ZodString;
15744
15781
  }, import("zod/v4/core").$strip>, import("@orpc/server").Schema<LocaleView, LocaleView>, Record<never, never>, Record<never, never>>;
15782
+ setDefault: 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>>, {
15783
+ draft: DraftRequest | null;
15784
+ locale: string | undefined;
15785
+ publishingDraft: string | undefined;
15786
+ look: LookGrant | undefined;
15787
+ }>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
15788
+ draft: DraftRequest | null;
15789
+ locale: string | undefined;
15790
+ publishingDraft: string | undefined;
15791
+ look: LookGrant | undefined;
15792
+ }>>, {
15793
+ draft: DraftRequest | null;
15794
+ } & Record<never, never>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
15795
+ draft: DraftRequest | null;
15796
+ locale: string | undefined;
15797
+ publishingDraft: string | undefined;
15798
+ look: LookGrant | undefined;
15799
+ }>, {
15800
+ db: Database;
15801
+ env: Bindings;
15802
+ headers: Headers;
15803
+ client: string;
15804
+ telemetryDisabled: boolean;
15805
+ waitUntil: (promise: Promise<unknown>) => void;
15806
+ apiOrigin?: string;
15807
+ draft: DraftRequest | null;
15808
+ locale: string | undefined;
15809
+ publishingDraft: string | undefined;
15810
+ look: LookGrant | undefined;
15811
+ user: {
15812
+ id: string;
15813
+ createdAt: Date;
15814
+ updatedAt: Date;
15815
+ email: string;
15816
+ emailVerified: boolean;
15817
+ name: string;
15818
+ image?: string | null | undefined;
15819
+ };
15820
+ session: {
15821
+ id: string;
15822
+ createdAt: Date;
15823
+ updatedAt: Date;
15824
+ userId: string;
15825
+ expiresAt: Date;
15826
+ token: string;
15827
+ ipAddress?: string | null | undefined;
15828
+ userAgent?: string | null | undefined;
15829
+ activeOrganizationId?: string | null | undefined;
15830
+ local?: boolean | null | undefined;
15831
+ studio?: boolean | null | undefined;
15832
+ };
15833
+ }>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
15834
+ draft: DraftRequest | null;
15835
+ locale: string | undefined;
15836
+ publishingDraft: string | undefined;
15837
+ look: LookGrant | undefined;
15838
+ }>, {
15839
+ db: Database;
15840
+ env: Bindings;
15841
+ headers: Headers;
15842
+ client: string;
15843
+ telemetryDisabled: boolean;
15844
+ waitUntil: (promise: Promise<unknown>) => void;
15845
+ apiOrigin?: string;
15846
+ draft: DraftRequest | null;
15847
+ locale: string | undefined;
15848
+ publishingDraft: string | undefined;
15849
+ look: LookGrant | undefined;
15850
+ user: {
15851
+ id: string;
15852
+ createdAt: Date;
15853
+ updatedAt: Date;
15854
+ email: string;
15855
+ emailVerified: boolean;
15856
+ name: string;
15857
+ image?: string | null | undefined;
15858
+ };
15859
+ session: {
15860
+ id: string;
15861
+ createdAt: Date;
15862
+ updatedAt: Date;
15863
+ userId: string;
15864
+ expiresAt: Date;
15865
+ token: string;
15866
+ ipAddress?: string | null | undefined;
15867
+ userAgent?: string | null | undefined;
15868
+ activeOrganizationId?: string | null | undefined;
15869
+ local?: boolean | null | undefined;
15870
+ studio?: boolean | null | undefined;
15871
+ };
15872
+ }>, Record<never, never>>, import("zod").ZodObject<{
15873
+ projectId: import("zod").ZodNumber;
15874
+ tag: import("zod").ZodString;
15875
+ }, import("zod/v4/core").$strip>, import("@orpc/server").Schema<LocaleView, LocaleView>, Record<never, never>, Record<never, never>>;
15745
15876
  setDefaultTag: 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>>, {
15746
15877
  draft: DraftRequest | null;
15747
15878
  locale: string | undefined;
@@ -15957,6 +16088,114 @@ declare const router: {
15957
16088
  entity: "page" | "record";
15958
16089
  id: string;
15959
16090
  }>, Record<never, never>, Record<never, never>>;
16091
+ retranslate: 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>>, {
16092
+ draft: DraftRequest | null;
16093
+ locale: string | undefined;
16094
+ publishingDraft: string | undefined;
16095
+ look: LookGrant | undefined;
16096
+ }>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
16097
+ draft: DraftRequest | null;
16098
+ locale: string | undefined;
16099
+ publishingDraft: string | undefined;
16100
+ look: LookGrant | undefined;
16101
+ }>>, {
16102
+ draft: DraftRequest | null;
16103
+ } & Record<never, never>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
16104
+ draft: DraftRequest | null;
16105
+ locale: string | undefined;
16106
+ publishingDraft: string | undefined;
16107
+ look: LookGrant | undefined;
16108
+ }>, {
16109
+ db: Database;
16110
+ env: Bindings;
16111
+ headers: Headers;
16112
+ client: string;
16113
+ telemetryDisabled: boolean;
16114
+ waitUntil: (promise: Promise<unknown>) => void;
16115
+ apiOrigin?: string;
16116
+ draft: DraftRequest | null;
16117
+ locale: string | undefined;
16118
+ publishingDraft: string | undefined;
16119
+ look: LookGrant | undefined;
16120
+ user: {
16121
+ id: string;
16122
+ createdAt: Date;
16123
+ updatedAt: Date;
16124
+ email: string;
16125
+ emailVerified: boolean;
16126
+ name: string;
16127
+ image?: string | null | undefined;
16128
+ };
16129
+ session: {
16130
+ id: string;
16131
+ createdAt: Date;
16132
+ updatedAt: Date;
16133
+ userId: string;
16134
+ expiresAt: Date;
16135
+ token: string;
16136
+ ipAddress?: string | null | undefined;
16137
+ userAgent?: string | null | undefined;
16138
+ activeOrganizationId?: string | null | undefined;
16139
+ local?: boolean | null | undefined;
16140
+ studio?: boolean | null | undefined;
16141
+ };
16142
+ }>>, import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<import("@orpc/server").MergedCurrentContext<BaseContext, Record<never, never>>, {
16143
+ draft: DraftRequest | null;
16144
+ locale: string | undefined;
16145
+ publishingDraft: string | undefined;
16146
+ look: LookGrant | undefined;
16147
+ }>, {
16148
+ db: Database;
16149
+ env: Bindings;
16150
+ headers: Headers;
16151
+ client: string;
16152
+ telemetryDisabled: boolean;
16153
+ waitUntil: (promise: Promise<unknown>) => void;
16154
+ apiOrigin?: string;
16155
+ draft: DraftRequest | null;
16156
+ locale: string | undefined;
16157
+ publishingDraft: string | undefined;
16158
+ look: LookGrant | undefined;
16159
+ user: {
16160
+ id: string;
16161
+ createdAt: Date;
16162
+ updatedAt: Date;
16163
+ email: string;
16164
+ emailVerified: boolean;
16165
+ name: string;
16166
+ image?: string | null | undefined;
16167
+ };
16168
+ session: {
16169
+ id: string;
16170
+ createdAt: Date;
16171
+ updatedAt: Date;
16172
+ userId: string;
16173
+ expiresAt: Date;
16174
+ token: string;
16175
+ ipAddress?: string | null | undefined;
16176
+ userAgent?: string | null | undefined;
16177
+ activeOrganizationId?: string | null | undefined;
16178
+ local?: boolean | null | undefined;
16179
+ studio?: boolean | null | undefined;
16180
+ };
16181
+ }>, Record<never, never>>, import("zod").ZodObject<{
16182
+ projectId: import("zod").ZodNumber;
16183
+ entity: import("zod").ZodEnum<{
16184
+ block: "block";
16185
+ page: "page";
16186
+ record: "record";
16187
+ repeatableItem: "repeatableItem";
16188
+ }>;
16189
+ id: import("zod").ZodUUID;
16190
+ }, import("zod/v4/core").$strip>, import("@orpc/server").Schema<{
16191
+ entity: "block" | "page" | "record" | "repeatableItem";
16192
+ id: string;
16193
+ localizations: number;
16194
+ }, {
16195
+ entity: "block" | "page" | "record" | "repeatableItem";
16196
+ id: string;
16197
+ localizations: number;
16198
+ }>, Record<never, never>, Record<never, never>>;
15960
16199
  };
15961
16200
  files: {
15962
16201
  list: 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>>, {
@@ -16858,6 +17097,351 @@ declare const router: {
16858
17097
  width: number | null;
16859
17098
  }> | undefined>, Record<never, never>, Record<never, never>>;
16860
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
+ };
16861
17445
  repeatableItems: {
16862
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>>, {
16863
17447
  draft: DraftRequest | null;
@@ -19107,7 +19691,8 @@ declare const router: {
19107
19691
  token: string;
19108
19692
  blockers: Problem[];
19109
19693
  changes: Change[];
19110
- defaultLocale: string | null;
19694
+ memoryChanges: MemoryChange[];
19695
+ defaultLocale: string;
19111
19696
  overview: {
19112
19697
  status: "pending";
19113
19698
  } | {
@@ -19132,7 +19717,8 @@ declare const router: {
19132
19717
  token: string;
19133
19718
  blockers: Problem[];
19134
19719
  changes: Change[];
19135
- defaultLocale: string | null;
19720
+ memoryChanges: MemoryChange[];
19721
+ defaultLocale: string;
19136
19722
  overview: {
19137
19723
  status: "pending";
19138
19724
  } | {
@@ -19536,6 +20122,7 @@ declare const router: {
19536
20122
  exclusion: "exclusion";
19537
20123
  file: "file";
19538
20124
  locale: "locale";
20125
+ memory: "memory";
19539
20126
  page: "page";
19540
20127
  record: "record";
19541
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
@@ -251,13 +256,19 @@ export declare const pushDataSchema: z.ZodObject<{
251
256
  }>;
252
257
  }, z.core.$strip>;
253
258
  export type PushData = z.infer<typeof pushDataSchema>;
254
- /** What an editor's message entry records: who sent it, and the operation id it was sent with. */
259
+ /**
260
+ * What an editor's message entry records: who sent it, the operation id it was sent with, and the
261
+ * locale they were in as they sent it, which lets the agent change that locale's localizations
262
+ * (ADR 0048).
263
+ */
255
264
  export declare const editorMessageDataSchema: z.ZodObject<{
256
265
  id: z.ZodString;
257
266
  name: z.ZodString;
258
267
  image: z.ZodNullable<z.ZodString>;
259
268
  operationId: z.ZodOptional<z.ZodString>;
269
+ locale: z.ZodOptional<z.ZodString>;
260
270
  }, z.core.$strip>;
271
+ export type EditorMessageData = z.infer<typeof editorMessageDataSchema>;
261
272
  /**
262
273
  * A draft the agent on Live started with `startDraft`, or restored with `restoreDraft`, and the
263
274
  * operation ids of the messages of the run that did: the studio that sent one of them enters the draft, if it still shows
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,18 +150,22 @@ 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",
158
166
  "moveBlock",
159
167
  "removeLocale",
168
+ "retranslateLocalization",
160
169
  "setPageLayout",
161
170
  "setPageSeo",
162
171
  "updateFile",
@@ -221,8 +230,15 @@ const pushDataSchema = z.object({
221
230
  subjects: z.array(z.string()),
222
231
  outcome: pushOutcomeSchema
223
232
  });
224
- /** What an editor's message entry records: who sent it, and the operation id it was sent with. */
225
- const editorMessageDataSchema = threadSenderSchema.extend({ operationId: z.string().optional() });
233
+ /**
234
+ * What an editor's message entry records: who sent it, the operation id it was sent with, and the
235
+ * locale they were in as they sent it, which lets the agent change that locale's localizations
236
+ * (ADR 0048).
237
+ */
238
+ const editorMessageDataSchema = threadSenderSchema.extend({
239
+ operationId: z.string().optional(),
240
+ locale: z.string().optional()
241
+ });
226
242
  /**
227
243
  * A draft the agent on Live started with `startDraft`, or restored with `restoreDraft`, and the
228
244
  * operation ids of the messages of the run that did: the studio that sent one of them enters the draft, if it still shows
@@ -417,7 +433,7 @@ function threadStepOf(entry) {
417
433
  status: build.status
418
434
  };
419
435
  }
420
- if (entry.kind === "camox.draft-ended") return void 0;
436
+ if (entry.kind === "camox.draft-ended" || entry.kind === "camox.memory") return void 0;
421
437
  if (entry.kind === "camox.push") {
422
438
  const push = pushDataSchema.safeParse(entry.data).data;
423
439
  return push && {
@@ -793,4 +809,4 @@ function reduceThreadFrame(state, frame) {
793
809
  }
794
810
 
795
811
  //#endregion
796
- 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.76.1",
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
@@ -320,9 +320,11 @@ const LOCALE_WRITES: Record<keyof Router["locales"], boolean> = {
320
320
  list: false,
321
321
  add: true,
322
322
  remove: true,
323
+ setDefault: true,
323
324
  setDefaultTag: false,
324
325
  listMissing: false,
325
326
  addBack: true,
327
+ retranslate: true,
326
328
  };
327
329
 
328
330
  // Applying a finding's fix edits content as the member would; dismissing one is the project's,
@@ -333,12 +335,21 @@ const SPECIALISTS_WRITES: Record<keyof Router["specialists"], boolean> = {
333
335
  dismissFinding: false,
334
336
  };
335
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
+
336
346
  // `definitions` is absent: its sync is a release, never a studio content write.
337
347
  const CONTENT_WRITES: Partial<Record<keyof Router, Record<string, boolean>>> = {
338
348
  blocks: BLOCK_WRITES,
339
349
  locales: LOCALE_WRITES,
340
350
  collectionDefinitions: COLLECTION_WRITES,
341
351
  files: FILE_WRITES,
352
+ memories: MEMORY_WRITES,
342
353
  pages: PAGE_WRITES,
343
354
  specialists: SPECIALISTS_WRITES,
344
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,18 +185,22 @@ 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",
192
201
  "moveBlock",
193
202
  "removeLocale",
203
+ "retranslateLocalization",
194
204
  "setPageLayout",
195
205
  "setPageSeo",
196
206
  "updateFile",
@@ -284,10 +294,16 @@ export const pushDataSchema = z.object({
284
294
  });
285
295
  export type PushData = z.infer<typeof pushDataSchema>;
286
296
 
287
- /** What an editor's message entry records: who sent it, and the operation id it was sent with. */
297
+ /**
298
+ * What an editor's message entry records: who sent it, the operation id it was sent with, and the
299
+ * locale they were in as they sent it, which lets the agent change that locale's localizations
300
+ * (ADR 0048).
301
+ */
288
302
  export const editorMessageDataSchema = threadSenderSchema.extend({
289
303
  operationId: z.string().optional(),
304
+ locale: z.string().optional(),
290
305
  });
306
+ export type EditorMessageData = z.infer<typeof editorMessageDataSchema>;
291
307
 
292
308
  /**
293
309
  * A draft the agent on Live started with `startDraft`, or restored with `restoreDraft`, and the
@@ -636,7 +652,7 @@ function threadStepOf(entry: EntryRecord): ThreadStep | undefined {
636
652
  return build && { id, type: "build", status: build.status };
637
653
  }
638
654
  // Only the model reads it: as a user message, it would otherwise read as Pi continuing a run.
639
- if (entry.kind === DRAFT_ENDED_ENTRY) return undefined;
655
+ if (entry.kind === DRAFT_ENDED_ENTRY || entry.kind === MEMORY_ENTRY) return undefined;
640
656
  if (entry.kind === PUSH_ENTRY) {
641
657
  const push = pushDataSchema.safeParse(entry.data).data;
642
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.