@skrr-ai/cli 0.1.155 → 0.1.158
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/dist/base-command.js +64 -16
- package/dist/commands/activity/list.d.ts +13 -0
- package/dist/commands/activity/list.js +50 -0
- package/dist/commands/activity/scan-older.d.ts +23 -0
- package/dist/commands/activity/scan-older.js +74 -0
- package/dist/commands/activity/show.d.ts +27 -0
- package/dist/commands/activity/show.js +228 -0
- package/dist/commands/agent/message/send.js +64 -19
- package/dist/commands/agents/always-on/held-messages.js +24 -1
- package/dist/commands/agents/always-on/status.js +6 -1
- package/dist/commands/agents/mini-computer/app/reset.d.ts +13 -0
- package/dist/commands/agents/mini-computer/app/reset.js +35 -0
- package/dist/commands/agents/mini-computer/app/set.d.ts +16 -0
- package/dist/commands/agents/mini-computer/app/set.js +70 -0
- package/dist/commands/agents/mini-computer/layout/change.d.ts +14 -0
- package/dist/commands/agents/mini-computer/layout/change.js +44 -0
- package/dist/commands/agents/mini-computer/layout/folder.d.ts +14 -0
- package/dist/commands/agents/mini-computer/layout/folder.js +35 -0
- package/dist/commands/agents/mini-computer/layout/move.d.ts +14 -0
- package/dist/commands/agents/mini-computer/layout/move.js +32 -0
- package/dist/commands/agents/mini-computer/layout/pin.d.ts +14 -0
- package/dist/commands/agents/mini-computer/layout/pin.js +35 -0
- package/dist/commands/agents/mini-computer/layout/remove.d.ts +13 -0
- package/dist/commands/agents/mini-computer/layout/remove.js +27 -0
- package/dist/commands/agents/mini-computer/layout/restore.d.ts +13 -0
- package/dist/commands/agents/mini-computer/layout/restore.js +27 -0
- package/dist/commands/agents/mini-computer/layout/unfolder.d.ts +13 -0
- package/dist/commands/agents/mini-computer/layout/unfolder.js +27 -0
- package/dist/commands/agents/mini-computer/layout/unpin.d.ts +14 -0
- package/dist/commands/agents/mini-computer/layout/unpin.js +34 -0
- package/dist/commands/agents/mini-computer/show.d.ts +13 -0
- package/dist/commands/agents/mini-computer/show.js +60 -0
- package/dist/commands/agents/mini-computer/tasks-view.d.ts +29 -0
- package/dist/commands/agents/mini-computer/tasks-view.js +100 -0
- package/dist/commands/apps/auto-apply.d.ts +14 -0
- package/dist/commands/apps/auto-apply.js +53 -0
- package/dist/commands/apps/check.js +4 -1
- package/dist/commands/apps/create.js +11 -6
- package/dist/commands/apps/data/batch.d.ts +15 -0
- package/dist/commands/apps/data/batch.js +59 -0
- package/dist/commands/apps/data/collections.d.ts +12 -0
- package/dist/commands/apps/data/collections.js +44 -0
- package/dist/commands/apps/data/delete.d.ts +15 -0
- package/dist/commands/apps/data/delete.js +57 -0
- package/dist/commands/apps/data/patch.d.ts +17 -0
- package/dist/commands/apps/data/patch.js +70 -0
- package/dist/commands/apps/data/put.js +1 -1
- package/dist/commands/apps/data/query.js +1 -1
- package/dist/commands/apps/installations/diff.d.ts +14 -0
- package/dist/commands/apps/installations/diff.js +45 -0
- package/dist/commands/apps/installations/events.d.ts +23 -0
- package/dist/commands/apps/installations/events.js +104 -0
- package/dist/commands/apps/installations/snapshot.d.ts +18 -0
- package/dist/commands/apps/installations/snapshot.js +60 -0
- package/dist/commands/apps/installations/versions.d.ts +12 -0
- package/dist/commands/apps/installations/versions.js +38 -0
- package/dist/commands/apps/logs.js +3 -0
- package/dist/commands/apps/preview.js +4 -2
- package/dist/commands/apps/pull.js +10 -1
- package/dist/commands/apps/push.js +36 -12
- package/dist/commands/apps/reference.d.ts +26 -0
- package/dist/commands/apps/reference.js +56 -0
- package/dist/commands/apps/rollback.d.ts +13 -0
- package/dist/commands/apps/rollback.js +47 -0
- package/dist/commands/apps/version/create.js +5 -0
- package/dist/commands/duties/accounting.js +6 -0
- package/dist/commands/duties/analytics/detail.js +6 -0
- package/dist/commands/duties/analytics/index.js +14 -0
- package/dist/commands/duties/analytics/replay.js +6 -0
- package/dist/commands/duties/cost.js +6 -0
- package/dist/commands/duties/delete.js +22 -19
- package/dist/commands/duties/doctor.d.ts +2 -1
- package/dist/commands/duties/doctor.js +17 -3
- package/dist/commands/duties/goals/link.js +4 -0
- package/dist/commands/duties/goals/unlink.js +4 -0
- package/dist/commands/duties/lineage.js +6 -1
- package/dist/commands/duties/links/list.js +6 -0
- package/dist/commands/duties/metrics.js +10 -0
- package/dist/commands/duties/observations.js +12 -0
- package/dist/commands/duties/operating-review.d.ts +4 -30
- package/dist/commands/duties/operating-review.js +28 -141
- package/dist/commands/duties/receipt-metrics.js +7 -0
- package/dist/commands/duties/receipt.js +7 -0
- package/dist/commands/duties/roster.js +14 -8
- package/dist/commands/duties/show.js +27 -9
- package/dist/commands/duties/status.js +18 -9
- package/dist/commands/duties/trigger-status.d.ts +2 -0
- package/dist/commands/duties/trigger-status.js +19 -1
- package/dist/commands/duties/wake-capabilities.d.ts +2 -0
- package/dist/commands/duties/wake-capabilities.js +32 -2
- package/dist/commands/followups/act.js +3 -0
- package/dist/commands/followups/remind.js +12 -3
- package/dist/commands/followups/show.js +6 -0
- package/dist/commands/harnesses/quota.js +1 -1
- package/dist/commands/spaces/notebook.d.ts +3 -7
- package/dist/commands/spaces/notebook.js +32 -8
- package/dist/commands/tasks/create.d.ts +2 -2
- package/dist/commands/tasks/create.js +3 -3
- package/dist/commands/tasks/list.d.ts +3 -41
- package/dist/commands/tasks/list.js +5 -53
- package/dist/generated/agent-guides.json +424 -101
- package/dist/generated/managed-instruction-guides.json +1 -1
- package/dist/lib/agent-activity.d.ts +153 -0
- package/dist/lib/agent-activity.js +241 -0
- package/dist/lib/always-on-runtime.d.ts +9 -0
- package/dist/lib/always-on-runtime.js +20 -0
- package/dist/lib/api-fetch.d.ts +10 -0
- package/dist/lib/api-fetch.js +12 -2
- package/dist/lib/appData.d.ts +28 -1
- package/dist/lib/appData.js +111 -9
- package/dist/lib/appInstallations.d.ts +9 -1
- package/dist/lib/appInstallations.js +100 -0
- package/dist/lib/apps-command.d.ts +1 -0
- package/dist/lib/apps-command.js +11 -0
- package/dist/lib/apps.d.ts +12 -0
- package/dist/lib/apps.js +28 -1
- package/dist/lib/appsAssets.d.ts +17 -0
- package/dist/lib/appsAssets.js +15 -0
- package/dist/lib/appsCheck.d.ts +1 -0
- package/dist/lib/appsCheck.js +1 -0
- package/dist/lib/appsFs.d.ts +18 -1
- package/dist/lib/appsFs.js +76 -19
- package/dist/lib/compasses.js +6 -0
- package/dist/lib/duties.d.ts +25 -2
- package/dist/lib/duties.js +58 -3
- package/dist/lib/duty-analytics.d.ts +2 -0
- package/dist/lib/duty-analytics.js +26 -0
- package/dist/lib/duty-goal-propagation.d.ts +2 -0
- package/dist/lib/duty-goal-propagation.js +18 -0
- package/dist/lib/duty-history-source.d.ts +4 -0
- package/dist/lib/duty-history-source.js +12 -0
- package/dist/lib/duty-ledgers.d.ts +4 -0
- package/dist/lib/duty-ledgers.js +4 -0
- package/dist/lib/duty-receipt-source.d.ts +4 -0
- package/dist/lib/duty-receipt-source.js +19 -0
- package/dist/lib/followups.d.ts +20 -0
- package/dist/lib/followups.js +10 -0
- package/dist/lib/held-messages.d.ts +22 -0
- package/dist/lib/held-messages.js +55 -0
- package/dist/lib/list-workspace.d.ts +40 -0
- package/dist/lib/list-workspace.js +58 -0
- package/dist/lib/miniComputer.d.ts +59 -0
- package/dist/lib/miniComputer.js +224 -0
- package/dist/lib/miniComputerCommand.d.ts +13 -0
- package/dist/lib/miniComputerCommand.js +48 -0
- package/dist/lib/roles.d.ts +3 -3
- package/dist/lib/space-notebook.js +15 -4
- package/dist/node_modules/@skrr-ai/data-provider/index.js +10465 -8383
- package/oclif.manifest.json +2849 -462
- package/package.json +14 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"oversky-task-management": {
|
|
3
3
|
"key": "oversky-task-management",
|
|
4
4
|
"name": "skrr Task Management",
|
|
5
|
-
"templateVersion":
|
|
5
|
+
"templateVersion": 24,
|
|
6
6
|
"body": "## OverSky Task Management\n\nUse `skrr` as the durable record for work that must outlive this conversation.\n\n### One concept, one record\n\n- **Task** says what is owed and where it stands.\n- **Expectation** says what must be true before the Task can close.\n- **Update** says what meaningfully changed during execution.\n- **Resume Point** says where one Run can safely continue after interruption.\n- **Result** says what the work concluded or returned.\n- **Deliverable** identifies a concrete Resource version produced by the work.\n- **Review** says whether another actor accepted one exact Result.\n- **Comment** is replyable collaboration.\n- **Activity** is the immutable audit projection. A Run transcript is detailed telemetry, not Activity.\n\nDo not put a Result in a Comment, use an Update as a transcript, or use review words such as\n“approved” for a domain conclusion such as NO-SHIP.\n\nThe platform derives Human, Agent, Run, session, and recording provenance from the authenticated\nruntime. Never supply or invent an Agent identity. An Update has one author; a multi-Agent summary\nmay cite contributors and their source Runs or Updates.\n\n### During execution: write Updates at meaningful boundaries\n\nDo not log routine reads, tool calls, heartbeats, token counts, or repeated “still working” narration.\nRecord an Update only when a future reader or replacement Run needs to know that shared state changed:\n\nEach type has a REQUIRED `--data` shape, and the array fields are required even when empty.\nOptional fields are marked `?`. The server rejects a missing required field, so guessing from the\nprose costs a round trip:\n\n- `progress`: a material part is complete.\n `{completedSinceLast: string[], nextActions: string[], currentFocus?}`\n- `finding`: a newly discovered fact. `impact` is optional; the evidence references are not.\n `{finding, evidenceRefs: [], impact?, severity?}`\n- `decision`: a choice now constrains the work.\n `{decision, rationale, alternativesConsidered?: string[]}`\n- `blocker`: work cannot continue. `nextOwner` is a principal OBJECT, not a name.\n `{cause, requiredAction, nextOwner: {kind: \"human\", userId}}`\n- `verification`: a claim was checked. `result` is one of `passed`, `failed`, `inconclusive`.\n `{claim, result, evidenceRefs: []}`\n- `ready_for_review`: created by Result submission; do not author it separately.\n\n`--reference <kind>:<id>` sets the Update's OWN references. It does not populate\n`data.evidenceRefs`, which belongs inside `--data`.\n\nUse one stable idempotency key only for retries of the identical write. Reusing it for different\ncontent is rejected.\n\nExample:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type progress \\\n --summary \"Migration review complete\" \\\n --data '{\"completedSinceLast\":[\"Checked migrations 001-014\"],\"currentFocus\":\"Authorization review\",\"nextActions\":[\"Inspect legacy adapters\"]}' \\\n --idempotency-key \"<task-id>:migration-review\"\n```\n\nFor a decision:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type decision \\\n --summary \"Use a first-class Resource identity\" \\\n --data '{\"decision\":\"Use WorkResource plus immutable versions\",\"rationale\":\"A URL can move and cannot identify the version a reviewer accepted\"}' \\\n --idempotency-key \"<task-id>:resource-model\"\n```\n\nFor a finding — `evidenceRefs` is required and may be empty:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type finding \\\n --summary \"The closure gate reads assessments by exact specVersion\" \\\n --data '{\"finding\":\"A cosmetic title edit bumps specVersion, so every prior assessment stops counting\",\"impact\":\"A task with expectations cannot be closed after a rename\",\"evidenceRefs\":[{\"kind\":\"code\",\"uri\":\"api/server/services/TaskClosurePolicy/index.js\"}]}' \\\n --idempotency-key \"<task-id>:spec-bump-revocation\"\n```\n\nFor a blocker — `nextOwner` is a principal object:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type blocker \\\n --summary \"Waiting on production database credentials\" \\\n --data '{\"cause\":\"The migration needs write access to the prod cluster\",\"requiredAction\":\"Grant the deploy role write access, or run the migration yourself\",\"nextOwner\":{\"kind\":\"human\",\"userId\":\"<user-id>\"}}' \\\n --idempotency-key \"<task-id>:needs-prod-credentials\"\n```\n\nFor a verification:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type verification \\\n --summary \"Re-ran the closure flow end to end after the fix\" \\\n --data '{\"claim\":\"A renamed task with one assessed expectation can close\",\"result\":\"passed\",\"evidenceRefs\":[{\"kind\":\"task\",\"id\":\"<task-id>\"}]}' \\\n --idempotency-key \"<task-id>:closure-reverify\"\n```\n\n### Media: screenshots and recordings\n\n`--attach <path>` (repeatable) on `updates add`, `result submit`, `complete`, or `comments add`\nuploads a file as a Task asset and cites it; identical bytes dedupe. In-run proof goes on a\n`verification` or `progress` Update, the final before/after on the Result, never the description.\nAn upload is `self_reported` evidence and counts toward the storage quota. Images keep full\nresolution minus metadata (Runs get a model-sized copy); undecodable bytes get 422, a type the bytes\ncontradict 415, and SVG downloads as a file. An agent uploads evidence (the default) or\n`--role deliverable`; `input` is refused (403): ask a person to run `attachments set-role`. Cite a\ndeliverable as `--evidence task_attachment:<asset-id>` when you assess its Expectation.\n\n### Recovery: Update delta and Resume Point snapshot\n\nWhen a semantic boundary should also be resumable, add `--run-id` and `--resume` to the same Update\ncommand. The server commits the visible Update and the Run-bound Resume Point together. The snapshot\nmust be self-contained enough for another capable Agent to continue without replaying the transcript:\ncompleted work, current focus, next actions, open questions, and references to decisions, evidence,\nDeliverables, and durable workspace state.\n\nThe runtime may save a silent crash-safety snapshot with:\n\n```bash\nskrr tasks resume save <task-id> --run-id <run-id> --snapshot '<resume-json>'\n```\n\nNever put credentials, secrets, permission grants, bearer tokens, or leases in a Resume Point. A\nresumed Run reloads the current Task Revision, re-authorizes, validates referenced files/commits, and\nreads Updates recorded after the snapshot:\n\n```bash\nskrr tasks resume show <task-id> --run-id <run-id>\n```\n\n### Deliverables: lightweight input, first-class identity\n\nA user may provide one coordinate, but the platform records a WorkResource, its exact version, the\nTask relationship, and an evidence-backed availability observation. External reference is the\ndefault; OverSky-managed content is used only when retention, stable access, preview/search, or\npolicy requires a copy.\n\n```bash\nskrr tasks deliverable add <task-id> \\\n file/markdown:docs/reviews/report.md@docs/reviews/report.md \\\n --status in_review\n```\n\nA recording made by its producer is always self-reported; the caller cannot promote itself to a\nHuman confirmation, system observation, or provider receipt. A local path is only local availability. A commit, provider revision, digest, or managed object\nfreezes the exact version. Do not call “in the conversation” a Deliverable.\n\nA Human confirms the exact linked version, not a retyped URL or name:\n\n```bash\nskrr tasks deliverable confirm <task-id> <task-resource-link-id> --reason \"Opened and checked this exact version\"\n```\n\n### Result and Review are separate\n\nSubmit the finished answer once:\n\n```bash\nskrr tasks result submit <task-id> \\\n --summary \"NO-SHIP until remediation Gates A-D pass\" \\\n --conclusion-type release_recommendation \\\n --conclusion-json '{\"posture\":\"no_ship\"}' \\\n --deliverable <task-resource-link-id>\n```\n\nAn amendment creates a new Result version and explicitly supersedes the previous one. There is one\ncurrent Result; old versions remain in Activity and are not ordinary Updates.\n\nOnly another actor records acceptance, against that exact Result:\n\n```bash\nskrr tasks review <task-id> --result-id <result-id> --decision accepted --rationale \"Evidence checked\"\n```\n\n“Accepted” means the submitted work was accepted. NO-SHIP, BUY, REJECT, root cause, experiment\ndecision, and similar subject-matter conclusions belong in `Result.conclusion`, never in Review.\n\nUse `skrr tasks complete` only when submitting the Result and advancing workflow in one closeout.\nDo not call `tasks report` before or after it; `tasks complete` already creates the canonical Result.\n\nSubmitting a Result is not the same as closing the Task, and being an Agent is not by itself a\nreason to stop. Closing is always the closer's call — unmet Expectations or a Changes-requested\nReview do not prevent it; they are RECORDED on the close (`resolution.closure`), so closing over\nthem hides nothing and settles nothing. The one exception is an owner-declared required Review\n(`--review-policy required`): a non-owner cannot close without it — unless they close with\n`--force`, which records the override on the resolution — and the owner always can.\n\nSo do not predict the outcome. `result submit` reports where the Task stands after the write —\nread that, and if you need to ask again later:\n\n```bash\nskrr tasks expectations <task-id> # what is owed, and why the Result cannot be accepted yet\n```\n\nSay “ready for review” only when something you read actually said so.\n\n### Expectations\n\nExpectations are free text first. A typed check explains how the statement can be assessed; it never\nreplaces the sentence.\n\nAn Expectation is an obligation, not a lock: it does not stop a close, it is recorded on one — and\nclosing over it settles nothing. Write each one so it can\nbe judged — say what would satisfy it and how that could be checked — because an Expectation authored\nwithout a thought about verification is one you will later be unable to settle honestly. When you\ncreate several across several Tasks, say how many you created and who they fall to; a set of gates\nnobody was told about is work assigned by accident. A Deliverable requirement is one typed Expectation, not a second\n`requiredDeliverables` list. Actual Deliverables are recorded only after something exists.\n\nRead what is owed, then settle it — never rewrite the declaration to make it settleable:\n\n```bash\nskrr tasks expectations <task-id> # what is owed, and how far each one got\nskrr tasks expectations assess <task-id> <expectation-id> \\\n --decision met \\\n --reason \"Ran the suite named in the statement; 49/49 pass\" \\\n --evidence code:<commit>\nskrr tasks expectations assess <task-id> --all \\\n --decision met --reason \"...\" # every one still awaiting a judgement\n```\n\n**You may assess any Expectation that takes a judgement.** A `deliverable` Expectation is not one —\nit settles through its linked Resource and evidence, so record the Deliverable rather than\nassessing it. The assessment is recorded as YOURS — every surface shows `met (agent)` against\n`met (person)` — and a human can override it. The control is attribution, not permission, so what\nyou owe is not restraint but evidence: cite what you actually checked, and prefer `--evidence` and\n`--resource-link-id` over prose.\n\nAssess what you VERIFIED. Not what you intended, not what you inferred from having finished the\nwork. “I could not check this” is a real and useful answer — record it `unmet` with the reason\nrather than leaving it silent, because an unassessed Expectation and one you tried and failed to\nverify send the next reader to different places.\n\nA waiver is a judgement about scope — that this is no longer owed — and it stays a person's call:\nif the honest answer is \"this should be waived,\" say so in an Update or Comment and let a person\nrecord it. Do not delete the Expectation to hide that it was owed.\n\nChanging an Expectation's wording advances the Task specification and **revokes every assessment\nalready recorded** — fix the statement before people start settling it, not after.\n\n### Labels — say what PROGRAM this belongs to\n\nA label is cross-cutting classification: which recurring program a Space or Task\nbelongs to (`dogfood`, `incident`, `experiment`, `migration`), not what state it\nis in. Status, priority and assignee are first-class fields and already answer\ntheir own questions — a label that restates one is noise that will drift out of\nsync with the field it copies.\n\nThe vocabulary is DECLARED, not invented. Read it before you use it:\n\n```bash\nskrr labels list\n```\n\nAttach from that list, never a name you made up. A second spelling of an\nexisting label (`dog-food` beside `dogfood`) is worse than no label at all,\nbecause the whole value of one is that filtering on it returns everything:\n\n```bash\nskrr spaces labels add <space-id> --label <label-id>\nskrr tasks labels attach <task-id> --label <label-id>\n```\n\nCreate a label only when the program it names is real and recurring, and say\nwhich entities it applies to — a label created without `--applicable-to space`\ncannot be attached to a Space, which is how a vocabulary comes to exist that\nnothing can use:\n\n```bash\nskrr labels create --name <name> --applicable-to space --applicable-to task\n```\n\nWhen you create a Space or Task for a recurring program, label it as you create\nit (`--label <id>` on `spaces`, `tasks` and `goals create`). The create\nresponse carries a `_labelGuidance` hint naming the applicable vocabulary WITH\nITS IDS when you attached none — read it, and attach in one follow-up call if\none of them fits. It may also carry `suggested` — a proposal, not a decision;\nattach is your call. `skrr tasks labels suggest <task-id>` asks it of a Task.\n\nIf nothing in the vocabulary fits, attach nothing. \"No label\" is a correct\nanswer and a wrong label is not.\n\n### Comments and blockers\n\nUse a Comment only for a question, answer, or review discussion where a reply is useful. For a\nblocker, first record the typed blocker Update, then move the Task to blocked. Add a Comment only if\nsomeone actually needs to respond.\n\n### Creating and placing Tasks\n\nCreate a Task without asking when work needs tracking across meaningful steps, sessions, or\nfollow-up. Avoid duplicates and do not create Tasks for trivial actions that finish immediately.\n\n```bash\nskrr tasks list --q \"<relevant title>\"\nskrr tasks create --title \"<concise requested result>\" --description \"<scope and constraints>\" --json\nskrr tasks move <task-id> --status in_progress\n```\n\nA Space is a durable ownership, collaboration, and authorization boundary. Use an identified Space\nwhen the work clearly belongs there; otherwise create the Task unscoped. Ask before creating a new\nSpace. An Agent works a Task in a Space only as a Space member, or when it is shared with no one\nelse and its owner assigns and starts it; anything else is refused. Do not widen Agent membership\nmerely to force one task assignment.\n\n### Closing a Task out\n\nThe model above says what each record IS. This is the order they go in, and what each step can\nrefuse:\n\n1. **Record what exists** — `skrr tasks deliverable add`, binding it to the Expectation it answers\n with `--expectation <id>` whenever one applies. Evidence that arrives bound is evidence the next\n reader does not have to reconstruct.\n2. **Submit the answer** — `skrr tasks result submit`. This does not close the Task. Read what it\n reports back.\n3. **Read what is still owed** — `skrr tasks expectations <task-id>`.\n4. **Settle what you verified** — `skrr tasks expectations assess`, citing evidence. `--all` covers\n every Expectation still awaiting a judgement.\n5. **Read the Task state again and report THAT** — not what you intended it to be.\n\nTwo things still matter regardless of how complete the work is: an unmet Expectation, and a\n`changes_requested` Review. Neither blocks a close — but both are stamped onto it\n(`resolution.closure`), so closing over them is a recorded choice, not a clean finish. Neither is\na failure state; both are somebody's turn.\n\nStep 5 is the one that goes wrong quietly, and not only here: before reporting a check as passed,\nconfirm you measured what you think you measured. A pipeline's exit status is the LAST command's, so\n`cmd | tail` reports on `tail`. A filter may match something other than what you meant — a path\npattern can match the directory you are working in. When a result will be reported to a person as\nfact, re-run it in the simplest form that can only mean one thing.\n\nAcross a whole Space, `skrr tasks review-queue --space <space-id>` names every outstanding\njudgement at once, with its evidence and the command that settles it.\n\n### Share readable links and close the loop\n\nShare clickable Task, Space, Goal, and Duty URLs, never bare IDs. Use the URL returned by the\nCLI; do not construct one. If needed:\n\n```bash\nskrr tasks show <task-id> --json\nskrr spaces show <space-id> --json\nskrr goals show <goal-id> --json\nskrr duties show <duty-id> --json\n```\n\nBefore your final response, verify every Task you created or touched reflects reality. If work is\nready for independent review, leave it in review. If blocked, record the blocker and required action.\nIf genuinely complete and accepted under the Task's policy, close it. Include the Task URL in the\nfinal handoff. Never claim a write succeeded unless the CLI returned success.\n\n### Coming back later\n\nYou can arrange to return to something. Four shapes, and picking the right one\nmatters more than the wording:\n\n**Reminder** — the user asked to be reminded. Keep their words; a reminder you\nhave rephrased into your own voice is no longer the thing they asked for.\n\n**Watch** — something has an asynchronous tail: CI, a review, an approval, a\nlong job, a metric. If the condition is machine-checkable (an endpoint plus a\npredicate), say so — that costs nothing and is guaranteed to terminate. Only\nwrite a prose check recipe when the check genuinely needs your judgement or your\ntools, because that one burns a full turn every time it runs. Always give it an\nabort condition: a watch that cannot stop is a leak.\n\n**Check-in** — you decided the conversation is worth returning to. This is\npermission AND restraint. Come back when you will have something worth saying —\na result that will have arrived, a decision that will be ripe, a thread you left\ngenuinely open. When you see one, arrange the return yourself and say in one\nline when you will look again. Do not ask whether you should: that hands the\nperson a decision they did not come to make. Do not come back to ask how it is\ngoing. A legacy check-in holds one pending return per conversation. For a sequence\nof checks, use one scheduled lookback plan with 1–10 lifetime steps. When you\nwake, read the original goal, current state and earlier outcomes. Saying\nnothing is a legitimate outcome and often the right one. Stop or cancel\nremaining checks when the work resolves, becomes obsolete or the person cancels.\n\n**Act** — a specific action you already know how to take and the user has already\nagreed to. Not for anything you would still need to ask about.\n\nSettle what you arranged. When you wake and the thing resolved, say so and close\nit out; when it did not, either come back once more with a reason or hand it to\nthe person. Leaving one armed forever is the failure mode here.\n\nFrom a local session, arrange these with `skrr followups` —\n`remind`, `watch`, `checkin`, `act` — and settle them with\n`skrr followups resolve <id> --outcome resolved`.\nFor a bounded lookback plan, use `skrr followups plans create --from-json plan.json`\nand inspect, revise or cancel it with `skrr followups plans` (read `--help`).\nUse 1–10 concrete checks, relative offsets from the completed reply or explicit\nabsolute/local times, and a stop condition. Omit a plan when none is useful.\nA saved plan is not necessarily armed; read the returned receipt before promising a return.\n",
|
|
7
7
|
"hash": "6804d01c68782b97a16920c43f6b9104a8b0c0a512514b25a7622b371055f669"
|
|
8
8
|
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { ResolvedCredential } from './credential-resolver';
|
|
2
|
+
export type ActivityScope = 'user' | 'agent' | 'duty';
|
|
3
|
+
export interface ActivitySourceRef {
|
|
4
|
+
kind: string;
|
|
5
|
+
keys: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface ActivityItem {
|
|
8
|
+
id: string;
|
|
9
|
+
sourceKind: string;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
status: string;
|
|
12
|
+
title: string;
|
|
13
|
+
sourceRef: ActivitySourceRef;
|
|
14
|
+
agentId?: string;
|
|
15
|
+
dutyId?: string;
|
|
16
|
+
/** Task executions only: what the ledger proves about handing the run to its executor. */
|
|
17
|
+
dispatch?: {
|
|
18
|
+
state: string;
|
|
19
|
+
};
|
|
20
|
+
runtime?: {
|
|
21
|
+
state: string;
|
|
22
|
+
selectedMachineProduct?: string;
|
|
23
|
+
/** The resolver's trace of the targets it weighed (the table shows how many, `--json` the rest). */
|
|
24
|
+
considered?: Array<{
|
|
25
|
+
index: number;
|
|
26
|
+
outcome: string;
|
|
27
|
+
machineProduct?: string;
|
|
28
|
+
category?: string;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
content?: {
|
|
32
|
+
state: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface ActivityResponse {
|
|
36
|
+
object: 'agent_activity';
|
|
37
|
+
scope: ActivityScope;
|
|
38
|
+
items: ActivityItem[];
|
|
39
|
+
hasMore: boolean;
|
|
40
|
+
nextCursor: string | null;
|
|
41
|
+
ordering: string;
|
|
42
|
+
coverage: Array<{
|
|
43
|
+
source: string;
|
|
44
|
+
state: string;
|
|
45
|
+
reason?: string;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
/** The API authorizes each source; a source reference is never an access grant. */
|
|
49
|
+
export declare function listAgentActivity(options: {
|
|
50
|
+
scope: ActivityScope;
|
|
51
|
+
agentId?: string;
|
|
52
|
+
dutyId?: string;
|
|
53
|
+
limit?: number;
|
|
54
|
+
cursor?: string;
|
|
55
|
+
}, credential?: ResolvedCredential): Promise<ActivityResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Show source keys without synthesizing commands from untrusted identifiers.
|
|
58
|
+
* Whether details are available depends on the individual source.
|
|
59
|
+
*/
|
|
60
|
+
export declare function sourceLabel(ref: ActivitySourceRef | undefined): string;
|
|
61
|
+
/**
|
|
62
|
+
* The RUNTIME cell: the placement state, then what the server knows beyond it. A run says where it
|
|
63
|
+
* was bound and how many targets the resolver weighed; a Task execution says what its hand-off
|
|
64
|
+
* proves. A queue acknowledgement is acceptance, never a provider start, so it is worded as such.
|
|
65
|
+
* Every value is untrusted text and goes through `formatCell`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function runtimeCell(item: ActivityItem): string;
|
|
68
|
+
/** The activity table, shared by the feed and the older-activity scans so the two never drift. */
|
|
69
|
+
export declare function renderActivityItems(items: ActivityItem[], log: (line: string) => void): void;
|
|
70
|
+
export declare function renderAgentActivity(response: ActivityResponse, log: (line: string) => void): void;
|
|
71
|
+
export type ActivityScanSource = 'chat' | 'group-chat';
|
|
72
|
+
export interface ActivityScanResponse {
|
|
73
|
+
object: string;
|
|
74
|
+
items: ActivityItem[];
|
|
75
|
+
/** Absent when the server cannot continue the scan. */
|
|
76
|
+
scanOlderCursor?: string;
|
|
77
|
+
ordering?: string;
|
|
78
|
+
/** One object, unlike the feed's per-source array. */
|
|
79
|
+
coverage: {
|
|
80
|
+
source?: string;
|
|
81
|
+
state: string;
|
|
82
|
+
reason?: string;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Scan for older chat replies (yours) or older group replies. Agent-scoped group scans are not
|
|
87
|
+
* offered: the API answers them with an empty list and `unsupported` coverage, because historical
|
|
88
|
+
* agent identities cannot be verified, and the web says so instead of calling it.
|
|
89
|
+
*/
|
|
90
|
+
export declare function scanOlderActivity(options: {
|
|
91
|
+
source: ActivityScanSource;
|
|
92
|
+
limit?: number;
|
|
93
|
+
cursor?: string;
|
|
94
|
+
}, credential?: ResolvedCredential): Promise<unknown>;
|
|
95
|
+
/**
|
|
96
|
+
* Accept a response only if it has the documented shape. A body that merely LOOKS empty (a proxy
|
|
97
|
+
* page, a server that answers a different contract) must not render as "no older activity": that is
|
|
98
|
+
* the reading that would reassure about exactly what a scan exists to find.
|
|
99
|
+
*/
|
|
100
|
+
export declare function parseActivityScan(source: ActivityScanSource, value: unknown): ActivityScanResponse | null;
|
|
101
|
+
export declare function renderActivityScan(source: ActivityScanSource, response: ActivityScanResponse, log: (line: string) => void): void;
|
|
102
|
+
export interface GroupChatActivityDetail {
|
|
103
|
+
object: string;
|
|
104
|
+
source?: {
|
|
105
|
+
kind?: string;
|
|
106
|
+
groupChatId?: string;
|
|
107
|
+
responseMessageId?: string;
|
|
108
|
+
};
|
|
109
|
+
input?: {
|
|
110
|
+
availability?: string;
|
|
111
|
+
reason?: string;
|
|
112
|
+
};
|
|
113
|
+
output: {
|
|
114
|
+
kind?: string;
|
|
115
|
+
/** `complete`, `partial`, `pending` or `unavailable`; anything else is printed as itself. */
|
|
116
|
+
availability: string;
|
|
117
|
+
fidelity?: string;
|
|
118
|
+
text?: string;
|
|
119
|
+
/** Set when `text` was cut to the server's limit. */
|
|
120
|
+
originalLength?: number;
|
|
121
|
+
};
|
|
122
|
+
outputCoverage?: string;
|
|
123
|
+
fullProviderPrompt?: {
|
|
124
|
+
availability?: string;
|
|
125
|
+
reason?: string;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* One Group reply, opened through the API that owns it. The caller needs current READ on the group
|
|
130
|
+
* at the reply's original time; an id that does not resolve and one the caller may not see answer
|
|
131
|
+
* the same 404.
|
|
132
|
+
*/
|
|
133
|
+
export declare function getGroupChatActivityDetail(ref: {
|
|
134
|
+
groupChatId: string;
|
|
135
|
+
messageId: string;
|
|
136
|
+
}, credential?: ResolvedCredential): Promise<unknown>;
|
|
137
|
+
/**
|
|
138
|
+
* A reply whose text is `complete` or `partial` must carry that text. Without it the response is
|
|
139
|
+
* not the documented shape, and printing "Empty message" would say something the server did not.
|
|
140
|
+
*/
|
|
141
|
+
export declare function parseGroupChatActivityDetail(value: unknown): GroupChatActivityDetail | null;
|
|
142
|
+
/**
|
|
143
|
+
* What to tell the caller when a Group reply answers 404. The API gives one answer to "no such
|
|
144
|
+
* reply", "you may not read it" and "the workspace is not the Group's own", on purpose, so the
|
|
145
|
+
* caller cannot probe for existence. It does check the workspace by EXACT match
|
|
146
|
+
* (`groupChatContent.usableGroup`: the Group's `workspaceId` must equal the request's, both
|
|
147
|
+
* absent included), and the CLI is the only party that knows what the request named, so it can
|
|
148
|
+
* name the one cause the caller can act on without revealing which of the three it was.
|
|
149
|
+
*/
|
|
150
|
+
export declare function groupReplyUnavailable(sentWorkspaceId: string | null | undefined): {
|
|
151
|
+
message: string;
|
|
152
|
+
suggestion: string;
|
|
153
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listAgentActivity = listAgentActivity;
|
|
4
|
+
exports.sourceLabel = sourceLabel;
|
|
5
|
+
exports.runtimeCell = runtimeCell;
|
|
6
|
+
exports.renderActivityItems = renderActivityItems;
|
|
7
|
+
exports.renderAgentActivity = renderAgentActivity;
|
|
8
|
+
exports.scanOlderActivity = scanOlderActivity;
|
|
9
|
+
exports.parseActivityScan = parseActivityScan;
|
|
10
|
+
exports.renderActivityScan = renderActivityScan;
|
|
11
|
+
exports.getGroupChatActivityDetail = getGroupChatActivityDetail;
|
|
12
|
+
exports.parseGroupChatActivityDetail = parseGroupChatActivityDetail;
|
|
13
|
+
exports.groupReplyUnavailable = groupReplyUnavailable;
|
|
14
|
+
const api_fetch_1 = require("./api-fetch");
|
|
15
|
+
const format_1 = require("./format");
|
|
16
|
+
const search_display_1 = require("./search-display");
|
|
17
|
+
/** The API authorizes each source; a source reference is never an access grant. */
|
|
18
|
+
function listAgentActivity(options, credential) {
|
|
19
|
+
const query = new URLSearchParams({ scope: options.scope });
|
|
20
|
+
if (options.agentId)
|
|
21
|
+
query.set('agentId', options.agentId);
|
|
22
|
+
if (options.dutyId)
|
|
23
|
+
query.set('dutyId', options.dutyId);
|
|
24
|
+
if (options.limit !== undefined)
|
|
25
|
+
query.set('limit', String(options.limit));
|
|
26
|
+
if (options.cursor)
|
|
27
|
+
query.set('cursor', options.cursor);
|
|
28
|
+
return (0, api_fetch_1.apiFetch)(`/api/agent-activity?${query.toString()}`, { credential });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Show source keys without synthesizing commands from untrusted identifiers.
|
|
32
|
+
* Whether details are available depends on the individual source.
|
|
33
|
+
*/
|
|
34
|
+
function sourceLabel(ref) {
|
|
35
|
+
if (!ref?.keys || typeof ref.keys !== 'object')
|
|
36
|
+
return 'unavailable';
|
|
37
|
+
const pairs = Object.entries(ref.keys).map(([key, value]) => `${key}=${(0, format_1.formatCell)(value)}`);
|
|
38
|
+
return pairs.length ? pairs.join(' ') : 'unavailable';
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The RUNTIME cell: the placement state, then what the server knows beyond it. A run says where it
|
|
42
|
+
* was bound and how many targets the resolver weighed; a Task execution says what its hand-off
|
|
43
|
+
* proves. A queue acknowledgement is acceptance, never a provider start, so it is worded as such.
|
|
44
|
+
* Every value is untrusted text and goes through `formatCell`.
|
|
45
|
+
*/
|
|
46
|
+
function runtimeCell(item) {
|
|
47
|
+
const runtime = item.runtime;
|
|
48
|
+
const parts = [(0, format_1.formatCell)(runtime?.state, 'unknown')];
|
|
49
|
+
if (runtime?.selectedMachineProduct)
|
|
50
|
+
parts.push((0, format_1.formatCell)(runtime.selectedMachineProduct));
|
|
51
|
+
const considered = runtime?.considered;
|
|
52
|
+
const weighed = Array.isArray(considered) ? considered.length : 0;
|
|
53
|
+
if (weighed > 1 || (weighed === 1 && runtime?.state === 'not_bound')) {
|
|
54
|
+
parts.push(`${weighed} weighed`);
|
|
55
|
+
}
|
|
56
|
+
const handoff = item.dispatch?.state;
|
|
57
|
+
if (handoff && handoff !== 'unknown')
|
|
58
|
+
parts.push(`hand-off ${(0, format_1.formatCell)(handoff)}`);
|
|
59
|
+
return parts.join(' · ');
|
|
60
|
+
}
|
|
61
|
+
/** The activity table, shared by the feed and the older-activity scans so the two never drift. */
|
|
62
|
+
function renderActivityItems(items, log) {
|
|
63
|
+
(0, format_1.renderTable)(items.map((item) => ({
|
|
64
|
+
when: (0, format_1.localTime)(item.timestamp),
|
|
65
|
+
source: (0, format_1.formatCell)(item.sourceKind),
|
|
66
|
+
status: (0, format_1.formatCell)(item.status, 'unknown'),
|
|
67
|
+
title: (0, format_1.formatCell)(item.title),
|
|
68
|
+
reference: sourceLabel(item.sourceRef),
|
|
69
|
+
runtime: runtimeCell(item),
|
|
70
|
+
content: (0, format_1.formatCell)(item.content?.state, 'unknown'),
|
|
71
|
+
})), [
|
|
72
|
+
{ key: 'when', header: 'WHEN' },
|
|
73
|
+
{ key: 'source', header: 'SOURCE' },
|
|
74
|
+
{ key: 'status', header: 'STATUS' },
|
|
75
|
+
{ key: 'title', header: 'ACTIVITY', maxWidth: 36 },
|
|
76
|
+
{ key: 'reference', header: 'SOURCE REFERENCE', verbatim: true },
|
|
77
|
+
{ key: 'runtime', header: 'RUNTIME' },
|
|
78
|
+
{ key: 'content', header: 'CONTENT' },
|
|
79
|
+
], log);
|
|
80
|
+
}
|
|
81
|
+
function renderAgentActivity(response, log) {
|
|
82
|
+
log(`Activity · ${response.scope}`);
|
|
83
|
+
const items = Array.isArray(response.items) ? response.items : [];
|
|
84
|
+
if (items.length) {
|
|
85
|
+
renderActivityItems(items, log);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
log('No activity returned for the available sources.');
|
|
89
|
+
}
|
|
90
|
+
// No result from a source that failed or is not implemented is not proof of
|
|
91
|
+
// no activity. Always print the server's coverage, even on an empty page.
|
|
92
|
+
if (items.length) {
|
|
93
|
+
log('');
|
|
94
|
+
log('Detail: activity show --trigger <triggerId> --fire <occurrenceId>,');
|
|
95
|
+
log(' or activity show --duty <dutyId>.');
|
|
96
|
+
log('Task run content is not connected to Activity; open the Task for its authorized history.');
|
|
97
|
+
log('Chat source: messages show <conversationId> <messageId> (subject to conversation access).');
|
|
98
|
+
log('Group reply: activity show --group-chat <groupChatId> --message <messageId>.');
|
|
99
|
+
log('Older chat or group rows the feed does not page to: activity scan-older chat|group-chat.');
|
|
100
|
+
}
|
|
101
|
+
log('');
|
|
102
|
+
const coverage = Array.isArray(response.coverage) ? response.coverage : [];
|
|
103
|
+
if (!coverage.length)
|
|
104
|
+
log('Coverage: unknown');
|
|
105
|
+
else {
|
|
106
|
+
log('Coverage:');
|
|
107
|
+
for (const item of coverage) {
|
|
108
|
+
log(` ${(0, format_1.formatCell)(item.source)}: ${(0, format_1.formatCell)(item.state, 'unknown')}${item.reason ? ` (${(0, format_1.formatCell)(item.reason)})` : ''}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (response.hasMore && response.nextCursor) {
|
|
112
|
+
log('');
|
|
113
|
+
log(`Next cursor: ${response.nextCursor}`);
|
|
114
|
+
log('Pass this cursor with the same scope and filters to read the next page.');
|
|
115
|
+
}
|
|
116
|
+
else if (response.hasMore) {
|
|
117
|
+
log('');
|
|
118
|
+
log('More activity may be available, but the server did not return a cursor.');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const SCAN_OBJECT = {
|
|
122
|
+
chat: 'personal_chat_activity_scan',
|
|
123
|
+
'group-chat': 'group_chat_activity_scan',
|
|
124
|
+
};
|
|
125
|
+
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
126
|
+
/**
|
|
127
|
+
* Scan for older chat replies (yours) or older group replies. Agent-scoped group scans are not
|
|
128
|
+
* offered: the API answers them with an empty list and `unsupported` coverage, because historical
|
|
129
|
+
* agent identities cannot be verified, and the web says so instead of calling it.
|
|
130
|
+
*/
|
|
131
|
+
function scanOlderActivity(options, credential) {
|
|
132
|
+
const query = new URLSearchParams();
|
|
133
|
+
if (options.source === 'group-chat')
|
|
134
|
+
query.set('scope', 'user');
|
|
135
|
+
if (options.limit !== undefined)
|
|
136
|
+
query.set('limit', String(options.limit));
|
|
137
|
+
if (options.cursor)
|
|
138
|
+
query.set('cursor', options.cursor);
|
|
139
|
+
return options.source === 'chat'
|
|
140
|
+
? (0, api_fetch_1.apiFetch)(`/api/agent-activity/chat/scan-older?${query.toString()}`, { credential })
|
|
141
|
+
: (0, api_fetch_1.apiFetch)(`/api/agent-activity/group-chat/scan-older?${query.toString()}`, {
|
|
142
|
+
credential,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Accept a response only if it has the documented shape. A body that merely LOOKS empty (a proxy
|
|
147
|
+
* page, a server that answers a different contract) must not render as "no older activity": that is
|
|
148
|
+
* the reading that would reassure about exactly what a scan exists to find.
|
|
149
|
+
*/
|
|
150
|
+
function parseActivityScan(source, value) {
|
|
151
|
+
if (!isRecord(value) || value.object !== SCAN_OBJECT[source])
|
|
152
|
+
return null;
|
|
153
|
+
if (!Array.isArray(value.items) || !value.items.every(isRecord))
|
|
154
|
+
return null;
|
|
155
|
+
if (!isRecord(value.coverage) || typeof value.coverage.state !== 'string')
|
|
156
|
+
return null;
|
|
157
|
+
if (value.scanOlderCursor !== undefined && typeof value.scanOlderCursor !== 'string')
|
|
158
|
+
return null;
|
|
159
|
+
return value;
|
|
160
|
+
}
|
|
161
|
+
function renderActivityScan(source, response, log) {
|
|
162
|
+
const label = source === 'chat' ? 'chat' : 'group';
|
|
163
|
+
log(`Earlier ${label} activity`);
|
|
164
|
+
if (response.items.length) {
|
|
165
|
+
renderActivityItems(response.items, log);
|
|
166
|
+
log('');
|
|
167
|
+
log(source === 'chat'
|
|
168
|
+
? 'Chat source: messages show <conversationId> <messageId> (subject to conversation access).'
|
|
169
|
+
: 'Group reply: activity show --group-chat <groupChatId> --message <messageId>.');
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
log(`No additional visible ${label} activity was found in this scan.`);
|
|
173
|
+
}
|
|
174
|
+
// Never present a scan as complete: say what it is, and print the server's own coverage.
|
|
175
|
+
log('');
|
|
176
|
+
log(source === 'chat'
|
|
177
|
+
? 'A scan is a separate, bounded read of older chat replies. Its cursor is not a global time order or a has-more signal, and some history may be unavailable.'
|
|
178
|
+
: 'Groups are scanned separately, not in global time order. Some history may be unavailable.');
|
|
179
|
+
const coverage = response.coverage;
|
|
180
|
+
log(`Coverage: ${(0, format_1.formatCell)(coverage.source, label)}: ${(0, format_1.formatCell)(coverage.state, 'unknown')}${coverage.reason ? ` (${(0, format_1.formatCell)(coverage.reason)})` : ''}`);
|
|
181
|
+
log('');
|
|
182
|
+
const cursor = response.scanOlderCursor;
|
|
183
|
+
if (!cursor) {
|
|
184
|
+
log('The server returned no cursor, so this scan cannot be continued.');
|
|
185
|
+
}
|
|
186
|
+
else if (!(0, search_display_1.isPrintableSearchCursor)(cursor)) {
|
|
187
|
+
log('The server returned a cursor that cannot be printed safely; read it with --json.');
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
log(`Next scan cursor: ${cursor}`);
|
|
191
|
+
log('Pass it with --cursor to scan further back. A scan with no rows does not prove nothing older exists.');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* One Group reply, opened through the API that owns it. The caller needs current READ on the group
|
|
196
|
+
* at the reply's original time; an id that does not resolve and one the caller may not see answer
|
|
197
|
+
* the same 404.
|
|
198
|
+
*/
|
|
199
|
+
function getGroupChatActivityDetail(ref, credential) {
|
|
200
|
+
return (0, api_fetch_1.apiFetch)(`/api/agent-activity/group-chat/${encodeURIComponent(ref.groupChatId)}/${encodeURIComponent(ref.messageId)}`, { credential });
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* A reply whose text is `complete` or `partial` must carry that text. Without it the response is
|
|
204
|
+
* not the documented shape, and printing "Empty message" would say something the server did not.
|
|
205
|
+
*/
|
|
206
|
+
function parseGroupChatActivityDetail(value) {
|
|
207
|
+
if (!isRecord(value) || value.object !== 'group_chat_activity_detail')
|
|
208
|
+
return null;
|
|
209
|
+
const output = value.output;
|
|
210
|
+
if (!isRecord(output) || typeof output.availability !== 'string')
|
|
211
|
+
return null;
|
|
212
|
+
if ((output.availability === 'complete' || output.availability === 'partial') &&
|
|
213
|
+
typeof output.text !== 'string')
|
|
214
|
+
return null;
|
|
215
|
+
if (output.text !== undefined && typeof output.text !== 'string')
|
|
216
|
+
return null;
|
|
217
|
+
if (output.originalLength !== undefined && typeof output.originalLength !== 'number')
|
|
218
|
+
return null;
|
|
219
|
+
return value;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* What to tell the caller when a Group reply answers 404. The API gives one answer to "no such
|
|
223
|
+
* reply", "you may not read it" and "the workspace is not the Group's own", on purpose, so the
|
|
224
|
+
* caller cannot probe for existence. It does check the workspace by EXACT match
|
|
225
|
+
* (`groupChatContent.usableGroup`: the Group's `workspaceId` must equal the request's, both
|
|
226
|
+
* absent included), and the CLI is the only party that knows what the request named, so it can
|
|
227
|
+
* name the one cause the caller can act on without revealing which of the three it was.
|
|
228
|
+
*/
|
|
229
|
+
function groupReplyUnavailable(sentWorkspaceId) {
|
|
230
|
+
const sent = sentWorkspaceId?.trim();
|
|
231
|
+
return {
|
|
232
|
+
message: 'That Group reply is unavailable: it does not exist, you cannot read it, ' +
|
|
233
|
+
(sent
|
|
234
|
+
? `or the Group is not in workspace ${sent}, which this request named. `
|
|
235
|
+
: 'or the Group belongs to a workspace and this request named none. ') +
|
|
236
|
+
'The server answers all of these the same way.',
|
|
237
|
+
suggestion: 'A Group in a workspace is found only when that workspace is named (--workspace <workspace-id>, ' +
|
|
238
|
+
'or `skrr workspaces use <workspace-id>`); a Group outside any workspace only when none is. ' +
|
|
239
|
+
'`skrr workspaces list` shows yours.',
|
|
240
|
+
};
|
|
241
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AlwaysOnExecutionReadiness } from '@skrr-ai/data-provider';
|
|
1
2
|
/**
|
|
2
3
|
* Where an Always-On Agent's work has to run, as `skrr agents always-on status`
|
|
3
4
|
* prints it (OSK-22347).
|
|
@@ -28,4 +29,12 @@ export declare function runtimeFromAgent(agent: AgentRuntimeFields | null | unde
|
|
|
28
29
|
export declare const RUNTIME_READ_FAILED: AlwaysOnRuntimeRead;
|
|
29
30
|
/** Lines to print under `Operational:`; empty when there is no machine involved. */
|
|
30
31
|
export declare function runtimeLines(runtime: AlwaysOnRuntimeRead, desiredEnabled: boolean): string[];
|
|
32
|
+
/**
|
|
33
|
+
* One line when Always-On is wanted and the status read says the machine is online but its Skrr
|
|
34
|
+
* cannot run the Agent's scheduled work (`capability_missing`), and nothing otherwise. Any other
|
|
35
|
+
* reason an execution target is `blocked` has its own lines or none here, a server that did not
|
|
36
|
+
* send the field says nothing either way, and an Agent that is off has no scheduled work to fail.
|
|
37
|
+
* The words are the server's (fixed platform text, never a machine's).
|
|
38
|
+
*/
|
|
39
|
+
export declare function executionReadinessLines(readiness: AlwaysOnExecutionReadiness | null | undefined, desiredEnabled: boolean): string[];
|
|
31
40
|
export {};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RUNTIME_READ_FAILED = void 0;
|
|
4
4
|
exports.runtimeFromAgent = runtimeFromAgent;
|
|
5
5
|
exports.runtimeLines = runtimeLines;
|
|
6
|
+
exports.executionReadinessLines = executionReadinessLines;
|
|
6
7
|
function runtimeFromAgent(agent) {
|
|
7
8
|
// An Agent with no harness runs in the cloud: there is no machine to be off.
|
|
8
9
|
if (!agent || !agent.harnessId)
|
|
@@ -37,3 +38,22 @@ function runtimeLines(runtime, desiredEnabled) {
|
|
|
37
38
|
return [`Runtime: online${label}`];
|
|
38
39
|
return [`Runtime: unknown${runtime.readFailed ? ' (could not read the Agent)' : label}`];
|
|
39
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* One line when Always-On is wanted and the status read says the machine is online but its Skrr
|
|
43
|
+
* cannot run the Agent's scheduled work (`capability_missing`), and nothing otherwise. Any other
|
|
44
|
+
* reason an execution target is `blocked` has its own lines or none here, a server that did not
|
|
45
|
+
* send the field says nothing either way, and an Agent that is off has no scheduled work to fail.
|
|
46
|
+
* The words are the server's (fixed platform text, never a machine's).
|
|
47
|
+
*/
|
|
48
|
+
function executionReadinessLines(readiness, desiredEnabled) {
|
|
49
|
+
if (!desiredEnabled || readiness?.state !== 'blocked')
|
|
50
|
+
return [];
|
|
51
|
+
const constraints = Array.isArray(readiness.constraints) ? readiness.constraints : [];
|
|
52
|
+
const missing = constraints.find((c) => c?.code === 'capability_missing');
|
|
53
|
+
if (!missing)
|
|
54
|
+
return [];
|
|
55
|
+
const text = [missing.message, missing.requiredAction]
|
|
56
|
+
.filter((part) => typeof part === 'string' && part.length > 0)
|
|
57
|
+
.join(' ');
|
|
58
|
+
return [`Execution: blocked${text ? ` — ${text}` : ''}`];
|
|
59
|
+
}
|
package/dist/lib/api-fetch.d.ts
CHANGED
|
@@ -14,6 +14,16 @@ export interface ApiFetchOptions {
|
|
|
14
14
|
* without one.
|
|
15
15
|
*/
|
|
16
16
|
headers?: Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* A body sent as it is: the bytes of a file, with `Content-Type: application/octet-stream`, not JSON (Dynamic Agent Apps'
|
|
19
|
+
* upload door for an image or a font). Used INSTEAD of `body`; a caller that passes both gets the raw bytes.
|
|
20
|
+
*/
|
|
21
|
+
rawBody?: Uint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* What the answer is. `json` (the default) is what every endpoint here returns; `bytes` returns the response body as a
|
|
24
|
+
* `Uint8Array` (a download of a file). An error response is read as text and thrown either way.
|
|
25
|
+
*/
|
|
26
|
+
responseAs?: 'json' | 'bytes';
|
|
17
27
|
/**
|
|
18
28
|
* Caller-owned cancellation. Added for OSK-3892: `skrr code`'s managed-session
|
|
19
29
|
* acquisition promises the user ONE bound for the whole handshake, and without
|
package/dist/lib/api-fetch.js
CHANGED
|
@@ -130,8 +130,12 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
130
130
|
// (tasks attachments) need this on the session-scoped path, which is not
|
|
131
131
|
// in dataService.
|
|
132
132
|
const isFormData = typeof FormData !== 'undefined' && opts.body instanceof FormData;
|
|
133
|
+
const isRaw = opts.rawBody !== undefined && method !== 'GET';
|
|
133
134
|
let body;
|
|
134
|
-
if (
|
|
135
|
+
if (isRaw) {
|
|
136
|
+
body = opts.rawBody;
|
|
137
|
+
}
|
|
138
|
+
else if (opts.body !== undefined && method !== 'GET') {
|
|
135
139
|
body = isFormData ? opts.body : JSON.stringify(opts.body);
|
|
136
140
|
}
|
|
137
141
|
// Same rule as every `dataService` write (`@skrr-ai/data-provider`
|
|
@@ -182,7 +186,10 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
182
186
|
Accept: 'application/json',
|
|
183
187
|
'X-Oversky-Origin': (0, refresh_1.getCliOrigin)(),
|
|
184
188
|
};
|
|
185
|
-
if (
|
|
189
|
+
if (isRaw) {
|
|
190
|
+
headers['Content-Type'] = 'application/octet-stream';
|
|
191
|
+
}
|
|
192
|
+
else if (opts.body !== undefined && method !== 'GET' && !isFormData) {
|
|
186
193
|
headers['Content-Type'] = 'application/json';
|
|
187
194
|
}
|
|
188
195
|
if (credential.token) {
|
|
@@ -309,6 +316,9 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
309
316
|
error.retryAfterMs = lastRetryAfterMs;
|
|
310
317
|
throw error;
|
|
311
318
|
}
|
|
319
|
+
if (opts.responseAs === 'bytes') {
|
|
320
|
+
return new Uint8Array(await res.arrayBuffer());
|
|
321
|
+
}
|
|
312
322
|
// 204/205 carry no body by definition; an empty body has no content-type
|
|
313
323
|
// worth judging. Neither is an error.
|
|
314
324
|
if (res.status === 204 || res.status === 205) {
|
package/dist/lib/appData.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppPersonDataRefusal, AppStoreConflict, AppStoreDocView, AppStoreQueryResult } from '@skrr-ai/data-provider';
|
|
1
|
+
import type { AppInstallationDataCatalog, AppPersonDataRefusal, AppStoreConflict, AppStoreDocView, AppStoreQueryResult } from '@skrr-ai/data-provider';
|
|
2
2
|
/** Why the input could not be used; never carries what was in it. */
|
|
3
3
|
export declare class AppDataInputError extends Error {
|
|
4
4
|
readonly code: 'APP_DATA_SOURCE' | 'APP_DATA_NOT_JSON' | 'APP_DATA_NOT_OBJECT' | 'APP_DATA_WHERE';
|
|
@@ -27,6 +27,8 @@ export type PersonDataFailure = {
|
|
|
27
27
|
conflict: AppStoreConflict;
|
|
28
28
|
status?: number;
|
|
29
29
|
currentRev?: number;
|
|
30
|
+
/** A batch: which write (by position) could not apply. */
|
|
31
|
+
index?: number;
|
|
30
32
|
};
|
|
31
33
|
/**
|
|
32
34
|
* What the person channel answered, read out of an API error: a refusal (`{ error, code, message }`, the code from
|
|
@@ -56,7 +58,27 @@ export declare function describePersonDataConflict(failure: Extract<PersonDataFa
|
|
|
56
58
|
installation: string;
|
|
57
59
|
collection: string;
|
|
58
60
|
id: string;
|
|
61
|
+
verb?: 'put' | 'patch' | 'delete' | 'batch';
|
|
59
62
|
}, bin: string): string;
|
|
63
|
+
/** The `set` of a patch (a JSON object of path -> value) and the `unset` paths. What a path may be is the server's parser's to say. */
|
|
64
|
+
export declare function readPatchInput(input: {
|
|
65
|
+
set?: string;
|
|
66
|
+
unset?: string[];
|
|
67
|
+
}): {
|
|
68
|
+
set?: Record<string, unknown>;
|
|
69
|
+
unset?: string[];
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* The writes of a batch, from exactly one of `--writes`, `--from-file` and `--stdin`: a JSON list, or `{ "writes": [...] }`.
|
|
73
|
+
* Each write is `{ op: "put" | "patch" | "delete", collection, ... }`; the server's parser says what each may hold.
|
|
74
|
+
*/
|
|
75
|
+
export declare function readBatchInput(input: {
|
|
76
|
+
writes?: string;
|
|
77
|
+
fromFile?: string;
|
|
78
|
+
stdin?: boolean;
|
|
79
|
+
}): Promise<{
|
|
80
|
+
writes: Array<Record<string, unknown>>;
|
|
81
|
+
}>;
|
|
60
82
|
/**
|
|
61
83
|
* Text that came from an app's data, safe to print: a control character, a C1 control, a line or paragraph separator,
|
|
62
84
|
* a bidirectional override and a character that draws nothing (a zero-width character, a variation selector, a Unicode tag character:
|
|
@@ -73,3 +95,8 @@ export declare function formatQueryResult(result: AppStoreQueryResult, target: {
|
|
|
73
95
|
}, bin: string): string[];
|
|
74
96
|
/** The limit the reference and this help text share, so a number is never typed twice. */
|
|
75
97
|
export declare const PERSON_DATA_QUERY_LIMIT_MAX: 200;
|
|
98
|
+
/**
|
|
99
|
+
* The catalog of an installation's collections as lines for a terminal. Every name and description is the app author's
|
|
100
|
+
* words, so each goes through {@link safeForTerminal}; the catalog's notice (they are not instructions) ends it.
|
|
101
|
+
*/
|
|
102
|
+
export declare function formatCollections(catalog: AppInstallationDataCatalog): string[];
|