maka-agent 0.2.0-dev.64.20260929 → 0.2.0-dev.68.20261003

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 (109) hide show
  1. package/LICENSE +1 -1
  2. package/THIRD_PARTY_NOTICES.txt +3 -3
  3. package/dist/pi-tui-runner.js +26 -29
  4. package/dist/tui-copy-catalog.js +9 -9
  5. package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
  6. package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
  7. package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
  8. package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
  9. package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
  10. package/node_modules/@maka/acp-executor-plugin/dist/acp-catalog.js +132 -0
  11. package/node_modules/@maka/acp-executor-plugin/dist/index.js +251 -113
  12. package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +431 -108
  13. package/node_modules/@maka/core/dist/executor-catalog.js +25 -3
  14. package/node_modules/@maka/core/dist/settings.js +2 -2
  15. package/node_modules/@maka/core/dist/tool-ledger-scanner.js +53 -150
  16. package/node_modules/@maka/runtime/dist/admission-limiter.js +3 -2
  17. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +8 -1
  18. package/node_modules/@maka/runtime/dist/conversation-copy.js +6 -0
  19. package/node_modules/@maka/runtime/dist/plugin-data-services.js +7 -0
  20. package/node_modules/@maka/runtime/dist/plugin-executor-service.js +19 -3
  21. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +17 -0
  22. package/node_modules/@maka/runtime/dist/session-manager.js +26 -40
  23. package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +79 -13
  24. package/node_modules/@maka/runtime/dist/stream-graph-projection.js +64 -0
  25. package/node_modules/@maka/runtime/dist/stream-graph-read-model.js +138 -20
  26. package/node_modules/@maka/runtime/dist/tool-availability.js +10 -3
  27. package/node_modules/@maka/runtime/package.json +1 -0
  28. package/node_modules/@maka/runtime-host/dist/antigravity-program.js +49 -0
  29. package/node_modules/@maka/runtime-host/dist/candidate-entry.js +15 -0
  30. package/node_modules/@maka/runtime-host/dist/candidate-startup-failure.js +5 -0
  31. package/node_modules/@maka/runtime-host/dist/client/session-catalog-summary.js +1 -0
  32. package/node_modules/@maka/runtime-host/dist/client/startup-error.js +5 -0
  33. package/node_modules/@maka/runtime-host/dist/protocol/agent-graph.js +46 -1
  34. package/node_modules/@maka/runtime-host/dist/protocol/index.js +16 -1
  35. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +5 -1
  36. package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +8 -2
  37. package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +12 -0
  38. package/node_modules/@maka/runtime-host/dist/protocol/session-retirement.js +46 -10
  39. package/node_modules/@maka/runtime-host/dist/protocol/storage-usage.js +155 -0
  40. package/node_modules/@maka/runtime-host/dist/server/acp/antigravity.js +5 -19
  41. package/node_modules/@maka/runtime-host/dist/server/agent-graph-coordinator.js +23 -0
  42. package/node_modules/@maka/runtime-host/dist/server/canonical-turn-snapshot.js +5 -0
  43. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +41 -9
  44. package/node_modules/@maka/runtime-host/dist/server/external-agent-setup-coordinator.js +3 -0
  45. package/node_modules/@maka/runtime-host/dist/server/hosted-execution-tool-profile.js +2 -0
  46. package/node_modules/@maka/runtime-host/dist/server/plugin-data-runtime.js +6 -0
  47. package/node_modules/@maka/runtime-host/dist/server/plugin-scratch-directory.js +55 -0
  48. package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +46 -6
  49. package/node_modules/@maka/runtime-host/dist/server/session-retirement-coordinator.js +112 -36
  50. package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +27 -1
  51. package/node_modules/@maka/runtime-host/dist/server/storage-usage-coordinator.js +67 -0
  52. package/node_modules/@maka/runtime-host/dist/server/workhub-inspection-tool.js +208 -0
  53. package/node_modules/@maka/runtime-host/package.json +1 -0
  54. package/node_modules/@maka/storage/dist/git-worktree-child-executor.js +3 -1
  55. package/node_modules/@maka/storage/dist/operational-state-store.js +0 -13
  56. package/node_modules/@maka/storage/dist/session-store.js +9 -6
  57. package/node_modules/@maka/storage/dist/sqlite-file-set.js +22 -0
  58. package/node_modules/@maka/storage/dist/sqlite-long-term-memory-store.js +1 -3
  59. package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +10 -260
  60. package/node_modules/@maka/storage/dist/sqlite-session-catalog-query.js +1 -0
  61. package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +18 -6
  62. package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +28 -6
  63. package/node_modules/@maka/storage/dist/storage-footprint.js +239 -0
  64. package/node_modules/@maka/storage/dist/storage-writer-composition.js +10 -1
  65. package/node_modules/axios/CHANGELOG.md +62 -0
  66. package/node_modules/axios/README.md +297 -5
  67. package/node_modules/axios/dist/axios.js +728 -170
  68. package/node_modules/axios/dist/axios.min.js +3 -3
  69. package/node_modules/axios/dist/browser/axios.cjs +871 -188
  70. package/node_modules/axios/dist/esm/axios.js +871 -188
  71. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  72. package/node_modules/axios/dist/node/axios.cjs +1037 -225
  73. package/node_modules/axios/lib/adapters/fetch.js +64 -11
  74. package/node_modules/axios/lib/adapters/http.js +140 -67
  75. package/node_modules/axios/lib/adapters/xhr.js +52 -3
  76. package/node_modules/axios/lib/core/Axios.js +43 -20
  77. package/node_modules/axios/lib/core/AxiosError.js +33 -2
  78. package/node_modules/axios/lib/core/AxiosHeaders.js +124 -1
  79. package/node_modules/axios/lib/core/InterceptorManager.js +107 -8
  80. package/node_modules/axios/lib/core/buildFullPath.js +41 -15
  81. package/node_modules/axios/lib/core/dispatchRequest.js +8 -2
  82. package/node_modules/axios/lib/core/mergeConfig.js +19 -4
  83. package/node_modules/axios/lib/core/methodList.js +17 -0
  84. package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  85. package/node_modules/axios/lib/defaults/index.js +2 -1
  86. package/node_modules/axios/lib/env/data.js +1 -1
  87. package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -0
  88. package/node_modules/axios/lib/helpers/HttpStatusCode.js +12 -1
  89. package/node_modules/axios/lib/helpers/combineURLs.js +11 -3
  90. package/node_modules/axios/lib/helpers/composeSignals.js +12 -1
  91. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +115 -54
  92. package/node_modules/axios/lib/helpers/formDataToJSON.js +11 -5
  93. package/node_modules/axios/lib/helpers/fromDataURI.js +5 -4
  94. package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  95. package/node_modules/axios/lib/helpers/parseHeaders.js +5 -3
  96. package/node_modules/axios/lib/helpers/progressEventReducer.js +4 -4
  97. package/node_modules/axios/lib/helpers/resolveConfig.js +5 -17
  98. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +300 -5
  99. package/node_modules/axios/lib/helpers/throttle.js +3 -2
  100. package/node_modules/axios/lib/helpers/toFormData.js +17 -23
  101. package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  102. package/node_modules/axios/lib/utils.js +151 -18
  103. package/node_modules/axios/package.json +21 -19
  104. package/node_modules/brace-expansion/dist/commonjs/index.js +69 -25
  105. package/node_modules/brace-expansion/dist/esm/index.js +68 -24
  106. package/node_modules/brace-expansion/package.json +2 -1
  107. package/node_modules/fast-uri/index.js +10 -6
  108. package/node_modules/fast-uri/package.json +1 -1
  109. package/package.json +1 -1
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ import { constants } from 'node:fs';
20
+ import { access, realpath, stat } from 'node:fs/promises';
21
+ import { dirname, isAbsolute, join } from 'node:path';
22
+ /** Public diagnostics survive Electron IPC without exposing filesystem error details. */
23
+ export class AntigravityProgramError extends Error {
24
+ failure;
25
+ constructor(failure) {
26
+ super(`Antigravity program: ${failure}`);
27
+ this.failure = failure;
28
+ }
29
+ }
30
+ /** Shared by native program selection and the Host's check/sign-in admission. */
31
+ export async function checkAntigravityProgram(executable) {
32
+ const resolved = await checkedFile(executable, 'executable_unavailable');
33
+ const helper = await checkedFile(join(dirname(resolved), 'localharness_external'), 'helper_unavailable');
34
+ return { executable: resolved, helper };
35
+ }
36
+ async function checkedFile(path, failure) {
37
+ try {
38
+ if (!isAbsolute(path))
39
+ throw new Error('Absolute path required');
40
+ const resolved = await realpath(path);
41
+ if (!(await stat(resolved)).isFile())
42
+ throw new Error('File required');
43
+ await access(resolved, constants.X_OK);
44
+ return resolved;
45
+ }
46
+ catch {
47
+ throw new AntigravityProgramError(failure);
48
+ }
49
+ }
@@ -74,6 +74,21 @@ export async function runExecutionCandidateEntry(argv, entrypointUrl, hooks = {}
74
74
  process.exit(candidateStartupFailureExitCode(failure));
75
75
  }
76
76
  if (result.kind === 'loser') {
77
+ // Losing the launch election is a normal outcome the replacement loop
78
+ // relies on, but a silent exit left no trace on disk — during replacement
79
+ // storms every loss was invisible (issue #5843). Leave the same startup
80
+ // diagnostic the failure paths write before exiting.
81
+ if (rootId && startupAttemptId) {
82
+ await import('./control/startup-diagnostic.js')
83
+ .then(({ writeCandidateStartupDiagnostic }) => writeCandidateStartupDiagnostic({
84
+ rootId,
85
+ startupAttemptId,
86
+ failure: { reason: 'launch_election_lost' },
87
+ error: new Error('Lost the Runtime Host launch election: another candidate owns this workspace'),
88
+ logs: runtimeHostLogBuffer.snapshot(),
89
+ }))
90
+ .catch(() => undefined);
91
+ }
77
92
  await launchOwnerGuard?.dispose();
78
93
  process.exit(2);
79
94
  }
@@ -22,6 +22,7 @@ export const CANDIDATE_STARTUP_FAILURE_REASONS = [
22
22
  'operational_state_migration_blocked',
23
23
  'local_ipc_security_failed',
24
24
  'internal_startup_failure',
25
+ 'launch_election_lost',
25
26
  ...RUNTIME_HOST_MANAGED_LAUNCH_REJECTIONS,
26
27
  ];
27
28
  const STARTUP_ATTEMPT_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;
@@ -38,6 +39,10 @@ const EXIT_CODE_BY_REASON = {
38
39
  deployment_launch_mismatch: 85,
39
40
  deployment_transition_in_progress: 86,
40
41
  deployment_needs_repair: 87,
42
+ // Losing the launch election is a normal outcome, not a failure: losing
43
+ // candidates still exit 2. This entry exists so the startup diagnostic can
44
+ // name the outcome; the code itself is never used as an exit code.
45
+ launch_election_lost: 88,
41
46
  };
42
47
  export function classifyCandidateStartupFailure(error) {
43
48
  const errors = primaryErrorChain(error);
@@ -27,6 +27,7 @@ export function projectSessionCatalogSummary(session) {
27
27
  name: session.name,
28
28
  isFlagged: session.isFlagged,
29
29
  isArchived: session.isArchived,
30
+ ...(session.archivedAt === undefined ? {} : { archivedAt: session.archivedAt }),
30
31
  labels: [...session.labels],
31
32
  hasUnread: session.hasUnread,
32
33
  ...(session.lastMessageAt === undefined ? {} : { lastMessageAt: session.lastMessageAt }),
@@ -35,6 +35,11 @@ export function runtimeHostStartupError(reason, diagnostic) {
35
35
  return new Error('Runtime Host failed while recovering this workspace. Try again; if the problem persists, report diagnostic code INTERNAL_STARTUP_FAILURE.');
36
36
  case 'local_ipc_security_failed':
37
37
  return new Error('Runtime Host could not secure its Local IPC endpoint. Try again; if the problem persists, report diagnostic code LOCAL_IPC_SECURITY_FAILED.');
38
+ case 'launch_election_lost':
39
+ // Losing candidates exit 2, which the election loop suppresses, so this
40
+ // reason never surfaces through a startup failure report today; the case
41
+ // keeps the mapping total if the diagnostic reason is ever surfaced.
42
+ return new Error('Another Maka process won the launch election for this workspace and is opening it. Retry once that instance has finished starting. Diagnostic code: LAUNCH_ELECTION_LOST.');
38
43
  case 'composition_mismatch':
39
44
  return new RuntimeHostStartupError(reason, 'This workspace belongs to a different Runtime Host composition. Diagnostic code: COMPOSITION_MISMATCH.');
40
45
  case 'managed_root_requires_operator':
@@ -44,6 +44,7 @@ export const AGENT_GRAPH_MAX_INSPECTION_ACTIVATIONS = 32;
44
44
  export const AGENT_GRAPH_MAX_INSPECTION_RECORDS = 32;
45
45
  export const AGENT_GRAPH_EPOCH_PAGE_SIZE = 32;
46
46
  const AGENT_GRAPH_INSTRUCTION_PREVIEW_MAX_BYTES = 2 * 1024;
47
+ const AGENT_GRAPH_OUTPUT_PREVIEW_MAX_BYTES = 2 * 1024;
47
48
  const AGENT_GRAPH_REASON_MAX_BYTES = 12 * 1024;
48
49
  const AGENT_GRAPH_RECONCILIATION_FAILURE_REASON_MAX_BYTES = 4 * 1024;
49
50
  const QUERY_ERRORS = [
@@ -341,7 +342,7 @@ function decodeOperator(value) {
341
342
  'scheduledWorkIds',
342
343
  'readiness',
343
344
  'omitted',
344
- ], ['currentActivation']);
345
+ ], ['currentActivation', 'output']);
345
346
  return {
346
347
  operatorId: requireOpaqueIdentity(record.operatorId, 'operatorId'),
347
348
  childSessionId: requireEntityId(record.childSessionId, 'childSessionId'),
@@ -357,6 +358,44 @@ function decodeOperator(value) {
357
358
  ...(record.currentActivation === undefined
358
359
  ? {}
359
360
  : { currentActivation: decodeCurrentActivation(record.currentActivation) }),
361
+ ...(record.output === undefined ? {} : { output: decodeOperatorOutput(record.output) }),
362
+ };
363
+ }
364
+ function decodeOperatorOutput(value) {
365
+ const record = requireShapedRecord(value, 'agent graph operator output', [
366
+ 'activationId',
367
+ 'preview',
368
+ 'previewTruncated',
369
+ 'phase',
370
+ 'previewUpdatedAt',
371
+ 'sourceEventId',
372
+ 'sampleStartedAt',
373
+ ], ['messageId', 'outputTokens', 'sampleDurationMs', 'tokensPerSecond']);
374
+ if (record.phase !== 'streaming' && record.phase !== 'completed') {
375
+ throw invalidProtocolFrame('Invalid agent graph operator output phase');
376
+ }
377
+ return {
378
+ activationId: requireOpaqueIdentity(record.activationId, 'activationId'),
379
+ preview: requireUtf8String(record.preview, 'operator output preview', AGENT_GRAPH_OUTPUT_PREVIEW_MAX_BYTES),
380
+ previewTruncated: requireBoolean(record.previewTruncated, 'previewTruncated'),
381
+ phase: record.phase,
382
+ previewUpdatedAt: requireCount(record.previewUpdatedAt, 'previewUpdatedAt'),
383
+ sourceEventId: requireOpaqueIdentity(record.sourceEventId, 'sourceEventId'),
384
+ ...(record.messageId === undefined
385
+ ? {}
386
+ : { messageId: requireOpaqueIdentity(record.messageId, 'messageId') }),
387
+ sampleStartedAt: requireCount(record.sampleStartedAt, 'sampleStartedAt'),
388
+ ...(record.outputTokens === undefined
389
+ ? {}
390
+ : { outputTokens: requireCount(record.outputTokens, 'outputTokens') }),
391
+ ...(record.sampleDurationMs === undefined
392
+ ? {}
393
+ : { sampleDurationMs: requireCount(record.sampleDurationMs, 'sampleDurationMs') }),
394
+ ...(record.tokensPerSecond === undefined
395
+ ? {}
396
+ : {
397
+ tokensPerSecond: requireNonNegativeFiniteNumber(record.tokensPerSecond, 'tokensPerSecond'),
398
+ }),
360
399
  };
361
400
  }
362
401
  function decodeReadiness(value) {
@@ -786,6 +825,12 @@ function requireBoolean(value, label) {
786
825
  throw invalidProtocolFrame(`Invalid ${label}`);
787
826
  return value;
788
827
  }
828
+ function requireNonNegativeFiniteNumber(value, label) {
829
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {
830
+ throw invalidProtocolFrame(`Invalid ${label}`);
831
+ }
832
+ return value;
833
+ }
789
834
  function requireFingerprint(value, label) {
790
835
  if (typeof value !== 'string' || !/^sha256:[a-f0-9]{64}$/.test(value)) {
791
836
  throw invalidProtocolFrame(`Invalid ${label}`);
@@ -65,7 +65,22 @@ export const RUNTIME_HOST_REGISTRATION_SCHEMA_VERSION = 1;
65
65
  export const RUNTIME_HOST_PROTOCOL_VERSION = 0;
66
66
  // Increment when the same protocol version no longer guarantees safe Client-Host
67
67
  // interoperability. Mismatches are rejected before domain commands are admitted.
68
- export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 198;
68
+ export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 204;
69
+ // 204: Executor catalogs and Session configuration carry opaque mode IDs;
70
+ // catalog queries may request a provider refresh. Older peers reject these fields.
71
+ // 202: `session.remove.preview` takes a bounded list of Sessions and reports the
72
+ // child tasks, worktrees and optionally the bytes their removal would delete;
73
+ // `session.remove` takes `requireArchivedForMs` and may answer `too_recent`.
74
+ // Epoch-201 peers reject the new input and result shapes, so the pair must
75
+ // fail admission.
76
+ // 201: Session catalog projections may carry `archivedAt`, the time the
77
+ // Session last entered the archive. Epoch-200 peers reject the unknown key, so
78
+ // a newer Desktop against an older Host would lose session catalog reads.
79
+ // 200: Agent Graph operator snapshots carry bounded output previews and metrics.
80
+ // Older peers reject the additional `output` field on strict operator shapes.
81
+ // 199: `storage.usage.query` and `storage.usage.sessions.query` report storage
82
+ // usage. An epoch-198 Host rejects the unknown operation and drops the
83
+ // connection, so the pair must fail admission instead.
69
84
  // 198: Executor readiness exposes explicit restore, restore-failed and history-gap states.
70
85
  // 197: Queue reorder requests carry the expected queue revision. Epoch-196
71
86
  // peers reject the required field or send an unfenced reorder request.
@@ -58,6 +58,7 @@ import { SESSION_RETIREMENT_OPERATION_SPECS } from './session-retirement.js';
58
58
  import { PROMPT_SUGGESTION_OPERATION_SPECS } from './prompt-suggestions.js';
59
59
  import { SESSION_EFFECT_OPERATION_SPECS } from './session-effects.js';
60
60
  import { SKILL_CATALOG_OPERATION_SPECS } from './skill-catalog.js';
61
+ import { STORAGE_USAGE_OPERATION_SPECS } from './storage-usage.js';
61
62
  import { TURN_OPERATION_SPECS } from './turn.js';
62
63
  import { USAGE_PRICING_OPERATION_SPECS } from './usage-pricing.js';
63
64
  import { WEB_SEARCH_OPERATION_SPECS } from './web-search.js';
@@ -96,11 +97,12 @@ export * from './session-todo.js';
96
97
  export * from './session-effects.js';
97
98
  export * from './prompt-suggestions.js';
98
99
  export * from './skill-catalog.js';
100
+ export * from './storage-usage.js';
99
101
  export * from './usage-pricing.js';
100
102
  export * from './web-search.js';
101
103
  export * from './recall.js';
102
104
  export * from './workspace.js';
103
- export const HOST_OPERATION_SPECS = composeOperationSpecMaps(HOST_BOOTSTRAP_OPERATION_SPECS, HOST_RESOURCE_OPERATION_SPECS, PEER_MESH_OPERATION_SPECS, HOSTED_EXECUTION_OPERATION_SPECS, ACCESS_AUTHORITY_OPERATION_SPECS, SESSION_COLLABORATION_OPERATION_SPECS, AGENT_GRAPH_OPERATION_SPECS, GOAL_OPERATION_SPECS, TURN_OPERATION_SPECS, CONTEXT_OPERATION_SPECS, CONNECTION_EFFECT_OPERATION_SPECS, DAILY_REVIEW_OPERATION_SPECS, EXECUTION_INSPECT_OPERATION_SPECS, EXTERNAL_SESSION_OPERATION_SPECS, RUNTIME_POLICY_OPERATION_SPECS, RUNTIME_RESOURCE_OPERATION_SPECS, SCHEDULED_TASK_OPERATION_SPECS, PLAN_OPERATION_SPECS, PROJECT_CATALOG_OPERATION_SPECS, MESSAGE_OPERATION_SPECS, SESSION_TODO_OPERATION_SPECS, INTERACTION_OPERATION_SPECS, SESSION_CONTINUITY_OPERATION_SPECS, SESSION_TRANSCRIPT_OPERATION_SPECS, SESSION_TURNS_OPERATION_SPECS, SESSION_CATALOG_OPERATION_SPECS, SESSION_EFFECT_OPERATION_SPECS, PROMPT_SUGGESTION_OPERATION_SPECS, SESSION_REVISION_OPERATION_SPECS, SESSION_BUNDLE_OPERATION_SPECS, SESSION_RETIREMENT_OPERATION_SPECS, ARTIFACT_OPERATION_SPECS, SKILL_CATALOG_OPERATION_SPECS, USAGE_PRICING_OPERATION_SPECS, MEMORY_OPERATION_SPECS, OAUTH_OPERATION_SPECS, EXTERNAL_AGENT_SETUP_OPERATION_SPECS, CLIENT_CAPABILITY_OPERATION_SPECS, WEB_SEARCH_OPERATION_SPECS, NETWORK_PROXY_OPERATION_SPECS, RECALL_OPERATION_SPECS, CONFIGURATION_OPERATION_SPECS, WORKHUB_COORDINATION_OPERATION_SPECS, PLUGIN_PLATFORM_OPERATION_SPECS);
105
+ export const HOST_OPERATION_SPECS = composeOperationSpecMaps(HOST_BOOTSTRAP_OPERATION_SPECS, HOST_RESOURCE_OPERATION_SPECS, PEER_MESH_OPERATION_SPECS, HOSTED_EXECUTION_OPERATION_SPECS, ACCESS_AUTHORITY_OPERATION_SPECS, SESSION_COLLABORATION_OPERATION_SPECS, AGENT_GRAPH_OPERATION_SPECS, GOAL_OPERATION_SPECS, TURN_OPERATION_SPECS, CONTEXT_OPERATION_SPECS, CONNECTION_EFFECT_OPERATION_SPECS, DAILY_REVIEW_OPERATION_SPECS, EXECUTION_INSPECT_OPERATION_SPECS, EXTERNAL_SESSION_OPERATION_SPECS, RUNTIME_POLICY_OPERATION_SPECS, RUNTIME_RESOURCE_OPERATION_SPECS, SCHEDULED_TASK_OPERATION_SPECS, PLAN_OPERATION_SPECS, PROJECT_CATALOG_OPERATION_SPECS, MESSAGE_OPERATION_SPECS, SESSION_TODO_OPERATION_SPECS, INTERACTION_OPERATION_SPECS, SESSION_CONTINUITY_OPERATION_SPECS, SESSION_TRANSCRIPT_OPERATION_SPECS, SESSION_TURNS_OPERATION_SPECS, SESSION_CATALOG_OPERATION_SPECS, SESSION_EFFECT_OPERATION_SPECS, PROMPT_SUGGESTION_OPERATION_SPECS, SESSION_REVISION_OPERATION_SPECS, SESSION_BUNDLE_OPERATION_SPECS, SESSION_RETIREMENT_OPERATION_SPECS, ARTIFACT_OPERATION_SPECS, SKILL_CATALOG_OPERATION_SPECS, USAGE_PRICING_OPERATION_SPECS, STORAGE_USAGE_OPERATION_SPECS, MEMORY_OPERATION_SPECS, OAUTH_OPERATION_SPECS, EXTERNAL_AGENT_SETUP_OPERATION_SPECS, CLIENT_CAPABILITY_OPERATION_SPECS, WEB_SEARCH_OPERATION_SPECS, NETWORK_PROXY_OPERATION_SPECS, RECALL_OPERATION_SPECS, CONFIGURATION_OPERATION_SPECS, WORKHUB_COORDINATION_OPERATION_SPECS, PLUGIN_PLATFORM_OPERATION_SPECS);
104
106
  // Remote credentials are fail-closed: adding a protocol operation does not
105
107
  // grant it to remote owners until this policy is deliberately updated.
106
108
  export const REMOTE_OWNER_OPERATION_GRANTS = Object.freeze([
@@ -211,6 +213,8 @@ export const REMOTE_OWNER_OPERATION_GRANTS = Object.freeze([
211
213
  'skill.catalog.mutate',
212
214
  'skill.catalog.preview-update',
213
215
  'skill.catalog.query',
216
+ 'storage.usage.query',
217
+ 'storage.usage.sessions.query',
214
218
  'subscription.close',
215
219
  'subscription.open',
216
220
  'subscription.pty_interest.set',
@@ -93,8 +93,14 @@ export const PLUGIN_PLATFORM_OPERATION_SPECS = {
93
93
  decodeInput: (value) => {
94
94
  const record = requireRecord(value, 'Executor query');
95
95
  if (record.kind === 'catalog') {
96
- const input = requireExactRecord(record, 'Executor catalog', ['kind', 'cwd']);
97
- return { kind: 'catalog', cwd: requireString(input.cwd, 'cwd', 4096) };
96
+ const input = requireShapedRecord(record, 'Executor catalog', ['kind', 'cwd'], ['refresh']);
97
+ if (input.refresh !== undefined && typeof input.refresh !== 'boolean')
98
+ throw invalidProtocolFrame('Invalid executor refresh flag');
99
+ return {
100
+ kind: 'catalog',
101
+ cwd: requireString(input.cwd, 'cwd', 4096),
102
+ ...(input.refresh ? { refresh: true } : {}),
103
+ };
98
104
  }
99
105
  const input = requireExactRecord(record, 'Executor conversation', ['kind', 'sessionId']);
100
106
  if (input.kind !== 'conversation')
@@ -83,6 +83,7 @@ const PROJECTION_REQUIRED_FIELDS = [
83
83
  ];
84
84
  const PROJECTION_FIELDS = [
85
85
  ...PROJECTION_REQUIRED_FIELDS,
86
+ 'archivedAt',
86
87
  'lastMessageAt',
87
88
  'lastMessagePreview',
88
89
  'blockedReason',
@@ -508,6 +509,7 @@ export function decodeSessionCatalogProjection(value) {
508
509
  name: sessionName(record.name),
509
510
  isFlagged: boolean(record.isFlagged, 'Session flagged state'),
510
511
  isArchived: boolean(record.isArchived, 'Session archived state'),
512
+ ...optionalArchivedAt(record),
511
513
  labels: labels(record.labels),
512
514
  labelsTruncated: boolean(record.labelsTruncated, 'Session labels truncated state'),
513
515
  hasUnread: boolean(record.hasUnread, 'Session unread state'),
@@ -542,6 +544,9 @@ export function decodeSessionCatalogProjection(value) {
542
544
  if ((projection.backend === 'plugin-executor') !== (projection.executorId !== undefined)) {
543
545
  throw invalidProtocolFrame('Session executor identity does not match its backend');
544
546
  }
547
+ if (projection.archivedAt !== undefined && !projection.isArchived) {
548
+ throw invalidProtocolFrame('Session archive time requires an archived Session');
549
+ }
545
550
  requireEncodedByteLimit(projection, 'Session catalog projection', SESSION_CATALOG_RESULT_MAX_BYTES);
546
551
  return projection;
547
552
  }
@@ -610,6 +615,13 @@ function optionalTimestamp(record, field) {
610
615
  ? { [field]: timestamp(record[field], `Session ${field}`) }
611
616
  : {};
612
617
  }
618
+ // One object type with an optional key rather than a union, so this spread
619
+ // does not multiply the projection literal's inferred union past TS2590.
620
+ function optionalArchivedAt(record) {
621
+ return Object.hasOwn(record, 'archivedAt')
622
+ ? { archivedAt: timestamp(record.archivedAt, 'Session archivedAt') }
623
+ : {};
624
+ }
613
625
  function optionalText(record, field, maxBytes) {
614
626
  return Object.hasOwn(record, field)
615
627
  ? { [field]: boundedText(record[field], `Session ${field}`, maxBytes) }
@@ -31,6 +31,13 @@ const LIFECYCLE_ERRORS = [
31
31
  'commit_outcome_unknown',
32
32
  'internal_failure',
33
33
  ];
34
+ /**
35
+ * Sessions one `session.remove.preview` accepts. Each target expands to its
36
+ * whole removal plan, which the Host reads and may size, so a request stays
37
+ * as small as a per-task storage page (also 25) and a Client pages a longer
38
+ * selection one request at a time.
39
+ */
40
+ export const SESSION_REMOVE_PREVIEW_MAX_ITEMS = 25;
34
41
  export const SESSION_RETIREMENT_OPERATION_SPECS = {
35
42
  'session.lifecycle.set': defineOperation({
36
43
  mode: 'command',
@@ -57,7 +64,7 @@ export const SESSION_RETIREMENT_OPERATION_SPECS = {
57
64
  decodeInput: decodeSessionRemoveInput,
58
65
  decodeOutput: decodeSessionRemoveResult,
59
66
  assertOutputForInput: (input, output) => {
60
- if (output.kind === 'removed' && output.sessionId !== input.sessionId) {
67
+ if (output.kind !== 'revision_conflict' && output.sessionId !== input.sessionId) {
61
68
  throw invalidProtocolFrame('Session remove result belongs to another Session');
62
69
  }
63
70
  if (output.kind === 'revision_conflict' &&
@@ -85,25 +92,50 @@ export function decodeSessionLifecycleSetInput(value) {
85
92
  };
86
93
  }
87
94
  export function decodeSessionRemoveInput(value) {
88
- const input = requireExactRecord(value, 'Session remove input', [
89
- 'sessionId',
90
- 'expectedRevision',
91
- ]);
95
+ const input = requireShapedRecord(value, 'Session remove input', ['sessionId', 'expectedRevision'], ['requireArchivedForMs']);
96
+ const { requireArchivedForMs } = input;
97
+ if (requireArchivedForMs !== undefined &&
98
+ (!Number.isSafeInteger(requireArchivedForMs) || requireArchivedForMs < 1)) {
99
+ throw invalidProtocolFrame('requireArchivedForMs must be a positive safe integer');
100
+ }
92
101
  return {
93
102
  sessionId: requireEntityId(input.sessionId, 'sessionId'),
94
103
  expectedRevision: positiveRevision(input.expectedRevision),
104
+ ...(requireArchivedForMs === undefined
105
+ ? {}
106
+ : { requireArchivedForMs: requireArchivedForMs }),
95
107
  };
96
108
  }
97
109
  export function decodeSessionRemovePreviewInput(value) {
98
- const input = requireExactRecord(value, 'Session remove preview input', ['sessionId']);
99
- return { sessionId: requireEntityId(input.sessionId, 'sessionId') };
110
+ const input = requireShapedRecord(value, 'Session remove preview input', ['sessionIds'], ['measureBytes', 'requireArchived']);
111
+ if (!Array.isArray(input.sessionIds) ||
112
+ input.sessionIds.length === 0 ||
113
+ input.sessionIds.length > SESSION_REMOVE_PREVIEW_MAX_ITEMS) {
114
+ throw invalidProtocolFrame('Invalid Session remove preview sessionIds');
115
+ }
116
+ const sessionIds = input.sessionIds.map((sessionId) => requireEntityId(sessionId, 'sessionId'));
117
+ if (new Set(sessionIds).size !== sessionIds.length) {
118
+ throw invalidProtocolFrame('Duplicate Session remove preview sessionId');
119
+ }
120
+ const flags = {};
121
+ for (const flag of ['measureBytes', 'requireArchived']) {
122
+ const flagValue = input[flag];
123
+ if (flagValue === undefined)
124
+ continue;
125
+ if (typeof flagValue !== 'boolean') {
126
+ throw invalidProtocolFrame(`Invalid Session remove preview ${flag}`);
127
+ }
128
+ flags[flag] = flagValue;
129
+ }
130
+ return { sessionIds, ...flags };
100
131
  }
101
132
  export function decodeSessionRemovePreviewResult(value) {
102
- const result = requireExactRecord(value, 'Session remove preview result', [
103
- 'archivableSubtaskCount',
104
- ]);
133
+ const result = requireShapedRecord(value, 'Session remove preview result', ['archivableSubtaskCount', 'removedSubtaskCount', 'worktreeCount'], ['bytes']);
105
134
  return {
106
135
  archivableSubtaskCount: requireCount(result.archivableSubtaskCount, 'archivableSubtaskCount'),
136
+ removedSubtaskCount: requireCount(result.removedSubtaskCount, 'removedSubtaskCount'),
137
+ worktreeCount: requireCount(result.worktreeCount, 'worktreeCount'),
138
+ ...(result.bytes === undefined ? {} : { bytes: requireCount(result.bytes, 'bytes') }),
107
139
  };
108
140
  }
109
141
  export function decodeSessionRemoveResult(value) {
@@ -120,6 +152,10 @@ export function decodeSessionRemoveResult(value) {
120
152
  }),
121
153
  };
122
154
  }
155
+ if (result.kind === 'too_recent') {
156
+ const exact = requireExactRecord(result, 'Too-recent Session result', ['kind', 'sessionId']);
157
+ return { kind: 'too_recent', sessionId: requireEntityId(exact.sessionId, 'sessionId') };
158
+ }
123
159
  if (result.kind !== 'revision_conflict') {
124
160
  throw invalidProtocolFrame('Invalid Session remove result kind');
125
161
  }
@@ -0,0 +1,155 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ import { requireCount, requireEntityId, requireExactRecord, requireShapedRecord } from './codec.js';
20
+ import { invalidProtocolFrame } from './errors.js';
21
+ import { defineOperation } from './operation-spec.js';
22
+ /**
23
+ * Sessions measured by one `storage.usage.sessions.query`. Each Session costs
24
+ * several indexed range scans on the Host, so a request stays small and a
25
+ * Client pages through a longer list one request at a time.
26
+ */
27
+ export const STORAGE_USAGE_SESSION_MAX_ITEMS = 25;
28
+ /**
29
+ * State Root parts the Host can size without scanning database rows.
30
+ *
31
+ * `database` is the operational SQLite file set. `artifacts` sums recorded
32
+ * artifact sizes. `context_offload` is its SQLite file set, which holds inline
33
+ * blobs, plus the managed value files beside it. `memory` is the long-term
34
+ * memory SQLite file set. Worktrees are counted separately and never sized.
35
+ */
36
+ export const STORAGE_USAGE_KINDS = ['database', 'artifacts', 'context_offload', 'memory'];
37
+ const STORAGE_USAGE_ERRORS = [
38
+ 'host_not_ready',
39
+ 'host_draining',
40
+ 'operation_unavailable',
41
+ 'persistence_failed',
42
+ 'internal_failure',
43
+ ];
44
+ export const STORAGE_USAGE_OPERATION_SPECS = {
45
+ 'storage.usage.query': defineOperation({
46
+ mode: 'query',
47
+ availability: 'ready',
48
+ errors: STORAGE_USAGE_ERRORS,
49
+ decodeInput: decodeStorageUsageQueryInput,
50
+ decodeOutput: decodeStorageUsageQueryResult,
51
+ }),
52
+ 'storage.usage.sessions.query': defineOperation({
53
+ mode: 'query',
54
+ availability: 'ready',
55
+ errors: STORAGE_USAGE_ERRORS,
56
+ decodeInput: decodeStorageSessionUsageQueryInput,
57
+ decodeOutput: decodeStorageSessionUsageQueryResult,
58
+ assertOutputForInput: (input, output) => {
59
+ // A subsequence of the request: each id at most once, in request order.
60
+ let next = 0;
61
+ for (const session of output.sessions) {
62
+ while (next < input.sessionIds.length && input.sessionIds[next] !== session.sessionId) {
63
+ next += 1;
64
+ }
65
+ if (next === input.sessionIds.length) {
66
+ throw invalidProtocolFrame('Storage usage Sessions do not match the request');
67
+ }
68
+ next += 1;
69
+ }
70
+ },
71
+ }),
72
+ };
73
+ export function decodeStorageUsageQueryInput(value) {
74
+ requireExactRecord(value, 'storage usage input', []);
75
+ return {};
76
+ }
77
+ export function decodeStorageUsageQueryResult(value) {
78
+ const result = requireExactRecord(value, 'storage usage result', [
79
+ 'measuredAt',
80
+ 'totals',
81
+ 'reclaimableBytes',
82
+ 'worktreeCount',
83
+ ]);
84
+ if (!Array.isArray(result.totals) || result.totals.length > STORAGE_USAGE_KINDS.length) {
85
+ throw invalidProtocolFrame('Invalid storage usage totals');
86
+ }
87
+ const totals = result.totals.map(decodeTotal);
88
+ if (new Set(totals.map((total) => total.kind)).size !== totals.length) {
89
+ throw invalidProtocolFrame('Duplicate storage usage kind');
90
+ }
91
+ return {
92
+ measuredAt: requireCount(result.measuredAt, 'storage usage measuredAt'),
93
+ totals,
94
+ reclaimableBytes: requireCount(result.reclaimableBytes, 'storage usage reclaimableBytes'),
95
+ worktreeCount: requireCount(result.worktreeCount, 'storage usage worktreeCount'),
96
+ };
97
+ }
98
+ export function decodeStorageSessionUsageQueryInput(value) {
99
+ const input = requireExactRecord(value, 'storage Session usage input', ['sessionIds']);
100
+ if (!Array.isArray(input.sessionIds) ||
101
+ input.sessionIds.length === 0 ||
102
+ input.sessionIds.length > STORAGE_USAGE_SESSION_MAX_ITEMS) {
103
+ throw invalidProtocolFrame('Invalid storage usage sessionIds');
104
+ }
105
+ const sessionIds = input.sessionIds.map((sessionId) => requireEntityId(sessionId, 'sessionId'));
106
+ if (new Set(sessionIds).size !== sessionIds.length) {
107
+ throw invalidProtocolFrame('Duplicate storage usage sessionId');
108
+ }
109
+ return { sessionIds };
110
+ }
111
+ export function decodeStorageSessionUsageQueryResult(value) {
112
+ const result = requireExactRecord(value, 'storage Session usage result', ['sessions']);
113
+ if (!Array.isArray(result.sessions) || result.sessions.length > STORAGE_USAGE_SESSION_MAX_ITEMS) {
114
+ throw invalidProtocolFrame('Invalid storage usage Sessions');
115
+ }
116
+ const sessions = result.sessions.map(decodeSessionUsage);
117
+ if (new Set(sessions.map((session) => session.sessionId)).size !== sessions.length) {
118
+ throw invalidProtocolFrame('Duplicate storage usage Session');
119
+ }
120
+ return { sessions };
121
+ }
122
+ function decodeTotal(value) {
123
+ const total = requireExactRecord(value, 'storage usage total', ['kind', 'bytes', 'exact']);
124
+ if (!STORAGE_USAGE_KINDS.includes(total.kind)) {
125
+ throw invalidProtocolFrame('Invalid storage usage kind');
126
+ }
127
+ if (typeof total.exact !== 'boolean') {
128
+ throw invalidProtocolFrame('Invalid storage usage exactness');
129
+ }
130
+ return {
131
+ kind: total.kind,
132
+ bytes: requireCount(total.bytes, 'storage usage bytes'),
133
+ exact: total.exact,
134
+ };
135
+ }
136
+ function decodeSessionUsage(value) {
137
+ const session = requireExactRecord(value, 'storage usage Session', [
138
+ 'sessionId',
139
+ 'bytes',
140
+ 'worktreeCount',
141
+ ]);
142
+ const bytes = requireShapedRecord(session.bytes, 'storage usage Session bytes', ['transcript', 'runtime', 'artifacts'], ['context']);
143
+ return {
144
+ sessionId: requireEntityId(session.sessionId, 'sessionId'),
145
+ bytes: {
146
+ transcript: requireCount(bytes.transcript, 'storage usage transcript bytes'),
147
+ runtime: requireCount(bytes.runtime, 'storage usage runtime bytes'),
148
+ artifacts: requireCount(bytes.artifacts, 'storage usage artifact bytes'),
149
+ ...(bytes.context === undefined
150
+ ? {}
151
+ : { context: requireCount(bytes.context, 'storage usage context bytes') }),
152
+ },
153
+ worktreeCount: requireCount(session.worktreeCount, 'storage usage worktreeCount'),
154
+ };
155
+ }
@@ -16,12 +16,11 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
- import { constants } from 'node:fs';
20
- import { access, realpath, stat } from 'node:fs/promises';
21
- import { dirname, join, isAbsolute } from 'node:path';
19
+ import { dirname } from 'node:path';
22
20
  import { StringDecoder } from 'node:string_decoder';
23
21
  import { methods, RequestError } from '@agentclientprotocol/sdk';
24
22
  import { AcpSetupError, withAcpConnection } from './connection.js';
23
+ import { checkAntigravityProgram, AntigravityProgramError } from '../../antigravity-program.js';
25
24
  const AUTH_PREFIX = 'Open the following link to authenticate the ACP server: ';
26
25
  const INITIALIZE_TIMEOUT_MS = 30_000;
27
26
  const LOGIN_TIMEOUT_MS = 5 * 60_000;
@@ -45,8 +44,7 @@ export async function runAntigravitySetup(input) {
45
44
  });
46
45
  try {
47
46
  signal.throwIfAborted();
48
- const executable = await checkedFile(input.executable, 'executable_unavailable');
49
- const helper = await checkedFile(join(dirname(executable), 'localharness_external'), 'helper_unavailable');
47
+ const { executable, helper } = await checkAntigravityProgram(input.executable);
50
48
  await withAcpConnection({
51
49
  executable,
52
50
  cwd: dirname(executable),
@@ -96,6 +94,8 @@ export async function runAntigravitySetup(input) {
96
94
  });
97
95
  }
98
96
  catch (error) {
97
+ if (error instanceof AntigravityProgramError)
98
+ throw new AcpSetupError(error.failure);
99
99
  if (error instanceof AcpSetupError)
100
100
  throw error;
101
101
  signal.throwIfAborted();
@@ -105,20 +105,6 @@ export async function runAntigravitySetup(input) {
105
105
  clearTimeout(timeout);
106
106
  }
107
107
  }
108
- async function checkedFile(path, failure) {
109
- try {
110
- if (!isAbsolute(path))
111
- throw new Error('Absolute path required');
112
- const resolved = await realpath(path);
113
- if (!(await stat(resolved)).isFile())
114
- throw new Error('File required');
115
- await access(resolved, constants.X_OK);
116
- return resolved;
117
- }
118
- catch {
119
- throw new AcpSetupError(failure);
120
- }
121
- }
122
108
  /** Official 1.1.1 prints its login link to stderr; ordinary diagnostics are discarded. */
123
109
  export function createAntigravityStderrHandler(onAuthorizationUrl) {
124
110
  const recognize = (line) => {
@@ -278,6 +278,29 @@ function projectOperator(operator) {
278
278
  },
279
279
  }
280
280
  : {}),
281
+ ...(operator.output
282
+ ? {
283
+ output: {
284
+ activationId: operator.output.activationId,
285
+ preview: operator.output.preview,
286
+ previewTruncated: operator.output.previewTruncated,
287
+ phase: operator.output.phase,
288
+ previewUpdatedAt: operator.output.previewUpdatedAt,
289
+ sourceEventId: operator.output.sourceEventId,
290
+ sampleStartedAt: operator.output.sampleStartedAt,
291
+ ...(operator.output.messageId ? { messageId: operator.output.messageId } : {}),
292
+ ...(operator.output.outputTokens !== undefined
293
+ ? { outputTokens: operator.output.outputTokens }
294
+ : {}),
295
+ ...(operator.output.sampleDurationMs !== undefined
296
+ ? { sampleDurationMs: operator.output.sampleDurationMs }
297
+ : {}),
298
+ ...(operator.output.tokensPerSecond !== undefined
299
+ ? { tokensPerSecond: operator.output.tokensPerSecond }
300
+ : {}),
301
+ },
302
+ }
303
+ : {}),
281
304
  };
282
305
  }
283
306
  function projectReadinessWait(wait) {
@@ -42,6 +42,11 @@ export async function readCanonicalTurnSnapshot(stores, identity, knownRun) {
42
42
  const terminal = classifyTerminalRuntimeLedger(logical.tip, logical.events);
43
43
  if (terminal.kind === 'fact') {
44
44
  const fact = terminal.fact;
45
+ if (fact.runStatus === 'handed_off') {
46
+ // The pause ends this run, not the turn: the logical execution continues
47
+ // in the handoff successor.
48
+ return { sessionId, turnId, runId, status: 'running', ...rootExecutionKind };
49
+ }
45
50
  if (fact.runStatus === 'completed') {
46
51
  const contextCompactionOutcome = readContextCompactionOutcome(fact.terminalEvent.actions?.stateDelta?.contextCompactionOutcome);
47
52
  return {