@oxgeneral/orch 0.3.2 → 0.3.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 (64) hide show
  1. package/dist/App-NN7HR7UE.js +20 -0
  2. package/dist/chunk-3MQNQ7QW.js +2 -0
  3. package/dist/{chunk-2UC4SVJB.js → chunk-BGHCY7WY.js} +7 -3
  4. package/dist/chunk-BGHCY7WY.js.map +1 -0
  5. package/dist/chunk-IS3YBE2B.js +3 -0
  6. package/dist/chunk-KPCT44WU.js +2 -0
  7. package/dist/chunk-NLQAJ7TW.js +147 -0
  8. package/dist/chunk-NLQAJ7TW.js.map +1 -0
  9. package/dist/{chunk-ZA5Z33GO.js → chunk-OQKREZUF.js} +1 -1
  10. package/dist/chunk-QFKVCNKL.js +2 -0
  11. package/dist/{chunk-MGFMVPRD.js → chunk-S3QYSBW4.js} +11 -4
  12. package/dist/chunk-S3QYSBW4.js.map +1 -0
  13. package/dist/{chunk-QEEM67OA.js → chunk-UIJYU3J7.js} +3 -3
  14. package/dist/{chunk-QEEM67OA.js.map → chunk-UIJYU3J7.js.map} +1 -1
  15. package/dist/claude-GQZNDJ6L.js +2 -0
  16. package/dist/{claude-RIB3RQS5.js → claude-INM52PTH.js} +13 -7
  17. package/dist/claude-INM52PTH.js.map +1 -0
  18. package/dist/cli.js +1 -1
  19. package/dist/{clipboard-service-PDTSZIR5.js → clipboard-service-MYLSWM5E.js} +1 -1
  20. package/dist/{codex-VBUSA2GJ.js → codex-QGH2GRV6.js} +17 -9
  21. package/dist/codex-QGH2GRV6.js.map +1 -0
  22. package/dist/codex-SJV7ZZBY.js +2 -0
  23. package/dist/container-NEKK5W2B.js +6 -0
  24. package/dist/cursor-4JQOCP5X.js +2 -0
  25. package/dist/{cursor-4QIOTDBW.js → cursor-KQJTQ73D.js} +11 -6
  26. package/dist/cursor-KQJTQ73D.js.map +1 -0
  27. package/dist/{doctor-KBK5JZBZ.js → doctor-UAII4VWN.js} +1 -1
  28. package/dist/index.d.ts +53 -41
  29. package/dist/index.js +13 -11
  30. package/dist/index.js.map +1 -1
  31. package/dist/{init-WRDFAFS2.js → init-2D4RAN7B.js} +1 -1
  32. package/dist/{logs-5QHJWMEG.js → logs-UXFXVYCP.js} +1 -1
  33. package/dist/orchestrator-KF4UY5GD.js +5 -0
  34. package/dist/{orchestrator-FGGXK3N3.js.map → orchestrator-KF4UY5GD.js.map} +1 -1
  35. package/dist/{orchestrator-R7IWZUT6.js → orchestrator-MFL3XK5L.js} +4 -4
  36. package/dist/shell-F42UUF3U.js +2 -0
  37. package/dist/{shell-IH2MMTVP.js → shell-UXJNTNBC.js} +7 -4
  38. package/dist/shell-UXJNTNBC.js.map +1 -0
  39. package/dist/{task-J6ZN7ALI.js → task-AP2TIOOF.js} +1 -1
  40. package/dist/{tui-LW7WIDE3.js → tui-PIQT4ZZ2.js} +1 -1
  41. package/dist/{workspace-manager-KOOYTO7E.js → workspace-manager-DYN3XJ7X.js} +1 -1
  42. package/dist/{workspace-manager-T6AXG7XL.js → workspace-manager-EVD67GCG.js} +4 -4
  43. package/dist/{workspace-manager-T6AXG7XL.js.map → workspace-manager-EVD67GCG.js.map} +1 -1
  44. package/package.json +1 -1
  45. package/readme.md +1 -1
  46. package/dist/App-YJM5QGP7.js +0 -19
  47. package/dist/chunk-2UC4SVJB.js.map +0 -1
  48. package/dist/chunk-GZ2Q56YZ.js +0 -2
  49. package/dist/chunk-IQXRQBUK.js +0 -83
  50. package/dist/chunk-IQXRQBUK.js.map +0 -1
  51. package/dist/chunk-L3FYR45M.js +0 -2
  52. package/dist/chunk-MGFMVPRD.js.map +0 -1
  53. package/dist/chunk-MNXU3KCD.js +0 -2
  54. package/dist/chunk-UW6GUUE6.js +0 -3
  55. package/dist/claude-E36EGXUV.js +0 -2
  56. package/dist/claude-RIB3RQS5.js.map +0 -1
  57. package/dist/codex-OTZKVESD.js +0 -2
  58. package/dist/codex-VBUSA2GJ.js.map +0 -1
  59. package/dist/container-OIXLFSX2.js +0 -6
  60. package/dist/cursor-3DJA6LWS.js +0 -2
  61. package/dist/cursor-4QIOTDBW.js.map +0 -1
  62. package/dist/orchestrator-FGGXK3N3.js +0 -5
  63. package/dist/shell-EOJBDWTH.js +0 -2
  64. package/dist/shell-IH2MMTVP.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -212,6 +212,7 @@ interface OrchestratorState {
212
212
  version: 1;
213
213
  pid?: number;
214
214
  started_at?: string;
215
+ onboardingCompleted?: boolean;
215
216
  running: Record<string, RunningEntry>;
216
217
  claimed: Set<string>;
217
218
  retry_queue: RetryEntry[];
@@ -228,6 +229,54 @@ interface OrchestratorState {
228
229
  };
229
230
  }
230
231
 
232
+ /**
233
+ * Typed error hierarchy for the orchestrator.
234
+ *
235
+ * Every error carries an exit code (matching CLI_UI_DESIGN.md §11)
236
+ * and an optional hint for the user.
237
+ *
238
+ * Exit codes:
239
+ * 0 - Success
240
+ * 1 - General error
241
+ * 2 - Invalid arguments
242
+ * 3 - Not initialized (.orchestry/ not found)
243
+ * 4 - Lock conflict (orchestrator already running)
244
+ * 5 - Agent error (adapter test failed)
245
+ */
246
+ declare class OrchestryError extends Error {
247
+ readonly exitCode: number;
248
+ readonly hint?: string | undefined;
249
+ constructor(message: string, exitCode: number, hint?: string | undefined);
250
+ }
251
+ declare class NotInitializedError extends OrchestryError {
252
+ constructor();
253
+ }
254
+ declare class TaskNotFoundError extends OrchestryError {
255
+ constructor(taskId: string);
256
+ }
257
+ declare class AgentNotFoundError extends OrchestryError {
258
+ constructor(agentId: string);
259
+ }
260
+ declare class WorkspaceError extends OrchestryError {
261
+ constructor(message: string, hint?: string);
262
+ }
263
+ declare enum AdapterErrorKind {
264
+ ADAPTER_NOT_FOUND = "adapter_not_found",
265
+ AUTH_FAILED = "auth_failed",
266
+ TIMEOUT = "timeout",
267
+ RATE_LIMIT = "rate_limit",
268
+ PROCESS_CRASH = "process_crash",
269
+ SPAWN_FAILED = "spawn_failed",
270
+ UNKNOWN = "unknown"
271
+ }
272
+ interface AdapterErrorHint {
273
+ message: string;
274
+ fix: string;
275
+ doctorHint?: boolean;
276
+ }
277
+ declare const ERROR_HINTS: Record<AdapterErrorKind, AdapterErrorHint>;
278
+ declare function classifyAdapterError(error: string, exitCode?: number): AdapterErrorKind;
279
+
231
280
  /**
232
281
  * Goal domain model.
233
282
  *
@@ -288,14 +337,6 @@ interface CreateMessageInput {
288
337
  reply_to?: string;
289
338
  }
290
339
 
291
- /**
292
- * Orchestrator event system.
293
- *
294
- * All communication between layers goes through typed events.
295
- * The EventBus emits these synchronously; subscribers (TUI, logger,
296
- * run store, state) react independently.
297
- */
298
-
299
340
  type OrchestratorEvent = {
300
341
  type: 'task:created';
301
342
  task: Task;
@@ -338,6 +379,7 @@ type OrchestratorEvent = {
338
379
  runId: string;
339
380
  agentId: string;
340
381
  error: string;
382
+ errorKind?: AdapterErrorKind;
341
383
  } | {
342
384
  type: 'run:retry';
343
385
  runId: string;
@@ -439,38 +481,6 @@ type EventPayload<T extends OrchestratorEventType> = Extract<OrchestratorEvent,
439
481
  type: T;
440
482
  }>;
441
483
 
442
- /**
443
- * Typed error hierarchy for the orchestrator.
444
- *
445
- * Every error carries an exit code (matching CLI_UI_DESIGN.md §11)
446
- * and an optional hint for the user.
447
- *
448
- * Exit codes:
449
- * 0 - Success
450
- * 1 - General error
451
- * 2 - Invalid arguments
452
- * 3 - Not initialized (.orchestry/ not found)
453
- * 4 - Lock conflict (orchestrator already running)
454
- * 5 - Agent error (adapter test failed)
455
- */
456
- declare class OrchestryError extends Error {
457
- readonly exitCode: number;
458
- readonly hint?: string | undefined;
459
- constructor(message: string, exitCode: number, hint?: string | undefined);
460
- }
461
- declare class NotInitializedError extends OrchestryError {
462
- constructor();
463
- }
464
- declare class TaskNotFoundError extends OrchestryError {
465
- constructor(taskId: string);
466
- }
467
- declare class AgentNotFoundError extends OrchestryError {
468
- constructor(agentId: string);
469
- }
470
- declare class WorkspaceError extends OrchestryError {
471
- constructor(message: string, hint?: string);
472
- }
473
-
474
484
  /**
475
485
  * Task state machine — pure functions, no side effects.
476
486
  *
@@ -878,6 +888,7 @@ interface AdapterTestResult {
878
888
  ok: boolean;
879
889
  version?: string;
880
890
  error?: string;
891
+ errorKind?: AdapterErrorKind;
881
892
  details?: Record<string, unknown>;
882
893
  }
883
894
  interface ExecuteParams {
@@ -896,6 +907,7 @@ interface AgentEvent {
896
907
  output: number;
897
908
  total: number;
898
909
  };
910
+ errorKind?: AdapterErrorKind;
899
911
  }
900
912
  interface ExecuteHandle {
901
913
  pid: number;
@@ -1431,4 +1443,4 @@ declare function buildFullContainer(context: CliContext): Promise<Container>;
1431
1443
  */
1432
1444
  declare function buildContainer(context: CliContext): Promise<Container>;
1433
1445
 
1434
- export { AdapterRegistry, type AdapterTestResult, type Agent, type AgentConfig, type AgentEvent, AgentNotFoundError, AgentService, type AgentStats, type AgentStatus, type ApprovalPolicy, type ClipboardContentType, type ClipboardImage, type Container, type CreateAgentInput, type CreateTaskInput, EventBus, type EventPayload, type ExecuteParams, type IAgentAdapter, type LightContainer, NotInitializedError, Orchestrator, type OrchestratorConfig, type OrchestratorEvent, type OrchestratorEventType, type OrchestratorState, OrchestryError, type ProjectConfig, type RetryEntry, type Run, type RunEvent, type RunEventType, RunService, type RunStatus, type RunningEntry, type SchedulingConfig, type Task, TaskNotFoundError, type TaskProof, TaskService, type TaskStatus, type TokenUsage, WorkspaceError, type WorkspaceMode, buildContainer, buildFullContainer, buildLightContainer, canTransition, createTokenUsage, detectClipboardType, getClipboardImage, isBlocked, isClipboardToolAvailable, isDispatchable, isTerminal, resolveFailureStatus };
1446
+ export { type AdapterErrorHint, AdapterErrorKind, AdapterRegistry, type AdapterTestResult, type Agent, type AgentConfig, type AgentEvent, AgentNotFoundError, AgentService, type AgentStats, type AgentStatus, type ApprovalPolicy, type ClipboardContentType, type ClipboardImage, type Container, type CreateAgentInput, type CreateTaskInput, ERROR_HINTS, EventBus, type EventPayload, type ExecuteParams, type IAgentAdapter, type LightContainer, NotInitializedError, Orchestrator, type OrchestratorConfig, type OrchestratorEvent, type OrchestratorEventType, type OrchestratorState, OrchestryError, type ProjectConfig, type RetryEntry, type Run, type RunEvent, type RunEventType, RunService, type RunStatus, type RunningEntry, type SchedulingConfig, type Task, TaskNotFoundError, type TaskProof, TaskService, type TaskStatus, type TokenUsage, WorkspaceError, type WorkspaceMode, buildContainer, buildFullContainer, buildLightContainer, canTransition, classifyAdapterError, createTokenUsage, detectClipboardType, getClipboardImage, isBlocked, isClipboardToolAvailable, isDispatchable, isTerminal, resolveFailureStatus };
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { ensureDir, Paths, readYaml, writeYaml, listFiles, writeJson, readJson, appendJsonl, readJsonl, readJsonlTail, pathExists } from './chunk-QEEM67OA.js';
2
- import { canTransition, isTerminal } from './chunk-2UC4SVJB.js';
3
- export { Orchestrator, canTransition, isBlocked, isDispatchable, isTerminal, resolveFailureStatus } from './chunk-2UC4SVJB.js';
4
- import { InvalidArgumentsError, TaskNotFoundError, InvalidTransitionError, AgentNotFoundError, OrchestryError, TeamNotFoundError, GoalNotFoundError } from './chunk-IQXRQBUK.js';
5
- export { AgentNotFoundError, NotInitializedError, OrchestryError, TaskNotFoundError, WorkspaceError } from './chunk-IQXRQBUK.js';
1
+ import { ensureDir, Paths, readYaml, writeYaml, listFiles, writeJson, readJson, appendJsonl, readJsonl, readJsonlTail, pathExists } from './chunk-UIJYU3J7.js';
2
+ import { canTransition, isTerminal } from './chunk-BGHCY7WY.js';
3
+ export { Orchestrator, canTransition, isBlocked, isDispatchable, isTerminal, resolveFailureStatus } from './chunk-BGHCY7WY.js';
6
4
  import { AUTONOMOUS_LABEL } from './chunk-B4JQM4NU.js';
7
5
  export { AdapterRegistry } from './chunk-6DWHQPTE.js';
8
6
  export { createTokenUsage } from './chunk-XDVMX2FO.js';
7
+ import { InvalidArgumentsError, TaskNotFoundError, InvalidTransitionError, AgentNotFoundError, OrchestryError, TeamNotFoundError, GoalNotFoundError } from './chunk-NLQAJ7TW.js';
8
+ export { AdapterErrorKind, AgentNotFoundError, ERROR_HINTS, NotInitializedError, OrchestryError, TaskNotFoundError, WorkspaceError, classifyAdapterError } from './chunk-NLQAJ7TW.js';
9
9
  import fs, { mkdtemp, readFile, unlink, rm, mkdir } from 'fs/promises';
10
10
  import path, { join } from 'path';
11
11
  import { nanoid } from 'nanoid';
@@ -919,6 +919,7 @@ var RunStore = class {
919
919
  // src/domain/state.ts
920
920
  var DEFAULT_STATE = {
921
921
  version: 1,
922
+ onboardingCompleted: false,
922
923
  running: {},
923
924
  claimed: /* @__PURE__ */ new Set(),
924
925
  retry_queue: [],
@@ -944,6 +945,7 @@ var StateStore = class {
944
945
  version: raw.version ?? defaults.version,
945
946
  pid: raw.pid,
946
947
  started_at: raw.started_at,
948
+ onboardingCompleted: typeof raw.onboardingCompleted === "boolean" ? raw.onboardingCompleted : false,
947
949
  running: raw.running && typeof raw.running === "object" ? raw.running : defaults.running,
948
950
  claimed: Array.isArray(raw.claimed) ? new Set(raw.claimed) : new Set(defaults.claimed),
949
951
  retry_queue: Array.isArray(raw.retry_queue) ? raw.retry_queue : defaults.retry_queue,
@@ -1757,13 +1759,13 @@ async function buildFullContainer(context) {
1757
1759
  ] = await Promise.all([
1758
1760
  import('./process-manager-A36Y7LHP.js'),
1759
1761
  import('./registry-JXXRLJ5J.js'),
1760
- import('./claude-RIB3RQS5.js'),
1761
- import('./codex-VBUSA2GJ.js'),
1762
- import('./cursor-4QIOTDBW.js'),
1763
- import('./shell-IH2MMTVP.js'),
1764
- import('./workspace-manager-T6AXG7XL.js'),
1762
+ import('./claude-INM52PTH.js'),
1763
+ import('./codex-QGH2GRV6.js'),
1764
+ import('./cursor-KQJTQ73D.js'),
1765
+ import('./shell-UXJNTNBC.js'),
1766
+ import('./workspace-manager-EVD67GCG.js'),
1765
1767
  import('./template-engine-MFL5B677.js'),
1766
- import('./orchestrator-FGGXK3N3.js'),
1768
+ import('./orchestrator-KF4UY5GD.js'),
1767
1769
  import('./doctor-service-F2SXDWHS.js')
1768
1770
  ]);
1769
1771
  const processManager = new ProcessManager();