@ny4n/durable 1.2.0 → 1.3.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 (67) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +41 -5
  3. package/dist/codemode/codemode.d.ts +132 -0
  4. package/dist/codemode/codemode.d.ts.map +1 -0
  5. package/dist/codemode/codemode.js +791 -0
  6. package/dist/codemode/codemode.js.map +1 -0
  7. package/dist/codemode/describe.d.ts +38 -0
  8. package/dist/codemode/describe.d.ts.map +1 -0
  9. package/dist/codemode/describe.js +117 -0
  10. package/dist/codemode/describe.js.map +1 -0
  11. package/dist/codemode/index.d.ts +3 -0
  12. package/dist/codemode/index.d.ts.map +1 -0
  13. package/dist/codemode/index.js +3 -0
  14. package/dist/codemode/index.js.map +1 -0
  15. package/dist/codemode/output.d.ts +39 -0
  16. package/dist/codemode/output.d.ts.map +1 -0
  17. package/dist/codemode/output.js +160 -0
  18. package/dist/codemode/output.js.map +1 -0
  19. package/dist/harness/agent.d.ts +4 -2
  20. package/dist/harness/agent.d.ts.map +1 -1
  21. package/dist/harness/agent.js +56 -26
  22. package/dist/harness/agent.js.map +1 -1
  23. package/dist/harness/compaction.d.ts +6 -1
  24. package/dist/harness/compaction.d.ts.map +1 -1
  25. package/dist/harness/compaction.js +10 -7
  26. package/dist/harness/compaction.js.map +1 -1
  27. package/dist/harness/events.d.ts +8 -2
  28. package/dist/harness/events.d.ts.map +1 -1
  29. package/dist/harness/events.js +4 -1
  30. package/dist/harness/events.js.map +1 -1
  31. package/dist/harness/generation.d.ts +2 -0
  32. package/dist/harness/generation.d.ts.map +1 -1
  33. package/dist/harness/generation.js +25 -4
  34. package/dist/harness/generation.js.map +1 -1
  35. package/dist/harness/inbox.d.ts +16 -4
  36. package/dist/harness/inbox.d.ts.map +1 -1
  37. package/dist/harness/inbox.js +26 -3
  38. package/dist/harness/inbox.js.map +1 -1
  39. package/dist/harness/live.d.ts +15 -1
  40. package/dist/harness/live.d.ts.map +1 -1
  41. package/dist/harness/live.js +10 -2
  42. package/dist/harness/live.js.map +1 -1
  43. package/dist/harness/scheduler.d.ts.map +1 -1
  44. package/dist/harness/scheduler.js +72 -10
  45. package/dist/harness/scheduler.js.map +1 -1
  46. package/dist/harness/submissions.d.ts +7 -4
  47. package/dist/harness/submissions.d.ts.map +1 -1
  48. package/dist/harness/submissions.js +29 -10
  49. package/dist/harness/submissions.js.map +1 -1
  50. package/dist/harness/tool.d.ts.map +1 -1
  51. package/dist/harness/tool.js +13 -1
  52. package/dist/harness/tool.js.map +1 -1
  53. package/dist/harness/types.d.ts +38 -11
  54. package/dist/harness/types.d.ts.map +1 -1
  55. package/dist/harness/types.js.map +1 -1
  56. package/dist/index.d.ts +2 -2
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/tool-search/index.d.ts +2 -0
  60. package/dist/tool-search/index.d.ts.map +1 -0
  61. package/dist/tool-search/index.js +2 -0
  62. package/dist/tool-search/index.js.map +1 -0
  63. package/dist/tool-search/tool-search.d.ts +18 -0
  64. package/dist/tool-search/tool-search.d.ts.map +1 -0
  65. package/dist/tool-search/tool-search.js +62 -0
  66. package/dist/tool-search/tool-search.js.map +1 -0
  67. package/package.json +16 -3
@@ -11,6 +11,14 @@ export type ModelRef = {
11
11
  readonly modelId: string;
12
12
  };
13
13
  export type UserInput = UserMessage["content"];
14
+ /**
15
+ * The entry an input is placed as, instead of `nyan.user`: an application kind, and data the transcript shows, such as its
16
+ * author. Its model message is still the input's user message.
17
+ */
18
+ export type InputEntry = {
19
+ readonly kind: string;
20
+ readonly data?: JsonValue;
21
+ };
14
22
  /** Host submission: user input that may start a run, or a passive entry write. */
15
23
  export type SubmissionDraft = {
16
24
  readonly requestId?: string;
@@ -18,7 +26,8 @@ export type SubmissionDraft = {
18
26
  readonly type: "input";
19
27
  readonly content: UserInput;
20
28
  readonly whenBusy?: "steer" | "followUp" | "reject";
21
- readonly entry?: never;
29
+ /** Place the input as this entry; default `nyan.user` without data. The kind must not start with `nyan.`. */
30
+ readonly entry?: InputEntry;
22
31
  } | {
23
32
  readonly type: "write";
24
33
  readonly entry: EntryDraft;
@@ -119,10 +128,11 @@ export type NestedToolExecutionResult = {
119
128
  /** The nested call's tool task. */
120
129
  readonly taskId: TaskId;
121
130
  /**
122
- * The value for programs. A tool with `structuredOutputSchema`: its validated `structuredOutput`, absent on an error
123
- * result that has none. A tool without: its bounded output, success or error, as a string for one text item, an
124
- * `ImageContent` for one image, `""` for none, and the content list otherwise. Absent on an error result the Harness
125
- * wrote itself (unavailable, invalid, blocked, interrupted, aborted); `diagnostics` say what went wrong.
131
+ * The tool's value for programs. A tool with `structuredOutputSchema`: its validated `structuredOutput`, also on an
132
+ * error result that has one; absent otherwise, and an error's text is then in an error diagnostic. A tool without:
133
+ * its bounded output, success or error, as a string for one text item, an `ImageContent` for one image, `""` for
134
+ * none, and the content list otherwise. Absent on an error result the Harness wrote itself (unavailable, invalid,
135
+ * blocked, interrupted, aborted); `diagnostics` say what went wrong.
126
136
  */
127
137
  readonly structuredOutput?: JsonValue;
128
138
  readonly isError: boolean;
@@ -247,6 +257,11 @@ export type ToolRegistration<TParameters extends TSchema = TSchema, TDetails ext
247
257
  * model is never offered them.
248
258
  */
249
259
  readonly callers?: readonly ("model" | "tools")[];
260
+ /**
261
+ * Not offered to the model until loaded: the model gets the tool only when `modelTools` names it, in its array or its
262
+ * `add`, which `control.addTools` (from a tool such as `tool_search`) writes. Other tools can call it any time.
263
+ */
264
+ readonly deferred?: true;
250
265
  readonly outputLimits?: {
251
266
  readonly maxBytes?: number;
252
267
  readonly maxLines?: number;
@@ -342,11 +357,17 @@ export type AgentState = {
342
357
  remove: string[];
343
358
  };
344
359
  /**
345
- * Filters the enabled tools the model may call (`callers` includes `model`): the tools offered to it. An array offers
346
- * exactly these, in order. Never widens: other tools can still call the ones it leaves out.
360
+ * Filters the enabled tools the model may call (`callers` includes `model`): the tools offered to it. Never widens:
361
+ * other tools can still call the ones it leaves out.
362
+ * - Unset: every such tool except deferred ones.
363
+ * - An array: exactly these, in order, deferred ones too.
364
+ * - An object: every such tool except deferred ones and those in `remove`, in registry order, followed by the
365
+ * deferred tools in `add` that are not in `remove`, in `add` order. Names of tools that are not deferred or not
366
+ * registered have no effect in `add`.
347
367
  */
348
368
  modelTools?: string[] | {
349
- remove: string[];
369
+ remove?: string[];
370
+ add?: string[];
350
371
  };
351
372
  /** Rendered after every extension section, as the section `instructions`. */
352
373
  instructions?: string;
@@ -364,8 +385,10 @@ export type AgentChange = {
364
385
  readonly tools?: readonly ToolRegistration[] | {
365
386
  readonly remove: readonly ToolRegistration[];
366
387
  } | null;
388
+ /** Replaces the stored filter as a whole; tools loaded with `control.addTools` are in its `add`. */
367
389
  readonly modelTools?: readonly ToolRegistration[] | {
368
- readonly remove: readonly ToolRegistration[];
390
+ readonly remove?: readonly ToolRegistration[];
391
+ readonly add?: readonly ToolRegistration[];
369
392
  } | null;
370
393
  readonly instructions?: string | null;
371
394
  readonly cwd?: string | null;
@@ -379,6 +402,8 @@ export type Agent<Tool extends ToolRegistration = ToolRegistration> = {
379
402
  readonly tools: readonly Tool[];
380
403
  /** The tools nested calls (`executeTool()`) resolve among, in order: enabled and callable by tools. */
381
404
  readonly callable: readonly Tool[];
405
+ /** Enabled deferred tools the model may call and is not offered yet, in registry order: what `tool_search` loads. */
406
+ readonly deferred: readonly Tool[];
382
407
  /** Extension sections, then `instructions` when set. */
383
408
  readonly sections: readonly PromptSection<Tool>[];
384
409
  readonly instructions?: string;
@@ -567,8 +592,10 @@ export interface Conversation {
567
592
  /** `configure()` in its own commit. */
568
593
  configure(change: AgentChange, context: Context): Promise<void>;
569
594
  /**
570
- * Durably admit user input or a passive entry write. A busy conversation, or one with queued items, queues it in
571
- * `nyan.inbox`; `whenBusy: "reject"` rejects with `ConversationBusy` instead and writes nothing.
595
+ * Durably admit user input or a passive entry write. A busy conversation, or one with queued items, queues input and
596
+ * writes that affect model context in `nyan.inbox`; `whenBusy: "reject"` rejects input with `ConversationBusy` instead
597
+ * and writes nothing. A write of only `kind` and `data` (no `model`, `head`, or `edits`) is appended at once,
598
+ * even mid-run, as it changes nothing the model sees.
572
599
  */
573
600
  submit(submission: SubmissionDraft, context: Context): Promise<Submission>;
574
601
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,KAAK,EACX,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,IAAI,EACJ,MAAM,EACN,WAAW,EACX,UAAU,EACV,SAAS,EACT,EAAE,EACF,WAAW,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,0FAA0F;AAC1F,MAAM,MAAM,QAAQ,GAAG;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAA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C;QACzC,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;QACtC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;QAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;KAC/B,EACD,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,OAAO,GACd,UAAU,CAAC;QAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n\tAssistantMessage,\n\tCacheRetention,\n\tMessage,\n\tModelRuntime,\n\tModelThinkingLevel,\n\tStatic,\n\tTool,\n\tToolCall,\n\tToolResultMessage,\n\tTransport,\n\tTSchema,\n\tUsage,\n\tUserMessage,\n} from \"@ny4n/ai/contracts\";\nimport type { AttachedReplicatedState, Context, JsonValue } from \"@ny4n/chord\";\nimport type { ExecutionEnv, ShellOutputSkip, ShellOutputWindow } from \"../env/index.ts\";\nimport type {\n\tConversationId,\n\tConversationOwnership,\n\tConversationRecord,\n\tCursor,\n\tDocumentObserver,\n\tDocumentReader,\n\tEntryDraft,\n\tEntryId,\n\tEntryQuery,\n\tEntryRecord,\n\tJsonObject,\n\tPage,\n\tSession,\n\tSubmissionId,\n\tSubmissionRecord,\n\tTask,\n\tTaskId,\n\tTaskOptions,\n\tTaskRecord,\n\tTaskState,\n\tTx,\n\tWatchHandle,\n} from \"../types.ts\";\nimport type { TaskGraph, TaskGraphWatch } from \"./task-graph.ts\";\nimport type { UsageState } from \"./usage.ts\";\nimport type { ConversationView } from \"./view.ts\";\n\n/** Provider and model ID resolved through the provider-neutral model runtime contract. */\nexport type ModelRef = {\n\treadonly provider: string;\n\treadonly modelId: string;\n};\n\nexport type UserInput = UserMessage[\"content\"];\n\n/** Host submission: user input that may start a run, or a passive entry write. */\nexport type SubmissionDraft = {\n\treadonly requestId?: string;\n} & (\n\t| {\n\t\t\treadonly type: \"input\";\n\t\t\treadonly content: UserInput;\n\t\t\treadonly whenBusy?: \"steer\" | \"followUp\" | \"reject\";\n\t\t\treadonly entry?: never;\n\t }\n\t| {\n\t\t\treadonly type: \"write\";\n\t\t\treadonly entry: EntryDraft;\n\t\t\treadonly content?: never;\n\t\t\treadonly whenBusy?: never;\n\t }\n);\n\nexport type InputSubmissionDraft = Extract<SubmissionDraft, { readonly type: \"input\" }>;\n\nexport type SettledSubmissionRecord = SubmissionRecord & {\n\treadonly status: \"done\" | \"unanswered\";\n};\n\n/** Awaitable host object for one durably admitted submission. */\nexport interface Submission {\n\treadonly id: SubmissionId;\n\tstatus(context: Context): Promise<SubmissionRecord>;\n\twait(context: Context): Promise<SettledSubmissionRecord>;\n\tabort(context: Context): Promise<\"aborted\" | \"already_placed\" | \"settled\">;\n}\n\nexport type SettledTask<R> = TaskRecord<JsonValue, JsonValue, R> & {\n\treadonly state: Extract<TaskState<JsonValue, R>, { readonly status: \"terminal\" }>;\n};\n\n/** Erased executable task definition stored in the registry. */\nexport type AnyTask = {\n\treadonly definition: {\n\t\treadonly name: string;\n\t\treadonly version: number;\n\t\treadonly initial: unknown;\n\t\treadonly phases: Readonly<Record<string, unknown>>;\n\t\treadonly abort: unknown;\n\t\treadonly migrate?: unknown;\n\t\treadonly hooks?: object;\n\t};\n};\n\n/** Options of `Conversation.abort()`. */\nexport type ConversationAbortOptions = {\n\t/**\n\t * Cross background boundaries: mark every live task reached ignoring the background flag when the abort is admitted,\n\t * withdraw the queued inputs of every conversation reached, and wait until those tasks are terminal and the\n\t * conversation is ordinarily idle. Background work created afterwards is neither marked nor awaited.\n\t */\n\treadonly background?: boolean;\n};\n\n/** Hook handler map declared by a task definition. */\nexport type HooksOf<K> = K extends Task<infer _I, infer _S, infer _R, infer H> ? H : never;\n\n/**\n * Invocation-bound conversation operations for tasks and tools. Rejects after the invocation ends; passive entries are\n * written with ordinary transaction writes instead.\n */\nexport interface ConversationHandle {\n\treadonly id: ConversationId;\n\tsubmit(submission: InputSubmissionDraft, context: Context): Promise<Submission>;\n\t/** `Conversation.abort()`: withdraw queued inputs, abort the ordinary ownership scope, and wait until it is idle. */\n\tabort(context: Context, options?: ConversationAbortOptions): Promise<void>;\n\t/** Resolve when the conversation's ordinary ownership scope has no live non-background task. */\n\twaitForIdle(context: Context): Promise<void>;\n}\n\n/** Post-tools controls requested by a tool result. */\nexport type ToolControl = {\n\treadonly addTools?: readonly string[];\n\treadonly terminate?: true;\n\treadonly handoff?: string;\n};\n\n/** Remark about a call for the model and the UI, such as truncation or a spill path; never part of the tool's data. */\nexport type ToolDiagnostic = {\n\treadonly severity: \"info\" | \"warn\" | \"error\";\n\treadonly message: string;\n\treadonly code?: string;\n};\n\n/**\n * What a tool returns, on three channels: `output` for the model, `structuredOutput` for programs that call the tool\n * (`executeTool()` callers, code mode scripts), and `details` for UIs.\n */\nexport type ToolExecutionResult<TDetails extends JsonValue = JsonValue> = {\n\t/** For the model. Omitted: the retained `output()` text. */\n\treadonly output?: ToolResultMessage[\"content\"];\n\t/**\n\t * For programs. Required unless `isError` when the tool declares `structuredOutputSchema`, and validated against it;\n\t * not allowed without one, where programs get the output itself (`NestedToolExecutionResult.structuredOutput`).\n\t */\n\treadonly structuredOutput?: JsonValue;\n\treadonly isError?: boolean;\n\t/** Omitted: the last `details()` value becomes the details. */\n\treadonly details?: TDetails;\n\t/** Added after those recorded through `api.diagnostic()`. */\n\treadonly diagnostics?: readonly ToolDiagnostic[];\n\t/** Spend of the execution itself, such as a model call; stored on the result and in `nyan.usage.tools`. */\n\treadonly usage?: Usage;\n\treadonly control?: ToolControl;\n};\n\n/**\n * Result of a nested call, as `executeTool()` returns it. Programs read `structuredOutput`; the output for the model\n * is not kept, and `control` does not apply.\n */\nexport type NestedToolExecutionResult = {\n\t/** The nested call's tool task. */\n\treadonly taskId: TaskId;\n\t/**\n\t * The value for programs. A tool with `structuredOutputSchema`: its validated `structuredOutput`, absent on an error\n\t * result that has none. A tool without: its bounded output, success or error, as a string for one text item, an\n\t * `ImageContent` for one image, `\"\"` for none, and the content list otherwise. Absent on an error result the Harness\n\t * wrote itself (unavailable, invalid, blocked, interrupted, aborted); `diagnostics` say what went wrong.\n\t */\n\treadonly structuredOutput?: JsonValue;\n\treadonly isError: boolean;\n\treadonly details?: JsonValue;\n\treadonly diagnostics: readonly ToolDiagnostic[];\n\treadonly usage?: Usage;\n\t/** Execution time of the attempt that produced the result; absent when it never executed. */\n\treadonly durationMs?: number;\n};\n\n/** Whether the tools of one round run at once or one after another in call order. */\nexport type ToolExecutionMode = \"parallel\" | \"sequential\";\n\n/** How many queued items of one mode a boundary places: the first, or all of them. */\nexport type QueueMode = \"all\" | \"one-at-a-time\";\n\n/**\n * Operations available to one tool invocation. A plain object, so a wrapper can spread it. Every operation rejects after\n * the invocation ends.\n */\nexport interface ToolExecutionApi<TDetails extends JsonValue = JsonValue> extends DocumentObserver, DocumentReader {\n\treadonly taskId: TaskId;\n\treadonly conversationId: ConversationId;\n\treadonly callId: string;\n\t/** The tool task's phase snapshot. */\n\treadonly registry: RegistrySnapshot;\n\t/** The calling conversation's agent, as the tool task's phase resolved it. */\n\tagent(context: Context): Promise<Agent>;\n\t/** `HarnessOptions.models`: the catalog, credentials, and request transforms generation uses. */\n\treadonly models: ModelRuntime;\n\t/** Built by `HarnessOptions.env` for this call; `undefined` without an environment. */\n\treadonly env: ExecutionEnv | undefined;\n\t/**\n\t * Append running output; it becomes the result's `output` when the result omits it. `skipped` counts output\n\t * omitted before the chunk, as reported by an environment given `outputWindow` (`ShellOutputInfo.skipped`).\n\t */\n\toutput(chunk: string | Uint8Array, skipped?: ShellOutputSkip): void;\n\t/**\n\t * The tail this call's output keeps and the pace of its progress commits, for `ShellExecOptions.window`; `undefined`\n\t * when the tool keeps the head of its output, which cannot accept skips. A wrapper that replaces `output` and\n\t * transforms text must also replace this with `undefined`, so skipped text cannot bypass its transform.\n\t */\n\treadonly outputWindow: ShellOutputWindow | undefined;\n\t/**\n\t * The output retained so far, as the model will see it when the result omits `output`, and whether earlier output was\n\t * dropped; for a tool that also returns that text in its `structuredOutput`.\n\t */\n\tretainedOutput(): { readonly text: string; readonly truncated: boolean };\n\t/** Record a model-visible remark about this call. */\n\tdiagnostic(diagnostic: ToolDiagnostic): void;\n\t/** Replace running details; the last value becomes the result details when the result omits `details`. */\n\tdetails(value: TDetails, context: Context): Promise<void>;\n\tcommit<T>(change: (tx: Tx) => T | Promise<T>, context: Context): Promise<T>;\n\tmemo<T extends JsonValue>(name: string, context: Context): Promise<T | undefined>;\n\tmemo<T extends JsonValue>(name: string, candidate: T, context: Context): Promise<T>;\n\t/**\n\t * Create a task in one commit. A child task of a tool that is not replay-safe defaults to `abandonOnRestart`: the\n\t * tool never resumes after a restart, so nothing awaits the child then.\n\t */\n\tcreateTask<I, S extends { phase: string }, R, H extends object>(\n\t\ttask: Task<I, S, R, H>,\n\t\tinput: I,\n\t\toptions: Omit<TaskOptions, \"conversationId\">,\n\t\tcontext: Context,\n\t): Promise<TaskId<R>>;\n\tgetTask<R>(id: TaskId<R>, context: Context): Promise<TaskRecord<JsonValue, JsonValue, R> | undefined>;\n\twaitForTask<R>(id: TaskId<R>, context: Context): Promise<SettledTask<R>>;\n\t/** Invocation-bound handle of an existing conversation, such as one this tool created in `commit()`. */\n\tconversation(id: ConversationId, context: Context): Promise<ConversationHandle | undefined>;\n\t/**\n\t * Run tool `name` as a nested call of this one and wait for its result. The nested call is its own `nyan.tool` task,\n\t * owned by this call: it resolves the tool among the conversation's tools, validates, runs the `ToolTask` hooks (which\n\t * see `call.parent`), applies output limits and the tool's replay policy, and reports progress in `nyan.live.nestedTools`.\n\t * Its result returns here instead of entering the transcript. A call that is blocked, invalid, throws, is interrupted,\n\t * or is aborted returns an `isError` result.\n\t *\n\t * The nested call's key names it within this call; its call ID is `<callId>/<key>`. By default the key is the call's\n\t * position among this invocation's nested calls, `1`, `2`, ... An explicit `key` must be non-empty, without `/`, not\n\t * `__proto__`, and not a positive integer, so it never collides with a default one. A rerun of a replay-safe tool\n\t * that makes a call with a used key, by calling in the same order or by passing the same `key`, gets that nested call\n\t * back, finished or still running, instead of starting another. A nested call a crash interrupted before its result\n\t * committed follows its own replay policy, so this is not exactly-once execution. Reusing a key with another tool or\n\t * other arguments throws. A tool that is not replay-safe never reruns: after a restart, its unfinished nested calls\n\t * are abandoned (`TaskOptions.abandonOnRestart`) before they run again.\n\t *\n\t * `progress: false` commits no running output, details, or diagnostics to the nested call's slot, only its status;\n\t * the result still carries its details and diagnostics, and a schema-less tool's output as `structuredOutput`. An\n\t * interrupted or aborted call's result is built from its slot, so it then has none of them. Either way, programs never\n\t * get the partial output of an interrupted or aborted call.\n\t *\n\t * Nested calls run as soon as they are made, whatever their `executionMode`; the caller decides what runs at once by\n\t * what it awaits. Cancelling `context` stops only the wait; the nested call runs on. When this call settles, nested\n\t * calls it left running are aborted first. A nested result's `usage` is already counted under its tool; a result\n\t * that passes it on counts it again. Rejects, instead of returning a result, once `execute()` has returned, when this\n\t * call is aborted, or when the Harness closes.\n\t */\n\texecuteTool(\n\t\tname: string,\n\t\targs: JsonObject,\n\t\tcontext: Context,\n\t\toptions?: { readonly key?: string; readonly progress?: boolean },\n\t): Promise<NestedToolExecutionResult>;\n}\n\n/**\n * Executable tool registered in a registry. Only nyan-ai `Tool` fields enter the transcript. `args` are typed by\n * `parameters`, which the Harness validates them against before `execute()`; `defineTool()` infers both generics.\n */\nexport type ToolRegistration<\n\tTParameters extends TSchema = TSchema,\n\tTDetails extends JsonValue = JsonValue,\n> = Tool<TParameters> & {\n\t/** Whether an interrupted execution may rerun on recovery. Default `unsafe`. */\n\treadonly replay?: \"safe\" | \"unsafe\";\n\t/** Default: the settings' `toolExecution`. One sequential call makes its whole round sequential. */\n\treadonly executionMode?: ToolExecutionMode;\n\t/**\n\t * Repair arguments models commonly get wrong before validation, such as a JSON string where an array belongs. Must be\n\t * pure and must not mutate `args`: it runs again when a call is retried before its intent is recorded. Its result is\n\t * still validated against `parameters`.\n\t */\n\tprepareArguments?(args: unknown): Static<TParameters>;\n\t/**\n\t * Schema of `structuredOutput`, which programs that call the tool receive. Omitted: they receive the result's bounded\n\t * output, success or error, as `NestedToolExecutionResult.structuredOutput` describes.\n\t */\n\treadonly structuredOutputSchema?: TSchema;\n\t/**\n\t * Who may call the tool: the model, other tools through `executeTool()`, or both (default). A code mode tool is\n\t * `[\"model\"]`, so scripts cannot start scripts; tools behind code mode, such as MCP tools, can be `[\"tools\"]`, so the\n\t * model is never offered them.\n\t */\n\treadonly callers?: readonly (\"model\" | \"tools\")[];\n\treadonly outputLimits?: {\n\t\treadonly maxBytes?: number;\n\t\treadonly maxLines?: number;\n\t\treadonly retain?: \"head\" | \"tail\";\n\t};\n\texecute(\n\t\targs: Static<TParameters>,\n\t\tapi: ToolExecutionApi<TDetails>,\n\t\tcontext: Context,\n\t): Promise<ToolExecutionResult<TDetails>>;\n};\n\n/** Input to system prompt section rendering for one request preparation. */\nexport type PromptInput<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly conversationId: ConversationId;\n\t/** The request's resolution; `agent.tools` are the tools offered in this request. */\n\treadonly agent: Agent<Tool>;\n\t/** Built by `HarnessOptions.env` for this preparation; `undefined` without an environment. */\n\treadonly env: ExecutionEnv | undefined;\n\t/** Sections already in effect after replaying the active transcript. */\n\treadonly shown: Readonly<Record<string, string>>;\n\t/** Committed document reads. */\n\treadonly read: DocumentReader;\n};\n\n/** One system prompt section; the agent's sections render in order before each request. */\nexport type PromptSection<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly key: string;\n\trender(input: PromptInput<Tool>, context: Context): string | undefined | Promise<string | undefined>;\n\t/** Default true: wrap the text as `<key>\\n...\\n</key>`. */\n\treadonly tag?: boolean;\n};\n\n/** Built by `hook()`; matches tasks by name. */\nexport type HookRegistration = { readonly task: string; readonly handlers: object };\n\n/** Built by `wrapTool()` and `wrapSection()`; targets a tool name or a section key. Wrappers are pure. */\nexport type Wrap<Tool extends ToolRegistration = ToolRegistration> =\n\t| { readonly tool: string; wrap(tool: Tool): Tool }\n\t| { readonly section: string; wrap(section: PromptSection<Tool>): PromptSection<Tool> };\n\n/** Named bundle of code; installed in a registry and selected by conversations by name. */\nexport interface Extension<Tool extends ToolRegistration = ToolRegistration> {\n\treadonly name: string;\n\treadonly tools?: readonly Tool[];\n\treadonly sections?: readonly PromptSection<Tool>[];\n\treadonly hooks?: readonly HookRegistration[];\n\t/** Apply where this extension is selected, in order. */\n\treadonly wraps?: readonly Wrap<Tool>[];\n\t/** Resolved by name for every task, whichever conversations select this extension. */\n\treadonly tasks?: readonly AnyTask[];\n}\n\n/** Immutable view of one published registry state. */\nexport interface RegistrySnapshot<Tool extends ToolRegistration = ToolRegistration> {\n\tinstalled(): readonly Extension<Tool>[];\n\textension(name: string): Extension<Tool> | undefined;\n\t/** Every installed tool with its extension, in install order. Names may repeat across extensions. */\n\ttools(): readonly { readonly extension: Extension<Tool>; readonly tool: Tool }[];\n\tsections(): readonly { readonly extension: Extension<Tool>; readonly section: PromptSection<Tool> }[];\n\t/** Built-in and installed task definitions. */\n\ttasks(): readonly AnyTask[];\n\ttask(name: string): AnyTask | undefined;\n}\n\n/** Read side of a registry consumed by a Harness. */\nexport interface RegistryReader<Tool extends ToolRegistration = ToolRegistration> {\n\t/** Immutable view of the whole current registry. */\n\tsnapshot(): RegistrySnapshot<Tool>;\n\t/** Called synchronously after every publication; wakes the scheduler to reconsider blocked tasks. */\n\tsubscribe(listener: () => void): () => void;\n}\n\n/** Application-owned registry of extensions. */\nexport interface Registry<Tool extends ToolRegistration = ToolRegistration> extends RegistryReader<Tool> {\n\t/** Install `extension`, or replace the installed extension with its name in place. Publishes at once. */\n\tinstall(extension: Extension<Tool>): void;\n\t/** Remove the installed extension with `extension.name`, whichever object it is. A later install appends. */\n\tuninstall(extension: Extension): void;\n}\n\n/** Stored choices of one conversation; names, not objects. Unset fields follow the host. */\nexport type AgentState = {\n\tmodel?: ModelRef;\n\tthinkingLevel?: ModelThinkingLevel;\n\t/** An array selects exactly these extensions, in order. An object edits the host default selection. */\n\textensions?: string[] | { add?: string[]; remove?: string[] };\n\t/** Filters the selected extensions' tools: the enabled tools. An array enables exactly these, in order. */\n\ttools?: string[] | { remove: string[] };\n\t/**\n\t * Filters the enabled tools the model may call (`callers` includes `model`): the tools offered to it. An array offers\n\t * exactly these, in order. Never widens: other tools can still call the ones it leaves out.\n\t */\n\tmodelTools?: string[] | { remove: string[] };\n\t/** Rendered after every extension section, as the section `instructions`. */\n\tinstructions?: string;\n\t/** Directory within the environment's file system, passed to `HarnessOptions.env`. */\n\tcwd?: string;\n};\n\n/** A change to `nyan.agent`: a given field replaces the stored one, `null` clears it, `undefined` changes nothing. */\nexport type AgentChange = {\n\treadonly model?: ModelRef | null;\n\treadonly thinkingLevel?: ModelThinkingLevel | null;\n\treadonly extensions?:\n\t\t| readonly Extension[]\n\t\t| { readonly add?: readonly Extension[]; readonly remove?: readonly Extension[] }\n\t\t| null;\n\treadonly tools?: readonly ToolRegistration[] | { readonly remove: readonly ToolRegistration[] } | null;\n\treadonly modelTools?: readonly ToolRegistration[] | { readonly remove: readonly ToolRegistration[] } | null;\n\treadonly instructions?: string | null;\n\treadonly cwd?: string | null;\n};\n\n/** A conversation's agent resolved against a registry snapshot and the settings. */\nexport type Agent<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly model?: ModelRef;\n\treadonly thinkingLevel: ModelThinkingLevel;\n\treadonly extensions: readonly Extension<Tool>[];\n\t/** The tools a request offers, in order: enabled, callable by the model, and selected by `modelTools`. */\n\treadonly tools: readonly Tool[];\n\t/** The tools nested calls (`executeTool()`) resolve among, in order: enabled and callable by tools. */\n\treadonly callable: readonly Tool[];\n\t/** Extension sections, then `instructions` when set. */\n\treadonly sections: readonly PromptSection<Tool>[];\n\treadonly instructions?: string;\n\treadonly cwd?: string;\n};\n\n/**\n * Runs inside the creating commit, after the creation hook and the `agent` change. The conversation creation is already\n * a table write, so table reads here throw `ReadAfterWrite`; document access remains available.\n */\nexport type ConversationInit = (tx: Tx, conversationId: ConversationId) => void | Promise<void>;\n\nexport type ConversationCreateOptions = {\n\treadonly ownership: ConversationOwnership;\n\t/** Applied in the creating commit after the creation hook's copy, before `init`. */\n\treadonly agent?: AgentChange;\n\treadonly init?: ConversationInit;\n};\n\n/** Curated nyan-ai request options; absent fields use nyan-ai defaults. */\nexport type ConversationStreamOptions = {\n\ttransport?: Transport;\n\ttimeoutMs?: number;\n\t/** Provider/SDK retries inside one request attempt. */\n\tmaxRetries?: number;\n\tmaxRetryDelayMs?: number;\n\theaders?: Record<string, string>;\n\tmetadata?: JsonObject;\n\tcacheRetention?: CacheRetention;\n\tdeferred?: boolean | { window?: \"15m\" | \"1h\" | \"24h\" };\n};\n\n/** Durable generation attempt retries; the JSON shape of nyan-ai `RetryPolicy`. */\nexport type ConversationRetryPolicy = {\n\tenabled: boolean;\n\tmaxRetries: number;\n\tbaseDelayMs: number;\n\tmaxAgentDelayMs?: number;\n};\n\n/** Automatic compaction thresholds (spec §8.7); manual compaction ignores `enabled`. */\nexport type CompactionPolicy = {\n\t/** Threshold and overflow compaction. */\n\tenabled: boolean;\n\t/** Room kept free for the answer: generation blocks to compact above `contextWindow - reserveTokens`. */\n\treserveTokens: number;\n\t/** Approximate size of the recent context a summary keeps verbatim. */\n\tkeepRecentTokens: number;\n\t/** Background compaction starts `backgroundTokens` below the blocking threshold; `0` disables it. */\n\tbackgroundTokens: number;\n};\n\n/**\n * How often running progress is committed. Each progress commit is a storage write; a host whose storage is remote can\n * commit less often, so live answers and tool output appear in larger steps.\n */\nexport type ProgressPolicy = {\n\t/** Minimum pause between commits of the answer being generated. */\n\tpartialIntervalMs: number;\n\t/** Minimum pause between commits of running tool output; large commits also pause in proportion to their size. */\n\toutputIntervalMs: number;\n};\n\n/** Why a compaction runs: `compact()`, a threshold in generation preparation, or a context overflow. */\nexport type CompactionReason = \"manual\" | \"threshold\" | \"overflow\";\n\n/**\n * `entryId` of a blocking compaction's summary, or the `submissionId` of a conversation-owned compaction's summary\n * write; both absent when nothing was compacted.\n */\nexport type CompactionResult = { entryId?: EntryId; submissionId?: SubmissionId };\n\n/** Harness-wide run policy. Read at every resolution and never copied; getters are fine. Synchronous: some readers run on the Session line. */\nexport type HarnessSettings = {\n\t/** Default extension selection; absent: every installed extension, in install order. */\n\treadonly extensions?: readonly Extension[];\n\treadonly stream?: ConversationStreamOptions;\n\treadonly retry?: Partial<ConversationRetryPolicy>;\n\treadonly compaction?: Partial<CompactionPolicy>;\n\treadonly progress?: Partial<ProgressPolicy>;\n\treadonly toolExecution?: ToolExecutionMode;\n\treadonly steeringMode?: QueueMode;\n\treadonly followUpMode?: QueueMode;\n\t/**\n\t * How long an idle conversation keeps its last context read in memory, so its next run reads only newer entries.\n\t * Busy conversations always keep it; `0` drops it once the conversation is idle.\n\t */\n\treadonly contextRetentionMs?: number;\n\t/**\n\t * How long a loaded document that no watch or document state observes stays in memory after its last read or write;\n\t * the next access loads it from Storage. Observed documents always stay. Default ten minutes; `0` drops one right\n\t * after use; `Infinity` keeps them. Anything else that is not a number of milliseconds means the default.\n\t */\n\treadonly documentRetentionMs?: number;\n};\n\n/** Resolved settings: every field over its built-in default, object fields merged. */\nexport type Settings = {\n\t/** Absent: every installed extension, in install order. */\n\treadonly extensions?: readonly Extension[];\n\treadonly stream: ConversationStreamOptions;\n\treadonly retry: ConversationRetryPolicy;\n\treadonly compaction: CompactionPolicy;\n\treadonly progress: ProgressPolicy;\n\treadonly toolExecution: ToolExecutionMode;\n\treadonly steeringMode: QueueMode;\n\treadonly followUpMode: QueueMode;\n\treadonly contextRetentionMs: number;\n\treadonly documentRetentionMs: number;\n};\n\n/** What `HarnessOptions.env` builds an environment for. */\nexport type EnvTarget = {\n\treadonly conversationId: ConversationId;\n\t/** The conversation's agent `cwd`. */\n\treadonly cwd?: string;\n\treadonly read: DocumentReader;\n};\n\nexport type HarnessOptions<Tool extends ToolRegistration = ToolRegistration> = {\n\t/** Provider-neutral model operations used by generation. */\n\treadonly models: ModelRuntime;\n\treadonly registry: RegistryReader<Tool>;\n\treadonly settings?: HarnessSettings;\n\t/** Builds a conversation's environment at each use. Never called on the Session line; may be async. */\n\treadonly env?: (target: EnvTarget, context: Context) => ExecutionEnv | undefined | Promise<ExecutionEnv | undefined>;\n\t/**\n\t * Runs in every commit that creates or forks a conversation, raw `tx.createConversation()` included, after the\n\t * built-in `nyan.*` documents and before the conveniences apply `agent` and run `init`. A fork already has its copies.\n\t * Table reads throw `ReadAfterWrite`, as in `init`; a throw fails the creating commit.\n\t */\n\treadonly conversationCreated?: (tx: Tx, conversation: ConversationRecord) => void | Promise<void>;\n\treadonly now?: () => number;\n\t/**\n\t * Receives failures that do not fail the calling operation, such as a throwing hook or listener, and the error that\n\t * fails the Session, once. Its own throw or rejection is dropped.\n\t */\n\treadonly onReport?: (error: unknown) => void;\n};\n\n/** Live task and what the scheduler would do with it under the current registry. */\nexport type TaskInspection = {\n\treadonly record: TaskRecord<JsonValue, JsonValue, JsonValue>;\n\treadonly state: /** An invocation is active. */\n\t\t| { readonly kind: \"running\" }\n\t\t/** The next scheduling pass reserves it; `migrates` when its definition is newer and has `migrate`. */\n\t\t| { readonly kind: \"ready\"; readonly migrates: boolean }\n\t\t/**\n\t\t * Waits for these live tasks: the live part of its `on`, or, when abort-marked, its live ordinary owned work, which\n\t\t * must end before its abort handler starts.\n\t\t */\n\t\t| { readonly kind: \"waiting\"; readonly on: readonly TaskId[] }\n\t\t/** Outcome held until its ordinary owned work drains. */\n\t\t| { readonly kind: \"completing\" }\n\t\t/** No registered definition can take it; aborting it settles it as `orphaned`. */\n\t\t| {\n\t\t\t\treadonly kind: \"blocked\";\n\t\t\t\treadonly reason: \"missing_task\" | \"task_too_old\" | \"migration_failed\";\n\t\t\t\treadonly error?: unknown;\n\t\t };\n};\n\n/** Point-in-time view of live work: unfinished tasks and submissions, read on the Session line. */\nexport type HarnessInspection = {\n\treadonly scheduling: \"paused\" | \"running\" | \"closing\";\n\treadonly tasks: readonly TaskInspection[];\n\t/** Queued and placed submissions, in ID order. */\n\treadonly submissions: readonly SubmissionRecord[];\n};\n\n/** Raw active transcript and derived model context. */\nexport type ContextView = {\n\t/** Newest applicable head marker, if any. */\n\treadonly head: EntryRecord | undefined;\n\t/** Raw active entries: the head marker followed by non-head entries from its head through the tail. */\n\treadonly entries: readonly EntryRecord[];\n\t/** Per entry of `entries`, its model messages after edits and excluded stop reasons, before tool result ordering. */\n\treadonly contributions: readonly (readonly Message[])[];\n\t/** Model context for the next provider request. */\n\treadonly messages: readonly Message[];\n};\n\n/** Stateless handle for one conversation, bound to the Harness that returned it. Compare handles by `id`. */\nexport interface Conversation {\n\treadonly id: ConversationId;\n\n\t/** Resolved with the current registry snapshot and settings. */\n\tagent(context: Context): Promise<Agent>;\n\t/** `configure()` in its own commit. */\n\tconfigure(change: AgentChange, context: Context): Promise<void>;\n\n\t/**\n\t * Durably admit user input or a passive entry write. A busy conversation, or one with queued items, queues it in\n\t * `nyan.inbox`; `whenBusy: \"reject\"` rejects with `ConversationBusy` instead and writes nothing.\n\t */\n\tsubmit(submission: SubmissionDraft, context: Context): Promise<Submission>;\n\t/**\n\t * Admit a write of a `nyan.reset` entry that starts a new context, carrying `handoff` as a user message when given.\n\t * Resolves after admission; while busy, it is placed at the next boundary.\n\t */\n\treset(handoff: string | undefined, context: Context): Promise<void>;\n\t/**\n\t * Admit a manual compaction task and return its ID. It summarizes while the conversation keeps working and places its\n\t * summary through a write submission: at once when idle, otherwise at the next boundary (spec §8.7).\n\t */\n\tcompact(instructions: string | undefined, context: Context): Promise<TaskId<CompactionResult>>;\n\n\t/** Session commit whose `tx.createTask()` defaults to this conversation. */\n\tcommit<T>(change: (tx: Tx) => T | Promise<T>, context: Context): Promise<T>;\n\t/**\n\t * Committed raw active transcript and model context. With `at`, the context as of that visible entry: the same view\n\t * `fork(at)` would start with, without creating a conversation.\n\t */\n\tcontext(context: Context, options?: { readonly at?: EntryId }): Promise<ContextView>;\n\t/** Fork-aware history of this conversation, newest first unless `query.order` is `ascending`. */\n\tentries(\n\t\tquery: Omit<EntryQuery, \"conversationId\">,\n\t\tlimit: number,\n\t\tcursor: Cursor | undefined,\n\t\tcontext: Context,\n\t): Promise<Page<EntryRecord, Cursor>>;\n\tfork(at: EntryId, options: ConversationCreateOptions, context: Context): Promise<Conversation>;\n\t/**\n\t * Withdraw queued inputs (queued writes stay), mark every live non-background task of the ordinary ownership scope,\n\t * signal them, and resolve once the scope is idle. Background subtrees survive unless `background` is set.\n\t */\n\tabort(context: Context, options?: ConversationAbortOptions): Promise<void>;\n\t/**\n\t * Resolve when the ordinary ownership scope has no live non-background task: this conversation and the conversations\n\t * owned, transitively, by its non-background tasks.\n\t */\n\twaitForIdle(context: Context): Promise<void>;\n\t/** The structural view (spec §9.3) as a disposable read-only Chord state. */\n\tviewState(context: Context): Promise<AttachedReplicatedState<ConversationView>>;\n\t/** The structural view as a serialized exact-frame watch with bounded pending frames. */\n\twatch(context: Context): Promise<ConversationWatch>;\n}\n\nexport type ConversationWatch = WatchHandle<ConversationView>;\n\n/** Durable agent harness over one Session. */\nexport interface Harness extends Session {\n\t/**\n\t * Enable task scheduling. Idempotent; throws after close. Calls that ask for progress enable it too:\n\t * `Conversation.submit()`, `Conversation.compact()`, `Conversation.abort()`, `Submission.wait()`, `waitForTask()`,\n\t * `Harness.waitForIdle()`, and `Conversation.waitForIdle()`. Read-only viewers never do.\n\t */\n\tresume(): void;\n\n\t/** Return the reserved root conversation, creating it with `agent` and `init` in one commit when absent. */\n\troot(\n\t\tcontext: Context,\n\t\toptions?: { readonly agent?: AgentChange; readonly init?: ConversationInit },\n\t): Promise<Conversation>;\n\tconversation(id: ConversationId, context: Context): Promise<Conversation | undefined>;\n\tcreateConversation(options: ConversationCreateOptions, context: Context): Promise<Conversation>;\n\n\tgetTask<R>(id: TaskId<R>, context: Context): Promise<TaskRecord<JsonValue, JsonValue, R> | undefined>;\n\t/** Live tasks and unsettled submissions. Writes nothing and runs no task code. */\n\tinspect(context: Context): Promise<HarnessInspection>;\n\t/** Reacquire a submission, for example after reopen. */\n\tsubmission(id: SubmissionId, context: Context): Promise<Submission | undefined>;\n\t/** `not_found` for an unknown submission or one of another conversation than `conversationId`. */\n\tabortSubmission(\n\t\tid: SubmissionId,\n\t\tcontext: Context,\n\t\tconversationId?: ConversationId,\n\t): Promise<\"aborted\" | \"already_placed\" | \"settled\" | \"not_found\">;\n\t/**\n\t * Commit the abort mark, signal and join an active run invocation, and schedule the abort invocation. A task whose\n\t * definition cannot take it settles as `orphaned` instead.\n\t */\n\tabortTask(id: TaskId, context: Context): Promise<\"marked\" | \"terminal\">;\n\t/** Resolve with the terminal receipt; cancelling `context` cancels only this wait. */\n\twaitForTask<R>(id: TaskId<R>, context: Context): Promise<SettledTask<R>>;\n\t/** Resolve when the ordinary ownership scope of every ownerless conversation has no live non-background task. */\n\twaitForIdle(context: Context): Promise<void>;\n\t/** Session total: every conversation's `nyan.usage` summed. */\n\tusage(context: Context): Promise<UsageState>;\n\t/** Every live task with its owner edge, status, and owned conversations (spec §9.5), as a disposable Chord state. */\n\ttaskGraph(context: Context): Promise<AttachedReplicatedState<TaskGraph>>;\n\t/** The task graph as a serialized exact-frame watch with bounded pending frames. */\n\twatchTaskGraph(context: Context): Promise<TaskGraphWatch>;\n}\n\n/** What a hook may use: committed reads and the asking task's memos, which hooks and the task share. */\nexport interface HookApi extends DocumentReader {\n\treadonly taskId: TaskId;\n\treadonly conversationId: ConversationId;\n\t/** `HarnessOptions.models`. */\n\treadonly models: ModelRuntime;\n\tmemo<T extends JsonValue>(name: string, context: Context): Promise<T | undefined>;\n\tmemo<T extends JsonValue>(name: string, candidate: T, context: Context): Promise<T>;\n}\n\nexport type HookResult<T> = T | undefined | Promise<T | undefined>;\n\n/** Hooks of the built-in generation task. */\nexport interface GenerationHooks {\n\t/** Before every request attempt, including recovery; the result is used for that request only. */\n\tbeforeRequest(\n\t\trequest: { readonly messages: readonly Message[] },\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly messages: readonly Message[] }>;\n\t/** Every terminal provider message, before classification. */\n\tafterResponse(message: AssistantMessage, api: HookApi, context: Context): void | Promise<void>;\n\t/** A final answer; the first `continue` appends a user message and continues the run. */\n\tonYield(answer: AssistantMessage, api: HookApi, context: Context): HookResult<{ readonly continue: UserInput }>;\n\t/** After every tool of the round is terminal; `results` are the round's result entries in call order. */\n\tafterTools(assistant: EntryId, results: readonly EntryId[], api: HookApi, context: Context): void | Promise<void>;\n}\n\n/** A call as tool hooks see it; `parent` is set for a nested call, one a running tool made through `executeTool()`. */\nexport type ToolHookCall = ToolCall & {\n\treadonly parent?: { readonly taskId: TaskId; readonly callId: string };\n};\n\n/** Hooks of the built-in tool task, for model-issued and nested calls. */\nexport interface ToolHooks {\n\t/** Before intent; the first `block` wins, otherwise `arguments` replace the call's arguments. A throw blocks. */\n\tbeforeTool(\n\t\tcall: ToolHookCall,\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly arguments?: JsonObject; readonly block?: string }>;\n\t/** After execution, before the result is committed; replaces the result. */\n\tafterTool(\n\t\tcall: ToolHookCall,\n\t\tresult: ToolExecutionResult,\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<ToolExecutionResult>;\n}\n\n/** Hooks of the built-in compaction task. */\nexport interface CompactionHooks {\n\t/**\n\t * After range selection, before summarizing; the first decision wins. `entries` are the active entries the summary\n\t * replaces, the head marker first, and `messages` their model context, the summarizer's source; `firstKept` is the\n\t * first entry kept verbatim.\n\t */\n\tbeforeCompact(\n\t\tcompaction: {\n\t\t\treadonly reason: CompactionReason;\n\t\t\treadonly entries: readonly EntryRecord[];\n\t\t\treadonly messages: readonly Message[];\n\t\t\treadonly firstKept: EntryId;\n\t\t\treadonly instructions?: string;\n\t\t},\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly decline: true } | { readonly summary: string }>;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n\tAssistantMessage,\n\tCacheRetention,\n\tMessage,\n\tModelRuntime,\n\tModelThinkingLevel,\n\tStatic,\n\tTool,\n\tToolCall,\n\tToolResultMessage,\n\tTransport,\n\tTSchema,\n\tUsage,\n\tUserMessage,\n} from \"@ny4n/ai/contracts\";\nimport type { AttachedReplicatedState, Context, JsonValue } from \"@ny4n/chord\";\nimport type { ExecutionEnv, ShellOutputSkip, ShellOutputWindow } from \"../env/index.ts\";\nimport type {\n\tConversationId,\n\tConversationOwnership,\n\tConversationRecord,\n\tCursor,\n\tDocumentObserver,\n\tDocumentReader,\n\tEntryDraft,\n\tEntryId,\n\tEntryQuery,\n\tEntryRecord,\n\tJsonObject,\n\tPage,\n\tSession,\n\tSubmissionId,\n\tSubmissionRecord,\n\tTask,\n\tTaskId,\n\tTaskOptions,\n\tTaskRecord,\n\tTaskState,\n\tTx,\n\tWatchHandle,\n} from \"../types.ts\";\nimport type { TaskGraph, TaskGraphWatch } from \"./task-graph.ts\";\nimport type { UsageState } from \"./usage.ts\";\nimport type { ConversationView } from \"./view.ts\";\n\n/** Provider and model ID resolved through the provider-neutral model runtime contract. */\nexport type ModelRef = {\n\treadonly provider: string;\n\treadonly modelId: string;\n};\n\nexport type UserInput = UserMessage[\"content\"];\n\n/**\n * The entry an input is placed as, instead of `nyan.user`: an application kind, and data the transcript shows, such as its\n * author. Its model message is still the input's user message.\n */\nexport type InputEntry = { readonly kind: string; readonly data?: JsonValue };\n\n/** Host submission: user input that may start a run, or a passive entry write. */\nexport type SubmissionDraft = {\n\treadonly requestId?: string;\n} & (\n\t| {\n\t\t\treadonly type: \"input\";\n\t\t\treadonly content: UserInput;\n\t\t\treadonly whenBusy?: \"steer\" | \"followUp\" | \"reject\";\n\t\t\t/** Place the input as this entry; default `nyan.user` without data. The kind must not start with `nyan.`. */\n\t\t\treadonly entry?: InputEntry;\n\t }\n\t| {\n\t\t\treadonly type: \"write\";\n\t\t\treadonly entry: EntryDraft;\n\t\t\treadonly content?: never;\n\t\t\treadonly whenBusy?: never;\n\t }\n);\n\nexport type InputSubmissionDraft = Extract<SubmissionDraft, { readonly type: \"input\" }>;\n\nexport type SettledSubmissionRecord = SubmissionRecord & {\n\treadonly status: \"done\" | \"unanswered\";\n};\n\n/** Awaitable host object for one durably admitted submission. */\nexport interface Submission {\n\treadonly id: SubmissionId;\n\tstatus(context: Context): Promise<SubmissionRecord>;\n\twait(context: Context): Promise<SettledSubmissionRecord>;\n\tabort(context: Context): Promise<\"aborted\" | \"already_placed\" | \"settled\">;\n}\n\nexport type SettledTask<R> = TaskRecord<JsonValue, JsonValue, R> & {\n\treadonly state: Extract<TaskState<JsonValue, R>, { readonly status: \"terminal\" }>;\n};\n\n/** Erased executable task definition stored in the registry. */\nexport type AnyTask = {\n\treadonly definition: {\n\t\treadonly name: string;\n\t\treadonly version: number;\n\t\treadonly initial: unknown;\n\t\treadonly phases: Readonly<Record<string, unknown>>;\n\t\treadonly abort: unknown;\n\t\treadonly migrate?: unknown;\n\t\treadonly hooks?: object;\n\t};\n};\n\n/** Options of `Conversation.abort()`. */\nexport type ConversationAbortOptions = {\n\t/**\n\t * Cross background boundaries: mark every live task reached ignoring the background flag when the abort is admitted,\n\t * withdraw the queued inputs of every conversation reached, and wait until those tasks are terminal and the\n\t * conversation is ordinarily idle. Background work created afterwards is neither marked nor awaited.\n\t */\n\treadonly background?: boolean;\n};\n\n/** Hook handler map declared by a task definition. */\nexport type HooksOf<K> = K extends Task<infer _I, infer _S, infer _R, infer H> ? H : never;\n\n/**\n * Invocation-bound conversation operations for tasks and tools. Rejects after the invocation ends; passive entries are\n * written with ordinary transaction writes instead.\n */\nexport interface ConversationHandle {\n\treadonly id: ConversationId;\n\tsubmit(submission: InputSubmissionDraft, context: Context): Promise<Submission>;\n\t/** `Conversation.abort()`: withdraw queued inputs, abort the ordinary ownership scope, and wait until it is idle. */\n\tabort(context: Context, options?: ConversationAbortOptions): Promise<void>;\n\t/** Resolve when the conversation's ordinary ownership scope has no live non-background task. */\n\twaitForIdle(context: Context): Promise<void>;\n}\n\n/** Post-tools controls requested by a tool result. */\nexport type ToolControl = {\n\treadonly addTools?: readonly string[];\n\treadonly terminate?: true;\n\treadonly handoff?: string;\n};\n\n/** Remark about a call for the model and the UI, such as truncation or a spill path; never part of the tool's data. */\nexport type ToolDiagnostic = {\n\treadonly severity: \"info\" | \"warn\" | \"error\";\n\treadonly message: string;\n\treadonly code?: string;\n};\n\n/**\n * What a tool returns, on three channels: `output` for the model, `structuredOutput` for programs that call the tool\n * (`executeTool()` callers, code mode scripts), and `details` for UIs.\n */\nexport type ToolExecutionResult<TDetails extends JsonValue = JsonValue> = {\n\t/** For the model. Omitted: the retained `output()` text. */\n\treadonly output?: ToolResultMessage[\"content\"];\n\t/**\n\t * For programs. Required unless `isError` when the tool declares `structuredOutputSchema`, and validated against it;\n\t * not allowed without one, where programs get the output itself (`NestedToolExecutionResult.structuredOutput`).\n\t */\n\treadonly structuredOutput?: JsonValue;\n\treadonly isError?: boolean;\n\t/** Omitted: the last `details()` value becomes the details. */\n\treadonly details?: TDetails;\n\t/** Added after those recorded through `api.diagnostic()`. */\n\treadonly diagnostics?: readonly ToolDiagnostic[];\n\t/** Spend of the execution itself, such as a model call; stored on the result and in `nyan.usage.tools`. */\n\treadonly usage?: Usage;\n\treadonly control?: ToolControl;\n};\n\n/**\n * Result of a nested call, as `executeTool()` returns it. Programs read `structuredOutput`; the output for the model\n * is not kept, and `control` does not apply.\n */\nexport type NestedToolExecutionResult = {\n\t/** The nested call's tool task. */\n\treadonly taskId: TaskId;\n\t/**\n\t * The tool's value for programs. A tool with `structuredOutputSchema`: its validated `structuredOutput`, also on an\n\t * error result that has one; absent otherwise, and an error's text is then in an error diagnostic. A tool without:\n\t * its bounded output, success or error, as a string for one text item, an `ImageContent` for one image, `\"\"` for\n\t * none, and the content list otherwise. Absent on an error result the Harness wrote itself (unavailable, invalid,\n\t * blocked, interrupted, aborted); `diagnostics` say what went wrong.\n\t */\n\treadonly structuredOutput?: JsonValue;\n\treadonly isError: boolean;\n\treadonly details?: JsonValue;\n\treadonly diagnostics: readonly ToolDiagnostic[];\n\treadonly usage?: Usage;\n\t/** Execution time of the attempt that produced the result; absent when it never executed. */\n\treadonly durationMs?: number;\n};\n\n/** Whether the tools of one round run at once or one after another in call order. */\nexport type ToolExecutionMode = \"parallel\" | \"sequential\";\n\n/** How many queued items of one mode a boundary places: the first, or all of them. */\nexport type QueueMode = \"all\" | \"one-at-a-time\";\n\n/**\n * Operations available to one tool invocation. A plain object, so a wrapper can spread it. Every operation rejects after\n * the invocation ends.\n */\nexport interface ToolExecutionApi<TDetails extends JsonValue = JsonValue> extends DocumentObserver, DocumentReader {\n\treadonly taskId: TaskId;\n\treadonly conversationId: ConversationId;\n\treadonly callId: string;\n\t/** The tool task's phase snapshot. */\n\treadonly registry: RegistrySnapshot;\n\t/** The calling conversation's agent, as the tool task's phase resolved it. */\n\tagent(context: Context): Promise<Agent>;\n\t/** `HarnessOptions.models`: the catalog, credentials, and request transforms generation uses. */\n\treadonly models: ModelRuntime;\n\t/** Built by `HarnessOptions.env` for this call; `undefined` without an environment. */\n\treadonly env: ExecutionEnv | undefined;\n\t/**\n\t * Append running output; it becomes the result's `output` when the result omits it. `skipped` counts output\n\t * omitted before the chunk, as reported by an environment given `outputWindow` (`ShellOutputInfo.skipped`).\n\t */\n\toutput(chunk: string | Uint8Array, skipped?: ShellOutputSkip): void;\n\t/**\n\t * The tail this call's output keeps and the pace of its progress commits, for `ShellExecOptions.window`; `undefined`\n\t * when the tool keeps the head of its output, which cannot accept skips. A wrapper that replaces `output` and\n\t * transforms text must also replace this with `undefined`, so skipped text cannot bypass its transform.\n\t */\n\treadonly outputWindow: ShellOutputWindow | undefined;\n\t/**\n\t * The output retained so far, as the model will see it when the result omits `output`, and whether earlier output was\n\t * dropped; for a tool that also returns that text in its `structuredOutput`.\n\t */\n\tretainedOutput(): { readonly text: string; readonly truncated: boolean };\n\t/** Record a model-visible remark about this call. */\n\tdiagnostic(diagnostic: ToolDiagnostic): void;\n\t/** Replace running details; the last value becomes the result details when the result omits `details`. */\n\tdetails(value: TDetails, context: Context): Promise<void>;\n\tcommit<T>(change: (tx: Tx) => T | Promise<T>, context: Context): Promise<T>;\n\tmemo<T extends JsonValue>(name: string, context: Context): Promise<T | undefined>;\n\tmemo<T extends JsonValue>(name: string, candidate: T, context: Context): Promise<T>;\n\t/**\n\t * Create a task in one commit. A child task of a tool that is not replay-safe defaults to `abandonOnRestart`: the\n\t * tool never resumes after a restart, so nothing awaits the child then.\n\t */\n\tcreateTask<I, S extends { phase: string }, R, H extends object>(\n\t\ttask: Task<I, S, R, H>,\n\t\tinput: I,\n\t\toptions: Omit<TaskOptions, \"conversationId\">,\n\t\tcontext: Context,\n\t): Promise<TaskId<R>>;\n\tgetTask<R>(id: TaskId<R>, context: Context): Promise<TaskRecord<JsonValue, JsonValue, R> | undefined>;\n\twaitForTask<R>(id: TaskId<R>, context: Context): Promise<SettledTask<R>>;\n\t/** Invocation-bound handle of an existing conversation, such as one this tool created in `commit()`. */\n\tconversation(id: ConversationId, context: Context): Promise<ConversationHandle | undefined>;\n\t/**\n\t * Run tool `name` as a nested call of this one and wait for its result. The nested call is its own `nyan.tool` task,\n\t * owned by this call: it resolves the tool among the conversation's tools, validates, runs the `ToolTask` hooks (which\n\t * see `call.parent`), applies output limits and the tool's replay policy, and reports progress in `nyan.live.nestedTools`.\n\t * Its result returns here instead of entering the transcript. A call that is blocked, invalid, throws, is interrupted,\n\t * or is aborted returns an `isError` result.\n\t *\n\t * The nested call's key names it within this call; its call ID is `<callId>/<key>`. By default the key is the call's\n\t * position among this invocation's nested calls, `1`, `2`, ... An explicit `key` must be non-empty, without `/`, not\n\t * `__proto__`, and not a positive integer, so it never collides with a default one. A rerun of a replay-safe tool\n\t * that makes a call with a used key, by calling in the same order or by passing the same `key`, gets that nested call\n\t * back, finished or still running, instead of starting another. A nested call a crash interrupted before its result\n\t * committed follows its own replay policy, so this is not exactly-once execution. Reusing a key with another tool or\n\t * other arguments throws. A tool that is not replay-safe never reruns: after a restart, its unfinished nested calls\n\t * are abandoned (`TaskOptions.abandonOnRestart`) before they run again.\n\t *\n\t * `progress: false` commits no running output, details, or diagnostics to the nested call's slot, only its status;\n\t * the result still carries its details and diagnostics, and a schema-less tool's output as `structuredOutput`. An\n\t * interrupted or aborted call's result is built from its slot, so it then has none of them. Either way, programs never\n\t * get the partial output of an interrupted or aborted call.\n\t *\n\t * Nested calls run as soon as they are made, whatever their `executionMode`; the caller decides what runs at once by\n\t * what it awaits. Cancelling `context` stops only the wait; the nested call runs on. When this call settles, nested\n\t * calls it left running are aborted first. A nested result's `usage` is already counted under its tool; a result\n\t * that passes it on counts it again. Rejects, instead of returning a result, once `execute()` has returned, when this\n\t * call is aborted, or when the Harness closes.\n\t */\n\texecuteTool(\n\t\tname: string,\n\t\targs: JsonObject,\n\t\tcontext: Context,\n\t\toptions?: { readonly key?: string; readonly progress?: boolean },\n\t): Promise<NestedToolExecutionResult>;\n}\n\n/**\n * Executable tool registered in a registry. Only nyan-ai `Tool` fields enter the transcript. `args` are typed by\n * `parameters`, which the Harness validates them against before `execute()`; `defineTool()` infers both generics.\n */\nexport type ToolRegistration<\n\tTParameters extends TSchema = TSchema,\n\tTDetails extends JsonValue = JsonValue,\n> = Tool<TParameters> & {\n\t/** Whether an interrupted execution may rerun on recovery. Default `unsafe`. */\n\treadonly replay?: \"safe\" | \"unsafe\";\n\t/** Default: the settings' `toolExecution`. One sequential call makes its whole round sequential. */\n\treadonly executionMode?: ToolExecutionMode;\n\t/**\n\t * Repair arguments models commonly get wrong before validation, such as a JSON string where an array belongs. Must be\n\t * pure and must not mutate `args`: it runs again when a call is retried before its intent is recorded. Its result is\n\t * still validated against `parameters`.\n\t */\n\tprepareArguments?(args: unknown): Static<TParameters>;\n\t/**\n\t * Schema of `structuredOutput`, which programs that call the tool receive. Omitted: they receive the result's bounded\n\t * output, success or error, as `NestedToolExecutionResult.structuredOutput` describes.\n\t */\n\treadonly structuredOutputSchema?: TSchema;\n\t/**\n\t * Who may call the tool: the model, other tools through `executeTool()`, or both (default). A code mode tool is\n\t * `[\"model\"]`, so scripts cannot start scripts; tools behind code mode, such as MCP tools, can be `[\"tools\"]`, so the\n\t * model is never offered them.\n\t */\n\treadonly callers?: readonly (\"model\" | \"tools\")[];\n\t/**\n\t * Not offered to the model until loaded: the model gets the tool only when `modelTools` names it, in its array or its\n\t * `add`, which `control.addTools` (from a tool such as `tool_search`) writes. Other tools can call it any time.\n\t */\n\treadonly deferred?: true;\n\treadonly outputLimits?: {\n\t\treadonly maxBytes?: number;\n\t\treadonly maxLines?: number;\n\t\treadonly retain?: \"head\" | \"tail\";\n\t};\n\texecute(\n\t\targs: Static<TParameters>,\n\t\tapi: ToolExecutionApi<TDetails>,\n\t\tcontext: Context,\n\t): Promise<ToolExecutionResult<TDetails>>;\n};\n\n/** Input to system prompt section rendering for one request preparation. */\nexport type PromptInput<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly conversationId: ConversationId;\n\t/** The request's resolution; `agent.tools` are the tools offered in this request. */\n\treadonly agent: Agent<Tool>;\n\t/** Built by `HarnessOptions.env` for this preparation; `undefined` without an environment. */\n\treadonly env: ExecutionEnv | undefined;\n\t/** Sections already in effect after replaying the active transcript. */\n\treadonly shown: Readonly<Record<string, string>>;\n\t/** Committed document reads. */\n\treadonly read: DocumentReader;\n};\n\n/** One system prompt section; the agent's sections render in order before each request. */\nexport type PromptSection<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly key: string;\n\trender(input: PromptInput<Tool>, context: Context): string | undefined | Promise<string | undefined>;\n\t/** Default true: wrap the text as `<key>\\n...\\n</key>`. */\n\treadonly tag?: boolean;\n};\n\n/** Built by `hook()`; matches tasks by name. */\nexport type HookRegistration = { readonly task: string; readonly handlers: object };\n\n/** Built by `wrapTool()` and `wrapSection()`; targets a tool name or a section key. Wrappers are pure. */\nexport type Wrap<Tool extends ToolRegistration = ToolRegistration> =\n\t| { readonly tool: string; wrap(tool: Tool): Tool }\n\t| { readonly section: string; wrap(section: PromptSection<Tool>): PromptSection<Tool> };\n\n/** Named bundle of code; installed in a registry and selected by conversations by name. */\nexport interface Extension<Tool extends ToolRegistration = ToolRegistration> {\n\treadonly name: string;\n\treadonly tools?: readonly Tool[];\n\treadonly sections?: readonly PromptSection<Tool>[];\n\treadonly hooks?: readonly HookRegistration[];\n\t/** Apply where this extension is selected, in order. */\n\treadonly wraps?: readonly Wrap<Tool>[];\n\t/** Resolved by name for every task, whichever conversations select this extension. */\n\treadonly tasks?: readonly AnyTask[];\n}\n\n/** Immutable view of one published registry state. */\nexport interface RegistrySnapshot<Tool extends ToolRegistration = ToolRegistration> {\n\tinstalled(): readonly Extension<Tool>[];\n\textension(name: string): Extension<Tool> | undefined;\n\t/** Every installed tool with its extension, in install order. Names may repeat across extensions. */\n\ttools(): readonly { readonly extension: Extension<Tool>; readonly tool: Tool }[];\n\tsections(): readonly { readonly extension: Extension<Tool>; readonly section: PromptSection<Tool> }[];\n\t/** Built-in and installed task definitions. */\n\ttasks(): readonly AnyTask[];\n\ttask(name: string): AnyTask | undefined;\n}\n\n/** Read side of a registry consumed by a Harness. */\nexport interface RegistryReader<Tool extends ToolRegistration = ToolRegistration> {\n\t/** Immutable view of the whole current registry. */\n\tsnapshot(): RegistrySnapshot<Tool>;\n\t/** Called synchronously after every publication; wakes the scheduler to reconsider blocked tasks. */\n\tsubscribe(listener: () => void): () => void;\n}\n\n/** Application-owned registry of extensions. */\nexport interface Registry<Tool extends ToolRegistration = ToolRegistration> extends RegistryReader<Tool> {\n\t/** Install `extension`, or replace the installed extension with its name in place. Publishes at once. */\n\tinstall(extension: Extension<Tool>): void;\n\t/** Remove the installed extension with `extension.name`, whichever object it is. A later install appends. */\n\tuninstall(extension: Extension): void;\n}\n\n/** Stored choices of one conversation; names, not objects. Unset fields follow the host. */\nexport type AgentState = {\n\tmodel?: ModelRef;\n\tthinkingLevel?: ModelThinkingLevel;\n\t/** An array selects exactly these extensions, in order. An object edits the host default selection. */\n\textensions?: string[] | { add?: string[]; remove?: string[] };\n\t/** Filters the selected extensions' tools: the enabled tools. An array enables exactly these, in order. */\n\ttools?: string[] | { remove: string[] };\n\t/**\n\t * Filters the enabled tools the model may call (`callers` includes `model`): the tools offered to it. Never widens:\n\t * other tools can still call the ones it leaves out.\n\t * - Unset: every such tool except deferred ones.\n\t * - An array: exactly these, in order, deferred ones too.\n\t * - An object: every such tool except deferred ones and those in `remove`, in registry order, followed by the\n\t * deferred tools in `add` that are not in `remove`, in `add` order. Names of tools that are not deferred or not\n\t * registered have no effect in `add`.\n\t */\n\tmodelTools?: string[] | { remove?: string[]; add?: string[] };\n\t/** Rendered after every extension section, as the section `instructions`. */\n\tinstructions?: string;\n\t/** Directory within the environment's file system, passed to `HarnessOptions.env`. */\n\tcwd?: string;\n};\n\n/** A change to `nyan.agent`: a given field replaces the stored one, `null` clears it, `undefined` changes nothing. */\nexport type AgentChange = {\n\treadonly model?: ModelRef | null;\n\treadonly thinkingLevel?: ModelThinkingLevel | null;\n\treadonly extensions?:\n\t\t| readonly Extension[]\n\t\t| { readonly add?: readonly Extension[]; readonly remove?: readonly Extension[] }\n\t\t| null;\n\treadonly tools?: readonly ToolRegistration[] | { readonly remove: readonly ToolRegistration[] } | null;\n\t/** Replaces the stored filter as a whole; tools loaded with `control.addTools` are in its `add`. */\n\treadonly modelTools?:\n\t\t| readonly ToolRegistration[]\n\t\t| { readonly remove?: readonly ToolRegistration[]; readonly add?: readonly ToolRegistration[] }\n\t\t| null;\n\treadonly instructions?: string | null;\n\treadonly cwd?: string | null;\n};\n\n/** A conversation's agent resolved against a registry snapshot and the settings. */\nexport type Agent<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly model?: ModelRef;\n\treadonly thinkingLevel: ModelThinkingLevel;\n\treadonly extensions: readonly Extension<Tool>[];\n\t/** The tools a request offers, in order: enabled, callable by the model, and selected by `modelTools`. */\n\treadonly tools: readonly Tool[];\n\t/** The tools nested calls (`executeTool()`) resolve among, in order: enabled and callable by tools. */\n\treadonly callable: readonly Tool[];\n\t/** Enabled deferred tools the model may call and is not offered yet, in registry order: what `tool_search` loads. */\n\treadonly deferred: readonly Tool[];\n\t/** Extension sections, then `instructions` when set. */\n\treadonly sections: readonly PromptSection<Tool>[];\n\treadonly instructions?: string;\n\treadonly cwd?: string;\n};\n\n/**\n * Runs inside the creating commit, after the creation hook and the `agent` change. The conversation creation is already\n * a table write, so table reads here throw `ReadAfterWrite`; document access remains available.\n */\nexport type ConversationInit = (tx: Tx, conversationId: ConversationId) => void | Promise<void>;\n\nexport type ConversationCreateOptions = {\n\treadonly ownership: ConversationOwnership;\n\t/** Applied in the creating commit after the creation hook's copy, before `init`. */\n\treadonly agent?: AgentChange;\n\treadonly init?: ConversationInit;\n};\n\n/** Curated nyan-ai request options; absent fields use nyan-ai defaults. */\nexport type ConversationStreamOptions = {\n\ttransport?: Transport;\n\ttimeoutMs?: number;\n\t/** Provider/SDK retries inside one request attempt. */\n\tmaxRetries?: number;\n\tmaxRetryDelayMs?: number;\n\theaders?: Record<string, string>;\n\tmetadata?: JsonObject;\n\tcacheRetention?: CacheRetention;\n\tdeferred?: boolean | { window?: \"15m\" | \"1h\" | \"24h\" };\n};\n\n/** Durable generation attempt retries; the JSON shape of nyan-ai `RetryPolicy`. */\nexport type ConversationRetryPolicy = {\n\tenabled: boolean;\n\tmaxRetries: number;\n\tbaseDelayMs: number;\n\tmaxAgentDelayMs?: number;\n};\n\n/** Automatic compaction thresholds (spec §8.7); manual compaction ignores `enabled`. */\nexport type CompactionPolicy = {\n\t/** Threshold and overflow compaction. */\n\tenabled: boolean;\n\t/** Room kept free for the answer: generation blocks to compact above `contextWindow - reserveTokens`. */\n\treserveTokens: number;\n\t/** Approximate size of the recent context a summary keeps verbatim. */\n\tkeepRecentTokens: number;\n\t/** Background compaction starts `backgroundTokens` below the blocking threshold; `0` disables it. */\n\tbackgroundTokens: number;\n};\n\n/**\n * How often running progress is committed. Each progress commit is a storage write; a host whose storage is remote can\n * commit less often, so live answers and tool output appear in larger steps.\n */\nexport type ProgressPolicy = {\n\t/** Minimum pause between commits of the answer being generated. */\n\tpartialIntervalMs: number;\n\t/** Minimum pause between commits of running tool output; large commits also pause in proportion to their size. */\n\toutputIntervalMs: number;\n};\n\n/** Why a compaction runs: `compact()`, a threshold in generation preparation, or a context overflow. */\nexport type CompactionReason = \"manual\" | \"threshold\" | \"overflow\";\n\n/**\n * `entryId` of a blocking compaction's summary, or the `submissionId` of a conversation-owned compaction's summary\n * write; both absent when nothing was compacted.\n */\nexport type CompactionResult = { entryId?: EntryId; submissionId?: SubmissionId };\n\n/** Harness-wide run policy. Read at every resolution and never copied; getters are fine. Synchronous: some readers run on the Session line. */\nexport type HarnessSettings = {\n\t/** Default extension selection; absent: every installed extension, in install order. */\n\treadonly extensions?: readonly Extension[];\n\treadonly stream?: ConversationStreamOptions;\n\treadonly retry?: Partial<ConversationRetryPolicy>;\n\treadonly compaction?: Partial<CompactionPolicy>;\n\treadonly progress?: Partial<ProgressPolicy>;\n\treadonly toolExecution?: ToolExecutionMode;\n\treadonly steeringMode?: QueueMode;\n\treadonly followUpMode?: QueueMode;\n\t/**\n\t * How long an idle conversation keeps its last context read in memory, so its next run reads only newer entries.\n\t * Busy conversations always keep it; `0` drops it once the conversation is idle.\n\t */\n\treadonly contextRetentionMs?: number;\n\t/**\n\t * How long a loaded document that no watch or document state observes stays in memory after its last read or write;\n\t * the next access loads it from Storage. Observed documents always stay. Default ten minutes; `0` drops one right\n\t * after use; `Infinity` keeps them. Anything else that is not a number of milliseconds means the default.\n\t */\n\treadonly documentRetentionMs?: number;\n};\n\n/** Resolved settings: every field over its built-in default, object fields merged. */\nexport type Settings = {\n\t/** Absent: every installed extension, in install order. */\n\treadonly extensions?: readonly Extension[];\n\treadonly stream: ConversationStreamOptions;\n\treadonly retry: ConversationRetryPolicy;\n\treadonly compaction: CompactionPolicy;\n\treadonly progress: ProgressPolicy;\n\treadonly toolExecution: ToolExecutionMode;\n\treadonly steeringMode: QueueMode;\n\treadonly followUpMode: QueueMode;\n\treadonly contextRetentionMs: number;\n\treadonly documentRetentionMs: number;\n};\n\n/** What `HarnessOptions.env` builds an environment for. */\nexport type EnvTarget = {\n\treadonly conversationId: ConversationId;\n\t/** The conversation's agent `cwd`. */\n\treadonly cwd?: string;\n\treadonly read: DocumentReader;\n};\n\nexport type HarnessOptions<Tool extends ToolRegistration = ToolRegistration> = {\n\t/** Provider-neutral model operations used by generation. */\n\treadonly models: ModelRuntime;\n\treadonly registry: RegistryReader<Tool>;\n\treadonly settings?: HarnessSettings;\n\t/** Builds a conversation's environment at each use. Never called on the Session line; may be async. */\n\treadonly env?: (target: EnvTarget, context: Context) => ExecutionEnv | undefined | Promise<ExecutionEnv | undefined>;\n\t/**\n\t * Runs in every commit that creates or forks a conversation, raw `tx.createConversation()` included, after the\n\t * built-in `nyan.*` documents and before the conveniences apply `agent` and run `init`. A fork already has its copies.\n\t * Table reads throw `ReadAfterWrite`, as in `init`; a throw fails the creating commit.\n\t */\n\treadonly conversationCreated?: (tx: Tx, conversation: ConversationRecord) => void | Promise<void>;\n\treadonly now?: () => number;\n\t/**\n\t * Receives failures that do not fail the calling operation, such as a throwing hook or listener, and the error that\n\t * fails the Session, once. Its own throw or rejection is dropped.\n\t */\n\treadonly onReport?: (error: unknown) => void;\n};\n\n/** Live task and what the scheduler would do with it under the current registry. */\nexport type TaskInspection = {\n\treadonly record: TaskRecord<JsonValue, JsonValue, JsonValue>;\n\treadonly state: /** An invocation is active. */\n\t\t| { readonly kind: \"running\" }\n\t\t/** The next scheduling pass reserves it; `migrates` when its definition is newer and has `migrate`. */\n\t\t| { readonly kind: \"ready\"; readonly migrates: boolean }\n\t\t/**\n\t\t * Waits for these live tasks: the live part of its `on`, or, when abort-marked, its live ordinary owned work, which\n\t\t * must end before its abort handler starts.\n\t\t */\n\t\t| { readonly kind: \"waiting\"; readonly on: readonly TaskId[] }\n\t\t/** Outcome held until its ordinary owned work drains. */\n\t\t| { readonly kind: \"completing\" }\n\t\t/** No registered definition can take it; aborting it settles it as `orphaned`. */\n\t\t| {\n\t\t\t\treadonly kind: \"blocked\";\n\t\t\t\treadonly reason: \"missing_task\" | \"task_too_old\" | \"migration_failed\";\n\t\t\t\treadonly error?: unknown;\n\t\t };\n};\n\n/** Point-in-time view of live work: unfinished tasks and submissions, read on the Session line. */\nexport type HarnessInspection = {\n\treadonly scheduling: \"paused\" | \"running\" | \"closing\";\n\treadonly tasks: readonly TaskInspection[];\n\t/** Queued and placed submissions, in ID order. */\n\treadonly submissions: readonly SubmissionRecord[];\n};\n\n/** Raw active transcript and derived model context. */\nexport type ContextView = {\n\t/** Newest applicable head marker, if any. */\n\treadonly head: EntryRecord | undefined;\n\t/** Raw active entries: the head marker followed by non-head entries from its head through the tail. */\n\treadonly entries: readonly EntryRecord[];\n\t/** Per entry of `entries`, its model messages after edits and excluded stop reasons, before tool result ordering. */\n\treadonly contributions: readonly (readonly Message[])[];\n\t/** Model context for the next provider request. */\n\treadonly messages: readonly Message[];\n};\n\n/** Stateless handle for one conversation, bound to the Harness that returned it. Compare handles by `id`. */\nexport interface Conversation {\n\treadonly id: ConversationId;\n\n\t/** Resolved with the current registry snapshot and settings. */\n\tagent(context: Context): Promise<Agent>;\n\t/** `configure()` in its own commit. */\n\tconfigure(change: AgentChange, context: Context): Promise<void>;\n\n\t/**\n\t * Durably admit user input or a passive entry write. A busy conversation, or one with queued items, queues input and\n\t * writes that affect model context in `nyan.inbox`; `whenBusy: \"reject\"` rejects input with `ConversationBusy` instead\n\t * and writes nothing. A write of only `kind` and `data` (no `model`, `head`, or `edits`) is appended at once,\n\t * even mid-run, as it changes nothing the model sees.\n\t */\n\tsubmit(submission: SubmissionDraft, context: Context): Promise<Submission>;\n\t/**\n\t * Admit a write of a `nyan.reset` entry that starts a new context, carrying `handoff` as a user message when given.\n\t * Resolves after admission; while busy, it is placed at the next boundary.\n\t */\n\treset(handoff: string | undefined, context: Context): Promise<void>;\n\t/**\n\t * Admit a manual compaction task and return its ID. It summarizes while the conversation keeps working and places its\n\t * summary through a write submission: at once when idle, otherwise at the next boundary (spec §8.7).\n\t */\n\tcompact(instructions: string | undefined, context: Context): Promise<TaskId<CompactionResult>>;\n\n\t/** Session commit whose `tx.createTask()` defaults to this conversation. */\n\tcommit<T>(change: (tx: Tx) => T | Promise<T>, context: Context): Promise<T>;\n\t/**\n\t * Committed raw active transcript and model context. With `at`, the context as of that visible entry: the same view\n\t * `fork(at)` would start with, without creating a conversation.\n\t */\n\tcontext(context: Context, options?: { readonly at?: EntryId }): Promise<ContextView>;\n\t/** Fork-aware history of this conversation, newest first unless `query.order` is `ascending`. */\n\tentries(\n\t\tquery: Omit<EntryQuery, \"conversationId\">,\n\t\tlimit: number,\n\t\tcursor: Cursor | undefined,\n\t\tcontext: Context,\n\t): Promise<Page<EntryRecord, Cursor>>;\n\tfork(at: EntryId, options: ConversationCreateOptions, context: Context): Promise<Conversation>;\n\t/**\n\t * Withdraw queued inputs (queued writes stay), mark every live non-background task of the ordinary ownership scope,\n\t * signal them, and resolve once the scope is idle. Background subtrees survive unless `background` is set.\n\t */\n\tabort(context: Context, options?: ConversationAbortOptions): Promise<void>;\n\t/**\n\t * Resolve when the ordinary ownership scope has no live non-background task: this conversation and the conversations\n\t * owned, transitively, by its non-background tasks.\n\t */\n\twaitForIdle(context: Context): Promise<void>;\n\t/** The structural view (spec §9.3) as a disposable read-only Chord state. */\n\tviewState(context: Context): Promise<AttachedReplicatedState<ConversationView>>;\n\t/** The structural view as a serialized exact-frame watch with bounded pending frames. */\n\twatch(context: Context): Promise<ConversationWatch>;\n}\n\nexport type ConversationWatch = WatchHandle<ConversationView>;\n\n/** Durable agent harness over one Session. */\nexport interface Harness extends Session {\n\t/**\n\t * Enable task scheduling. Idempotent; throws after close. Calls that ask for progress enable it too:\n\t * `Conversation.submit()`, `Conversation.compact()`, `Conversation.abort()`, `Submission.wait()`, `waitForTask()`,\n\t * `Harness.waitForIdle()`, and `Conversation.waitForIdle()`. Read-only viewers never do.\n\t */\n\tresume(): void;\n\n\t/** Return the reserved root conversation, creating it with `agent` and `init` in one commit when absent. */\n\troot(\n\t\tcontext: Context,\n\t\toptions?: { readonly agent?: AgentChange; readonly init?: ConversationInit },\n\t): Promise<Conversation>;\n\tconversation(id: ConversationId, context: Context): Promise<Conversation | undefined>;\n\tcreateConversation(options: ConversationCreateOptions, context: Context): Promise<Conversation>;\n\n\tgetTask<R>(id: TaskId<R>, context: Context): Promise<TaskRecord<JsonValue, JsonValue, R> | undefined>;\n\t/** Live tasks and unsettled submissions. Writes nothing and runs no task code. */\n\tinspect(context: Context): Promise<HarnessInspection>;\n\t/** Reacquire a submission, for example after reopen. */\n\tsubmission(id: SubmissionId, context: Context): Promise<Submission | undefined>;\n\t/** `not_found` for an unknown submission or one of another conversation than `conversationId`. */\n\tabortSubmission(\n\t\tid: SubmissionId,\n\t\tcontext: Context,\n\t\tconversationId?: ConversationId,\n\t): Promise<\"aborted\" | \"already_placed\" | \"settled\" | \"not_found\">;\n\t/**\n\t * Commit the abort mark, signal and join an active run invocation, and schedule the abort invocation. A task whose\n\t * definition cannot take it settles as `orphaned` instead.\n\t */\n\tabortTask(id: TaskId, context: Context): Promise<\"marked\" | \"terminal\">;\n\t/** Resolve with the terminal receipt; cancelling `context` cancels only this wait. */\n\twaitForTask<R>(id: TaskId<R>, context: Context): Promise<SettledTask<R>>;\n\t/** Resolve when the ordinary ownership scope of every ownerless conversation has no live non-background task. */\n\twaitForIdle(context: Context): Promise<void>;\n\t/** Session total: every conversation's `nyan.usage` summed. */\n\tusage(context: Context): Promise<UsageState>;\n\t/** Every live task with its owner edge, status, and owned conversations (spec §9.5), as a disposable Chord state. */\n\ttaskGraph(context: Context): Promise<AttachedReplicatedState<TaskGraph>>;\n\t/** The task graph as a serialized exact-frame watch with bounded pending frames. */\n\twatchTaskGraph(context: Context): Promise<TaskGraphWatch>;\n}\n\n/** What a hook may use: committed reads and the asking task's memos, which hooks and the task share. */\nexport interface HookApi extends DocumentReader {\n\treadonly taskId: TaskId;\n\treadonly conversationId: ConversationId;\n\t/** `HarnessOptions.models`. */\n\treadonly models: ModelRuntime;\n\tmemo<T extends JsonValue>(name: string, context: Context): Promise<T | undefined>;\n\tmemo<T extends JsonValue>(name: string, candidate: T, context: Context): Promise<T>;\n}\n\nexport type HookResult<T> = T | undefined | Promise<T | undefined>;\n\n/** Hooks of the built-in generation task. */\nexport interface GenerationHooks {\n\t/** Before every request attempt, including recovery; the result is used for that request only. */\n\tbeforeRequest(\n\t\trequest: { readonly messages: readonly Message[] },\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly messages: readonly Message[] }>;\n\t/** Every terminal provider message, before classification. */\n\tafterResponse(message: AssistantMessage, api: HookApi, context: Context): void | Promise<void>;\n\t/** A final answer; the first `continue` appends a user message and continues the run. */\n\tonYield(answer: AssistantMessage, api: HookApi, context: Context): HookResult<{ readonly continue: UserInput }>;\n\t/** After every tool of the round is terminal; `results` are the round's result entries in call order. */\n\tafterTools(assistant: EntryId, results: readonly EntryId[], api: HookApi, context: Context): void | Promise<void>;\n}\n\n/** A call as tool hooks see it; `parent` is set for a nested call, one a running tool made through `executeTool()`. */\nexport type ToolHookCall = ToolCall & {\n\treadonly parent?: { readonly taskId: TaskId; readonly callId: string };\n};\n\n/** Hooks of the built-in tool task, for model-issued and nested calls. */\nexport interface ToolHooks {\n\t/** Before intent; the first `block` wins, otherwise `arguments` replace the call's arguments. A throw blocks. */\n\tbeforeTool(\n\t\tcall: ToolHookCall,\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly arguments?: JsonObject; readonly block?: string }>;\n\t/** After execution, before the result is committed; replaces the result. */\n\tafterTool(\n\t\tcall: ToolHookCall,\n\t\tresult: ToolExecutionResult,\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<ToolExecutionResult>;\n}\n\n/** Hooks of the built-in compaction task. */\nexport interface CompactionHooks {\n\t/**\n\t * After range selection, before summarizing; the first decision wins. `entries` are the active entries the summary\n\t * replaces, the head marker first, and `messages` their model context, the summarizer's source; `firstKept` is the\n\t * first entry kept verbatim.\n\t */\n\tbeforeCompact(\n\t\tcompaction: {\n\t\t\treadonly reason: CompactionReason;\n\t\t\treadonly entries: readonly EntryRecord[];\n\t\t\treadonly messages: readonly Message[];\n\t\t\treadonly firstKept: EntryId;\n\t\t\treadonly instructions?: string;\n\t\t},\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly decline: true } | { readonly summary: string }>;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -8,12 +8,12 @@ export { type AgentEvent, type AgentEventStream, type MessageChange, type Snapsh
8
8
  export { type GenerationCheckpoint, type GenerationInput, type GenerationResult, GenerationTask, } from "./harness/generation.ts";
9
9
  export { Harness } from "./harness/harness.ts";
10
10
  export { InboxDoc, type InboxItem, type InboxState } from "./harness/inbox.ts";
11
- export { type CompactionStatus, LiveDoc, type LiveState, type NestedToolSlot, type NestedToolSummary, type ToolSlot, } from "./harness/live.ts";
11
+ export { type CompactionFailure, type CompactionStatus, LiveDoc, type LiveState, type NestedToolSlot, type NestedToolSummary, type ToolSlot, } from "./harness/live.ts";
12
12
  export { ProviderDoc, type ProviderState } from "./harness/provider.ts";
13
13
  export { createRegistry } from "./harness/registry.ts";
14
14
  export type { TaskGraph, TaskGraphNode, TaskGraphState, TaskGraphWatch } from "./harness/task-graph.ts";
15
15
  export { NestedCallDoc, type NestedCallState, ToolTask, type ToolTaskCheckpoint, type ToolTaskInput, type ToolTaskResult, } from "./harness/tool.ts";
16
- export type { Agent, AgentChange, AgentState, AnyTask, CompactionHooks, CompactionPolicy, CompactionReason, CompactionResult, ContextView, Conversation, ConversationAbortOptions, ConversationCreateOptions, ConversationHandle, ConversationInit, ConversationRetryPolicy, ConversationStreamOptions, ConversationWatch, EnvTarget, Extension, GenerationHooks, HarnessInspection, HarnessOptions, HarnessSettings, HookApi, HookRegistration, HookResult, HooksOf, InputSubmissionDraft, ModelRef, NestedToolExecutionResult, ProgressPolicy, PromptInput, PromptSection, QueueMode, Registry, RegistryReader, RegistrySnapshot, Settings, SettledSubmissionRecord, SettledTask, Submission, SubmissionDraft, TaskInspection, ToolControl, ToolDiagnostic, ToolExecutionApi, ToolExecutionMode, ToolExecutionResult, ToolHookCall, ToolHooks, ToolRegistration, UserInput, Wrap, } from "./harness/types.ts";
16
+ export type { Agent, AgentChange, AgentState, AnyTask, CompactionHooks, CompactionPolicy, CompactionReason, CompactionResult, ContextView, Conversation, ConversationAbortOptions, ConversationCreateOptions, ConversationHandle, ConversationInit, ConversationRetryPolicy, ConversationStreamOptions, ConversationWatch, EnvTarget, Extension, GenerationHooks, HarnessInspection, HarnessOptions, HarnessSettings, HookApi, HookRegistration, HookResult, HooksOf, InputEntry, InputSubmissionDraft, ModelRef, NestedToolExecutionResult, ProgressPolicy, PromptInput, PromptSection, QueueMode, Registry, RegistryReader, RegistrySnapshot, Settings, SettledSubmissionRecord, SettledTask, Submission, SubmissionDraft, TaskInspection, ToolControl, ToolDiagnostic, ToolExecutionApi, ToolExecutionMode, ToolExecutionResult, ToolHookCall, ToolHooks, ToolRegistration, UserInput, Wrap, } from "./harness/types.ts";
17
17
  export { UsageDoc, type UsageState } from "./harness/usage.ts";
18
18
  export type { ConversationView } from "./harness/view.ts";
19
19
  export { createSession } from "./session/session.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EACN,cAAc,EACd,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,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B,EACnB,cAAc,EACd,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,EAAE,EACF,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,oCAAoC,EACpC,8BAA8B,EAC9B,+BAA+B,EAC/B,WAAW,EACX,SAAS,EACT,GAAG,EACH,OAAO,EACP,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,OAAO,EACP,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,IAAI,EACJ,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACN,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,EACT,EAAE,EACF,UAAU,EACV,eAAe,EACf,QAAQ,EACR,WAAW,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EACN,cAAc,EACd,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EACN,QAAQ,EACR,SAAS,EACT,yB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,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,EAAE,EACF,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,oCAAoC,EACpC,8BAA8B,EAC9B,+BAA+B,EAC/B,WAAW,EACX,SAAS,EACT,GAAG,EACH,OAAO,EACP,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,OAAO,EACP,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,IAAI,EACJ,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACN,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,EACT,EAAE,EACF,UAAU,EACV,eAAe,EACf,QAAQ,EACR,WAAW,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EACN,cAAc,EACd,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EACN,QAAQ,EACR,SAAS,EACT,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGN,cAAc,GAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EAMN,WAAW,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIN,cAAc,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAmC,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAEN,OAAO,GAKP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAsB,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EACN,aAAa,EAEb,QAAQ,GAIR,MAAM,mBAAmB,CAAC;AAwD3B,OAAO,EAAE,QAAQ,EAAmB,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAmFxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { defineDoc, defineDocFamily } from \"./documents.ts\";\nexport {\n\tAssistantEntry,\n\tCompactionEntry,\n\tdefineEntry,\n\tResetEntry,\n\tSystemEntry,\n\tToolResultEntry,\n\tUserEntry,\n} from \"./entries.ts\";\nexport { ConversationBusy, ReadAfterWrite, SessionFailed, StorageRequestError } from \"./errors.ts\";\nexport {\n\tAgentDoc,\n\tconfigure,\n\tDEFAULT_COMPACTION_POLICY,\n\tDEFAULT_PROGRESS_POLICY,\n\tDEFAULT_RETRY_POLICY,\n} from \"./harness/agent.ts\";\nexport {\n\ttype CompactionCheckpoint,\n\ttype CompactionInput,\n\tCompactionTask,\n\ttype SummaryRequest,\n} from \"./harness/compaction.ts\";\nexport { defineExtension, defineTool, hook, section, wrapSection, wrapTool } from \"./harness/define.ts\";\nexport {\n\ttype AgentEvent,\n\ttype AgentEventStream,\n\ttype MessageChange,\n\ttype SnapshotEvent,\n\ttype ToolEventCall,\n\twatchEvents,\n} from \"./harness/events.ts\";\nexport {\n\ttype GenerationCheckpoint,\n\ttype GenerationInput,\n\ttype GenerationResult,\n\tGenerationTask,\n} from \"./harness/generation.ts\";\nexport { Harness } from \"./harness/harness.ts\";\nexport { InboxDoc, type InboxItem, type InboxState } from \"./harness/inbox.ts\";\nexport {\n\ttype CompactionStatus,\n\tLiveDoc,\n\ttype LiveState,\n\ttype NestedToolSlot,\n\ttype NestedToolSummary,\n\ttype ToolSlot,\n} from \"./harness/live.ts\";\nexport { ProviderDoc, type ProviderState } from \"./harness/provider.ts\";\nexport { createRegistry } from \"./harness/registry.ts\";\nexport type { TaskGraph, TaskGraphNode, TaskGraphState, TaskGraphWatch } from \"./harness/task-graph.ts\";\nexport {\n\tNestedCallDoc,\n\ttype NestedCallState,\n\tToolTask,\n\ttype ToolTaskCheckpoint,\n\ttype ToolTaskInput,\n\ttype ToolTaskResult,\n} from \"./harness/tool.ts\";\nexport type {\n\tAgent,\n\tAgentChange,\n\tAgentState,\n\tAnyTask,\n\tCompactionHooks,\n\tCompactionPolicy,\n\tCompactionReason,\n\tCompactionResult,\n\tContextView,\n\tConversation,\n\tConversationAbortOptions,\n\tConversationCreateOptions,\n\tConversationHandle,\n\tConversationInit,\n\tConversationRetryPolicy,\n\tConversationStreamOptions,\n\tConversationWatch,\n\tEnvTarget,\n\tExtension,\n\tGenerationHooks,\n\tHarnessInspection,\n\tHarnessOptions,\n\tHarnessSettings,\n\tHookApi,\n\tHookRegistration,\n\tHookResult,\n\tHooksOf,\n\tInputSubmissionDraft,\n\tModelRef,\n\tNestedToolExecutionResult,\n\tProgressPolicy,\n\tPromptInput,\n\tPromptSection,\n\tQueueMode,\n\tRegistry,\n\tRegistryReader,\n\tRegistrySnapshot,\n\tSettings,\n\tSettledSubmissionRecord,\n\tSettledTask,\n\tSubmission,\n\tSubmissionDraft,\n\tTaskInspection,\n\tToolControl,\n\tToolDiagnostic,\n\tToolExecutionApi,\n\tToolExecutionMode,\n\tToolExecutionResult,\n\tToolHookCall,\n\tToolHooks,\n\tToolRegistration,\n\tUserInput,\n\tWrap,\n} from \"./harness/types.ts\";\nexport { UsageDoc, type UsageState } from \"./harness/usage.ts\";\nexport type { ConversationView } from \"./harness/view.ts\";\nexport { createSession } from \"./session/session.ts\";\nexport { MemoryStorage } from \"./storage/memory.ts\";\nexport { defineTask } from \"./tasks.ts\";\nexport type {\n\tCheckpointInfo,\n\tCommitChange,\n\tCommitPublication,\n\tCommonDocDefinition,\n\tContextEdit,\n\tConversationDocFamilyToken,\n\tConversationDocToken,\n\tConversationId,\n\tConversationOwnership,\n\tConversationQuery,\n\tConversationRecord,\n\tCursor,\n\tDocDefinition,\n\tDocFamilyDefinition,\n\tDocFamilyToken,\n\tDocToken,\n\tDocumentAddress,\n\tDocumentCommitChange,\n\tDocumentContent,\n\tDocumentCopySource,\n\tDocumentCreate,\n\tDocumentId,\n\tDocumentObserver,\n\tDocumentPoint,\n\tDocumentQuery,\n\tDocumentReader,\n\tDocumentRecord,\n\tDocumentSemantics,\n\tDocumentState,\n\tDocumentWatch,\n\tEntry,\n\tEntryDraft,\n\tEntryId,\n\tEntryQuery,\n\tEntryRecord,\n\tHookRunner,\n\tId,\n\tJoinPolicy,\n\tJsonObject,\n\tLatestConversationSemantics,\n\tNextTaskState,\n\tPage,\n\tPhaseHandler,\n\tRewindableConversationDocFamilyToken,\n\tRewindableConversationDocToken,\n\tRewindableConversationSemantics,\n\tRunningTask,\n\tScanOrder,\n\tSeq,\n\tSession,\n\tSessionDocFamilyToken,\n\tSessionDocToken,\n\tSessionEnd,\n\tStorage,\n\tStorageWrite,\n\tStoredDocument,\n\tSubmissionCreate,\n\tSubmissionId,\n\tSubmissionQuery,\n\tSubmissionRecord,\n\tSubmissionSettlement,\n\tTableCommitChange,\n\tTask,\n\tTaskDefinition,\n\tTaskDocFamilyToken,\n\tTaskDocToken,\n\tTaskId,\n\tTaskOptions,\n\tTaskOutcome,\n\tTaskOutcomeError,\n\tTaskOwnership,\n\tTaskQuery,\n\tTaskRecord,\n\tTaskRuntime,\n\tTaskState,\n\tTx,\n\tTypedEntry,\n\tTypedEntryDraft,\n\tWatchEnd,\n\tWatchHandle,\n} from \"./types.ts\";\nexport { ROOT_CONVERSATION_ID } from \"./types.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EACN,cAAc,EACd,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EACN,QAAQ,EACR,SAAS,EACT,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGN,cAAc,GAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EAMN,WAAW,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIN,cAAc,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAmC,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAGN,OAAO,GAKP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAsB,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EACN,aAAa,EAEb,QAAQ,GAIR,MAAM,mBAAmB,CAAC;AAyD3B,OAAO,EAAE,QAAQ,EAAmB,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAmFxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { defineDoc, defineDocFamily } from \"./documents.ts\";\nexport {\n\tAssistantEntry,\n\tCompactionEntry,\n\tdefineEntry,\n\tResetEntry,\n\tSystemEntry,\n\tToolResultEntry,\n\tUserEntry,\n} from \"./entries.ts\";\nexport { ConversationBusy, ReadAfterWrite, SessionFailed, StorageRequestError } from \"./errors.ts\";\nexport {\n\tAgentDoc,\n\tconfigure,\n\tDEFAULT_COMPACTION_POLICY,\n\tDEFAULT_PROGRESS_POLICY,\n\tDEFAULT_RETRY_POLICY,\n} from \"./harness/agent.ts\";\nexport {\n\ttype CompactionCheckpoint,\n\ttype CompactionInput,\n\tCompactionTask,\n\ttype SummaryRequest,\n} from \"./harness/compaction.ts\";\nexport { defineExtension, defineTool, hook, section, wrapSection, wrapTool } from \"./harness/define.ts\";\nexport {\n\ttype AgentEvent,\n\ttype AgentEventStream,\n\ttype MessageChange,\n\ttype SnapshotEvent,\n\ttype ToolEventCall,\n\twatchEvents,\n} from \"./harness/events.ts\";\nexport {\n\ttype GenerationCheckpoint,\n\ttype GenerationInput,\n\ttype GenerationResult,\n\tGenerationTask,\n} from \"./harness/generation.ts\";\nexport { Harness } from \"./harness/harness.ts\";\nexport { InboxDoc, type InboxItem, type InboxState } from \"./harness/inbox.ts\";\nexport {\n\ttype CompactionFailure,\n\ttype CompactionStatus,\n\tLiveDoc,\n\ttype LiveState,\n\ttype NestedToolSlot,\n\ttype NestedToolSummary,\n\ttype ToolSlot,\n} from \"./harness/live.ts\";\nexport { ProviderDoc, type ProviderState } from \"./harness/provider.ts\";\nexport { createRegistry } from \"./harness/registry.ts\";\nexport type { TaskGraph, TaskGraphNode, TaskGraphState, TaskGraphWatch } from \"./harness/task-graph.ts\";\nexport {\n\tNestedCallDoc,\n\ttype NestedCallState,\n\tToolTask,\n\ttype ToolTaskCheckpoint,\n\ttype ToolTaskInput,\n\ttype ToolTaskResult,\n} from \"./harness/tool.ts\";\nexport type {\n\tAgent,\n\tAgentChange,\n\tAgentState,\n\tAnyTask,\n\tCompactionHooks,\n\tCompactionPolicy,\n\tCompactionReason,\n\tCompactionResult,\n\tContextView,\n\tConversation,\n\tConversationAbortOptions,\n\tConversationCreateOptions,\n\tConversationHandle,\n\tConversationInit,\n\tConversationRetryPolicy,\n\tConversationStreamOptions,\n\tConversationWatch,\n\tEnvTarget,\n\tExtension,\n\tGenerationHooks,\n\tHarnessInspection,\n\tHarnessOptions,\n\tHarnessSettings,\n\tHookApi,\n\tHookRegistration,\n\tHookResult,\n\tHooksOf,\n\tInputEntry,\n\tInputSubmissionDraft,\n\tModelRef,\n\tNestedToolExecutionResult,\n\tProgressPolicy,\n\tPromptInput,\n\tPromptSection,\n\tQueueMode,\n\tRegistry,\n\tRegistryReader,\n\tRegistrySnapshot,\n\tSettings,\n\tSettledSubmissionRecord,\n\tSettledTask,\n\tSubmission,\n\tSubmissionDraft,\n\tTaskInspection,\n\tToolControl,\n\tToolDiagnostic,\n\tToolExecutionApi,\n\tToolExecutionMode,\n\tToolExecutionResult,\n\tToolHookCall,\n\tToolHooks,\n\tToolRegistration,\n\tUserInput,\n\tWrap,\n} from \"./harness/types.ts\";\nexport { UsageDoc, type UsageState } from \"./harness/usage.ts\";\nexport type { ConversationView } from \"./harness/view.ts\";\nexport { createSession } from \"./session/session.ts\";\nexport { MemoryStorage } from \"./storage/memory.ts\";\nexport { defineTask } from \"./tasks.ts\";\nexport type {\n\tCheckpointInfo,\n\tCommitChange,\n\tCommitPublication,\n\tCommonDocDefinition,\n\tContextEdit,\n\tConversationDocFamilyToken,\n\tConversationDocToken,\n\tConversationId,\n\tConversationOwnership,\n\tConversationQuery,\n\tConversationRecord,\n\tCursor,\n\tDocDefinition,\n\tDocFamilyDefinition,\n\tDocFamilyToken,\n\tDocToken,\n\tDocumentAddress,\n\tDocumentCommitChange,\n\tDocumentContent,\n\tDocumentCopySource,\n\tDocumentCreate,\n\tDocumentId,\n\tDocumentObserver,\n\tDocumentPoint,\n\tDocumentQuery,\n\tDocumentReader,\n\tDocumentRecord,\n\tDocumentSemantics,\n\tDocumentState,\n\tDocumentWatch,\n\tEntry,\n\tEntryDraft,\n\tEntryId,\n\tEntryQuery,\n\tEntryRecord,\n\tHookRunner,\n\tId,\n\tJoinPolicy,\n\tJsonObject,\n\tLatestConversationSemantics,\n\tNextTaskState,\n\tPage,\n\tPhaseHandler,\n\tRewindableConversationDocFamilyToken,\n\tRewindableConversationDocToken,\n\tRewindableConversationSemantics,\n\tRunningTask,\n\tScanOrder,\n\tSeq,\n\tSession,\n\tSessionDocFamilyToken,\n\tSessionDocToken,\n\tSessionEnd,\n\tStorage,\n\tStorageWrite,\n\tStoredDocument,\n\tSubmissionCreate,\n\tSubmissionId,\n\tSubmissionQuery,\n\tSubmissionRecord,\n\tSubmissionSettlement,\n\tTableCommitChange,\n\tTask,\n\tTaskDefinition,\n\tTaskDocFamilyToken,\n\tTaskDocToken,\n\tTaskId,\n\tTaskOptions,\n\tTaskOutcome,\n\tTaskOutcomeError,\n\tTaskOwnership,\n\tTaskQuery,\n\tTaskRecord,\n\tTaskRuntime,\n\tTaskState,\n\tTx,\n\tTypedEntry,\n\tTypedEntryDraft,\n\tWatchEnd,\n\tWatchHandle,\n} from \"./types.ts\";\nexport { ROOT_CONVERSATION_ID } from \"./types.ts\";\n"]}
@@ -0,0 +1,2 @@
1
+ export { createToolSearchExtension, createToolSearchTool, DEFAULT_TOOL_SEARCH_LIMIT, TOOL_SEARCH_TOOL_NAME, type ToolSearchToolDetails, } from "./tool-search.ts";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,yBAAyB,EACzB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,qBAAqB,GAC1B,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createToolSearchExtension, createToolSearchTool, DEFAULT_TOOL_SEARCH_LIMIT, TOOL_SEARCH_TOOL_NAME, } from "./tool-search.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tool-search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,yBAAyB,EACzB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,GAErB,MAAM,kBAAkB,CAAC","sourcesContent":["export {\n\tcreateToolSearchExtension,\n\tcreateToolSearchTool,\n\tDEFAULT_TOOL_SEARCH_LIMIT,\n\tTOOL_SEARCH_TOOL_NAME,\n\ttype ToolSearchToolDetails,\n} from \"./tool-search.ts\";\n"]}
@@ -0,0 +1,18 @@
1
+ import { Type } from "typebox";
2
+ import type { ToolRegistration } from "../harness/types.ts";
3
+ export declare const TOOL_SEARCH_TOOL_NAME = "tool_search";
4
+ export declare const DEFAULT_TOOL_SEARCH_LIMIT = 8;
5
+ /** `tool_search` result details: the tools it loaded. */
6
+ export type ToolSearchToolDetails = {
7
+ loaded: string[];
8
+ };
9
+ export declare function createToolSearchTool(): ToolRegistration<Type.TObject<{
10
+ query: Type.TString;
11
+ limit: Type.TOptional<Type.TNumber>;
12
+ }>, import("@ny4n/chord").JsonValue>;
13
+ /** The `tool_search` extension: install it and select it where the model should find deferred tools. */
14
+ export declare function createToolSearchExtension(): import("../harness/types.ts").Extension<ToolRegistration<Type.TObject<{
15
+ query: Type.TString;
16
+ limit: Type.TOptional<Type.TNumber>;
17
+ }>, import("@ny4n/chord").JsonValue>>;
18
+ //# sourceMappingURL=tool-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-search.d.ts","sourceRoot":"","sources":["../../src/tool-search/tool-search.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAY3C,yDAAyD;AACzD,MAAM,MAAM,qBAAqB,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AASzD,wBAAgB,oBAAoB;;;qCAgCnC;AAED,wGAAwG;AACxG,wBAAgB,yBAAyB;;;sCAExC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The `tool_search` tool: the model searches the deferred tools it is not offered yet, and the matches are loaded with
3
+ * `control.addTools`, so the next request offers them. Loading writes the conversation's `modelTools` (its `add`), so
4
+ * loaded tools stay offered on that branch, also after a compaction. Ranking is the BM25 ranker of
5
+ * `@ny4n/codemode/search`, shared with code mode's `searchTools()` and the coding agent's `tool_search`.
6
+ */
7
+ import { Bm25Ranker, collectSchemaText } from "@ny4n/codemode/search";
8
+ import { Type } from "typebox";
9
+ import { defineExtension, defineTool } from "../harness/define.js";
10
+ export const TOOL_SEARCH_TOOL_NAME = "tool_search";
11
+ export const DEFAULT_TOOL_SEARCH_LIMIT = 8;
12
+ /** Fixed, so it does not change while deferred tools are registered, for example as MCP servers connect. */
13
+ const TOOL_SEARCH_DESCRIPTION = `# Tool discovery\n\nSearches over deferred tool metadata with BM25 and exposes matching tools for the next model call.\n\nSome of the tools, such as tools of MCP servers, may not have been provided to you upfront, and you should use this tool (\`${TOOL_SEARCH_TOOL_NAME}\`) to search for the required tools. For MCP tool discovery, always use \`${TOOL_SEARCH_TOOL_NAME}\`.`;
14
+ const toolSearchSchema = Type.Object({
15
+ query: Type.String({ description: "Search query for deferred tools." }),
16
+ limit: Type.Optional(Type.Number({ description: `Maximum number of tools to return. Defaults to ${DEFAULT_TOOL_SEARCH_LIMIT}.` })),
17
+ });
18
+ /** Search text of a tool: its name, the name with `_` as spaces, its description, and its parameters' text. */
19
+ function searchText(tool) {
20
+ const parts = [tool.name, tool.name.replaceAll("_", " "), tool.description];
21
+ collectSchemaText(tool.parameters, parts);
22
+ return parts.filter((part) => part.trim() !== "").join(" ");
23
+ }
24
+ export function createToolSearchTool() {
25
+ return defineTool({
26
+ name: TOOL_SEARCH_TOOL_NAME,
27
+ description: TOOL_SEARCH_DESCRIPTION,
28
+ parameters: toolSearchSchema,
29
+ // Searching changes what the model is offered; scripts have their own `searchTools()`.
30
+ callers: ["model"],
31
+ replay: "safe",
32
+ async execute({ query, limit }, api, context) {
33
+ if (query.trim() === "")
34
+ throw new Error("query must not be empty");
35
+ const max = limit ?? DEFAULT_TOOL_SEARCH_LIMIT;
36
+ if (!Number.isInteger(max) || max <= 0)
37
+ throw new Error("limit must be a positive integer");
38
+ const candidates = (await api.agent(context)).deferred;
39
+ const documents = candidates.map((tool) => ({ name: tool.name, text: searchText(tool) }));
40
+ const loaded = new Bm25Ranker().rank(query, documents, max).map((match) => match.name);
41
+ const text = loaded.length === 0
42
+ ? "No matching tools found."
43
+ : `Loaded ${loaded.length} tool${loaded.length === 1 ? "" : "s"}. They are available from your next call:\n${loaded
44
+ .map((name) => {
45
+ const description = candidates.find((tool) => tool.name === name)?.description ?? "";
46
+ return `- ${name}: ${description.trim().split(/\r?\n/)[0]}`;
47
+ })
48
+ .join("\n")}`;
49
+ const details = { loaded };
50
+ return {
51
+ output: [{ type: "text", text }],
52
+ details,
53
+ ...(loaded.length === 0 ? {} : { control: { addTools: loaded } }),
54
+ };
55
+ },
56
+ });
57
+ }
58
+ /** The `tool_search` extension: install it and select it where the model should find deferred tools. */
59
+ export function createToolSearchExtension() {
60
+ return defineExtension({ name: "tool-search", tools: [createToolSearchTool()] });
61
+ }
62
+ //# sourceMappingURL=tool-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-search.js","sourceRoot":"","sources":["../../src/tool-search/tool-search.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGnE,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AACnD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C,4GAA4G;AAC5G,MAAM,uBAAuB,GAAG,yPAAyP,qBAAqB,8EAA8E,qBAAqB,KAAK,CAAC;AAEvZ,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IACvE,KAAK,EAAE,IAAI,CAAC,QAAQ,CACnB,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,kDAAkD,yBAAyB,GAAG,EAAE,CAAC,CAC5G;CACD,CAAC,CAAC;AAKH,+GAA+G;AAC/G,SAAS,UAAU,CAAC,IAAsB;IACzC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5E,iBAAiB,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IA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M,QAAQ,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,8CAA8C,MAAM;qBAChH,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBACb,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,WAAW,IAAI,EAAE,CAAC;oBACrF,OAAO,KAAK,IAAI,KAAK,WAAW,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7D,CAAC,CAAC;qBACD,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAClB,MAAM,OAAO,GAA0B,EAAE,MAAM,EAAE,CAAC;YAClD,OAAO;gBACN,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;gBAChC,OAAO;gBACP,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;aACjE,CAAC;QACH,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,yBAAyB;IACxC,OAAO,eAAe,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,oBAAoB,EAAE,CAAC,EAAE,CAAC,CAAC;AAClF,CAAC","sourcesContent":["/**\n * The `tool_search` tool: the model searches the deferred tools it is not offered yet, and the matches are loaded with\n * `control.addTools`, so the next request offers them. Loading writes the conversation's `modelTools` (its `add`), so\n * loaded tools stay offered on that branch, also after a compaction. Ranking is the BM25 ranker of\n * `@ny4n/codemode/search`, shared with code mode's `searchTools()` and the coding agent's `tool_search`.\n */\nimport { Bm25Ranker, collectSchemaText } from \"@ny4n/codemode/search\";\nimport { Type } from \"typebox\";\nimport { defineExtension, defineTool } from \"../harness/define.ts\";\nimport type { ToolRegistration } from \"../harness/types.ts\";\n\nexport const TOOL_SEARCH_TOOL_NAME = \"tool_search\";\nexport const DEFAULT_TOOL_SEARCH_LIMIT = 8;\n\n/** Fixed, so it does not change while deferred tools are registered, for example as MCP servers connect. */\nconst TOOL_SEARCH_DESCRIPTION = `# Tool discovery\\n\\nSearches over deferred tool metadata with BM25 and exposes matching tools for the next model call.\\n\\nSome of the tools, such as tools of MCP servers, may not have been provided to you upfront, and you should use this tool (\\`${TOOL_SEARCH_TOOL_NAME}\\`) to search for the required tools. For MCP tool discovery, always use \\`${TOOL_SEARCH_TOOL_NAME}\\`.`;\n\nconst toolSearchSchema = Type.Object({\n\tquery: Type.String({ description: \"Search query for deferred tools.\" }),\n\tlimit: Type.Optional(\n\t\tType.Number({ description: `Maximum number of tools to return. Defaults to ${DEFAULT_TOOL_SEARCH_LIMIT}.` }),\n\t),\n});\n\n/** `tool_search` result details: the tools it loaded. */\nexport type ToolSearchToolDetails = { loaded: string[] };\n\n/** Search text of a tool: its name, the name with `_` as spaces, its description, and its parameters' text. */\nfunction searchText(tool: ToolRegistration): string {\n\tconst parts = [tool.name, tool.name.replaceAll(\"_\", \" \"), tool.description];\n\tcollectSchemaText(tool.parameters, parts);\n\treturn parts.filter((part) => part.trim() !== \"\").join(\" \");\n}\n\nexport function createToolSearchTool() {\n\treturn defineTool({\n\t\tname: TOOL_SEARCH_TOOL_NAME,\n\t\tdescription: TOOL_SEARCH_DESCRIPTION,\n\t\tparameters: toolSearchSchema,\n\t\t// Searching changes what the model is offered; scripts have their own `searchTools()`.\n\t\tcallers: [\"model\"],\n\t\treplay: \"safe\",\n\t\tasync execute({ query, limit }, api, context) {\n\t\t\tif (query.trim() === \"\") throw new Error(\"query must not be empty\");\n\t\t\tconst max = limit ?? DEFAULT_TOOL_SEARCH_LIMIT;\n\t\t\tif (!Number.isInteger(max) || max <= 0) throw new Error(\"limit must be a positive integer\");\n\t\t\tconst candidates = (await api.agent(context)).deferred;\n\t\t\tconst documents = candidates.map((tool) => ({ name: tool.name, text: searchText(tool) }));\n\t\t\tconst loaded = new Bm25Ranker().rank(query, documents, max).map((match) => match.name);\n\t\t\tconst text =\n\t\t\t\tloaded.length === 0\n\t\t\t\t\t? \"No matching tools found.\"\n\t\t\t\t\t: `Loaded ${loaded.length} tool${loaded.length === 1 ? \"\" : \"s\"}. They are available from your next call:\\n${loaded\n\t\t\t\t\t\t\t.map((name) => {\n\t\t\t\t\t\t\t\tconst description = candidates.find((tool) => tool.name === name)?.description ?? \"\";\n\t\t\t\t\t\t\t\treturn `- ${name}: ${description.trim().split(/\\r?\\n/)[0]}`;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.join(\"\\n\")}`;\n\t\t\tconst details: ToolSearchToolDetails = { loaded };\n\t\t\treturn {\n\t\t\t\toutput: [{ type: \"text\", text }],\n\t\t\t\tdetails,\n\t\t\t\t...(loaded.length === 0 ? {} : { control: { addTools: loaded } }),\n\t\t\t};\n\t\t},\n\t});\n}\n\n/** The `tool_search` extension: install it and select it where the model should find deferred tools. */\nexport function createToolSearchExtension() {\n\treturn defineExtension({ name: \"tool-search\", tools: [createToolSearchTool()] });\n}\n"]}