@camox/api-contract 0.77.0 → 0.79.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 +8 -0
- package/dist/query-keys.d.ts +4 -0
- package/dist/query-keys.js +12 -0
- package/dist/router.d.ts +889 -305
- package/dist/threads.d.ts +5 -0
- package/dist/threads.js +12 -2
- package/dist/voice.d.ts +191 -0
- package/dist/voice.js +228 -0
- package/package.json +6 -2
- package/src/drafts.ts +11 -0
- package/src/query-keys.ts +5 -0
- package/src/threads.ts +12 -1
- package/src/voice.ts +229 -0
- package/LICENSE.md +0 -21
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,18 +150,23 @@ 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",
|
|
156
|
+
"changeVoice",
|
|
149
157
|
"copyFromPastWork",
|
|
150
158
|
"createBlock",
|
|
151
159
|
"createCollectionRecord",
|
|
152
160
|
"createPage",
|
|
153
161
|
"deleteBlock",
|
|
154
162
|
"deleteCollectionRecord",
|
|
163
|
+
"deleteMemory",
|
|
155
164
|
"deletePage",
|
|
156
165
|
"editBlock",
|
|
157
166
|
"editCollectionRecord",
|
|
158
167
|
"moveBlock",
|
|
159
168
|
"removeLocale",
|
|
169
|
+
"retranslateLocale",
|
|
160
170
|
"retranslateLocalization",
|
|
161
171
|
"setPageLayout",
|
|
162
172
|
"setPageSeo",
|
|
@@ -425,7 +435,7 @@ function threadStepOf(entry) {
|
|
|
425
435
|
status: build.status
|
|
426
436
|
};
|
|
427
437
|
}
|
|
428
|
-
if (entry.kind === "camox.draft-ended") return void 0;
|
|
438
|
+
if (entry.kind === "camox.draft-ended" || entry.kind === "camox.memory") return void 0;
|
|
429
439
|
if (entry.kind === "camox.push") {
|
|
430
440
|
const push = pushDataSchema.safeParse(entry.data).data;
|
|
431
441
|
return push && {
|
|
@@ -801,4 +811,4 @@ function reduceThreadFrame(state, frame) {
|
|
|
801
811
|
}
|
|
802
812
|
|
|
803
813
|
//#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 };
|
|
814
|
+
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/dist/voice.d.ts
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
//#region src/voice.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The Voice Axes, each with its steps in order and each step's one-line definition. The Voice is
|
|
4
|
+
* a limit, not a target, and each axis's `limit` says how: under a `ceiling`, copy may sit at any
|
|
5
|
+
* step below the chosen one, never above; in a `band`, within one step of it either way.
|
|
6
|
+
*/
|
|
7
|
+
export declare const VOICE_AXES: readonly [{
|
|
8
|
+
readonly key: "formality";
|
|
9
|
+
readonly limit: "band";
|
|
10
|
+
readonly name: "Formality";
|
|
11
|
+
readonly about: "register, grammar, vocabulary";
|
|
12
|
+
readonly steps: readonly [{
|
|
13
|
+
readonly key: "ceremonial";
|
|
14
|
+
readonly name: "Ceremonial";
|
|
15
|
+
readonly definition: "elevated, ritual register; no contractions; set phrases and honorifics.";
|
|
16
|
+
}, {
|
|
17
|
+
readonly key: "formal";
|
|
18
|
+
readonly name: "Formal";
|
|
19
|
+
readonly definition: "correct and impersonal; no contractions or slang; complete sentences.";
|
|
20
|
+
}, {
|
|
21
|
+
readonly key: "neutral";
|
|
22
|
+
readonly name: "Neutral";
|
|
23
|
+
readonly definition: "standard written register; contractions allowed; no slang.";
|
|
24
|
+
}, {
|
|
25
|
+
readonly key: "conversational";
|
|
26
|
+
readonly name: "Conversational";
|
|
27
|
+
readonly definition: "as spoken to a customer; contractions, short sentences, questions to the reader.";
|
|
28
|
+
}, {
|
|
29
|
+
readonly key: "colloquial";
|
|
30
|
+
readonly name: "Colloquial";
|
|
31
|
+
readonly definition: "as spoken among friends; slang, fragments, loose grammar.";
|
|
32
|
+
}];
|
|
33
|
+
}, {
|
|
34
|
+
readonly key: "humor";
|
|
35
|
+
readonly limit: "ceiling";
|
|
36
|
+
readonly name: "Humor";
|
|
37
|
+
readonly about: null;
|
|
38
|
+
readonly steps: readonly [{
|
|
39
|
+
readonly key: "grave";
|
|
40
|
+
readonly name: "Grave";
|
|
41
|
+
readonly definition: "solemn and weighty; treats its subject with gravity, beyond having no jokes.";
|
|
42
|
+
}, {
|
|
43
|
+
readonly key: "earnest";
|
|
44
|
+
readonly name: "Earnest";
|
|
45
|
+
readonly definition: "sincere and straightforward; no jokes.";
|
|
46
|
+
}, {
|
|
47
|
+
readonly key: "light";
|
|
48
|
+
readonly name: "Light";
|
|
49
|
+
readonly definition: "warm, with an occasional light touch; no set-up jokes.";
|
|
50
|
+
}, {
|
|
51
|
+
readonly key: "witty";
|
|
52
|
+
readonly name: "Witty";
|
|
53
|
+
readonly definition: "jokes, irony or playful exaggeration recur.";
|
|
54
|
+
}, {
|
|
55
|
+
readonly key: "irreverent";
|
|
56
|
+
readonly name: "Irreverent";
|
|
57
|
+
readonly definition: "mocks conventions, the industry or itself; jokes over sincerity.";
|
|
58
|
+
}];
|
|
59
|
+
}, {
|
|
60
|
+
readonly key: "claimStrength";
|
|
61
|
+
readonly limit: "ceiling";
|
|
62
|
+
readonly name: "Claim strength";
|
|
63
|
+
readonly about: "how strongly copy praises and promises, backed or not; calls to action count only when they push urgency";
|
|
64
|
+
readonly steps: readonly [{
|
|
65
|
+
readonly key: "understated";
|
|
66
|
+
readonly name: "Understated";
|
|
67
|
+
readonly definition: "states facts only; no praise words; qualifies claims.";
|
|
68
|
+
}, {
|
|
69
|
+
readonly key: "measured";
|
|
70
|
+
readonly name: "Measured";
|
|
71
|
+
readonly definition: "modest claims; praise words are rare.";
|
|
72
|
+
}, {
|
|
73
|
+
readonly key: "confident";
|
|
74
|
+
readonly name: "Confident";
|
|
75
|
+
readonly definition: "states benefits plainly; few praise words, no superlatives.";
|
|
76
|
+
}, {
|
|
77
|
+
readonly key: "assertive";
|
|
78
|
+
readonly name: "Assertive";
|
|
79
|
+
readonly definition: "praise words throughout; strong claims and comparisons.";
|
|
80
|
+
}, {
|
|
81
|
+
readonly key: "bold";
|
|
82
|
+
readonly name: "Bold";
|
|
83
|
+
readonly definition: "superlatives, sweeping promises, urgency, exclamations.";
|
|
84
|
+
}];
|
|
85
|
+
}, {
|
|
86
|
+
readonly key: "expertise";
|
|
87
|
+
readonly limit: "ceiling";
|
|
88
|
+
readonly name: "Expertise";
|
|
89
|
+
readonly about: "what the reader is assumed to know";
|
|
90
|
+
readonly steps: readonly [{
|
|
91
|
+
readonly key: "plain";
|
|
92
|
+
readonly name: "Plain";
|
|
93
|
+
readonly definition: "everyday words only; no terms of the trade.";
|
|
94
|
+
}, {
|
|
95
|
+
readonly key: "accessible";
|
|
96
|
+
readonly name: "Accessible";
|
|
97
|
+
readonly definition: "terms of the trade only when explained.";
|
|
98
|
+
}, {
|
|
99
|
+
readonly key: "informed";
|
|
100
|
+
readonly name: "Informed";
|
|
101
|
+
readonly definition: "common terms of the trade, unexplained.";
|
|
102
|
+
}, {
|
|
103
|
+
readonly key: "technical";
|
|
104
|
+
readonly name: "Technical";
|
|
105
|
+
readonly definition: "precise terms, specifications and figures for practitioners.";
|
|
106
|
+
}, {
|
|
107
|
+
readonly key: "specialist";
|
|
108
|
+
readonly name: "Specialist";
|
|
109
|
+
readonly definition: "dense jargon and references only experts follow.";
|
|
110
|
+
}];
|
|
111
|
+
}, {
|
|
112
|
+
readonly key: "density";
|
|
113
|
+
readonly limit: "ceiling";
|
|
114
|
+
readonly name: "Density";
|
|
115
|
+
readonly about: "words per idea, not page length";
|
|
116
|
+
readonly steps: readonly [{
|
|
117
|
+
readonly key: "telegraphic";
|
|
118
|
+
readonly name: "Telegraphic";
|
|
119
|
+
readonly definition: "fragments and lists; articles and transitions dropped where possible.";
|
|
120
|
+
}, {
|
|
121
|
+
readonly key: "concise";
|
|
122
|
+
readonly name: "Concise";
|
|
123
|
+
readonly definition: "one idea per short sentence; nothing restated.";
|
|
124
|
+
}, {
|
|
125
|
+
readonly key: "balanced";
|
|
126
|
+
readonly name: "Balanced";
|
|
127
|
+
readonly definition: "each idea gets the sentence it needs, with transitions.";
|
|
128
|
+
}, {
|
|
129
|
+
readonly key: "descriptive";
|
|
130
|
+
readonly name: "Descriptive";
|
|
131
|
+
readonly definition: "ideas get detail, qualification and imagery.";
|
|
132
|
+
}, {
|
|
133
|
+
readonly key: "expansive";
|
|
134
|
+
readonly name: "Expansive";
|
|
135
|
+
readonly definition: "ideas developed at length, with asides and restatement.";
|
|
136
|
+
}];
|
|
137
|
+
}, {
|
|
138
|
+
readonly key: "distance";
|
|
139
|
+
readonly limit: "band";
|
|
140
|
+
readonly name: "Distance";
|
|
141
|
+
readonly about: "who speaks, how close";
|
|
142
|
+
readonly steps: readonly [{
|
|
143
|
+
readonly key: "institutional";
|
|
144
|
+
readonly name: "Institutional";
|
|
145
|
+
readonly definition: "the organization speaks of itself by name, in the third person, and doesn't address the reader.";
|
|
146
|
+
}, {
|
|
147
|
+
readonly key: "collective";
|
|
148
|
+
readonly name: "Collective";
|
|
149
|
+
readonly definition: '"we" speak about readers in general.';
|
|
150
|
+
}, {
|
|
151
|
+
readonly key: "direct";
|
|
152
|
+
readonly name: "Direct";
|
|
153
|
+
readonly definition: '"we" speak to "you".';
|
|
154
|
+
}, {
|
|
155
|
+
readonly key: "personal";
|
|
156
|
+
readonly name: "Personal";
|
|
157
|
+
readonly definition: '"we" speak to "you" one to one, sharing opinions and feelings.';
|
|
158
|
+
}, {
|
|
159
|
+
readonly key: "solo";
|
|
160
|
+
readonly name: "Solo";
|
|
161
|
+
readonly definition: 'one person speaks as "I".';
|
|
162
|
+
}];
|
|
163
|
+
}];
|
|
164
|
+
/** One Voice Axis, with its steps in order. */
|
|
165
|
+
export type VoiceAxis = (typeof VOICE_AXES)[number];
|
|
166
|
+
export type VoiceAxisKey = VoiceAxis["key"];
|
|
167
|
+
/** A step of the axis `A`. */
|
|
168
|
+
export type VoiceStep<A extends VoiceAxisKey = VoiceAxisKey> = Extract<VoiceAxis, {
|
|
169
|
+
key: A;
|
|
170
|
+
}>["steps"][number];
|
|
171
|
+
/** The key of a step of the axis `A`. */
|
|
172
|
+
export type VoiceStepKey<A extends VoiceAxisKey = VoiceAxisKey> = VoiceStep<A>["key"];
|
|
173
|
+
/** A Voice: the chosen step on each axis. */
|
|
174
|
+
export type Voice = { [A in VoiceAxisKey]: VoiceStepKey<A>; };
|
|
175
|
+
/** The Voice a new project starts with: no hype, no wordiness, no forced jokes. */
|
|
176
|
+
export declare const DEFAULT_VOICE: Voice;
|
|
177
|
+
/** The axis with this key. */
|
|
178
|
+
export declare const voiceAxis: <A extends VoiceAxisKey>(key: A) => Extract<VoiceAxis, {
|
|
179
|
+
key: A;
|
|
180
|
+
}>;
|
|
181
|
+
/** Whether `key` names a step of the axis `axis`. */
|
|
182
|
+
export declare const isVoiceStep: <A extends VoiceAxisKey>(axis: A, key: string) => key is VoiceStepKey<A>;
|
|
183
|
+
/** The step with this key on the axis `axis`. */
|
|
184
|
+
export declare const voiceStep: <A extends VoiceAxisKey>(axis: A, key: VoiceStepKey<A>) => VoiceStep<A>;
|
|
185
|
+
/** An axis a draft moves: from Live's step to the draft's. */
|
|
186
|
+
export type VoiceChange = { [A in VoiceAxisKey]: {
|
|
187
|
+
axis: A;
|
|
188
|
+
before: VoiceStepKey<A>;
|
|
189
|
+
after: VoiceStepKey<A>;
|
|
190
|
+
}; }[VoiceAxisKey];
|
|
191
|
+
//#endregion
|
package/dist/voice.js
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
//#region src/voice.ts
|
|
2
|
+
/**
|
|
3
|
+
* The Voice Axes, each with its steps in order and each step's one-line definition. The Voice is
|
|
4
|
+
* a limit, not a target, and each axis's `limit` says how: under a `ceiling`, copy may sit at any
|
|
5
|
+
* step below the chosen one, never above; in a `band`, within one step of it either way.
|
|
6
|
+
*/
|
|
7
|
+
const VOICE_AXES = [
|
|
8
|
+
{
|
|
9
|
+
key: "formality",
|
|
10
|
+
limit: "band",
|
|
11
|
+
name: "Formality",
|
|
12
|
+
about: "register, grammar, vocabulary",
|
|
13
|
+
steps: [
|
|
14
|
+
{
|
|
15
|
+
key: "ceremonial",
|
|
16
|
+
name: "Ceremonial",
|
|
17
|
+
definition: "elevated, ritual register; no contractions; set phrases and honorifics."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
key: "formal",
|
|
21
|
+
name: "Formal",
|
|
22
|
+
definition: "correct and impersonal; no contractions or slang; complete sentences."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: "neutral",
|
|
26
|
+
name: "Neutral",
|
|
27
|
+
definition: "standard written register; contractions allowed; no slang."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "conversational",
|
|
31
|
+
name: "Conversational",
|
|
32
|
+
definition: "as spoken to a customer; contractions, short sentences, questions to the reader."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "colloquial",
|
|
36
|
+
name: "Colloquial",
|
|
37
|
+
definition: "as spoken among friends; slang, fragments, loose grammar."
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "humor",
|
|
43
|
+
limit: "ceiling",
|
|
44
|
+
name: "Humor",
|
|
45
|
+
about: null,
|
|
46
|
+
steps: [
|
|
47
|
+
{
|
|
48
|
+
key: "grave",
|
|
49
|
+
name: "Grave",
|
|
50
|
+
definition: "solemn and weighty; treats its subject with gravity, beyond having no jokes."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "earnest",
|
|
54
|
+
name: "Earnest",
|
|
55
|
+
definition: "sincere and straightforward; no jokes."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "light",
|
|
59
|
+
name: "Light",
|
|
60
|
+
definition: "warm, with an occasional light touch; no set-up jokes."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: "witty",
|
|
64
|
+
name: "Witty",
|
|
65
|
+
definition: "jokes, irony or playful exaggeration recur."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: "irreverent",
|
|
69
|
+
name: "Irreverent",
|
|
70
|
+
definition: "mocks conventions, the industry or itself; jokes over sincerity."
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: "claimStrength",
|
|
76
|
+
limit: "ceiling",
|
|
77
|
+
name: "Claim strength",
|
|
78
|
+
about: "how strongly copy praises and promises, backed or not; calls to action count only when they push urgency",
|
|
79
|
+
steps: [
|
|
80
|
+
{
|
|
81
|
+
key: "understated",
|
|
82
|
+
name: "Understated",
|
|
83
|
+
definition: "states facts only; no praise words; qualifies claims."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "measured",
|
|
87
|
+
name: "Measured",
|
|
88
|
+
definition: "modest claims; praise words are rare."
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: "confident",
|
|
92
|
+
name: "Confident",
|
|
93
|
+
definition: "states benefits plainly; few praise words, no superlatives."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
key: "assertive",
|
|
97
|
+
name: "Assertive",
|
|
98
|
+
definition: "praise words throughout; strong claims and comparisons."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: "bold",
|
|
102
|
+
name: "Bold",
|
|
103
|
+
definition: "superlatives, sweeping promises, urgency, exclamations."
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
key: "expertise",
|
|
109
|
+
limit: "ceiling",
|
|
110
|
+
name: "Expertise",
|
|
111
|
+
about: "what the reader is assumed to know",
|
|
112
|
+
steps: [
|
|
113
|
+
{
|
|
114
|
+
key: "plain",
|
|
115
|
+
name: "Plain",
|
|
116
|
+
definition: "everyday words only; no terms of the trade."
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: "accessible",
|
|
120
|
+
name: "Accessible",
|
|
121
|
+
definition: "terms of the trade only when explained."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: "informed",
|
|
125
|
+
name: "Informed",
|
|
126
|
+
definition: "common terms of the trade, unexplained."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
key: "technical",
|
|
130
|
+
name: "Technical",
|
|
131
|
+
definition: "precise terms, specifications and figures for practitioners."
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: "specialist",
|
|
135
|
+
name: "Specialist",
|
|
136
|
+
definition: "dense jargon and references only experts follow."
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
key: "density",
|
|
142
|
+
limit: "ceiling",
|
|
143
|
+
name: "Density",
|
|
144
|
+
about: "words per idea, not page length",
|
|
145
|
+
steps: [
|
|
146
|
+
{
|
|
147
|
+
key: "telegraphic",
|
|
148
|
+
name: "Telegraphic",
|
|
149
|
+
definition: "fragments and lists; articles and transitions dropped where possible."
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: "concise",
|
|
153
|
+
name: "Concise",
|
|
154
|
+
definition: "one idea per short sentence; nothing restated."
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: "balanced",
|
|
158
|
+
name: "Balanced",
|
|
159
|
+
definition: "each idea gets the sentence it needs, with transitions."
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: "descriptive",
|
|
163
|
+
name: "Descriptive",
|
|
164
|
+
definition: "ideas get detail, qualification and imagery."
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
key: "expansive",
|
|
168
|
+
name: "Expansive",
|
|
169
|
+
definition: "ideas developed at length, with asides and restatement."
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
key: "distance",
|
|
175
|
+
limit: "band",
|
|
176
|
+
name: "Distance",
|
|
177
|
+
about: "who speaks, how close",
|
|
178
|
+
steps: [
|
|
179
|
+
{
|
|
180
|
+
key: "institutional",
|
|
181
|
+
name: "Institutional",
|
|
182
|
+
definition: "the organization speaks of itself by name, in the third person, and doesn't address the reader."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
key: "collective",
|
|
186
|
+
name: "Collective",
|
|
187
|
+
definition: "\"we\" speak about readers in general."
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: "direct",
|
|
191
|
+
name: "Direct",
|
|
192
|
+
definition: "\"we\" speak to \"you\"."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
key: "personal",
|
|
196
|
+
name: "Personal",
|
|
197
|
+
definition: "\"we\" speak to \"you\" one to one, sharing opinions and feelings."
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
key: "solo",
|
|
201
|
+
name: "Solo",
|
|
202
|
+
definition: "one person speaks as \"I\"."
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
];
|
|
207
|
+
/** The Voice a new project starts with: no hype, no wordiness, no forced jokes. */
|
|
208
|
+
const DEFAULT_VOICE = {
|
|
209
|
+
formality: "conversational",
|
|
210
|
+
humor: "earnest",
|
|
211
|
+
claimStrength: "confident",
|
|
212
|
+
expertise: "accessible",
|
|
213
|
+
density: "concise",
|
|
214
|
+
distance: "direct"
|
|
215
|
+
};
|
|
216
|
+
/** The axis with this key. */
|
|
217
|
+
const voiceAxis = (key) => VOICE_AXES.find((axis) => axis.key === key);
|
|
218
|
+
/** Whether `key` names a step of the axis `axis`. */
|
|
219
|
+
const isVoiceStep = (axis, key) => {
|
|
220
|
+
return voiceAxis(axis).steps.some((step) => step.key === key);
|
|
221
|
+
};
|
|
222
|
+
/** The step with this key on the axis `axis`. */
|
|
223
|
+
const voiceStep = (axis, key) => {
|
|
224
|
+
return voiceAxis(axis).steps.find((step) => step.key === key);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
//#endregion
|
|
228
|
+
export { DEFAULT_VOICE, VOICE_AXES, isVoiceStep, voiceAxis, voiceStep };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camox/api-contract",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"license": "
|
|
3
|
+
"version": "0.79.0",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
7
7
|
"dist"
|
|
@@ -59,6 +59,10 @@
|
|
|
59
59
|
"./claim-links": {
|
|
60
60
|
"types": "./dist/claim-links.d.ts",
|
|
61
61
|
"default": "./dist/claim-links.js"
|
|
62
|
+
},
|
|
63
|
+
"./voice": {
|
|
64
|
+
"types": "./dist/voice.d.ts",
|
|
65
|
+
"default": "./dist/voice.js"
|
|
62
66
|
}
|
|
63
67
|
},
|
|
64
68
|
"dependencies": {
|
package/src/drafts.ts
CHANGED
|
@@ -335,12 +335,23 @@ const SPECIALISTS_WRITES: Record<keyof Router["specialists"], boolean> = {
|
|
|
335
335
|
dismissFinding: false,
|
|
336
336
|
};
|
|
337
337
|
|
|
338
|
+
// Memory, the Voice included, changes through drafts, like content (ADR 0049, ADR 0051).
|
|
339
|
+
const MEMORY_WRITES: Record<keyof Router["memories"], boolean> = {
|
|
340
|
+
list: false,
|
|
341
|
+
add: true,
|
|
342
|
+
change: true,
|
|
343
|
+
delete: true,
|
|
344
|
+
voice: false,
|
|
345
|
+
saveVoice: true,
|
|
346
|
+
};
|
|
347
|
+
|
|
338
348
|
// `definitions` is absent: its sync is a release, never a studio content write.
|
|
339
349
|
const CONTENT_WRITES: Partial<Record<keyof Router, Record<string, boolean>>> = {
|
|
340
350
|
blocks: BLOCK_WRITES,
|
|
341
351
|
locales: LOCALE_WRITES,
|
|
342
352
|
collectionDefinitions: COLLECTION_WRITES,
|
|
343
353
|
files: FILE_WRITES,
|
|
354
|
+
memories: MEMORY_WRITES,
|
|
344
355
|
pages: PAGE_WRITES,
|
|
345
356
|
specialists: SPECIALISTS_WRITES,
|
|
346
357
|
// The old name of `specialists`, for studios not yet upgraded (ADR 0019).
|
package/src/query-keys.ts
CHANGED
|
@@ -52,6 +52,11 @@ export const queryKeys = {
|
|
|
52
52
|
layouts: {
|
|
53
53
|
all: ["camox", "layouts"],
|
|
54
54
|
},
|
|
55
|
+
// A scope's memory (ADR 0049), and its Voice (ADR 0051).
|
|
56
|
+
memories: {
|
|
57
|
+
list: ["camox", "memories", "list"],
|
|
58
|
+
voice: ["camox", "memories", "voice"],
|
|
59
|
+
},
|
|
55
60
|
drafts: {
|
|
56
61
|
all: ["camox", "drafts"],
|
|
57
62
|
// 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,23 @@ export const CHANGING_TOOLS: ReadonlySet<string> = new Set([
|
|
|
179
185
|
// Content
|
|
180
186
|
"addBackToLocale",
|
|
181
187
|
"addLocale",
|
|
188
|
+
"addMemory",
|
|
182
189
|
"applyFindingFix",
|
|
190
|
+
"changeMemory",
|
|
191
|
+
"changeVoice",
|
|
183
192
|
"copyFromPastWork",
|
|
184
193
|
"createBlock",
|
|
185
194
|
"createCollectionRecord",
|
|
186
195
|
"createPage",
|
|
187
196
|
"deleteBlock",
|
|
188
197
|
"deleteCollectionRecord",
|
|
198
|
+
"deleteMemory",
|
|
189
199
|
"deletePage",
|
|
190
200
|
"editBlock",
|
|
191
201
|
"editCollectionRecord",
|
|
192
202
|
"moveBlock",
|
|
193
203
|
"removeLocale",
|
|
204
|
+
"retranslateLocale",
|
|
194
205
|
"retranslateLocalization",
|
|
195
206
|
"setPageLayout",
|
|
196
207
|
"setPageSeo",
|
|
@@ -643,7 +654,7 @@ function threadStepOf(entry: EntryRecord): ThreadStep | undefined {
|
|
|
643
654
|
return build && { id, type: "build", status: build.status };
|
|
644
655
|
}
|
|
645
656
|
// 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;
|
|
657
|
+
if (entry.kind === DRAFT_ENDED_ENTRY || entry.kind === MEMORY_ENTRY) return undefined;
|
|
647
658
|
if (entry.kind === PUSH_ENTRY) {
|
|
648
659
|
const push = pushDataSchema.safeParse(entry.data).data;
|
|
649
660
|
return push && { id, type: "push", ...push };
|