@oar-sh/oar 0.9.2 → 0.9.3

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/CHANGELOG.md +269 -0
  2. package/README.md +407 -424
  3. package/bin/oar.js +25 -10
  4. package/package.json +7 -4
  5. package/server/README.md +1 -1
  6. package/server/claude-worker/claude-session-process.mjs +981 -44
  7. package/server/claude-worker/claude-session-worker.mjs +45 -4
  8. package/server/claude-worker/claude-turn-publisher.mjs +81 -20
  9. package/server/claude-worker/claude-worker-link-wiring.mjs +9 -0
  10. package/server/copilot-worker/copilot-ask-user-tool.mjs +89 -0
  11. package/server/copilot-worker/copilot-continuation-signals.mjs +55 -0
  12. package/server/copilot-worker/copilot-question-bridge.mjs +34 -12
  13. package/server/copilot-worker/copilot-sdk-event-normalizer.mjs +101 -12
  14. package/server/copilot-worker/copilot-sdk-session-process.mjs +2269 -492
  15. package/server/copilot-worker/copilot-sdk-session-worker.mjs +82 -20
  16. package/server/db-schema.mjs +20 -0
  17. package/server/migrations/0004-steer-settle-markers.mjs +119 -0
  18. package/server/public/app/api-client.js +22 -2
  19. package/server/public/app/ask-user-view.js +102 -13
  20. package/server/public/app/attachments-view.js +37 -2
  21. package/server/public/app/background-task-timeout-options.mjs +9 -0
  22. package/server/public/app/background-tasks-view.mjs +33 -18
  23. package/server/public/app/bootstrap.js +34 -8
  24. package/server/public/app/composer-control-state.mjs +52 -34
  25. package/server/public/app/conversation-draft-sync.mjs +187 -0
  26. package/server/public/app/conversation-list-filter.mjs +86 -0
  27. package/server/public/app/conversation-provider-indicator.mjs +8 -0
  28. package/server/public/app/conversation-view.js +919 -194
  29. package/server/public/app/emoji-view.js +2 -0
  30. package/server/public/app/font-scaling.js +4 -37
  31. package/server/public/app/journal-view.js +145 -5
  32. package/server/public/app/model-selector-options.mjs +1 -1
  33. package/server/public/app/question-multi-select.mjs +52 -0
  34. package/server/public/app/relay-prompt-sanitizer.mjs +17 -2
  35. package/server/public/app/settings-modal.js +8 -6
  36. package/server/public/app/socket-handlers.js +19 -0
  37. package/server/public/app/steered-turn-merge.mjs +100 -0
  38. package/server/public/app/store.js +126 -15
  39. package/server/public/app/sync-outbox.mjs +16 -8
  40. package/server/public/app/tool-activity-emoji.mjs +36 -0
  41. package/server/public/app/transcript-viewport-anchor.mjs +210 -0
  42. package/server/public/index.html +206 -9
  43. package/server/public/sw.js +7 -0
  44. package/server/relay-tools.md +2 -0
  45. package/server/repositories/message-repository.mjs +61 -18
  46. package/server/repositories/question-repository.mjs +15 -0
  47. package/server/repositories/session-repository.mjs +7 -31
  48. package/server/routes/messages-routes.mjs +488 -46
  49. package/server/routes/sessions-routes.mjs +298 -55
  50. package/server/server-runtime.mjs +65 -25
  51. package/server/services/live-turn-picker.mjs +47 -0
  52. package/server/services/relay-prompt-sanitizer.mjs +17 -2
  53. package/server/services/relay-question-context.mjs +46 -0
  54. package/server/services/sdk-session-import-service.mjs +49 -7
  55. package/server/services/session-worker-registry-service.mjs +75 -0
  56. package/server/services/session-worker-supervisor-service.mjs +7 -1
  57. package/server/services/session-worker-websocket-service.mjs +23 -1
  58. package/server/services/steer-resend.mjs +45 -0
  59. package/shared/background-task-timeout.mjs +12 -4
  60. package/shared/control-poller.mjs +4 -1
  61. package/shared/question-multi-select.mjs +16 -0
  62. package/shared/relay-stop-failure.mjs +15 -0
  63. package/shared/slash-command-guard.mjs +76 -0
  64. package/shared/steer-note.mjs +66 -0
  65. package/shared/steer-settle-failure.mjs +89 -0
  66. package/shared/steer-settle-markers.mjs +18 -0
  67. package/shared/worker-crash-guard.mjs +40 -25
  68. package/shared/worker-runtime/heartbeat.mjs +55 -1
  69. package/shared/worker-runtime/runner-link-wiring.mjs +44 -0
  70. package/shared/worker-runtime/worker-websocket-link.mjs +119 -8
  71. package/server/claude-worker/claude-session-test-harness.mjs +0 -250
  72. package/server/claude-worker/fixtures/workflow-run-record.json +0 -1
  73. package/server/copilot-worker/copilot-sdk-test-harness.mjs +0 -382
  74. package/server/copilot-worker/fixtures/abort-turn.json +0 -588
  75. package/server/copilot-worker/fixtures/ask-user-turn.json +0 -1154
  76. package/server/copilot-worker/fixtures/background-timer-continuation.json +0 -445
  77. package/server/copilot-worker/fixtures/background-timer-turn.json +0 -497
  78. package/server/copilot-worker/fixtures/happy-turn.json +0 -566
  79. package/server/copilot-worker/fixtures/quota-turn.json +0 -647
  80. package/server/copilot-worker/fixtures/reasoning-turn.json +0 -625
  81. package/server/copilot-worker/fixtures/resume-turn.json +0 -700
  82. package/server/copilot-worker/fixtures/subagent-turn.json +0 -1378
  83. package/server/copilot-worker/fixtures/tool-permission-turn.json +0 -1293
  84. package/server/routes/messages-routes-test-harness.mjs +0 -111
  85. package/server/services/fixtures/claude-auth-stub.cmd +0 -1
  86. package/server/services/fixtures/claude-auth-stub.mjs +0 -76
  87. package/server/services/fixtures/claude-auth-stub.sh +0 -4
  88. package/server/services/fixtures/cli-install-stub.cmd +0 -1
  89. package/server/services/fixtures/cli-install-stub.mjs +0 -98
  90. package/server/services/fixtures/cli-install-stub.sh +0 -4
  91. package/server/services/fixtures/grok-stub.cmd +0 -1
  92. package/server/services/fixtures/grok-stub.mjs +0 -89
  93. package/server/services/fixtures/grok-stub.sh +0 -4
  94. package/shared/fixtures/copilot-catalog-raw-2026-09-07.json +0 -2363
@@ -1,445 +0,0 @@
1
- [
2
- {
3
- "type": "system.notification",
4
- "data": {
5
- "content": "<system_notification>\nDetached shell \"Wait one minute for the requested timer\" (shellId: 1) has completed. Use read_bash with shellId \"1\" to retrieve its output and exit code.\n</system_notification>",
6
- "kind": {
7
- "type": "shell_detached_completed",
8
- "shellId": "1",
9
- "description": "Wait one minute for the requested timer"
10
- }
11
- },
12
- "id": "9718510f-f3dd-4a09-be19-8b466e7528cb",
13
- "timestamp": "2026-08-31T14:24:20.843Z",
14
- "parentId": "3c68df7e-54eb-4cf9-a3a4-0b2db5cebd2d"
15
- },
16
- {
17
- "type": "system.message",
18
- "data": {
19
- "role": "system",
20
- "content": "<system prompt elided>",
21
- "interactionId": "ef0f9e8d-5f19-45a2-9c79-045785470c60"
22
- },
23
- "id": "8d3a34d1-7f87-44e5-8b46-97ad9844cf30",
24
- "timestamp": "2026-08-31T14:24:20.844Z",
25
- "parentId": "9718510f-f3dd-4a09-be19-8b466e7528cb"
26
- },
27
- {
28
- "type": "assistant.turn_start",
29
- "data": {
30
- "turnId": "0",
31
- "interactionId": "ef0f9e8d-5f19-45a2-9c79-045785470c60"
32
- },
33
- "id": "6ddc442a-a525-4702-bb8e-9a9a6e01ba5e",
34
- "timestamp": "2026-08-31T14:24:20.846Z",
35
- "parentId": "8d3a34d1-7f87-44e5-8b46-97ad9844cf30"
36
- },
37
- {
38
- "type": "assistant.message",
39
- "data": {
40
- "messageId": "bc093279-9c5b-4ff8-82ab-0a0a200367eb",
41
- "model": "gpt-5.6-luna",
42
- "content": "",
43
- "toolRequests": [
44
- {
45
- "toolCallId": "call_Hh2pB3NjFaXzsTqHTRbs28Sr",
46
- "name": "read_bash",
47
- "arguments": {
48
- "shellId": "1",
49
- "delay": 1
50
- },
51
- "type": "function",
52
- "intentionSummary": "Waiting up to 1 second for command output",
53
- "toolTitle": "Read shell output"
54
- }
55
- ],
56
- "interactionId": "ef0f9e8d-5f19-45a2-9c79-045785470c60",
57
- "turnId": "0",
58
- "rte": true,
59
- "apiCallId": "C2c1KiMJOacgll8Wa91HeAEsW2aJBfJuJ2np91aeALpTLWA03oU6eC/fL+6MhlCA8wHpBty7PRv55pq5t788S3qkBIooxXkLN8L2M3Qr4HA43JhtmIllA15h0cAMNkZ+HTyaUpvQVb1oLw5V8eIJePUaLLg4dI7foUlzNs/2Svqb6sTkSWH4nyVM2LYxIA6kdbGZC2x0YJp5DdD8ZvLauLm7O2HE7ZTKITv81G+zAJfLBopUBr9ap3xfKcLJ4lM+8UJe0kG2jZssiFLFHNNA04RG6okIt2vd2cJD3/Y8jXbgXR8eugVkeaU45fLbQuX5b5rcN8b7Hyel0lK7JzSpWa7JGqKCV5jyboGp7ZCOldLufcRRP/rjeA+n0XQh4PNbY+Oz7sJoZbfr/eRfwd8Ysc798iZD1Bu6Z+naf4wX933s4szucW6QxxOc2cRllr9qquEdn/E8cKsfFzsB0oKakrx2TD2OYqOlBiaA7SInkQ=="
60
- },
61
- "id": "a4c433ab-05c1-4f6a-95e0-39942cf0f88d",
62
- "timestamp": "2026-08-31T14:24:23.114Z",
63
- "parentId": "6ddc442a-a525-4702-bb8e-9a9a6e01ba5e"
64
- },
65
- {
66
- "type": "tool.execution_start",
67
- "data": {
68
- "toolCallId": "call_Hh2pB3NjFaXzsTqHTRbs28Sr",
69
- "toolName": "read_bash",
70
- "arguments": {
71
- "shellId": "1",
72
- "delay": 1
73
- },
74
- "turnId": "0",
75
- "model": "gpt-5.6-luna",
76
- "toolTitle": "Read shell output"
77
- },
78
- "id": "6f8c9443-8629-4092-a665-d9ef013637ac",
79
- "timestamp": "2026-08-31T14:24:23.116Z",
80
- "parentId": "a4c433ab-05c1-4f6a-95e0-39942cf0f88d"
81
- },
82
- {
83
- "type": "tool.execution_complete",
84
- "data": {
85
- "toolCallId": "call_Hh2pB3NjFaXzsTqHTRbs28Sr",
86
- "model": "gpt-5.6-luna",
87
- "interactionId": "ef0f9e8d-5f19-45a2-9c79-045785470c60",
88
- "turnId": "0",
89
- "rte": true,
90
- "success": true,
91
- "result": {
92
- "content": "Output:\nTimer fired after 1 minute.\n<detached command with shellId: 1 completed with exit code 0>",
93
- "detailedContent": "Output:\nTimer fired after 1 minute.\n<detached command with shellId: 1 completed with exit code 0>"
94
- },
95
- "toolTelemetry": {
96
- "properties": {
97
- "read_target_state": "active",
98
- "read_target_original_mode": "async"
99
- },
100
- "restrictedProperties": {}
101
- }
102
- },
103
- "id": "13dcde40-ab42-49c3-be0b-19cc2d7ec4c8",
104
- "timestamp": "2026-08-31T14:24:23.119Z",
105
- "parentId": "6f8c9443-8629-4092-a665-d9ef013637ac"
106
- },
107
- {
108
- "type": "assistant.turn_end",
109
- "data": {
110
- "turnId": "0"
111
- },
112
- "id": "20b90e67-9725-458b-9773-67557d084b40",
113
- "timestamp": "2026-08-31T14:24:23.122Z",
114
- "parentId": "13dcde40-ab42-49c3-be0b-19cc2d7ec4c8"
115
- },
116
- {
117
- "type": "assistant.turn_start",
118
- "data": {
119
- "turnId": "1",
120
- "interactionId": "ef0f9e8d-5f19-45a2-9c79-045785470c60"
121
- },
122
- "id": "527ac096-a704-4c25-a434-8c42b69a5391",
123
- "timestamp": "2026-08-31T14:24:23.122Z",
124
- "parentId": "20b90e67-9725-458b-9773-67557d084b40"
125
- },
126
- {
127
- "type": "assistant.message",
128
- "data": {
129
- "messageId": "11076e47-37ed-4d57-a7bd-326c34321993",
130
- "model": "gpt-5.6-luna",
131
- "content": "⏰ The 1-minute timer fired.",
132
- "toolRequests": [],
133
- "interactionId": "ef0f9e8d-5f19-45a2-9c79-045785470c60",
134
- "turnId": "1",
135
- "phase": "final_answer",
136
- "rte": true,
137
- "apiCallId": "0JECOlpIuTgGOy6s6zrLVL9CcTknzPc8UY2wNRhNgivB6OcGT13yiAE8opiQwdiP950wWc0dgDBT1XZbd2/JONLg9OheINjBm38S+8fmKLCNZ9P7E2o35GyCMOHLvhR+G9Fo43hqxjrpijL5qFphMT8g0YOAs1hQF/2kuCFwFnJJVTYPFvOWti2AZ6bRel4sp/5RNrpbfxdh/fe2dwduFdrLt/um2WpGEf+kL5pl87UpvGzJ31bUvcCT3rg/pxGs6Erg0izl/4fpuMxmMcjkNPNolHssUnG82iShvLeE5WnrSmvaSIftyebKjJlMqnI8cxgUoswSNnX/LGhZuMKDbMjAlJqOAccLcgOCi4oICtRl9OtVexJumdiXQ7CA/wqM7tdoLv++PJkmkxon6yuyGZNIfACS65blPdSXPoTIV+nUHrI2kJ3PvgNOFZZMDvEbMYQx36xRKpi6QOu3CHQ+nroIwpK23lBAMD6Zgs1yag==",
138
- "serverTools": {
139
- "provider": "openai-responses"
140
- }
141
- },
142
- "id": "53fed53c-189c-4723-a7b1-1e50cde947f7",
143
- "timestamp": "2026-08-31T14:24:24.160Z",
144
- "parentId": "527ac096-a704-4c25-a434-8c42b69a5391"
145
- },
146
- {
147
- "type": "assistant.turn_end",
148
- "data": {
149
- "turnId": "1"
150
- },
151
- "id": "39a52877-6e2e-4cce-8af9-5f26452af553",
152
- "timestamp": "2026-08-31T14:24:24.162Z",
153
- "parentId": "53fed53c-189c-4723-a7b1-1e50cde947f7"
154
- },
155
- {
156
- "type": "session.usage_checkpoint",
157
- "data": {
158
- "totalNanoAiu": 971665000,
159
- "totalPremiumRequests": 2,
160
- "modelCacheState": [
161
- {
162
- "modelId": "gpt-5.6-luna",
163
- "cacheExpiresAt": "2026-08-31T14:54:23.158Z",
164
- "cacheTtlSeconds": 1800
165
- }
166
- ],
167
- "promptCacheBreakState": [
168
- {
169
- "conversation": "main",
170
- "models": {
171
- "gpt-5.6-luna": {
172
- "model": "gpt-5.6-luna",
173
- "vendor": "openai",
174
- "model_call_id": "0JECOlpIuTgGOy6s6zrLVL9CcTknzPc8UY2wNRhNgivB6OcGT13yiAE8opiQwdiP950wWc0dgDBT1XZbd2/JONLg9OheINjBm38S+8fmKLCNZ9P7E2o35GyCMOHLvhR+G9Fo43hqxjrpijL5qFphMT8g0YOAs1hQF/2kuCFwFnJJVTYPFvOWti2AZ6bRel4sp/5RNrpbfxdh/fe2dwduFdrLt/um2WpGEf+kL5pl87UpvGzJ31bUvcCT3rg/pxGs6Erg0izl/4fpuMxmMcjkNPNolHssUnG82iShvLeE5WnrSmvaSIftyebKjJlMqnI8cxgUoswSNnX/LGhZuMKDbMjAlJqOAccLcgOCi4oICtRl9OtVexJumdiXQ7CA/wqM7tdoLv++PJkmkxon6yuyGZNIfACS65blPdSXPoTIV+nUHrI2kJ3PvgNOFZZMDvEbMYQx36xRKpi6QOu3CHQ+nroIwpK23lBAMD6Zgs1yag==",
175
- "request_id": "00000-5c71bcdf-3e4e-42c4-8c17-cb4bfb065f4a",
176
- "github_request_id": "196adc63-c9f4-4154-868b-f2c2cd6d4daa",
177
- "api_endpoint": "ws:/responses",
178
- "transport": "websocket",
179
- "session_mode": "interactive",
180
- "reasoning_effort": "medium",
181
- "initiator": "agent",
182
- "tool_count": 22,
183
- "tool_tokens": 7964,
184
- "tools": [
185
- {
186
- "name": "bash",
187
- "schema_hash": "8071f13f1f8b",
188
- "safe": true
189
- },
190
- {
191
- "name": "read_bash",
192
- "schema_hash": "78bdc74b3707",
193
- "safe": true
194
- },
195
- {
196
- "name": "stop_bash",
197
- "schema_hash": "dd8c0c97e7c9",
198
- "safe": true
199
- },
200
- {
201
- "name": "list_bash",
202
- "schema_hash": "3209638ac5d6",
203
- "safe": true
204
- },
205
- {
206
- "name": "apply_patch",
207
- "schema_hash": "82b4475374ff",
208
- "safe": true
209
- },
210
- {
211
- "name": "view",
212
- "schema_hash": "bce2bfaab6ba",
213
- "safe": true
214
- },
215
- {
216
- "name": "web_fetch",
217
- "schema_hash": "a0829f05c5fd",
218
- "safe": true
219
- },
220
- {
221
- "name": "skill",
222
- "schema_hash": "970ef5551151",
223
- "safe": true
224
- },
225
- {
226
- "name": "ask_user",
227
- "schema_hash": "c45aacfa3e3d",
228
- "safe": true
229
- },
230
- {
231
- "name": "sql",
232
- "schema_hash": "c2a06c9d4c62",
233
- "safe": true
234
- },
235
- {
236
- "name": "read_agent",
237
- "schema_hash": "0cc5a3205bfc",
238
- "safe": true
239
- },
240
- {
241
- "name": "list_agents",
242
- "schema_hash": "e83edd8ed50f",
243
- "safe": true
244
- },
245
- {
246
- "name": "write_agent",
247
- "schema_hash": "1db3ce5292e0",
248
- "safe": true
249
- },
250
- {
251
- "name": "rg",
252
- "schema_hash": "32552e28c37f",
253
- "safe": true
254
- },
255
- {
256
- "name": "glob",
257
- "schema_hash": "0b44fa8a5cf4",
258
- "safe": true
259
- },
260
- {
261
- "name": "task",
262
- "schema_hash": "b7751998643e",
263
- "safe": false
264
- },
265
- {
266
- "name": "github-mcp-server-get_copilot_space",
267
- "schema_hash": "c8adccdafb84",
268
- "safe": true
269
- },
270
- {
271
- "name": "github-mcp-server-get_file_contents",
272
- "schema_hash": "6cf17f9abfd4",
273
- "safe": true
274
- },
275
- {
276
- "name": "github-mcp-server-list_copilot_spaces",
277
- "schema_hash": "32e5d3fd470f",
278
- "safe": true
279
- },
280
- {
281
- "name": "github-mcp-server-search_code",
282
- "schema_hash": "679d4765fec5",
283
- "safe": true
284
- },
285
- {
286
- "name": "github-mcp-server-search_users",
287
- "schema_hash": "da0cf089bedb",
288
- "safe": true
289
- },
290
- {
291
- "name": "web_search",
292
- "schema_hash": "cb18d98a639a",
293
- "safe": true
294
- }
295
- ],
296
- "tools_truncated": 0,
297
- "system_segments": [
298
- {
299
- "segment": "identity",
300
- "hash": "fe1711f6f31c",
301
- "tokens": 754
302
- },
303
- {
304
- "segment": "version_information",
305
- "hash": "13746b2fa56e",
306
- "tokens": 9
307
- },
308
- {
309
- "segment": "model_information",
310
- "hash": "4dfb83d40484",
311
- "tokens": 83
312
- },
313
- {
314
- "segment": "environment_context",
315
- "hash": "1d572ecf0169",
316
- "tokens": 60
317
- },
318
- {
319
- "segment": "code_change_instructions",
320
- "hash": "8882f6eb1325",
321
- "tokens": 667
322
- },
323
- {
324
- "segment": "dynamic_guidelines",
325
- "hash": "47926a65fcda",
326
- "tokens": 78
327
- },
328
- {
329
- "segment": "environment_limitations",
330
- "hash": "9d9ae1650158",
331
- "tokens": 235
332
- },
333
- {
334
- "segment": "tool_intro",
335
- "hash": "2c07d9f78963",
336
- "tokens": 20
337
- },
338
- {
339
- "segment": "tool_instructions",
340
- "hash": "c46fe9f18b7d",
341
- "tokens": 3808
342
- },
343
- {
344
- "segment": "custom_instructions",
345
- "hash": "01ba4719c80b",
346
- "tokens": 1
347
- },
348
- {
349
- "segment": "additional_instructions",
350
- "hash": "d2172871b2d3",
351
- "tokens": 1521
352
- },
353
- {
354
- "segment": "final_instructions",
355
- "hash": "42885e06aebe",
356
- "tokens": 223
357
- }
358
- ],
359
- "conversation": {
360
- "message_count": 11,
361
- "points": [
362
- {
363
- "index": 0,
364
- "hash": "b7418648e048"
365
- },
366
- {
367
- "index": 1,
368
- "hash": "906e64ad2fb2"
369
- },
370
- {
371
- "index": 2,
372
- "hash": "fa56b0c92c8c"
373
- },
374
- {
375
- "index": 3,
376
- "hash": "5689fc5ca33e"
377
- },
378
- {
379
- "index": 4,
380
- "hash": "7d018ae09713"
381
- },
382
- {
383
- "index": 5,
384
- "hash": "fc75a9a38800"
385
- },
386
- {
387
- "index": 6,
388
- "hash": "7fc43fa73e94"
389
- },
390
- {
391
- "index": 7,
392
- "hash": "cb7cffaf96f0"
393
- },
394
- {
395
- "index": 8,
396
- "hash": "e66aee3cca50"
397
- },
398
- {
399
- "index": 9,
400
- "hash": "a481de3dc0a3"
401
- },
402
- {
403
- "index": 10,
404
- "hash": "44646d1cb325"
405
- }
406
- ]
407
- },
408
- "cache_config": {
409
- "arm": "control",
410
- "marks_system_prompt": false,
411
- "marks_conversation": false,
412
- "advisor_tool": false,
413
- "incremental_input": true
414
- },
415
- "prompt_tokens": 15763,
416
- "cache_read": 15686,
417
- "cache_write": 74,
418
- "cache_details_reported": true,
419
- "frontier_tokens": 15760,
420
- "frontier_source": "reported_writes",
421
- "ttl_seconds": 1800,
422
- "cache_expires_at": "2026-08-31T14:54:23.158Z",
423
- "completed_at": "2026-08-31T14:24:24.157Z"
424
- }
425
- },
426
- "lastActiveModel": "gpt-5.6-luna",
427
- "pendingRewriteSources": []
428
- }
429
- ]
430
- },
431
- "id": "c2791aef-b2d0-4d6a-b4cb-bb409475d7b7",
432
- "timestamp": "2026-08-31T14:24:24.166Z",
433
- "parentId": "39a52877-6e2e-4cce-8af9-5f26452af553"
434
- },
435
- {
436
- "type": "session.idle",
437
- "data": {
438
- "aborted": false
439
- },
440
- "id": "idle-continuation",
441
- "timestamp": "2026-08-31T14:24:24.300Z",
442
- "parentId": null,
443
- "ephemeral": true
444
- }
445
- ]