@skrr-ai/cli 0.1.142 → 0.1.144
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 +8 -0
- package/dist/base-command.d.ts +4 -2
- package/dist/base-command.js +46 -13
- package/dist/commands/agenda/trigger/create.js +4 -2
- package/dist/commands/agenda/trigger/list.js +7 -7
- package/dist/commands/agent/message/approve.d.ts +17 -0
- package/dist/commands/agent/message/approve.js +72 -0
- package/dist/commands/agent/message/decline.d.ts +17 -0
- package/dist/commands/agent/message/decline.js +72 -0
- package/dist/commands/agent/message/pending.d.ts +18 -0
- package/dist/commands/agent/message/pending.js +79 -0
- package/dist/commands/agents/always-on/disable.js +9 -1
- package/dist/commands/agents/always-on/enable.js +9 -1
- package/dist/commands/agents/always-on/status.js +14 -1
- package/dist/commands/agents/create.js +10 -1
- package/dist/commands/agents/delete.d.ts +51 -0
- package/dist/commands/agents/delete.js +163 -2
- package/dist/commands/agents/intuitions/list.js +1 -1
- package/dist/commands/agents/plan-day.d.ts +39 -7
- package/dist/commands/agents/plan-day.js +254 -65
- package/dist/commands/agents/proactive-audit.d.ts +22 -0
- package/dist/commands/agents/proactive-audit.js +86 -0
- package/dist/commands/agents/schedule-overview.d.ts +7 -0
- package/dist/commands/agents/schedule-overview.js +43 -5
- package/dist/commands/agents/schedule-trace.js +30 -19
- package/dist/commands/agents/spawn.d.ts +51 -0
- package/dist/commands/agents/spawn.js +212 -9
- package/dist/commands/agents/todos/cancel.js +3 -0
- package/dist/commands/agents/todos/edit.js +1 -1
- package/dist/commands/agents/todos/list.d.ts +5 -0
- package/dist/commands/agents/todos/list.js +19 -5
- package/dist/commands/agents/triggers/create.js +1 -1
- package/dist/commands/agents/triggers/policy.js +7 -0
- package/dist/commands/agents/triggers/update.js +1 -1
- package/dist/commands/commitments/create.js +13 -3
- package/dist/commands/commitments/preflight.js +31 -5
- package/dist/commands/daemon/index.js +1 -0
- package/dist/commands/daemon/logs.d.ts +8 -1
- package/dist/commands/daemon/logs.js +32 -22
- package/dist/commands/daemon/profile.d.ts +15 -0
- package/dist/commands/daemon/profile.js +51 -0
- package/dist/commands/goals/briefing/status.js +1 -1
- package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
- package/dist/commands/initiatives/worker/deactivate.js +78 -0
- package/dist/commands/login.js +8 -2
- package/dist/commands/logout.d.ts +20 -0
- package/dist/commands/logout.js +110 -5
- package/dist/commands/machines/profiles/disconnect.d.ts +23 -0
- package/dist/commands/machines/profiles/disconnect.js +102 -0
- package/dist/commands/machines/profiles/index.d.ts +15 -0
- package/dist/commands/machines/profiles/index.js +33 -0
- package/dist/commands/machines/profiles/label.d.ts +24 -0
- package/dist/commands/machines/profiles/label.js +85 -0
- package/dist/commands/machines/profiles/list.d.ts +16 -0
- package/dist/commands/machines/profiles/list.js +87 -0
- package/dist/commands/memory/maintain.js +16 -2
- package/dist/commands/profiles/list.js +17 -2
- package/dist/commands/spaces/delete.js +6 -1
- package/dist/commands/spaces/workflows/archive.js +6 -1
- package/dist/commands/spaces/workflows/publish.js +3 -1
- package/dist/commands/spaces/workflows/run.d.ts +1 -0
- package/dist/commands/spaces/workflows/run.js +17 -1
- package/dist/commands/spaces/workflows/triggers/create.js +3 -1
- package/dist/commands/tasks/workflow-context.js +3 -1
- package/dist/commands/triggers/authorization.js +1 -1
- package/dist/commands/triggers/capabilities.js +17 -1
- package/dist/commands/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +23 -7
- package/dist/commands/triggers/fire-detail.js +12 -3
- package/dist/commands/triggers/list.d.ts +1 -0
- package/dist/commands/triggers/list.js +13 -1
- package/dist/commands/triggers/preflight.js +18 -0
- package/dist/commands/triggers/prune.js +9 -5
- package/dist/commands/triggers/update.js +13 -4
- package/dist/generated/agent-guides.json +35 -35
- package/dist/lib/agent-guides.js +1 -1
- package/dist/lib/agent-proactive-baseline.d.ts +6 -0
- package/dist/lib/agent-proactive-baseline.js +32 -3
- package/dist/lib/always-on-command-result.d.ts +18 -0
- package/dist/lib/always-on-command-result.js +52 -0
- package/dist/lib/always-on-runtime.d.ts +31 -0
- package/dist/lib/always-on-runtime.js +39 -0
- package/dist/lib/auth-diagnostics.d.ts +10 -1
- package/dist/lib/auth-diagnostics.js +16 -8
- package/dist/lib/commitments.d.ts +16 -9
- package/dist/lib/commitments.js +65 -4
- package/dist/lib/compasses.js +5 -0
- package/dist/lib/daemon-binding.js +6 -3
- package/dist/lib/daemon-command-hint.d.ts +10 -5
- package/dist/lib/daemon-command-hint.js +11 -6
- package/dist/lib/daemon-setup.js +9 -3
- package/dist/lib/daemonBroker.d.ts +7 -0
- package/dist/lib/daemonBroker.js +5 -0
- package/dist/lib/daemonHandoff.d.ts +2 -0
- package/dist/lib/daemonHandoff.js +16 -3
- package/dist/lib/daemonIslandProfile.d.ts +19 -0
- package/dist/lib/daemonIslandProfile.js +41 -0
- package/dist/lib/drain-stdio.d.ts +22 -0
- package/dist/lib/drain-stdio.js +46 -0
- package/dist/lib/format.d.ts +32 -0
- package/dist/lib/format.js +105 -1
- package/dist/lib/initiatives-worker.d.ts +25 -0
- package/dist/lib/initiatives-worker.js +13 -0
- package/dist/lib/keychain.d.ts +22 -1
- package/dist/lib/keychain.js +40 -1
- package/dist/lib/local-daemon-readiness.js +4 -6
- package/dist/lib/local-skills.js +4 -1
- package/dist/lib/login.d.ts +7 -0
- package/dist/lib/login.js +5 -0
- package/dist/lib/machines.d.ts +68 -0
- package/dist/lib/machines.js +67 -0
- package/dist/lib/proactive-audit.d.ts +52 -0
- package/dist/lib/proactive-audit.js +67 -0
- package/dist/lib/proactiveApi.d.ts +23 -0
- package/dist/lib/refresh.d.ts +20 -6
- package/dist/lib/refresh.js +27 -9
- package/dist/lib/roles.d.ts +1 -1
- package/dist/lib/runtime-start-verification.js +3 -6
- package/dist/lib/schedule.d.ts +189 -9
- package/dist/lib/schedule.js +283 -22
- package/dist/lib/triggers.d.ts +134 -3
- package/dist/lib/triggers.js +370 -17
- package/dist/lib/workflow-node-control.js +8 -0
- package/dist/lib/workflow-run-view.js +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.d.ts +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +10 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.d.ts +133 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.js +180 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +50 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.d.ts +137 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.js +328 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.js +174 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.d.ts +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +14 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +27 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.d.ts +133 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.js +183 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +11 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.d.ts +137 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.js +333 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.js +212 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +7446 -7378
- package/oclif.manifest.json +844 -47
- package/package.json +1 -1
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
"id": "later",
|
|
393
393
|
"title": "Choose how to act later",
|
|
394
394
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
395
|
-
"tokens":
|
|
395
|
+
"tokens": 538,
|
|
396
396
|
"aliases": [],
|
|
397
397
|
"explains": []
|
|
398
398
|
},
|
|
@@ -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": 1167,
|
|
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": "adec03aab3bb26844ecd6686c8ec837709213aa1185e643fbedf773d44fdf44b",
|
|
713
713
|
"tokens": 545
|
|
714
714
|
},
|
|
715
715
|
"routedIndex": {
|
|
@@ -1105,7 +1105,7 @@
|
|
|
1105
1105
|
"id": "later",
|
|
1106
1106
|
"title": "Choose how to act later",
|
|
1107
1107
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
1108
|
-
"tokens":
|
|
1108
|
+
"tokens": 538,
|
|
1109
1109
|
"aliases": [],
|
|
1110
1110
|
"explains": []
|
|
1111
1111
|
},
|
|
@@ -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": 1167,
|
|
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": "b7c253138eb714aae57f25c611b22cac61311d88839a1b21aec83ca3607cb3d1",
|
|
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": "14ebc97d9cee24eb4b6c50968895a1cfad156a482907392718e990ebfce96e84",
|
|
1751
1751
|
"tokens": 1169,
|
|
1752
1752
|
"sections": [
|
|
1753
1753
|
{
|
|
@@ -1762,7 +1762,7 @@
|
|
|
1762
1762
|
"id": "later",
|
|
1763
1763
|
"title": "Choose how to act later",
|
|
1764
1764
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
1765
|
-
"tokens":
|
|
1765
|
+
"tokens": 538,
|
|
1766
1766
|
"aliases": [],
|
|
1767
1767
|
"explains": []
|
|
1768
1768
|
},
|
|
@@ -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": 1167,
|
|
1784
1784
|
"aliases": [],
|
|
1785
1785
|
"explains": [
|
|
1786
1786
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -5788,7 +5788,7 @@
|
|
|
5788
5788
|
"id": "later",
|
|
5789
5789
|
"title": "Choose how to act later",
|
|
5790
5790
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
5791
|
-
"tokens":
|
|
5791
|
+
"tokens": 538,
|
|
5792
5792
|
"aliases": [],
|
|
5793
5793
|
"explains": []
|
|
5794
5794
|
},
|
|
@@ -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": 1167,
|
|
5810
5810
|
"aliases": [],
|
|
5811
5811
|
"explains": [
|
|
5812
5812
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -5888,9 +5888,9 @@
|
|
|
5888
5888
|
"version": 4,
|
|
5889
5889
|
"aliases": [],
|
|
5890
5890
|
"explains": [],
|
|
5891
|
-
"body": "Read this when you must choose how to make something happen later, repeatedly or continuously.\n\n## Choose by the ask\n\n- **It ends.** \"Look tomorrow\", \"tell me when the review lands\", \"remind me on Friday\": a\n follow-up. A loop that outlives the ask is the wrong record, however useful it seems.\n- **It repeats on a clock the person named, with the same work each time.** \"Every weekday at 9,\n brief me\": a trigger.\n- **It is contact, not an outcome.** \"Check in with me daily\": a heartbeat, which backs off while\n its messages go unread.\n- **It must stay true.** \"Keep our deploy failure rate low\", \"watch this metric\": a Commitment. It\n needs sources it can read and a cadence, and its loop decides when anything is worth doing.\n- **It is several steps in order.** A Workflow: a graph of Tasks in a Space.\n\nWho asked matters as much as when. A reminder keeps the person's words. A check-in you decided on\nis arranged by you, without asking whether you should.\n\n## Arrange it\n\n| Mechanism | Command |\n| --- | --- |\n| Follow-up | `skrr followups remind`, `skrr followups watch`, `skrr followups checkin` or `skrr followups act` |\n| Trigger | `skrr triggers create` |\n| Heartbeat | `skrr spaces heartbeats create`, for a Space
|
|
5892
|
-
"hash": "
|
|
5893
|
-
"tokens":
|
|
5891
|
+
"body": "Read this when you must choose how to make something happen later, repeatedly or continuously.\n\n## Choose by the ask\n\n- **It ends.** \"Look tomorrow\", \"tell me when the review lands\", \"remind me on Friday\": a\n follow-up. A loop that outlives the ask is the wrong record, however useful it seems.\n- **It repeats on a clock the person named, with the same work each time.** \"Every weekday at 9,\n brief me\": a trigger.\n- **It is contact, not an outcome.** \"Check in with me daily\": a heartbeat, which backs off while\n its messages go unread.\n- **It must stay true.** \"Keep our deploy failure rate low\", \"watch this metric\": a Commitment. It\n needs sources it can read and a cadence, and its loop decides when anything is worth doing.\n- **It is several steps in order.** A Workflow: a graph of Tasks in a Space.\n\nWho asked matters as much as when. A reminder keeps the person's words. A check-in you decided on\nis arranged by you, without asking whether you should.\n\n## Arrange it\n\n| Mechanism | Command |\n| --- | --- |\n| Follow-up | `skrr followups remind`, `skrr followups watch`, `skrr followups checkin` or `skrr followups act` |\n| Trigger | `skrr triggers create` |\n| Heartbeat | `skrr spaces heartbeats create`, for a Space. No command sets up a personal one: for \"check in with me\", use `skrr followups checkin --frequency \"<cron>\" --timezone <zone>` |\n| Commitment | `skrr commitments create`, which makes a draft |\n| Workflow | `skrr spaces workflows create` |\n\n## Example\n\n\"CI on main has been flaky all week. Look at it tomorrow morning and tell me whether it's still\nred.\" The ask ends tomorrow, so it is a watch follow-up: one look at a set time that reports back.\n\n```bash\nskrr followups watch --subject ci:main --why \"Owner asked whether CI on main is still red\" \\\n --check \"Read the latest CI run on main\" --success \"The latest run on main passed\" \\\n --abort \"No CI run on main within two days\" --wait clock --wait-at <tomorrow-09:00-with-offset>\n```\n\nWhen it wakes, report either answer to the owner and settle it with `skrr followups resolve`.",
|
|
5892
|
+
"hash": "1f37219cbeedbe5af8fe0c2b4d32d5794d112854314287691ad878a2e2fd4050",
|
|
5893
|
+
"tokens": 538,
|
|
5894
5894
|
"sections": [
|
|
5895
5895
|
{
|
|
5896
5896
|
"id": "model",
|
|
@@ -5904,7 +5904,7 @@
|
|
|
5904
5904
|
"id": "later",
|
|
5905
5905
|
"title": "Choose how to act later",
|
|
5906
5906
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
5907
|
-
"tokens":
|
|
5907
|
+
"tokens": 538,
|
|
5908
5908
|
"aliases": [],
|
|
5909
5909
|
"explains": []
|
|
5910
5910
|
},
|
|
@@ -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": 1167,
|
|
5926
5926
|
"aliases": [],
|
|
5927
5927
|
"explains": [
|
|
5928
5928
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6022,7 +6022,7 @@
|
|
|
6022
6022
|
"id": "later",
|
|
6023
6023
|
"title": "Choose how to act later",
|
|
6024
6024
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6025
|
-
"tokens":
|
|
6025
|
+
"tokens": 538,
|
|
6026
6026
|
"aliases": [],
|
|
6027
6027
|
"explains": []
|
|
6028
6028
|
},
|
|
@@ -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": 1167,
|
|
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`
|
|
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`. With `event_plus_interval` an event makes a check come\n sooner; it is an accelerator, not a delivery receipt. An event can be missed and is not\n replayed. At each interval the Commitment re-checks current state, which finds what a missed\n event would have reported, but only while it is running. Silence from a watched source\n therefore means no event was seen, not that none happened.\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": "8232a4c2a0736850f26cd59b56f804105dfa93137509ade13704497f3df2467d",
|
|
6133
|
+
"tokens": 1167,
|
|
6134
6134
|
"sections": [
|
|
6135
6135
|
{
|
|
6136
6136
|
"id": "model",
|
|
@@ -6144,7 +6144,7 @@
|
|
|
6144
6144
|
"id": "later",
|
|
6145
6145
|
"title": "Choose how to act later",
|
|
6146
6146
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6147
|
-
"tokens":
|
|
6147
|
+
"tokens": 538,
|
|
6148
6148
|
"aliases": [],
|
|
6149
6149
|
"explains": []
|
|
6150
6150
|
},
|
|
@@ -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": 1167,
|
|
6166
6166
|
"aliases": [],
|
|
6167
6167
|
"explains": [
|
|
6168
6168
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6260,7 +6260,7 @@
|
|
|
6260
6260
|
"id": "later",
|
|
6261
6261
|
"title": "Choose how to act later",
|
|
6262
6262
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6263
|
-
"tokens":
|
|
6263
|
+
"tokens": 538,
|
|
6264
6264
|
"aliases": [],
|
|
6265
6265
|
"explains": []
|
|
6266
6266
|
},
|
|
@@ -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": 1167,
|
|
6282
6282
|
"aliases": [],
|
|
6283
6283
|
"explains": [
|
|
6284
6284
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6376,7 +6376,7 @@
|
|
|
6376
6376
|
"id": "later",
|
|
6377
6377
|
"title": "Choose how to act later",
|
|
6378
6378
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6379
|
-
"tokens":
|
|
6379
|
+
"tokens": 538,
|
|
6380
6380
|
"aliases": [],
|
|
6381
6381
|
"explains": []
|
|
6382
6382
|
},
|
|
@@ -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": 1167,
|
|
6398
6398
|
"aliases": [],
|
|
6399
6399
|
"explains": [
|
|
6400
6400
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6498,7 +6498,7 @@
|
|
|
6498
6498
|
"id": "later",
|
|
6499
6499
|
"title": "Choose how to act later",
|
|
6500
6500
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6501
|
-
"tokens":
|
|
6501
|
+
"tokens": 538,
|
|
6502
6502
|
"aliases": [],
|
|
6503
6503
|
"explains": []
|
|
6504
6504
|
},
|
|
@@ -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": 1167,
|
|
6520
6520
|
"aliases": [],
|
|
6521
6521
|
"explains": [
|
|
6522
6522
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6614,7 +6614,7 @@
|
|
|
6614
6614
|
"id": "later",
|
|
6615
6615
|
"title": "Choose how to act later",
|
|
6616
6616
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6617
|
-
"tokens":
|
|
6617
|
+
"tokens": 538,
|
|
6618
6618
|
"aliases": [],
|
|
6619
6619
|
"explains": []
|
|
6620
6620
|
},
|
|
@@ -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": 1167,
|
|
6636
6636
|
"aliases": [],
|
|
6637
6637
|
"explains": [
|
|
6638
6638
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6734,7 +6734,7 @@
|
|
|
6734
6734
|
"id": "later",
|
|
6735
6735
|
"title": "Choose how to act later",
|
|
6736
6736
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6737
|
-
"tokens":
|
|
6737
|
+
"tokens": 538,
|
|
6738
6738
|
"aliases": [],
|
|
6739
6739
|
"explains": []
|
|
6740
6740
|
},
|
|
@@ -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": 1167,
|
|
6756
6756
|
"aliases": [],
|
|
6757
6757
|
"explains": [
|
|
6758
6758
|
"COMMITMENT_MODE_RETIRED",
|
|
@@ -6852,7 +6852,7 @@
|
|
|
6852
6852
|
"id": "later",
|
|
6853
6853
|
"title": "Choose how to act later",
|
|
6854
6854
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6855
|
-
"tokens":
|
|
6855
|
+
"tokens": 538,
|
|
6856
6856
|
"aliases": [],
|
|
6857
6857
|
"explains": []
|
|
6858
6858
|
},
|
|
@@ -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": 1167,
|
|
6874
6874
|
"aliases": [],
|
|
6875
6875
|
"explains": [
|
|
6876
6876
|
"COMMITMENT_MODE_RETIRED",
|
package/dist/lib/agent-guides.js
CHANGED
|
@@ -88,7 +88,7 @@ async function readAgentGuide(request, flags) {
|
|
|
88
88
|
let source = 'bundled';
|
|
89
89
|
let reason = flags.offline ? 'offline-requested' : 'no-session';
|
|
90
90
|
if (!flags.offline) {
|
|
91
|
-
(0, keychain_1.
|
|
91
|
+
(0, keychain_1.selectActiveProfile)(flags.profile);
|
|
92
92
|
let credential;
|
|
93
93
|
let autonomous = false;
|
|
94
94
|
try {
|
|
@@ -6,4 +6,10 @@ import type { AgentCreationDisposition, AgentProactiveBaseline } from '@skrr-ai/
|
|
|
6
6
|
* unreadable fact prints as `unknown`, never as missing.
|
|
7
7
|
*/
|
|
8
8
|
export declare function proactiveBaselineLines(b?: AgentProactiveBaseline | null): string[];
|
|
9
|
+
/**
|
|
10
|
+
* The ceiling is the sum of what the EXPECTED system loops declare, not of the loops
|
|
11
|
+
* that exist. A standby duplicate with 0 of its 5 loops printed "23/day (declared by
|
|
12
|
+
* the system loops)", which read as a budget it was spending (OSK-22353).
|
|
13
|
+
*/
|
|
14
|
+
export declare function modelRunCeilingText(b: AgentProactiveBaseline): string;
|
|
9
15
|
export declare function creationDispositionLines(p?: AgentCreationDisposition | null): string[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.proactiveBaselineLines = proactiveBaselineLines;
|
|
4
|
+
exports.modelRunCeilingText = modelRunCeilingText;
|
|
4
5
|
exports.creationDispositionLines = creationDispositionLines;
|
|
5
6
|
/**
|
|
6
7
|
* Human lines for the read-only proactive baseline an Always-On status carries
|
|
@@ -17,12 +18,21 @@ function proactiveBaselineLines(b) {
|
|
|
17
18
|
? 'unknown'
|
|
18
19
|
: `${b.systemLoops.present.length}/${b.systemLoops.expected.length}` +
|
|
19
20
|
(b.systemLoops.paused.length ? ` (paused: ${b.systemLoops.paused.join(', ')})` : '') +
|
|
20
|
-
(b.systemLoops.missing.length ? ` (missing: ${b.systemLoops.missing.join(', ')})` : '')
|
|
21
|
+
(b.systemLoops.missing.length ? ` (missing: ${b.systemLoops.missing.join(', ')})` : '') +
|
|
22
|
+
(b.systemLoops.blocked?.length
|
|
23
|
+
? ` (cannot run: ${b.systemLoops.blocked.map((loop) => `${loop.role} - ${loop.reason}`).join(', ')})`
|
|
24
|
+
: '');
|
|
21
25
|
const watchers = b.watchers.status === 'unknown'
|
|
22
26
|
? 'unknown'
|
|
23
27
|
: `${b.watchers.total} (${b.watchers.enabled} enabled; separate from Always-On)`;
|
|
28
|
+
// `unknown` also means "present, but who wrote it is not recorded" (a Compass applied from a
|
|
29
|
+
// spec, say); only an unreadable one is listed under `unknown[]`. Printing "Compass unknown"
|
|
30
|
+
// beside an empty `unknown` list read like a failed read (OSK-22348).
|
|
31
|
+
const compassText = b.compass.source === 'unknown' && !b.unknown.includes('compass')
|
|
32
|
+
? 'present (author not recorded)'
|
|
33
|
+
: b.compass.source;
|
|
24
34
|
const lines = [
|
|
25
|
-
`Baseline: Always-On ${armed}; policy ${b.policy.source}; Compass ${
|
|
35
|
+
`Baseline: Always-On ${armed}; policy ${b.policy.source}; Compass ${compassText}`,
|
|
26
36
|
];
|
|
27
37
|
const quiet = b.policy.quietHours;
|
|
28
38
|
if (quiet) {
|
|
@@ -37,11 +47,30 @@ function proactiveBaselineLines(b) {
|
|
|
37
47
|
}
|
|
38
48
|
lines.push(`System loops: ${loops}`);
|
|
39
49
|
lines.push(`Watchers: ${watchers}`);
|
|
40
|
-
lines.push(`Model-run ceiling: ${b
|
|
50
|
+
lines.push(`Model-run ceiling: ${modelRunCeilingText(b)}`);
|
|
41
51
|
for (const gap of b.gaps)
|
|
42
52
|
lines.push(` ${gap.code}: ${gap.fix}`);
|
|
43
53
|
return lines;
|
|
44
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* The ceiling is the sum of what the EXPECTED system loops declare, not of the loops
|
|
57
|
+
* that exist. A standby duplicate with 0 of its 5 loops printed "23/day (declared by
|
|
58
|
+
* the system loops)", which read as a budget it was spending (OSK-22353).
|
|
59
|
+
*/
|
|
60
|
+
function modelRunCeilingText(b) {
|
|
61
|
+
const ceiling = b.dailyModelRunCeiling;
|
|
62
|
+
if (b.systemLoops.status === 'unknown')
|
|
63
|
+
return `${ceiling}/day if its system loops are installed (their state is unknown)`;
|
|
64
|
+
const expected = b.systemLoops.expected.length;
|
|
65
|
+
const present = b.systemLoops.present.length;
|
|
66
|
+
if (expected === 0 || ceiling === 0)
|
|
67
|
+
return `${ceiling}/day (no system loop declares a budget)`;
|
|
68
|
+
if (present >= expected)
|
|
69
|
+
return `${ceiling}/day (declared by its ${expected} system loops)`;
|
|
70
|
+
if (present === 0)
|
|
71
|
+
return `none now; ${ceiling}/day once its ${expected} system loops are installed`;
|
|
72
|
+
return `${ceiling}/day once all ${expected} system loops are installed (${present} are now)`;
|
|
73
|
+
}
|
|
45
74
|
function creationDispositionLines(p) {
|
|
46
75
|
if (!p)
|
|
47
76
|
return [];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AlwaysOnStatus } from '@skrr-ai/data-provider';
|
|
2
|
+
/**
|
|
3
|
+
* What `skrr agents always-on enable|disable` should say about the response to
|
|
4
|
+
* its control write (OSK-21992).
|
|
5
|
+
*
|
|
6
|
+
* The response is the composed status read at the END of the request. Two
|
|
7
|
+
* concurrent opposite commands are both valid when one of them is a no-op, so
|
|
8
|
+
* "disable" can come back from a server whose Agent is now ON. Printing
|
|
9
|
+
* "Always-On disabled" there is a claim the same response contradicts.
|
|
10
|
+
*
|
|
11
|
+
* `matched` is whether the Agent ended in the state the caller asked for. It is
|
|
12
|
+
* the command's exit code: a script chaining `disable && …` must not carry on
|
|
13
|
+
* with an Agent that is still on.
|
|
14
|
+
*/
|
|
15
|
+
export declare function alwaysOnCommandResult(requested: boolean, status: Pick<AlwaysOnStatus, 'desiredEnabled' | 'generation' | 'operationalState' | 'controlCommand'>): {
|
|
16
|
+
matched: boolean;
|
|
17
|
+
line: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.alwaysOnCommandResult = alwaysOnCommandResult;
|
|
4
|
+
/**
|
|
5
|
+
* What `skrr agents always-on enable|disable` should say about the response to
|
|
6
|
+
* its control write (OSK-21992).
|
|
7
|
+
*
|
|
8
|
+
* The response is the composed status read at the END of the request. Two
|
|
9
|
+
* concurrent opposite commands are both valid when one of them is a no-op, so
|
|
10
|
+
* "disable" can come back from a server whose Agent is now ON. Printing
|
|
11
|
+
* "Always-On disabled" there is a claim the same response contradicts.
|
|
12
|
+
*
|
|
13
|
+
* `matched` is whether the Agent ended in the state the caller asked for. It is
|
|
14
|
+
* the command's exit code: a script chaining `disable && …` must not carry on
|
|
15
|
+
* with an Agent that is still on.
|
|
16
|
+
*/
|
|
17
|
+
function alwaysOnCommandResult(requested, status) {
|
|
18
|
+
const word = (on) => (on ? 'on' : 'off');
|
|
19
|
+
const matched = status.desiredEnabled === requested;
|
|
20
|
+
const now = `generation=${status.generation} operational=${status.operationalState}`;
|
|
21
|
+
const command = status.controlCommand;
|
|
22
|
+
if (matched) {
|
|
23
|
+
// Only an explicit `unchanged` is a no-op; an older server sends no receipt,
|
|
24
|
+
// and then the long-standing wording is all that can honestly be said.
|
|
25
|
+
return {
|
|
26
|
+
matched,
|
|
27
|
+
line: command?.outcome === 'unchanged'
|
|
28
|
+
? `Always-On was already ${word(requested)} — nothing to change (${now})`
|
|
29
|
+
: `Always-On ${requested ? 'enabled' : 'disabled'} — ${now}`,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const actual = word(status.desiredEnabled);
|
|
33
|
+
const tail = `(${now}). Run \`skrr agents always-on status\` before relying on it.`;
|
|
34
|
+
if (command?.outcome === 'unchanged') {
|
|
35
|
+
return {
|
|
36
|
+
matched,
|
|
37
|
+
line: `Always-On was already ${word(requested)} at generation ${command.generation}, so this ` +
|
|
38
|
+
`command changed nothing; a newer command has since turned it ${actual} ${tail}`,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (command?.outcome === 'applied') {
|
|
42
|
+
return {
|
|
43
|
+
matched,
|
|
44
|
+
line: `Always-On was turned ${word(requested)} at generation ${command.generation}, but a ` +
|
|
45
|
+
`newer command has since turned it ${actual} ${tail}`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
matched,
|
|
50
|
+
line: `Always-On was not left ${word(requested)}: a concurrent change landed first and it is now ${actual} ${tail}`,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where an Always-On Agent's work has to run, as `skrr agents always-on status`
|
|
3
|
+
* prints it (OSK-22347).
|
|
4
|
+
*
|
|
5
|
+
* The status envelope says what the platform INTENDS to fire (`operationalState`,
|
|
6
|
+
* `nextFire`) and nothing about whether the machine that work runs on is
|
|
7
|
+
* reachable, so a laptop that was closed, or a stopped Dedicated Runtime, read as
|
|
8
|
+
* a healthy `idle` with a next fire hours away. The web already downgrades that
|
|
9
|
+
* to "Runtime offline" from the Agent's `harnessStatus`; this is the same fact for
|
|
10
|
+
* the CLI. A failed read is `unknown`, never absent: a missing line would read as
|
|
11
|
+
* "nothing wrong".
|
|
12
|
+
*/
|
|
13
|
+
export type AlwaysOnRuntimeStatus = 'online' | 'offline' | 'unknown' | 'none';
|
|
14
|
+
export interface AlwaysOnRuntimeRead {
|
|
15
|
+
status: AlwaysOnRuntimeStatus;
|
|
16
|
+
name?: string;
|
|
17
|
+
lastSeenAt?: string;
|
|
18
|
+
/** The Agent read itself failed, so the runtime could not be established. */
|
|
19
|
+
readFailed?: true;
|
|
20
|
+
}
|
|
21
|
+
interface AgentRuntimeFields {
|
|
22
|
+
harnessId?: string | null;
|
|
23
|
+
harnessStatus?: string | null;
|
|
24
|
+
harnessName?: string | null;
|
|
25
|
+
harnessLastSeenAt?: string | Date | null;
|
|
26
|
+
}
|
|
27
|
+
export declare function runtimeFromAgent(agent: AgentRuntimeFields | null | undefined): AlwaysOnRuntimeRead;
|
|
28
|
+
export declare const RUNTIME_READ_FAILED: AlwaysOnRuntimeRead;
|
|
29
|
+
/** Lines to print under `Operational:`; empty when there is no machine involved. */
|
|
30
|
+
export declare function runtimeLines(runtime: AlwaysOnRuntimeRead, desiredEnabled: boolean): string[];
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RUNTIME_READ_FAILED = void 0;
|
|
4
|
+
exports.runtimeFromAgent = runtimeFromAgent;
|
|
5
|
+
exports.runtimeLines = runtimeLines;
|
|
6
|
+
function runtimeFromAgent(agent) {
|
|
7
|
+
// An Agent with no harness runs in the cloud: there is no machine to be off.
|
|
8
|
+
if (!agent || !agent.harnessId)
|
|
9
|
+
return { status: 'none' };
|
|
10
|
+
const status = agent.harnessStatus === 'online' || agent.harnessStatus === 'offline'
|
|
11
|
+
? agent.harnessStatus
|
|
12
|
+
: 'unknown';
|
|
13
|
+
return {
|
|
14
|
+
status,
|
|
15
|
+
...(agent.harnessName ? { name: agent.harnessName } : {}),
|
|
16
|
+
...(agent.harnessLastSeenAt
|
|
17
|
+
? { lastSeenAt: new Date(agent.harnessLastSeenAt).toISOString() }
|
|
18
|
+
: {}),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.RUNTIME_READ_FAILED = { status: 'unknown', readFailed: true };
|
|
22
|
+
/** Lines to print under `Operational:`; empty when there is no machine involved. */
|
|
23
|
+
function runtimeLines(runtime, desiredEnabled) {
|
|
24
|
+
if (runtime.status === 'none')
|
|
25
|
+
return [];
|
|
26
|
+
const label = runtime.name ? ` — ${runtime.name}` : '';
|
|
27
|
+
if (runtime.status === 'offline') {
|
|
28
|
+
const lines = [
|
|
29
|
+
`Runtime: offline${label}${runtime.lastSeenAt ? ` (last seen ${runtime.lastSeenAt})` : ''}`,
|
|
30
|
+
];
|
|
31
|
+
if (desiredEnabled) {
|
|
32
|
+
lines.push('Warning: Always-On cannot run work while this runtime is offline; scheduled fires wait for it.');
|
|
33
|
+
}
|
|
34
|
+
return lines;
|
|
35
|
+
}
|
|
36
|
+
if (runtime.status === 'online')
|
|
37
|
+
return [`Runtime: online${label}`];
|
|
38
|
+
return [`Runtime: unknown${runtime.readFailed ? ' (could not read the Agent)' : label}`];
|
|
39
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Only metadata crosses this boundary: callers must never pass a token, an
|
|
5
5
|
* auth-helper result, or a raw configured URL into an error document.
|
|
6
6
|
*/
|
|
7
|
+
import { type ProfileSelection } from '@skrr-ai/auth-core';
|
|
7
8
|
export type ServerConfigurationSource = 'OVERSKY_BASE_URL' | 'SKRR_BASE_URL' | 'OVERSKY_SERVER_URL' | 'SKRR_SERVER_URL' | 'configuration';
|
|
8
9
|
/** Matches config.ts precedence while exposing only the selected variable name. */
|
|
9
10
|
export declare function serverConfigurationSource(env?: Record<string, string | undefined>): ServerConfigurationSource;
|
|
@@ -25,15 +26,23 @@ export type AuthResolutionDiagnostic = {
|
|
|
25
26
|
origin: string | null;
|
|
26
27
|
source: ServerConfigurationSource;
|
|
27
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* The profile whose credential store was read, and why it was chosen
|
|
31
|
+
* (OSK-22299). "Not signed in" while another profile holds a session is
|
|
32
|
+
* the common case after `skrrd profile use`, and without this it read as a
|
|
33
|
+
* lost login.
|
|
34
|
+
*/
|
|
35
|
+
profile: ProfileSelection | null;
|
|
28
36
|
suggestion: string | null;
|
|
29
37
|
};
|
|
30
|
-
export declare function authResolutionDiagnostic({ credential, bareMode, managedRuntime, baseURL, bin, env, }: {
|
|
38
|
+
export declare function authResolutionDiagnostic({ credential, bareMode, managedRuntime, baseURL, bin, env, profile, }: {
|
|
31
39
|
credential: CredentialResolutionMetadata;
|
|
32
40
|
bareMode: boolean;
|
|
33
41
|
managedRuntime?: boolean;
|
|
34
42
|
baseURL: string | null | undefined;
|
|
35
43
|
bin: string;
|
|
36
44
|
env?: Record<string, string | undefined>;
|
|
45
|
+
profile?: ProfileSelection | null;
|
|
37
46
|
}): AuthResolutionDiagnostic;
|
|
38
47
|
/** Human form of a missing-credential diagnostic. Never echoes a raw URL. */
|
|
39
48
|
export declare function describeMissingCredential(diagnostic: AuthResolutionDiagnostic, bin: string): string;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serverConfigurationSource = serverConfigurationSource;
|
|
4
|
+
exports.safeServerOrigin = safeServerOrigin;
|
|
5
|
+
exports.authResolutionDiagnostic = authResolutionDiagnostic;
|
|
6
|
+
exports.describeMissingCredential = describeMissingCredential;
|
|
2
7
|
/**
|
|
3
8
|
* Stable, secret-safe auth diagnostics.
|
|
4
9
|
*
|
|
5
10
|
* Only metadata crosses this boundary: callers must never pass a token, an
|
|
6
11
|
* auth-helper result, or a raw configured URL into an error document.
|
|
7
12
|
*/
|
|
8
|
-
|
|
9
|
-
exports.serverConfigurationSource = serverConfigurationSource;
|
|
10
|
-
exports.safeServerOrigin = safeServerOrigin;
|
|
11
|
-
exports.authResolutionDiagnostic = authResolutionDiagnostic;
|
|
12
|
-
exports.describeMissingCredential = describeMissingCredential;
|
|
13
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
13
14
|
const SERVER_ENV_PRECEDENCE = [
|
|
14
15
|
'OVERSKY_BASE_URL',
|
|
15
16
|
'SKRR_BASE_URL',
|
|
@@ -32,15 +33,20 @@ function safeServerOrigin(value) {
|
|
|
32
33
|
return null;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
function authResolutionDiagnostic({ credential, bareMode, managedRuntime = false, baseURL, bin, env = process.env, }) {
|
|
36
|
+
function authResolutionDiagnostic({ credential, bareMode, managedRuntime = false, baseURL, bin, env = process.env, profile = null, }) {
|
|
36
37
|
const resolved = Boolean(credential.token);
|
|
38
|
+
// Name the profile in the command only when a bare `login` would land
|
|
39
|
+
// somewhere else: an environment override or a lock pointing elsewhere.
|
|
40
|
+
const loginProfile = profile && !(0, auth_core_1.profileIsImplicit)(profile.profile, env)
|
|
41
|
+
? ` --profile ${profile.profile}`
|
|
42
|
+
: '';
|
|
37
43
|
const suggestion = resolved
|
|
38
44
|
? null
|
|
39
45
|
: bareMode
|
|
40
46
|
? 'Set OVERSKY_TOKEN or SKRR_TOKEN, pass --token, or omit --bare to use a saved session.'
|
|
41
47
|
: managedRuntime
|
|
42
48
|
? 'This managed runtime accepts only its session credential. Start a new managed session or run the command in your own terminal.'
|
|
43
|
-
: `Run \`${bin} login\` to create a local session.`;
|
|
49
|
+
: `Run \`${bin} login${loginProfile}\` to create a local session.`;
|
|
44
50
|
return {
|
|
45
51
|
state: resolved ? 'resolved' : 'missing',
|
|
46
52
|
source: resolved ? credential.source ?? null : null,
|
|
@@ -53,6 +59,7 @@ function authResolutionDiagnostic({ credential, bareMode, managedRuntime = false
|
|
|
53
59
|
: 'checked',
|
|
54
60
|
authHelper: env.OVERSKY_AUTH_HELPER?.trim() ? 'configured' : 'not-configured',
|
|
55
61
|
server: { origin: safeServerOrigin(baseURL), source: serverConfigurationSource(env) },
|
|
62
|
+
profile: profile ? { profile: profile.profile, source: profile.source } : null,
|
|
56
63
|
suggestion,
|
|
57
64
|
};
|
|
58
65
|
}
|
|
@@ -67,5 +74,6 @@ function describeMissingCredential(diagnostic, bin) {
|
|
|
67
74
|
: diagnostic.localCredentialStore === 'unavailable-in-managed-runtime'
|
|
68
75
|
? ' This managed runtime cannot use the local credential store.'
|
|
69
76
|
: '';
|
|
70
|
-
|
|
77
|
+
const profile = diagnostic.profile ? ` in ${(0, auth_core_1.describeProfileSelection)(diagnostic.profile)}` : '';
|
|
78
|
+
return `No usable credential for ${server} (selected by ${source})${profile}.${localStore} ${diagnostic.suggestion ?? `Run \`${bin} login\` to sign in.`}`;
|
|
71
79
|
}
|