@skrr-ai/cli 0.1.110 → 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 +31 -3
- package/dist/base-command.js +136 -22
- 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/list.js +2 -1
- 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/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/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/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/triggers/list.js +2 -1
- 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 +3 -7
- 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 +97 -4
- 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/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.js +17 -11
- 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/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +25 -2
- 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/list.js +2 -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/list.js +3 -2
- package/dist/commands/workspaces/members.d.ts +1 -0
- package/dist/commands/workspaces/members.js +5 -2
- 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/commitments.d.ts +44 -3
- package/dist/lib/commitments.js +107 -9
- package/dist/lib/compasses.d.ts +4 -0
- package/dist/lib/compasses.js +11 -0
- package/dist/lib/daemon-setup.js +7 -7
- package/dist/lib/daemonHandoff.js +3 -2
- package/dist/lib/dedicated-ssh.d.ts +2 -0
- package/dist/lib/dedicated-ssh.js +98 -28
- 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 +36 -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/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-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 +7 -0
- package/dist/lib/triggers.js +54 -4
- 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/workspaces.d.ts +11 -4
- package/dist/lib/workspaces.js +7 -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/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/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 +30 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +25239 -18730
- package/docs/v1/operations.md +52 -0
- package/docs/v1/space-search.md +19 -0
- package/oclif.manifest.json +4719 -479
- package/package.json +23 -2
|
@@ -301,8 +301,11 @@ function runSshProxy(options) {
|
|
|
301
301
|
let closing = false;
|
|
302
302
|
let lastKeepaliveAt = 0;
|
|
303
303
|
let pendingInput = null;
|
|
304
|
-
const identityAuth = () => ({
|
|
305
|
-
|
|
304
|
+
const identityAuth = () => ({
|
|
305
|
+
...(0, data_provider_1.getClientIdentityAuth)(),
|
|
306
|
+
clientPlatform: 'cli',
|
|
307
|
+
clientOs: process.platform === 'darwin' ? 'macos' : process.platform,
|
|
308
|
+
});
|
|
306
309
|
const wsOrigin = (0, agentic_stream_1.toWebSocketOrigin)(options.baseURL);
|
|
307
310
|
const handshakeAuth = (token, callback) => {
|
|
308
311
|
// Resolve a fresh proof after token renewal on every reconnect. Never
|
|
@@ -315,20 +318,30 @@ function runSshProxy(options) {
|
|
|
315
318
|
};
|
|
316
319
|
const socket = connect(wsOrigin, {
|
|
317
320
|
path: '/ws/agentic',
|
|
318
|
-
auth: options.getToken
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
auth: options.getToken
|
|
322
|
+
? (callback) => {
|
|
323
|
+
void options.getToken().then((token) => handshakeAuth(token, callback), () => {
|
|
324
|
+
finish(1, 'Could not renew SSH authentication. Restore skrr login and connect again.');
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
: (0, dpop_auth_1.socketAuthWithDpop)({ token: options.token, ...identityAuth() }, wsOrigin),
|
|
328
|
+
transports: ['websocket'],
|
|
329
|
+
reconnection: true,
|
|
330
|
+
reconnectionDelay: 1000,
|
|
331
|
+
reconnectionDelayMax: 2000,
|
|
325
332
|
});
|
|
326
333
|
const startTimer = setTimeout(() => finish(1, 'The machine did not answer the SSH channel in time. Its daemon may be busy or offline.'), exports.SSH_START_TIMEOUT_MS);
|
|
327
334
|
function sendPendingInput() {
|
|
328
335
|
if (closing || !online || !attached || !pendingInput || finished)
|
|
329
336
|
return;
|
|
330
|
-
socket.emit('dedicated:ssh:data', {
|
|
331
|
-
|
|
337
|
+
socket.emit('dedicated:ssh:data', {
|
|
338
|
+
channelId,
|
|
339
|
+
data: pendingInput.bytes.toString('base64'),
|
|
340
|
+
resumeV2: true,
|
|
341
|
+
epoch,
|
|
342
|
+
generation,
|
|
343
|
+
offset: pendingInput.offset,
|
|
344
|
+
});
|
|
332
345
|
}
|
|
333
346
|
function pumpInput() {
|
|
334
347
|
if (closing || !started || !resumable || !online || !attached || pendingInput || finished)
|
|
@@ -351,11 +364,23 @@ function runSshProxy(options) {
|
|
|
351
364
|
};
|
|
352
365
|
function sendResume() {
|
|
353
366
|
if (online && started && resumable && !attached && !finished) {
|
|
354
|
-
socket.emit('dedicated:ssh:resume', {
|
|
367
|
+
socket.emit('dedicated:ssh:resume', {
|
|
368
|
+
leaseId: options.leaseId,
|
|
369
|
+
channelId,
|
|
370
|
+
resumeProof,
|
|
371
|
+
epoch,
|
|
372
|
+
generation,
|
|
373
|
+
attachmentSeq,
|
|
374
|
+
});
|
|
355
375
|
}
|
|
356
376
|
}
|
|
357
377
|
function keepalive() {
|
|
358
|
-
if (started &&
|
|
378
|
+
if (started &&
|
|
379
|
+
resumable &&
|
|
380
|
+
attached &&
|
|
381
|
+
online &&
|
|
382
|
+
!finished &&
|
|
383
|
+
Date.now() - lastKeepaliveAt >= 10_000) {
|
|
359
384
|
lastKeepaliveAt = Date.now();
|
|
360
385
|
socket.emit('dedicated:ssh:keepalive', { channelId, epoch });
|
|
361
386
|
}
|
|
@@ -376,6 +401,10 @@ function runSshProxy(options) {
|
|
|
376
401
|
keepalive();
|
|
377
402
|
}, 2000);
|
|
378
403
|
ticker.unref?.();
|
|
404
|
+
const signals = options.signalSource ?? process;
|
|
405
|
+
const onTermination = () => finish(0);
|
|
406
|
+
signals.on('SIGHUP', onTermination);
|
|
407
|
+
signals.on('SIGTERM', onTermination);
|
|
379
408
|
const onInputEnded = () => finish(0);
|
|
380
409
|
const onOutputError = () => finish(1);
|
|
381
410
|
input.once('end', onInputEnded);
|
|
@@ -397,10 +426,24 @@ function runSshProxy(options) {
|
|
|
397
426
|
if (notice)
|
|
398
427
|
errorOutput.write(`${notice}\n`);
|
|
399
428
|
// Never queue an offline stop that might arrive after another attachment.
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
429
|
+
const disconnected = () => {
|
|
430
|
+
signals.off('SIGHUP', onTermination);
|
|
431
|
+
signals.off('SIGTERM', onTermination);
|
|
432
|
+
socket.disconnect();
|
|
433
|
+
resolve(code);
|
|
434
|
+
};
|
|
435
|
+
if (started && online) {
|
|
436
|
+
// OpenSSH may SIGHUP its ProxyCommand before stdio reaches EOF. Keep
|
|
437
|
+
// the transport alive until the API has forwarded stop. A bounded
|
|
438
|
+
// fallback also supports older servers without this receipt.
|
|
439
|
+
const closeTimer = setTimeout(disconnected, 1000);
|
|
440
|
+
socket.emit('dedicated:ssh:stop', { channelId, ...(resumable ? { epoch } : {}) }, () => {
|
|
441
|
+
clearTimeout(closeTimer);
|
|
442
|
+
disconnected();
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
else
|
|
446
|
+
disconnected();
|
|
404
447
|
}
|
|
405
448
|
socket.on('connect_error', (error) => {
|
|
406
449
|
if (finished || (started && resumable))
|
|
@@ -420,9 +463,16 @@ function runSshProxy(options) {
|
|
|
420
463
|
return;
|
|
421
464
|
}
|
|
422
465
|
startSent = true;
|
|
423
|
-
socket.emit('dedicated:ssh:start', {
|
|
424
|
-
|
|
425
|
-
|
|
466
|
+
socket.emit('dedicated:ssh:start', {
|
|
467
|
+
leaseId: options.leaseId,
|
|
468
|
+
channelId,
|
|
469
|
+
keyType: identity.keyType,
|
|
470
|
+
keyBlob: identity.keyBlob,
|
|
471
|
+
receiverAckV1: true,
|
|
472
|
+
resumeV2: true,
|
|
473
|
+
resumeProof,
|
|
474
|
+
epoch,
|
|
475
|
+
});
|
|
426
476
|
});
|
|
427
477
|
socket.on('dedicated:ssh:start:ack', (ack) => {
|
|
428
478
|
if (!ack || ack.channelId !== channelId || started || finished)
|
|
@@ -432,7 +482,9 @@ function runSshProxy(options) {
|
|
|
432
482
|
return;
|
|
433
483
|
}
|
|
434
484
|
if (ack.resumeV2 === true) {
|
|
435
|
-
if (ack.epoch !== epoch ||
|
|
485
|
+
if (ack.epoch !== epoch ||
|
|
486
|
+
!Number.isSafeInteger(ack.generation) ||
|
|
487
|
+
Number(ack.generation) < 1 ||
|
|
436
488
|
(generation !== null && generation !== ack.generation)) {
|
|
437
489
|
finish(1, 'Invalid SSH stream admission.');
|
|
438
490
|
return;
|
|
@@ -458,7 +510,13 @@ function runSshProxy(options) {
|
|
|
458
510
|
}
|
|
459
511
|
});
|
|
460
512
|
socket.on('dedicated:ssh:resume:ack', (ack) => {
|
|
461
|
-
if (!ack ||
|
|
513
|
+
if (!ack ||
|
|
514
|
+
ack.channelId !== channelId ||
|
|
515
|
+
ack.epoch !== epoch ||
|
|
516
|
+
!started ||
|
|
517
|
+
!resumable ||
|
|
518
|
+
finished ||
|
|
519
|
+
attached)
|
|
462
520
|
return;
|
|
463
521
|
if (!ack.ok) {
|
|
464
522
|
if (ack.retryable === true)
|
|
@@ -483,8 +541,14 @@ function runSshProxy(options) {
|
|
|
483
541
|
pumpInput();
|
|
484
542
|
});
|
|
485
543
|
socket.on('dedicated:ssh:input:ack', (ack) => {
|
|
486
|
-
if (finished ||
|
|
487
|
-
|
|
544
|
+
if (finished ||
|
|
545
|
+
!resumable ||
|
|
546
|
+
!pendingInput ||
|
|
547
|
+
!attached ||
|
|
548
|
+
ack?.channelId !== channelId ||
|
|
549
|
+
ack.epoch !== epoch ||
|
|
550
|
+
ack.generation !== generation ||
|
|
551
|
+
ack.offset !== pendingInput.offset)
|
|
488
552
|
return;
|
|
489
553
|
if (!ack.ok) {
|
|
490
554
|
finish(1, ack.error || 'The SSH input stream was refused.');
|
|
@@ -499,19 +563,25 @@ function runSshProxy(options) {
|
|
|
499
563
|
pumpInput();
|
|
500
564
|
});
|
|
501
565
|
socket.on('dedicated:ssh:data', async (frame, receipt) => {
|
|
502
|
-
if (!frame ||
|
|
566
|
+
if (!frame ||
|
|
567
|
+
frame.channelId !== channelId ||
|
|
568
|
+
finished ||
|
|
569
|
+
typeof frame.data !== 'string' ||
|
|
570
|
+
!frame.data.length)
|
|
503
571
|
return;
|
|
504
572
|
try {
|
|
505
573
|
const bytes = Buffer.from(frame.data, 'base64');
|
|
506
574
|
if (frame.resumeV2 === true) {
|
|
507
575
|
if (frame.epoch !== epoch)
|
|
508
576
|
return;
|
|
509
|
-
if (!Number.isSafeInteger(frame.generation) ||
|
|
510
|
-
(
|
|
577
|
+
if (!Number.isSafeInteger(frame.generation) ||
|
|
578
|
+
Number(frame.generation) < 1 ||
|
|
579
|
+
(generation !== null && frame.generation !== generation) ||
|
|
580
|
+
bytes.toString('base64') !== frame.data) {
|
|
511
581
|
throw new Error('invalid SSH output frame');
|
|
512
582
|
}
|
|
513
583
|
generation ??= frame.generation;
|
|
514
|
-
const nextOffset = await receiver.receive(frame.offset, bytes, (value) => new Promise((done, reject) => output.write(value, (error) => error ? reject(error) : done())));
|
|
584
|
+
const nextOffset = await receiver.receive(frame.offset, bytes, (value) => new Promise((done, reject) => output.write(value, (error) => (error ? reject(error) : done()))));
|
|
515
585
|
receipt?.({ channelId, ok: !finished, epoch: frame.epoch, nextOffset });
|
|
516
586
|
}
|
|
517
587
|
else {
|
|
@@ -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,8 @@ exports.COMPACT_FIELDS = {
|
|
|
61
63
|
'version',
|
|
62
64
|
'executionMode',
|
|
63
65
|
'nextAction',
|
|
66
|
+
'actionability',
|
|
67
|
+
'execution',
|
|
64
68
|
// Present only on a `--rank economics` page: the score the row was sorted by (OSK-16476).
|
|
65
69
|
'economicsRank',
|
|
66
70
|
'createdAt',
|
|
@@ -146,13 +150,15 @@ function projectRow(row, fields) {
|
|
|
146
150
|
return out;
|
|
147
151
|
}
|
|
148
152
|
/**
|
|
149
|
-
* Normalize
|
|
150
|
-
*
|
|
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`.
|
|
151
156
|
* A response that is not list-shaped is returned untouched (never invent rows).
|
|
152
157
|
*/
|
|
153
|
-
function toListEnvelope(response) {
|
|
158
|
+
function toListEnvelope(response, rowKey) {
|
|
154
159
|
if (Array.isArray(response)) {
|
|
155
160
|
return {
|
|
161
|
+
ok: true,
|
|
156
162
|
object: 'list',
|
|
157
163
|
data: response,
|
|
158
164
|
has_more: false,
|
|
@@ -162,25 +168,44 @@ function toListEnvelope(response) {
|
|
|
162
168
|
if (!response || typeof response !== 'object')
|
|
163
169
|
return undefined;
|
|
164
170
|
const r = response;
|
|
165
|
-
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;
|
|
166
178
|
if (!rows)
|
|
167
179
|
return undefined;
|
|
180
|
+
const nextCursor = r.next_cursor ?? r.nextCursor ?? r.nextAfterId ?? r.after;
|
|
168
181
|
const { projects: _legacy, ...rest } = r;
|
|
169
182
|
void _legacy;
|
|
170
183
|
return {
|
|
171
|
-
...rest,
|
|
184
|
+
...(0, json_output_1.withOk)(rest),
|
|
172
185
|
object: 'list',
|
|
173
186
|
data: rows,
|
|
174
|
-
has_more: typeof r.has_more === 'boolean'
|
|
175
|
-
|
|
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,
|
|
176
193
|
};
|
|
177
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
|
+
}
|
|
178
200
|
/** Pure: envelope + projection + notes. Returns the response untouched if not a list. */
|
|
179
201
|
function shapeListResponse(response, options) {
|
|
180
202
|
const envelope = toListEnvelope(response);
|
|
181
203
|
if (!envelope)
|
|
182
204
|
return response;
|
|
183
|
-
const warnings = [
|
|
205
|
+
const warnings = [
|
|
206
|
+
...(Array.isArray(envelope.warnings) ? envelope.warnings : []),
|
|
207
|
+
...(options.warnings ?? []),
|
|
208
|
+
];
|
|
184
209
|
const fields = parseFields(options.fields);
|
|
185
210
|
let data = envelope.data;
|
|
186
211
|
if (fields) {
|
|
@@ -279,7 +304,9 @@ function renderListOutput(shaped, ndjson) {
|
|
|
279
304
|
if (!envelope || !Array.isArray(envelope.data)) {
|
|
280
305
|
return { stdout: [JSON.stringify(shaped)], stderr: [] };
|
|
281
306
|
}
|
|
282
|
-
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));
|
|
283
310
|
return {
|
|
284
311
|
stdout: data.map((row) => JSON.stringify(row)),
|
|
285
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;
|