@yaks/harness 0.0.0-stage → 0.2.36

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 (230) hide show
  1. package/FRONTEND.md +170 -0
  2. package/LICENSE +202 -0
  3. package/MCPAuthPanel.js +166 -0
  4. package/MCPAuthPanel.js.map +1 -0
  5. package/MCPAuthPanel.ts +184 -0
  6. package/ModelPanel.js +124 -0
  7. package/ModelPanel.js.map +1 -0
  8. package/ModelPanel.ts +143 -0
  9. package/PersonaPanel.js +106 -0
  10. package/PersonaPanel.js.map +1 -0
  11. package/PersonaPanel.ts +110 -0
  12. package/README.md +1570 -2
  13. package/RuntimePanel.js +180 -0
  14. package/RuntimePanel.js.map +1 -0
  15. package/RuntimePanel.ts +205 -0
  16. package/STREAMING.md +101 -0
  17. package/WINDOWS.md +78 -0
  18. package/WORKER.md +221 -0
  19. package/_dist/agent.d.ts +197 -0
  20. package/_dist/agent.d.ts.map +1 -0
  21. package/_dist/cli.d.ts +10 -0
  22. package/_dist/cli.d.ts.map +1 -0
  23. package/_dist/conversations.d.ts +45 -0
  24. package/_dist/conversations.d.ts.map +1 -0
  25. package/_dist/default.d.ts +32 -0
  26. package/_dist/default.d.ts.map +1 -0
  27. package/_dist/detail.d.ts +16 -0
  28. package/_dist/detail.d.ts.map +1 -0
  29. package/_dist/diagnostics.d.ts +5 -0
  30. package/_dist/diagnostics.d.ts.map +1 -0
  31. package/_dist/effects.d.ts +35 -0
  32. package/_dist/effects.d.ts.map +1 -0
  33. package/_dist/http.d.ts +12 -0
  34. package/_dist/http.d.ts.map +1 -0
  35. package/_dist/isolated.d.ts +6 -0
  36. package/_dist/isolated.d.ts.map +1 -0
  37. package/_dist/local.d.ts +74 -0
  38. package/_dist/local.d.ts.map +1 -0
  39. package/_dist/machine.d.ts +3 -0
  40. package/_dist/machine.d.ts.map +1 -0
  41. package/_dist/mcp_auth.d.ts +8 -0
  42. package/_dist/mcp_auth.d.ts.map +1 -0
  43. package/_dist/mod.d.ts +43 -0
  44. package/_dist/mod.d.ts.map +1 -0
  45. package/_dist/model_selection.d.ts +8 -0
  46. package/_dist/model_selection.d.ts.map +1 -0
  47. package/_dist/routes.d.ts +11 -0
  48. package/_dist/routes.d.ts.map +1 -0
  49. package/_dist/runs.d.ts +7 -0
  50. package/_dist/runs.d.ts.map +1 -0
  51. package/_dist/runtime.d.ts +2 -0
  52. package/_dist/runtime.d.ts.map +1 -0
  53. package/_dist/session_machines.d.ts +18 -0
  54. package/_dist/session_machines.d.ts.map +1 -0
  55. package/_dist/skills.d.ts +11 -0
  56. package/_dist/skills.d.ts.map +1 -0
  57. package/_dist/store.d.ts +38 -0
  58. package/_dist/store.d.ts.map +1 -0
  59. package/_dist/tools.d.ts +28 -0
  60. package/_dist/tools.d.ts.map +1 -0
  61. package/_dist/view.d.ts +5 -0
  62. package/_dist/view.d.ts.map +1 -0
  63. package/_dist/vocab.d.ts +7 -0
  64. package/_dist/vocab.d.ts.map +1 -0
  65. package/_dist/worn.d.ts +52 -0
  66. package/_dist/worn.d.ts.map +1 -0
  67. package/agent.js +773 -0
  68. package/agent.js.map +1 -0
  69. package/agent.ts +959 -0
  70. package/app.js +811 -0
  71. package/app.js.map +1 -0
  72. package/app.ts +868 -0
  73. package/artifact_tools.js +186 -0
  74. package/artifact_tools.js.map +1 -0
  75. package/artifact_tools.ts +190 -0
  76. package/backend_worker.ts +286 -0
  77. package/cli.js +43 -0
  78. package/cli.js.map +1 -0
  79. package/cli.ts +48 -0
  80. package/conversations.js +526 -0
  81. package/conversations.js.map +1 -0
  82. package/conversations.ts +576 -0
  83. package/conversations_testing.ts +162 -0
  84. package/default.js +162 -0
  85. package/default.js.map +1 -0
  86. package/default.ts +168 -0
  87. package/deferred_model.ts +1 -0
  88. package/deno.json +1 -0
  89. package/detail.js +50 -0
  90. package/detail.js.map +1 -0
  91. package/detail.ts +75 -0
  92. package/diagnostics.js +132 -0
  93. package/diagnostics.js.map +1 -0
  94. package/diagnostics.ts +150 -0
  95. package/draft_vault.js +149 -0
  96. package/draft_vault.js.map +1 -0
  97. package/draft_vault.ts +176 -0
  98. package/effects.js +233 -0
  99. package/effects.js.map +1 -0
  100. package/effects.ts +250 -0
  101. package/frontend/vocab.json +376 -0
  102. package/frontend.js +511 -0
  103. package/frontend.js.map +1 -0
  104. package/frontend.ts +389 -0
  105. package/http.js +107 -0
  106. package/http.js.map +1 -0
  107. package/http.ts +105 -0
  108. package/input_text.js +91 -0
  109. package/input_text.js.map +1 -0
  110. package/input_text.ts +99 -0
  111. package/instructions.js +111 -0
  112. package/instructions.js.map +1 -0
  113. package/instructions.ts +145 -0
  114. package/isolated.js +512 -0
  115. package/isolated.js.map +1 -0
  116. package/isolated.ts +502 -0
  117. package/keyboard.js +544 -0
  118. package/keyboard.js.map +1 -0
  119. package/keyboard.ts +403 -0
  120. package/legacy_instructions.js +3 -0
  121. package/legacy_instructions.js.map +1 -0
  122. package/legacy_instructions.ts +13 -0
  123. package/local.js +181 -0
  124. package/local.js.map +1 -0
  125. package/local.ts +282 -0
  126. package/machine.js +3 -0
  127. package/machine.js.map +1 -0
  128. package/machine.ts +8 -0
  129. package/mcp.js +123 -0
  130. package/mcp.js.map +1 -0
  131. package/mcp.ts +141 -0
  132. package/mcp_auth.js +63 -0
  133. package/mcp_auth.js.map +1 -0
  134. package/mcp_auth.ts +91 -0
  135. package/mcp_authorize.js +17 -0
  136. package/mcp_authorize.js.map +1 -0
  137. package/mcp_authorize.ts +18 -0
  138. package/mcp_registry.js +178 -0
  139. package/mcp_registry.js.map +1 -0
  140. package/mcp_registry.ts +193 -0
  141. package/mod.js +43 -0
  142. package/mod.js.map +1 -0
  143. package/mod.ts +45 -0
  144. package/model_selection.js +72 -0
  145. package/model_selection.js.map +1 -0
  146. package/model_selection.ts +86 -0
  147. package/numbers.js +6 -0
  148. package/numbers.js.map +1 -0
  149. package/numbers.ts +8 -0
  150. package/package.json +106 -4
  151. package/panels.js +119 -0
  152. package/panels.js.map +1 -0
  153. package/panels.ts +259 -0
  154. package/patch.js +329 -0
  155. package/patch.js.map +1 -0
  156. package/patch.ts +325 -0
  157. package/perf.ts +65 -0
  158. package/providers.js +36 -0
  159. package/providers.js.map +1 -0
  160. package/providers.ts +53 -0
  161. package/remote.js +441 -0
  162. package/remote.js.map +1 -0
  163. package/remote.ts +446 -0
  164. package/results.js +49 -0
  165. package/results.js.map +1 -0
  166. package/results.ts +39 -0
  167. package/routes.js +64 -0
  168. package/routes.js.map +1 -0
  169. package/routes.ts +87 -0
  170. package/runs.js +478 -0
  171. package/runs.js.map +1 -0
  172. package/runs.ts +479 -0
  173. package/runtime/vocab.json +36 -0
  174. package/runtime.js +105 -0
  175. package/runtime.js.map +1 -0
  176. package/runtime.ts +112 -0
  177. package/session_machines.js +203 -0
  178. package/session_machines.js.map +1 -0
  179. package/session_machines.ts +216 -0
  180. package/sheet.js +55 -0
  181. package/sheet.js.map +1 -0
  182. package/sheet.ts +31 -0
  183. package/shutdown.js +7 -0
  184. package/shutdown.js.map +1 -0
  185. package/shutdown.ts +7 -0
  186. package/skills.js +116 -0
  187. package/skills.js.map +1 -0
  188. package/skills.ts +114 -0
  189. package/startup_bench.ts +140 -0
  190. package/status.js +82 -0
  191. package/status.js.map +1 -0
  192. package/status.ts +97 -0
  193. package/steps.baseline.json +28 -0
  194. package/steps_bench.ts +155 -0
  195. package/store.js +31 -0
  196. package/store.js.map +1 -0
  197. package/store.ts +82 -0
  198. package/streaming.js +3 -0
  199. package/streaming.js.map +1 -0
  200. package/streaming.ts +8 -0
  201. package/streaming_bench.ts +76 -0
  202. package/switch_bench.ts +97 -0
  203. package/testing.ts +177 -0
  204. package/tools.js +287 -0
  205. package/tools.js.map +1 -0
  206. package/tools.ts +313 -0
  207. package/transcript.js +149 -0
  208. package/transcript.js.map +1 -0
  209. package/transcript.ts +187 -0
  210. package/tree.js +97 -0
  211. package/tree.js.map +1 -0
  212. package/tree.ts +114 -0
  213. package/unfinished.js +186 -0
  214. package/unfinished.js.map +1 -0
  215. package/unfinished.ts +198 -0
  216. package/view.js +92 -0
  217. package/view.js.map +1 -0
  218. package/view.ts +102 -0
  219. package/vocab.js +23 -0
  220. package/vocab.js.map +1 -0
  221. package/vocab.json +494 -0
  222. package/vocab.ts +22 -0
  223. package/window_bench.ts +114 -0
  224. package/worker_bench.ts +72 -0
  225. package/workspace.js +21 -0
  226. package/workspace.js.map +1 -0
  227. package/workspace.ts +17 -0
  228. package/worn.js +194 -0
  229. package/worn.js.map +1 -0
  230. package/worn.ts +246 -0
@@ -0,0 +1,74 @@
1
+ import type { Model } from "@yaks/model";
2
+ import { type Bundle } from "@yaks/graph";
3
+ import type { ChildLimits, Step, Tool } from "@yaks/session";
4
+ import type { ReactElement } from "@types/react";
5
+ import { type Agent, type Opts as AgentOpts } from "./agent.js";
6
+ import type { MCPAuthAction, MCPAuthReply } from "./mcp_auth.js";
7
+ import { type FailureContext } from "./diagnostics.js";
8
+ import type { Harness } from "./store.js";
9
+ import { pooledHttp } from "./http.js";
10
+ export { type Harness, hosted } from "./store.js";
11
+ export { graphTools, harnessTools } from "./tools.js";
12
+ type NotHarness = {
13
+ [K in Exclude<keyof Harness, 'sandboxes' | 'workspaces'>]?: never;
14
+ };
15
+ /** How the harness is started here: what it stores in, what serves it, and
16
+ * what the agent may do. */ export type Opts = ChildLimits & NotHarness & {
17
+ /** Local root openings select the checkout containing this command directory. */ cwd?: string;
18
+ /** the graph to run over */ h: Harness;
19
+ /** what serves every ask (default: the providers the config names) */ model?: Model;
20
+ /** the model to ask for by name (otherwise the graph's `defaultUsing`) */ name?: string;
21
+ /** the provider to ask, by name, and the one `model` serves */ provider?: string;
22
+ /** Implementations keyed by provider.name, over the configured ones, for
23
+ * embedding and testing. */ providers?: Record<string, Model>;
24
+ /** what the agent may call (default: the shell and the graph) */ tools?: Tool[];
25
+ /** Stream responses by default; false overrides HARNESS_STREAM. */ streaming?: boolean;
26
+ /** Alias for streaming. If both are supplied, streaming takes precedence. */ stream?: boolean;
27
+ /** where settings such as `HARNESS_STREAM` are read (default this process's
28
+ * environment) */ env?: (name: string) => string | undefined;
29
+ /** Transport and connection lifetime lent to the provider pool. */ http?: Parameters<typeof pooledHttp>[0];
30
+ /** Cooperating migrations must allow at least this polling interval, which
31
+ * the migration monitor keeps by `clock`. */ migrationPollMs?: number;
32
+ /** how long a transcript's lease stands between renewals, so how long a
33
+ * process that died running it holds it up (ms) */ hold?: number;
34
+ checkpointMs?: number;
35
+ /** The system prompt every ask carries. */ instructions?: string;
36
+ /** Maximum tool-result UTF-8 bytes before model-facing handle projection. */ outputLimit?: number;
37
+ /** the share of its model's context window a transcript fills before it is
38
+ * compacted, for every model (@yaks/session `Deps.compactAt`) */ compactAt?: number;
39
+ /** each step of every transcript, as it lands */ each?: (step: Step, session?: string) => void | Promise<void>;
40
+ /** Override the workspace and sandbox bindings explicitly lent by the host. */ sandboxes?: Harness['sandboxes'];
41
+ workspaces?: Harness['workspaces'];
42
+ workspace?: string;
43
+ };
44
+ /** The harness running here: the agent, and what only a box offers it. */ export type Local = Agent<Harness> & {
45
+ authorizeMCP: (action: MCPAuthAction, name?: string, callback?: string) => Promise<MCPAuthReply>;
46
+ image: (eid: string) => Promise<Uint8Array>;
47
+ /** one bundle as the terminal draws it */ entry: (b: Bundle) => ReactElement | null;
48
+ };
49
+ /** What this machine lends an agent: its options, and what answers a person
50
+ * here. */ export type Here = {
51
+ /** the agent's options; their `release` lets go of what was opened for
52
+ * them, and leaves the graph open */ lent: AgentOpts<Harness>;
53
+ /** a person authorizing a sign-in: an MCP server or model provider */ authorize: (action: MCPAuthAction, name?: string, callback?: string) => Promise<MCPAuthReply>;
54
+ /** how the model lent names the reply a request continues */ anchor: Model['anchor'];
55
+ report: (error: unknown, where: FailureContext) => void;
56
+ };
57
+ /** What this machine lends an agent over `h`: the models of the providers its
58
+ * config names, over its credentials and sign-ins, the workspace and sandbox
59
+ * bindings, the MCP servers, the pictures, the instruction files where a
60
+ * session opens, the persona and topic each of its asks is told afresh, and
61
+ * where a defect is written. */ export declare let here: (h: Harness, opts?: Omit<Opts, 'h'>) => Promise<Here>;
62
+ /**
63
+ * Start the harness here, over a graph a `yak` config composed: lend the agent
64
+ * this machine, and work the runs its commits owe.
65
+ *
66
+ * ```ts ignore
67
+ * import { hosted, local } from '@yaks/harness/local'
68
+ *
69
+ * let a = await local({ h: hosted(host), model: fake })
70
+ * let s = await a.start('reply with the word pong')
71
+ * await a.idle(s)
72
+ * ```
73
+ */ export declare let local: (opts: Opts) => Promise<Local>;
74
+ //# sourceMappingURL=local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.d.ts","sources":["../local.ts"],"names":[],"mappings":"AAMA,cAAc,KAAK,2BAAgC;AACnD,SAAS,KAAK,MAAM,2BAAgC;AACpD,cAAc,WAAW,EAAE,IAAI,EAAE,IAAI,6BAAkC;AAG7B,cAAc,YAAY,uBAA0B;AAC9F,SAAS,KAAK,KAAK,EAAS,KAAK,QAAQ,SAAS,qBAAoB;AAEtE,cAAc,aAAa,EAAE,YAAY,wBAAuB;AAIhE,SAAsB,KAAK,cAAc,2BAA0B;AAKnE,cAAc,OAAO,qBAAoB;AAGzC,SAAS,UAAU,oBAAmB;AAItC,SAAS,KAAK,OAAO,EAAE,MAAM,qBAAoB;AACjD,SAAS,UAAU,EAAE,YAAY,qBAAoB;KAIhD;GACF,KAAK,cAAc,SAAS,cAAc,iBAAiB,KAAK;;AAGnE;0BAC0B,GAC1B,YAAY,OAAO,cAAc;EAC/B,+EAA+E,GAC/E,MAAM,MAAM;EACZ,0BAA0B,GAC1B,GAAG;EACH,oEAAoE,GACpE,QAAQ;EACR,wEAAwE,GACxE,OAAO,MAAM;EACb,6DAA6D,GAC7D,WAAW,MAAM;EACjB;4BAC0B,GAC1B,YAAY,OAAO,MAAM,EAAE;EAC3B,+DAA+D,GAC/D,QAAQ;EACR,iEAAiE,GACjE,YAAY,OAAO;EACnB,2EAA2E,GAC3E,SAAS,OAAO;EAChB;kBACgB,GAChB,OAAO,MAAM,MAAM,KAAK,MAAM,GAAG,SAAS;EAC1C,iEAAiE,GACjE,OAAO,kBAAkB,YAAY;EACrC;6CAC2C,GAC3C,kBAAkB,MAAM;EACxB;mDACiD,GACjD,OAAO,MAAM;EACb,eAAe,MAAM;EACrB,yCAAyC,GACzC,eAAe,MAAM;EACrB,2EAA2E,GAC3E,cAAc,MAAM;EACpB;iEAC+D,GAC/D,YAAY,MAAM;EAClB,+CAA+C,GAC/C,QAAQ,MAAM,MAAM,UAAU,MAAM,KAAK,IAAI,GAAG,QAAQ,IAAI;EAC5D,6EAA6E,GAC7E,YAAY,QAAQ;EACpB,aAAa,QAAQ;EACrB,YAAY,MAAM;;AAGpB,wEAAwE,GACxE,YAAY,QAAQ,MAAM;EACxB,eACE,QAAQ,eACR,OAAO,MAAM,EACb,WAAW,MAAM,KACd,QAAQ;EACb,QAAQ,KAAK,MAAM,KAAK,QAAQ;EAChC,wCAAwC,GACxC,QAAQ,GAAG,WAAW,eAAe,IAAI;;AAG3C;SACS,GACT,YAAY;EACV;qCACmC,GACnC,MAAM,UAAU;EAChB,oEAAoE,GACpE,YACE,QAAQ,eACR,OAAO,MAAM,EACb,WAAW,MAAM,KACd,QAAQ;EACb,2DAA2D,GAC3D,QAAQ,MAAM;EACd,SAAS,OAAO,OAAO,EAAE,OAAO,mBAAmB,IAAI;;AAGzD;;;;8BAI8B,GAC9B,OAAO,YAAI,OACT,GAAG,SACH,OAAM,KAAK,MAAM,SAChB,QAAQ,MAwFV;AAED;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,QAAe,MAAM,SAAO,QAAQ,OAsD9C"}
@@ -0,0 +1,3 @@
1
+ export { machineDeclared, machineTools, rooted, workspaceTools } from "@yaks/machine/tools";
2
+ export type { MachineOpts, MachineTool } from "@yaks/machine/tools";
3
+ //# sourceMappingURL=machine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machine.d.ts","sources":["../machine.ts"],"names":[],"mappings":"AACA,SACE,eAAe,EACf,YAAY,EACZ,MAAM,EACN,cAAc,mCACuB;AACvC,cAAc,WAAW,EAAE,WAAW,mCAAwC"}
@@ -0,0 +1,8 @@
1
+ export type MCPAuthAction = 'list' | 'begin' | 'complete' | 'cancel';
2
+ export type MCPAuthReply = {
3
+ servers?: string[];
4
+ url?: string;
5
+ redirectUrl?: string;
6
+ message?: string;
7
+ };
8
+ //# sourceMappingURL=mcp_auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp_auth.d.ts","sources":["../mcp_auth.ts"],"names":[],"mappings":"AAmBA,YAAY,gBAAgB,SAAS,UAAU,aAAa;AAC5D,YAAY;EACV,UAAU,MAAM;EAChB,MAAM,MAAM;EACZ,cAAc,MAAM;EACpB,UAAU,MAAM"}
package/_dist/mod.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @yaks/harness — an agent runner over a graph, and the host that runs it on
3
+ * this machine.
4
+ *
5
+ * A session in the fleet is a transcript in the live graph, run by whichever
6
+ * process works its effects. The harness is the same session with the server
7
+ * removed: the {@link agent} loop over any graph, written in bundles and read
8
+ * in queries, so the same rows run on a box, in a Cloudflare Worker, or move
9
+ * into the fleet's graph with no export step. It composes existing packages
10
+ * rather than adding machinery —
11
+ *
12
+ * ```
13
+ * agent() the seed rows, the runner lent (@yaks/session), and the
14
+ * operations a caller needs (./agent.ts)
15
+ * local() agent() here, over a graph a config composed: the shell, a
16
+ * workspace and sandbox bindings, MCP servers, the terminal
17
+ * (@yaks/harness/local)
18
+ * tools its verbs, as `yak` tools (./runs.ts)
19
+ * effects `session_run`, lent providers, where a `yak` host
20
+ * lists the harness (./effects.ts)
21
+ * ```
22
+ *
23
+ * This door is the runner alone, and type-checks with only the web platform in
24
+ * scope; nothing it imports names a machine.
25
+ *
26
+ * ```ts ignore
27
+ * import { agent } from '@yaks/harness'
28
+ *
29
+ * let a = agent({ h: { g, fx, vocab, me }, model: fake })
30
+ * let s = await a.start('reply with the word pong')
31
+ * await a.idle(s)
32
+ * for (let e of await a.transcript(s)) console.log(a.line(e))
33
+ * ```
34
+ *
35
+ * On a command line the harness is a `yak` plugin: `yak session new`,
36
+ * `yak session send` and `yak model list` are its tools (./runs.ts), and
37
+ * `--tui` draws a session as its terminal app (./view.ts).
38
+ *
39
+ * @module
40
+ */ export * from "./agent.js";
41
+ export { defaultUsing, HARNESS, usingFor } from "./default.js";
42
+ export { selectedUsing } from "./model_selection.js";
43
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GAED,2BAA0B;AAE1B,SAAS,YAAY,EAAE,OAAO,EAAE,QAAQ,uBAAsB;AAC9D,SAAS,aAAa,+BAA8B"}
@@ -0,0 +1,8 @@
1
+ /** Model choices are graph records: a choice is one provider's offering of a
2
+ * model, its `serves` edge. */ import { type Bundle, type Comp, type Graph } from "@yaks/graph";
3
+ export type ModelSelection = {
4
+ choices: Bundle[];
5
+ current?: string;
6
+ };
7
+ /** Read configuration metadata only, following a fork's bounded prefix. */ export declare const selectedUsing: (g: Graph, session: string, before?: number, seen?: Set<string>) => Promise<Comp | undefined>;
8
+ //# sourceMappingURL=model_selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model_selection.d.ts","sources":["../model_selection.ts"],"names":[],"mappings":"AAAA;6BAC6B,GAC7B,SAAS,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,2BAAgC;AAK3E,YAAY;EAAmB,SAAS;EAAU,UAAU,MAAM;;AAuBlE,yEAAyE,GACzE,OAAO,cAAM,gBACX,GAAG,OACH,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAM,IAAI,MAAM,MACf,QAAQ,OAAO,SAAS,EAkB1B"}
@@ -0,0 +1,11 @@
1
+ import type { Route } from "@yaks/api";
2
+ import type { Host } from "@yaks/host";
3
+ import type { Opts } from "./local.js";
4
+ /** What a config file can set for this facet. */ export type Options = {
5
+ /** the providers whose models this machine answers another host's model
6
+ * steps from, by `provider.name`; none answers nothing */ serve?: string[];
7
+ };
8
+ /** `POST /model/step`: one model step, answered from the providers `serve`
9
+ * names and streamed as it arrives. `providers` are ones the caller already
10
+ * holds, beside the config's. */ export declare let routes: (host: Host, options?: Options & Pick<Opts, 'env' | 'http' | 'providers'>) => Route[];
11
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.d.ts","sources":["../routes.ts"],"names":[],"mappings":"AAaA,cAAc,KAAK,yBAA8B;AAEjD,cAAc,IAAI,0BAA+B;AAKjD,cAAc,IAAI,qBAAoB;AAItC,+CAA+C,GAC/C,YAAY;EACV;0DACwD,GACxD,QAAQ,MAAM;;AAoBhB;;+BAE+B,GAC/B,OAAO,YAAI,SACT,MAAM,MACN,UAAS,UAAU,KAAK,MAAM,QAAQ,SAAS,iBAC9C,QAgCF"}
@@ -0,0 +1,7 @@
1
+ import type { Comp, Eid, Graph } from "@yaks/graph";
2
+ import { type Runs } from "@yaks/graph/tools";
3
+ import type { Host } from "@yaks/host";
4
+ export declare let outside: (graph: Graph, s: Eid, using?: Comp) => Promise<boolean>;
5
+ export type { Listed } from "@yaks/model";
6
+ /** The functions behind the tools the harness declares (./vocab.json). */ export declare let runs: (host?: Host) => Runs;
7
+ //# sourceMappingURL=runs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.d.ts","sources":["../runs.ts"],"names":[],"mappings":"AAkBA,cAAsB,IAAI,EAAE,GAAG,EAAE,KAAK,2BAAgC;AAKtE,SAAe,KAAK,IAAI,iCAAsC;AAC9D,cAAc,IAAI,0BAA+B;AAwKjD,OAAO,YAAI,UACT,OAAO,OACP,GAAG,KACH,QAAQ,SACP,QAAQ,OAAO,EAUjB;AAYD,cAAc,MAAM,2BAAgC;AAwFpD,wEAAwE,GACxE,OAAO,YAAI,OAAQ,OAAO,SAAO,KA2K/B"}
@@ -0,0 +1,2 @@
1
+ export type RuntimeAction = 'interrupt' | 'cancel-queued' | 'resume';
2
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sources":["../runtime.ts"],"names":[],"mappings":"AAOA,YAAY,gBAAgB,cAAc,kBAAkB"}
@@ -0,0 +1,18 @@
1
+ import type { Comp } from "@yaks/graph";
2
+ import { type Machine } from "@yaks/machine";
3
+ import type { ChildLimits } from "@yaks/session";
4
+ export declare let homeAt: (workspace?: string, cwd?: string) => Comp;
5
+ export type WorkspaceFile = {
6
+ path: string;
7
+ bytes: Uint8Array;
8
+ };
9
+ export type SessionMachines = {
10
+ home: (session: string, supplied?: Comp) => Promise<Comp>;
11
+ machine: (session: string, supplied?: Comp) => Promise<Machine>;
12
+ cwd: (session: string) => Promise<string | undefined>;
13
+ homeAt: typeof homeAt;
14
+ release: (session: string) => Promise<void>;
15
+ files: (session: string, paths: string[]) => AsyncIterable<WorkspaceFile>;
16
+ limits: ChildLimits;
17
+ };
18
+ //# sourceMappingURL=session_machines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session_machines.d.ts","sources":["../session_machines.ts"],"names":[],"mappings":"AAKA,cAAc,IAAI,2BAAuC;AAEzD,SAAS,KAAK,OAAO,6BAA0C;AAE/D,cAAc,WAAW,6BAAkC;AAI3D,OAAO,YAAI,SAAU,YAAY,MAAM,EAAE,MAAM,MAAM,KAAG,KAGtD;AASF,YAAY;EAAkB,MAAM,MAAM;EAAE,OAAO;;AAsLnD,YAAY;EACV,OAAO,SAAS,MAAM,EAAE,WAAW,SAAS,QAAQ;EACpD,UAAU,SAAS,MAAM,EAAE,WAAW,SAAS,QAAQ;EACvD,MAAM,SAAS,MAAM,KAAK,QAAQ,MAAM,GAAG,SAAS;EACpD,eAAe;EACf,UAAU,SAAS,MAAM,KAAK,QAAQ,IAAI;EAC1C,QAAQ,SAAS,MAAM,EAAE,OAAO,MAAM,OAAO,cAAc;EAC3D,QAAQ"}
@@ -0,0 +1,11 @@
1
+ import type { Eid, Graph, NamedTool } from "@yaks/graph";
2
+ import type { Item } from "@yaks/model";
3
+ /** Discover graph skill descriptions after resolving the exact tool offer. */ export declare let skillItems: (g: Graph, current: {
4
+ session: Eid;
5
+ tools: readonly {
6
+ name: string;
7
+ }[];
8
+ }) => Promise<Item[]>;
9
+ /** The loader, as a graph tool: the instructions of one skill by title,
10
+ * signed as the session that asked. */ export declare let skillRead: NamedTool;
11
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sources":["../skills.ts"],"names":[],"mappings":"AAOA,cAAoB,GAAG,EAAE,KAAK,EAAE,SAAS,2BAAgC;AAGzE,cAAc,IAAI,2BAAgC;AA0BlD,4EAA4E,GAC5E,OAAO,YAAI,aACT,GAAG,OACH;EAAW,SAAS;EAAK;IAAkB,MAAM,MAAM;;MACtD,QAAQ,QAiBV;AAED;qCACqC,GACrC,OAAO,YAAI,WAAW,UAoDrB"}
@@ -0,0 +1,38 @@
1
+ import { type Blobs } from "@yaks/blob";
2
+ import type { Effects } from "@yaks/effects";
3
+ import type { Eid, Graph, NamedTool, Storage } from "@yaks/graph";
4
+ import type { Vocab } from "@yaks/vocab";
5
+ import type { Host, MigrationMonitor, Plug } from "@yaks/host";
6
+ import type { Vault } from "@yaks/secrets";
7
+ import type { Reply } from "@yaks/tools";
8
+ /** A graph as a harness runs over it: the store under it, the graph
9
+ * over it, the effects registry the runner is handled on, and the process
10
+ * working it. */ export type Harness = {
11
+ /** The configured person whose default provider accounts serve native sessions. */ person?: Eid;
12
+ /** the plugins the config names: the providers among them are the ones
13
+ * a session may ask (./providers.ts) */ plugins?: readonly Plug[];
14
+ store: Storage;
15
+ g: Graph;
16
+ fx: Effects;
17
+ vocab: Vocab;
18
+ /** the process row this graph is worked by: what a run's lease names */ me: Eid;
19
+ /** whether a lease's holder is over, so what it held is had now rather than
20
+ * at its expiry (@yaks/cli `Host.gone`) */ gone: (holder: Eid) => Promise<boolean>;
21
+ /** where this graph's secrets are kept — its sign-ins among them */ vault: Vault;
22
+ /** Explicitly lent workspace and sandbox bindings; no host disk is assumed. */ sandboxes?: Host['sandboxes'];
23
+ resolveHome?: Host['resolveHome'];
24
+ workspaces?: Host['workspaces'];
25
+ /** Binary artifacts shared with the host's blob door. */ artifacts: Blobs;
26
+ /** what a tool call the agent makes directly is owed beside its answer,
27
+ * as the host's own runner adds it (@yaks/cli `Host.reply`): the entities
28
+ * near one it just created, among them */ reply?: Reply;
29
+ /** The host's catch boundary, delivering original failures to its tracker. */ report?: Host['report'];
30
+ /** every tool the host runs, its plugins' own among them (`memory_around`),
31
+ * read when a transcript names one the harness does not carry for all */ hostTools?: () => NamedTool[];
32
+ migrations?: MigrationMonitor;
33
+ close: () => void | Promise<void>;
34
+ };
35
+ /** The graph a `yak` config composed, as a harness runs over it: its store,
36
+ * graph, effects and vault are the host's. Closing the harness runs `close`,
37
+ * which by default leaves the host open for whoever composed it to close. */ export declare let hosted: (host: Host, close?: () => void | Promise<void>) => Harness;
38
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sources":["../store.ts"],"names":[],"mappings":"AAOA,SAAS,KAAK,KAAK,0BAA+B;AAClD,cAAc,OAAO,6BAAkC;AACvD,cAAc,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,2BAAgC;AAC5E,cAAc,KAAK,2BAAgC;AACnD,cAAc,IAAI,EAAE,gBAAgB,EAAE,IAAI,0BAA+B;AACzE,cAAc,KAAK,6BAAkC;AACrD,cAAc,KAAK,2BAAgC;AAEnD;;eAEe,GACf,YAAY;EACV,iFAAiF,GACjF,SAAS;EACT;wCACsC,GACtC,mBAAmB;EACnB,OAAO;EACP,GAAG;EACH,IAAI;EACJ,OAAO;EACP,sEAAsE,GACtE,IAAI;EACJ;2CACyC,GACzC,OAAO,QAAQ,QAAQ,QAAQ,OAAO;EACtC,kEAAkE,GAClE,OAAO;EACP,6EAA6E,GAC7E,YAAY,KAAK;EACjB,cAAc,KAAK;EACnB,aAAa,KAAK;EAClB,uDAAuD,GACvD,WAAW;EACX;;0CAEwC,GACxC,QAAQ;EACR,4EAA4E,GAC5E,SAAS,KAAK;EACd;yEACuE,GACvE,kBAAkB;EAClB,aAAa;EACb,aAAa,IAAI,GAAG,QAAQ,IAAI;;AAGlC;;2EAE2E,GAC3E,OAAO,YAAI,SACT,MAAM,MACN,cAAa,IAAI,GAAG,QAAQ,IAAI,MAC/B,QAqBF"}
@@ -0,0 +1,28 @@
1
+ import type { Reply } from "@yaks/tools";
2
+ import { type Blobs } from "@yaks/blob";
3
+ import { type SessionMachines } from "./session_machines.js";
4
+ import type { Entity, Graph, Tool as GraphTool } from "@yaks/graph";
5
+ import { type Workspaces } from "@yaks/machine/targets";
6
+ import { type ChildLimits, type Tool } from "@yaks/session";
7
+ /**
8
+ * Graph tools as tools a model may call: the generic tier (`graph_apply`,
9
+ * `graph_query`, `graph_show`, `graph_schema`) where `tools` names none, or
10
+ * the ones it names (a host's plugins' own, `memory_around` among them). The
11
+ * agent reads and writes the same graph its transcript lives in.
12
+ */ export declare let graphTools: (g: Graph, opts?: {
13
+ actor?: Entity | null;
14
+ reply?: Reply;
15
+ tools?: GraphTool[];
16
+ }) => Tool[];
17
+ /** The machine, delegation, and the graph, with one wait for all three targets.
18
+ * react records every tool's wall-clock and projects it after output bounding;
19
+ * these raw answers remain parseable JSON for non-model callers. */ export declare let harnessTools: (g: Graph, opts?: {
20
+ cwd?: string;
21
+ /** where artifacts' bytes are kept (the harness's `artifacts`) */ artifacts?: Blobs;
22
+ /** the root a task child's checkout is cut under */ machines?: SessionMachines;
23
+ workspaces?: Workspaces;
24
+ workspaceEffects?: boolean;
25
+ /** what a direct graph tool call is owed beside its answer (the
26
+ * harness's `reply`) */ reply?: Reply;
27
+ } & ChildLimits) => Tool[];
28
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sources":["../tools.ts"],"names":[],"mappings":"AAGA,cAAc,KAAK,2BAAgC;AAOnD,SAAS,KAAK,KAAK,0BAA2C;AAuB9D,SAAmB,KAAK,eAAe,gCAA+B;AACtE,cAGE,MAAM,EACN,KAAK,EACL,QAAQ,SAAS,2BACY;AAM/B,SAAiC,KAAK,UAAU,qCAA0C;AAC1F,SACE,KAAK,WAAW,EAGhB,KAAK,IAAI,6BAGsB;AAgBjC;;;;;CAKC,GACD,OAAO,YAAI,aACT,GAAG,OACH;EACE,QAAQ,SAAS,IAAI;EACrB,QAAQ;EACR,QAAQ;MAET,OAsDF;AA2DD;;kEAEkE,GAClE,OAAO,YAAI,eACT,GAAG,OACH;EAEI,MAAM,MAAM;EACZ,gEAAgE,GAChE,YAAY;EACZ,kDAAkD,GAClD,WAAW;EACX,aAAa;EACb,mBAAmB,OAAO;EAC1B;4BACsB,GACtB,QAAQ;IAER,gBACH,OAiGF"}
@@ -0,0 +1,5 @@
1
+ import type { ComponentRenderer } from "@yaks/react";
2
+ import { type Registry } from "@yaks/render";
3
+ /** The views a terminal holds a harness answer with. */ export declare let views: Registry<ComponentRenderer>;
4
+ /** Open the harness without creating or selecting a session. */ export declare let open: (config: string) => Promise<void>;
5
+ //# sourceMappingURL=view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view.d.ts","sources":["../view.ts"],"names":[],"mappings":"AAgBA,cAAc,iBAAiB,2BAAgC;AAE/D,SAAiB,KAAK,QAAQ,4BAAiC;AA2E/D,sDAAsD,GACtD,OAAO,YAAI,OAAO,SAAS,mBAGzB;AAEF,8DAA8D,GAC9D,OAAO,YAAI,OAAQ,QAAQ,MAAM,KAAG,QAAQ,IAAI,EACK"}
@@ -0,0 +1,7 @@
1
+ import { type VocabDoc } from "@yaks/vocab/runtime";
2
+ export declare let homeDoc: VocabDoc;
3
+ export declare let harnessDoc: VocabDoc;
4
+ /** What this package is: its manifest's description, the one place it is
5
+ * written, which a host stamps on each document here. */ export declare let description: string;
6
+ /** The harness's own words: the `home` a session works from, and its tools. */ export declare let docs: VocabDoc[];
7
+ //# sourceMappingURL=vocab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocab.d.ts","sources":["../vocab.ts"],"names":[],"mappings":"AAMA,SAAe,KAAK,QAAQ,mCAAwC;AAIpE,OAAO,YAAI,SAAS,SAA8C;AAClE,OAAO,YAAI,YAAY,SAGtB;AAED;uDACuD,GACvD,OAAO,YAAI,aAAa,MAAM,CAAuB;AAErD,6EAA6E,GAC7E,OAAO,YAAI,MAAM,WAAkC"}
@@ -0,0 +1,52 @@
1
+ import type { Bundle, Eid, Graph, NamedTool } from "@yaks/graph";
2
+ import { type Reads } from "@yaks/persona";
3
+ /** What a transcript is opened as: the persona it wears and the topic it is
4
+ * opened on, with the project it is filed under and the directory it works
5
+ * in where this graph keeps those. */ export type Opened = {
6
+ persona?: Eid;
7
+ topic?: Eid;
8
+ project?: Eid;
9
+ cwd?: string;
10
+ };
11
+ /** What a transcript is opened as: its own `session{persona, topic}`, else
12
+ * those of the session that started it, since a fork or a helper works as the
13
+ * one that started it does. */ export declare let openedAs: (g: Graph, session: Eid) => Promise<Opened>;
14
+ /** The persona a transcript wears ({@link openedAs}). */ export declare let personaOf: (g: Graph, session: Eid) => Promise<Eid | undefined>;
15
+ /** How a transcript's persona is worn: where its bases (`persona.base`) are
16
+ * kept when this graph does not keep them, whether the tree of the topic it
17
+ * is opened on follows the persona's text, and whether the tools the persona
18
+ * contains are all the transcript is offered. */ export type Wear = {
19
+ bases?: Reads;
20
+ topic?: boolean;
21
+ tools?: boolean;
22
+ };
23
+ /** What a transcript wears, as text: its persona ({@link openedAs}), its
24
+ * bases read from `how.bases` (@yaks/persona `wear`), and where `how.topic`
25
+ * asks, the tree of the topic it is opened on after it (@yaks/topic
26
+ * `compile`). Undefined where it wears no persona and is opened on no topic.
27
+ * Read on each call, so an edit to the persona, a base or the topic reaches a
28
+ * transcript on its next ask. */ export declare let wornBy: (g: Graph, session: Eid, how?: Wear) => Promise<string | undefined>;
29
+ /** The shared base and what this session wears over it, in prompt order.
30
+ * Only the configured base can start the shared prefix. */ export declare let wornLayers: (g: Graph, session: Eid, how: Wear, shared: Eid) => Promise<{
31
+ shared?: string;
32
+ local?: string;
33
+ }>;
34
+ /** The names of the tools a transcript is offered by the persona it wears
35
+ * ({@link openedAs}, @yaks/persona `offer`): the registered tools it contains,
36
+ * itself or through a persona it includes or is said with. Undefined where it
37
+ * wears none or its persona contains none, which leaves the runner's own set.
38
+ * Read on each call, so a tool the persona gains reaches a transcript on its
39
+ * next ask. */ export declare let offeredTo: (g: Graph, session: Eid, how?: Wear) => Promise<string[] | undefined>;
40
+ /** The Reads a transcript's persona names ({@link openedAs}): the documents
41
+ * it, or a base under it, links by `reads`, each read where it is kept. */ export declare let readsOf: (g: Graph, session: Eid, how?: Wear) => Promise<Bundle[]>;
42
+ /** The Read among `names` that `asked` names: by its id or title, or,
43
+ * `loosely`, by its id and more words or the start of its title. */ export declare let readAt: (g: Graph, names: Bundle[], asked: string, loosely?: boolean) => Bundle | undefined;
44
+ /** A Read as one text: its id and title as a heading, then its body. */ export declare let readText: (g: Graph, b: Bundle) => string;
45
+ /**
46
+ * The tool that opens one of the Reads a transcript's persona names (its
47
+ * `reads` documents, @yaks/persona `voice`'s `## Reads`) in full, by the id
48
+ * the text gives it or its title, read where it is kept: the transcript's own
49
+ * graph or `how.bases`. Only the persona's Reads open, so it reaches nothing
50
+ * else of where the bases are kept.
51
+ */ export declare let readOpen: (how?: Wear) => NamedTool;
52
+ //# sourceMappingURL=worn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worn.d.ts","sources":["../worn.ts"],"names":[],"mappings":"AAIA,cAAc,MAAM,EAAQ,GAAG,EAAE,KAAK,EAAE,SAAS,2BAAgC;AAKjF,SAKE,KAAK,KAAK,6BAKqB;AAOjC;;oCAEoC,GACpC,YAAY;EACV,UAAU;EACV,QAAQ;EACR,UAAU;EACV,MAAM,MAAM;;AAGd;;6BAE6B,GAC7B,OAAO,YAAI,WAAkB,GAAG,OAAO,SAAS,QAAM,QAAQ,QA8B7D;AAED,uDAAuD,GACvD,OAAO,YAAI,YACT,GAAG,OACH,SAAS,QACR,QAAQ,MAAM,SAAS,EAAyC;AAEnE;;;+CAG+C,GAC/C,YAAY;EAAS,QAAQ;EAAO,QAAQ,OAAO;EAAE,QAAQ,OAAO;;AAepE;;;;;+BAK+B,GAC/B,OAAO,YAAI,SACT,GAAG,OACH,SAAS,KACT,MAAK,SACJ,QAAQ,MAAM,GAAG,SAAS,EAU5B;AAED;yDACyD,GACzD,OAAO,YAAI,aACT,GAAG,OACH,SAAS,KACT,KAAK,MACL,QAAQ,QACP;EAAU,SAAS,MAAM;EAAE,QAAQ,MAAM;GAe3C;AAED;;;;;aAKa,GACb,OAAO,YAAI,YACT,GAAG,OACH,SAAS,KACT,MAAK,SACJ,QAAQ,MAAM,KAAK,SAAS,EAC8B;AAY7D;yEACyE,GACzE,OAAO,YAAI,UACT,GAAG,OACH,SAAS,KACT,MAAK,SACJ,QAAQ,UAC0D;AAErE;kEACkE,GAClE,OAAO,YAAI,SACT,GAAG,OACH,OAAO,UACP,OAAO,MAAM,EACb,sBACC,SAAS,SAAS,CAUpB;AAED,sEAAsE,GACtE,OAAO,YAAI,WAAY,GAAG,OAAO,GAAG,WAAS,MAAM,CAIlD;AAED;;;;;;CAMC,GACD,OAAO,YAAI,WAAY,MAAK,SAAY,UAsCtC"}