pi-better-server 0.4.0 → 0.6.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.
- package/package.json +8 -1
- package/scripts/copy-pi-test-providers.mjs +10 -0
- package/scripts/event-publication/README.md +26 -0
- package/scripts/event-publication/commit.mjs +21 -0
- package/scripts/event-publication/measure.mjs +87 -0
- package/scripts/event-publication/writer.mjs +6 -0
- package/scripts/measure-full-runtime/frontend.ts +24 -0
- package/scripts/measure-full-runtime/hosted-extension.ts +28 -0
- package/scripts/measure-full-runtime/probe.mjs +29 -0
- package/scripts/measure-full-runtime/recovery-trace-loader.mjs +51 -0
- package/scripts/measure-full-runtime/recovery-trace.mjs +16 -0
- package/scripts/measure-full-runtime.mjs +146 -0
- package/scripts/measure-shared-reads/probe.mjs +26 -2
- package/scripts/measure-shared-reads.mjs +44 -9
- package/scripts/private-runtime/package-lock.json +66 -4
- package/scripts/private-runtime/package.json +10 -2
- package/scripts/source-provenance.mjs +31 -0
- package/scripts/test-on-pi.sh +3 -9
- package/src/handshake.ts +1 -1
- package/src/hosted-session.ts +32 -4
- package/src/maintenance.ts +35 -7
- package/src/registry.ts +28 -4
- package/src/runtime/attempt-invalidation.ts +54 -0
- package/src/runtime/background-history.ts +151 -45
- package/src/runtime/background-policy.ts +27 -0
- package/src/runtime/background-tools.ts +389 -0
- package/src/runtime/background.ts +410 -48
- package/src/runtime/cancellation.ts +28 -7
- package/src/runtime/catalog-sources.ts +199 -0
- package/src/runtime/catalog.ts +53 -21
- package/src/runtime/client.ts +22 -2
- package/src/runtime/domain/assignment-inbox.mjs +119 -0
- package/src/runtime/domain/assignment-observation.d.mts +1 -1
- package/src/runtime/domain/assignment-observation.mjs +71 -33
- package/src/runtime/domain/background/process-identity.mjs +20 -2
- package/src/runtime/domain/background/process.mjs +3 -3
- package/src/runtime/domain/background/registry.mjs +89 -4
- package/src/runtime/domain/background/types.mjs +1 -0
- package/src/runtime/domain/background-service/adapter-contract.domain.mjs +83 -0
- package/src/runtime/domain/background-service/adapter-contract.ts +70 -0
- package/src/runtime/domain/background-service/batch.domain.mjs +91 -0
- package/src/runtime/domain/background-service/batch.ts +111 -0
- package/src/runtime/domain/background-service/conditions.domain.mjs +94 -0
- package/src/runtime/domain/background-service/conditions.ts +99 -0
- package/src/runtime/domain/background-service/delivery-observer.domain.mjs +37 -0
- package/src/runtime/domain/background-service/delivery-observer.ts +42 -0
- package/src/runtime/domain/background-service/failures.domain.mjs +209 -0
- package/src/runtime/domain/background-service/failures.ts +212 -0
- package/src/runtime/domain/background-service/goal-provider.domain.mjs +193 -0
- package/src/runtime/domain/background-service/goal-provider.ts +209 -0
- package/src/runtime/domain/background-service/index.domain.mjs +54 -0
- package/src/runtime/domain/background-service/index.ts +55 -0
- package/src/runtime/domain/background-service/logs.domain.mjs +129 -0
- package/src/runtime/domain/background-service/logs.ts +134 -0
- package/src/runtime/domain/background-service/maintenance.domain.mjs +95 -0
- package/src/runtime/domain/background-service/maintenance.ts +98 -0
- package/src/runtime/domain/background-service/managed-authority.domain.mjs +32 -0
- package/src/runtime/domain/background-service/managed-authority.ts +30 -0
- package/src/runtime/domain/background-service/managed-client.domain.mjs +79 -0
- package/src/runtime/domain/background-service/managed-client.ts +73 -0
- package/src/runtime/domain/background-service/managed-frontend.domain.mjs +225 -0
- package/src/runtime/domain/background-service/managed-frontend.ts +176 -0
- package/src/runtime/domain/background-service/navigator-provider.domain.mjs +492 -0
- package/src/runtime/domain/background-service/navigator-provider.ts +485 -0
- package/src/runtime/domain/background-service/observed-wait-client.domain.mjs +6 -0
- package/src/runtime/domain/background-service/observed-wait-client.ts +10 -0
- package/src/runtime/domain/background-service/observed-waits.domain.mjs +4080 -0
- package/src/runtime/domain/background-service/observed-waits.ts +4513 -0
- package/src/runtime/domain/background-service/output.domain.mjs +867 -0
- package/src/runtime/domain/background-service/output.ts +952 -0
- package/src/runtime/domain/background-service/process-identity.domain.mjs +129 -0
- package/src/runtime/domain/background-service/process-identity.ts +134 -0
- package/src/runtime/domain/background-service/process.domain.mjs +512 -0
- package/src/runtime/domain/background-service/process.ts +532 -0
- package/src/runtime/domain/background-service/prompt.domain.mjs +58 -0
- package/src/runtime/domain/background-service/prompt.ts +72 -0
- package/src/runtime/domain/background-service/registry.domain.mjs +460 -0
- package/src/runtime/domain/background-service/registry.ts +450 -0
- package/src/runtime/domain/background-service/remote-task-preset.domain.mjs +67 -0
- package/src/runtime/domain/background-service/remote-task-preset.ts +127 -0
- package/src/runtime/domain/background-service/runtime.domain.mjs +1511 -0
- package/src/runtime/domain/background-service/runtime.ts +1636 -0
- package/src/runtime/domain/background-service/sandbox.domain.mjs +735 -0
- package/src/runtime/domain/background-service/sandbox.ts +913 -0
- package/src/runtime/domain/background-service/shared-callback-batcher.domain.mjs +777 -0
- package/src/runtime/domain/background-service/shared-callback-batcher.ts +956 -0
- package/src/runtime/domain/background-service/shared-execution-policy.domain.mjs +50 -0
- package/src/runtime/domain/background-service/shared-execution-policy.ts +61 -0
- package/src/runtime/domain/background-service/shared-failure-observations.domain.mjs +1078 -0
- package/src/runtime/domain/background-service/shared-failure-observations.ts +1166 -0
- package/src/runtime/domain/background-service/shared-harness-settings.domain.mjs +126 -0
- package/src/runtime/domain/background-service/shared-harness-settings.ts +116 -0
- package/src/runtime/domain/background-service/shared-log-utils.domain.mjs +1223 -0
- package/src/runtime/domain/background-service/shared-log-utils.ts +1492 -0
- package/src/runtime/domain/background-service/shared-navigator-panels.domain.mjs +289 -0
- package/src/runtime/domain/background-service/shared-navigator-panels.ts +272 -0
- package/src/runtime/domain/background-service/shared-navigator.domain.mjs +1930 -0
- package/src/runtime/domain/background-service/shared-navigator.ts +1962 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/assignment-inbox.mjs +144 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/assignment-observation.mjs +189 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/index.domain.mjs +51 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/index.ts +122 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/assignment-changes.domain.mjs +75 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/assignment-changes.ts +73 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/assignment-outcomes.domain.mjs +163 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/assignment-outcomes.ts +174 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/background-parent-callbacks.domain.mjs +66 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/background-parent-callbacks.ts +68 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/background-requests.domain.mjs +87 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/background-requests.ts +90 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/discovery.domain.mjs +97 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/discovery.ts +139 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/errors.domain.mjs +12 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/errors.ts +79 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/operations.domain.mjs +342 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/operations.ts +513 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/outbox.domain.mjs +283 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/outbox.ts +458 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/recovery.domain.mjs +52 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/recovery.ts +55 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/result-supervision.domain.mjs +114 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/result-supervision.ts +140 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/rows.domain.mjs +280 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/rows.ts +442 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/schema.domain.mjs +420 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/schema.ts +441 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/sqlite.domain.mjs +194 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/sqlite.ts +239 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/store.domain.mjs +275 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/store.ts +585 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/subagent-launch.domain.mjs +120 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/subagent-launch.ts +142 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/task-cancellation.domain.mjs +188 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/task-cancellation.ts +224 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/types.domain.mjs +25 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/types.ts +707 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/upgrade.domain.mjs +22 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/upgrade.ts +22 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/validate.domain.mjs +234 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/validate.ts +241 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/waits.domain.mjs +851 -0
- package/src/runtime/domain/background-service/shared-operation-coordinator/src/waits.ts +1424 -0
- package/src/runtime/domain/background-service/shared-permission-blocker.domain.mjs +40 -0
- package/src/runtime/domain/background-service/shared-permission-blocker.ts +48 -0
- package/src/runtime/domain/background-service/shared-render-scheduler.domain.mjs +41 -0
- package/src/runtime/domain/background-service/shared-render-scheduler.ts +47 -0
- package/src/runtime/domain/background-service/shared-sandbox-core.domain.mjs +1531 -0
- package/src/runtime/domain/background-service/shared-sandbox-core.ts +1757 -0
- package/src/runtime/domain/background-service/shared-sandbox-diagnostics.domain.mjs +591 -0
- package/src/runtime/domain/background-service/shared-sandbox-diagnostics.ts +491 -0
- package/src/runtime/domain/background-service/shared-ssh-core/index.domain.mjs +698 -0
- package/src/runtime/domain/background-service/shared-ssh-core/index.ts +979 -0
- package/src/runtime/domain/background-service/shared-stall-detector.domain.mjs +37 -0
- package/src/runtime/domain/background-service/shared-stall-detector.ts +69 -0
- package/src/runtime/domain/background-service/shared-work-client.mjs +303 -0
- package/src/runtime/domain/background-service/stall-attention.domain.mjs +29 -0
- package/src/runtime/domain/background-service/stall-attention.ts +31 -0
- package/src/runtime/domain/background-service/stall.domain.mjs +57 -0
- package/src/runtime/domain/background-service/stall.ts +57 -0
- package/src/runtime/domain/background-service/supervisor/README.md +111 -0
- package/src/runtime/domain/background-service/supervisor/emit-runner.mjs +90 -0
- package/src/runtime/domain/background-service/supervisor/generated/conditions.mjs +96 -0
- package/src/runtime/domain/background-service/supervisor/generated/identity.mjs +95 -0
- package/src/runtime/domain/background-service/supervisor/generated/process-identity.mjs +131 -0
- package/src/runtime/domain/background-service/supervisor/generated/process.mjs +514 -0
- package/src/runtime/domain/background-service/supervisor/generated/runner.mjs +872 -0
- package/src/runtime/domain/background-service/supervisor/generated/store.mjs +609 -0
- package/src/runtime/domain/background-service/supervisor/generated/types.mjs +50 -0
- package/src/runtime/domain/background-service/supervisor/identity.domain.mjs +93 -0
- package/src/runtime/domain/background-service/supervisor/identity.ts +99 -0
- package/src/runtime/domain/background-service/supervisor/index.domain.mjs +22 -0
- package/src/runtime/domain/background-service/supervisor/index.ts +37 -0
- package/src/runtime/domain/background-service/supervisor/invocation.domain.mjs +30 -0
- package/src/runtime/domain/background-service/supervisor/invocation.ts +44 -0
- package/src/runtime/domain/background-service/supervisor/runner.domain.mjs +870 -0
- package/src/runtime/domain/background-service/supervisor/runner.ts +982 -0
- package/src/runtime/domain/background-service/supervisor/store.domain.mjs +605 -0
- package/src/runtime/domain/background-service/supervisor/store.ts +651 -0
- package/src/runtime/domain/background-service/supervisor/supervisor.domain.mjs +721 -0
- package/src/runtime/domain/background-service/supervisor/supervisor.ts +804 -0
- package/src/runtime/domain/background-service/supervisor/types.domain.mjs +48 -0
- package/src/runtime/domain/background-service/supervisor/types.ts +394 -0
- package/src/runtime/domain/background-service/task-diagnostics.domain.mjs +60 -0
- package/src/runtime/domain/background-service/task-diagnostics.ts +71 -0
- package/src/runtime/domain/background-service/tools.domain.mjs +1050 -0
- package/src/runtime/domain/background-service/tools.ts +1142 -0
- package/src/runtime/domain/background-service/types.domain.mjs +5 -0
- package/src/runtime/domain/background-service/types.ts +236 -0
- package/src/runtime/domain/background-service/work-observation.domain.mjs +176 -0
- package/src/runtime/domain/background-service/work-observation.ts +144 -0
- package/src/runtime/domain/catalog/catalog-store.d.mts +9 -1
- package/src/runtime/domain/catalog/catalog-store.mjs +20 -22
- package/src/runtime/domain/coordinator/src/assignment-changes.mjs +75 -0
- package/src/runtime/domain/coordinator/src/assignment-outcomes.mjs +2 -0
- package/src/runtime/domain/coordinator/src/background-parent-callbacks.mjs +65 -0
- package/src/runtime/domain/coordinator/src/background-requests.mjs +86 -0
- package/src/runtime/domain/coordinator/src/discovery.mjs +4 -2
- package/src/runtime/domain/coordinator/src/operations.mjs +44 -4
- package/src/runtime/domain/coordinator/src/result-supervision.mjs +12 -0
- package/src/runtime/domain/coordinator/src/rows.mjs +2 -0
- package/src/runtime/domain/coordinator/src/schema.mjs +73 -21
- package/src/runtime/domain/coordinator/src/store.mjs +32 -3
- package/src/runtime/domain/coordinator/src/subagent-launch.mjs +119 -0
- package/src/runtime/domain/coordinator/src/types.mjs +1 -1
- package/src/runtime/domain/coordinator/src/upgrade.mjs +22 -0
- package/src/runtime/domain/health-observation.d.mts +3 -1
- package/src/runtime/domain/health-observation.mjs +189 -190
- package/src/runtime/domain/log-cursor.d.mts +2 -0
- package/src/runtime/domain/log-cursor.mjs +85 -16
- package/src/runtime/domain/parse.d.mts +4 -1
- package/src/runtime/domain/parse.mjs +50 -5
- package/src/runtime/domain/sandbox-policy/README.md +633 -0
- package/src/runtime/domain/sandbox-policy/background-admission.domain.mjs +83 -0
- package/src/runtime/domain/sandbox-policy/background-admission.ts +75 -0
- package/src/runtime/domain/sandbox-policy/commands.domain.mjs +245 -0
- package/src/runtime/domain/sandbox-policy/commands.ts +336 -0
- package/src/runtime/domain/sandbox-policy/deny-rules.domain.mjs +440 -0
- package/src/runtime/domain/sandbox-policy/deny-rules.ts +620 -0
- package/src/runtime/domain/sandbox-policy/diagnostics-command.domain.mjs +30 -0
- package/src/runtime/domain/sandbox-policy/diagnostics-command.ts +27 -0
- package/src/runtime/domain/sandbox-policy/events.domain.mjs +49 -0
- package/src/runtime/domain/sandbox-policy/events.ts +85 -0
- package/src/runtime/domain/sandbox-policy/files.domain.mjs +153 -0
- package/src/runtime/domain/sandbox-policy/files.ts +224 -0
- package/src/runtime/domain/sandbox-policy/index.domain.mjs +289 -0
- package/src/runtime/domain/sandbox-policy/index.ts +386 -0
- package/src/runtime/domain/sandbox-policy/package.json +66 -0
- package/src/runtime/domain/sandbox-policy/permission-settings.domain.mjs +36 -0
- package/src/runtime/domain/sandbox-policy/permission-settings.ts +46 -0
- package/src/runtime/domain/sandbox-policy/permissions-page.domain.mjs +309 -0
- package/src/runtime/domain/sandbox-policy/permissions-page.ts +295 -0
- package/src/runtime/domain/sandbox-policy/permissions.domain.mjs +98 -0
- package/src/runtime/domain/sandbox-policy/permissions.ts +125 -0
- package/src/runtime/domain/sandbox-policy/policy.domain.mjs +80 -0
- package/src/runtime/domain/sandbox-policy/policy.ts +102 -0
- package/src/runtime/domain/sandbox-policy/preferences.domain.mjs +55 -0
- package/src/runtime/domain/sandbox-policy/preferences.ts +82 -0
- package/src/runtime/domain/sandbox-policy/rules-page.domain.mjs +138 -0
- package/src/runtime/domain/sandbox-policy/rules-page.ts +176 -0
- package/src/runtime/domain/sandbox-policy/session-permissions.domain.mjs +22 -0
- package/src/runtime/domain/sandbox-policy/session-permissions.ts +24 -0
- package/src/runtime/domain/sandbox-policy/shared-harness-settings.domain.mjs +126 -0
- package/src/runtime/domain/sandbox-policy/shared-harness-settings.ts +116 -0
- package/src/runtime/domain/sandbox-policy/shared-permission-blocker.domain.mjs +40 -0
- package/src/runtime/domain/sandbox-policy/shared-permission-blocker.ts +48 -0
- package/src/runtime/domain/sandbox-policy/shared-sandbox-core.domain.mjs +1531 -0
- package/src/runtime/domain/sandbox-policy/shared-sandbox-core.ts +1757 -0
- package/src/runtime/domain/sandbox-policy/shared-sandbox-diagnostics.domain.mjs +591 -0
- package/src/runtime/domain/sandbox-policy/shared-sandbox-diagnostics.ts +491 -0
- package/src/runtime/domain/sandbox-policy/shared-task-application.domain.mjs +185 -0
- package/src/runtime/domain/sandbox-policy/shared-task-application.ts +185 -0
- package/src/runtime/domain/sandbox-policy/shared-task-apply-patch.domain.mjs +416 -0
- package/src/runtime/domain/sandbox-policy/shared-task-apply-patch.ts +409 -0
- package/src/runtime/domain/sandbox-policy/shared-task-exec.domain.mjs +325 -0
- package/src/runtime/domain/sandbox-policy/shared-task-exec.ts +335 -0
- package/src/runtime/domain/sandbox-policy/shared-task-files.domain.mjs +346 -0
- package/src/runtime/domain/sandbox-policy/shared-task-files.ts +342 -0
- package/src/runtime/domain/sandbox-policy/shared-task-process-identity.domain.mjs +140 -0
- package/src/runtime/domain/sandbox-policy/shared-task-process-identity.ts +126 -0
- package/src/runtime/domain/sandbox-policy/shared-task-process-list.domain.mjs +220 -0
- package/src/runtime/domain/sandbox-policy/shared-task-process-list.ts +209 -0
- package/src/runtime/domain/sandbox-policy/shared-task-sandbox.domain.mjs +227 -0
- package/src/runtime/domain/sandbox-policy/shared-task-sandbox.ts +224 -0
- package/src/runtime/domain/sandbox-policy/shared-task-tools.domain.mjs +92 -0
- package/src/runtime/domain/sandbox-policy/shared-task-tools.ts +123 -0
- package/src/runtime/domain/sandbox-policy/shell.domain.mjs +93 -0
- package/src/runtime/domain/sandbox-policy/shell.ts +129 -0
- package/src/runtime/domain/sandbox-policy/state.domain.mjs +307 -0
- package/src/runtime/domain/sandbox-policy/state.ts +408 -0
- package/src/runtime/domain/sandbox-policy/status.domain.mjs +64 -0
- package/src/runtime/domain/sandbox-policy/status.ts +76 -0
- package/src/runtime/domain/sandbox-policy/subagent-admission.domain.mjs +69 -0
- package/src/runtime/domain/sandbox-policy/subagent-admission.ts +60 -0
- package/src/runtime/domain/subagents/CONTEXT.md +202 -0
- package/src/runtime/domain/subagents/PRODUCT.md +49 -0
- package/src/runtime/domain/subagents/README.md +201 -0
- package/src/runtime/domain/subagents/agent-catalog.mjs +64 -0
- package/src/runtime/domain/subagents/agent-commands.domain.mjs +822 -0
- package/src/runtime/domain/subagents/agent-commands.ts +905 -0
- package/src/runtime/domain/subagents/agent-inspection.domain.mjs +398 -0
- package/src/runtime/domain/subagents/agent-inspection.ts +574 -0
- package/src/runtime/domain/subagents/agent-operations.domain.mjs +40 -0
- package/src/runtime/domain/subagents/agent-operations.ts +61 -0
- package/src/runtime/domain/subagents/agent-session-settings.domain.mjs +112 -0
- package/src/runtime/domain/subagents/agent-session-settings.ts +118 -0
- package/src/runtime/domain/subagents/agents-catalog-tool.domain.mjs +84 -0
- package/src/runtime/domain/subagents/agents-catalog-tool.ts +118 -0
- package/src/runtime/domain/subagents/assignment-outcomes.domain.mjs +276 -0
- package/src/runtime/domain/subagents/assignment-outcomes.ts +212 -0
- package/src/runtime/domain/subagents/assignment-projection.mjs +261 -0
- package/src/runtime/domain/subagents/assignment-report.domain.mjs +174 -0
- package/src/runtime/domain/subagents/assignment-report.ts +156 -0
- package/src/runtime/domain/subagents/batch.mjs +275 -0
- package/src/runtime/domain/subagents/callback-fields.domain.mjs +72 -0
- package/src/runtime/domain/subagents/callback-fields.ts +95 -0
- package/src/runtime/domain/subagents/capacity.mjs +108 -0
- package/src/runtime/domain/subagents/catalog-editor.domain.mjs +98 -0
- package/src/runtime/domain/subagents/catalog-editor.ts +125 -0
- package/src/runtime/domain/subagents/catalog-host-admission.domain.mjs +104 -0
- package/src/runtime/domain/subagents/catalog-host-admission.ts +85 -0
- package/src/runtime/domain/subagents/catalog-identity.domain.mjs +222 -0
- package/src/runtime/domain/subagents/catalog-identity.ts +258 -0
- package/src/runtime/domain/subagents/catalog-overlay.domain.mjs +9 -0
- package/src/runtime/domain/subagents/catalog-overlay.ts +10 -0
- package/src/runtime/domain/subagents/catalog-preferences.domain.mjs +164 -0
- package/src/runtime/domain/subagents/catalog-preferences.ts +139 -0
- package/src/runtime/domain/subagents/catalog-resolver.domain.mjs +366 -0
- package/src/runtime/domain/subagents/catalog-resolver.ts +540 -0
- package/src/runtime/domain/subagents/catalog-runtime.domain.mjs +570 -0
- package/src/runtime/domain/subagents/catalog-runtime.ts +680 -0
- package/src/runtime/domain/subagents/catalog-schema.domain.mjs +1331 -0
- package/src/runtime/domain/subagents/catalog-schema.ts +1563 -0
- package/src/runtime/domain/subagents/catalog-skill-edits.domain.mjs +95 -0
- package/src/runtime/domain/subagents/catalog-skill-edits.ts +116 -0
- package/src/runtime/domain/subagents/catalog-store.domain.mjs +808 -0
- package/src/runtime/domain/subagents/catalog-store.ts +1006 -0
- package/src/runtime/domain/subagents/catalog-ui.domain.mjs +651 -0
- package/src/runtime/domain/subagents/catalog-ui.ts +611 -0
- package/src/runtime/domain/subagents/child-apply-patch.domain.mjs +13 -0
- package/src/runtime/domain/subagents/child-apply-patch.ts +13 -0
- package/src/runtime/domain/subagents/child-codemode.domain.mjs +16 -0
- package/src/runtime/domain/subagents/child-codemode.ts +17 -0
- package/src/runtime/domain/subagents/child-dependencies.mjs +193 -0
- package/src/runtime/domain/subagents/child-incidents.domain.mjs +170 -0
- package/src/runtime/domain/subagents/child-incidents.ts +169 -0
- package/src/runtime/domain/subagents/child-operations.domain.mjs +986 -0
- package/src/runtime/domain/subagents/child-operations.ts +1191 -0
- package/src/runtime/domain/subagents/child-ownership.domain.mjs +205 -0
- package/src/runtime/domain/subagents/child-ownership.ts +160 -0
- package/src/runtime/domain/subagents/child-preflight.mjs +38 -0
- package/src/runtime/domain/subagents/child-process-list.domain.mjs +7 -0
- package/src/runtime/domain/subagents/child-process-list.ts +8 -0
- package/src/runtime/domain/subagents/child-runtime.mjs +67 -0
- package/src/runtime/domain/subagents/child-steer.domain.mjs +109 -0
- package/src/runtime/domain/subagents/child-steer.ts +102 -0
- package/src/runtime/domain/subagents/cleanup.domain.mjs +818 -0
- package/src/runtime/domain/subagents/cleanup.ts +1017 -0
- package/src/runtime/domain/subagents/codex-import.domain.mjs +575 -0
- package/src/runtime/domain/subagents/codex-import.ts +717 -0
- package/src/runtime/domain/subagents/completion.domain.mjs +6 -0
- package/src/runtime/domain/subagents/completion.mjs +152 -0
- package/src/runtime/domain/subagents/completion.ts +11 -0
- package/src/runtime/domain/subagents/config.domain.mjs +248 -0
- package/src/runtime/domain/subagents/config.json +15 -0
- package/src/runtime/domain/subagents/config.ts +328 -0
- package/src/runtime/domain/subagents/continuation-authority.domain.mjs +38 -0
- package/src/runtime/domain/subagents/continuation-authority.ts +31 -0
- package/src/runtime/domain/subagents/continuation-runtime.domain.mjs +89 -0
- package/src/runtime/domain/subagents/continuation-runtime.ts +88 -0
- package/src/runtime/domain/subagents/continuation.domain.mjs +942 -0
- package/src/runtime/domain/subagents/continuation.ts +1051 -0
- package/src/runtime/domain/subagents/delegation.domain.mjs +19 -0
- package/src/runtime/domain/subagents/delegation.ts +24 -0
- package/src/runtime/domain/subagents/effective-settings.domain.mjs +130 -0
- package/src/runtime/domain/subagents/effective-settings.ts +184 -0
- package/src/runtime/domain/subagents/extensions.domain.mjs +6 -0
- package/src/runtime/domain/subagents/extensions.mjs +164 -0
- package/src/runtime/domain/subagents/extensions.ts +19 -0
- package/src/runtime/domain/subagents/failures.domain.mjs +362 -0
- package/src/runtime/domain/subagents/failures.ts +319 -0
- package/src/runtime/domain/subagents/finalization.domain.mjs +168 -0
- package/src/runtime/domain/subagents/finalization.ts +218 -0
- package/src/runtime/domain/subagents/git-remotes.domain.mjs +351 -0
- package/src/runtime/domain/subagents/git-remotes.ts +413 -0
- package/src/runtime/domain/subagents/git-workspace.domain.mjs +337 -0
- package/src/runtime/domain/subagents/git-workspace.ts +430 -0
- package/src/runtime/domain/subagents/goal-provider.domain.mjs +125 -0
- package/src/runtime/domain/subagents/goal-provider.ts +132 -0
- package/src/runtime/domain/subagents/health-observation.domain.mjs +617 -0
- package/src/runtime/domain/subagents/health-observation.ts +818 -0
- package/src/runtime/domain/subagents/health-surface.mjs +284 -0
- package/src/runtime/domain/subagents/health.domain.mjs +261 -0
- package/src/runtime/domain/subagents/health.ts +343 -0
- package/src/runtime/domain/subagents/historical-attention.domain.mjs +37 -0
- package/src/runtime/domain/subagents/historical-attention.ts +35 -0
- package/src/runtime/domain/subagents/incident-model.domain.mjs +322 -0
- package/src/runtime/domain/subagents/incident-model.ts +358 -0
- package/src/runtime/domain/subagents/index.domain.mjs +4731 -0
- package/src/runtime/domain/subagents/index.ts +4781 -0
- package/src/runtime/domain/subagents/launch-abort.domain.mjs +13 -0
- package/src/runtime/domain/subagents/launch-abort.ts +21 -0
- package/src/runtime/domain/subagents/launch-context.domain.mjs +24 -0
- package/src/runtime/domain/subagents/launch-context.ts +23 -0
- package/src/runtime/domain/subagents/launch-digest.mjs +6 -0
- package/src/runtime/domain/subagents/lifecycle.domain.mjs +265 -0
- package/src/runtime/domain/subagents/lifecycle.ts +360 -0
- package/src/runtime/domain/subagents/list.domain.mjs +2 -0
- package/src/runtime/domain/subagents/list.mjs +152 -0
- package/src/runtime/domain/subagents/list.ts +19 -0
- package/src/runtime/domain/subagents/log-cursor.domain.mjs +217 -0
- package/src/runtime/domain/subagents/log-cursor.ts +268 -0
- package/src/runtime/domain/subagents/managed-background-capability.domain.mjs +10 -0
- package/src/runtime/domain/subagents/managed-background-capability.ts +9 -0
- package/src/runtime/domain/subagents/managed-failure-worker.mjs +36 -0
- package/src/runtime/domain/subagents/managed-launch-bootstrap.mjs +48 -0
- package/src/runtime/domain/subagents/managed-launch-client.domain.mjs +75 -0
- package/src/runtime/domain/subagents/managed-launch-client.ts +59 -0
- package/src/runtime/domain/subagents/managed-launch-host.domain.mjs +627 -0
- package/src/runtime/domain/subagents/managed-launch-host.ts +504 -0
- package/src/runtime/domain/subagents/managed-launch-journal.mjs +17 -0
- package/src/runtime/domain/subagents/managed-launch-ownership.domain.mjs +29 -0
- package/src/runtime/domain/subagents/managed-launch-ownership.ts +22 -0
- package/src/runtime/domain/subagents/managed-launch-port.domain.mjs +2 -0
- package/src/runtime/domain/subagents/managed-launch-port.ts +25 -0
- package/src/runtime/domain/subagents/managed-launch-recovery.domain.mjs +29 -0
- package/src/runtime/domain/subagents/managed-launch-recovery.ts +45 -0
- package/src/runtime/domain/subagents/managed-worker-bridge.domain.mjs +63 -0
- package/src/runtime/domain/subagents/managed-worker-bridge.ts +48 -0
- package/src/runtime/domain/subagents/managed-worker.mjs +13 -0
- package/src/runtime/domain/subagents/model-resolution-core.domain.mjs +822 -0
- package/src/runtime/domain/subagents/model-resolution-core.ts +1074 -0
- package/src/runtime/domain/subagents/model-resolution.domain.mjs +22 -0
- package/src/runtime/domain/subagents/model-resolution.ts +32 -0
- package/src/runtime/domain/subagents/navigator.domain.mjs +6 -0
- package/src/runtime/domain/subagents/navigator.mjs +1233 -0
- package/src/runtime/domain/subagents/navigator.ts +39 -0
- package/src/runtime/domain/subagents/operation-bridge-types.domain.mjs +1012 -0
- package/src/runtime/domain/subagents/operation-bridge-types.ts +1156 -0
- package/src/runtime/domain/subagents/outage-observations.domain.mjs +84 -0
- package/src/runtime/domain/subagents/outage-observations.ts +73 -0
- package/src/runtime/domain/subagents/output-payload.domain.mjs +767 -0
- package/src/runtime/domain/subagents/output-payload.ts +987 -0
- package/src/runtime/domain/subagents/owned-exit.domain.mjs +12 -0
- package/src/runtime/domain/subagents/owned-exit.ts +12 -0
- package/src/runtime/domain/subagents/package.json +86 -0
- package/src/runtime/domain/subagents/park-checkpoint.domain.mjs +55 -0
- package/src/runtime/domain/subagents/park-checkpoint.ts +61 -0
- package/src/runtime/domain/subagents/parse.domain.mjs +1218 -0
- package/src/runtime/domain/subagents/parse.ts +1451 -0
- package/src/runtime/domain/subagents/permission-policy.domain.mjs +232 -0
- package/src/runtime/domain/subagents/permission-policy.ts +291 -0
- package/src/runtime/domain/subagents/process-identity.mjs +33 -0
- package/src/runtime/domain/subagents/registry.domain.mjs +1584 -0
- package/src/runtime/domain/subagents/registry.ts +1904 -0
- package/src/runtime/domain/subagents/role-assignment.domain.mjs +104 -0
- package/src/runtime/domain/subagents/role-assignment.ts +141 -0
- package/src/runtime/domain/subagents/roles/role.architect.md +13 -0
- package/src/runtime/domain/subagents/roles/role.developer.md +16 -0
- package/src/runtime/domain/subagents/roles/role.explorer.md +13 -0
- package/src/runtime/domain/subagents/roles/role.product-manager.md +13 -0
- package/src/runtime/domain/subagents/roles/role.researcher.md +13 -0
- package/src/runtime/domain/subagents/roles/role.reviewer.md +13 -0
- package/src/runtime/domain/subagents/roles/role.writer.md +12 -0
- package/src/runtime/domain/subagents/sandbox.domain.mjs +64 -0
- package/src/runtime/domain/subagents/sandbox.ts +92 -0
- package/src/runtime/domain/subagents/session-selection.domain.mjs +32 -0
- package/src/runtime/domain/subagents/session-selection.ts +35 -0
- package/src/runtime/domain/subagents/session-store.domain.mjs +489 -0
- package/src/runtime/domain/subagents/session-store.ts +468 -0
- package/src/runtime/domain/subagents/settings-page.domain.mjs +313 -0
- package/src/runtime/domain/subagents/settings-page.ts +363 -0
- package/src/runtime/domain/subagents/shared-callback-batcher.domain.mjs +777 -0
- package/src/runtime/domain/subagents/shared-callback-batcher.ts +956 -0
- package/src/runtime/domain/subagents/shared-catalog.domain.mjs +70 -0
- package/src/runtime/domain/subagents/shared-catalog.ts +61 -0
- package/src/runtime/domain/subagents/shared-execution-policy.domain.mjs +50 -0
- package/src/runtime/domain/subagents/shared-execution-policy.ts +61 -0
- package/src/runtime/domain/subagents/shared-failure-observations.domain.mjs +1078 -0
- package/src/runtime/domain/subagents/shared-failure-observations.ts +1166 -0
- package/src/runtime/domain/subagents/shared-harness-settings.domain.mjs +126 -0
- package/src/runtime/domain/subagents/shared-harness-settings.ts +116 -0
- package/src/runtime/domain/subagents/shared-log-utils.domain.mjs +1223 -0
- package/src/runtime/domain/subagents/shared-log-utils.ts +1492 -0
- package/src/runtime/domain/subagents/shared-navigator-panels.domain.mjs +289 -0
- package/src/runtime/domain/subagents/shared-navigator-panels.ts +272 -0
- package/src/runtime/domain/subagents/shared-navigator.domain.mjs +1930 -0
- package/src/runtime/domain/subagents/shared-navigator.ts +1962 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/assignment-inbox.mjs +144 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/assignment-observation.mjs +189 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/index.domain.mjs +51 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/index.ts +122 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/assignment-changes.domain.mjs +75 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/assignment-changes.ts +73 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/assignment-outcomes.domain.mjs +163 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/assignment-outcomes.ts +174 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/background-parent-callbacks.domain.mjs +66 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/background-parent-callbacks.ts +68 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/background-requests.domain.mjs +87 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/background-requests.ts +90 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/discovery.domain.mjs +97 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/discovery.ts +139 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/errors.domain.mjs +12 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/errors.ts +79 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/operations.domain.mjs +342 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/operations.ts +513 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/outbox.domain.mjs +283 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/outbox.ts +458 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/recovery.domain.mjs +52 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/recovery.ts +55 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/result-supervision.domain.mjs +114 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/result-supervision.ts +140 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/rows.domain.mjs +280 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/rows.ts +442 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/schema.domain.mjs +420 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/schema.ts +441 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/sqlite.domain.mjs +194 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/sqlite.ts +239 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/store.domain.mjs +275 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/store.ts +585 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/subagent-launch.domain.mjs +120 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/subagent-launch.ts +142 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/task-cancellation.domain.mjs +188 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/task-cancellation.ts +224 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/types.domain.mjs +25 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/types.ts +707 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/upgrade.domain.mjs +22 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/upgrade.ts +22 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/validate.domain.mjs +234 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/validate.ts +241 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/waits.domain.mjs +851 -0
- package/src/runtime/domain/subagents/shared-operation-coordinator/src/waits.ts +1424 -0
- package/src/runtime/domain/subagents/shared-permission-blocker.domain.mjs +40 -0
- package/src/runtime/domain/subagents/shared-permission-blocker.ts +48 -0
- package/src/runtime/domain/subagents/shared-render-scheduler.domain.mjs +41 -0
- package/src/runtime/domain/subagents/shared-render-scheduler.ts +47 -0
- package/src/runtime/domain/subagents/shared-sandbox-core.domain.mjs +1531 -0
- package/src/runtime/domain/subagents/shared-sandbox-core.ts +1757 -0
- package/src/runtime/domain/subagents/shared-sandbox-diagnostics.domain.mjs +591 -0
- package/src/runtime/domain/subagents/shared-sandbox-diagnostics.ts +491 -0
- package/src/runtime/domain/subagents/shared-stall-detector.domain.mjs +37 -0
- package/src/runtime/domain/subagents/shared-stall-detector.ts +69 -0
- package/src/runtime/domain/subagents/shared-task-application.domain.mjs +185 -0
- package/src/runtime/domain/subagents/shared-task-application.ts +185 -0
- package/src/runtime/domain/subagents/shared-task-apply-patch.domain.mjs +416 -0
- package/src/runtime/domain/subagents/shared-task-apply-patch.ts +409 -0
- package/src/runtime/domain/subagents/shared-task-exec.domain.mjs +325 -0
- package/src/runtime/domain/subagents/shared-task-exec.ts +335 -0
- package/src/runtime/domain/subagents/shared-task-files.domain.mjs +346 -0
- package/src/runtime/domain/subagents/shared-task-files.ts +342 -0
- package/src/runtime/domain/subagents/shared-task-process-identity.domain.mjs +140 -0
- package/src/runtime/domain/subagents/shared-task-process-identity.ts +126 -0
- package/src/runtime/domain/subagents/shared-task-process-list.domain.mjs +220 -0
- package/src/runtime/domain/subagents/shared-task-process-list.ts +209 -0
- package/src/runtime/domain/subagents/shared-task-sandbox.domain.mjs +227 -0
- package/src/runtime/domain/subagents/shared-task-sandbox.ts +224 -0
- package/src/runtime/domain/subagents/shared-task-tools.domain.mjs +92 -0
- package/src/runtime/domain/subagents/shared-task-tools.ts +123 -0
- package/src/runtime/domain/subagents/shared-work-client.mjs +303 -0
- package/src/runtime/domain/subagents/shared-worktree-context.domain.mjs +142 -0
- package/src/runtime/domain/subagents/shared-worktree-context.ts +158 -0
- package/src/runtime/domain/subagents/skill-picker.domain.mjs +316 -0
- package/src/runtime/domain/subagents/skill-picker.ts +353 -0
- package/src/runtime/domain/subagents/skills.domain.mjs +138 -0
- package/src/runtime/domain/subagents/skills.ts +183 -0
- package/src/runtime/domain/subagents/spawn.domain.mjs +72 -0
- package/src/runtime/domain/subagents/spawn.ts +80 -0
- package/src/runtime/domain/subagents/stop.domain.mjs +184 -0
- package/src/runtime/domain/subagents/stop.ts +217 -0
- package/src/runtime/domain/subagents/subagent-tools.domain.mjs +101 -0
- package/src/runtime/domain/subagents/subagent-tools.ts +137 -0
- package/src/runtime/domain/subagents/task-guard.domain.mjs +163 -0
- package/src/runtime/domain/subagents/task-guard.ts +144 -0
- package/src/runtime/domain/subagents/task-policy.domain.mjs +201 -0
- package/src/runtime/domain/subagents/task-policy.ts +236 -0
- package/src/runtime/domain/subagents/task-runtime.mjs +53 -0
- package/src/runtime/domain/subagents/task-tool-owner.domain.mjs +18 -0
- package/src/runtime/domain/subagents/task-tool-owner.ts +21 -0
- package/src/runtime/domain/subagents/thinking.domain.mjs +22 -0
- package/src/runtime/domain/subagents/thinking.ts +28 -0
- package/src/runtime/domain/subagents/tier-policy.domain.mjs +75 -0
- package/src/runtime/domain/subagents/tier-policy.ts +126 -0
- package/src/runtime/domain/subagents/timing-notifications.domain.mjs +51 -0
- package/src/runtime/domain/subagents/timing-notifications.ts +37 -0
- package/src/runtime/domain/subagents/timing.domain.mjs +487 -0
- package/src/runtime/domain/subagents/timing.ts +634 -0
- package/src/runtime/domain/subagents/tools.domain.mjs +558 -0
- package/src/runtime/domain/subagents/tools.ts +629 -0
- package/src/runtime/domain/subagents/widget.domain.mjs +6 -0
- package/src/runtime/domain/subagents/widget.mjs +246 -0
- package/src/runtime/domain/subagents/widget.ts +30 -0
- package/src/runtime/domain/subagents/work-observation.domain.mjs +316 -0
- package/src/runtime/domain/subagents/work-observation.ts +248 -0
- package/src/runtime/domain/subagents/worker-catalog.domain.mjs +120 -0
- package/src/runtime/domain/subagents/worker-catalog.ts +162 -0
- package/src/runtime/domain/subagents/worker-operations-host.domain.mjs +1009 -0
- package/src/runtime/domain/subagents/worker-operations-host.ts +1238 -0
- package/src/runtime/domain/subagents/worker-waits.domain.mjs +2336 -0
- package/src/runtime/domain/subagents/worker-waits.ts +2878 -0
- package/src/runtime/domain/subagents/workspace-scope.domain.mjs +52 -0
- package/src/runtime/domain/subagents/workspace-scope.ts +50 -0
- package/src/runtime/health-config.ts +27 -11
- package/src/runtime/log-checkpoints.ts +117 -0
- package/src/runtime/mutation-store.ts +5 -4
- package/src/runtime/queries.ts +27 -3
- package/src/runtime/query-executor.ts +178 -34
- package/src/runtime/query-worker.mjs +119 -22
- package/src/runtime/read-model.ts +939 -113
- package/src/runtime/read-watchdog-probe.ts +4 -0
- package/src/runtime/result-supervision.ts +188 -16
- package/src/runtime/source-watch.ts +175 -0
- package/src/runtime/subagent-launch.ts +73 -0
- package/src/runtime/work-budget.ts +130 -0
- package/src/runtime/work-client.d.mts +8 -0
- package/src/runtime/work-client.mjs +150 -7
- package/src/server.ts +185 -22
- package/src/session-activity.ts +26 -4
- package/src/version.ts +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import { sourceProvenance } from './source-provenance.mjs';
|
|
3
|
+
import { measureEventPublication } from './event-publication/measure.mjs';
|
|
2
4
|
import { fork } from 'node:child_process';
|
|
3
5
|
import { once } from 'node:events';
|
|
4
6
|
import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
|
|
5
7
|
import { dirname, join, resolve } from 'node:path';
|
|
6
|
-
import { tmpdir } from 'node:os';
|
|
8
|
+
import { tmpdir, cpus, release, totalmem } from 'node:os';
|
|
7
9
|
import { fileURLToPath } from 'node:url';
|
|
8
10
|
import { performance } from 'node:perf_hooks';
|
|
9
11
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
@@ -30,6 +32,14 @@ async function sample(child) {
|
|
|
30
32
|
child.send({ type: 'resource-sample', id });
|
|
31
33
|
return result;
|
|
32
34
|
}
|
|
35
|
+
async function refreshProvider(child) {
|
|
36
|
+
const id = ++requestId;
|
|
37
|
+
const result = waitMessage(child, message => message.type === 'provider-refreshed' && message.id === id);
|
|
38
|
+
child.send({ type: 'provider-refresh', id });
|
|
39
|
+
const response = await result;
|
|
40
|
+
assert.equal(response.error, undefined, response.error);
|
|
41
|
+
return response.rows;
|
|
42
|
+
}
|
|
33
43
|
function track(child) { children.add(child); child.once('exit', () => children.delete(child)); return child; }
|
|
34
44
|
async function stop(child, graceful = false) {
|
|
35
45
|
if (child.exitCode !== null || child.signalCode !== null) return;
|
|
@@ -43,7 +53,7 @@ function distribution(values) {
|
|
|
43
53
|
const percentile = p => sorted[Math.min(sorted.length - 1, Math.floor(sorted.length * p))];
|
|
44
54
|
return { samples: sorted.length, p50: percentile(.5), p95: percentile(.95), p99: percentile(.99), max: sorted.at(-1) };
|
|
45
55
|
}
|
|
46
|
-
const report = { platform: process.platform, arch: process.arch, node: process.version,
|
|
56
|
+
const report = { source: sourceProvenance(workspace), machine: { cpu: cpus()[0]?.model, logicalCpus: cpus().length, memoryBytes: totalmem(), osRelease: release() }, platform: process.platform, arch: process.arch, node: process.version,
|
|
47
57
|
sdk: sdkVersion, scope: 'Real Pi RPC processes with standalone Subagents, control RPC at 10 Hz, seeded read-only work records; no guardian in slice #753.', scenarios: [] };
|
|
48
58
|
const output = process.env.PI_SHARED_READ_REPORT ?? join(tmpdir(), 'pi-shared-read-resources.json');
|
|
49
59
|
const phase = (step, history, clients = 0) => { report.phase = { step, history, clients }; };
|
|
@@ -53,6 +63,9 @@ try {
|
|
|
53
63
|
const root = realpathSync(mkdtempSync('/tmp/p751-res-'));
|
|
54
64
|
const agent = join(root, 'agent'), transport = join(root, 's'), runs = join(root, 'pi-better-subagents/runs');
|
|
55
65
|
const durable = join(agent, 'subagents'), archives = join(durable, 'attempts');
|
|
66
|
+
const sessionId = 'b005eb3d-66af-4b8b-88b7-0dd4971de123';
|
|
67
|
+
const sessionPath = join(root, 'shared-observer.jsonl');
|
|
68
|
+
writeFileSync(sessionPath, JSON.stringify({ type: 'session', version: 3, id: sessionId, timestamp: new Date().toISOString(), cwd: root }) + '\n');
|
|
56
69
|
mkdirSync(runs, { recursive: true }); mkdirSync(archives, { recursive: true });
|
|
57
70
|
for (let i = 0; i < history; i++) {
|
|
58
71
|
const id = `sa_resource_history_${i}`;
|
|
@@ -62,12 +75,12 @@ try {
|
|
|
62
75
|
}
|
|
63
76
|
const env = { ...process.env, PI_CODING_AGENT_DIR: agent,
|
|
64
77
|
PI_SERVER_DIR: transport, PI_SUBAGENT_DURABLE_DIR: durable, TMPDIR: root, TMP: root, TEMP: root,
|
|
65
|
-
PI_OFFLINE: '1', PI_SANDBOX_RECOVERY_SNAPSHOT: 'off' };
|
|
78
|
+
PI_OFFLINE: '1', PI_CATALOG_ACCEPTANCE_PROBE: '1', PI_SANDBOX_RECOVERY_SNAPSHOT: 'off' };
|
|
66
79
|
const work = track(fork(new URL('./measure-shared-reads/probe.mjs', import.meta.url), [], { env, execArgv: [], stdio: ['ignore','ignore','inherit','ipc'] }));
|
|
67
80
|
for (let i = 0; i < 2; i++) {
|
|
68
81
|
const id = `sa_resource_active_${i}`; mkdirSync(join(runs, id));
|
|
69
82
|
writeFileSync(join(runs, id, 'meta.json'), JSON.stringify({ id, cwd: root, status: 'running',
|
|
70
|
-
pid: work.pid, spawnPid: process.pid, startedAt: Date.now(), sessionId: id, callback: false, name: `resource-work-${i}` }));
|
|
83
|
+
pid: work.pid, spawnPid: process.pid, startedAt: Date.now(), sessionId: id, callback: false, callbackOrigin: { cwd: root, sessionId }, name: `resource-work-${i}` }));
|
|
71
84
|
}
|
|
72
85
|
const server = track(fork(new URL('./measure-shared-reads/daemon.mjs', import.meta.url), [], { env, execArgv: [], stdio: ['ignore','ignore','inherit','ipc'] }));
|
|
73
86
|
phase('start-server', history);
|
|
@@ -93,7 +106,7 @@ try {
|
|
|
93
106
|
for (const count of [1, 5, 10]) {
|
|
94
107
|
phase('start-pi-clients', history, count);
|
|
95
108
|
while (pis.length < count) {
|
|
96
|
-
const pi = track(fork(sdkCli, ['--mode','rpc','--offline','--
|
|
109
|
+
const pi = track(fork(sdkCli, ['--mode','rpc','--offline','--session',sessionPath,'--no-extensions',
|
|
97
110
|
'--extension',join(workspace,'packages/pi-better-subagents/index.ts'),
|
|
98
111
|
'--no-skills','--no-prompt-templates','--no-themes'], {
|
|
99
112
|
cwd: root, env, execArgv: ['--import', new URL('./measure-shared-reads/probe.mjs', import.meta.url).href], stdio: ['pipe','pipe','pipe','ipc'] }));
|
|
@@ -114,6 +127,14 @@ try {
|
|
|
114
127
|
}
|
|
115
128
|
phase('warmup', history, count);
|
|
116
129
|
await delay(1200);
|
|
130
|
+
const providerDeadline = performance.now() + 15000;
|
|
131
|
+
let providerRows;
|
|
132
|
+
do {
|
|
133
|
+
providerRows = await Promise.all(pis.map(refreshProvider));
|
|
134
|
+
if (providerRows.every(rows => rows >= 2)) break;
|
|
135
|
+
assert.ok(performance.now() < providerDeadline, `Actual provider did not observe active work: ${providerRows}`);
|
|
136
|
+
await delay(100);
|
|
137
|
+
} while (true);
|
|
117
138
|
await control.get({ cwd: root, active: true });
|
|
118
139
|
const before = await control.request('runtime_get_metrics');
|
|
119
140
|
report.lastMetrics = before;
|
|
@@ -123,11 +144,15 @@ try {
|
|
|
123
144
|
const began = performance.now(), latencies = [];
|
|
124
145
|
const windowMs = count === 10 && history === 10000 ? 60000 : 3000;
|
|
125
146
|
while (performance.now() - began < windowMs) {
|
|
126
|
-
const sent = performance.now(); await Promise.all(pis.map(pi => pi.rpc())); latencies.push(performance.now() - sent);
|
|
147
|
+
const sent = performance.now(); await Promise.all(pis.map(async pi => { await pi.rpc(); assert.ok(await refreshProvider(pi) >= 2); })); latencies.push(performance.now() - sent);
|
|
127
148
|
await delay(100);
|
|
128
149
|
}
|
|
129
150
|
const elapsedMs = performance.now() - began;
|
|
130
151
|
const end = await Promise.all(subjects.map(sample));
|
|
152
|
+
for (let i = 0; i < pis.length; i++) {
|
|
153
|
+
assert.equal(end[i].fileCalls.archiveReads, start[i].fileCalls.archiveReads, 'unchanged actual provider must not reread archives');
|
|
154
|
+
assert.equal(end[i].fileCalls.markerStats, start[i].fileCalls.markerStats, 'unchanged actual provider must not stat per-archive markers');
|
|
155
|
+
}
|
|
131
156
|
phase('post-window-snapshot', history, count);
|
|
132
157
|
await control.get({ cwd: root, active: true });
|
|
133
158
|
const after = await control.request('runtime_get_metrics');
|
|
@@ -139,16 +164,26 @@ try {
|
|
|
139
164
|
assert.ok(after.sqlite.active <= 2, 'read worker must retain the root database budget');
|
|
140
165
|
assert.equal((await control.request('runtime_get_status')).hostedSessions, 0,
|
|
141
166
|
'ordinary local Pi clients must not create hosted sessions');
|
|
142
|
-
const resources = end.map((value, i) => ({ pid: value.pid, role: i < pis.length ? 'pi' : i === pis.length ? 'server' : 'work',
|
|
167
|
+
const resources = end.map((value, i) => ({ pid: value.pid, identity: value.identity, role: i < pis.length ? 'pi' : i === pis.length ? 'server' : 'work',
|
|
168
|
+
archiveReadDelta: value.fileCalls.archiveReads - start[i].fileCalls.archiveReads, markerStatDelta: value.fileCalls.markerStats - start[i].fileCalls.markerStats,
|
|
143
169
|
cpuMs: ((value.cpu.user - start[i].cpu.user) + (value.cpu.system - start[i].cpu.system))/1000,
|
|
144
170
|
rss: value.rss, fsRead: value.usage.fsRead - start[i].usage.fsRead, fsWrite: value.usage.fsWrite - start[i].usage.fsWrite,
|
|
145
171
|
lagMs: value.lag }));
|
|
146
|
-
const entry = { history, clients: count, elapsedMs, resources,
|
|
172
|
+
const entry = { history, clients: count, elapsedMs, resources, actualProviderRefresh: true, providerRows,
|
|
173
|
+
totalFsRead: resources.reduce((sum,r) => sum+r.fsRead, 0), totalFsWrite: resources.reduce((sum,r) => sum+r.fsWrite, 0),
|
|
147
174
|
totalCpuMs: resources.reduce((sum,r) => sum+r.cpuMs, 0), totalRss: resources.reduce((sum,r) => sum+r.rss, 0),
|
|
148
175
|
rpcMs: distribution(latencies), inventoryDelta: after.inventories-before.inventories,
|
|
149
176
|
metadataReadDelta: after.metadataReads-before.metadataReads, projectionDelta: after.projections-before.projections,
|
|
150
177
|
sqlite: after.sqlite, rebuild: { ms: rebuildMs, controlRpcMs: distribution(rebuildLatencies) } };
|
|
151
|
-
report.scenarios.push(entry);
|
|
178
|
+
report.scenarios.push(entry);
|
|
179
|
+
phase('event-publication', history, count);
|
|
180
|
+
entry.eventPublication = await measureEventPublication({ socketPath: ready.socket, agentDir: agent,
|
|
181
|
+
scope: { cwd: root, sessionId, active: true }, metaPath: join(runs, 'sa_resource_active_0', 'meta.json'),
|
|
182
|
+
taskId: 'sa_resource_active_0', subscribers: count, phase: { history, clients: count },
|
|
183
|
+
diagnostics: () => control.request('runtime_get_metrics') });
|
|
184
|
+
assert.ok(entry.eventPublication.ms.max <= 1000, `Committed changes must reach healthy subscribers within 1s: ${JSON.stringify(entry.eventPublication.ms)}`);
|
|
185
|
+
assert.ok(entry.eventPublication.ms.p50 >= 0, 'Event visibility must follow the source commit');
|
|
186
|
+
console.log(JSON.stringify(entry));
|
|
152
187
|
}
|
|
153
188
|
await Promise.all(pis.map(pi => stop(pi))); control.close(); await stop(server, true); await stop(work);
|
|
154
189
|
rmSync(root, { recursive: true, force: true });
|
|
@@ -10,7 +10,16 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/pi-ai": "1.4.0",
|
|
12
12
|
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
13
|
-
"@earendil-works/pi-tui": "1.4.0"
|
|
13
|
+
"@earendil-works/pi-tui": "1.4.0",
|
|
14
|
+
"fsevents": "2.3.3",
|
|
15
|
+
"proper-lockfile": "4.1.2",
|
|
16
|
+
"shell-quote": "1.12.0",
|
|
17
|
+
"smol-toml": "1.9.0",
|
|
18
|
+
"typebox": "1.3.27",
|
|
19
|
+
"yaml": "2.9.1"
|
|
20
|
+
},
|
|
21
|
+
"optionalDependencies": {
|
|
22
|
+
"fsevents": "2.3.3"
|
|
14
23
|
}
|
|
15
24
|
},
|
|
16
25
|
"node_modules/@anthropic-ai/sdk": {
|
|
@@ -497,6 +506,21 @@
|
|
|
497
506
|
"node": ">=22.19.0"
|
|
498
507
|
}
|
|
499
508
|
},
|
|
509
|
+
"node_modules/@earendil-works/pi-coding-agent/node_modules/yaml": {
|
|
510
|
+
"version": "2.9.0",
|
|
511
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
|
|
512
|
+
"integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
|
|
513
|
+
"license": "ISC",
|
|
514
|
+
"bin": {
|
|
515
|
+
"yaml": "bin.mjs"
|
|
516
|
+
},
|
|
517
|
+
"engines": {
|
|
518
|
+
"node": ">= 14.6"
|
|
519
|
+
},
|
|
520
|
+
"funding": {
|
|
521
|
+
"url": "https://github.com/sponsors/eemeli"
|
|
522
|
+
}
|
|
523
|
+
},
|
|
500
524
|
"node_modules/@earendil-works/pi-mcp": {
|
|
501
525
|
"version": "1.4.0",
|
|
502
526
|
"resolved": "https://registry.npmjs.org/@earendil-works/pi-mcp/-/pi-mcp-1.4.0.tgz",
|
|
@@ -909,6 +933,20 @@
|
|
|
909
933
|
"node": ">=12.20.0"
|
|
910
934
|
}
|
|
911
935
|
},
|
|
936
|
+
"node_modules/fsevents": {
|
|
937
|
+
"version": "2.3.3",
|
|
938
|
+
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
|
939
|
+
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
|
940
|
+
"hasInstallScript": true,
|
|
941
|
+
"license": "MIT",
|
|
942
|
+
"optional": true,
|
|
943
|
+
"os": [
|
|
944
|
+
"darwin"
|
|
945
|
+
],
|
|
946
|
+
"engines": {
|
|
947
|
+
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
|
948
|
+
}
|
|
949
|
+
},
|
|
912
950
|
"node_modules/gaxios": {
|
|
913
951
|
"version": "7.3.1",
|
|
914
952
|
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.3.1.tgz",
|
|
@@ -1419,12 +1457,36 @@
|
|
|
1419
1457
|
"node": ">=8"
|
|
1420
1458
|
}
|
|
1421
1459
|
},
|
|
1460
|
+
"node_modules/shell-quote": {
|
|
1461
|
+
"version": "1.12.0",
|
|
1462
|
+
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.12.0.tgz",
|
|
1463
|
+
"integrity": "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==",
|
|
1464
|
+
"license": "MIT",
|
|
1465
|
+
"engines": {
|
|
1466
|
+
"node": ">= 0.4"
|
|
1467
|
+
},
|
|
1468
|
+
"funding": {
|
|
1469
|
+
"url": "https://github.com/sponsors/ljharb"
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1422
1472
|
"node_modules/signal-exit": {
|
|
1423
1473
|
"version": "3.0.7",
|
|
1424
1474
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
|
1425
1475
|
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
|
|
1426
1476
|
"license": "ISC"
|
|
1427
1477
|
},
|
|
1478
|
+
"node_modules/smol-toml": {
|
|
1479
|
+
"version": "1.9.0",
|
|
1480
|
+
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.0.tgz",
|
|
1481
|
+
"integrity": "sha512-hpd+HLON7HdZXqYchMM/+LaTTbdK0AU3NngIJ4KVyWbY9bfQqdL9cD+4yf6dUoU2Ap4VsU0JkQi6FxAI1B2mXQ==",
|
|
1482
|
+
"license": "BSD-3-Clause",
|
|
1483
|
+
"engines": {
|
|
1484
|
+
"node": ">= 18"
|
|
1485
|
+
},
|
|
1486
|
+
"funding": {
|
|
1487
|
+
"url": "https://github.com/sponsors/cyyynthia"
|
|
1488
|
+
}
|
|
1489
|
+
},
|
|
1428
1490
|
"node_modules/standardwebhooks": {
|
|
1429
1491
|
"version": "1.1.1",
|
|
1430
1492
|
"resolved": "https://registry.npmjs.org/standardwebhooks/-/standardwebhooks-1.1.1.tgz",
|
|
@@ -1514,9 +1576,9 @@
|
|
|
1514
1576
|
}
|
|
1515
1577
|
},
|
|
1516
1578
|
"node_modules/yaml": {
|
|
1517
|
-
"version": "2.9.
|
|
1518
|
-
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.
|
|
1519
|
-
"integrity": "sha512-
|
|
1579
|
+
"version": "2.9.1",
|
|
1580
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz",
|
|
1581
|
+
"integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==",
|
|
1520
1582
|
"license": "ISC",
|
|
1521
1583
|
"bin": {
|
|
1522
1584
|
"yaml": "bin.mjs"
|
|
@@ -4,14 +4,22 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
8
7
|
"@earendil-works/pi-ai": "1.4.0",
|
|
9
|
-
"@earendil-works/pi-
|
|
8
|
+
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
9
|
+
"@earendil-works/pi-tui": "1.4.0",
|
|
10
|
+
"proper-lockfile": "4.1.2",
|
|
11
|
+
"shell-quote": "1.12.0",
|
|
12
|
+
"smol-toml": "1.9.0",
|
|
13
|
+
"typebox": "1.3.27",
|
|
14
|
+
"yaml": "2.9.1"
|
|
10
15
|
},
|
|
11
16
|
"overrides": {
|
|
12
17
|
"@earendil-works/pi-agent-core": "1.4.0",
|
|
13
18
|
"@earendil-works/pi-mcp": "1.4.0",
|
|
14
19
|
"@earendil-works/pi-codemode": "1.4.0",
|
|
15
20
|
"@earendil-works/pi-telemetry": "1.4.0"
|
|
21
|
+
},
|
|
22
|
+
"optionalDependencies": {
|
|
23
|
+
"fsevents": "2.3.3"
|
|
16
24
|
}
|
|
17
25
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
|
|
6
|
+
/** Content identity remains available in compatibility copies without Git metadata. */
|
|
7
|
+
export function sourceProvenance(workspace) {
|
|
8
|
+
let head = null, dirty = null;
|
|
9
|
+
// A parent repository must not accidentally identify an unpacked source tree.
|
|
10
|
+
if (existsSync(join(workspace, '.git'))) {
|
|
11
|
+
try {
|
|
12
|
+
head = execFileSync('git', ['rev-parse', 'HEAD'], { cwd: workspace, encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
13
|
+
dirty = execFileSync('git', ['status', '--porcelain'], { cwd: workspace, encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
14
|
+
} catch { head = null; dirty = null; }
|
|
15
|
+
}
|
|
16
|
+
const files = [];
|
|
17
|
+
const walk = relative => {
|
|
18
|
+
for (const entry of readdirSync(join(workspace, relative), { withFileTypes: true })) {
|
|
19
|
+
if (['node_modules', '.git', '.work', 'dist', 'coverage'].includes(entry.name)) continue;
|
|
20
|
+
const path = `${relative}/${entry.name}`;
|
|
21
|
+
if (entry.isDirectory()) walk(path);
|
|
22
|
+
else if (entry.isFile()) files.push(path);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
for (const directory of ['packages', 'scripts']) if (existsSync(join(workspace, directory))) walk(directory);
|
|
26
|
+
for (const file of ['package.json', 'package-lock.json']) if (existsSync(join(workspace, file))) files.push(file);
|
|
27
|
+
const manifest = files.sort().map(path => ({ path, sha256: createHash('sha256').update(readFileSync(join(workspace, path))).digest('hex') }));
|
|
28
|
+
return { head, dirty, kind: head ? 'git-checkout' : 'source-copy-without-git',
|
|
29
|
+
manifest: { algorithm: 'sha256', scope: 'packages and scripts excluding .git/.work/node_modules/dist/coverage, plus root package manifests',
|
|
30
|
+
files: manifest.length, sha256: createHash('sha256').update(JSON.stringify(manifest)).digest('hex') } };
|
|
31
|
+
}
|
package/scripts/test-on-pi.sh
CHANGED
|
@@ -26,20 +26,14 @@ cp "$ROOT_DIR/scripts/isolate-registry.mjs" "$PREFIX/scripts/"
|
|
|
26
26
|
cp -R "$PKG_DIR/src" "$PKG_DIR/test" "$PKG_DIR/scripts" "$PKG_DIR/package.json" "$PKG_DIR/tsconfig.json" "$PREFIX/packages/pi-better-server/"
|
|
27
27
|
[ -d "$PKG_DIR/codex-plugin" ] && cp -R "$PKG_DIR/codex-plugin" "$PREFIX/packages/pi-better-server/"
|
|
28
28
|
# Activity and permission regressions load the real sibling providers against this SDK.
|
|
29
|
-
node
|
|
30
|
-
import { cpSync } from "node:fs";
|
|
31
|
-
import { basename, join } from "node:path";
|
|
32
|
-
for (const name of ["pi-better-subagents", "pi-better-background-tasks", "pi-better-sandbox", "operation-coordinator"]) {
|
|
33
|
-
cpSync(join(process.argv[2], "packages", name), join(process.argv[3], "packages", name), {
|
|
34
|
-
recursive: true, filter: path => !["node_modules", ".work", ".pi-compat"].includes(basename(path)),
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
NODE
|
|
29
|
+
node "$PKG_DIR/scripts/copy-pi-test-providers.mjs" "$ROOT_DIR" "$PREFIX"
|
|
38
30
|
# Install the consumer's declared runtime closure, not just the host's transitives.
|
|
39
31
|
# Its host-provided peers must keep resolving to the requested Pi above.
|
|
32
|
+
(cd "$PREFIX/packages/pi-better-server" && npm install --omit=dev --ignore-scripts --legacy-peer-deps --package-lock=false --no-audit --no-fund)
|
|
40
33
|
(cd "$PREFIX/packages/pi-better-subagents" && npm install --omit=dev --ignore-scripts --legacy-peer-deps --package-lock=false --no-audit --no-fund)
|
|
41
34
|
(cd "$PREFIX/packages/pi-better-background-tasks" && npm install --omit=dev --ignore-scripts --legacy-peer-deps --package-lock=false --no-audit --no-fund)
|
|
42
35
|
(cd "$PREFIX/packages/pi-better-sandbox" && npm install --omit=dev --ignore-scripts --legacy-peer-deps --package-lock=false --no-audit --no-fund)
|
|
36
|
+
(cd "$PREFIX/packages/pi-better-goal" && npm install --omit=dev --ignore-scripts --legacy-peer-deps --package-lock=false --no-audit --no-fund)
|
|
43
37
|
|
|
44
38
|
cd "$PREFIX/packages/pi-better-server"
|
|
45
39
|
installed="$(node -p "require('$PREFIX/node_modules/@earendil-works/pi-coding-agent/package.json').version")"
|
package/src/handshake.ts
CHANGED
|
@@ -12,7 +12,7 @@ export function serverHello(identity: HelloIdentity = {}): HelloData {
|
|
|
12
12
|
return { protocolVersion: PROTOCOL_VERSION, piVersion: PI_VERSION, extensionVersions: { ...SERVER_EXTENSION_VERSIONS },
|
|
13
13
|
...(identity.agentDir ? { agentDir: identity.agentDir, nodeVersion: process.versions.node } : {}),
|
|
14
14
|
...(build ? { build } : {}), ...(identity.instanceId ? { instanceId: identity.instanceId } : {}),
|
|
15
|
-
capabilities: [...(identity.runtimeLifecycle ? ["runtime-client-retention-v1"] : []),...(identity.agentDir ? ["runtime-status-v1", "runtime-state-v1", "runtime-subscriptions-v1", "runtime-background-state-v1", "runtime-cancellation-v1", "runtime-result-supervision-v1", "runtime-catalog-v1"] : []), "native-client-v1", "package-sync-v1", "global-package-sync-v1", "session-browser-v1", "folder-browser-v1", "session-transfer-v1", "compressed-bundle-v1", "remote-reload-v1",
|
|
15
|
+
capabilities: [...(identity.runtimeLifecycle ? ["runtime-client-retention-v1"] : []),...(identity.agentDir ? ["runtime-status-v1", "runtime-state-v1", "runtime-subscriptions-v1", "runtime-background-state-v1", "runtime-background-execution-v1", "runtime-background-admission-v2", "runtime-cancellation-v1", "runtime-result-supervision-v1", "runtime-catalog-v1", "runtime-subagent-launch-v1"] : []), "native-client-v1", "package-sync-v1", "global-package-sync-v1", "session-browser-v1", "folder-browser-v1", "session-transfer-v1", "compressed-bundle-v1", "remote-reload-v1",
|
|
16
16
|
...(identity.safeUpgrade && build && identity.instanceId ? ["safe-upgrade-v1"] : [])] };
|
|
17
17
|
}
|
|
18
18
|
|
package/src/hosted-session.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { AgentSession, AgentSessionEvent, RpcCommand, RpcResponse, RpcSessi
|
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import type { EventLog, LoggedEvent, Replay } from "./event-log.ts";
|
|
5
5
|
import { UNSUPPORTED_SESSION_COMMANDS } from "./protocol.ts";
|
|
6
|
-
import { assertHostedAdmission, fenceHostedSession, reloadHostedSession } from "./maintenance.ts";
|
|
6
|
+
import { assertHostedAdmission, fenceHostedSession, reloadHostedSession, hostedCacheReasons } from "./maintenance.ts";
|
|
7
7
|
import type { SessionActivity } from "./session-activity.ts";
|
|
8
8
|
import { UiBridge, type PendingDialog } from "./ui-bridge.ts";
|
|
9
9
|
|
|
10
10
|
type Listener = (logged: LoggedEvent) => void;
|
|
11
|
-
type CommandWork = { kind: string; dialogs: number };
|
|
11
|
+
type CommandWork = { kind: string; dialogs: number; id: number; startedAt: number };
|
|
12
12
|
|
|
13
13
|
function ok(id: string | undefined, command: string, data?: unknown): RpcResponse {
|
|
14
14
|
return { ...(id !== undefined ? { id } : {}), type: "response", command, success: true, ...(data !== undefined ? { data } : {}) } as RpcResponse;
|
|
@@ -60,6 +60,29 @@ export class HostedSession {
|
|
|
60
60
|
private runtimeReleased = false;
|
|
61
61
|
private operations = 0;
|
|
62
62
|
private readonly commandsInFlight = new Set<CommandWork>();
|
|
63
|
+
private operationCounter = 0;
|
|
64
|
+
private progressAt = Date.now();
|
|
65
|
+
private operationRecords = new Map<number, { source: string; lastProgressAt: number }>();
|
|
66
|
+
lifecycleReasons() {
|
|
67
|
+
const dialogs = [...this.dialogWork.values()];
|
|
68
|
+
const modelBlocked = dialogs.some(work => work.toolCallId || !work.command || ['prompt','steer','follow_up'].includes(work.command.kind));
|
|
69
|
+
const compactBlocked = dialogs.some(work => !work.toolCallId && (!work.command || work.command.kind === 'compact'));
|
|
70
|
+
const bashBlocked = dialogs.some(work => !work.toolCallId && (!work.command || work.command.kind === 'bash'));
|
|
71
|
+
const blockedTools = new Set(dialogs.map(work => work.toolCallId));
|
|
72
|
+
const base = { owner: this.session.sessionId, generation: this.generation, lastProgressAt: this.progressAt,
|
|
73
|
+
executionDeadline: null, nextDeadline: null, recovery: 'existing-hosted-idle-and-admission-policy' };
|
|
74
|
+
return [
|
|
75
|
+
...[...this.operationRecords].map(([id, record]) => ({ ...base, kind: 'hosted-operation', id, ...record, retainsExecution: false })),
|
|
76
|
+
...[...this.commandsInFlight].map(work => ({ ...base, kind: 'hosted-command', id: work.id, source: work.kind, lastProgressAt: work.startedAt, retainsExecution: work.dialogs === 0 })),
|
|
77
|
+
...[...this.activeTools.keys()].map(id => ({ ...base, kind: 'hosted-tool', id, retainsExecution: !blockedTools.has(id) })),
|
|
78
|
+
...[...this.dialogWork.keys()].map(id => ({ ...base, kind: 'hosted-dialog', id, retainsExecution: false })),
|
|
79
|
+
...(this.turnActive ? [{ ...base, kind: 'hosted-turn', id: this.generation, retainsExecution: !modelBlocked }] : []),
|
|
80
|
+
...(this.session.isCompacting ? [{ ...base, kind: 'hosted-compaction', id: this.generation, retainsExecution: !compactBlocked }] : []),
|
|
81
|
+
...(this.session.isBashRunning ? [{ ...base, kind: 'hosted-bash', id: this.generation, retainsExecution: !bashBlocked }] : []),
|
|
82
|
+
...(this.activity?.lifecycleReasons() ?? []).map(record => ({ ...base, ...record, retainsExecution: record.kind !== 'hosted-observation' })),
|
|
83
|
+
...hostedCacheReasons(this.session),
|
|
84
|
+
];
|
|
85
|
+
}
|
|
63
86
|
private readonly workContext = new AsyncLocalStorage<CommandWork>();
|
|
64
87
|
private readonly dialogWork = new Map<string, { command?: CommandWork; toolCallId?: string }>();
|
|
65
88
|
/**
|
|
@@ -136,8 +159,10 @@ export class HostedSession {
|
|
|
136
159
|
async clientSnapshot(): Promise<Record<string, unknown>> {
|
|
137
160
|
if (this.disposed) throw new Error("Session runtime is closed; explicitly reopen the session");
|
|
138
161
|
this.operations++;
|
|
162
|
+
const record = ++this.operationCounter;
|
|
163
|
+
this.operationRecords.set(record, { source: 'client-snapshot', lastProgressAt: Date.now() });
|
|
139
164
|
try { return await this.readClientSnapshot(); }
|
|
140
|
-
finally { this.operations--; }
|
|
165
|
+
finally { this.operations--; this.operationRecords.delete(record); }
|
|
141
166
|
}
|
|
142
167
|
|
|
143
168
|
private async readClientSnapshot(): Promise<Record<string, unknown>> {
|
|
@@ -219,6 +244,7 @@ export class HostedSession {
|
|
|
219
244
|
publishRuntimeEvent(event: unknown): void { this.publish(event); }
|
|
220
245
|
|
|
221
246
|
private publish(event: unknown): void {
|
|
247
|
+
this.progressAt = Date.now();
|
|
222
248
|
if (this.runtimeReleased) return;
|
|
223
249
|
const logged = this.log.append(event);
|
|
224
250
|
for (const listener of this.listeners) listener(logged);
|
|
@@ -418,7 +444,8 @@ export class HostedSession {
|
|
|
418
444
|
try { if (!command.type.startsWith("get_")) assertHostedAdmission(this.session, command.type === "set_session_name"); }
|
|
419
445
|
catch (error) { return fail(command.id, command.type, String(error)); }
|
|
420
446
|
this.operations++;
|
|
421
|
-
const work: CommandWork = { kind: command.type, dialogs: 0 };
|
|
447
|
+
const work: CommandWork = { kind: command.type, dialogs: 0, id: ++this.operationCounter, startedAt: Date.now() };
|
|
448
|
+
this.operationRecords.set(work.id, { source: passive ? 'passive-rpc' : 'command-rpc', lastProgressAt: work.startedAt });
|
|
422
449
|
if (!passive) {
|
|
423
450
|
// Installed synchronously, before dispatch can reach provider/preflight awaits.
|
|
424
451
|
this.commandsInFlight.add(work);
|
|
@@ -428,6 +455,7 @@ export class HostedSession {
|
|
|
428
455
|
try { return await this.workContext.run(work, () => this.dispatch(command)); }
|
|
429
456
|
finally {
|
|
430
457
|
this.operations--;
|
|
458
|
+
this.operationRecords.delete(work.id);
|
|
431
459
|
if (!passive) {
|
|
432
460
|
this.commandsInFlight.delete(work);
|
|
433
461
|
this.onActivity("work");
|
package/src/maintenance.ts
CHANGED
|
@@ -16,7 +16,7 @@ export class MaintenanceBusyError extends Error {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
type Admission = { gate: HostMaintenance; closed: boolean; calls: number; persistenceSafe: boolean; reloadEntry: boolean };
|
|
19
|
+
type Admission = { gate: HostMaintenance; manager?: SessionManager; closed: boolean; calls: number; persistenceSafe: boolean; reloadEntry: boolean };
|
|
20
20
|
type Method = (this: any, ...args: any[]) => any;
|
|
21
21
|
type WarmGuard = { state: Admission; methods: Map<string, Method> };
|
|
22
22
|
type GuardState = { managers: WeakMap<object, Admission>; installed: WeakSet<object>; supported: WeakSet<object>; tools: WeakSet<object>; warmers?: WeakMap<object, WarmGuard> };
|
|
@@ -41,12 +41,14 @@ function tracked(state: Admission | undefined, original: Method, receiver: unkno
|
|
|
41
41
|
throw error;
|
|
42
42
|
}
|
|
43
43
|
state.calls++;
|
|
44
|
+
const finishRecord = state.gate.trackOperation(`sdk:${original.name || 'call'}`, state.manager?.getSessionId());
|
|
44
45
|
try {
|
|
45
46
|
const result = Reflect.apply(original, receiver, args);
|
|
46
|
-
if (result && typeof result.then === "function") return Promise.resolve(result).finally(() => { state.calls--; });
|
|
47
|
+
if (result && typeof result.then === "function") return Promise.resolve(result).finally(() => { state.calls--; finishRecord(); });
|
|
47
48
|
state.calls--;
|
|
49
|
+
finishRecord();
|
|
48
50
|
return result;
|
|
49
|
-
} catch (error) { state.calls--; throw error; }
|
|
51
|
+
} catch (error) { state.calls--; finishRecord(); throw error; }
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
function wrap(proto: object, name: string, invoke: (original: Method, receiver: any, args: any[]) => any): boolean {
|
|
@@ -195,6 +197,20 @@ export function assertHostedAdmission(session: AgentSession, metadata = false):
|
|
|
195
197
|
}
|
|
196
198
|
|
|
197
199
|
export function hostedSdkCalls(session: AgentSession): number { return guards.managers.get(session.sessionManager)?.calls ?? 0; }
|
|
200
|
+
const warmingRuns = new WeakMap<object, number>();
|
|
201
|
+
let warmingRunCounter = 0;
|
|
202
|
+
export function hostedCacheReasons(session: AgentSession) {
|
|
203
|
+
const warmer = (session as unknown as { _cacheWarmer?: { run?: unknown } })._cacheWarmer;
|
|
204
|
+
const run = warmer?.run;
|
|
205
|
+
if (cacheWarmingState(session) === 'idle') return [];
|
|
206
|
+
let id: number | null = null;
|
|
207
|
+
if (run && typeof run === 'object') {
|
|
208
|
+
id = warmingRuns.get(run) ?? ++warmingRunCounter; warmingRuns.set(run, id);
|
|
209
|
+
}
|
|
210
|
+
return [{ kind: 'hosted-cache-work', owner: session.sessionId, id, state: run === undefined ? 'unsupported-observation' : 'queued-or-running',
|
|
211
|
+
lastProgressAt: null, executionDeadline: null, nextDeadline: null, retainsExecution: false,
|
|
212
|
+
recovery: 'existing-sdk-cache-warmer-must-retire-run-before-maintenance-no-new-runtime-lease' }];
|
|
213
|
+
}
|
|
198
214
|
|
|
199
215
|
export async function reloadHostedSession(session: AgentSession): Promise<void> {
|
|
200
216
|
const state = guards.managers.get(session.sessionManager);
|
|
@@ -205,6 +221,15 @@ export async function reloadHostedSession(session: AgentSession): Promise<void>
|
|
|
205
221
|
|
|
206
222
|
/** The registry, native reload/package host and upgrade activation share this one gate. */
|
|
207
223
|
export class HostMaintenance {
|
|
224
|
+
private recordCounter = 0;
|
|
225
|
+
private records = new Map<number, { kind: string; id: number; source: string; sessionId?: string; lastProgressAt: number; executionDeadline: null; nextDeadline: null; recovery: string }>();
|
|
226
|
+
lifecycleReasons() { return [...this.records.values()].map(record => ({ ...record })); }
|
|
227
|
+
trackOperation(source: string, sessionId?: string): () => void {
|
|
228
|
+
const id = ++this.recordCounter;
|
|
229
|
+
this.records.set(id, { kind: 'host-operation', id, source, sessionId, lastProgressAt: Date.now(),
|
|
230
|
+
executionDeadline: null, nextDeadline: null, recovery: 'drain-admitted-host-operation-until-settlement' });
|
|
231
|
+
return () => { this.records.delete(id); };
|
|
232
|
+
}
|
|
208
233
|
private purpose: MaintenancePurpose | undefined;
|
|
209
234
|
private operations = 0;
|
|
210
235
|
private stopped = false;
|
|
@@ -225,7 +250,7 @@ export class HostMaintenance {
|
|
|
225
250
|
const proto = SessionManager.prototype as unknown as Record<string, unknown>;
|
|
226
251
|
const sessionProto = AgentSession.prototype as unknown as Record<string, unknown>;
|
|
227
252
|
guards.managers.set(manager, {
|
|
228
|
-
gate: this, closed: false, calls: 0, reloadEntry: false,
|
|
253
|
+
gate: this, manager, closed: false, calls: 0, reloadEntry: false,
|
|
229
254
|
persistenceSafe: /^(0\.82|1\.2)\./.test(VERSION) && guards.supported.has(AgentSession.prototype) && guards.supported.has(SessionManager.prototype) &&
|
|
230
255
|
["_persist", "_rewriteFile"].every(name => typeof proto[name] === "function" && !Object.hasOwn(manager, name)) &&
|
|
231
256
|
["_buildRuntime", "_refreshToolRegistry", "prompt", "compact", "executeBash"].every(name => typeof sessionProto[name] === "function"),
|
|
@@ -241,15 +266,17 @@ export class HostMaintenance {
|
|
|
241
266
|
const state = guards.managers.get(manager)!;
|
|
242
267
|
assertAdmission(state);
|
|
243
268
|
state.calls++;
|
|
269
|
+
const finishRecord = this.trackOperation('hosted-tool', manager.getSessionId());
|
|
244
270
|
let released = false;
|
|
245
|
-
return () => { if (!released) { released = true; state.calls--; } };
|
|
271
|
+
return () => { if (!released) { released = true; state.calls--; finishRecord(); } };
|
|
246
272
|
}
|
|
247
273
|
|
|
248
274
|
enterSessionOperation(): () => void {
|
|
249
275
|
this.assertAdmission();
|
|
250
276
|
this.operations++;
|
|
277
|
+
const finishRecord = this.trackOperation('session-operation');
|
|
251
278
|
let released = false;
|
|
252
|
-
return () => { if (!released) { released = true; this.operations--; } };
|
|
279
|
+
return () => { if (!released) { released = true; this.operations--; finishRecord(); } };
|
|
253
280
|
}
|
|
254
281
|
|
|
255
282
|
async withIdleSessions<T>(purpose: MaintenancePurpose, run: (sessions: HostedSession[], lease: IdleSessionsLease) => Promise<T>): Promise<T> {
|
|
@@ -311,7 +338,8 @@ export class HostMaintenance {
|
|
|
311
338
|
for (const session of sessions) session.fence();
|
|
312
339
|
},
|
|
313
340
|
};
|
|
341
|
+
const finishRecord = this.trackOperation(purpose);
|
|
314
342
|
try { await lease.refreshIdle(); return await run(sessions, lease); }
|
|
315
|
-
finally { valid = false; if (!this.stopped && held) this.purpose = undefined; }
|
|
343
|
+
finally { finishRecord(); valid = false; if (!this.stopped && held) this.purpose = undefined; }
|
|
316
344
|
}
|
|
317
345
|
}
|
package/src/registry.ts
CHANGED
|
@@ -93,6 +93,15 @@ export class SessionRegistry {
|
|
|
93
93
|
get hasPendingOperations(): boolean {
|
|
94
94
|
return this.creating > 0 || this.operations.size > 0 || this.pending.size > 0 || this.releasing.size > 0;
|
|
95
95
|
}
|
|
96
|
+
lifecycleReasons() {
|
|
97
|
+
return [...this.live].flatMap(([sessionId, hosted]) => {
|
|
98
|
+
const entry = this.entries.get(sessionId)!;
|
|
99
|
+
const last = Date.parse(entry.lastActivityAt ?? entry.createdAt);
|
|
100
|
+
return [{ kind: 'hosted-session', id: sessionId, lastProgressAt: Number.isFinite(last) ? last : null,
|
|
101
|
+
nextDeadline: this.sessionIdleMs === 0 || !Number.isFinite(last) ? null : last + this.sessionIdleMs,
|
|
102
|
+
executionDeadline: null, recovery: 'configured-hosted-idle-expiry-after-execution-clears' }, ...hosted.lifecycleReasons()];
|
|
103
|
+
});
|
|
104
|
+
}
|
|
96
105
|
|
|
97
106
|
/** Recheck under the same serialization as open/close; no await between the final check and fencing. */
|
|
98
107
|
async expireIdle(now = this.now()): Promise<string[]> {
|
|
@@ -147,8 +156,9 @@ export class SessionRegistry {
|
|
|
147
156
|
this.maintenance.assertAdmission();
|
|
148
157
|
if (this.stopping) throw new Error("Session registry is shutting down");
|
|
149
158
|
this.creating++;
|
|
159
|
+
const finishCreating = this.maintenance.trackOperation('registry-create');
|
|
150
160
|
try { return await this.createNow(request); }
|
|
151
|
-
finally { this.creating--; }
|
|
161
|
+
finally { this.creating--; finishCreating(); }
|
|
152
162
|
}
|
|
153
163
|
|
|
154
164
|
private async createNow(request: CreateSessionRequest): Promise<SessionSummary> {
|
|
@@ -222,7 +232,13 @@ export class SessionRegistry {
|
|
|
222
232
|
try { this.maintenance.assertAdmission(); }
|
|
223
233
|
catch (error) { return Promise.reject(error); }
|
|
224
234
|
const prior = this.operations.get(sessionId) ?? Promise.resolve();
|
|
225
|
-
const
|
|
235
|
+
const finishQueued = this.maintenance.trackOperation('registry-queued', sessionId);
|
|
236
|
+
const dispatch = async () => {
|
|
237
|
+
finishQueued();
|
|
238
|
+
const finishRunning = this.maintenance.trackOperation('registry-dispatched', sessionId);
|
|
239
|
+
try { return await run(); } finally { finishRunning(); }
|
|
240
|
+
};
|
|
241
|
+
const result = prior.then(dispatch, dispatch);
|
|
226
242
|
const tail = result.catch(() => undefined);
|
|
227
243
|
this.operations.set(sessionId, tail);
|
|
228
244
|
void tail.then(() => {
|
|
@@ -281,6 +297,7 @@ export class SessionRegistry {
|
|
|
281
297
|
* back until the old session's events have stopped.
|
|
282
298
|
*/
|
|
283
299
|
private releaseLive(sessionId: string, abort: boolean): Promise<void> {
|
|
300
|
+
const finishRelease = this.maintenance.trackOperation('registry-release', sessionId);
|
|
284
301
|
const prior = this.releasing.get(sessionId);
|
|
285
302
|
this.live.get(sessionId)?.fence();
|
|
286
303
|
const run = (async () => {
|
|
@@ -291,6 +308,7 @@ export class SessionRegistry {
|
|
|
291
308
|
if (hosted) await hosted.dispose({ abort });
|
|
292
309
|
})();
|
|
293
310
|
const tracked = run.finally(() => {
|
|
311
|
+
finishRelease();
|
|
294
312
|
if (this.releasing.get(sessionId) === tracked) this.releasing.delete(sessionId);
|
|
295
313
|
});
|
|
296
314
|
this.releasing.set(sessionId, tracked);
|
|
@@ -368,7 +386,8 @@ export class SessionRegistry {
|
|
|
368
386
|
if (existing) return Promise.resolve(existing);
|
|
369
387
|
const inFlight = this.pending.get(entry.sessionId);
|
|
370
388
|
if (inFlight) return inFlight;
|
|
371
|
-
const
|
|
389
|
+
const finishStart = this.maintenance.trackOperation('registry-host-start', entry.sessionId);
|
|
390
|
+
const started = this.start(entry, manager, useDefaultModel).finally(() => { this.pending.delete(entry.sessionId); finishStart(); });
|
|
372
391
|
this.pending.set(entry.sessionId, started);
|
|
373
392
|
return started;
|
|
374
393
|
}
|
|
@@ -408,7 +427,12 @@ export class SessionRegistry {
|
|
|
408
427
|
this.log(`session ${entry.sessionId}: automatic expiry disabled with a caller-owned resource loader because background activity is unobservable`);
|
|
409
428
|
activity.markUnobservable();
|
|
410
429
|
}
|
|
411
|
-
|
|
430
|
+
// A hosted recipient can receive assignments from another client before its first tool call.
|
|
431
|
+
const sessionStartEvent = {
|
|
432
|
+
...(supplied?.sessionStartEvent ?? { type: "session_start" as const, reason: "startup" as const }),
|
|
433
|
+
piBetterObserveWork: true,
|
|
434
|
+
};
|
|
435
|
+
({ session } = await createAgentSession({ ...supplied, sessionStartEvent, customTools: supplied?.customTools?.map((tool) => activity.wrapTool(tool)), settingsManager, resourceLoader, cwd: entry.cwd, sessionManager }));
|
|
412
436
|
if (useDefaultModel) await this.initializeDefaultModel(session);
|
|
413
437
|
if (!manager) await this.restoreSavedModel(session, sessionManager, entry.model);
|
|
414
438
|
const events = new EventLog(join(this.options.serverDir, "events", `${entry.sessionId}.jsonl`), this.options.eventLog);
|