@skrr-ai/cli 0.1.110 → 0.1.113
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/create.d.ts +3 -1
- package/dist/commands/agents/create.js +36 -3
- 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 +37 -0
- package/dist/commands/followups/plans/example.d.ts +6 -0
- package/dist/commands/followups/plans/example.js +12 -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 +14 -0
- package/dist/commands/followups/plans/revise.js +38 -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/lookbackPlanHelp.d.ts +19 -0
- package/dist/lib/lookbackPlanHelp.js +27 -0
- package/dist/lib/lookbackPlans.d.ts +22 -0
- package/dist/lib/lookbackPlans.js +88 -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 +25245 -18730
- package/docs/v1/README.md +1 -0
- package/docs/v1/lookback-plans.md +88 -0
- package/docs/v1/operations.md +52 -0
- package/docs/v1/space-search.md +19 -0
- package/oclif.manifest.json +4792 -477
- package/package.json +27 -3
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readTaskPreflight = readTaskPreflight;
|
|
4
|
+
exports.taskPreflightLines = taskPreflightLines;
|
|
5
|
+
const task_admission_1 = require("./task-admission");
|
|
6
|
+
const task_operations_1 = require("./task-operations");
|
|
7
|
+
const LIMITS = [
|
|
8
|
+
'Workflow and execution checks are separate server observations, not an atomic reservation.',
|
|
9
|
+
'No Run, shell command, machine probe, or branch checkout was performed.',
|
|
10
|
+
'Tool availability, working-directory access, and successful provider execution remain unverified.',
|
|
11
|
+
'Starting rechecks current Task authorization, runtime admission, and tool permissions.',
|
|
12
|
+
];
|
|
13
|
+
function unavailable(error, label) {
|
|
14
|
+
const row = error && typeof error === 'object' ? error : {};
|
|
15
|
+
const status = typeof row.status === 'number' ? row.status : undefined;
|
|
16
|
+
let code = typeof row.code === 'string' && /^[A-Z][A-Z0-9_]{0,100}$/.test(row.code) ? row.code : undefined;
|
|
17
|
+
// Keep the native typed refusal without echoing an arbitrary response body,
|
|
18
|
+
// HTML proxy page, request URL, or credential into diagnostics.
|
|
19
|
+
if (!code && typeof row.body === 'string') {
|
|
20
|
+
try {
|
|
21
|
+
const body = JSON.parse(row.body);
|
|
22
|
+
if (typeof body?.code === 'string' && /^[A-Z][A-Z0-9_]{0,100}$/.test(body.code))
|
|
23
|
+
code = body.code;
|
|
24
|
+
}
|
|
25
|
+
catch { /* non-JSON server refusal */ }
|
|
26
|
+
}
|
|
27
|
+
const remedy = status === 401
|
|
28
|
+
? 'Restore the current CLI sign-in or delegated runtime credential, then repeat this read-only check.'
|
|
29
|
+
: status === 403
|
|
30
|
+
? 'Ask the Task owner or an authorized administrator to check your access; preflight does not bypass permissions.'
|
|
31
|
+
: status === 404
|
|
32
|
+
? 'Check the Task reference and server support for this diagnostic. No start fallback was attempted.'
|
|
33
|
+
: 'Read tasks actionability and tasks start --dry-run separately for the native refusal, then repeat preflight after resolving it.';
|
|
34
|
+
return {
|
|
35
|
+
status: 'unavailable', certainty: 'unknown', code: code || 'TASK_PREFLIGHT_UNAVAILABLE',
|
|
36
|
+
...(status ? { httpStatus: status } : {}),
|
|
37
|
+
message: `${label} could not be confirmed${status ? ` (HTTP ${status})` : ''}.`, remedy,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function isWorkflow(value, taskId) {
|
|
41
|
+
if (!value || typeof value !== 'object')
|
|
42
|
+
return false;
|
|
43
|
+
const row = value;
|
|
44
|
+
const a = row.actionability;
|
|
45
|
+
return row.taskId === taskId && Boolean(a &&
|
|
46
|
+
['ready', 'running', 'waiting', 'terminal'].includes(a.state) &&
|
|
47
|
+
['agent', 'human', 'system', 'external', 'none'].includes(a.nextActor) &&
|
|
48
|
+
typeof a.reasonCode === 'string' && typeof a.reason === 'string' &&
|
|
49
|
+
(a.actorRefs === undefined || Array.isArray(a.actorRefs) && a.actorRefs.every(ref => ref && ['user', 'agent'].includes(ref.kind) && typeof ref.id === 'string')) &&
|
|
50
|
+
Array.isArray(a.allowedActions) && a.allowedActions.every(action => action &&
|
|
51
|
+
typeof action.action === 'string' && (action.targetId === undefined || typeof action.targetId === 'string')));
|
|
52
|
+
}
|
|
53
|
+
function isPreview(value, taskId) {
|
|
54
|
+
if (!(0, task_admission_1.isAdmissionPreview)(value) || value.taskId !== taskId)
|
|
55
|
+
return false;
|
|
56
|
+
const a = value.executionAdmission;
|
|
57
|
+
return Boolean(typeof a.unattended === 'boolean' && typeof a.approverAvailable === 'boolean' &&
|
|
58
|
+
(a.constraints === undefined || Array.isArray(a.constraints) && a.constraints.every(c => c &&
|
|
59
|
+
(c.message === undefined || typeof c.message === 'string') &&
|
|
60
|
+
(c.requiredAction === undefined || typeof c.requiredAction === 'string'))) &&
|
|
61
|
+
(a.permission === undefined || a.permission && typeof a.permission === 'object' &&
|
|
62
|
+
(a.permission.mode == null || typeof a.permission.mode === 'string') &&
|
|
63
|
+
(a.permission.source === undefined || typeof a.permission.source === 'string')) &&
|
|
64
|
+
(a.shell === undefined || a.shell && typeof a.shell === 'object' &&
|
|
65
|
+
(a.shell.state === undefined || typeof a.shell.state === 'string')) &&
|
|
66
|
+
(a.workingDirectory === undefined || a.workingDirectory &&
|
|
67
|
+
(a.workingDirectory.path === null || typeof a.workingDirectory.path === 'string') &&
|
|
68
|
+
typeof a.workingDirectory.source === 'string'));
|
|
69
|
+
}
|
|
70
|
+
/** Compose native reads. This module cannot dispatch execution or infer grants. */
|
|
71
|
+
async function readTaskPreflight(taskId, reads) {
|
|
72
|
+
const [workflowResult, executionResult] = await Promise.allSettled([
|
|
73
|
+
Promise.resolve().then(reads.workflow), Promise.resolve().then(reads.execution),
|
|
74
|
+
]);
|
|
75
|
+
const workflow = workflowResult.status === 'fulfilled' && isWorkflow(workflowResult.value, taskId)
|
|
76
|
+
? { status: 'observed', certainty: 'server_projection', value: workflowResult.value }
|
|
77
|
+
: unavailable(workflowResult.status === 'rejected' ? workflowResult.reason : { code: 'TASK_ACTIONABILITY_UNSUPPORTED' }, 'Workflow actionability');
|
|
78
|
+
const execution = executionResult.status === 'fulfilled' && isPreview(executionResult.value, taskId)
|
|
79
|
+
? { status: 'observed', certainty: 'server_projection', value: executionResult.value }
|
|
80
|
+
: unavailable(executionResult.status === 'rejected' ? executionResult.reason : { code: 'TASK_START_PREVIEW_UNSUPPORTED' }, 'Execution preview');
|
|
81
|
+
// actionability.revision is the attention revision, not Task.version from
|
|
82
|
+
// start-preview. Equal numbers would not prove the reads shared a snapshot.
|
|
83
|
+
const workflowBlocked = workflow.status === 'observed' &&
|
|
84
|
+
!workflow.value.actionability.allowedActions.some(action => action.action === 'start_task');
|
|
85
|
+
const executionBlocked = execution.status === 'observed' && execution.value.executionAdmission.state === 'blocked';
|
|
86
|
+
const summary = workflowBlocked || executionBlocked ? 'blocked'
|
|
87
|
+
: workflow.status === 'unavailable' || execution.status === 'unavailable' ||
|
|
88
|
+
execution.value.executionAdmission.state !== 'ready' ? 'unknown'
|
|
89
|
+
: 'eligible_to_attempt';
|
|
90
|
+
return { taskId, summary, workflow, execution, consistency: 'independent_observations', limits: [...LIMITS] };
|
|
91
|
+
}
|
|
92
|
+
function taskPreflightLines(report, bin = 'skrr') {
|
|
93
|
+
const lines = [`Task preflight: ${report.taskId}`, `Start eligibility: ${report.summary.replaceAll('_', ' ')} (current server projections)`];
|
|
94
|
+
if (report.workflow.status === 'observed') {
|
|
95
|
+
const a = report.workflow.value.actionability;
|
|
96
|
+
lines.push('', `Workflow: ${a.state} (server projection)`, `Next actor: ${a.nextActor}`, `Why: ${a.reason} [${a.reasonCode}]`);
|
|
97
|
+
if (a.actorRefs?.length)
|
|
98
|
+
lines.push(`Eligible actors: ${a.actorRefs.map(ref => `${ref.kind}:${ref.id}`).join(', ')}`);
|
|
99
|
+
for (const action of a.allowedActions) {
|
|
100
|
+
const command = (0, task_operations_1.taskActionCommand)(action.action, report.taskId, action.targetId, bin, {
|
|
101
|
+
allowedActions: a.allowedActions,
|
|
102
|
+
});
|
|
103
|
+
lines.push(` ${action.action}${command ? ` → ${command}` : ' (no single CLI remedy is mapped)'}`);
|
|
104
|
+
}
|
|
105
|
+
lines.push('Allowed actions describe the workflow; the caller must still have permission to perform them.');
|
|
106
|
+
}
|
|
107
|
+
else
|
|
108
|
+
lines.push('', `Workflow: unknown. ${report.workflow.message} [${report.workflow.code}]`, `Next step: ${report.workflow.remedy}`);
|
|
109
|
+
if (report.execution.status === 'observed') {
|
|
110
|
+
lines.push('', 'Execution prerequisites (server configuration; no execution test):', ...(0, task_admission_1.admissionLines)(report.execution.value.executionAdmission));
|
|
111
|
+
if (report.execution.value.executionAdmission.shell?.state) {
|
|
112
|
+
lines.push(`Shell approval prerequisites: ${report.execution.value.executionAdmission.shell.state} (policy only; shell execution unverified).`);
|
|
113
|
+
}
|
|
114
|
+
if (report.execution.value.executionAdmission.constraints?.length)
|
|
115
|
+
lines.push('Execution remedy owner: not reported by this server; ask the authorized Agent or Harness administrator.');
|
|
116
|
+
}
|
|
117
|
+
else
|
|
118
|
+
lines.push('', `Execution: unknown. ${report.execution.message} [${report.execution.code}]`, `Next step: ${report.execution.remedy}`);
|
|
119
|
+
lines.push('', ...report.limits, `More operations: ${bin} tasks guide`);
|
|
120
|
+
return lines;
|
|
121
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type RecordValue = Record<string, unknown>;
|
|
2
|
+
export type TaskResourceReferenceCache = Map<string, Promise<unknown>>;
|
|
3
|
+
export type TaskResourceReferenceOptions = {
|
|
4
|
+
existingTask?: RecordValue;
|
|
5
|
+
cache?: TaskResourceReferenceCache;
|
|
6
|
+
resolveSpace: (value: string) => Promise<string>;
|
|
7
|
+
getTask?: (id: string) => Promise<RecordValue>;
|
|
8
|
+
getProject?: (id: string) => Promise<RecordValue>;
|
|
9
|
+
listProjects?: (spaceId: string) => Promise<unknown>;
|
|
10
|
+
listGoals?: (spaceId: string) => Promise<unknown>;
|
|
11
|
+
};
|
|
12
|
+
export declare class TaskResourceReferenceError extends Error {
|
|
13
|
+
readonly code: string;
|
|
14
|
+
readonly candidates: RecordValue[];
|
|
15
|
+
constructor(code: string, message: string, candidates?: RecordValue[]);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolve structured-input names as well as flag names, before assignment
|
|
19
|
+
* defaults. UUIDs keep their existing native validation path. A Goal is a
|
|
20
|
+
* relationship, not containment: a qualified Goal never moves its Task.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveTaskResourceReferences(payload: RecordValue, options: TaskResourceReferenceOptions): Promise<void>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskResourceReferenceError = void 0;
|
|
4
|
+
exports.resolveTaskResourceReferences = resolveTaskResourceReferences;
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const failed_lookup_1 = require("./failed-lookup");
|
|
7
|
+
const projects_1 = require("./projects");
|
|
8
|
+
const UUID = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/i;
|
|
9
|
+
const STORAGE_ID = /^[\da-f]{24}$/i;
|
|
10
|
+
const str = (value) => typeof value === 'string' ? value.trim() : '';
|
|
11
|
+
class TaskResourceReferenceError extends Error {
|
|
12
|
+
code;
|
|
13
|
+
candidates;
|
|
14
|
+
constructor(code, message, candidates = []) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.code = code;
|
|
17
|
+
this.candidates = candidates;
|
|
18
|
+
this.name = 'TaskResourceReferenceError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.TaskResourceReferenceError = TaskResourceReferenceError;
|
|
22
|
+
function rows(body, kind) {
|
|
23
|
+
const value = body;
|
|
24
|
+
const data = value?.data ?? (kind === 'project' ? value?.projects : undefined);
|
|
25
|
+
if (!Array.isArray(data) || value?.has_more === true) {
|
|
26
|
+
throw new TaskResourceReferenceError('TASK_RESOURCE_LOOKUP_INCOMPLETE', `Cannot safely resolve a ${kind} name from an incomplete or unsupported list. Use its canonical id, or inspect ${kind}s list with --space.`);
|
|
27
|
+
}
|
|
28
|
+
return data.filter((row) => row !== null && typeof row === 'object');
|
|
29
|
+
}
|
|
30
|
+
/** Names are exact, case-insensitive matches. Never choose a fuzzy first hit. */
|
|
31
|
+
function select(kind, query, candidates) {
|
|
32
|
+
const normalize = (v) => str(v).toLowerCase();
|
|
33
|
+
const q = normalize(query);
|
|
34
|
+
const byId = candidates.filter(row => normalize(row.id) === q || normalize(row.identifier) === q || normalize(row.ref) === q);
|
|
35
|
+
// Native project external keys are exact and case-sensitive, and take
|
|
36
|
+
// precedence over a human title, as they do on the project endpoint.
|
|
37
|
+
const byExternalKey = kind === 'project' ? candidates.filter(row => row.externalKey === query) : [];
|
|
38
|
+
const matches = byId.length ? byId : byExternalKey.length ? byExternalKey : candidates.filter(row => normalize(row.title) === q);
|
|
39
|
+
if (matches.length !== 1 || !str(matches[0]?.id)) {
|
|
40
|
+
throw new TaskResourceReferenceError(matches.length > 1 ? 'TASK_RESOURCE_AMBIGUOUS' : 'TASK_RESOURCE_NOT_FOUND', matches.length > 1
|
|
41
|
+
? `More than one ${kind} matches "${query}". Use a canonical id from ${kind}s list --space <space>.`
|
|
42
|
+
: `No visible ${kind} exactly matches "${query}" in this Space. Inspect ${kind}s list --space <space>, or use a canonical id.`, matches.map(row => ({ id: row.id, identifier: row.identifier, title: row.title })));
|
|
43
|
+
}
|
|
44
|
+
return str(matches[0].id);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Resolve structured-input names as well as flag names, before assignment
|
|
48
|
+
* defaults. UUIDs keep their existing native validation path. A Goal is a
|
|
49
|
+
* relationship, not containment: a qualified Goal never moves its Task.
|
|
50
|
+
*/
|
|
51
|
+
async function resolveTaskResourceReferences(payload, options) {
|
|
52
|
+
const cache = options.cache ?? new Map();
|
|
53
|
+
const read = async (key, load) => {
|
|
54
|
+
if (!cache.has(key))
|
|
55
|
+
cache.set(key, load());
|
|
56
|
+
return await cache.get(key);
|
|
57
|
+
};
|
|
58
|
+
const space = (query) => read(`space:${query}`, () => options.resolveSpace(query));
|
|
59
|
+
if (str(payload.spaceId) && !UUID.test(str(payload.spaceId)))
|
|
60
|
+
payload.spaceId = await space(str(payload.spaceId));
|
|
61
|
+
let taskSpace = str(payload.spaceId) || str(options.existingTask?.spaceId);
|
|
62
|
+
const inheritedSpace = async () => {
|
|
63
|
+
if (taskSpace)
|
|
64
|
+
return taskSpace;
|
|
65
|
+
if (str(payload.parentId)) {
|
|
66
|
+
const parentId = str(payload.parentId);
|
|
67
|
+
const parent = await read(`task:${parentId}`, () => options.getTask
|
|
68
|
+
? options.getTask(parentId) : data_provider_1.dataService.getTask(parentId, { enrich: false }));
|
|
69
|
+
taskSpace = str(parent.spaceId);
|
|
70
|
+
}
|
|
71
|
+
if (!taskSpace && UUID.test(str(payload.projectId))) {
|
|
72
|
+
const id = str(payload.projectId);
|
|
73
|
+
const project = await read(`project:${id}`, () => options.getProject ? options.getProject(id) : projects_1.projectApi.get(id));
|
|
74
|
+
taskSpace = str(project.spaceId);
|
|
75
|
+
if (taskSpace)
|
|
76
|
+
payload.spaceId = taskSpace;
|
|
77
|
+
}
|
|
78
|
+
return taskSpace;
|
|
79
|
+
};
|
|
80
|
+
for (const kind of ['project', 'goal']) {
|
|
81
|
+
const field = kind === 'project' ? 'projectId' : 'goalId';
|
|
82
|
+
const raw = str(payload[field]);
|
|
83
|
+
if (!raw || UUID.test(raw) || STORAGE_ID.test(raw))
|
|
84
|
+
continue;
|
|
85
|
+
if ((0, failed_lookup_1.isFailedLookupValue)(raw))
|
|
86
|
+
throw new TaskResourceReferenceError('TASK_RESOURCE_NOT_A_REFERENCE', `"${raw}" is not a ${kind} reference. Use the id or exact title from ${kind}s list.`);
|
|
87
|
+
const localScope = await inheritedSpace();
|
|
88
|
+
if (localScope) {
|
|
89
|
+
const body = await read(`${kind}s:${localScope}`, () => kind === 'project'
|
|
90
|
+
? options.listProjects ? options.listProjects(localScope) : data_provider_1.dataService.listSpaceProjects(localScope)
|
|
91
|
+
: options.listGoals ? options.listGoals(localScope) : data_provider_1.dataService.listSpaceGoals(localScope));
|
|
92
|
+
const candidates = rows(body, kind);
|
|
93
|
+
const q = raw.toLowerCase();
|
|
94
|
+
if (candidates.some(row => (kind === 'project' && row.externalKey === raw) ||
|
|
95
|
+
[row.id, row.identifier, row.ref, row.title].some(value => str(value).toLowerCase() === q))) {
|
|
96
|
+
payload[field] = select(kind, raw, candidates);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const slash = raw.indexOf('/');
|
|
101
|
+
const qualified = slash > 0 && slash < raw.length - 1;
|
|
102
|
+
const query = qualified ? raw.slice(slash + 1).trim() : raw;
|
|
103
|
+
const qualifiedSpace = qualified ? await space(raw.slice(0, slash).trim()) : '';
|
|
104
|
+
const scope = qualifiedSpace || localScope;
|
|
105
|
+
if (!scope)
|
|
106
|
+
throw new TaskResourceReferenceError('TASK_RESOURCE_REQUIRES_SPACE', `Resolving a ${kind} name requires --space, a scoped parent, or <space-ref>/<${kind}-ref-or-exact-title>. A canonical id works without a name lookup.`);
|
|
107
|
+
if (kind === 'project' && taskSpace && qualifiedSpace && taskSpace !== qualifiedSpace) {
|
|
108
|
+
throw new TaskResourceReferenceError('PROJECT_SPACE_MISMATCH', 'The qualified project and Task name different Spaces. Correct --space or the project reference; no Task was written.');
|
|
109
|
+
}
|
|
110
|
+
const body = await read(`${kind}s:${scope}`, () => kind === 'project'
|
|
111
|
+
? options.listProjects ? options.listProjects(scope) : data_provider_1.dataService.listSpaceProjects(scope)
|
|
112
|
+
: options.listGoals ? options.listGoals(scope) : data_provider_1.dataService.listSpaceGoals(scope));
|
|
113
|
+
payload[field] = select(kind, query, rows(body, kind));
|
|
114
|
+
if (kind === 'project' && !taskSpace) {
|
|
115
|
+
taskSpace = scope;
|
|
116
|
+
payload.spaceId = scope;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
type Task = Record<string, unknown>;
|
|
2
|
+
export type TaskSpecInput = {
|
|
3
|
+
tempId: string;
|
|
4
|
+
id: string;
|
|
5
|
+
expected: Task;
|
|
6
|
+
};
|
|
7
|
+
export type TaskSpecObservation = {
|
|
8
|
+
tempId: string;
|
|
9
|
+
id: string;
|
|
10
|
+
state: 'matched' | 'mismatched' | 'unavailable';
|
|
11
|
+
checkedFields: string[];
|
|
12
|
+
uncheckedFields: Array<{
|
|
13
|
+
field: string;
|
|
14
|
+
reason: string;
|
|
15
|
+
}>;
|
|
16
|
+
mismatches: Array<{
|
|
17
|
+
field: string;
|
|
18
|
+
expected: unknown;
|
|
19
|
+
actual: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
expectationCount?: number;
|
|
22
|
+
specVersion?: unknown;
|
|
23
|
+
error?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Compare declarations, never assessments or whether a lesson/task worked. */
|
|
26
|
+
export declare function compareTaskSpecification(input: TaskSpecInput, actual: Task): TaskSpecObservation;
|
|
27
|
+
/** Bounded native rereads. Failure to read is not evidence of a failed write. */
|
|
28
|
+
export declare function verifyTaskSpecifications(inputs: TaskSpecInput[], read: (id: string) => Promise<Task>): Promise<{
|
|
29
|
+
object: string;
|
|
30
|
+
ok: boolean;
|
|
31
|
+
scope: string;
|
|
32
|
+
assessmentPerformed: boolean;
|
|
33
|
+
summary: {
|
|
34
|
+
total: number;
|
|
35
|
+
matched: number;
|
|
36
|
+
mismatched: number;
|
|
37
|
+
unavailable: number;
|
|
38
|
+
withUncheckedFields: number;
|
|
39
|
+
};
|
|
40
|
+
results: TaskSpecObservation[];
|
|
41
|
+
}>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compareTaskSpecification = compareTaskSpecification;
|
|
4
|
+
exports.verifyTaskSpecifications = verifyTaskSpecifications;
|
|
5
|
+
const node_util_1 = require("node:util");
|
|
6
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
7
|
+
const FIELDS = [
|
|
8
|
+
'title', 'status', 'priority', 'estimate', 'commitmentId', 'spaceId', 'goalId', 'projectId', 'parentId',
|
|
9
|
+
'externalKey', 'executionMode', 'reviewPolicy', 'assigneeAgentIds',
|
|
10
|
+
'assigneeUserIds', 'labelIds', 'tags', 'workingDirectory', 'executionIsolation',
|
|
11
|
+
'startDate', 'dueDate', 'expectations', 'blocksIds', 'blockedByIds',
|
|
12
|
+
];
|
|
13
|
+
const SETS = new Set(['labelIds', 'tags', 'blocksIds', 'blockedByIds', 'assigneeAgentIds', 'assigneeUserIds']);
|
|
14
|
+
const DATES = new Set(['startDate', 'dueDate']);
|
|
15
|
+
function comparable(field, value) {
|
|
16
|
+
// Explicit clears may be persisted as an absent field; both mean unset.
|
|
17
|
+
if (value === undefined || value === null)
|
|
18
|
+
return null;
|
|
19
|
+
if (SETS.has(field) && Array.isArray(value))
|
|
20
|
+
return [...new Set(value)].sort();
|
|
21
|
+
if (DATES.has(field) && typeof value === 'string') {
|
|
22
|
+
const time = Date.parse(value);
|
|
23
|
+
return Number.isFinite(time) ? time : value;
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
function authoredExpectations(value, authored) {
|
|
28
|
+
if (!Array.isArray(value) || !Array.isArray(authored))
|
|
29
|
+
return value;
|
|
30
|
+
return value.map((item, index) => {
|
|
31
|
+
const original = (0, data_provider_1.normalizeTaskExpectationDeclaration)(authored[index]);
|
|
32
|
+
const parsed = (0, data_provider_1.normalizeTaskExpectationDeclaration)(item);
|
|
33
|
+
if (!parsed.ok)
|
|
34
|
+
return item;
|
|
35
|
+
const row = parsed.value;
|
|
36
|
+
return {
|
|
37
|
+
...(original.ok && original.value.id ? { id: row.id } : {}),
|
|
38
|
+
text: row.text,
|
|
39
|
+
check: row.check ?? { method: 'manual' },
|
|
40
|
+
...(original.ok && original.value.presetKey ? { presetKey: row.presetKey } : {}),
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** Compare declarations, never assessments or whether a lesson/task worked. */
|
|
45
|
+
function compareTaskSpecification(input, actual) {
|
|
46
|
+
const checkedFields = FIELDS.filter(field => Object.prototype.hasOwnProperty.call(input.expected, field));
|
|
47
|
+
const mismatches = [];
|
|
48
|
+
if (actual.id !== input.id)
|
|
49
|
+
mismatches.push({ field: 'id', expected: input.id, actual: actual.id ?? null });
|
|
50
|
+
for (const field of checkedFields) {
|
|
51
|
+
const expected = field === 'expectations' ? authoredExpectations(input.expected[field], input.expected[field]) : comparable(field, input.expected[field]);
|
|
52
|
+
const observed = field === 'expectations' ? authoredExpectations(actual[field], input.expected[field]) : comparable(field, actual[field]);
|
|
53
|
+
if (!(0, node_util_1.isDeepStrictEqual)(expected, observed)) {
|
|
54
|
+
mismatches.push({ field, expected: input.expected[field] ?? null, actual: actual[field] ?? null });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Rich text is normalized by the native service. A client-side byte compare
|
|
58
|
+
// would assert a false mismatch; report the exact boundary, not a full-spec pass.
|
|
59
|
+
const uncheckedFields = Object.keys(input.expected).filter(field => !checkedFields.includes(field))
|
|
60
|
+
.map(field => ({ field, reason: field === 'description' || field === 'descriptionFormat'
|
|
61
|
+
? 'Native rich-text normalization; content is not compared by this structured-field check.'
|
|
62
|
+
: 'This authored field is outside the supported structured-field comparator; no equality claim is made.' }));
|
|
63
|
+
return {
|
|
64
|
+
tempId: input.tempId, id: input.id,
|
|
65
|
+
state: mismatches.length ? 'mismatched' : 'matched',
|
|
66
|
+
checkedFields: [...checkedFields], uncheckedFields, mismatches,
|
|
67
|
+
...(Array.isArray(actual.expectations) ? { expectationCount: actual.expectations.length } : {}),
|
|
68
|
+
...(actual.specVersion !== undefined ? { specVersion: actual.specVersion } : {}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Bounded native rereads. Failure to read is not evidence of a failed write. */
|
|
72
|
+
async function verifyTaskSpecifications(inputs, read) {
|
|
73
|
+
const results = [];
|
|
74
|
+
for (let start = 0; start < inputs.length; start += 4) {
|
|
75
|
+
const group = await Promise.all(inputs.slice(start, start + 4).map(async (input) => {
|
|
76
|
+
try {
|
|
77
|
+
return compareTaskSpecification(input, await read(input.id));
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return { tempId: input.tempId, id: input.id, state: 'unavailable',
|
|
81
|
+
checkedFields: [], uncheckedFields: [], mismatches: [],
|
|
82
|
+
error: error instanceof Error ? error.message : String(error) };
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
results.push(...group);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
object: 'task_specification_verification',
|
|
89
|
+
ok: results.every(row => row.state === 'matched'),
|
|
90
|
+
scope: 'declared_structured_fields',
|
|
91
|
+
assessmentPerformed: false,
|
|
92
|
+
summary: {
|
|
93
|
+
total: inputs.length,
|
|
94
|
+
matched: results.filter(row => row.state === 'matched').length,
|
|
95
|
+
mismatched: results.filter(row => row.state === 'mismatched').length,
|
|
96
|
+
unavailable: results.filter(row => row.state === 'unavailable').length,
|
|
97
|
+
withUncheckedFields: results.filter(row => row.uncheckedFields.length > 0).length,
|
|
98
|
+
},
|
|
99
|
+
results,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TaskExecutionSnapshot, TaskConversationInputBody, TaskConversationInputReceipt, TaskInputPurpose } from '@skrr-ai/data-provider';
|
|
2
|
+
/** Observation time is not evidence that a worker just sent a heartbeat. */
|
|
3
|
+
export declare function describeExecutionState(state: TaskExecutionSnapshot): string[];
|
|
4
|
+
export declare function buildTaskContinuationBody(input: {
|
|
5
|
+
text: string;
|
|
6
|
+
commandKey?: string;
|
|
7
|
+
purpose?: TaskInputPurpose;
|
|
8
|
+
workflowGeneration: number;
|
|
9
|
+
authorizationGeneration: number;
|
|
10
|
+
}): TaskConversationInputBody;
|
|
11
|
+
export declare function describeTaskContinuation(receipt: TaskConversationInputReceipt): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeExecutionState = describeExecutionState;
|
|
4
|
+
exports.buildTaskContinuationBody = buildTaskContinuationBody;
|
|
5
|
+
exports.describeTaskContinuation = describeTaskContinuation;
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
7
|
+
/** Observation time is not evidence that a worker just sent a heartbeat. */
|
|
8
|
+
function describeExecutionState(state) {
|
|
9
|
+
return [
|
|
10
|
+
`Task: ${state.taskId}`,
|
|
11
|
+
`Workflow: ${state.workflowStatus} (generation ${state.workflowGeneration})`,
|
|
12
|
+
`Execution: ${state.execution.runStatus ?? 'not observed'}${state.execution.runId ? `; Run ${state.execution.runId}` : ''}`,
|
|
13
|
+
`Liveness: ${state.liveness.state}; last runtime signal ${state.liveness.lastRuntimeSignalAt ?? 'unavailable'}`,
|
|
14
|
+
`Health: ${state.health.condition}; ${state.health.reason}`,
|
|
15
|
+
...(state.waiting ? [`Waiting: ${state.waiting.kind}; ${state.waiting.referenceId}`] : []),
|
|
16
|
+
`Work input: ${state.work.latestWorkInputRevision}; ${state.work.pendingCommandCount} pending command(s); ${state.work.queuedExchangeCount} queued exchange(s)`,
|
|
17
|
+
`Result: ${state.result.currentResultId ?? 'none'} (${state.result.applicability})${state.result.reason ? `; ${state.result.reason}` : ''}`,
|
|
18
|
+
`Observed: ${state.observedAt}; consistency ${state.consistency}`,
|
|
19
|
+
...state.limitations.map((limitation) => `Limitation: ${limitation}`),
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
function buildTaskContinuationBody(input) {
|
|
23
|
+
if (!input.text.trim() || input.text.length > 24000)
|
|
24
|
+
throw new Error('--text must contain 1–24000 characters.');
|
|
25
|
+
const commandKey = input.commandKey ?? `cli-input-${(0, node_crypto_1.randomUUID)()}`;
|
|
26
|
+
if (!commandKey.trim() || commandKey.length > 300)
|
|
27
|
+
throw new Error('--command-key must contain 1–300 characters.');
|
|
28
|
+
if (!Number.isInteger(input.workflowGeneration) || input.workflowGeneration < 1 ||
|
|
29
|
+
!Number.isInteger(input.authorizationGeneration) || input.authorizationGeneration < 1) {
|
|
30
|
+
throw new Error('Workflow and authorization generations must be positive integers.');
|
|
31
|
+
}
|
|
32
|
+
return { commandKey, text: input.text, purpose: input.purpose ?? 'continue_work',
|
|
33
|
+
expectedWorkflowGeneration: input.workflowGeneration,
|
|
34
|
+
expectedAuthorizationGeneration: input.authorizationGeneration };
|
|
35
|
+
}
|
|
36
|
+
function describeTaskContinuation(receipt) {
|
|
37
|
+
const detail = receipt.reason ? `: ${receipt.reason}` : '';
|
|
38
|
+
if (receipt.phase === 'refused')
|
|
39
|
+
return `Task input refused${detail}. Command ${receipt.commandId}.`;
|
|
40
|
+
return `Task input ${receipt.phase}${detail}. Command ${receipt.commandId}; ${receipt.purposeDecision ?? 'classification pending'}${receipt.exchangeId ? `; exchange ${receipt.exchangeId}` : ''}. Execution is reported separately by tasks execution-state.`;
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readRuntimeContext } from './runtime-context';
|
|
2
|
+
export declare const AGENT_BINDING_GUIDANCE: string;
|
|
3
|
+
export declare const ACCOUNT_ATTRIBUTION_NOTICE: string;
|
|
4
|
+
type Principal = {
|
|
5
|
+
kind: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
agentId?: string;
|
|
8
|
+
service?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Use the persisted server receipt, never the process's claimed Agent identity. */
|
|
11
|
+
export declare function taskWriteAttribution(receipt: unknown, field: 'assessedBy' | 'submittedBy'): {
|
|
12
|
+
bindingGuidance?: string | undefined;
|
|
13
|
+
notice: string | null;
|
|
14
|
+
method?: string | undefined;
|
|
15
|
+
source: "server_receipt";
|
|
16
|
+
principal: Principal | null;
|
|
17
|
+
};
|
|
18
|
+
export declare function attributionLines(attribution: ReturnType<typeof taskWriteAttribution>): string[];
|
|
19
|
+
/** Environment hints explain local execution only; the server verifies every write. */
|
|
20
|
+
export declare function runtimeWriteAttribution(runtime: ReturnType<typeof readRuntimeContext>): {
|
|
21
|
+
authority: "authenticated_server_principal";
|
|
22
|
+
runtimeBinding: string;
|
|
23
|
+
notice: string;
|
|
24
|
+
bindingGuidance: string;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACCOUNT_ATTRIBUTION_NOTICE = exports.AGENT_BINDING_GUIDANCE = void 0;
|
|
4
|
+
exports.taskWriteAttribution = taskWriteAttribution;
|
|
5
|
+
exports.attributionLines = attributionLines;
|
|
6
|
+
exports.runtimeWriteAttribution = runtimeWriteAttribution;
|
|
7
|
+
exports.AGENT_BINDING_GUIDANCE = 'Assign this runtime in skrr → Engines, then run in its authenticated Agent session. ' +
|
|
8
|
+
'An --agent flag or an environment Agent id cannot establish authenticated authorship.';
|
|
9
|
+
exports.ACCOUNT_ATTRIBUTION_NOTICE = 'Without authenticated Agent provenance, Task writes are attributed to the signed-in account. ' +
|
|
10
|
+
'An account-attributed assessment is not proof of an independent human check.';
|
|
11
|
+
/** Use the persisted server receipt, never the process's claimed Agent identity. */
|
|
12
|
+
function taskWriteAttribution(receipt, field) {
|
|
13
|
+
const record = receipt && typeof receipt === 'object' ? receipt : {};
|
|
14
|
+
const entity = record[field === 'assessedBy' ? 'assessment' : 'result'];
|
|
15
|
+
const row = entity && typeof entity === 'object' ? entity : {};
|
|
16
|
+
const value = row[field];
|
|
17
|
+
const principal = value && typeof value === 'object' && typeof value.kind === 'string'
|
|
18
|
+
? value : null;
|
|
19
|
+
return {
|
|
20
|
+
source: 'server_receipt',
|
|
21
|
+
principal,
|
|
22
|
+
...(typeof row.method === 'string' ? { method: row.method } : {}),
|
|
23
|
+
notice: principal?.kind === 'human' ? exports.ACCOUNT_ATTRIBUTION_NOTICE
|
|
24
|
+
: !principal ? 'The server receipt did not identify the author; no authorship is inferred from local runtime hints.' : null,
|
|
25
|
+
...(!principal || principal.kind === 'human' ? { bindingGuidance: exports.AGENT_BINDING_GUIDANCE } : {}),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function attributionLines(attribution) {
|
|
29
|
+
const actor = attribution.principal;
|
|
30
|
+
return [
|
|
31
|
+
actor ? `Recorded author: ${actor.kind} (${actor.userId || actor.agentId || actor.service || 'id unavailable'}).`
|
|
32
|
+
: 'Recorded author: unavailable in server receipt.',
|
|
33
|
+
...(attribution.notice ? [attribution.notice] : []),
|
|
34
|
+
...(attribution.bindingGuidance ? [attribution.bindingGuidance] : []),
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
/** Environment hints explain local execution only; the server verifies every write. */
|
|
38
|
+
function runtimeWriteAttribution(runtime) {
|
|
39
|
+
return {
|
|
40
|
+
authority: 'authenticated_server_principal',
|
|
41
|
+
runtimeBinding: runtime.agent?.boundToSession ? 'session_hint' : 'unbound',
|
|
42
|
+
notice: runtime.agent?.boundToSession
|
|
43
|
+
? 'Local session binding is a hint. The server verifies Agent provenance and returns the recorded author.'
|
|
44
|
+
: exports.ACCOUNT_ATTRIBUTION_NOTICE,
|
|
45
|
+
bindingGuidance: exports.AGENT_BINDING_GUIDANCE,
|
|
46
|
+
};
|
|
47
|
+
}
|
package/dist/lib/tasks.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export declare function releasePinRepairGuard(payload: TaskRecord): TaskMutation
|
|
|
76
76
|
*/
|
|
77
77
|
export declare function taskUpdateMutationGuard(payload: TaskRecord): TaskMutationGuardFailure | null;
|
|
78
78
|
export type TaskCreateFlagValues = {
|
|
79
|
+
unassigned?: boolean;
|
|
79
80
|
template?: string;
|
|
80
81
|
title?: string;
|
|
81
82
|
description?: string;
|
|
@@ -211,6 +212,18 @@ export declare function applyDaemonSessionDefaults(payload: TaskRecord): void;
|
|
|
211
212
|
export declare function validateTaskCreatePayload(payload: TaskRecord): string[];
|
|
212
213
|
/** Stamp the unambiguous executor so CLI-authored tasks are explicit on day one. */
|
|
213
214
|
export declare function applyInferredTaskExecutionMode(payload: TaskRecord): void;
|
|
215
|
+
/** A caller's explicit clearing instruction, never a new native field. Flag
|
|
216
|
+
* values override JSON just as named assignment flags do. */
|
|
217
|
+
export declare function applyExplicitTaskUnassignment(payload: TaskRecord, requested: boolean): void;
|
|
218
|
+
export declare function taskUnassignmentFlagError(flags: Record<string, unknown>): string | null;
|
|
219
|
+
/** A projection of a frozen payload or a native returned row, not admission. */
|
|
220
|
+
export declare function taskAssignmentPreview(task: TaskRecord): {
|
|
221
|
+
executor: import("@skrr-ai/data-provider").TaskExecutorResolution;
|
|
222
|
+
assigneeAgentIds: string[];
|
|
223
|
+
assigneeUserIds: string[];
|
|
224
|
+
assigned: boolean;
|
|
225
|
+
startRequested: false;
|
|
226
|
+
};
|
|
214
227
|
/**
|
|
215
228
|
* Stamp an executor only when the post-update assignee set is unambiguous.
|
|
216
229
|
* Existing fields participate when an upsert omits one assignee kind; this
|