@phyzess/pappra 0.1.0-beta.14 → 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 +133 -14
- 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 +104 -3
- 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,360 @@
|
|
|
1
|
+
# Visible collaboration workflow
|
|
2
|
+
|
|
3
|
+
Choose the collaboration channel before preparing a task, and keep the two
|
|
4
|
+
environment choices distinct from the work itself: a channel decides where a
|
|
5
|
+
participant runs and how messages reach it. It never grants permissions,
|
|
6
|
+
capabilities, ownership, or task success. Existing guidance starts after
|
|
7
|
+
participants exist; this reference covers the entry path from a new authorized
|
|
8
|
+
request to a bound, ready receiving instance.
|
|
9
|
+
|
|
10
|
+
## 1. Detect the environment, not the installed tools
|
|
11
|
+
|
|
12
|
+
Inspect only the non-sensitive Herdr markers and caller IDs, for example:
|
|
13
|
+
|
|
14
|
+
```nu
|
|
15
|
+
$env.HERDR_ENV? == '1'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- **False or absent** — use **direct mode**: keep the current session as
|
|
19
|
+
coordinator and use the host's own supported tools. Do not query a Herdr
|
|
20
|
+
server, inspect its focus, split panes, or open a terminal merely because a
|
|
21
|
+
`herdr` binary is installed. A binary, an open window, or an old pane ID in a
|
|
22
|
+
task record proves no caller affiliation. Do not print the process
|
|
23
|
+
environment.
|
|
24
|
+
- **True** — you are inside a Herdr caller. Read that installation's own
|
|
25
|
+
`herdr --skill` and the relevant `--help` before acting (pane ids and flags
|
|
26
|
+
are version-sensitive), then resolve the current caller, for example
|
|
27
|
+
`herdr pane current --current`. If the claim cannot be resolved
|
|
28
|
+
unambiguously, record **herdr unavailable** with the reason and fall back to
|
|
29
|
+
direct mode only when the user's instructions allow it.
|
|
30
|
+
- The UI-focused pane is never a fallback. Do not spoof `HERDR_*` values.
|
|
31
|
+
- If the task requires visible delivery and it is unavailable, report the
|
|
32
|
+
blocker. Do not start a hidden duplicate of the required participant.
|
|
33
|
+
|
|
34
|
+
A failed inherited `pane current --current` lookup is not enough to conclude
|
|
35
|
+
that native collaboration is unavailable. For a moved pane or a persistent
|
|
36
|
+
app-server with stale inherited context, inspect the current task's known
|
|
37
|
+
caller binding and the named live agent metadata. An unambiguous task-bound
|
|
38
|
+
caller can use `pane current --pane <id>` and Pappra's `--caller-pane` route.
|
|
39
|
+
Compare the actual harness, cwd and reported session where available; never
|
|
40
|
+
choose a pane merely because it is focused. If identity remains ambiguous,
|
|
41
|
+
report that exact gap and do not dispatch. Route evidence is not process proof.
|
|
42
|
+
|
|
43
|
+
`pappra collab message notify` supports two caller routes. The default requires
|
|
44
|
+
the inherited Herdr context; `--caller-pane <id>` names the sender pane
|
|
45
|
+
explicitly for hosted or stale inherited contexts. Either way the pane is
|
|
46
|
+
routing evidence, not process authentication, and recorded delivery evidence
|
|
47
|
+
stays `process_affiliation: "not-established"`.
|
|
48
|
+
|
|
49
|
+
## 2. Decide participants and bootstrap the receiving instance
|
|
50
|
+
|
|
51
|
+
Pick participants, roles, harness, and configuration from the task rather than a
|
|
52
|
+
fixed agent count. Everyone can implement, review, or verify; assign by need.
|
|
53
|
+
|
|
54
|
+
Reuse an existing peer only when all of the following match what the task will
|
|
55
|
+
bind: current agent name, pane, harness, cwd, native session (where the host
|
|
56
|
+
reports one), and the capabilities the assignment will require. Otherwise, when
|
|
57
|
+
a new visible participant is authorized, create a **sibling** shell pane with
|
|
58
|
+
the task's cwd and the installed layout/`--no-focus` options you verified above,
|
|
59
|
+
start the intended interactive agent there, and keep the user's focus unchanged.
|
|
60
|
+
Do not add worktrees, workspaces, or tabs just to get a pane, and never take over
|
|
61
|
+
an arbitrary idle pane.
|
|
62
|
+
|
|
63
|
+
### One-time bounded discovery contact
|
|
64
|
+
|
|
65
|
+
A newly started interactive instance has not told you its identity yet. Before
|
|
66
|
+
any task preparation that depends on it, make exactly **one** bounded,
|
|
67
|
+
read-only discovery contact through the installed visible tool (for example the
|
|
68
|
+
installed `herdr agent prompt` command; confirm its syntax from
|
|
69
|
+
`herdr --help`/`--skill`). Ask only for:
|
|
70
|
+
|
|
71
|
+
- the agent/host name and harness actually running;
|
|
72
|
+
- the exact native session identity the host accepts (or an explicit "unknown"
|
|
73
|
+
when the host cannot report one);
|
|
74
|
+
- the actual cwd and configuration/model in use;
|
|
75
|
+
- where the instance can leave a bounded native evidence file (for example a Pi
|
|
76
|
+
session JSONL path) if that evidence route exists.
|
|
77
|
+
|
|
78
|
+
State explicitly in that contact that it is a read-only identity handshake: do
|
|
79
|
+
not start implementation, do not answer approvals, do not change settings, and
|
|
80
|
+
reply with the identity packet only. This contact is **bootstrap**, not a
|
|
81
|
+
product notification and not an ASSIGN. It must be clearly separate from normal
|
|
82
|
+
`COLLAB_MESSAGE` delivery, which needs a binding that does not exist yet.
|
|
83
|
+
|
|
84
|
+
If that first contact route is unavailable (direct mode without a visible
|
|
85
|
+
channel, missing host capability, refused prompt), report the concrete blocker.
|
|
86
|
+
Do not fabricate a runtime card, assume a session identity, or launch an owned
|
|
87
|
+
child as a stand-in for the visible participant.
|
|
88
|
+
|
|
89
|
+
Starting and contacting the interactive instance is not a readiness check and
|
|
90
|
+
not permission to dispatch source work. Do not send an implementation prompt at
|
|
91
|
+
this point, and do not substitute the isolated pilot launcher or bypass host
|
|
92
|
+
approvals. Preserve the daily native model, tools, MCP, hooks, and permission
|
|
93
|
+
settings.
|
|
94
|
+
|
|
95
|
+
## 3. Bind routing metadata
|
|
96
|
+
|
|
97
|
+
Record the observed routing identity in the existing task-local binding
|
|
98
|
+
`pappra/collab-binding/1`. Use the discovered values; use JSON `null` (not a
|
|
99
|
+
quoted string) only when the host genuinely cannot report a native session. A
|
|
100
|
+
null/unknown worker session can be recorded for routing, but it cannot be bound
|
|
101
|
+
to an admitted work assignment: the goal schema requires an exact assignee
|
|
102
|
+
session, so report the identity blocker instead of preparing work for an
|
|
103
|
+
unknown instance.
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"schema": "pappra/collab-binding/1",
|
|
108
|
+
"task_id": "<task-id>",
|
|
109
|
+
"task_root": "/absolute/domain/tasks/<task-id>",
|
|
110
|
+
"channel": "herdr",
|
|
111
|
+
"participants": [
|
|
112
|
+
{
|
|
113
|
+
"agent_id": "<coordinator-agent>",
|
|
114
|
+
"harness": "<codex|pi|claude>",
|
|
115
|
+
"cwd": "/absolute/coordinator/cwd",
|
|
116
|
+
"herdr_agent": "<named-coordinator-agent>",
|
|
117
|
+
"pane_id": "<wN:pN>",
|
|
118
|
+
"native_session_id": "<exact-coordinator-session>"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"agent_id": "<worker-agent>",
|
|
122
|
+
"harness": "<codex|pi|claude>",
|
|
123
|
+
"cwd": "/absolute/receiving/cwd",
|
|
124
|
+
"herdr_agent": "<named-worker-agent>",
|
|
125
|
+
"pane_id": "<wN:pN>",
|
|
126
|
+
"native_session_id": "<exact-worker-session-or-null>"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Placeholders such as `<task-id>` and `<exact-worker-session>` are literal
|
|
133
|
+
substitution points, not values. A pane ID is not a native session ID, and this
|
|
134
|
+
binding is routing metadata, not a second ownership store and not proof that a
|
|
135
|
+
native session exists. Revalidate it before later sends, resume, or handoff.
|
|
136
|
+
|
|
137
|
+
## 4. Prepare the task and admit the new assignment
|
|
138
|
+
|
|
139
|
+
`pappra collab prepare` is **not** a preview command: it has no plan/apply mode.
|
|
140
|
+
With explicit operator/agent authorization it writes the private task record and
|
|
141
|
+
prepared files, claims the listed resources, and registers the initial
|
|
142
|
+
`ASSIGN`. Do not run it expecting a dry run, and do not treat the message-level
|
|
143
|
+
`send`/`notify` plan behavior as applying to preparation. Resource, message,
|
|
144
|
+
binding, handoff, and recovery commands are the ones with plan/apply modes; see
|
|
145
|
+
`references/collaboration.md`.
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
# Mutates task/prepared state and claims. Requires explicit authorization.
|
|
149
|
+
pappra collab prepare \
|
|
150
|
+
--goal /abs/example/goal.json \
|
|
151
|
+
--domain-root /abs/example/domain
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Preparation creates no declared capability template or card. If you need a
|
|
155
|
+
derivation template, write one yourself from the assignment's expected
|
|
156
|
+
capabilities and mark it clearly as declared, for example:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"schema": "harness-collab/capabilities/1",
|
|
161
|
+
"agent_id": "<worker-agent>",
|
|
162
|
+
"session_id": "<exact-worker-session-or-null>",
|
|
163
|
+
"harness": "<pi|codex|claude>",
|
|
164
|
+
"surface": "cli",
|
|
165
|
+
"configuration_id": "<observed-configuration>",
|
|
166
|
+
"cwd": "/absolute/receiving/cwd",
|
|
167
|
+
"observed_at": "<ISO time from actual evidence>",
|
|
168
|
+
"evidence_level": "declared",
|
|
169
|
+
"skills": [],
|
|
170
|
+
"tools": [{ "id": "<expected-tool>", "state": "declared" }]
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
A declared template is not evidence and cannot authorize a launch. Derive a
|
|
175
|
+
runtime card from evidence the receiving instance actually produced (native
|
|
176
|
+
session/events), and save only the returned `card`; derivation prints a result
|
|
177
|
+
wrapper and writes nothing:
|
|
178
|
+
|
|
179
|
+
```nu
|
|
180
|
+
# Literal example values: substitute the real harness and absolute paths.
|
|
181
|
+
let harness = "pi"
|
|
182
|
+
let assignment = "/abs/example/assignment.json"
|
|
183
|
+
let template = "/abs/example/card.declared.json"
|
|
184
|
+
let execution = "/abs/example/execution.json"
|
|
185
|
+
let session = "/abs/example/pi-session.jsonl"
|
|
186
|
+
let deriveArgs = [
|
|
187
|
+
'collab' 'capabilities' 'derive'
|
|
188
|
+
'--harness' $harness
|
|
189
|
+
'--assignment' $assignment
|
|
190
|
+
'--template' $template
|
|
191
|
+
'--execution' $execution
|
|
192
|
+
'--session' $session
|
|
193
|
+
'--json'
|
|
194
|
+
]
|
|
195
|
+
let derived = (^pappra ...$deriveArgs | from json)
|
|
196
|
+
if $derived.status != 'derived' { error make {msg: $"derive refused: ($derived.status)"} }
|
|
197
|
+
$derived.card | to json | save --raw /abs/example/card.runtime.json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
For Codex or Claude replace the session flag with the events flag accepted by
|
|
201
|
+
the installed command (`pappra collab capabilities derive --help`), and set
|
|
202
|
+
`--harness` to the participant's actual harness. `save --raw` refuses to
|
|
203
|
+
overwrite, so use a new path. Observation time and
|
|
204
|
+
freshness come from the native evidence; replaying old artifacts does not
|
|
205
|
+
refresh them. If the evidence route does not exist, record the blocker instead
|
|
206
|
+
of inventing a card, then check reported readiness:
|
|
207
|
+
|
|
208
|
+
```sh
|
|
209
|
+
pappra collab preflight \
|
|
210
|
+
--assignment /abs/example/assignment.json \
|
|
211
|
+
--capabilities /abs/example/card.runtime.json --json
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Ready is not authorization, locking, or dispatch. A declared, stale,
|
|
215
|
+
mismatched, or missing-evidence card stays refused; fix the evidence or report
|
|
216
|
+
the gap.
|
|
217
|
+
|
|
218
|
+
## 5. Dispatch once and return a correlated result
|
|
219
|
+
|
|
220
|
+
Preparation already persisted the initial `ASSIGN`. Do not send a second ASSIGN
|
|
221
|
+
for the same attempt. Locate the exact registered message by its own fields
|
|
222
|
+
(current `task_id`, `subtask_id`, `attempt`, `owner_epoch`, recipient, and input
|
|
223
|
+
revision) and read it back through the product:
|
|
224
|
+
|
|
225
|
+
```nu
|
|
226
|
+
# Literal example paths: replace them with the actual prepared file and values.
|
|
227
|
+
let prepared = (open /abs/example-domain/tasks/example-task/p10/prepared.json)
|
|
228
|
+
let record = (open ($prepared.task_root + "/task.json"))
|
|
229
|
+
let assignEntries = ($record.messages | where { |m| $m.type == "ASSIGN" and $m.subtask_id == $prepared.subtask_id and $m.attempt == $prepared.attempt and $m.to.agent_id == "worker-agent" and $m.to.session_id == "worker-session" })
|
|
230
|
+
if ($assignEntries | length) != 1 { error make {msg: "expected exactly one prepared ASSIGN for this attempt"} }
|
|
231
|
+
let registered = (pappra collab message read --task-root $prepared.task_root --message-id $assignEntries.0.message_id --json | from json)
|
|
232
|
+
if $registered.message.body.input_revision != $prepared.prompt_digest { error make {msg: "prepared ASSIGN input mismatch"} }
|
|
233
|
+
if $registered.message.body.assignment_digest != $prepared.assignment_digest { error make {msg: "prepared ASSIGN digest mismatch"} }
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
`message read` returns the full envelope and its recorded/applied state. Send
|
|
237
|
+
additional `message send --apply` envelopes only for a genuinely new bounded
|
|
238
|
+
assignment (for example a later attempt) or a message that is not already
|
|
239
|
+
persisted. Then send exactly one pointer-only notification for that registered
|
|
240
|
+
message:
|
|
241
|
+
|
|
242
|
+
```sh
|
|
243
|
+
# Literal example values: substitute the real task root, message id, binding and pane.
|
|
244
|
+
pappra collab message notify --task-root /abs/example/domain/tasks/example-task \
|
|
245
|
+
--message-id msg-example-assign \
|
|
246
|
+
--binding /abs/example/binding.json --caller-pane w9:p1 --apply
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Never loop notifications, never use `--wait`, and never treat `submitted` as
|
|
250
|
+
consumption or acceptance.
|
|
251
|
+
|
|
252
|
+
The receiving instance verifies the pointer digest and **its own** exact
|
|
253
|
+
identity before working: its `to.agent_id`/`to.session_id` must match the
|
|
254
|
+
envelope, and the task/subtask/attempt/owner epoch/input revision must match its
|
|
255
|
+
prepared state. It then records a correlated `ACK` (one envelope, registered
|
|
256
|
+
with `--apply`), does admitted work, and persists one `REPORT`, `BLOCK`, or
|
|
257
|
+
`STATUS` followed by one product notification to the coordinator.
|
|
258
|
+
|
|
259
|
+
Minimal correlated envelopes (placeholders are substitution points; keep
|
|
260
|
+
`content_digest: null` — registration records the real digest):
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"schema": "harness-collab/message/1",
|
|
265
|
+
"message_id": "msg-<unique>-ack",
|
|
266
|
+
"type": "ACK",
|
|
267
|
+
"task_id": "<task-id>",
|
|
268
|
+
"from": {
|
|
269
|
+
"agent_id": "<worker-agent>",
|
|
270
|
+
"session_id": "<exact-worker-session>",
|
|
271
|
+
"harness": "<harness>"
|
|
272
|
+
},
|
|
273
|
+
"to": {
|
|
274
|
+
"agent_id": "<coordinator-agent>",
|
|
275
|
+
"session_id": "<exact-coordinator-session>",
|
|
276
|
+
"harness": "<harness>"
|
|
277
|
+
},
|
|
278
|
+
"reply_to": "<assign-message-id>",
|
|
279
|
+
"subtask_id": "<subtask-id>",
|
|
280
|
+
"attempt": 1,
|
|
281
|
+
"owner_epoch": 1,
|
|
282
|
+
"created_at": "<ISO-8601>",
|
|
283
|
+
"content_digest": null,
|
|
284
|
+
"body": {}
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
```json
|
|
289
|
+
{
|
|
290
|
+
"schema": "harness-collab/message/1",
|
|
291
|
+
"message_id": "msg-<unique>-report",
|
|
292
|
+
"type": "REPORT",
|
|
293
|
+
"task_id": "<task-id>",
|
|
294
|
+
"from": {
|
|
295
|
+
"agent_id": "<worker-agent>",
|
|
296
|
+
"session_id": "<exact-worker-session>",
|
|
297
|
+
"harness": "<harness>"
|
|
298
|
+
},
|
|
299
|
+
"to": {
|
|
300
|
+
"agent_id": "<coordinator-agent>",
|
|
301
|
+
"session_id": "<exact-coordinator-session>",
|
|
302
|
+
"harness": "<harness>"
|
|
303
|
+
},
|
|
304
|
+
"reply_to": "<assign-message-id>",
|
|
305
|
+
"subtask_id": "<subtask-id>",
|
|
306
|
+
"attempt": 1,
|
|
307
|
+
"owner_epoch": 1,
|
|
308
|
+
"created_at": "<ISO-8601>",
|
|
309
|
+
"content_digest": null,
|
|
310
|
+
"body": {
|
|
311
|
+
"status": "completed",
|
|
312
|
+
"outputs": [],
|
|
313
|
+
"native_ref": null,
|
|
314
|
+
"evidence_ref": "/absolute/evidence/report.json"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
The worker registers each envelope (`message send --apply`) and reads it back.
|
|
320
|
+
Registration may report `accepted`, `duplicate`, or a classification such as
|
|
321
|
+
`rejected`; check the actual status rather than assuming acceptance, and do not
|
|
322
|
+
resend a rejected REPORT with a new id unless the underlying evidence changed.
|
|
323
|
+
The worker then notifies the coordinator once with the same task-local binding
|
|
324
|
+
and its own `--caller-pane` where needed. The coordinator verifies the
|
|
325
|
+
artifacts, the exact correlation and the pinned input before deciding business
|
|
326
|
+
acceptance; protocol application and acceptance remain separate facts.
|
|
327
|
+
|
|
328
|
+
The owned `pappra collab run --controller pi-rpc` path remains a separate,
|
|
329
|
+
explicit option for an owned Pi RPC child with its own admission and evidence
|
|
330
|
+
limits. Do not present it as the default collaboration channel, and do not use
|
|
331
|
+
it to imitate a visible participant.
|
|
332
|
+
|
|
333
|
+
## 6. Yield, then verify
|
|
334
|
+
|
|
335
|
+
After sending the notification, yield. Independent work continues in the
|
|
336
|
+
receiving session; do not poll panes, status endpoints, or logs, do not install
|
|
337
|
+
completion timers, and do not re-wake yourself. An idle or finished pane is not
|
|
338
|
+
a result, a stopped process, or acceptance.
|
|
339
|
+
|
|
340
|
+
When the coordinator's next turn arrives, verify the reported artifacts and
|
|
341
|
+
inputs yourself. If a delivery or execution outcome is uncertain, inspect the
|
|
342
|
+
original evidence through the existing recovery surface
|
|
343
|
+
(`pappra collab recovery inspect`) before any explicit retry or handoff. A
|
|
344
|
+
fresh history client cannot adopt native control of an unknown execution, and
|
|
345
|
+
claimed resources stay held until the protocol permits release.
|
|
346
|
+
|
|
347
|
+
## Known limits
|
|
348
|
+
|
|
349
|
+
- `notify` does not create, start, or discover a participant. Bootstrap contact
|
|
350
|
+
remains a one-time, read-only operator/agent action inside the authorized
|
|
351
|
+
visible environment, separate from product notifications.
|
|
352
|
+
- A pane is a visibility aid: it is not authentication, native identity, or
|
|
353
|
+
stop proof. Live ownership of an existing native session cannot be rebuilt
|
|
354
|
+
from stored pointers.
|
|
355
|
+
- Herdr command shapes change between versions. Treat the examples here as
|
|
356
|
+
product-side routing patterns and confirm the actual flags with the installed
|
|
357
|
+
`herdr --help`/`--skill` at use time.
|
|
358
|
+
- Without a working visible channel, persisted messaging and the owned Pi RPC
|
|
359
|
+
run may still be available, but they do not satisfy a visible-delivery
|
|
360
|
+
requirement.
|
|
@@ -9,6 +9,26 @@ entry imports `./runtime.mjs` next to it, so the package survives a moved
|
|
|
9
9
|
checkout. Pi 1.3.0 was verified in a real session through the packaged extension
|
|
10
10
|
(`pi install <dir> -l -a` + `pi -p -a`).
|
|
11
11
|
|
|
12
|
+
`pappra host bundle --host pi --bootstrap-config <abs-file>` is the opt-in successor
|
|
13
|
+
variant: the destination must be new, the private config binds one canonical task root
|
|
14
|
+
and guard pin, and the generated entry installs a default-deny tool gate before any
|
|
15
|
+
config/reader/lifecycle work. Its read-only `bootstrap-status` reports registration,
|
|
16
|
+
never write permission; export does not install, trust, load or transfer.
|
|
17
|
+
|
|
18
|
+
The bootstrap export relies on a trusted local parent directory with no concurrent
|
|
19
|
+
namespace mutation. It exclusively claims a new destination (existing empty, populated,
|
|
20
|
+
file or symlink targets are left untouched), assembles the payload in a private staging
|
|
21
|
+
directory with identity checks, and on a failure before publication removes only the empty
|
|
22
|
+
claim and stage it created. This is not an OS filesystem fence: portable Node has no
|
|
23
|
+
anchored directory writes or no-replace directory rename, so a same-user process changing
|
|
24
|
+
a path between a check and its use can redirect a write or affect publication/cleanup. The
|
|
25
|
+
private binding is written last, which reduces but does not prevent that check/use race.
|
|
26
|
+
|
|
27
|
+
Publication is a rename followed by a final inode check, not a transaction: a failure
|
|
28
|
+
during or after publication can return an error after the output directory is visible. A
|
|
29
|
+
non-zero export exit is not proof that no files exist; inspect the destination, never
|
|
30
|
+
blindly delete it, and do not install or trust the output from a failed export.
|
|
31
|
+
|
|
12
32
|
## Codex
|
|
13
33
|
|
|
14
34
|
Codex 0.163.0 loads command hooks only from its user configuration directory.
|
|
@@ -5,10 +5,32 @@
|
|
|
5
5
|
to the person.
|
|
6
6
|
- `pappra init` plans or applies workspace configuration. `--yes` derives
|
|
7
7
|
selections from discovery, `--print-choices` prints that document without
|
|
8
|
-
writing, `--
|
|
9
|
-
`--
|
|
8
|
+
writing, `--config` reads a `pappra/init-choices/1` document, and
|
|
9
|
+
`--reconfigure` is the explicit opt-in that rewrites an existing valid
|
|
10
|
+
`workspace.json` from the current selections while keeping its identity,
|
|
11
|
+
extensions, continuity, custom validation bindings and local machine
|
|
12
|
+
settings. Without `--reconfigure` an existing valid configuration is reused
|
|
13
|
+
and only missing local state is requested. With that existing workspace,
|
|
14
|
+
`--yes --reconfigure` keeps the current represented choices instead of
|
|
15
|
+
deriving new ones and `--print-choices --reconfigure` prints them.
|
|
16
|
+
A plain `--apply` verifies/reuses a runtime for the workspace target or
|
|
17
|
+
installs the current package and binds it. `--no-runtime` suppresses runtime
|
|
18
|
+
verification, installation and binding: when an action is still required the
|
|
19
|
+
result is `status:"external-actions-pending"` with exit 0 for configuration-only work, while an
|
|
20
|
+
already bound matching runtime with no file changes yields apply status
|
|
21
|
+
`no-changes` and exit 0 with `initComplete:false`.
|
|
22
|
+
A TTY wizard opens only when selections are needed; `--config` without
|
|
23
|
+
`--apply` stays preview-only, an empty plan asks nothing, and the single
|
|
24
|
+
apply confirmation belongs to the interactive no-`--apply` flow that plans
|
|
25
|
+
configuration writes. `--apply` itself never prompts.
|
|
26
|
+
`knowledge.sources` are existing documents registered later by
|
|
27
|
+
`docs scan --apply`, while `knowledge.newDocuments` is only the destination
|
|
28
|
+
for future authored documents and is not created by init.
|
|
10
29
|
- `pappra runtime <install|status|verify|remove>` manages the durable runtime
|
|
11
30
|
copy. `install --apply` defaults to `--from self`; writes require `--apply`.
|
|
31
|
+
- `pappra repair` previews interrupted install journals; `--apply` explicitly recovers
|
|
32
|
+
proven workspace effects or a selected `--runtime-version`. Live/unknown owners and
|
|
33
|
+
changed files remain protected.
|
|
12
34
|
- `pappra doctor` is passive: it does not install hooks, start hosts, or fix
|
|
13
35
|
state. `runtime verify` is the active runtime check.
|
|
14
36
|
- `pappra checkpoint` writes a task checkpoint; `pappra resume` reads a stored
|
|
@@ -23,9 +45,18 @@
|
|
|
23
45
|
directory without registering it, and `install --mode plugin` fails closed.
|
|
24
46
|
- `pappra mcp` starts the stdio MCP server; `pappra host mcp install --host <name> --apply`
|
|
25
47
|
registers it. `pappra task pin <id> --auto-resume` controls hook resume injection.
|
|
26
|
-
- `pappra collab
|
|
27
|
-
`
|
|
28
|
-
|
|
48
|
+
- `pappra collab prepare --goal <file> --domain-root <dir>` and MCP
|
|
49
|
+
`collab_prepare` share the strict explicit goal; MCP accepts only
|
|
50
|
+
`{domainRoot, goal}`, not the retired flat objective fields, and synthesizes no card.
|
|
51
|
+
Preparation maps `pi`/`codex`/`claude` to `pi-cli`/`codex-exec`/`claude-cli`;
|
|
52
|
+
real controllers remain `fixture|pi-rpc` with `pi-rpc` only for Pi. `collab_start`
|
|
53
|
+
returns `cli_required` and never launches, even with `confirm:true`. The user must
|
|
54
|
+
launch through the CLI with runtime evidence. MCP `runtime_install` only copies the
|
|
55
|
+
running package; tarball and registry sources require the CLI.
|
|
56
|
+
- `pappra collab message <send|list|read|notify> --task-root <dir>` persists
|
|
57
|
+
protocol messages, reads them back, and sends one explicit pointer-only Herdr
|
|
58
|
+
notification. `send` and `notify` are plan-only without `--apply`; notification
|
|
59
|
+
is not consumption or acceptance. See `references/collaboration.md`.
|
|
29
60
|
|
|
30
61
|
Preserve user bytes. If an operation reports a conflict or residual path,
|
|
31
62
|
inspect that path and resolve ownership before retrying. Never delete an
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { HostName } from '../schemas/host.js';
|
|
2
|
-
import type { Diagnostic } from '../schemas/diagnostics.js';
|
|
3
|
-
import { type PreparedBundle } from './collaboration.js';
|
|
4
|
-
export interface CollabResource {
|
|
5
|
-
readonly path: string;
|
|
6
|
-
readonly access: 'read' | 'write';
|
|
7
|
-
}
|
|
8
|
-
export interface PrepareFromObjectiveInput {
|
|
9
|
-
readonly domainRoot: string;
|
|
10
|
-
readonly objective: string;
|
|
11
|
-
readonly taskId: string;
|
|
12
|
-
readonly subtaskId?: string;
|
|
13
|
-
readonly attempt?: number;
|
|
14
|
-
readonly phase?: 'discovery' | 'implementation' | 'review' | 'handoff' | 'fix';
|
|
15
|
-
readonly acceptance: readonly string[];
|
|
16
|
-
readonly prompt?: string;
|
|
17
|
-
readonly coordinatorSession: string;
|
|
18
|
-
readonly assigneeSession: string;
|
|
19
|
-
readonly harness?: HostName;
|
|
20
|
-
readonly resources: readonly CollabResource[];
|
|
21
|
-
}
|
|
22
|
-
export type PrepareFromObjectiveResult = {
|
|
23
|
-
readonly ok: true;
|
|
24
|
-
readonly prepared: PreparedBundle['prepared'];
|
|
25
|
-
readonly goal: PreparedBundle['goal'];
|
|
26
|
-
readonly cardPath: string;
|
|
27
|
-
readonly card: Record<string, unknown>;
|
|
28
|
-
readonly notes: readonly string[];
|
|
29
|
-
} | {
|
|
30
|
-
readonly ok: false;
|
|
31
|
-
readonly code: string;
|
|
32
|
-
readonly message: string;
|
|
33
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
34
|
-
};
|
|
35
|
-
export declare function prepareFromObjective(input: PrepareFromObjectiveInput): Promise<PrepareFromObjectiveResult>;
|
package/dist/app/collab-from.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { prepareCollaboration } from './collaboration.js';
|
|
4
|
-
export async function prepareFromObjective(input) {
|
|
5
|
-
const harness = input.harness ?? 'pi';
|
|
6
|
-
if (input.resources.length === 0) {
|
|
7
|
-
return {
|
|
8
|
-
ok: false,
|
|
9
|
-
code: 'collab_resource_required',
|
|
10
|
-
message: 'A collaboration goal needs at least one explicit resource (file or directory).',
|
|
11
|
-
diagnostics: [],
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const goal = {
|
|
15
|
-
schema: 'pappra/collaboration-goal/1',
|
|
16
|
-
task_id: input.taskId,
|
|
17
|
-
subtask_id: input.subtaskId ?? 'work',
|
|
18
|
-
attempt: input.attempt ?? 1,
|
|
19
|
-
phase: input.phase ?? 'implementation',
|
|
20
|
-
objective: input.objective,
|
|
21
|
-
acceptance: [...input.acceptance],
|
|
22
|
-
prompt: input.prompt ?? input.objective,
|
|
23
|
-
coordinator: {
|
|
24
|
-
agent_id: 'coordinator',
|
|
25
|
-
session_id: input.coordinatorSession,
|
|
26
|
-
harness: 'codex',
|
|
27
|
-
owner_epoch: 1,
|
|
28
|
-
},
|
|
29
|
-
assignee: {
|
|
30
|
-
agent_id: 'worker',
|
|
31
|
-
session_id: input.assigneeSession,
|
|
32
|
-
harness,
|
|
33
|
-
surface: 'rpc',
|
|
34
|
-
configuration_id: 'daily',
|
|
35
|
-
cwd: input.resources[0].path,
|
|
36
|
-
},
|
|
37
|
-
resources: input.resources.map((resource) => ({
|
|
38
|
-
path: resource.path,
|
|
39
|
-
access: resource.access,
|
|
40
|
-
})),
|
|
41
|
-
required: { skills: [], tools: [] },
|
|
42
|
-
preferred: { skills: [], tools: [] },
|
|
43
|
-
};
|
|
44
|
-
const prepared = await prepareCollaboration(goal, {
|
|
45
|
-
domainRoot: input.domainRoot,
|
|
46
|
-
});
|
|
47
|
-
if (!prepared.ok) {
|
|
48
|
-
return {
|
|
49
|
-
ok: false,
|
|
50
|
-
code: prepared.code,
|
|
51
|
-
message: prepared.message,
|
|
52
|
-
diagnostics: prepared.diagnostics ?? [],
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const card = {
|
|
56
|
-
schema: 'harness-collab/capabilities/1',
|
|
57
|
-
agent_id: goal.assignee.agent_id,
|
|
58
|
-
session_id: goal.assignee.session_id,
|
|
59
|
-
harness: goal.assignee.harness,
|
|
60
|
-
surface: goal.assignee.surface,
|
|
61
|
-
configuration_id: goal.assignee.configuration_id,
|
|
62
|
-
cwd: goal.assignee.cwd,
|
|
63
|
-
observed_at: new Date().toISOString(),
|
|
64
|
-
evidence_level: 'declared',
|
|
65
|
-
skills: [],
|
|
66
|
-
tools: [],
|
|
67
|
-
};
|
|
68
|
-
const cardPath = join(prepared.value.prepared.prepared_dir, 'card.declared.json');
|
|
69
|
-
await mkdir(prepared.value.prepared.prepared_dir, { recursive: true });
|
|
70
|
-
await writeFile(cardPath, `${JSON.stringify(card, null, 2)}\n`, {
|
|
71
|
-
mode: 0o600,
|
|
72
|
-
});
|
|
73
|
-
return {
|
|
74
|
-
ok: true,
|
|
75
|
-
prepared: prepared.value.prepared,
|
|
76
|
-
goal: prepared.value.goal,
|
|
77
|
-
cardPath,
|
|
78
|
-
card,
|
|
79
|
-
notes: [
|
|
80
|
-
'The generated capability card is declared, not runtime evidence: a work launch will refuse it.',
|
|
81
|
-
'For a real launch, provide a runtime capability card observed from an admitted session.',
|
|
82
|
-
],
|
|
83
|
-
};
|
|
84
|
-
}
|