@jmoyers/harness 0.1.0

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 (214) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +145 -0
  3. package/native/ptyd/Cargo.lock +16 -0
  4. package/native/ptyd/Cargo.toml +7 -0
  5. package/native/ptyd/src/main.rs +257 -0
  6. package/package.json +90 -0
  7. package/scripts/build-ptyd.sh +73 -0
  8. package/scripts/control-plane-daemon.ts +277 -0
  9. package/scripts/cursor-hook-relay.ts +82 -0
  10. package/scripts/harness-animate.ts +469 -0
  11. package/scripts/harness-bin.js +77 -0
  12. package/scripts/harness-core.ts +1 -0
  13. package/scripts/harness-inspector.ts +439 -0
  14. package/scripts/harness.ts +2493 -0
  15. package/src/adapters/agent-session-state.ts +390 -0
  16. package/src/cli/gateway-record.ts +173 -0
  17. package/src/codex/live-session.ts +872 -0
  18. package/src/config/config-core.ts +1359 -0
  19. package/src/config/secrets-core.ts +170 -0
  20. package/src/control-plane/agent-realtime-api.ts +2441 -0
  21. package/src/control-plane/codex-session-stream.ts +392 -0
  22. package/src/control-plane/codex-telemetry.ts +1325 -0
  23. package/src/control-plane/lifecycle-hooks.ts +706 -0
  24. package/src/control-plane/session-summary.ts +380 -0
  25. package/src/control-plane/status/agent-status-reducer.ts +21 -0
  26. package/src/control-plane/status/reducer-base.ts +170 -0
  27. package/src/control-plane/status/reducers/claude-status-reducer.ts +37 -0
  28. package/src/control-plane/status/reducers/codex-status-reducer.ts +48 -0
  29. package/src/control-plane/status/reducers/critique-status-reducer.ts +15 -0
  30. package/src/control-plane/status/reducers/cursor-status-reducer.ts +37 -0
  31. package/src/control-plane/status/reducers/terminal-status-reducer.ts +15 -0
  32. package/src/control-plane/status/session-status-engine.ts +76 -0
  33. package/src/control-plane/stream-client.ts +396 -0
  34. package/src/control-plane/stream-command-parser.ts +1673 -0
  35. package/src/control-plane/stream-protocol.ts +1808 -0
  36. package/src/control-plane/stream-server-background.ts +486 -0
  37. package/src/control-plane/stream-server-command.ts +2557 -0
  38. package/src/control-plane/stream-server-connection.ts +234 -0
  39. package/src/control-plane/stream-server-observed-filter.ts +112 -0
  40. package/src/control-plane/stream-server-session-runtime.ts +566 -0
  41. package/src/control-plane/stream-server-state-store.ts +15 -0
  42. package/src/control-plane/stream-server.ts +3192 -0
  43. package/src/cursor/managed-hooks.ts +282 -0
  44. package/src/domain/conversations.ts +414 -0
  45. package/src/domain/directories.ts +78 -0
  46. package/src/domain/repositories.ts +123 -0
  47. package/src/domain/tasks.ts +148 -0
  48. package/src/domain/workspace.ts +156 -0
  49. package/src/events/normalized-events.ts +124 -0
  50. package/src/mux/ansi-integrity.ts +103 -0
  51. package/src/mux/control-plane-op-queue.ts +212 -0
  52. package/src/mux/conversation-rail.ts +339 -0
  53. package/src/mux/double-click.ts +78 -0
  54. package/src/mux/dual-pane-core.ts +435 -0
  55. package/src/mux/harness-core-ui.ts +817 -0
  56. package/src/mux/input-shortcuts.ts +667 -0
  57. package/src/mux/live-mux/actions-conversation.ts +344 -0
  58. package/src/mux/live-mux/actions-repository.ts +246 -0
  59. package/src/mux/live-mux/actions-task.ts +115 -0
  60. package/src/mux/live-mux/args.ts +142 -0
  61. package/src/mux/live-mux/command-menu.ts +298 -0
  62. package/src/mux/live-mux/control-plane-records.ts +546 -0
  63. package/src/mux/live-mux/conversation-state.ts +188 -0
  64. package/src/mux/live-mux/directory-resolution.ts +34 -0
  65. package/src/mux/live-mux/event-mapping.ts +96 -0
  66. package/src/mux/live-mux/gateway-profiler.ts +152 -0
  67. package/src/mux/live-mux/gateway-render-trace.ts +177 -0
  68. package/src/mux/live-mux/gateway-status-timeline.ts +166 -0
  69. package/src/mux/live-mux/git-parsing.ts +131 -0
  70. package/src/mux/live-mux/git-snapshot.ts +263 -0
  71. package/src/mux/live-mux/git-state.ts +136 -0
  72. package/src/mux/live-mux/global-shortcut-handlers.ts +143 -0
  73. package/src/mux/live-mux/home-pane-actions.ts +58 -0
  74. package/src/mux/live-mux/home-pane-drop.ts +44 -0
  75. package/src/mux/live-mux/home-pane-entity-click.ts +96 -0
  76. package/src/mux/live-mux/home-pane-pointer.ts +96 -0
  77. package/src/mux/live-mux/input-forwarding.ts +112 -0
  78. package/src/mux/live-mux/layout.ts +30 -0
  79. package/src/mux/live-mux/left-nav-activation.ts +103 -0
  80. package/src/mux/live-mux/left-nav.ts +85 -0
  81. package/src/mux/live-mux/left-rail-actions.ts +118 -0
  82. package/src/mux/live-mux/left-rail-conversation-click.ts +82 -0
  83. package/src/mux/live-mux/left-rail-pointer.ts +74 -0
  84. package/src/mux/live-mux/modal-command-menu-handler.ts +101 -0
  85. package/src/mux/live-mux/modal-conversation-handlers.ts +217 -0
  86. package/src/mux/live-mux/modal-input-reducers.ts +94 -0
  87. package/src/mux/live-mux/modal-overlays.ts +287 -0
  88. package/src/mux/live-mux/modal-pointer.ts +70 -0
  89. package/src/mux/live-mux/modal-prompt-handlers.ts +187 -0
  90. package/src/mux/live-mux/modal-task-editor-handler.ts +156 -0
  91. package/src/mux/live-mux/observed-stream.ts +87 -0
  92. package/src/mux/live-mux/palette-parsing.ts +128 -0
  93. package/src/mux/live-mux/pointer-routing.ts +108 -0
  94. package/src/mux/live-mux/process-usage.ts +53 -0
  95. package/src/mux/live-mux/project-pane-pointer.ts +44 -0
  96. package/src/mux/live-mux/rail-layout.ts +244 -0
  97. package/src/mux/live-mux/render-trace-analysis.ts +213 -0
  98. package/src/mux/live-mux/render-trace-state.ts +84 -0
  99. package/src/mux/live-mux/repository-folding.ts +207 -0
  100. package/src/mux/live-mux/runtime-shutdown.ts +51 -0
  101. package/src/mux/live-mux/selection.ts +411 -0
  102. package/src/mux/live-mux/startup-utils.ts +187 -0
  103. package/src/mux/live-mux/status-timeline-state.ts +82 -0
  104. package/src/mux/live-mux/task-pane-shortcuts.ts +206 -0
  105. package/src/mux/live-mux/terminal-palette.ts +79 -0
  106. package/src/mux/new-thread-prompt.ts +165 -0
  107. package/src/mux/project-tree.ts +295 -0
  108. package/src/mux/render-frame.ts +113 -0
  109. package/src/mux/runtime-wiring.ts +185 -0
  110. package/src/mux/selector-index.ts +160 -0
  111. package/src/mux/startup-sequencer.ts +238 -0
  112. package/src/mux/task-composer.ts +289 -0
  113. package/src/mux/task-focused-pane.ts +417 -0
  114. package/src/mux/task-screen-keybindings.ts +539 -0
  115. package/src/mux/terminal-input-modes.ts +35 -0
  116. package/src/mux/workspace-path.ts +55 -0
  117. package/src/mux/workspace-rail-model.ts +701 -0
  118. package/src/mux/workspace-rail.ts +247 -0
  119. package/src/perf/perf-core.ts +307 -0
  120. package/src/pty/pty_host.ts +217 -0
  121. package/src/pty/session-broker.ts +158 -0
  122. package/src/recording/terminal-recording.ts +383 -0
  123. package/src/services/control-plane.ts +567 -0
  124. package/src/services/conversation-lifecycle.ts +176 -0
  125. package/src/services/conversation-startup-hydration.ts +47 -0
  126. package/src/services/directory-hydration.ts +49 -0
  127. package/src/services/event-persistence.ts +104 -0
  128. package/src/services/mux-ui-state-persistence.ts +82 -0
  129. package/src/services/output-load-sampler.ts +231 -0
  130. package/src/services/process-usage-refresh.ts +88 -0
  131. package/src/services/recording.ts +75 -0
  132. package/src/services/render-trace-recorder.ts +177 -0
  133. package/src/services/runtime-control-actions.ts +123 -0
  134. package/src/services/runtime-control-plane-ops.ts +131 -0
  135. package/src/services/runtime-conversation-actions.ts +113 -0
  136. package/src/services/runtime-conversation-activation.ts +78 -0
  137. package/src/services/runtime-conversation-starter.ts +171 -0
  138. package/src/services/runtime-conversation-title-edit.ts +149 -0
  139. package/src/services/runtime-directory-actions.ts +164 -0
  140. package/src/services/runtime-envelope-handler.ts +198 -0
  141. package/src/services/runtime-git-state.ts +92 -0
  142. package/src/services/runtime-input-pipeline.ts +50 -0
  143. package/src/services/runtime-input-router.ts +202 -0
  144. package/src/services/runtime-layout-resize.ts +236 -0
  145. package/src/services/runtime-left-rail-render.ts +159 -0
  146. package/src/services/runtime-main-pane-input.ts +230 -0
  147. package/src/services/runtime-modal-input.ts +119 -0
  148. package/src/services/runtime-navigation-input.ts +207 -0
  149. package/src/services/runtime-process-wiring.ts +68 -0
  150. package/src/services/runtime-rail-input.ts +287 -0
  151. package/src/services/runtime-render-flush.ts +146 -0
  152. package/src/services/runtime-render-lifecycle.ts +104 -0
  153. package/src/services/runtime-render-orchestrator.ts +108 -0
  154. package/src/services/runtime-render-pipeline.ts +167 -0
  155. package/src/services/runtime-render-state.ts +72 -0
  156. package/src/services/runtime-repository-actions.ts +197 -0
  157. package/src/services/runtime-right-pane-render.ts +132 -0
  158. package/src/services/runtime-shutdown.ts +79 -0
  159. package/src/services/runtime-stream-subscriptions.ts +56 -0
  160. package/src/services/runtime-task-composer-persistence.ts +139 -0
  161. package/src/services/runtime-task-editor-actions.ts +83 -0
  162. package/src/services/runtime-task-pane-actions.ts +198 -0
  163. package/src/services/runtime-task-pane-shortcuts.ts +189 -0
  164. package/src/services/runtime-task-pane.ts +62 -0
  165. package/src/services/runtime-workspace-actions.ts +153 -0
  166. package/src/services/runtime-workspace-observed-events.ts +190 -0
  167. package/src/services/session-projection-instrumentation.ts +190 -0
  168. package/src/services/startup-background-probe.ts +91 -0
  169. package/src/services/startup-background-resume.ts +65 -0
  170. package/src/services/startup-orchestrator.ts +166 -0
  171. package/src/services/startup-output-tracker.ts +54 -0
  172. package/src/services/startup-paint-tracker.ts +115 -0
  173. package/src/services/startup-persisted-conversation-queue.ts +45 -0
  174. package/src/services/startup-settled-gate.ts +67 -0
  175. package/src/services/startup-shutdown.ts +53 -0
  176. package/src/services/startup-span-tracker.ts +77 -0
  177. package/src/services/startup-state-hydration.ts +94 -0
  178. package/src/services/startup-visibility.ts +35 -0
  179. package/src/services/status-timeline-recorder.ts +144 -0
  180. package/src/services/task-pane-selection-actions.ts +153 -0
  181. package/src/services/task-planning-hydration.ts +58 -0
  182. package/src/services/task-planning-observed-events.ts +89 -0
  183. package/src/services/workspace-observed-events.ts +113 -0
  184. package/src/store/control-plane-store-normalize.ts +760 -0
  185. package/src/store/control-plane-store-types.ts +224 -0
  186. package/src/store/control-plane-store.ts +2951 -0
  187. package/src/store/event-store.ts +253 -0
  188. package/src/store/sqlite.ts +81 -0
  189. package/src/terminal/compat-matrix.ts +345 -0
  190. package/src/terminal/differential-checkpoints.ts +132 -0
  191. package/src/terminal/parity-suite.ts +441 -0
  192. package/src/terminal/snapshot-oracle.ts +1840 -0
  193. package/src/ui/conversation-input-forwarder.ts +114 -0
  194. package/src/ui/conversation-selection-input.ts +103 -0
  195. package/src/ui/debug-footer-notice.ts +39 -0
  196. package/src/ui/global-shortcut-input.ts +126 -0
  197. package/src/ui/input-preflight.ts +68 -0
  198. package/src/ui/input-token-router.ts +312 -0
  199. package/src/ui/input.ts +238 -0
  200. package/src/ui/kit.ts +509 -0
  201. package/src/ui/left-nav-input.ts +80 -0
  202. package/src/ui/left-rail-pointer-input.ts +148 -0
  203. package/src/ui/main-pane-pointer-input.ts +150 -0
  204. package/src/ui/modals/manager.ts +192 -0
  205. package/src/ui/mux-theme.ts +529 -0
  206. package/src/ui/panes/conversation.ts +19 -0
  207. package/src/ui/panes/home-gridfire.ts +302 -0
  208. package/src/ui/panes/home.ts +109 -0
  209. package/src/ui/panes/left-rail.ts +12 -0
  210. package/src/ui/panes/project.ts +44 -0
  211. package/src/ui/pointer-routing-input.ts +158 -0
  212. package/src/ui/repository-fold-input.ts +91 -0
  213. package/src/ui/screen.ts +210 -0
  214. package/src/ui/surface.ts +224 -0
@@ -0,0 +1,224 @@
1
+ import type { PtyExit } from '../pty/pty_host.ts';
2
+ import type {
3
+ StreamSessionRuntimeStatus,
4
+ StreamSessionStatusModel,
5
+ } from '../control-plane/stream-protocol.ts';
6
+ import type { CodexTelemetrySource } from '../control-plane/codex-telemetry.ts';
7
+
8
+ export interface ControlPlaneDirectoryRecord {
9
+ readonly directoryId: string;
10
+ readonly tenantId: string;
11
+ readonly userId: string;
12
+ readonly workspaceId: string;
13
+ readonly path: string;
14
+ readonly createdAt: string;
15
+ readonly archivedAt: string | null;
16
+ }
17
+
18
+ export interface ControlPlaneConversationRecord {
19
+ readonly conversationId: string;
20
+ readonly directoryId: string;
21
+ readonly tenantId: string;
22
+ readonly userId: string;
23
+ readonly workspaceId: string;
24
+ readonly title: string;
25
+ readonly agentType: string;
26
+ readonly createdAt: string;
27
+ readonly archivedAt: string | null;
28
+ readonly runtimeStatus: StreamSessionRuntimeStatus;
29
+ readonly runtimeStatusModel: StreamSessionStatusModel | null;
30
+ readonly runtimeLive: boolean;
31
+ readonly runtimeAttentionReason: string | null;
32
+ readonly runtimeProcessId: number | null;
33
+ readonly runtimeLastEventAt: string | null;
34
+ readonly runtimeLastExit: PtyExit | null;
35
+ readonly adapterState: Record<string, unknown>;
36
+ }
37
+
38
+ export interface ControlPlaneTelemetryRecord {
39
+ readonly telemetryId: number;
40
+ readonly source: CodexTelemetrySource;
41
+ readonly sessionId: string | null;
42
+ readonly providerThreadId: string | null;
43
+ readonly eventName: string | null;
44
+ readonly severity: string | null;
45
+ readonly summary: string | null;
46
+ readonly observedAt: string;
47
+ readonly ingestedAt: string;
48
+ readonly payload: Record<string, unknown>;
49
+ readonly fingerprint: string;
50
+ }
51
+
52
+ export interface ControlPlaneTelemetrySummary {
53
+ readonly source: CodexTelemetrySource;
54
+ readonly eventName: string | null;
55
+ readonly severity: string | null;
56
+ readonly summary: string | null;
57
+ readonly observedAt: string;
58
+ }
59
+
60
+ export type ControlPlaneTaskStatus = 'draft' | 'ready' | 'in-progress' | 'completed';
61
+ export type ControlPlaneTaskScopeKind = 'global' | 'repository' | 'project';
62
+ export type ControlPlaneTaskLinearPriority = 0 | 1 | 2 | 3 | 4;
63
+ export type ControlPlaneProjectTaskFocusMode = 'balanced' | 'own-only';
64
+ export type ControlPlaneProjectThreadSpawnMode = 'new-thread' | 'reuse-thread';
65
+ export type ControlPlaneAutomationPolicyScope = 'global' | 'repository' | 'project';
66
+ export type ControlPlaneGitHubPrState = 'open' | 'closed';
67
+ export type ControlPlaneGitHubCiRollup =
68
+ | 'pending'
69
+ | 'success'
70
+ | 'failure'
71
+ | 'cancelled'
72
+ | 'neutral'
73
+ | 'none';
74
+
75
+ export interface ControlPlaneTaskLinearRecord {
76
+ readonly issueId: string | null;
77
+ readonly identifier: string | null;
78
+ readonly url: string | null;
79
+ readonly teamId: string | null;
80
+ readonly projectId: string | null;
81
+ readonly projectMilestoneId: string | null;
82
+ readonly cycleId: string | null;
83
+ readonly stateId: string | null;
84
+ readonly assigneeId: string | null;
85
+ readonly priority: ControlPlaneTaskLinearPriority | null;
86
+ readonly estimate: number | null;
87
+ readonly dueDate: string | null;
88
+ readonly labelIds: readonly string[];
89
+ }
90
+
91
+ export interface TaskLinearInput {
92
+ issueId?: string | null;
93
+ identifier?: string | null;
94
+ url?: string | null;
95
+ teamId?: string | null;
96
+ projectId?: string | null;
97
+ projectMilestoneId?: string | null;
98
+ cycleId?: string | null;
99
+ stateId?: string | null;
100
+ assigneeId?: string | null;
101
+ priority?: number | null;
102
+ estimate?: number | null;
103
+ dueDate?: string | null;
104
+ labelIds?: readonly string[] | null;
105
+ }
106
+
107
+ export interface ControlPlaneRepositoryRecord {
108
+ readonly repositoryId: string;
109
+ readonly tenantId: string;
110
+ readonly userId: string;
111
+ readonly workspaceId: string;
112
+ readonly name: string;
113
+ readonly remoteUrl: string;
114
+ readonly defaultBranch: string;
115
+ readonly metadata: Record<string, unknown>;
116
+ readonly createdAt: string;
117
+ readonly archivedAt: string | null;
118
+ }
119
+
120
+ export interface ControlPlaneTaskRecord {
121
+ readonly taskId: string;
122
+ readonly tenantId: string;
123
+ readonly userId: string;
124
+ readonly workspaceId: string;
125
+ readonly repositoryId: string | null;
126
+ readonly scopeKind: ControlPlaneTaskScopeKind;
127
+ readonly projectId: string | null;
128
+ readonly title: string;
129
+ readonly description: string;
130
+ readonly status: ControlPlaneTaskStatus;
131
+ readonly orderIndex: number;
132
+ readonly claimedByControllerId: string | null;
133
+ readonly claimedByDirectoryId: string | null;
134
+ readonly branchName: string | null;
135
+ readonly baseBranch: string | null;
136
+ readonly claimedAt: string | null;
137
+ readonly completedAt: string | null;
138
+ readonly linear: ControlPlaneTaskLinearRecord;
139
+ readonly createdAt: string;
140
+ readonly updatedAt: string;
141
+ }
142
+
143
+ export interface ControlPlaneProjectSettingsRecord {
144
+ readonly directoryId: string;
145
+ readonly tenantId: string;
146
+ readonly userId: string;
147
+ readonly workspaceId: string;
148
+ readonly pinnedBranch: string | null;
149
+ readonly taskFocusMode: ControlPlaneProjectTaskFocusMode;
150
+ readonly threadSpawnMode: ControlPlaneProjectThreadSpawnMode;
151
+ readonly createdAt: string;
152
+ readonly updatedAt: string;
153
+ }
154
+
155
+ export interface ControlPlaneAutomationPolicyRecord {
156
+ readonly policyId: string;
157
+ readonly tenantId: string;
158
+ readonly userId: string;
159
+ readonly workspaceId: string;
160
+ readonly scope: ControlPlaneAutomationPolicyScope;
161
+ readonly scopeId: string | null;
162
+ readonly automationEnabled: boolean;
163
+ readonly frozen: boolean;
164
+ readonly createdAt: string;
165
+ readonly updatedAt: string;
166
+ }
167
+
168
+ export interface ControlPlaneGitHubPullRequestRecord {
169
+ readonly prRecordId: string;
170
+ readonly tenantId: string;
171
+ readonly userId: string;
172
+ readonly workspaceId: string;
173
+ readonly repositoryId: string;
174
+ readonly directoryId: string | null;
175
+ readonly owner: string;
176
+ readonly repo: string;
177
+ readonly number: number;
178
+ readonly title: string;
179
+ readonly url: string;
180
+ readonly authorLogin: string | null;
181
+ readonly headBranch: string;
182
+ readonly headSha: string;
183
+ readonly baseBranch: string;
184
+ readonly state: ControlPlaneGitHubPrState;
185
+ readonly isDraft: boolean;
186
+ readonly ciRollup: ControlPlaneGitHubCiRollup;
187
+ readonly createdAt: string;
188
+ readonly updatedAt: string;
189
+ readonly closedAt: string | null;
190
+ readonly observedAt: string;
191
+ }
192
+
193
+ export interface ControlPlaneGitHubPrJobRecord {
194
+ readonly jobRecordId: string;
195
+ readonly tenantId: string;
196
+ readonly userId: string;
197
+ readonly workspaceId: string;
198
+ readonly repositoryId: string;
199
+ readonly prRecordId: string;
200
+ readonly provider: 'check-run' | 'status-context';
201
+ readonly externalId: string;
202
+ readonly name: string;
203
+ readonly status: string;
204
+ readonly conclusion: string | null;
205
+ readonly url: string | null;
206
+ readonly startedAt: string | null;
207
+ readonly completedAt: string | null;
208
+ readonly observedAt: string;
209
+ readonly updatedAt: string;
210
+ }
211
+
212
+ export interface ControlPlaneGitHubSyncStateRecord {
213
+ readonly stateId: string;
214
+ readonly tenantId: string;
215
+ readonly userId: string;
216
+ readonly workspaceId: string;
217
+ readonly repositoryId: string;
218
+ readonly directoryId: string | null;
219
+ readonly branchName: string;
220
+ readonly lastSyncAt: string;
221
+ readonly lastSuccessAt: string | null;
222
+ readonly lastError: string | null;
223
+ readonly lastErrorAt: string | null;
224
+ }