@skrr-ai/cli 0.1.119 → 0.1.121
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/base-command.d.ts +31 -0
- package/dist/base-command.js +117 -6
- package/dist/commands/agent/message/context.d.ts +1 -0
- package/dist/commands/agent/message/context.js +3 -2
- package/dist/commands/commands.js +11 -0
- package/dist/commands/commitments/action-proposal.d.ts +13 -0
- package/dist/commands/commitments/action-proposal.js +39 -0
- package/dist/commands/commitments/action-proposals/decide.js +8 -1
- package/dist/commands/commitments/action-proposals/execute.js +11 -1
- package/dist/commands/commitments/create.js +2 -2
- package/dist/commands/commitments/doctor.d.ts +8 -0
- package/dist/commands/commitments/doctor.js +22 -0
- package/dist/commands/commitments/execute-remediation.js +12 -1
- package/dist/commands/commitments/observations.js +2 -2
- package/dist/commands/commitments/pack/bind.d.ts +18 -1
- package/dist/commands/commitments/pack/bind.js +66 -8
- package/dist/commands/commitments/pack/plan.d.ts +4 -1
- package/dist/commands/commitments/pack/plan.js +30 -2
- package/dist/commands/commitments/update.js +8 -2
- package/dist/commands/completion/index.js +1 -1
- package/dist/commands/completion/values.js +1 -1
- package/dist/commands/computer-use/audio.d.ts +1 -0
- package/dist/commands/computer-use/audio.js +1 -0
- package/dist/commands/computer-use/browser.d.ts +1 -0
- package/dist/commands/computer-use/browser.js +1 -0
- package/dist/commands/computer-use/disable.d.ts +1 -0
- package/dist/commands/computer-use/disable.js +1 -0
- package/dist/commands/computer-use/enable.d.ts +1 -0
- package/dist/commands/computer-use/enable.js +1 -0
- package/dist/commands/computer-use/index.d.ts +1 -0
- package/dist/commands/computer-use/index.js +1 -0
- package/dist/commands/computer-use/install.d.ts +1 -0
- package/dist/commands/computer-use/install.js +1 -0
- package/dist/commands/computer-use/recover.d.ts +1 -0
- package/dist/commands/computer-use/recover.js +1 -0
- package/dist/commands/computer-use/status.d.ts +1 -0
- package/dist/commands/computer-use/status.js +1 -0
- package/dist/commands/computer-use/stop.d.ts +1 -0
- package/dist/commands/computer-use/stop.js +1 -0
- package/dist/commands/context.js +16 -11
- package/dist/commands/convos/recovery.js +1 -1
- package/dist/commands/daemon/diagnostics.d.ts +9 -0
- package/dist/commands/daemon/diagnostics.js +53 -0
- package/dist/commands/daemon/index.js +2 -0
- package/dist/commands/daemon/maintenance/attest.d.ts +15 -0
- package/dist/commands/daemon/maintenance/attest.js +52 -0
- package/dist/commands/daemon/maintenance/hold.d.ts +17 -0
- package/dist/commands/daemon/maintenance/hold.js +70 -0
- package/dist/commands/daemon/maintenance/index.d.ts +12 -0
- package/dist/commands/daemon/maintenance/index.js +30 -0
- package/dist/commands/daemon/maintenance/resume.d.ts +13 -0
- package/dist/commands/daemon/maintenance/resume.js +36 -0
- package/dist/commands/daemon/maintenance/status.d.ts +13 -0
- package/dist/commands/daemon/maintenance/status.js +36 -0
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.js +50 -6
- package/dist/commands/followups/plans/cancel-batch.js +6 -3
- package/dist/commands/followups/plans/capacity.js +7 -3
- package/dist/commands/followups/plans/observability.js +11 -3
- package/dist/commands/followups/plans/preferences/set.js +26 -8
- package/dist/commands/followups/plans/preferences.js +1 -1
- package/dist/commands/followups/plans/show.js +1 -1
- package/dist/commands/goals/key-results/assess.d.ts +36 -0
- package/dist/commands/goals/key-results/assess.js +110 -0
- package/dist/commands/goals/key-results/history.d.ts +30 -0
- package/dist/commands/goals/key-results/history.js +104 -0
- package/dist/commands/goals/key-results/list.d.ts +5 -4
- package/dist/commands/goals/key-results/list.js +12 -6
- package/dist/commands/goals/key-results/show.d.ts +4 -2
- package/dist/commands/goals/key-results/show.js +25 -4
- package/dist/commands/goals/key-results/update.d.ts +4 -0
- package/dist/commands/goals/key-results/update.js +18 -24
- package/dist/commands/goals/plan-now.js +12 -1
- package/dist/commands/goals/planner-compare.d.ts +30 -0
- package/dist/commands/goals/planner-compare.js +136 -0
- package/dist/commands/machines/dedicated/service/exec.d.ts +3 -0
- package/dist/commands/machines/dedicated/service/exec.js +70 -11
- package/dist/commands/machines/hosted/destroy.d.ts +1 -0
- package/dist/commands/machines/hosted/destroy.js +11 -1
- package/dist/commands/machines/hosted/exec.d.ts +1 -0
- package/dist/commands/machines/hosted/exec.js +12 -1
- package/dist/commands/machines/hosted/index.js +1 -0
- package/dist/commands/machines/hosted/operation.d.ts +14 -0
- package/dist/commands/machines/hosted/operation.js +51 -0
- package/dist/commands/machines/hosted/pull.js +1 -1
- package/dist/commands/machines/hosted/start.js +6 -2
- package/dist/commands/search/agents.js +5 -1
- package/dist/commands/search/all.js +74 -22
- package/dist/commands/search/skills.d.ts +1 -0
- package/dist/commands/search/skills.js +12 -1
- package/dist/commands/search/spaces.d.ts +8 -1
- package/dist/commands/search/spaces.js +50 -12
- package/dist/commands/search/tasks.d.ts +13 -2
- package/dist/commands/search/tasks.js +78 -14
- package/dist/commands/search/teams.js +5 -1
- package/dist/commands/search/workspace.d.ts +19 -0
- package/dist/commands/search/workspace.js +126 -0
- package/dist/commands/skills/browse.d.ts +1 -0
- package/dist/commands/skills/browse.js +8 -1
- package/dist/commands/skills/search.d.ts +1 -0
- package/dist/commands/skills/search.js +12 -1
- package/dist/commands/spaces/auto-executor/compare.d.ts +18 -0
- package/dist/commands/spaces/auto-executor/compare.js +139 -0
- package/dist/commands/spaces/auto-executor/runs.d.ts +3 -0
- package/dist/commands/spaces/auto-executor/runs.js +13 -1
- package/dist/commands/spaces/charter/create-from-description.d.ts +21 -0
- package/dist/commands/spaces/charter/create-from-description.js +77 -0
- package/dist/commands/spaces/charter/show.d.ts +22 -0
- package/dist/commands/spaces/charter/show.js +61 -0
- package/dist/commands/spaces/heartbeats/list.d.ts +1 -16
- package/dist/commands/spaces/heartbeats/list.js +13 -0
- package/dist/commands/spaces/install-template.js +3 -0
- package/dist/commands/spaces/list.d.ts +1 -0
- package/dist/commands/spaces/list.js +12 -3
- package/dist/commands/spaces/loops/migrate.d.ts +32 -0
- package/dist/commands/spaces/loops/migrate.js +103 -0
- package/dist/commands/spaces/loops/release.d.ts +14 -0
- package/dist/commands/spaces/loops/release.js +59 -0
- package/dist/commands/spaces/notebook.d.ts +25 -0
- package/dist/commands/spaces/notebook.js +75 -0
- package/dist/commands/spaces/proposals/discard.d.ts +17 -0
- package/dist/commands/spaces/proposals/discard.js +17 -0
- package/dist/commands/spaces/proposals/keep.d.ts +17 -0
- package/dist/commands/spaces/proposals/keep.js +17 -0
- package/dist/commands/spaces/proposals/list.d.ts +24 -0
- package/dist/commands/spaces/proposals/list.js +89 -0
- package/dist/commands/spaces/search.d.ts +1 -0
- package/dist/commands/spaces/search.js +9 -0
- package/dist/commands/spaces/skills/propose.d.ts +29 -0
- package/dist/commands/spaces/skills/propose.js +82 -0
- package/dist/commands/spaces/templates/fork.js +3 -0
- package/dist/commands/spaces/triggers/show.js +6 -0
- package/dist/commands/spaces/workflows/retry.d.ts +1 -0
- package/dist/commands/spaces/workflows/retry.js +8 -1
- package/dist/commands/spaces/workflows/triggers/create.js +3 -2
- package/dist/commands/spaces/workflows/triggers/fire.js +4 -0
- package/dist/commands/spaces/workflows/triggers/update.js +2 -1
- package/dist/commands/spaces/write-policy/set.d.ts +22 -0
- package/dist/commands/spaces/write-policy/set.js +82 -0
- package/dist/commands/spaces/write-policy/show.d.ts +19 -0
- package/dist/commands/spaces/write-policy/show.js +49 -0
- package/dist/commands/store/artifacts/receipt.d.ts +14 -0
- package/dist/commands/store/artifacts/receipt.js +34 -0
- package/dist/commands/store/artifacts/release.d.ts +2 -0
- package/dist/commands/store/artifacts/release.js +11 -0
- package/dist/commands/store/governance/publish-release.d.ts +2 -0
- package/dist/commands/store/governance/publish-release.js +30 -1
- package/dist/commands/store/governance/release-receipt.d.ts +12 -0
- package/dist/commands/store/governance/release-receipt.js +32 -0
- package/dist/commands/tasks/approvals/list.d.ts +11 -5
- package/dist/commands/tasks/approvals/list.js +13 -6
- package/dist/commands/tasks/attachments/facts.d.ts +12 -0
- package/dist/commands/tasks/attachments/facts.js +29 -0
- package/dist/commands/tasks/attachments/upload.d.ts +1 -0
- package/dist/commands/tasks/attachments/upload.js +16 -0
- package/dist/commands/tasks/bulk-update.js +35 -1
- package/dist/commands/tasks/context.d.ts +15 -0
- package/dist/commands/tasks/context.js +69 -0
- package/dist/commands/tasks/copy.d.ts +18 -0
- package/dist/commands/tasks/copy.js +85 -0
- package/dist/commands/tasks/create-tree.js +97 -23
- package/dist/commands/tasks/create.js +9 -1
- package/dist/commands/tasks/deliverable/add.js +20 -10
- package/dist/commands/tasks/move.js +8 -1
- package/dist/commands/tasks/operations/show.d.ts +16 -0
- package/dist/commands/tasks/operations/show.js +98 -0
- package/dist/commands/tasks/operations/wait.d.ts +22 -0
- package/dist/commands/tasks/operations/wait.js +114 -0
- package/dist/commands/tasks/preflight.d.ts +1 -0
- package/dist/commands/tasks/preflight.js +11 -1
- package/dist/commands/tasks/rearm-recurrence.js +4 -0
- package/dist/commands/tasks/result/show.js +22 -0
- package/dist/commands/tasks/result/submit.d.ts +1 -0
- package/dist/commands/tasks/result/submit.js +3 -0
- package/dist/commands/tasks/retry-receipt.d.ts +15 -0
- package/dist/commands/tasks/retry-receipt.js +89 -0
- package/dist/commands/tasks/retry-review.d.ts +16 -0
- package/dist/commands/tasks/retry-review.js +66 -0
- package/dist/commands/tasks/retry.d.ts +4 -8
- package/dist/commands/tasks/retry.js +34 -68
- package/dist/commands/tasks/runs.d.ts +21 -0
- package/dist/commands/tasks/runs.js +95 -0
- package/dist/commands/tasks/search.d.ts +1 -0
- package/dist/commands/tasks/search.js +9 -0
- package/dist/commands/tasks/show.d.ts +2 -0
- package/dist/commands/tasks/show.js +15 -1
- package/dist/commands/tasks/start-receipt.d.ts +15 -0
- package/dist/commands/tasks/start-receipt.js +95 -0
- package/dist/commands/tasks/start.d.ts +4 -0
- package/dist/commands/tasks/start.js +49 -3
- package/dist/commands/tasks/update.js +3 -0
- package/dist/commands/tasks/upsert.js +17 -3
- package/dist/commands/tasks/watch.d.ts +3 -0
- package/dist/commands/tasks/watch.js +85 -20
- package/dist/commands/wiki/history.d.ts +33 -0
- package/dist/commands/wiki/history.js +134 -0
- package/dist/commands/wiki/ls.d.ts +2 -0
- package/dist/commands/wiki/ls.js +8 -0
- package/dist/commands/wiki/update.d.ts +3 -1
- package/dist/commands/wiki/update.js +24 -2
- package/dist/commands/wiki/write.d.ts +22 -0
- package/dist/commands/wiki/write.js +144 -6
- package/dist/generated/agent-guides.json +81 -81
- package/dist/generated/managed-instruction-guides.json +1 -1
- package/dist/lib/agent-guides.d.ts +9 -0
- package/dist/lib/agent-guides.js +23 -1
- package/dist/lib/agentic-stream.d.ts +5 -0
- package/dist/lib/agentic-stream.js +122 -3
- package/dist/lib/api-error-reason.d.ts +2 -0
- package/dist/lib/api-error-reason.js +14 -0
- package/dist/lib/api-fetch.js +3 -0
- package/dist/lib/auth-diagnostics.d.ts +39 -0
- package/dist/lib/auth-diagnostics.js +71 -0
- package/dist/lib/cli-client-identity.d.ts +6 -0
- package/dist/lib/cli-client-identity.js +16 -0
- package/dist/lib/cli-installation-diagnostics.d.ts +52 -0
- package/dist/lib/cli-installation-diagnostics.js +254 -0
- package/dist/lib/command-hygiene.d.ts +45 -0
- package/dist/lib/command-hygiene.js +413 -0
- package/dist/lib/commitments.d.ts +64 -3
- package/dist/lib/commitments.js +34 -6
- package/dist/lib/completion-index.d.ts +16 -4
- package/dist/lib/completion-index.js +50 -14
- package/dist/lib/config.js +7 -1
- package/dist/lib/daemon-maintenance-command.d.ts +22 -0
- package/dist/lib/daemon-maintenance-command.js +39 -0
- package/dist/lib/daemon-maintenance.d.ts +275 -0
- package/dist/lib/daemon-maintenance.js +1035 -0
- package/dist/lib/dedicated-service.d.ts +3 -2
- package/dist/lib/dedicated-service.js +11 -3
- package/dist/lib/governed-store.d.ts +8 -0
- package/dist/lib/governed-store.js +5 -0
- package/dist/lib/hosted-machines.d.ts +33 -2
- package/dist/lib/hosted-machines.js +19 -1
- package/dist/lib/json-output.d.ts +1 -1
- package/dist/lib/machines.d.ts +9 -1
- package/dist/lib/machines.js +15 -1
- package/dist/lib/node-adapter.js +13 -0
- package/dist/lib/record-output.d.ts +22 -0
- package/dist/lib/record-output.js +78 -0
- package/dist/lib/roles.d.ts +3 -3
- package/dist/lib/scoped-memory-command.d.ts +18 -0
- package/dist/lib/scoped-memory-command.js +53 -2
- package/dist/lib/search-display.d.ts +7 -0
- package/dist/lib/search-display.js +31 -0
- package/dist/lib/skill-store-pagination.d.ts +8 -0
- package/dist/lib/skill-store-pagination.js +35 -0
- package/dist/lib/space-charter.d.ts +49 -0
- package/dist/lib/space-charter.js +78 -0
- package/dist/lib/space-loop-migration.d.ts +18 -0
- package/dist/lib/space-loop-migration.js +128 -0
- package/dist/lib/space-notebook.d.ts +22 -0
- package/dist/lib/space-notebook.js +140 -0
- package/dist/lib/space-proposal-decision-command.d.ts +36 -0
- package/dist/lib/space-proposal-decision-command.js +108 -0
- package/dist/lib/space-proposals.d.ts +44 -0
- package/dist/lib/space-proposals.js +186 -0
- package/dist/lib/space-templates.d.ts +8 -0
- package/dist/lib/space-templates.js +17 -0
- package/dist/lib/space-write-policy.d.ts +24 -0
- package/dist/lib/space-write-policy.js +103 -0
- package/dist/lib/task-agent-context-capabilities.d.ts +10 -0
- package/dist/lib/task-agent-context-capabilities.js +22 -0
- package/dist/lib/task-agent-context-compatibility.d.ts +9 -0
- package/dist/lib/task-agent-context-compatibility.js +30 -0
- package/dist/lib/task-asset-upload.d.ts +22 -0
- package/dist/lib/task-asset-upload.js +257 -29
- package/dist/lib/task-batch.d.ts +15 -1
- package/dist/lib/task-batch.js +35 -2
- package/dist/lib/task-operation-watch.d.ts +66 -0
- package/dist/lib/task-operation-watch.js +159 -0
- package/dist/lib/task-resolver.d.ts +1 -1
- package/dist/lib/task-resolver.js +4 -3
- package/dist/lib/task-work.d.ts +1 -1
- package/dist/lib/task-work.js +35 -1
- package/dist/lib/task-write-attribution.d.ts +14 -0
- package/dist/lib/task-write-attribution.js +35 -2
- package/dist/lib/triggers.d.ts +11 -0
- package/dist/lib/triggers.js +7 -0
- package/dist/lib/wiki-update.d.ts +1 -0
- package/dist/lib/wiki-update.js +10 -1
- package/dist/lib/wiki.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +31 -15
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.d.ts +10 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +147 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonConsentProof.d.ts +20 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonConsentProof.js +72 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +1 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +13 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopDaemonProof.d.ts +21 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopDaemonProof.js +96 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +2 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +102 -20
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.d.ts +370 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +315 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineReservation.d.ts +27 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineReservation.js +161 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineScopes.d.ts +26 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineScopes.js +41 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +15 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/kek/macos.js +20 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.d.ts +178 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.js +262 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +106 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +32 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.d.ts +10 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +172 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonConsentProof.d.ts +20 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonConsentProof.js +43 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +1 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +33 -14
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopDaemonProof.d.ts +21 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopDaemonProof.js +62 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +2 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +133 -25
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.d.ts +370 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +404 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineReservation.d.ts +27 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineReservation.js +132 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineScopes.d.ts +26 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineScopes.js +15 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/kek/macos.js +28 -15
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.d.ts +178 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.js +342 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +138 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +51 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +27181 -20293
- package/oclif.manifest.json +5745 -1813
- package/package.json +20 -2
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var maintenanceReportWire_exports = {};
|
|
20
|
+
__export(maintenanceReportWire_exports, {
|
|
21
|
+
MAINTENANCE_REPORT_CAPABILITY: () => MAINTENANCE_REPORT_CAPABILITY,
|
|
22
|
+
MAINTENANCE_REPORT_HANDOFF_PHASES: () => MAINTENANCE_REPORT_HANDOFF_PHASES,
|
|
23
|
+
MAINTENANCE_REPORT_HEARTBEAT_KEY: () => MAINTENANCE_REPORT_HEARTBEAT_KEY,
|
|
24
|
+
MAINTENANCE_REPORT_LIMITS: () => MAINTENANCE_REPORT_LIMITS,
|
|
25
|
+
MAINTENANCE_REPORT_VERSION: () => MAINTENANCE_REPORT_VERSION,
|
|
26
|
+
buildMaintenanceReport: () => buildMaintenanceReport,
|
|
27
|
+
maintenanceReportIsQuiet: () => maintenanceReportIsQuiet,
|
|
28
|
+
parseMaintenanceReport: () => parseMaintenanceReport,
|
|
29
|
+
parseStoredMaintenanceReport: () => parseStoredMaintenanceReport,
|
|
30
|
+
unknownMaintenanceReport: () => unknownMaintenanceReport
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(maintenanceReportWire_exports);
|
|
33
|
+
const MAINTENANCE_REPORT_CAPABILITY = "maintenance_report_v1";
|
|
34
|
+
const MAINTENANCE_REPORT_HEARTBEAT_KEY = "maintenanceReport";
|
|
35
|
+
const MAINTENANCE_REPORT_VERSION = 1;
|
|
36
|
+
const MAINTENANCE_REPORT_HANDOFF_PHASES = [
|
|
37
|
+
"ready",
|
|
38
|
+
"deferred",
|
|
39
|
+
"reconnecting",
|
|
40
|
+
"verified",
|
|
41
|
+
"failed",
|
|
42
|
+
"rolled-back"
|
|
43
|
+
];
|
|
44
|
+
const MAINTENANCE_REPORT_LIMITS = {
|
|
45
|
+
/** The handoff's blockers carried for the "waiting on" text; the counts, not this list, decide busy. */
|
|
46
|
+
maxBlockers: 32,
|
|
47
|
+
maxKindLength: 32,
|
|
48
|
+
maxIdLength: 128,
|
|
49
|
+
maxReasonLength: 240,
|
|
50
|
+
maxHandoffIdLength: 64,
|
|
51
|
+
maxHandoffReasonLength: 64,
|
|
52
|
+
maxProcessStartIdLength: 64,
|
|
53
|
+
/** Hard ceiling on the serialized report. The clamps above keep a valid one well under it. */
|
|
54
|
+
maxSerializedBytes: 2e4
|
|
55
|
+
};
|
|
56
|
+
const PROCESS_START_ID_PATTERN = /^[A-Za-z0-9_.:-]+$/;
|
|
57
|
+
const CONTROL_CHARACTERS = /[\u0000-\u001f\u007f]/g;
|
|
58
|
+
function isRecord(value) {
|
|
59
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60
|
+
}
|
|
61
|
+
function field(record, key) {
|
|
62
|
+
return Object.prototype.hasOwnProperty.call(record, key) ? record[key] : void 0;
|
|
63
|
+
}
|
|
64
|
+
function isoFromMs(ms) {
|
|
65
|
+
if (typeof ms !== "number" || !Number.isFinite(ms))
|
|
66
|
+
return "";
|
|
67
|
+
const date = new Date(ms);
|
|
68
|
+
return Number.isNaN(date.getTime()) ? "" : date.toISOString();
|
|
69
|
+
}
|
|
70
|
+
function count(value) {
|
|
71
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
72
|
+
}
|
|
73
|
+
function clampText(value, max) {
|
|
74
|
+
if (typeof value !== "string")
|
|
75
|
+
return null;
|
|
76
|
+
const clean = value.replace(CONTROL_CHARACTERS, " ");
|
|
77
|
+
return clean.length > max ? clean.slice(0, max) : clean;
|
|
78
|
+
}
|
|
79
|
+
function isoOf(value) {
|
|
80
|
+
if (typeof value !== "string")
|
|
81
|
+
return null;
|
|
82
|
+
const ms = Date.parse(value);
|
|
83
|
+
if (!Number.isFinite(ms))
|
|
84
|
+
return null;
|
|
85
|
+
try {
|
|
86
|
+
return new Date(ms).toISOString();
|
|
87
|
+
} catch {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function completeOf(value) {
|
|
92
|
+
return value === true || value === false || value === "unknown" ? value : void 0;
|
|
93
|
+
}
|
|
94
|
+
function parseMaintenanceReport(raw) {
|
|
95
|
+
if (!isRecord(raw))
|
|
96
|
+
return null;
|
|
97
|
+
if (field(raw, "version") !== MAINTENANCE_REPORT_VERSION)
|
|
98
|
+
return null;
|
|
99
|
+
const processStartId = field(raw, "processStartId");
|
|
100
|
+
if (typeof processStartId !== "string" || processStartId.length < 1 || processStartId.length > MAINTENANCE_REPORT_LIMITS.maxProcessStartIdLength || !PROCESS_START_ID_PATTERN.test(processStartId)) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
const readAt = isoOf(field(raw, "readAt"));
|
|
104
|
+
if (readAt === null)
|
|
105
|
+
return null;
|
|
106
|
+
const complete = completeOf(field(raw, "complete"));
|
|
107
|
+
if (complete === void 0)
|
|
108
|
+
return null;
|
|
109
|
+
const admittedTotal = count(field(raw, "admittedTotal"));
|
|
110
|
+
if (admittedTotal === null)
|
|
111
|
+
return null;
|
|
112
|
+
const rawInflight = field(raw, "inflight");
|
|
113
|
+
if (!isRecord(rawInflight))
|
|
114
|
+
return null;
|
|
115
|
+
const sessions = count(field(rawInflight, "sessions"));
|
|
116
|
+
const tools = count(field(rawInflight, "tools"));
|
|
117
|
+
const terminals = count(field(rawInflight, "terminals"));
|
|
118
|
+
const providerDependencies = count(field(rawInflight, "providerDependencies"));
|
|
119
|
+
const walUnconfirmed = count(field(rawInflight, "walUnconfirmed"));
|
|
120
|
+
if (sessions === null || tools === null || terminals === null || providerDependencies === null || walUnconfirmed === null) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const rawBlockers = field(raw, "blockers");
|
|
124
|
+
if (!Array.isArray(rawBlockers))
|
|
125
|
+
return null;
|
|
126
|
+
const rawTruncated = field(raw, "blockersTruncated");
|
|
127
|
+
if (rawTruncated !== void 0 && typeof rawTruncated !== "boolean")
|
|
128
|
+
return null;
|
|
129
|
+
const limit = MAINTENANCE_REPORT_LIMITS.maxBlockers;
|
|
130
|
+
const blockers = [];
|
|
131
|
+
for (let index = 0; index < rawBlockers.length && blockers.length < limit; index += 1) {
|
|
132
|
+
const element = rawBlockers[index];
|
|
133
|
+
if (!isRecord(element))
|
|
134
|
+
return null;
|
|
135
|
+
const kind = clampText(field(element, "kind"), MAINTENANCE_REPORT_LIMITS.maxKindLength);
|
|
136
|
+
const reason = clampText(field(element, "reason"), MAINTENANCE_REPORT_LIMITS.maxReasonLength);
|
|
137
|
+
if (kind === null || kind === "" || reason === null)
|
|
138
|
+
return null;
|
|
139
|
+
const blocker = { kind, reason };
|
|
140
|
+
const rawId = field(element, "id");
|
|
141
|
+
if (rawId !== void 0) {
|
|
142
|
+
const id = clampText(rawId, MAINTENANCE_REPORT_LIMITS.maxIdLength);
|
|
143
|
+
if (id === null)
|
|
144
|
+
return null;
|
|
145
|
+
blocker.id = id;
|
|
146
|
+
}
|
|
147
|
+
blockers.push(blocker);
|
|
148
|
+
}
|
|
149
|
+
const blockersTruncated = rawBlockers.length > limit || rawTruncated === true;
|
|
150
|
+
const rawHandoff = field(raw, "handoff");
|
|
151
|
+
if (rawHandoff === void 0)
|
|
152
|
+
return null;
|
|
153
|
+
let handoff = null;
|
|
154
|
+
if (rawHandoff !== null) {
|
|
155
|
+
if (!isRecord(rawHandoff))
|
|
156
|
+
return null;
|
|
157
|
+
const phase = field(rawHandoff, "phase");
|
|
158
|
+
if (!MAINTENANCE_REPORT_HANDOFF_PHASES.includes(phase))
|
|
159
|
+
return null;
|
|
160
|
+
const handoffId = clampText(field(rawHandoff, "handoffId"), MAINTENANCE_REPORT_LIMITS.maxHandoffIdLength);
|
|
161
|
+
if (handoffId === null || handoffId === "")
|
|
162
|
+
return null;
|
|
163
|
+
handoff = { phase, handoffId };
|
|
164
|
+
const rawReason = field(rawHandoff, "reason");
|
|
165
|
+
if (rawReason !== void 0) {
|
|
166
|
+
const reason = clampText(rawReason, MAINTENANCE_REPORT_LIMITS.maxHandoffReasonLength);
|
|
167
|
+
if (reason === null)
|
|
168
|
+
return null;
|
|
169
|
+
handoff.reason = reason;
|
|
170
|
+
}
|
|
171
|
+
const rawExpiresAt = field(rawHandoff, "expiresAt");
|
|
172
|
+
if (rawExpiresAt !== void 0) {
|
|
173
|
+
const expiresAt = isoOf(rawExpiresAt);
|
|
174
|
+
if (expiresAt === null)
|
|
175
|
+
return null;
|
|
176
|
+
handoff.expiresAt = expiresAt;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const report = {
|
|
180
|
+
version: MAINTENANCE_REPORT_VERSION,
|
|
181
|
+
processStartId,
|
|
182
|
+
readAt,
|
|
183
|
+
complete,
|
|
184
|
+
admittedTotal,
|
|
185
|
+
inflight: { sessions, tools, terminals, providerDependencies, walUnconfirmed },
|
|
186
|
+
blockers,
|
|
187
|
+
blockersTruncated,
|
|
188
|
+
handoff
|
|
189
|
+
};
|
|
190
|
+
if (JSON.stringify(report).length > MAINTENANCE_REPORT_LIMITS.maxSerializedBytes)
|
|
191
|
+
return null;
|
|
192
|
+
return report;
|
|
193
|
+
}
|
|
194
|
+
function parseStoredMaintenanceReport(stored) {
|
|
195
|
+
if (typeof stored !== "string" || stored === "")
|
|
196
|
+
return null;
|
|
197
|
+
if (stored.length > MAINTENANCE_REPORT_LIMITS.maxSerializedBytes)
|
|
198
|
+
return null;
|
|
199
|
+
try {
|
|
200
|
+
return parseMaintenanceReport(JSON.parse(stored));
|
|
201
|
+
} catch {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function maintenanceReportIsQuiet(report) {
|
|
206
|
+
if (!report)
|
|
207
|
+
return false;
|
|
208
|
+
if (report.complete !== true)
|
|
209
|
+
return false;
|
|
210
|
+
const { sessions, tools, terminals, providerDependencies, walUnconfirmed } = report.inflight;
|
|
211
|
+
return sessions === 0 && tools === 0 && terminals === 0 && providerDependencies === 0 && walUnconfirmed === 0;
|
|
212
|
+
}
|
|
213
|
+
function unknownMaintenanceReport(processStartId, readAtMs, admittedTotal = 0) {
|
|
214
|
+
return {
|
|
215
|
+
version: MAINTENANCE_REPORT_VERSION,
|
|
216
|
+
processStartId,
|
|
217
|
+
readAt: isoFromMs(readAtMs) || (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
218
|
+
complete: "unknown",
|
|
219
|
+
admittedTotal: count(admittedTotal) ?? 0,
|
|
220
|
+
inflight: { sessions: 0, tools: 0, terminals: 0, providerDependencies: 0, walUnconfirmed: 0 },
|
|
221
|
+
blockers: [],
|
|
222
|
+
blockersTruncated: false,
|
|
223
|
+
handoff: null
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function buildMaintenanceReport(input) {
|
|
227
|
+
const blockers = input.blockers.slice(0, MAINTENANCE_REPORT_LIMITS.maxBlockers).map((blocker) => ({
|
|
228
|
+
kind: blocker.kind,
|
|
229
|
+
...blocker.id !== void 0 ? { id: blocker.id } : {},
|
|
230
|
+
reason: blocker.reason
|
|
231
|
+
}));
|
|
232
|
+
const candidate = {
|
|
233
|
+
version: MAINTENANCE_REPORT_VERSION,
|
|
234
|
+
processStartId: input.processStartId,
|
|
235
|
+
readAt: isoFromMs(input.readAtMs),
|
|
236
|
+
complete: input.complete,
|
|
237
|
+
admittedTotal: input.admittedTotal,
|
|
238
|
+
inflight: { ...input.inflight },
|
|
239
|
+
blockers,
|
|
240
|
+
blockersTruncated: input.blockers.length > MAINTENANCE_REPORT_LIMITS.maxBlockers,
|
|
241
|
+
handoff: input.handoff ? {
|
|
242
|
+
phase: input.handoff.phase,
|
|
243
|
+
handoffId: input.handoff.handoffId,
|
|
244
|
+
...input.handoff.reason !== void 0 ? { reason: input.handoff.reason } : {},
|
|
245
|
+
...input.handoff.expiresAtMs !== void 0 ? { expiresAt: isoFromMs(input.handoff.expiresAtMs) } : {}
|
|
246
|
+
} : null
|
|
247
|
+
};
|
|
248
|
+
return parseMaintenanceReport(candidate) ?? unknownMaintenanceReport(input.processStartId, input.readAtMs, input.admittedTotal);
|
|
249
|
+
}
|
|
250
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
251
|
+
0 && (module.exports = {
|
|
252
|
+
MAINTENANCE_REPORT_CAPABILITY,
|
|
253
|
+
MAINTENANCE_REPORT_HANDOFF_PHASES,
|
|
254
|
+
MAINTENANCE_REPORT_HEARTBEAT_KEY,
|
|
255
|
+
MAINTENANCE_REPORT_LIMITS,
|
|
256
|
+
MAINTENANCE_REPORT_VERSION,
|
|
257
|
+
buildMaintenanceReport,
|
|
258
|
+
maintenanceReportIsQuiet,
|
|
259
|
+
parseMaintenanceReport,
|
|
260
|
+
parseStoredMaintenanceReport,
|
|
261
|
+
unknownMaintenanceReport
|
|
262
|
+
});
|
|
@@ -177,6 +177,57 @@ export declare function signToolApproval(args: {
|
|
|
177
177
|
now?: number;
|
|
178
178
|
ttlMs?: number;
|
|
179
179
|
}): SignedToolApproval;
|
|
180
|
+
/** A short-lived platform-signed assertion for exactly one local executor. */
|
|
181
|
+
export interface PersonalDataExecutorLeasePayload {
|
|
182
|
+
v: 1;
|
|
183
|
+
leaseId: string;
|
|
184
|
+
/** The daemon identity registered for this machine. */
|
|
185
|
+
daemonId: string;
|
|
186
|
+
/** Fresh random daemon-start nonce; restart invalidates every prior lease. */
|
|
187
|
+
daemonInstanceId: string;
|
|
188
|
+
/** Account whose interactive session requested this local executor. */
|
|
189
|
+
ownerUserId: string;
|
|
190
|
+
/** Fixed, sorted set of operations this executor may make available. */
|
|
191
|
+
capabilities: string[];
|
|
192
|
+
issuedAt: number;
|
|
193
|
+
expiresAt: number;
|
|
194
|
+
}
|
|
195
|
+
export interface SignedPersonalDataExecutorLease {
|
|
196
|
+
v: 1;
|
|
197
|
+
payload: string;
|
|
198
|
+
kid: string;
|
|
199
|
+
sig: string;
|
|
200
|
+
}
|
|
201
|
+
export type PersonalDataExecutorLeaseVerdict = {
|
|
202
|
+
ok: true;
|
|
203
|
+
leaseId: string;
|
|
204
|
+
ownerUserId: string;
|
|
205
|
+
expiresAt: number;
|
|
206
|
+
} | {
|
|
207
|
+
ok: false;
|
|
208
|
+
reason: 'absent' | 'malformed' | 'unknown_key' | 'signature' | 'daemon_binding' | 'capabilities' | 'expired' | 'window';
|
|
209
|
+
};
|
|
210
|
+
/** Server-side mint. The caller must authorize the requesting user separately. */
|
|
211
|
+
export declare function signPersonalDataExecutorLease(args: {
|
|
212
|
+
leaseId: string;
|
|
213
|
+
daemonId: string;
|
|
214
|
+
daemonInstanceId: string;
|
|
215
|
+
ownerUserId: string;
|
|
216
|
+
capabilities: readonly string[];
|
|
217
|
+
signer: ApprovalSigner;
|
|
218
|
+
now?: number;
|
|
219
|
+
ttlMs?: number;
|
|
220
|
+
}): SignedPersonalDataExecutorLease | null;
|
|
221
|
+
/**
|
|
222
|
+
* Daemon-side verifier. It trusts the same independently pinned platform
|
|
223
|
+
* keyset as v2 tool approvals, but a separate signature domain and schema.
|
|
224
|
+
*/
|
|
225
|
+
export declare function verifyPersonalDataExecutorLease(lease: unknown, expected: {
|
|
226
|
+
daemonId: string;
|
|
227
|
+
daemonInstanceId: string;
|
|
228
|
+
capabilities: readonly string[];
|
|
229
|
+
now?: number;
|
|
230
|
+
}, keyset: ApprovalKeyset): PersonalDataExecutorLeaseVerdict;
|
|
180
231
|
export interface SignedToolApprovalCall {
|
|
181
232
|
toolUseId: string;
|
|
182
233
|
toolName: string;
|
|
@@ -24,8 +24,10 @@ __export(toolApprovalSignature_exports, {
|
|
|
24
24
|
canonicalApprovalKeysetText: () => canonicalApprovalKeysetText,
|
|
25
25
|
endorseApprovalKeysetText: () => endorseApprovalKeysetText,
|
|
26
26
|
parseApprovalKeysetText: () => parseApprovalKeysetText,
|
|
27
|
+
signPersonalDataExecutorLease: () => signPersonalDataExecutorLease,
|
|
27
28
|
signToolApproval: () => signToolApproval,
|
|
28
29
|
verifyApprovalKeysetDocument: () => verifyApprovalKeysetDocument,
|
|
30
|
+
verifyPersonalDataExecutorLease: () => verifyPersonalDataExecutorLease,
|
|
29
31
|
verifySignedToolApproval: () => verifySignedToolApproval,
|
|
30
32
|
verifyToolApprovalAttestation: () => verifyToolApprovalAttestation
|
|
31
33
|
});
|
|
@@ -35,11 +37,17 @@ var import_daemonToolApproval = require("./daemonToolApproval.js");
|
|
|
35
37
|
const TOOL_APPROVAL_SIGNED_CAPABILITY = "tool_approval_signed_v1";
|
|
36
38
|
const ATTESTATION_SIGNING_DOMAIN = "skrr-tool-approval-v2\n";
|
|
37
39
|
const KEYSET_SIGNING_DOMAIN = "skrr-tool-approval-keyset-v1\n";
|
|
40
|
+
const PERSONAL_DATA_EXECUTOR_LEASE_SIGNING_DOMAIN = "skrr-personal-data-executor-lease-v1\n";
|
|
38
41
|
const KID_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
39
42
|
const MAX_PAYLOAD_BYTES = 4096;
|
|
40
43
|
const MAX_KEYSET_BYTES = 16 * 1024;
|
|
41
44
|
const MAX_KEYSET_KEYS = 16;
|
|
42
45
|
const MAX_KEYSET_SIGNATURES = 16;
|
|
46
|
+
const MAX_EXECUTOR_LEASE_CAPABILITIES = 8;
|
|
47
|
+
const MAX_EXECUTOR_LEASE_TTL_MS = 5 * 60 * 1e3;
|
|
48
|
+
const EXECUTOR_LEASE_CLOCK_SKEW_MS = 3e4;
|
|
49
|
+
const EXECUTOR_LEASE_ID_PATTERN = /^[A-Za-z0-9_-]{16,128}$/;
|
|
50
|
+
const EXECUTOR_CAPABILITY_PATTERN = /^[a-z0-9_.:-]{1,128}$/;
|
|
43
51
|
function approvalPublicKeyFromKeyObject(kid, key) {
|
|
44
52
|
const publicKey = key.type === "private" ? (0, import_node_crypto.createPublicKey)(key) : key;
|
|
45
53
|
const der = publicKey.export({ format: "der", type: "spki" });
|
|
@@ -70,6 +78,24 @@ function verifySignature(domain, message, sigB64, key) {
|
|
|
70
78
|
function signMessage(domain, message, privateKey) {
|
|
71
79
|
return (0, import_node_crypto.sign)(null, Buffer.from(domain + message, "utf8"), privateKey).toString("base64");
|
|
72
80
|
}
|
|
81
|
+
function isExecutorLeaseId(value) {
|
|
82
|
+
return typeof value === "string" && EXECUTOR_LEASE_ID_PATTERN.test(value);
|
|
83
|
+
}
|
|
84
|
+
function isExecutorLeaseText(value, max = 128) {
|
|
85
|
+
return typeof value === "string" && value.length > 0 && value.length <= max && !/[\u0000-\u001f]/.test(value);
|
|
86
|
+
}
|
|
87
|
+
function canonicalExecutorCapabilities(value) {
|
|
88
|
+
if (!Array.isArray(value) || value.length === 0 || value.length > MAX_EXECUTOR_LEASE_CAPABILITIES) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const capabilities = value.map((entry) => typeof entry === "string" ? entry : "");
|
|
92
|
+
if (capabilities.some((entry) => !EXECUTOR_CAPABILITY_PATTERN.test(entry)))
|
|
93
|
+
return null;
|
|
94
|
+
const sorted = [...capabilities].sort();
|
|
95
|
+
if (new Set(sorted).size !== sorted.length)
|
|
96
|
+
return null;
|
|
97
|
+
return sorted;
|
|
98
|
+
}
|
|
73
99
|
function compareKid(a, b) {
|
|
74
100
|
if (a === b)
|
|
75
101
|
return 0;
|
|
@@ -199,6 +225,84 @@ function signToolApproval(args) {
|
|
|
199
225
|
sig: signMessage(ATTESTATION_SIGNING_DOMAIN, text, args.signer.privateKey)
|
|
200
226
|
};
|
|
201
227
|
}
|
|
228
|
+
function signPersonalDataExecutorLease(args) {
|
|
229
|
+
const capabilities = canonicalExecutorCapabilities(args.capabilities);
|
|
230
|
+
const ttlMs = args.ttlMs ?? MAX_EXECUTOR_LEASE_TTL_MS;
|
|
231
|
+
const now = args.now ?? Date.now();
|
|
232
|
+
if (!isExecutorLeaseId(args.leaseId) || !isExecutorLeaseText(args.daemonId) || !isExecutorLeaseId(args.daemonInstanceId) || !isExecutorLeaseText(args.ownerUserId) || !capabilities || !Number.isSafeInteger(now) || !Number.isSafeInteger(ttlMs) || ttlMs <= 0 || ttlMs > MAX_EXECUTOR_LEASE_TTL_MS) {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
const payload = {
|
|
236
|
+
v: 1,
|
|
237
|
+
leaseId: args.leaseId,
|
|
238
|
+
daemonId: args.daemonId,
|
|
239
|
+
daemonInstanceId: args.daemonInstanceId,
|
|
240
|
+
ownerUserId: args.ownerUserId,
|
|
241
|
+
capabilities,
|
|
242
|
+
issuedAt: now,
|
|
243
|
+
expiresAt: now + ttlMs
|
|
244
|
+
};
|
|
245
|
+
const text = (0, import_daemonToolApproval.canonicalApprovalJson)(payload);
|
|
246
|
+
return {
|
|
247
|
+
v: 1,
|
|
248
|
+
payload: text,
|
|
249
|
+
kid: args.signer.kid,
|
|
250
|
+
sig: signMessage(PERSONAL_DATA_EXECUTOR_LEASE_SIGNING_DOMAIN, text, args.signer.privateKey)
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function verifyPersonalDataExecutorLease(lease, expected, keyset) {
|
|
254
|
+
if (lease === void 0 || lease === null)
|
|
255
|
+
return { ok: false, reason: "absent" };
|
|
256
|
+
if (!lease || typeof lease !== "object" || Array.isArray(lease)) {
|
|
257
|
+
return { ok: false, reason: "malformed" };
|
|
258
|
+
}
|
|
259
|
+
const wire = lease;
|
|
260
|
+
if (wire.v !== 1 || typeof wire.payload !== "string" || wire.payload.length === 0 || wire.payload.length > MAX_PAYLOAD_BYTES || typeof wire.kid !== "string" || typeof wire.sig !== "string") {
|
|
261
|
+
return { ok: false, reason: "malformed" };
|
|
262
|
+
}
|
|
263
|
+
const pinnedKey = keyset.keys.find((key2) => key2.kid === wire.kid);
|
|
264
|
+
const key = pinnedKey ? ed25519PublicKey(pinnedKey.publicKeySpkiB64) : null;
|
|
265
|
+
if (!key)
|
|
266
|
+
return { ok: false, reason: "unknown_key" };
|
|
267
|
+
if (!verifySignature(PERSONAL_DATA_EXECUTOR_LEASE_SIGNING_DOMAIN, wire.payload, wire.sig, key)) {
|
|
268
|
+
return { ok: false, reason: "signature" };
|
|
269
|
+
}
|
|
270
|
+
let parsed;
|
|
271
|
+
try {
|
|
272
|
+
parsed = JSON.parse(wire.payload);
|
|
273
|
+
} catch {
|
|
274
|
+
return { ok: false, reason: "malformed" };
|
|
275
|
+
}
|
|
276
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
277
|
+
return { ok: false, reason: "malformed" };
|
|
278
|
+
}
|
|
279
|
+
const payload = parsed;
|
|
280
|
+
const issuedAt = payload.issuedAt;
|
|
281
|
+
const expiresAt = payload.expiresAt;
|
|
282
|
+
const capabilities = canonicalExecutorCapabilities(payload.capabilities);
|
|
283
|
+
if (payload.v !== 1 || !isExecutorLeaseId(payload.leaseId) || !isExecutorLeaseText(payload.daemonId) || !isExecutorLeaseId(payload.daemonInstanceId) || !isExecutorLeaseText(payload.ownerUserId) || !capabilities || typeof issuedAt !== "number" || typeof expiresAt !== "number" || !Number.isSafeInteger(issuedAt) || !Number.isSafeInteger(expiresAt)) {
|
|
284
|
+
return { ok: false, reason: "malformed" };
|
|
285
|
+
}
|
|
286
|
+
const expectedCapabilities = canonicalExecutorCapabilities(expected.capabilities);
|
|
287
|
+
if (!expectedCapabilities || capabilities.join("\0") !== expectedCapabilities.join("\0")) {
|
|
288
|
+
return { ok: false, reason: "capabilities" };
|
|
289
|
+
}
|
|
290
|
+
if (payload.daemonId !== expected.daemonId || payload.daemonInstanceId !== expected.daemonInstanceId) {
|
|
291
|
+
return { ok: false, reason: "daemon_binding" };
|
|
292
|
+
}
|
|
293
|
+
const now = expected.now ?? Date.now();
|
|
294
|
+
if (expiresAt <= issuedAt || expiresAt - issuedAt > MAX_EXECUTOR_LEASE_TTL_MS || issuedAt > now + EXECUTOR_LEASE_CLOCK_SKEW_MS) {
|
|
295
|
+
return { ok: false, reason: "window" };
|
|
296
|
+
}
|
|
297
|
+
if (expiresAt <= now)
|
|
298
|
+
return { ok: false, reason: "expired" };
|
|
299
|
+
return {
|
|
300
|
+
ok: true,
|
|
301
|
+
leaseId: payload.leaseId,
|
|
302
|
+
ownerUserId: payload.ownerUserId,
|
|
303
|
+
expiresAt
|
|
304
|
+
};
|
|
305
|
+
}
|
|
202
306
|
function verifySignedToolApproval(approval, call, keyset) {
|
|
203
307
|
if (approval === void 0 || approval === null)
|
|
204
308
|
return { ok: false, reason: "absent" };
|
|
@@ -271,8 +375,10 @@ function verifyToolApprovalAttestation(approval, call, pin) {
|
|
|
271
375
|
canonicalApprovalKeysetText,
|
|
272
376
|
endorseApprovalKeysetText,
|
|
273
377
|
parseApprovalKeysetText,
|
|
378
|
+
signPersonalDataExecutorLease,
|
|
274
379
|
signToolApproval,
|
|
275
380
|
verifyApprovalKeysetDocument,
|
|
381
|
+
verifyPersonalDataExecutorLease,
|
|
276
382
|
verifySignedToolApproval,
|
|
277
383
|
verifyToolApprovalAttestation
|
|
278
384
|
});
|
|
@@ -185,6 +185,14 @@ export type DaemonComputerEventKey = keyof typeof DAEMON_COMPUTER_EVENTS;
|
|
|
185
185
|
export type DaemonComputerEventName = (typeof DAEMON_COMPUTER_EVENTS)[DaemonComputerEventKey];
|
|
186
186
|
export declare const COMPUTER_EVENT_NAMES: readonly ComputerEventName[];
|
|
187
187
|
export declare const DAEMON_COMPUTER_EVENT_NAMES: readonly DaemonComputerEventName[];
|
|
188
|
+
/**
|
|
189
|
+
* API → daemon: an authorized person observes, configures, stops or recovers
|
|
190
|
+
* the machine's Computer Use provider. Answered with `daemon:computer:ack`. It
|
|
191
|
+
* is deliberately outside `DAEMON_COMPUTER_EVENTS`, which lists the events the
|
|
192
|
+
* attachment protocol itself speaks, so the registry parity over that table
|
|
193
|
+
* does not move.
|
|
194
|
+
*/
|
|
195
|
+
export declare const DAEMON_COMPUTER_USE_CONTROL_EVENT: "daemon:computer:use-control";
|
|
188
196
|
/** The daemon → API events; every other `daemon:computer:*` event flows API → daemon. */
|
|
189
197
|
export declare const DAEMON_COMPUTER_REPORT_EVENT_KEYS: readonly ["ack", "manifest", "data", "activity", "detached", "filesChanged", "diagnostics"];
|
|
190
198
|
/** The API → client events; every other `computer:*` event flows client → API. */
|
|
@@ -362,7 +370,7 @@ export declare const COMPUTER_CAPABILITY_VALUES: [ComputerCapability, ...Compute
|
|
|
362
370
|
* Every refusal and limit the computer protocol can answer with. Callers branch
|
|
363
371
|
* on the code; a message beside it is free text and may change.
|
|
364
372
|
*/
|
|
365
|
-
export declare const COMPUTER_REFUSAL_CODES: readonly ["human_control", "stale_epoch", "stale_generation", "file_changed", "capability_missing", "unauthorized", "control_denied", "not_holder", "attachment_limit", "observer_limit", "watch_limit", "grant_limit", "browser_limit", "rate_limited", "not_found", "surface_ended", "machine_unavailable", "daemon_unreachable", "relay_error", "timeout", "invalid_request", "consent_missing", "path_withheld", "too_large", "service_limit"];
|
|
373
|
+
export declare const COMPUTER_REFUSAL_CODES: readonly ["human_control", "stale_epoch", "stale_generation", "file_changed", "capability_missing", "unauthorized", "control_denied", "not_holder", "attachment_limit", "observer_limit", "watch_limit", "grant_limit", "browser_limit", "rate_limited", "not_found", "surface_ended", "machine_unavailable", "daemon_unreachable", "relay_error", "timeout", "invalid_request", "consent_missing", "path_withheld", "too_large", "service_limit", "maintenance_hold"];
|
|
366
374
|
export type ComputerRefusalCode = (typeof COMPUTER_REFUSAL_CODES)[number];
|
|
367
375
|
/**
|
|
368
376
|
* The code when it is a computer refusal, else `null`. There is one spelling
|
|
@@ -186,6 +186,14 @@ export const DAEMON_COMPUTER_EVENTS = {
|
|
|
186
186
|
};
|
|
187
187
|
export const COMPUTER_EVENT_NAMES = Object.values(COMPUTER_EVENTS);
|
|
188
188
|
export const DAEMON_COMPUTER_EVENT_NAMES = Object.values(DAEMON_COMPUTER_EVENTS);
|
|
189
|
+
/**
|
|
190
|
+
* API → daemon: an authorized person observes, configures, stops or recovers
|
|
191
|
+
* the machine's Computer Use provider. Answered with `daemon:computer:ack`. It
|
|
192
|
+
* is deliberately outside `DAEMON_COMPUTER_EVENTS`, which lists the events the
|
|
193
|
+
* attachment protocol itself speaks, so the registry parity over that table
|
|
194
|
+
* does not move.
|
|
195
|
+
*/
|
|
196
|
+
export const DAEMON_COMPUTER_USE_CONTROL_EVENT = 'daemon:computer:use-control';
|
|
189
197
|
/** The daemon → API events; every other `daemon:computer:*` event flows API → daemon. */
|
|
190
198
|
export const DAEMON_COMPUTER_REPORT_EVENT_KEYS = [
|
|
191
199
|
'ack',
|
|
@@ -432,6 +440,14 @@ export const COMPUTER_REFUSAL_CODES = [
|
|
|
432
440
|
'too_large',
|
|
433
441
|
/** The machine has as many declared services as it allows (`COMPUTER_DECLARED_SERVICES_MAX`). */
|
|
434
442
|
'service_limit',
|
|
443
|
+
/**
|
|
444
|
+
* The machine's owner paused NEW work on it (OSK-19107). Refuses an `open` only:
|
|
445
|
+
* watching, reading files and controlling a surface that already exists keep
|
|
446
|
+
* working, and nothing running is touched. The refusal carries the hold's facts
|
|
447
|
+
* (`maintenance`), and it is not `machine_unavailable`, which says the machine is
|
|
448
|
+
* down: a paused machine is up.
|
|
449
|
+
*/
|
|
450
|
+
'maintenance_hold',
|
|
435
451
|
];
|
|
436
452
|
/**
|
|
437
453
|
* The code when it is a computer refusal, else `null`. There is one spelling
|
|
@@ -1258,7 +1274,8 @@ export function normalizeBrowserActivityOriginPolicy(input) {
|
|
|
1258
1274
|
const origins = (items, required) => {
|
|
1259
1275
|
if (!Array.isArray(items) || items.length > 20 || (required && !items.length))
|
|
1260
1276
|
throw new Error('Choose from one to twenty allowed origins and up to twenty excluded origins');
|
|
1261
|
-
return [
|
|
1277
|
+
return [
|
|
1278
|
+
...new Set(items.map((item) => {
|
|
1262
1279
|
if (typeof item !== 'string' || item.length > 500)
|
|
1263
1280
|
throw new Error('Use an exact http or https origin without a path, credentials, query or fragment');
|
|
1264
1281
|
let url;
|
|
@@ -1268,19 +1285,29 @@ export function normalizeBrowserActivityOriginPolicy(input) {
|
|
|
1268
1285
|
catch {
|
|
1269
1286
|
throw new Error('Use an exact http or https origin');
|
|
1270
1287
|
}
|
|
1271
|
-
if (!['http:', 'https:'].includes(url.protocol) ||
|
|
1288
|
+
if (!['http:', 'https:'].includes(url.protocol) ||
|
|
1289
|
+
url.hostname.includes('*') ||
|
|
1290
|
+
url.username ||
|
|
1291
|
+
url.password ||
|
|
1292
|
+
item !== url.origin)
|
|
1272
1293
|
throw new Error('Use an exact http or https origin without a path, credentials, query or fragment');
|
|
1273
1294
|
return url.origin;
|
|
1274
|
-
}))
|
|
1295
|
+
})),
|
|
1296
|
+
].sort();
|
|
1297
|
+
};
|
|
1298
|
+
return {
|
|
1299
|
+
allowOrigins: origins(value.allowOrigins, true),
|
|
1300
|
+
excludeOrigins: origins(value.excludeOrigins, false),
|
|
1275
1301
|
};
|
|
1276
|
-
return { allowOrigins: origins(value.allowOrigins, true), excludeOrigins: origins(value.excludeOrigins, false) };
|
|
1277
1302
|
}
|
|
1278
1303
|
export function browserActivityOriginAllowed(policy, url) {
|
|
1279
1304
|
if (typeof url !== 'string')
|
|
1280
1305
|
return false;
|
|
1281
1306
|
try {
|
|
1282
1307
|
const origin = new URL(url).origin;
|
|
1283
|
-
return ['http:', 'https:'].includes(new URL(url).protocol) &&
|
|
1308
|
+
return (['http:', 'https:'].includes(new URL(url).protocol) &&
|
|
1309
|
+
policy.allowOrigins.includes(origin) &&
|
|
1310
|
+
!policy.excludeOrigins.includes(origin));
|
|
1284
1311
|
}
|
|
1285
1312
|
catch {
|
|
1286
1313
|
return false;
|
|
@@ -54,6 +54,16 @@ export declare function splitKeyConvergencePolicy(): {
|
|
|
54
54
|
converge: boolean;
|
|
55
55
|
reason: 'daemon_key_pinned' | 'daemon_key_refused';
|
|
56
56
|
};
|
|
57
|
+
/** Open only the existing wrapped DEK. Recovery must never enroll a new key,
|
|
58
|
+
* consolidate profile paths or replace an unreadable envelope. A caller gets
|
|
59
|
+
* an error if the existing file or the platform's read-only unwrap is unsafe
|
|
60
|
+
* or unavailable. This intentionally does not load retired keys; credentials
|
|
61
|
+
* that require one remain unavailable rather than triggering a migration. */
|
|
62
|
+
export declare function initExistingCredEnvelope(profile: string): Promise<void>;
|
|
63
|
+
/** First enrollment for a reserved desktop background profile. Existing or
|
|
64
|
+
* ambiguous state is opened read-only or refused; it is never re-enrolled.
|
|
65
|
+
* The caller must validate the reservation before calling this function. */
|
|
66
|
+
export declare function initNewIndependentCredEnvelope(profile: string): Promise<void>;
|
|
57
67
|
/**
|
|
58
68
|
* Initialize the envelope path. Idempotent — second call when state is
|
|
59
69
|
* non-uninit returns immediately.
|