@phyzess/pappra 0.1.0-beta.13 → 0.1.0-beta.18
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/README.md +134 -15
- package/assets/integrations/skills/pappra/SKILL.md +28 -7
- package/assets/integrations/skills/pappra/references/collaboration.md +633 -0
- package/assets/integrations/skills/pappra/references/environment.md +360 -0
- package/assets/integrations/skills/pappra/references/hosts.md +20 -0
- package/assets/integrations/skills/pappra/references/operations.md +36 -5
- package/dist/adapters/pi/recovery-extension.d.ts +65 -0
- package/dist/adapters/pi/recovery-extension.js +238 -0
- package/dist/adapters/pi/session-transition-extension.d.ts +30 -0
- package/dist/adapters/pi/session-transition-extension.js +265 -0
- package/dist/app/automatic-handoff-events.d.ts +26 -0
- package/dist/app/automatic-handoff-events.js +134 -0
- package/dist/app/bounded-file.d.ts +2 -0
- package/dist/app/bounded-file.js +2 -0
- package/dist/app/capability-evidence/claude.d.ts +37 -0
- package/dist/app/capability-evidence/claude.js +206 -0
- package/dist/app/capability-evidence/codex.d.ts +35 -0
- package/dist/app/capability-evidence/codex.js +193 -0
- package/dist/app/capability-evidence/index.d.ts +33 -0
- package/dist/app/capability-evidence/index.js +117 -0
- package/dist/app/capability-evidence/pi.d.ts +73 -0
- package/dist/app/capability-evidence/pi.js +669 -0
- package/dist/app/capability-evidence/shared.d.ts +69 -0
- package/dist/app/capability-evidence/shared.js +195 -0
- package/dist/app/collab-auto-handoff.d.ts +55 -0
- package/dist/app/collab-auto-handoff.js +384 -0
- package/dist/app/collab-bindings.d.ts +57 -0
- package/dist/app/collab-bindings.js +1006 -0
- package/dist/app/collab-bootstrap-transport.d.ts +163 -0
- package/dist/app/collab-bootstrap-transport.js +769 -0
- package/dist/app/collab-bootstrap.d.ts +137 -0
- package/dist/app/collab-bootstrap.js +3455 -0
- package/dist/app/collab-handoff.d.ts +12 -0
- package/dist/app/collab-handoff.js +511 -0
- package/dist/app/collab-messages.d.ts +2 -0
- package/dist/app/collab-messages.js +2 -0
- package/dist/app/collab-notify.d.ts +156 -0
- package/dist/app/collab-notify.js +1208 -0
- package/dist/app/collab-preflight.d.ts +34 -0
- package/dist/app/collab-preflight.js +96 -0
- package/dist/app/collab-recovery-executor.d.ts +161 -0
- package/dist/app/collab-recovery-executor.js +1153 -0
- package/dist/app/collab-recovery-projection.d.ts +103 -0
- package/dist/app/collab-recovery-projection.js +659 -0
- package/dist/app/collab-recovery.d.ts +25 -0
- package/dist/app/collab-recovery.js +429 -0
- package/dist/app/collab-resources.d.ts +16 -0
- package/dist/app/collab-resources.js +278 -0
- package/dist/app/collab-role-events.d.ts +22 -0
- package/dist/app/collab-role-events.js +329 -0
- package/dist/app/collab-role-orchestration.d.ts +53 -0
- package/dist/app/collab-role-orchestration.js +601 -0
- package/dist/app/collab-role-plan.d.ts +81 -0
- package/dist/app/collab-role-plan.js +504 -0
- package/dist/app/collab-role-repair.d.ts +109 -0
- package/dist/app/collab-role-repair.js +821 -0
- package/dist/app/collab-rollover.d.ts +263 -0
- package/dist/app/collab-rollover.js +1112 -0
- package/dist/app/collab-route.d.ts +64 -0
- package/dist/app/collab-route.js +240 -0
- package/dist/app/collab-session-transition.d.ts +221 -0
- package/dist/app/collab-session-transition.js +3334 -0
- package/dist/app/collab-state.d.ts +7 -0
- package/dist/app/collab-state.js +162 -0
- package/dist/app/collab-task-store.d.ts +22 -0
- package/dist/app/collab-task-store.js +204 -0
- package/dist/app/collab-work-execution.d.ts +127 -0
- package/dist/app/collab-work-execution.js +1027 -0
- package/dist/app/collab-work-plan.d.ts +87 -0
- package/dist/app/collab-work-plan.js +437 -0
- package/dist/app/collaboration.d.ts +8 -2
- package/dist/app/collaboration.js +101 -12
- package/dist/app/doctor.js +108 -5
- package/dist/app/host-mcp.js +34 -8
- package/dist/app/host-probe.js +4 -4
- package/dist/app/init.d.ts +58 -4
- package/dist/app/init.js +768 -155
- package/dist/app/managed-pi-bootstrap-admission.d.ts +14 -0
- package/dist/app/managed-pi-bootstrap-admission.js +104 -0
- package/dist/app/managed-pi-bootstrap-refresh.d.ts +10 -0
- package/dist/app/managed-pi-bootstrap-refresh.js +78 -0
- package/dist/app/managed-pi-delivery.d.ts +8 -0
- package/dist/app/managed-pi-delivery.js +110 -0
- package/dist/app/managed-pi-handoff-receiver.d.ts +15 -0
- package/dist/app/managed-pi-handoff-receiver.js +263 -0
- package/dist/app/managed-pi-handoff-reference.d.ts +3 -0
- package/dist/app/managed-pi-handoff-reference.js +60 -0
- package/dist/app/managed-pi-herdr.d.ts +21 -0
- package/dist/app/managed-pi-herdr.js +185 -0
- package/dist/app/managed-pi-initial-admission.d.ts +28 -0
- package/dist/app/managed-pi-initial-admission.js +416 -0
- package/dist/app/managed-pi-initial-launch.d.ts +5 -0
- package/dist/app/managed-pi-initial-launch.js +61 -0
- package/dist/app/managed-pi-native-observation.d.ts +36 -0
- package/dist/app/managed-pi-native-observation.js +191 -0
- package/dist/app/managed-pi-readiness.d.ts +29 -0
- package/dist/app/managed-pi-readiness.js +288 -0
- package/dist/app/managed-pi-repair-stop.d.ts +21 -0
- package/dist/app/managed-pi-repair-stop.js +371 -0
- package/dist/app/managed-pi-resume-admission.d.ts +32 -0
- package/dist/app/managed-pi-resume-admission.js +618 -0
- package/dist/app/managed-pi-retirement.d.ts +28 -0
- package/dist/app/managed-pi-retirement.js +112 -0
- package/dist/app/managed-pi-sdk-control.d.ts +7 -0
- package/dist/app/managed-pi-sdk-control.js +169 -0
- package/dist/app/managed-pi-sdk-runtime.d.ts +3 -0
- package/dist/app/managed-pi-sdk-runtime.js +483 -0
- package/dist/app/managed-pi-source-admission.d.ts +14 -0
- package/dist/app/managed-pi-source-admission.js +323 -0
- package/dist/app/managed-pi-transition-host.d.ts +36 -0
- package/dist/app/managed-pi-transition-host.js +292 -0
- package/dist/app/managed-pi.d.ts +54 -0
- package/dist/app/managed-pi.js +248 -0
- package/dist/app/shell-readiness.d.ts +66 -0
- package/dist/app/shell-readiness.js +368 -0
- package/dist/app/task-pin.d.ts +2 -23
- package/dist/app/task-pin.js +2 -113
- package/dist/cli/commands/collaboration-binding.d.ts +13 -0
- package/dist/cli/commands/collaboration-binding.js +118 -0
- package/dist/cli/commands/collaboration-bootstrap.d.ts +10 -0
- package/dist/cli/commands/collaboration-bootstrap.js +84 -0
- package/dist/cli/commands/collaboration-capabilities.d.ts +13 -0
- package/dist/cli/commands/collaboration-capabilities.js +127 -0
- package/dist/cli/commands/collaboration-handoff.d.ts +13 -0
- package/dist/cli/commands/collaboration-handoff.js +102 -0
- package/dist/cli/commands/collaboration-message.d.ts +17 -0
- package/dist/cli/commands/collaboration-message.js +177 -0
- package/dist/cli/commands/collaboration-plan.d.ts +8 -0
- package/dist/cli/commands/collaboration-plan.js +108 -0
- package/dist/cli/commands/collaboration-preflight.d.ts +10 -0
- package/dist/cli/commands/collaboration-preflight.js +167 -0
- package/dist/cli/commands/collaboration-recovery-run.d.ts +46 -0
- package/dist/cli/commands/collaboration-recovery-run.js +224 -0
- package/dist/cli/commands/collaboration-recovery.d.ts +11 -0
- package/dist/cli/commands/collaboration-recovery.js +104 -0
- package/dist/cli/commands/collaboration-resources.d.ts +11 -0
- package/dist/cli/commands/collaboration-resources.js +96 -0
- package/dist/cli/commands/collaboration-role-plan.d.ts +9 -0
- package/dist/cli/commands/collaboration-role-plan.js +69 -0
- package/dist/cli/commands/collaboration-role-run.d.ts +11 -0
- package/dist/cli/commands/collaboration-role-run.js +128 -0
- package/dist/cli/commands/collaboration-rollover.d.ts +10 -0
- package/dist/cli/commands/collaboration-rollover.js +103 -0
- package/dist/cli/commands/collaboration-state.d.ts +10 -0
- package/dist/cli/commands/collaboration-state.js +96 -0
- package/dist/cli/commands/collaboration-transition.d.ts +10 -0
- package/dist/cli/commands/collaboration-transition.js +75 -0
- package/dist/cli/commands/collaboration-work-run.d.ts +34 -0
- package/dist/cli/commands/collaboration-work-run.js +178 -0
- package/dist/cli/commands/collaboration.d.ts +4 -0
- package/dist/cli/commands/collaboration.js +39 -4
- package/dist/cli/commands/continuity.js +2 -6
- package/dist/cli/commands/docs.d.ts +2 -0
- package/dist/cli/commands/docs.js +89 -15
- package/dist/cli/commands/host.d.ts +7 -1
- package/dist/cli/commands/host.js +122 -7
- package/dist/cli/commands/init.d.ts +20 -3
- package/dist/cli/commands/init.js +897 -232
- package/dist/cli/commands/mcp.d.ts +1 -0
- package/dist/cli/commands/mcp.js +11 -5
- package/dist/cli/commands/repair.d.ts +12 -0
- package/dist/cli/commands/repair.js +41 -0
- package/dist/cli/commands/runtime.d.ts +1 -1
- package/dist/cli/commands/runtime.js +139 -38
- package/dist/cli/commands/session.d.ts +7 -0
- package/dist/cli/commands/session.js +82 -0
- package/dist/cli/commands/task.js +19 -5
- package/dist/cli/run.js +866 -24
- package/dist/code/identity.d.ts +7 -0
- package/dist/code/identity.js +7 -3
- package/dist/code/registration.js +7 -0
- package/dist/code/service.d.ts +9 -0
- package/dist/code/service.js +16 -3
- package/dist/code/text.js +19 -7
- package/dist/collab/admission.d.ts +91 -66
- package/dist/collab/admission.js +21 -6
- package/dist/collab/canonical.d.ts +1 -1
- package/dist/collab/canonical.js +44 -3
- package/dist/collab/envelope.d.ts +2 -2
- package/dist/collab/envelope.js +12 -12
- package/dist/collab/first-work.d.ts +3 -0
- package/dist/collab/first-work.js +15 -0
- package/dist/collab/handoff.d.ts +16 -0
- package/dist/collab/handoff.js +39 -5
- package/dist/collab/index.d.ts +97 -1
- package/dist/collab/index.js +9 -1
- package/dist/collab/messages.js +126 -3
- package/dist/collab/persisted-messages.d.ts +123 -0
- package/dist/collab/persisted-messages.js +496 -0
- package/dist/collab/preflight.d.ts +1 -1
- package/dist/collab/resources.d.ts +13 -3
- package/dist/collab/resources.js +37 -6
- package/dist/collab/rollover.d.ts +311 -0
- package/dist/collab/rollover.js +1024 -0
- package/dist/collab/store.d.ts +1 -0
- package/dist/collab/store.js +1 -4
- package/dist/collab/types.d.ts +2 -354
- package/dist/collab/validation.d.ts +2 -10
- package/dist/collab/validation.js +2 -303
- package/dist/collab/work-plan.d.ts +105 -0
- package/dist/collab/work-plan.js +843 -0
- package/dist/continuity/context.d.ts +11 -2
- package/dist/continuity/context.js +100 -13
- package/dist/continuity/handoff-bundle.d.ts +296 -0
- package/dist/continuity/handoff-bundle.js +477 -0
- package/dist/continuity/index.d.ts +2 -0
- package/dist/continuity/index.js +1 -0
- package/dist/continuity/paths.js +10 -2
- package/dist/continuity/service.js +91 -15
- package/dist/continuity/task-pin.d.ts +24 -0
- package/dist/continuity/task-pin.js +590 -0
- package/dist/doctor.d.ts +1 -0
- package/dist/doctor.js +6 -0
- package/dist/experimental/index.d.ts +13 -0
- package/dist/experimental/index.js +25 -0
- package/dist/experimental/pi.d.ts +4 -0
- package/dist/experimental/pi.js +12 -0
- package/dist/hosts/claude/native.js +1 -1
- package/dist/hosts/codex/native.js +1 -1
- package/dist/hosts/codex/protocol.js +1 -1
- package/dist/hosts/integration/bootstrap-config.d.ts +58 -0
- package/dist/hosts/integration/bootstrap-config.js +254 -0
- package/dist/hosts/integration/bundle-export.d.ts +44 -0
- package/dist/hosts/integration/bundle-export.js +366 -3
- package/dist/hosts/integration/bundle.js +3 -0
- package/dist/hosts/integration/hook.js +36 -9
- package/dist/hosts/integration/pappra-bootstrap-extension.mjs +80 -0
- package/dist/hosts/integration/pappra-extension-runtime.mjs +59 -24631
- package/dist/hosts/integration/pappra-hook.mjs +61 -24749
- package/dist/hosts/integration/pappra-recovery-extension.mjs +259 -0
- package/dist/hosts/integration/pappra-session-transition-extension.mjs +276 -0
- package/dist/hosts/integration/pi-bootstrap-extension.d.ts +36 -0
- package/dist/hosts/integration/pi-bootstrap-extension.js +101 -0
- package/dist/hosts/integration/pi-bootstrap-guard.d.ts +125 -0
- package/dist/hosts/integration/pi-bootstrap-guard.js +438 -0
- package/dist/hosts/integration/pi-bootstrap-runtime.d.ts +63 -0
- package/dist/hosts/integration/pi-bootstrap-runtime.js +223 -0
- package/dist/hosts/integration/pi-native-events.d.ts +112 -0
- package/dist/hosts/integration/pi-native-events.js +348 -0
- package/dist/hosts/integration/pi-rollover-extension.d.ts +166 -0
- package/dist/hosts/integration/pi-rollover-extension.js +431 -0
- package/dist/hosts/integration/recovery-config.d.ts +48 -0
- package/dist/hosts/integration/recovery-config.js +117 -0
- package/dist/hosts/integration/service.d.ts +6 -1
- package/dist/hosts/integration/service.js +485 -35
- package/dist/hosts/integration/support.d.ts +7 -0
- package/dist/hosts/integration/support.js +9 -1
- package/dist/hosts/integration/templates.d.ts +3 -0
- package/dist/hosts/integration/templates.js +26 -3
- package/dist/hosts/pi/managed-host-identity.d.ts +2 -0
- package/dist/hosts/pi/managed-host-identity.js +40 -0
- package/dist/hosts/pi/managed-provider-diagnostics.d.ts +6 -0
- package/dist/hosts/pi/managed-provider-diagnostics.js +184 -0
- package/dist/hosts/pi/managed-sdk-session.d.ts +335 -0
- package/dist/hosts/pi/managed-sdk-session.js +1639 -0
- package/dist/hosts/pi/managed-session-extension.d.ts +20 -0
- package/dist/hosts/pi/managed-session-extension.js +84 -0
- package/dist/hosts/pi/managed-session.d.ts +177 -0
- package/dist/hosts/pi/managed-session.js +1557 -0
- package/dist/hosts/pi/protocol.js +1 -1
- package/dist/hosts/pi/query-result.js +1 -1
- package/dist/hosts/pi/resume-capability.d.ts +41 -0
- package/dist/hosts/pi/resume-capability.js +33 -0
- package/dist/hosts/pi/rpc.d.ts +182 -134
- package/dist/hosts/pi/rpc.js +230 -37
- package/dist/hosts/pilot.d.ts +97 -74
- package/dist/hosts/pilot.js +5 -1
- package/dist/hosts/version.d.ts +3 -0
- package/dist/hosts/version.js +18 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/infra/bounded-file.d.ts +19 -0
- package/dist/infra/bounded-file.js +66 -0
- package/dist/infra/fs.js +10 -2
- package/dist/infra/git.d.ts +29 -0
- package/dist/infra/git.js +45 -9
- package/dist/infra/json-property.d.ts +2 -0
- package/dist/infra/json-property.js +69 -0
- package/dist/infra/json.d.ts +4 -0
- package/dist/infra/json.js +24 -0
- package/dist/infra/owned-process-group.js +1 -1
- package/dist/infra/private-lock.d.ts +16 -0
- package/dist/infra/private-lock.js +148 -0
- package/dist/infra/private-state.d.ts +7 -0
- package/dist/infra/private-state.js +146 -0
- package/dist/infra/process-identity.d.ts +12 -0
- package/dist/infra/process-identity.js +142 -0
- package/dist/infra/validation.d.ts +5 -0
- package/dist/infra/validation.js +15 -0
- package/dist/init.d.ts +1 -0
- package/dist/init.js +6 -0
- package/dist/install/apply.d.ts +9 -1
- package/dist/install/apply.js +176 -12
- package/dist/install/dependencies.d.ts +38 -0
- package/dist/install/dependencies.js +282 -0
- package/dist/install/ownership.js +30 -1
- package/dist/install/references.d.ts +31 -0
- package/dist/install/references.js +208 -0
- package/dist/install/repair.d.ts +37 -0
- package/dist/install/repair.js +798 -0
- package/dist/install/reset-local.d.ts +16 -0
- package/dist/install/reset-local.js +304 -0
- package/dist/install/rollback.d.ts +3 -0
- package/dist/install/rollback.js +9 -3
- package/dist/install/runtime.d.ts +10 -6
- package/dist/install/runtime.js +299 -59
- package/dist/install/source-fingerprint.d.ts +2 -0
- package/dist/install/source-fingerprint.js +103 -0
- package/dist/knowledge/catalog.d.ts +1 -0
- package/dist/knowledge/catalog.js +143 -10
- package/dist/knowledge/journal.js +17 -7
- package/dist/knowledge/paths.js +2 -1
- package/dist/knowledge/refs.js +4 -0
- package/dist/knowledge/register-batch.d.ts +4 -0
- package/dist/knowledge/register-batch.js +225 -0
- package/dist/knowledge/relocate.d.ts +5 -0
- package/dist/knowledge/relocate.js +92 -0
- package/dist/knowledge/scan.js +103 -47
- package/dist/knowledge/service.d.ts +3 -0
- package/dist/knowledge/service.js +33 -1
- package/dist/knowledge/write.d.ts +4 -1
- package/dist/knowledge/write.js +1 -1
- package/dist/mcp/server.d.ts +4 -2
- package/dist/mcp/server.js +87 -136
- package/dist/schemas/collaboration-state-validation.d.ts +6 -0
- package/dist/schemas/collaboration-state-validation.js +342 -0
- package/dist/schemas/collaboration-state.d.ts +436 -0
- package/dist/schemas/collaboration-state.js +1 -0
- package/dist/schemas/collaboration.d.ts +335 -0
- package/dist/schemas/collaboration.js +272 -0
- package/dist/schemas/continuity.d.ts +8 -0
- package/dist/schemas/continuity.js +13 -3
- package/dist/schemas/doctor.d.ts +1 -0
- package/dist/schemas/doctor.js +1 -0
- package/dist/schemas/document.d.ts +61 -0
- package/dist/schemas/document.js +9 -0
- package/dist/schemas/errors.d.ts +1 -0
- package/dist/schemas/errors.js +1 -0
- package/dist/schemas/host.d.ts +24 -0
- package/dist/schemas/host.js +19 -0
- package/dist/schemas/install.d.ts +8 -2
- package/dist/schemas/install.js +11 -1
- package/dist/schemas/managed-pi-execution.d.ts +16 -0
- package/dist/schemas/managed-pi-execution.js +2 -0
- package/dist/schemas/outcome.d.ts +9 -5
- package/dist/workspace/config-file.js +1 -3
- package/dist/workspace/documents.js +12 -2
- package/dist/workspace/repositories.d.ts +7 -0
- package/dist/workspace/repositories.js +14 -5
- package/package.json +35 -35
- package/skills/pappra/SKILL.md +28 -7
- package/skills/pappra/references/collaboration.md +633 -0
- package/skills/pappra/references/environment.md +360 -0
- package/skills/pappra/references/hosts.md +20 -0
- package/skills/pappra/references/operations.md +36 -5
- package/dist/app/collab-from.d.ts +0 -35
- package/dist/app/collab-from.js +0 -84
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { readRecord } from '../collab/store.js';
|
|
4
|
+
import { isAssignment } from '../collab/contracts.js';
|
|
5
|
+
import { canonicalJson } from '../collab/envelope.js';
|
|
6
|
+
import { readPiBootstrapConfig } from '../hosts/integration/bootstrap-config.js';
|
|
7
|
+
import { RolloverFreezeController } from '../hosts/integration/pi-rollover-extension.js';
|
|
8
|
+
import { startManagedPiSdkSession, } from '../hosts/pi/managed-sdk-session.js';
|
|
9
|
+
import { readBoundedFile } from './bounded-file.js';
|
|
10
|
+
import { bindManagedPiExecutionScope, createManagedPiTransitionHost, } from './managed-pi-transition-host.js';
|
|
11
|
+
import { loadAutomaticHandoffConfig, watchAutomaticHandoff, } from './automatic-handoff-events.js';
|
|
12
|
+
import { watchManagedPiReadiness } from './managed-pi-readiness.js';
|
|
13
|
+
import { serveManagedPiSdkControl } from './managed-pi-sdk-control.js';
|
|
14
|
+
import { registerManagedPiRuntime } from './managed-pi-repair-stop.js';
|
|
15
|
+
import { retireManagedPiSource } from './managed-pi-retirement.js';
|
|
16
|
+
import { publishManagedPiHerdrIdentity } from './managed-pi-herdr.js';
|
|
17
|
+
import { watchManagedPiBootstrapAdmission } from './managed-pi-bootstrap-admission.js';
|
|
18
|
+
import { deliverManagedPiMessage } from './managed-pi-delivery.js';
|
|
19
|
+
import { prepareManagedPiHandoffReceiver } from './managed-pi-handoff-receiver.js';
|
|
20
|
+
import { refreshManagedBootstrapAdmission } from './managed-pi-bootstrap-refresh.js';
|
|
21
|
+
import { admitManagedSourceAssignment } from './managed-pi-source-admission.js';
|
|
22
|
+
import { watchManagedPiInitialAdmission } from './managed-pi-initial-admission.js';
|
|
23
|
+
import { initialAdmissionDigest, registerManagedPiInitialLaunch, } from './managed-pi-initial-launch.js';
|
|
24
|
+
import { canExecuteManagedPiResume, prepareManagedPiResume, releaseManagedPiResume, } from './managed-pi-resume-admission.js';
|
|
25
|
+
/** Native SDK CLI lifecycle, including a receiver's deferred authoritative task binding. */
|
|
26
|
+
export async function runManagedPiSdkRuntime(request) {
|
|
27
|
+
let automatic = request.automaticHandoffFile
|
|
28
|
+
? loadAutomaticHandoffConfig(request.automaticHandoffFile)
|
|
29
|
+
: null;
|
|
30
|
+
const sourceReadiness = request.readiness ?? automatic?.sourceReadiness;
|
|
31
|
+
if (request.readiness &&
|
|
32
|
+
automatic?.sourceReadiness &&
|
|
33
|
+
canonicalJson(request.readiness) !==
|
|
34
|
+
canonicalJson(automatic.sourceReadiness))
|
|
35
|
+
throw new Error('managed_source_readiness_conflict');
|
|
36
|
+
const bootstrap = request.bootstrapExtensionPath
|
|
37
|
+
? readPiBootstrapConfig(path.join(path.dirname(request.bootstrapExtensionPath), 'bootstrap.json'))
|
|
38
|
+
: null;
|
|
39
|
+
if (bootstrap && !bootstrap.ok)
|
|
40
|
+
throw new Error('managed_bootstrap_config_invalid');
|
|
41
|
+
if (bootstrap?.ok &&
|
|
42
|
+
(bootstrap.config.guard.successor.sessionId !== request.sessionId ||
|
|
43
|
+
request.executionScope))
|
|
44
|
+
throw new Error('managed_bootstrap_receiver_identity_invalid');
|
|
45
|
+
if (automatic &&
|
|
46
|
+
(request.sessionId !== automatic.transition.intent.from.session_id ||
|
|
47
|
+
request.cwd !== automatic.transition.intent.from.cwd))
|
|
48
|
+
throw new Error('automatic_handoff_source_mismatch');
|
|
49
|
+
const immediateScope = request.executionScope ??
|
|
50
|
+
(!bootstrap ? automatic?.transition.managed_execution_scope : undefined);
|
|
51
|
+
if (request.executionScope &&
|
|
52
|
+
automatic?.transition.managed_execution_scope &&
|
|
53
|
+
canonicalJson(request.executionScope) !==
|
|
54
|
+
canonicalJson(automatic.transition.managed_execution_scope))
|
|
55
|
+
throw new Error('managed_execution_scope_conflict');
|
|
56
|
+
if (request.resume &&
|
|
57
|
+
(!request.executionScope ||
|
|
58
|
+
bootstrap ||
|
|
59
|
+
automatic ||
|
|
60
|
+
request.initialAssignment ||
|
|
61
|
+
request.handoffContextFile))
|
|
62
|
+
throw new Error('managed_pi_resume_scope_or_mode_invalid');
|
|
63
|
+
const resumeAuthorization = request.resume
|
|
64
|
+
? await prepareManagedPiResume(request)
|
|
65
|
+
: undefined;
|
|
66
|
+
let scope = null;
|
|
67
|
+
let host;
|
|
68
|
+
let control = null;
|
|
69
|
+
let readiness = null;
|
|
70
|
+
let admission = null;
|
|
71
|
+
let initialAdmission = null;
|
|
72
|
+
let publication = null;
|
|
73
|
+
let handoff = null;
|
|
74
|
+
let retirement = null;
|
|
75
|
+
let receiver = null;
|
|
76
|
+
let retirementWatch = null;
|
|
77
|
+
let ready = false;
|
|
78
|
+
let unbindInitialLifecycle;
|
|
79
|
+
let sourceAdmissionReady = false;
|
|
80
|
+
let sourceAdmissionPending = false;
|
|
81
|
+
let sourceAdmissionError = null;
|
|
82
|
+
let controller;
|
|
83
|
+
let admissionController;
|
|
84
|
+
const paneId = request.herdrPaneId ?? process.env.HERDR_PANE_ID ?? null;
|
|
85
|
+
const name = request.herdrAgentName;
|
|
86
|
+
let resolveHandoff;
|
|
87
|
+
let rejectHandoff;
|
|
88
|
+
const handoffCompleted = new Promise((resolve, reject) => {
|
|
89
|
+
resolveHandoff = resolve;
|
|
90
|
+
rejectHandoff = reject;
|
|
91
|
+
});
|
|
92
|
+
void handoffCompleted.catch(() => { });
|
|
93
|
+
const bindIdentity = (live) => {
|
|
94
|
+
const assignmentFile = sourceReadiness?.assignmentFile ??
|
|
95
|
+
request.initialAssignment?.assignmentFile;
|
|
96
|
+
if (!assignmentFile)
|
|
97
|
+
return;
|
|
98
|
+
const file = readBoundedFile(assignmentFile, 1024 * 1024);
|
|
99
|
+
if (!file.ok)
|
|
100
|
+
return;
|
|
101
|
+
let value;
|
|
102
|
+
try {
|
|
103
|
+
value = JSON.parse(file.text);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (!isAssignment(value) ||
|
|
109
|
+
value.assignee.harness !== 'pi' ||
|
|
110
|
+
value.assignee.session_id !== live.observe().native.sessionId ||
|
|
111
|
+
path.resolve(value.assignee.cwd) !== path.resolve(request.cwd))
|
|
112
|
+
return;
|
|
113
|
+
const expectedAgent = bootstrap?.ok
|
|
114
|
+
? bootstrap.config.guard.successor.agentId
|
|
115
|
+
: automatic?.transition.intent.from.agent_id;
|
|
116
|
+
if (expectedAgent && value.assignee.agent_id !== expectedAgent)
|
|
117
|
+
return;
|
|
118
|
+
live.bindNativeIdentity({
|
|
119
|
+
agentId: value.assignee.agent_id,
|
|
120
|
+
paneId,
|
|
121
|
+
surface: value.assignee.surface,
|
|
122
|
+
configurationId: value.assignee.configuration_id,
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
const startHandoff = (live) => {
|
|
126
|
+
if (!automatic ||
|
|
127
|
+
handoff ||
|
|
128
|
+
(bootstrap && !scope) ||
|
|
129
|
+
(receiver && !receiver.priorSourceRetired()))
|
|
130
|
+
return;
|
|
131
|
+
if (receiver && sourceReadiness && !sourceAdmissionReady) {
|
|
132
|
+
if (!scope ||
|
|
133
|
+
!receiver.status().first_work_observed ||
|
|
134
|
+
sourceAdmissionPending)
|
|
135
|
+
return;
|
|
136
|
+
sourceAdmissionPending = true;
|
|
137
|
+
void admitManagedSourceAssignment(live, scope, sourceReadiness)
|
|
138
|
+
.then(async () => {
|
|
139
|
+
sourceAdmissionReady = true;
|
|
140
|
+
sourceAdmissionError = null;
|
|
141
|
+
bindIdentity(live);
|
|
142
|
+
live.publishResourcesReady(true);
|
|
143
|
+
await readiness?.refresh();
|
|
144
|
+
startHandoff(live);
|
|
145
|
+
})
|
|
146
|
+
.catch((error) => {
|
|
147
|
+
sourceAdmissionError =
|
|
148
|
+
error instanceof Error
|
|
149
|
+
? error.message
|
|
150
|
+
: 'managed_source_admission_failed';
|
|
151
|
+
})
|
|
152
|
+
.finally(() => {
|
|
153
|
+
sourceAdmissionPending = false;
|
|
154
|
+
});
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
handoff = watchAutomaticHandoff(automatic, {
|
|
158
|
+
observe: () => live.observe(),
|
|
159
|
+
canCaptureSummary: () => live.canCaptureSummary(),
|
|
160
|
+
captureSummary: (cause) => live.captureSummary(cause),
|
|
161
|
+
inventory: () => live.inventory(),
|
|
162
|
+
subscribe: (listener) => live.subscribe(listener),
|
|
163
|
+
...(sourceReadiness
|
|
164
|
+
? {
|
|
165
|
+
prepareBootstrapAdmission: (original) => refreshManagedBootstrapAdmission(live, sourceReadiness, original),
|
|
166
|
+
}
|
|
167
|
+
: {}),
|
|
168
|
+
}, host ? { host } : {}, async (result) => {
|
|
169
|
+
if (!result.request)
|
|
170
|
+
throw new Error('handoff_retirement_request_missing');
|
|
171
|
+
retirement = await retireManagedPiSource(result.request, live, host ? { host } : {});
|
|
172
|
+
});
|
|
173
|
+
void handoff.completed.then((result) => {
|
|
174
|
+
if (result.ok)
|
|
175
|
+
resolveHandoff();
|
|
176
|
+
else
|
|
177
|
+
rejectHandoff(new Error(result.code));
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
const activate = async (live, binding) => {
|
|
181
|
+
if (automatic &&
|
|
182
|
+
(binding.scope.task_root !== automatic.transition.task_root ||
|
|
183
|
+
binding.scope.subtask_id !== automatic.transition.intent.subtask_id ||
|
|
184
|
+
binding.scope.attempt !== automatic.transition.intent.attempt ||
|
|
185
|
+
binding.scope.owner_epoch !==
|
|
186
|
+
automatic.transition.intent.coordinator_epoch ||
|
|
187
|
+
(automatic.transition.managed_execution_scope &&
|
|
188
|
+
canonicalJson(automatic.transition.managed_execution_scope) !==
|
|
189
|
+
canonicalJson(binding.scope))))
|
|
190
|
+
throw new Error('automatic_handoff_scope_mismatch');
|
|
191
|
+
scope = binding.scope;
|
|
192
|
+
host = createManagedPiTransitionHost({
|
|
193
|
+
controller: live,
|
|
194
|
+
binding,
|
|
195
|
+
freezeController: new RolloverFreezeController({
|
|
196
|
+
sessionId: live.observe().native.sessionId,
|
|
197
|
+
readAllowlist: [],
|
|
198
|
+
}),
|
|
199
|
+
});
|
|
200
|
+
if (automatic)
|
|
201
|
+
automatic = {
|
|
202
|
+
...automatic,
|
|
203
|
+
transition: {
|
|
204
|
+
...automatic.transition,
|
|
205
|
+
managed_execution_scope: binding.scope,
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
if (!live.observe().native.agentId) {
|
|
209
|
+
const record = readRecord(binding.scope.task_root);
|
|
210
|
+
const assignee = record?.attempts.find((row) => row.subtask_id === binding.scope.subtask_id &&
|
|
211
|
+
row.attempt === binding.scope.attempt)?.assignee;
|
|
212
|
+
if (!assignee ||
|
|
213
|
+
assignee.session_id !== live.observe().native.sessionId ||
|
|
214
|
+
assignee.harness !== 'pi')
|
|
215
|
+
throw new Error('managed_execution_identity_changed');
|
|
216
|
+
live.bindNativeIdentity({
|
|
217
|
+
agentId: assignee.agent_id,
|
|
218
|
+
paneId,
|
|
219
|
+
surface: 'pi-sdk-tui',
|
|
220
|
+
configurationId: `sha256:${createHash('sha256').update(canonicalJson(binding.scope)).digest('hex')}`,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
bindIdentity(live);
|
|
224
|
+
await registerManagedPiRuntime(live, binding.scope, `${request.journalPath}.control.json`, {
|
|
225
|
+
confirmNative: !request.initialAssignment,
|
|
226
|
+
...(resumeAuthorization ? { resumeAuthorization } : {}),
|
|
227
|
+
});
|
|
228
|
+
live.bindResumeCheckpointScope(binding.scope);
|
|
229
|
+
live.recordInitialResumeCheckpoint();
|
|
230
|
+
receiver?.startWork();
|
|
231
|
+
if (ready)
|
|
232
|
+
startHandoff(live);
|
|
233
|
+
};
|
|
234
|
+
const openControl = (live) => serveManagedPiSdkControl(live, request.journalPath, request.controlSocketPath, () => ({
|
|
235
|
+
launch: {
|
|
236
|
+
runtime: 'sdk',
|
|
237
|
+
sdk_module_path: request.sdkModulePath,
|
|
238
|
+
bootstrap_extension_path: request.bootstrapExtensionPath ?? null,
|
|
239
|
+
bootstrap_task_root: bootstrap?.ok ? bootstrap.taskRoot : null,
|
|
240
|
+
bootstrap_config_digest: bootstrap?.ok ? bootstrap.digest : null,
|
|
241
|
+
initial_task_root: request.initialAssignment?.taskRoot ?? null,
|
|
242
|
+
initial_admission_digest: request.initialAssignment
|
|
243
|
+
? initialAdmissionDigest(request.initialAssignment)
|
|
244
|
+
: null,
|
|
245
|
+
herdr_agent_name: name ?? null,
|
|
246
|
+
herdr_pane_id: paneId,
|
|
247
|
+
journal_path: request.journalPath,
|
|
248
|
+
controller_run_id: control?.runId ?? null,
|
|
249
|
+
ready,
|
|
250
|
+
session_id: live.observe().native.sessionId,
|
|
251
|
+
cwd: live.observe().cwd,
|
|
252
|
+
model: {
|
|
253
|
+
provider: live.observe().native.modelObservation.provider,
|
|
254
|
+
id: live.observe().native.modelObservation.model,
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
readiness: readiness?.status() ?? null,
|
|
258
|
+
handoff: handoff
|
|
259
|
+
? (() => {
|
|
260
|
+
const status = handoff.status();
|
|
261
|
+
const result = status.result;
|
|
262
|
+
return {
|
|
263
|
+
error: status.error,
|
|
264
|
+
completion: status.completion,
|
|
265
|
+
result: result
|
|
266
|
+
? {
|
|
267
|
+
schema: result.schema,
|
|
268
|
+
status: result.status,
|
|
269
|
+
code: result.code,
|
|
270
|
+
transition: result.transition
|
|
271
|
+
? {
|
|
272
|
+
transition_id: result.transition.transition_id,
|
|
273
|
+
status: result.transition.status,
|
|
274
|
+
code: result.transition.code,
|
|
275
|
+
stage: result.transition.stage,
|
|
276
|
+
}
|
|
277
|
+
: null,
|
|
278
|
+
}
|
|
279
|
+
: null,
|
|
280
|
+
};
|
|
281
|
+
})()
|
|
282
|
+
: null,
|
|
283
|
+
retirement: retirement?.receipt ?? null,
|
|
284
|
+
execution_scope: scope,
|
|
285
|
+
resume: resumeAuthorization
|
|
286
|
+
? {
|
|
287
|
+
source_run_id: resumeAuthorization.sourceRunId,
|
|
288
|
+
source_pid: resumeAuthorization.sourcePid,
|
|
289
|
+
restored_session_id: resumeAuthorization.sessionId,
|
|
290
|
+
checkpoint_sequence: resumeAuthorization.checkpointSequence,
|
|
291
|
+
checkpoint_digest: resumeAuthorization.checkpointDigest,
|
|
292
|
+
task_authority_current: canExecuteManagedPiResume(resumeAuthorization, {
|
|
293
|
+
sessionId: live.observe().native.sessionId,
|
|
294
|
+
cwd: live.observe().cwd,
|
|
295
|
+
}),
|
|
296
|
+
}
|
|
297
|
+
: null,
|
|
298
|
+
bootstrap_admission: admission?.status() ?? null,
|
|
299
|
+
initial_admission: initialAdmission?.status() ?? null,
|
|
300
|
+
herdr_publication: publication?.status() ?? null,
|
|
301
|
+
receiver: receiver?.status() ?? null,
|
|
302
|
+
source_admission: {
|
|
303
|
+
ready: sourceAdmissionReady,
|
|
304
|
+
error: sourceAdmissionError,
|
|
305
|
+
},
|
|
306
|
+
}), async (incoming) => {
|
|
307
|
+
await initialAdmission?.refresh();
|
|
308
|
+
const taskRoot = scope?.task_root ?? (bootstrap?.ok ? bootstrap.taskRoot : null);
|
|
309
|
+
const agentId = bootstrap?.ok
|
|
310
|
+
? bootstrap.config.guard.successor.agentId
|
|
311
|
+
: (automatic?.transition.intent.from.agent_id ??
|
|
312
|
+
live.observe().native.agentId);
|
|
313
|
+
if (!ready || !taskRoot || !agentId)
|
|
314
|
+
return { ok: false, reason: 'delivery_not_bound' };
|
|
315
|
+
return deliverManagedPiMessage(live, incoming, { taskRoot, agentId });
|
|
316
|
+
});
|
|
317
|
+
let signalFailed = false;
|
|
318
|
+
let resolveSignal;
|
|
319
|
+
const signalled = new Promise((resolve) => {
|
|
320
|
+
resolveSignal = resolve;
|
|
321
|
+
});
|
|
322
|
+
const onSignal = () => {
|
|
323
|
+
void controller?.stopOwnedRuntime().then(resolveSignal, () => {
|
|
324
|
+
signalFailed = true;
|
|
325
|
+
resolveSignal();
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
try {
|
|
329
|
+
const identity = bootstrap?.ok
|
|
330
|
+
? {
|
|
331
|
+
agentId: bootstrap.config.guard.successor.agentId,
|
|
332
|
+
paneId,
|
|
333
|
+
surface: 'pi-sdk-tui',
|
|
334
|
+
configurationId: bootstrap.digest,
|
|
335
|
+
}
|
|
336
|
+
: automatic
|
|
337
|
+
? {
|
|
338
|
+
agentId: automatic.transition.intent.from.agent_id,
|
|
339
|
+
paneId,
|
|
340
|
+
surface: 'pi-sdk-tui',
|
|
341
|
+
configurationId: automatic.id,
|
|
342
|
+
}
|
|
343
|
+
: undefined;
|
|
344
|
+
controller = await startManagedPiSdkSession({
|
|
345
|
+
cwd: request.cwd,
|
|
346
|
+
model: request.model,
|
|
347
|
+
journalPath: request.journalPath,
|
|
348
|
+
sdkModulePath: request.sdkModulePath,
|
|
349
|
+
...(request.sessionId ? { sessionId: request.sessionId } : {}),
|
|
350
|
+
...(request.executionScope
|
|
351
|
+
? { executionScope: request.executionScope }
|
|
352
|
+
: {}),
|
|
353
|
+
...(resumeAuthorization ? { resumeAuthorization } : {}),
|
|
354
|
+
...(request.thinkingLevel
|
|
355
|
+
? { thinkingLevel: request.thinkingLevel }
|
|
356
|
+
: {}),
|
|
357
|
+
...(request.bootstrapExtensionPath
|
|
358
|
+
? { bootstrapExtensionPath: request.bootstrapExtensionPath }
|
|
359
|
+
: {}),
|
|
360
|
+
...(identity ? { nativeIdentity: identity } : {}),
|
|
361
|
+
...(resumeAuthorization || request.initialAssignment
|
|
362
|
+
? {
|
|
363
|
+
canExecute: () => (!resumeAuthorization ||
|
|
364
|
+
(admissionController !== undefined &&
|
|
365
|
+
canExecuteManagedPiResume(resumeAuthorization, {
|
|
366
|
+
sessionId: admissionController.observe().native.sessionId,
|
|
367
|
+
cwd: admissionController.observe().cwd,
|
|
368
|
+
}))) &&
|
|
369
|
+
(!request.initialAssignment ||
|
|
370
|
+
initialAdmission?.canExecute() === true),
|
|
371
|
+
}
|
|
372
|
+
: {}),
|
|
373
|
+
beforeInteractiveStart: async (live) => {
|
|
374
|
+
admissionController = live;
|
|
375
|
+
bindIdentity(live);
|
|
376
|
+
if (bootstrap?.ok) {
|
|
377
|
+
const current = readPiBootstrapConfig(path.join(path.dirname(request.bootstrapExtensionPath), 'bootstrap.json'));
|
|
378
|
+
if (!current.ok || current.digest !== bootstrap.digest)
|
|
379
|
+
throw new Error('bootstrap_config_changed_during_start');
|
|
380
|
+
}
|
|
381
|
+
control = await openControl(live);
|
|
382
|
+
if (request.initialAssignment) {
|
|
383
|
+
await registerManagedPiInitialLaunch(live, request.initialAssignment, `${request.journalPath}.control.json`);
|
|
384
|
+
initialAdmission = await watchManagedPiInitialAdmission(live, request.initialAssignment, (binding) => activate(live, binding));
|
|
385
|
+
}
|
|
386
|
+
if (immediateScope)
|
|
387
|
+
await activate(live, await bindManagedPiExecutionScope({
|
|
388
|
+
controller: live,
|
|
389
|
+
scope: immediateScope,
|
|
390
|
+
}));
|
|
391
|
+
},
|
|
392
|
+
});
|
|
393
|
+
if (request.initialAssignment) {
|
|
394
|
+
const live = controller;
|
|
395
|
+
unbindInitialLifecycle = live.subscribe((event) => {
|
|
396
|
+
if (scope &&
|
|
397
|
+
typeof event === 'object' &&
|
|
398
|
+
event !== null &&
|
|
399
|
+
'type' in event &&
|
|
400
|
+
event.type === 'agent_start') {
|
|
401
|
+
void registerManagedPiRuntime(live, scope, `${request.journalPath}.control.json`).catch(() => {
|
|
402
|
+
live.fenceIngress('initial_native_execution_binding_failed');
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
if (paneId && process.env.HERDR_ENV === '1') {
|
|
408
|
+
try {
|
|
409
|
+
publication = await publishManagedPiHerdrIdentity(controller, {
|
|
410
|
+
paneId,
|
|
411
|
+
...(name ? { name } : {}),
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
if (name)
|
|
416
|
+
throw error;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
else if (name)
|
|
420
|
+
throw new Error('managed_herdr_context_required');
|
|
421
|
+
ready = true;
|
|
422
|
+
controller.recordInitialResumeCheckpoint();
|
|
423
|
+
if (sourceReadiness)
|
|
424
|
+
readiness = watchManagedPiReadiness(sourceReadiness, {
|
|
425
|
+
sessionId: controller.observe().native.sessionId,
|
|
426
|
+
cwd: request.cwd,
|
|
427
|
+
metadataFile: `${request.journalPath}.pi-events.jsonl`,
|
|
428
|
+
}, undefined, {
|
|
429
|
+
beforeRefresh: async () => {
|
|
430
|
+
bindIdentity(controller);
|
|
431
|
+
controller.publishResourcesReady();
|
|
432
|
+
},
|
|
433
|
+
});
|
|
434
|
+
if (bootstrap?.ok && request.handoffContextFile)
|
|
435
|
+
receiver = await prepareManagedPiHandoffReceiver(controller, bootstrap.config, request.handoffContextFile, request.journalPath);
|
|
436
|
+
if (bootstrap?.ok)
|
|
437
|
+
admission = await watchManagedPiBootstrapAdmission(controller, bootstrap.config, (binding) => activate(controller, binding));
|
|
438
|
+
startHandoff(controller);
|
|
439
|
+
if (automatic && receiver) {
|
|
440
|
+
retirementWatch = setInterval(() => {
|
|
441
|
+
startHandoff(controller);
|
|
442
|
+
if (handoff && retirementWatch) {
|
|
443
|
+
clearInterval(retirementWatch);
|
|
444
|
+
retirementWatch = null;
|
|
445
|
+
}
|
|
446
|
+
}, 1000);
|
|
447
|
+
retirementWatch.unref();
|
|
448
|
+
}
|
|
449
|
+
process.once('SIGINT', onSignal);
|
|
450
|
+
process.once('SIGTERM', onSignal);
|
|
451
|
+
process.once('SIGHUP', onSignal);
|
|
452
|
+
await Promise.race([
|
|
453
|
+
controller.runPromise,
|
|
454
|
+
control.stopped,
|
|
455
|
+
signalled,
|
|
456
|
+
...(automatic ? [handoffCompleted] : []),
|
|
457
|
+
]);
|
|
458
|
+
return signalFailed ? 1 : 0;
|
|
459
|
+
}
|
|
460
|
+
finally {
|
|
461
|
+
try {
|
|
462
|
+
ready = false;
|
|
463
|
+
process.off('SIGINT', onSignal);
|
|
464
|
+
process.off('SIGTERM', onSignal);
|
|
465
|
+
process.off('SIGHUP', onSignal);
|
|
466
|
+
if (retirementWatch)
|
|
467
|
+
clearInterval(retirementWatch);
|
|
468
|
+
await readiness?.close();
|
|
469
|
+
unbindInitialLifecycle?.();
|
|
470
|
+
handoff?.close();
|
|
471
|
+
await admission?.close();
|
|
472
|
+
await initialAdmission?.close();
|
|
473
|
+
receiver?.close();
|
|
474
|
+
await publication?.close();
|
|
475
|
+
control?.close();
|
|
476
|
+
await controller?.stopOwnedRuntime().catch(() => { });
|
|
477
|
+
}
|
|
478
|
+
finally {
|
|
479
|
+
if (resumeAuthorization)
|
|
480
|
+
releaseManagedPiResume(resumeAuthorization);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Assignment } from '../collab/contracts.js';
|
|
2
|
+
import type { Attempt, Identity, TaskRecord } from '../collab/types.js';
|
|
3
|
+
import { ManagedPiSdkSessionController } from '../hosts/pi/managed-sdk-session.js';
|
|
4
|
+
import type { ManagedPiExecutionScope } from './collab-session-transition.js';
|
|
5
|
+
import type { ManagedPiReadinessConfig } from './managed-pi-readiness.js';
|
|
6
|
+
/** Original ASSIGN pins stay immutable. A completed succession permits a bounded current-source view. */
|
|
7
|
+
export declare function readManagedSourceAssignment(record: TaskRecord, attempt: Attempt, actor?: Identity): {
|
|
8
|
+
assignment: Assignment;
|
|
9
|
+
digest: string;
|
|
10
|
+
file: string;
|
|
11
|
+
originalDigest: string;
|
|
12
|
+
};
|
|
13
|
+
/** Called only inside the successor's owned SDK process after its real first work. */
|
|
14
|
+
export declare function admitManagedSourceAssignment(controller: ManagedPiSdkSessionController, scope: ManagedPiExecutionScope, readiness: ManagedPiReadinessConfig): Promise<void>;
|