@skrr-ai/cli 0.1.109 → 0.1.111
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/bin/run.js +15 -1
- package/dist/base-command.d.ts +44 -1
- package/dist/base-command.js +194 -33
- package/dist/commands/actions/list.js +2 -1
- package/dist/commands/agenda/trigger/create.js +1 -1
- package/dist/commands/agenda/trigger/list.js +2 -1
- package/dist/commands/agent-groups/list.js +2 -1
- package/dist/commands/agents/actions/list.js +2 -1
- package/dist/commands/agents/always-on/status.js +5 -0
- package/dist/commands/agents/chat.js +4 -1
- package/dist/commands/agents/duplicate.js +4 -0
- package/dist/commands/agents/eval/list.js +2 -1
- package/dist/commands/agents/files/list.js +2 -1
- package/dist/commands/agents/folders/list.js +2 -1
- package/dist/commands/agents/goals/list.js +2 -1
- package/dist/commands/agents/intuitions/list.js +8 -5
- package/dist/commands/agents/list.d.ts +12 -0
- package/dist/commands/agents/list.js +45 -8
- package/dist/commands/agents/releases/known-issues/list.js +2 -1
- package/dist/commands/agents/releases/list.js +5 -1
- package/dist/commands/agents/releases/trusted-publishers/list.js +2 -1
- package/dist/commands/agents/roles/list.js +2 -1
- package/dist/commands/agents/skills/list.js +2 -1
- package/dist/commands/agents/todos/list.js +2 -1
- package/dist/commands/agents/triggers/create.js +1 -1
- package/dist/commands/agents/triggers/list.js +2 -1
- package/dist/commands/agents/triggers/update.js +1 -1
- package/dist/commands/agents/update.d.ts +11 -0
- package/dist/commands/agents/update.js +58 -2
- package/dist/commands/api-keys/list.js +2 -1
- package/dist/commands/apps/channel.d.ts +20 -0
- package/dist/commands/apps/channel.js +64 -0
- package/dist/commands/apps/check-draft.d.ts +12 -0
- package/dist/commands/apps/check-draft.js +41 -0
- package/dist/commands/apps/check.d.ts +42 -0
- package/dist/commands/apps/check.js +91 -0
- package/dist/commands/apps/create.d.ts +15 -0
- package/dist/commands/apps/create.js +59 -0
- package/dist/commands/apps/data/put.d.ts +18 -0
- package/dist/commands/apps/data/put.js +72 -0
- package/dist/commands/apps/data/query.d.ts +20 -0
- package/dist/commands/apps/data/query.js +88 -0
- package/dist/commands/apps/disclosure.d.ts +16 -0
- package/dist/commands/apps/disclosure.js +71 -0
- package/dist/commands/apps/file/cat.d.ts +15 -0
- package/dist/commands/apps/file/cat.js +50 -0
- package/dist/commands/apps/file/ls.d.ts +13 -0
- package/dist/commands/apps/file/ls.js +47 -0
- package/dist/commands/apps/file/mv.d.ts +15 -0
- package/dist/commands/apps/file/mv.js +49 -0
- package/dist/commands/apps/file/rm.d.ts +15 -0
- package/dist/commands/apps/file/rm.js +53 -0
- package/dist/commands/apps/file/write.d.ts +17 -0
- package/dist/commands/apps/file/write.js +81 -0
- package/dist/commands/apps/install.d.ts +19 -0
- package/dist/commands/apps/install.js +136 -0
- package/dist/commands/apps/installations/list.d.ts +11 -0
- package/dist/commands/apps/installations/list.js +49 -0
- package/dist/commands/apps/installations/show.d.ts +12 -0
- package/dist/commands/apps/installations/show.js +61 -0
- package/dist/commands/apps/layout/set.d.ts +11 -0
- package/dist/commands/apps/layout/set.js +125 -0
- package/dist/commands/apps/layout/show.d.ts +9 -0
- package/dist/commands/apps/layout/show.js +33 -0
- package/dist/commands/apps/list.d.ts +10 -0
- package/dist/commands/apps/list.js +45 -0
- package/dist/commands/apps/logs.d.ts +13 -0
- package/dist/commands/apps/logs.js +55 -0
- package/dist/commands/apps/preview.d.ts +12 -0
- package/dist/commands/apps/preview.js +39 -0
- package/dist/commands/apps/publish/propose.d.ts +14 -0
- package/dist/commands/apps/publish/propose.js +45 -0
- package/dist/commands/apps/pull.d.ts +14 -0
- package/dist/commands/apps/pull.js +56 -0
- package/dist/commands/apps/push.d.ts +15 -0
- package/dist/commands/apps/push.js +75 -0
- package/dist/commands/apps/reconsent.d.ts +13 -0
- package/dist/commands/apps/reconsent.js +67 -0
- package/dist/commands/apps/report.d.ts +20 -0
- package/dist/commands/apps/report.js +63 -0
- package/dist/commands/apps/resume.d.ts +12 -0
- package/dist/commands/apps/resume.js +36 -0
- package/dist/commands/apps/settings/set.d.ts +13 -0
- package/dist/commands/apps/settings/set.js +54 -0
- package/dist/commands/apps/settings/show.d.ts +11 -0
- package/dist/commands/apps/settings/show.js +31 -0
- package/dist/commands/apps/show.d.ts +12 -0
- package/dist/commands/apps/show.js +49 -0
- package/dist/commands/apps/suspend.d.ts +12 -0
- package/dist/commands/apps/suspend.js +35 -0
- package/dist/commands/apps/uninstall.d.ts +13 -0
- package/dist/commands/apps/uninstall.js +43 -0
- package/dist/commands/apps/upgrade.d.ts +14 -0
- package/dist/commands/apps/upgrade.js +49 -0
- package/dist/commands/apps/version/create.d.ts +14 -0
- package/dist/commands/apps/version/create.js +53 -0
- package/dist/commands/apps/version/show.d.ts +12 -0
- package/dist/commands/apps/version/show.js +39 -0
- package/dist/commands/apps/versions.d.ts +12 -0
- package/dist/commands/apps/versions.js +40 -0
- package/dist/commands/apps/webhooks/list.d.ts +12 -0
- package/dist/commands/apps/webhooks/list.js +47 -0
- package/dist/commands/characters/list.js +2 -1
- package/dist/commands/chats/files/list.js +2 -1
- package/dist/commands/chats/folders/list.js +2 -1
- package/dist/commands/chats/list.js +2 -1
- package/dist/commands/chats/spaces/list.js +2 -1
- package/dist/commands/chats/widgets/list.js +2 -1
- package/dist/commands/code/jobs/list.js +4 -1
- package/dist/commands/commerce/incidents/list.js +2 -1
- package/dist/commands/commitments/accounting.js +3 -0
- package/dist/commands/commitments/action-proposals.d.ts +8 -0
- package/dist/commands/commitments/action-proposals.js +17 -2
- package/dist/commands/commitments/cost.d.ts +11 -0
- package/dist/commands/commitments/cost.js +25 -0
- package/dist/commands/commitments/create.js +6 -1
- package/dist/commands/commitments/endpoints/list.js +2 -1
- package/dist/commands/commitments/links/list.js +2 -1
- package/dist/commands/commitments/list.js +2 -1
- package/dist/commands/commitments/liveness.d.ts +30 -0
- package/dist/commands/commitments/liveness.js +22 -5
- package/dist/commands/commitments/pack/list.js +2 -1
- package/dist/commands/commitments/preflight.js +6 -2
- package/dist/commands/commitments/update.js +10 -1
- package/dist/commands/compass/list.js +2 -1
- package/dist/commands/context.js +7 -1
- package/dist/commands/convos/list.js +3 -2
- package/dist/commands/daemon/install.js +17 -1
- package/dist/commands/daemon/login.js +14 -0
- package/dist/commands/dm/list.js +2 -1
- package/dist/commands/dm/work.d.ts +19 -0
- package/dist/commands/dm/work.js +54 -0
- package/dist/commands/feeds/list.js +2 -1
- package/dist/commands/followups/list.js +2 -1
- package/dist/commands/followups/plans/cancel.d.ts +13 -0
- package/dist/commands/followups/plans/cancel.js +26 -0
- package/dist/commands/followups/plans/create.d.ts +11 -0
- package/dist/commands/followups/plans/create.js +35 -0
- package/dist/commands/followups/plans/list.d.ts +13 -0
- package/dist/commands/followups/plans/list.js +50 -0
- package/dist/commands/followups/plans/observability.d.ts +11 -0
- package/dist/commands/followups/plans/observability.js +46 -0
- package/dist/commands/followups/plans/revise.d.ts +13 -0
- package/dist/commands/followups/plans/revise.js +35 -0
- package/dist/commands/followups/plans/show.d.ts +11 -0
- package/dist/commands/followups/plans/show.js +32 -0
- package/dist/commands/goals/key-results/list.js +2 -1
- package/dist/commands/goals/labels/list.js +3 -2
- package/dist/commands/goals/list.js +3 -2
- package/dist/commands/grants/list.js +2 -1
- package/dist/commands/harnesses/grants/list.js +2 -1
- package/dist/commands/harnesses/leases/list.js +2 -1
- package/dist/commands/harnesses/list.js +10 -1
- package/dist/commands/harnesses/prune.d.ts +26 -0
- package/dist/commands/harnesses/prune.js +172 -0
- package/dist/commands/ingress/list.js +2 -1
- package/dist/commands/initiatives/list.js +2 -1
- package/dist/commands/instruction-blocks/list.js +2 -1
- package/dist/commands/instructions/list.js +2 -1
- package/dist/commands/integrations/connections/list.js +2 -1
- package/dist/commands/integrations/tools/list.js +2 -1
- package/dist/commands/labels/list.js +3 -2
- package/dist/commands/learning/adapters.d.ts +16 -0
- package/dist/commands/learning/adapters.js +44 -0
- package/dist/commands/login.js +11 -0
- package/dist/commands/machines/dedicated/list.js +2 -1
- package/dist/commands/machines/hosted/list.js +2 -1
- package/dist/commands/machines/list.js +2 -1
- package/dist/commands/machines/show.js +5 -2
- package/dist/commands/measures/list.js +2 -1
- package/dist/commands/memory/list.js +2 -1
- package/dist/commands/memory/proposals/list.js +2 -1
- package/dist/commands/memory/stores/list.js +2 -1
- package/dist/commands/memory/topics/list.js +2 -1
- package/dist/commands/memory/versions/list.js +2 -1
- package/dist/commands/messages/list.js +2 -1
- package/dist/commands/northstars/intents/list.js +2 -1
- package/dist/commands/northstars/list.js +2 -1
- package/dist/commands/northstars/recommendations/list.js +2 -1
- package/dist/commands/outbox/list.js +2 -1
- package/dist/commands/profiles/list.js +2 -1
- package/dist/commands/projects/docs/list.js +8 -1
- package/dist/commands/projects/updates/list.js +2 -1
- package/dist/commands/proposals/list.js +2 -1
- package/dist/commands/requests/comments/list.js +2 -1
- package/dist/commands/requests/list.js +2 -1
- package/dist/commands/shares/list.js +2 -1
- package/dist/commands/shortcuts/list.js +2 -1
- package/dist/commands/signals/monitors/list.js +2 -1
- package/dist/commands/signals/schemas/list.js +2 -1
- package/dist/commands/signals/sources/list.js +2 -1
- package/dist/commands/space-directory-views/list.js +2 -1
- package/dist/commands/spaces/actions/list.js +4 -3
- package/dist/commands/spaces/briefs/list.js +2 -1
- package/dist/commands/spaces/cycles/list.js +2 -1
- package/dist/commands/spaces/files/folders/list.js +2 -1
- package/dist/commands/spaces/files/list.js +3 -2
- package/dist/commands/spaces/heartbeats/list.js +3 -2
- package/dist/commands/spaces/labels/list.js +3 -2
- package/dist/commands/spaces/list.d.ts +3 -18
- package/dist/commands/spaces/list.js +28 -35
- package/dist/commands/spaces/live/cards/list.js +2 -1
- package/dist/commands/spaces/members/list.d.ts +1 -0
- package/dist/commands/spaces/members/list.js +4 -1
- package/dist/commands/spaces/show.js +2 -2
- package/dist/commands/spaces/skills/list.js +6 -2
- package/dist/commands/spaces/states/list.js +2 -1
- package/dist/commands/spaces/views/list.js +2 -1
- package/dist/commands/spaces/widgets/list.js +3 -2
- package/dist/commands/spaces/workflow-templates/list.js +2 -1
- package/dist/commands/spaces/workflows/fixtures/list.js +2 -1
- package/dist/commands/spaces/workflows/list.js +3 -2
- package/dist/commands/spaces/workflows/proposals/list.js +2 -1
- package/dist/commands/spaces/workflows/start.js +3 -1
- package/dist/commands/spaces/workflows/triggers/list.js +2 -1
- package/dist/commands/spaces/workflows/validate.js +12 -2
- package/dist/commands/store/acquisitions/list.js +2 -1
- package/dist/commands/store/admissions/list.js +17 -1
- package/dist/commands/store/advisories/list.js +2 -1
- package/dist/commands/store/follows/list.js +2 -1
- package/dist/commands/store/publishers/domains/list.js +2 -1
- package/dist/commands/store/reports/list.js +2 -1
- package/dist/commands/subscriptions/list.js +2 -1
- package/dist/commands/tasks/actionability.js +7 -30
- package/dist/commands/tasks/activity.js +14 -8
- package/dist/commands/tasks/approvals/list.js +2 -1
- package/dist/commands/tasks/assign.d.ts +1 -0
- package/dist/commands/tasks/assign.js +43 -7
- package/dist/commands/tasks/attachments/list.js +2 -1
- package/dist/commands/tasks/chat/send.js +34 -0
- package/dist/commands/tasks/comments/add.js +6 -1
- package/dist/commands/tasks/comments/list.js +2 -1
- package/dist/commands/tasks/complete.js +26 -2
- package/dist/commands/tasks/continue.d.ts +18 -0
- package/dist/commands/tasks/continue.js +54 -0
- package/dist/commands/tasks/create-tree.d.ts +5 -0
- package/dist/commands/tasks/create-tree.js +399 -219
- package/dist/commands/tasks/create.d.ts +1 -0
- package/dist/commands/tasks/create.js +63 -11
- package/dist/commands/tasks/deliverable/add.js +10 -3
- package/dist/commands/tasks/deliverable/list.js +2 -1
- package/dist/commands/tasks/events/list.js +2 -1
- package/dist/commands/tasks/execution-state.d.ts +12 -0
- package/dist/commands/tasks/execution-state.js +28 -0
- package/dist/commands/tasks/expectations/assess.js +40 -5
- package/dist/commands/tasks/guide.d.ts +10 -0
- package/dist/commands/tasks/guide.js +20 -0
- package/dist/commands/tasks/labels/list.js +2 -1
- package/dist/commands/tasks/list.d.ts +19 -0
- package/dist/commands/tasks/list.js +103 -6
- package/dist/commands/tasks/move.js +10 -2
- package/dist/commands/tasks/preflight.d.ts +14 -0
- package/dist/commands/tasks/preflight.js +77 -0
- package/dist/commands/tasks/rearm-recurrence.js +22 -3
- package/dist/commands/tasks/resource/list.js +2 -1
- package/dist/commands/tasks/result/submit.js +10 -1
- package/dist/commands/tasks/review.js +6 -1
- package/dist/commands/tasks/revisions.d.ts +2 -0
- package/dist/commands/tasks/revisions.js +8 -1
- package/dist/commands/tasks/show.d.ts +8 -0
- package/dist/commands/tasks/show.js +81 -43
- package/dist/commands/tasks/start.d.ts +1 -0
- package/dist/commands/tasks/start.js +35 -0
- package/dist/commands/tasks/templates/list.js +2 -1
- package/dist/commands/tasks/timeline.d.ts +5 -0
- package/dist/commands/tasks/timeline.js +9 -1
- package/dist/commands/tasks/unschedule.js +5 -1
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +36 -3
- package/dist/commands/tasks/updates/add.js +6 -1
- package/dist/commands/tasks/updates/list.js +2 -1
- package/dist/commands/tasks/upsert.d.ts +1 -0
- package/dist/commands/tasks/upsert.js +8 -1
- package/dist/commands/token/list.js +2 -1
- package/dist/commands/tokens/list.js +2 -1
- package/dist/commands/tones/list.js +4 -2
- package/dist/commands/triggers/audit.js +12 -3
- package/dist/commands/triggers/create.js +1 -1
- package/dist/commands/triggers/fire-detail.d.ts +7 -0
- package/dist/commands/triggers/fire-detail.js +30 -12
- package/dist/commands/triggers/fire.js +13 -3
- package/dist/commands/triggers/list.js +2 -1
- package/dist/commands/triggers/parse-intent.js +1 -1
- package/dist/commands/triggers/update.js +1 -1
- package/dist/commands/views/list.js +2 -1
- package/dist/commands/webhooks/list.js +2 -1
- package/dist/commands/whoami.js +1 -1
- package/dist/commands/widgets/list.js +2 -1
- package/dist/commands/widgets/save-as-app.d.ts +13 -0
- package/dist/commands/widgets/save-as-app.js +65 -0
- package/dist/commands/work-views/list.js +2 -1
- package/dist/commands/worklog/list.js +2 -1
- package/dist/commands/workspaces/grants.js +1 -4
- package/dist/commands/workspaces/list.js +3 -2
- package/dist/commands/workspaces/members.d.ts +1 -0
- package/dist/commands/workspaces/members.js +10 -7
- package/dist/generated/managed-instruction-guides.json +2 -2
- package/dist/help.js +7 -0
- package/dist/lib/agent-proactive-baseline.d.ts +9 -0
- package/dist/lib/agent-proactive-baseline.js +44 -0
- package/dist/lib/agentic-stream.d.ts +4 -1
- package/dist/lib/agentic-stream.js +29 -4
- package/dist/lib/appData.d.ts +75 -0
- package/dist/lib/appData.js +274 -0
- package/dist/lib/appInstallations.d.ts +117 -0
- package/dist/lib/appInstallations.js +960 -0
- package/dist/lib/appSettings.d.ts +3 -0
- package/dist/lib/appSettings.js +71 -0
- package/dist/lib/appWebhooks.d.ts +7 -0
- package/dist/lib/appWebhooks.js +59 -0
- package/dist/lib/apps-command.d.ts +44 -0
- package/dist/lib/apps-command.js +164 -0
- package/dist/lib/apps.d.ts +45 -0
- package/dist/lib/apps.js +148 -0
- package/dist/lib/appsCheck.d.ts +12 -0
- package/dist/lib/appsCheck.js +173 -0
- package/dist/lib/appsFs.d.ts +58 -0
- package/dist/lib/appsFs.js +384 -0
- package/dist/lib/auth-failure.d.ts +20 -0
- package/dist/lib/auth-failure.js +40 -3
- package/dist/lib/cli-installers.d.ts +9 -2
- package/dist/lib/command-miss.js +107 -0
- package/dist/lib/commitment-loop-status.js +25 -3
- package/dist/lib/commitment-product.js +5 -2
- package/dist/lib/commitments.d.ts +45 -3
- package/dist/lib/commitments.js +139 -41
- package/dist/lib/compasses.d.ts +4 -0
- package/dist/lib/compasses.js +11 -0
- package/dist/lib/daemon-machine-identity-copy.d.ts +14 -0
- package/dist/lib/daemon-machine-identity-copy.js +27 -0
- package/dist/lib/daemon-machine-identity.d.ts +27 -0
- package/dist/lib/daemon-machine-identity.js +61 -0
- package/dist/lib/daemon-setup.js +7 -7
- package/dist/lib/daemonHandoff.d.ts +19 -1
- package/dist/lib/daemonHandoff.js +62 -2
- package/dist/lib/dedicated-ssh.d.ts +2 -0
- package/dist/lib/dedicated-ssh.js +98 -28
- package/dist/lib/harnesses.d.ts +71 -0
- package/dist/lib/harnesses.js +70 -0
- package/dist/lib/json-output.d.ts +33 -0
- package/dist/lib/json-output.js +37 -0
- package/dist/lib/list-output.d.ts +9 -4
- package/dist/lib/list-output.js +38 -9
- package/dist/lib/lookbackPlans.d.ts +13 -0
- package/dist/lib/lookbackPlans.js +68 -0
- package/dist/lib/machines.d.ts +27 -6
- package/dist/lib/machines.js +25 -14
- package/dist/lib/member-output.d.ts +20 -0
- package/dist/lib/member-output.js +57 -0
- package/dist/lib/preflight-copy.d.ts +7 -0
- package/dist/lib/preflight-copy.js +31 -0
- package/dist/lib/profile-machine-identity-guard.js +11 -1
- package/dist/lib/roles.d.ts +2 -2
- package/dist/lib/task-admission.d.ts +9 -0
- package/dist/lib/task-admission.js +35 -0
- package/dist/lib/task-batch.d.ts +4 -0
- package/dist/lib/task-batch.js +2 -0
- package/dist/lib/task-economics.d.ts +10 -0
- package/dist/lib/task-economics.js +24 -2
- package/dist/lib/task-operations.d.ts +25 -0
- package/dist/lib/task-operations.js +123 -0
- package/dist/lib/task-preflight.d.ts +35 -0
- package/dist/lib/task-preflight.js +121 -0
- package/dist/lib/task-resource-references.d.ts +23 -0
- package/dist/lib/task-resource-references.js +119 -0
- package/dist/lib/task-spec-verification.d.ts +42 -0
- package/dist/lib/task-spec-verification.js +101 -0
- package/dist/lib/task-work.d.ts +11 -0
- package/dist/lib/task-work.js +41 -0
- package/dist/lib/task-write-attribution.d.ts +26 -0
- package/dist/lib/task-write-attribution.js +47 -0
- package/dist/lib/tasks.d.ts +13 -0
- package/dist/lib/tasks.js +61 -8
- package/dist/lib/triggers.d.ts +18 -0
- package/dist/lib/triggers.js +97 -5
- package/dist/lib/usage-discovery.d.ts +4 -0
- package/dist/lib/usage-discovery.js +14 -4
- package/dist/lib/widgetApps.d.ts +10 -0
- package/dist/lib/widgetApps.js +47 -0
- package/dist/lib/widgetStaticScan.js +25 -1
- package/dist/lib/workflow-run-view.d.ts +4 -0
- package/dist/lib/workflow-run-view.js +5 -0
- package/dist/lib/workspaces.d.ts +33 -9
- package/dist/lib/workspaces.js +19 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.d.ts +49 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +26 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.d.ts +118 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +614 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.d.ts +60 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +130 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.d.ts +5 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.js +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionRevocation.d.ts +177 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionRevocation.js +484 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.d.ts +11 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.js +46 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +232 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +372 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.d.ts +17 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.js +12 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +45 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.d.ts +49 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +24 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.d.ts +118 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +608 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.d.ts +60 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +128 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +15 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.d.ts +5 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.js +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionRevocation.d.ts +177 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionRevocation.js +472 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.d.ts +11 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.js +44 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +232 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +360 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.d.ts +17 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.js +12 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +31 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +25255 -18711
- package/docs/v1/operations.md +52 -0
- package/docs/v1/space-search.md +19 -0
- package/oclif.manifest.json +4843 -513
- package/package.json +32 -2
package/dist/lib/harnesses.js
CHANGED
|
@@ -13,6 +13,9 @@ exports.listQuotaAccounts = listQuotaAccounts;
|
|
|
13
13
|
exports.getQuotaHistory = getQuotaHistory;
|
|
14
14
|
exports.updateHarness = updateHarness;
|
|
15
15
|
exports.forgetHarness = forgetHarness;
|
|
16
|
+
exports.pruneHarnesses = pruneHarnesses;
|
|
17
|
+
exports.parseHarnessPruneAge = parseHarnessPruneAge;
|
|
18
|
+
exports.harnessPruneReasonSentence = harnessPruneReasonSentence;
|
|
16
19
|
exports.setHarnessAlias = setHarnessAlias;
|
|
17
20
|
exports.setDefaultHarness = setDefaultHarness;
|
|
18
21
|
exports.mintInstallToken = mintInstallToken;
|
|
@@ -173,6 +176,73 @@ async function updateHarness(id, patch) {
|
|
|
173
176
|
async function forgetHarness(id) {
|
|
174
177
|
return (0, api_fetch_1.apiFetch)(`/api/harnesses/${encodeURIComponent(id)}`, { method: 'DELETE' });
|
|
175
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Remove the caller's superseded harness rows - or, by default, say which would go.
|
|
181
|
+
*
|
|
182
|
+
* ONE route for both: the server makes the decision once and this only asks for it
|
|
183
|
+
* to be shown (`dryRun: true`, also its own default) or carried out. The caller
|
|
184
|
+
* never lists rows and picks, so there is no client-side rule to drift from the
|
|
185
|
+
* server's. A write, so `apiFetch` gives it an idempotency key and a retried
|
|
186
|
+
* request replays the recorded answer instead of running again.
|
|
187
|
+
*/
|
|
188
|
+
async function pruneHarnesses(options = { dryRun: true }) {
|
|
189
|
+
return (0, api_fetch_1.apiFetch)('/api/harnesses/prune', {
|
|
190
|
+
method: 'POST',
|
|
191
|
+
body: {
|
|
192
|
+
dryRun: options.dryRun,
|
|
193
|
+
...(options.limit !== undefined ? { limit: options.limit } : {}),
|
|
194
|
+
...(options.minUnseenMs !== undefined ? { minUnseenMs: options.minUnseenMs } : {}),
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* `--older-than` takes a whole number with a unit: `90m`, `36h`, `7d`. A bare
|
|
200
|
+
* number is hours. Returns milliseconds. The server never goes below its offline
|
|
201
|
+
* window whatever this says.
|
|
202
|
+
*/
|
|
203
|
+
function parseHarnessPruneAge(value) {
|
|
204
|
+
const match = value.trim().match(/^(\d+)\s*(m|h|d)?$/i);
|
|
205
|
+
if (!match) {
|
|
206
|
+
throw new Error(`Invalid --older-than value "${value}". Use a number with m, h or d, such as 90m, 36h or 7d.`);
|
|
207
|
+
}
|
|
208
|
+
const amount = Number(match[1]);
|
|
209
|
+
const unit = (match[2] || 'h').toLowerCase();
|
|
210
|
+
const perUnit = unit === 'd' ? 86_400_000 : unit === 'h' ? 3_600_000 : 60_000;
|
|
211
|
+
return amount * perUnit;
|
|
212
|
+
}
|
|
213
|
+
/** One sentence per reason a row was kept. The only place they are worded. */
|
|
214
|
+
function harnessPruneReasonSentence(row) {
|
|
215
|
+
switch (row.reason) {
|
|
216
|
+
case 'recent':
|
|
217
|
+
return 'seen too recently to be sure it is gone';
|
|
218
|
+
case 'latest_registration':
|
|
219
|
+
return 'the newest registration of its provider on that machine';
|
|
220
|
+
case 'no_live_sibling':
|
|
221
|
+
return 'nothing has replaced it - no daemon on that machine is online for this provider';
|
|
222
|
+
case 'pinned': {
|
|
223
|
+
const names = (row.detail?.agents ?? []).map((a) => a.name ?? a.id);
|
|
224
|
+
const more = row.detail?.moreAgents ?? 0;
|
|
225
|
+
const others = row.detail?.otherAuthors ?? 0;
|
|
226
|
+
const parts = [];
|
|
227
|
+
if (names.length > 0) {
|
|
228
|
+
parts.push(`${names.join(', ')}${more > 0 ? ` and ${more} more` : ''}`);
|
|
229
|
+
}
|
|
230
|
+
if (others > 0)
|
|
231
|
+
parts.push(`${others} agent${others === 1 ? '' : 's'} of other people`);
|
|
232
|
+
return `agents are pinned to it${parts.length > 0 ? ` (${parts.join('; ')})` : ''}`;
|
|
233
|
+
}
|
|
234
|
+
case 'granted':
|
|
235
|
+
return 'it is lent to a workspace';
|
|
236
|
+
case 'default':
|
|
237
|
+
return 'it is your default harness';
|
|
238
|
+
case 'aliased':
|
|
239
|
+
return 'you gave it a name';
|
|
240
|
+
case 'changed_since_plan':
|
|
241
|
+
return 'it changed while this ran (came back online, or was pinned)';
|
|
242
|
+
default:
|
|
243
|
+
return String(row.reason ?? 'kept');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
176
246
|
/**
|
|
177
247
|
* A per-USER display name. Distinct from `updateHarness({name})`, which renames
|
|
178
248
|
* the harness for everyone it is shared with — this only changes what YOU see,
|
|
@@ -53,4 +53,37 @@ export declare function stripStorageFieldsFromText(text: string): string;
|
|
|
53
53
|
export declare function withOk<T>(value: T, ok?: boolean): T | ({
|
|
54
54
|
ok: boolean;
|
|
55
55
|
} & Record<string, unknown>);
|
|
56
|
+
export type CliOperationMode = 'execute' | 'dry_run' | 'verify';
|
|
57
|
+
export type CliWriteState = 'confirmed' | 'not_attempted' | 'unknown';
|
|
58
|
+
export type CliResourceIdentity = {
|
|
59
|
+
kind: string;
|
|
60
|
+
id?: string | null;
|
|
61
|
+
};
|
|
62
|
+
export type CliTaskIdentity = {
|
|
63
|
+
id?: string | null;
|
|
64
|
+
};
|
|
65
|
+
export type CliOperationOptions = {
|
|
66
|
+
command: string;
|
|
67
|
+
mode: CliOperationMode;
|
|
68
|
+
/** Command outcome, not a claim that an unsuccessful write did not commit. */
|
|
69
|
+
outcome: 'succeeded' | 'failed';
|
|
70
|
+
/** Use only the identity returned by a native read/write, never a requested ref. */
|
|
71
|
+
resource?: CliResourceIdentity | null;
|
|
72
|
+
task?: CliTaskIdentity | null;
|
|
73
|
+
/** Include only when the native response explicitly establishes replay. */
|
|
74
|
+
replayed?: boolean;
|
|
75
|
+
writeState?: CliWriteState;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* An opt-in result contract for commands whose native record is not the Task.
|
|
79
|
+
* Legacy payload paths remain in place; `_cli` is the CLI-owned v1 namespace.
|
|
80
|
+
* In particular, an Update's id never becomes the enclosing Task's id. Missing
|
|
81
|
+
* native identities stay null rather than being guessed from positional refs.
|
|
82
|
+
*
|
|
83
|
+
* Arrays/primitives remain unchanged. This helper never wraps arbitrary `log`
|
|
84
|
+
* output, inspects a command name to infer a record, or invents a created ID
|
|
85
|
+
* for dry-run/verification. `writeState:unknown` on an error is deliberate:
|
|
86
|
+
* a failed HTTP response is not proof that a server-side write did not commit.
|
|
87
|
+
*/
|
|
88
|
+
export declare function withCliOperation<T>(value: T, options: CliOperationOptions): T | Record<string, unknown>;
|
|
56
89
|
export {};
|
package/dist/lib/json-output.js
CHANGED
|
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
exports.stripStorageFields = stripStorageFields;
|
|
22
22
|
exports.stripStorageFieldsFromText = stripStorageFieldsFromText;
|
|
23
23
|
exports.withOk = withOk;
|
|
24
|
+
exports.withCliOperation = withCliOperation;
|
|
24
25
|
function usableId(value) {
|
|
25
26
|
return (typeof value === 'string' && value.length > 0) || typeof value === 'number';
|
|
26
27
|
}
|
|
@@ -106,3 +107,39 @@ function withOk(value, ok = true) {
|
|
|
106
107
|
return value;
|
|
107
108
|
return { ok, ...value };
|
|
108
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* An opt-in result contract for commands whose native record is not the Task.
|
|
112
|
+
* Legacy payload paths remain in place; `_cli` is the CLI-owned v1 namespace.
|
|
113
|
+
* In particular, an Update's id never becomes the enclosing Task's id. Missing
|
|
114
|
+
* native identities stay null rather than being guessed from positional refs.
|
|
115
|
+
*
|
|
116
|
+
* Arrays/primitives remain unchanged. This helper never wraps arbitrary `log`
|
|
117
|
+
* output, inspects a command name to infer a record, or invents a created ID
|
|
118
|
+
* for dry-run/verification. `writeState:unknown` on an error is deliberate:
|
|
119
|
+
* a failed HTTP response is not proof that a server-side write did not commit.
|
|
120
|
+
*/
|
|
121
|
+
function withCliOperation(value, options) {
|
|
122
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
123
|
+
return value;
|
|
124
|
+
const id = (candidate) => typeof candidate === 'string' && candidate.trim() ? candidate : null;
|
|
125
|
+
const resourceId = id(options.resource?.id);
|
|
126
|
+
const taskId = id(options.task?.id);
|
|
127
|
+
const outcome = value.ok === false ? 'failed' : options.outcome;
|
|
128
|
+
return {
|
|
129
|
+
...withOk(value, outcome === 'succeeded'),
|
|
130
|
+
_cli: {
|
|
131
|
+
schemaVersion: 1,
|
|
132
|
+
command: options.command,
|
|
133
|
+
mode: options.mode,
|
|
134
|
+
outcome,
|
|
135
|
+
resource: resourceId && options.resource?.kind
|
|
136
|
+
? { kind: options.resource.kind, id: resourceId }
|
|
137
|
+
: null,
|
|
138
|
+
task: taskId ? { id: taskId } : null,
|
|
139
|
+
...(options.replayed !== undefined ? { replayed: options.replayed } : {}),
|
|
140
|
+
writeState: options.mode !== 'execute'
|
|
141
|
+
? 'not_attempted'
|
|
142
|
+
: options.writeState ?? (outcome === 'succeeded' ? 'confirmed' : 'unknown'),
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
@@ -18,7 +18,8 @@ export type ListEnvelope = {
|
|
|
18
18
|
* Documented in docs/cli/SKRR_TASKS.md (List output for agents).
|
|
19
19
|
*/
|
|
20
20
|
export declare const COMPACT_FIELDS: {
|
|
21
|
-
readonly
|
|
21
|
+
readonly agent: readonly ["id", "name", "description", "harnessId", "harnessName", "harnessProvider", "harnessStatus", "executionReadiness", "updatedAt", "url"];
|
|
22
|
+
readonly task: readonly ["id", "identifier", "ref", "title", "status", "statusType", "priority", "estimate", "assigneeAgentIds", "assigneeUserIds", "parentId", "spaceId", "projectId", "goalId", "dueDate", "scheduledFor", "labelIds", "tags", "externalKey", "version", "executionMode", "nextAction", "actionability", "execution", "economicsRank", "createdAt", "updatedAt", "url"];
|
|
22
23
|
readonly space: readonly ["id", "identifier", "title", "status", "parentSpaceId", "leadAgentId", "labelIds", "archivedAt", "createdAt", "updatedAt", "url"];
|
|
23
24
|
readonly project: readonly ["id", "identifier", "title", "spaceId", "externalKey", "taskCounts", "archivedAt", "createdAt", "updatedAt", "url"];
|
|
24
25
|
};
|
|
@@ -38,11 +39,15 @@ export type ListOutputFlags = {
|
|
|
38
39
|
export declare function parseFields(raw: string | undefined): string[] | undefined;
|
|
39
40
|
export declare function projectRow(row: Record<string, unknown>, fields: readonly string[]): Record<string, unknown>;
|
|
40
41
|
/**
|
|
41
|
-
* Normalize
|
|
42
|
-
*
|
|
42
|
+
* Normalize a list response to the shared envelope. Each command explicitly
|
|
43
|
+
* supplies its legacy row key when needed; named keys remain compatible.
|
|
44
|
+
* The original projects adapter continues folding its old key into `data`.
|
|
43
45
|
* A response that is not list-shaped is returned untouched (never invent rows).
|
|
44
46
|
*/
|
|
45
|
-
export declare function toListEnvelope(response: unknown): ListEnvelope | undefined;
|
|
47
|
+
export declare function toListEnvelope(response: unknown, rowKey?: string): ListEnvelope | undefined;
|
|
48
|
+
/** Explicit command boundary: retain unknown responses rather than inventing empty rows.
|
|
49
|
+
* Named row keys remain available for existing consumers during migration. */
|
|
50
|
+
export declare function listResult(response: unknown, rowKey?: string): unknown;
|
|
46
51
|
export type ShapeListOptions = ListOutputFlags & {
|
|
47
52
|
resource: ListResource;
|
|
48
53
|
/** What the caller asked for with --limit (undefined when the command has none). */
|
package/dist/lib/list-output.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.listOutputFlags = exports.COMPACT_FIELDS = void 0;
|
|
|
4
4
|
exports.parseFields = parseFields;
|
|
5
5
|
exports.projectRow = projectRow;
|
|
6
6
|
exports.toListEnvelope = toListEnvelope;
|
|
7
|
+
exports.listResult = listResult;
|
|
7
8
|
exports.shapeListResponse = shapeListResponse;
|
|
8
9
|
exports.limitNote = limitNote;
|
|
9
10
|
exports.warningLines = warningLines;
|
|
@@ -38,6 +39,7 @@ const json_output_1 = require("./json-output");
|
|
|
38
39
|
* Documented in docs/cli/SKRR_TASKS.md (List output for agents).
|
|
39
40
|
*/
|
|
40
41
|
exports.COMPACT_FIELDS = {
|
|
42
|
+
agent: ['id', 'name', 'description', 'harnessId', 'harnessName', 'harnessProvider', 'harnessStatus', 'executionReadiness', 'updatedAt', 'url'],
|
|
41
43
|
task: [
|
|
42
44
|
'id',
|
|
43
45
|
'identifier',
|
|
@@ -61,6 +63,10 @@ exports.COMPACT_FIELDS = {
|
|
|
61
63
|
'version',
|
|
62
64
|
'executionMode',
|
|
63
65
|
'nextAction',
|
|
66
|
+
'actionability',
|
|
67
|
+
'execution',
|
|
68
|
+
// Present only on a `--rank economics` page: the score the row was sorted by (OSK-16476).
|
|
69
|
+
'economicsRank',
|
|
64
70
|
'createdAt',
|
|
65
71
|
'updatedAt',
|
|
66
72
|
'url',
|
|
@@ -144,13 +150,15 @@ function projectRow(row, fields) {
|
|
|
144
150
|
return out;
|
|
145
151
|
}
|
|
146
152
|
/**
|
|
147
|
-
* Normalize
|
|
148
|
-
*
|
|
153
|
+
* Normalize a list response to the shared envelope. Each command explicitly
|
|
154
|
+
* supplies its legacy row key when needed; named keys remain compatible.
|
|
155
|
+
* The original projects adapter continues folding its old key into `data`.
|
|
149
156
|
* A response that is not list-shaped is returned untouched (never invent rows).
|
|
150
157
|
*/
|
|
151
|
-
function toListEnvelope(response) {
|
|
158
|
+
function toListEnvelope(response, rowKey) {
|
|
152
159
|
if (Array.isArray(response)) {
|
|
153
160
|
return {
|
|
161
|
+
ok: true,
|
|
154
162
|
object: 'list',
|
|
155
163
|
data: response,
|
|
156
164
|
has_more: false,
|
|
@@ -160,25 +168,44 @@ function toListEnvelope(response) {
|
|
|
160
168
|
if (!response || typeof response !== 'object')
|
|
161
169
|
return undefined;
|
|
162
170
|
const r = response;
|
|
163
|
-
const rows = Array.isArray(r.data)
|
|
171
|
+
const rows = Array.isArray(r.data)
|
|
172
|
+
? r.data
|
|
173
|
+
: rowKey && Array.isArray(r[rowKey])
|
|
174
|
+
? r[rowKey]
|
|
175
|
+
: Array.isArray(r.projects)
|
|
176
|
+
? r.projects
|
|
177
|
+
: undefined;
|
|
164
178
|
if (!rows)
|
|
165
179
|
return undefined;
|
|
180
|
+
const nextCursor = r.next_cursor ?? r.nextCursor ?? r.nextAfterId ?? r.after;
|
|
166
181
|
const { projects: _legacy, ...rest } = r;
|
|
167
182
|
void _legacy;
|
|
168
183
|
return {
|
|
169
|
-
...rest,
|
|
184
|
+
...(0, json_output_1.withOk)(rest),
|
|
170
185
|
object: 'list',
|
|
171
186
|
data: rows,
|
|
172
|
-
has_more: typeof r.has_more === 'boolean'
|
|
173
|
-
|
|
187
|
+
has_more: typeof r.has_more === 'boolean'
|
|
188
|
+
? r.has_more
|
|
189
|
+
: typeof r.hasMore === 'boolean'
|
|
190
|
+
? r.hasMore
|
|
191
|
+
: Boolean(nextCursor),
|
|
192
|
+
next_cursor: typeof nextCursor === 'string' ? nextCursor : null,
|
|
174
193
|
};
|
|
175
194
|
}
|
|
195
|
+
/** Explicit command boundary: retain unknown responses rather than inventing empty rows.
|
|
196
|
+
* Named row keys remain available for existing consumers during migration. */
|
|
197
|
+
function listResult(response, rowKey) {
|
|
198
|
+
return toListEnvelope(response, rowKey) ?? (0, json_output_1.withOk)(response);
|
|
199
|
+
}
|
|
176
200
|
/** Pure: envelope + projection + notes. Returns the response untouched if not a list. */
|
|
177
201
|
function shapeListResponse(response, options) {
|
|
178
202
|
const envelope = toListEnvelope(response);
|
|
179
203
|
if (!envelope)
|
|
180
204
|
return response;
|
|
181
|
-
const warnings = [
|
|
205
|
+
const warnings = [
|
|
206
|
+
...(Array.isArray(envelope.warnings) ? envelope.warnings : []),
|
|
207
|
+
...(options.warnings ?? []),
|
|
208
|
+
];
|
|
182
209
|
const fields = parseFields(options.fields);
|
|
183
210
|
let data = envelope.data;
|
|
184
211
|
if (fields) {
|
|
@@ -277,7 +304,9 @@ function renderListOutput(shaped, ndjson) {
|
|
|
277
304
|
if (!envelope || !Array.isArray(envelope.data)) {
|
|
278
305
|
return { stdout: [JSON.stringify(shaped)], stderr: [] };
|
|
279
306
|
}
|
|
280
|
-
const { data, ...
|
|
307
|
+
const { data, ...metadata } = envelope;
|
|
308
|
+
// Compatibility row aliases are not metadata and must not duplicate the rows.
|
|
309
|
+
const meta = Object.fromEntries(Object.entries(metadata).filter(([, value]) => value !== data));
|
|
281
310
|
return {
|
|
282
311
|
stdout: data.map((row) => JSON.stringify(row)),
|
|
283
312
|
stderr: [JSON.stringify({ _meta: meta })],
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { lookbackPlansApi, type CreateLookbackPlanRequest, type LookbackPlan, type LookbackPlanInput } from '@skrr-ai/data-provider';
|
|
2
|
+
export { lookbackPlansApi };
|
|
3
|
+
export declare const lookbackPlanIdArg: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
4
|
+
/** JSON can be the plan itself or the canonical create envelope. Never copy identity fields. */
|
|
5
|
+
export declare function lookbackCreateBody(input: Record<string, unknown>, explicitAgentId?: string): CreateLookbackPlanRequest;
|
|
6
|
+
/** Validate time forms locally; admission time and authorization remain server authoritative. */
|
|
7
|
+
export declare function lookbackInput(raw: unknown, allowPast?: boolean): LookbackPlanInput;
|
|
8
|
+
export declare function lookbackPlanSummary(plan: LookbackPlan): string;
|
|
9
|
+
export declare function lookbackArmingLine(result: {
|
|
10
|
+
plan: LookbackPlan;
|
|
11
|
+
reused?: boolean;
|
|
12
|
+
armed: boolean;
|
|
13
|
+
}): string;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lookbackPlanIdArg = exports.lookbackPlansApi = void 0;
|
|
4
|
+
exports.lookbackCreateBody = lookbackCreateBody;
|
|
5
|
+
exports.lookbackInput = lookbackInput;
|
|
6
|
+
exports.lookbackPlanSummary = lookbackPlanSummary;
|
|
7
|
+
exports.lookbackArmingLine = lookbackArmingLine;
|
|
8
|
+
const core_1 = require("@oclif/core");
|
|
9
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
10
|
+
Object.defineProperty(exports, "lookbackPlansApi", { enumerable: true, get: function () { return data_provider_1.lookbackPlansApi; } });
|
|
11
|
+
const followups_1 = require("./followups");
|
|
12
|
+
exports.lookbackPlanIdArg = core_1.Args.string({
|
|
13
|
+
description: 'Lookback plan id', required: true, ignoreStdin: true,
|
|
14
|
+
parse: async (value) => {
|
|
15
|
+
if (!value.trim())
|
|
16
|
+
throw new Error('Plan id is empty; see `skrr followups plans list`');
|
|
17
|
+
return value.trim();
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
/** JSON can be the plan itself or the canonical create envelope. Never copy identity fields. */
|
|
21
|
+
function lookbackCreateBody(input, explicitAgentId) {
|
|
22
|
+
const envelope = Object.prototype.hasOwnProperty.call(input, 'plan');
|
|
23
|
+
const allowed = envelope
|
|
24
|
+
? ['agentId', 'plan', 'endpointId', 'endpointTarget', 'pinnedConversationId']
|
|
25
|
+
: ['title', 'objective', 'stopCondition', 'timezone', 'source', 'steps'];
|
|
26
|
+
const unknown = Object.keys(input).filter((key) => !allowed.includes(key));
|
|
27
|
+
if (unknown.length)
|
|
28
|
+
throw new Error(`Unknown lookback input fields: ${unknown.join(', ')}`);
|
|
29
|
+
if (envelope) {
|
|
30
|
+
for (const field of ['agentId', 'endpointId', 'endpointTarget', 'pinnedConversationId']) {
|
|
31
|
+
if (input[field] !== undefined && (typeof input[field] !== 'string' || !input[field].trim())) {
|
|
32
|
+
throw new Error(`${field} must be a non-empty string`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const inputAgent = typeof input.agentId === 'string' ? input.agentId : undefined;
|
|
37
|
+
if (explicitAgentId && inputAgent && explicitAgentId !== inputAgent) {
|
|
38
|
+
throw new Error('--agent conflicts with agentId in the input');
|
|
39
|
+
}
|
|
40
|
+
const agent = (0, followups_1.resolveFollowUpAgent)(explicitAgentId || inputAgent);
|
|
41
|
+
return {
|
|
42
|
+
agentId: agent.id,
|
|
43
|
+
producer: agent.boundToSession ? 'agent_in_turn' : 'user_explicit',
|
|
44
|
+
plan: lookbackInput(envelope ? input.plan : input),
|
|
45
|
+
...(envelope && input.endpointId !== undefined ? { endpointId: input.endpointId } : {}),
|
|
46
|
+
...(envelope && input.endpointTarget !== undefined ? { endpointTarget: input.endpointTarget } : {}),
|
|
47
|
+
...(envelope && input.pinnedConversationId !== undefined
|
|
48
|
+
? { pinnedConversationId: input.pinnedConversationId } : {}),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** Validate time forms locally; admission time and authorization remain server authoritative. */
|
|
52
|
+
function lookbackInput(raw, allowPast = false) {
|
|
53
|
+
const parsed = (0, data_provider_1.normalizeLookbackPlanInput)(raw, { allowPast });
|
|
54
|
+
if (!parsed.ok)
|
|
55
|
+
throw new Error(`${parsed.code}: ${parsed.message}`);
|
|
56
|
+
// Send only authored fields. The server fixes normalized times, generated
|
|
57
|
+
// step IDs, lifecycle and ownership; CLI must not forge those projections.
|
|
58
|
+
return raw;
|
|
59
|
+
}
|
|
60
|
+
function lookbackPlanSummary(plan) {
|
|
61
|
+
const next = plan.steps.find((step) => step.state === 'pending');
|
|
62
|
+
return `${plan.id} [${plan.state}] r${plan.revision} ${plan.title || plan.objective}` +
|
|
63
|
+
` ${plan.steps.length} lookbacks${next ? ` next:${next.runAt}` : ''}`;
|
|
64
|
+
}
|
|
65
|
+
function lookbackArmingLine(result) {
|
|
66
|
+
const status = result.armed ? 'armed' : 'saved; scheduling is pending';
|
|
67
|
+
return `Lookback plan ${result.plan.id} ${status}${result.reused ? ' (existing plan)' : ''}.`;
|
|
68
|
+
}
|
package/dist/lib/machines.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DaemonContactState } from '@skrr-ai/data-provider';
|
|
1
2
|
/**
|
|
2
3
|
* machines.ts — request client for `/api/machines`.
|
|
3
4
|
*
|
|
@@ -62,6 +63,17 @@ export interface MachineHarnessRow {
|
|
|
62
63
|
stale?: boolean;
|
|
63
64
|
/** How long that row has been silent, in ms. Present with `stale`. */
|
|
64
65
|
staleForMs?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Recorded `online`, and the server saw the daemon's connection CLOSE with no
|
|
68
|
+
* heartbeat since: it is waiting out the grace before recording the daemon
|
|
69
|
+
* offline (`MachineContact.reconnectGraceMs`). A laptop that wakes, a network
|
|
70
|
+
* that blips and an API replica that restarts all come back inside it; a daemon
|
|
71
|
+
* stopped on purpose does not, and goes `offline` when it runs out. Present only
|
|
72
|
+
* when true (OSK-16442).
|
|
73
|
+
*/
|
|
74
|
+
reconnecting?: boolean;
|
|
75
|
+
/** How long ago the connection closed, in ms. Present with `reconnecting`. */
|
|
76
|
+
disconnectedForMs?: number;
|
|
65
77
|
}
|
|
66
78
|
/**
|
|
67
79
|
* What a machine's heartbeats say, apart from what its rows are recorded as
|
|
@@ -70,18 +82,24 @@ export interface MachineHarnessRow {
|
|
|
70
82
|
* `online` for a process that had not been heard from in a minute.
|
|
71
83
|
*
|
|
72
84
|
* - `live`: a row is online and heard from recently.
|
|
85
|
+
* - `reconnecting`: the server saw a daemon's connection close and is waiting for
|
|
86
|
+
* it to come back. The machine's `status` is `degraded` meanwhile.
|
|
73
87
|
* - `stale`: rows are recorded online, but none has been heard from for
|
|
74
88
|
* `staleAfterMs`. The machine's `status` is `degraded` meanwhile.
|
|
75
89
|
* - `offline`: nothing is recorded online.
|
|
76
90
|
*
|
|
77
91
|
* The thresholds are the server's, sent so this CLI never restates them. Absent
|
|
78
|
-
* on a server older than this field and on a lease-backed machine.
|
|
92
|
+
* on a server older than this field and on a lease-backed machine. The two
|
|
93
|
+
* `...ForMs` fields and `reconnectGraceMs` arrived after the first version of the
|
|
94
|
+
* object, so a server one release older omits them.
|
|
79
95
|
*/
|
|
80
96
|
export interface MachineContact {
|
|
81
|
-
state:
|
|
97
|
+
state: DaemonContactState;
|
|
82
98
|
staleForMs: number | null;
|
|
99
|
+
disconnectedForMs?: number | null;
|
|
83
100
|
staleAfterMs: number;
|
|
84
101
|
offlineAfterMs: number;
|
|
102
|
+
reconnectGraceMs?: number;
|
|
85
103
|
}
|
|
86
104
|
export interface Machine {
|
|
87
105
|
id: string;
|
|
@@ -190,11 +208,12 @@ export interface MachineDaemonSummary {
|
|
|
190
208
|
/** How it was launched (`cli`, `launchd`, …); null when the id does not say. */
|
|
191
209
|
source: string | null;
|
|
192
210
|
/**
|
|
193
|
-
* `online` when any registration is online and heard from recently,
|
|
194
|
-
* when
|
|
195
|
-
*
|
|
211
|
+
* `online` when any registration is online and heard from recently,
|
|
212
|
+
* `reconnecting` when the server saw its connection close and is waiting,
|
|
213
|
+
* `stale` when some are recorded online but none has been heard from lately,
|
|
214
|
+
* `offline` otherwise.
|
|
196
215
|
*/
|
|
197
|
-
status: 'online' | 'stale' | 'offline';
|
|
216
|
+
status: 'online' | 'reconnecting' | 'stale' | 'offline';
|
|
198
217
|
lastSeenAt: string | null;
|
|
199
218
|
harnessCount: number;
|
|
200
219
|
/** Of those, how many a newer registration of the same provider replaced. */
|
|
@@ -206,6 +225,8 @@ export declare function parseDaemonId(daemonId: string): {
|
|
|
206
225
|
source: string;
|
|
207
226
|
profile: string;
|
|
208
227
|
} | null;
|
|
228
|
+
/** The word the tables print for one harness row: the server's statement, not the bare status. */
|
|
229
|
+
export declare function harnessStateLabel(row: MachineHarnessRow): string;
|
|
209
230
|
export declare function summarizeDaemons(harnesses: readonly MachineHarnessRow[], activeProfile: string): MachineDaemonSummary[];
|
|
210
231
|
/** Whether the machine's identity is THIS computer's (the default profile's, or a profile qualified from it). */
|
|
211
232
|
export declare function isThisComputer(machine: Machine, hardwareMachineUuid: string): boolean;
|
package/dist/lib/machines.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.isReachableMachine = isReachableMachine;
|
|
|
6
6
|
exports.isOwnComputer = isOwnComputer;
|
|
7
7
|
exports.isListedByDefault = isListedByDefault;
|
|
8
8
|
exports.parseDaemonId = parseDaemonId;
|
|
9
|
+
exports.harnessStateLabel = harnessStateLabel;
|
|
9
10
|
exports.summarizeDaemons = summarizeDaemons;
|
|
10
11
|
exports.isThisComputer = isThisComputer;
|
|
11
12
|
exports.machineListView = machineListView;
|
|
@@ -15,6 +16,7 @@ exports.getMachine = getMachine;
|
|
|
15
16
|
exports.updateMachine = updateMachine;
|
|
16
17
|
exports.disconnectMachine = disconnectMachine;
|
|
17
18
|
exports.resolveMachineRef = resolveMachineRef;
|
|
19
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
18
20
|
const api_fetch_1 = require("./api-fetch");
|
|
19
21
|
/**
|
|
20
22
|
* What a machine's state actually is, when `offline` is doing two jobs.
|
|
@@ -31,11 +33,15 @@ const api_fetch_1 = require("./api-fetch");
|
|
|
31
33
|
* could come back says so, and a destroyed one cannot.
|
|
32
34
|
*/
|
|
33
35
|
function machineStateLabel(machine) {
|
|
34
|
-
// `degraded` is the machine's status while a daemon is silent
|
|
35
|
-
// same as a sign-in problem or one provider
|
|
36
|
-
// it is; the word a person reads is that one
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
// `degraded` is the machine's status while a daemon is silent or its connection
|
|
37
|
+
// has just closed, and it reads the same as a sign-in problem or one provider
|
|
38
|
+
// being down. The server says which it is; the word a person reads is that one
|
|
39
|
+
// (OSK-16442).
|
|
40
|
+
if (machine.status === 'degraded') {
|
|
41
|
+
const contact = machine.contact?.state;
|
|
42
|
+
if (contact === 'stale' || contact === 'reconnecting')
|
|
43
|
+
return data_provider_1.DAEMON_CONTACT_WORDS[contact];
|
|
44
|
+
}
|
|
39
45
|
if (machine.status !== 'offline')
|
|
40
46
|
return machine.status;
|
|
41
47
|
// A computer somebody installed a daemon on has no lease to resume and nothing
|
|
@@ -132,6 +138,11 @@ function newerStamp(a, b) {
|
|
|
132
138
|
return a;
|
|
133
139
|
return new Date(b).getTime() > new Date(a).getTime() ? b : a;
|
|
134
140
|
}
|
|
141
|
+
const RANK = { online: 0, reconnecting: 1, stale: 2, offline: 3 };
|
|
142
|
+
/** The word the tables print for one harness row: the server's statement, not the bare status. */
|
|
143
|
+
function harnessStateLabel(row) {
|
|
144
|
+
return data_provider_1.DAEMON_CONTACT_WORDS[(0, data_provider_1.daemonContactOfRow)(row)];
|
|
145
|
+
}
|
|
135
146
|
function summarizeDaemons(harnesses, activeProfile) {
|
|
136
147
|
const byDaemon = new Map();
|
|
137
148
|
for (const row of harnesses) {
|
|
@@ -152,18 +163,18 @@ function summarizeDaemons(harnesses, activeProfile) {
|
|
|
152
163
|
entry.harnessCount += 1;
|
|
153
164
|
if (row.superseded === true)
|
|
154
165
|
entry.supersededCount += 1;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
166
|
+
// The server's statement for this row, read, not recomputed. A daemon is as
|
|
167
|
+
// heard-from as its best row.
|
|
168
|
+
const state = (0, data_provider_1.daemonContactOfRow)(row);
|
|
169
|
+
const rowStatus = state === 'live' ? 'online' : state;
|
|
170
|
+
if (RANK[rowStatus] < RANK[entry.status])
|
|
171
|
+
entry.status = rowStatus;
|
|
161
172
|
entry.lastSeenAt = newerStamp(entry.lastSeenAt, row.lastSeenAt);
|
|
162
173
|
byDaemon.set(row.daemonId, entry);
|
|
163
174
|
}
|
|
164
|
-
// Connected first, then silent, then gone, each by
|
|
165
|
-
// person is looking for is on top.
|
|
166
|
-
const rank =
|
|
175
|
+
// Connected first, then waiting on a reconnect, then silent, then gone, each by
|
|
176
|
+
// most recently seen: the one a person is looking for is on top.
|
|
177
|
+
const rank = RANK;
|
|
167
178
|
return [...byDaemon.values()].sort((a, b) => {
|
|
168
179
|
if (a.status !== b.status)
|
|
169
180
|
return rank[a.status] - rank[b.status];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Member discovery promises identity and access, not image transport credentials. */
|
|
2
|
+
export declare const memberImageFlags: {
|
|
3
|
+
'include-images': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
4
|
+
};
|
|
5
|
+
/** Only the explicit image flag expands a member; --raw affects storage fields only. */
|
|
6
|
+
export declare function memberAvatar(raw: {
|
|
7
|
+
avatar?: unknown;
|
|
8
|
+
} | null | undefined, includeImages?: boolean): {
|
|
9
|
+
avatar?: string;
|
|
10
|
+
};
|
|
11
|
+
/** Allowlist scalar fields so future provider additions cannot inflate routine logs. */
|
|
12
|
+
export declare function projectMemberPrincipal(raw: Record<string, unknown>, includeImages?: boolean): Record<string, unknown>;
|
|
13
|
+
/** Do not spread provider metadata: it can carry another copy of a raw principal. */
|
|
14
|
+
export declare function projectSpaceMembership(response: {
|
|
15
|
+
resourceType: string;
|
|
16
|
+
resourceId: string;
|
|
17
|
+
principals: Array<Record<string, unknown>>;
|
|
18
|
+
public: boolean;
|
|
19
|
+
publicAccessRoleId?: string;
|
|
20
|
+
}, includeImages?: boolean): Record<string, unknown>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.memberImageFlags = void 0;
|
|
4
|
+
exports.memberAvatar = memberAvatar;
|
|
5
|
+
exports.projectMemberPrincipal = projectMemberPrincipal;
|
|
6
|
+
exports.projectSpaceMembership = projectSpaceMembership;
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
|
+
/** Member discovery promises identity and access, not image transport credentials. */
|
|
9
|
+
exports.memberImageFlags = {
|
|
10
|
+
'include-images': core_1.Flags.boolean({
|
|
11
|
+
description: 'Include avatar URLs in JSON. These may be temporary signed URLs containing authorization query parameters; avoid recording or sharing them.',
|
|
12
|
+
default: false,
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
/** Only the explicit image flag expands a member; --raw affects storage fields only. */
|
|
16
|
+
function memberAvatar(raw, includeImages = false) {
|
|
17
|
+
return includeImages && typeof raw?.avatar === 'string'
|
|
18
|
+
? { avatar: raw.avatar }
|
|
19
|
+
: {};
|
|
20
|
+
}
|
|
21
|
+
const PRINCIPAL_FIELDS = [
|
|
22
|
+
'type',
|
|
23
|
+
'id',
|
|
24
|
+
'idOnTheSource',
|
|
25
|
+
'name',
|
|
26
|
+
'email',
|
|
27
|
+
'source',
|
|
28
|
+
'accessRoleId',
|
|
29
|
+
'memberCount',
|
|
30
|
+
'harnessProvider',
|
|
31
|
+
'harnessName',
|
|
32
|
+
'harnessStatus',
|
|
33
|
+
'harnessLastSeenAt',
|
|
34
|
+
];
|
|
35
|
+
/** Allowlist scalar fields so future provider additions cannot inflate routine logs. */
|
|
36
|
+
function projectMemberPrincipal(raw, includeImages = false) {
|
|
37
|
+
const member = {};
|
|
38
|
+
for (const field of PRINCIPAL_FIELDS) {
|
|
39
|
+
const value = raw[field];
|
|
40
|
+
if (typeof value === 'string' || typeof value === 'number' || value === null) {
|
|
41
|
+
member[field] = value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return { ...member, ...memberAvatar(raw, includeImages) };
|
|
45
|
+
}
|
|
46
|
+
/** Do not spread provider metadata: it can carry another copy of a raw principal. */
|
|
47
|
+
function projectSpaceMembership(response, includeImages = false) {
|
|
48
|
+
return {
|
|
49
|
+
resourceType: response.resourceType,
|
|
50
|
+
resourceId: response.resourceId,
|
|
51
|
+
principals: response.principals.map((member) => projectMemberPrincipal(member, includeImages)),
|
|
52
|
+
public: response.public,
|
|
53
|
+
...(response.publicAccessRoleId === undefined
|
|
54
|
+
? {}
|
|
55
|
+
: { publicAccessRoleId: response.publicAccessRoleId }),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -16,6 +16,13 @@ type GateLike = {
|
|
|
16
16
|
export declare function sourceRefusalWords(code: string): string;
|
|
17
17
|
/** Extra lines under a gate, or none. The gate's own note is printed by the caller. */
|
|
18
18
|
export declare function gateExplanationLines(gate: GateLike): string[];
|
|
19
|
+
/**
|
|
20
|
+
* One line per execution target under "Is there somewhere else it can run?" (OSK-17003): the
|
|
21
|
+
* product, consent, contract and reachability the resolver would apply. The gate used to report a
|
|
22
|
+
* bare `fallbackCandidates` count, which read the same for a fallback that could take the run and
|
|
23
|
+
* one that never could. Nothing is printed for a single primary — the gate's note says that.
|
|
24
|
+
*/
|
|
25
|
+
export declare function placementTargetLines(gate: GateLike): string[];
|
|
19
26
|
/**
|
|
20
27
|
* The status word for a capability. A credential whose expiry has passed is `expired`, not the
|
|
21
28
|
* storage word `stale`, which gave no sign that time had run out.
|