@skrr-ai/cli 0.1.145 → 0.1.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-command.js +38 -21
- package/dist/commands/agenda/plan.d.ts +14 -0
- package/dist/commands/agenda/plan.js +29 -0
- package/dist/commands/agent/message/approve.js +5 -1
- package/dist/commands/agent/message/decline.js +5 -1
- package/dist/commands/agent/message/send.d.ts +11 -0
- package/dist/commands/agent/message/send.js +34 -8
- package/dist/commands/agent-worker.js +2 -1
- package/dist/commands/agents/activity.js +2 -1
- package/dist/commands/agents/always-on/enable.js +1 -1
- package/dist/commands/agents/badge.js +10 -5
- package/dist/commands/agents/categories/index.js +2 -1
- package/dist/commands/agents/chat.d.ts +1 -0
- package/dist/commands/agents/chat.js +29 -1
- package/dist/commands/agents/create.js +4 -1
- package/dist/commands/agents/overview.js +2 -1
- package/dist/commands/agents/releases/create.js +2 -1
- package/dist/commands/agents/schedule-overview.js +12 -11
- package/dist/commands/agents/schedule.js +2 -1
- package/dist/commands/agents/spawn.d.ts +38 -1
- package/dist/commands/agents/spawn.js +112 -9
- package/dist/commands/agents/tools/auth.js +2 -1
- package/dist/commands/agents/tools/calls.js +2 -1
- package/dist/commands/agents/triggers/fire.js +20 -0
- package/dist/commands/agents/visibility.js +2 -1
- package/dist/commands/balance/show.js +17 -2
- package/dist/commands/balance/statement.js +2 -1
- package/dist/commands/commands.js +2 -1
- package/dist/commands/commitments/create.js +2 -1
- package/dist/commands/commitments/delivery.js +2 -1
- package/dist/commands/commitments/doctor.js +2 -1
- package/dist/commands/commitments/observations.js +2 -2
- package/dist/commands/commitments/operating-review.js +2 -1
- package/dist/commands/commitments/pack/preflight.js +2 -1
- package/dist/commands/commitments/trigger-status.js +2 -1
- package/dist/commands/convos/messages.js +2 -1
- package/dist/commands/daemon/logs.js +18 -9
- package/dist/commands/daemon/usage.js +2 -1
- package/dist/commands/dm/messages.js +2 -1
- package/dist/commands/dm/thread/messages.js +2 -1
- package/dist/commands/dm/threads.js +2 -1
- package/dist/commands/doctor.js +2 -1
- package/dist/commands/goals/key-results/assess.js +2 -1
- package/dist/commands/goals/key-results/history.js +2 -1
- package/dist/commands/harnesses/forget.js +2 -1
- package/dist/commands/harnesses/show.js +12 -6
- package/dist/commands/inbox/index.js +4 -3
- package/dist/commands/initiatives/decide.js +2 -1
- package/dist/commands/instructions/diff.js +2 -1
- package/dist/commands/instructions/show.js +2 -1
- package/dist/commands/login.js +4 -2
- package/dist/commands/machines/dedicated/cp.js +2 -1
- package/dist/commands/machines/dedicated/power/set.js +2 -1
- package/dist/commands/machines/show.js +2 -1
- package/dist/commands/memory/maintain.js +2 -1
- package/dist/commands/memory/read.js +2 -1
- package/dist/commands/memory/rebuild-index.js +2 -1
- package/dist/commands/memory/rebuild.js +2 -1
- package/dist/commands/memory/search.js +2 -1
- package/dist/commands/messages/list.js +2 -1
- package/dist/commands/revoke-daemon.js +2 -1
- package/dist/commands/revoke-token.js +2 -1
- package/dist/commands/search/all.js +14 -7
- package/dist/commands/search/workspace.js +2 -1
- package/dist/commands/set-capabilities.js +2 -1
- package/dist/commands/skills/browse.js +8 -2
- package/dist/commands/spaces/auto-executor/preview.js +3 -2
- package/dist/commands/spaces/auto-executor/runs.js +4 -1
- package/dist/commands/spaces/workflow-templates/extract.d.ts +1 -0
- package/dist/commands/spaces/workflow-templates/extract.js +9 -1
- package/dist/commands/spaces/workflows/events.js +6 -3
- package/dist/commands/spaces/workflows/run.js +5 -3
- package/dist/commands/spaces/workflows/update.js +2 -1
- package/dist/commands/store/gallery-admissions/preview.js +2 -1
- package/dist/commands/store/publishers/profile/handle.js +2 -1
- package/dist/commands/tasks/comments/anchor.js +23 -9
- package/dist/commands/tasks/complete.js +4 -2
- package/dist/commands/tasks/create-tree.js +7 -3
- package/dist/commands/tasks/create.js +2 -1
- package/dist/commands/tasks/deliverable/add.js +2 -1
- package/dist/commands/tasks/deliverable/archive.js +2 -1
- package/dist/commands/tasks/deliverable/list.js +2 -1
- package/dist/commands/tasks/expectations/assess.js +2 -1
- package/dist/commands/tasks/labels/create.js +2 -1
- package/dist/commands/tasks/preflight.js +4 -2
- package/dist/commands/tasks/ready.js +2 -1
- package/dist/commands/tasks/result/submit.js +2 -1
- package/dist/commands/tasks/updates/add.js +2 -1
- package/dist/commands/tasks/wait.js +2 -1
- package/dist/commands/token/list.js +2 -1
- package/dist/commands/token/mint.js +2 -1
- package/dist/commands/triggers/audit.js +1 -1
- package/dist/commands/triggers/fire.js +19 -0
- package/dist/commands/wiki/write.js +14 -7
- package/dist/hooks/command-not-found.js +2 -1
- package/dist/lib/agent-chat-start.d.ts +77 -0
- package/dist/lib/agent-chat-start.js +169 -0
- package/dist/lib/agent-config.js +2 -1
- package/dist/lib/agent-endpoints.js +4 -2
- package/dist/lib/agent-evals.js +2 -1
- package/dist/lib/agent-guide-reference-gate.js +22 -11
- package/dist/lib/agent-guides.js +4 -1
- package/dist/lib/agent-instructions.js +5 -1
- package/dist/lib/agent-ref.js +8 -4
- package/dist/lib/agent-trigger-listing.js +2 -1
- package/dist/lib/agentic-stream.d.ts +21 -0
- package/dist/lib/agentic-stream.js +75 -6
- package/dist/lib/api-error-reason.js +2 -1
- package/dist/lib/api-fetch.js +5 -3
- package/dist/lib/appData.js +6 -6
- package/dist/lib/appInstallations.js +10 -5
- package/dist/lib/appsCheck.js +2 -1
- package/dist/lib/auth-failure.js +2 -1
- package/dist/lib/auth-storage.js +2 -1
- package/dist/lib/balance.js +6 -3
- package/dist/lib/capability-matrix.js +4 -2
- package/dist/lib/cli-runtime.js +2 -1
- package/dist/lib/code-handover.js +8 -3
- package/dist/lib/command-hygiene.js +28 -12
- package/dist/lib/command-manifest.js +6 -3
- package/dist/lib/commitment-attention-copy.js +2 -1
- package/dist/lib/commitment-event-wakes.js +9 -0
- package/dist/lib/commitment-product.js +5 -3
- package/dist/lib/commitment-terms.js +2 -1
- package/dist/lib/commitments.d.ts +8 -0
- package/dist/lib/commitments.js +8 -4
- package/dist/lib/compasses.js +2 -1
- package/dist/lib/completion-index.js +2 -1
- package/dist/lib/computer-files.js +8 -6
- package/dist/lib/config.js +11 -5
- package/dist/lib/conversation-search.js +4 -2
- package/dist/lib/daemon-installer.js +6 -2
- package/dist/lib/daemon-maintenance.js +2 -1
- package/dist/lib/daemon-ref.js +2 -1
- package/dist/lib/daemonBroker.js +6 -3
- package/dist/lib/daemonBrokerRefusal.js +4 -2
- package/dist/lib/daemonHandoff.js +14 -7
- package/dist/lib/daemonIslandProfile.js +2 -1
- package/dist/lib/dedicated-copy.js +9 -3
- package/dist/lib/dedicated-exec.js +2 -1
- package/dist/lib/dedicated-keep-awake.js +2 -1
- package/dist/lib/dedicated-machines.js +9 -5
- package/dist/lib/dedicated-service.js +2 -1
- package/dist/lib/dedicated-ssh.js +5 -3
- package/dist/lib/deployed-build.js +2 -1
- package/dist/lib/device-code.js +4 -3
- package/dist/lib/dpop-auth.js +2 -1
- package/dist/lib/earnings.js +2 -1
- package/dist/lib/exec-runtime-binary.js +5 -3
- package/dist/lib/first-party-harness-broker.js +4 -3
- package/dist/lib/first-party-harness-managed.js +2 -1
- package/dist/lib/first-party-harness-startup-update.js +8 -4
- package/dist/lib/first-party-harness-update.js +2 -1
- package/dist/lib/first-party-harness.js +2 -1
- package/dist/lib/format.d.ts +5 -0
- package/dist/lib/format.js +24 -4
- package/dist/lib/git-task.js +10 -5
- package/dist/lib/github-tools.js +6 -3
- package/dist/lib/harnesses.js +4 -2
- package/dist/lib/hosted-machines.js +2 -1
- package/dist/lib/html-text.js +33 -16
- package/dist/lib/instruction-blocks.js +2 -1
- package/dist/lib/iso-instant.js +5 -3
- package/dist/lib/keychain.js +15 -5
- package/dist/lib/label-scope.js +2 -1
- package/dist/lib/live-runtime-binary.js +10 -7
- package/dist/lib/local-skills.js +10 -6
- package/dist/lib/login.js +3 -2
- package/dist/lib/machine-audit.js +2 -1
- package/dist/lib/machine-daemon-log.js +2 -1
- package/dist/lib/machine-services.js +2 -1
- package/dist/lib/memory-history-session.js +2 -1
- package/dist/lib/memory-sync.js +6 -2
- package/dist/lib/message-intent.d.ts +10 -0
- package/dist/lib/node-adapter.js +4 -2
- package/dist/lib/northstars.js +4 -2
- package/dist/lib/oauthLogin.js +16 -7
- package/dist/lib/open-target.js +8 -4
- package/dist/lib/option-hint.js +2 -4
- package/dist/lib/outbox.js +2 -1
- package/dist/lib/planOutcome.d.ts +5 -3
- package/dist/lib/planOutcome.js +7 -4
- package/dist/lib/platform-update-local.js +2 -3
- package/dist/lib/proactiveApi.d.ts +38 -1
- package/dist/lib/proactiveApi.js +17 -1
- package/dist/lib/rate-limit-retry.js +2 -1
- package/dist/lib/reflection.js +2 -1
- package/dist/lib/request-field-flags.js +2 -1
- package/dist/lib/runtime-start-verification.js +2 -1
- package/dist/lib/schedule.d.ts +15 -0
- package/dist/lib/schedule.js +16 -1
- package/dist/lib/scoped-memory-command.js +7 -3
- package/dist/lib/search-display.js +11 -4
- package/dist/lib/skill-store-pagination.js +2 -1
- package/dist/lib/space-notebook.js +5 -3
- package/dist/lib/store-listing.js +2 -1
- package/dist/lib/task-agent-context-capabilities.js +2 -1
- package/dist/lib/task-asset-upload.js +7 -3
- package/dist/lib/task-closure.js +2 -1
- package/dist/lib/task-economics.js +2 -1
- package/dist/lib/task-execution.js +16 -8
- package/dist/lib/task-extras.js +4 -2
- package/dist/lib/task-operation-watch.js +2 -1
- package/dist/lib/task-preflight.js +3 -2
- package/dist/lib/task-recurrence-summary.js +4 -2
- package/dist/lib/task-runtime-headers.js +10 -5
- package/dist/lib/task-transcript.js +3 -2
- package/dist/lib/task-transfer.js +9 -5
- package/dist/lib/tasks.js +2 -1
- package/dist/lib/triggers.d.ts +144 -3
- package/dist/lib/triggers.js +280 -23
- package/dist/lib/update-check.js +12 -7
- package/dist/lib/usage-discovery.js +2 -1
- package/dist/lib/usd-micros.js +2 -1
- package/dist/lib/web-url.js +2 -1
- package/dist/lib/widgetCheck.js +15 -9
- package/dist/lib/widgetStaticScan.js +26 -14
- package/dist/lib/workflow-run-view.js +5 -3
- package/dist/lib/workflow-templates.d.ts +10 -0
- package/dist/lib/workflow-templates.js +47 -0
- package/dist/lib/write-target.js +4 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/authHelper.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +22 -12
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelope.js +7 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonConsentProof.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonPair.js +16 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopDaemonProof.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +11 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceKey.js +7 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dpop.js +8 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineReservation.js +8 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/kek/macos.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/liveState.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loginWithLocalhost.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loopbackHttp.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileStateDir.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/recoveryCode.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +3 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +6 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/restartArtifact.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.js +7 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/authHelper.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +27 -18
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.js +6 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelope.js +11 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +6 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonConsentProof.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonPair.js +20 -8
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +5 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopDaemonProof.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +11 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceKey.js +11 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dpop.js +12 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +5 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineReservation.js +10 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/kek/macos.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/liveState.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loginWithLocalhost.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loopbackHttp.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileStateDir.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/recoveryCode.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +3 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +6 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/restartArtifact.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.js +11 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +20520 -20130
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/loopback-server.js +4 -2
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +10 -6
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/loopback-server.js +4 -2
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +10 -6
- package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
- package/oclif.manifest.json +24 -2
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@ exports.deliveryInput = deliveryInput;
|
|
|
7
7
|
exports.renderExecutionReceipt = renderExecutionReceipt;
|
|
8
8
|
exports.renderExecutionReceiptQuarterlyMetrics = renderExecutionReceiptQuarterlyMetrics;
|
|
9
9
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
10
|
+
const DELIVERY_INPUT_RE = /-/g;
|
|
11
|
+
const RENDER_EXECUTION_RECEIPT_RE = /^[A-Za-z0-9_.:-]+$/;
|
|
10
12
|
exports.COMMITMENT_DELIVERY_CHOICES = [
|
|
11
13
|
'report-only',
|
|
12
14
|
'local-patch',
|
|
@@ -29,8 +31,8 @@ function normalizeTaskReviewPolicy(value) {
|
|
|
29
31
|
return value;
|
|
30
32
|
}
|
|
31
33
|
function deliveryInput(mode, options = {}) {
|
|
32
|
-
const normalized = mode.replace(
|
|
33
|
-
if (!exports.COMMITMENT_DELIVERY_CHOICES.some((choice) => choice.replace(
|
|
34
|
+
const normalized = mode.replace(DELIVERY_INPUT_RE, '_');
|
|
35
|
+
if (!exports.COMMITMENT_DELIVERY_CHOICES.some((choice) => choice.replace(DELIVERY_INPUT_RE, '_') === normalized)) {
|
|
34
36
|
throw new Error(`Unknown delivery. Choose ${exports.COMMITMENT_DELIVERY_CHOICES.join(', ')}.`);
|
|
35
37
|
}
|
|
36
38
|
return {
|
|
@@ -66,7 +68,7 @@ function renderExecutionReceipt(receipt, log, verbose = false) {
|
|
|
66
68
|
// there) is not an action either: the actor is printed alone.
|
|
67
69
|
const narrative = [receipt.summary, receipt.blocker?.summary].filter(Boolean);
|
|
68
70
|
const reason = receipt.nextActor?.reason;
|
|
69
|
-
const action = reason && !narrative.includes(reason) &&
|
|
71
|
+
const action = reason && !narrative.includes(reason) && !RENDER_EXECUTION_RECEIPT_RE.test(reason.trim())
|
|
70
72
|
? reason
|
|
71
73
|
: '';
|
|
72
74
|
if (receipt.nextActor)
|
|
@@ -24,6 +24,7 @@ exports.appendUnique = appendUnique;
|
|
|
24
24
|
exports.removeByKey = removeByKey;
|
|
25
25
|
exports.renderCommitmentTerms = renderCommitmentTerms;
|
|
26
26
|
const commitments_1 = require("./commitments");
|
|
27
|
+
const PARSE_SENSOR_REF_RE = /^(trigger|ingress):(.+)$/;
|
|
27
28
|
/**
|
|
28
29
|
* Parse a sensor reference. Accepts `ingress:<id>` / `trigger:<id>`, or a bare
|
|
29
30
|
* id which is treated as an ingress — the common case, and the server rejects a
|
|
@@ -33,7 +34,7 @@ function parseSensorRef(input) {
|
|
|
33
34
|
const raw = String(input || '').trim();
|
|
34
35
|
if (!raw)
|
|
35
36
|
throw new Error('Sensor reference is empty.');
|
|
36
|
-
const match =
|
|
37
|
+
const match = PARSE_SENSOR_REF_RE.exec(raw);
|
|
37
38
|
if (match) {
|
|
38
39
|
return { kind: match[1], refId: match[2] };
|
|
39
40
|
}
|
|
@@ -732,6 +732,14 @@ export type EventWakeCapabilities = {
|
|
|
732
732
|
impact?: string;
|
|
733
733
|
}[];
|
|
734
734
|
degradedReason?: string;
|
|
735
|
+
/** What the author selected through `config.events`, and which selections were set aside (OSK-22600). */
|
|
736
|
+
selectedEvents?: {
|
|
737
|
+
source?: string;
|
|
738
|
+
event?: string | null;
|
|
739
|
+
verdict?: 'can_wake' | 'set_aside';
|
|
740
|
+
reason?: string;
|
|
741
|
+
detail?: string;
|
|
742
|
+
}[];
|
|
735
743
|
};
|
|
736
744
|
/** Shape of `GET /:id/wake-capabilities`. */
|
|
737
745
|
export interface CommitmentWakeCapabilities {
|
package/dist/lib/commitments.js
CHANGED
|
@@ -95,6 +95,10 @@ const commitment_attention_copy_1 = require("./commitment-attention-copy");
|
|
|
95
95
|
const instruction_input_1 = require("./instruction-input");
|
|
96
96
|
const format_1 = require("./format");
|
|
97
97
|
const triggers_1 = require("./triggers");
|
|
98
|
+
const PARSE_INTERVAL_TO_MS_RE = /^\d+(\.\d+)?$/;
|
|
99
|
+
const DESCRIBE_EVIDENCE_HEALTH_RE = /_indeterminate$/;
|
|
100
|
+
const STANDSTILL_FIX_FOR_READ_RE = /^[A-Za-z0-9_-]{1,80}$/;
|
|
101
|
+
const DESCRIBE_OPERATION_RE = /^lifecycle_([a-z_]+)$/;
|
|
98
102
|
/** Derived from the installed compatibility vocabulary so the CLI remains
|
|
99
103
|
* safe even while data-provider and CLI packages roll out separately. */
|
|
100
104
|
exports.COMMITMENT_AUTHORABLE_CADENCE_MODES = data_provider_2.COMMITMENT_CADENCE_MODES.filter((mode) => mode !== 'sampled');
|
|
@@ -660,7 +664,7 @@ function parseIntervalToMs(input) {
|
|
|
660
664
|
if (!raw)
|
|
661
665
|
throw new Error('Empty interval. Use a form like "15m", "6h", "1d", or "360".');
|
|
662
666
|
let minutes;
|
|
663
|
-
if (
|
|
667
|
+
if (PARSE_INTERVAL_TO_MS_RE.test(raw)) {
|
|
664
668
|
minutes = Number(raw);
|
|
665
669
|
}
|
|
666
670
|
else {
|
|
@@ -832,7 +836,7 @@ function describeEvidenceHealth(health, criteriaCount) {
|
|
|
832
836
|
// The coarse `*_indeterminate` reasons ride alongside a precise one and say
|
|
833
837
|
// only "something was indeterminate", so showing them crowds out the reason
|
|
834
838
|
// that names what to do.
|
|
835
|
-
const reasons = (health?.reasons || []).filter((r) =>
|
|
839
|
+
const reasons = (health?.reasons || []).filter((r) => !DESCRIBE_EVIDENCE_HEALTH_RE.test(r));
|
|
836
840
|
const detail = reasons.length ? ` (${reasons.join(', ')})` : '';
|
|
837
841
|
if (state === 'unevidenceable_criteria') {
|
|
838
842
|
// This is not the same problem as criteria that exist but cannot be
|
|
@@ -1104,7 +1108,7 @@ function standstillFixForRead(standstill, commitmentId) {
|
|
|
1104
1108
|
if (!(0, data_provider_2.isLegacyStandstillReason)(standstill.reason))
|
|
1105
1109
|
return standstill.fix;
|
|
1106
1110
|
const fix = (0, data_provider_2.describeStandstill)(standstill.reason).fix ?? undefined;
|
|
1107
|
-
if (!fix || !commitmentId ||
|
|
1111
|
+
if (!fix || !commitmentId || !STANDSTILL_FIX_FOR_READ_RE.test(commitmentId))
|
|
1108
1112
|
return fix;
|
|
1109
1113
|
return fix.split('<commitment>').join(commitmentId);
|
|
1110
1114
|
}
|
|
@@ -1184,7 +1188,7 @@ function describeOperation(operation, reason) {
|
|
|
1184
1188
|
// while `show` said `ready` seconds later (OSK-21105).
|
|
1185
1189
|
if (reason === 'operation_read_unavailable')
|
|
1186
1190
|
return 'not read yet — no status is recorded for the current contract, which is not a failure; `skrr commitments show` reads it live';
|
|
1187
|
-
const lifecycle = typeof reason === 'string' ?
|
|
1191
|
+
const lifecycle = typeof reason === 'string' ? DESCRIBE_OPERATION_RE.exec(reason) : null;
|
|
1188
1192
|
if (!lifecycle) {
|
|
1189
1193
|
const words = operationReasonWords(reason);
|
|
1190
1194
|
return `${operation ?? 'blocked'}${reason ? ` — ${reason}${words ? `: ${words}` : ''}` : ''}`;
|
package/dist/lib/compasses.js
CHANGED
|
@@ -37,6 +37,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
37
37
|
const data_provider_2 = require("@skrr-ai/data-provider");
|
|
38
38
|
const format_1 = require("./format");
|
|
39
39
|
const triggers_1 = require("./triggers");
|
|
40
|
+
const RENDER_COMPASS_TRACE_RE = /_/g;
|
|
40
41
|
exports.COMPASS_STATUSES = ['active', 'archived'];
|
|
41
42
|
const base = (id) => `/api/compasses/${encodeURIComponent(id)}`;
|
|
42
43
|
exports.compassApi = {
|
|
@@ -351,7 +352,7 @@ function renderCompassTrace(trace, log) {
|
|
|
351
352
|
}
|
|
352
353
|
(0, format_1.renderTable)(trace.events.map((event) => ({
|
|
353
354
|
when: shortDate(event.occurredAt),
|
|
354
|
-
type: event.type.replace(
|
|
355
|
+
type: event.type.replace(RENDER_COMPASS_TRACE_RE, ' '),
|
|
355
356
|
status: event.status ?? '—',
|
|
356
357
|
event: event.summary ?? '—',
|
|
357
358
|
commitment: String(event.references?.commitmentId ?? '—'),
|
|
@@ -42,6 +42,7 @@ exports.completionCandidates = completionCandidates;
|
|
|
42
42
|
const fs = __importStar(require("node:fs/promises"));
|
|
43
43
|
const path = __importStar(require("node:path"));
|
|
44
44
|
const node_crypto_1 = require("node:crypto");
|
|
45
|
+
const CREATE_COMPLETION_CACHE_SCOPE_RE = /\/+$/;
|
|
45
46
|
const INDEX_VERSION = 1;
|
|
46
47
|
const CACHE_VERSION = 2;
|
|
47
48
|
/** Bind references to the command's resolved context, never a stored login. */
|
|
@@ -52,7 +53,7 @@ function createCompletionCacheScope(context) {
|
|
|
52
53
|
const hash = (value) => (0, node_crypto_1.createHash)('sha256').update(value).digest('hex');
|
|
53
54
|
// The adapter appends API paths to the full request base. Preserve deployment
|
|
54
55
|
// prefixes, queries and fragments; normalize its trailing-slash handling.
|
|
55
|
-
const requestBase = new URL(context.baseURL.replace(
|
|
56
|
+
const requestBase = new URL(context.baseURL.replace(CREATE_COMPLETION_CACHE_SCOPE_RE, '')).href;
|
|
56
57
|
return {
|
|
57
58
|
namespace: hash(JSON.stringify([
|
|
58
59
|
path.resolve(context.configRoot), context.profile,
|
|
@@ -67,6 +67,8 @@ const base_command_1 = require("../base-command");
|
|
|
67
67
|
const api_fetch_1 = require("./api-fetch");
|
|
68
68
|
const dedicated_machines_1 = require("./dedicated-machines");
|
|
69
69
|
const dedicated_file_retry_1 = require("./dedicated-file-retry");
|
|
70
|
+
const PARSE_COMPUTER_FILE_TAG_RE = /^\d+$/;
|
|
71
|
+
const DESCRIBE_COMPUTER_FILE_REFUSAL_RE = /path|file|folder|directory/i;
|
|
70
72
|
/**
|
|
71
73
|
* The lease could not say which generation is running — a server that does not
|
|
72
74
|
* publish it yet, or a lease with none. File calls cannot be fenced without
|
|
@@ -371,10 +373,10 @@ function parseComputerFileTag(text) {
|
|
|
371
373
|
}
|
|
372
374
|
const parts = trimmed.split(':');
|
|
373
375
|
if ((parts.length === 3 || parts.length === 4) &&
|
|
374
|
-
|
|
375
|
-
|
|
376
|
+
PARSE_COMPUTER_FILE_TAG_RE.test(parts[0]) &&
|
|
377
|
+
PARSE_COMPUTER_FILE_TAG_RE.test(parts[1]) &&
|
|
376
378
|
Number.isSafeInteger(Number(parts[1])) &&
|
|
377
|
-
|
|
379
|
+
PARSE_COMPUTER_FILE_TAG_RE.test(parts[2]) &&
|
|
378
380
|
(parts.length === 3 || CONTENTS_TAG.test(parts[3]))) {
|
|
379
381
|
return {
|
|
380
382
|
inode: parts[0],
|
|
@@ -397,12 +399,12 @@ function entityTagOf(tag) {
|
|
|
397
399
|
function isEntityTag(value) {
|
|
398
400
|
const tag = value;
|
|
399
401
|
return (typeof tag?.inode === 'string' &&
|
|
400
|
-
|
|
402
|
+
PARSE_COMPUTER_FILE_TAG_RE.test(tag.inode) &&
|
|
401
403
|
typeof tag?.size === 'number' &&
|
|
402
404
|
Number.isSafeInteger(tag.size) &&
|
|
403
405
|
tag.size >= 0 &&
|
|
404
406
|
typeof tag?.mtimeNs === 'string' &&
|
|
405
|
-
|
|
407
|
+
PARSE_COMPUTER_FILE_TAG_RE.test(tag.mtimeNs) &&
|
|
406
408
|
(tag.contents === undefined ||
|
|
407
409
|
(typeof tag.contents === 'string' && CONTENTS_TAG.test(tag.contents))));
|
|
408
410
|
}
|
|
@@ -617,7 +619,7 @@ function describeComputerFileRefusal(refusal, ctx) {
|
|
|
617
619
|
case 'not_found': {
|
|
618
620
|
// `details.path` marks a path refusal; without it the machine itself was
|
|
619
621
|
// not found — "No computer exists by that machine id."
|
|
620
|
-
if (refusal.details?.path ||
|
|
622
|
+
if (refusal.details?.path || DESCRIBE_COMPUTER_FILE_REFUSAL_RE.test(refusal.message)) {
|
|
621
623
|
return `${refusal.message} Look with \`${bin} machines dedicated ls ${lease} <dir>\`.`;
|
|
622
624
|
}
|
|
623
625
|
return `${refusal.message} List your machines with \`${bin} machines dedicated list\`.`;
|
package/dist/lib/config.js
CHANGED
|
@@ -60,6 +60,10 @@ const auth_diagnostics_1 = require("./auth-diagnostics");
|
|
|
60
60
|
const cli_id_1 = require("./cli-id");
|
|
61
61
|
const device_id_1 = require("./device-id");
|
|
62
62
|
const publicEndpoints_generated_1 = require("./publicEndpoints.generated");
|
|
63
|
+
const ENVIRONMENT_FOR_BASE_URL_RE = /\/+$/;
|
|
64
|
+
const CANONICALIZE_KNOWN_BASE_URL_RE = /^http:\/\//;
|
|
65
|
+
const CANONICALIZE_KNOWN_BASE_URL_RE_2 = /^https:\/\/www\./;
|
|
66
|
+
const ENV_OVERLAY_VALUE_RE = /^OVERSKY_/;
|
|
63
67
|
// Both from config/public-endpoints.json, the one domain contract, rather than a
|
|
64
68
|
// fourth hand-copied pair. The CLI previously knew only about dev — there was no
|
|
65
69
|
// prod constant at all — which matters more here than it looks: baseURL decides
|
|
@@ -90,7 +94,9 @@ exports.ENVIRONMENT_BASE_URLS = {
|
|
|
90
94
|
};
|
|
91
95
|
/** Which deployment a base URL denotes, or null for a self-hosted server. */
|
|
92
96
|
function environmentForBaseURL(value) {
|
|
93
|
-
const normalized = canonicalizeKnownBaseURL(value)
|
|
97
|
+
const normalized = canonicalizeKnownBaseURL(value)
|
|
98
|
+
.replace(ENVIRONMENT_FOR_BASE_URL_RE, '')
|
|
99
|
+
.toLowerCase();
|
|
94
100
|
for (const [name, url] of Object.entries(exports.ENVIRONMENT_BASE_URLS)) {
|
|
95
101
|
if (normalized === url.toLowerCase())
|
|
96
102
|
return name;
|
|
@@ -124,11 +130,11 @@ function describeDeployment(baseURL) {
|
|
|
124
130
|
return env ? `${env} (${baseURL})` : baseURL;
|
|
125
131
|
}
|
|
126
132
|
function canonicalizeKnownBaseURL(value) {
|
|
127
|
-
const trimmed = value.trim().replace(
|
|
128
|
-
const normalized = trimmed.toLowerCase().replace(
|
|
133
|
+
const trimmed = value.trim().replace(ENVIRONMENT_FOR_BASE_URL_RE, '');
|
|
134
|
+
const normalized = trimmed.toLowerCase().replace(CANONICALIZE_KNOWN_BASE_URL_RE, 'https://');
|
|
129
135
|
if (normalized === exports.LEGACY_DEV_BASE_URL)
|
|
130
136
|
return exports.CANONICAL_DEV_BASE_URL;
|
|
131
|
-
const withoutWww = normalized.replace(
|
|
137
|
+
const withoutWww = normalized.replace(CANONICALIZE_KNOWN_BASE_URL_RE_2, 'https://');
|
|
132
138
|
// Checked after `www.` is stripped, so `https://www.oversky.ai` folds too.
|
|
133
139
|
if (withoutWww === exports.LEGACY_PROD_BASE_URL)
|
|
134
140
|
return exports.CANONICAL_PROD_BASE_URL;
|
|
@@ -201,7 +207,7 @@ const ENV_VAR = {
|
|
|
201
207
|
let warnedEnvPrefixConflict = false;
|
|
202
208
|
function envOverlayValue(key) {
|
|
203
209
|
const legacyName = ENV_VAR[key];
|
|
204
|
-
const renamedName = legacyName.replace(
|
|
210
|
+
const renamedName = legacyName.replace(ENV_OVERLAY_VALUE_RE, 'SKRR_');
|
|
205
211
|
const legacy = process.env[legacyName]?.trim();
|
|
206
212
|
const renamed = process.env[renamedName]?.trim();
|
|
207
213
|
if (legacy && renamed && legacy !== renamed && !warnedEnvPrefixConflict) {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizedSnippetLength = normalizedSnippetLength;
|
|
4
4
|
exports.compactMessageSearchHit = compactMessageSearchHit;
|
|
5
|
+
const FIND_QUERY_MATCH_RE = /[^\p{L}\p{N}]+/u;
|
|
6
|
+
const COMPACT_MESSAGE_SEARCH_HIT_RE = /\s+/g;
|
|
5
7
|
const MAX_SEARCH_SNIPPET_CHARS = 4000;
|
|
6
8
|
function normalizedSnippetLength(value) {
|
|
7
9
|
if (!Number.isFinite(value))
|
|
@@ -21,7 +23,7 @@ function findQueryMatch(text, query) {
|
|
|
21
23
|
// present, center on the earliest substantive query token so the bounded CLI
|
|
22
24
|
// result still explains why it matched instead of truncating just before the
|
|
23
25
|
// highlighted word returned by the server crop.
|
|
24
|
-
const tokens = Array.from(new Set(normalizedQuery.split(
|
|
26
|
+
const tokens = Array.from(new Set(normalizedQuery.split(FIND_QUERY_MATCH_RE).filter((token) => token.length >= 2)));
|
|
25
27
|
let best = null;
|
|
26
28
|
for (const token of tokens) {
|
|
27
29
|
const at = loweredText.indexOf(token);
|
|
@@ -34,7 +36,7 @@ function findQueryMatch(text, query) {
|
|
|
34
36
|
function compactMessageSearchHit(message, requestedSnippetLength, query = '') {
|
|
35
37
|
const limit = normalizedSnippetLength(requestedSnippetLength);
|
|
36
38
|
const normalizedText = String(message.text ?? '')
|
|
37
|
-
.replace(
|
|
39
|
+
.replace(COMPACT_MESSAGE_SEARCH_HIT_RE, ' ')
|
|
38
40
|
.trim();
|
|
39
41
|
const normalizedQuery = query.trim();
|
|
40
42
|
let text = normalizedText;
|
|
@@ -63,6 +63,8 @@ const node_os_1 = __importDefault(require("node:os"));
|
|
|
63
63
|
const node_path_1 = __importDefault(require("node:path"));
|
|
64
64
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
65
65
|
Object.defineProperty(exports, "isTrustedArtifactOrigin", { enumerable: true, get: function () { return auth_core_1.isTrustedArtifactOrigin; } });
|
|
66
|
+
const DAEMON_FEED_BASE_RE = /\/+$/;
|
|
67
|
+
const GET_BYTES_WITH_TIMEOUT_RE = /^\d+$/;
|
|
66
68
|
/** Public CloudFront feed. Mirrors the daemon's own `CLOUDFRONT_FEED_BASE`. */
|
|
67
69
|
exports.DEFAULT_DAEMON_FEED_BASE = 'https://updates.skrr.ai/daemon';
|
|
68
70
|
/** Same override the daemon honours, so one env var steers both. */
|
|
@@ -74,7 +76,7 @@ const MAX_ARTIFACT_BYTES = 256 * 1_024 * 1_024;
|
|
|
74
76
|
const MANIFEST_TIMEOUT_MS = 30_000;
|
|
75
77
|
const ARTIFACT_TIMEOUT_MS = 10 * 60_000;
|
|
76
78
|
function daemonFeedBase(env = process.env) {
|
|
77
|
-
return (env[exports.DAEMON_FEED_BASE_ENV]?.trim() || exports.DEFAULT_DAEMON_FEED_BASE).replace(
|
|
79
|
+
return (env[exports.DAEMON_FEED_BASE_ENV]?.trim() || exports.DEFAULT_DAEMON_FEED_BASE).replace(DAEMON_FEED_BASE_RE, '');
|
|
78
80
|
}
|
|
79
81
|
/**
|
|
80
82
|
* Where the fetched binary lands. `exec-runtime-binary.ts` already looks here, so a
|
|
@@ -158,7 +160,9 @@ async function getBytesWithTimeout(url, timeoutMs, maxBytes, fetchImpl, signal)
|
|
|
158
160
|
if (!response.ok)
|
|
159
161
|
throw new Error(`returned HTTP ${response.status}`);
|
|
160
162
|
const contentLength = response.headers.get('content-length');
|
|
161
|
-
if (contentLength &&
|
|
163
|
+
if (contentLength &&
|
|
164
|
+
GET_BYTES_WITH_TIMEOUT_RE.test(contentLength.trim()) &&
|
|
165
|
+
Number(contentLength) > maxBytes) {
|
|
162
166
|
throw new DownloadSizeLimitError(maxBytes);
|
|
163
167
|
}
|
|
164
168
|
if (!response.body)
|
|
@@ -22,6 +22,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
22
22
|
const format_1 = require("./format");
|
|
23
23
|
const hosted_machines_1 = require("./hosted-machines");
|
|
24
24
|
const machines_1 = require("./machines");
|
|
25
|
+
const NORMALIZE_SPACES_RE = /\s+/g;
|
|
25
26
|
/**
|
|
26
27
|
* daemon-maintenance.ts — the owner's pause on one of their own machines, from the
|
|
27
28
|
* terminal (`skrr daemon maintenance status | hold | resume | attest`; OSK-19107,
|
|
@@ -709,7 +710,7 @@ async function runStatus(input, io) {
|
|
|
709
710
|
};
|
|
710
711
|
}
|
|
711
712
|
function normalizeSpaces(text) {
|
|
712
|
-
return text.replace(
|
|
713
|
+
return text.replace(NORMALIZE_SPACES_RE, ' ').trim();
|
|
713
714
|
}
|
|
714
715
|
/**
|
|
715
716
|
* `hold`: take the hold, and optionally wait for the machine to be ready.
|
package/dist/lib/daemon-ref.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.formatDaemonRef = formatDaemonRef;
|
|
21
21
|
exports.normalizeDaemonRef = normalizeDaemonRef;
|
|
22
|
+
const NORMALIZE_DAEMON_REF_RE = /(?:\.{3}|…)$/;
|
|
22
23
|
/** Prefix the short form carries so a truncated id is visibly truncated. */
|
|
23
24
|
const DISPLAY_PREFIX = 'd_';
|
|
24
25
|
/**
|
|
@@ -42,6 +43,6 @@ function normalizeDaemonRef(input) {
|
|
|
42
43
|
let out = input.trim();
|
|
43
44
|
if (out.toLowerCase().startsWith(DISPLAY_PREFIX))
|
|
44
45
|
out = out.slice(DISPLAY_PREFIX.length);
|
|
45
|
-
out = out.replace(
|
|
46
|
+
out = out.replace(NORMALIZE_DAEMON_REF_RE, '');
|
|
46
47
|
return out.trim();
|
|
47
48
|
}
|
package/dist/lib/daemonBroker.js
CHANGED
|
@@ -108,6 +108,9 @@ const harness_context_1 = require("./harness-context");
|
|
|
108
108
|
const cli_identity_1 = require("./cli-identity");
|
|
109
109
|
const daemonRestartWait_1 = require("./daemonRestartWait");
|
|
110
110
|
const keychain_1 = require("./keychain");
|
|
111
|
+
const NORMALIZE_BASE_URL_RE = /\/+$/;
|
|
112
|
+
const RESOLVE_PROFILE_BOOTSTRAP_PATHS_RE = /^daemon-island\.(?!default\.json$)[^.]+\.json$/;
|
|
113
|
+
const ADOPTION_LOCK_PATH_RE = /[^A-Za-z0-9._-]/g;
|
|
111
114
|
const REQUEST_TIMEOUT_MS = 20_000;
|
|
112
115
|
/**
|
|
113
116
|
* Normalize a base URL for equality comparison. Mirrors the daemon-side
|
|
@@ -118,7 +121,7 @@ const REQUEST_TIMEOUT_MS = 20_000;
|
|
|
118
121
|
function normalizeBaseUrl(u) {
|
|
119
122
|
if (typeof u !== 'string' || u.length === 0)
|
|
120
123
|
return null;
|
|
121
|
-
const trimmed = u.trim().replace(
|
|
124
|
+
const trimmed = u.trim().replace(NORMALIZE_BASE_URL_RE, '');
|
|
122
125
|
if (trimmed.length === 0)
|
|
123
126
|
return null;
|
|
124
127
|
try {
|
|
@@ -160,7 +163,7 @@ function resolveBootstrapPath(profile = 'default') {
|
|
|
160
163
|
/** Build deterministic non-default bootstrap paths from a daemon config directory. */
|
|
161
164
|
function resolveProfileBootstrapPaths(primary, entryNames) {
|
|
162
165
|
const extras = entryNames
|
|
163
|
-
.filter((name) =>
|
|
166
|
+
.filter((name) => RESOLVE_PROFILE_BOOTSTRAP_PATHS_RE.test(name))
|
|
164
167
|
.sort()
|
|
165
168
|
.map((name) => path.join(path.dirname(primary), name));
|
|
166
169
|
return [primary, ...extras];
|
|
@@ -1280,7 +1283,7 @@ function daemonDidNotAnswer(failure) {
|
|
|
1280
1283
|
}
|
|
1281
1284
|
/** The adoption lock: one per config root and profile. */
|
|
1282
1285
|
function adoptionLockPath(profile) {
|
|
1283
|
-
const safe = profile.replace(
|
|
1286
|
+
const safe = profile.replace(ADOPTION_LOCK_PATH_RE, '_') || 'default';
|
|
1284
1287
|
return path.join((0, config_1.configRoot)(), `cli-session-adopt.${safe}.lock`);
|
|
1285
1288
|
}
|
|
1286
1289
|
function storedAccessToken(baseURL) {
|
|
@@ -6,6 +6,8 @@ exports.describeGuestDaemonUnavailable = describeGuestDaemonUnavailable;
|
|
|
6
6
|
exports.describeLocalDaemonUnavailable = describeLocalDaemonUnavailable;
|
|
7
7
|
exports.describeBrokerFailure = describeBrokerFailure;
|
|
8
8
|
const daemon_command_hint_1 = require("./daemon-command-hint");
|
|
9
|
+
const SENTENCE_RE = /[.!?]$/;
|
|
10
|
+
const DESCRIBE_LOCAL_DAEMON_UNAVAILABLE_RE = /[.]$/;
|
|
9
11
|
/**
|
|
10
12
|
* True when a daemon ANSWERED the hand-off and refused it — as opposed to no
|
|
11
13
|
* daemon being there to ask (`no_bootstrap`, a stale descriptor nobody listens
|
|
@@ -54,7 +56,7 @@ function sentence(detail) {
|
|
|
54
56
|
const d = (detail ?? '').trim();
|
|
55
57
|
if (!d)
|
|
56
58
|
return '';
|
|
57
|
-
return
|
|
59
|
+
return SENTENCE_RE.test(d) ? ` ${d}` : ` ${d}.`;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* Describe a broker failure for a person, or null when there is nothing to
|
|
@@ -254,7 +256,7 @@ function describeLocalDaemonUnavailable(failure, bin = 'skrr') {
|
|
|
254
256
|
else if (failure.reason === 'bootstrap_parse' ||
|
|
255
257
|
failure.descriptorState === 'unreadable' ||
|
|
256
258
|
failure.descriptorState === 'invalid') {
|
|
257
|
-
headline = `${who} is not available: its sign-in hand-off${where} could not be read${failure.detail ? ` (${failure.detail.replace(
|
|
259
|
+
headline = `${who} is not available: its sign-in hand-off${where} could not be read${failure.detail ? ` (${failure.detail.replace(DESCRIBE_LOCAL_DAEMON_UNAVAILABLE_RE, '')})` : ''}.`;
|
|
258
260
|
}
|
|
259
261
|
else if (failure.descriptorState === 'dead_pid') {
|
|
260
262
|
headline =
|
|
@@ -11,6 +11,13 @@ const dedicated_service_1 = require("./dedicated-service");
|
|
|
11
11
|
const exec_runtime_binary_1 = require("./exec-runtime-binary");
|
|
12
12
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
13
13
|
const keychain_1 = require("./keychain");
|
|
14
|
+
const WINDOWS_SHIM_RE = /\.(cmd|bat)$/i;
|
|
15
|
+
const PARSE_ID_PROVENANCE_RE = /id-source=([A-Za-z0-9._:-]+)/;
|
|
16
|
+
const PARSE_ID_PROVENANCE_RE_2 = /machine-uuid=([A-Za-z0-9._:-]+)/;
|
|
17
|
+
const PARSE_ID_PROVENANCE_RE_3 = /server=(\S+)/;
|
|
18
|
+
const CANONICAL_SERVER_RE = /\/+$/;
|
|
19
|
+
const FIRST_MEANINGFUL_LINE_RE = /^[{}]/;
|
|
20
|
+
const CHECK_LOCAL_DAEMON_MACHINE_IDENTITY_RE = /unknown command/i;
|
|
14
21
|
/**
|
|
15
22
|
* Ceilings, not expectations. Both calls finish in milliseconds when anything is
|
|
16
23
|
* working; these exist so that when something is NOT working the login ends.
|
|
@@ -39,7 +46,7 @@ function runOversky(binary, args, opts) {
|
|
|
39
46
|
// failed on EVERY Windows login and reported it as the daemon refusing the
|
|
40
47
|
// bundle. Restricted to the shim case so real binaries keep the argv-array
|
|
41
48
|
// exec path, which needs no quoting rules to be right.
|
|
42
|
-
const isWinShim = process.platform === 'win32' &&
|
|
49
|
+
const isWinShim = process.platform === 'win32' && WINDOWS_SHIM_RE.test(binary);
|
|
43
50
|
const child = (0, node_child_process_1.spawn)(binary, (0, exec_runtime_binary_1.normalizeRuntimeGlobalArgs)(args), {
|
|
44
51
|
// stderr is CAPTURED, not discarded. Discarding it cost a debugging cycle
|
|
45
52
|
// on the first real run: the daemon exited non-zero with
|
|
@@ -118,11 +125,11 @@ function parseIdProvenance(stderr) {
|
|
|
118
125
|
const line = stderr.split('\n').find((l) => l.includes('skrrd:accept-handoff'));
|
|
119
126
|
if (!line)
|
|
120
127
|
return {};
|
|
121
|
-
const idSource =
|
|
122
|
-
const machineUuid =
|
|
128
|
+
const idSource = PARSE_ID_PROVENANCE_RE.exec(line)?.[1];
|
|
129
|
+
const machineUuid = PARSE_ID_PROVENANCE_RE_2.exec(line)?.[1];
|
|
123
130
|
// Any non-space run: this one is a URL, and a URL contains characters the
|
|
124
131
|
// other two never do.
|
|
125
|
-
const daemonServer =
|
|
132
|
+
const daemonServer = PARSE_ID_PROVENANCE_RE_3.exec(line)?.[1];
|
|
126
133
|
return { idSource, machineUuid, daemonServer };
|
|
127
134
|
}
|
|
128
135
|
/**
|
|
@@ -161,7 +168,7 @@ function describeDelivery(opts) {
|
|
|
161
168
|
* is the fold the rest of the CLI already compares through.
|
|
162
169
|
*/
|
|
163
170
|
function canonicalServer(url) {
|
|
164
|
-
return (0, config_1.canonicalizeKnownBaseURL)(url).trim().replace(
|
|
171
|
+
return (0, config_1.canonicalizeKnownBaseURL)(url).trim().replace(CANONICAL_SERVER_RE, '').toLowerCase();
|
|
165
172
|
}
|
|
166
173
|
/** The most useful line of a failure, so a remedy can name the cause. */
|
|
167
174
|
function firstMeaningfulLine(text) {
|
|
@@ -170,7 +177,7 @@ function firstMeaningfulLine(text) {
|
|
|
170
177
|
.map((l) => l.trim())
|
|
171
178
|
.find((l) => l &&
|
|
172
179
|
!l.startsWith('at ') &&
|
|
173
|
-
|
|
180
|
+
!FIRST_MEANINGFUL_LINE_RE.test(l) &&
|
|
174
181
|
// The provenance line is a protocol between these two programs, not a
|
|
175
182
|
// diagnosis. Reporting it as one would answer "why did this fail?" with
|
|
176
183
|
// a machine's own bookkeeping.
|
|
@@ -413,7 +420,7 @@ async function checkLocalDaemonMachineIdentity(profile, binary = (0, exec_runtim
|
|
|
413
420
|
if (!printed.ok) {
|
|
414
421
|
// A daemon too old to have `accept-handoff` answers "unknown command": it is
|
|
415
422
|
// older than per-profile identities too, which is the skew itself.
|
|
416
|
-
if (
|
|
423
|
+
if (CHECK_LOCAL_DAEMON_MACHINE_IDENTITY_RE.test(printed.stderr)) {
|
|
417
424
|
return (0, daemon_machine_identity_1.daemonMachineIdentitySkew)({ profile, binary, reported: null });
|
|
418
425
|
}
|
|
419
426
|
// Any other failed probe says nothing about the daemon's identity, and
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.bootstrapDescriptorProfile = bootstrapDescriptorProfile;
|
|
7
7
|
const node_os_1 = __importDefault(require("node:os"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const BOOTSTRAP_DESCRIPTOR_PROFILE_RE = /^daemon-island\.([^.]+)\.json$/;
|
|
9
10
|
/**
|
|
10
11
|
* The daemon profile an island descriptor belongs to, read from its path, or
|
|
11
12
|
* null when the path names none (a Dedicated Runtime or Hosted Machine hand-off
|
|
@@ -28,7 +29,7 @@ function bootstrapDescriptorProfile(descriptorPath) {
|
|
|
28
29
|
if (!descriptorPath)
|
|
29
30
|
return null;
|
|
30
31
|
const base = node_path_1.default.basename(descriptorPath);
|
|
31
|
-
const named =
|
|
32
|
+
const named = BOOTSTRAP_DESCRIPTOR_PROFILE_RE.exec(base);
|
|
32
33
|
if (named)
|
|
33
34
|
return named[1];
|
|
34
35
|
if (base !== 'daemon-island.json')
|
|
@@ -15,6 +15,10 @@ const node_path_1 = require("node:path");
|
|
|
15
15
|
const computer_files_1 = require("./computer-files");
|
|
16
16
|
const dedicated_file_retry_1 = require("./dedicated-file-retry");
|
|
17
17
|
const dedicated_machines_1 = require("./dedicated-machines");
|
|
18
|
+
const NAMES_REMOTE_DIRECTORY_RE = /(^|\/)\.?$/;
|
|
19
|
+
const INTO_REMOTE_DIRECTORY_RE = /\/\.?$/;
|
|
20
|
+
const INTO_REMOTE_DIRECTORY_RE_2 = /^\.$/;
|
|
21
|
+
const STAT_DESTINATION_RE = /path|file|folder|directory/i;
|
|
18
22
|
/**
|
|
19
23
|
* A refusal the CLI makes itself, with the code the server uses for the same
|
|
20
24
|
* cause. A file over the limit, a file that changed and a file that is missing
|
|
@@ -133,11 +137,13 @@ function isContinuousIntegration(env = process.env) {
|
|
|
133
137
|
}
|
|
134
138
|
/** `dir/`, `dir/.` or `.`: a machine path that names a directory to copy into. */
|
|
135
139
|
function namesRemoteDirectory(remotePath) {
|
|
136
|
-
return
|
|
140
|
+
return NAMES_REMOTE_DIRECTORY_RE.test(remotePath);
|
|
137
141
|
}
|
|
138
142
|
/** `name` inside the machine directory `directory`, however it was spelled. */
|
|
139
143
|
function intoRemoteDirectory(directory, name) {
|
|
140
|
-
const parent = directory
|
|
144
|
+
const parent = directory
|
|
145
|
+
.replace(INTO_REMOTE_DIRECTORY_RE, '')
|
|
146
|
+
.replace(INTO_REMOTE_DIRECTORY_RE_2, '');
|
|
141
147
|
return parent ? `${parent}/${name}` : name;
|
|
142
148
|
}
|
|
143
149
|
/**
|
|
@@ -155,7 +161,7 @@ async function statDestination(statPath, leaseId, remotePath, generation, scope,
|
|
|
155
161
|
// `details.path` (or a path-shaped message) marks a missing PATH; without
|
|
156
162
|
// it the machine itself was not found, which is not a destination to create.
|
|
157
163
|
if (refusal?.code === 'not_found' &&
|
|
158
|
-
(refusal.details?.path !== undefined ||
|
|
164
|
+
(refusal.details?.path !== undefined || STAT_DESTINATION_RE.test(refusal.message))) {
|
|
159
165
|
return { kind: 'absent' };
|
|
160
166
|
}
|
|
161
167
|
throw err;
|
|
@@ -8,6 +8,7 @@ exports.describeTruncation = describeTruncation;
|
|
|
8
8
|
const node_crypto_1 = require("node:crypto");
|
|
9
9
|
const api_fetch_1 = require("./api-fetch");
|
|
10
10
|
const dedicated_machines_1 = require("./dedicated-machines");
|
|
11
|
+
const IS_UNANSWERED_REQUEST_RE = /fetch failed|socket hang up|network|terminated|other side closed/i;
|
|
11
12
|
/**
|
|
12
13
|
* `skrr machines dedicated exec`, as a start and a series of short observations
|
|
13
14
|
* (OSK-8705).
|
|
@@ -143,7 +144,7 @@ function isUnansweredRequest(err) {
|
|
|
143
144
|
if (['ECONNRESET', 'ECONNREFUSED', 'ETIMEDOUT', 'EPIPE', 'ENOTFOUND', 'EAI_AGAIN'].includes(code)) {
|
|
144
145
|
return true;
|
|
145
146
|
}
|
|
146
|
-
return
|
|
147
|
+
return IS_UNANSWERED_REQUEST_RE.test(e.message || '');
|
|
147
148
|
}
|
|
148
149
|
function backoff(attempt) {
|
|
149
150
|
return Math.min(1000 * 2 ** Math.max(0, attempt - 1), MAX_BACKOFF_MS);
|
|
@@ -10,6 +10,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
10
10
|
const api_fetch_1 = require("./api-fetch");
|
|
11
11
|
const format_1 = require("./format");
|
|
12
12
|
const dedicated_machines_1 = require("./dedicated-machines");
|
|
13
|
+
const PARSE_KEEP_AWAKE_DURATION_RE = /^(\d+)\s*(m|h|d)?$/i;
|
|
13
14
|
/**
|
|
14
15
|
* Domain lib for `skrr machines dedicated power keep-awake` (K1). Keep-awake is a
|
|
15
16
|
* temporary override that forbids AUTOMATIC stop; it never starts the machine.
|
|
@@ -31,7 +32,7 @@ function clearDedicatedKeepAwake(leaseId, scope = {}) {
|
|
|
31
32
|
* minutes (the unit the API speaks). Returns minutes, or throws a plain message.
|
|
32
33
|
*/
|
|
33
34
|
function parseKeepAwakeDuration(value) {
|
|
34
|
-
const match = value.trim().match(
|
|
35
|
+
const match = value.trim().match(PARSE_KEEP_AWAKE_DURATION_RE);
|
|
35
36
|
if (!match) {
|
|
36
37
|
throw new Error(`Invalid --for value "${value}". Use a number with m, h or d, such as 90m, 2h or 3d.`);
|
|
37
38
|
}
|
|
@@ -61,6 +61,10 @@ const machine_spend_cap_1 = require("./machine-spend-cap");
|
|
|
61
61
|
const web_url_1 = require("./web-url");
|
|
62
62
|
const edge_error_page_1 = require("./edge-error-page");
|
|
63
63
|
const harnesses_1 = require("./harnesses");
|
|
64
|
+
const VERSION_PARTS_RE = /^v?(\d+)\.(\d+)\.(\d+)/;
|
|
65
|
+
const IS_DEDICATED_REPOSITORY_REF_RE = /^(?:https?:\/\/)?(?:github\.com\/)?[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+?(?:\.git)?$/i;
|
|
66
|
+
const FORMAT_INVOICE_AMOUNT_RE = /^[A-Z]{3}$/;
|
|
67
|
+
const DEDICATED_DELETION_LINES_RE = /^unless /;
|
|
64
68
|
exports.DEDICATED_LEASE_ACTIONS = [
|
|
65
69
|
'start',
|
|
66
70
|
'stop',
|
|
@@ -82,7 +86,7 @@ function describeDedicatedCheckpoint(lease) {
|
|
|
82
86
|
return (0, data_provider_1.describeMachineCheckpointOutcome)(operation.checkpoint, { action: operation.action });
|
|
83
87
|
}
|
|
84
88
|
function versionParts(version) {
|
|
85
|
-
const match =
|
|
89
|
+
const match = VERSION_PARTS_RE.exec(String(version || '').trim());
|
|
86
90
|
return match ? match.slice(1, 4).map(Number) : null;
|
|
87
91
|
}
|
|
88
92
|
/** -1 / 0 / 1, or null when either side is not a version. */
|
|
@@ -238,7 +242,7 @@ function dedicatedRuntimeCreateInput(input) {
|
|
|
238
242
|
* billable request is sent.
|
|
239
243
|
*/
|
|
240
244
|
function isDedicatedRepositoryRef(value) {
|
|
241
|
-
return
|
|
245
|
+
return IS_DEDICATED_REPOSITORY_REF_RE.test(value.trim());
|
|
242
246
|
}
|
|
243
247
|
// Takes the finished path rather than composing one from a suffix, so the route
|
|
244
248
|
// each call reaches is a literal at the call site. `cli/src/__tests__/helpers/
|
|
@@ -910,7 +914,7 @@ const LEGACY_DELETION_REMEDY_TEXT = {
|
|
|
910
914
|
/** An invoice's amount in its own currency, from Stripe's minor units. */
|
|
911
915
|
function formatInvoiceAmount(amountDue, currency) {
|
|
912
916
|
const code = String(currency || '').toUpperCase();
|
|
913
|
-
if (
|
|
917
|
+
if (!FORMAT_INVOICE_AMOUNT_RE.test(code) || !Number.isSafeInteger(amountDue))
|
|
914
918
|
return null;
|
|
915
919
|
try {
|
|
916
920
|
const format = new Intl.NumberFormat('en-US', { style: 'currency', currency: code });
|
|
@@ -1014,7 +1018,7 @@ function dedicatedDeletionLines(lease, now = new Date()) {
|
|
|
1014
1018
|
// Until its files are about to be deleted, clearing the cause still stops it.
|
|
1015
1019
|
remedyApplies = plan.cancellable === true;
|
|
1016
1020
|
lines.push(remedyApplies
|
|
1017
|
-
? `workspace is being deleted — not too late: it stops, with every file kept, ${remedy.clause.replace(
|
|
1021
|
+
? `workspace is being deleted — not too late: it stops, with every file kept, ${remedy.clause.replace(DEDICATED_DELETION_LINES_RE, 'if ')}`
|
|
1018
1022
|
: 'workspace is being deleted');
|
|
1019
1023
|
}
|
|
1020
1024
|
else if (plan.status === 'scheduled') {
|
|
@@ -1023,7 +1027,7 @@ function dedicatedDeletionLines(lease, now = new Date()) {
|
|
|
1023
1027
|
}
|
|
1024
1028
|
else {
|
|
1025
1029
|
remedyApplies = true;
|
|
1026
|
-
lines.push(`files kept until at least ${formatDedicatedDeadline(plan.retentionEndsAt, now)}; no deletion date until a deletion notice reaches your email, then at least ${plan.noticeFloorDays || 30} days; no deletion at all ${remedy.clause.replace(
|
|
1030
|
+
lines.push(`files kept until at least ${formatDedicatedDeadline(plan.retentionEndsAt, now)}; no deletion date until a deletion notice reaches your email, then at least ${plan.noticeFloorDays || 30} days; no deletion at all ${remedy.clause.replace(DEDICATED_DELETION_LINES_RE, 'if ')}`);
|
|
1027
1031
|
}
|
|
1028
1032
|
if (remedyApplies)
|
|
1029
1033
|
lines.push(...remedy.lines);
|
|
@@ -28,6 +28,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
28
28
|
const agentic_stream_1 = require("./agentic-stream");
|
|
29
29
|
const dpop_auth_1 = require("./dpop-auth");
|
|
30
30
|
const format_1 = require("./format");
|
|
31
|
+
const CALL_EVENT_RE = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
31
32
|
/**
|
|
32
33
|
* Declared services on a Dedicated Runtime — the CLI half of
|
|
33
34
|
* docs/architecture/dedicated-runtime-always-on-workloads-2026-09-21.md (§5.3
|
|
@@ -545,7 +546,7 @@ class DedicatedServiceChannel {
|
|
|
545
546
|
// socket response can be inspected or replayed without a second effect.
|
|
546
547
|
// Other verbs retain their historical per-call id generation.
|
|
547
548
|
const supplied = payload.requestId;
|
|
548
|
-
const requestId = typeof supplied === 'string' &&
|
|
549
|
+
const requestId = typeof supplied === 'string' && CALL_EVENT_RE.test(supplied)
|
|
549
550
|
? supplied
|
|
550
551
|
: `svc-${(0, node_crypto_1.randomUUID)()}`;
|
|
551
552
|
return new Promise((resolve, reject) => {
|