code60-transmission-server 0.1.0-staging.2 → 0.1.0-staging.21

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 (94) hide show
  1. package/INTENT.md +47 -0
  2. package/README.md +85 -244
  3. package/dist/src/acp.js +115 -0
  4. package/dist/src/contract.js +133 -0
  5. package/dist/src/engine.js +650 -0
  6. package/dist/src/main.js +76 -22
  7. package/dist/src/repository.js +94 -0
  8. package/dist/src/service.js +192 -0
  9. package/package.json +16 -32
  10. package/reference/openapi.json +1073 -0
  11. package/README.engine.md +0 -401
  12. package/dist/src/broker/filesystem.js +0 -385
  13. package/dist/src/broker/index.js +0 -734
  14. package/dist/src/broker/native/README.md +0 -192
  15. package/dist/src/broker/native/build.js +0 -43
  16. package/dist/src/broker/native/fs-helper.c +0 -529
  17. package/dist/src/broker/native/git-helper.c +0 -205
  18. package/dist/src/broker/policy.js +0 -149
  19. package/dist/src/broker/startup-lock.js +0 -14
  20. package/dist/src/broker/types.js +0 -11
  21. package/dist/src/cli/daemon.js +0 -365
  22. package/dist/src/cli/helpers.js +0 -104
  23. package/dist/src/cli/main.js +0 -180
  24. package/dist/src/config/deployment.js +0 -163
  25. package/dist/src/config/documents.js +0 -29
  26. package/dist/src/config/profile-validation.js +0 -123
  27. package/dist/src/config/schema-graph.js +0 -237
  28. package/dist/src/config/schema-loader.js +0 -185
  29. package/dist/src/config/validation-pool.js +0 -105
  30. package/dist/src/config/validation-protocol.js +0 -1
  31. package/dist/src/config/validation-worker.js +0 -106
  32. package/dist/src/config/workflow-language.js +0 -9
  33. package/dist/src/config/workflow-schema.json +0 -534
  34. package/dist/src/config/workflow-types.js +0 -1
  35. package/dist/src/config/workflow-validation.js +0 -95
  36. package/dist/src/engine/budgets.js +0 -50
  37. package/dist/src/engine/clocks.js +0 -27
  38. package/dist/src/engine/commands.js +0 -441
  39. package/dist/src/engine/contracts.js +0 -11
  40. package/dist/src/engine/drain-state.js +0 -31
  41. package/dist/src/engine/effective-permissions.js +0 -120
  42. package/dist/src/engine/instruction-pins.js +0 -205
  43. package/dist/src/engine/retries.js +0 -50
  44. package/dist/src/engine/state.js +0 -1
  45. package/dist/src/engine/timing.js +0 -23
  46. package/dist/src/engine/tool-observations.js +0 -87
  47. package/dist/src/engine/workflow-engine.js +0 -1807
  48. package/dist/src/mcp/catalog.js +0 -71
  49. package/dist/src/mcp/main.js +0 -24
  50. package/dist/src/mcp/server.js +0 -104
  51. package/dist/src/runtime/codex-app-server.js +0 -91
  52. package/dist/src/runtime/containment.js +0 -82
  53. package/dist/src/runtime/engine-driver.js +0 -212
  54. package/dist/src/runtime/json-line-writer.js +0 -192
  55. package/dist/src/runtime/pinned-instruction-sources.js +0 -24
  56. package/dist/src/runtime/protocol-client.js +0 -264
  57. package/dist/src/runtime/protocol-pool.js +0 -183
  58. package/dist/src/runtime/protocol-projection.js +0 -393
  59. package/dist/src/runtime/protocol-types.js +0 -1
  60. package/dist/src/runtime/protocol-worker.js +0 -18
  61. package/dist/src/runtime/provider-bridge.js +0 -288
  62. package/dist/src/runtime/provider-credentials.js +0 -41
  63. package/dist/src/runtime/provider-transport.js +0 -404
  64. package/dist/src/runtime/runtime-broker.js +0 -213
  65. package/dist/src/runtime/workspace-instructions.js +0 -120
  66. package/dist/src/runtime/workspace-view.js +0 -74
  67. package/dist/src/server/api-contract.json +0 -11078
  68. package/dist/src/server/api-types.js +0 -1
  69. package/dist/src/server/application.js +0 -38
  70. package/dist/src/server/auth.js +0 -67
  71. package/dist/src/server/broker-handlers.js +0 -242
  72. package/dist/src/server/control-plane.js +0 -50
  73. package/dist/src/server/deployment.js +0 -237
  74. package/dist/src/server/errors.js +0 -22
  75. package/dist/src/server/history-handlers.js +0 -113
  76. package/dist/src/server/http.js +0 -124
  77. package/dist/src/server/paging.js +0 -56
  78. package/dist/src/server/publication.js +0 -119
  79. package/dist/src/server/tool-event-handler.js +0 -77
  80. package/dist/src/server/workspace-handlers.js +0 -34
  81. package/dist/src/storage/coordinator.js +0 -224
  82. package/dist/src/storage/startup-lock.js +0 -71
  83. package/dist/src/storage/store.js +0 -167
  84. package/dist/src/tools/check-worker.js +0 -81
  85. package/dist/src/tools/checks.js +0 -106
  86. package/dist/src/tools/dns.js +0 -248
  87. package/dist/src/tools/http-contract.js +0 -38
  88. package/dist/src/tools/http.js +0 -358
  89. package/dist/src/tools/index.js +0 -177
  90. package/dist/src/tools/worker-check.js +0 -73
  91. package/dist/src/workspaces/git.js +0 -227
  92. package/dist/src/workspaces/index.js +0 -715
  93. package/examples/deployment.local.json +0 -22
  94. package/scripts/postinstall.mjs +0 -25
@@ -0,0 +1,133 @@
1
+ import { z } from 'zod';
2
+ const text = z.string().trim().min(1).max(65536);
3
+ export const task = z.strictObject({
4
+ name: text,
5
+ instructions: text,
6
+ verify: text,
7
+ checks: z.array(text).max(30).optional(),
8
+ });
9
+ export const start = z.strictObject({
10
+ repository: text,
11
+ tasks: z.array(task).min(1).max(100),
12
+ confirmed: z.literal(true),
13
+ idempotencyKey: z.string().min(1).max(256),
14
+ repairs: z.number().int().min(0).max(30).default(2),
15
+ retries: z.number().int().min(0).max(30).default(2),
16
+ autoApprove: z.boolean().default(true),
17
+ });
18
+ export const runId = z.uuid();
19
+ const id = z.strictObject({ runId });
20
+ export const revision = id.extend({
21
+ expectedRevision: z.int().nonnegative(),
22
+ idempotencyKey: z.string().min(1).max(256),
23
+ confirmed: z.literal(true),
24
+ remainingTasks: z.array(task).min(1).max(100),
25
+ });
26
+ export const operations = {
27
+ start_workflow: start,
28
+ get_workflow: id,
29
+ get_workflow_plan: id,
30
+ revise_workflow: revision,
31
+ get_workflow_events: id.extend({
32
+ after: z.number().int().nonnegative().default(0),
33
+ }),
34
+ get_workflow_diff: id.extend({
35
+ offset: z.number().int().nonnegative().default(0),
36
+ }),
37
+ answer_workflow_question: id.extend({ questionId: z.uuid(), answer: text }),
38
+ send_workflow_message: id.extend({ message: text }),
39
+ pause_workflow: id,
40
+ resume_workflow: id,
41
+ cancel_workflow: id,
42
+ };
43
+ export const descriptions = {
44
+ start_workflow: 'Run the exact workflow confirmed by the user. Design ordered tasks, each with implementation instructions and an independent verification prompt. Show the project, tasks and criteria to the user and obtain confirmation before calling. Reuse the same key on reconnect.',
45
+ get_workflow: 'Read an ordered task snapshot by run ID, including the active task index, decision, accepted results, and event cursor. Pass eventCursor as after to get_workflow_events for subsequent activity.',
46
+ get_workflow_plan: 'Read the complete effective task definitions and planRevision. Tasks before activeTaskIndex are completed and immutable. Use the current revision as expectedRevision when revising a paused workflow.',
47
+ revise_workflow: 'Replace all unfinished tasks of a fully paused workflow, including the interrupted task and its verification criteria. Present the revised tasks and criteria to the user and obtain confirmation before calling with confirmed:true. Supply expectedRevision from get_workflow_plan and a new idempotencyKey; retry uncertain outcomes with the exact same request. Completed work, history and spent allowances are preserved. The run stays paused; call resume_workflow separately.',
48
+ get_workflow_events: 'Read the next page of progress, sessions, native tools and verifier feedback. Use the last sequence number as after.',
49
+ get_workflow_diff: 'Read a page of the accepted patch relative to the initial working tree. Offset is in bytes; content is base64.',
50
+ answer_workflow_question: 'Answer the outstanding decision by ID. For a permission question select an offered option ID.',
51
+ send_workflow_message: 'Deliver new guidance before the current task is accepted.',
52
+ pause_workflow: 'Interrupt active agents and pause the workflow, preserving files and accepted tasks. Returns paused after agents stop. Pause survives engine restart.',
53
+ resume_workflow: 'Resume a paused workflow with fresh sessions for the first unfinished task without spending a retry. An unanswered scope question still requires an answer.',
54
+ cancel_workflow: 'Stop the workflow and its active agent sessions. Leave working files available for review.',
55
+ };
56
+ export const terminal = (status) => ['completed', 'failed', 'cancelled'].includes(status);
57
+ const status = z.enum(['running', 'pausing', 'paused', 'completed', 'needs_input', 'failed', 'cancelled']);
58
+ const checkEvidence = z.object({
59
+ command: text,
60
+ passed: z.boolean(),
61
+ evidence: text,
62
+ });
63
+ const verdict = z.object({
64
+ decision: z.enum(['accept', 'reject']),
65
+ reason: z.string(),
66
+ checks: z.array(checkEvidence).optional(),
67
+ });
68
+ const accepted = z.object({
69
+ name: z.string(),
70
+ result: z.string(),
71
+ verdict,
72
+ worker: z.string(),
73
+ verifier: z.string(),
74
+ revision: z.string(),
75
+ });
76
+ const question = z.object({
77
+ id: z.uuid(),
78
+ text: z.string(),
79
+ options: z.array(z.object({ id: z.string(), name: z.string() })).optional(),
80
+ });
81
+ const taskState = z.enum([
82
+ 'pending', 'implementing', 'verifying', 'repairing',
83
+ 'needs_input', 'accepted', 'failed', 'cancelled',
84
+ 'pausing', 'paused',
85
+ ]);
86
+ const nonnegativeInteger = z.int().nonnegative();
87
+ export const workflowSnapshot = z.object({
88
+ runId,
89
+ planRevision: nonnegativeInteger,
90
+ status,
91
+ tasks: z.array(z.object({ index: nonnegativeInteger, name: z.string(), state: taskState })),
92
+ activeTaskIndex: nonnegativeInteger.nullable(),
93
+ eventCursor: nonnegativeInteger,
94
+ task: z.string().optional(),
95
+ phase: z.enum(['worker', 'verifier']).optional(),
96
+ decision: question.optional(),
97
+ reason: z.string().optional(),
98
+ attempts: z.array(z.string()),
99
+ accepted: z.array(accepted),
100
+ result: z.string().optional(),
101
+ verdict: verdict.optional(),
102
+ });
103
+ export const workflowPlan = z.object({
104
+ runId,
105
+ planRevision: nonnegativeInteger,
106
+ activeTaskIndex: nonnegativeInteger.nullable(),
107
+ tasks: z.array(task),
108
+ });
109
+ export const responseSchemas = { WorkflowSnapshot: workflowSnapshot, WorkflowPlan: workflowPlan };
110
+ export const operationResponses = {
111
+ start_workflow: 'WorkflowSnapshot',
112
+ get_workflow: 'WorkflowSnapshot',
113
+ get_workflow_plan: 'WorkflowPlan',
114
+ revise_workflow: 'WorkflowSnapshot',
115
+ answer_workflow_question: 'WorkflowSnapshot',
116
+ send_workflow_message: 'WorkflowSnapshot',
117
+ pause_workflow: 'WorkflowSnapshot',
118
+ resume_workflow: 'WorkflowSnapshot',
119
+ cancel_workflow: 'WorkflowSnapshot',
120
+ };
121
+ export const workerReply = z.discriminatedUnion('kind', [
122
+ z.object({ kind: z.literal('result'), summary: text }),
123
+ z.object({ kind: z.literal('question'), question: text }),
124
+ ]);
125
+ export const verifierReply = z.discriminatedUnion('kind', [
126
+ z.object({
127
+ kind: z.literal('verdict'),
128
+ decision: z.enum(['accept', 'reject']),
129
+ reason: text,
130
+ checks: z.array(checkEvidence).optional(),
131
+ }),
132
+ z.object({ kind: z.literal('question'), question: text }),
133
+ ]);