@skrr-ai/cli 0.1.160 → 0.1.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/balance/usage/breakdown.d.ts +1 -1
- package/dist/commands/balance/usage/breakdown.js +4 -4
- package/dist/commands/balance/usage/events.d.ts +1 -1
- package/dist/commands/balance/usage/events.js +4 -4
- package/dist/commands/goals/create.js +18 -1
- package/dist/commands/triggers/preflight.js +15 -10
- package/dist/generated/agent-guides.json +29 -29
- package/dist/lib/balance.d.ts +5 -5
- package/dist/lib/balance.js +4 -4
- package/dist/lib/dedicated-machines.d.ts +8 -0
- package/dist/lib/dedicated-machines.js +15 -9
- package/dist/lib/dedicated-power.d.ts +5 -1
- package/dist/lib/dedicated-power.js +28 -10
- package/dist/lib/dedicated-wait.js +2 -2
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6497 -6447
- package/oclif.manifest.json +2 -2
- package/package.json +2 -2
|
@@ -11,4 +11,4 @@ export default class BalanceUsageBreakdown extends BaseCommand {
|
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function renderUsageBreakdown(breakdown: TSkyCodeUsageBreakdown, log: (line: string) => void, agentNames?: ReadonlyMap<string, string>): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.renderUsageBreakdown = renderUsageBreakdown;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
6
6
|
const base_command_1 = require("../../../base-command");
|
|
@@ -28,7 +28,7 @@ class BalanceUsageBreakdown extends base_command_1.BaseCommand {
|
|
|
28
28
|
const workspaceId = flags.workspace;
|
|
29
29
|
let breakdown;
|
|
30
30
|
try {
|
|
31
|
-
breakdown = await (0, balance_1.
|
|
31
|
+
breakdown = await (0, balance_1.getUsageBreakdown)(workspaceId, {
|
|
32
32
|
from: flags.from,
|
|
33
33
|
to: flags.to,
|
|
34
34
|
productFamily: flags['product-family'],
|
|
@@ -49,13 +49,13 @@ class BalanceUsageBreakdown extends base_command_1.BaseCommand {
|
|
|
49
49
|
catch {
|
|
50
50
|
lookupFailed = true;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
renderUsageBreakdown(breakdown, (line) => this.log(line), agentNames);
|
|
53
53
|
if (lookupFailed)
|
|
54
54
|
this.log(' Agent names unavailable; showing recorded IDs.');
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
exports.default = BalanceUsageBreakdown;
|
|
58
|
-
function
|
|
58
|
+
function renderUsageBreakdown(breakdown, log, agentNames = new Map()) {
|
|
59
59
|
log(`${auth_core_1.FIRST_PARTY_HARNESS.displayName} usage breakdown · ${breakdown.ownerType} ${breakdown.ownerId}`);
|
|
60
60
|
log(` Window ${breakdown.from} to ${breakdown.to}`);
|
|
61
61
|
log(` Total ${(0, balance_1.formatCreditsWithUsd)(breakdown.total.usageMicros)} across ${breakdown.total.events} settled authorization${breakdown.total.events === 1 ? '' : 's'}`);
|
|
@@ -13,4 +13,4 @@ export default class BalanceUsageEvents extends BaseCommand {
|
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<void>;
|
|
15
15
|
}
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function renderUsageEvents(events: TSkyCodeUsageEvents | TSkyCodeUsageSettlements, log: (line: string) => void): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.renderUsageEvents = renderUsageEvents;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
6
6
|
const base_command_1 = require("../../../base-command");
|
|
@@ -27,7 +27,7 @@ class BalanceUsageEvents extends base_command_1.BaseCommand {
|
|
|
27
27
|
const workspaceId = flags.workspace;
|
|
28
28
|
let events;
|
|
29
29
|
try {
|
|
30
|
-
events = await (0, balance_1.
|
|
30
|
+
events = await (0, balance_1.getUsageEvents)(workspaceId, {
|
|
31
31
|
from: flags.from,
|
|
32
32
|
to: flags.to,
|
|
33
33
|
cursor: flags.cursor,
|
|
@@ -44,11 +44,11 @@ class BalanceUsageEvents extends base_command_1.BaseCommand {
|
|
|
44
44
|
: events, null, 2));
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
renderUsageEvents(events, (line) => this.log(line));
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.default = BalanceUsageEvents;
|
|
51
|
-
function
|
|
51
|
+
function renderUsageEvents(events, log) {
|
|
52
52
|
log(`${auth_core_1.FIRST_PARTY_HARNESS.displayName} usage events · ${events.ownerType} ${events.ownerId}`);
|
|
53
53
|
log(` Window ${events.from} to ${events.to}`);
|
|
54
54
|
if (events.version === 1) {
|
|
@@ -142,7 +142,24 @@ class GoalsCreate extends base_command_1.BaseCommand {
|
|
|
142
142
|
// server deliberately routes goal links through this $addToSet endpoint so
|
|
143
143
|
// concurrent edits can't clobber each other (same contract as `spaces
|
|
144
144
|
// labels add`). Re-linking an already-linked goal is a no-op.
|
|
145
|
-
|
|
145
|
+
try {
|
|
146
|
+
await data_provider_1.dataService.linkGoalToSpace({ spaceId: flags.space, goalId });
|
|
147
|
+
}
|
|
148
|
+
catch (linkError) {
|
|
149
|
+
// The create already returned an identity. Never tell the caller
|
|
150
|
+
// that nothing happened or invite a blind retry of the create.
|
|
151
|
+
const failure = linkError;
|
|
152
|
+
const statusText = typeof failure?.status === 'number' ? ` (HTTP ${failure.status})` : '';
|
|
153
|
+
this.failWithCliError({
|
|
154
|
+
code: 'GOAL_CREATED_SPACE_LINK_UNCONFIRMED',
|
|
155
|
+
message: `Goal ${goalId} was created or recovered, but its Space link could not be confirmed${statusText}. Run \`${this.config.bin} goals show ${goalId}\` before retrying.`,
|
|
156
|
+
exit: 1,
|
|
157
|
+
retryable: false,
|
|
158
|
+
...(typeof failure?.status === 'number' ? { status: failure.status } : {}),
|
|
159
|
+
...(typeof failure?.requestId === 'string' ? { requestId: failure.requestId } : {}),
|
|
160
|
+
details: { goalId, spaceId: flags.space },
|
|
161
|
+
});
|
|
162
|
+
}
|
|
146
163
|
}
|
|
147
164
|
}
|
|
148
165
|
catch (err) {
|
|
@@ -35,7 +35,7 @@ class TriggersPreflight extends base_command_1.BaseCommand {
|
|
|
35
35
|
id: core_1.Args.string({ description: 'Trigger ID', required: true, ignoreStdin: true }),
|
|
36
36
|
};
|
|
37
37
|
static flags = {
|
|
38
|
-
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
38
|
+
json: core_1.Flags.boolean({ description: 'Output the server response as JSON; use exit status for the effective verdict (2 means uncertain)' }),
|
|
39
39
|
'sample-event': core_1.Flags.string({
|
|
40
40
|
description: 'Path to a JSON event payload (or "-" for stdin) to exercise event filters and payload variables',
|
|
41
41
|
}),
|
|
@@ -67,7 +67,8 @@ class TriggersPreflight extends base_command_1.BaseCommand {
|
|
|
67
67
|
}
|
|
68
68
|
// Preserve machine-readable output while still communicating the verdict
|
|
69
69
|
// through the process contract.
|
|
70
|
-
const
|
|
70
|
+
const legacyResponse = report.decisionVersion !== 2;
|
|
71
|
+
const exitCode = preflightExitCode(legacyResponse ? null : report.wouldFire);
|
|
71
72
|
if (exitCode !== 0)
|
|
72
73
|
process.exitCode = exitCode;
|
|
73
74
|
if (flags.json) {
|
|
@@ -76,13 +77,17 @@ class TriggersPreflight extends base_command_1.BaseCommand {
|
|
|
76
77
|
}
|
|
77
78
|
// Three outcomes, not two — `suggest` (would run, but as an inbox card) is
|
|
78
79
|
// the most common real answer and must not read as either pass or fail.
|
|
79
|
-
const verdict =
|
|
80
|
-
? '
|
|
81
|
-
: report.wouldFire ===
|
|
82
|
-
? '
|
|
83
|
-
: report.
|
|
84
|
-
? '
|
|
85
|
-
:
|
|
80
|
+
const verdict = legacyResponse
|
|
81
|
+
? 'OUTCOME UNCERTAIN — this server did not report an ordered Trigger claim protocol check'
|
|
82
|
+
: report.wouldFire === true
|
|
83
|
+
? 'CHECKS PASSED — could run if the executing server has the same configuration'
|
|
84
|
+
: report.wouldFire === null
|
|
85
|
+
? 'INDETERMINATE — needs a live event or live state'
|
|
86
|
+
: (report.blockedBy
|
|
87
|
+
? report.gates.find((g) => g.name === report.blockedBy)
|
|
88
|
+
: report.gates.find((g) => g.verdict === 'block' || g.verdict === 'suggest'))?.verdict === 'suggest'
|
|
89
|
+
? 'MAY SUGGEST — an inbox card instead of an autonomous run'
|
|
90
|
+
: 'BLOCKED ON CHECKED SERVER — this check would stop before running';
|
|
86
91
|
// Name the RELATIONSHIP, and use the reason the gate already carries.
|
|
87
92
|
// `blockedBy` is a gate NAME, and rendering it bare produced
|
|
88
93
|
// `WOULD NOT RUN (enabled)` for a disabled trigger — which reads as
|
|
@@ -92,7 +97,7 @@ class TriggersPreflight extends base_command_1.BaseCommand {
|
|
|
92
97
|
const blocker = report.blockedBy
|
|
93
98
|
? report.gates.find((g) => g.name === report.blockedBy && g.verdict === 'block')
|
|
94
99
|
: undefined;
|
|
95
|
-
const because = report.blockedBy
|
|
100
|
+
const because = report.blockedBy && !legacyResponse
|
|
96
101
|
? ` — blocked by ${report.blockedBy}${blocker?.reason ? `: ${blocker.reason}` : ''}`
|
|
97
102
|
: '';
|
|
98
103
|
this.log(`${verdict}${because}`);
|
|
@@ -308,10 +308,10 @@
|
|
|
308
308
|
"id": "agents",
|
|
309
309
|
"title": "Agents",
|
|
310
310
|
"readWhen": "you create or configure an Agent (instructions, tone, model, tools, where it runs, Memory) or need to know which Agent you are",
|
|
311
|
-
"version":
|
|
311
|
+
"version": 5,
|
|
312
312
|
"routed": true,
|
|
313
313
|
"aliases": [],
|
|
314
|
-
"tokens":
|
|
314
|
+
"tokens": 1081,
|
|
315
315
|
"sections": [
|
|
316
316
|
{
|
|
317
317
|
"id": "model",
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
"id": "duties",
|
|
384
384
|
"title": "Duties and acting later",
|
|
385
385
|
"readWhen": "you make something happen later, repeatedly or continuously, or give an Agent a standing responsibility",
|
|
386
|
-
"version":
|
|
386
|
+
"version": 5,
|
|
387
387
|
"routed": true,
|
|
388
388
|
"aliases": [],
|
|
389
389
|
"tokens": 1153,
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
]
|
|
726
726
|
}
|
|
727
727
|
],
|
|
728
|
-
"hash": "
|
|
728
|
+
"hash": "4219e5f436224078c86c63ed2b25fc4a0dab4076e4d7f9f27a61862cab49172f",
|
|
729
729
|
"tokens": 557
|
|
730
730
|
},
|
|
731
731
|
"routedIndex": {
|
|
@@ -1037,10 +1037,10 @@
|
|
|
1037
1037
|
"id": "agents",
|
|
1038
1038
|
"title": "Agents",
|
|
1039
1039
|
"readWhen": "you create or configure an Agent (instructions, tone, model, tools, where it runs, Memory) or need to know which Agent you are",
|
|
1040
|
-
"version":
|
|
1040
|
+
"version": 5,
|
|
1041
1041
|
"routed": true,
|
|
1042
1042
|
"aliases": [],
|
|
1043
|
-
"tokens":
|
|
1043
|
+
"tokens": 1081,
|
|
1044
1044
|
"sections": [
|
|
1045
1045
|
{
|
|
1046
1046
|
"id": "model",
|
|
@@ -1112,7 +1112,7 @@
|
|
|
1112
1112
|
"id": "duties",
|
|
1113
1113
|
"title": "Duties and acting later",
|
|
1114
1114
|
"readWhen": "you make something happen later, repeatedly or continuously, or give an Agent a standing responsibility",
|
|
1115
|
-
"version":
|
|
1115
|
+
"version": 5,
|
|
1116
1116
|
"routed": true,
|
|
1117
1117
|
"aliases": [],
|
|
1118
1118
|
"tokens": 1153,
|
|
@@ -1385,7 +1385,7 @@
|
|
|
1385
1385
|
]
|
|
1386
1386
|
}
|
|
1387
1387
|
],
|
|
1388
|
-
"hash": "
|
|
1388
|
+
"hash": "2438d3d9c9da94a544e271fee95ca158c3b121f0f044e599b281d184c3163d20",
|
|
1389
1389
|
"tokens": 506
|
|
1390
1390
|
},
|
|
1391
1391
|
"cards": {
|
|
@@ -1704,12 +1704,12 @@
|
|
|
1704
1704
|
"id": "agents",
|
|
1705
1705
|
"title": "Agents",
|
|
1706
1706
|
"readWhen": "you create or configure an Agent (instructions, tone, model, tools, where it runs, Memory) or need to know which Agent you are",
|
|
1707
|
-
"version":
|
|
1707
|
+
"version": 5,
|
|
1708
1708
|
"routed": true,
|
|
1709
1709
|
"aliases": [],
|
|
1710
|
-
"body": "## Concept model\n\n| Noun | Question it answers |\n| --- | --- |\n| **Agent** | Who acts, and with which identity, instructions, model, tools and tone? |\n| **Harness** | Which provider runs its turns, on which machine? One machine × one provider: Claude Code and Codex on one laptop are two Harnesses. |\n| **Machine** | Which computer: a personal machine running the daemon, a Dedicated Runtime, or a Hosted Machine? |\n| **Release** | Which exact, installable snapshot of the Agent's portable specification? |\n| **Role** | Which portable responsibility (purpose, scope, parameters) can be installed on an Agent? |\n| **Memory Store** | What does the Agent know, kept for the Agent or for a Space? |\n| **Notepad** | What does one person privately want this Agent to keep in mind? |\n\n## Decide\n\n- **Who am I?** The managed identity block in your instruction file names the Agent this machine\n speaks as. `--agent <agent-id>` chooses which Agent a message speaks as. Neither sets authorship:\n the server records the author of every write from the authenticated runtime, and `skrr context`\n reports only whether this runtime carries an Agent binding.\n- How it writes (shorter, plainer, warmer) is **tone**. What it does or must never do is an\n **instruction block**. Neither belongs in a Memory Store or the Notepad.\n- A preference the person tells you to remember is a Memory proposal they review, not an edit to\n your own instructions. Work to do later, or to keep checking, belongs to a duty.\n- Where it runs is its execution targets. A Machine is not a Harness: pin the Harness.\n- What its Mini Computer shows (the view Tasks opens on, how the home screen is arranged) is in the\n `computer` section: the first is the Agent's, the second is the person's own.\n\n## Workflow\n\n### Change an Agent's configuration\n\n1. Read the current value of exactly what you will change, on the Agent the owner named.\n2. Make the narrowest change asked for: add or edit one instruction block rather than replacing\n all of them.\n3. Read the resolved state back and report that. A workspace policy can override a tone you set.\n\nThe commands for each step are in the `configure` section; `--help` gives their flags.\n\n## Authority\n\n| Actor | May do | Only a person may do |\n| --- | --- | --- |\n| Agent | Read any Agent it can view; when the owner asks, change an Agent's instructions, tone, model or tools, create an Agent, or delete one the owner's own message names; propose a Memory change | Widen an Agent's permissions: permission mode, network egress, tool sign-in; publish, list, price or share an Agent; connect a channel; choose paid compute; approve a Memory promotion; set Memory governance |\n| Person | Everything in both columns | — |\n\nAn Agent never widens its own permissions or membership, even where a command would accept it.\n\n## Live state\n\n- `skrr agents show <agent-id> --expanded` — the full configuration, execution targets included.\n- `skrr agents instructions show <agent-id>` — the instruction blocks in order, with instance ids.\n- `skrr agents tone show <agent-id>` — the tone it actually writes in, and where that came from.\n- `skrr harnesses list` and `skrr machines list` — Harness ids and the Machines they run on.\n- `skrr memory mounts resolve --agent <agent-id>` — the Memory Stores it can read or write.\n\n## Related guides\n\n- `duties` — what an Agent is responsible for over time, and making something happen later.\n- `learning` — teaching an Agent a preference or procedure that lasts.\n- `spaces` — admitting an Agent to a Space.\n- `store` — publishing an Agent release.",
|
|
1711
|
-
"hash": "
|
|
1712
|
-
"tokens":
|
|
1710
|
+
"body": "## Concept model\n\n| Noun | Question it answers |\n| --- | --- |\n| **Agent** | Who acts, and with which identity, instructions, model, tools and tone? |\n| **Harness** | Which provider runs its turns, on which machine? One machine × one provider: Claude Code and Codex on one laptop are two Harnesses. |\n| **Machine** | Which computer: a personal machine running the daemon, a Dedicated Runtime, or a Hosted Machine? |\n| **Release** | Which exact, installable snapshot of the Agent's portable specification? |\n| **Role** | Which portable responsibility (purpose, scope, parameters) can be installed on an Agent? |\n| **Memory Store** | What does the Agent know, kept for the Agent or for a Space? |\n| **Notepad** | What does one person privately want this Agent to keep in mind? |\n\n## Decide\n\n- **Who am I?** The managed identity block in your instruction file names the Agent this machine\n speaks as. `--agent <agent-id>` chooses which Agent a message speaks as. Neither sets authorship:\n the server records the author of every write from the authenticated runtime, and `skrr context`\n reports only whether this runtime carries an Agent binding.\n- How it writes (shorter, plainer, warmer) is **tone**. What it does or must never do is an\n **instruction block**. Neither belongs in a Memory Store or the Notepad.\n- A preference the person tells you to remember is a Memory proposal they review, not an edit to\n your own instructions. Work to do later, or to keep checking, belongs to a duty.\n- Where it runs is its execution targets. A Machine is not a Harness: pin the Harness.\n- Whether it wakes on its own is its **Always-On**: a switch on the Agent, not part of its\n configuration. Read the operational state it reports, not the setting that was requested.\n- What its Mini Computer shows (the view Tasks opens on, how the home screen is arranged) is in the\n `computer` section: the first is the Agent's, the second is the person's own.\n\n## Workflow\n\n### Change an Agent's configuration\n\n1. Read the current value of exactly what you will change, on the Agent the owner named.\n2. Make the narrowest change asked for: add or edit one instruction block rather than replacing\n all of them.\n3. Read the resolved state back and report that. A workspace policy can override a tone you set.\n\nThe commands for each step are in the `configure` section; `--help` gives their flags.\n\n## Authority\n\n| Actor | May do | Only a person may do |\n| --- | --- | --- |\n| Agent | Read any Agent it can view; when the owner asks, change an Agent's instructions, tone, model or tools, create an Agent, or delete one the owner's own message names; propose a Memory change | Widen an Agent's permissions: permission mode, network egress, tool sign-in; publish, list, price or share an Agent; connect a channel; choose paid compute; approve a Memory promotion; set Memory governance |\n| Person | Everything in both columns | — |\n\nAn Agent never widens its own permissions or membership, even where a command would accept it.\n\n## Live state\n\n- `skrr agents show <agent-id> --expanded` — the full configuration, execution targets included.\n- `skrr agents instructions show <agent-id>` — the instruction blocks in order, with instance ids.\n- `skrr agents tone show <agent-id>` — the tone it actually writes in, and where that came from.\n- `skrr harnesses list` and `skrr machines list` — Harness ids and the Machines they run on.\n- `skrr memory mounts resolve --agent <agent-id>` — the Memory Stores it can read or write.\n- `skrr agents always-on status <agent-id>` — whether it wakes on its own.\n\n## Related guides\n\n- `duties` — what an Agent is responsible for over time, and making something happen later.\n- `learning` — teaching an Agent a preference or procedure that lasts.\n- `spaces` — admitting an Agent to a Space.\n- `store` — publishing an Agent release.",
|
|
1711
|
+
"hash": "e3c65d31ae310030cee422e2287d7f3d615653ae3363dc34d891f3facaf60895",
|
|
1712
|
+
"tokens": 1081,
|
|
1713
1713
|
"sections": [
|
|
1714
1714
|
{
|
|
1715
1715
|
"id": "model",
|
|
@@ -1783,7 +1783,7 @@
|
|
|
1783
1783
|
"id": "duties",
|
|
1784
1784
|
"title": "Duties and acting later",
|
|
1785
1785
|
"readWhen": "you make something happen later, repeatedly or continuously, or give an Agent a standing responsibility",
|
|
1786
|
-
"version":
|
|
1786
|
+
"version": 5,
|
|
1787
1787
|
"routed": true,
|
|
1788
1788
|
"aliases": [],
|
|
1789
1789
|
"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 Duties should exist, at what priority and on what budget? |\n| **Duty** | Which outcome does this Agent keep true, and how does it keep checking? |\n| **Check** | What did one wake of a Duty see, decide and do? |\n\nA Duty is not a unit of work. A **Task** is one unit of work and a **Goal** is a dated\noutcome with key results; a Duty 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| **Duty** | 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 Duty. Standing observation is a\nDuty with a freshness contract, not a recurring trigger or a task board left running.\n\n## Workflow\n\n### Start a Duty\n\n1. Read the Agent's Duties 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 Duties 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 Duty 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 Duty. 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 duties list --agent <agent-id>` — an Agent's Duties, with status and assessment.\n- `skrr duties show <duty-id>` — the contract, its next check and the last one.\n- `skrr duties 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 Duty creates or watches.\n- `spaces` — Goals, and Workflows: durable graphs of Tasks.\n- `agents` — the Agent a Duty belongs to, and where its runs execute.\n- `communication` — whether, what and how to tell the owner.",
|
|
@@ -5441,7 +5441,7 @@
|
|
|
5441
5441
|
"section": "model",
|
|
5442
5442
|
"title": "What an Agent is made of",
|
|
5443
5443
|
"readWhen": "you need to know which part of an Agent a request touches, or what travels when an Agent is shared",
|
|
5444
|
-
"version":
|
|
5444
|
+
"version": 5,
|
|
5445
5445
|
"aliases": [],
|
|
5446
5446
|
"explains": [],
|
|
5447
5447
|
"body": "Read this when you need to know which part of an Agent a request touches, or what travels when an Agent is shared.\n\nAn Agent is one record with several parts, and each part has its own owner and its own way to\nchange. Most mistakes come from changing the right thing in the wrong part.\n\n| Part | What it holds | What it is not |\n| --- | --- | --- |\n| Identity | Name, description, avatar, and persona files such as SOUL, IDENTITY and USER | Not the tone, and not a rule |\n| Instructions | An ordered list of blocks; each is inline (owned by this Agent) or a version-pinned library block; the server compiles them into one prompt | Not a scratchpad: every enabled block is read on every turn |\n| Model, tools and skills | Which model answers, and what it can call | Not where it runs |\n| Tone | How it writes: one tone from the library, plus per-Agent notes | Delivery only; a tone never changes what the Agent may do or must say |\n| Execution targets | Where its turns run, in order: a Harness, a Hosted Machine, or the cloud worker | Not a Machine: a Machine carries one Harness per provider |\n| Memory | What it knows, in Memory Stores; plus each person's private Notepad | Not instructions, and not tone |\n\nA change to the Agent record is kept as a version, and an earlier version can be restored.\n\n## What travels when an Agent is shared\n\n- An **agent spec** is the portable part of the record: what another person receives when they\n install the Agent. Where it runs, who owns it, its tone, budget, price and anything it has\n learned never travel in it, and a credential-bearing reference is withheld.\n- A **Release** is an immutable, installable snapshot of that portable part. A Task pinned to a\n Release runs on that Release, not on later edits of the Agent.\n- A **Role** is a portable responsibility (purpose, scope, parameters), not a configuration.\n Installing one creates an archived Compass and inactive responsibilities; it activates nothing,\n and credentials, permissions and activation stay the owner's choices.\n\nEveryone with edit access to an Agent can read its Agent Memory Store, so sharing edit access\nshares what the Agent knows.\n\n## Example\n\nRead the whole picture before deciding which part to change.\n\n```bash\nskrr agents overview <agent-id> --expanded --json\nskrr agents versions <agent-id>\n```",
|
|
@@ -5521,7 +5521,7 @@
|
|
|
5521
5521
|
"section": "configure",
|
|
5522
5522
|
"title": "Configure an Agent",
|
|
5523
5523
|
"readWhen": "the owner asks you to change an Agent's instructions, tone, model, tools or channels",
|
|
5524
|
-
"version":
|
|
5524
|
+
"version": 5,
|
|
5525
5525
|
"aliases": [],
|
|
5526
5526
|
"explains": [
|
|
5527
5527
|
"TONE_NOT_FOUND",
|
|
@@ -5605,7 +5605,7 @@
|
|
|
5605
5605
|
"section": "identity",
|
|
5606
5606
|
"title": "Which Agent you are, and who is recorded",
|
|
5607
5607
|
"readWhen": "you need to know which Agent you are, which Agent a message speaks as, or who a write is recorded as",
|
|
5608
|
-
"version":
|
|
5608
|
+
"version": 5,
|
|
5609
5609
|
"aliases": [],
|
|
5610
5610
|
"explains": [
|
|
5611
5611
|
"AGENT_CONTEXT_CONFLICT",
|
|
@@ -5690,7 +5690,7 @@
|
|
|
5690
5690
|
"section": "memory",
|
|
5691
5691
|
"title": "Where an Agent's knowledge lives",
|
|
5692
5692
|
"readWhen": "you need to read or change what an Agent knows, or tell its Memory from its configuration",
|
|
5693
|
-
"version":
|
|
5693
|
+
"version": 5,
|
|
5694
5694
|
"aliases": [],
|
|
5695
5695
|
"explains": [
|
|
5696
5696
|
"MEMORY_NOT_MOUNTED",
|
|
@@ -5774,7 +5774,7 @@
|
|
|
5774
5774
|
"section": "computer",
|
|
5775
5775
|
"title": "An Agent's Mini Computer",
|
|
5776
5776
|
"readWhen": "the owner wants an Agent's Mini Computer arranged, or a built-in app such as Tasks to open on a particular view",
|
|
5777
|
-
"version":
|
|
5777
|
+
"version": 5,
|
|
5778
5778
|
"aliases": [],
|
|
5779
5779
|
"explains": [],
|
|
5780
5780
|
"body": "Read this when the owner wants an Agent's Mini Computer arranged, or one of its built-in apps to open on a particular view.\n\nAn Agent's Mini Computer is the home screen its owner opens. Two things on it are yours to change, and they are not alike:\n\n| What | Whose it is | What you do |\n| --- | --- | --- |\n| What a built-in app opens on (today: the view Tasks opens on) | The Agent's: everyone who opens its computer sees it | Set it. The person can switch to their own view on their device, and can reset it |\n| How the home screen is arranged (dock, order, folders, hidden apps) | The person's own | Ask for the change. The person chose whether it applies at once or waits for them |\n\nRules that hold on every surface:\n\n- Read before you change: the result shows the current view and arrangement, and whether your layout changes\n are applied or only proposed.\n- A layout change is all or none, and nothing it does deletes anything: removing an app only hides it, and\n it can be restored. Settings cannot be hidden, the dock holds four apps, and an installed Agent App is\n not removed from the layout (uninstall it instead).\n- By default a layout change is only a suggestion: the person sees it on their Mini Computer and applies or\n dismisses it. Only they can let Agents apply changes without asking, apply or undo a change, or write the\n whole layout. Do not look for a way around that; tell the person what you changed or suggested, in plain words.\n- The Tasks view uses the same vocabulary as a saved task view: a layout (list, board, tree or canvas), a\n grouping, a sort, filters and a date window. A key the server does not know is refused, and the refusal says where.\n- Changing what an app opens on needs edit access to the Agent. Changing the home screen only needs to be able to see it,\n because it is the person's own.\n\nRead both with `skrr agents mini-computer show <agent-id>`. Set the Tasks view in one command with\n`skrr agents mini-computer tasks-view` (`--reset` puts it back). Any other app takes\n`skrr agents mini-computer app set <agent-id> <app> --config '{...}'`, and `app reset` puts it back.\nArrange the home screen with `skrr agents mini-computer layout pin|unpin|move|folder|unfolder|remove|restore`,\nor several at once with `layout change --ops '[...]'`.\n\n## Example\n\nA board of the Agent's work grouped by assignee, for the next seven days, then one app pinned to the dock.\n\n```bash\nskrr agents mini-computer tasks-view <agent-id> --type board --group-by assignee --date-preset next_7_days\nskrr agents mini-computer layout pin <agent-id> calendar\nskrr agents mini-computer show <agent-id>\n```",
|
|
@@ -5854,7 +5854,7 @@
|
|
|
5854
5854
|
"section": "machines",
|
|
5855
5855
|
"title": "Where an Agent runs",
|
|
5856
5856
|
"readWhen": "you choose or change where an Agent runs: a Harness, a Dedicated Runtime, a Hosted Machine or the cloud worker",
|
|
5857
|
-
"version":
|
|
5857
|
+
"version": 5,
|
|
5858
5858
|
"aliases": [],
|
|
5859
5859
|
"explains": [
|
|
5860
5860
|
"INVALID_EXECUTION_TARGET",
|
|
@@ -5937,7 +5937,7 @@
|
|
|
5937
5937
|
"section": "model",
|
|
5938
5938
|
"title": "Compass, Northstar, Duty and the check loop",
|
|
5939
5939
|
"readWhen": "you must tell a Duty from a Goal, Task, Compass or Northstar, or read what its loop reports",
|
|
5940
|
-
"version":
|
|
5940
|
+
"version": 5,
|
|
5941
5941
|
"aliases": [],
|
|
5942
5942
|
"explains": [],
|
|
5943
5943
|
"body": "Read this when you must tell a Duty from a Goal, Task, Compass or Northstar, or read what its loop reports.\n\n## Three layers\n\n| Layer | Answers | Changes |\n| --- | --- | --- |\n| **Compass** | What good looks like for this Agent: the states it keeps true, and its autonomy and communication defaults | Rarely, deliberately |\n| **Northstar** | Which Duties should exist, their priority and their budget | On a review cadence |\n| **Duty** | One outcome held true by its own check loop | Continuously |\n\nA **Goal** is a dated outcome with key results, and a **Task** is one unit of work. A Duty\nmay watch a Goal and its Tasks as sources and may create Tasks; it is neither of them.\n\n## The loop\n\n- A **Check** wakes on the cadence or on a watched event. It reads the watched sources, compares\n them with the last snapshot, finds open loops (blocked, stale, waiting on someone, overdue),\n chooses a posture and routes actions. Most checks end quiet, by design.\n- **Reflection** is slower: it measures whether the checks earn their keep and retunes the cadence.\n- Its assessment answers three things separately: the outcome, how fresh the evidence is, and\n how the work is going. A finished run, a patch or a merged PR does not by itself prove the\n outcome, and evidence goes stale.\n\n## Vocabulary\n\n- Kind, fixed when the Duty is created:\n - `achieve`: a bounded outcome, which may carry a deadline and completes when it is met.\n - `maintain`: a state held true for as long as the Duty runs; it never completes.\n- Status: `draft`, `active`, `paused`, `completed`, `cancelled`, `archived`.\n- A Check's posture: `stay_quiet`, `record_only`, `act_silently`, `ask_approval`, `nudge_user`, `escalate`.\n\nA `draft` does nothing until it is turned on; `paused` stops new work, and a turn already running\nmay finish.",
|
|
@@ -6053,7 +6053,7 @@
|
|
|
6053
6053
|
"section": "later",
|
|
6054
6054
|
"title": "Choose how to act later",
|
|
6055
6055
|
"readWhen": "you must choose how to make something happen later, repeatedly or continuously",
|
|
6056
|
-
"version":
|
|
6056
|
+
"version": 5,
|
|
6057
6057
|
"aliases": [],
|
|
6058
6058
|
"explains": [],
|
|
6059
6059
|
"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 Duty. 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| Duty | `skrr duties create`, which makes a draft |\n| Workflow | `skrr spaces workflows create` |\n\nA reminder reaches the person one of two ways. Without `--active` the platform sends your words\nthrough the owner's notifications at that time, whatever any agent's mode. With `--active` the\nagent words it, so it follows that agent's initiative mode, and a CLI login does not prove the\nowner is present, so it gets no exemption: under the default `suggestions_only` it is skipped,\nwaits in the inbox as a suggestion, and the owner is told. Use `--active` only when the agent's\nvoice matters, and read the mode with `skrr agents triggers policy <agent-id>`. The command prints\na heads-up when the mode will refuse the reminder you just made.\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`.",
|
|
@@ -6169,7 +6169,7 @@
|
|
|
6169
6169
|
"section": "followups",
|
|
6170
6170
|
"title": "Follow-ups",
|
|
6171
6171
|
"readWhen": "you want to come back to something later: a reminder, a watch, a check-in or an action",
|
|
6172
|
-
"version":
|
|
6172
|
+
"version": 5,
|
|
6173
6173
|
"aliases": [
|
|
6174
6174
|
"tasks/followups"
|
|
6175
6175
|
],
|
|
@@ -6287,7 +6287,7 @@
|
|
|
6287
6287
|
"section": "authoring",
|
|
6288
6288
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6289
6289
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6290
|
-
"version":
|
|
6290
|
+
"version": 5,
|
|
6291
6291
|
"aliases": [],
|
|
6292
6292
|
"explains": [
|
|
6293
6293
|
"DUTY_MODE_RETIRED",
|
|
@@ -6409,7 +6409,7 @@
|
|
|
6409
6409
|
"section": "sensing",
|
|
6410
6410
|
"title": "Readings a run reports",
|
|
6411
6411
|
"readWhen": "you read what a Duty's runs reported seeing, or report a reading from a run",
|
|
6412
|
-
"version":
|
|
6412
|
+
"version": 5,
|
|
6413
6413
|
"aliases": [],
|
|
6414
6414
|
"explains": [],
|
|
6415
6415
|
"body": "Read this when you read what a Duty's runs reported seeing, or report a reading from a run.\n\nA run is a sensor: it can read what the platform cannot, such as a dashboard or a vendor's console.\nThe run reports what it saw, and the server decides whether that is a change.\n\n- Every reading is stored as \"AGENT-REPORTED, not platform-verified\", and that caveat travels inside its text.\n- Its confidence is capped at 0.5, or 0.7 when it carries an artifact with a\n real content digest (`sha256:…`). It is never 1.\n\n## Report a reading\n\n- Report the reading, not a judgement about it: one entry per declared key you read. A key you\n invent is recorded and drives nothing.\n- If you could not read a key, say so with `accessStatus` `unavailable` or `unauthorized` and no\n value. \"I could not see\" is not \"it is fine\", so never carry the previous reading forward.\n- Where a key requires an artifact, attach what you actually kept (a screenshot, a file, a log)\n with a real digest; without it the reading is kept as evidence and cannot move the Duty.\n\n## Read them\n\nThe `changed` beside a reading is the server's verdict, from the key's `changeRule`. Treat every\nreading as a claim by the actor whose work is being judged, your own included.\n\n```bash\nskrr duties observations <duty-id> --declared-only\nskrr duties observations <duty-id> --latest\n```\n\nWithout `--declared-only` the list includes undeclared keys: what a run noticed that nobody asked\nabout is how to decide what to declare next.",
|
|
@@ -6525,7 +6525,7 @@
|
|
|
6525
6525
|
"section": "cycles-explain",
|
|
6526
6526
|
"title": "Why it stopped: cycles and explain",
|
|
6527
6527
|
"readWhen": "a Duty did not do what you expected and you need to know where it stopped",
|
|
6528
|
-
"version":
|
|
6528
|
+
"version": 5,
|
|
6529
6529
|
"aliases": [],
|
|
6530
6530
|
"explains": [],
|
|
6531
6531
|
"body": "Read this when a Duty did not do what you expected and you need to know where it stopped.\n\nEvery wake is a cycle. A cycle that stopped names the first question it answered \"no\" to, with the\nreason in the platform's own words and, where someone can act, the fix. The questions, in the order\nthey are asked, and what a stop at each means:\n\n- `wake`: \"The wake did not run a check.\"\n- `fresh`: \"There was nothing new to act on.\"\n- `turn`: \"It was not this wake’s turn.\"\n- `think`: \"The check did not start an agent turn.\"\n- `act`: \"The agent turn or its action did not go ahead.\"\n- `reach`: \"The check had something to raise and it did not reach you.\"\n- `error`: \"The check or its run failed.\"\n\nA stop at `fresh`, or at `think` with the gate `no_agent_turn_planned`, is the loop choosing\nsilence, and there is nothing to fix. Every other stop is a gate between an intention and its\neffect. Act on the fix the cycle gives; do not invent another, and do not report a gate as quiet.\n\n```bash\nskrr duties explain <duty-id>\nskrr duties cycles <duty-id>\nskrr duties trigger-status <duty-id>\n```\n\n`explain` walks the latest cycle as six yes or no questions; `cycles` lists them, newest first;\n`trigger-status` shows what the scheduler actually holds, which is usually why one \"isn't\nchecking\". A failed run names who has to move: the machine (sign it in, bring it online) or the\nmodel. Once a machine is fixed, `skrr duties check-now <duty-id>` starts a new run; a\nscheduled check would still see nothing new.",
|
|
@@ -6641,7 +6641,7 @@
|
|
|
6641
6641
|
"section": "hypotheses",
|
|
6642
6642
|
"title": "Hypotheses: claims about why",
|
|
6643
6643
|
"readWhen": "a run concludes why a reading moved, or you investigate a drift that may already be ruled out",
|
|
6644
|
-
"version":
|
|
6644
|
+
"version": 5,
|
|
6645
6645
|
"aliases": [],
|
|
6646
6646
|
"explains": [
|
|
6647
6647
|
"missing_falsifier",
|
|
@@ -6763,7 +6763,7 @@
|
|
|
6763
6763
|
"section": "speaking",
|
|
6764
6764
|
"title": "A Duty finds; its Agent speaks",
|
|
6765
6765
|
"readWhen": "a Duty run found something and you must decide whether the owner hears of it",
|
|
6766
|
-
"version":
|
|
6766
|
+
"version": 5,
|
|
6767
6767
|
"aliases": [],
|
|
6768
6768
|
"explains": [],
|
|
6769
6769
|
"body": "Read this when a Duty run found something and you must decide whether the owner hears of it.\n\nA Check never writes to the owner, and it does not hand you a prepared message or brief: whether\nthe owner hears of what a run found is your call, from what you saw and what you already said.\n\n- Decide with everything in view: what you already said, whether the owner replied, what another\n surface already raised. One message, a different message or nothing are all valid outcomes, and\n silence is often the right one.\n- To speak from the run, return a `status_update` or `report` action intent with its `text` for the\n Duty's report destinations. A `message` action intent is recorded but never delivered. Write\n the words yourself.\n- Where the run allows it, send the message with `skrr agent message send` instead: it is delivered\n under the owner's limits and counted for this Duty.\n- The owner's limits (mute, quiet hours, a daily nudge cap) apply when you deliver, whichever way\n you send it: whatever is delivered counts against them, and a delivery they do not allow is\n suppressed: the cycle shows it as a stop at \"reach\" where the platform recorded it.\n`skrr agent message send` answers with the delivery status.\n\n`skrr duties reports <duty-id>` lists where its reports go and on what condition; the\ndefault sends only on a material change.",
|
|
@@ -6879,7 +6879,7 @@
|
|
|
6879
6879
|
"section": "always-on",
|
|
6880
6880
|
"title": "Turn it on: activation and Always-On",
|
|
6881
6881
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6882
|
-
"version":
|
|
6882
|
+
"version": 5,
|
|
6883
6883
|
"aliases": [],
|
|
6884
6884
|
"explains": [
|
|
6885
6885
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6999,7 +6999,7 @@
|
|
|
6999
6999
|
"section": "governance",
|
|
7000
7000
|
"title": "Compass and Northstar: what each may change",
|
|
7001
7001
|
"readWhen": "a Duty is bound to a Compass or belongs to a Northstar, and you must know what either may change",
|
|
7002
|
-
"version":
|
|
7002
|
+
"version": 5,
|
|
7003
7003
|
"aliases": [],
|
|
7004
7004
|
"explains": [
|
|
7005
7005
|
"DUTY_COMPASS_IMMUTABLE"
|
package/dist/lib/balance.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TSubscription, TSkyCodeUsageBreakdown, TSkyCodeUsageEvents, TSkyCodeUsageSettlements, TSkyCodeUsageSnapshot } from '@skrr-ai/data-provider';
|
|
1
|
+
import type { TSubscription, TSkyCodeUsageBreakdown as TUsageBreakdown, TSkyCodeUsageEvents, TSkyCodeUsageSettlements as TUsageSettlements, TSkyCodeUsageSnapshot } from '@skrr-ai/data-provider';
|
|
2
2
|
/**
|
|
3
3
|
* balance.ts — request client for `/api/balance`.
|
|
4
4
|
*
|
|
@@ -106,18 +106,18 @@ export declare function getSkyCodeSubscription(): Promise<TSubscription>;
|
|
|
106
106
|
export declare function setSkyCodeOverageConsent(enabled: boolean): Promise<{
|
|
107
107
|
enabled: boolean;
|
|
108
108
|
}>;
|
|
109
|
-
export declare function
|
|
109
|
+
export declare function getUsageEvents(workspaceId: string | undefined, params?: {
|
|
110
110
|
from?: string;
|
|
111
111
|
to?: string;
|
|
112
112
|
cursor?: string;
|
|
113
113
|
limit?: number;
|
|
114
114
|
view?: 'settlements';
|
|
115
|
-
}): Promise<TSkyCodeUsageEvents |
|
|
116
|
-
export declare function
|
|
115
|
+
}): Promise<TSkyCodeUsageEvents | TUsageSettlements>;
|
|
116
|
+
export declare function getUsageBreakdown(workspaceId: string | undefined, params?: {
|
|
117
117
|
from?: string;
|
|
118
118
|
to?: string;
|
|
119
119
|
productFamily?: string;
|
|
120
|
-
}): Promise<
|
|
120
|
+
}): Promise<TUsageBreakdown>;
|
|
121
121
|
/** Resolve only identities this caller may VIEW; the server omits denied IDs. */
|
|
122
122
|
export declare function getUsageAgentNames(ids: string[], workspaceId?: string): Promise<Map<string, string>>;
|
|
123
123
|
/** Recent token transactions, newest first. Cursor is an ISO createdAt. */
|
package/dist/lib/balance.js
CHANGED
|
@@ -5,8 +5,8 @@ exports.getBalance = getBalance;
|
|
|
5
5
|
exports.getSkyCodeUsage = getSkyCodeUsage;
|
|
6
6
|
exports.getSkyCodeSubscription = getSkyCodeSubscription;
|
|
7
7
|
exports.setSkyCodeOverageConsent = setSkyCodeOverageConsent;
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
8
|
+
exports.getUsageEvents = getUsageEvents;
|
|
9
|
+
exports.getUsageBreakdown = getUsageBreakdown;
|
|
10
10
|
exports.getUsageAgentNames = getUsageAgentNames;
|
|
11
11
|
exports.getBalanceHistory = getBalanceHistory;
|
|
12
12
|
exports.formatCredits = formatCredits;
|
|
@@ -48,7 +48,7 @@ async function setSkyCodeOverageConsent(enabled) {
|
|
|
48
48
|
body: { enabled },
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
async function
|
|
51
|
+
async function getUsageEvents(workspaceId, params = {}) {
|
|
52
52
|
const query = new URLSearchParams();
|
|
53
53
|
if (params.from)
|
|
54
54
|
query.set('from', params.from);
|
|
@@ -66,7 +66,7 @@ async function getSkyCodeUsageEvents(workspaceId, params = {}) {
|
|
|
66
66
|
const suffix = query.toString();
|
|
67
67
|
return (0, api_fetch_1.apiFetch)(suffix ? `${base}?${suffix}` : base);
|
|
68
68
|
}
|
|
69
|
-
async function
|
|
69
|
+
async function getUsageBreakdown(workspaceId, params = {}) {
|
|
70
70
|
const query = new URLSearchParams();
|
|
71
71
|
if (params.from)
|
|
72
72
|
query.set('from', params.from);
|
|
@@ -18,6 +18,12 @@ export interface DedicatedRuntimeScope {
|
|
|
18
18
|
export interface DedicatedLease extends Omit<HarnessLease, 'storage' | 'health'> {
|
|
19
19
|
/** Canonical public scope; the persisted MachineLease field is `teamId`. */
|
|
20
20
|
workspaceId?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* The workspace volume is recorded as gone (OSK-23526), read on the server from the record and never from
|
|
23
|
+
* `stateReason`. ABSENT means UNKNOWN (an older server), never "no": only `true` changes any copy, so a
|
|
24
|
+
* line that says "files are kept" must check it first.
|
|
25
|
+
*/
|
|
26
|
+
workspaceVolumeMissing?: boolean;
|
|
21
27
|
health?: {
|
|
22
28
|
assignable?: boolean;
|
|
23
29
|
reasons?: string[];
|
|
@@ -170,6 +176,8 @@ export declare function describeDedicatedDaemonRelease(image: DedicatedImageStan
|
|
|
170
176
|
export declare function describeDedicatedImageStanding(image: DedicatedImageStanding, leaseId?: string, opts?: {
|
|
171
177
|
daemonVersion?: string | null;
|
|
172
178
|
latestDaemonRelease?: LatestDaemonRelease | null;
|
|
179
|
+
/** The lease's `workspaceVolumeMissing`: when true no line says the files are kept (OSK-23526). */
|
|
180
|
+
workspaceVolumeMissing?: boolean | null;
|
|
173
181
|
}): string;
|
|
174
182
|
/**
|
|
175
183
|
* A deleted workspace: restorable into a new machine until `recoverableUntil`,
|
|
@@ -162,11 +162,13 @@ function approvedImageDaemonUnknownText(image) {
|
|
|
162
162
|
*/
|
|
163
163
|
function describeDedicatedImageStanding(image, leaseId, opts = {}) {
|
|
164
164
|
const last = image.lastUpdate;
|
|
165
|
+
// Only a lease whose disk is recorded as gone drops the promise; an unknown (absent) keeps the words.
|
|
166
|
+
const filesKept = opts.workspaceVolumeMissing === true ? '' : '; files are kept';
|
|
165
167
|
if (last?.status === 'applying') {
|
|
166
|
-
return `moving onto the current image${last.startedAt ? ` since ${last.startedAt}` : ''}
|
|
168
|
+
return `moving onto the current image${last.startedAt ? ` since ${last.startedAt}` : ''}${filesKept}`;
|
|
167
169
|
}
|
|
168
170
|
if (last?.status === 'rolling_back') {
|
|
169
|
-
return
|
|
171
|
+
return `the current image did not come back healthy; returning to the previous image${opts.workspaceVolumeMissing === true ? '' : ', files kept'}`;
|
|
170
172
|
}
|
|
171
173
|
const parts = [];
|
|
172
174
|
if (image.updateAvailable) {
|
|
@@ -176,7 +178,7 @@ function describeDedicatedImageStanding(image, leaseId, opts = {}) {
|
|
|
176
178
|
parts.push('on the previous image: the current one did not come back healthy here');
|
|
177
179
|
}
|
|
178
180
|
else if (last?.status === 'failed') {
|
|
179
|
-
parts.push(
|
|
181
|
+
parts.push(`the last image update did not complete on either image${filesKept}`);
|
|
180
182
|
}
|
|
181
183
|
else {
|
|
182
184
|
const here = String(opts.daemonVersion || '').trim();
|
|
@@ -706,15 +708,14 @@ function dedicatedSpendSummary(lease) {
|
|
|
706
708
|
}
|
|
707
709
|
const spent = billing.currentMonthSpendCents;
|
|
708
710
|
const projected = billing.projectedCurrentMonthSpendCents;
|
|
709
|
-
const parts = [
|
|
710
|
-
`${formatUsdCents(spent)} this month for ${scope}`,
|
|
711
|
-
capSummary,
|
|
712
|
-
];
|
|
711
|
+
const parts = [`${formatUsdCents(spent)} this month for ${scope}`, capSummary];
|
|
713
712
|
if (typeof projected === 'number' && projected !== spent) {
|
|
714
713
|
parts.push(`projected ${formatUsdCents(projected)}`);
|
|
715
714
|
}
|
|
716
715
|
if (billing.spendingLimitExceeded) {
|
|
717
|
-
|
|
716
|
+
// "files are kept" is not said of a lease whose workspace disk is recorded gone (OSK-23526); an absent
|
|
717
|
+
// field (an older server) keeps the words.
|
|
718
|
+
parts.push(`OVER CAP — ${overCapComputeClause(lease.state)}${lease.workspaceVolumeMissing === true ? '' : ', files are kept'}`);
|
|
718
719
|
}
|
|
719
720
|
return parts.join(' · ');
|
|
720
721
|
}
|
|
@@ -780,7 +781,11 @@ function describeDedicatedLease(lease, harnesses = [], opts = {}) {
|
|
|
780
781
|
// A reason the platform wrote for its own stop gets a sentence, not just a code: the
|
|
781
782
|
// code names an internal rule and leaves the owner asking where their machine went
|
|
782
783
|
// (OSK-13732). A reason with no copy keeps printing as the code above.
|
|
783
|
-
|
|
784
|
+
// A lease whose workspace disk is gone says so here instead of the stop sentence, which promises
|
|
785
|
+
// "Your files are kept" (OSK-23526). `workspaceVolumeMissing` absent (an older server) keeps the words.
|
|
786
|
+
const stateReasonCopy = (0, data_provider_1.describeMachineStateReason)(lease.stateReason, undefined, {
|
|
787
|
+
workspaceVolumeMissing: lease.workspaceVolumeMissing,
|
|
788
|
+
});
|
|
784
789
|
if (stateReasonCopy)
|
|
785
790
|
row('why', stateReasonCopy);
|
|
786
791
|
const resources = lease.resources || {};
|
|
@@ -811,6 +816,7 @@ function describeDedicatedLease(lease, harnesses = [], opts = {}) {
|
|
|
811
816
|
row('image update', describeDedicatedImageStanding(lease.health.image, dedicatedLeaseId(lease), {
|
|
812
817
|
daemonVersion: lease.daemon?.version,
|
|
813
818
|
latestDaemonRelease: opts.latestDaemonRelease,
|
|
819
|
+
workspaceVolumeMissing: lease.workspaceVolumeMissing,
|
|
814
820
|
}));
|
|
815
821
|
row('image daemon', describeDedicatedDaemonRelease(lease.health.image, opts.latestDaemonRelease));
|
|
816
822
|
}
|
|
@@ -57,7 +57,11 @@ export declare function describePowerDecisionLines(decision: PowerDecisionView):
|
|
|
57
57
|
* the decision text already carries (the server appends it while the machine is stopped) is not
|
|
58
58
|
* repeated.
|
|
59
59
|
*/
|
|
60
|
-
export declare function describeLastAutoStopLines(last: DedicatedRuntimePowerSummary['lastAutoStop'], decisionDetail?: string, when?: WhenOptions
|
|
60
|
+
export declare function describeLastAutoStopLines(last: DedicatedRuntimePowerSummary['lastAutoStop'], decisionDetail?: string, when?: WhenOptions,
|
|
61
|
+
/** The summary's `workspaceVolumeMissing`: when true a false stop's fix promises no files (OSK-23526). */
|
|
62
|
+
facts?: {
|
|
63
|
+
workspaceVolumeMissing?: boolean | null;
|
|
64
|
+
}): {
|
|
61
65
|
lines: string[];
|
|
62
66
|
fix: string | null;
|
|
63
67
|
};
|