@mmon-co/ncept-default-theory 0.0.0-stage → 1.1.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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +73 -2
  3. package/dist/catalog-contract.d.ts +102 -0
  4. package/dist/catalog-contract.js +75 -0
  5. package/dist/catalog.d.ts +14 -0
  6. package/dist/catalog.js +164 -0
  7. package/dist/chat.d.ts +171 -0
  8. package/dist/chat.js +232 -0
  9. package/dist/completion.d.ts +74 -0
  10. package/dist/completion.js +277 -0
  11. package/dist/dependent-cone.d.ts +3 -0
  12. package/dist/dependent-cone.js +26 -0
  13. package/dist/diagnosis.d.ts +9 -0
  14. package/dist/diagnosis.js +1 -0
  15. package/dist/diagnostics.d.ts +25 -0
  16. package/dist/diagnostics.js +34 -0
  17. package/dist/evaluation.d.ts +33 -0
  18. package/dist/evaluation.js +376 -0
  19. package/dist/event.d.ts +7 -0
  20. package/dist/event.js +405 -0
  21. package/dist/history.d.ts +4 -0
  22. package/dist/history.js +61 -0
  23. package/dist/implementation.d.ts +184 -0
  24. package/dist/implementation.js +31 -0
  25. package/dist/index.d.ts +200 -0
  26. package/dist/index.js +27 -0
  27. package/dist/messages.d.ts +167 -0
  28. package/dist/messages.js +56 -0
  29. package/dist/opening.d.ts +20 -0
  30. package/dist/opening.js +33 -0
  31. package/dist/outcomes.d.ts +143 -0
  32. package/dist/outcomes.js +323 -0
  33. package/dist/path.d.ts +19 -0
  34. package/dist/path.js +293 -0
  35. package/dist/reading.d.ts +12 -0
  36. package/dist/reading.js +75 -0
  37. package/dist/release.d.ts +1 -0
  38. package/dist/release.js +1 -0
  39. package/dist/roleplay.d.ts +17 -0
  40. package/dist/roleplay.js +2 -0
  41. package/dist/skills/sources.d.ts +12 -0
  42. package/dist/skills/sources.js +13 -0
  43. package/dist/skills.d.ts +12 -0
  44. package/dist/skills.js +70 -0
  45. package/dist/state.d.ts +316 -0
  46. package/dist/state.js +1309 -0
  47. package/dist/tags.d.ts +34 -0
  48. package/dist/tags.js +306 -0
  49. package/dist/timing.d.ts +21 -0
  50. package/dist/timing.js +79 -0
  51. package/dist/tools.d.ts +394 -0
  52. package/dist/tools.js +872 -0
  53. package/package.json +52 -4
@@ -0,0 +1,394 @@
1
+ import { type JsonSchema, type Observation, type ObservationId, type Program, type SurfaceId } from "@mmon-co/ncept-core/observations";
2
+ import type { ChatContext } from "@mmon-co/ncept-core/theory";
3
+ import { type DefaultState, type Demonstration, type Interpretation } from "./state.js";
4
+ type InterpretationSourceHandle = {
5
+ readonly support: ObservationId;
6
+ readonly kind: "observation";
7
+ readonly observation: ObservationId;
8
+ } | {
9
+ readonly support: ObservationId;
10
+ readonly kind: "transcript";
11
+ readonly surface: SurfaceId;
12
+ readonly from: string;
13
+ readonly to: string;
14
+ };
15
+ /** Pure projection shared by live reads and the one-off historical catalog migration. */
16
+ export declare function projectTrailPage<R, S extends {
17
+ readonly records: readonly R[];
18
+ }, N extends string>(reading: {
19
+ readonly node: N;
20
+ readonly rule: string;
21
+ readonly state: S;
22
+ readonly records: readonly R[];
23
+ }, revision: string, offset: number, limit: number): {
24
+ node: N;
25
+ rule: string;
26
+ standing: Omit<S, "records">;
27
+ page: R[];
28
+ isDone: boolean;
29
+ continueCursor: string | null;
30
+ };
31
+ /** Evidence readings, retrieval context and the Session's closing diagnosis. */
32
+ export declare const defaultInstrumentTools: ((Readonly<{
33
+ name: string;
34
+ description: string;
35
+ schema: JsonSchema;
36
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
37
+ run(args: unknown, ctx: ChatContext<DefaultState>): Program<unknown>;
38
+ }> & {
39
+ name: "frontier";
40
+ }) | (Readonly<{
41
+ name: string;
42
+ description: string;
43
+ schema: JsonSchema;
44
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
45
+ run(args: unknown, ctx: ChatContext<DefaultState>): Program<unknown>;
46
+ }> & {
47
+ name: "coverage";
48
+ }) | (Readonly<{
49
+ name: string;
50
+ description: string;
51
+ schema: JsonSchema;
52
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
53
+ run(args: unknown, ctx: ChatContext<DefaultState>): Program<unknown>;
54
+ }> & {
55
+ name: "probes";
56
+ }) | (Readonly<{
57
+ name: string;
58
+ description: string;
59
+ schema: JsonSchema;
60
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
61
+ run(args: unknown, ctx: ChatContext<DefaultState>): Program<unknown>;
62
+ }> & {
63
+ name: "warnings";
64
+ }) | (Readonly<{
65
+ name: string;
66
+ description: string;
67
+ schema: JsonSchema;
68
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
69
+ run(args: unknown, ctx: ChatContext<DefaultState>): Program<unknown>;
70
+ }> & {
71
+ name: "items";
72
+ }) | (Readonly<{
73
+ name: string;
74
+ description: string;
75
+ schema: JsonSchema;
76
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
77
+ run(args: unknown, ctx: ChatContext<DefaultState>): Program<unknown>;
78
+ }> & {
79
+ name: "memory";
80
+ }) | (Readonly<{
81
+ name: string;
82
+ description: string;
83
+ schema: JsonSchema;
84
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
85
+ run(args: unknown, ctx: ChatContext<DefaultState>): Program<unknown>;
86
+ }> & {
87
+ name: "mission";
88
+ }) | {
89
+ name: "route";
90
+ description: string;
91
+ schema: Readonly<Record<string, unknown>>;
92
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<never, {
93
+ missions: string[];
94
+ openSurfaces: `surface-${string}`[];
95
+ citations: readonly `obs-${string}`[];
96
+ lastSuccess?: string | undefined;
97
+ node: `node-${string}`;
98
+ label: import("./state.js").NodeLabel;
99
+ }[], unknown>;
100
+ } | {
101
+ name: "interpretations";
102
+ description: string;
103
+ schema: Readonly<Record<string, unknown>>;
104
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<never, {
105
+ surface?: `surface-${string}` | undefined;
106
+ id: `obs-${string}`;
107
+ text: string;
108
+ tags: readonly string[];
109
+ nodes: readonly `node-${string}`[];
110
+ supportIds: readonly `obs-${string}`[];
111
+ sourceHandles: InterpretationSourceHandle[];
112
+ }[], unknown>;
113
+ } | {
114
+ name: string;
115
+ schema: {
116
+ required: never[];
117
+ oneOf: ({
118
+ type: string;
119
+ properties: {
120
+ node: {
121
+ type: string;
122
+ pattern: string;
123
+ };
124
+ scope?: undefined;
125
+ };
126
+ required: string[];
127
+ additionalProperties: boolean;
128
+ } | {
129
+ type: string;
130
+ properties: {
131
+ scope: {
132
+ type: string;
133
+ items: {
134
+ type: string;
135
+ pattern: string;
136
+ };
137
+ };
138
+ node?: undefined;
139
+ };
140
+ required: string[];
141
+ additionalProperties: boolean;
142
+ })[];
143
+ };
144
+ description: string;
145
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<never, {
146
+ node: `node-${string}`;
147
+ rule: string;
148
+ standing: Omit<import("./state.js").NodeState, "records">;
149
+ page: import("./state.js").HomedRecord[];
150
+ isDone: boolean;
151
+ continueCursor: string | null;
152
+ } | {
153
+ node: `node-${string}`;
154
+ rule: string;
155
+ standing: Omit<import("./state.js").NodeState, "records">;
156
+ page: import("./state.js").HomedRecord[];
157
+ isDone: boolean;
158
+ continueCursor: string | null;
159
+ }[], unknown>;
160
+ } | {
161
+ name: "close_recount";
162
+ description: string;
163
+ schema: Readonly<Record<string, unknown>>;
164
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
165
+ capabilities: {
166
+ label: string;
167
+ standing: import("./state.js").NodeLabel;
168
+ }[];
169
+ recordsScope: string;
170
+ records: ({
171
+ prompt?: string | undefined;
172
+ kind: "claim";
173
+ stance: "knows" | "forgotten" | "unfamiliar";
174
+ statement: string;
175
+ about?: undefined;
176
+ } | {
177
+ prompt?: string | undefined;
178
+ kind: "claim";
179
+ stance: "knows" | "forgotten" | "unfamiliar";
180
+ statement: string;
181
+ about: string[];
182
+ } | {
183
+ kind: "demonstration";
184
+ outcome: "success" | "failure" | "dont-know";
185
+ unaided: boolean;
186
+ task: string;
187
+ response: string;
188
+ about?: undefined;
189
+ } | {
190
+ kind: "demonstration";
191
+ outcome: "success" | "failure" | "dont-know";
192
+ unaided: boolean;
193
+ task: string;
194
+ response: string;
195
+ about: string[];
196
+ })[];
197
+ practising: {
198
+ node: `node-${string}`;
199
+ why: string;
200
+ }[];
201
+ }, unknown>;
202
+ })[];
203
+ export declare const defaultRecordingTools: ({
204
+ name: "record_demonstration";
205
+ description: string;
206
+ schema: Readonly<Record<string, unknown>>;
207
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
208
+ lesson?: {
209
+ complete: boolean;
210
+ status: string;
211
+ nodes: {
212
+ node: `node-${string}`;
213
+ complete: boolean;
214
+ query: string | import("./completion.js").Completion;
215
+ counts: readonly import("./completion.js").CountProgress[];
216
+ needs: string;
217
+ }[];
218
+ } | undefined;
219
+ observation: {
220
+ id: `obs-${string}`;
221
+ at: string;
222
+ about: `node-${string}`[];
223
+ nodes: `node-${string}`[];
224
+ surface: `surface-${string}`;
225
+ payload: Demonstration;
226
+ };
227
+ citations: `obs-${string}`[];
228
+ }, unknown>;
229
+ } | {
230
+ name: "record_material_attempt";
231
+ description: string;
232
+ schema: Readonly<Record<string, unknown>>;
233
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
234
+ alreadyRecorded: boolean;
235
+ records: `obs-${string}`[];
236
+ correction: string;
237
+ } | {
238
+ lesson?: {
239
+ complete: boolean;
240
+ status: string;
241
+ nodes: {
242
+ node: `node-${string}`;
243
+ complete: boolean;
244
+ query: string | import("./completion.js").Completion;
245
+ counts: readonly import("./completion.js").CountProgress[];
246
+ needs: string;
247
+ }[];
248
+ } | undefined;
249
+ observations: Observation<unknown>[];
250
+ citations: `obs-${string}`[];
251
+ alreadyRecorded?: undefined;
252
+ records?: undefined;
253
+ correction?: undefined;
254
+ }, unknown>;
255
+ } | {
256
+ name: "record_retrieval_opener";
257
+ description: string;
258
+ schema: Readonly<Record<string, unknown>>;
259
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
260
+ observation: {
261
+ id: `obs-${string}`;
262
+ at: string;
263
+ about: `node-${string}`[];
264
+ nodes: `node-${string}`[];
265
+ surface: `surface-${string}`;
266
+ payload: import("./state.js").RetrievalOpenerDemonstration;
267
+ };
268
+ citations: `obs-${string}`[];
269
+ }, unknown>;
270
+ } | {
271
+ name: "record_teaching";
272
+ description: string;
273
+ schema: Readonly<Record<string, unknown>>;
274
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
275
+ observation: {
276
+ id: `obs-${string}`;
277
+ at: string;
278
+ about: `node-${string}`[];
279
+ nodes: `node-${string}`[];
280
+ surface: `surface-${string}`;
281
+ payload: import("./state.js").Teaching;
282
+ };
283
+ citations: `obs-${string}`[];
284
+ }, unknown>;
285
+ } | {
286
+ name: "record_claim";
287
+ description: string;
288
+ schema: Readonly<Record<string, unknown>>;
289
+ run(this: void, raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
290
+ observation: {
291
+ id: `obs-${string}`;
292
+ at: string;
293
+ about: `node-${string}`[];
294
+ surface: `surface-${string}`;
295
+ payload: import("./state.js").Claim;
296
+ };
297
+ citations: `obs-${string}`[];
298
+ }, unknown>;
299
+ } | {
300
+ name: "record_retraction";
301
+ description: string;
302
+ schema: {
303
+ oneOf: ({
304
+ type: string;
305
+ properties: {
306
+ of: {
307
+ type: string;
308
+ };
309
+ node?: undefined;
310
+ };
311
+ required: string[];
312
+ additionalProperties: boolean;
313
+ } | {
314
+ type: string;
315
+ properties: {
316
+ node: {
317
+ type: string;
318
+ pattern: string;
319
+ };
320
+ of?: undefined;
321
+ };
322
+ required: string[];
323
+ additionalProperties: boolean;
324
+ })[];
325
+ };
326
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
327
+ observation: {
328
+ id: `obs-${string}`;
329
+ at: string;
330
+ about: `node-${string}`[];
331
+ surface: `surface-${string}`;
332
+ cites: `obs-${string}`[];
333
+ payload: {
334
+ kind: "retraction";
335
+ of: `obs-${string}`;
336
+ };
337
+ };
338
+ citations: `obs-${string}`[];
339
+ }, unknown>;
340
+ } | {
341
+ name: "correct_interpretation";
342
+ description: string;
343
+ schema: Readonly<Record<string, unknown>>;
344
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
345
+ observation: {
346
+ id: `obs-${string}`;
347
+ at: string;
348
+ about: `node-${string}`[];
349
+ nodes: readonly `node-${string}`[];
350
+ cites: readonly `obs-${string}`[];
351
+ surface: `surface-${string}` | undefined;
352
+ supersedes: `obs-${string}`;
353
+ payload: Interpretation;
354
+ };
355
+ citations: `obs-${string}`[];
356
+ }, unknown>;
357
+ })[];
358
+ /** Claim-homing and system-revision tools: no revision fences, cache saves, journals or retry contracts in Core. */
359
+ export declare const defaultBackgroundTools: ({
360
+ name: "attach_claim";
361
+ description: string;
362
+ schema: Readonly<Record<string, unknown>>;
363
+ run(this: void, raw: unknown, ctx: ChatContext<DefaultState>): Generator<import("@mmon-co/ncept-core/observations").Request, {
364
+ observation: {
365
+ id: `obs-${string}`;
366
+ at: string;
367
+ about: `node-${string}`[];
368
+ surface: `surface-${string}`;
369
+ nodes: readonly `node-${string}`[];
370
+ cites: `obs-${string}`[];
371
+ payload: {
372
+ kind: "homing";
373
+ of: `obs-${string}`;
374
+ homes: readonly `node-${string}`[];
375
+ revision: import("@mmon-co/ncept-core/patch").ExactPatchRef;
376
+ };
377
+ };
378
+ citations: `obs-${string}`[];
379
+ }, unknown>;
380
+ } | {
381
+ name: "refine_records";
382
+ description: string;
383
+ schema: Readonly<Record<string, unknown>>;
384
+ run(raw: unknown, ctx: ChatContext<DefaultState>): Program<void>;
385
+ })[];
386
+ /** Keyed scoring retains the selected option's error verbatim; skips never call this. */
387
+ export declare function keyedDemonstration(input: Omit<Demonstration, "kind" | "grader" | "outcome" | "response" | "recording"> & {
388
+ readonly response: string;
389
+ readonly option: {
390
+ readonly correct: boolean;
391
+ readonly error?: string;
392
+ };
393
+ }): Demonstration;
394
+ export {};