@skrr-ai/cli 0.1.109 → 0.1.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/run.js +15 -1
- package/dist/base-command.d.ts +44 -1
- package/dist/base-command.js +194 -33
- package/dist/commands/actions/list.js +2 -1
- package/dist/commands/agenda/trigger/create.js +1 -1
- package/dist/commands/agenda/trigger/list.js +2 -1
- package/dist/commands/agent-groups/list.js +2 -1
- package/dist/commands/agents/actions/list.js +2 -1
- package/dist/commands/agents/always-on/status.js +5 -0
- package/dist/commands/agents/chat.js +4 -1
- package/dist/commands/agents/duplicate.js +4 -0
- package/dist/commands/agents/eval/list.js +2 -1
- package/dist/commands/agents/files/list.js +2 -1
- package/dist/commands/agents/folders/list.js +2 -1
- package/dist/commands/agents/goals/list.js +2 -1
- package/dist/commands/agents/intuitions/list.js +8 -5
- package/dist/commands/agents/list.d.ts +12 -0
- package/dist/commands/agents/list.js +45 -8
- package/dist/commands/agents/releases/known-issues/list.js +2 -1
- package/dist/commands/agents/releases/list.js +5 -1
- package/dist/commands/agents/releases/trusted-publishers/list.js +2 -1
- package/dist/commands/agents/roles/list.js +2 -1
- package/dist/commands/agents/skills/list.js +2 -1
- package/dist/commands/agents/todos/list.js +2 -1
- package/dist/commands/agents/triggers/create.js +1 -1
- package/dist/commands/agents/triggers/list.js +2 -1
- package/dist/commands/agents/triggers/update.js +1 -1
- package/dist/commands/agents/update.d.ts +11 -0
- package/dist/commands/agents/update.js +58 -2
- package/dist/commands/api-keys/list.js +2 -1
- package/dist/commands/apps/channel.d.ts +20 -0
- package/dist/commands/apps/channel.js +64 -0
- package/dist/commands/apps/check-draft.d.ts +12 -0
- package/dist/commands/apps/check-draft.js +41 -0
- package/dist/commands/apps/check.d.ts +42 -0
- package/dist/commands/apps/check.js +91 -0
- package/dist/commands/apps/create.d.ts +15 -0
- package/dist/commands/apps/create.js +59 -0
- package/dist/commands/apps/data/put.d.ts +18 -0
- package/dist/commands/apps/data/put.js +72 -0
- package/dist/commands/apps/data/query.d.ts +20 -0
- package/dist/commands/apps/data/query.js +88 -0
- package/dist/commands/apps/disclosure.d.ts +16 -0
- package/dist/commands/apps/disclosure.js +71 -0
- package/dist/commands/apps/file/cat.d.ts +15 -0
- package/dist/commands/apps/file/cat.js +50 -0
- package/dist/commands/apps/file/ls.d.ts +13 -0
- package/dist/commands/apps/file/ls.js +47 -0
- package/dist/commands/apps/file/mv.d.ts +15 -0
- package/dist/commands/apps/file/mv.js +49 -0
- package/dist/commands/apps/file/rm.d.ts +15 -0
- package/dist/commands/apps/file/rm.js +53 -0
- package/dist/commands/apps/file/write.d.ts +17 -0
- package/dist/commands/apps/file/write.js +81 -0
- package/dist/commands/apps/install.d.ts +19 -0
- package/dist/commands/apps/install.js +136 -0
- package/dist/commands/apps/installations/list.d.ts +11 -0
- package/dist/commands/apps/installations/list.js +49 -0
- package/dist/commands/apps/installations/show.d.ts +12 -0
- package/dist/commands/apps/installations/show.js +61 -0
- package/dist/commands/apps/layout/set.d.ts +11 -0
- package/dist/commands/apps/layout/set.js +125 -0
- package/dist/commands/apps/layout/show.d.ts +9 -0
- package/dist/commands/apps/layout/show.js +33 -0
- package/dist/commands/apps/list.d.ts +10 -0
- package/dist/commands/apps/list.js +45 -0
- package/dist/commands/apps/logs.d.ts +13 -0
- package/dist/commands/apps/logs.js +55 -0
- package/dist/commands/apps/preview.d.ts +12 -0
- package/dist/commands/apps/preview.js +39 -0
- package/dist/commands/apps/publish/propose.d.ts +14 -0
- package/dist/commands/apps/publish/propose.js +45 -0
- package/dist/commands/apps/pull.d.ts +14 -0
- package/dist/commands/apps/pull.js +56 -0
- package/dist/commands/apps/push.d.ts +15 -0
- package/dist/commands/apps/push.js +75 -0
- package/dist/commands/apps/reconsent.d.ts +13 -0
- package/dist/commands/apps/reconsent.js +67 -0
- package/dist/commands/apps/report.d.ts +20 -0
- package/dist/commands/apps/report.js +63 -0
- package/dist/commands/apps/resume.d.ts +12 -0
- package/dist/commands/apps/resume.js +36 -0
- package/dist/commands/apps/settings/set.d.ts +13 -0
- package/dist/commands/apps/settings/set.js +54 -0
- package/dist/commands/apps/settings/show.d.ts +11 -0
- package/dist/commands/apps/settings/show.js +31 -0
- package/dist/commands/apps/show.d.ts +12 -0
- package/dist/commands/apps/show.js +49 -0
- package/dist/commands/apps/suspend.d.ts +12 -0
- package/dist/commands/apps/suspend.js +35 -0
- package/dist/commands/apps/uninstall.d.ts +13 -0
- package/dist/commands/apps/uninstall.js +43 -0
- package/dist/commands/apps/upgrade.d.ts +14 -0
- package/dist/commands/apps/upgrade.js +49 -0
- package/dist/commands/apps/version/create.d.ts +14 -0
- package/dist/commands/apps/version/create.js +53 -0
- package/dist/commands/apps/version/show.d.ts +12 -0
- package/dist/commands/apps/version/show.js +39 -0
- package/dist/commands/apps/versions.d.ts +12 -0
- package/dist/commands/apps/versions.js +40 -0
- package/dist/commands/apps/webhooks/list.d.ts +12 -0
- package/dist/commands/apps/webhooks/list.js +47 -0
- package/dist/commands/characters/list.js +2 -1
- package/dist/commands/chats/files/list.js +2 -1
- package/dist/commands/chats/folders/list.js +2 -1
- package/dist/commands/chats/list.js +2 -1
- package/dist/commands/chats/spaces/list.js +2 -1
- package/dist/commands/chats/widgets/list.js +2 -1
- package/dist/commands/code/jobs/list.js +4 -1
- package/dist/commands/commerce/incidents/list.js +2 -1
- package/dist/commands/commitments/accounting.js +3 -0
- package/dist/commands/commitments/action-proposals.d.ts +8 -0
- package/dist/commands/commitments/action-proposals.js +17 -2
- package/dist/commands/commitments/cost.d.ts +11 -0
- package/dist/commands/commitments/cost.js +25 -0
- package/dist/commands/commitments/create.js +6 -1
- package/dist/commands/commitments/endpoints/list.js +2 -1
- package/dist/commands/commitments/links/list.js +2 -1
- package/dist/commands/commitments/list.js +2 -1
- package/dist/commands/commitments/liveness.d.ts +30 -0
- package/dist/commands/commitments/liveness.js +22 -5
- package/dist/commands/commitments/pack/list.js +2 -1
- package/dist/commands/commitments/preflight.js +6 -2
- package/dist/commands/commitments/update.js +10 -1
- package/dist/commands/compass/list.js +2 -1
- package/dist/commands/context.js +7 -1
- package/dist/commands/convos/list.js +3 -2
- package/dist/commands/daemon/install.js +17 -1
- package/dist/commands/daemon/login.js +14 -0
- package/dist/commands/dm/list.js +2 -1
- package/dist/commands/dm/work.d.ts +19 -0
- package/dist/commands/dm/work.js +54 -0
- package/dist/commands/feeds/list.js +2 -1
- package/dist/commands/followups/list.js +2 -1
- package/dist/commands/followups/plans/cancel.d.ts +13 -0
- package/dist/commands/followups/plans/cancel.js +26 -0
- package/dist/commands/followups/plans/create.d.ts +11 -0
- package/dist/commands/followups/plans/create.js +35 -0
- package/dist/commands/followups/plans/list.d.ts +13 -0
- package/dist/commands/followups/plans/list.js +50 -0
- package/dist/commands/followups/plans/observability.d.ts +11 -0
- package/dist/commands/followups/plans/observability.js +46 -0
- package/dist/commands/followups/plans/revise.d.ts +13 -0
- package/dist/commands/followups/plans/revise.js +35 -0
- package/dist/commands/followups/plans/show.d.ts +11 -0
- package/dist/commands/followups/plans/show.js +32 -0
- package/dist/commands/goals/key-results/list.js +2 -1
- package/dist/commands/goals/labels/list.js +3 -2
- package/dist/commands/goals/list.js +3 -2
- package/dist/commands/grants/list.js +2 -1
- package/dist/commands/harnesses/grants/list.js +2 -1
- package/dist/commands/harnesses/leases/list.js +2 -1
- package/dist/commands/harnesses/list.js +10 -1
- package/dist/commands/harnesses/prune.d.ts +26 -0
- package/dist/commands/harnesses/prune.js +172 -0
- package/dist/commands/ingress/list.js +2 -1
- package/dist/commands/initiatives/list.js +2 -1
- package/dist/commands/instruction-blocks/list.js +2 -1
- package/dist/commands/instructions/list.js +2 -1
- package/dist/commands/integrations/connections/list.js +2 -1
- package/dist/commands/integrations/tools/list.js +2 -1
- package/dist/commands/labels/list.js +3 -2
- package/dist/commands/learning/adapters.d.ts +16 -0
- package/dist/commands/learning/adapters.js +44 -0
- package/dist/commands/login.js +11 -0
- package/dist/commands/machines/dedicated/list.js +2 -1
- package/dist/commands/machines/hosted/list.js +2 -1
- package/dist/commands/machines/list.js +2 -1
- package/dist/commands/machines/show.js +5 -2
- package/dist/commands/measures/list.js +2 -1
- package/dist/commands/memory/list.js +2 -1
- package/dist/commands/memory/proposals/list.js +2 -1
- package/dist/commands/memory/stores/list.js +2 -1
- package/dist/commands/memory/topics/list.js +2 -1
- package/dist/commands/memory/versions/list.js +2 -1
- package/dist/commands/messages/list.js +2 -1
- package/dist/commands/northstars/intents/list.js +2 -1
- package/dist/commands/northstars/list.js +2 -1
- package/dist/commands/northstars/recommendations/list.js +2 -1
- package/dist/commands/outbox/list.js +2 -1
- package/dist/commands/profiles/list.js +2 -1
- package/dist/commands/projects/docs/list.js +8 -1
- package/dist/commands/projects/updates/list.js +2 -1
- package/dist/commands/proposals/list.js +2 -1
- package/dist/commands/requests/comments/list.js +2 -1
- package/dist/commands/requests/list.js +2 -1
- package/dist/commands/shares/list.js +2 -1
- package/dist/commands/shortcuts/list.js +2 -1
- package/dist/commands/signals/monitors/list.js +2 -1
- package/dist/commands/signals/schemas/list.js +2 -1
- package/dist/commands/signals/sources/list.js +2 -1
- package/dist/commands/space-directory-views/list.js +2 -1
- package/dist/commands/spaces/actions/list.js +4 -3
- package/dist/commands/spaces/briefs/list.js +2 -1
- package/dist/commands/spaces/cycles/list.js +2 -1
- package/dist/commands/spaces/files/folders/list.js +2 -1
- package/dist/commands/spaces/files/list.js +3 -2
- package/dist/commands/spaces/heartbeats/list.js +3 -2
- package/dist/commands/spaces/labels/list.js +3 -2
- package/dist/commands/spaces/list.d.ts +3 -18
- package/dist/commands/spaces/list.js +28 -35
- package/dist/commands/spaces/live/cards/list.js +2 -1
- package/dist/commands/spaces/members/list.d.ts +1 -0
- package/dist/commands/spaces/members/list.js +4 -1
- package/dist/commands/spaces/show.js +2 -2
- package/dist/commands/spaces/skills/list.js +6 -2
- package/dist/commands/spaces/states/list.js +2 -1
- package/dist/commands/spaces/views/list.js +2 -1
- package/dist/commands/spaces/widgets/list.js +3 -2
- package/dist/commands/spaces/workflow-templates/list.js +2 -1
- package/dist/commands/spaces/workflows/fixtures/list.js +2 -1
- package/dist/commands/spaces/workflows/list.js +3 -2
- package/dist/commands/spaces/workflows/proposals/list.js +2 -1
- package/dist/commands/spaces/workflows/start.js +3 -1
- package/dist/commands/spaces/workflows/triggers/list.js +2 -1
- package/dist/commands/spaces/workflows/validate.js +12 -2
- package/dist/commands/store/acquisitions/list.js +2 -1
- package/dist/commands/store/admissions/list.js +17 -1
- package/dist/commands/store/advisories/list.js +2 -1
- package/dist/commands/store/follows/list.js +2 -1
- package/dist/commands/store/publishers/domains/list.js +2 -1
- package/dist/commands/store/reports/list.js +2 -1
- package/dist/commands/subscriptions/list.js +2 -1
- package/dist/commands/tasks/actionability.js +7 -30
- package/dist/commands/tasks/activity.js +14 -8
- package/dist/commands/tasks/approvals/list.js +2 -1
- package/dist/commands/tasks/assign.d.ts +1 -0
- package/dist/commands/tasks/assign.js +43 -7
- package/dist/commands/tasks/attachments/list.js +2 -1
- package/dist/commands/tasks/chat/send.js +34 -0
- package/dist/commands/tasks/comments/add.js +6 -1
- package/dist/commands/tasks/comments/list.js +2 -1
- package/dist/commands/tasks/complete.js +26 -2
- package/dist/commands/tasks/continue.d.ts +18 -0
- package/dist/commands/tasks/continue.js +54 -0
- package/dist/commands/tasks/create-tree.d.ts +5 -0
- package/dist/commands/tasks/create-tree.js +399 -219
- package/dist/commands/tasks/create.d.ts +1 -0
- package/dist/commands/tasks/create.js +63 -11
- package/dist/commands/tasks/deliverable/add.js +10 -3
- package/dist/commands/tasks/deliverable/list.js +2 -1
- package/dist/commands/tasks/events/list.js +2 -1
- package/dist/commands/tasks/execution-state.d.ts +12 -0
- package/dist/commands/tasks/execution-state.js +28 -0
- package/dist/commands/tasks/expectations/assess.js +40 -5
- package/dist/commands/tasks/guide.d.ts +10 -0
- package/dist/commands/tasks/guide.js +20 -0
- package/dist/commands/tasks/labels/list.js +2 -1
- package/dist/commands/tasks/list.d.ts +19 -0
- package/dist/commands/tasks/list.js +103 -6
- package/dist/commands/tasks/move.js +10 -2
- package/dist/commands/tasks/preflight.d.ts +14 -0
- package/dist/commands/tasks/preflight.js +77 -0
- package/dist/commands/tasks/rearm-recurrence.js +22 -3
- package/dist/commands/tasks/resource/list.js +2 -1
- package/dist/commands/tasks/result/submit.js +10 -1
- package/dist/commands/tasks/review.js +6 -1
- package/dist/commands/tasks/revisions.d.ts +2 -0
- package/dist/commands/tasks/revisions.js +8 -1
- package/dist/commands/tasks/show.d.ts +8 -0
- package/dist/commands/tasks/show.js +81 -43
- package/dist/commands/tasks/start.d.ts +1 -0
- package/dist/commands/tasks/start.js +35 -0
- package/dist/commands/tasks/templates/list.js +2 -1
- package/dist/commands/tasks/timeline.d.ts +5 -0
- package/dist/commands/tasks/timeline.js +9 -1
- package/dist/commands/tasks/unschedule.js +5 -1
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +36 -3
- package/dist/commands/tasks/updates/add.js +6 -1
- package/dist/commands/tasks/updates/list.js +2 -1
- package/dist/commands/tasks/upsert.d.ts +1 -0
- package/dist/commands/tasks/upsert.js +8 -1
- package/dist/commands/token/list.js +2 -1
- package/dist/commands/tokens/list.js +2 -1
- package/dist/commands/tones/list.js +4 -2
- package/dist/commands/triggers/audit.js +12 -3
- package/dist/commands/triggers/create.js +1 -1
- package/dist/commands/triggers/fire-detail.d.ts +7 -0
- package/dist/commands/triggers/fire-detail.js +30 -12
- package/dist/commands/triggers/fire.js +13 -3
- package/dist/commands/triggers/list.js +2 -1
- package/dist/commands/triggers/parse-intent.js +1 -1
- package/dist/commands/triggers/update.js +1 -1
- package/dist/commands/views/list.js +2 -1
- package/dist/commands/webhooks/list.js +2 -1
- package/dist/commands/whoami.js +1 -1
- package/dist/commands/widgets/list.js +2 -1
- package/dist/commands/widgets/save-as-app.d.ts +13 -0
- package/dist/commands/widgets/save-as-app.js +65 -0
- package/dist/commands/work-views/list.js +2 -1
- package/dist/commands/worklog/list.js +2 -1
- package/dist/commands/workspaces/grants.js +1 -4
- package/dist/commands/workspaces/list.js +3 -2
- package/dist/commands/workspaces/members.d.ts +1 -0
- package/dist/commands/workspaces/members.js +10 -7
- package/dist/generated/managed-instruction-guides.json +2 -2
- package/dist/help.js +7 -0
- package/dist/lib/agent-proactive-baseline.d.ts +9 -0
- package/dist/lib/agent-proactive-baseline.js +44 -0
- package/dist/lib/agentic-stream.d.ts +4 -1
- package/dist/lib/agentic-stream.js +29 -4
- package/dist/lib/appData.d.ts +75 -0
- package/dist/lib/appData.js +274 -0
- package/dist/lib/appInstallations.d.ts +117 -0
- package/dist/lib/appInstallations.js +960 -0
- package/dist/lib/appSettings.d.ts +3 -0
- package/dist/lib/appSettings.js +71 -0
- package/dist/lib/appWebhooks.d.ts +7 -0
- package/dist/lib/appWebhooks.js +59 -0
- package/dist/lib/apps-command.d.ts +44 -0
- package/dist/lib/apps-command.js +164 -0
- package/dist/lib/apps.d.ts +45 -0
- package/dist/lib/apps.js +148 -0
- package/dist/lib/appsCheck.d.ts +12 -0
- package/dist/lib/appsCheck.js +173 -0
- package/dist/lib/appsFs.d.ts +58 -0
- package/dist/lib/appsFs.js +384 -0
- package/dist/lib/auth-failure.d.ts +20 -0
- package/dist/lib/auth-failure.js +40 -3
- package/dist/lib/cli-installers.d.ts +9 -2
- package/dist/lib/command-miss.js +107 -0
- package/dist/lib/commitment-loop-status.js +25 -3
- package/dist/lib/commitment-product.js +5 -2
- package/dist/lib/commitments.d.ts +45 -3
- package/dist/lib/commitments.js +139 -41
- package/dist/lib/compasses.d.ts +4 -0
- package/dist/lib/compasses.js +11 -0
- package/dist/lib/daemon-machine-identity-copy.d.ts +14 -0
- package/dist/lib/daemon-machine-identity-copy.js +27 -0
- package/dist/lib/daemon-machine-identity.d.ts +27 -0
- package/dist/lib/daemon-machine-identity.js +61 -0
- package/dist/lib/daemon-setup.js +7 -7
- package/dist/lib/daemonHandoff.d.ts +19 -1
- package/dist/lib/daemonHandoff.js +62 -2
- package/dist/lib/dedicated-ssh.d.ts +2 -0
- package/dist/lib/dedicated-ssh.js +98 -28
- package/dist/lib/harnesses.d.ts +71 -0
- package/dist/lib/harnesses.js +70 -0
- package/dist/lib/json-output.d.ts +33 -0
- package/dist/lib/json-output.js +37 -0
- package/dist/lib/list-output.d.ts +9 -4
- package/dist/lib/list-output.js +38 -9
- package/dist/lib/lookbackPlans.d.ts +13 -0
- package/dist/lib/lookbackPlans.js +68 -0
- package/dist/lib/machines.d.ts +27 -6
- package/dist/lib/machines.js +25 -14
- package/dist/lib/member-output.d.ts +20 -0
- package/dist/lib/member-output.js +57 -0
- package/dist/lib/preflight-copy.d.ts +7 -0
- package/dist/lib/preflight-copy.js +31 -0
- package/dist/lib/profile-machine-identity-guard.js +11 -1
- package/dist/lib/roles.d.ts +2 -2
- package/dist/lib/task-admission.d.ts +9 -0
- package/dist/lib/task-admission.js +35 -0
- package/dist/lib/task-batch.d.ts +4 -0
- package/dist/lib/task-batch.js +2 -0
- package/dist/lib/task-economics.d.ts +10 -0
- package/dist/lib/task-economics.js +24 -2
- package/dist/lib/task-operations.d.ts +25 -0
- package/dist/lib/task-operations.js +123 -0
- package/dist/lib/task-preflight.d.ts +35 -0
- package/dist/lib/task-preflight.js +121 -0
- package/dist/lib/task-resource-references.d.ts +23 -0
- package/dist/lib/task-resource-references.js +119 -0
- package/dist/lib/task-spec-verification.d.ts +42 -0
- package/dist/lib/task-spec-verification.js +101 -0
- package/dist/lib/task-work.d.ts +11 -0
- package/dist/lib/task-work.js +41 -0
- package/dist/lib/task-write-attribution.d.ts +26 -0
- package/dist/lib/task-write-attribution.js +47 -0
- package/dist/lib/tasks.d.ts +13 -0
- package/dist/lib/tasks.js +61 -8
- package/dist/lib/triggers.d.ts +18 -0
- package/dist/lib/triggers.js +97 -5
- package/dist/lib/usage-discovery.d.ts +4 -0
- package/dist/lib/usage-discovery.js +14 -4
- package/dist/lib/widgetApps.d.ts +10 -0
- package/dist/lib/widgetApps.js +47 -0
- package/dist/lib/widgetStaticScan.js +25 -1
- package/dist/lib/workflow-run-view.d.ts +4 -0
- package/dist/lib/workflow-run-view.js +5 -0
- package/dist/lib/workspaces.d.ts +33 -9
- package/dist/lib/workspaces.js +19 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.d.ts +49 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +26 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.d.ts +118 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +614 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.d.ts +60 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +130 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.d.ts +5 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.js +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionRevocation.d.ts +177 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionRevocation.js +484 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.d.ts +11 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.js +46 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +232 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +372 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.d.ts +17 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.js +12 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +45 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.d.ts +49 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +24 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.d.ts +118 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +608 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.d.ts +60 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +128 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +15 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.d.ts +5 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.js +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionRevocation.d.ts +177 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionRevocation.js +472 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.d.ts +11 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.js +44 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +232 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +360 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.d.ts +17 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.js +12 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +31 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +25255 -18711
- package/docs/v1/operations.md +52 -0
- package/docs/v1/space-search.md +19 -0
- package/oclif.manifest.json +4843 -513
- package/package.json +32 -2
|
@@ -242,16 +242,25 @@ function describePermission(event) {
|
|
|
242
242
|
* word.SECOND" as its answer, and `run.result.text` kept it, because the
|
|
243
243
|
* stream then held the final result as a suffix and the longer text won.
|
|
244
244
|
*/
|
|
245
|
-
function envelopesText(event) {
|
|
245
|
+
function envelopesText(event, joiner = (0, data_provider_1.createAssistantTextJoiner)(), accumulated = '') {
|
|
246
246
|
const envelopes = event.envelopes;
|
|
247
247
|
if (!Array.isArray(envelopes))
|
|
248
248
|
return '';
|
|
249
249
|
let out = '';
|
|
250
250
|
for (const envelope of envelopes) {
|
|
251
|
+
// A tool call ends the agent's text block: the run that resumes after it starts on
|
|
252
|
+
// its own paragraph, exactly as the stored message has it (OSK-16934). The rule is
|
|
253
|
+
// the shared one (`assistantTextJoin`, `@skrr-ai/data-provider`); this fold used to
|
|
254
|
+
// append the runs with nothing between them, so `run.result.text` read
|
|
255
|
+
// `...in sequence.**Command 1**` and a widget block that opened right after a tool
|
|
256
|
+
// call read `Ready::::skrr-ui{...`, an opener mid-line that the grammar (and so
|
|
257
|
+
// `widgetsAsText`) does not recognise, printing the whole raw block.
|
|
258
|
+
joiner.note(envelope);
|
|
251
259
|
const ev = envelope
|
|
252
260
|
?.ev;
|
|
253
261
|
if (ev && ev.t === 'text' && ev.thinking !== true && typeof ev.text === 'string') {
|
|
254
|
-
|
|
262
|
+
// Only the last character of the text so far is read.
|
|
263
|
+
out += joiner.join(ev.text, out ? out.slice(-1) : accumulated.slice(-1));
|
|
255
264
|
}
|
|
256
265
|
}
|
|
257
266
|
return out;
|
|
@@ -713,6 +722,12 @@ function describeRunPermission(event) {
|
|
|
713
722
|
: '';
|
|
714
723
|
return `${mode} (from ${from})${coerced}`;
|
|
715
724
|
}
|
|
725
|
+
/** `tail` is the end of `whole`, whitespace aside. */
|
|
726
|
+
function endsWithIgnoringWhitespace(whole, tail) {
|
|
727
|
+
const solid = (value) => value.replace(/\s+/g, '');
|
|
728
|
+
const wanted = solid(tail);
|
|
729
|
+
return wanted.length > 0 && solid(whole).endsWith(wanted);
|
|
730
|
+
}
|
|
716
731
|
class AgenticStreamClient {
|
|
717
732
|
options;
|
|
718
733
|
socket = null;
|
|
@@ -721,6 +736,8 @@ class AgenticStreamClient {
|
|
|
721
736
|
settled = false;
|
|
722
737
|
closed = false;
|
|
723
738
|
accumulated = '';
|
|
739
|
+
/** Where a tool call fell in the envelopes folded into `accumulated` (OSK-16934). */
|
|
740
|
+
textJoiner = (0, data_provider_1.createAssistantTextJoiner)();
|
|
724
741
|
/** Highest envelope `__seq` folded into `accumulated`, for gap detection. */
|
|
725
742
|
highestSeq = 0;
|
|
726
743
|
pendingEnvelopes = new Map();
|
|
@@ -1448,7 +1465,7 @@ class AgenticStreamClient {
|
|
|
1448
1465
|
fresh.some((env) => env?.ev?.t === 'turn-end')) {
|
|
1449
1466
|
this.requestHandoverRead();
|
|
1450
1467
|
}
|
|
1451
|
-
const envelopeText = envelopesText(scoped);
|
|
1468
|
+
const envelopeText = envelopesText(scoped, this.textJoiner, this.accumulated);
|
|
1452
1469
|
if (envelopeText) {
|
|
1453
1470
|
this.accumulated += envelopeText;
|
|
1454
1471
|
this.emit({ ...scoped, type: 'text.delta', text: this.answerText() });
|
|
@@ -1557,6 +1574,7 @@ class AgenticStreamClient {
|
|
|
1557
1574
|
if (!match(event))
|
|
1558
1575
|
return;
|
|
1559
1576
|
this.accumulated = '';
|
|
1577
|
+
this.textJoiner.reset();
|
|
1560
1578
|
this.renderedText = '';
|
|
1561
1579
|
// Seqs restart with the stream, so a fresh low seq is not a gap.
|
|
1562
1580
|
this.highestSeq = 0;
|
|
@@ -2140,9 +2158,16 @@ class AgenticStreamClient {
|
|
|
2140
2158
|
// the two when one contains the other is right for both defects: the
|
|
2141
2159
|
// truncated-stream case (result longer) and the last-block case
|
|
2142
2160
|
// (accumulation longer).
|
|
2161
|
+
//
|
|
2162
|
+
// Compared without whitespace: the join across a tool call puts a paragraph break
|
|
2163
|
+
// INSIDE a run that begins with its own whitespace (`' ::::skrr-ui{'` arrives as
|
|
2164
|
+
// `' \n\n::::skrr-ui{'`), so the harness's last block is not a byte-for-byte suffix of the
|
|
2165
|
+
// accumulation even though it is its tail, and taking it as the answer would drop
|
|
2166
|
+
// everything the agent said before the tool call (OSK-16934).
|
|
2143
2167
|
const accumulationIsSuperset = finalText.length > 0 &&
|
|
2144
2168
|
this.accumulated.length > finalText.length &&
|
|
2145
|
-
this.accumulated.endsWith(finalText)
|
|
2169
|
+
(this.accumulated.endsWith(finalText) ||
|
|
2170
|
+
endsWithIgnoringWhitespace(this.accumulated, finalText));
|
|
2146
2171
|
if (finalText && finalText !== this.accumulated && !accumulationIsSuperset) {
|
|
2147
2172
|
this.accumulated = finalText;
|
|
2148
2173
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { AppPersonDataRefusal, AppStoreConflict, AppStoreDocView, AppStoreQueryResult } from '@skrr-ai/data-provider';
|
|
2
|
+
/** Why the input could not be used; never carries what was in it. */
|
|
3
|
+
export declare class AppDataInputError extends Error {
|
|
4
|
+
readonly code: 'APP_DATA_SOURCE' | 'APP_DATA_NOT_JSON' | 'APP_DATA_NOT_OBJECT' | 'APP_DATA_WHERE';
|
|
5
|
+
constructor(code: 'APP_DATA_SOURCE' | 'APP_DATA_NOT_JSON' | 'APP_DATA_NOT_OBJECT' | 'APP_DATA_WHERE', message: string);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The document the person gave, from exactly one of `--doc`, `--from-file` and `--stdin`. A file is read the way the
|
|
9
|
+
* authoring commands read one (a symbolic link is refused, never followed). The error names the problem and never
|
|
10
|
+
* quotes the input, which may be anything.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readDocumentInput(input: {
|
|
13
|
+
doc?: string;
|
|
14
|
+
fromFile?: string;
|
|
15
|
+
stdin?: boolean;
|
|
16
|
+
}): Promise<Record<string, unknown>>;
|
|
17
|
+
/** The `--where` of a read: a JSON object. What it may hold is the server's parser's to say, once, for every client. */
|
|
18
|
+
export declare function readWhereInput(text: string): Record<string, string | number | boolean | null>;
|
|
19
|
+
export type PersonDataFailure = {
|
|
20
|
+
kind: 'refusal';
|
|
21
|
+
code: AppPersonDataRefusal;
|
|
22
|
+
status?: number;
|
|
23
|
+
message?: string;
|
|
24
|
+
retryAfterMs?: number;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'conflict';
|
|
27
|
+
conflict: AppStoreConflict;
|
|
28
|
+
status?: number;
|
|
29
|
+
currentRev?: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* What the person channel answered, read out of an API error: a refusal (`{ error, code, message }`, the code from
|
|
33
|
+
* the contract's closed set) or a conflict (`409 { error: "conflict", conflict, currentRev? }`). `null` for anything
|
|
34
|
+
* else (a network failure, an HTML error page, another route's refusal), which the base command says.
|
|
35
|
+
*/
|
|
36
|
+
export declare function readPersonDataFailure(error: unknown): PersonDataFailure | null;
|
|
37
|
+
/** The machine code each refusal exits under; a `Record` over the contract's list, so a new member needs one. */
|
|
38
|
+
export declare const PERSON_DATA_REFUSAL_CODES: Record<AppPersonDataRefusal, string>;
|
|
39
|
+
/** The machine code of a conflict. `not_found` here is "there is no such DOCUMENT", not "no such installation". */
|
|
40
|
+
export declare const PERSON_DATA_CONFLICT_CODES: Record<AppStoreConflict, string>;
|
|
41
|
+
/** A refusal that says "that is not there for you" exits as an unknown app does; the rest exit 1. */
|
|
42
|
+
export declare function personDataFailureExit(failure: PersonDataFailure): number;
|
|
43
|
+
/** Can the same call work a moment later? A busy server and a rate limit can; the rest need something changed. */
|
|
44
|
+
export declare function personDataFailureRetryable(failure: PersonDataFailure): boolean;
|
|
45
|
+
/** The words for a refusal. The server's own sentence, when it sent one, is added after ours and never replaces it. */
|
|
46
|
+
export declare function describePersonDataRefusal(failure: Extract<PersonDataFailure, {
|
|
47
|
+
kind: 'refusal';
|
|
48
|
+
}>, bin: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* What a conflict means and what to do. A conflict is an ANSWER: someone (the app's window, an Agent, another person)
|
|
51
|
+
* wrote the document first, so read it again, merge, and retry with the revision it is at now. Nothing was written.
|
|
52
|
+
*/
|
|
53
|
+
export declare function describePersonDataConflict(failure: Extract<PersonDataFailure, {
|
|
54
|
+
kind: 'conflict';
|
|
55
|
+
}>, target: {
|
|
56
|
+
installation: string;
|
|
57
|
+
collection: string;
|
|
58
|
+
id: string;
|
|
59
|
+
}, bin: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Text that came from an app's data, safe to print: a control character, a C1 control, a line or paragraph separator,
|
|
62
|
+
* a bidirectional override and a character that draws nothing (a zero-width character, a variation selector, a Unicode tag character:
|
|
63
|
+
* text a person cannot see) are written as a visible `\uXXXX` and everything else is left alone. `JSON.stringify`
|
|
64
|
+
* already escapes everything below U+0020, but not these.
|
|
65
|
+
*/
|
|
66
|
+
export declare function safeForTerminal(text: string): string;
|
|
67
|
+
/** One document as two lines: where it stands, and its content as compact JSON (cut where it would flood a terminal). */
|
|
68
|
+
export declare function formatDocument(doc: AppStoreDocView): string[];
|
|
69
|
+
/** A page of documents, in lines; an empty page says so, and a page that ends early says how to ask for the rest. */
|
|
70
|
+
export declare function formatQueryResult(result: AppStoreQueryResult, target: {
|
|
71
|
+
installation: string;
|
|
72
|
+
collection: string;
|
|
73
|
+
}, bin: string): string[];
|
|
74
|
+
/** The limit the reference and this help text share, so a number is never typed twice. */
|
|
75
|
+
export declare const PERSON_DATA_QUERY_LIMIT_MAX: 200;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PERSON_DATA_QUERY_LIMIT_MAX = exports.PERSON_DATA_CONFLICT_CODES = exports.PERSON_DATA_REFUSAL_CODES = exports.AppDataInputError = void 0;
|
|
4
|
+
exports.readDocumentInput = readDocumentInput;
|
|
5
|
+
exports.readWhereInput = readWhereInput;
|
|
6
|
+
exports.readPersonDataFailure = readPersonDataFailure;
|
|
7
|
+
exports.personDataFailureExit = personDataFailureExit;
|
|
8
|
+
exports.personDataFailureRetryable = personDataFailureRetryable;
|
|
9
|
+
exports.describePersonDataRefusal = describePersonDataRefusal;
|
|
10
|
+
exports.describePersonDataConflict = describePersonDataConflict;
|
|
11
|
+
exports.safeForTerminal = safeForTerminal;
|
|
12
|
+
exports.formatDocument = formatDocument;
|
|
13
|
+
exports.formatQueryResult = formatQueryResult;
|
|
14
|
+
/**
|
|
15
|
+
* `skrr apps data put | query`: what the commands that write and read an installed app's OWN documents, as the
|
|
16
|
+
* signed-in person, share. The domain lib of the person channel; the authoring loop's is `lib/apps.ts` and the
|
|
17
|
+
* installation commands' `lib/appInstallations.ts`.
|
|
18
|
+
*
|
|
19
|
+
* It builds no URL. Every call is a `dataService` function (`@skrr-ai/data-provider`: `putAppInstallationData`,
|
|
20
|
+
* `queryAppInstallationData`), which is what keeps this CLI and any other client on one route (and what
|
|
21
|
+
* `domain-api-parity.spec.ts` checks). What lives here is what a terminal needs around it:
|
|
22
|
+
*
|
|
23
|
+
* - where a document comes from (`--doc`, `--from-file`, `--stdin`: exactly one) and that it is a JSON OBJECT, said
|
|
24
|
+
* before anything is sent;
|
|
25
|
+
* - the `where` of a read, a JSON object of equalities on top-level fields (the store's own rule, refused by the
|
|
26
|
+
* server's parser if it is more);
|
|
27
|
+
* - what a refusal means in words, keyed by the contract's whole vocabulary (`APP_PERSON_DATA_REFUSALS`), and what a
|
|
28
|
+
* conflict (someone wrote first) means and the revision to retry from: an answer, never an error;
|
|
29
|
+
* - a document drawn for a terminal: its content is whatever the app's window, a webhook, an Agent or a person
|
|
30
|
+
* wrote, so it is DATA, and nothing a terminal would act on is printed raw (control characters, escapes and
|
|
31
|
+
* bidirectional overrides are written out as `\uXXXX`).
|
|
32
|
+
*
|
|
33
|
+
* NEVER PRINTED: who wrote a row. The server returns the KIND of writer (`app`, `agent`, `person`) and never an id.
|
|
34
|
+
*/
|
|
35
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
36
|
+
const appsFs_1 = require("./appsFs");
|
|
37
|
+
// ── what a document is, and where it comes from ─────────────────────────────
|
|
38
|
+
/** Why the input could not be used; never carries what was in it. */
|
|
39
|
+
class AppDataInputError extends Error {
|
|
40
|
+
code;
|
|
41
|
+
constructor(code, message) {
|
|
42
|
+
super(message);
|
|
43
|
+
this.code = code;
|
|
44
|
+
this.name = 'AppDataInputError';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.AppDataInputError = AppDataInputError;
|
|
48
|
+
/** `{ ... }` and not a list, a string, a number or null: the store holds objects. */
|
|
49
|
+
function asPlainObject(value) {
|
|
50
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
51
|
+
? value
|
|
52
|
+
: null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The document the person gave, from exactly one of `--doc`, `--from-file` and `--stdin`. A file is read the way the
|
|
56
|
+
* authoring commands read one (a symbolic link is refused, never followed). The error names the problem and never
|
|
57
|
+
* quotes the input, which may be anything.
|
|
58
|
+
*/
|
|
59
|
+
async function readDocumentInput(input) {
|
|
60
|
+
const given = [input.doc !== undefined, input.fromFile !== undefined, input.stdin === true];
|
|
61
|
+
if (given.filter(Boolean).length !== 1) {
|
|
62
|
+
throw new AppDataInputError('APP_DATA_SOURCE', 'Give the document with exactly one of --doc, --from-file or --stdin.');
|
|
63
|
+
}
|
|
64
|
+
let text;
|
|
65
|
+
if (input.doc !== undefined) {
|
|
66
|
+
text = input.doc;
|
|
67
|
+
}
|
|
68
|
+
else if (input.fromFile !== undefined) {
|
|
69
|
+
text = (0, appsFs_1.readRegularTextFile)(input.fromFile, input.fromFile);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
text = await (0, appsFs_1.readStdinText)();
|
|
73
|
+
}
|
|
74
|
+
let parsed;
|
|
75
|
+
try {
|
|
76
|
+
parsed = JSON.parse(text);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
throw new AppDataInputError('APP_DATA_NOT_JSON', 'The document is not JSON.');
|
|
80
|
+
}
|
|
81
|
+
const object = asPlainObject(parsed);
|
|
82
|
+
if (!object) {
|
|
83
|
+
throw new AppDataInputError('APP_DATA_NOT_OBJECT', 'The document must be a JSON object ({ ... }), not a list, a text, a number or null.');
|
|
84
|
+
}
|
|
85
|
+
return object;
|
|
86
|
+
}
|
|
87
|
+
/** The `--where` of a read: a JSON object. What it may hold is the server's parser's to say, once, for every client. */
|
|
88
|
+
function readWhereInput(text) {
|
|
89
|
+
let parsed;
|
|
90
|
+
try {
|
|
91
|
+
parsed = JSON.parse(text);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
throw new AppDataInputError('APP_DATA_WHERE', '--where must be a JSON object of equalities on top-level fields, for example \'{"status":"open"}\'.');
|
|
95
|
+
}
|
|
96
|
+
const object = asPlainObject(parsed);
|
|
97
|
+
if (!object) {
|
|
98
|
+
throw new AppDataInputError('APP_DATA_WHERE', '--where must be a JSON object of equalities on top-level fields, for example \'{"status":"open"}\'.');
|
|
99
|
+
}
|
|
100
|
+
return object;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* What the person channel answered, read out of an API error: a refusal (`{ error, code, message }`, the code from
|
|
104
|
+
* the contract's closed set) or a conflict (`409 { error: "conflict", conflict, currentRev? }`). `null` for anything
|
|
105
|
+
* else (a network failure, an HTML error page, another route's refusal), which the base command says.
|
|
106
|
+
*/
|
|
107
|
+
function readPersonDataFailure(error) {
|
|
108
|
+
const e = error;
|
|
109
|
+
if (!e || typeof e.body !== 'string') {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
let body;
|
|
113
|
+
try {
|
|
114
|
+
const parsed = JSON.parse(e.body);
|
|
115
|
+
const object = asPlainObject(parsed);
|
|
116
|
+
if (!object) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
body = object;
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
const status = typeof e.status === 'number' ? { status: e.status } : {};
|
|
125
|
+
if (body.code === 'conflict') {
|
|
126
|
+
const conflict = data_provider_1.APP_STORE_CONFLICTS.includes(body.conflict)
|
|
127
|
+
? body.conflict
|
|
128
|
+
: null;
|
|
129
|
+
return conflict === null
|
|
130
|
+
? null
|
|
131
|
+
: {
|
|
132
|
+
kind: 'conflict',
|
|
133
|
+
conflict,
|
|
134
|
+
...status,
|
|
135
|
+
...(typeof body.currentRev === 'number' ? { currentRev: body.currentRev } : {}),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const code = data_provider_1.APP_PERSON_DATA_REFUSALS.includes(body.code)
|
|
139
|
+
? body.code
|
|
140
|
+
: null;
|
|
141
|
+
if (code === null) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
kind: 'refusal',
|
|
146
|
+
code,
|
|
147
|
+
...status,
|
|
148
|
+
...(typeof body.message === 'string' ? { message: body.message } : {}),
|
|
149
|
+
...(typeof body.retryAfterMs === 'number' ? { retryAfterMs: body.retryAfterMs } : {}),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/** The machine code each refusal exits under; a `Record` over the contract's list, so a new member needs one. */
|
|
153
|
+
exports.PERSON_DATA_REFUSAL_CODES = {
|
|
154
|
+
human_only: 'APP_DATA_HUMAN_ONLY',
|
|
155
|
+
not_found: 'APP_DATA_NOT_FOUND',
|
|
156
|
+
not_granted: 'APP_DATA_NOT_GRANTED',
|
|
157
|
+
forbidden_by_viewer: 'APP_DATA_FORBIDDEN',
|
|
158
|
+
grant_stale: 'APP_DATA_GRANT_STALE',
|
|
159
|
+
schema: 'APP_DATA_INVALID',
|
|
160
|
+
quota: 'APP_DATA_QUOTA',
|
|
161
|
+
rate: 'APP_DATA_RATE',
|
|
162
|
+
unavailable: 'APP_DATA_UNAVAILABLE',
|
|
163
|
+
};
|
|
164
|
+
/** The machine code of a conflict. `not_found` here is "there is no such DOCUMENT", not "no such installation". */
|
|
165
|
+
exports.PERSON_DATA_CONFLICT_CODES = {
|
|
166
|
+
rev_mismatch: 'APP_DATA_REV_MISMATCH',
|
|
167
|
+
exists: 'APP_DATA_EXISTS',
|
|
168
|
+
not_found: 'APP_DATA_DOC_NOT_FOUND',
|
|
169
|
+
};
|
|
170
|
+
/** A refusal that says "that is not there for you" exits as an unknown app does; the rest exit 1. */
|
|
171
|
+
function personDataFailureExit(failure) {
|
|
172
|
+
return failure.kind === 'refusal' && failure.code === 'not_found' ? 4 : 1;
|
|
173
|
+
}
|
|
174
|
+
/** Can the same call work a moment later? A busy server and a rate limit can; the rest need something changed. */
|
|
175
|
+
function personDataFailureRetryable(failure) {
|
|
176
|
+
return failure.kind === 'refusal' && (failure.code === 'rate' || failure.code === 'unavailable');
|
|
177
|
+
}
|
|
178
|
+
const REFUSAL_WORDS = {
|
|
179
|
+
human_only: (bin) => `Only a signed-in person can write an app's data this way. This credential is not one (an agent's, a workload's or an access token). Sign in as yourself with \`${bin} login\`.`,
|
|
180
|
+
not_found: () => 'There is no such installation that you can see.',
|
|
181
|
+
not_granted: () => 'A person may not write this collection here. The running version must list it in capabilities.store and name "person" in its write list, and the person who installed the app must have approved that. Nothing was written.',
|
|
182
|
+
forbidden_by_viewer: () => 'You do not have permission to do this on the agent this app is installed on (writing needs edit access, reading needs view access). Nothing was written.',
|
|
183
|
+
grant_stale: (bin) => `This app changed since it was approved. Approve it again with \`${bin} apps reconsent <installation>\` and try again.`,
|
|
184
|
+
schema: () => 'The request does not fit this operation (the collection name, the document id, the document, or a query parameter). Nothing was written.',
|
|
185
|
+
quota: () => `That would go over a limit (a document is at most ${data_provider_1.APP_STORE_LIMITS.docMaxChars} characters of JSON, a collection holds at most ${data_provider_1.APP_STORE_LIMITS.docsPerCollectionMax} documents, an installation at most ${data_provider_1.APP_STORE_LIMITS.installationMaxBytes} bytes). Nothing was written; nothing is ever trimmed to fit.`,
|
|
186
|
+
rate: () => 'Too many writes in a short time. Wait a moment and try again.',
|
|
187
|
+
unavailable: () => 'This is not available right now: the installation may be paused, or the server is busy. Check `apps installations show <installation>`, then try again.',
|
|
188
|
+
};
|
|
189
|
+
/** The words for a refusal. The server's own sentence, when it sent one, is added after ours and never replaces it. */
|
|
190
|
+
function describePersonDataRefusal(failure, bin) {
|
|
191
|
+
const lines = [REFUSAL_WORDS[failure.code](bin)];
|
|
192
|
+
if (failure.code === 'rate' && failure.retryAfterMs !== undefined) {
|
|
193
|
+
lines.push(`→ Try again in ${Math.max(1, Math.ceil(failure.retryAfterMs / 1000))} s.`);
|
|
194
|
+
}
|
|
195
|
+
return lines.join('\n');
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* What a conflict means and what to do. A conflict is an ANSWER: someone (the app's window, an Agent, another person)
|
|
199
|
+
* wrote the document first, so read it again, merge, and retry with the revision it is at now. Nothing was written.
|
|
200
|
+
*/
|
|
201
|
+
function describePersonDataConflict(failure, target, bin) {
|
|
202
|
+
const read = `${bin} apps data query ${target.installation} ${target.collection} --id ${target.id}`;
|
|
203
|
+
switch (failure.conflict) {
|
|
204
|
+
case 'rev_mismatch':
|
|
205
|
+
return [
|
|
206
|
+
`Not written: ${target.collection}/${target.id} is at revision ${failure.currentRev ?? '(unknown)'}, not the one you named.`,
|
|
207
|
+
`→ Read it again (\`${read}\`), merge, and retry with --expected-rev ${failure.currentRev ?? '<its revision>'}.`,
|
|
208
|
+
].join('\n');
|
|
209
|
+
case 'exists':
|
|
210
|
+
return [
|
|
211
|
+
`Not written: ${target.collection}/${target.id} already exists${failure.currentRev === undefined ? '' : ` (revision ${failure.currentRev})`}, and --expected-rev 0 only creates.`,
|
|
212
|
+
`→ Read it (\`${read}\`) and replace it with --expected-rev ${failure.currentRev ?? '<its revision>'}, or leave --expected-rev out to overwrite whatever is there.`,
|
|
213
|
+
].join('\n');
|
|
214
|
+
case 'not_found':
|
|
215
|
+
return [
|
|
216
|
+
`Not written: there is no document ${target.collection}/${target.id} to replace.`,
|
|
217
|
+
`→ Create it with --expected-rev 0, or leave --expected-rev out.`,
|
|
218
|
+
].join('\n');
|
|
219
|
+
default: {
|
|
220
|
+
const never = failure.conflict;
|
|
221
|
+
return String(never);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// ── a document, drawn for a terminal ────────────────────────────────────────
|
|
226
|
+
/**
|
|
227
|
+
* Text that came from an app's data, safe to print: a control character, a C1 control, a line or paragraph separator,
|
|
228
|
+
* a bidirectional override and a character that draws nothing (a zero-width character, a variation selector, a Unicode tag character:
|
|
229
|
+
* text a person cannot see) are written as a visible `\uXXXX` and everything else is left alone. `JSON.stringify`
|
|
230
|
+
* already escapes everything below U+0020, but not these.
|
|
231
|
+
*/
|
|
232
|
+
function safeForTerminal(text) {
|
|
233
|
+
return text.replace(
|
|
234
|
+
// eslint-disable-next-line no-control-regex, no-misleading-character-class -- the point of the pattern is to match control, combining and invisible characters
|
|
235
|
+
/[\u0000-\u001f\u007f-\u009f\u00ad\u034f\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180e\u200b-\u200f\u2028-\u202e\u2060-\u206f\u2800\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff9-\ufffb\u{1d173}-\u{1d17a}\u{e0000}-\u{e03ff}]/gu, (c) => {
|
|
236
|
+
const code = c.codePointAt(0) ?? 0;
|
|
237
|
+
return code > 0xffff
|
|
238
|
+
? `\\u{${code.toString(16)}}`
|
|
239
|
+
: `\\u${code.toString(16).padStart(4, '0')}`;
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
const DATA_LINE_MAX = 400;
|
|
243
|
+
/** One document as two lines: where it stands, and its content as compact JSON (cut where it would flood a terminal). */
|
|
244
|
+
function formatDocument(doc) {
|
|
245
|
+
const head = `${doc.id} rev ${doc.rev} by ${doc.writtenBy.kind}${doc.writtenBy.via ? ` (${doc.writtenBy.via})` : ''} ${doc.updatedAt}`;
|
|
246
|
+
if (doc.unreadable) {
|
|
247
|
+
return [
|
|
248
|
+
head,
|
|
249
|
+
' (this document cannot be shown: it is stored in a form the store cannot hand over)',
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
const json = safeForTerminal(JSON.stringify(doc.data));
|
|
253
|
+
const shown = json.length > DATA_LINE_MAX
|
|
254
|
+
? `${json.slice(0, DATA_LINE_MAX)}... (${json.length - DATA_LINE_MAX} more characters; --json prints it whole)`
|
|
255
|
+
: json;
|
|
256
|
+
return [head, ` ${shown}`];
|
|
257
|
+
}
|
|
258
|
+
/** A page of documents, in lines; an empty page says so, and a page that ends early says how to ask for the rest. */
|
|
259
|
+
function formatQueryResult(result, target, bin) {
|
|
260
|
+
const lines = [];
|
|
261
|
+
const total = result.total === undefined ? '' : ` of ${result.total}`;
|
|
262
|
+
lines.push(result.docs.length === 0
|
|
263
|
+
? `No documents in ${target.collection}.`
|
|
264
|
+
: `${result.docs.length} document${result.docs.length === 1 ? '' : 's'}${total} in ${target.collection}:`);
|
|
265
|
+
for (const doc of result.docs) {
|
|
266
|
+
lines.push(...formatDocument(doc));
|
|
267
|
+
}
|
|
268
|
+
if (result.nextCursor) {
|
|
269
|
+
lines.push(`→ More: \`${bin} apps data query ${target.installation} ${target.collection} --cursor ${result.nextCursor}\` (same filters).`);
|
|
270
|
+
}
|
|
271
|
+
return lines;
|
|
272
|
+
}
|
|
273
|
+
/** The limit the reference and this help text share, so a number is never typed twice. */
|
|
274
|
+
exports.PERSON_DATA_QUERY_LIMIT_MAX = data_provider_1.APP_STORE_LIMITS.queryLimitMax;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { AppDisclosureCheck, AppDisclosureFacts, AppHostUnsuitable, AppInstallationJobState, AppInstallationListItem, AppOperatorUnmet } from '@skrr-ai/data-provider';
|
|
2
|
+
import type { AppsRefusal } from './apps';
|
|
3
|
+
/**
|
|
4
|
+
* The words for an availability the contract names. One this CLI does not know (a server newer than the CLI) is said
|
|
5
|
+
* as it came and as NOT recognised, never as "ready" and never as nothing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function describeAvailability(availability: unknown): string;
|
|
8
|
+
export declare function describeTrust(trust: unknown): string;
|
|
9
|
+
export declare function describeTrustShort(trust: unknown): string;
|
|
10
|
+
/**
|
|
11
|
+
* A table row of the apps installed on a principal. When the platform did not schedule some of the app's jobs (refused, or
|
|
12
|
+
* chose not to run) the row says how many at its end, and when it has not confirmed some (nothing is recorded for the
|
|
13
|
+
* version the app runs now) it says that, as its own count: "the platform said no" and "nobody has said anything" are
|
|
14
|
+
* different facts, and a row that counted only the first read an app whose every job is unconfirmed the same as a healthy
|
|
15
|
+
* one. Neither count is a verdict on the others, and neither says anything reassuring; `show` says which jobs and why. A row
|
|
16
|
+
* with nothing to say is the row it was (a job the person deleted the schedule of is their own choice, and adds nothing).
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatInstallationRow(item: AppInstallationListItem): string;
|
|
19
|
+
/**
|
|
20
|
+
* A job's scheduling state, in words: `null` when it is scheduled (nothing to say). A state with something to say returns
|
|
21
|
+
* the clause and the next step; `unknown` is NEVER null, because "nobody recorded it" reads as "fine" when it is silent.
|
|
22
|
+
*/
|
|
23
|
+
export declare function describeJobScheduling(jobState: {
|
|
24
|
+
state?: unknown;
|
|
25
|
+
reason?: unknown;
|
|
26
|
+
} | null | undefined): {
|
|
27
|
+
state: string;
|
|
28
|
+
what: string;
|
|
29
|
+
next: string | null;
|
|
30
|
+
} | null;
|
|
31
|
+
/** The lines `skrr apps installations show` prints for the jobs' states: one per job, the reason and the next step under a job that is not scheduled. */
|
|
32
|
+
export declare function formatJobStates(jobStates: readonly AppInstallationJobState[] | undefined, installationId: string): string[];
|
|
33
|
+
/** The words for each reason a grant stopped covering a version; a kind it does not know is said as it came. */
|
|
34
|
+
export declare function describeGrantReasons(kinds: readonly string[]): string[];
|
|
35
|
+
/**
|
|
36
|
+
* A disclosure as the lines a person reads before they approve. `null` (a disclosure this CLI cannot read) is
|
|
37
|
+
* said plainly: "cannot show what you would be approving" is never "nothing to approve".
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatDisclosure(raw: unknown, facts?: AppDisclosureFacts): string[];
|
|
40
|
+
export declare function describeHostUnsuitable(reason: AppHostUnsuitable): string;
|
|
41
|
+
export declare function describeOperatorUnmet(unmet: AppOperatorUnmet): string;
|
|
42
|
+
/**
|
|
43
|
+
* The choices an install has to settle, as lines. `undefined` is "this app needs no choice" and says nothing; a block this
|
|
44
|
+
* CLI cannot read is said so, and is never "nothing to choose".
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatBindings(raw: unknown): string[];
|
|
47
|
+
/**
|
|
48
|
+
* What the app's service would cost, as lines. Every figure is the server's arithmetic over the computer's rate; nothing
|
|
49
|
+
* here is an amount written in advance, and a state without a number says why and is never zero. `undefined` is "this app
|
|
50
|
+
* has no service" and says nothing.
|
|
51
|
+
*/
|
|
52
|
+
export declare function formatHosting(raw: unknown): string[];
|
|
53
|
+
/** The words for a `binding_required` refusal: what was missing, and why what was given would not do. */
|
|
54
|
+
export declare function describeBindingRefusal(refusal: AppsRefusal): string;
|
|
55
|
+
/**
|
|
56
|
+
* What the automatic check recorded for this version, in lines. It is never a verdict of "safe", and the three states
|
|
57
|
+
* a surface must keep apart are kept apart: a result, no result on record (the version predates the check), and a
|
|
58
|
+
* result stored in a form this CLI cannot read. A server that did not send the section at all is a fourth, said as such.
|
|
59
|
+
* None of the last three is ever drawn as "nothing found".
|
|
60
|
+
*/
|
|
61
|
+
export declare function describeDisclosureCheck(check: AppDisclosureCheck | undefined): string[];
|
|
62
|
+
export interface InstallTarget {
|
|
63
|
+
appId: string;
|
|
64
|
+
versionId: string;
|
|
65
|
+
bundleHash: string;
|
|
66
|
+
version: number;
|
|
67
|
+
}
|
|
68
|
+
export declare class InstallTargetError extends Error {
|
|
69
|
+
readonly code: 'no_versions' | 'version_not_found' | 'wrong_app';
|
|
70
|
+
constructor(code: 'no_versions' | 'version_not_found' | 'wrong_app', message: string);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The version an install points at, and the bundle the person is about to be shown. With `--version` that
|
|
74
|
+
* version (and it must belong to the app); without it the app's newest. The server decides whether it is
|
|
75
|
+
* installable (a rejected or delisted version, a beta for a channel that does not see them): this does not
|
|
76
|
+
* guess at that vocabulary, it lets the refusal say it.
|
|
77
|
+
*/
|
|
78
|
+
export declare function resolveInstallTarget(input: {
|
|
79
|
+
appId: string;
|
|
80
|
+
versionId?: string;
|
|
81
|
+
}): Promise<InstallTarget>;
|
|
82
|
+
/** The sentence for a refusal the server made on an installation call, or null for one that is not. */
|
|
83
|
+
export declare function describeInstallationConflict(refusal: AppsRefusal, bin: string): string | null;
|
|
84
|
+
/** The machine code of every installation refusal: `APP_<REASON>`. */
|
|
85
|
+
export declare const ALL_INSTALLATION_REFUSAL_CODES: Record<string, string>;
|
|
86
|
+
export declare const INSTALLATION_REFUSAL_CODES: Record<string, string>;
|
|
87
|
+
/** The lines the disclosure preview adds when the app cannot be installed on the principal asked about. Empty for none. */
|
|
88
|
+
export declare function formatScopeIssues(raw: unknown): string[];
|
|
89
|
+
/**
|
|
90
|
+
* Where an install points: one of the person's agents, or the person themself. `me` is the signed-in person's own id,
|
|
91
|
+
* which the server compares with the request's user (a stranger's id is refused as not found), so naming it here is
|
|
92
|
+
* not a claim the server takes on trust.
|
|
93
|
+
*/
|
|
94
|
+
export declare function resolveInstallPrincipal(input: {
|
|
95
|
+
agent?: string;
|
|
96
|
+
me?: boolean;
|
|
97
|
+
}): Promise<{
|
|
98
|
+
kind: 'agent' | 'user';
|
|
99
|
+
id: string;
|
|
100
|
+
}>;
|
|
101
|
+
/** A layout read, in lines: the revision to name when writing, then the top-level order and each folder. */
|
|
102
|
+
export declare function formatUserLayout(raw: unknown): string[];
|
|
103
|
+
/** What the layout route refused with: the contract's word, the revision to retry from, and where the body did not fit. */
|
|
104
|
+
export interface LayoutRefusal {
|
|
105
|
+
status?: number;
|
|
106
|
+
error: string;
|
|
107
|
+
currentRev?: number;
|
|
108
|
+
issue?: string;
|
|
109
|
+
}
|
|
110
|
+
/** Read a layout refusal out of an API error, or null when the error is not one the layout route made. */
|
|
111
|
+
export declare function readLayoutRefusal(error: unknown): LayoutRefusal | null;
|
|
112
|
+
/** The machine code of a report refusal that is the report's alone: `APP_REPORT_<REASON>`. */
|
|
113
|
+
export declare const REPORT_REFUSAL_CODES: Record<string, string>;
|
|
114
|
+
/** The sentence for a refusal the server made on a report, or null for one that is not the report's alone. */
|
|
115
|
+
export declare function describeReportRefusal(refusal: AppsRefusal, bin: string): string | null;
|
|
116
|
+
/** The exit of a refusal that says "that is not there for you": the same one an unknown app gets. */
|
|
117
|
+
export declare function installationRefusalExit(conflict: string): number;
|