@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
|
@@ -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
|
package/dist/lib/tasks.js
CHANGED
|
@@ -17,6 +17,9 @@ exports.boundSessionAgentId = boundSessionAgentId;
|
|
|
17
17
|
exports.applyDaemonSessionDefaults = applyDaemonSessionDefaults;
|
|
18
18
|
exports.validateTaskCreatePayload = validateTaskCreatePayload;
|
|
19
19
|
exports.applyInferredTaskExecutionMode = applyInferredTaskExecutionMode;
|
|
20
|
+
exports.applyExplicitTaskUnassignment = applyExplicitTaskUnassignment;
|
|
21
|
+
exports.taskUnassignmentFlagError = taskUnassignmentFlagError;
|
|
22
|
+
exports.taskAssignmentPreview = taskAssignmentPreview;
|
|
20
23
|
exports.applyProspectiveTaskExecutionMode = applyProspectiveTaskExecutionMode;
|
|
21
24
|
exports.validateTaskCreateReferences = validateTaskCreateReferences;
|
|
22
25
|
exports.resolveTaskCreateScope = resolveTaskCreateScope;
|
|
@@ -384,6 +387,7 @@ function buildTaskCreatePayload(body, flags = {}) {
|
|
|
384
387
|
executionIsolation: executionIsolationFromWorktreeFlag(flags.worktree),
|
|
385
388
|
lifecycle: lifecycleBindingFromFlags(flags),
|
|
386
389
|
});
|
|
390
|
+
applyExplicitTaskUnassignment(payload, flags.unassigned === true);
|
|
387
391
|
applyDaemonSessionDefaults(payload);
|
|
388
392
|
normalizeStringField(payload, 'externalKey', 300);
|
|
389
393
|
return payload;
|
|
@@ -500,14 +504,14 @@ function validateTaskCreatePayload(payload) {
|
|
|
500
504
|
!data_provider_1.TASK_EXECUTION_MODES.includes(payload.executionMode)) {
|
|
501
505
|
errors.push(`executionMode must be one of: ${data_provider_1.TASK_EXECUTION_MODES.join(', ')}`);
|
|
502
506
|
}
|
|
503
|
-
else
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
507
|
+
else {
|
|
508
|
+
const issue = (0, data_provider_1.taskExecutorAssignmentIssue)({
|
|
509
|
+
executionMode: payload.executionMode,
|
|
510
|
+
assigneeAgentIds: agentIds,
|
|
511
|
+
assigneeUserIds: userIds,
|
|
512
|
+
});
|
|
513
|
+
if (issue)
|
|
514
|
+
errors.push(issue.message);
|
|
511
515
|
}
|
|
512
516
|
if (Array.isArray(payload.tags) && payload.tags.length > 50) {
|
|
513
517
|
errors.push('tags should contain at most 50 entries');
|
|
@@ -531,6 +535,49 @@ function validateTaskCreatePayload(payload) {
|
|
|
531
535
|
function applyInferredTaskExecutionMode(payload) {
|
|
532
536
|
applyProspectiveTaskExecutionMode(payload);
|
|
533
537
|
}
|
|
538
|
+
/** A caller's explicit clearing instruction, never a new native field. Flag
|
|
539
|
+
* values override JSON just as named assignment flags do. */
|
|
540
|
+
function applyExplicitTaskUnassignment(payload, requested) {
|
|
541
|
+
if (!requested)
|
|
542
|
+
return;
|
|
543
|
+
payload.assigneeAgentIds = [];
|
|
544
|
+
payload.assigneeUserIds = [];
|
|
545
|
+
for (const field of [
|
|
546
|
+
'addAssigneeAgentIds',
|
|
547
|
+
'removeAssigneeAgentIds',
|
|
548
|
+
'addAssigneeUserIds',
|
|
549
|
+
'removeAssigneeUserIds',
|
|
550
|
+
])
|
|
551
|
+
delete payload[field];
|
|
552
|
+
}
|
|
553
|
+
function taskUnassignmentFlagError(flags) {
|
|
554
|
+
if (!flags.unassigned)
|
|
555
|
+
return null;
|
|
556
|
+
const conflicts = [
|
|
557
|
+
'default-agent',
|
|
558
|
+
'assignee-agent',
|
|
559
|
+
'assignee-user',
|
|
560
|
+
'add-assignee-agent',
|
|
561
|
+
'remove-assignee-agent',
|
|
562
|
+
'add-assignee-user',
|
|
563
|
+
'remove-assignee-user',
|
|
564
|
+
].filter((key) => flags[key] !== undefined);
|
|
565
|
+
return conflicts.length
|
|
566
|
+
? `--unassigned cannot be combined with ${conflicts.map((key) => `--${key}`).join(', ')}. Choose clearing all assignees or naming assignees.`
|
|
567
|
+
: null;
|
|
568
|
+
}
|
|
569
|
+
/** A projection of a frozen payload or a native returned row, not admission. */
|
|
570
|
+
function taskAssignmentPreview(task) {
|
|
571
|
+
const assigneeAgentIds = [...stringArray(task.assigneeAgentIds)];
|
|
572
|
+
const assigneeUserIds = [...stringArray(task.assigneeUserIds)];
|
|
573
|
+
return {
|
|
574
|
+
executor: (0, data_provider_1.resolveTaskExecutor)(task),
|
|
575
|
+
assigneeAgentIds,
|
|
576
|
+
assigneeUserIds,
|
|
577
|
+
assigned: assigneeAgentIds.length + assigneeUserIds.length > 0,
|
|
578
|
+
startRequested: false,
|
|
579
|
+
};
|
|
580
|
+
}
|
|
534
581
|
/**
|
|
535
582
|
* Stamp an executor only when the post-update assignee set is unambiguous.
|
|
536
583
|
* Existing fields participate when an upsert omits one assignee kind; this
|
|
@@ -937,14 +984,20 @@ function createPatchFromCreatePayload(payload) {
|
|
|
937
984
|
'description',
|
|
938
985
|
'descriptionFormat',
|
|
939
986
|
'priority',
|
|
987
|
+
'estimate',
|
|
940
988
|
'startDate',
|
|
941
989
|
'dueDate',
|
|
942
990
|
'goalId',
|
|
991
|
+
'projectId',
|
|
992
|
+
'cycleId',
|
|
943
993
|
'spaceId',
|
|
944
994
|
'parentId',
|
|
945
995
|
'assigneeAgentIds',
|
|
946
996
|
'assigneeUserIds',
|
|
947
997
|
'executionMode',
|
|
998
|
+
'expectations',
|
|
999
|
+
'reviewPolicy',
|
|
1000
|
+
'executionIsolation',
|
|
948
1001
|
'tags',
|
|
949
1002
|
'labelIds',
|
|
950
1003
|
// Per-task working-directory override — part of the same execution shape
|
package/dist/lib/triggers.d.ts
CHANGED
|
@@ -457,6 +457,13 @@ export declare function armedLabel(trigger: TriggerDefinition): string;
|
|
|
457
457
|
* Marked here so the list says it, not only `triggers show`.
|
|
458
458
|
*/
|
|
459
459
|
export declare function degradedMarker(trigger: TriggerDefinition): string;
|
|
460
|
+
/**
|
|
461
|
+
* Feed health lines for `triggers show`: whether the sensor stopped itself and
|
|
462
|
+
* why, whether it is backing off, and when the source was last read. A stop
|
|
463
|
+
* the engine made used to be a field nothing printed, so a sensor that had
|
|
464
|
+
* given up looked like one that was switched off.
|
|
465
|
+
*/
|
|
466
|
+
export declare function sensorHealthLines(trigger: TriggerDefinition, now?: number): string[];
|
|
460
467
|
export declare function renderTriggerList(triggers: TriggerDefinition[], log: (line: string) => void): void;
|
|
461
468
|
/**
|
|
462
469
|
* The `duplicate_subscription` warning a create response may carry, as the
|