tryharness 0.7.67 → 0.7.69

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 (54) hide show
  1. package/lib/boardFileCommands.mjs +5 -7
  2. package/lib/boardFiles.mjs +5 -0
  3. package/lib/boardProtocol.json +50 -64
  4. package/lib/boardWaits.mjs +6 -0
  5. package/lib/cards.mjs +13 -1
  6. package/lib/comfyExecution.mjs +545 -0
  7. package/lib/context.mjs +34 -20
  8. package/lib/contextWorker.mjs +199 -0
  9. package/lib/coordinator.mjs +224 -22
  10. package/lib/daemon.mjs +196 -14
  11. package/lib/dispatchContract.json +313 -0
  12. package/lib/dispatchTools.js +87 -0
  13. package/lib/dispatches.mjs +975 -0
  14. package/lib/environment.mjs +54 -69
  15. package/lib/files.mjs +35 -0
  16. package/lib/frames.mjs +5 -9
  17. package/lib/goalCommands.mjs +13 -10
  18. package/lib/kept.mjs +131 -0
  19. package/lib/landed.mjs +1 -34
  20. package/lib/library.mjs +18 -11
  21. package/lib/live.mjs +30 -11
  22. package/lib/localAgentAsk.mjs +27 -4
  23. package/lib/localStack.mjs +17 -13
  24. package/lib/machineRoutes.mjs +5 -0
  25. package/lib/machineRuns.mjs +2 -1
  26. package/lib/mcp-stdio.mjs +42 -1
  27. package/lib/openHere.mjs +36 -0
  28. package/lib/openRequests.mjs +56 -0
  29. package/lib/ownMachines.mjs +232 -24
  30. package/lib/phones.mjs +29 -4
  31. package/lib/places.mjs +44 -11
  32. package/lib/portCalls.mjs +54 -0
  33. package/lib/promptDecider.mjs +471 -0
  34. package/lib/promptFlow.mjs +562 -0
  35. package/lib/promptScopes.mjs +670 -0
  36. package/lib/provenance.mjs +3 -2
  37. package/lib/runAuthority.mjs +14 -2
  38. package/lib/runBrief.mjs +2 -2
  39. package/lib/runWorker.mjs +25 -5
  40. package/lib/runner.mjs +62 -6
  41. package/lib/sealed.mjs +37 -0
  42. package/lib/sessionControl.mjs +47 -14
  43. package/lib/sessionIndex.mjs +11 -3
  44. package/lib/store.mjs +362 -40
  45. package/lib/swarm.mjs +85 -34
  46. package/lib/swarmMemory.mjs +39 -16
  47. package/lib/taskCommands.mjs +125 -1
  48. package/lib/team.json +10 -0
  49. package/lib/team.mjs +287 -26
  50. package/lib/threadBriefs.mjs +43 -31
  51. package/lib/threadRuns.mjs +47 -3
  52. package/npm-shrinkwrap.json +14 -14
  53. package/package.json +4 -4
  54. package/release.json +55 -43
@@ -0,0 +1,87 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ const contract = createRequire(import.meta.url)("./dispatchContract.json");
4
+ const fields = {
5
+ action: { type: "string", enum: ["scopes", "propose", "view", "dispatch"] },
6
+ root_id: { type: "string" },
7
+ task_id: { type: "string" },
8
+ proposal: {
9
+ oneOf: [
10
+ {
11
+ type: "object",
12
+ properties: {
13
+ scope_ref: { type: "string" },
14
+ template_ref: { type: "string" },
15
+ },
16
+ required: ["scope_ref", "template_ref"],
17
+ additionalProperties: false,
18
+ },
19
+ {
20
+ type: "object",
21
+ properties: {
22
+ scope_ref: { type: "string" },
23
+ objective: { type: "string" },
24
+ brief: { type: "string" },
25
+ capability_ref: { type: "string" },
26
+ },
27
+ required: ["scope_ref", "objective", "brief", "capability_ref"],
28
+ additionalProperties: false,
29
+ },
30
+ ],
31
+ },
32
+ decision: contract.decision_output_schema,
33
+ };
34
+ // This adapter offers no owner grant or approval operation to agents.
35
+ export const DISPATCH_WORK_TOOL = {
36
+ name: "dispatch_work",
37
+ description:
38
+ "Use an existing scope without another Start. Prompt scopes accept new child objectives and briefs under their offered capability; legacy scopes accept an offered template. Read the task's eligible assignments, then dispatch with code-offered typed references. All children share the cumulative start budget. Agent prose cannot widen permissions. The original owner prompt remains the completion standard.",
39
+ inputSchema: {
40
+ definitions: contract.decision_output_schema.definitions,
41
+ type: "object",
42
+ properties: fields,
43
+ required: ["action"],
44
+ additionalProperties: false,
45
+ },
46
+ };
47
+ export const SCOPE_WORKSPACE_TOOL = {
48
+ name: "scope_workspace",
49
+ description:
50
+ "List/read source files and stage file writes in this run's private workspace through Relay. Writes return reviewable artifacts. Paths are relative; hidden paths, symlinks, runtime code, credentials and paths outside the workspace are refused. Writes need the exact sha256 returned by read, or null to create a new file. No shell, networking or financial operation is available.",
51
+ inputSchema: {
52
+ type: "object",
53
+ properties: {
54
+ operation: { type: "string", enum: ["list", "read", "write"] },
55
+ path: { type: "string" },
56
+ text: { type: "string" },
57
+ expected_sha256: { type: ["string", "null"] },
58
+ },
59
+ required: ["operation"],
60
+ additionalProperties: false,
61
+ },
62
+ };
63
+ export function dispatchWorkRequest(args) {
64
+ const required = {
65
+ scopes: ["action", "root_id"],
66
+ propose: ["action", "proposal"],
67
+ view: ["action", "task_id"],
68
+ dispatch: ["action", "task_id", "decision"],
69
+ }[args.action];
70
+ if (
71
+ !required ||
72
+ Object.keys(args).length !== required.length ||
73
+ !required.every((key) => Object.hasOwn(args, key))
74
+ )
75
+ return { error: "Use only the fields for the selected dispatch action." };
76
+ if (args.action === "scopes")
77
+ return { command: "board.dispatch.scope.list", rootId: args.root_id };
78
+ if (args.action === "propose")
79
+ return { command: "board.dispatch.propose", proposal: args.proposal };
80
+ if (args.action === "view")
81
+ return { command: "board.dispatch.view", id: args.task_id };
82
+ return {
83
+ command: "board.dispatch.apply",
84
+ id: args.task_id,
85
+ decision: args.decision,
86
+ };
87
+ }