@skrr-ai/cli 0.1.116 → 0.1.118

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.
Files changed (94) hide show
  1. package/dist/base-command.d.ts +21 -0
  2. package/dist/base-command.js +95 -8
  3. package/dist/commands/actions/browse.js +2 -1
  4. package/dist/commands/actions/install.d.ts +2 -0
  5. package/dist/commands/actions/install.js +67 -2
  6. package/dist/commands/actions/list.js +2 -1
  7. package/dist/commands/actions/show.js +2 -1
  8. package/dist/commands/commitments/create.d.ts +21 -2
  9. package/dist/commands/commitments/create.js +74 -4
  10. package/dist/commands/convos/recovery.js +12 -4
  11. package/dist/commands/followups/plans/list.js +1 -1
  12. package/dist/commands/guide.d.ts +21 -0
  13. package/dist/commands/guide.js +46 -0
  14. package/dist/commands/instructions/guide.js +34 -52
  15. package/dist/commands/memory/maintain.js +1 -1
  16. package/dist/commands/skills/browse.js +2 -1
  17. package/dist/commands/skills/details.js +4 -2
  18. package/dist/commands/skills/featured.js +2 -1
  19. package/dist/commands/skills/install.d.ts +2 -0
  20. package/dist/commands/skills/install.js +62 -3
  21. package/dist/commands/skills/search.js +2 -1
  22. package/dist/commands/slack/send-as-agent.js +3 -3
  23. package/dist/commands/spaces/create.js +8 -2
  24. package/dist/commands/spaces/guide.d.ts +21 -0
  25. package/dist/commands/spaces/guide.js +40 -0
  26. package/dist/commands/spaces/index.d.ts +0 -1
  27. package/dist/commands/spaces/index.js +1 -6
  28. package/dist/commands/store/acquisitions/list.js +2 -1
  29. package/dist/commands/store/acquisitions/show.js +2 -1
  30. package/dist/commands/store/browse.js +4 -2
  31. package/dist/commands/store/install.d.ts +1 -0
  32. package/dist/commands/store/install.js +26 -2
  33. package/dist/commands/store/releases.js +4 -2
  34. package/dist/commands/store/show.js +3 -2
  35. package/dist/commands/store/tip.js +2 -2
  36. package/dist/commands/tasks/checkout.js +2 -3
  37. package/dist/commands/tasks/comments/add.js +3 -5
  38. package/dist/commands/tasks/complete.js +2 -3
  39. package/dist/commands/tasks/deliverable/add.d.ts +1 -1
  40. package/dist/commands/tasks/deliverable/add.js +4 -7
  41. package/dist/commands/tasks/expectations/assess.js +2 -2
  42. package/dist/commands/tasks/guide.d.ts +8 -0
  43. package/dist/commands/tasks/guide.js +23 -10
  44. package/dist/commands/tasks/report.js +9 -5
  45. package/dist/commands/tasks/resource/add.js +2 -3
  46. package/dist/commands/tasks/result/submit.js +2 -3
  47. package/dist/commands/tasks/resume/save.js +2 -3
  48. package/dist/commands/tasks/review.js +2 -3
  49. package/dist/commands/tasks/triage.js +2 -1
  50. package/dist/commands/tasks/updates/add.js +2 -3
  51. package/dist/generated/agent-guides.json +8312 -0
  52. package/dist/generated/managed-instruction-guides.json +1 -1
  53. package/dist/help.js +4 -3
  54. package/dist/hooks/command-not-found.js +1 -1
  55. package/dist/lib/action-listings.js +2 -1
  56. package/dist/lib/agent-guide-reference-gate.d.ts +28 -0
  57. package/dist/lib/agent-guide-reference-gate.js +186 -0
  58. package/dist/lib/agent-guides.d.ts +51 -0
  59. package/dist/lib/agent-guides.js +170 -0
  60. package/dist/lib/api-fetch.js +3 -1
  61. package/dist/lib/command-miss.d.ts +13 -2
  62. package/dist/lib/command-miss.js +134 -8
  63. package/dist/lib/guide-pointer.d.ts +15 -0
  64. package/dist/lib/guide-pointer.js +51 -0
  65. package/dist/lib/lookbackPlans.d.ts +3 -1
  66. package/dist/lib/lookbackPlans.js +9 -0
  67. package/dist/lib/node-adapter.js +4 -3
  68. package/dist/lib/outbox.d.ts +0 -14
  69. package/dist/lib/outbox.js +0 -21
  70. package/dist/lib/roles.d.ts +1 -1
  71. package/dist/lib/store-listing.d.ts +6 -1
  72. package/dist/lib/store-listing.js +6 -1
  73. package/dist/lib/task-admission.js +27 -5
  74. package/dist/lib/task-batch.d.ts +10 -7
  75. package/dist/lib/task-batch.js +5 -20
  76. package/dist/lib/task-operations.d.ts +8 -20
  77. package/dist/lib/task-operations.js +9 -94
  78. package/dist/lib/task-preflight.js +70 -33
  79. package/dist/lib/task-runtime-headers.d.ts +11 -0
  80. package/dist/lib/task-runtime-headers.js +73 -0
  81. package/dist/lib/task-write-attribution.js +1 -1
  82. package/dist/lib/usage-discovery.d.ts +4 -0
  83. package/dist/lib/usage-discovery.js +5 -0
  84. package/dist/lib/usd-micros.d.ts +27 -0
  85. package/dist/lib/usd-micros.js +67 -2
  86. package/dist/lib/voice-call-intent.js +3 -1
  87. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.d.ts +17 -0
  88. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +35 -2
  89. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.d.ts +17 -0
  90. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +44 -0
  91. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  92. package/dist/node_modules/@skrr-ai/data-provider/index.js +11927 -11678
  93. package/oclif.manifest.json +251 -14
  94. package/package.json +4 -2
@@ -2,7 +2,7 @@
2
2
  "oversky-task-management": {
3
3
  "key": "oversky-task-management",
4
4
  "name": "skrr Task Management",
5
- "templateVersion": 20,
5
+ "templateVersion": 22,
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 Commitment 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 commitments show <commitment-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": "a4bcb9d4c39e33e8a1dcd12b8a669efe80c67d81c3a8ad90119be73f8352c8b6"
8
8
  }
package/dist/help.js CHANGED
@@ -48,6 +48,7 @@ class SkrrHelp extends core_1.Help {
48
48
  this.log('GETTING STARTED');
49
49
  this.log(' skrr login Sign in. Offers to install the background service if this computer has none.');
50
50
  this.log(' skrr daemon install Install the background service by hand (fetches the signed release).');
51
+ this.log(" skrr guide Read a Skrr domain's guide before you write in it.");
51
52
  this.log('');
52
53
  return super.showRootHelp();
53
54
  }
@@ -73,11 +74,11 @@ class SkrrHelp extends core_1.Help {
73
74
  ...(flagStart === -1 ? [] : argv.slice(flagStart)),
74
75
  ]);
75
76
  }
76
- throw new Error((0, command_miss_1.describeCommandMiss)(lookup, id));
77
+ throw new Error((0, command_miss_1.describeCommandMiss)(lookup, id, words));
77
78
  }
78
- if (id === 'tasks' && this.config.findCommand('tasks:guide')) {
79
+ if (id === 'tasks' && this.config.findCommand('guide')) {
79
80
  this.log('TASK OPERATIONS');
80
- this.log(` ${this.config.bin} tasks guide Find planning, dependencies, execution, and result commands.`);
81
+ this.log(` ${this.config.bin} guide tasks Read the tasks guide: planning, dependencies, execution, and results.`);
81
82
  if (this.config.findCommand('tasks:preflight'))
82
83
  this.log(` ${this.config.bin} tasks preflight <task> Inspect blockers and execution prerequisites without starting work.`);
83
84
  this.log('');
@@ -102,7 +102,7 @@ const hook = async function (opts) {
102
102
  // — a typo would silently look like success, which is far worse than the
103
103
  // message this hook was written to improve. (I shipped exactly that for one
104
104
  // build; `skrr shortcuts lst` said nothing and exited 0.)
105
- throw new Error((0, command_miss_1.describeCommandMiss)(lookup, id));
105
+ throw new Error((0, command_miss_1.describeCommandMiss)(lookup, id, words));
106
106
  };
107
107
  exports.default = hook;
108
108
  class VirtualUsageFlagError extends Error {
@@ -4,6 +4,7 @@ exports.ACTION_LISTING_SORTS = exports.ACTION_LISTING_CATEGORIES = void 0;
4
4
  exports.renderActionListings = renderActionListings;
5
5
  exports.renderActionListing = renderActionListing;
6
6
  const format_1 = require("./format");
7
+ const store_listing_1 = require("./store-listing");
7
8
  exports.ACTION_LISTING_CATEGORIES = [
8
9
  'code',
9
10
  'data',
@@ -47,7 +48,7 @@ function renderActionListing(listing, log) {
47
48
  log(`Kind: ${listing.kind}`);
48
49
  log(`Category: ${listing.category}`);
49
50
  log(`Public: ${listing.isPublic ? 'yes' : 'no'}`);
50
- log(`Price: ${listing.price ?? 0}`);
51
+ log(`Price: ${(0, store_listing_1.formatListingPrice)(listing.price)}`);
51
52
  log(`Installs: ${listing.installCount ?? 0}`);
52
53
  log(`Rating: ${listing.ratingCount ? `${listing.rating} (${listing.ratingCount})` : '-'}`);
53
54
  if (listing.builtinType)
@@ -0,0 +1,28 @@
1
+ import { type CommandManifest } from './command-manifest';
2
+ export type AgentGuideSourceLine = {
3
+ text: string;
4
+ line: number;
5
+ };
6
+ export type AgentGuideSourceDocument = {
7
+ guide: string;
8
+ section: string;
9
+ surface: 'cli' | 'mcp';
10
+ file: string;
11
+ lines: readonly AgentGuideSourceLine[];
12
+ };
13
+ export type McpToolSource = {
14
+ server: string;
15
+ tools: readonly string[];
16
+ /** Argument names from the tools' input schemas; never mistaken for a tool. */
17
+ fields?: readonly string[];
18
+ };
19
+ /** Validates the CLI surface against the command manifest the CLI ships. */
20
+ export declare function assertCliGuideReferences(documents: readonly AgentGuideSourceDocument[], manifest: CommandManifest, globalFlags?: readonly string[]): void;
21
+ /**
22
+ * Validates explicitly named MCP tools. Unknown snake_case values are only
23
+ * treated as tools when their namespace exists and prose calls them a tool
24
+ * right beside the name; a tool argument (`agent_id`, from the input schemas)
25
+ * and fields such as `task_id` stay ordinary prose rather than gate false
26
+ * positives.
27
+ */
28
+ export declare function assertMcpGuideToolReferences(documents: readonly AgentGuideSourceDocument[], sources: readonly McpToolSource[]): void;
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertCliGuideReferences = assertCliGuideReferences;
4
+ exports.assertMcpGuideToolReferences = assertMcpGuideToolReferences;
5
+ const data_provider_1 = require("@skrr-ai/data-provider");
6
+ const command_miss_1 = require("./command-miss");
7
+ const command_manifest_1 = require("./command-manifest");
8
+ const FENCE = /^ {0,3}(`{3,}|~{3,})(.*)$/;
9
+ const INLINE_CODE = /`([^`\n]+)`/g;
10
+ const FLAG = /(?<!-)--([a-z][a-z0-9-]*)\b/g;
11
+ const BARE_TOOL = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)+$/;
12
+ const PREFIXED_TOOL = /mcp__[a-z0-9-]+__[a-z0-9_]+/g;
13
+ function location(document, line, problem) {
14
+ return new Error(`[AgentGuides] guide "${document.guide}", section "${document.section}", ` +
15
+ `surface "${document.surface}" (${document.file}:${line}): ${problem}`);
16
+ }
17
+ function commandWords(text) {
18
+ const words = [];
19
+ for (const token of text.trim().split(/\s+/)) {
20
+ if (token.startsWith('--') || token.startsWith('<') || token.startsWith('['))
21
+ break;
22
+ if (!/^[a-z][a-z0-9-]*$/i.test(token))
23
+ break;
24
+ words.push(token.toLowerCase());
25
+ }
26
+ return words;
27
+ }
28
+ function codeSpans(document) {
29
+ const spans = [];
30
+ let fence = null;
31
+ for (const source of document.lines) {
32
+ const marker = FENCE.exec(source.text);
33
+ if (fence) {
34
+ if (marker &&
35
+ marker[1][0] === fence[0] &&
36
+ marker[1].length >= fence.length &&
37
+ !marker[2].trim()) {
38
+ fence = null;
39
+ }
40
+ else {
41
+ spans.push(source);
42
+ }
43
+ continue;
44
+ }
45
+ if (marker) {
46
+ fence = marker[1];
47
+ continue;
48
+ }
49
+ for (const match of source.text.matchAll(INLINE_CODE)) {
50
+ spans.push({ text: match[1], line: source.line });
51
+ }
52
+ }
53
+ return spans;
54
+ }
55
+ function commandCatalog(manifest) {
56
+ const ids = [];
57
+ const spellings = [];
58
+ const flags = new Set();
59
+ for (const entry of (0, command_manifest_1.visibleCommandEntries)(manifest)) {
60
+ ids.push(entry.id);
61
+ for (const name of [entry.command, ...entry.aliases]) {
62
+ const words = commandWords(name.replace(/:/g, ' '));
63
+ if (words.length)
64
+ spellings.push({ words, id: entry.id });
65
+ }
66
+ for (const [name, flag] of Object.entries(entry.flags)) {
67
+ flags.add(name);
68
+ // oclif accepts `--no-<name>` for a boolean declared with `allowNo`.
69
+ if (flag.allowNo === true)
70
+ flags.add(`no-${name}`);
71
+ const aliases = flag.aliases;
72
+ if (Array.isArray(aliases)) {
73
+ for (const alias of aliases) {
74
+ if (typeof alias === 'string')
75
+ flags.add(alias.replace(/^--/, ''));
76
+ }
77
+ }
78
+ }
79
+ }
80
+ return { ids, spellings, flags };
81
+ }
82
+ /** Validates the CLI surface against the command manifest the CLI ships. */
83
+ function assertCliGuideReferences(documents, manifest, globalFlags = []) {
84
+ const catalog = commandCatalog(manifest);
85
+ for (const flag of globalFlags)
86
+ catalog.flags.add(flag.replace(/^--/, ''));
87
+ for (const document of documents) {
88
+ if (document.surface !== 'cli')
89
+ continue;
90
+ for (const span of codeSpans(document)) {
91
+ for (const match of span.text.matchAll(/\bskrr(?:\s+[^\s`]+)*/g)) {
92
+ const typed = commandWords(match[0].slice('skrr'.length));
93
+ if (!typed.length)
94
+ continue;
95
+ const matching = catalog.spellings
96
+ .filter((candidate) => candidate.words.every((word, index) => typed[index] === word))
97
+ .sort((a, b) => b.words.length - a.words.length)[0];
98
+ if (matching)
99
+ continue;
100
+ const id = typed.join(':');
101
+ // A bare topic in prose (for example `skrr followups`) names a
102
+ // command family, not an invocation of a missing no-argument command.
103
+ if (catalog.ids.some((known) => known.startsWith(`${id}:`)))
104
+ continue;
105
+ const nearest = (0, command_miss_1.nearestCommands)(id, catalog.ids)[0];
106
+ throw location(document, span.line, `unknown \`skrr ${typed.join(' ')}\` command${nearest ? `; nearest real command: \`skrr ${nearest.replace(/:/g, ' ')}\`` : ''}`);
107
+ }
108
+ }
109
+ for (const source of document.lines) {
110
+ for (const match of source.text.matchAll(FLAG)) {
111
+ const name = match[1];
112
+ if (catalog.flags.has(name))
113
+ continue;
114
+ const nearest = (0, command_miss_1.nearestCommands)(name, [...catalog.flags])[0];
115
+ throw location(document, source.line, `unknown flag \`--${name}\`${nearest ? `; nearest real flag: \`--${nearest}\`` : ''}`);
116
+ }
117
+ }
118
+ }
119
+ }
120
+ function isToolReference(line, start, end, name, known) {
121
+ if (known.has(name))
122
+ return true;
123
+ const before = line.slice(0, start);
124
+ const after = line.slice(end);
125
+ return (/\b(?:call|use|invoke|run)\s*$/i.test(before) ||
126
+ // "the `x` tool" / "tool `x`": the word must sit beside the name, since a
127
+ // line that mentions tools elsewhere often names an argument too.
128
+ /\b(?:MCP\s+)?tools?\s*$/i.test(before) ||
129
+ /^\s*(?:MCP\s+)?tool\b/i.test(after) ||
130
+ /^\s*(?:[-*]|\d+\.)\s*$/.test(before));
131
+ }
132
+ function nearestTool(name, names) {
133
+ return (0, data_provider_1.nearestAgentGuideIds)(name, names, 1)[0] ?? '';
134
+ }
135
+ /**
136
+ * Validates explicitly named MCP tools. Unknown snake_case values are only
137
+ * treated as tools when their namespace exists and prose calls them a tool
138
+ * right beside the name; a tool argument (`agent_id`, from the input schemas)
139
+ * and fields such as `task_id` stay ordinary prose rather than gate false
140
+ * positives.
141
+ */
142
+ function assertMcpGuideToolReferences(documents, sources) {
143
+ const owners = new Map();
144
+ for (const source of sources) {
145
+ for (const name of source.tools) {
146
+ const servers = owners.get(name) ?? new Set();
147
+ servers.add(source.server);
148
+ owners.set(name, servers);
149
+ }
150
+ }
151
+ const names = [...owners.keys()];
152
+ const known = new Set(names);
153
+ const argumentNames = new Set(sources.flatMap((source) => source.fields ?? []));
154
+ const namespaces = new Set(names.map((name) => name.split('_', 1)[0]));
155
+ for (const document of documents) {
156
+ if (document.surface !== 'mcp')
157
+ continue;
158
+ for (const source of document.lines) {
159
+ for (const match of source.text.matchAll(PREFIXED_TOOL)) {
160
+ const name = match[0].split('__').at(-1) ?? match[0];
161
+ const nearest = nearestTool(name, names);
162
+ throw location(document, source.line, `MCP tools use bare names, not \`${match[0]}\`${nearest ? `; nearest real tool: \`${nearest}\`` : ''}`);
163
+ }
164
+ for (const match of source.text.matchAll(INLINE_CODE)) {
165
+ const name = match[1];
166
+ if (!BARE_TOOL.test(name))
167
+ continue;
168
+ if (argumentNames.has(name) && !known.has(name))
169
+ continue;
170
+ const namespace = name.split('_', 1)[0];
171
+ if (!namespaces.has(namespace) ||
172
+ !isToolReference(source.text, match.index, match.index + match[0].length, name, known)) {
173
+ continue;
174
+ }
175
+ const servers = owners.get(name);
176
+ if (!servers) {
177
+ const nearest = nearestTool(name, names);
178
+ throw location(document, source.line, `unknown MCP tool \`${name}\`${nearest ? `; nearest real tool: \`${nearest}\`` : ''}`);
179
+ }
180
+ if (servers.size > 1) {
181
+ throw location(document, source.line, `MCP tool \`${name}\` is ambiguous across ${[...servers].sort().join(', ')}; name a unique bare tool`);
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
@@ -0,0 +1,51 @@
1
+ import { type AgentGuideMiss, type AgentGuideResponse } from '@skrr-ai/data-provider';
2
+ import type { Command } from '@oclif/core';
3
+ export type AgentGuideRequest = {
4
+ id?: string;
5
+ section?: string;
6
+ };
7
+ export type AgentGuideFallbackReason = 'no-session' | 'server-unavailable' | 'server-hash-mismatch' | 'offline-requested';
8
+ export type AgentGuideRead = {
9
+ found: true;
10
+ response: AgentGuideResponse;
11
+ source: 'server' | 'bundled';
12
+ /** Why the bundled copy answered; set only when `source` is 'bundled'. */
13
+ reason?: AgentGuideFallbackReason;
14
+ } | {
15
+ found: false;
16
+ miss: AgentGuideMiss;
17
+ };
18
+ /** The flag subset a guide read consults; every caller's parsed flags satisfy it. */
19
+ type AgentGuideReadFlags = {
20
+ offline?: boolean;
21
+ profile?: string;
22
+ token?: string;
23
+ bare?: boolean;
24
+ };
25
+ /**
26
+ * The one read path behind `skrr guide` and the legacy
27
+ * `instructions guide task-management`: the server when a credential answers,
28
+ * the bundled release copy otherwise, with a distinct `server-hash-mismatch` fallback
29
+ * reason (OSK-17944). Documentation stays readable with no session at all.
30
+ */
31
+ export declare function readAgentGuide(request: AgentGuideRequest, flags: AgentGuideReadFlags): Promise<AgentGuideRead>;
32
+ /**
33
+ * The `--json` body every guide read prints: the response itself plus where it
34
+ * was read from, so `skrr guide --json` and each kept alias say provenance the
35
+ * same way.
36
+ */
37
+ export declare function agentGuideJson(read: Extract<AgentGuideRead, {
38
+ found: true;
39
+ }>): string;
40
+ /**
41
+ * The one fallback a text-mode reader is told about. No session, `--offline`
42
+ * and an unreachable server are ordinary reasons to read the bundled copy. A
43
+ * server whose body does not match its own hash is an integrity failure, so it
44
+ * is said on stderr and stdout stays the guide (OSK-17944).
45
+ */
46
+ export declare function agentGuideFallbackNotice(read: Extract<AgentGuideRead, {
47
+ found: true;
48
+ }>): string | null;
49
+ /** A miss is steering, not a crash: print it with its nearest addresses and exit 1. */
50
+ export declare function writeAgentGuideMiss(command: Command, miss: AgentGuideMiss, json: boolean): never;
51
+ export {};
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.readAgentGuide = readAgentGuide;
7
+ exports.agentGuideJson = agentGuideJson;
8
+ exports.agentGuideFallbackNotice = agentGuideFallbackNotice;
9
+ exports.writeAgentGuideMiss = writeAgentGuideMiss;
10
+ const data_provider_1 = require("@skrr-ai/data-provider");
11
+ const node_crypto_1 = require("node:crypto");
12
+ const agent_guides_json_1 = __importDefault(require("../generated/agent-guides.json"));
13
+ const auth_core_init_1 = require("./auth-core-init");
14
+ const credential_resolver_1 = require("./credential-resolver");
15
+ const harness_context_1 = require("./harness-context");
16
+ const http_error_1 = require("./http-error");
17
+ const keychain_1 = require("./keychain");
18
+ const config_1 = require("./config");
19
+ const node_adapter_1 = require("./node-adapter");
20
+ const bundle = agent_guides_json_1.default;
21
+ function responseHashMatches(response) {
22
+ return ((0, node_crypto_1.createHash)('sha256').update((0, data_provider_1.renderAgentGuideText)(response), 'utf8').digest('hex') ===
23
+ response.hash);
24
+ }
25
+ function guideMissFrom(error) {
26
+ if ((0, http_error_1.httpStatusOf)(error) !== 404)
27
+ return null;
28
+ const body = (0, http_error_1.httpBodyOf)(error);
29
+ if (body?.code !== 'GUIDE_NOT_FOUND' ||
30
+ typeof body.message !== 'string' ||
31
+ !Array.isArray(body.suggestions)) {
32
+ return null;
33
+ }
34
+ return body;
35
+ }
36
+ function readBundledGuide(request) {
37
+ if (!request.id)
38
+ return { found: true, response: bundle.routedIndex };
39
+ const resolved = (0, data_provider_1.resolveAgentGuideRequest)(bundle.index.guides, { id: request.id, ...(request.section ? { section: request.section } : {}) }, { surface: 'cli' });
40
+ if (!resolved.found)
41
+ return resolved;
42
+ const response = resolved.section
43
+ ? bundle.sections[`${resolved.id}/${resolved.section}`]
44
+ : bundle.cards[resolved.id];
45
+ if (!response) {
46
+ throw new Error('The bundled agent guides are incomplete. Run node cli/scripts/generate-agent-guides.cjs.');
47
+ }
48
+ return {
49
+ found: true,
50
+ response: resolved.aliasOf ? { ...response, aliasOf: resolved.aliasOf } : response,
51
+ };
52
+ }
53
+ async function readServerGuide(request, options) {
54
+ if (request.section) {
55
+ return data_provider_1.dataService.getAgentGuideSection(request.id ?? '', request.section, { surface: 'cli' }, options);
56
+ }
57
+ if (request.id)
58
+ return data_provider_1.dataService.getAgentGuide(request.id, { surface: 'cli' }, options);
59
+ return data_provider_1.dataService.getAgentGuideIndex({ surface: 'cli' }, options);
60
+ }
61
+ /**
62
+ * The one read path behind `skrr guide` and the legacy
63
+ * `instructions guide task-management`: the server when a credential answers,
64
+ * the bundled release copy otherwise, with a distinct `server-hash-mismatch` fallback
65
+ * reason (OSK-17944). Documentation stays readable with no session at all.
66
+ */
67
+ async function readAgentGuide(request, flags) {
68
+ let response;
69
+ let miss;
70
+ let source = 'bundled';
71
+ let reason = flags.offline ? 'offline-requested' : 'no-session';
72
+ if (!flags.offline) {
73
+ (0, keychain_1.setActiveProfile)(flags.profile ?? process.env.OVERSKY_PROFILE ?? '');
74
+ let credential;
75
+ let autonomous = false;
76
+ try {
77
+ const trusted = (0, credential_resolver_1.resolveTrustedAutonomousCredential)();
78
+ autonomous = Boolean(trusted);
79
+ if (!trusted && !flags.bare && !(0, harness_context_1.isHarnessCliContext)())
80
+ await (0, auth_core_init_1.prefetchCliAuth)();
81
+ credential =
82
+ trusted ??
83
+ (await (0, credential_resolver_1.resolveCredential)({
84
+ flagToken: flags.token,
85
+ bareMode: flags.bare,
86
+ allowUnreadableStoredCredential: true,
87
+ }));
88
+ }
89
+ catch {
90
+ credential = undefined;
91
+ }
92
+ if (credential?.token) {
93
+ try {
94
+ const baseURL = autonomous ? process.env.OVERSKY_SERVER_URL?.trim() : (0, config_1.loadConfig)().baseURL;
95
+ if (!baseURL)
96
+ throw new Error('No API base URL is configured.');
97
+ (0, data_provider_1.setBaseURL)(baseURL);
98
+ (0, node_adapter_1.setAdapterCredentialOverride)(credential);
99
+ (0, data_provider_1.setHttpAdapter)((0, node_adapter_1.createNodeAdapter)());
100
+ const options = { signal: AbortSignal.timeout(3_000) };
101
+ response = await readServerGuide(request, options);
102
+ if (!responseHashMatches(response)) {
103
+ response = undefined;
104
+ reason = 'server-hash-mismatch';
105
+ }
106
+ else {
107
+ source = 'server';
108
+ }
109
+ }
110
+ catch (error) {
111
+ miss = guideMissFrom(error) ?? undefined;
112
+ if (!miss)
113
+ reason = 'server-unavailable';
114
+ }
115
+ }
116
+ }
117
+ if (miss)
118
+ return { found: false, miss };
119
+ if (!response) {
120
+ const bundled = readBundledGuide(request);
121
+ if (!bundled.found)
122
+ return bundled;
123
+ response = bundled.response;
124
+ }
125
+ return {
126
+ found: true,
127
+ response,
128
+ source,
129
+ ...(source === 'bundled' ? { reason } : {}),
130
+ };
131
+ }
132
+ /**
133
+ * The `--json` body every guide read prints: the response itself plus where it
134
+ * was read from, so `skrr guide --json` and each kept alias say provenance the
135
+ * same way.
136
+ */
137
+ function agentGuideJson(read) {
138
+ return `${JSON.stringify({
139
+ ...read.response,
140
+ provenance: {
141
+ source: read.source,
142
+ fallback: read.source === 'bundled',
143
+ ...(read.reason ? { reason: read.reason } : {}),
144
+ },
145
+ }, null, 2)}\n`;
146
+ }
147
+ /**
148
+ * The one fallback a text-mode reader is told about. No session, `--offline`
149
+ * and an unreachable server are ordinary reasons to read the bundled copy. A
150
+ * server whose body does not match its own hash is an integrity failure, so it
151
+ * is said on stderr and stdout stays the guide (OSK-17944).
152
+ */
153
+ function agentGuideFallbackNotice(read) {
154
+ return read.reason === 'server-hash-mismatch'
155
+ ? 'The server guide’s body does not match its hash; using the guide bundled with this CLI.'
156
+ : null;
157
+ }
158
+ /** A miss is steering, not a crash: print it with its nearest addresses and exit 1. */
159
+ function writeAgentGuideMiss(command, miss, json) {
160
+ if (json) {
161
+ process.stdout.write(`${JSON.stringify({ ok: false, error: miss }, null, 2)}\n`);
162
+ }
163
+ else {
164
+ process.stdout.write(`${miss.message}\n`);
165
+ for (const suggestion of miss.suggestions) {
166
+ process.stdout.write(`${(0, data_provider_1.agentGuideReadCommand)(suggestion, 'cli')}\n`);
167
+ }
168
+ }
169
+ return command.exit(1);
170
+ }
@@ -46,6 +46,7 @@ const delegated_cli_1 = require("./delegated-cli");
46
46
  const daemonBroker_1 = require("./daemonBroker");
47
47
  const dpop_auth_1 = require("./dpop-auth");
48
48
  const workspace_header_1 = require("./workspace-header");
49
+ const task_runtime_headers_1 = require("./task-runtime-headers");
49
50
  const non_json_response_1 = require("./non-json-response");
50
51
  const rate_limit_retry_1 = require("./rate-limit-retry");
51
52
  class ApiFetchError extends Error {
@@ -189,12 +190,13 @@ async function apiFetch(pathOrUrl, opts = {}) {
189
190
  // OSK-12020 — a fresh proof per attempt for a DPoP-bound hand-off token
190
191
  // (the 401 retry below re-enters here and gets its own). No-op otherwise.
191
192
  Object.assign(headers, await (0, dpop_auth_1.dpopHeadersFor)(credential.token, method, url));
192
- const sent = (0, workspace_header_1.withWorkspaceHeader)(headers);
193
+ const sent = (0, task_runtime_headers_1.withTaskRuntimeHeaders)((0, workspace_header_1.withWorkspaceHeader)(headers), url, method);
193
194
  // E6: a 429 on a GET or an idempotency-keyed write is retried (bounded,
194
195
  // jittered, honouring Retry-After). The last 429's wait is kept for the error.
195
196
  const { response, retryAfterMs } = await (0, rate_limit_retry_1.fetchWithRateLimitRetry)(() => fetch(url, {
196
197
  method,
197
198
  headers: sent,
199
+ ...(0, task_runtime_headers_1.taskRuntimeRedirectOptions)(sent),
198
200
  body,
199
201
  ...(opts.signal ? { signal: opts.signal } : {}),
200
202
  }), { method, headers: sent, signal: opts.signal });
@@ -29,6 +29,17 @@ export type CommandLookup = {
29
29
  commandIDs: string[];
30
30
  topicNames: string[];
31
31
  };
32
+ /**
33
+ * Commands behind the Task spellings agents reach for before they have read
34
+ * the guide. Keep these ids here with their redirects so the manifest contract
35
+ * test can prove every printed target ships in this CLI build.
36
+ */
37
+ export declare const TASK_COMMAND_MISS_TARGETS: Readonly<{
38
+ topic: "tasks";
39
+ search: "tasks:list";
40
+ resultShow: "tasks:result:show";
41
+ resultSubmit: "tasks:result:submit";
42
+ }>;
32
43
  /** Cheap edit distance, bounded — this runs only on a miss. */
33
44
  export declare function editDistance(a: string, b: string): number;
34
45
  /**
@@ -68,7 +79,7 @@ export type CommandMiss = {
68
79
  suggestions: string[];
69
80
  };
70
81
  /** The text form: exactly what a miss has always printed. */
71
- export declare function describeCommandMiss(config: CommandLookup, id: string): string;
82
+ export declare function describeCommandMiss(config: CommandLookup, id: string, typedWords?: readonly string[]): string;
72
83
  /**
73
84
  * The miss for a colon-joined id that did not resolve.
74
85
  *
@@ -81,7 +92,7 @@ export declare function describeCommandMiss(config: CommandLookup, id: string):
81
92
  * suggest the nearest siblings under the same topic before falling back to
82
93
  * the whole command list.
83
94
  */
84
- export declare function analyzeCommandMiss(config: CommandLookup, id: string): CommandMiss;
95
+ export declare function analyzeCommandMiss(config: CommandLookup, id: string, typedWords?: readonly string[]): CommandMiss;
85
96
  /** Adapt an oclif `Config` to the lookup shape above. */
86
97
  export declare function lookupFromConfig(config: {
87
98
  bin: string;