@skrr-ai/cli 0.1.91 → 0.1.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-command.d.ts +44 -0
- package/dist/base-command.js +96 -0
- package/dist/commands/agents/badge.d.ts +41 -0
- package/dist/commands/agents/badge.js +158 -0
- package/dist/commands/agents/create.d.ts +24 -0
- package/dist/commands/agents/create.js +212 -0
- package/dist/commands/agents/embed.d.ts +20 -0
- package/dist/commands/agents/embed.js +61 -0
- package/dist/commands/agents/share.d.ts +27 -0
- package/dist/commands/agents/share.js +100 -0
- package/dist/commands/agents/vanity.d.ts +21 -0
- package/dist/commands/agents/vanity.js +77 -0
- package/dist/commands/agents/visibility.d.ts +21 -1
- package/dist/commands/agents/visibility.js +112 -0
- package/dist/commands/commands.d.ts +1 -0
- package/dist/commands/commands.js +22 -9
- package/dist/commands/earnings/attributions.d.ts +17 -0
- package/dist/commands/earnings/attributions.js +82 -0
- package/dist/commands/earnings/index.js +2 -1
- package/dist/commands/generate-recovery-code.js +4 -3
- package/dist/commands/github/allow-tools.d.ts +1 -0
- package/dist/commands/github/app/install.d.ts +1 -0
- package/dist/commands/github/app/status.d.ts +1 -0
- package/dist/commands/github/connect.d.ts +1 -0
- package/dist/commands/github/connections.d.ts +1 -0
- package/dist/commands/github/disconnect.d.ts +1 -0
- package/dist/commands/github/finalize.d.ts +1 -0
- package/dist/commands/github/reconnect.d.ts +1 -0
- package/dist/commands/github/run.d.ts +1 -0
- package/dist/commands/github/tools.d.ts +1 -0
- package/dist/commands/integrations/connections/connect.d.ts +1 -0
- package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
- package/dist/commands/integrations/connections/finalize.d.ts +1 -0
- package/dist/commands/integrations/connections/list.d.ts +1 -0
- package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
- package/dist/commands/integrations/execute.d.ts +1 -0
- package/dist/commands/integrations/search.d.ts +1 -0
- package/dist/commands/integrations/toolkits.d.ts +1 -0
- package/dist/commands/integrations/tools/allow.d.ts +1 -0
- package/dist/commands/integrations/tools/list.d.ts +1 -0
- package/dist/commands/login.js +12 -0
- package/dist/commands/machines/dedicated/logs.d.ts +19 -0
- package/dist/commands/machines/dedicated/logs.js +103 -0
- package/dist/commands/machines/dedicated/power/index.js +3 -2
- package/dist/commands/machines/dedicated/power/set.js +1 -1
- package/dist/commands/machines/dedicated/power/waiting.d.ts +13 -0
- package/dist/commands/machines/dedicated/power/waiting.js +36 -0
- package/dist/commands/open.d.ts +24 -0
- package/dist/commands/open.js +74 -0
- package/dist/commands/projects/archive.d.ts +1 -0
- package/dist/commands/projects/archive.js +23 -0
- package/dist/commands/projects/delete.d.ts +1 -0
- package/dist/commands/projects/delete.js +23 -0
- package/dist/commands/projects/list.d.ts +3 -0
- package/dist/commands/projects/list.js +12 -2
- package/dist/commands/spaces/actions/add.js +4 -3
- package/dist/commands/spaces/actions/available.js +3 -2
- package/dist/commands/spaces/actions/list.js +5 -4
- package/dist/commands/spaces/actions/replace.js +6 -5
- package/dist/commands/spaces/archive.js +3 -2
- package/dist/commands/spaces/auto-executor/preview.js +4 -3
- package/dist/commands/spaces/auto-executor/run.js +4 -3
- package/dist/commands/spaces/auto-executor/runs.js +3 -2
- package/dist/commands/spaces/auto-executor/update.js +4 -3
- package/dist/commands/spaces/bootstrap.js +3 -2
- package/dist/commands/spaces/briefs/delete.js +3 -2
- package/dist/commands/spaces/briefs/get.js +3 -2
- package/dist/commands/spaces/briefs/list.js +3 -2
- package/dist/commands/spaces/briefs/set.js +5 -4
- package/dist/commands/spaces/capacity.js +5 -4
- package/dist/commands/spaces/conversations.js +3 -2
- package/dist/commands/spaces/cycles/create.js +3 -2
- package/dist/commands/spaces/cycles/graph.js +2 -1
- package/dist/commands/spaces/cycles/list.js +3 -2
- package/dist/commands/spaces/cycles/settings.js +4 -3
- package/dist/commands/spaces/cycles/show.js +3 -2
- package/dist/commands/spaces/cycles/update.js +3 -2
- package/dist/commands/spaces/delete.js +4 -3
- package/dist/commands/spaces/expertise-suggestions.js +4 -3
- package/dist/commands/spaces/files/delete.js +3 -2
- package/dist/commands/spaces/files/folders/create.js +3 -2
- package/dist/commands/spaces/files/folders/delete.js +3 -2
- package/dist/commands/spaces/files/folders/list.js +3 -2
- package/dist/commands/spaces/files/folders/update.js +3 -2
- package/dist/commands/spaces/files/list.js +3 -2
- package/dist/commands/spaces/files/move.js +3 -2
- package/dist/commands/spaces/files/rename.js +3 -2
- package/dist/commands/spaces/files/upload.js +6 -5
- package/dist/commands/spaces/github-automations/set.js +3 -2
- package/dist/commands/spaces/github-automations/show.js +3 -2
- package/dist/commands/spaces/goals.js +2 -1
- package/dist/commands/spaces/heartbeats/create.js +4 -3
- package/dist/commands/spaces/heartbeats/delete.js +4 -3
- package/dist/commands/spaces/heartbeats/list.js +4 -3
- package/dist/commands/spaces/heartbeats/status.js +3 -2
- package/dist/commands/spaces/heartbeats/update.js +4 -3
- package/dist/commands/spaces/insights.js +5 -4
- package/dist/commands/spaces/labels/add.js +4 -3
- package/dist/commands/spaces/labels/list.js +2 -1
- package/dist/commands/spaces/labels/remove.js +4 -3
- package/dist/commands/spaces/list.d.ts +3 -0
- package/dist/commands/spaces/list.js +11 -2
- package/dist/commands/spaces/live/cards/create.js +3 -2
- package/dist/commands/spaces/live/cards/list.js +3 -2
- package/dist/commands/spaces/live/cards/reorder.js +7 -2
- package/dist/commands/spaces/live/scene.js +4 -3
- package/dist/commands/spaces/members/add.js +7 -6
- package/dist/commands/spaces/members/list.js +4 -3
- package/dist/commands/spaces/members/remove.js +7 -6
- package/dist/commands/spaces/move.js +3 -2
- package/dist/commands/spaces/pin.js +5 -4
- package/dist/commands/spaces/preferences/show.js +4 -3
- package/dist/commands/spaces/preferences/tabs.js +4 -3
- package/dist/commands/spaces/revisions.js +3 -2
- package/dist/commands/spaces/room/ensure.js +5 -4
- package/dist/commands/spaces/room/messages.js +3 -2
- package/dist/commands/spaces/room/show.js +5 -4
- package/dist/commands/spaces/skills/add.js +4 -3
- package/dist/commands/spaces/skills/list.js +3 -2
- package/dist/commands/spaces/skills/pin.js +4 -3
- package/dist/commands/spaces/skills/remove.js +4 -3
- package/dist/commands/spaces/snapshot.js +3 -2
- package/dist/commands/spaces/states/archive.js +3 -2
- package/dist/commands/spaces/states/create.js +3 -2
- package/dist/commands/spaces/states/list.js +3 -2
- package/dist/commands/spaces/states/reorder.js +2 -1
- package/dist/commands/spaces/states/update.js +3 -2
- package/dist/commands/spaces/summary.js +4 -3
- package/dist/commands/spaces/tasks.d.ts +3 -0
- package/dist/commands/spaces/tasks.js +14 -3
- package/dist/commands/spaces/triggers/delete.js +5 -4
- package/dist/commands/spaces/triggers/set.js +4 -3
- package/dist/commands/spaces/triggers/show.js +4 -3
- package/dist/commands/spaces/unarchive.js +3 -2
- package/dist/commands/spaces/update.js +5 -4
- package/dist/commands/spaces/views/create.js +3 -2
- package/dist/commands/spaces/views/list.js +3 -2
- package/dist/commands/spaces/views/reorder.js +6 -3
- package/dist/commands/spaces/views/subscribe.js +2 -1
- package/dist/commands/spaces/views/subscriptions.js +1 -0
- package/dist/commands/spaces/views/unsubscribe.js +2 -1
- package/dist/commands/spaces/widgets/add.js +4 -3
- package/dist/commands/spaces/widgets/list.js +3 -2
- package/dist/commands/spaces/widgets/remove.js +5 -4
- package/dist/commands/spaces/work-graph.js +2 -1
- package/dist/commands/store/install.d.ts +1 -1
- package/dist/commands/store/install.js +24 -8
- package/dist/commands/store/show.d.ts +25 -0
- package/dist/commands/store/show.js +203 -0
- package/dist/commands/store/stats.d.ts +33 -0
- package/dist/commands/store/stats.js +258 -0
- package/dist/commands/tasks/actions/attach.js +1 -1
- package/dist/commands/tasks/actions/detach.js +4 -3
- package/dist/commands/tasks/activity.js +3 -2
- package/dist/commands/tasks/ancestors.js +2 -1
- package/dist/commands/tasks/approvals/create.js +2 -1
- package/dist/commands/tasks/approvals/delete.js +3 -2
- package/dist/commands/tasks/approvals/list.js +5 -4
- package/dist/commands/tasks/approvals/resolve.js +2 -1
- package/dist/commands/tasks/archive.js +3 -2
- package/dist/commands/tasks/assign.js +4 -3
- package/dist/commands/tasks/attachments/delete.js +3 -2
- package/dist/commands/tasks/attachments/download.d.ts +1 -0
- package/dist/commands/tasks/attachments/download.js +20 -1
- package/dist/commands/tasks/attachments/list.js +2 -1
- package/dist/commands/tasks/attachments/set-role.js +2 -1
- package/dist/commands/tasks/attachments/upload.js +2 -1
- package/dist/commands/tasks/bulk-update.d.ts +1 -0
- package/dist/commands/tasks/bulk-update.js +106 -15
- package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
- package/dist/commands/tasks/cancel-cascade.js +13 -3
- package/dist/commands/tasks/cascade-status.js +2 -1
- package/dist/commands/tasks/chat/send.d.ts +44 -0
- package/dist/commands/tasks/chat/send.js +112 -0
- package/dist/commands/tasks/checkout.js +3 -2
- package/dist/commands/tasks/children.js +2 -1
- package/dist/commands/tasks/comments/add.js +7 -6
- package/dist/commands/tasks/comments/anchor.js +8 -7
- package/dist/commands/tasks/comments/delete.js +3 -2
- package/dist/commands/tasks/comments/list.js +2 -1
- package/dist/commands/tasks/comments/reopen.js +3 -2
- package/dist/commands/tasks/comments/resolve.js +3 -2
- package/dist/commands/tasks/create-tree.d.ts +63 -0
- package/dist/commands/tasks/create-tree.js +197 -4
- package/dist/commands/tasks/delete.js +5 -4
- package/dist/commands/tasks/descendants.js +2 -1
- package/dist/commands/tasks/dri-plan.js +3 -2
- package/dist/commands/tasks/dri-run.js +3 -2
- package/dist/commands/tasks/dri-status.js +2 -1
- package/dist/commands/tasks/duplicate-pipeline.js +2 -1
- package/dist/commands/tasks/execution-summary.js +2 -1
- package/dist/commands/tasks/execution-timeline.js +2 -1
- package/dist/commands/tasks/fork.js +1 -0
- package/dist/commands/tasks/forward.js +4 -3
- package/dist/commands/tasks/handover.js +1 -0
- package/dist/commands/tasks/interrupt.js +3 -2
- package/dist/commands/tasks/labels/attach.js +4 -3
- package/dist/commands/tasks/labels/detach.js +4 -3
- package/dist/commands/tasks/labels/suggest.js +5 -4
- package/dist/commands/tasks/list.d.ts +27 -1
- package/dist/commands/tasks/list.js +101 -3
- package/dist/commands/tasks/move.js +4 -3
- package/dist/commands/tasks/output.js +6 -5
- package/dist/commands/tasks/pause-schedule.js +3 -2
- package/dist/commands/tasks/promote.js +1 -0
- package/dist/commands/tasks/prompt-log.js +2 -1
- package/dist/commands/tasks/release.js +5 -4
- package/dist/commands/tasks/remind.js +2 -1
- package/dist/commands/tasks/replay.js +3 -2
- package/dist/commands/tasks/report.js +1 -0
- package/dist/commands/tasks/resume-schedule.js +3 -2
- package/dist/commands/tasks/retry-schedule.js +3 -2
- package/dist/commands/tasks/retry.js +10 -9
- package/dist/commands/tasks/revisions.js +2 -1
- package/dist/commands/tasks/runs.js +6 -5
- package/dist/commands/tasks/schedule.js +3 -2
- package/dist/commands/tasks/self-schedule.js +6 -5
- package/dist/commands/tasks/skills/pin.js +3 -2
- package/dist/commands/tasks/skills/unpin.js +3 -2
- package/dist/commands/tasks/snooze.js +6 -5
- package/dist/commands/tasks/start-all.js +5 -4
- package/dist/commands/tasks/subscribe.js +1 -0
- package/dist/commands/tasks/tags/add.js +4 -3
- package/dist/commands/tasks/tags/remove.js +4 -3
- package/dist/commands/tasks/timeline.js +3 -2
- package/dist/commands/tasks/today.d.ts +4 -1
- package/dist/commands/tasks/today.js +12 -2
- package/dist/commands/tasks/transcript.js +6 -5
- package/dist/commands/tasks/unschedule.js +3 -2
- package/dist/commands/tasks/unsnooze.js +3 -2
- package/dist/commands/tasks/unsubscribe.js +2 -1
- package/dist/commands/tasks/update.js +5 -4
- package/dist/commands/tasks/wait.js +5 -4
- package/dist/lib/agent-distribution.d.ts +37 -0
- package/dist/lib/agent-distribution.js +63 -0
- package/dist/lib/agent-ref.d.ts +69 -0
- package/dist/lib/agent-ref.js +168 -0
- package/dist/lib/api-fetch.d.ts +2 -0
- package/dist/lib/api-fetch.js +14 -3
- package/dist/lib/command-hygiene.d.ts +13 -0
- package/dist/lib/command-hygiene.js +62 -2
- package/dist/lib/dedicated-power.d.ts +16 -1
- package/dist/lib/dedicated-power.js +153 -2
- package/dist/lib/dry-run-plans.d.ts +50 -0
- package/dist/lib/dry-run-plans.js +85 -0
- package/dist/lib/json-output.d.ts +31 -0
- package/dist/lib/json-output.js +78 -0
- package/dist/lib/list-output.d.ts +75 -0
- package/dist/lib/list-output.js +266 -0
- package/dist/lib/machine-daemon-log.d.ts +36 -0
- package/dist/lib/machine-daemon-log.js +78 -0
- package/dist/lib/node-adapter.js +10 -1
- package/dist/lib/open-target.d.ts +12 -0
- package/dist/lib/open-target.js +108 -0
- package/dist/lib/rate-limit-retry.d.ts +45 -0
- package/dist/lib/rate-limit-retry.js +88 -0
- package/dist/lib/store-listing.d.ts +45 -0
- package/dist/lib/store-listing.js +186 -0
- package/dist/lib/task-batch.d.ts +67 -0
- package/dist/lib/task-batch.js +227 -0
- package/dist/lib/terminal-qr.d.ts +55 -0
- package/dist/lib/terminal-qr.js +119 -0
- package/dist/lib/web-url.d.ts +11 -0
- package/dist/lib/web-url.js +24 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6615 -6112
- package/oclif.manifest.json +41499 -32585
- package/package.json +2 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* A QR code a phone can scan off a terminal.
|
|
4
|
+
*
|
|
5
|
+
* The ENCODER is `qrcode-terminal`'s vendored QR model (the same zero-dependency
|
|
6
|
+
* package the daemon already ships for its login QR, pinned in the lockfile).
|
|
7
|
+
* Its own renderer is not used, because it is the part that decides whether a
|
|
8
|
+
* phone can read the result, and it gets two things wrong for that:
|
|
9
|
+
*
|
|
10
|
+
* - a ONE-module border. The QR spec asks for a four-module quiet zone, and a
|
|
11
|
+
* scanner looking at a terminal full of other text needs it most;
|
|
12
|
+
* - it paints light modules as `█` in the terminal's FOREGROUND colour, so on
|
|
13
|
+
* a light-themed terminal the code comes out inverted, which many scanners
|
|
14
|
+
* refuse.
|
|
15
|
+
*
|
|
16
|
+
* This renderer draws half-blocks (two modules per character row, so the code
|
|
17
|
+
* is square in a ~1:2 character cell) in EXPLICIT colours — black on bright
|
|
18
|
+
* white — so it scans the same on dark and light themes, with a full quiet zone.
|
|
19
|
+
*
|
|
20
|
+
* The QR is always a convenience printed beside the URL, never instead of it:
|
|
21
|
+
* `qrRenderDecision` says no for a pipe, `NO_COLOR`, `OVERSKY_NO_QR` / `SKRR_NO_QR`
|
|
22
|
+
* or a terminal too narrow to hold it, and the caller prints the URL alone.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.QR_QUIET_ZONE = void 0;
|
|
26
|
+
exports.qrMatrix = qrMatrix;
|
|
27
|
+
exports.renderQr = renderQr;
|
|
28
|
+
exports.qrWidth = qrWidth;
|
|
29
|
+
exports.qrRenderDecision = qrRenderDecision;
|
|
30
|
+
// The vendored model has no published types; this is its whole surface here.
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
32
|
+
const QRCodeModel = require('qrcode-terminal/vendor/QRCode');
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
34
|
+
const QRErrorCorrectLevel = require('qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel');
|
|
35
|
+
/** The spec's quiet zone, in modules. */
|
|
36
|
+
exports.QR_QUIET_ZONE = 4;
|
|
37
|
+
/**
|
|
38
|
+
* The module matrix for `text`, quiet zone included. Level M: a share URL is
|
|
39
|
+
* well under 100 bytes, so the extra damage tolerance costs nothing in size.
|
|
40
|
+
*/
|
|
41
|
+
function qrMatrix(text, level = 'M') {
|
|
42
|
+
const qr = new QRCodeModel(-1, QRErrorCorrectLevel[level]);
|
|
43
|
+
qr.addData(text);
|
|
44
|
+
qr.make();
|
|
45
|
+
const count = qr.getModuleCount();
|
|
46
|
+
const size = count + exports.QR_QUIET_ZONE * 2;
|
|
47
|
+
const matrix = [];
|
|
48
|
+
for (let row = 0; row < size; row += 1) {
|
|
49
|
+
const line = [];
|
|
50
|
+
for (let col = 0; col < size; col += 1) {
|
|
51
|
+
const r = row - exports.QR_QUIET_ZONE;
|
|
52
|
+
const c = col - exports.QR_QUIET_ZONE;
|
|
53
|
+
line.push(r >= 0 && c >= 0 && r < count && c < count ? qr.isDark(r, c) : false);
|
|
54
|
+
}
|
|
55
|
+
matrix.push(line);
|
|
56
|
+
}
|
|
57
|
+
return matrix;
|
|
58
|
+
}
|
|
59
|
+
/** Indexed by (top dark ? 2 : 0) + (bottom dark ? 1 : 0). */
|
|
60
|
+
const HALF_BLOCK = [' ', '▄', '▀', '█'];
|
|
61
|
+
const DARK_ON_LIGHT = '\x1b[30;107m';
|
|
62
|
+
const RESET = '\x1b[0m';
|
|
63
|
+
/**
|
|
64
|
+
* Render with half blocks: the upper half of each character is the top
|
|
65
|
+
* module (foreground, black), the lower half the bottom module (background,
|
|
66
|
+
* white). Returns the lines, each `matrix width` characters wide.
|
|
67
|
+
*/
|
|
68
|
+
function renderQr(text) {
|
|
69
|
+
const matrix = qrMatrix(text);
|
|
70
|
+
const size = matrix.length;
|
|
71
|
+
const lines = [];
|
|
72
|
+
for (let row = 0; row < size; row += 2) {
|
|
73
|
+
let line = '';
|
|
74
|
+
for (let col = 0; col < size; col += 1) {
|
|
75
|
+
const top = matrix[row][col];
|
|
76
|
+
const bottom = row + 1 < size ? matrix[row + 1][col] : false;
|
|
77
|
+
line += HALF_BLOCK[(top ? 2 : 0) + (bottom ? 1 : 0)];
|
|
78
|
+
}
|
|
79
|
+
lines.push(`${DARK_ON_LIGHT}${line}${RESET}`);
|
|
80
|
+
}
|
|
81
|
+
return lines;
|
|
82
|
+
}
|
|
83
|
+
/** The QR's width in terminal columns (one column per module). */
|
|
84
|
+
function qrWidth(text) {
|
|
85
|
+
return qrMatrix(text).length;
|
|
86
|
+
}
|
|
87
|
+
function truthy(value) {
|
|
88
|
+
if (typeof value !== 'string')
|
|
89
|
+
return false;
|
|
90
|
+
const v = value.trim().toLowerCase();
|
|
91
|
+
return v !== '' && v !== '0' && v !== 'false' && v !== 'no';
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether a QR for `text` can be drawn on `stream`. Default-deny when the
|
|
95
|
+
* stream does not say it is a TTY, so captured output never carries block
|
|
96
|
+
* glyphs or escape codes.
|
|
97
|
+
*/
|
|
98
|
+
function qrRenderDecision(text, { env = process.env, stream = process.stdout, } = {}) {
|
|
99
|
+
// https://no-color.org: present and non-empty disables colour. The QR IS
|
|
100
|
+
// colour (it is drawn in explicit black and white), so it goes too.
|
|
101
|
+
if (typeof env.NO_COLOR === 'string' && env.NO_COLOR !== '') {
|
|
102
|
+
return { render: false, reason: 'NO_COLOR is set' };
|
|
103
|
+
}
|
|
104
|
+
if (truthy(env.SKRR_NO_QR) || truthy(env.OVERSKY_NO_QR)) {
|
|
105
|
+
return { render: false, reason: 'QR codes are turned off (SKRR_NO_QR)' };
|
|
106
|
+
}
|
|
107
|
+
if (stream.isTTY !== true) {
|
|
108
|
+
return { render: false, reason: 'output is not a terminal' };
|
|
109
|
+
}
|
|
110
|
+
const columns = typeof stream.columns === 'number' ? stream.columns : 0;
|
|
111
|
+
const width = qrWidth(text);
|
|
112
|
+
if (columns > 0 && columns < width) {
|
|
113
|
+
return {
|
|
114
|
+
render: false,
|
|
115
|
+
reason: `the terminal is ${columns} columns wide and the code needs ${width}`,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return { render: true };
|
|
119
|
+
}
|
package/dist/lib/web-url.d.ts
CHANGED
|
@@ -45,6 +45,9 @@ export type WebUrlRef = {
|
|
|
45
45
|
} | {
|
|
46
46
|
kind: 'agent';
|
|
47
47
|
agentId: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'storeListing';
|
|
50
|
+
agentId: string;
|
|
48
51
|
} | {
|
|
49
52
|
kind: 'compass';
|
|
50
53
|
agentId: string;
|
|
@@ -96,6 +99,14 @@ export type WebUrlRef = {
|
|
|
96
99
|
export declare function webPath(ref: WebUrlRef): string | null;
|
|
97
100
|
/** Absolute web URL (`<webOrigin><path>`), or `null` when the ref lacks its id. */
|
|
98
101
|
export declare function webUrl(baseURL: string, ref: WebUrlRef): string | null;
|
|
102
|
+
/** The origin that serves the SPA for a configured baseURL (see `toWebOrigin`). */
|
|
103
|
+
export declare function webOrigin(baseURL: string): string;
|
|
104
|
+
/**
|
|
105
|
+
* Every origin that serves the skrr web app: the configured deployment's, each
|
|
106
|
+
* environment's from the one domain contract, and prod's retained previous
|
|
107
|
+
* origin. A URL on any other host is not a skrr page.
|
|
108
|
+
*/
|
|
109
|
+
export declare function firstPartyWebOrigins(baseURL: string): string[];
|
|
99
110
|
/** A persisted personalized Task View always opens as a focused modal on /tasks. */
|
|
100
111
|
export declare function taskViewUrl(baseURL: string, viewId: string): string;
|
|
101
112
|
type EntityRecord = Record<string, unknown>;
|
package/dist/lib/web-url.js
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.webPath = webPath;
|
|
21
21
|
exports.webUrl = webUrl;
|
|
22
|
+
exports.webOrigin = webOrigin;
|
|
23
|
+
exports.firstPartyWebOrigins = firstPartyWebOrigins;
|
|
22
24
|
exports.taskViewUrl = taskViewUrl;
|
|
23
25
|
exports.taskUrlFrom = taskUrlFrom;
|
|
24
26
|
exports.spaceUrlFrom = spaceUrlFrom;
|
|
@@ -42,6 +44,7 @@ exports.withNorthstarUrl = withNorthstarUrl;
|
|
|
42
44
|
exports.withAgentUrl = withAgentUrl;
|
|
43
45
|
exports.withDataUrls = withDataUrls;
|
|
44
46
|
exports.workflowUrlFrom = workflowUrlFrom;
|
|
47
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
45
48
|
const publicEndpoints_generated_1 = require("./publicEndpoints.generated");
|
|
46
49
|
/**
|
|
47
50
|
* Site-relative canonical path for an entity, or `null` when the required id is
|
|
@@ -93,6 +96,10 @@ function webPath(ref) {
|
|
|
93
96
|
const agentId = encodeId(ref.agentId);
|
|
94
97
|
return agentId ? `/agent/${agentId}` : null;
|
|
95
98
|
}
|
|
99
|
+
case 'storeListing': {
|
|
100
|
+
// The path comes from data-provider's one builder, never spelled here.
|
|
101
|
+
return ref.agentId ? (0, data_provider_1.publicAgentListingPath)(ref.agentId) : null;
|
|
102
|
+
}
|
|
96
103
|
case 'compass': {
|
|
97
104
|
const agentId = encodeId(ref.agentId);
|
|
98
105
|
const compassId = encodeId(ref.compassId);
|
|
@@ -178,6 +185,23 @@ const WEB_ORIGIN_FROM_API = {
|
|
|
178
185
|
// deliberately kept (LEGACY_PROD_BASE_URL), so its api. host must map too.
|
|
179
186
|
'https://api.oversky.ai': 'https://oversky.ai',
|
|
180
187
|
};
|
|
188
|
+
/** The origin that serves the SPA for a configured baseURL (see `toWebOrigin`). */
|
|
189
|
+
function webOrigin(baseURL) {
|
|
190
|
+
return toWebOrigin(baseURL);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Every origin that serves the skrr web app: the configured deployment's, each
|
|
194
|
+
* environment's from the one domain contract, and prod's retained previous
|
|
195
|
+
* origin. A URL on any other host is not a skrr page.
|
|
196
|
+
*/
|
|
197
|
+
function firstPartyWebOrigins(baseURL) {
|
|
198
|
+
const origins = new Set([
|
|
199
|
+
toWebOrigin(baseURL).toLowerCase(),
|
|
200
|
+
...Object.values(publicEndpoints_generated_1.OVERSKY_ENVIRONMENT_ENDPOINTS).map((e) => e.appUrl.toLowerCase()),
|
|
201
|
+
...Object.values(WEB_ORIGIN_FROM_API).map((origin) => origin.toLowerCase()),
|
|
202
|
+
]);
|
|
203
|
+
return [...origins].filter(Boolean);
|
|
204
|
+
}
|
|
181
205
|
function toWebOrigin(baseURL) {
|
|
182
206
|
const trimmed = trimTrailingSlash(baseURL);
|
|
183
207
|
return WEB_ORIGIN_FROM_API[trimmed.toLowerCase()] ?? trimmed;
|
|
@@ -151,6 +151,14 @@ export declare const DAEMON_COMPUTER_EVENTS: {
|
|
|
151
151
|
* `computer_declared_services_v1`.
|
|
152
152
|
*/
|
|
153
153
|
readonly services: "daemon:computer:services";
|
|
154
|
+
/**
|
|
155
|
+
* Read the tail of the daemon's OWN process log (a bounded, redacted copy of
|
|
156
|
+
* what its logger wrote since it started), for the owner who asks why their
|
|
157
|
+
* machine reconnected. Carries a `requestId` and the principal the API
|
|
158
|
+
* authorized (`observe`); the daemon checks the principal against the grant
|
|
159
|
+
* set it holds. Needs `computer_daemon_log_v1`.
|
|
160
|
+
*/
|
|
161
|
+
readonly daemonLog: "daemon:computer:log";
|
|
154
162
|
/** The answer to any request that carried a `requestId`. */
|
|
155
163
|
readonly ack: "daemon:computer:ack";
|
|
156
164
|
readonly manifest: "daemon:computer:manifest";
|
|
@@ -295,6 +303,15 @@ export declare const COMPUTER_CAPABILITIES: {
|
|
|
295
303
|
* browser; nothing is proxied to it. Announced by the relay that serves it.
|
|
296
304
|
*/
|
|
297
305
|
readonly declaredServices: "computer_declared_services_v1";
|
|
306
|
+
/**
|
|
307
|
+
* The daemon serves the tail of its own process log
|
|
308
|
+
* (`daemon:computer:log`): an in-memory ring of lines its logger
|
|
309
|
+
* wrote, redacted before they enter the ring, read at the `watch` tier. It
|
|
310
|
+
* is NOT syslog or the journal and never reads either. Announced by the relay
|
|
311
|
+
* that serves it; a personal machine's daemon announces it too and refuses
|
|
312
|
+
* the read `consent_missing` until `skrr computer allow`.
|
|
313
|
+
*/
|
|
314
|
+
readonly daemonLog: "computer_daemon_log_v1";
|
|
298
315
|
/**
|
|
299
316
|
* The page follows the controlling window (§6.2 "a stable viewport", §7.1,
|
|
300
317
|
* OSK-13808): a browser `viewport` input, sent only by the attachment that
|
|
@@ -1080,3 +1097,54 @@ export declare function computerPowerPhaseForLeaseState(state: unknown): Compute
|
|
|
1080
1097
|
export declare function computerShowsDesktop(phase: ComputerPowerPhase): boolean;
|
|
1081
1098
|
/** Power actions are offered for a Dedicated Runtime only; a personal machine has none (§18). */
|
|
1082
1099
|
export declare function computerOffersPowerActions(machineKind: ComputerMachineKind): boolean;
|
|
1100
|
+
/**
|
|
1101
|
+
* Why the daemon's log is a wire feature at all: the tenant uid on a Dedicated
|
|
1102
|
+
* Runtime guest cannot read syslog or the journal, so an owner could not see
|
|
1103
|
+
* why their machine's daemon reconnected or failed. The daemon keeps the last
|
|
1104
|
+
* lines its OWN logger wrote in memory and serves them; it opens no file and no
|
|
1105
|
+
* system log for this.
|
|
1106
|
+
*/
|
|
1107
|
+
export declare const COMPUTER_DAEMON_LOG_LEVELS: readonly ["trace", "debug", "info", "warn", "error"];
|
|
1108
|
+
export type ComputerDaemonLogLevel = (typeof COMPUTER_DAEMON_LOG_LEVELS)[number];
|
|
1109
|
+
/** Every bound is the daemon's to enforce and the API's to validate against. */
|
|
1110
|
+
export declare const COMPUTER_DAEMON_LOG_LIMITS: {
|
|
1111
|
+
/** Lines the daemon keeps in memory; older ones fall off the front. */
|
|
1112
|
+
readonly ringLines: 2000;
|
|
1113
|
+
/** A line longer than this is cut and marked, never kept whole. */
|
|
1114
|
+
readonly lineChars: 1000;
|
|
1115
|
+
/** Lines returned when the caller names none. */
|
|
1116
|
+
readonly defaultLines: 100;
|
|
1117
|
+
/** The most lines one answer carries. */
|
|
1118
|
+
readonly maxLines: 500;
|
|
1119
|
+
/** The most bytes (UTF-8) one answer's text carries; far under the 1 MiB SSE frame. */
|
|
1120
|
+
readonly maxBytes: number;
|
|
1121
|
+
/** The longest look-back a `sinceMs` may ask for (24 h; the ring is shorter anyway). */
|
|
1122
|
+
readonly maxSinceMs: number;
|
|
1123
|
+
/** Requests the daemon answers per `rateWindowMs`; one more is `rate_limited`. */
|
|
1124
|
+
readonly rateMax: 30;
|
|
1125
|
+
readonly rateWindowMs: number;
|
|
1126
|
+
};
|
|
1127
|
+
/** One line of the daemon's log as it leaves the daemon: redacted, time and level split out. */
|
|
1128
|
+
export interface ComputerDaemonLogLine {
|
|
1129
|
+
/** Epoch milliseconds the daemon wrote it. */
|
|
1130
|
+
at: number;
|
|
1131
|
+
level: ComputerDaemonLogLevel;
|
|
1132
|
+
text: string;
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* The answer to `daemon:computer:log`. `lines` are oldest first, at most
|
|
1136
|
+
* the asked number of the NEWEST that match. `truncated` is true when more
|
|
1137
|
+
* matched than were returned (by count or bytes); `ringFull` is true when the
|
|
1138
|
+
* ring has already dropped older lines, so "no line before this" does not mean
|
|
1139
|
+
* "the daemon logged nothing earlier". `startedAt` is the daemon process start:
|
|
1140
|
+
* a reconnect that restarted the daemon is visible as a new one.
|
|
1141
|
+
*/
|
|
1142
|
+
export interface ComputerDaemonLogResult {
|
|
1143
|
+
lines: ComputerDaemonLogLine[];
|
|
1144
|
+
startedAt: number;
|
|
1145
|
+
now: number;
|
|
1146
|
+
truncated: boolean;
|
|
1147
|
+
ringFull: boolean;
|
|
1148
|
+
/** Lines the redaction rewrote anywhere in the ring (a count, never content). */
|
|
1149
|
+
redactedLines: number;
|
|
1150
|
+
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
exports.COMPUTER_BROWSER_DIALOG_KINDS = exports.COMPUTER_INPUT_TEXT_MAX_LENGTH = exports.COMPUTER_BROWSER_INPUT_PLATFORMS = exports.COMPUTER_BROWSER_VIEWPORT_LIMITS = exports.COMPUTER_BROWSER_INPUT_TYPES = exports.COMPUTER_TERMINAL_CAVEATS = exports.COMPUTER_TERMINAL_HISTORY_CAUSES = exports.COMPUTER_TERMINAL_LIFETIMES = exports.COMPUTER_TERMINAL_INPUT_TYPES = exports.COMPUTER_TERMINAL_SIGNALS = exports.COMPUTER_DIAGNOSTICS_MAX_STREAMS = exports.COMPUTER_DIAGNOSTICS_INTERVAL_MS = exports.COMPUTER_DIAGNOSTIC_COUNTERS = exports.COMPUTER_FRAME_ACK_TIMEOUT_MS = exports.COMPUTER_FRAME_MAX_BYTES = exports.COMPUTER_BROWSER_VIEWPORT = exports.COMPUTER_SURFACE_END_REASONS = exports.COMPUTER_SURFACE_STATES = exports.COMPUTER_SURFACE_KINDS = exports.COMPUTER_CONTROL_ACTIVITY_CHANGES = exports.COMPUTER_CONTROL_CHANGE_REASONS = exports.COMPUTER_SURFACE_UNPIN_REASONS = exports.COMPUTER_SURFACE_PIN_ACTIONS = exports.COMPUTER_SHARE_MODES = exports.COMPUTER_SHARE_ACTIONS = exports.COMPUTER_CONTROL_ACTIONS = exports.COMPUTER_AGENT_WRITE_WAIT_MS = exports.COMPUTER_RECONNECT_GRACE_MS = exports.COMPUTER_RECLAIM_WARNING_MS = exports.COMPUTER_CONTROL_IDLE_MS = exports.COMPUTER_HANDBACK_NOTE_MAX_LENGTH = exports.COMPUTER_GRANT_TIERS = exports.COMPUTER_OPERATIONS = exports.COMPUTER_ACCESS_LEVELS = exports.COMPUTER_ACTOR_ENGINE_MAX_LENGTH = exports.COMPUTER_PLATFORM_ROUTE_SESSION_PREFIXES = exports.COMPUTER_ACTIVITY_ACTOR_KINDS = exports.COMPUTER_ACTOR_KINDS = exports.COMPUTER_REFUSAL_CODES = exports.COMPUTER_CAPABILITY_VALUES = exports.COMPUTER_CAPABILITIES = exports.COMPUTER_MANIFEST_REORDER_WAIT_MS = exports.COMPUTER_RESYNC_TIMEOUT_MS = exports.COMPUTER_API_ANSWERED_EVENT_KEYS = exports.COMPUTER_SERVER_EVENT_KEYS = exports.DAEMON_COMPUTER_REPORT_EVENT_KEYS = exports.DAEMON_COMPUTER_EVENT_NAMES = exports.COMPUTER_EVENT_NAMES = exports.DAEMON_COMPUTER_EVENTS = exports.COMPUTER_EVENTS = void 0;
|
|
29
29
|
exports.COMPUTER_DECLARED_SERVICES_MAX = exports.COMPUTER_DECLARED_SERVICE_PROTOCOLS = exports.COMPUTER_SERVICES_TOOL_ERROR_PREFIX = exports.COMPUTER_SERVICES_TOOL_NAME = exports.COMPUTER_DECLARED_SERVICE_ACTIONS = exports.COMPUTER_COMMAND_OUTPUT_STREAMS = exports.COMPUTER_COMMAND_START_REFUSALS = exports.COMPUTER_COMMAND_UNKNOWN_END_SIGNAL = exports.COMPUTER_COMMAND_NOT_STARTED_SIGNAL = exports.COMPUTER_COMMAND_OUTCOMES = exports.COMPUTER_LIFECYCLE_EVENTS = exports.COMPUTER_COMMAND_PHASES = exports.COMPUTER_ACTIVITY_WITHHELD_PLACEHOLDER = exports.COMPUTER_ACTIVITY_OUTPUT_MAX_LENGTH = exports.COMPUTER_ACTIVITY_SUMMARY_MAX_LENGTH = exports.COMPUTER_ACTIVITY_KINDS = exports.COMPUTER_FILE_CONTENTS_TAG_PATTERN = exports.COMPUTER_FILE_CONTENTS_TAG_MAX_ENTRIES = exports.COMPUTER_FILE_CHANGES = exports.COMPUTER_FILES_CHANGED_MAX_CHANGES = exports.COMPUTER_FILES_WATCH_DEGRADED_REASONS = exports.COMPUTER_FILE_WITHHELD_REASONS = exports.COMPUTER_FILE_TYPES = exports.COMPUTER_FILE_GIT_STATUS_BUDGET_MS = exports.COMPUTER_FILE_SEARCH_MAX_QUERY_LENGTH = exports.COMPUTER_FILE_SEARCH_MAX_BUDGET_MS = exports.COMPUTER_FILE_SEARCH_DEFAULT_BUDGET_MS = exports.COMPUTER_FILE_SEARCH_MAX_LIMIT = exports.COMPUTER_FILE_SEARCH_DEFAULT_LIMIT = exports.COMPUTER_FILE_GIT_MARKS = exports.COMPUTER_FILE_SEARCH_STATES = exports.COMPUTER_FILE_SEARCH_OPERATIONS = exports.COMPUTER_FILE_OPERATIONS = exports.COMPUTER_BROWSER_URL_MAX_LENGTH = exports.COMPUTER_BROWSER_TAB_ACTIONS = exports.COMPUTER_BROWSER_HISTORY_ACTIONS = exports.COMPUTER_BROWSER_COPY_MAX_LENGTH = exports.COMPUTER_TERMINAL_CWD_MAX_LENGTH = exports.COMPUTER_BROWSER_FILE_CHOOSER_PATH_MAX_LENGTH = exports.COMPUTER_BROWSER_FILE_CHOOSER_ACCEPT_MAX_LENGTH = exports.COMPUTER_BROWSER_FILE_CHOOSER_MAX_FILES = exports.COMPUTER_BROWSER_FILE_CHOOSER_OUTCOMES = exports.COMPUTER_BROWSER_FILE_CHOOSER_MODES = exports.COMPUTER_BROWSER_DOWNLOADS_MAX = exports.COMPUTER_BROWSER_DOWNLOAD_STATES = exports.COMPUTER_BROWSER_DIALOG_CREDENTIAL_MAX_LENGTH = exports.COMPUTER_BROWSER_DIALOG_PROMPT_MAX_LENGTH = exports.COMPUTER_BROWSER_DIALOG_MESSAGE_MAX_LENGTH = exports.COMPUTER_BROWSER_DIALOG_ANSWERERS = exports.COMPUTER_BROWSER_DIALOG_OUTCOMES = void 0;
|
|
30
|
-
exports.COMPUTER_LEASE_STATE_POWER_PHASE = exports.COMPUTER_START_REFUSALS = exports.COMPUTER_PERSONAL_SIGN_IN_REASONS = exports.COMPUTER_PERSONAL_POWER_PHASES = exports.COMPUTER_POWER_PHASES = exports.COMPUTER_MACHINE_KINDS = exports.COMPUTER_DECLARED_SERVICE_PROBLEMS = exports.COMPUTER_DECLARED_SERVICE_NAME_PATTERN = exports.COMPUTER_DECLARED_SERVICE_HOST = exports.COMPUTER_DECLARED_SERVICE_PATH_MAX_LENGTH = exports.COMPUTER_DECLARED_SERVICE_NAME_MAX_LENGTH = void 0;
|
|
30
|
+
exports.COMPUTER_DAEMON_LOG_LIMITS = exports.COMPUTER_DAEMON_LOG_LEVELS = exports.COMPUTER_LEASE_STATE_POWER_PHASE = exports.COMPUTER_START_REFUSALS = exports.COMPUTER_PERSONAL_SIGN_IN_REASONS = exports.COMPUTER_PERSONAL_POWER_PHASES = exports.COMPUTER_POWER_PHASES = exports.COMPUTER_MACHINE_KINDS = exports.COMPUTER_DECLARED_SERVICE_PROBLEMS = exports.COMPUTER_DECLARED_SERVICE_NAME_PATTERN = exports.COMPUTER_DECLARED_SERVICE_HOST = exports.COMPUTER_DECLARED_SERVICE_PATH_MAX_LENGTH = exports.COMPUTER_DECLARED_SERVICE_NAME_MAX_LENGTH = void 0;
|
|
31
31
|
exports.normalizeComputerRefusalCode = normalizeComputerRefusalCode;
|
|
32
32
|
exports.isComputerPlatformRouteSession = isComputerPlatformRouteSession;
|
|
33
33
|
exports.computerTierOperations = computerTierOperations;
|
|
@@ -176,6 +176,14 @@ exports.DAEMON_COMPUTER_EVENTS = {
|
|
|
176
176
|
* `computer_declared_services_v1`.
|
|
177
177
|
*/
|
|
178
178
|
services: 'daemon:computer:services',
|
|
179
|
+
/**
|
|
180
|
+
* Read the tail of the daemon's OWN process log (a bounded, redacted copy of
|
|
181
|
+
* what its logger wrote since it started), for the owner who asks why their
|
|
182
|
+
* machine reconnected. Carries a `requestId` and the principal the API
|
|
183
|
+
* authorized (`observe`); the daemon checks the principal against the grant
|
|
184
|
+
* set it holds. Needs `computer_daemon_log_v1`.
|
|
185
|
+
*/
|
|
186
|
+
daemonLog: 'daemon:computer:log',
|
|
179
187
|
// daemon → API
|
|
180
188
|
/** The answer to any request that carried a `requestId`. */
|
|
181
189
|
ack: 'daemon:computer:ack',
|
|
@@ -336,6 +344,15 @@ exports.COMPUTER_CAPABILITIES = {
|
|
|
336
344
|
* browser; nothing is proxied to it. Announced by the relay that serves it.
|
|
337
345
|
*/
|
|
338
346
|
declaredServices: 'computer_declared_services_v1',
|
|
347
|
+
/**
|
|
348
|
+
* The daemon serves the tail of its own process log
|
|
349
|
+
* (`daemon:computer:log`): an in-memory ring of lines its logger
|
|
350
|
+
* wrote, redacted before they enter the ring, read at the `watch` tier. It
|
|
351
|
+
* is NOT syslog or the journal and never reads either. Announced by the relay
|
|
352
|
+
* that serves it; a personal machine's daemon announces it too and refuses
|
|
353
|
+
* the read `consent_missing` until `skrr computer allow`.
|
|
354
|
+
*/
|
|
355
|
+
daemonLog: 'computer_daemon_log_v1',
|
|
339
356
|
/**
|
|
340
357
|
* The page follows the controlling window (§6.2 "a stable viewport", §7.1,
|
|
341
358
|
* OSK-13808): a browser `viewport` input, sent only by the attachment that
|
|
@@ -1218,3 +1235,32 @@ function computerShowsDesktop(phase) {
|
|
|
1218
1235
|
function computerOffersPowerActions(machineKind) {
|
|
1219
1236
|
return machineKind === 'dedicated';
|
|
1220
1237
|
}
|
|
1238
|
+
// ---------------------------------------------------------------------------
|
|
1239
|
+
// The daemon's own log (`computer_daemon_log_v1`)
|
|
1240
|
+
// ---------------------------------------------------------------------------
|
|
1241
|
+
/**
|
|
1242
|
+
* Why the daemon's log is a wire feature at all: the tenant uid on a Dedicated
|
|
1243
|
+
* Runtime guest cannot read syslog or the journal, so an owner could not see
|
|
1244
|
+
* why their machine's daemon reconnected or failed. The daemon keeps the last
|
|
1245
|
+
* lines its OWN logger wrote in memory and serves them; it opens no file and no
|
|
1246
|
+
* system log for this.
|
|
1247
|
+
*/
|
|
1248
|
+
exports.COMPUTER_DAEMON_LOG_LEVELS = ['trace', 'debug', 'info', 'warn', 'error'];
|
|
1249
|
+
/** Every bound is the daemon's to enforce and the API's to validate against. */
|
|
1250
|
+
exports.COMPUTER_DAEMON_LOG_LIMITS = {
|
|
1251
|
+
/** Lines the daemon keeps in memory; older ones fall off the front. */
|
|
1252
|
+
ringLines: 2000,
|
|
1253
|
+
/** A line longer than this is cut and marked, never kept whole. */
|
|
1254
|
+
lineChars: 1000,
|
|
1255
|
+
/** Lines returned when the caller names none. */
|
|
1256
|
+
defaultLines: 100,
|
|
1257
|
+
/** The most lines one answer carries. */
|
|
1258
|
+
maxLines: 500,
|
|
1259
|
+
/** The most bytes (UTF-8) one answer's text carries; far under the 1 MiB SSE frame. */
|
|
1260
|
+
maxBytes: 192 * 1024,
|
|
1261
|
+
/** The longest look-back a `sinceMs` may ask for (24 h; the ring is shorter anyway). */
|
|
1262
|
+
maxSinceMs: 24 * 60 * 60 * 1000,
|
|
1263
|
+
/** Requests the daemon answers per `rateWindowMs`; one more is `rate_limited`. */
|
|
1264
|
+
rateMax: 30,
|
|
1265
|
+
rateWindowMs: 60 * 1000,
|
|
1266
|
+
};
|
|
@@ -151,6 +151,14 @@ export declare const DAEMON_COMPUTER_EVENTS: {
|
|
|
151
151
|
* `computer_declared_services_v1`.
|
|
152
152
|
*/
|
|
153
153
|
readonly services: "daemon:computer:services";
|
|
154
|
+
/**
|
|
155
|
+
* Read the tail of the daemon's OWN process log (a bounded, redacted copy of
|
|
156
|
+
* what its logger wrote since it started), for the owner who asks why their
|
|
157
|
+
* machine reconnected. Carries a `requestId` and the principal the API
|
|
158
|
+
* authorized (`observe`); the daemon checks the principal against the grant
|
|
159
|
+
* set it holds. Needs `computer_daemon_log_v1`.
|
|
160
|
+
*/
|
|
161
|
+
readonly daemonLog: "daemon:computer:log";
|
|
154
162
|
/** The answer to any request that carried a `requestId`. */
|
|
155
163
|
readonly ack: "daemon:computer:ack";
|
|
156
164
|
readonly manifest: "daemon:computer:manifest";
|
|
@@ -295,6 +303,15 @@ export declare const COMPUTER_CAPABILITIES: {
|
|
|
295
303
|
* browser; nothing is proxied to it. Announced by the relay that serves it.
|
|
296
304
|
*/
|
|
297
305
|
readonly declaredServices: "computer_declared_services_v1";
|
|
306
|
+
/**
|
|
307
|
+
* The daemon serves the tail of its own process log
|
|
308
|
+
* (`daemon:computer:log`): an in-memory ring of lines its logger
|
|
309
|
+
* wrote, redacted before they enter the ring, read at the `watch` tier. It
|
|
310
|
+
* is NOT syslog or the journal and never reads either. Announced by the relay
|
|
311
|
+
* that serves it; a personal machine's daemon announces it too and refuses
|
|
312
|
+
* the read `consent_missing` until `skrr computer allow`.
|
|
313
|
+
*/
|
|
314
|
+
readonly daemonLog: "computer_daemon_log_v1";
|
|
298
315
|
/**
|
|
299
316
|
* The page follows the controlling window (§6.2 "a stable viewport", §7.1,
|
|
300
317
|
* OSK-13808): a browser `viewport` input, sent only by the attachment that
|
|
@@ -1080,3 +1097,54 @@ export declare function computerPowerPhaseForLeaseState(state: unknown): Compute
|
|
|
1080
1097
|
export declare function computerShowsDesktop(phase: ComputerPowerPhase): boolean;
|
|
1081
1098
|
/** Power actions are offered for a Dedicated Runtime only; a personal machine has none (§18). */
|
|
1082
1099
|
export declare function computerOffersPowerActions(machineKind: ComputerMachineKind): boolean;
|
|
1100
|
+
/**
|
|
1101
|
+
* Why the daemon's log is a wire feature at all: the tenant uid on a Dedicated
|
|
1102
|
+
* Runtime guest cannot read syslog or the journal, so an owner could not see
|
|
1103
|
+
* why their machine's daemon reconnected or failed. The daemon keeps the last
|
|
1104
|
+
* lines its OWN logger wrote in memory and serves them; it opens no file and no
|
|
1105
|
+
* system log for this.
|
|
1106
|
+
*/
|
|
1107
|
+
export declare const COMPUTER_DAEMON_LOG_LEVELS: readonly ["trace", "debug", "info", "warn", "error"];
|
|
1108
|
+
export type ComputerDaemonLogLevel = (typeof COMPUTER_DAEMON_LOG_LEVELS)[number];
|
|
1109
|
+
/** Every bound is the daemon's to enforce and the API's to validate against. */
|
|
1110
|
+
export declare const COMPUTER_DAEMON_LOG_LIMITS: {
|
|
1111
|
+
/** Lines the daemon keeps in memory; older ones fall off the front. */
|
|
1112
|
+
readonly ringLines: 2000;
|
|
1113
|
+
/** A line longer than this is cut and marked, never kept whole. */
|
|
1114
|
+
readonly lineChars: 1000;
|
|
1115
|
+
/** Lines returned when the caller names none. */
|
|
1116
|
+
readonly defaultLines: 100;
|
|
1117
|
+
/** The most lines one answer carries. */
|
|
1118
|
+
readonly maxLines: 500;
|
|
1119
|
+
/** The most bytes (UTF-8) one answer's text carries; far under the 1 MiB SSE frame. */
|
|
1120
|
+
readonly maxBytes: number;
|
|
1121
|
+
/** The longest look-back a `sinceMs` may ask for (24 h; the ring is shorter anyway). */
|
|
1122
|
+
readonly maxSinceMs: number;
|
|
1123
|
+
/** Requests the daemon answers per `rateWindowMs`; one more is `rate_limited`. */
|
|
1124
|
+
readonly rateMax: 30;
|
|
1125
|
+
readonly rateWindowMs: number;
|
|
1126
|
+
};
|
|
1127
|
+
/** One line of the daemon's log as it leaves the daemon: redacted, time and level split out. */
|
|
1128
|
+
export interface ComputerDaemonLogLine {
|
|
1129
|
+
/** Epoch milliseconds the daemon wrote it. */
|
|
1130
|
+
at: number;
|
|
1131
|
+
level: ComputerDaemonLogLevel;
|
|
1132
|
+
text: string;
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* The answer to `daemon:computer:log`. `lines` are oldest first, at most
|
|
1136
|
+
* the asked number of the NEWEST that match. `truncated` is true when more
|
|
1137
|
+
* matched than were returned (by count or bytes); `ringFull` is true when the
|
|
1138
|
+
* ring has already dropped older lines, so "no line before this" does not mean
|
|
1139
|
+
* "the daemon logged nothing earlier". `startedAt` is the daemon process start:
|
|
1140
|
+
* a reconnect that restarted the daemon is visible as a new one.
|
|
1141
|
+
*/
|
|
1142
|
+
export interface ComputerDaemonLogResult {
|
|
1143
|
+
lines: ComputerDaemonLogLine[];
|
|
1144
|
+
startedAt: number;
|
|
1145
|
+
now: number;
|
|
1146
|
+
truncated: boolean;
|
|
1147
|
+
ringFull: boolean;
|
|
1148
|
+
/** Lines the redaction rewrote anywhere in the ring (a count, never content). */
|
|
1149
|
+
redactedLines: number;
|
|
1150
|
+
}
|
|
@@ -155,6 +155,14 @@ export const DAEMON_COMPUTER_EVENTS = {
|
|
|
155
155
|
* `computer_declared_services_v1`.
|
|
156
156
|
*/
|
|
157
157
|
services: 'daemon:computer:services',
|
|
158
|
+
/**
|
|
159
|
+
* Read the tail of the daemon's OWN process log (a bounded, redacted copy of
|
|
160
|
+
* what its logger wrote since it started), for the owner who asks why their
|
|
161
|
+
* machine reconnected. Carries a `requestId` and the principal the API
|
|
162
|
+
* authorized (`observe`); the daemon checks the principal against the grant
|
|
163
|
+
* set it holds. Needs `computer_daemon_log_v1`.
|
|
164
|
+
*/
|
|
165
|
+
daemonLog: 'daemon:computer:log',
|
|
158
166
|
// daemon → API
|
|
159
167
|
/** The answer to any request that carried a `requestId`. */
|
|
160
168
|
ack: 'daemon:computer:ack',
|
|
@@ -315,6 +323,15 @@ export const COMPUTER_CAPABILITIES = {
|
|
|
315
323
|
* browser; nothing is proxied to it. Announced by the relay that serves it.
|
|
316
324
|
*/
|
|
317
325
|
declaredServices: 'computer_declared_services_v1',
|
|
326
|
+
/**
|
|
327
|
+
* The daemon serves the tail of its own process log
|
|
328
|
+
* (`daemon:computer:log`): an in-memory ring of lines its logger
|
|
329
|
+
* wrote, redacted before they enter the ring, read at the `watch` tier. It
|
|
330
|
+
* is NOT syslog or the journal and never reads either. Announced by the relay
|
|
331
|
+
* that serves it; a personal machine's daemon announces it too and refuses
|
|
332
|
+
* the read `consent_missing` until `skrr computer allow`.
|
|
333
|
+
*/
|
|
334
|
+
daemonLog: 'computer_daemon_log_v1',
|
|
318
335
|
/**
|
|
319
336
|
* The page follows the controlling window (§6.2 "a stable viewport", §7.1,
|
|
320
337
|
* OSK-13808): a browser `viewport` input, sent only by the attachment that
|
|
@@ -1197,3 +1214,32 @@ export function computerShowsDesktop(phase) {
|
|
|
1197
1214
|
export function computerOffersPowerActions(machineKind) {
|
|
1198
1215
|
return machineKind === 'dedicated';
|
|
1199
1216
|
}
|
|
1217
|
+
// ---------------------------------------------------------------------------
|
|
1218
|
+
// The daemon's own log (`computer_daemon_log_v1`)
|
|
1219
|
+
// ---------------------------------------------------------------------------
|
|
1220
|
+
/**
|
|
1221
|
+
* Why the daemon's log is a wire feature at all: the tenant uid on a Dedicated
|
|
1222
|
+
* Runtime guest cannot read syslog or the journal, so an owner could not see
|
|
1223
|
+
* why their machine's daemon reconnected or failed. The daemon keeps the last
|
|
1224
|
+
* lines its OWN logger wrote in memory and serves them; it opens no file and no
|
|
1225
|
+
* system log for this.
|
|
1226
|
+
*/
|
|
1227
|
+
export const COMPUTER_DAEMON_LOG_LEVELS = ['trace', 'debug', 'info', 'warn', 'error'];
|
|
1228
|
+
/** Every bound is the daemon's to enforce and the API's to validate against. */
|
|
1229
|
+
export const COMPUTER_DAEMON_LOG_LIMITS = {
|
|
1230
|
+
/** Lines the daemon keeps in memory; older ones fall off the front. */
|
|
1231
|
+
ringLines: 2000,
|
|
1232
|
+
/** A line longer than this is cut and marked, never kept whole. */
|
|
1233
|
+
lineChars: 1000,
|
|
1234
|
+
/** Lines returned when the caller names none. */
|
|
1235
|
+
defaultLines: 100,
|
|
1236
|
+
/** The most lines one answer carries. */
|
|
1237
|
+
maxLines: 500,
|
|
1238
|
+
/** The most bytes (UTF-8) one answer's text carries; far under the 1 MiB SSE frame. */
|
|
1239
|
+
maxBytes: 192 * 1024,
|
|
1240
|
+
/** The longest look-back a `sinceMs` may ask for (24 h; the ring is shorter anyway). */
|
|
1241
|
+
maxSinceMs: 24 * 60 * 60 * 1000,
|
|
1242
|
+
/** Requests the daemon answers per `rateWindowMs`; one more is `rate_limited`. */
|
|
1243
|
+
rateMax: 30,
|
|
1244
|
+
rateWindowMs: 60 * 1000,
|
|
1245
|
+
};
|