harnery 0.35.0 → 0.36.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/dist/commander.d.ts +30 -5
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +124 -96
- package/dist/commands/agents.d.ts +23 -3
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +379 -198
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +10 -10
- package/dist/commands/browse-session.d.ts.map +1 -1
- package/dist/commands/browse-session.js +12 -0
- package/dist/commands/browse.d.ts +1 -1
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +5 -4
- package/dist/commands/conversations.d.ts +10 -0
- package/dist/commands/conversations.d.ts.map +1 -0
- package/dist/commands/conversations.js +201 -0
- package/dist/commands/deinit.d.ts.map +1 -1
- package/dist/commands/deinit.js +5 -0
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +13 -2
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +51 -7
- package/dist/commands/fetch.js +6 -5
- package/dist/commands/files.d.ts +22 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +113 -0
- package/dist/commands/governor.js +14 -12
- package/dist/commands/inbox.d.ts +5 -0
- package/dist/commands/inbox.d.ts.map +1 -0
- package/dist/commands/inbox.js +57 -0
- package/dist/commands/init.d.ts +4 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +63 -13
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +347 -1
- package/dist/commands/logs.d.ts +4 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +169 -0
- package/dist/commands/messages.d.ts +5 -0
- package/dist/commands/messages.d.ts.map +1 -0
- package/dist/commands/messages.js +45 -0
- package/dist/commands/outline.d.ts +1 -1
- package/dist/commands/outline.d.ts.map +1 -1
- package/dist/commands/outline.js +2 -2
- package/dist/commands/read.d.ts +1 -1
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +2 -2
- package/dist/commands/semantic.d.ts.map +1 -1
- package/dist/commands/semantic.js +54 -2
- package/dist/commands/storage.d.ts +4 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +238 -0
- package/dist/commands/tunnel.d.ts +5 -1
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +44 -31
- package/dist/commands/web.d.ts +3 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +67 -7
- package/dist/commands/work.js +3 -3
- package/dist/commands/workflow.js +13 -13
- package/dist/core/adapters/profiles.d.ts +1 -1
- package/dist/core/agents/cli.js +209 -39
- package/dist/core/agents/live-authority-v3.d.ts +47 -1
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
- package/dist/core/agents/live-authority-v3.js +244 -10
- package/dist/core/agents/live-lifecycle-v3.js +6 -1
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -1
- package/dist/core/agents/live-observation-v3.js +6 -1
- package/dist/core/agents/render/prompt-context.d.ts +9 -3
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +24 -7
- package/dist/core/agents/rules/stop-hook.d.ts +2 -0
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +94 -13
- package/dist/core/agents/rules/verdict.d.ts +1 -0
- package/dist/core/agents/rules/verdict.d.ts.map +1 -1
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +4 -0
- package/dist/core/agents/session-finalization-state-v3.js +1 -1
- package/dist/core/agents/session-finalizer-v3.js +5 -1
- package/dist/core/agents/state/activity-log.d.ts +3 -0
- package/dist/core/agents/state/activity-log.d.ts.map +1 -1
- package/dist/core/agents/state/activity-log.js +6 -3
- package/dist/core/agents/state/heartbeat-writer.d.ts +6 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +18 -0
- package/dist/core/agents/state/live-coordination-view.d.ts +5 -7
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +15 -90
- package/dist/core/agents/state/live-coordination-writer.d.ts +12 -0
- package/dist/core/agents/state/live-coordination-writer.d.ts.map +1 -0
- package/dist/core/agents/state/live-coordination-writer.js +92 -0
- package/dist/core/artifacts/index.d.ts +21 -0
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +46 -1
- package/dist/core/config.d.ts +62 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +98 -4
- package/dist/core/conversations/archive.d.ts +49 -0
- package/dist/core/conversations/archive.d.ts.map +1 -0
- package/dist/core/conversations/archive.js +136 -0
- package/dist/core/conversations/catalog.d.ts +10 -0
- package/dist/core/conversations/catalog.d.ts.map +1 -0
- package/dist/core/conversations/catalog.js +72 -0
- package/dist/core/conversations/context-pack.d.ts +6 -0
- package/dist/core/conversations/context-pack.d.ts.map +1 -0
- package/dist/core/conversations/context-pack.js +60 -0
- package/dist/core/conversations/contract.d.ts +155 -0
- package/dist/core/conversations/contract.d.ts.map +1 -0
- package/dist/core/conversations/contract.js +1 -0
- package/dist/core/conversations/evaluation.d.ts +16 -0
- package/dist/core/conversations/evaluation.d.ts.map +1 -0
- package/dist/core/conversations/evaluation.js +9 -0
- package/dist/core/conversations/index.d.ts +10 -0
- package/dist/core/conversations/index.d.ts.map +1 -0
- package/dist/core/conversations/index.js +9 -0
- package/dist/core/conversations/lifecycle.d.ts +28 -0
- package/dist/core/conversations/lifecycle.d.ts.map +1 -0
- package/dist/core/conversations/lifecycle.js +29 -0
- package/dist/core/conversations/normalize.d.ts +14 -0
- package/dist/core/conversations/normalize.d.ts.map +1 -0
- package/dist/core/conversations/normalize.js +82 -0
- package/dist/core/conversations/query.d.ts +8 -0
- package/dist/core/conversations/query.d.ts.map +1 -0
- package/dist/core/conversations/query.js +280 -0
- package/dist/core/conversations/search-index.d.ts +9 -0
- package/dist/core/conversations/search-index.d.ts.map +1 -0
- package/dist/core/conversations/search-index.js +29 -0
- package/dist/core/events/legacy-storage/canary.d.ts +18 -0
- package/dist/core/events/legacy-storage/canary.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/canary.js +150 -0
- package/dist/core/events/legacy-storage/fence.d.ts +15 -0
- package/dist/core/events/legacy-storage/fence.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/fence.js +115 -0
- package/dist/core/events/legacy-storage/index.d.ts +6 -0
- package/dist/core/events/legacy-storage/index.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/index.js +5 -0
- package/dist/core/events/legacy-storage/inventory.d.ts +10 -0
- package/dist/core/events/legacy-storage/inventory.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/inventory.js +40 -0
- package/dist/core/events/legacy-storage/manifest.d.ts +23 -0
- package/dist/core/events/legacy-storage/manifest.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/manifest.js +108 -0
- package/dist/core/events/legacy-storage/reader.d.ts +15 -0
- package/dist/core/events/legacy-storage/reader.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/reader.js +154 -0
- package/dist/core/events/v3/authority-outbox.d.ts +7 -2
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -1
- package/dist/core/events/v3/authority-outbox.js +16 -3
- package/dist/core/events/v3/base-contract.d.ts +81 -41
- package/dist/core/events/v3/base-contract.d.ts.map +1 -1
- package/dist/core/events/v3/base-contract.js +17 -7
- package/dist/core/events/v3/bootstrap.d.ts +39 -0
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
- package/dist/core/events/v3/bootstrap.js +167 -3
- package/dist/core/events/v3/capabilities.js +3 -3
- package/dist/core/events/v3/control-witness.d.ts +44 -0
- package/dist/core/events/v3/control-witness.d.ts.map +1 -0
- package/dist/core/events/v3/control-witness.js +233 -0
- package/dist/core/events/v3/control-writer.d.ts +4 -0
- package/dist/core/events/v3/control-writer.d.ts.map +1 -0
- package/dist/core/events/v3/control-writer.js +16 -0
- package/dist/core/events/v3/control.d.ts +8 -2
- package/dist/core/events/v3/control.d.ts.map +1 -1
- package/dist/core/events/v3/control.js +46 -18
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts +42 -0
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts.map +1 -0
- package/dist/core/events/v3/coordination-transaction-recovery.js +342 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -1
- package/dist/core/events/v3/coordination-view.js +16 -1
- package/dist/core/events/v3/generated.d.ts +1 -1
- package/dist/core/events/v3/generated.js +1 -1
- package/dist/core/events/v3/index.d.ts +4 -2
- package/dist/core/events/v3/index.d.ts.map +1 -1
- package/dist/core/events/v3/index.js +3 -1
- package/dist/core/events/v3/live-route-observer.d.ts +31 -0
- package/dist/core/events/v3/live-route-observer.d.ts.map +1 -0
- package/dist/core/events/v3/live-route-observer.js +58 -0
- package/dist/core/events/v3/live-routing.d.ts +13 -21
- package/dist/core/events/v3/live-routing.d.ts.map +1 -1
- package/dist/core/events/v3/live-routing.js +45 -41
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +11 -1
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/coordination-recorder.js +76 -10
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts +129 -0
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts.map +1 -0
- package/dist/core/events/v3/producers/diagnostic-summaries.js +499 -0
- package/dist/core/events/v3/producers/hook-base.js +1 -1
- package/dist/core/events/v3/producers/intake.d.ts +7 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +25 -2
- package/dist/core/events/v3/producers/producer-state-observer.d.ts +8 -0
- package/dist/core/events/v3/producers/producer-state-observer.d.ts.map +1 -0
- package/dist/core/events/v3/producers/producer-state-observer.js +45 -0
- package/dist/core/events/v3/producers/recorder.d.ts +55 -1
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +353 -24
- package/dist/core/events/v3/reader.d.ts +51 -0
- package/dist/core/events/v3/reader.d.ts.map +1 -1
- package/dist/core/events/v3/reader.js +181 -1
- package/dist/core/events/v3/rotation-config.d.ts +9 -0
- package/dist/core/events/v3/rotation-config.d.ts.map +1 -0
- package/dist/core/events/v3/rotation-config.js +91 -0
- package/dist/core/events/v3/runtime-build.d.ts +11 -0
- package/dist/core/events/v3/runtime-build.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-build.js +39 -0
- package/dist/core/events/v3/runtime-identity.d.ts +5 -0
- package/dist/core/events/v3/runtime-identity.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-identity.js +18 -0
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts +6 -5
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/runtime-telemetry-capabilities.js +1 -1
- package/dist/core/events/v3/support-storage/classify.d.ts +46 -0
- package/dist/core/events/v3/support-storage/classify.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/classify.js +149 -0
- package/dist/core/events/v3/support-storage/eligibility.d.ts +29 -0
- package/dist/core/events/v3/support-storage/eligibility.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/eligibility.js +35 -0
- package/dist/core/events/v3/support-storage/index.d.ts +10 -0
- package/dist/core/events/v3/support-storage/index.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/index.js +9 -0
- package/dist/core/events/v3/support-storage/inventory.d.ts +30 -0
- package/dist/core/events/v3/support-storage/inventory.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/inventory.js +94 -0
- package/dist/core/events/v3/support-storage/logical-authority.d.ts +14 -0
- package/dist/core/events/v3/support-storage/logical-authority.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/logical-authority.js +104 -0
- package/dist/core/events/v3/support-storage/maintenance.d.ts +98 -0
- package/dist/core/events/v3/support-storage/maintenance.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/maintenance.js +352 -0
- package/dist/core/events/v3/support-storage/pack-contract.d.ts +59 -0
- package/dist/core/events/v3/support-storage/pack-contract.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-contract.js +249 -0
- package/dist/core/events/v3/support-storage/pack-reader.d.ts +34 -0
- package/dist/core/events/v3/support-storage/pack-reader.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-reader.js +258 -0
- package/dist/core/events/v3/support-storage/pack-writer.d.ts +30 -0
- package/dist/core/events/v3/support-storage/pack-writer.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-writer.js +268 -0
- package/dist/core/events/v3/support-storage/recovery.d.ts +15 -0
- package/dist/core/events/v3/support-storage/recovery.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/recovery.js +22 -0
- package/dist/core/events/v3/turn-telemetry.d.ts +14 -8
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -1
- package/dist/core/events/v3/turn-telemetry.js +32 -2
- package/dist/core/events/v3/writer.d.ts +13 -1
- package/dist/core/events/v3/writer.d.ts.map +1 -1
- package/dist/core/events/v3/writer.js +126 -12
- package/dist/core/governor/plan-read.d.ts.map +1 -1
- package/dist/core/governor/plan-read.js +5 -21
- package/dist/core/governor/planning.js +6 -8
- package/dist/core/governor/service-read.d.ts +12 -0
- package/dist/core/governor/service-read.d.ts.map +1 -1
- package/dist/core/governor/service-read.js +266 -2
- package/dist/core/governor/service.d.ts +1 -0
- package/dist/core/governor/service.d.ts.map +1 -1
- package/dist/core/governor/service.js +53 -18
- package/dist/core/guard/evidence-v3.d.ts.map +1 -1
- package/dist/core/guard/evidence-v3.js +2 -0
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +1 -0
- package/dist/core/hooks/adapter/output.d.ts +4 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +13 -5
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts +27 -4
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts.map +1 -1
- package/dist/core/hooks/adapter/runtime-telemetry.js +307 -6
- package/dist/core/hooks/cli.js +212 -30
- package/dist/core/hooks/effects/image-capture.d.ts +1 -1
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +4 -2
- package/dist/core/hooks/remediation-cap.d.ts +8 -3
- package/dist/core/hooks/remediation-cap.d.ts.map +1 -1
- package/dist/core/hooks/remediation-cap.js +3 -11
- package/dist/core/hooks/resolve/coord-root.d.ts +22 -9
- package/dist/core/hooks/resolve/coord-root.d.ts.map +1 -1
- package/dist/core/hooks/resolve/coord-root.js +92 -11
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +5 -0
- package/dist/core/hooks/resolve/transcript.d.ts +8 -0
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +11 -0
- package/dist/core/inbox/contract.d.ts +64 -0
- package/dist/core/inbox/contract.d.ts.map +1 -0
- package/dist/core/inbox/contract.js +13 -0
- package/dist/core/inbox/index.d.ts +5 -0
- package/dist/core/inbox/index.d.ts.map +1 -0
- package/dist/core/inbox/index.js +4 -0
- package/dist/core/inbox/lifecycle.d.ts +22 -0
- package/dist/core/inbox/lifecycle.d.ts.map +1 -0
- package/dist/core/inbox/lifecycle.js +41 -0
- package/dist/core/inbox/service.d.ts +36 -0
- package/dist/core/inbox/service.d.ts.map +1 -0
- package/dist/core/inbox/service.js +210 -0
- package/dist/core/inbox/watcher.d.ts +7 -0
- package/dist/core/inbox/watcher.d.ts.map +1 -0
- package/dist/core/inbox/watcher.js +26 -0
- package/dist/core/presence/codec-digest.d.ts.map +1 -1
- package/dist/core/presence/codec-digest.js +14 -3
- package/dist/core/presence/relay-client.d.ts +1 -0
- package/dist/core/presence/relay-client.d.ts.map +1 -1
- package/dist/core/presence/relay-client.js +52 -8
- package/dist/core/semantic/adapters.d.ts +11 -8
- package/dist/core/semantic/adapters.d.ts.map +1 -1
- package/dist/core/semantic/adapters.js +169 -31
- package/dist/core/semantic/contract.d.ts +532 -48
- package/dist/core/semantic/contract.d.ts.map +1 -1
- package/dist/core/semantic/contract.js +104 -3
- package/dist/core/semantic/index.d.ts +7 -3
- package/dist/core/semantic/index.d.ts.map +1 -1
- package/dist/core/semantic/index.js +7 -3
- package/dist/core/semantic/once.d.ts +6 -1
- package/dist/core/semantic/once.d.ts.map +1 -1
- package/dist/core/semantic/once.js +80 -9
- package/dist/core/semantic/prompt.d.ts.map +1 -1
- package/dist/core/semantic/prompt.js +14 -1
- package/dist/core/semantic/review.d.ts +144 -0
- package/dist/core/semantic/review.d.ts.map +1 -0
- package/dist/core/semantic/review.js +544 -0
- package/dist/core/semantic/routes.d.ts +10 -0
- package/dist/core/semantic/routes.d.ts.map +1 -0
- package/dist/core/semantic/routes.js +21 -0
- package/dist/core/semantic/scheduler.d.ts +14 -3
- package/dist/core/semantic/scheduler.d.ts.map +1 -1
- package/dist/core/semantic/scheduler.js +30 -6
- package/dist/core/semantic/service-status.d.ts +20 -0
- package/dist/core/semantic/service-status.d.ts.map +1 -1
- package/dist/core/semantic/service-status.js +60 -4
- package/dist/core/semantic/service.d.ts +1 -0
- package/dist/core/semantic/service.d.ts.map +1 -1
- package/dist/core/semantic/service.js +104 -15
- package/dist/core/semantic/soak.d.ts +75 -0
- package/dist/core/semantic/soak.d.ts.map +1 -0
- package/dist/core/semantic/soak.js +476 -0
- package/dist/core/semantic/storage.d.ts +11 -1
- package/dist/core/semantic/storage.d.ts.map +1 -1
- package/dist/core/semantic/storage.js +4 -3
- package/dist/core/semantic/usage.d.ts +43 -0
- package/dist/core/semantic/usage.d.ts.map +1 -0
- package/dist/core/semantic/usage.js +193 -0
- package/dist/core/semantic/validate.d.ts +3 -1
- package/dist/core/semantic/validate.d.ts.map +1 -1
- package/dist/core/semantic/validate.js +34 -1
- package/dist/core/storage/buffer.d.ts +28 -0
- package/dist/core/storage/buffer.d.ts.map +1 -0
- package/dist/core/storage/buffer.js +101 -0
- package/dist/core/storage/builtins.d.ts +3 -0
- package/dist/core/storage/builtins.d.ts.map +1 -0
- package/dist/core/storage/builtins.js +683 -0
- package/dist/core/storage/catalog.d.ts +19 -0
- package/dist/core/storage/catalog.d.ts.map +1 -0
- package/dist/core/storage/catalog.js +365 -0
- package/dist/core/storage/config.d.ts +16 -0
- package/dist/core/storage/config.d.ts.map +1 -0
- package/dist/core/storage/config.js +311 -0
- package/dist/core/storage/contract.d.ts +275 -0
- package/dist/core/storage/contract.d.ts.map +1 -0
- package/dist/core/storage/contract.js +3 -0
- package/dist/core/storage/durable-history.d.ts +36 -0
- package/dist/core/storage/durable-history.d.ts.map +1 -0
- package/dist/core/storage/durable-history.js +606 -0
- package/dist/core/storage/health.d.ts +4 -0
- package/dist/core/storage/health.d.ts.map +1 -0
- package/dist/core/storage/health.js +65 -0
- package/dist/core/storage/index.d.ts +16 -0
- package/dist/core/storage/index.d.ts.map +1 -0
- package/dist/core/storage/index.js +15 -0
- package/dist/core/storage/inventory.d.ts +25 -0
- package/dist/core/storage/inventory.d.ts.map +1 -0
- package/dist/core/storage/inventory.js +666 -0
- package/dist/core/storage/jsonl.d.ts +52 -0
- package/dist/core/storage/jsonl.d.ts.map +1 -0
- package/dist/core/storage/jsonl.js +156 -0
- package/dist/core/storage/log-retention.d.ts +52 -0
- package/dist/core/storage/log-retention.d.ts.map +1 -0
- package/dist/core/storage/log-retention.js +419 -0
- package/dist/core/storage/logger.d.ts +82 -0
- package/dist/core/storage/logger.d.ts.map +1 -0
- package/dist/core/storage/logger.js +411 -0
- package/dist/core/storage/maintenance-providers.d.ts +26 -0
- package/dist/core/storage/maintenance-providers.d.ts.map +1 -0
- package/dist/core/storage/maintenance-providers.js +141 -0
- package/dist/core/storage/maintenance.d.ts +125 -0
- package/dist/core/storage/maintenance.d.ts.map +1 -0
- package/dist/core/storage/maintenance.js +609 -0
- package/dist/core/storage/metrics.d.ts +60 -0
- package/dist/core/storage/metrics.d.ts.map +1 -0
- package/dist/core/storage/metrics.js +134 -0
- package/dist/core/storage/policy.d.ts +7 -0
- package/dist/core/storage/policy.d.ts.map +1 -0
- package/dist/core/storage/policy.js +110 -0
- package/dist/core/storage/process-log.d.ts +38 -0
- package/dist/core/storage/process-log.d.ts.map +1 -0
- package/dist/core/storage/process-log.js +165 -0
- package/dist/core/storage/query.d.ts +34 -0
- package/dist/core/storage/query.d.ts.map +1 -0
- package/dist/core/storage/query.js +295 -0
- package/dist/core/storage/receipts.d.ts +23 -0
- package/dist/core/storage/receipts.d.ts.map +1 -0
- package/dist/core/storage/receipts.js +117 -0
- package/dist/core/storage/segments.d.ts +84 -0
- package/dist/core/storage/segments.d.ts.map +1 -0
- package/dist/core/storage/segments.js +542 -0
- package/dist/core/storage/sink-graph.d.ts +65 -0
- package/dist/core/storage/sink-graph.d.ts.map +1 -0
- package/dist/core/storage/sink-graph.js +213 -0
- package/dist/core/storage/storm-control.d.ts +23 -0
- package/dist/core/storage/storm-control.d.ts.map +1 -0
- package/dist/core/storage/storm-control.js +59 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +10 -14
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lazy-commands.d.ts +26 -0
- package/dist/lazy-commands.d.ts.map +1 -0
- package/dist/lazy-commands.js +210 -0
- package/dist/lib/docs-lint.d.ts +2 -0
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +45 -80
- package/dist/lib/docs-metadata-audit.d.ts +3 -0
- package/dist/lib/docs-metadata-audit.d.ts.map +1 -1
- package/dist/lib/docs-metadata-audit.js +13 -23
- package/dist/lib/docs-metadata-sync.d.ts +1 -0
- package/dist/lib/docs-metadata-sync.d.ts.map +1 -1
- package/dist/lib/docs-metadata-sync.js +28 -10
- package/dist/lib/docs-repository-view.d.ts +22 -0
- package/dist/lib/docs-repository-view.d.ts.map +1 -0
- package/dist/lib/docs-repository-view.js +185 -0
- package/dist/lib/http/client.d.ts +11 -5
- package/dist/lib/http/client.d.ts.map +1 -1
- package/dist/lib/http/client.js +22 -4
- package/dist/lib/http/index.d.ts +1 -1
- package/dist/lib/http/index.d.ts.map +1 -1
- package/dist/lib/http/index.js +1 -1
- package/dist/lib/indexer-exclusions.d.ts +27 -0
- package/dist/lib/indexer-exclusions.d.ts.map +1 -0
- package/dist/lib/indexer-exclusions.js +176 -0
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +5 -0
- package/dist/lib/local-file-url.d.ts +9 -0
- package/dist/lib/local-file-url.d.ts.map +1 -0
- package/dist/lib/local-file-url.js +20 -0
- package/dist/lib/web-performance.d.ts +118 -0
- package/dist/lib/web-performance.d.ts.map +1 -0
- package/dist/lib/web-performance.js +192 -0
- package/package.json +29 -2
- package/schemas/config.schema.json +58 -0
- package/schemas/event-v3.schema.json +324 -112
- package/src/commander.ts +462 -95
- package/src/commands/agents.ts +517 -190
- package/src/commands/backup.ts +18 -14
- package/src/commands/browse-session.ts +12 -0
- package/src/commands/browse.ts +6 -7
- package/src/commands/conversations.ts +279 -0
- package/src/commands/deinit.ts +6 -0
- package/src/commands/docs.ts +25 -6
- package/src/commands/doctor.ts +75 -9
- package/src/commands/fetch.ts +7 -6
- package/src/commands/files.ts +143 -0
- package/src/commands/governor.ts +13 -12
- package/src/commands/inbox.ts +61 -0
- package/src/commands/init.ts +78 -16
- package/src/commands/ledger-v3.ts +421 -1
- package/src/commands/logs.ts +224 -0
- package/src/commands/messages.ts +61 -0
- package/src/commands/outline.ts +6 -2
- package/src/commands/read.ts +6 -2
- package/src/commands/semantic.ts +66 -1
- package/src/commands/storage.ts +310 -0
- package/src/commands/tunnel.ts +66 -52
- package/src/commands/web.ts +77 -7
- package/src/commands/work.ts +3 -3
- package/src/commands/workflow.ts +13 -13
- package/src/core/agents/cli.ts +259 -53
- package/src/core/agents/live-authority-v3.ts +341 -10
- package/src/core/agents/live-lifecycle-v3.ts +6 -1
- package/src/core/agents/live-observation-v3.ts +6 -1
- package/src/core/agents/render/prompt-context.ts +27 -6
- package/src/core/agents/rules/stop-hook.ts +107 -16
- package/src/core/agents/rules/verdict.ts +1 -0
- package/src/core/agents/session-events.ts +4 -0
- package/src/core/agents/session-finalization-state-v3.ts +1 -1
- package/src/core/agents/session-finalizer-v3.ts +4 -1
- package/src/core/agents/state/activity-log.ts +7 -2
- package/src/core/agents/state/heartbeat-writer.ts +27 -0
- package/src/core/agents/state/live-coordination-view.ts +16 -105
- package/src/core/agents/state/live-coordination-writer.ts +141 -0
- package/src/core/artifacts/index.ts +64 -1
- package/src/core/config.ts +126 -5
- package/src/core/conversations/archive.ts +237 -0
- package/src/core/conversations/catalog.ts +79 -0
- package/src/core/conversations/context-pack.ts +72 -0
- package/src/core/conversations/contract.ts +178 -0
- package/src/core/conversations/evaluation.ts +30 -0
- package/src/core/conversations/index.ts +9 -0
- package/src/core/conversations/lifecycle.ts +63 -0
- package/src/core/conversations/normalize.ts +105 -0
- package/src/core/conversations/query.ts +318 -0
- package/src/core/conversations/search-index.ts +48 -0
- package/src/core/events/legacy-storage/canary.ts +177 -0
- package/src/core/events/legacy-storage/fence.ts +129 -0
- package/src/core/events/legacy-storage/index.ts +5 -0
- package/src/core/events/legacy-storage/inventory.ts +51 -0
- package/src/core/events/legacy-storage/manifest.ts +136 -0
- package/src/core/events/legacy-storage/reader.ts +178 -0
- package/src/core/events/v3/authority-outbox.ts +22 -1
- package/src/core/events/v3/base-contract.ts +17 -7
- package/src/core/events/v3/bootstrap.ts +195 -2
- package/src/core/events/v3/capabilities.ts +3 -3
- package/src/core/events/v3/control-witness.ts +339 -0
- package/src/core/events/v3/control-writer.ts +16 -0
- package/src/core/events/v3/control.ts +54 -18
- package/src/core/events/v3/coordination-transaction-recovery.ts +477 -0
- package/src/core/events/v3/coordination-view.ts +17 -1
- package/src/core/events/v3/generated.ts +1 -1
- package/src/core/events/v3/index.ts +5 -2
- package/src/core/events/v3/live-route-observer.ts +80 -0
- package/src/core/events/v3/live-routing.ts +64 -46
- package/src/core/events/v3/producers/coordination-recorder.ts +95 -10
- package/src/core/events/v3/producers/diagnostic-summaries.ts +593 -0
- package/src/core/events/v3/producers/hook-base.ts +1 -1
- package/src/core/events/v3/producers/intake.ts +30 -2
- package/src/core/events/v3/producers/producer-state-observer.ts +52 -0
- package/src/core/events/v3/producers/recorder.ts +571 -33
- package/src/core/events/v3/reader.ts +243 -2
- package/src/core/events/v3/rotation-config.ts +98 -0
- package/src/core/events/v3/runtime-build.ts +41 -0
- package/src/core/events/v3/runtime-identity.ts +16 -0
- package/src/core/events/v3/runtime-telemetry-capabilities.ts +14 -8
- package/src/core/events/v3/support-storage/classify.ts +209 -0
- package/src/core/events/v3/support-storage/eligibility.ts +58 -0
- package/src/core/events/v3/support-storage/index.ts +9 -0
- package/src/core/events/v3/support-storage/inventory.ts +135 -0
- package/src/core/events/v3/support-storage/logical-authority.ts +117 -0
- package/src/core/events/v3/support-storage/maintenance.ts +501 -0
- package/src/core/events/v3/support-storage/pack-contract.ts +337 -0
- package/src/core/events/v3/support-storage/pack-reader.ts +346 -0
- package/src/core/events/v3/support-storage/pack-writer.ts +352 -0
- package/src/core/events/v3/support-storage/recovery.ts +43 -0
- package/src/core/events/v3/turn-telemetry.ts +58 -7
- package/src/core/events/v3/writer.ts +168 -16
- package/src/core/governor/plan-read.ts +5 -18
- package/src/core/governor/planning.ts +5 -8
- package/src/core/governor/service-read.ts +320 -2
- package/src/core/governor/service.ts +49 -22
- package/src/core/guard/evidence-v3.ts +1 -0
- package/src/core/hooks/adapter/events.ts +1 -0
- package/src/core/hooks/adapter/output.ts +12 -5
- package/src/core/hooks/adapter/runtime-telemetry.ts +408 -13
- package/src/core/hooks/cli.ts +226 -32
- package/src/core/hooks/effects/image-capture.ts +4 -1
- package/src/core/hooks/remediation-cap.ts +12 -6
- package/src/core/hooks/resolve/coord-root.ts +91 -11
- package/src/core/hooks/resolve/owner.ts +4 -0
- package/src/core/hooks/resolve/transcript.ts +18 -0
- package/src/core/inbox/contract.ts +81 -0
- package/src/core/inbox/index.ts +4 -0
- package/src/core/inbox/lifecycle.ts +104 -0
- package/src/core/inbox/service.ts +305 -0
- package/src/core/inbox/watcher.ts +36 -0
- package/src/core/presence/codec-digest.ts +15 -9
- package/src/core/presence/relay-client.ts +55 -7
- package/src/core/semantic/adapters.ts +200 -41
- package/src/core/semantic/contract.ts +135 -3
- package/src/core/semantic/index.ts +76 -2
- package/src/core/semantic/once.ts +93 -7
- package/src/core/semantic/prompt.ts +13 -1
- package/src/core/semantic/review.ts +803 -0
- package/src/core/semantic/routes.ts +30 -0
- package/src/core/semantic/scheduler.ts +49 -5
- package/src/core/semantic/service-status.ts +99 -5
- package/src/core/semantic/service.ts +116 -15
- package/src/core/semantic/soak.ts +638 -0
- package/src/core/semantic/storage.ts +20 -6
- package/src/core/semantic/usage.ts +272 -0
- package/src/core/semantic/validate.ts +31 -0
- package/src/core/storage/buffer.ts +124 -0
- package/src/core/storage/builtins.ts +916 -0
- package/src/core/storage/catalog.ts +467 -0
- package/src/core/storage/config.ts +423 -0
- package/src/core/storage/contract.ts +342 -0
- package/src/core/storage/durable-history.ts +738 -0
- package/src/core/storage/health.ts +76 -0
- package/src/core/storage/index.ts +15 -0
- package/src/core/storage/inventory.ts +859 -0
- package/src/core/storage/jsonl.ts +213 -0
- package/src/core/storage/log-retention.ts +555 -0
- package/src/core/storage/logger.ts +546 -0
- package/src/core/storage/maintenance-providers.ts +200 -0
- package/src/core/storage/maintenance.ts +929 -0
- package/src/core/storage/metrics.ts +199 -0
- package/src/core/storage/policy.ts +141 -0
- package/src/core/storage/process-log.ts +203 -0
- package/src/core/storage/query.ts +360 -0
- package/src/core/storage/receipts.ts +162 -0
- package/src/core/storage/segments.ts +721 -0
- package/src/core/storage/sink-graph.ts +343 -0
- package/src/core/storage/storm-control.ts +91 -0
- package/src/core/work/state.ts +12 -21
- package/src/core/workflow/live-session-v3.ts +2 -4
- package/src/index.ts +2 -0
- package/src/lazy-commands.ts +294 -0
- package/src/lib/docs-lint.ts +58 -77
- package/src/lib/docs-metadata-audit.ts +26 -21
- package/src/lib/docs-metadata-sync.ts +32 -9
- package/src/lib/docs-repository-view.ts +220 -0
- package/src/lib/http/client.ts +44 -8
- package/src/lib/http/index.ts +6 -1
- package/src/lib/indexer-exclusions.ts +173 -0
- package/src/lib/instructions/templates.ts +5 -0
- package/src/lib/local-file-url.ts +31 -0
- package/src/lib/web-performance.ts +335 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
|
+
import { inventoryLegacyV1Segments, streamLegacyV1Rows, verifyLegacyV1HardFence, writeLegacyV1Canary, } from "../core/events/legacy-storage/index.js";
|
|
5
6
|
import { initializeEventLedgerV3, readEventV3ControlState, recoverInvalidEventLedgerV3, sha256V3, } from "../core/events/v3/index.js";
|
|
7
|
+
import { authorizeEventV3SupportReplacement, inventoryEventV3Support, planEventV3SupportReplacement, planEventV3SupportTransaction, readEventV3SupportPackManifest, readEventV3SupportTransaction, streamEventV3SupportPackRecords, unpackEventV3SupportPack, verifyEventV3SupportTransactionShadow, writeEventV3SupportTransactionShadow, } from "../core/events/v3/support-storage/index.js";
|
|
6
8
|
/** Inspect or initialize the universal V3 event ledger. */
|
|
7
9
|
export function registerLedgerV3Command(program, emit, context) {
|
|
8
10
|
const command = program
|
|
@@ -64,6 +66,258 @@ export function registerLedgerV3Command(program, emit, context) {
|
|
|
64
66
|
emitFailure(emit, "ledger_v3_recovery_failed", error);
|
|
65
67
|
}
|
|
66
68
|
});
|
|
69
|
+
command
|
|
70
|
+
.command("verify-support")
|
|
71
|
+
.description("Validate one V3 support-pack manifest and every packed source digest")
|
|
72
|
+
.argument("<manifest>", "Support-pack manifest path")
|
|
73
|
+
.action(async (manifest) => {
|
|
74
|
+
try {
|
|
75
|
+
const path = resolve(manifest);
|
|
76
|
+
const supportManifest = await readEventV3SupportPackManifest(path);
|
|
77
|
+
let entries = 0;
|
|
78
|
+
for await (const _record of streamEventV3SupportPackRecords(path))
|
|
79
|
+
entries += 1;
|
|
80
|
+
emit.data({
|
|
81
|
+
valid: true,
|
|
82
|
+
pack_id: supportManifest.pack_id,
|
|
83
|
+
entries,
|
|
84
|
+
source_files_digest: supportManifest.authority.source_files_digest,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
emitFailure(emit, "ledger_v3_support_verify_failed", error);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
command
|
|
92
|
+
.command("unpack-support")
|
|
93
|
+
.description("Unpack one verified support pack into a new explicit destination")
|
|
94
|
+
.argument("<manifest>", "Support-pack manifest path")
|
|
95
|
+
.requiredOption("--out <directory>", "New destination; existing paths are refused")
|
|
96
|
+
.action(async (manifest, options) => {
|
|
97
|
+
try {
|
|
98
|
+
emit.data(await unpackEventV3SupportPack(resolve(manifest), resolve(options.out)));
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
emitFailure(emit, "ledger_v3_support_unpack_failed", error);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
command
|
|
105
|
+
.command("support-transaction-status")
|
|
106
|
+
.description("Read one exact V3 support maintenance transaction")
|
|
107
|
+
.requiredOption("--transaction <id>", "Exact support maintenance transaction")
|
|
108
|
+
.option("--root <path>", "Explicit coordination root")
|
|
109
|
+
.action(async (options) => {
|
|
110
|
+
try {
|
|
111
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
112
|
+
emit.data(await readEventV3SupportTransaction(transactionRoot(root), options.transaction));
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
emitFailure(emit, "ledger_v3_support_transaction_status_failed", error);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
command
|
|
119
|
+
.command("support-plan")
|
|
120
|
+
.description("Inventory explicit V3 support evidence and persist a shadow-only transaction")
|
|
121
|
+
.requiredOption("--authority-root <directory>", "Exact active or archived authority root")
|
|
122
|
+
.requiredOption("--authority-state <state>", "Authority state: active or archived")
|
|
123
|
+
.requiredOption("--root-id <id>", "Authority root identifier")
|
|
124
|
+
.requiredOption("--genesis-id <id>", "Authority genesis binding")
|
|
125
|
+
.requiredOption("--evidence <json>", "JSON evidence map keyed by every support relative path")
|
|
126
|
+
.requiredOption("--observed-at <timestamp>", "Explicit ISO-8601 inventory time")
|
|
127
|
+
.requiredOption("--catalog-version <version>", "Storage catalog version used for the plan")
|
|
128
|
+
.requiredOption("--policy-version <version>", "Support classification policy version")
|
|
129
|
+
.option("--source-authority-digest <digest>", "Required archived authority digest")
|
|
130
|
+
.option("--root <path>", "Explicit coordination root for transaction persistence")
|
|
131
|
+
.action(async (options) => {
|
|
132
|
+
try {
|
|
133
|
+
const state = supportAuthorityState(options.authorityState);
|
|
134
|
+
const observedAt = exactIsoTimestamp(options.observedAt);
|
|
135
|
+
const evidence = readSupportEvidence(resolve(options.evidence));
|
|
136
|
+
const entries = await inventoryEventV3Support({
|
|
137
|
+
authority_root: resolve(options.authorityRoot),
|
|
138
|
+
authority: {
|
|
139
|
+
state,
|
|
140
|
+
genesis_id: nonemptyOption(options.genesisId, "genesis-id"),
|
|
141
|
+
},
|
|
142
|
+
now: observedAt,
|
|
143
|
+
evidence,
|
|
144
|
+
});
|
|
145
|
+
if (!sameSortedStrings(Object.keys(evidence), entries.map((entry) => entry.relative_path))) {
|
|
146
|
+
throw new Error("event_v3_support_plan_evidence_paths_mismatch");
|
|
147
|
+
}
|
|
148
|
+
if (entries.some((entry) => entry.disposition !== "pack-eligible")) {
|
|
149
|
+
throw new Error("event_v3_support_transaction_contains_ineligible_source");
|
|
150
|
+
}
|
|
151
|
+
const rootId = nonemptyOption(options.rootId, "root-id");
|
|
152
|
+
const genesisId = nonemptyOption(options.genesisId, "genesis-id");
|
|
153
|
+
const catalogVersion = nonemptyOption(options.catalogVersion, "catalog-version");
|
|
154
|
+
const policyVersion = nonemptyOption(options.policyVersion, "policy-version");
|
|
155
|
+
const authorityDigest = options.sourceAuthorityDigest
|
|
156
|
+
? exactSha256(options.sourceAuthorityDigest)
|
|
157
|
+
: undefined;
|
|
158
|
+
if (state === "archived" && !authorityDigest) {
|
|
159
|
+
throw new Error("event_v3_support_transaction_archive_digest_required");
|
|
160
|
+
}
|
|
161
|
+
if (state === "active" && authorityDigest) {
|
|
162
|
+
throw new Error("event_v3_support_transaction_active_digest_forbidden");
|
|
163
|
+
}
|
|
164
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
165
|
+
const transactions = transactionRoot(root);
|
|
166
|
+
mkdirSync(transactions, { recursive: true, mode: 0o700 });
|
|
167
|
+
emit.data(await planEventV3SupportTransaction({
|
|
168
|
+
transaction_root: transactions,
|
|
169
|
+
authority_root: resolve(options.authorityRoot),
|
|
170
|
+
root_id: rootId,
|
|
171
|
+
genesis_id: genesisId,
|
|
172
|
+
authority_state: state,
|
|
173
|
+
...(authorityDigest ? { source_authority_digest: authorityDigest } : {}),
|
|
174
|
+
entries,
|
|
175
|
+
catalog_version: catalogVersion,
|
|
176
|
+
policy_version: policyVersion,
|
|
177
|
+
now: observedAt,
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
emitFailure(emit, "ledger_v3_support_plan_failed", error);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
command
|
|
185
|
+
.command("support-shadow")
|
|
186
|
+
.description("Write and verify a shadow pack while preserving every loose source")
|
|
187
|
+
.requiredOption("--transaction <id>", "Exact support maintenance transaction")
|
|
188
|
+
.requiredOption("--genesis-id <id>", "Current authority genesis binding")
|
|
189
|
+
.requiredOption("--minimum-harnery-version <version>", "Minimum pack-aware Harnery version")
|
|
190
|
+
.option("--root <path>", "Explicit coordination root")
|
|
191
|
+
.action(async (options) => {
|
|
192
|
+
try {
|
|
193
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
194
|
+
const transactions = transactionRoot(root);
|
|
195
|
+
let current = await readEventV3SupportTransaction(transactions, options.transaction);
|
|
196
|
+
if (current.authority.genesis_id !== options.genesisId) {
|
|
197
|
+
throw new Error("event_v3_support_transaction_genesis_mismatch");
|
|
198
|
+
}
|
|
199
|
+
if (current.state === "planned") {
|
|
200
|
+
current = await writeEventV3SupportTransactionShadow({
|
|
201
|
+
transaction_root: transactions,
|
|
202
|
+
transaction_id: current.transaction_id,
|
|
203
|
+
minimum_harnery_version: options.minimumHarneryVersion,
|
|
204
|
+
now: new Date().toISOString(),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
if (current.state === "shadow-written") {
|
|
208
|
+
current = await verifyEventV3SupportTransactionShadow({
|
|
209
|
+
transaction_root: transactions,
|
|
210
|
+
transaction_id: current.transaction_id,
|
|
211
|
+
expected_current_genesis_id: options.genesisId,
|
|
212
|
+
now: new Date().toISOString(),
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
if (current.state !== "shadow-verified") {
|
|
216
|
+
throw new Error(`support shadow cannot resume from ${current.state}`);
|
|
217
|
+
}
|
|
218
|
+
emit.data({
|
|
219
|
+
transaction_id: current.transaction_id,
|
|
220
|
+
state: current.state,
|
|
221
|
+
sources_preserved: true,
|
|
222
|
+
replacement_enabled: false,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
emitFailure(emit, "ledger_v3_support_shadow_failed", error);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
command
|
|
230
|
+
.command("support-replacement")
|
|
231
|
+
.description("Authorize an exact verified canary plan; source replacement remains disabled")
|
|
232
|
+
.requiredOption("--transaction <id>", "Transaction to inspect")
|
|
233
|
+
.requiredOption("--exact-transaction <id>", "Repeat the exact transaction identifier")
|
|
234
|
+
.option("--yes", "Record exact replacement authorization")
|
|
235
|
+
.option("--root <path>", "Explicit coordination root")
|
|
236
|
+
.action(async (options) => {
|
|
237
|
+
try {
|
|
238
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
239
|
+
const transactions = transactionRoot(root);
|
|
240
|
+
const authorized = await authorizeEventV3SupportReplacement({
|
|
241
|
+
transaction_root: transactions,
|
|
242
|
+
transaction_id: options.transaction,
|
|
243
|
+
exact_transaction_id: options.exactTransaction,
|
|
244
|
+
yes: options.yes === true,
|
|
245
|
+
now: new Date().toISOString(),
|
|
246
|
+
});
|
|
247
|
+
emit.data(await planEventV3SupportReplacement({
|
|
248
|
+
transaction_root: transactions,
|
|
249
|
+
transaction_id: authorized.transaction_id,
|
|
250
|
+
}));
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
emitFailure(emit, "ledger_v3_support_replacement_failed", error);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
command
|
|
257
|
+
.command("verify-v1-fence")
|
|
258
|
+
.description("Verify the sealed legacy V1 hard fence and terminal digest")
|
|
259
|
+
.option("--root <path>", "Explicit coordination root")
|
|
260
|
+
.action(async (options) => {
|
|
261
|
+
try {
|
|
262
|
+
emit.data(await verifyLegacyV1HardFence(resolve(options.root ?? coordRoot(context))));
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
emitFailure(emit, "ledger_v1_fence_verify_failed", error);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
command
|
|
269
|
+
.command("legacy-inventory")
|
|
270
|
+
.description("List sealed root events*.ndjson* history after the V1 fence passes")
|
|
271
|
+
.option("--root <path>", "Explicit coordination root")
|
|
272
|
+
.action(async (options) => {
|
|
273
|
+
try {
|
|
274
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
275
|
+
await verifyLegacyV1HardFence(root);
|
|
276
|
+
emit.data(await inventoryLegacyV1Segments(root));
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
emitFailure(emit, "ledger_v1_inventory_failed", error);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
command
|
|
283
|
+
.command("verify-legacy")
|
|
284
|
+
.description("Stream and validate one loose or manifest-bound gzip legacy segment")
|
|
285
|
+
.argument("<source>", "Loose segment or compressed-segment manifest")
|
|
286
|
+
.action(async (source) => {
|
|
287
|
+
try {
|
|
288
|
+
let rows = 0;
|
|
289
|
+
for await (const row of streamLegacyV1Rows(resolve(source)))
|
|
290
|
+
rows = row.row_number;
|
|
291
|
+
emit.data({ valid: true, rows });
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
emitFailure(emit, "ledger_v1_segment_verify_failed", error);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
command
|
|
298
|
+
.command("legacy-canary")
|
|
299
|
+
.description("Write one shadow gzip canary while retaining the sealed loose segment")
|
|
300
|
+
.requiredOption("--source-filename <name>", "Root legacy segment filename")
|
|
301
|
+
.requiredOption("--out <directory>", "Shadow output directory")
|
|
302
|
+
.requiredOption("--minimum-harnery-version <version>", "Minimum canary-aware version")
|
|
303
|
+
.option("--shadow", "Confirm shadow-only compression")
|
|
304
|
+
.option("--root <path>", "Explicit coordination root")
|
|
305
|
+
.action(async (options) => {
|
|
306
|
+
try {
|
|
307
|
+
if (!options.shadow)
|
|
308
|
+
throw new Error("--shadow is required for legacy canary creation");
|
|
309
|
+
emit.data(await writeLegacyV1Canary({
|
|
310
|
+
coord_root: resolve(options.root ?? coordRoot(context)),
|
|
311
|
+
source_filename: options.sourceFilename,
|
|
312
|
+
output_directory: resolve(options.out),
|
|
313
|
+
minimum_harnery_version: options.minimumHarneryVersion,
|
|
314
|
+
created_at: new Date().toISOString(),
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
317
|
+
catch (error) {
|
|
318
|
+
emitFailure(emit, "ledger_v1_canary_failed", error);
|
|
319
|
+
}
|
|
320
|
+
});
|
|
67
321
|
}
|
|
68
322
|
function coordRoot(context) {
|
|
69
323
|
return resolve(context?.resolveCoordRoot?.() ??
|
|
@@ -85,6 +339,98 @@ function configDigest(root) {
|
|
|
85
339
|
const path = resolve(root, ".harnery", "config.jsonc");
|
|
86
340
|
return sha256V3(existsSync(path) ? readFileSync(path) : Buffer.from("{}\n"));
|
|
87
341
|
}
|
|
342
|
+
function transactionRoot(root) {
|
|
343
|
+
return resolve(root, ".harnery", "maintenance", "transactions", "v3-support");
|
|
344
|
+
}
|
|
345
|
+
function supportAuthorityState(value) {
|
|
346
|
+
if (value === "active" || value === "archived")
|
|
347
|
+
return value;
|
|
348
|
+
throw new Error("event_v3_support_plan_authority_state_invalid");
|
|
349
|
+
}
|
|
350
|
+
function exactIsoTimestamp(value) {
|
|
351
|
+
if (!Number.isFinite(Date.parse(value)) || new Date(value).toISOString() !== value) {
|
|
352
|
+
throw new Error("event_v3_support_plan_timestamp_invalid");
|
|
353
|
+
}
|
|
354
|
+
return value;
|
|
355
|
+
}
|
|
356
|
+
function exactSha256(value) {
|
|
357
|
+
if (!/^sha256:[0-9a-f]{64}$/.test(value)) {
|
|
358
|
+
throw new Error("event_v3_support_plan_authority_digest_invalid");
|
|
359
|
+
}
|
|
360
|
+
return value;
|
|
361
|
+
}
|
|
362
|
+
function nonemptyOption(value, name) {
|
|
363
|
+
if (value.trim().length === 0)
|
|
364
|
+
throw new Error(`event_v3_support_plan_${name}_empty`);
|
|
365
|
+
return value;
|
|
366
|
+
}
|
|
367
|
+
function readSupportEvidence(path) {
|
|
368
|
+
let parsed;
|
|
369
|
+
try {
|
|
370
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
371
|
+
}
|
|
372
|
+
catch {
|
|
373
|
+
throw new Error("event_v3_support_plan_evidence_invalid");
|
|
374
|
+
}
|
|
375
|
+
if (!isRecord(parsed))
|
|
376
|
+
throw new Error("event_v3_support_plan_evidence_invalid");
|
|
377
|
+
for (const evidence of Object.values(parsed)) {
|
|
378
|
+
if (!isRecord(evidence) || !validSupportEvidence(evidence)) {
|
|
379
|
+
throw new Error("event_v3_support_plan_evidence_invalid");
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return parsed;
|
|
383
|
+
}
|
|
384
|
+
const supportEvidenceBooleanFields = new Set([
|
|
385
|
+
"recovery_bound",
|
|
386
|
+
"recovery_packing_enabled",
|
|
387
|
+
"epoch_maintenance_enabled",
|
|
388
|
+
"active_session_tee_enabled",
|
|
389
|
+
"active_committed_receipt_enabled",
|
|
390
|
+
"contract_valid",
|
|
391
|
+
"maintenance_owned",
|
|
392
|
+
"terminal",
|
|
393
|
+
"pending",
|
|
394
|
+
"turn_sealed",
|
|
395
|
+
"finalization_complete",
|
|
396
|
+
"event_references_resolved",
|
|
397
|
+
"event_references_same_epoch",
|
|
398
|
+
"lease_live",
|
|
399
|
+
"stale_writer_grace_elapsed",
|
|
400
|
+
"ready_sibling",
|
|
401
|
+
"producer_pending_reference",
|
|
402
|
+
"event_row_digest_matches",
|
|
403
|
+
"transaction_digest_matches",
|
|
404
|
+
"receipt_grace_elapsed",
|
|
405
|
+
"archive_has_ready_transaction",
|
|
406
|
+
]);
|
|
407
|
+
const supportEvidenceStringFields = new Set(["recorded_at", "filename_recorded_at"]);
|
|
408
|
+
const supportEvidenceNumberFields = new Set([
|
|
409
|
+
"maximum_loose_consumer_window_ms",
|
|
410
|
+
"fixed_consumer_grace_ms",
|
|
411
|
+
"writer_tolerance_ms",
|
|
412
|
+
]);
|
|
413
|
+
function validSupportEvidence(evidence) {
|
|
414
|
+
return Object.entries(evidence).every(([key, value]) => {
|
|
415
|
+
if (supportEvidenceBooleanFields.has(key))
|
|
416
|
+
return typeof value === "boolean";
|
|
417
|
+
if (supportEvidenceStringFields.has(key))
|
|
418
|
+
return typeof value === "string";
|
|
419
|
+
if (supportEvidenceNumberFields.has(key)) {
|
|
420
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
421
|
+
}
|
|
422
|
+
return false;
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
function isRecord(value) {
|
|
426
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
427
|
+
}
|
|
428
|
+
function sameSortedStrings(left, right) {
|
|
429
|
+
const leftSorted = [...left].sort();
|
|
430
|
+
const rightSorted = [...right].sort();
|
|
431
|
+
return (leftSorted.length === rightSorted.length &&
|
|
432
|
+
leftSorted.every((value, index) => value === rightSorted[index]));
|
|
433
|
+
}
|
|
88
434
|
function emitFailure(emit, code, error) {
|
|
89
435
|
emit.error({ code, message: error instanceof Error ? error.message : String(error) });
|
|
90
436
|
throw error;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { EmitContext, HarneryProgramContext } from "../commander.js";
|
|
3
|
+
export declare function registerLogsCommand(program: Command, emit: EmitContext, context?: HarneryProgramContext): void;
|
|
4
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAuB1E,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAqFN"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { resolveCoordRoot as resolveCanonicalCoordRoot } from "../core/agents/coord-client.js";
|
|
3
|
+
import { createStorageCatalog } from "../core/storage/catalog.js";
|
|
4
|
+
import { HARNERY_STRUCTURED_LOG_PROVIDER_ID, } from "../core/storage/contract.js";
|
|
5
|
+
import { inspectStructuredLogRetention } from "../core/storage/log-retention.js";
|
|
6
|
+
import { queryLogs, rotationFollowCursor } from "../core/storage/query.js";
|
|
7
|
+
import { familyLogDirectory } from "../core/storage/segments.js";
|
|
8
|
+
export function registerLogsCommand(program, emit, context) {
|
|
9
|
+
const logs = program.command("logs").description("List and query bounded Harnery log families");
|
|
10
|
+
logs
|
|
11
|
+
.command("list")
|
|
12
|
+
.option("--json", "Emit structured output")
|
|
13
|
+
.action((options) => run(emit, async () => {
|
|
14
|
+
const catalog = catalogFor(context);
|
|
15
|
+
const capturedAt = new Date();
|
|
16
|
+
const rows = logFamilies(catalog.families).map((family) => logFamilyRow(family, capturedAt));
|
|
17
|
+
if (options.json) {
|
|
18
|
+
emit.config({ format: "json" });
|
|
19
|
+
emit.data({
|
|
20
|
+
schema: "harnery.logs-list/v2",
|
|
21
|
+
captured_at: capturedAt.toISOString(),
|
|
22
|
+
diagnostics: catalog.log_storage_diagnostics,
|
|
23
|
+
dormant_families: catalog.dormant_log_storage_families,
|
|
24
|
+
families: rows,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else
|
|
28
|
+
emit.rows(rows.map(logFamilyTableRow));
|
|
29
|
+
}));
|
|
30
|
+
const configureQuery = (command) => command
|
|
31
|
+
.option("--family <id...>", "Restrict to named families")
|
|
32
|
+
.option("--level <level>", "Minimum severity")
|
|
33
|
+
.option("--event <event>", "Exact event name")
|
|
34
|
+
.option("--since <timestamp>", "Earliest timestamp")
|
|
35
|
+
.option("--until <timestamp>", "Latest timestamp")
|
|
36
|
+
.option("--max-records <n>", "Global record scan budget", integer, 10_000)
|
|
37
|
+
.option("--max-bytes <n>", "Global byte scan budget", integer, 10 * 1024 * 1024)
|
|
38
|
+
.option("--json", "Emit structured output");
|
|
39
|
+
configureQuery(logs.command("query").description("Query sealed and active log segments")).action((options) => run(emit, async () => {
|
|
40
|
+
const result = await queryLogs(logFamilies(catalogFor(context).families), queryFrom(options));
|
|
41
|
+
if (options.json) {
|
|
42
|
+
emit.config({ format: "json" });
|
|
43
|
+
emit.data({ schema: "harnery.logs-query/v1", ...result });
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
emit.rows(result.records);
|
|
47
|
+
}));
|
|
48
|
+
configureQuery(logs.command("export").description("Export matching records as JSONL")).action((options) => run(emit, async () => {
|
|
49
|
+
const result = await queryLogs(logFamilies(catalogFor(context).families), queryFrom(options));
|
|
50
|
+
for (const record of result.records)
|
|
51
|
+
emit.text(JSON.stringify(record));
|
|
52
|
+
if (result.truncated)
|
|
53
|
+
emit.log("log export stopped at the configured global scan budget", "warn");
|
|
54
|
+
}));
|
|
55
|
+
logs
|
|
56
|
+
.command("tail")
|
|
57
|
+
.argument("<family>")
|
|
58
|
+
.description("Read recent records and a rotation-aware follow cursor")
|
|
59
|
+
.option("-n, --lines <n>", "Number of recent records", integer, 50)
|
|
60
|
+
.option("--max-bytes <n>", "Global byte scan budget", integer, 10 * 1024 * 1024)
|
|
61
|
+
.action((familyId, options) => run(emit, async () => {
|
|
62
|
+
const family = catalogFor(context).require(familyId);
|
|
63
|
+
if (!isLogFamily(family))
|
|
64
|
+
throw new Error(`storage family is not a log: ${familyId}`);
|
|
65
|
+
const result = await queryLogs([family], {
|
|
66
|
+
max_records: 10_000,
|
|
67
|
+
max_bytes: options.maxBytes,
|
|
68
|
+
});
|
|
69
|
+
emit.data({
|
|
70
|
+
schema: "harnery.logs-tail-cursor/v1",
|
|
71
|
+
records: result.records.slice(-options.lines),
|
|
72
|
+
truncated: result.truncated,
|
|
73
|
+
cursor: rotationFollowCursor(family),
|
|
74
|
+
});
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
function logFamilyRow(family, now) {
|
|
78
|
+
const inspection = inspectStructuredLogRetention(family, now);
|
|
79
|
+
const effective = family.effective_log_retention;
|
|
80
|
+
return {
|
|
81
|
+
family_id: family.id,
|
|
82
|
+
class: family.storage_class,
|
|
83
|
+
directory: structuredLogDirectory(family),
|
|
84
|
+
registered_roots: family.resolved_roots,
|
|
85
|
+
policy_version: family.policy.policy_version,
|
|
86
|
+
effective_policy: effective
|
|
87
|
+
? {
|
|
88
|
+
state: effective.state,
|
|
89
|
+
max_bytes: effective.max_bytes,
|
|
90
|
+
max_age_days: effective.max_age_days,
|
|
91
|
+
max_age_ms: effective.max_age_ms,
|
|
92
|
+
fingerprint: effective.effective_policy_fingerprint,
|
|
93
|
+
provenance: effective.provenance,
|
|
94
|
+
diagnostics: effective.diagnostics,
|
|
95
|
+
}
|
|
96
|
+
: null,
|
|
97
|
+
usage: inspection.usage,
|
|
98
|
+
pressure: inspection.pressure,
|
|
99
|
+
retention: inspection.retention,
|
|
100
|
+
sealed_segments: inspection.sealed_segments.length,
|
|
101
|
+
obsolete_manifest_snapshots: inspection.obsolete_snapshots.length,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function structuredLogDirectory(family) {
|
|
105
|
+
if (family.provider.provider_id !== HARNERY_STRUCTURED_LOG_PROVIDER_ID ||
|
|
106
|
+
family.format !== "jsonl") {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const root = family.resolved_roots.find((candidate) => candidate.match === "provider-partition" && candidate.ownership !== "external");
|
|
110
|
+
return root?.partition ? familyLogDirectory(family) : null;
|
|
111
|
+
}
|
|
112
|
+
function logFamilyTableRow(row) {
|
|
113
|
+
return {
|
|
114
|
+
family_id: row.family_id,
|
|
115
|
+
class: row.class,
|
|
116
|
+
max_bytes: row.effective_policy?.max_bytes ?? "unavailable",
|
|
117
|
+
max_age_days: row.effective_policy?.max_age_days ?? "unavailable",
|
|
118
|
+
managed_bytes: row.usage.managed_bytes,
|
|
119
|
+
unmanaged_bytes: row.usage.unmanaged_bytes,
|
|
120
|
+
pressure: row.pressure.state,
|
|
121
|
+
pressure_ratio: row.pressure.ratio === null ? "unavailable" : Number(row.pressure.ratio.toFixed(3)),
|
|
122
|
+
retention: row.retention.state,
|
|
123
|
+
enforcement: row.retention.enforcement,
|
|
124
|
+
reasons: row.retention.reason_codes.join(",") || "none",
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function catalogFor(context) {
|
|
128
|
+
const coordRoot = resolve(context?.resolveCoordRoot?.() ??
|
|
129
|
+
context?.repoRoot ??
|
|
130
|
+
process.env.HARNERY_COORD_ROOT ??
|
|
131
|
+
resolveCanonicalCoordRoot() ??
|
|
132
|
+
process.cwd());
|
|
133
|
+
return createStorageCatalog({ coord_root: coordRoot, project_root: resolve(context?.repoRoot ?? coordRoot) }, context?.storage);
|
|
134
|
+
}
|
|
135
|
+
function logFamilies(families) {
|
|
136
|
+
return families.filter(isLogFamily);
|
|
137
|
+
}
|
|
138
|
+
function isLogFamily(family) {
|
|
139
|
+
return family.storage_class === "operational-log" || family.storage_class === "debug-log";
|
|
140
|
+
}
|
|
141
|
+
function integer(value) {
|
|
142
|
+
const parsed = Number.parseInt(value, 10);
|
|
143
|
+
if (!Number.isSafeInteger(parsed) || parsed <= 0)
|
|
144
|
+
throw new Error(`invalid positive integer: ${value}`);
|
|
145
|
+
return parsed;
|
|
146
|
+
}
|
|
147
|
+
function queryFrom(options) {
|
|
148
|
+
return {
|
|
149
|
+
...(options.family ? { family_ids: options.family } : {}),
|
|
150
|
+
...(options.level ? { minimum_level: options.level } : {}),
|
|
151
|
+
...(options.event ? { event: options.event } : {}),
|
|
152
|
+
...(options.since ? { since: options.since } : {}),
|
|
153
|
+
...(options.until ? { until: options.until } : {}),
|
|
154
|
+
max_records: options.maxRecords,
|
|
155
|
+
max_bytes: options.maxBytes,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
async function run(emit, action) {
|
|
159
|
+
try {
|
|
160
|
+
await action();
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
emit.error({
|
|
164
|
+
code: "logs_query_failed",
|
|
165
|
+
message: error instanceof Error ? error.message : String(error),
|
|
166
|
+
});
|
|
167
|
+
emit.setExitCode(1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { EmitContext } from "../commander.js";
|
|
3
|
+
import type { HarneryInboxService } from "../core/inbox/service.js";
|
|
4
|
+
export declare function registerMessagesCommand(program: Command, emit: EmitContext, service?: HarneryInboxService): void;
|
|
5
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/commands/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,IAAI,CA+CN"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function registerMessagesCommand(program, emit, service) {
|
|
2
|
+
program
|
|
3
|
+
.command("messages")
|
|
4
|
+
.description("Queue a durable coordination message; dry-run unless --yes")
|
|
5
|
+
.requiredOption("--from <instance>")
|
|
6
|
+
.requiredOption("--from-name <name>")
|
|
7
|
+
.requiredOption("--to <instance>")
|
|
8
|
+
.requiredOption("--to-name <name>")
|
|
9
|
+
.requiredOption("--body <text>")
|
|
10
|
+
.option("--yes", "Append and sync the message")
|
|
11
|
+
.option("--json", "Emit stable JSON")
|
|
12
|
+
.action((options) => {
|
|
13
|
+
try {
|
|
14
|
+
const result = options.yes
|
|
15
|
+
? requireInboxService(service).send({
|
|
16
|
+
sender_instance_id: options.from,
|
|
17
|
+
sender_display_name: options.fromName,
|
|
18
|
+
recipient_instance_id: options.to,
|
|
19
|
+
recipient_display_name: options.toName,
|
|
20
|
+
body: options.body,
|
|
21
|
+
})
|
|
22
|
+
: {
|
|
23
|
+
state: "dry-run",
|
|
24
|
+
recipient_instance_id: options.to,
|
|
25
|
+
body_bytes: Buffer.byteLength(options.body),
|
|
26
|
+
writes: false,
|
|
27
|
+
};
|
|
28
|
+
if (options.json)
|
|
29
|
+
emit.config({ format: "json" });
|
|
30
|
+
emit.data({ schema: "harnery.message-send/v1", ...result });
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
emit.error({
|
|
34
|
+
code: "message_send_failed",
|
|
35
|
+
message: error instanceof Error ? error.message : String(error),
|
|
36
|
+
});
|
|
37
|
+
emit.setExitCode(1);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function requireInboxService(service) {
|
|
42
|
+
if (!service)
|
|
43
|
+
throw new Error("coordination inbox is not configured by this host");
|
|
44
|
+
return service;
|
|
45
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
2
|
import type { EmitContext } from "../commander.js";
|
|
3
|
-
export declare function registerOutlineCommand(program: Command, emit: EmitContext): void;
|
|
3
|
+
export declare function registerOutlineCommand(program: Command, emit: EmitContext, binName?: string): void;
|
|
4
4
|
//# sourceMappingURL=outline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outline.d.ts","sourceRoot":"","sources":["../../src/commands/outline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAqDnD,wBAAgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"outline.d.ts","sourceRoot":"","sources":["../../src/commands/outline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAqDnD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,SAAmB,GACzB,IAAI,CAwBN"}
|
package/dist/commands/outline.js
CHANGED
|
@@ -16,10 +16,10 @@ async function loadTypeScript() {
|
|
|
16
16
|
throw new Error("outlining TS/JS files needs the `typescript` package; install it (npm i -D typescript) or use outline on PHP/Python files");
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
export function registerOutlineCommand(program, emit) {
|
|
19
|
+
export function registerOutlineCommand(program, emit, binName = resolveBinName()) {
|
|
20
20
|
program
|
|
21
21
|
.command("outline <file>")
|
|
22
|
-
.description(`Print the structural skeleton of a code file (imports + top-level decls + line numbers). Supports TS/JS/TSX/JSX (AST), PHP/Python (regex). Use \`${
|
|
22
|
+
.description(`Print the structural skeleton of a code file (imports + top-level decls + line numbers). Supports TS/JS/TSX/JSX (AST), PHP/Python (regex). Use \`${binName} toc\` for markdown.`)
|
|
23
23
|
.option("--json", "Structured JSON envelope")
|
|
24
24
|
.option("--exports-only", "Only show exported symbols")
|
|
25
25
|
.option("--no-imports", "Skip the imports summary block")
|
package/dist/commands/read.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type { EmitContext } from "../commander.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* `harn read`: extract clean readable markdown from HTML.
|
|
5
5
|
*/
|
|
6
|
-
export declare function registerReadCommand(program: Command, emitParam: EmitContext): void;
|
|
6
|
+
export declare function registerReadCommand(program: Command, emitParam: EmitContext, binName?: string): void;
|
|
7
7
|
//# sourceMappingURL=read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/commands/read.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAQnD;;GAEG;AACH,wBAAgB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/commands/read.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAQnD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,SAAmB,GACzB,IAAI,CAwBN"}
|
package/dist/commands/read.js
CHANGED
|
@@ -7,11 +7,11 @@ let emit;
|
|
|
7
7
|
/**
|
|
8
8
|
* `harn read`: extract clean readable markdown from HTML.
|
|
9
9
|
*/
|
|
10
|
-
export function registerReadCommand(program, emitParam) {
|
|
10
|
+
export function registerReadCommand(program, emitParam, binName = resolveBinName()) {
|
|
11
11
|
emit = emitParam;
|
|
12
12
|
program
|
|
13
13
|
.command("read [html-file]")
|
|
14
|
-
.description(`Extract clean readable markdown from HTML. Reads from file or stdin (use '-'). Pair with \`${
|
|
14
|
+
.description(`Extract clean readable markdown from HTML. Reads from file or stdin (use '-'). Pair with \`${binName} fetch\` or \`${binName} browse\` for scrape-to-markdown.`)
|
|
15
15
|
.option("-o, --output <file>", "Write markdown to file instead of stdout")
|
|
16
16
|
.option("--url <url>", "Base URL: used to resolve relative links")
|
|
17
17
|
.option("--selector <css>", "Use this CSS selector instead of Readability (fallback when extraction misses content)")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/commands/semantic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/commands/semantic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAiB1E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CA8LN"}
|