@skrr-ai/cli 0.1.215 → 0.1.217

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 (48) hide show
  1. package/dist/commands/agent/message/no-reply.d.ts +4 -0
  2. package/dist/commands/agent/message/no-reply.js +5 -1
  3. package/dist/commands/agents/always-on/recovery-review.d.ts +12 -0
  4. package/dist/commands/agents/always-on/recovery-review.js +52 -2
  5. package/dist/commands/agents/permissions/list.d.ts +12 -0
  6. package/dist/commands/agents/permissions/list.js +42 -0
  7. package/dist/commands/agents/permissions/remove.d.ts +15 -0
  8. package/dist/commands/agents/permissions/remove.js +68 -0
  9. package/dist/commands/dm/work.js +2 -0
  10. package/dist/commands/duties/action-proposal.js +7 -1
  11. package/dist/commands/duties/action-proposals.d.ts +9 -0
  12. package/dist/commands/duties/action-proposals.js +30 -12
  13. package/dist/commands/duties/check-now.d.ts +7 -0
  14. package/dist/commands/duties/check-now.js +36 -1
  15. package/dist/commands/duties/create.d.ts +15 -0
  16. package/dist/commands/duties/create.js +93 -5
  17. package/dist/commands/duties/pause.js +20 -2
  18. package/dist/commands/duties/trigger-status.js +6 -1
  19. package/dist/commands/duties/update.js +22 -7
  20. package/dist/commands/spaces/auto-executor/preview.d.ts +7 -0
  21. package/dist/commands/spaces/auto-executor/preview.js +21 -2
  22. package/dist/commands/tasks/chat/index.d.ts +11 -0
  23. package/dist/commands/tasks/chat/index.js +27 -0
  24. package/dist/commands/tasks/input/answer.d.ts +12 -0
  25. package/dist/commands/tasks/input/answer.js +59 -5
  26. package/dist/commands/tasks/operations/show.js +5 -6
  27. package/dist/commands/tasks/result/show.js +2 -4
  28. package/dist/commands/tasks/retry-receipt.js +1 -3
  29. package/dist/commands/wiki/write.js +7 -2
  30. package/dist/generated/agent-guides.json +24 -24
  31. package/dist/lib/compasses.d.ts +5 -0
  32. package/dist/lib/compasses.js +6 -1
  33. package/dist/lib/duties.d.ts +29 -0
  34. package/dist/lib/duties.js +122 -16
  35. package/dist/lib/permission-rules.d.ts +21 -0
  36. package/dist/lib/permission-rules.js +75 -0
  37. package/dist/lib/space-proposals.js +8 -1
  38. package/dist/lib/space-write-policy.js +18 -2
  39. package/dist/lib/task-extras.d.ts +19 -0
  40. package/dist/lib/task-extras.js +13 -0
  41. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/ownerChatDutyHarnesses.d.ts +43 -0
  42. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/ownerChatDutyHarnesses.js +36 -0
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/ownerChatDutyHarnesses.d.ts +43 -0
  44. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/ownerChatDutyHarnesses.js +48 -0
  45. package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
  46. package/dist/node_modules/@skrr-ai/data-provider/index.js +12658 -12041
  47. package/oclif.manifest.json +201 -4
  48. package/package.json +5 -2
@@ -12,7 +12,7 @@
12
12
  "aliases": [
13
13
  "task-management"
14
14
  ],
15
- "tokens": 1441,
15
+ "tokens": 1479,
16
16
  "sections": [
17
17
  {
18
18
  "id": "records",
@@ -157,7 +157,7 @@
157
157
  "id": "result-review",
158
158
  "title": "Result and Review",
159
159
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
160
- "tokens": 619,
160
+ "tokens": 672,
161
161
  "aliases": [],
162
162
  "explains": [
163
163
  "TASK_REOPEN_REQUIRED",
@@ -786,7 +786,7 @@
786
786
  ]
787
787
  }
788
788
  ],
789
- "hash": "fecd8dd12d61ab425e3eff713afd770787c098e437014c90bb1c369227dff3c8",
789
+ "hash": "83aa347e7115521e054a1b39a716753c8d70e58997844332095a87cfca1f61c4",
790
790
  "tokens": 574
791
791
  },
792
792
  "routedIndex": {
@@ -802,7 +802,7 @@
802
802
  "aliases": [
803
803
  "task-management"
804
804
  ],
805
- "tokens": 1441,
805
+ "tokens": 1479,
806
806
  "sections": [
807
807
  {
808
808
  "id": "records",
@@ -947,7 +947,7 @@
947
947
  "id": "result-review",
948
948
  "title": "Result and Review",
949
949
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
950
- "tokens": 619,
950
+ "tokens": 672,
951
951
  "aliases": [],
952
952
  "explains": [
953
953
  "TASK_REOPEN_REQUIRED",
@@ -1448,7 +1448,7 @@
1448
1448
  ]
1449
1449
  }
1450
1450
  ],
1451
- "hash": "c839e3fbf739eb1459639c876dad11e7e481b7539dd96d953eab4c7f82a25b32",
1451
+ "hash": "0edcfcbd11d7e56fb1bbe227646cf0335d7676ebfeb1aec6690f20a057ecd255",
1452
1452
  "tokens": 506
1453
1453
  },
1454
1454
  "cards": {
@@ -1463,9 +1463,9 @@
1463
1463
  "aliases": [
1464
1464
  "task-management"
1465
1465
  ],
1466
- "body": "## Concept model\n\n`skrr` is the durable record for work that must outlive this conversation.\n\n| Record | Question it answers |\n| --- | --- |\n| **Task** | What is owed, and where does it stand? |\n| **Expectation** | What must be true before the Task can close? |\n| **Update** | What meaningfully changed while the work ran? |\n| **Resume Point** | Where can an interrupted Run safely continue? |\n| **Result** | What did the work conclude or return? |\n| **Deliverable** | Which exact Resource version did the work produce? |\n| **Review** | Did another actor accept one exact Result? |\n| **Comment** | What does somebody need to answer? |\n| **Activity** | What happened, for the audit? A Run transcript is telemetry, not Activity. |\n\n## Decide\n\n- **Create a Task** without asking when work needs tracking across steps, sessions or a\n follow-up. Search first so you do not duplicate one, and create none for an action that\n finishes now.\n\nSearch with `skrr tasks list --q \"<query>\"`.\n\n- **Place it** in the Space the work clearly belongs to, or leave it unscoped. A new Space is a\n new boundary, never a home made for one Task.\n- **Update, Comment or Result**: an Update records a fact a later reader or Run needs; a Comment\n asks for a reply; the Result is the conclusion, submitted once. Never put a Result in a\n Comment, a transcript in Updates, or \"approved\" on a domain verdict such as NO-SHIP.\n- **Ask a person** one decision per question: the question in one line under 140 characters, the\n choices as options with the one you recommend marked, and the evidence and trade-off in the\n question's context, shown beneath it. Outside a Run there is no message beside the question, so\n the context is the only place the background goes. Mark it owner only when it concerns payment,\n sending outside, deletion, permissions, secrets, another person, or a choice redoing work cannot\n repair; otherwise the Agent that gave you the work may answer it.\n\nAsk with `skrr tasks ask <task> --question \"<one line>\" --option <a> --option <b> --recommended <n> --context \"<evidence>\"`.\n\n- **Keep its status true** while you work it: started when you begin, closed when the work is\n done, a `blocker` Update when it stops. Review is where a Review the Task's `reviewPolicy`\n requires is waited for, never a place to hand finished work over.\n\n## Workflow\n\n### Close out\n\n1. Record what exists: each Deliverable, bound to the Expectation it answers.\n2. Read what is still owed: `skrr tasks expectations <task>`.\n3. Assess each Expectation you verified, citing evidence; one you could not check is `unmet`, with the reason.\n4. Close it: `skrr tasks complete <task> --summary \"…\"` submits the Result and closes the Task in\n one step. When its `reviewPolicy` is `required`, submit with `skrr tasks result submit` and move\n it to review instead: a Review is owed, and your close as the owner would skip it.\n5. Read the Task back and report that state, not the one you intended.\n\nAn unmet Expectation or a `changes_requested` Review does not stop a close; it is recorded on it.\nSo if the work does not hold up, leave the Task open, say which Expectation failed, and record what\nblocks it as a `blocker` Update; its shape is in `updates`.\n\n## Authority\n\n| Actor | May do | Only a person may do |\n| --- | --- | --- |\n| Agent | Create and work Tasks; record Updates, Deliverables and Results; assess any Expectation that takes a judgement, citing evidence; review a Result another actor submitted | Waive an Expectation; confirm a Deliverable; make an attachment a Run input; close past a required Review |\n| Person | Everything in both columns | — |\n\nThe server cannot always tell an Agent from the person whose login it holds, so an accepted call\nis not permission: the right-hand column stays a person's even when the call would succeed. Never\nsupply or invent an Agent identity; the platform records who wrote each record.\nInside a Task's Run that is the Agent; in a session started with a person's login, it is that person.\n\nA required Review (`reviewPolicy` `required`) refuses a close only by a non-owner. The owner, and\nan Agent acting for the owner, can close without it, and that is the owner's decision. A non-owner\ncloses past it with `--force`, which records the override.\n\n## Live state\n\n- `skrr tasks show <task> --json` — status, Expectations, assignment and the Task URL.\n- `skrr tasks expectations <task>` — what is owed, with ids, and how far each one got.\n- `skrr tasks actionability <task>` — who can move the Task next, and why.\n- `skrr tasks review-queue --space <space-id>` — every judgement still outstanding in a Space.\n\n## Related guides\n\n- `spaces` — which Space, Project or Goal work belongs to, and who may work in a Space.\n- `agents` — which Agent you are, and where it runs.\n- `duties` — coming back to work later, and what an Agent keeps true over time.",
1467
- "hash": "3cc5bca8bb5d431ffe7616fc58dcb5f25ff0d8d9b6121d9cc3c1ddd74c2e262a",
1468
- "tokens": 1441,
1466
+ "body": "## Concept model\n\n`skrr` is the durable record for work that must outlive this conversation.\n\n| Record | Question it answers |\n| --- | --- |\n| **Task** | What is owed, and where does it stand? |\n| **Expectation** | What must be true before the Task can close? |\n| **Update** | What meaningfully changed while the work ran? |\n| **Resume Point** | Where can an interrupted Run safely continue? |\n| **Result** | What did the work conclude or return? |\n| **Deliverable** | Which exact Resource version did the work produce? |\n| **Review** | Did another actor accept one exact Result? |\n| **Comment** | What does somebody need to answer? |\n| **Activity** | What happened, for the audit? A Run transcript is telemetry, not Activity. |\n\n## Decide\n\n- **Create a Task** without asking when work needs tracking across steps, sessions or a\n follow-up. Search first so you do not duplicate one, and create none for an action that\n finishes now.\n\nSearch with `skrr tasks list --q \"<query>\"`.\n\n- **Place it** in the Space the work clearly belongs to, or leave it unscoped. A new Space is a\n new boundary, never a home made for one Task.\n- **Update, Comment or Result**: an Update records a fact a later reader or Run needs; a Comment\n asks for a reply; the Result is the conclusion, submitted once. Never put a Result in a\n Comment, a transcript in Updates, or \"approved\" on a domain verdict such as NO-SHIP.\n- **Ask a person** one decision per question: the question in one line under 140 characters, the\n choices as options with the one you recommend marked, and the evidence and trade-off in the\n question's context, shown beneath it. Outside a Run there is no message beside the question, so\n the context is the only place the background goes. Mark it owner only when it concerns payment,\n sending outside, deletion, permissions, secrets, another person, or a choice redoing work cannot\n repair; otherwise the Agent that gave you the work may answer it.\n\nAsk with `skrr tasks ask <task> --question \"<one line>\" --option <a> --option <b> --recommended <n> --context \"<evidence>\"`.\n\n- **Keep its status true** while you work it: started when you begin, closed when the work is\n done, a `blocker` Update when it stops. Review is where a Review the Task's `reviewPolicy`\n requires is waited for, never a place to hand finished work over.\n\n## Workflow\n\n### Close out\n\n1. Record what exists: each Deliverable, bound to the Expectation it answers.\n2. Read what is still owed: `skrr tasks expectations <task>`.\n3. Assess each Expectation you verified, citing evidence; one you could not check is `unmet`, with the reason.\n4. Close it: `skrr tasks complete <task> --summary \"…\"` submits the Result and closes the Task in\n one step. When its `reviewPolicy` is `required`, submit with `skrr tasks result submit\n --request-completion` instead: a Review is owed, and your close as the owner would skip it. Set\n the flag only when the entire current Task scope has been delivered; the server then decides\n review or completion after the run ends, and without it the Task stays in progress.\n5. Read the Task back and report that state, not the one you intended.\n\nAn unmet Expectation or a `changes_requested` Review does not stop a close; it is recorded on it.\nSo if the work does not hold up, leave the Task open, say which Expectation failed, and record what\nblocks it as a `blocker` Update; its shape is in `updates`.\n\n## Authority\n\n| Actor | May do | Only a person may do |\n| --- | --- | --- |\n| Agent | Create and work Tasks; record Updates, Deliverables and Results; assess any Expectation that takes a judgement, citing evidence; review a Result another actor submitted | Waive an Expectation; confirm a Deliverable; make an attachment a Run input; close past a required Review |\n| Person | Everything in both columns | — |\n\nThe server cannot always tell an Agent from the person whose login it holds, so an accepted call\nis not permission: the right-hand column stays a person's even when the call would succeed. Never\nsupply or invent an Agent identity; the platform records who wrote each record.\nInside a Task's Run that is the Agent; in a session started with a person's login, it is that person.\n\nA required Review (`reviewPolicy` `required`) refuses a close only by a non-owner. The owner, and\nan Agent acting for the owner, can close without it, and that is the owner's decision. A non-owner\ncloses past it with `--force`, which records the override.\n\n## Live state\n\n- `skrr tasks show <task> --json` — status, Expectations, assignment and the Task URL.\n- `skrr tasks expectations <task>` — what is owed, with ids, and how far each one got.\n- `skrr tasks actionability <task>` — who can move the Task next, and why.\n- `skrr tasks review-queue --space <space-id>` — every judgement still outstanding in a Space.\n\n## Related guides\n\n- `spaces` — which Space, Project or Goal work belongs to, and who may work in a Space.\n- `agents` — which Agent you are, and where it runs.\n- `duties` — coming back to work later, and what an Agent keeps true over time.",
1467
+ "hash": "0fbbd8856383ab6cfd54ee5d1bea8c7e32c01fff188c143c9398806e31e6975a",
1468
+ "tokens": 1479,
1469
1469
  "sections": [
1470
1470
  {
1471
1471
  "id": "records",
@@ -1610,7 +1610,7 @@
1610
1610
  "id": "result-review",
1611
1611
  "title": "Result and Review",
1612
1612
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
1613
- "tokens": 619,
1613
+ "tokens": 672,
1614
1614
  "aliases": [],
1615
1615
  "explains": [
1616
1616
  "TASK_REOPEN_REQUIRED",
@@ -2421,7 +2421,7 @@
2421
2421
  "id": "result-review",
2422
2422
  "title": "Result and Review",
2423
2423
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
2424
- "tokens": 619,
2424
+ "tokens": 672,
2425
2425
  "aliases": [],
2426
2426
  "explains": [
2427
2427
  "TASK_REOPEN_REQUIRED",
@@ -2631,7 +2631,7 @@
2631
2631
  "id": "result-review",
2632
2632
  "title": "Result and Review",
2633
2633
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
2634
- "tokens": 619,
2634
+ "tokens": 672,
2635
2635
  "aliases": [],
2636
2636
  "explains": [
2637
2637
  "TASK_REOPEN_REQUIRED",
@@ -2838,7 +2838,7 @@
2838
2838
  "id": "result-review",
2839
2839
  "title": "Result and Review",
2840
2840
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
2841
- "tokens": 619,
2841
+ "tokens": 672,
2842
2842
  "aliases": [],
2843
2843
  "explains": [
2844
2844
  "TASK_REOPEN_REQUIRED",
@@ -3057,7 +3057,7 @@
3057
3057
  "id": "result-review",
3058
3058
  "title": "Result and Review",
3059
3059
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
3060
- "tokens": 619,
3060
+ "tokens": 672,
3061
3061
  "aliases": [],
3062
3062
  "explains": [
3063
3063
  "TASK_REOPEN_REQUIRED",
@@ -3264,7 +3264,7 @@
3264
3264
  "id": "result-review",
3265
3265
  "title": "Result and Review",
3266
3266
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
3267
- "tokens": 619,
3267
+ "tokens": 672,
3268
3268
  "aliases": [],
3269
3269
  "explains": [
3270
3270
  "TASK_REOPEN_REQUIRED",
@@ -3474,7 +3474,7 @@
3474
3474
  "id": "result-review",
3475
3475
  "title": "Result and Review",
3476
3476
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
3477
- "tokens": 619,
3477
+ "tokens": 672,
3478
3478
  "aliases": [],
3479
3479
  "explains": [
3480
3480
  "TASK_REOPEN_REQUIRED",
@@ -3684,7 +3684,7 @@
3684
3684
  "id": "result-review",
3685
3685
  "title": "Result and Review",
3686
3686
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
3687
- "tokens": 619,
3687
+ "tokens": 672,
3688
3688
  "aliases": [],
3689
3689
  "explains": [
3690
3690
  "TASK_REOPEN_REQUIRED",
@@ -3896,7 +3896,7 @@
3896
3896
  "id": "result-review",
3897
3897
  "title": "Result and Review",
3898
3898
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
3899
- "tokens": 619,
3899
+ "tokens": 672,
3900
3900
  "aliases": [],
3901
3901
  "explains": [
3902
3902
  "TASK_REOPEN_REQUIRED",
@@ -3959,9 +3959,9 @@
3959
3959
  "TASK_REVIEW_RATIONALE_REQUIRED",
3960
3960
  "TASK_EXPECTATIONS_NOT_MET"
3961
3961
  ],
3962
- "body": "Read this when you submit a Task's Result, or accept or question someone else's.\n\nThe Result is the finished answer, submitted once. A subject-matter conclusion (NO-SHIP, BUY,\nREJECT, a root cause, an experiment's verdict) goes in its `conclusion`, never in a Review. An\namendment is a new version that supersedes the previous one; there is one current Result, and\nolder versions stay in Activity.\n\nA Review is another actor's decision on one exact Result: `accepted` means the submitted work was\naccepted, `changes_requested` that it was not, with a rationale. Never review a Result you or\nyour own Agent submitted, even where the call would be accepted.\n\nSubmitting a Result does not close the Task. Say \"ready for review\" only when something you read\nsaid so.\n`result submit` reports where the Task stands after the write; read that. `skrr tasks complete`\nsubmits the Result and advances the workflow in one closeout; do not call `tasks report` before or\nafter it.\n\n## Example\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\nAnother actor, never the submitter, reviews it:\n`skrr tasks review <task-id> --result-id <result-id> --decision accepted --rationale \"Evidence checked\"`.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `TASK_REOPEN_REQUIRED` | The Task is already completed, cancelled or hidden. | Reopen the Task first. |\n| `TASK_RESULT_IDEMPOTENCY_CONFLICT` | The key already names a different Result. | Give this Result its own key. |\n| `TASK_RESULT_AGENT_RUN_REQUIRED` | An Agent submitted with no Run of this Task to cite. | Submit from the Run executing the Task. |\n| `TASK_RESULT_ACTOR_MISMATCH` | The cited Run belongs to another Agent. | Cite your own Run. |\n| `TASK_RESULT_RESOURCE_LINK_MISMATCH` | A Deliverable link is not a Deliverable of this Task. | Use the link id its Deliverable was recorded with. |\n| `TASK_RESULT_SUPERSEDED` | The Review names a Result that is no longer current. | Review the current Result. |\n| `TASK_REVIEW_SELF_ACCEPTANCE` | The reviewer is the principal who submitted the Result. | Another principal reviews it. |\n| `TASK_REVIEW_RATIONALE_REQUIRED` | `changes_requested` came with no rationale. | Say what has to change. |\n| `TASK_EXPECTATIONS_NOT_MET` | An acceptance came while an Expectation was unassessed or unmet. | Assess each Expectation the refusal lists, then review again. |",
3963
- "hash": "05864b887642184579a1275221225df37b4c2bf14f87dcbcbda2814225b2f263",
3964
- "tokens": 619,
3962
+ "body": "Read this when you submit a Task's Result, or accept or question someone else's.\n\nThe Result is the finished answer, submitted once. A subject-matter conclusion (NO-SHIP, BUY,\nREJECT, a root cause, an experiment's verdict) goes in its `conclusion`, never in a Review. An\namendment is a new version that supersedes the previous one; there is one current Result, and\nolder versions stay in Activity.\n\nA Review is another actor's decision on one exact Result: `accepted` means the submitted work was\naccepted, `changes_requested` that it was not, with a rationale. Never review a Result you or\nyour own Agent submitted, even where the call would be accepted.\n\nSubmitting a Result does not close the Task. Say \"ready for review\" only when something you read\nsaid so.\n`result submit` reports where the Task stands after the write; read that. `skrr tasks complete`\nsubmits the Result and advances the workflow in one closeout; do not call `tasks report` before or\nafter it.\nAdd `--request-completion` to `result submit` when the entire current Task scope has been delivered;\nthe server then decides review or completion after the run ends. Without it the Task stays open, so\nleave it off for intermediate progress or remaining work.\n\n## Example\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\nAnother actor, never the submitter, reviews it:\n`skrr tasks review <task-id> --result-id <result-id> --decision accepted --rationale \"Evidence checked\"`.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `TASK_REOPEN_REQUIRED` | The Task is already completed, cancelled or hidden. | Reopen the Task first. |\n| `TASK_RESULT_IDEMPOTENCY_CONFLICT` | The key already names a different Result. | Give this Result its own key. |\n| `TASK_RESULT_AGENT_RUN_REQUIRED` | An Agent submitted with no Run of this Task to cite. | Submit from the Run executing the Task. |\n| `TASK_RESULT_ACTOR_MISMATCH` | The cited Run belongs to another Agent. | Cite your own Run. |\n| `TASK_RESULT_RESOURCE_LINK_MISMATCH` | A Deliverable link is not a Deliverable of this Task. | Use the link id its Deliverable was recorded with. |\n| `TASK_RESULT_SUPERSEDED` | The Review names a Result that is no longer current. | Review the current Result. |\n| `TASK_REVIEW_SELF_ACCEPTANCE` | The reviewer is the principal who submitted the Result. | Another principal reviews it. |\n| `TASK_REVIEW_RATIONALE_REQUIRED` | `changes_requested` came with no rationale. | Say what has to change. |\n| `TASK_EXPECTATIONS_NOT_MET` | An acceptance came while an Expectation was unassessed or unmet. | Assess each Expectation the refusal lists, then review again. |",
3963
+ "hash": "049c293bbd44f0cc048d8ef554c98db49a75a22ce859bae257ccff44dad90202",
3964
+ "tokens": 672,
3965
3965
  "sections": [
3966
3966
  {
3967
3967
  "id": "records",
@@ -4106,7 +4106,7 @@
4106
4106
  "id": "result-review",
4107
4107
  "title": "Result and Review",
4108
4108
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
4109
- "tokens": 619,
4109
+ "tokens": 672,
4110
4110
  "aliases": [],
4111
4111
  "explains": [
4112
4112
  "TASK_REOPEN_REQUIRED",
@@ -4314,7 +4314,7 @@
4314
4314
  "id": "result-review",
4315
4315
  "title": "Result and Review",
4316
4316
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
4317
- "tokens": 619,
4317
+ "tokens": 672,
4318
4318
  "aliases": [],
4319
4319
  "explains": [
4320
4320
  "TASK_REOPEN_REQUIRED",
@@ -4517,7 +4517,7 @@
4517
4517
  "id": "result-review",
4518
4518
  "title": "Result and Review",
4519
4519
  "readWhen": "you submit a Task's Result, or accept or question someone else's",
4520
- "tokens": 619,
4520
+ "tokens": 672,
4521
4521
  "aliases": [],
4522
4522
  "explains": [
4523
4523
  "TASK_REOPEN_REQUIRED",
@@ -179,6 +179,11 @@ export declare function renderTacticResult(compass: Compass, log: (line: string)
179
179
  */
180
180
  export declare function renderEffectivePolicy(policy: Record<string, unknown>, log: (line: string) => void): void;
181
181
  export declare function renderRevisionList(rows: CompassRevision[], log: (line: string) => void): void;
182
+ /**
183
+ * A viewer who does not own a Duty reads its Checks', Runs' and boundary changes' prose as the
184
+ * withheld marker (OSK-33463); the EVENT column says `(owner only)` in its place. `--json` prints
185
+ * the marker as the server sent it.
186
+ */
182
187
  export declare function renderCompassTrace(trace: CompassTrace, log: (line: string) => void): void;
183
188
  /**
184
189
  * The ledger's name for a row. A revert is stored as `auto_revert`, which reads as something the
@@ -349,6 +349,11 @@ function renderRevisionList(rows, log) {
349
349
  { key: 'reason', header: 'REASON', maxWidth: 50 },
350
350
  ], log);
351
351
  }
352
+ /**
353
+ * A viewer who does not own a Duty reads its Checks', Runs' and boundary changes' prose as the
354
+ * withheld marker (OSK-33463); the EVENT column says `(owner only)` in its place. `--json` prints
355
+ * the marker as the server sent it.
356
+ */
352
357
  function renderCompassTrace(trace, log) {
353
358
  const title = trace.compass.title ?? trace.compass.id;
354
359
  log(`${title} — Compass trace (v${trace.compass.version}, ${trace.compass.status})`);
@@ -360,7 +365,7 @@ function renderCompassTrace(trace, log) {
360
365
  when: shortDate(event.occurredAt),
361
366
  type: event.type.replace(RENDER_COMPASS_TRACE_RE, ' '),
362
367
  status: event.status ?? '—',
363
- event: event.summary ?? '—',
368
+ event: (0, data_provider_1.isDutyReasonWithheld)(event.summary) ? '(owner only)' : (event.summary ?? '—'),
364
369
  duty: String(event.references?.dutyId ?? '—'),
365
370
  version: event.references?.compassVersion
366
371
  ? `v${String(event.references.compassVersion)}`
@@ -1072,6 +1072,25 @@ export declare function dutyWriteWarnings(response: unknown, fallback: {
1072
1072
  }): DutyAuthoringWarning[];
1073
1073
  /** One `Warning:` line per authoring warning, after the write's own output. */
1074
1074
  export declare function renderDutyWriteWarnings(warnings: DutyAuthoringWarning[], warn: (line: string) => void): void;
1075
+ /**
1076
+ * What became of a cadence change the server did not simply write (OSK-33445). An Agent's change
1077
+ * to a non-draft Duty's cadence is a request for the owner: `awaiting_approval` until they decide,
1078
+ * or `applied` when they allowed the Agent to tune within their limits.
1079
+ */
1080
+ export type DutyCadenceRequestReceipt = {
1081
+ status: 'awaiting_approval' | 'applied';
1082
+ requestId?: string;
1083
+ requestedIntervalMs?: number;
1084
+ currentIntervalMs?: number | null;
1085
+ intervalMs?: number;
1086
+ approvalReason?: string;
1087
+ unchanged?: boolean;
1088
+ replayed?: boolean;
1089
+ };
1090
+ /** Read the receipt off a PATCH answer, or `undefined` when the cadence was written as sent. */
1091
+ export declare function readDutyCadenceRequest(response: unknown): DutyCadenceRequestReceipt | undefined;
1092
+ /** The line `duties update` prints instead of "Updated duty" when the cadence became a request. */
1093
+ export declare function describeDutyCadenceRequest(receipt: DutyCadenceRequestReceipt, dutyId?: string): string;
1075
1094
  export declare function describeDutyRevision(revision: DutyRevisionReceipt | undefined): string;
1076
1095
  /**
1077
1096
  * A duty's priority, as one line: `high · weight 70 · from northstar`.
@@ -1126,6 +1145,8 @@ latestCheck?: {
1126
1145
  * same reason as `latestCheck`: only `show` reads them from the server.
1127
1146
  */
1128
1147
  scheduleIssues?: DutyScheduleIssue[] | null): void;
1148
+ /** What `show` prints where the latest finding would be, for a viewer who is not the Duty's owner. */
1149
+ export declare const DUTY_FINDING_WITHHELD_LINE = "Only the Duty's owner can read the latest finding.";
1129
1150
  /**
1130
1151
  * Whether a check woke the agent, in plain words (OSK-4884).
1131
1152
  *
@@ -1169,6 +1190,12 @@ export declare function isHeldCycleRun(run: DutyCycle['runs'][number]): boolean;
1169
1190
  * `running`, so its `failureCode` is null and this is the only place the code is said.
1170
1191
  */
1171
1192
  export declare function heldRunFailureCode(run: DutyCycle['runs'][number]): string | null;
1193
+ /**
1194
+ * Why a held run is held, as the server names it (OSK-33272): the hold's reason code, and its cause when the writer
1195
+ * recorded one that is not the failure code. A reason this CLI does not know is printed as written, marked. Null from
1196
+ * an older server, which named neither.
1197
+ */
1198
+ export declare function heldRunHoldReason(run: DutyCycle['runs'][number]): string | null;
1172
1199
  /** The review command for a held run, naming its Agent when the server did. */
1173
1200
  export declare function heldRunReviewCommand(run: DutyCycle['runs'][number]): string;
1174
1201
  /**
@@ -1236,6 +1263,8 @@ export declare function renderDutyObservations(response: ReadModelRecord, log: (
1236
1263
  export declare function renderDutyHypotheses(response: ReadModelRecord, log: (line: string) => void, options?: {
1237
1264
  emptyMessage?: string;
1238
1265
  }): void;
1266
+ /** Notes under the hypothesis table: each claim whose falsifier can never fire, and what that means. */
1267
+ export declare function hypothesisLegend(data: ReadModelRecord[]): string[];
1239
1268
  /** Old servers could associate work by logical ID without proving its source.
1240
1269
  * Never render or print those rows unless the server explicitly declares that
1241
1270
  * the source is supported. This also protects JSON output during mixed rollout.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BOUND_HYPOTHESES_NOTE = exports.BOUND_CASES_NOTE = exports.DUTY_CLI_EVALUATORS = exports.DUTY_CREATE_KEYS = exports.DUTY_REMEDIATION_ACTIONS = exports.DUTY_FEEDBACK_KINDS = exports.dutyApi = exports.dutyPackApi = exports.MAX_DUTY_INTERVAL_MS = exports.MIN_DUTY_INTERVAL_MS = exports.DUTY_EXECUTION_ISOLATION_MODES = exports.DUTY_AUTHORABLE_CADENCE_MODES = exports.DUTY_KIND_VALUES = exports.DUTY_STATUSES = exports.DUTY_CADENCE_MAX_TIMES = exports.DUTY_CADENCE_TIME_PATTERN = exports.DUTY_CADENCE_MODES = exports.DUTY_TEMPLATE_IDS = exports.DUTY_WATCHED_SOURCES = void 0;
3
+ exports.BOUND_HYPOTHESES_NOTE = exports.BOUND_CASES_NOTE = exports.DUTY_FINDING_WITHHELD_LINE = exports.DUTY_CLI_EVALUATORS = exports.DUTY_CREATE_KEYS = exports.DUTY_REMEDIATION_ACTIONS = exports.DUTY_FEEDBACK_KINDS = exports.dutyApi = exports.dutyPackApi = exports.MAX_DUTY_INTERVAL_MS = exports.MIN_DUTY_INTERVAL_MS = exports.DUTY_EXECUTION_ISOLATION_MODES = exports.DUTY_AUTHORABLE_CADENCE_MODES = exports.DUTY_KIND_VALUES = exports.DUTY_STATUSES = exports.DUTY_CADENCE_MAX_TIMES = exports.DUTY_CADENCE_TIME_PATTERN = exports.DUTY_CADENCE_MODES = exports.DUTY_TEMPLATE_IDS = exports.DUTY_WATCHED_SOURCES = void 0;
4
4
  exports.activationRefusalLines = activationRefusalLines;
5
5
  exports.gateRefusesActivation = gateRefusesActivation;
6
6
  exports.permissionLines = permissionLines;
@@ -35,6 +35,8 @@ exports.describeStoppedBy = describeStoppedBy;
35
35
  exports.withLiveAssessment = withLiveAssessment;
36
36
  exports.dutyWriteWarnings = dutyWriteWarnings;
37
37
  exports.renderDutyWriteWarnings = renderDutyWriteWarnings;
38
+ exports.readDutyCadenceRequest = readDutyCadenceRequest;
39
+ exports.describeDutyCadenceRequest = describeDutyCadenceRequest;
38
40
  exports.describeDutyRevision = describeDutyRevision;
39
41
  exports.describeDutyPriority = describeDutyPriority;
40
42
  exports.describeBoundCompass = describeBoundCompass;
@@ -49,6 +51,7 @@ exports.renderDutyTrace = renderDutyTrace;
49
51
  exports.renderProactivenessScorecard = renderProactivenessScorecard;
50
52
  exports.isHeldCycleRun = isHeldCycleRun;
51
53
  exports.heldRunFailureCode = heldRunFailureCode;
54
+ exports.heldRunHoldReason = heldRunHoldReason;
52
55
  exports.heldRunReviewCommand = heldRunReviewCommand;
53
56
  exports.formatDutyCycles = formatDutyCycles;
54
57
  exports.hypothesisRefusalLines = hypothesisRefusalLines;
@@ -59,6 +62,7 @@ exports.describeObservationArtifacts = describeObservationArtifacts;
59
62
  exports.observationLegend = observationLegend;
60
63
  exports.renderDutyObservations = renderDutyObservations;
61
64
  exports.renderDutyHypotheses = renderDutyHypotheses;
65
+ exports.hypothesisLegend = hypothesisLegend;
62
66
  exports.safeDutyLineage = safeDutyLineage;
63
67
  exports.isDutyLineageUnavailable = isDutyLineageUnavailable;
64
68
  exports.renderDutyLineage = renderDutyLineage;
@@ -1389,6 +1393,36 @@ function renderDutyWriteWarnings(warnings, warn) {
1389
1393
  for (const warning of warnings)
1390
1394
  warn(warning.message);
1391
1395
  }
1396
+ /** Read the receipt off a PATCH answer, or `undefined` when the cadence was written as sent. */
1397
+ function readDutyCadenceRequest(response) {
1398
+ const receipt = response && typeof response === 'object'
1399
+ ? response.cadenceRequest
1400
+ : undefined;
1401
+ if (!receipt || typeof receipt !== 'object')
1402
+ return undefined;
1403
+ const status = receipt.status;
1404
+ return status === 'awaiting_approval' || status === 'applied'
1405
+ ? receipt
1406
+ : undefined;
1407
+ }
1408
+ /** The line `duties update` prints instead of "Updated duty" when the cadence became a request. */
1409
+ function describeDutyCadenceRequest(receipt, dutyId) {
1410
+ if (receipt.status === 'applied') {
1411
+ return receipt.unchanged
1412
+ ? `No cadence change: it already checks every ${describeIntervalMs(receipt.intervalMs)}.`
1413
+ : `Cadence changed to every ${describeIntervalMs(receipt.intervalMs)}: the owner lets the Agent tune it within their limits.`;
1414
+ }
1415
+ const current = receipt.currentIntervalMs == null
1416
+ ? ''
1417
+ : ` It still checks every ${describeIntervalMs(receipt.currentIntervalMs)} until then.`;
1418
+ const step = receipt.approvalReason === 'cadence_change_exceeds_max_relative_change'
1419
+ ? ' The step is larger than the owner lets the Agent take alone.'
1420
+ : '';
1421
+ const decide = `skrr duties cadence-requests decide ${dutyId || '<duty-id>'} ${receipt.requestId || '<request-id>'} --approve`;
1422
+ return (`Cadence change waiting for the owner's approval: every ${describeIntervalMs(receipt.requestedIntervalMs)} ` +
1423
+ `(request ${receipt.requestId || 'unknown'}).${current}${step} The owner decides with ` +
1424
+ `\`${decide}\` or in the app.`);
1425
+ }
1392
1426
  function describeDutyRevision(revision) {
1393
1427
  if (!revision || typeof revision.changed !== 'boolean')
1394
1428
  return 'Updated duty:';
@@ -1597,7 +1631,15 @@ scheduleIssues) {
1597
1631
  log('This statement alone does not prove that the evidence was observed or the work succeeded.');
1598
1632
  }
1599
1633
  }
1634
+ else if ((0, data_provider_2.isDutyReasonWithheld)(latestCheck?.decision?.whyNow)) {
1635
+ // A viewer who is not the owner gets no `state.summary` (a copy of the latest `whyNow`) and the
1636
+ // marker in `whyNow` itself (OSK-33448). Say whose it is rather than print nothing.
1637
+ log('');
1638
+ log(exports.DUTY_FINDING_WITHHELD_LINE);
1639
+ }
1600
1640
  }
1641
+ /** What `show` prints where the latest finding would be, for a viewer who is not the Duty's owner. */
1642
+ exports.DUTY_FINDING_WITHHELD_LINE = "Only the Duty's owner can read the latest finding.";
1601
1643
  /**
1602
1644
  * Short humanization of a skipped invocation's reason CODE (OSK-4884). The
1603
1645
  * server records why it declined to wake the agent as a machine token; a reader
@@ -1678,20 +1720,24 @@ function renderCheckList(checks, log) {
1678
1720
  // list there is "not retained", never "none" (OSK-15148). Its retained
1679
1721
  // explanation stands in for the stripped `whyNow`.
1680
1722
  const retainedCount = (c, list) => c.historyDetail && !list?.length ? '-' : String(list?.length ?? 0);
1681
- (0, format_1.renderTable)(checks.map((c) => ({
1682
- started: c.startedAt ?? '-',
1683
- kind: c.checkKind ?? '-',
1684
- status: c.status ?? '-',
1685
- posture: c.decision?.posture ?? '-',
1686
- loops: retainedCount(c, c.openLoops),
1687
- actions: retainedCount(c, c.actionPlan),
1688
- woke: describeWakeDecision(c),
1689
- why: c.decision?.whyNow ??
1723
+ (0, format_1.renderTable)(checks.map((c) => {
1724
+ const why = c.decision?.whyNow ??
1690
1725
  c.decision?.summary ??
1691
1726
  c.reason ??
1692
- (c.historyDetail ? '(detail not retained)' : ''),
1693
- id: c.id ?? '-',
1694
- })), [
1727
+ (c.historyDetail ? '(detail not retained)' : '');
1728
+ return {
1729
+ started: c.startedAt ?? '-',
1730
+ kind: c.checkKind ?? '-',
1731
+ status: c.status ?? '-',
1732
+ posture: c.decision?.posture ?? '-',
1733
+ loops: retainedCount(c, c.openLoops),
1734
+ actions: retainedCount(c, c.actionPlan),
1735
+ woke: describeWakeDecision(c),
1736
+ // A viewer who is not the Duty's owner is sent a marker in place of the sentence (OSK-33448).
1737
+ why: (0, data_provider_2.isDutyReasonWithheld)(why) ? '(owner only)' : why,
1738
+ id: c.id ?? '-',
1739
+ };
1740
+ }), [
1695
1741
  { key: 'started', header: 'STARTED', maxWidth: 24 },
1696
1742
  { key: 'kind', header: 'KIND', maxWidth: 10 },
1697
1743
  { key: 'status', header: 'STATUS', maxWidth: 10 },
@@ -2203,6 +2249,23 @@ function heldRunFailureCode(run) {
2203
2249
  const code = run.heldForReview?.failureCode;
2204
2250
  return typeof code === 'string' && code ? code : null;
2205
2251
  }
2252
+ /**
2253
+ * Why a held run is held, as the server names it (OSK-33272): the hold's reason code, and its cause when the writer
2254
+ * recorded one that is not the failure code. A reason this CLI does not know is printed as written, marked. Null from
2255
+ * an older server, which named neither.
2256
+ */
2257
+ function heldRunHoldReason(run) {
2258
+ const held = run
2259
+ .heldForReview;
2260
+ const reason = typeof held?.holdReason === 'string' && held.holdReason ? held.holdReason : null;
2261
+ if (!reason)
2262
+ return null;
2263
+ const cause = typeof held?.holdCause === 'string' && held.holdCause ? held.holdCause : null;
2264
+ const named = (0, data_provider_2.isDutyResultHoldReason)(reason)
2265
+ ? reason
2266
+ : `${reason}, a reason this CLI does not know; \`skrr update\` for details`;
2267
+ return cause ? `${named}; cause: ${cause}` : named;
2268
+ }
2206
2269
  /** The review command for a held run, naming its Agent when the server did. */
2207
2270
  function heldRunReviewCommand(run) {
2208
2271
  const agentId = run.heldForReview?.agentId;
@@ -2318,7 +2381,12 @@ function formatDutyCycles(page) {
2318
2381
  lines.push(` ${line}`);
2319
2382
  if (isHeldCycleRun(run)) {
2320
2383
  const heldCode = heldRunFailureCode(run);
2321
- lines.push(` run ${run.id} held for review${heldCode ? ` (its turn failed: ${heldCode})` : ''} — review it with \`${heldRunReviewCommand(run)}\``);
2384
+ const heldWhy = heldRunHoldReason(run);
2385
+ const notes = [
2386
+ heldWhy ? `held because: ${heldWhy}` : '',
2387
+ heldCode ? `its turn failed: ${heldCode}` : '',
2388
+ ].filter(Boolean);
2389
+ lines.push(` run ${run.id} held for review${notes.length ? ` (${notes.join('; ')})` : ''} — review it with \`${heldRunReviewCommand(run)}\``);
2322
2390
  }
2323
2391
  if (!['machine', 'contract', 'work'].includes(run.failureClass))
2324
2392
  continue;
@@ -2601,7 +2669,7 @@ function renderDutyHypotheses(response, log, options = {}) {
2601
2669
  // difference between a real check and a degraded self-certification
2602
2670
  // (OSK-10954). (A hypothesis carries no `confidence` — that is an
2603
2671
  // observation concept — so the column that read it was always empty.)
2604
- falsifier: describeFalsifier(item.falsifier),
2672
+ falsifier: describeFalsifier(item.falsifier, item.falsifierCannotFire),
2605
2673
  authority: text(item.authority),
2606
2674
  episode: (0, format_1.formatCell)(item.episode),
2607
2675
  })), [
@@ -2612,6 +2680,40 @@ function renderDutyHypotheses(response, log, options = {}) {
2612
2680
  { key: 'authority', header: 'AUTHORITY', maxWidth: 18 },
2613
2681
  { key: 'episode', header: 'EP', maxWidth: 4 },
2614
2682
  ], options.emptyMessage || 'No hypotheses recorded.', log);
2683
+ for (const line of hypothesisLegend(data))
2684
+ log(line);
2685
+ }
2686
+ /**
2687
+ * Why a falsifier bound to a declared key can never fire, as the server derives it (OSK-33475). The column shows
2688
+ * the short form; the legend names the claim and the key, which the 26-character column cannot.
2689
+ */
2690
+ const FALSIFIER_CANNOT_FIRE_CELL = {
2691
+ no_comparator: 'cannot fire: no comparator',
2692
+ no_threshold: 'cannot fire: no threshold',
2693
+ };
2694
+ const FALSIFIER_CANNOT_FIRE_WORDS = {
2695
+ no_comparator: () => 'it names no comparator the platform evaluates',
2696
+ no_threshold: (comparator) => `comparator "${comparator}" has no numeric threshold to compare against`,
2697
+ };
2698
+ function cannotFireReason(value) {
2699
+ return typeof value === 'string' &&
2700
+ Object.prototype.hasOwnProperty.call(FALSIFIER_CANNOT_FIRE_CELL, value)
2701
+ ? value
2702
+ : undefined;
2703
+ }
2704
+ /** Notes under the hypothesis table: each claim whose falsifier can never fire, and what that means. */
2705
+ function hypothesisLegend(data) {
2706
+ const lines = [];
2707
+ for (const item of data) {
2708
+ const why = cannotFireReason(item.falsifierCannotFire);
2709
+ if (!why)
2710
+ continue;
2711
+ const falsifier = record(item.falsifier) || {};
2712
+ lines.push(`CANNOT FIRE ${text(item.id)}: the falsifier on key ${text(falsifier.observationKey)} can never fire, because ` +
2713
+ `${FALSIFIER_CANNOT_FIRE_WORDS[why](text(falsifier.comparator))}. The platform will not settle this claim; ` +
2714
+ 'only a run can.');
2715
+ }
2716
+ return lines;
2615
2717
  }
2616
2718
  /**
2617
2719
  * One falsifier rendered as what settles the claim, not just its kind.
@@ -2620,10 +2722,14 @@ function renderDutyHypotheses(response, log, options = {}) {
2620
2722
  * `agent_check` stays the literal kind — the claim can only be settled by the
2621
2723
  * same agent that proposed it, and the column should keep saying so.
2622
2724
  */
2623
- function describeFalsifier(falsifier) {
2725
+ function describeFalsifier(falsifier, cannotFire) {
2624
2726
  const f = record(falsifier);
2625
2727
  if (!f)
2626
2728
  return '-';
2729
+ const why = cannotFireReason(cannotFire);
2730
+ // A key that can never settle the claim is not "a real check", so the column must not name it as one.
2731
+ if (why)
2732
+ return FALSIFIER_CANNOT_FIRE_CELL[why];
2627
2733
  if (f.kind === 'observation_key' && typeof f.observationKey === 'string') {
2628
2734
  return `key:${f.observationKey}`;
2629
2735
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The words `skrr agents permissions` prints for one "Always allow" rule (OSK-33440 P2-3). The web
3
+ * settings card says the same things: what the rule covers, where it applies, where it was granted
4
+ * from, and how often it has run.
5
+ */
6
+ import type { AgentPermissionRuleView, PermissionRuleGrantOutcome } from '@skrr-ai/data-provider';
7
+ /**
8
+ * What a rule covers. "any command", and the Task Runs preset (OSK-33426), are worded here, never
9
+ * read from a stored label.
10
+ */
11
+ export declare function ruleCovers(rule: AgentPermissionRuleView): string;
12
+ export declare function ruleWhere(rule: AgentPermissionRuleView): string;
13
+ export declare function ruleGranted(rule: AgentPermissionRuleView): string;
14
+ export declare function ruleUse(rule: AgentPermissionRuleView): string;
15
+ /** One rule as a short block: what it covers, then its id and details. */
16
+ export declare function ruleLines(rule: AgentPermissionRuleView): string[];
17
+ /**
18
+ * What came of "Always allow …" chosen on a parked Task approval, as one line. The web card says
19
+ * the same through its toast.
20
+ */
21
+ export declare function ruleOutcomeLine(outcome: PermissionRuleGrantOutcome): string;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ruleCovers = ruleCovers;
4
+ exports.ruleWhere = ruleWhere;
5
+ exports.ruleGranted = ruleGranted;
6
+ exports.ruleUse = ruleUse;
7
+ exports.ruleLines = ruleLines;
8
+ exports.ruleOutcomeLine = ruleOutcomeLine;
9
+ /**
10
+ * What a rule covers. "any command", and the Task Runs preset (OSK-33426), are worded here, never
11
+ * read from a stored label.
12
+ */
13
+ function ruleCovers(rule) {
14
+ if (rule.runs === 'task')
15
+ return 'any tool or command in Task Runs';
16
+ return rule.match?.kind === 'any' ? 'any command' : rule.label;
17
+ }
18
+ function ruleWhere(rule) {
19
+ if (rule.where?.kind === 'machine') {
20
+ const id = rule.where.harnessId;
21
+ if (rule.where.name)
22
+ return id ? `on ${rule.where.name} (${id})` : `on ${rule.where.name}`;
23
+ return id ? `on machine ${id}` : 'on a machine';
24
+ }
25
+ return 'in the cloud';
26
+ }
27
+ function ruleGranted(rule) {
28
+ if (rule.source?.from === 'preset') {
29
+ const at = rule.createdAt ? `added ${rule.createdAt}` : 'added';
30
+ return `${at} automatically: Task Runs on your own machine don't ask. Remove it and they ask you again`;
31
+ }
32
+ const at = rule.createdAt ? `granted ${rule.createdAt}` : 'granted';
33
+ if (rule.source?.taskId)
34
+ return `${at} from Task ${rule.source.taskId}`;
35
+ if (rule.source?.conversationId)
36
+ return `${at} from chat ${rule.source.conversationId}`;
37
+ return at;
38
+ }
39
+ function ruleUse(rule) {
40
+ const count = rule.useCount ?? 0;
41
+ if (count === 0)
42
+ return 'not used yet';
43
+ const times = count === 1 ? 'used once' : `used ${count} times`;
44
+ return rule.lastUsedAt ? `${times}, last ${rule.lastUsedAt}` : times;
45
+ }
46
+ /** One rule as a short block: what it covers, then its id and details. */
47
+ function ruleLines(rule) {
48
+ return [
49
+ // The Task Runs preset covers every tool, so naming one (`*`) would say nothing.
50
+ rule.runs === 'task' ? ruleCovers(rule) : `${ruleCovers(rule)} (${rule.tool})`,
51
+ ` id: ${rule.id}`,
52
+ ` ${ruleWhere(rule)}; ${ruleGranted(rule)}`,
53
+ ` ${ruleUse(rule)}`,
54
+ ];
55
+ }
56
+ /** Why an "Always allow" saved no rule. Every one says the call itself was still allowed. */
57
+ const REFUSAL_LINES = {
58
+ invalid_context: 'Allowed this once. The rule could not be saved, so the Agent asks again next time.',
59
+ unavailable: 'Allowed this once. The rule could not be saved, so the Agent asks again next time.',
60
+ unsupported_place: 'Allowed this once. Rules are not available where this Agent runs yet, so it asks again next time.',
61
+ not_owner: "Allowed this once. Only the Agent's owner can save a rule, so it asks again next time.",
62
+ option_unavailable: 'Allowed this once. That rule no longer fits this call, so the Agent asks again next time.',
63
+ too_many_rules: 'Allowed this once. This Agent already holds as many rules as it can: remove one with `skrr agents permissions remove`.',
64
+ not_interactive: 'Allowed this once. A rule is saved only when you choose it on the card in the app, so the Agent asks again next time.',
65
+ };
66
+ /**
67
+ * What came of "Always allow …" chosen on a parked Task approval, as one line. The web card says
68
+ * the same through its toast.
69
+ */
70
+ function ruleOutcomeLine(outcome) {
71
+ if (!outcome.granted)
72
+ return REFUSAL_LINES[outcome.reason];
73
+ const covers = outcome.breadth === 'any' ? 'any command' : outcome.label;
74
+ return `Saved a rule for ${covers}: the Agent runs calls it covers without asking you. See or remove it with \`skrr agents permissions list <agent>\`.`;
75
+ }
@@ -161,7 +161,14 @@ function spaceProposalDetailLines(item, binName) {
161
161
  const produced = spaceMemoryProducerLine(item);
162
162
  if (produced)
163
163
  lines.push(` ${item.id} ${produced}`);
164
- if (item.kind === 'page_suggestion' && item.page) {
164
+ if (item.kind === 'page_suggestion' && item.page?.create) {
165
+ // A proposal to create a page (OSK-33418): there is no page to open yet.
166
+ const create = item.page.create;
167
+ lines.push(` ${item.id} create page "${create.title}" at ${create.path} (${create.kind})`);
168
+ if (item.page.truncated)
169
+ lines.push(` ${item.id} (draft shortened here; the proposal's details on the web show all of it)`);
170
+ }
171
+ else if (item.kind === 'page_suggestion' && item.page) {
165
172
  const where = item.page.anchor
166
173
  ? (0, data_provider_1.describePageSectionAnchor)(item.page.anchor)
167
174
  : 'the marked text';