@skrr-ai/cli 0.1.144 → 0.1.146
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/README.md +5 -0
- package/dist/commands/agenda/plan.d.ts +21 -0
- package/dist/commands/agenda/plan.js +46 -0
- package/dist/commands/agent/message/approve.js +7 -5
- package/dist/commands/agent/message/decline.js +7 -5
- package/dist/commands/agent/message/pending.js +1 -1
- package/dist/commands/agents/always-on/enable.js +1 -1
- package/dist/commands/agents/plan-day.d.ts +11 -0
- package/dist/commands/agents/plan-day.js +41 -2
- package/dist/commands/agents/schedule-overview.js +15 -10
- package/dist/commands/agents/schedule-trace.js +12 -2
- package/dist/commands/agents/spawn.d.ts +73 -1
- package/dist/commands/agents/spawn.js +274 -5
- package/dist/commands/agents/triggers/fire.js +20 -0
- package/dist/commands/agents/upcoming.d.ts +1 -0
- package/dist/commands/agents/upcoming.js +18 -7
- package/dist/commands/commitments/create.js +1 -1
- package/dist/commands/commitments/update.js +1 -1
- package/dist/commands/spaces/workflow-templates/insert.js +4 -0
- package/dist/commands/store/show.js +22 -0
- package/dist/commands/triggers/audit.js +1 -1
- package/dist/commands/triggers/fire.js +19 -0
- package/dist/generated/agent-guides.json +19 -19
- package/dist/lib/agentic-stream.d.ts +28 -0
- package/dist/lib/agentic-stream.js +89 -1
- package/dist/lib/commitments.js +13 -1
- package/dist/lib/compasses.js +1 -1
- package/dist/lib/dedicated-power.js +10 -3
- package/dist/lib/format.d.ts +20 -0
- package/dist/lib/format.js +47 -0
- package/dist/lib/planOutcome.d.ts +51 -0
- package/dist/lib/planOutcome.js +88 -0
- package/dist/lib/proactiveApi.d.ts +100 -1
- package/dist/lib/proactiveApi.js +27 -2
- package/dist/lib/schedule.d.ts +40 -1
- package/dist/lib/schedule.js +51 -2
- package/dist/lib/triggers.d.ts +134 -3
- package/dist/lib/triggers.js +260 -21
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +4677 -4673
- package/oclif.manifest.json +40 -4
- package/package.json +1 -1
|
@@ -410,7 +410,7 @@
|
|
|
410
410
|
"id": "authoring",
|
|
411
411
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
412
412
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
413
|
-
"tokens":
|
|
413
|
+
"tokens": 1200,
|
|
414
414
|
"aliases": [],
|
|
415
415
|
"explains": [
|
|
416
416
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -709,7 +709,7 @@
|
|
|
709
709
|
]
|
|
710
710
|
}
|
|
711
711
|
],
|
|
712
|
-
"hash": "
|
|
712
|
+
"hash": "094f13baf76b8cc49ff78f524d5806068a955865810f5d9171d2d630fe16e2c1",
|
|
713
713
|
"tokens": 545
|
|
714
714
|
},
|
|
715
715
|
"routedIndex": {
|
|
@@ -1123,7 +1123,7 @@
|
|
|
1123
1123
|
"id": "authoring",
|
|
1124
1124
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
1125
1125
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
1126
|
-
"tokens":
|
|
1126
|
+
"tokens": 1200,
|
|
1127
1127
|
"aliases": [],
|
|
1128
1128
|
"explains": [
|
|
1129
1129
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -1353,7 +1353,7 @@
|
|
|
1353
1353
|
]
|
|
1354
1354
|
}
|
|
1355
1355
|
],
|
|
1356
|
-
"hash": "
|
|
1356
|
+
"hash": "86969256907c1a1f9a35abfb01eae0f510a5fd52fac5ebc6a959d9a5fcb3382a",
|
|
1357
1357
|
"tokens": 494
|
|
1358
1358
|
},
|
|
1359
1359
|
"cards": {
|
|
@@ -1747,7 +1747,7 @@
|
|
|
1747
1747
|
"routed": true,
|
|
1748
1748
|
"aliases": [],
|
|
1749
1749
|
"body": "## Concept model\n\n| Noun | Question it answers |\n| --- | --- |\n| **Compass** | What does good look like for this Agent, and what may it never trade away? |\n| **Northstar** | Which Commitments should exist, at what priority and on what budget? |\n| **Commitment** | Which outcome does this Agent keep true, and how does it keep checking? |\n| **Check** | What did one wake of a Commitment see, decide and do? |\n\nA Commitment is not a unit of work. A **Task** is one unit of work and a **Goal** is a dated\noutcome with key results; a Commitment watches both and may create Tasks, and is neither.\n\n## Decide\n\nFive mechanisms make something happen later, and the noun alone does not pick one:\n\n| Mechanism | What it is for | The signal that picks it |\n| --- | --- | --- |\n| **Follow-up** | Coming back to one thing, once or a bounded few times: a reminder, a watch, a check-in, an agreed action | The ask ends: \"look tomorrow\", \"tell me when CI is green\" |\n| **Trigger** | Running the Agent with a set prompt on a schedule, an event, once, or on demand | The person names when, and every run does the same work |\n| **Heartbeat** | Checking in on a conversation, group chat or Space at a frequency that backs off while unread | The person wants regular contact, not an outcome held |\n| **Commitment** | Keeping an outcome true: watched sources, a cadence and a loop that decides when to act | \"Keep X true\", \"watch this metric\": no end, and stale evidence matters |\n| **Workflow** | Running a durable graph of Tasks in order | Repeatable work whose steps depend on each other |\n\nA one-off \"look at it tomorrow\" is a follow-up, never a Commitment. Standing observation is a\nCommitment with a freshness contract, not a recurring trigger or a task board left running.\n\n## Workflow\n\n### Start a Commitment\n\n1. Read the Agent's Commitments first, and change one rather than add a near-duplicate.\n2. Create it and turn it on in one call: the outcome, what it watches, how often it checks, where\n its work goes. Turning it on runs Preflight; a refusal keeps the draft and reports the code,\n reason and fix.\n3. Leave it a draft only when the person asked to see it first.\n4. Read it back, and tell the person what it watches, how often, and whether it is on.\n\n## Authority\n\n| Actor | May do | Only a person may do |\n| --- | --- | --- |\n| Agent | Read the Commitments of an Agent it can view; create one, change it and turn it on; request a check; pause one; decide whether a finding is worth telling the owner | Lift a stop a person made; set or clear a concurrency limit; choose the Task review policy; approve an action proposal or a cadence change; configure a Northstar's governance or decide its intents |\n| Person | Everything in both columns | — |\n\nA Commitment grants no permission: its runs work under the Agent's own. A Check never writes an\nowner-facing message, and a Compass never creates, rewrites, pauses or archives a Commitment. The\nserver cannot always tell an Agent from the person whose login it holds, so an accepted call is\nnot permission: the right-hand column stays a person's.\n\n## Live state\n\n- `skrr commitments list --agent <agent-id>` — an Agent's Commitments, with status and assessment.\n- `skrr commitments show <commitment-id>` — the contract, its next check and the last one.\n- `skrr commitments roster --agent <agent-id>` — each loop: whether it is armed, its next wake, runs today.\n\n## Related guides\n\n- `tasks` — the Tasks a Commitment creates or watches.\n- `spaces` — Goals, and Workflows: durable graphs of Tasks.\n- `agents` — the Agent a Commitment belongs to, and where its runs execute.\n- `communication` — whether, what and how to tell the owner.",
|
|
1750
|
-
"hash": "
|
|
1750
|
+
"hash": "eb283ae15f588c7245fb4bbcc0249d31ca5a541efbe6ac77c98a2bc0a3e8ec30",
|
|
1751
1751
|
"tokens": 1169,
|
|
1752
1752
|
"sections": [
|
|
1753
1753
|
{
|
|
@@ -1780,7 +1780,7 @@
|
|
|
1780
1780
|
"id": "authoring",
|
|
1781
1781
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
1782
1782
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
1783
|
-
"tokens":
|
|
1783
|
+
"tokens": 1200,
|
|
1784
1784
|
"aliases": [],
|
|
1785
1785
|
"explains": [
|
|
1786
1786
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -5806,7 +5806,7 @@
|
|
|
5806
5806
|
"id": "authoring",
|
|
5807
5807
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
5808
5808
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
5809
|
-
"tokens":
|
|
5809
|
+
"tokens": 1200,
|
|
5810
5810
|
"aliases": [],
|
|
5811
5811
|
"explains": [
|
|
5812
5812
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -5922,7 +5922,7 @@
|
|
|
5922
5922
|
"id": "authoring",
|
|
5923
5923
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
5924
5924
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
5925
|
-
"tokens":
|
|
5925
|
+
"tokens": 1200,
|
|
5926
5926
|
"aliases": [],
|
|
5927
5927
|
"explains": [
|
|
5928
5928
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6040,7 +6040,7 @@
|
|
|
6040
6040
|
"id": "authoring",
|
|
6041
6041
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
6042
6042
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6043
|
-
"tokens":
|
|
6043
|
+
"tokens": 1200,
|
|
6044
6044
|
"aliases": [],
|
|
6045
6045
|
"explains": [
|
|
6046
6046
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6128,9 +6128,9 @@
|
|
|
6128
6128
|
"COMMITMENT_CONCURRENCY_REQUIRES_OWNER_DECISION",
|
|
6129
6129
|
"COMMITMENT_TASK_REVIEW_POLICY_OWNER_REQUIRED"
|
|
6130
6130
|
],
|
|
6131
|
-
"body": "Read this when you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend.\n\nA Commitment starts as a draft; create and turn it on in one call unless the person asked to\nreview it first. Activation runs Preflight — a refusal keeps the draft and reports the code,\nreason and fix. An active contract spends compute on every check, so make it say exactly what\nwill be watched.\n\n- **Outcome and criteria**: the state to hold true, and how you will know it holds.\n- **Watched sources**: what each check reads. A source the platform reads itself (Tasks, a Goal,\n GitHub, metric snapshots it records) needs only its name and scope. A value only a run can read,\n such as a dashboard or an outside CI rate, is an `agent_run` key you declare.\n- **Declared keys**: the operator declares the keys, and the agent fills them. A run may report any\n key, but only a declared one can move the loop, and only as its `changeRule` says: `any` change,\n or `numeric_delta` with `minDelta`, `minRatio`, `direction` and `absoluteFloor`.\n- **Cadence**: `interval` (`1m` to `365d`), `daily` at `HH:MM` times in a timezone,\n `event_plus_interval`, or `manual`.
|
|
6132
|
-
"hash": "
|
|
6133
|
-
"tokens":
|
|
6131
|
+
"body": "Read this when you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend.\n\nA Commitment starts as a draft; create and turn it on in one call unless the person asked to\nreview it first. Activation runs Preflight — a refusal keeps the draft and reports the code,\nreason and fix. An active contract spends compute on every check, so make it say exactly what\nwill be watched.\n\n- **Outcome and criteria**: the state to hold true, and how you will know it holds.\n- **Watched sources**: what each check reads. A source the platform reads itself (Tasks, a Goal,\n GitHub, metric snapshots it records) needs only its name and scope. A value only a run can read,\n such as a dashboard or an outside CI rate, is an `agent_run` key you declare.\n- **Declared keys**: the operator declares the keys, and the agent fills them. A run may report any\n key, but only a declared one can move the loop, and only as its `changeRule` says: `any` change,\n or `numeric_delta` with `minDelta`, `minRatio`, `direction` and `absoluteFloor`.\n- **Cadence**: `interval` (`1m` to `365d`), `daily` at `HH:MM` times in a timezone,\n `event_plus_interval`, or `manual`. Only `event_plus_interval` reads events (CLI:\n `--event-driven`), and an event is an accelerator, not a delivery receipt: a missed one is not\n replayed, and each interval re-checks current state, while it is running. Silence means no\n event was seen, not that none happened. `skrr triggers event-catalog --json` marks each event's\n `commitmentWake` and how to select it (`watchedSource` or `attachedSensor`); a selection that cannot\n wake it is set aside and named by the write.\n- **Delivery**: where its work goes. `report_only` reports and changes nothing.\n- **Budgets**: `policy.executionBudget` caps runs, sensing runs and cost per day. `0` blocks; `null`\n is no limit.\n- **Event sources**: `policy.executionBudget.allowedEventSources` limits which sources may wake it.\n An empty or missing list allows every source; name sources to restrict it.\n- **Interruptions**: `policy.maxUserNudgesPerDay` caps messages to the person: `0` mutes, `null` is\n no limit. `minUserNudgeIntervalMs` is the least gap between two.\n- **Quiet hours**: `policy.quietHours` is `{enabled, start, end, timezone}`. Times are 24-hour\n `HH:MM`; `enabled: true` needs both, and they must differ. A window may cross midnight, and `end`\n is outside it. `timezone` is an IANA name; omitted means UTC, not the person's zone.\n\n## Example\n\nA daily, report-only watch on a deploy failure rate:\n\nSave this as `commitment.json`:\n\n```json\n{\n \"agentId\": \"<agent-id>\",\n \"title\": \"Deploy failure rate\",\n \"status\": \"draft\",\n \"target\": { \"outcome\": \"A rise in the deploy failure rate is reported the day it happens\" },\n \"cadence\": { \"mode\": \"daily\", \"times\": [\"09:00\"], \"timezone\": \"America/New_York\" },\n \"delivery\": { \"mode\": \"report_only\" },\n \"watchedSources\": [{\n \"source\": \"agent_run\",\n \"config\": { \"keys\": [{\n \"key\": \"deploys.failure_rate_7d\",\n \"label\": \"Deploy failure rate, last 7 days\",\n \"changeRule\": { \"mode\": \"numeric_delta\", \"minDelta\": 0.02, \"direction\": \"up\" }\n }] }\n }],\n \"policy\": { \"executionBudget\": { \"maxRunsPerDay\": 2, \"maxObservationRunsPerDay\": 2 } }\n}\n```\n\n```bash\nskrr commitments create --from-json commitment.json --activate --json\n```\n\n`create` prints a `Warning:` for anything the body leaves inert, such as an `agent_run` source\nwith no keys. `--activate` turns it on in the same call: it runs Preflight, and a refusal keeps\nthe draft and reports it, such as Always-On being off for the Agent. Drop `--activate` only when\nthe person asked to review it first; `skrr commitments resume` turns a draft on later, and\n`skrr commitments update` changes it.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `COMMITMENT_MODE_RETIRED` | The body carries `mode`; Commitment modes are retired. | Leave it out: runs work under the Agent's own permissions. |\n| `COMMITMENT_POLICY_RETIRED` | The body carries a retired permission-tier policy field. | Remove the field the refusal names. |\n| `COMMITMENT_DELIVERY_REQUIRED` | A coding Commitment names no delivery. | Choose where its work goes. |\n| `COMMITMENT_CONCURRENCY_REQUIRES_OWNER_DECISION` | An Agent set or cleared a finite concurrency limit. | Recommend the limit; the person sets it. |\n| `COMMITMENT_TASK_REVIEW_POLICY_OWNER_REQUIRED` | Only the owner chooses the Task review policy. | Leave it out and ask the owner. |",
|
|
6132
|
+
"hash": "8e2ed95ad9aa146cd1b1ee8d0a2181f8d52dd22d98104bfde7b175fd721099bd",
|
|
6133
|
+
"tokens": 1200,
|
|
6134
6134
|
"sections": [
|
|
6135
6135
|
{
|
|
6136
6136
|
"id": "model",
|
|
@@ -6162,7 +6162,7 @@
|
|
|
6162
6162
|
"id": "authoring",
|
|
6163
6163
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
6164
6164
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6165
|
-
"tokens":
|
|
6165
|
+
"tokens": 1200,
|
|
6166
6166
|
"aliases": [],
|
|
6167
6167
|
"explains": [
|
|
6168
6168
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6278,7 +6278,7 @@
|
|
|
6278
6278
|
"id": "authoring",
|
|
6279
6279
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
6280
6280
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6281
|
-
"tokens":
|
|
6281
|
+
"tokens": 1200,
|
|
6282
6282
|
"aliases": [],
|
|
6283
6283
|
"explains": [
|
|
6284
6284
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6394,7 +6394,7 @@
|
|
|
6394
6394
|
"id": "authoring",
|
|
6395
6395
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
6396
6396
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6397
|
-
"tokens":
|
|
6397
|
+
"tokens": 1200,
|
|
6398
6398
|
"aliases": [],
|
|
6399
6399
|
"explains": [
|
|
6400
6400
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6516,7 +6516,7 @@
|
|
|
6516
6516
|
"id": "authoring",
|
|
6517
6517
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
6518
6518
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6519
|
-
"tokens":
|
|
6519
|
+
"tokens": 1200,
|
|
6520
6520
|
"aliases": [],
|
|
6521
6521
|
"explains": [
|
|
6522
6522
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6632,7 +6632,7 @@
|
|
|
6632
6632
|
"id": "authoring",
|
|
6633
6633
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
6634
6634
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6635
|
-
"tokens":
|
|
6635
|
+
"tokens": 1200,
|
|
6636
6636
|
"aliases": [],
|
|
6637
6637
|
"explains": [
|
|
6638
6638
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6752,7 +6752,7 @@
|
|
|
6752
6752
|
"id": "authoring",
|
|
6753
6753
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
6754
6754
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6755
|
-
"tokens":
|
|
6755
|
+
"tokens": 1200,
|
|
6756
6756
|
"aliases": [],
|
|
6757
6757
|
"explains": [
|
|
6758
6758
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6870,7 +6870,7 @@
|
|
|
6870
6870
|
"id": "authoring",
|
|
6871
6871
|
"title": "Write a Commitment: sources, keys, cadence and budgets",
|
|
6872
6872
|
"readWhen": "you draft or change a Commitment's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6873
|
-
"tokens":
|
|
6873
|
+
"tokens": 1200,
|
|
6874
6874
|
"aliases": [],
|
|
6875
6875
|
"explains": [
|
|
6876
6876
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -354,6 +354,20 @@ export declare function projectDaemonToolEvents(envelopes: unknown[], namesByCal
|
|
|
354
354
|
* fails here instead of silently reverting these calls to `[tool failed]`.
|
|
355
355
|
*/
|
|
356
356
|
export declare const CODEX_DECLINED_TOOL_OUTPUTS: readonly string[];
|
|
357
|
+
/**
|
|
358
|
+
* The `tool.completed` status a typed operation receipt earns, for an end that names none
|
|
359
|
+
* (OSK-22614).
|
|
360
|
+
*
|
|
361
|
+
* A cloud run's `tool:end` has no `status` field; the daemon-routed path always sets one. So a
|
|
362
|
+
* call that FAILED on the cloud ended as `[tool completed]` here, and `--jsonl` carried the
|
|
363
|
+
* failure only inside `operationOutcome`, where a consumer reading `status` never looked. The
|
|
364
|
+
* receipt is the server's own statement of how the operation ended, so it is read the same way
|
|
365
|
+
* the daemon's status is: failed is failed, and an operation that never ran did not run.
|
|
366
|
+
*
|
|
367
|
+
* `unknown` earns nothing, because nothing is known: that call keeps whatever the end said, which is
|
|
368
|
+
* the status quo, not a claim it succeeded.
|
|
369
|
+
*/
|
|
370
|
+
export declare function toolEndStatusFromOutcome(outcome: unknown): string | undefined;
|
|
357
371
|
/**
|
|
358
372
|
* The line printed when a tool call ends, in the words its status earns.
|
|
359
373
|
*
|
|
@@ -603,6 +617,15 @@ export declare class AgenticStreamClient {
|
|
|
603
617
|
*/
|
|
604
618
|
private readonly openPermissionPrompts;
|
|
605
619
|
private readonly browserPermissionRequests;
|
|
620
|
+
/**
|
|
621
|
+
* Tool calls THIS client refused (the person answered no, or nobody was asked
|
|
622
|
+
* and the CLI declined). A cloud run's `tool:end` for such a call carries no
|
|
623
|
+
* status, so without this it printed `[tool completed]` for a call that never
|
|
624
|
+
* ran (OSK-22553).
|
|
625
|
+
*/
|
|
626
|
+
private readonly deniedToolUseIds;
|
|
627
|
+
/** Calls whose denial the terminal already labelled, so the run's own end does not say it twice. */
|
|
628
|
+
private readonly deniedLabelled;
|
|
606
629
|
private readonly permissionGenerations;
|
|
607
630
|
private readonly permissionEpochs;
|
|
608
631
|
/**
|
|
@@ -833,6 +856,11 @@ export declare class AgenticStreamClient {
|
|
|
833
856
|
*/
|
|
834
857
|
private jsonlView;
|
|
835
858
|
private emit;
|
|
859
|
+
/**
|
|
860
|
+
* `[tool denied] <tool> (it did not run)`, once per call (OSK-22553). The call's own end prints the
|
|
861
|
+
* same line when the run reports one; this is the line for the runs that never do.
|
|
862
|
+
*/
|
|
863
|
+
private writeRefusalLabel;
|
|
836
864
|
/**
|
|
837
865
|
* Human-mode lines for the hand-over wait. Returns true when the event is
|
|
838
866
|
* fully rendered here; false lets the ordinary rendering continue.
|
|
@@ -11,6 +11,7 @@ exports.envelopesText = envelopesText;
|
|
|
11
11
|
exports.envelopeKey = envelopeKey;
|
|
12
12
|
exports.unseenEnvelopes = unseenEnvelopes;
|
|
13
13
|
exports.projectDaemonToolEvents = projectDaemonToolEvents;
|
|
14
|
+
exports.toolEndStatusFromOutcome = toolEndStatusFromOutcome;
|
|
14
15
|
exports.describeToolEnd = describeToolEnd;
|
|
15
16
|
exports.describePermissionDecider = describePermissionDecider;
|
|
16
17
|
exports.projectPermissionResolutions = projectPermissionResolutions;
|
|
@@ -452,6 +453,30 @@ function daemonToolEndStatus(ev) {
|
|
|
452
453
|
}
|
|
453
454
|
return status;
|
|
454
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* The `tool.completed` status a typed operation receipt earns, for an end that names none
|
|
458
|
+
* (OSK-22614).
|
|
459
|
+
*
|
|
460
|
+
* A cloud run's `tool:end` has no `status` field; the daemon-routed path always sets one. So a
|
|
461
|
+
* call that FAILED on the cloud ended as `[tool completed]` here, and `--jsonl` carried the
|
|
462
|
+
* failure only inside `operationOutcome`, where a consumer reading `status` never looked. The
|
|
463
|
+
* receipt is the server's own statement of how the operation ended, so it is read the same way
|
|
464
|
+
* the daemon's status is: failed is failed, and an operation that never ran did not run.
|
|
465
|
+
*
|
|
466
|
+
* `unknown` earns nothing, because nothing is known: that call keeps whatever the end said, which is
|
|
467
|
+
* the status quo, not a claim it succeeded.
|
|
468
|
+
*/
|
|
469
|
+
function toolEndStatusFromOutcome(outcome) {
|
|
470
|
+
const receipt = (0, data_provider_1.readToolOperationOutcome)(outcome);
|
|
471
|
+
if (!receipt)
|
|
472
|
+
return undefined;
|
|
473
|
+
if (receipt.status === 'failed')
|
|
474
|
+
return 'failed';
|
|
475
|
+
if (receipt.status === 'not_run') {
|
|
476
|
+
return receipt.reason === 'permission_denied' ? 'denied' : 'not_run';
|
|
477
|
+
}
|
|
478
|
+
return undefined;
|
|
479
|
+
}
|
|
455
480
|
/**
|
|
456
481
|
* The line printed when a tool call ends, in the words its status earns.
|
|
457
482
|
*
|
|
@@ -848,6 +873,15 @@ class AgenticStreamClient {
|
|
|
848
873
|
*/
|
|
849
874
|
openPermissionPrompts = new Map();
|
|
850
875
|
browserPermissionRequests = new Set();
|
|
876
|
+
/**
|
|
877
|
+
* Tool calls THIS client refused (the person answered no, or nobody was asked
|
|
878
|
+
* and the CLI declined). A cloud run's `tool:end` for such a call carries no
|
|
879
|
+
* status, so without this it printed `[tool completed]` for a call that never
|
|
880
|
+
* ran (OSK-22553).
|
|
881
|
+
*/
|
|
882
|
+
deniedToolUseIds = new Set();
|
|
883
|
+
/** Calls whose denial the terminal already labelled, so the run's own end does not say it twice. */
|
|
884
|
+
deniedLabelled = new Set();
|
|
851
885
|
permissionGenerations = new Map();
|
|
852
886
|
permissionEpochs = new Map();
|
|
853
887
|
/**
|
|
@@ -1074,6 +1108,8 @@ class AgenticStreamClient {
|
|
|
1074
1108
|
this.stopHandoverTimers();
|
|
1075
1109
|
this.pendingEnvelopes.clear();
|
|
1076
1110
|
this.browserPermissionRequests.clear();
|
|
1111
|
+
this.deniedToolUseIds.clear();
|
|
1112
|
+
this.deniedLabelled.clear();
|
|
1077
1113
|
this.permissionGenerations.clear();
|
|
1078
1114
|
this.permissionEpochs.clear();
|
|
1079
1115
|
this.abandonConnectWait?.();
|
|
@@ -1823,6 +1859,8 @@ class AgenticStreamClient {
|
|
|
1823
1859
|
// This CLI makes the decision and nobody is asked, so it says so FIRST. The bound path used
|
|
1824
1860
|
// to return before any event, and the only lines a person saw were the server's "The
|
|
1825
1861
|
// response was admitted. Tool execution is not confirmed.", which read like an approval.
|
|
1862
|
+
if (event.toolUseId)
|
|
1863
|
+
this.deniedToolUseIds.add(event.toolUseId);
|
|
1826
1864
|
this.emit({ ...event, type: 'permission.denied', reason: 'noninteractive_or_not_enabled' });
|
|
1827
1865
|
if (event.toolUseId) {
|
|
1828
1866
|
if (await this.sendBoundPermissionDecision(event, false, {
|
|
@@ -1891,6 +1929,9 @@ class AgenticStreamClient {
|
|
|
1891
1929
|
if (prompt.signal.aborted)
|
|
1892
1930
|
return;
|
|
1893
1931
|
const approved = /^y(es)?$/i.test(answer.trim());
|
|
1932
|
+
// Recorded before the decision is sent, so the call's end can never arrive first.
|
|
1933
|
+
if (!approved && event.toolUseId)
|
|
1934
|
+
this.deniedToolUseIds.add(event.toolUseId);
|
|
1894
1935
|
if (await this.sendBoundPermissionDecision(event, approved, approved ? {} : { reason: 'Declined by CLI user' }))
|
|
1895
1936
|
return;
|
|
1896
1937
|
this.socket.emit(approved ? 'permission:approve' : 'permission:deny', {
|
|
@@ -2224,6 +2265,23 @@ class AgenticStreamClient {
|
|
|
2224
2265
|
const id = typeof event.toolUseId === 'string' ? event.toolUseId : undefined;
|
|
2225
2266
|
if (!this.firstTimeSeen(String(event.type), id))
|
|
2226
2267
|
return;
|
|
2268
|
+
// The refusal is this client's own fact, so it outranks an end that names no
|
|
2269
|
+
// status. A status the run did report (`failed`, `cancelled`) is kept.
|
|
2270
|
+
if (event.type === 'tool.completed' &&
|
|
2271
|
+
id &&
|
|
2272
|
+
this.deniedToolUseIds.has(id) &&
|
|
2273
|
+
(event.status === undefined || event.status === null || event.status === 'completed')) {
|
|
2274
|
+
this.emit({ ...event, status: 'denied' });
|
|
2275
|
+
return;
|
|
2276
|
+
}
|
|
2277
|
+
// An end that names no status, with a receipt that says how the operation ended (OSK-22614).
|
|
2278
|
+
if (event.type === 'tool.completed' && (event.status === undefined || event.status === null)) {
|
|
2279
|
+
const fromReceipt = toolEndStatusFromOutcome(event.operationOutcome);
|
|
2280
|
+
if (fromReceipt) {
|
|
2281
|
+
this.emit({ ...event, status: fromReceipt });
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2227
2285
|
this.emit(event);
|
|
2228
2286
|
}
|
|
2229
2287
|
/**
|
|
@@ -2350,7 +2408,13 @@ class AgenticStreamClient {
|
|
|
2350
2408
|
this.renderedText = this.answerText();
|
|
2351
2409
|
}
|
|
2352
2410
|
else if (event.type === 'tool.completed') {
|
|
2353
|
-
|
|
2411
|
+
const endedId = typeof event.toolUseId === 'string' ? event.toolUseId : undefined;
|
|
2412
|
+
// A refusal this terminal already labelled when it was given is not said a second time.
|
|
2413
|
+
if (!(event.status === 'denied' && endedId && this.deniedLabelled.has(endedId))) {
|
|
2414
|
+
output.write(`${describeToolEnd(event.toolName, event.status)}\n`);
|
|
2415
|
+
if (event.status === 'denied' && endedId)
|
|
2416
|
+
this.deniedLabelled.add(endedId);
|
|
2417
|
+
}
|
|
2354
2418
|
this.renderedText = this.answerText();
|
|
2355
2419
|
}
|
|
2356
2420
|
else if (event.type === 'stream.gap') {
|
|
@@ -2383,6 +2447,12 @@ class AgenticStreamClient {
|
|
|
2383
2447
|
'permission.response_refused',
|
|
2384
2448
|
].includes(event.type)) {
|
|
2385
2449
|
output.write(`\n[permission] ${String(event.message ?? '')}\n`);
|
|
2450
|
+
// A refusal the server recorded is this client's own fact, and the run does not always end
|
|
2451
|
+
// the call afterwards (a cloud run may carry on with its reply), so the label waited on an
|
|
2452
|
+
// event that never came and the denial went unlabelled in half the runs (OSK-22553).
|
|
2453
|
+
if (event.type === 'permission.response_recorded' && event.decision === 'deny') {
|
|
2454
|
+
this.writeRefusalLabel(event, output);
|
|
2455
|
+
}
|
|
2386
2456
|
this.renderedText = this.answerText();
|
|
2387
2457
|
}
|
|
2388
2458
|
else if (event.type === 'permission.cancelled') {
|
|
@@ -2413,6 +2483,12 @@ class AgenticStreamClient {
|
|
|
2413
2483
|
output.write(`\n[permission] ${describePermission(event)} denied: nobody could be asked, and this run was not started with --approve-tools\n`);
|
|
2414
2484
|
this.renderedText = this.answerText();
|
|
2415
2485
|
}
|
|
2486
|
+
else if (event.type === 'permission.denied' &&
|
|
2487
|
+
event.reason !== 'noninteractive_or_not_enabled') {
|
|
2488
|
+
// A person answered `n` and the decision went out the unbound way.
|
|
2489
|
+
this.writeRefusalLabel(event, output);
|
|
2490
|
+
this.renderedText = this.answerText();
|
|
2491
|
+
}
|
|
2416
2492
|
else if (event.type === 'permission.approved' && event.auto === true) {
|
|
2417
2493
|
// Said out loud, because nobody was asked: the flag approved it, and a
|
|
2418
2494
|
// reader of this log should see which tools that covered (OSK-10323).
|
|
@@ -2424,6 +2500,18 @@ class AgenticStreamClient {
|
|
|
2424
2500
|
this.renderedText = this.answerText();
|
|
2425
2501
|
}
|
|
2426
2502
|
}
|
|
2503
|
+
/**
|
|
2504
|
+
* `[tool denied] <tool> (it did not run)`, once per call (OSK-22553). The call's own end prints the
|
|
2505
|
+
* same line when the run reports one; this is the line for the runs that never do.
|
|
2506
|
+
*/
|
|
2507
|
+
writeRefusalLabel(event, output) {
|
|
2508
|
+
const id = typeof event.toolUseId === 'string' ? event.toolUseId : undefined;
|
|
2509
|
+
if (id && this.deniedLabelled.has(id))
|
|
2510
|
+
return;
|
|
2511
|
+
if (id)
|
|
2512
|
+
this.deniedLabelled.add(id);
|
|
2513
|
+
output.write(`\n${describeToolEnd(event.toolName, 'denied')}\n`);
|
|
2514
|
+
}
|
|
2427
2515
|
/**
|
|
2428
2516
|
* Human-mode lines for the hand-over wait. Returns true when the event is
|
|
2429
2517
|
* fully rendered here; false lets the ordinary rendering continue.
|
package/dist/lib/commitments.js
CHANGED
|
@@ -1011,7 +1011,12 @@ function renderCommitmentList(commitments, log) {
|
|
|
1011
1011
|
status: o.status ?? '-',
|
|
1012
1012
|
outcome: o.assessment?.label ?? 'Unknown',
|
|
1013
1013
|
evidence: o.assessment?.evidence ?? 'unavailable',
|
|
1014
|
-
|
|
1014
|
+
// `blocked` + `operation_read_unavailable` is "no sweep has recorded an operation for this
|
|
1015
|
+
// contract yet", which `show` then reads live as ready: the bare `blocked` here read as a
|
|
1016
|
+
// refusal and contradicted it (OSK-22586).
|
|
1017
|
+
operation: o.assessment?.operationReason === 'operation_read_unavailable'
|
|
1018
|
+
? 'not read yet'
|
|
1019
|
+
: (o.assessment?.operation ?? 'blocked'),
|
|
1015
1020
|
cadence: cadenceLabel(o),
|
|
1016
1021
|
agent: o.agentId ?? '-',
|
|
1017
1022
|
})), [
|
|
@@ -1038,6 +1043,13 @@ function renderCommitmentList(commitments, log) {
|
|
|
1038
1043
|
const reason = assessment.operationReason;
|
|
1039
1044
|
blockedByReason.set(reason, (blockedByReason.get(reason) ?? 0) + 1);
|
|
1040
1045
|
}
|
|
1046
|
+
const notRead = commitments.filter((commitment) => commitment.assessment?.operationReason ===
|
|
1047
|
+
'operation_read_unavailable').length;
|
|
1048
|
+
if (notRead) {
|
|
1049
|
+
log('');
|
|
1050
|
+
log(`${notRead} not read yet: no status is recorded for the current contract, which is not a failure. ` +
|
|
1051
|
+
'`skrr commitments show <id>` reads it live.');
|
|
1052
|
+
}
|
|
1041
1053
|
for (const [reason, count] of blockedByReason) {
|
|
1042
1054
|
log('');
|
|
1043
1055
|
log(`${count} blocked (${reason}): ${operationReasonWords(reason)}. \`skrr commitments show <id>\` names the fix.`);
|
package/dist/lib/compasses.js
CHANGED
|
@@ -279,7 +279,7 @@ function renderEffectivePolicy(policy, log) {
|
|
|
279
279
|
// The Gateway reads one Compass per agent for the agent's own messages; this one may not be it.
|
|
280
280
|
const gateway = record(policy.messageGateway);
|
|
281
281
|
if (gateway.readsThisCompass === false && typeof gateway.canonicalCompassId === 'string') {
|
|
282
|
-
log(`Agent messages: the Gateway reads ${gateway.canonicalCompassId} for this agent
|
|
282
|
+
log(`Agent messages: the Gateway reads ${gateway.canonicalCompassId} for this agent's communication defaults. From this Compass only a stricter mode counts for those messages (the strictest mode across active Compasses governs); its other defaults apply to Commitments bound to it.`);
|
|
283
283
|
}
|
|
284
284
|
const autonomy = record(policy.autonomy);
|
|
285
285
|
log('Autonomy');
|
|
@@ -312,7 +312,7 @@ function describePowerSummary(summary, when = {}) {
|
|
|
312
312
|
if (power.keepAwakeUntil)
|
|
313
313
|
lines.push(`Keep awake until: ${(0, format_1.formatWhen)(power.keepAwakeUntil, when)}`);
|
|
314
314
|
if (power.budgetHoursPerMonth !== null)
|
|
315
|
-
lines.push(`Budget: ${power.budgetHoursPerMonth} hours per month`);
|
|
315
|
+
lines.push(`Budget: ${power.budgetHoursPerMonth} ${power.budgetHoursPerMonth === 1 ? 'hour' : 'hours'} per month`);
|
|
316
316
|
if (summary.decision) {
|
|
317
317
|
const d = describePowerDecisionLines(summary.decision);
|
|
318
318
|
lines.push(`Decision: ${d.headline}`);
|
|
@@ -344,8 +344,15 @@ function describePowerSummary(summary, when = {}) {
|
|
|
344
344
|
lines.push(` - ${formatHolder(h, when)}`);
|
|
345
345
|
}
|
|
346
346
|
lines.push(`This month: ${formatUsage(summary.usage)}`);
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
if (power.policy === 'manual' && summary.nextExpectedWake) {
|
|
348
|
+
// A manual machine is started only by its owner, so a scheduled firing is work that will wait for
|
|
349
|
+
// that start, not a wake (OSK-22556). The value is the same one; only its label changes.
|
|
350
|
+
lines.push(`Next scheduled work: ${(0, format_1.formatWhen)(summary.nextExpectedWake, when)} (waits until you start the machine)`);
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
lines.push(`Next expected wake: ${(summary.nextExpectedWake ? (0, format_1.formatWhen)(summary.nextExpectedWake, when) : null) ??
|
|
354
|
+
(summary.nextExpectedWakeUnavailable ? 'unavailable' : 'none scheduled')}`);
|
|
355
|
+
}
|
|
349
356
|
lines.push(`Last wake: ${summary.lastWake
|
|
350
357
|
? `${summary.lastWake.at ? (0, format_1.formatWhen)(summary.lastWake.at, when) : 'unknown time'}${summary.lastWake.source ? ` (${summary.lastWake.source})` : ''}`
|
|
351
358
|
: 'none'}`);
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -141,6 +141,21 @@ export declare function zoneAbbreviation(timeZone: string, at?: Date): string;
|
|
|
141
141
|
export declare function zonedTime(value: unknown, timeZone: string, options?: {
|
|
142
142
|
seconds?: boolean;
|
|
143
143
|
}): string;
|
|
144
|
+
/**
|
|
145
|
+
* Rewrite the full ISO-8601 instants inside a sentence into `timeZone`, named:
|
|
146
|
+
* `Next planning run scheduled for 2026-11-04T08:00:00.000Z` becomes
|
|
147
|
+
* `... for 2026-11-04 00:00 PST`.
|
|
148
|
+
*
|
|
149
|
+
* The server writes its own summary strings, and some of them embed an instant
|
|
150
|
+
* (a scheduled run, a prompt that quotes a time). Printed as they arrive, the
|
|
151
|
+
* rest of the output is in the plan's zone while these stay in UTC, so the same
|
|
152
|
+
* moment reads two ways on one screen (OSK-22588). This touches ONLY a complete
|
|
153
|
+
* instant with an explicit zone, never a bare date, a time of day or an ID that
|
|
154
|
+
* merely looks like one, so it cannot reword a sentence it does not understand.
|
|
155
|
+
* Seconds are shown only when the instant has them. Text only: `--json` keeps
|
|
156
|
+
* the server's string untouched. Never throws.
|
|
157
|
+
*/
|
|
158
|
+
export declare function localizeIsoInstants(text: string, timeZone: string): string;
|
|
144
159
|
export type WhenOptions = {
|
|
145
160
|
/** The reference instant; injectable so output is deterministic in tests. */
|
|
146
161
|
now?: Date;
|
|
@@ -154,3 +169,8 @@ export type WhenOptions = {
|
|
|
154
169
|
* the raw ISO string; this is for text only. Unparseable input is returned as is.
|
|
155
170
|
*/
|
|
156
171
|
export declare function formatWhen(value: unknown, options?: WhenOptions): string;
|
|
172
|
+
/**
|
|
173
|
+
* A span of seconds as people say it: "45s", "7m 36s", "1h 5m". Used for how far past its time a
|
|
174
|
+
* one-shot is, where a bare second count (456) hides that it is minutes.
|
|
175
|
+
*/
|
|
176
|
+
export declare function formatElapsed(seconds: number): string;
|
package/dist/lib/format.js
CHANGED
|
@@ -13,7 +13,9 @@ exports.localTime = localTime;
|
|
|
13
13
|
exports.localZone = localZone;
|
|
14
14
|
exports.zoneAbbreviation = zoneAbbreviation;
|
|
15
15
|
exports.zonedTime = zonedTime;
|
|
16
|
+
exports.localizeIsoInstants = localizeIsoInstants;
|
|
16
17
|
exports.formatWhen = formatWhen;
|
|
18
|
+
exports.formatElapsed = formatElapsed;
|
|
17
19
|
/**
|
|
18
20
|
* Code points that occupy TWO terminal columns (Unicode East Asian Wide and
|
|
19
21
|
* Fullwidth), plus the emoji blocks terminals render double-width.
|
|
@@ -393,6 +395,36 @@ function zonedTime(value, timeZone, options = {}) {
|
|
|
393
395
|
return render('UTC');
|
|
394
396
|
}
|
|
395
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* A full ISO-8601 instant: date, time and an explicit UTC designator or offset
|
|
400
|
+
* (`2026-11-04T08:00:00.000Z`, `2026-11-04T08:00+00:00`). A date alone, or a time
|
|
401
|
+
* with no zone, names no instant and is deliberately not matched.
|
|
402
|
+
*/
|
|
403
|
+
const ISO_INSTANT = /\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}(?::?\d{2})?)(?![\w])/g;
|
|
404
|
+
/**
|
|
405
|
+
* Rewrite the full ISO-8601 instants inside a sentence into `timeZone`, named:
|
|
406
|
+
* `Next planning run scheduled for 2026-11-04T08:00:00.000Z` becomes
|
|
407
|
+
* `... for 2026-11-04 00:00 PST`.
|
|
408
|
+
*
|
|
409
|
+
* The server writes its own summary strings, and some of them embed an instant
|
|
410
|
+
* (a scheduled run, a prompt that quotes a time). Printed as they arrive, the
|
|
411
|
+
* rest of the output is in the plan's zone while these stay in UTC, so the same
|
|
412
|
+
* moment reads two ways on one screen (OSK-22588). This touches ONLY a complete
|
|
413
|
+
* instant with an explicit zone, never a bare date, a time of day or an ID that
|
|
414
|
+
* merely looks like one, so it cannot reword a sentence it does not understand.
|
|
415
|
+
* Seconds are shown only when the instant has them. Text only: `--json` keeps
|
|
416
|
+
* the server's string untouched. Never throws.
|
|
417
|
+
*/
|
|
418
|
+
function localizeIsoInstants(text, timeZone) {
|
|
419
|
+
if (!text || !text.includes('T'))
|
|
420
|
+
return text;
|
|
421
|
+
return text.replace(ISO_INSTANT, (match) => {
|
|
422
|
+
const date = new Date(match);
|
|
423
|
+
if (Number.isNaN(date.getTime()))
|
|
424
|
+
return match;
|
|
425
|
+
return zonedTime(date, timeZone, { seconds: date.getUTCSeconds() !== 0 });
|
|
426
|
+
});
|
|
427
|
+
}
|
|
396
428
|
function zonedParts(date, timeZone) {
|
|
397
429
|
const parts = new Intl.DateTimeFormat('en-CA', {
|
|
398
430
|
timeZone,
|
|
@@ -443,3 +475,18 @@ function formatWhen(value, options = {}) {
|
|
|
443
475
|
const relative = span === 'under a minute' ? 'just now' : delta >= 0 ? `in ${span}` : `${span} ago`;
|
|
444
476
|
return `${stamp} (${relative})`;
|
|
445
477
|
}
|
|
478
|
+
/**
|
|
479
|
+
* A span of seconds as people say it: "45s", "7m 36s", "1h 5m". Used for how far past its time a
|
|
480
|
+
* one-shot is, where a bare second count (456) hides that it is minutes.
|
|
481
|
+
*/
|
|
482
|
+
function formatElapsed(seconds) {
|
|
483
|
+
const total = Math.max(0, Math.floor(seconds));
|
|
484
|
+
const h = Math.floor(total / 3600);
|
|
485
|
+
const m = Math.floor((total % 3600) / 60);
|
|
486
|
+
const sec = total % 60;
|
|
487
|
+
if (h > 0)
|
|
488
|
+
return m > 0 ? `${h}h ${m}m` : `${h}h`;
|
|
489
|
+
if (m > 0)
|
|
490
|
+
return sec > 0 ? `${m}m ${sec}s` : `${m}m`;
|
|
491
|
+
return `${sec}s`;
|
|
492
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* planOutcome.ts — read a Smart Schedule planning fire's recorded outcome.
|
|
3
|
+
*
|
|
4
|
+
* A watcher or planning-run fire that "completed" may have drafted nothing: it was watch-only,
|
|
5
|
+
* nothing changed, One Voice held it, quiet hours lowered auto to review, the planner proposed no
|
|
6
|
+
* blocks or failed. The API records which one on the fire (`metadata.builtinAction.planOutcome`) and
|
|
7
|
+
* the schedule trace carries it on the event (`detail.planOutcome`). These helpers only read and
|
|
8
|
+
* word that record; the vocabulary is owned by `@skrr-ai/data-provider` and the sentence by the API.
|
|
9
|
+
*/
|
|
10
|
+
import { type SmartSchedulePlanOutcome } from '@skrr-ai/data-provider';
|
|
11
|
+
/** The recorded outcome in `value`, or null when it is absent or not a known outcome. */
|
|
12
|
+
export declare function readPlanOutcome(value: unknown): SmartSchedulePlanOutcome | null;
|
|
13
|
+
interface TraceEventLike {
|
|
14
|
+
id?: string;
|
|
15
|
+
summary?: string;
|
|
16
|
+
occurredAt?: string;
|
|
17
|
+
detail?: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Under the trace table: for every planning fire, WHY it did or did not leave a plan. The table's
|
|
21
|
+
* summary column says what ran; this says what it decided.
|
|
22
|
+
*/
|
|
23
|
+
export declare function renderPlanOutcomeTraceDetails(events: TraceEventLike[], log: (line: string) => void, formatWhen?: (at: string) => string): void;
|
|
24
|
+
/**
|
|
25
|
+
* The answer to "why no plan today?" from the newest planning fire in this trace, or null when no
|
|
26
|
+
* fire in it recorded an outcome. Events arrive newest first.
|
|
27
|
+
*/
|
|
28
|
+
export declare function latestPlanOutcomeLine(events: TraceEventLike[]): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* The REASON column of a fire-audit row: the planning outcome's sentence when the fire recorded
|
|
31
|
+
* one, else undefined so the caller falls back to the fire's own reason.
|
|
32
|
+
*/
|
|
33
|
+
export declare function fireAuditPlanOutcomeSummary(fire: {
|
|
34
|
+
metadata?: {
|
|
35
|
+
builtinAction?: {
|
|
36
|
+
planOutcome?: unknown;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}): string | undefined;
|
|
40
|
+
/** A trigger the Always-On control fence withholds, as `/api/upcoming` reports it. */
|
|
41
|
+
interface WithheldLike {
|
|
42
|
+
reason?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The line under "withheld" in the upcoming view when the cause is Always-On. A trigger that is
|
|
46
|
+
* listed under Upcoming has passed the same fence the withheld ones failed, so it is not gated by
|
|
47
|
+
* Always-On: it still fires. Without this the two lists sit side by side and read as one rule
|
|
48
|
+
* (OSK-22406). Null when nothing is withheld for Always-On or nothing is listed.
|
|
49
|
+
*/
|
|
50
|
+
export declare function alwaysOnUpcomingNote(withheld: WithheldLike[], listedCount: number): string | null;
|
|
51
|
+
export {};
|