@skrr-ai/cli 0.1.165 → 0.1.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-command.js +0 -1
- package/dist/commands/activity/scan-older.d.ts +1 -1
- package/dist/commands/activity/scan-older.js +5 -4
- package/dist/commands/agent/message/approve.d.ts +1 -0
- package/dist/commands/agent/message/approve.js +6 -2
- package/dist/commands/agent/message/decline.d.ts +1 -0
- package/dist/commands/agent/message/decline.js +6 -2
- package/dist/commands/agent/message/pending.js +5 -2
- package/dist/commands/agent/message/review.d.ts +13 -0
- package/dist/commands/agent/message/review.js +68 -0
- package/dist/commands/agents/always-on/recovery-close.d.ts +28 -0
- package/dist/commands/agents/always-on/recovery-close.js +60 -0
- package/dist/commands/agents/always-on/recovery-review.d.ts +22 -0
- package/dist/commands/agents/always-on/recovery-review.js +190 -0
- package/dist/commands/apps/installations/compatibility.js +1 -1
- package/dist/commands/apps/installations/list.js +3 -0
- package/dist/commands/apps/installations/migrate/abort.d.ts +13 -0
- package/dist/commands/apps/installations/migrate/abort.js +45 -0
- package/dist/commands/apps/installations/migrate/cutover.d.ts +15 -0
- package/dist/commands/apps/installations/migrate/cutover.js +102 -0
- package/dist/commands/apps/installations/migrate/plan.d.ts +13 -0
- package/dist/commands/apps/installations/migrate/plan.js +51 -0
- package/dist/commands/apps/installations/migrate/rollback.d.ts +16 -0
- package/dist/commands/apps/installations/migrate/rollback.js +103 -0
- package/dist/commands/apps/installations/migrate/stage.d.ts +15 -0
- package/dist/commands/apps/installations/migrate/stage.js +96 -0
- package/dist/commands/apps/installations/migrate/status.d.ts +12 -0
- package/dist/commands/apps/installations/migrate/status.js +52 -0
- package/dist/commands/apps/installations/migrate/validate.d.ts +14 -0
- package/dist/commands/apps/installations/migrate/validate.js +58 -0
- package/dist/commands/apps/installations/show.js +8 -6
- package/dist/commands/apps/operations/check.js +1 -1
- package/dist/commands/apps/resume.js +1 -1
- package/dist/commands/apps/settings/set.js +22 -10
- package/dist/commands/duties/show.js +10 -0
- package/dist/commands/goals/key-results/assess.d.ts +2 -3
- package/dist/commands/goals/key-results/assess.js +5 -12
- package/dist/commands/harnesses/removal-references.d.ts +16 -0
- package/dist/commands/harnesses/removal-references.js +61 -0
- package/dist/commands/tasks/actionability.js +8 -3
- package/dist/commands/tasks/complete.js +35 -17
- package/dist/commands/tasks/expectations/assess.d.ts +1 -0
- package/dist/commands/tasks/expectations/assess.js +50 -21
- package/dist/commands/tasks/expectations.js +5 -2
- package/dist/commands/tasks/judge.d.ts +1 -0
- package/dist/commands/tasks/judge.js +17 -2
- package/dist/commands/tasks/result/submit.js +26 -17
- package/dist/commands/tasks/review-queue.js +2 -1
- package/dist/commands/tasks/review.d.ts +1 -0
- package/dist/commands/tasks/review.js +24 -3
- package/dist/commands/tasks/show.d.ts +13 -0
- package/dist/commands/tasks/show.js +41 -3
- package/dist/commands/tasks/updates/add.d.ts +1 -0
- package/dist/commands/tasks/updates/add.js +71 -21
- package/dist/commands/tasks/updates/list.d.ts +4 -0
- package/dist/commands/tasks/updates/list.js +3 -1
- package/dist/commands/tasks/waive.d.ts +1 -0
- package/dist/commands/tasks/waive.js +17 -2
- package/dist/generated/agent-guides.json +20 -20
- package/dist/lib/agent-activity.d.ts +3 -1
- package/dist/lib/agent-activity.js +50 -11
- package/dist/lib/api-fetch.js +32 -5
- package/dist/lib/appCompatibility.js +1 -1
- package/dist/lib/appData.d.ts +1 -1
- package/dist/lib/appData.js +6 -2
- package/dist/lib/appDataMigration.d.ts +204 -0
- package/dist/lib/appDataMigration.js +753 -0
- package/dist/lib/appDataMigrationCommand.d.ts +39 -0
- package/dist/lib/appDataMigrationCommand.js +90 -0
- package/dist/lib/appInstallations.d.ts +8 -0
- package/dist/lib/appInstallations.js +55 -2
- package/dist/lib/apps-command.js +17 -10
- package/dist/lib/harnesses.d.ts +24 -0
- package/dist/lib/harnesses.js +4 -0
- package/dist/lib/node-adapter.d.ts +0 -2
- package/dist/lib/node-adapter.js +46 -42
- package/dist/lib/rate-limit-retry.d.ts +4 -5
- package/dist/lib/rate-limit-retry.js +6 -10
- package/dist/lib/reference-syntax.d.ts +28 -0
- package/dist/lib/reference-syntax.js +91 -0
- package/dist/lib/refresh.d.ts +2 -0
- package/dist/lib/refresh.js +6 -0
- package/dist/lib/runtime-context.js +6 -0
- package/dist/lib/task-closure.d.ts +1 -1
- package/dist/lib/task-closure.js +1 -1
- package/dist/lib/task-operations.d.ts +28 -6
- package/dist/lib/task-operations.js +77 -4
- package/dist/lib/task-preflight.js +8 -3
- package/dist/lib/task-write-attribution.d.ts +183 -19
- package/dist/lib/task-write-attribution.js +270 -39
- package/dist/lib/write-outcome.d.ts +2 -0
- package/dist/lib/write-outcome.js +14 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +71 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +11635 -11306
- package/oclif.manifest.json +1387 -412
- package/package.json +5 -2
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"id": "expectations",
|
|
137
137
|
"title": "Expectations",
|
|
138
138
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
139
|
-
"tokens":
|
|
139
|
+
"tokens": 996,
|
|
140
140
|
"aliases": [],
|
|
141
141
|
"explains": [
|
|
142
142
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
]
|
|
726
726
|
}
|
|
727
727
|
],
|
|
728
|
-
"hash": "
|
|
728
|
+
"hash": "991a5c2dd127fb3ac5fd0923eff6dbab9637fcf6832627ec0d58b50e5b1e5eda",
|
|
729
729
|
"tokens": 557
|
|
730
730
|
},
|
|
731
731
|
"routedIndex": {
|
|
@@ -865,7 +865,7 @@
|
|
|
865
865
|
"id": "expectations",
|
|
866
866
|
"title": "Expectations",
|
|
867
867
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
868
|
-
"tokens":
|
|
868
|
+
"tokens": 996,
|
|
869
869
|
"aliases": [],
|
|
870
870
|
"explains": [
|
|
871
871
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -1385,7 +1385,7 @@
|
|
|
1385
1385
|
]
|
|
1386
1386
|
}
|
|
1387
1387
|
],
|
|
1388
|
-
"hash": "
|
|
1388
|
+
"hash": "57110be667c5b948121bb29a19e4f106df0828f1aa204ed5886fe39bebf6fdf7",
|
|
1389
1389
|
"tokens": 506
|
|
1390
1390
|
},
|
|
1391
1391
|
"cards": {
|
|
@@ -1401,7 +1401,7 @@
|
|
|
1401
1401
|
"task-management"
|
|
1402
1402
|
],
|
|
1403
1403
|
"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\n## Workflow\n\n### Close out\n\n1. Record what exists: each Deliverable, bound to the Expectation it answers.\n2. Submit the Result. That does not close the Task.\n3. Read what is still owed: `skrr tasks expectations <task>`.\n4. Assess each Expectation you verified, citing evidence; one you could not check is `unmet`, with the reason.\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.",
|
|
1404
|
-
"hash": "
|
|
1404
|
+
"hash": "0b64df0f193c5a3f3bc492dd0b60729ad2ff3f49c86d66d7f2a9c2d9436b2e41",
|
|
1405
1405
|
"tokens": 1158,
|
|
1406
1406
|
"sections": [
|
|
1407
1407
|
{
|
|
@@ -1526,7 +1526,7 @@
|
|
|
1526
1526
|
"id": "expectations",
|
|
1527
1527
|
"title": "Expectations",
|
|
1528
1528
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
1529
|
-
"tokens":
|
|
1529
|
+
"tokens": 996,
|
|
1530
1530
|
"aliases": [],
|
|
1531
1531
|
"explains": [
|
|
1532
1532
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -2276,7 +2276,7 @@
|
|
|
2276
2276
|
"id": "expectations",
|
|
2277
2277
|
"title": "Expectations",
|
|
2278
2278
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
2279
|
-
"tokens":
|
|
2279
|
+
"tokens": 996,
|
|
2280
2280
|
"aliases": [],
|
|
2281
2281
|
"explains": [
|
|
2282
2282
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -2484,7 +2484,7 @@
|
|
|
2484
2484
|
"id": "expectations",
|
|
2485
2485
|
"title": "Expectations",
|
|
2486
2486
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
2487
|
-
"tokens":
|
|
2487
|
+
"tokens": 996,
|
|
2488
2488
|
"aliases": [],
|
|
2489
2489
|
"explains": [
|
|
2490
2490
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -2689,7 +2689,7 @@
|
|
|
2689
2689
|
"id": "expectations",
|
|
2690
2690
|
"title": "Expectations",
|
|
2691
2691
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
2692
|
-
"tokens":
|
|
2692
|
+
"tokens": 996,
|
|
2693
2693
|
"aliases": [],
|
|
2694
2694
|
"explains": [
|
|
2695
2695
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -2906,7 +2906,7 @@
|
|
|
2906
2906
|
"id": "expectations",
|
|
2907
2907
|
"title": "Expectations",
|
|
2908
2908
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
2909
|
-
"tokens":
|
|
2909
|
+
"tokens": 996,
|
|
2910
2910
|
"aliases": [],
|
|
2911
2911
|
"explains": [
|
|
2912
2912
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3111,7 +3111,7 @@
|
|
|
3111
3111
|
"id": "expectations",
|
|
3112
3112
|
"title": "Expectations",
|
|
3113
3113
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3114
|
-
"tokens":
|
|
3114
|
+
"tokens": 996,
|
|
3115
3115
|
"aliases": [],
|
|
3116
3116
|
"explains": [
|
|
3117
3117
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3318,7 +3318,7 @@
|
|
|
3318
3318
|
"id": "expectations",
|
|
3319
3319
|
"title": "Expectations",
|
|
3320
3320
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3321
|
-
"tokens":
|
|
3321
|
+
"tokens": 996,
|
|
3322
3322
|
"aliases": [],
|
|
3323
3323
|
"explains": [
|
|
3324
3324
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3526,7 +3526,7 @@
|
|
|
3526
3526
|
"id": "expectations",
|
|
3527
3527
|
"title": "Expectations",
|
|
3528
3528
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3529
|
-
"tokens":
|
|
3529
|
+
"tokens": 996,
|
|
3530
3530
|
"aliases": [],
|
|
3531
3531
|
"explains": [
|
|
3532
3532
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3610,9 +3610,9 @@
|
|
|
3610
3610
|
"TASK_EXPECTATION_RESOURCE_MISMATCH",
|
|
3611
3611
|
"TASK_EXPECTATION_RESULT_MISMATCH"
|
|
3612
3612
|
],
|
|
3613
|
-
"body": "Read this when you write, read or assess what a Task must make true before it closes.\n\n## Write them so they can be judged\n\nAn Expectation is a sentence first; a typed check says how it can be assessed and never replaces\nthe sentence. Say what would satisfy it and how that could be checked: one written without a\nthought about verification cannot be settled honestly later. A required Deliverable is one typed\nExpectation, not a second list. When you create several across several Tasks, say how many and\nwhom they fall to.\n\nEditing an Expectation or the description advances the Task's specification and revokes every\nassessment already recorded, so fix the statement before anyone settles it.\n\n`--expect` on `tasks create` and `tasks update` takes `<kind>[/<format>][:<target>]` for a\nDeliverable, `@<preset>`, or plain words a person settles. On `tasks update` it replaces the whole list.\n\n## Assess what you verified\n\nYou may assess any Expectation that takes a judgement. The assessment records who made it, as\n`met (agent)` or `met (person)`, and a person can override it. The control is attribution, so what\nyou owe is evidence: cite what you actually checked. Assess what you verified, not what you\nintended or inferred from finishing. One you could not check is `unmet`, with the reason, because\n\"never assessed\" and \"could not verify\" send the next reader to different places. Never rewrite an\nExpectation to make it settleable, or delete one to hide that it was owed.\n\nA Deliverable Expectation settles the same way: record the Deliverable bound to it, then assess it\n`met` citing that Deliverable. Unless the Expectation names its own bar, `code` asks for a provider\nreceipt and every other kind for a person's confirmation; a `met` below the bar is accepted and the\nclose records the shortfall.\n\nA waiver says it is no longer owed, and that is a person's call. If it is the honest answer, say so\nin an Update or a Comment.\n\n```bash\nskrr tasks expectations <task-id> # what is owed, with ids, 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>\n```\n\n`--resource-link-id` cites a Deliverable and `--result-id` the Result. `--all` gives one decision to\nevery Expectation still awaiting a judgement.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `INVALID_TASK_EXPECTATION` | An Expectation written with the Task could not be read. | Fix the entry the refusal names. |\n| `TASK_EXPECTATION_NOT_FOUND` | The id is not an Expectation of the current specification. | Use an id of what is owed now. |\n| `TASK_SPEC_VERSION_MISMATCH` | The specification changed after you read it. | Read the Task again and act on the current one. |\n| `TASK_EXPECTATION_ASSESSMENT_IDEMPOTENCY_CONFLICT` | The key already names a different assessment. | Give this assessment its own key. |\n| `TASK_EXPECTATION_AUTOMATIC_EVIDENCE_REQUIRED` | An Agent assessed without citing a Result, Deliverable or evidence. | Cite what you checked. |\n| `TASK_EXPECTATION_ASSESSMENT_REASON_REQUIRED` | The reason is empty. | Say why. |\n| `TASK_EXPECTATION_WAIVER_HUMAN_REQUIRED` | An Agent tried to waive an Expectation. | Ask a person to decide. |\n| `TASK_EXPECTATION_RUN_NOT_APPLICABLE` | A person's assessment cited a Run. | Leave the Run out. |\n| `TASK_EXPECTATION_AGENT_RUN_MISMATCH` | The cited Run belongs to another Agent. | Cite your own Run. |\n| `TASK_EXPECTATION_RESOURCE_MISMATCH` | The cited Deliverable link is not on this Task. | Cite a link of this Task. |\n| `TASK_EXPECTATION_RESULT_MISMATCH` | The cited Result is not this Task's, at this specification. | Cite the current Result. |",
|
|
3614
|
-
"hash": "
|
|
3615
|
-
"tokens":
|
|
3613
|
+
"body": "Read this when you write, read or assess what a Task must make true before it closes.\n\n## Write them so they can be judged\n\nAn Expectation is a sentence first; a typed check says how it can be assessed and never replaces\nthe sentence. Say what would satisfy it and how that could be checked: one written without a\nthought about verification cannot be settled honestly later. A required Deliverable is one typed\nExpectation, not a second list. When you create several across several Tasks, say how many and\nwhom they fall to.\n\nEditing an Expectation or the description advances the Task's specification and revokes every\nassessment already recorded, so fix the statement before anyone settles it.\n\n`--expect` on `tasks create` and `tasks update` takes `<kind>[/<format>][:<target>]` for a\nDeliverable, `@<preset>`, or plain words a person settles. On `tasks update` it replaces the whole list.\n\n## Assess what you verified\n\nYou may assess any Expectation that takes a judgement. The assessment records who made it, as\n`met (agent)` or `met (person)`, and a person can override it. The control is attribution, so what\nyou owe is evidence: cite what you actually checked. Assess what you verified, not what you\nintended or inferred from finishing. One you could not check is `unmet`, with the reason, because\n\"never assessed\" and \"could not verify\" send the next reader to different places. Never rewrite an\nExpectation to make it settleable, or delete one to hide that it was owed.\n\nA Deliverable Expectation settles the same way: record the Deliverable bound to it, then assess it\n`met` citing that Deliverable. Unless the Expectation names its own bar, `code` asks for a provider\nreceipt and every other kind for a person's confirmation; a `met` below the bar is accepted and the\nclose records the shortfall.\n\nA waiver says it is no longer owed, and that is a person's call. If it is the honest answer, say so\nin an Update or a Comment.\n\nIn a session a person started by hand, your writes are recorded as their account, so an assessment\nyou make there is their judgement, not yours: it reads `met (person via CLI credential)`. Assess\nonly when they ask you to record it as theirs. Otherwise record what you checked with\n`skrr tasks updates add <task-id> --type verification` and tell them the assessment is theirs to\nmake.\n\n```bash\nskrr tasks expectations <task-id> # what is owed, with ids, 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>\n```\n\n`--resource-link-id` cites a Deliverable and `--result-id` the Result. `--all` gives one decision to\nevery Expectation still awaiting a judgement.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `INVALID_TASK_EXPECTATION` | An Expectation written with the Task could not be read. | Fix the entry the refusal names. |\n| `TASK_EXPECTATION_NOT_FOUND` | The id is not an Expectation of the current specification. | Use an id of what is owed now. |\n| `TASK_SPEC_VERSION_MISMATCH` | The specification changed after you read it. | Read the Task again and act on the current one. |\n| `TASK_EXPECTATION_ASSESSMENT_IDEMPOTENCY_CONFLICT` | The key already names a different assessment. | Give this assessment its own key. |\n| `TASK_EXPECTATION_AUTOMATIC_EVIDENCE_REQUIRED` | An Agent assessed without citing a Result, Deliverable or evidence. | Cite what you checked. |\n| `TASK_EXPECTATION_ASSESSMENT_REASON_REQUIRED` | The reason is empty. | Say why. |\n| `TASK_EXPECTATION_WAIVER_HUMAN_REQUIRED` | An Agent tried to waive an Expectation. | Ask a person to decide. |\n| `TASK_EXPECTATION_RUN_NOT_APPLICABLE` | A person's assessment cited a Run. | Leave the Run out. |\n| `TASK_EXPECTATION_AGENT_RUN_MISMATCH` | The cited Run belongs to another Agent. | Cite your own Run. |\n| `TASK_EXPECTATION_RESOURCE_MISMATCH` | The cited Deliverable link is not on this Task. | Cite a link of this Task. |\n| `TASK_EXPECTATION_RESULT_MISMATCH` | The cited Result is not this Task's, at this specification. | Cite the current Result. |",
|
|
3614
|
+
"hash": "db0c8ded69dd3c96c045b24b7fcfb4a17116de13ee86f6c122c32a737eab17f2",
|
|
3615
|
+
"tokens": 996,
|
|
3616
3616
|
"sections": [
|
|
3617
3617
|
{
|
|
3618
3618
|
"id": "records",
|
|
@@ -3736,7 +3736,7 @@
|
|
|
3736
3736
|
"id": "expectations",
|
|
3737
3737
|
"title": "Expectations",
|
|
3738
3738
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3739
|
-
"tokens":
|
|
3739
|
+
"tokens": 996,
|
|
3740
3740
|
"aliases": [],
|
|
3741
3741
|
"explains": [
|
|
3742
3742
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3944,7 +3944,7 @@
|
|
|
3944
3944
|
"id": "expectations",
|
|
3945
3945
|
"title": "Expectations",
|
|
3946
3946
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3947
|
-
"tokens":
|
|
3947
|
+
"tokens": 996,
|
|
3948
3948
|
"aliases": [],
|
|
3949
3949
|
"explains": [
|
|
3950
3950
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -4150,7 +4150,7 @@
|
|
|
4150
4150
|
"id": "expectations",
|
|
4151
4151
|
"title": "Expectations",
|
|
4152
4152
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
4153
|
-
"tokens":
|
|
4153
|
+
"tokens": 996,
|
|
4154
4154
|
"aliases": [],
|
|
4155
4155
|
"explains": [
|
|
4156
4156
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -4350,7 +4350,7 @@
|
|
|
4350
4350
|
"id": "expectations",
|
|
4351
4351
|
"title": "Expectations",
|
|
4352
4352
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
4353
|
-
"tokens":
|
|
4353
|
+
"tokens": 996,
|
|
4354
4354
|
"aliases": [],
|
|
4355
4355
|
"explains": [
|
|
4356
4356
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -15,10 +15,12 @@ export interface ActivityItem {
|
|
|
15
15
|
sourceKind: string;
|
|
16
16
|
timestamp: string;
|
|
17
17
|
status: string;
|
|
18
|
+
sourceStatus?: string;
|
|
18
19
|
title: string;
|
|
19
20
|
sourceRef: ActivitySourceRef;
|
|
20
21
|
agentId?: string;
|
|
21
22
|
dutyId?: string;
|
|
23
|
+
otherWakes?: number;
|
|
22
24
|
/** Task executions only: what the ledger proves about handing the run to its executor. */
|
|
23
25
|
dispatch?: {
|
|
24
26
|
state: string;
|
|
@@ -88,7 +90,7 @@ export declare function runtimeCell(item: ActivityItem): string;
|
|
|
88
90
|
/** The activity table, shared by the feed and the older-activity scans so the two never drift. */
|
|
89
91
|
export declare function renderActivityItems(items: ActivityItem[], log: (line: string) => void): void;
|
|
90
92
|
export declare function renderAgentActivity(response: ActivityResponse, log: (line: string) => void): void;
|
|
91
|
-
export type ActivityScanSource = 'chat' | 'group-chat' | 'task';
|
|
93
|
+
export type ActivityScanSource = 'chat' | 'group-chat' | 'task' | 'trigger';
|
|
92
94
|
export interface ActivityScanResponse {
|
|
93
95
|
object: string;
|
|
94
96
|
items: ActivityItem[];
|
|
@@ -17,17 +17,31 @@ const api_fetch_1 = require("./api-fetch");
|
|
|
17
17
|
const format_1 = require("./format");
|
|
18
18
|
const search_display_1 = require("./search-display");
|
|
19
19
|
exports.ACTIVITY_SOURCES = [
|
|
20
|
-
'trigger_fire',
|
|
21
|
-
'
|
|
20
|
+
'trigger_fire',
|
|
21
|
+
'duty_check',
|
|
22
|
+
'task_execution',
|
|
23
|
+
'direct_chat',
|
|
24
|
+
'group_chat',
|
|
25
|
+
'goal_planner_tick',
|
|
26
|
+
'autonomous_run',
|
|
22
27
|
];
|
|
23
28
|
exports.ACTIVITY_RUNTIMES = [
|
|
24
|
-
'selected',
|
|
25
|
-
'
|
|
29
|
+
'selected',
|
|
30
|
+
'bound',
|
|
31
|
+
'not_bound',
|
|
32
|
+
'unknown',
|
|
33
|
+
'byo-machine',
|
|
34
|
+
'hosted-machine',
|
|
35
|
+
'hosted-job-machine',
|
|
36
|
+
'dedicated-machine',
|
|
37
|
+
'space-machine',
|
|
38
|
+
'oversky-worker',
|
|
26
39
|
];
|
|
27
40
|
exports.ACTIVITY_INITIATORS = ['person', 'automation', 'agent', 'system', 'unknown'];
|
|
28
41
|
/** Activity values can contain source-authored text. Never emit terminal control or bidi characters. */
|
|
29
42
|
function activityCell(value, placeholder = '-') {
|
|
30
|
-
return (0, search_display_1.searchDisplayText)((0, format_1.formatCell)(value, placeholder)).replace(/[\u061c\u200e\u200f]/g, '') ||
|
|
43
|
+
return ((0, search_display_1.searchDisplayText)((0, format_1.formatCell)(value, placeholder)).replace(/[\u061c\u200e\u200f]/g, '') ||
|
|
44
|
+
placeholder);
|
|
31
45
|
}
|
|
32
46
|
function isPrintableActivityToken(value) {
|
|
33
47
|
return (0, search_display_1.isPrintableSearchCursor)(value) && !/[\u061c\u200e\u200f]/.test(value);
|
|
@@ -96,11 +110,18 @@ function renderActivityItems(items, log) {
|
|
|
96
110
|
(0, format_1.renderTable)(items.map((item) => ({
|
|
97
111
|
when: activityCell((0, format_1.localTime)(item.timestamp)),
|
|
98
112
|
source: activityCell(item.sourceKind),
|
|
99
|
-
status: activityCell(item.status
|
|
113
|
+
status: activityCell(item.sourceStatus && item.sourceStatus !== item.status
|
|
114
|
+
? `${item.status} (${item.sourceStatus})`
|
|
115
|
+
: item.status, 'unknown'),
|
|
100
116
|
title: activityCell(item.title),
|
|
101
117
|
reference: sourceLabel(item.sourceRef),
|
|
102
118
|
runtime: runtimeCell(item),
|
|
103
119
|
content: activityCell(item.content?.state, 'unknown'),
|
|
120
|
+
wakes: item.sourceKind === 'duty_check' &&
|
|
121
|
+
Number.isSafeInteger(item.otherWakes) &&
|
|
122
|
+
(item.otherWakes ?? 0) > 0
|
|
123
|
+
? `at least ${item.otherWakes}`
|
|
124
|
+
: '-',
|
|
104
125
|
})), [
|
|
105
126
|
{ key: 'when', header: 'WHEN' },
|
|
106
127
|
{ key: 'source', header: 'SOURCE' },
|
|
@@ -109,6 +130,7 @@ function renderActivityItems(items, log) {
|
|
|
109
130
|
{ key: 'reference', header: 'SOURCE REFERENCE', verbatim: true },
|
|
110
131
|
{ key: 'runtime', header: 'RUNTIME' },
|
|
111
132
|
{ key: 'content', header: 'CONTENT' },
|
|
133
|
+
{ key: 'wakes', header: 'WAKE RECORDS' },
|
|
112
134
|
], log);
|
|
113
135
|
}
|
|
114
136
|
function renderAgentActivity(response, log) {
|
|
@@ -130,7 +152,7 @@ function renderAgentActivity(response, log) {
|
|
|
130
152
|
log('Current chat: messages show <conversationId> <messageId> (independently authorized; Activity identity unverified).');
|
|
131
153
|
log('Group reply: activity show --group-chat <groupChatId> --message <messageId>.');
|
|
132
154
|
}
|
|
133
|
-
log('Scan your older activity: activity scan-older chat|group-chat|task.');
|
|
155
|
+
log('Scan your older activity: activity scan-older chat|group-chat|task|trigger.');
|
|
134
156
|
log('');
|
|
135
157
|
const coverage = Array.isArray(response.coverage) ? response.coverage : [];
|
|
136
158
|
if (!coverage.length)
|
|
@@ -150,7 +172,8 @@ function renderAgentActivity(response, log) {
|
|
|
150
172
|
if (!response.nextCursor) {
|
|
151
173
|
log('More activity may be available, but the server did not return a cursor.');
|
|
152
174
|
}
|
|
153
|
-
else if (typeof response.nextCursor !== 'string' ||
|
|
175
|
+
else if (typeof response.nextCursor !== 'string' ||
|
|
176
|
+
!isPrintableActivityToken(response.nextCursor)) {
|
|
154
177
|
log('The next cursor cannot be printed safely.');
|
|
155
178
|
}
|
|
156
179
|
else {
|
|
@@ -173,6 +196,7 @@ const SCAN_OBJECT = {
|
|
|
173
196
|
chat: 'personal_chat_activity_scan',
|
|
174
197
|
'group-chat': 'group_chat_activity_scan',
|
|
175
198
|
task: 'personal_task_activity_scan',
|
|
199
|
+
trigger: 'trigger_fire_activity_scan',
|
|
176
200
|
};
|
|
177
201
|
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
178
202
|
/**
|
|
@@ -201,6 +225,11 @@ function scanOlderActivity(options, credential) {
|
|
|
201
225
|
credential,
|
|
202
226
|
});
|
|
203
227
|
}
|
|
228
|
+
if (options.source === 'trigger') {
|
|
229
|
+
return (0, api_fetch_1.apiFetch)(`/api/agent-activity/trigger/scan-older?${query.toString()}`, {
|
|
230
|
+
credential,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
204
233
|
return (0, api_fetch_1.apiFetch)(`/api/agent-activity/group-chat/scan-older?${query.toString()}`, {
|
|
205
234
|
credential,
|
|
206
235
|
});
|
|
@@ -224,7 +253,13 @@ function parseActivityScan(source, value) {
|
|
|
224
253
|
return value;
|
|
225
254
|
}
|
|
226
255
|
function renderActivityScan(source, response, log) {
|
|
227
|
-
const label = source === 'chat'
|
|
256
|
+
const label = source === 'chat'
|
|
257
|
+
? 'chat'
|
|
258
|
+
: source === 'task'
|
|
259
|
+
? 'Task'
|
|
260
|
+
: source === 'trigger'
|
|
261
|
+
? 'trigger'
|
|
262
|
+
: 'group';
|
|
228
263
|
log(`Earlier ${label} activity`);
|
|
229
264
|
if (response.items.length) {
|
|
230
265
|
renderActivityItems(response.items, log);
|
|
@@ -233,7 +268,9 @@ function renderActivityScan(source, response, log) {
|
|
|
233
268
|
? 'Current chat: messages show <conversationId> <messageId> (independently authorized; Activity identity unverified).'
|
|
234
269
|
: source === 'task'
|
|
235
270
|
? 'Open the Task for its independently authorized history.'
|
|
236
|
-
:
|
|
271
|
+
: source === 'trigger'
|
|
272
|
+
? 'Trigger records are listed only within the currently authorized account and workspace.'
|
|
273
|
+
: 'Group reply: activity show --group-chat <groupChatId> --message <messageId>.');
|
|
237
274
|
}
|
|
238
275
|
else {
|
|
239
276
|
log(`No additional visible ${label} activity was found in this scan.`);
|
|
@@ -244,7 +281,9 @@ function renderActivityScan(source, response, log) {
|
|
|
244
281
|
? 'A scan is a separate, bounded read of older chat replies. Its cursor is not a global time order or a has-more signal, and some history may be unavailable.'
|
|
245
282
|
: source === 'task'
|
|
246
283
|
? 'Personal Tasks are scanned separately, not in global time order. Some history may be unavailable.'
|
|
247
|
-
:
|
|
284
|
+
: source === 'trigger'
|
|
285
|
+
? 'Trigger fires are scanned separately. An empty scan does not establish complete history.'
|
|
286
|
+
: 'Groups are scanned separately, not in global time order. Some history may be unavailable.');
|
|
248
287
|
const coverage = response.coverage;
|
|
249
288
|
log(`Coverage: ${activityCell(coverage.source, label)}: ${activityCell(coverage.state, 'unknown')}${coverage.reason ? ` (${activityCell(coverage.reason)})` : ''}`);
|
|
250
289
|
log('');
|
package/dist/lib/api-fetch.js
CHANGED
|
@@ -189,6 +189,32 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
189
189
|
(0, node_adapter_1.getAdapterCredentialOverride)() ??
|
|
190
190
|
(await (0, credential_resolver_1.resolveCredential)());
|
|
191
191
|
}
|
|
192
|
+
if (method !== 'GET' &&
|
|
193
|
+
!historyRead &&
|
|
194
|
+
!isAuthEndpoint(pathOrUrl) &&
|
|
195
|
+
cred.source !== 'flag' &&
|
|
196
|
+
(0, refresh_1.cliCredentialNeedsRefresh)(cred.token)) {
|
|
197
|
+
if (delegatedCli) {
|
|
198
|
+
const fresh = await (0, delegated_cli_1.fetchDelegatedCliCredential)(process.env, { forceRefresh: true });
|
|
199
|
+
if (fresh?.token)
|
|
200
|
+
cred = fresh;
|
|
201
|
+
}
|
|
202
|
+
else if (!autonomousCredential && (0, daemonBroker_1.isBrokeredHandoffToken)(cred.token)) {
|
|
203
|
+
const fresh = await (0, daemonBroker_1.redeemBrokeredHandoffToken)(true);
|
|
204
|
+
if (fresh?.accessToken) {
|
|
205
|
+
cred = { token: fresh.accessToken, source: 'env-token', kind: (0, credential_resolver_1.kindOf)(fresh.accessToken) };
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else if (!autonomousCredential) {
|
|
209
|
+
const fresh = await (0, refresh_1.ensureFreshCliCredential)({ credential: cred });
|
|
210
|
+
if (fresh.refreshed && fresh.credential.token)
|
|
211
|
+
cred = fresh.credential;
|
|
212
|
+
}
|
|
213
|
+
// Explicit per-call authority stays local to this request.
|
|
214
|
+
if (!opts.credential)
|
|
215
|
+
(0, node_adapter_1.setAdapterCredentialOverride)(cred);
|
|
216
|
+
}
|
|
217
|
+
const replaySafe = !opts.singleAttempt && (0, write_outcome_1.isRequestReplaySafe)(method, url, callerHeaders);
|
|
192
218
|
const fetchWithCredential = async (credential) => {
|
|
193
219
|
const headers = {
|
|
194
220
|
Accept: 'application/json',
|
|
@@ -228,16 +254,17 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
228
254
|
fetched = await (0, rate_limit_retry_1.fetchWithRateLimitRetry)(() => fetch(url, {
|
|
229
255
|
method,
|
|
230
256
|
headers: sent,
|
|
231
|
-
...(historyRead ||
|
|
257
|
+
...(historyRead || !replaySafe || method !== 'GET'
|
|
232
258
|
? { redirect: 'error' }
|
|
233
259
|
: (0, task_runtime_headers_1.taskRuntimeRedirectOptions)(sent)),
|
|
234
260
|
body,
|
|
235
261
|
...(opts.signal ? { signal: opts.signal } : {}),
|
|
236
262
|
}), {
|
|
237
263
|
method,
|
|
264
|
+
url,
|
|
238
265
|
headers: sent,
|
|
239
266
|
signal: opts.signal,
|
|
240
|
-
...(
|
|
267
|
+
...(!replaySafe ? { maxRetries: 0 } : {}),
|
|
241
268
|
});
|
|
242
269
|
}
|
|
243
270
|
catch (transportError) {
|
|
@@ -251,7 +278,7 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
251
278
|
let lastRetryAfterMs;
|
|
252
279
|
let res = await fetchWithCredential(cred);
|
|
253
280
|
let brokerFailure = null;
|
|
254
|
-
if (
|
|
281
|
+
if (replaySafe && res.status === 401 && delegatedCli) {
|
|
255
282
|
// Deliberately terminal on broker failure: an Agent whose daemon cannot
|
|
256
283
|
// rotate its family must surface the 401, never fall through to
|
|
257
284
|
// `ensureFreshCliCredential` and adopt the human's stored refresh family.
|
|
@@ -262,7 +289,7 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
262
289
|
res = await fetchWithCredential(cred);
|
|
263
290
|
}
|
|
264
291
|
}
|
|
265
|
-
else if (
|
|
292
|
+
else if (replaySafe &&
|
|
266
293
|
res.status === 401 &&
|
|
267
294
|
!historyRead &&
|
|
268
295
|
(0, daemonBroker_1.isBrokeredHandoffToken)(cred.token) &&
|
|
@@ -282,7 +309,7 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
282
309
|
res = await fetchWithCredential(cred);
|
|
283
310
|
}
|
|
284
311
|
}
|
|
285
|
-
else if (
|
|
312
|
+
else if (replaySafe &&
|
|
286
313
|
res.status === 401 &&
|
|
287
314
|
!autonomousCredential &&
|
|
288
315
|
!isAuthEndpoint(pathOrUrl)) {
|
|
@@ -57,7 +57,7 @@ function formatCompatibility(view) {
|
|
|
57
57
|
else {
|
|
58
58
|
lines.push(`unknown: ${where}. This is NOT a pass: ${data_provider_1.APP_COMPATIBILITY_UNKNOWN_WORDS[view.reason ?? 'database_error']}.`);
|
|
59
59
|
}
|
|
60
|
-
lines.push(`checked at ${(0, appData_1.safeForTerminal)(view.computedAt)}, installation generation ${view.lifecycleGen}, data epoch ${view.dataEpoch}${view.epochEnforced ? '' : ' (
|
|
60
|
+
lines.push(`checked at ${(0, appData_1.safeForTerminal)(view.computedAt)}, installation generation ${view.lifecycleGen}, data epoch ${view.dataEpoch}${view.epochEnforced ? '' : ' (the data epoch is not known to be enforced by every writer)'}`);
|
|
61
61
|
for (const sentence of view.disclaimers)
|
|
62
62
|
lines.push(sentence);
|
|
63
63
|
return lines;
|
package/dist/lib/appData.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export type PersonDataFailure = {
|
|
|
88
88
|
status?: number;
|
|
89
89
|
message?: string;
|
|
90
90
|
/** A state proven by the same authorized request, when a newer server provides it. */
|
|
91
|
-
reason?: 'installation_suspended' | typeof APP_STORE_CURSOR_INVALID_REASON | typeof APP_STORE_CURSOR_MISMATCH_REASON;
|
|
91
|
+
reason?: 'installation_suspended' | 'installation_changed' | typeof APP_STORE_CURSOR_INVALID_REASON | typeof APP_STORE_CURSOR_MISMATCH_REASON;
|
|
92
92
|
/** Zero-based index of the batch operation, when the server can identify one. */
|
|
93
93
|
index?: number;
|
|
94
94
|
retryAfterMs?: number;
|
package/dist/lib/appData.js
CHANGED
|
@@ -298,8 +298,9 @@ function readPersonDataFailure(error) {
|
|
|
298
298
|
code,
|
|
299
299
|
...status,
|
|
300
300
|
...(typeof body.message === 'string' ? { message: body.message } : {}),
|
|
301
|
-
...(code === 'unavailable' &&
|
|
302
|
-
|
|
301
|
+
...(code === 'unavailable' &&
|
|
302
|
+
(body.reason === 'installation_suspended' || body.reason === 'installation_changed')
|
|
303
|
+
? { reason: body.reason }
|
|
303
304
|
: {}),
|
|
304
305
|
...(code === 'schema' && cursorRefusalReason(body.reason) !== undefined
|
|
305
306
|
? { reason: cursorRefusalReason(body.reason) }
|
|
@@ -352,6 +353,9 @@ function describePersonDataRefusal(failure, bin, operation) {
|
|
|
352
353
|
if (failure.code === 'unavailable' && failure.reason === 'installation_suspended') {
|
|
353
354
|
return `This installation is paused, so the operation was not run. If you paused it, resume it with \`${bin} apps resume <installation>\`. A platform pause can only be lifted by the platform.`;
|
|
354
355
|
}
|
|
356
|
+
if (failure.code === 'unavailable' && failure.reason === 'installation_changed') {
|
|
357
|
+
return 'The installation changed before the write could be applied. Refresh the installation and document revision before deciding whether to try again.';
|
|
358
|
+
}
|
|
355
359
|
if (operation === 'query' && failure.code === 'schema') {
|
|
356
360
|
if (typeof data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE === 'string' &&
|
|
357
361
|
data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE.length > 0 &&
|