buckyos 0.7.170 → 0.7.175

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 (200) hide show
  1. package/cli/core/app.ts +2 -0
  2. package/cli/core/argv.ts +45 -239
  3. package/cli/core/command.ts +3 -35
  4. package/cli/dist/cli.mjs +2151 -673
  5. package/cli/dist/cli.mjs.map +1 -1
  6. package/cli/modules/agent.ts +3 -1
  7. package/cli/modules/app.ts +13 -2
  8. package/cli/modules/pikg.ts +70 -1
  9. package/cli/modules/runtime.ts +497 -0
  10. package/cli/modules/skill.ts +583 -161
  11. package/cli/modules/skill_lint.ts +462 -0
  12. package/cli/version.ts +1 -1
  13. package/dist/account-7a7bde6f.mjs +105 -0
  14. package/dist/account-7a7bde6f.mjs.map +1 -0
  15. package/dist/account-b12ac6b9.js +2 -0
  16. package/dist/account-b12ac6b9.js.map +1 -0
  17. package/dist/aicc-67851c41.mjs +582 -0
  18. package/dist/aicc-67851c41.mjs.map +1 -0
  19. package/dist/aicc-ccb36ef7.js +2 -0
  20. package/dist/aicc-ccb36ef7.js.map +1 -0
  21. package/dist/browser.cjs +1 -1
  22. package/dist/browser.cjs.map +1 -1
  23. package/dist/browser.d.ts +2 -0
  24. package/dist/browser.d.ts.map +1 -1
  25. package/dist/browser.mjs +204 -194
  26. package/dist/browser.mjs.map +1 -1
  27. package/dist/did_object_client-6a1b108a.js +2 -0
  28. package/dist/did_object_client-6a1b108a.js.map +1 -0
  29. package/dist/did_object_client-7fa36f90.mjs +87 -0
  30. package/dist/did_object_client-7fa36f90.mjs.map +1 -0
  31. package/dist/did_object_client.d.ts +39 -0
  32. package/dist/did_object_client.d.ts.map +1 -0
  33. package/dist/{executor_client-5f4d0468.mjs → executor_client-c620d25c.mjs} +233 -748
  34. package/dist/executor_client-c620d25c.mjs.map +1 -0
  35. package/dist/executor_client-d4439d54.js +13 -0
  36. package/dist/executor_client-d4439d54.js.map +1 -0
  37. package/dist/executor_client.d.ts +129 -0
  38. package/dist/executor_client.d.ts.map +1 -1
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.ts +2 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.mjs +209 -199
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/internal/command_args.d.ts +67 -0
  46. package/dist/internal/command_args.d.ts.map +1 -0
  47. package/dist/krpc_client-26c2dc8b.js +2 -0
  48. package/dist/krpc_client-26c2dc8b.js.map +1 -0
  49. package/dist/krpc_client-673448e5.mjs +173 -0
  50. package/dist/krpc_client-673448e5.mjs.map +1 -0
  51. package/dist/krpc_client.d.ts +5 -1
  52. package/dist/krpc_client.d.ts.map +1 -1
  53. package/dist/{ndn_types-ab30fac0.mjs → ndn_types-0fac2499.mjs} +115 -215
  54. package/dist/ndn_types-0fac2499.mjs.map +1 -0
  55. package/dist/ndn_types-5b138882.js +2 -0
  56. package/dist/ndn_types-5b138882.js.map +1 -0
  57. package/dist/node.cjs +1 -1
  58. package/dist/node.cjs.map +1 -1
  59. package/dist/node.mjs +201 -194
  60. package/dist/node.mjs.map +1 -1
  61. package/dist/object_url-8fb5a7bf.js +2 -0
  62. package/dist/object_url-8fb5a7bf.js.map +1 -0
  63. package/dist/object_url-f72c1704.mjs +412 -0
  64. package/dist/object_url-f72c1704.mjs.map +1 -0
  65. package/dist/openai-ae2978de.mjs +163 -0
  66. package/dist/openai-ae2978de.mjs.map +1 -0
  67. package/dist/openai-f560d518.js +2 -0
  68. package/dist/openai-f560d518.js.map +1 -0
  69. package/dist/provision.cjs +6 -6
  70. package/dist/provision.cjs.map +1 -1
  71. package/dist/provision.mjs +4 -3
  72. package/dist/provision.mjs.map +1 -1
  73. package/dist/site_manager-11a7a468.mjs +6410 -0
  74. package/dist/site_manager-11a7a468.mjs.map +1 -0
  75. package/dist/site_manager-334b1a51.js +2 -0
  76. package/dist/site_manager-334b1a51.js.map +1 -0
  77. package/dist/{tus_client-b231b248.js → tus_client-809c90ab.js} +2 -2
  78. package/dist/{tus_client-b231b248.js.map → tus_client-809c90ab.js.map} +1 -1
  79. package/dist/{tus_client-d1ffe2d6.mjs → tus_client-893a3287.mjs} +2 -2
  80. package/dist/{tus_client-d1ffe2d6.mjs.map → tus_client-893a3287.mjs.map} +1 -1
  81. package/dist/xllm/core/action_parser.d.ts +15 -0
  82. package/dist/xllm/core/action_parser.d.ts.map +1 -0
  83. package/dist/xllm/core/behavior_loop.d.ts +20 -0
  84. package/dist/xllm/core/behavior_loop.d.ts.map +1 -0
  85. package/dist/xllm/core/behavior_result.d.ts +11 -0
  86. package/dist/xllm/core/behavior_result.d.ts.map +1 -0
  87. package/dist/xllm/core/config.d.ts +62 -0
  88. package/dist/xllm/core/config.d.ts.map +1 -0
  89. package/dist/xllm/core/context_window.d.ts +15 -0
  90. package/dist/xllm/core/context_window.d.ts.map +1 -0
  91. package/dist/xllm/core/deps.d.ts +97 -0
  92. package/dist/xllm/core/deps.d.ts.map +1 -0
  93. package/dist/xllm/core/errors.d.ts +94 -0
  94. package/dist/xllm/core/errors.d.ts.map +1 -0
  95. package/dist/xllm/core/interrupt.d.ts +31 -0
  96. package/dist/xllm/core/interrupt.d.ts.map +1 -0
  97. package/dist/xllm/core/json.d.ts +11 -0
  98. package/dist/xllm/core/json.d.ts.map +1 -0
  99. package/dist/xllm/core/json_check.d.ts +17 -0
  100. package/dist/xllm/core/json_check.d.ts.map +1 -0
  101. package/dist/xllm/core/loop.d.ts +135 -0
  102. package/dist/xllm/core/loop.d.ts.map +1 -0
  103. package/dist/xllm/core/messages.d.ts +18 -0
  104. package/dist/xllm/core/messages.d.ts.map +1 -0
  105. package/dist/xllm/core/observer.d.ts +14 -0
  106. package/dist/xllm/core/observer.d.ts.map +1 -0
  107. package/dist/xllm/core/open_runtime.d.ts +22 -0
  108. package/dist/xllm/core/open_runtime.d.ts.map +1 -0
  109. package/dist/xllm/core/prepare.d.ts +54 -0
  110. package/dist/xllm/core/prepare.d.ts.map +1 -0
  111. package/dist/xllm/core/prompt.d.ts +40 -0
  112. package/dist/xllm/core/prompt.d.ts.map +1 -0
  113. package/dist/xllm/core/protocol.d.ts +15 -0
  114. package/dist/xllm/core/protocol.d.ts.map +1 -0
  115. package/dist/xllm/core/result.d.ts +12 -0
  116. package/dist/xllm/core/result.d.ts.map +1 -0
  117. package/dist/xllm/core/run.d.ts +198 -0
  118. package/dist/xllm/core/run.d.ts.map +1 -0
  119. package/dist/xllm/core/rust_text.d.ts +20 -0
  120. package/dist/xllm/core/rust_text.d.ts.map +1 -0
  121. package/dist/xllm/core/site_policy.d.ts +5 -0
  122. package/dist/xllm/core/site_policy.d.ts.map +1 -0
  123. package/dist/xllm/core/store.d.ts +60 -0
  124. package/dist/xllm/core/store.d.ts.map +1 -0
  125. package/dist/xllm/core/suspension.d.ts +13 -0
  126. package/dist/xllm/core/suspension.d.ts.map +1 -0
  127. package/dist/xllm/core/tokenizer.d.ts +8 -0
  128. package/dist/xllm/core/tokenizer.d.ts.map +1 -0
  129. package/dist/xllm/core/types.d.ts +826 -0
  130. package/dist/xllm/core/types.d.ts.map +1 -0
  131. package/dist/xllm/core/xml.d.ts +19 -0
  132. package/dist/xllm/core/xml.d.ts.map +1 -0
  133. package/dist/xllm/dev/openai.d.ts +17 -0
  134. package/dist/xllm/dev/openai.d.ts.map +1 -0
  135. package/dist/xllm/dev/scripted.d.ts +46 -0
  136. package/dist/xllm/dev/scripted.d.ts.map +1 -0
  137. package/dist/xllm/dev.d.ts +5 -0
  138. package/dist/xllm/dev.d.ts.map +1 -0
  139. package/dist/xllm/hosts/browser/store.d.ts +41 -0
  140. package/dist/xllm/hosts/browser/store.d.ts.map +1 -0
  141. package/dist/xllm/hosts/deno/deno_api.d.ts +103 -0
  142. package/dist/xllm/hosts/deno/deno_api.d.ts.map +1 -0
  143. package/dist/xllm/hosts/deno/identity.d.ts +29 -0
  144. package/dist/xllm/hosts/deno/identity.d.ts.map +1 -0
  145. package/dist/xllm/hosts/deno/index.d.ts +47 -0
  146. package/dist/xllm/hosts/deno/index.d.ts.map +1 -0
  147. package/dist/xllm/hosts/deno/native_runtime.d.ts +93 -0
  148. package/dist/xllm/hosts/deno/native_runtime.d.ts.map +1 -0
  149. package/dist/xllm/hosts/deno/native_tools.d.ts +105 -0
  150. package/dist/xllm/hosts/deno/native_tools.d.ts.map +1 -0
  151. package/dist/xllm/hosts/deno/provider.d.ts +13 -0
  152. package/dist/xllm/hosts/deno/provider.d.ts.map +1 -0
  153. package/dist/xllm/hosts/deno/store.d.ts +60 -0
  154. package/dist/xllm/hosts/deno/store.d.ts.map +1 -0
  155. package/dist/xllm/index.d.ts +48 -0
  156. package/dist/xllm/index.d.ts.map +1 -0
  157. package/dist/xllm/providers/aicc.d.ts +22 -0
  158. package/dist/xllm/providers/aicc.d.ts.map +1 -0
  159. package/dist/xllm/providers/timeout.d.ts +12 -0
  160. package/dist/xllm/providers/timeout.d.ts.map +1 -0
  161. package/dist/xllm/runtime/compress.d.ts +149 -0
  162. package/dist/xllm/runtime/compress.d.ts.map +1 -0
  163. package/dist/xllm/runtime/did_object_resources.d.ts +21 -0
  164. package/dist/xllm/runtime/did_object_resources.d.ts.map +1 -0
  165. package/dist/xllm/runtime/hints.d.ts +23 -0
  166. package/dist/xllm/runtime/hints.d.ts.map +1 -0
  167. package/dist/xllm/runtime/site.d.ts +22 -0
  168. package/dist/xllm/runtime/site.d.ts.map +1 -0
  169. package/dist/xllm/runtime/site_manager.d.ts +38 -0
  170. package/dist/xllm/runtime/site_manager.d.ts.map +1 -0
  171. package/dist/xllm/runtime/site_tools.d.ts +76 -0
  172. package/dist/xllm/runtime/site_tools.d.ts.map +1 -0
  173. package/dist/xllm/runtime/step_renderer.d.ts +54 -0
  174. package/dist/xllm/runtime/step_renderer.d.ts.map +1 -0
  175. package/dist/xllm/runtime/task_model.d.ts +64 -0
  176. package/dist/xllm/runtime/task_model.d.ts.map +1 -0
  177. package/dist/xllm/runtime/tool_result.d.ts +39 -0
  178. package/dist/xllm/runtime/tool_result.d.ts.map +1 -0
  179. package/dist/xllm/runtime/types.d.ts +99 -0
  180. package/dist/xllm/runtime/types.d.ts.map +1 -0
  181. package/dist/xllm.cjs +2 -0
  182. package/dist/xllm.cjs.map +1 -0
  183. package/dist/xllm.mjs +1167 -0
  184. package/dist/xllm.mjs.map +1 -0
  185. package/dist/xllm_deno.cjs +2 -0
  186. package/dist/xllm_deno.cjs.map +1 -0
  187. package/dist/xllm_deno.mjs +2487 -0
  188. package/dist/xllm_deno.mjs.map +1 -0
  189. package/dist/xllm_dev.cjs +2 -0
  190. package/dist/xllm_dev.cjs.map +1 -0
  191. package/dist/xllm_dev.mjs +70 -0
  192. package/dist/xllm_dev.mjs.map +1 -0
  193. package/package.json +22 -1
  194. package/src/internal/command_args.ts +268 -0
  195. package/dist/executor_client-1ee523cf.js +0 -13
  196. package/dist/executor_client-1ee523cf.js.map +0 -1
  197. package/dist/executor_client-5f4d0468.mjs.map +0 -1
  198. package/dist/ndn_types-8c2696d5.js +0 -2
  199. package/dist/ndn_types-8c2696d5.js.map +0 -1
  200. package/dist/ndn_types-ab30fac0.mjs.map +0 -1
@@ -0,0 +1,22 @@
1
+ import type { LoopModel, RuntimeConfig, ToolsConfig } from './types';
2
+ import type { AgentRuntime } from '../runtime/types';
3
+ import type { RunningTaskResolver } from '../runtime/task_model';
4
+ /** Open the runtime's tools for a run and the configuration saved with it. */
5
+ export declare function openRuntime(runtime: AgentRuntime, configured: RuntimeConfig, workdir: string, loopModel: LoopModel, sources: Record<string, string>, toolsCfg: ToolsConfig, tasks?: RunningTaskResolver): Promise<{
6
+ tools: {
7
+ shell: import("./types").ShellSettings;
8
+ enabled: boolean;
9
+ filesystem_policy: import("./types").FilesystemPolicy;
10
+ tools2actions: boolean;
11
+ tool_sources: import("./types").ToolSource[];
12
+ action_sources: import("./types").ToolSource[];
13
+ native: import("./types").ResolvedTool[];
14
+ actions: import("./types").ResolvedTool[];
15
+ bash_tools: import("./types").BashToolManual[];
16
+ exec_enabled: boolean;
17
+ sources: Record<string, string>;
18
+ };
19
+ manager: import("../runtime/types").RunToolManager;
20
+ runtimeConfig: RuntimeConfig;
21
+ }>;
22
+ //# sourceMappingURL=open_runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open_runtime.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/open_runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAEhE,8EAA8E;AAC9E,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EACjG,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,mBAAmB;;;;;;;;;;;;;;;;GAQ1G"}
@@ -0,0 +1,54 @@
1
+ import type { AiMessage, JsonValue, LoopModel, ProviderKind, ResourceRef, ResultFormat, RunLogLevel } from './types';
2
+ import type { MergedConfig } from './config';
3
+ import type { PreparedTask, XllmDeps } from './run';
4
+ export declare const MAX_TEXT_ATTACHMENT_BYTES: number;
5
+ export declare const MAX_IMAGE_ATTACHMENT_BYTES: number;
6
+ export type Attachment =
7
+ /** Text material the host has (Rust `--file`). */
8
+ {
9
+ kind: 'text';
10
+ label: string;
11
+ text: string;
12
+ }
13
+ /** An image: a URL, or a resource (base64 / named object). */
14
+ | {
15
+ kind: 'image';
16
+ source: string | ResourceRef;
17
+ label?: string;
18
+ };
19
+ export interface TaskInput {
20
+ user?: string;
21
+ attachments?: Attachment[];
22
+ /** Piped input: the request when there is none, material otherwise. */
23
+ stdin?: string;
24
+ /** A ready conversation instead of a request (exclusive with everything else). */
25
+ structured?: AiMessage[];
26
+ }
27
+ /** Explicit arguments (Rust `TaskOverrides`); `undefined` keeps the configuration. */
28
+ export interface TaskOverrides {
29
+ provider?: ProviderKind;
30
+ model?: string;
31
+ file_model?: string;
32
+ loop_model?: LoopModel;
33
+ tools?: boolean;
34
+ select?: string;
35
+ system?: string;
36
+ max_tokens?: number;
37
+ max_tool_iterations?: number;
38
+ timeout_secs?: number;
39
+ llm_timeout_secs?: number;
40
+ run_logs?: RunLogLevel;
41
+ result_format?: ResultFormat;
42
+ json?: boolean;
43
+ json_schema?: JsonValue;
44
+ disable_capabilities?: string[];
45
+ }
46
+ /** The prompt group a task uses (`select_prompt_group`): none for structured input or a custom prompt. */
47
+ export declare function selectPromptGroup(merged: MergedConfig, overrides: Pick<TaskOverrides, 'select' | 'system'>, structured?: boolean): string | undefined;
48
+ /**
49
+ * Merge the configuration with `overrides`, select the group, open the
50
+ * runtime's tools, assemble the prompt and the first user message; no run
51
+ * is created.
52
+ */
53
+ export declare function prepareTask(llmContext: JsonValue | undefined, origin: string, input: TaskInput, overrides: TaskOverrides, deps: XllmDeps): Promise<PreparedTask>;
54
+ //# sourceMappingURL=prepare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/prepare.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACC,SAAS,EAAiE,SAAS,EAAE,SAAS,EACzF,YAAY,EAAE,WAAW,EAAE,YAAY,EAAa,WAAW,EAChF,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAO5C,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEnD,eAAO,MAAM,yBAAyB,QAAkB,CAAA;AACxD,eAAO,MAAM,0BAA0B,QAAmB,CAAA;AAE1D,MAAM,MAAM,UAAU;AACpB,kDAAkD;AAChD;IAA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Q,GAAG,MAAM,GAAG,SAAS,CAWnJ;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,UAAU,EAAE,SAAS,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAC7H,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAiKvC"}
@@ -0,0 +1,40 @@
1
+ import type { EffectiveTools, GroupDef, LoopModel, PromptPlan, RuntimeInfo, SectionRender } from './types';
2
+ import type { MergedConfig } from './config';
3
+ /** Fixed section aliases → line numbers. */
4
+ export declare const SECTION_ALIASES: [string, number][];
5
+ export declare function resolveSectionKey(key: string): number | string;
6
+ export declare function aliasLine(name: string): number | undefined;
7
+ export declare function sectionDefaultName(line: number): string;
8
+ /** `RuntimeInfo::template_values`: strings as they are, other values as JSON. */
9
+ export declare function runtimeTemplateValues(info: RuntimeInfo): Record<string, string>;
10
+ /**
11
+ * Template variables: `runtime.*` from the runtime, `env.*` read only when a
12
+ * template references them (from what the host / page passed). `\{{` is a
13
+ * literal `{{`; values are not interpreted again.
14
+ */
15
+ export declare class TemplateEnv {
16
+ private readonly env;
17
+ readonly runtime: Record<string, string>;
18
+ private readonly used;
19
+ constructor(runtime: Record<string, string>, env: (name: string) => string | undefined);
20
+ static forNewRun(info: RuntimeInfo, env: (name: string) => string | undefined): TemplateEnv;
21
+ usedVars(): Record<string, string>;
22
+ private lookup;
23
+ render(text: string, source: string): string;
24
+ }
25
+ export declare function sectionIsEmpty(s: SectionRender): boolean;
26
+ export interface PromptAssembly {
27
+ merged: MergedConfig;
28
+ /** `TaskOverrides.system` / `.select` (explicit arguments). */
29
+ overrideSystem?: string;
30
+ overrideSelect?: string;
31
+ groupName?: string;
32
+ group?: GroupDef;
33
+ loopModel: LoopModel;
34
+ tools: EffectiveTools;
35
+ env: TemplateEnv;
36
+ json: boolean;
37
+ }
38
+ /** System prompt of a run that xllm assembles itself (`assemble_prompt`). */
39
+ export declare function assemblePrompt(a: PromptAssembly): PromptPlan;
40
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/prompt.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAc,UAAU,EAAE,WAAW,EAAc,aAAa,EACpG,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAG5C,4CAA4C;AAC5C,eAAO,MAAM,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAE7C,CAAA;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAY9D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASvD;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAI/E;AAED;;;;GAIG;AACH,qBAAa,WAAW;IAIuB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAHjE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6B;gBAEtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAmB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS;IAIvG,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,WAAW;IAI3F,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIlC,OAAO,CAAC,MAAM;IAmBd,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;CAyB7C;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,CAExD;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,YAAY,CAAA;IACpB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,SAAS,EAAE,SAAS,CAAA;IACpB,KAAK,EAAE,cAAc,CAAA;IACrB,GAAG,EAAE,WAAW,CAAA;IAChB,IAAI,EAAE,OAAO,CAAA;CACd;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,UAAU,CAoF5D"}
@@ -0,0 +1,15 @@
1
+ import type { EffectiveTools, HostProtocolFlavor, LoopModel, ResolvedTool } from './types';
2
+ /** Runtime protocol version; a resume checks the executor can handle the saved one. */
3
+ export declare const RUNTIME_PROTOCOL_VERSION = "xllm/2";
4
+ /** The parameter an action's element body carries: `command` / `content` / … or the only required string. */
5
+ export declare function actionBodyArg(tool: ResolvedTool): string | undefined;
6
+ export declare function renderActionUsage(tool: ResolvedTool): string;
7
+ export declare function buildRuntimeProtocol(loopModel: LoopModel, tools: EffectiveTools, json: boolean): string;
8
+ export declare function buildRuntimeProtocolFor(flavor: HostProtocolFlavor, loopModel: LoopModel, tools: EffectiveTools, json: boolean): string;
9
+ /** System text of the `rules` section (30): the tools and actions this run has. */
10
+ export declare function buildRulesSystemText(loopModel: LoopModel, tools: EffectiveTools): string;
11
+ /** System text of the `cmd_manual` section (40), only when `shell` is enabled. */
12
+ export declare function buildCmdManualSystemText(tools: EffectiveTools): string | undefined;
13
+ /** System text of the `contexts` section (20): RuntimeInfo facts the templates did not reference. */
14
+ export declare function buildContextsSystemText(runtime: Record<string, string>, referenced: Record<string, string>): string | undefined;
15
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/protocol.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI1F,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,WAAW,CAAA;AAYhD,6GAA6G;AAC7G,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAWpE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAoC5D;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAEvG;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAwDtI;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,GAAG,MAAM,CAiBxF;AAED,kFAAkF;AAClF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAQlF;AAQD,qGAAqG;AACrG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAU/H"}
@@ -0,0 +1,12 @@
1
+ import type { ExtractedValue, JsonValue, ResultFormat } from './types';
2
+ /** Apply `result_format` to the final reply; a failure is an error, never a silent fallback to raw. */
3
+ export declare function extractResult(raw: string, fmt: ResultFormat): ExtractedValue;
4
+ /** `--json` check of an extracted value. */
5
+ export declare function extractedAsJson(v: ExtractedValue): {
6
+ ok: true;
7
+ value: JsonValue;
8
+ } | {
9
+ ok: false;
10
+ error: string;
11
+ };
12
+ //# sourceMappingURL=result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/result.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAmBtE,uGAAuG;AACvG,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,cAAc,CA4C5E;AAED,4CAA4C;AAC5C,wBAAgB,eAAe,CAAC,CAAC,EAAE,cAAc,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQhH"}
@@ -0,0 +1,198 @@
1
+ import type { AiContent, AiMessage, BudgetKind, EffectiveConfig, EffectiveTools, FileStagePlan, HostPromptSections, HostProtocolFlavor, InputRecord, JsonValue, LLMComputeError, LLMContextOutcome, LLMContextRequest, LLMContextSnapshot, LlmClient, LoopModel, PromptPlan, RunErrorRecord, RunLimits, RunObserver, RunRecord, RunStatus, Tokenizer, ToolPolicy } from './types';
2
+ import { LLMContext, DEFAULT_WRAP_UP_ROUNDS } from './loop';
3
+ import { TemplateEnv } from './prompt';
4
+ import type { RunLock, RunStore } from './store';
5
+ import type { TaskInput, TaskOverrides } from './prepare';
6
+ import type { AgentRuntime, RunToolManager } from '../runtime/types';
7
+ import type { RunningTaskResolver } from '../runtime/task_model';
8
+ export declare const REFUSED_CREDENTIALS = "credentials";
9
+ export declare const HOST_PROMPT_SECTIONS_ALL: HostPromptSections;
10
+ export declare const HOST_PROMPT_SECTIONS_NONE: HostPromptSections;
11
+ /** What a run executes with; `llm` and `runtime` come from the host (the page), never from configuration. */
12
+ export interface XllmDeps {
13
+ llm: LlmClient;
14
+ runtime: AgentRuntime;
15
+ store: RunStore;
16
+ observer?: RunObserver;
17
+ tokenizer?: Tokenizer;
18
+ /** Sections a hosted run appends after the host's system text (default: all). */
19
+ hostPromptSections?: HostPromptSections | 'NONE' | 'ALL';
20
+ /** Opening of a hosted run's runtime protocol (default one-shot). */
21
+ hostProtocol?: HostProtocolFlavor;
22
+ /** Process id written to run.json (0 where there is none, e.g. a browser page). */
23
+ pid?: number;
24
+ /** Working-directory lock of tool-enabled runs (hosts with a filesystem). */
25
+ lockWorkdir?(workdir: string, runId: string): Promise<RunLock | null>;
26
+ /** The control-side working directory still exists (hosts with a filesystem; default: yes). */
27
+ workdirExists?(workdir: string): Promise<boolean>;
28
+ /** The run's task backend: pending tool results are waited for through it (runtime layer). */
29
+ tasks?: RunningTaskResolver;
30
+ }
31
+ /** A host-assembled task: the host's system text, xllm's sections after it (`prepare_hosted`). */
32
+ export interface HostedTask {
33
+ readonly kind: 'hosted';
34
+ readonly origin: string;
35
+ readonly workdir: string;
36
+ readonly config: EffectiveConfig;
37
+ readonly prompt: PromptPlan;
38
+ /** @internal */
39
+ readonly manager: RunToolManager;
40
+ }
41
+ /** A task xllm assembled itself (`prepare`): its user input is part of it. */
42
+ export interface PreparedTask {
43
+ readonly kind: 'prepared';
44
+ readonly workdir: string;
45
+ readonly config: EffectiveConfig;
46
+ readonly prompt: PromptPlan;
47
+ readonly input: InputRecord;
48
+ readonly summary: string;
49
+ readonly initialMessages: AiMessage[];
50
+ readonly mainUserParts: AiContent[];
51
+ readonly fileStage?: FileStagePlan;
52
+ /** @internal */
53
+ readonly manager: RunToolManager;
54
+ }
55
+ /** The waist tool policy of a run (`hosted_request` / `build_initial_context`). */
56
+ export declare function runToolPolicy(cfg: EffectiveConfig): ToolPolicy;
57
+ /** The waist request of a run. `hosted`: a JSON reply is a contract with one repair (`hosted_request`). */
58
+ export declare function runRequest(cfg: EffectiveConfig, owner: JsonValue, trace: string, objective: string, behaviorName: string, input: AiMessage[], hosted: boolean): LLMContextRequest;
59
+ /** The loop a hosted run may use (`check_hosted_loop`). */
60
+ export declare function checkHostedLoop(origin: string, sections: HostPromptSections, loopModel: LoopModel, json: boolean): void;
61
+ /**
62
+ * A hosted run's system prompt (`assemble_hosted_system`): the host's text
63
+ * rendered with `env` (no `current_time` / `timezone`), then the sections.
64
+ */
65
+ export declare function assembleHostedSystem(hostSystem: string, origin: string, env: TemplateEnv, sections: HostPromptSections, flavor: HostProtocolFlavor, loopModel: LoopModel, tools: EffectiveTools, json: boolean): {
66
+ system_prompt: string;
67
+ runtime_protocol: string;
68
+ rendered_host: string;
69
+ template_vars: Record<string, string>;
70
+ };
71
+ export declare function limitReason(which: BudgetKind, limits: Pick<RunLimits, 'max_tool_iterations' | 'timeout_secs'>): string;
72
+ /**
73
+ * Run state an outcome ends a function-call run in when nothing else applies
74
+ * (no running task, nothing to compact) — Rust `run_step` + `RunStep::status`.
75
+ */
76
+ export declare function outcomeRunStatus(outcome: LLMContextOutcome, limits: Pick<RunLimits, 'max_tool_iterations' | 'timeout_secs'>): {
77
+ status: RunStatus;
78
+ kind?: string;
79
+ limit_reason?: string;
80
+ };
81
+ export declare class XllmTask {
82
+ /**
83
+ * Prepare a task xllm assembles itself (`XllmTask::prepare`): `llmContext`
84
+ * is the one JSON configuration (no discovery), `overrides` the explicit
85
+ * arguments, `input` the request, materials and images.
86
+ */
87
+ static prepare(llmContext: JsonValue | undefined, origin: string, input: TaskInput, overrides: TaskOverrides, deps: XllmDeps): Promise<PreparedTask>;
88
+ /**
89
+ * Prepare a host-assembled task (`prepare_hosted`): `llmContext` is the
90
+ * JSON form of an `.llm_context` (strict keys; `origin` names it in
91
+ * diagnostics), `hostSystem` the host's system text; xllm appends its
92
+ * `capabilities` / `cmd_manual` / `runtime_protocol` sections as
93
+ * `deps.hostPromptSections` allows.
94
+ */
95
+ static prepareHosted(llmContext: JsonValue | undefined, origin: string, hostSystem: string, deps: XllmDeps): Promise<HostedTask>;
96
+ }
97
+ export interface RunOutcome {
98
+ status: RunStatus;
99
+ record: RunRecord;
100
+ }
101
+ export interface ResumeLimits {
102
+ max_tokens?: number;
103
+ max_tool_iterations?: number;
104
+ timeout_secs?: number;
105
+ llm_timeout_secs?: number;
106
+ }
107
+ export type ResumeStart = {
108
+ kind: 'terminal';
109
+ record: RunRecord;
110
+ } | {
111
+ kind: 'run';
112
+ run: XllmRun;
113
+ };
114
+ /** External interrupt handle of a run (Ctrl-C semantics; `finish` settles gracefully). */
115
+ export declare class XllmInterrupter {
116
+ /** @internal */ requested: string | undefined;
117
+ /** @internal */ handle: {
118
+ interrupt(r: string): boolean;
119
+ finish(r: string): boolean;
120
+ } | undefined;
121
+ interrupt(reason: string): void;
122
+ finish(reason: string): void;
123
+ }
124
+ export interface StartOptions {
125
+ /** The user input of a hosted task (text or messages). */
126
+ input?: string | AiMessage[];
127
+ /** Task summary in run.json (default: the first line of the input). */
128
+ summary?: string;
129
+ }
130
+ /** One run's execution handle. */
131
+ export declare class XllmRun {
132
+ private readonly store;
133
+ private readonly deps;
134
+ private readonly manager;
135
+ readonly runId: string;
136
+ private record;
137
+ private ctx;
138
+ private limitSnapshot;
139
+ private readonly interrupterState;
140
+ private readonly llm;
141
+ private countedCalls;
142
+ private lock;
143
+ private workdirLock;
144
+ private readonly waistDeps;
145
+ private readonly hosted;
146
+ private initialMessages;
147
+ private fileStage;
148
+ private mainUserParts;
149
+ private constructor();
150
+ /** Create the run: allocate its id, take its locks, write run.json before the first model request. */
151
+ static start(task: HostedTask | PreparedTask, deps: XllmDeps, options?: StartOptions): Promise<XllmRun>;
152
+ /**
153
+ * Take a run back (`XllmRun::resume`). A terminal run only returns its
154
+ * record. Records and snapshots from a store are not trusted: the tools
155
+ * they name must be tools of this runtime, the model is the host's client.
156
+ */
157
+ static resume(store: RunStore, runId: string, limits: ResumeLimits, deps: XllmDeps): Promise<ResumeStart>;
158
+ /** The current run record. */
159
+ currentRecord(): RunRecord;
160
+ interrupter(): XllmInterrupter;
161
+ /**
162
+ * Give a paused or interrupted run a new input (`XllmRun::inject_input` /
163
+ * `xllm --resume "<message>"`): appended at the boundary the run stopped
164
+ * at and committed before the run continues.
165
+ */
166
+ injectInput(text: string): Promise<void>;
167
+ /** Release the run's locks without executing (a run that will not continue in this executor). */
168
+ release(): Promise<void>;
169
+ /** Drive the run to this command's stopping point. */
170
+ execute(): Promise<RunOutcome>;
171
+ private executeLocked;
172
+ private handleOutcome;
173
+ /**
174
+ * Compact a context suspended at the context limit and resume it (at most
175
+ * 3 compactions per run). The compacted context is committed before it
176
+ * runs; an outcome ends this command.
177
+ */
178
+ private compactContext;
179
+ private buildInitialContext;
180
+ /** The file-model stage: images analysed by `file_model`; the main model gets the analysis instead of the images. */
181
+ private runFileStage;
182
+ private finishWithResponse;
183
+ private interrupted;
184
+ /** @internal */
185
+ setCtx(ctx: LLMContext): void;
186
+ private addCalls;
187
+ private outcome;
188
+ private update;
189
+ private commit;
190
+ private emit;
191
+ }
192
+ export declare function isTerminal(s: RunStatus): boolean;
193
+ /** The call a resumed snapshot dispatches first that the previous executor may have started (`in_flight_call`). */
194
+ export declare function inFlightCall(snapshot: LLMContextSnapshot): import("./types").AiToolCall | undefined;
195
+ /** Run error of a waist error (`classify_error`): kind, whether `resume` can fix it, and how. */
196
+ export declare function classifyError(err: LLMComputeError): RunErrorRecord;
197
+ export { DEFAULT_WRAP_UP_ROUNDS };
198
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/run.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,SAAS,EAAE,SAAS,EAAuB,UAAU,EAAE,eAAe,EAAE,cAAc,EAAkB,aAAa,EAA6B,kBAAkB,EAAE,kBAAkB,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B,OAAO,CAAC,IAAI;CAGb;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAEhD;AA0DD,mHAAmH;AACnH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,kBAAkB,4CAUxD;AAuBD,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,cAAc,CAmClE;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -0,0 +1,20 @@
1
+ import type { AiMessage, JsonValue } from './types';
2
+ /** `str::trim_start`. */
3
+ export declare function rustTrimStart(s: string): string;
4
+ /** `str::trim_end`. */
5
+ export declare function rustTrimEnd(s: string): string;
6
+ /** `str::trim`. */
7
+ export declare function rustTrim(s: string): string;
8
+ /** `s.split_whitespace().collect::<Vec<_>>().join(" ")`. */
9
+ export declare function collapseWhitespace(s: string): string;
10
+ /** UTF-16 offset after the first `n` chars (Unicode scalar values) of `s`; `s.length` when it has fewer. */
11
+ export declare function charOffset(s: string, n: number): number;
12
+ /** `str::chars().count()`. */
13
+ export declare function charCount(s: string): number;
14
+ /** `AiMessage::text_content`: text blocks joined by `\n`, a separator only once something was written. */
15
+ export declare function rustTextContent(message: AiMessage): string;
16
+ /** Order of Rust `String` (UTF-8 bytes, i.e. code points). */
17
+ export declare function compareCodePoints(a: string, b: string): number;
18
+ /** `serde_json::to_string` (or `to_string_pretty`) of a `Value`: keys in Rust's order, numbers as serde prints them. */
19
+ export declare function serdeJson(value: JsonValue, pretty?: boolean): string;
20
+ //# sourceMappingURL=rust_text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rust_text.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/rust_text.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAQnD,yBAAyB;AACzB,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED,uBAAuB;AACvB,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI7C;AAED,mBAAmB;AACnB,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAapD;AAOD,4GAA4G;AAC5G,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED,8BAA8B;AAC9B,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI3C;AAED,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAQ1D;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAW9D;AA4CD,wHAAwH;AACxH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,UAAQ,GAAG,MAAM,CAElE"}
@@ -0,0 +1,5 @@
1
+ import type { LlmContextFile } from './types';
2
+ export declare const SITE_KIND = "site";
3
+ /** Rejects (Capability) what a site runtime cannot do; never downgrades silently. */
4
+ export declare function checkSiteConfig(file: LlmContextFile, origin: string): void;
5
+ //# sourceMappingURL=site_policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site_policy.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/site_policy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,SAAS,CAAA;AAI1D,eAAO,MAAM,SAAS,SAAS,CAAA;AAe/B,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,QAqBnE"}
@@ -0,0 +1,60 @@
1
+ import type { LLMContextSnapshot, RunRecord } from './types';
2
+ export declare const RUN_RECORD_VERSION = 7;
3
+ /** Held while a run executes; releasing it lets another executor take the run. */
4
+ export interface RunLock {
5
+ release(): void | Promise<void>;
6
+ }
7
+ /** A run with every snapshot, as moved between stores. */
8
+ export interface ExportedRun {
9
+ record: RunRecord;
10
+ /** `[index, snapshot]`, ascending. */
11
+ snapshots: [number, LLMContextSnapshot][];
12
+ }
13
+ export interface RunStore {
14
+ /** Runs survive this process (a directory, IndexedDB …). */
15
+ readonly persistent: boolean;
16
+ runsDir(): string | undefined;
17
+ runDir(runId: string): string | undefined;
18
+ createRun(): Promise<string>;
19
+ writeRecord(record: RunRecord): Promise<void>;
20
+ /** Rejects with `run_not_found` / `not_resumable` (other version) / `corrupted_run`. */
21
+ readRecord(runId: string): Promise<RunRecord>;
22
+ listRecords(): Promise<RunRecord[]>;
23
+ /** Stores the next snapshot and returns its index (1, 2, …). */
24
+ putSnapshot(runId: string, snapshot: LLMContextSnapshot): Promise<number>;
25
+ getSnapshot(runId: string, idx: number): Promise<LLMContextSnapshot>;
26
+ listSnapshots(runId: string): Promise<number[]>;
27
+ /** The run's execution lock, `null` when another executor holds it. */
28
+ lockRun(runId: string): Promise<RunLock | null>;
29
+ /** Some executor holds the run's lock. */
30
+ isRunLive(runId: string): Promise<boolean>;
31
+ removeRun(runId: string): Promise<void>;
32
+ /** Write a run exported from another store (same id, same snapshot indices). */
33
+ importRun(run: ExportedRun): Promise<void>;
34
+ }
35
+ /** `YYYYMMDD-HHMMSS-<6 hex>`: local time for reading, a random suffix against collisions. */
36
+ export declare function generateRunId(now?: Date): string;
37
+ export declare function exportRun(store: RunStore, runId: string): Promise<ExportedRun>;
38
+ export declare function importRun(store: RunStore, run: ExportedRun): Promise<void>;
39
+ export declare class MemoryRunStore implements RunStore {
40
+ readonly persistent = false;
41
+ private readonly records;
42
+ private readonly snapshots;
43
+ private readonly locks;
44
+ runsDir(): string | undefined;
45
+ runDir(): string | undefined;
46
+ createRun(): Promise<string>;
47
+ writeRecord(record: RunRecord): Promise<void>;
48
+ readRecord(runId: string): Promise<RunRecord>;
49
+ listRecords(): Promise<RunRecord[]>;
50
+ putSnapshot(runId: string, snapshot: LLMContextSnapshot): Promise<number>;
51
+ getSnapshot(runId: string, idx: number): Promise<LLMContextSnapshot>;
52
+ listSnapshots(runId: string): Promise<number[]>;
53
+ lockRun(runId: string): Promise<RunLock | null>;
54
+ isRunLive(runId: string): Promise<boolean>;
55
+ removeRun(runId: string): Promise<void>;
56
+ importRun(run: ExportedRun): Promise<void>;
57
+ /** `exportRun` on this store. */
58
+ exportRun(runId: string): Promise<ExportedRun>;
59
+ }
60
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/store.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAI5D,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC,kFAAkF;AAClF,MAAM,WAAW,OAAO;IACtB,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAED,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,CAAA;IACjB,sCAAsC;IACtC,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,CAAA;CAC1C;AAED,MAAM,WAAW,QAAQ;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,OAAO,IAAI,MAAM,GAAG,SAAS,CAAA;IAC7B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACzC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IAC5B,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7C,wFAAwF;IACxF,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAA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AI,MAAM,GAAG,SAAS;IAI7B,MAAM,IAAI,MAAM,GAAG,SAAS;IAItB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAW5B,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAM7C,WAAW,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAInC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAQzE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMpE,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/C,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAa/C,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1C,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvC,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAOhD,iCAAiC;IACjC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAG/C"}
@@ -0,0 +1,13 @@
1
+ import type { AiContent, AiMessage, LLMContextRequest, LLMContextSnapshot, LLMContextState, ResumeFill, StepRecord } from './types';
2
+ export declare function hasContinuation(state: LLMContextState): boolean;
3
+ export declare function applyFill(request: LLMContextRequest, state: LLMContextState, fill: ResumeFill, behavior: boolean, nowMs: number): void;
4
+ /** Messages of `accumulated` after `request.input` (the inner transcript of a behavior step). */
5
+ export declare function innerTranscriptOf(request: LLMContextRequest, state: LLMContextState): AiMessage[];
6
+ export declare function unansweredToolCalls(messages: AiMessage[]): string[];
7
+ export declare function checkPaired(messages: AiMessage[]): void;
8
+ export declare function isThinking(part: AiContent): boolean;
9
+ /** Thinking blocks are only valid under the prefix they were produced with; a rewritten history drops them. */
10
+ export declare function stripThinking(messages: AiMessage[]): AiMessage[];
11
+ export declare function stripStepThinking(step: StepRecord): void;
12
+ export declare function stripSnapshotThinking(snapshot: LLMContextSnapshot): void;
13
+ //# sourceMappingURL=suspension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suspension.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/suspension.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAQnI,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAE/D;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAyB/H;AA2CD,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,eAAe,GAAG,SAAS,EAAE,CAIjG;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CASnE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,QAahD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAOnD;AAED,+GAA+G;AAC/G,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAQhE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,QAMjD;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,kBAAkB,QAOjE"}
@@ -0,0 +1,8 @@
1
+ import type { Tokenizer } from './types';
2
+ /** UTF-8 byte length without allocating. */
3
+ export declare function utf8Length(s: string): number;
4
+ /** 1 token ≈ 4 bytes, rounded up (`ByteHeuristicTokenizer`). */
5
+ export declare class ByteHeuristicTokenizer implements Tokenizer {
6
+ countTokens(text: string): number;
7
+ }
8
+ //# sourceMappingURL=tokenizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../../../src/xllm/core/tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,4CAA4C;AAC5C,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAe5C;AAED,gEAAgE;AAChE,qBAAa,sBAAuB,YAAW,SAAS;IACtD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGlC"}