remote-codex 0.11.49 → 0.11.51

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 (38) hide show
  1. package/README.md +38 -5
  2. package/apps/supervisor-api/dist/index.js +2137 -422
  3. package/apps/supervisor-web/dist/assets/index-7LiZQ3aJ.js +22 -0
  4. package/apps/supervisor-web/dist/assets/{index-Dy8PgXgw.css → index-Bg8FdhS1.css} +1 -1
  5. package/apps/supervisor-web/dist/assets/{thread-ui-gcslNXur.js → thread-ui-BbtcUwps.js} +25 -19
  6. package/apps/supervisor-web/dist/index.html +3 -3
  7. package/bin/remote-codex.mjs +4 -2
  8. package/package.json +7 -1
  9. package/packages/acp/src/agent-catalog.test.ts +25 -0
  10. package/packages/acp/src/agent-catalog.ts +3 -1
  11. package/packages/acp/src/capabilities.ts +139 -0
  12. package/packages/acp/src/capability-parity.test.ts +99 -0
  13. package/packages/acp/src/catalog-runtime.test.ts +200 -6
  14. package/packages/acp/src/catalog-runtime.ts +239 -31
  15. package/packages/acp/src/extension-registry.test.ts +198 -0
  16. package/packages/acp/src/extension-registry.ts +285 -0
  17. package/packages/acp/src/extensions.test.ts +45 -0
  18. package/packages/acp/src/extensions.ts +103 -0
  19. package/packages/acp/src/harness-contract.test.ts +81 -0
  20. package/packages/acp/src/harness-contract.ts +62 -0
  21. package/packages/acp/src/index.ts +7 -0
  22. package/packages/acp/src/item-mapper.ts +28 -2
  23. package/packages/acp/src/prompt-content.test.ts +90 -0
  24. package/packages/acp/src/prompt-content.ts +99 -0
  25. package/packages/acp/src/runtimeAdapter.test.ts +458 -5
  26. package/packages/acp/src/runtimeAdapter.ts +791 -60
  27. package/packages/acp/src/session-hydrator.test.ts +135 -0
  28. package/packages/acp/src/session-hydrator.ts +147 -0
  29. package/packages/acp/src/terminal-service.test.ts +21 -2
  30. package/packages/acp/src/terminal-service.ts +23 -3
  31. package/packages/acp/src/test/fixtures/fake-acp-agent.mjs +514 -0
  32. package/packages/acp/src/workspace-boundary.test.ts +32 -0
  33. package/packages/acp/src/workspace-boundary.ts +47 -0
  34. package/packages/agent-runtime/src/types.ts +61 -1
  35. package/packages/db/src/repositories.ts +3 -2
  36. package/packages/shared/src/index.ts +32 -1
  37. package/scripts/service-manager.mjs +13 -0
  38. package/apps/supervisor-web/dist/assets/index-DZI1aSXo.js +0 -22
@@ -39,6 +39,11 @@ export interface AgentRuntimeStatus {
39
39
  lastStartedAt: string | null;
40
40
  lastError: string | null;
41
41
  restartCount: number;
42
+ operationalMetrics?: {
43
+ sessionStartFailures: number;
44
+ resumeFailures: number;
45
+ capabilityProbeFailures: number;
46
+ };
42
47
  }
43
48
 
44
49
  export interface AgentProviderCapabilities {
@@ -47,6 +52,9 @@ export interface AgentProviderCapabilities {
47
52
  read: boolean;
48
53
  resume: boolean;
49
54
  importLocal: boolean;
55
+ load?: boolean;
56
+ close?: boolean;
57
+ delete?: boolean;
50
58
  };
51
59
  turns: {
52
60
  start: boolean;
@@ -96,6 +104,14 @@ export interface AgentRuntimeDescriptor {
96
104
  installation: AgentBackendInstallationDto;
97
105
  }
98
106
 
107
+ export interface AgentCapabilitySnapshot {
108
+ provider: AgentProviderId;
109
+ agentId: string;
110
+ availability: AcpAgentOptionMetadataDto['availability'];
111
+ negotiated: unknown | null;
112
+ effectiveCapabilities: AgentProviderCapabilities | null;
113
+ }
114
+
99
115
  export interface AgentRuntimeConfigFileSchema {
100
116
  name: string;
101
117
  label: string;
@@ -174,6 +190,7 @@ export type AgentSessionStatus =
174
190
 
175
191
  export interface AgentSessionSummary {
176
192
  provider: AgentProviderId;
193
+ agentId?: string | null;
177
194
  providerSessionId: string;
178
195
  cwd: string;
179
196
  title: string | null;
@@ -220,6 +237,15 @@ export interface AgentTurn {
220
237
  export interface AgentSessionDetail extends AgentSessionSummary {
221
238
  turns: AgentTurn[];
222
239
  totalTurnCount?: number | null;
240
+ historyCoverage?: AgentSessionHistoryCoverage | null;
241
+ }
242
+
243
+ export interface AgentSessionHistoryCoverage {
244
+ source: 'providerReplay';
245
+ completeness: 'complete' | 'partial' | 'unknown';
246
+ replayedTurnCount: number;
247
+ replayedItemCount: number;
248
+ providerIdentifiedTurnCount: number;
223
249
  }
224
250
 
225
251
  export interface ReadAgentSessionOptions {
@@ -257,6 +283,18 @@ export interface ResumeAgentSessionInput {
257
283
  performanceMode?: 'standard' | 'fast' | null;
258
284
  }
259
285
 
286
+ export type AgentPromptContentBlock =
287
+ | { type: 'text'; text: string }
288
+ | { type: 'image'; data: string; mimeType: string; uri?: string | null }
289
+ | { type: 'audio'; data: string; mimeType: string }
290
+ | { type: 'resource_link'; name: string; uri: string; title?: string | null }
291
+ | {
292
+ type: 'resource';
293
+ resource:
294
+ | { uri: string; text: string; mimeType?: string | null }
295
+ | { uri: string; blob: string; mimeType?: string | null };
296
+ };
297
+
260
298
  export interface StartAgentTurnInput {
261
299
  providerSessionId: string;
262
300
  prompt: string;
@@ -270,6 +308,7 @@ export interface StartAgentTurnInput {
270
308
  performanceMode?: 'standard' | 'fast' | null;
271
309
  hidden?: boolean;
272
310
  displayTurnId?: string | null;
311
+ content?: AgentPromptContentBlock[];
273
312
  }
274
313
 
275
314
  export interface SendAgentInputInput {
@@ -475,6 +514,20 @@ export interface AgentRuntimeTurnFailedEvent {
475
514
  willRetry?: boolean;
476
515
  }
477
516
 
517
+ export interface AgentRuntimeHarnessExtensionEvent {
518
+ type: 'harness.extension';
519
+ provider: AgentProviderId;
520
+ providerSessionId: string;
521
+ providerTurnId: string | null;
522
+ providerItemId: string | null;
523
+ extensionId: string;
524
+ extensionVersion: number;
525
+ event: string;
526
+ operationId: string | null;
527
+ sequence: number | null;
528
+ payload: unknown;
529
+ }
530
+
478
531
  export type AgentRuntimeEvent =
479
532
  | AgentRuntimeStatusChangedEvent
480
533
  | AgentRuntimeTitleUpdatedEvent
@@ -487,7 +540,8 @@ export type AgentRuntimeEvent =
487
540
  | AgentRuntimePlanUpdatedEvent
488
541
  | AgentRuntimeOutputDeltaEvent
489
542
  | AgentRuntimeTurnCompletedEvent
490
- | AgentRuntimeTurnFailedEvent;
543
+ | AgentRuntimeTurnFailedEvent
544
+ | AgentRuntimeHarnessExtensionEvent;
491
545
 
492
546
  export interface AgentProviderRequest {
493
547
  provider: AgentProviderId;
@@ -556,7 +610,13 @@ export interface AgentRuntime extends EventEmitter {
556
610
  listModels(): Promise<AgentModel[]>;
557
611
  listAgentOptions?(): Promise<AgentModel[]>;
558
612
  listModelsForAgent?(agentId: string, cwd: string): Promise<AgentModel[]>;
613
+ getAgentCapabilitySnapshot?(agentId: string): Promise<AgentCapabilitySnapshot>;
614
+ getScopedCapabilities?(input: {
615
+ agentId?: string | null;
616
+ providerSessionId?: string | null;
617
+ }): AgentProviderCapabilities;
559
618
  listSessions(): Promise<AgentSessionSummary[]>;
619
+ listImportSessions?(agentId?: string | null): Promise<AgentSessionSummary[]>;
560
620
  listLoadedSessions(): Promise<string[]>;
561
621
  readSession(
562
622
  providerSessionId: string,
@@ -42,7 +42,7 @@ export interface CreateThreadRecordInput {
42
42
  approvalMode: string;
43
43
  sandboxMode?: string | null;
44
44
  summaryText?: string | null;
45
- source?: 'supervisor' | 'local_codex_import';
45
+ source?: 'supervisor' | 'local_codex_import' | 'local_provider_import';
46
46
  isConnected?: boolean;
47
47
  }
48
48
 
@@ -73,6 +73,7 @@ export interface UpdateThreadRecordInput {
73
73
  export interface UpsertThreadTurnMetadataInput {
74
74
  threadId: string;
75
75
  turnId: string;
76
+ createdAt?: string;
76
77
  model?: string | null;
77
78
  reasoningEffort?: string | null;
78
79
  reasoningEffortAvailable?: boolean | null;
@@ -423,7 +424,7 @@ export function upsertThreadTurnMetadata(
423
424
  pricingTierKey: input.pricingTierKey ?? null,
424
425
  tokenUsageJson: input.tokenUsageJson ?? null,
425
426
  displayPrompt: input.displayPrompt ?? null,
426
- createdAt: now,
427
+ createdAt: input.createdAt ?? now,
427
428
  updatedAt: now,
428
429
  })
429
430
  .run();
@@ -581,6 +581,11 @@ export interface AgentRuntimeStatusDto {
581
581
  lastStartedAt: string | null;
582
582
  lastError: string | null;
583
583
  restartCount: number;
584
+ operationalMetrics?: {
585
+ sessionStartFailures: number;
586
+ resumeFailures: number;
587
+ capabilityProbeFailures: number;
588
+ };
584
589
  }
585
590
 
586
591
  export interface AgentSubscriptionUsageWindowDto {
@@ -605,6 +610,9 @@ export interface AgentProviderCapabilitiesDto {
605
610
  read: boolean;
606
611
  resume: boolean;
607
612
  importLocal: boolean;
613
+ load?: boolean;
614
+ close?: boolean;
615
+ delete?: boolean;
608
616
  };
609
617
  turns: {
610
618
  start: boolean;
@@ -654,6 +662,14 @@ export interface AgentBackendDto {
654
662
  installation: AgentBackendInstallationDto;
655
663
  }
656
664
 
665
+ export interface AgentCapabilitySnapshotDto {
666
+ provider: AgentBackendIdDto;
667
+ agentId: string;
668
+ availability: AcpAgentOptionMetadataDto['availability'];
669
+ negotiated: unknown | null;
670
+ effectiveCapabilities: AgentProviderCapabilitiesDto | null;
671
+ }
672
+
657
673
  export interface AgentBackendInstallationDto {
658
674
  packageName: string | null;
659
675
  installed: boolean;
@@ -829,7 +845,10 @@ export interface UpdateWorkspaceInput {
829
845
  label: string;
830
846
  }
831
847
 
832
- export type ThreadSourceDto = 'supervisor' | 'local_codex_import';
848
+ export type ThreadSourceDto =
849
+ | 'supervisor'
850
+ | 'local_codex_import'
851
+ | 'local_provider_import';
833
852
 
834
853
  export interface UpdateWorkspaceFavoriteInput {
835
854
  isFavorite: boolean;
@@ -1640,6 +1659,18 @@ export interface ImportThreadInput {
1640
1659
  provider?: AgentBackendIdDto;
1641
1660
  }
1642
1661
 
1662
+ export interface ImportThreadCandidateDto {
1663
+ provider: AgentBackendIdDto;
1664
+ agentId: string | null;
1665
+ sessionId: string;
1666
+ cwd: string;
1667
+ title: string;
1668
+ preview: string | null;
1669
+ createdAt: string | null;
1670
+ updatedAt: string | null;
1671
+ historyStatus: 'unknown';
1672
+ }
1673
+
1643
1674
  export interface SendThreadPromptInput {
1644
1675
  prompt: string;
1645
1676
  clientRequestId?: string;
@@ -21,6 +21,7 @@ const stateFile = path.join(serviceDir, 'service-state.json');
21
21
  const apiEntry = path.join(repoRoot, 'apps', 'supervisor-api', 'dist', 'index.js');
22
22
  const webEntry = path.join(repoRoot, 'scripts', 'run-web-service.mjs');
23
23
  const webIndex = path.join(repoRoot, 'apps', 'supervisor-web', 'dist', 'index.html');
24
+ const packageVersion = readPackageVersion();
24
25
  const defaultServicePort = supportsSourceRestart ? 4173 : 45673;
25
26
  const defaultApiPort = supportsSourceRestart ? 8787 : 45674;
26
27
 
@@ -76,6 +77,7 @@ async function startService() {
76
77
 
77
78
  const apiPid = spawnDetached(process.execPath, [apiEntry], apiLogPath, {
78
79
  NODE_ENV: 'production',
80
+ APP_VERSION: process.env.APP_VERSION ?? packageVersion,
79
81
  HOST: apiHost,
80
82
  PORT: String(apiPort),
81
83
  LOG_LEVEL: process.env.LOG_LEVEL ?? 'warn',
@@ -186,6 +188,17 @@ function ensureBuildArtifacts() {
186
188
  process.exit(1);
187
189
  }
188
190
 
191
+ function readPackageVersion() {
192
+ try {
193
+ const parsed = JSON.parse(
194
+ fs.readFileSync(path.join(repoRoot, 'package.json'), 'utf8'),
195
+ );
196
+ return typeof parsed.version === 'string' ? parsed.version : '0.0.0';
197
+ } catch {
198
+ return '0.0.0';
199
+ }
200
+ }
201
+
189
202
  function spawnDetached(commandToRun, args, logPath, env) {
190
203
  const logFd = fs.openSync(logPath, 'a');
191
204
  const child = spawn(commandToRun, args, {