@owlmeans/viable-sdk 0.1.18-rc.1

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 (166) hide show
  1. package/README.md +128 -0
  2. package/build/api/index.d.ts +2 -0
  3. package/build/api/index.d.ts.map +1 -0
  4. package/build/api/index.js +2 -0
  5. package/build/api/index.js.map +1 -0
  6. package/build/api/remote.d.ts +14 -0
  7. package/build/api/remote.d.ts.map +1 -0
  8. package/build/api/remote.js +123 -0
  9. package/build/api/remote.js.map +1 -0
  10. package/build/consts.d.ts +47 -0
  11. package/build/consts.d.ts.map +1 -0
  12. package/build/consts.js +47 -0
  13. package/build/consts.js.map +1 -0
  14. package/build/context/index.d.ts +22 -0
  15. package/build/context/index.d.ts.map +1 -0
  16. package/build/context/index.js +92 -0
  17. package/build/context/index.js.map +1 -0
  18. package/build/errors.d.ts +21 -0
  19. package/build/errors.d.ts.map +1 -0
  20. package/build/errors.js +36 -0
  21. package/build/errors.js.map +1 -0
  22. package/build/executor/boot-check.d.ts +73 -0
  23. package/build/executor/boot-check.d.ts.map +1 -0
  24. package/build/executor/boot-check.js +155 -0
  25. package/build/executor/boot-check.js.map +1 -0
  26. package/build/executor/env.d.ts +25 -0
  27. package/build/executor/env.d.ts.map +1 -0
  28. package/build/executor/env.js +77 -0
  29. package/build/executor/env.js.map +1 -0
  30. package/build/executor/errors.d.ts +69 -0
  31. package/build/executor/errors.d.ts.map +1 -0
  32. package/build/executor/errors.js +80 -0
  33. package/build/executor/errors.js.map +1 -0
  34. package/build/executor/files.d.ts +124 -0
  35. package/build/executor/files.d.ts.map +1 -0
  36. package/build/executor/files.js +529 -0
  37. package/build/executor/files.js.map +1 -0
  38. package/build/executor/git.d.ts +52 -0
  39. package/build/executor/git.d.ts.map +1 -0
  40. package/build/executor/git.js +353 -0
  41. package/build/executor/git.js.map +1 -0
  42. package/build/executor/health.d.ts +92 -0
  43. package/build/executor/health.d.ts.map +1 -0
  44. package/build/executor/health.js +98 -0
  45. package/build/executor/health.js.map +1 -0
  46. package/build/executor/index.d.ts +39 -0
  47. package/build/executor/index.d.ts.map +1 -0
  48. package/build/executor/index.js +173 -0
  49. package/build/executor/index.js.map +1 -0
  50. package/build/executor/integrity.d.ts +17 -0
  51. package/build/executor/integrity.d.ts.map +1 -0
  52. package/build/executor/integrity.js +59 -0
  53. package/build/executor/integrity.js.map +1 -0
  54. package/build/executor/layout.d.ts +61 -0
  55. package/build/executor/layout.d.ts.map +1 -0
  56. package/build/executor/layout.js +98 -0
  57. package/build/executor/layout.js.map +1 -0
  58. package/build/executor/shell.d.ts +89 -0
  59. package/build/executor/shell.d.ts.map +1 -0
  60. package/build/executor/shell.js +280 -0
  61. package/build/executor/shell.js.map +1 -0
  62. package/build/executor/spawn.d.ts +111 -0
  63. package/build/executor/spawn.d.ts.map +1 -0
  64. package/build/executor/spawn.js +314 -0
  65. package/build/executor/spawn.js.map +1 -0
  66. package/build/harness/index.d.ts +28 -0
  67. package/build/harness/index.d.ts.map +1 -0
  68. package/build/harness/index.js +83 -0
  69. package/build/harness/index.js.map +1 -0
  70. package/build/harness/templates.d.ts +30 -0
  71. package/build/harness/templates.d.ts.map +1 -0
  72. package/build/harness/templates.js +162 -0
  73. package/build/harness/templates.js.map +1 -0
  74. package/build/index.d.ts +13 -0
  75. package/build/index.d.ts.map +1 -0
  76. package/build/index.js +12 -0
  77. package/build/index.js.map +1 -0
  78. package/build/project/env.d.ts +108 -0
  79. package/build/project/env.d.ts.map +1 -0
  80. package/build/project/env.js +233 -0
  81. package/build/project/env.js.map +1 -0
  82. package/build/project/marker.d.ts +34 -0
  83. package/build/project/marker.d.ts.map +1 -0
  84. package/build/project/marker.js +54 -0
  85. package/build/project/marker.js.map +1 -0
  86. package/build/project/setup.d.ts +62 -0
  87. package/build/project/setup.d.ts.map +1 -0
  88. package/build/project/setup.js +190 -0
  89. package/build/project/setup.js.map +1 -0
  90. package/build/run/index.d.ts +75 -0
  91. package/build/run/index.d.ts.map +1 -0
  92. package/build/run/index.js +150 -0
  93. package/build/run/index.js.map +1 -0
  94. package/build/run/serve.d.ts +18 -0
  95. package/build/run/serve.d.ts.map +1 -0
  96. package/build/run/serve.js +148 -0
  97. package/build/run/serve.js.map +1 -0
  98. package/build/run/state.d.ts +75 -0
  99. package/build/run/state.d.ts.map +1 -0
  100. package/build/run/state.js +136 -0
  101. package/build/run/state.js.map +1 -0
  102. package/build/session/index.d.ts +17 -0
  103. package/build/session/index.d.ts.map +1 -0
  104. package/build/session/index.js +226 -0
  105. package/build/session/index.js.map +1 -0
  106. package/build/session/questions.d.ts +16 -0
  107. package/build/session/questions.d.ts.map +1 -0
  108. package/build/session/questions.js +17 -0
  109. package/build/session/questions.js.map +1 -0
  110. package/build/session/queue.d.ts +54 -0
  111. package/build/session/queue.d.ts.map +1 -0
  112. package/build/session/queue.js +102 -0
  113. package/build/session/queue.js.map +1 -0
  114. package/build/session/tasks.d.ts +15 -0
  115. package/build/session/tasks.d.ts.map +1 -0
  116. package/build/session/tasks.js +16 -0
  117. package/build/session/tasks.js.map +1 -0
  118. package/build/task/driver.d.ts +30 -0
  119. package/build/task/driver.d.ts.map +1 -0
  120. package/build/task/driver.js +120 -0
  121. package/build/task/driver.js.map +1 -0
  122. package/build/task/envelope.d.ts +35 -0
  123. package/build/task/envelope.d.ts.map +1 -0
  124. package/build/task/envelope.js +230 -0
  125. package/build/task/envelope.js.map +1 -0
  126. package/build/task/index.d.ts +4 -0
  127. package/build/task/index.d.ts.map +1 -0
  128. package/build/task/index.js +4 -0
  129. package/build/task/index.js.map +1 -0
  130. package/build/task/inquiry.d.ts +53 -0
  131. package/build/task/inquiry.d.ts.map +1 -0
  132. package/build/task/inquiry.js +232 -0
  133. package/build/task/inquiry.js.map +1 -0
  134. package/build/tools/catalogue.d.ts +17 -0
  135. package/build/tools/catalogue.d.ts.map +1 -0
  136. package/build/tools/catalogue.js +1169 -0
  137. package/build/tools/catalogue.js.map +1 -0
  138. package/build/tools/index.d.ts +7 -0
  139. package/build/tools/index.d.ts.map +1 -0
  140. package/build/tools/index.js +7 -0
  141. package/build/tools/index.js.map +1 -0
  142. package/build/tools/jobs.d.ts +12 -0
  143. package/build/tools/jobs.d.ts.map +1 -0
  144. package/build/tools/jobs.js +60 -0
  145. package/build/tools/jobs.js.map +1 -0
  146. package/build/tools/mcp.d.ts +43 -0
  147. package/build/tools/mcp.d.ts.map +1 -0
  148. package/build/tools/mcp.js +131 -0
  149. package/build/tools/mcp.js.map +1 -0
  150. package/build/tools/platform.d.ts +77 -0
  151. package/build/tools/platform.d.ts.map +1 -0
  152. package/build/tools/platform.js +316 -0
  153. package/build/tools/platform.js.map +1 -0
  154. package/build/tools/refusal.d.ts +66 -0
  155. package/build/tools/refusal.d.ts.map +1 -0
  156. package/build/tools/refusal.js +377 -0
  157. package/build/tools/refusal.js.map +1 -0
  158. package/build/tools/types.d.ts +83 -0
  159. package/build/tools/types.d.ts.map +1 -0
  160. package/build/tools/types.js +38 -0
  161. package/build/tools/types.js.map +1 -0
  162. package/build/types.d.ts +174 -0
  163. package/build/types.d.ts.map +1 -0
  164. package/build/types.js +2 -0
  165. package/build/types.js.map +1 -0
  166. package/package.json +105 -0
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Operations waiting for the parent agent — the model calls it performs, and the questions it
3
+ * puts to a person.
4
+ *
5
+ * A queue rather than a callback because of who drains it: the parent agent asks for work when it
6
+ * is ready, through a tool call, and may take minutes to answer. Nothing here pushes — the whole
7
+ * point of the local-LLM mode is that the platform waits on somebody else's schedule, and a
8
+ * question waits on a slower schedule still.
9
+ *
10
+ * Generic over the payload rather than copied per kind: both of them are handed out once, both are
11
+ * redelivered by the platform until they are answered, and both route their answer back on an
12
+ * operation id. A second copy of these rules is a second place for the redelivery guard to be
13
+ * forgotten, and the symptom of forgetting it is real model calls paid for and thrown away.
14
+ *
15
+ * The operation id is kept beside each item and never shown to the parent. It is what an answer is
16
+ * routed back on, and a parent that could name one could answer an operation it was never given.
17
+ */
18
+ export class OpQueue {
19
+ queue = [];
20
+ ops = new Map();
21
+ /**
22
+ * Every item this session has ever been handed.
23
+ *
24
+ * The platform redelivers an operation on every poll until it is answered — that is what makes a
25
+ * connector restart cost a round trip instead of a run. A model task takes a parent agent tens of
26
+ * seconds to answer, so without this the queue grew one copy per poll for the whole time it was
27
+ * being answered, and the parent then ran the same task over and over: real model calls, paid
28
+ * for, thrown away. Kept after settling too, so a redelivery that raced the platform's deletion
29
+ * is ignored rather than answered a second time.
30
+ */
31
+ seen = new Set();
32
+ /**
33
+ * Handed out and not yet answered. An answer is checked against the item that asked for it.
34
+ *
35
+ * Named `held` rather than `outstanding` so the public reading of it can carry that name: the
36
+ * two subclasses expose it as `outstandingTasks()` / `outstandingQuestions()`, and a field and
37
+ * a method cannot share one name.
38
+ */
39
+ held = new Map();
40
+ waiting = [];
41
+ /** @returns whether the item was accepted — `false` for a redelivery of one already handed over. */
42
+ push(item, opId) {
43
+ // The op id is refreshed even for a known item: a redelivery carries the same id today, and
44
+ // answering the wrong operation is worse than answering none.
45
+ this.ops.set(item.id, opId);
46
+ if (this.seen.has(item.id))
47
+ return false;
48
+ this.seen.add(item.id);
49
+ const next = this.waiting.shift();
50
+ if (next != null) {
51
+ clearTimeout(next.timer);
52
+ next.resolve(item);
53
+ return true;
54
+ }
55
+ this.queue.push(item);
56
+ return true;
57
+ }
58
+ /** The next item, or null once `waitMs` elapses. Never rejects: nothing to do is not a failure. */
59
+ async take(waitMs) {
60
+ const ready = this.queue.shift();
61
+ if (ready != null) {
62
+ this.held.set(ready.id, ready);
63
+ return ready;
64
+ }
65
+ if (waitMs <= 0)
66
+ return null;
67
+ return await new Promise(resolve => {
68
+ const entry = {
69
+ resolve: item => {
70
+ if (item != null)
71
+ this.held.set(item.id, item);
72
+ resolve(item);
73
+ },
74
+ timer: setTimeout(() => {
75
+ const at = this.waiting.indexOf(entry);
76
+ if (at >= 0)
77
+ this.waiting.splice(at, 1);
78
+ resolve(null);
79
+ }, waitMs),
80
+ };
81
+ this.waiting.push(entry);
82
+ });
83
+ }
84
+ opIdOf(id) {
85
+ return this.ops.get(id) ?? null;
86
+ }
87
+ outstandingById(id) {
88
+ return this.held.get(id) ?? null;
89
+ }
90
+ /** Handed out and still unanswered, oldest first. */
91
+ outstanding() {
92
+ return [...this.held.values()];
93
+ }
94
+ settle(id) {
95
+ this.ops.delete(id);
96
+ this.held.delete(id);
97
+ }
98
+ size() {
99
+ return this.queue.length;
100
+ }
101
+ }
102
+ //# sourceMappingURL=queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/session/queue.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,OAAO;IACD,KAAK,GAAQ,EAAE,CAAA;IACf,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAA;IAChD;;;;;;;;;OASG;IACc,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IACzC;;;;;;OAMG;IACc,IAAI,GAAG,IAAI,GAAG,EAAa,CAAA;IAC3B,OAAO,GAAsB,EAAE,CAAA;IAEhD,oGAAoG;IACpG,IAAI,CAAC,IAAO,EAAE,IAAY;QACxB,4FAA4F;QAC5F,8DAA8D;QAC9D,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QAC3B,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,OAAO,KAAK,CAAA;QACxC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;QACjC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAA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I,IAAI,CAAA;IACjC,CAAC;IAED,eAAe,CAAC,EAAU;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAA;IAClC,CAAC;IAED,qDAAqD;IACrD,WAAW;QACT,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAChC,CAAC;IAED,MAAM,CAAC,EAAU;QACf,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACtB,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAA;IAC1B,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import type { ModelTask } from '@owlmeans/viable-common';
2
+ import { OpQueue } from './queue.js';
3
+ /**
4
+ * Model tasks waiting for the parent agent.
5
+ *
6
+ * Everything about how they queue, redeliver and settle is {@link OpQueue}'s; what is left here is
7
+ * the name the rest of the SDK reads them under. A task is a model CALL — the parent runs it in a
8
+ * clean subagent and submits the answer back — which is a different thing from a question, and the
9
+ * two must never drain into one another's tools.
10
+ */
11
+ export declare class TaskQueue extends OpQueue<ModelTask> {
12
+ /** Handed to the parent and still unanswered, oldest first. */
13
+ outstandingTasks(): ModelTask[];
14
+ }
15
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/session/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC;;;;;;;GAOG;AACH,qBAAa,SAAU,SAAQ,OAAO,CAAC,SAAS,CAAC;IAC/C,+DAA+D;IAC/D,gBAAgB,IAAI,SAAS,EAAE,CAE9B;CACF"}
@@ -0,0 +1,16 @@
1
+ import { OpQueue } from './queue.js';
2
+ /**
3
+ * Model tasks waiting for the parent agent.
4
+ *
5
+ * Everything about how they queue, redeliver and settle is {@link OpQueue}'s; what is left here is
6
+ * the name the rest of the SDK reads them under. A task is a model CALL — the parent runs it in a
7
+ * clean subagent and submits the answer back — which is a different thing from a question, and the
8
+ * two must never drain into one another's tools.
9
+ */
10
+ export class TaskQueue extends OpQueue {
11
+ /** Handed to the parent and still unanswered, oldest first. */
12
+ outstandingTasks() {
13
+ return this.outstanding();
14
+ }
15
+ }
16
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/session/tasks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC;;;;;;;GAOG;AACH,MAAM,OAAO,SAAU,SAAQ,OAAkB;IAC/C,+DAA+D;IAC/D,gBAAgB;QACd,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;CACF"}
@@ -0,0 +1,30 @@
1
+ import type { ModelTask, ModelTaskResult } from '@owlmeans/viable-common';
2
+ /**
3
+ * Something that can answer a model task without a coding agent in front of it.
4
+ *
5
+ * Two consumers, and both are the reason it is an interface rather than a function on the session:
6
+ * the end-to-end tests, which have to play the parent agent deterministically, and the CLI this
7
+ * SDK exists to make possible, where the "parent agent" is the CLI's own model.
8
+ */
9
+ export interface TaskDriver {
10
+ answer: (task: ModelTask) => Promise<ModelTaskResult>;
11
+ }
12
+ /** The minimum a chat model must offer to stand in for a parent agent. */
13
+ export interface DriverModel {
14
+ invoke: (messages: Array<{
15
+ role: string;
16
+ content: string;
17
+ }>) => Promise<string>;
18
+ }
19
+ export interface LangchainLikeModel {
20
+ invoke: (messages: unknown) => Promise<{
21
+ content: unknown;
22
+ }>;
23
+ bindTools?: (tools: unknown[], kwargs?: unknown) => LangchainLikeModel;
24
+ }
25
+ export interface ModelDriverOptions {
26
+ /** One model per tier. A tier with no model falls back to the first one given. */
27
+ models: Partial<Record<string, LangchainLikeModel>>;
28
+ }
29
+ export declare const makeModelTaskDriver: (opts: ModelDriverOptions) => TaskDriver;
30
+ //# sourceMappingURL=driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/task/driver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzE;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;CACtD;AAED,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAChF;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IAC5D,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,kBAAkB,CAAA;CACvE;AAED,MAAM,WAAW,kBAAkB;IACjC,kFAAkF;IAClF,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAA;CACpD;AA8DD,eAAO,MAAM,mBAAmB,SAAU,kBAAkB,KAAG,UAwE9D,CAAA"}
@@ -0,0 +1,120 @@
1
+ import { ModelTaskMode, ModelTaskResultKind, ModelTaskRole } from '@owlmeans/viable-common';
2
+ const textOf = (content) => typeof content === 'string'
3
+ ? content
4
+ : Array.isArray(content)
5
+ ? content.map(part => part.text ?? '').join('')
6
+ : String(content ?? '');
7
+ const ROLE_TO_LC = {
8
+ [ModelTaskRole.System]: 'system',
9
+ [ModelTaskRole.User]: 'user',
10
+ [ModelTaskRole.Assistant]: 'assistant',
11
+ // A chat model called without the tool definitions cannot receive a tool turn; the content is
12
+ // what mattered anyway, and presenting it as a user turn keeps the conversation readable.
13
+ [ModelTaskRole.Tool]: 'user',
14
+ };
15
+ /**
16
+ * A reference parent agent, backed by a chat model.
17
+ *
18
+ * It does what the envelope asks a real parent to do — run the task in isolation, produce exactly
19
+ * the shape requested — with the instruction written as a system message rather than as guidance
20
+ * to a human-facing agent. What it is NOT is a second implementation of the protocol: it consumes
21
+ * the same `ModelTask` a coding agent receives and produces the same `ModelTaskResult`, so a test
22
+ * driven by it exercises the platform's half exactly as a real one would.
23
+ */
24
+ /**
25
+ * The tool calls in an answer, or `null` when it carries none.
26
+ *
27
+ * Three shapes rather than one, because models produce three: the documented array, a bare object
28
+ * for a single call, and an array wrapped under `tool_calls`. Assuming the array threw
29
+ * `parsed.map is not a function`, the TypeError was handed back AS the answer, and the model ladder
30
+ * retried against feedback that said nothing about what was wrong.
31
+ *
32
+ * `null` rather than a throw for an answer with no call in it: a model with tools bound says it is
33
+ * finished by NOT calling one, and refusing that stalls the agent loop it was ending.
34
+ */
35
+ const toolCallsOf = (parsed) => {
36
+ const wrapper = parsed;
37
+ const list = Array.isArray(parsed)
38
+ ? parsed
39
+ : Array.isArray(wrapper?.tool_calls)
40
+ ? wrapper.tool_calls
41
+ : Array.isArray(wrapper?.toolCalls)
42
+ ? wrapper.toolCalls
43
+ : typeof parsed?.name === 'string'
44
+ ? [parsed]
45
+ : null;
46
+ if (list == null || list.length < 1)
47
+ return null;
48
+ return list.map(call => {
49
+ if (typeof call?.name !== 'string') {
50
+ throw new SyntaxError('a tool call must carry a "name"');
51
+ }
52
+ return { name: call.name, args: call.args ?? {} };
53
+ });
54
+ };
55
+ export const makeModelTaskDriver = (opts) => {
56
+ const pick = (tier) => {
57
+ const chosen = tier != null ? opts.models[tier] : undefined;
58
+ const fallback = Object.values(opts.models).find(model => model != null);
59
+ const model = chosen ?? fallback;
60
+ if (model == null)
61
+ throw new Error('the task driver was given no models');
62
+ return model;
63
+ };
64
+ return {
65
+ answer: async (task) => {
66
+ const instruction = task.mode === ModelTaskMode.Json
67
+ ? 'Answer with exactly one JSON object matching this schema, and nothing else — no prose, '
68
+ + `no code fence:\n${JSON.stringify(task.outputSchema ?? {})}`
69
+ : task.mode === ModelTaskMode.Tools
70
+ ? 'Answer with a JSON array of tool calls ({"name","args"}) and nothing else, OR — if no'
71
+ + ' tool call is needed and the work is done — with plain text:\n'
72
+ + JSON.stringify(task.tools ?? [])
73
+ : 'Answer with plain text.';
74
+ const messages = [
75
+ ...(task.system != null ? [{ role: 'system', content: task.system }] : []),
76
+ ...task.messages.map(message => ({
77
+ role: ROLE_TO_LC[message.role],
78
+ content: message.content,
79
+ })),
80
+ { role: 'system', content: instruction },
81
+ ...(task.feedback != null
82
+ ? [{ role: 'system', content: `The previous answer was refused: ${task.feedback}` }]
83
+ : []),
84
+ ];
85
+ try {
86
+ const answer = await pick(task.tier).invoke(messages);
87
+ const text = textOf(answer.content);
88
+ if (task.mode === ModelTaskMode.Text) {
89
+ return { taskId: task.id, kind: ModelTaskResultKind.Text, text };
90
+ }
91
+ const body = text.trim().replace(/^```[a-zA-Z]*\n?/, '').replace(/```\s*$/, '').trim();
92
+ let parsed;
93
+ try {
94
+ parsed = JSON.parse(body);
95
+ }
96
+ catch (e) {
97
+ // Prose where tools were offered is the model saying it is done, not a bad answer.
98
+ if (task.mode === ModelTaskMode.Tools) {
99
+ return { taskId: task.id, kind: ModelTaskResultKind.Text, text };
100
+ }
101
+ throw e;
102
+ }
103
+ if (task.mode === ModelTaskMode.Json) {
104
+ return { taskId: task.id, kind: ModelTaskResultKind.Json, json: parsed };
105
+ }
106
+ const calls = toolCallsOf(parsed);
107
+ return calls == null
108
+ ? { taskId: task.id, kind: ModelTaskResultKind.Text, text }
109
+ : { taskId: task.id, kind: ModelTaskResultKind.ToolCalls, toolCalls: calls };
110
+ }
111
+ catch (e) {
112
+ // Reported rather than thrown: the platform treats a reported failure as a bad answer and
113
+ // asks again with the reason, which is the behaviour a real parent agent would produce
114
+ // when its subagent came back with nothing usable.
115
+ return { taskId: task.id, kind: ModelTaskResultKind.Error, error: e.message };
116
+ }
117
+ },
118
+ };
119
+ };
120
+ //# sourceMappingURL=driver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.js","sourceRoot":"","sources":["../../src/task/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AA6B3F,MAAM,MAAM,GAAG,CAAC,OAAgB,EAAU,EAAE,CAAC,OAAO,OAAO,KAAK,QAAQ;IACtE,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QACtB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAE,IAA0B,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;AAE3B,MAAM,UAAU,GAAkC;IAChD,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ;IAChC,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM;IAC5B,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,WAAW;IACtC,8FAA8F;IAC9F,0FAA0F;IAC1F,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM;CAC7B,CAAA;AAED;;;;;;;;GAQG;AACH;;;;;;;;;;GAUG;AACH,MAAM,WAAW,GAAG,CAClB,MAAe,EACgD,EAAE;IACjE,MAAM,OAAO,GAAG,MAA8D,CAAA;IAC9E,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MA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EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE;oBAC3D,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;YAChF,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,0FAA0F;gBAC1F,uFAAuF;gBACvF,mDAAmD;gBACnD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAG,CAAW,CAAC,OAAO,EAAE,CAAA;YAC1F,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,35 @@
1
+ import { ConnectHarness } from '@owlmeans/viable-common';
2
+ import type { ModelTask, ModelTaskResult } from '@owlmeans/viable-common';
3
+ export interface EnvelopeOptions {
4
+ harness: ConnectHarness;
5
+ /** What the parent said it would run each tier on. Display only. */
6
+ tiers?: Partial<Record<string, string>>;
7
+ }
8
+ /**
9
+ * What `next_task` hands the parent agent.
10
+ *
11
+ * Text rather than a structure, because the reader is a language model working from a tool result:
12
+ * it has to be able to act on this without a schema in front of it. Everything it must do is
13
+ * stated in order — how to run it, what to call afterwards, what shape the answer takes — before
14
+ * the material itself, so a model that stops reading early has still read the instruction.
15
+ *
16
+ * The task id appears at the top and in the follow-up call on purpose. It is the only thing that
17
+ * routes an answer back, and a parent that paraphrases the rest but copies the id still works.
18
+ */
19
+ export declare const renderTaskEnvelope: (task: ModelTask, opts: EnvelopeOptions) => string;
20
+ export interface ParsedTaskResult {
21
+ result?: ModelTaskResult;
22
+ /** Present when the answer did not match what was asked. Quoted back to the parent verbatim. */
23
+ problem?: string;
24
+ }
25
+ /**
26
+ * Check a parent's answer against what the task asked for, before the platform ever sees it.
27
+ *
28
+ * The refusal is worth more than the parse. A malformed answer that reaches the platform costs a
29
+ * whole retry — another task, another subagent, another wait — while one caught here is a sentence
30
+ * the parent can act on immediately, with the subagent's context still open. So a failure comes
31
+ * back as a `problem`, not as a thrown error, and the caller renders it as a tool error the model
32
+ * reads and corrects.
33
+ */
34
+ export declare const parseTaskResult: (task: ModelTask, raw: unknown) => ParsedTaskResult;
35
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/task/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqD,MAAM,yBAAyB,CAAA;AAC3G,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AA4DzE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,oEAAoE;IACpE,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACxC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,SAAU,SAAS,QAAQ,eAAe,KAAG,MAgD3E,CAAA;AAWD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAiDD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,SACpB,SAAS,OAAO,OAAO,KAC5B,gBAqEF,CAAA"}
@@ -0,0 +1,230 @@
1
+ import { ConnectHarness, ModelTaskMode, ModelTaskResultKind, ModelTaskRole } from '@owlmeans/viable-common';
2
+ import Ajv from 'ajv';
3
+ /**
4
+ * How each parent agent is told to run a task in a CLEAN subagent.
5
+ *
6
+ * The instruction differs per harness only in the mechanism — which tool spawns a subagent, what
7
+ * the effort knob is called — never in what is being asked. A harness with no subagent mechanism
8
+ * Every one of them carries the inline fallback, which is the same request with the isolation
9
+ * stated rather than enforced. None may assert that the worker EXISTS: `install_harness` is what
10
+ * writes it, nothing in the flow requires that to have been run, and a block that names a file as
11
+ * a fact sends a literal agent to a subagent type it does not have — on the first task, before it
12
+ * has done anything.
13
+ */
14
+ const HOW_TO_RUN = {
15
+ [ConnectHarness.ClaudeCode]: 'Use the Agent tool with subagent_type "viable-worker", which install_harness writes to\n'
16
+ + '.claude/agents/viable-worker.md with effort: low. If that subagent is not installed, either\n'
17
+ + 'call install_harness now or answer INLINE: reason minimally and produce only the answer.\n'
18
+ + 'Give the worker the SYSTEM PROMPT as its opening instruction, then the CONVERSATION in\n'
19
+ + 'order, then the shape rule below. Take its final message verbatim.',
20
+ [ConnectHarness.Codex]: 'Spawn a subagent with the "viable-worker" role, which install_harness writes to config.toml\n'
21
+ + 'as `[agents.viable-worker]` with a low model_reasoning_effort. If it is not installed or\n'
22
+ + 'your session has no subagents, answer the task INLINE in a single reply: reason minimally,\n'
23
+ + 'produce only the answer in the required shape, and nothing else.',
24
+ [ConnectHarness.Copilot]: 'Delegate to the "viable-worker" custom agent, which install_harness writes to\n'
25
+ + '.github/agents/viable-worker.agent.md. If it is not installed or delegation is\n'
26
+ + 'unavailable, answer the task INLINE in a single reply: reason minimally and produce only\n'
27
+ + 'the answer in the required shape.',
28
+ [ConnectHarness.OpenCode]: 'Invoke the `viable-worker` subagent (@viable-worker, or the Task tool), which install_harness\n'
29
+ + 'writes to .opencode/agent/viable-worker.md. If it is not installed, answer INLINE instead:\n'
30
+ + 'reason minimally and produce only the answer. Give the worker the SYSTEM PROMPT, then the\n'
31
+ + 'CONVERSATION, then the shape rule below.',
32
+ [ConnectHarness.Other]: 'Run this in a fresh, isolated context — not in this conversation. Reason minimally. Produce\n'
33
+ + 'only the answer in the required shape.',
34
+ };
35
+ const SHAPE = {
36
+ [ModelTaskMode.Text]: 'The answer is plain text. Send it as the `result` string, verbatim.',
37
+ [ModelTaskMode.Json]: 'The answer must be ONE JSON object matching the OUTPUT SCHEMA below — no prose, no code fence,\n'
38
+ + 'no explanation. Send it as `result`.',
39
+ [ModelTaskMode.Tools]: 'Answer with a JSON array of tool calls chosen from the TOOLS below, each\n'
40
+ + '{"name": "...", "args": {...}} — nothing else around it. If no tool call is needed and the\n'
41
+ + 'work is done, answer in plain text instead: that is how the caller learns the turn is over.\n'
42
+ + 'Send whichever it is as `result`.',
43
+ };
44
+ const ROLE_LABEL = {
45
+ [ModelTaskRole.System]: 'system',
46
+ [ModelTaskRole.User]: 'user',
47
+ [ModelTaskRole.Assistant]: 'assistant',
48
+ [ModelTaskRole.Tool]: 'tool',
49
+ };
50
+ /**
51
+ * What `next_task` hands the parent agent.
52
+ *
53
+ * Text rather than a structure, because the reader is a language model working from a tool result:
54
+ * it has to be able to act on this without a schema in front of it. Everything it must do is
55
+ * stated in order — how to run it, what to call afterwards, what shape the answer takes — before
56
+ * the material itself, so a model that stops reading early has still read the instruction.
57
+ *
58
+ * The task id appears at the top and in the follow-up call on purpose. It is the only thing that
59
+ * routes an answer back, and a parent that paraphrases the rest but copies the id still works.
60
+ */
61
+ export const renderTaskEnvelope = (task, opts) => {
62
+ const model = task.tier != null ? opts.tiers?.[task.tier] : undefined;
63
+ const lines = [
64
+ `=== VIABLE MODEL TASK ${task.id} ===`,
65
+ `role: ${task.role} · tier: ${task.tier}${model != null ? ` → run on: ${model}` : ''}`,
66
+ `mode: ${task.mode} · reasoning: LOW${task.maxOutputChars != null ? ` · answer limit: ${task.maxOutputChars} chars` : ''}`,
67
+ ...(task.attempt > 0
68
+ ? [`This is attempt ${task.attempt + 1}. The previous answer was refused${task.feedback != null ? `: ${task.feedback}` : '.'}`]
69
+ : []),
70
+ '',
71
+ 'HOW TO RUN THIS (do not answer it yourself, in this conversation):',
72
+ HOW_TO_RUN[opts.harness] ?? HOW_TO_RUN[ConnectHarness.Other],
73
+ '',
74
+ 'WHAT TO SEND BACK — call exactly:',
75
+ ` submit_task_result { "taskId": "${task.id}", "result": <the subagent's final answer> }`,
76
+ SHAPE[task.mode],
77
+ 'Do not summarise, improve or reinterpret the answer. Pass it through as it was produced.',
78
+ '',
79
+ ];
80
+ if (task.system != null && task.system !== '') {
81
+ lines.push('--- SYSTEM PROMPT (give this to the subagent as its instructions) ---', task.system, '');
82
+ }
83
+ lines.push('--- CONVERSATION (give this to the subagent, in order) ---');
84
+ for (const message of task.messages) {
85
+ const label = message.name != null
86
+ ? `${ROLE_LABEL[message.role]}:${message.name}`
87
+ : ROLE_LABEL[message.role];
88
+ lines.push(`[${label}] ${message.content}`);
89
+ if (message.toolCalls != null) {
90
+ for (const call of message.toolCalls) {
91
+ lines.push(`[${label} → ${call.name}] ${JSON.stringify(call.args)}`);
92
+ }
93
+ }
94
+ }
95
+ lines.push('');
96
+ if (task.mode === ModelTaskMode.Tools && task.tools != null) {
97
+ lines.push('--- TOOLS THE SUBAGENT MAY CALL ---', JSON.stringify(task.tools, null, 2), '');
98
+ }
99
+ if (task.mode === ModelTaskMode.Json && task.outputSchema != null) {
100
+ lines.push('--- OUTPUT SCHEMA ---', JSON.stringify(task.outputSchema, null, 2), '');
101
+ }
102
+ lines.push(`=== END TASK ${task.id} ===`);
103
+ return lines.join('\n');
104
+ };
105
+ /** Strip a code fence a model wrapped its answer in. */
106
+ const unfence = (raw) => {
107
+ const trimmed = raw.trim();
108
+ if (!trimmed.startsWith('```'))
109
+ return trimmed;
110
+ const body = trimmed.replace(/^```[a-zA-Z]*\n?/, '');
111
+ return body.replace(/```\s*$/, '').trim();
112
+ };
113
+ /**
114
+ * Whether an answer satisfies the schema the task asked for, said in words a model can act on.
115
+ *
116
+ * Checked HERE, with the subagent's context still open, rather than left to the platform. A
117
+ * mismatch the platform catches costs a whole round trip, a new task and another wait, and the
118
+ * feedback it sends back is one step removed from the answer that caused it. Checked locally, the
119
+ * parent is told which field is wrong while it can still ask again cheaply.
120
+ *
121
+ * A schema this cannot compile is not a refusal: an answer must never be rejected because of an
122
+ * inability of ours to check it. The platform validates again either way.
123
+ */
124
+ const schemaProblem = (task, value) => {
125
+ if (task.outputSchema == null)
126
+ return null;
127
+ try {
128
+ const validate = new Ajv({ strict: false, allErrors: true }).compile(task.outputSchema);
129
+ if (validate(value))
130
+ return null;
131
+ const said = (validate.errors ?? []).slice(0, 4)
132
+ .map(error => `${error.instancePath === '' ? '(root)' : error.instancePath} ${error.message ?? ''}`)
133
+ .join('; ');
134
+ return `The answer does not match the OUTPUT SCHEMA: ${said}. Send one JSON object that does.`;
135
+ }
136
+ catch {
137
+ return null;
138
+ }
139
+ };
140
+ /**
141
+ * The tool calls an answer carries, or `null` when it carries none.
142
+ *
143
+ * Three shapes rather than one, because models produce three: the documented array, a bare object
144
+ * for a single call, and an array wrapped under `tool_calls`. Assuming the array made a single call
145
+ * read as no call at all.
146
+ */
147
+ const toolCallList = (parsed) => {
148
+ const wrapper = parsed;
149
+ if (Array.isArray(parsed))
150
+ return parsed.length > 0 ? parsed : null;
151
+ if (Array.isArray(wrapper?.tool_calls))
152
+ return wrapper.tool_calls;
153
+ if (Array.isArray(wrapper?.toolCalls))
154
+ return wrapper.toolCalls;
155
+ if (typeof parsed?.name === 'string')
156
+ return [parsed];
157
+ return null;
158
+ };
159
+ /**
160
+ * Check a parent's answer against what the task asked for, before the platform ever sees it.
161
+ *
162
+ * The refusal is worth more than the parse. A malformed answer that reaches the platform costs a
163
+ * whole retry — another task, another subagent, another wait — while one caught here is a sentence
164
+ * the parent can act on immediately, with the subagent's context still open. So a failure comes
165
+ * back as a `problem`, not as a thrown error, and the caller renders it as a tool error the model
166
+ * reads and corrects.
167
+ */
168
+ export const parseTaskResult = (task, raw) => {
169
+ if (raw == null || (typeof raw === 'string' && raw.trim() === '')) {
170
+ return { problem: 'The answer was empty. Run the task and send what the subagent produced.' };
171
+ }
172
+ if (task.mode === ModelTaskMode.Text) {
173
+ const text = typeof raw === 'string' ? raw : JSON.stringify(raw);
174
+ return { result: { taskId: task.id, kind: ModelTaskResultKind.Text, text } };
175
+ }
176
+ let parsed = raw;
177
+ if (typeof raw === 'string') {
178
+ try {
179
+ parsed = JSON.parse(unfence(raw));
180
+ }
181
+ catch {
182
+ if (task.mode === ModelTaskMode.Json) {
183
+ return {
184
+ problem: 'The answer was not valid JSON. Send ONE JSON object matching the schema, with no prose and no code fence.',
185
+ };
186
+ }
187
+ // Prose in a tools-mode task is not a malformed answer: it is how a model with tools bound
188
+ // says it is finished. Refusing it stalls the agent loop it was ending — every attempt gives
189
+ // the same reply and the run dies of exhausted retries with nothing wrong anywhere.
190
+ return { result: { taskId: task.id, kind: ModelTaskResultKind.Text, text: raw } };
191
+ }
192
+ }
193
+ if (task.mode === ModelTaskMode.Json) {
194
+ if (typeof parsed !== 'object' || parsed == null || Array.isArray(parsed)) {
195
+ return { problem: 'The answer must be a single JSON object, not an array or a scalar.' };
196
+ }
197
+ const invalid = schemaProblem(task, parsed);
198
+ if (invalid != null)
199
+ return { problem: invalid };
200
+ return { result: { taskId: task.id, kind: ModelTaskResultKind.Json, json: parsed } };
201
+ }
202
+ const listed = toolCallList(parsed);
203
+ if (listed == null) {
204
+ // Valid JSON that names no tool call — treated as the model's final say, for the same reason
205
+ // prose is. What it may NOT do is name a tool that does not exist, which is checked below.
206
+ return {
207
+ result: {
208
+ taskId: task.id,
209
+ kind: ModelTaskResultKind.Text,
210
+ text: typeof raw === 'string' ? raw : JSON.stringify(raw),
211
+ },
212
+ };
213
+ }
214
+ const known = new Set((task.tools ?? []).map(tool => tool.name));
215
+ const calls = [];
216
+ for (const entry of listed) {
217
+ const call = entry;
218
+ if (typeof call.name !== 'string') {
219
+ return { problem: 'Every tool call needs a "name". ' + JSON.stringify(entry) };
220
+ }
221
+ if (known.size > 0 && !known.has(call.name)) {
222
+ return {
223
+ problem: `"${call.name}" is not one of the tools this task offers (${[...known].join(', ')}).`,
224
+ };
225
+ }
226
+ calls.push({ name: call.name, args: (call.args ?? {}) });
227
+ }
228
+ return { result: { taskId: task.id, kind: ModelTaskResultKind.ToolCalls, toolCalls: calls } };
229
+ };
230
+ //# sourceMappingURL=envelope.js.map
@@ -0,0 +1 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AE,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAA4B,EAAE,CAAC,CAAA;IACrF,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAA;AAC/F,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './envelope.js';
2
+ export * from './inquiry.js';
3
+ export * from './driver.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './envelope.js';
2
+ export * from './inquiry.js';
3
+ export * from './driver.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}