@skrr-ai/cli 0.1.146 → 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/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/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 +3 -1
- package/dist/commands/agents/schedule.js +2 -1
- package/dist/commands/agents/spawn.js +9 -6
- package/dist/commands/agents/tools/auth.js +2 -1
- package/dist/commands/agents/tools/calls.js +2 -1
- 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/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.js +8 -5
- 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.js +8 -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/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.js +2 -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 +15 -0
- package/dist/lib/triggers.js +32 -3
- 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 +20519 -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 +17 -2
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ const node_fs_1 = require("node:fs");
|
|
|
10
10
|
const core_1 = require("@oclif/core");
|
|
11
11
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
12
12
|
const base_command_1 = require("../../base-command");
|
|
13
|
+
const PARSE_RELEASE_DEPENDENCIES_RE = /^(skill|action):([^@]+)@(store_release_[A-Za-z0-9_-]+)$/;
|
|
13
14
|
/**
|
|
14
15
|
* `--capability-rationale <permission-key>=<note>` → the publisher notes a
|
|
15
16
|
* release carries beside its capability manifest. Split on the FIRST `=`, so a
|
|
@@ -39,7 +40,7 @@ function parseReleaseDependencies(entries) {
|
|
|
39
40
|
return {};
|
|
40
41
|
const dependencies = [];
|
|
41
42
|
for (const entry of entries) {
|
|
42
|
-
const match =
|
|
43
|
+
const match = PARSE_RELEASE_DEPENDENCIES_RE.exec(entry);
|
|
43
44
|
if (!match) {
|
|
44
45
|
return {
|
|
45
46
|
error: `--dependency expects skill:<id>@<store-release-id> or action:<id>@<store-release-id>, got "${entry}".`,
|
|
@@ -68,6 +68,14 @@ function renderSessionBillingAccount(target, balance, log, bin = 'skrr') {
|
|
|
68
68
|
else {
|
|
69
69
|
for (const line of (0, balance_1.workspaceBalanceLines)(balance))
|
|
70
70
|
log(line);
|
|
71
|
+
// The workspace view is the one that decides whether a session can start, and it printed
|
|
72
|
+
// Held with no account of it at all. Held is reservations, not spend: a running agent turn
|
|
73
|
+
// reserves its maximum cost up front, and one that ended unsettled stays held (OSK-22651).
|
|
74
|
+
if (balance.heldMicros > 0) {
|
|
75
|
+
log(' Held is reserved for hosted sessions, including turns that ended without settling; ' +
|
|
76
|
+
`\`${bin} balance statement --workspace ${target.workspaceId}\` lists the \`hold\` and ` +
|
|
77
|
+
'`exception` entries.');
|
|
78
|
+
}
|
|
71
79
|
if (balance.availableMicros <= 0) {
|
|
72
80
|
log(' WARNING: nothing available — managed sessions billed here are refused for credit, ' +
|
|
73
81
|
'whatever your personal balance below says.');
|
|
@@ -224,8 +232,15 @@ class BalanceShow extends base_command_1.BaseCommand {
|
|
|
224
232
|
// printed in dollars only, so it read as a different quantity from the
|
|
225
233
|
// Credits above it (OSK-4827).
|
|
226
234
|
this.log(` Held: ${(0, balance_1.formatCreditsWithUsd)(balance.heldMicros)}`);
|
|
227
|
-
|
|
228
|
-
|
|
235
|
+
// Not all of it is "in flight". A running hosted agent turn reserves its maximum cost
|
|
236
|
+
// up front and settles for what it used; one that ends without settling expires into an
|
|
237
|
+
// `exception` and stays held until billing releases it (OSK-22651). Saying "in flight"
|
|
238
|
+
// for all of it made a frozen reservation read as a session that was still running.
|
|
239
|
+
this.log(' (reserved for hosted sessions: a running agent turn reserves');
|
|
240
|
+
this.log(' its maximum cost up front and settles for what it used; one');
|
|
241
|
+
this.log(' that ends without settling stays held until billing releases');
|
|
242
|
+
this.log(' it. See the `hold` and `exception` entries in');
|
|
243
|
+
this.log(' `skrr balance statement`)');
|
|
229
244
|
}
|
|
230
245
|
if (balance.balanceSource === 'legacy') {
|
|
231
246
|
// The unified account is missing for this user, so the figure above is
|
|
@@ -11,6 +11,7 @@ const base_command_1 = require("../../base-command");
|
|
|
11
11
|
const format_1 = require("../../lib/format");
|
|
12
12
|
const harness_provider_input_1 = require("../../lib/harness-provider-input");
|
|
13
13
|
const balance_1 = require("../../lib/balance");
|
|
14
|
+
const IS_OWNER_ONLY_REFUSAL_RE = /owner/i;
|
|
14
15
|
/**
|
|
15
16
|
* The canonical stored-value ledger — what a charge was FOR, and what incurred it.
|
|
16
17
|
*
|
|
@@ -289,7 +290,7 @@ function isOwnerOnlyRefusal(err) {
|
|
|
289
290
|
return false;
|
|
290
291
|
try {
|
|
291
292
|
const body = JSON.parse(e.body ?? '');
|
|
292
|
-
return typeof body.error === 'string' &&
|
|
293
|
+
return typeof body.error === 'string' && IS_OWNER_ONLY_REFUSAL_RE.test(body.error);
|
|
293
294
|
}
|
|
294
295
|
catch {
|
|
295
296
|
return false;
|
|
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const base_command_1 = require("../base-command");
|
|
5
5
|
const command_manifest_1 = require("../lib/command-manifest");
|
|
6
6
|
const command_hygiene_1 = require("../lib/command-hygiene");
|
|
7
|
+
const RUN_RE = /:/g;
|
|
7
8
|
class Commands extends base_command_1.BaseCommand {
|
|
8
9
|
static description = 'List skrr commands or print a machine-readable command schema';
|
|
9
10
|
static examples = [
|
|
@@ -101,7 +102,7 @@ class Commands extends base_command_1.BaseCommand {
|
|
|
101
102
|
}
|
|
102
103
|
const payload = {
|
|
103
104
|
id: key,
|
|
104
|
-
command: key.replace(
|
|
105
|
+
command: key.replace(RUN_RE, ' '),
|
|
105
106
|
description: command.description ?? '',
|
|
106
107
|
aliases: command.aliases ?? [],
|
|
107
108
|
args: command.args ?? {},
|
|
@@ -15,6 +15,7 @@ const commitment_attention_copy_1 = require("../../lib/commitment-attention-copy
|
|
|
15
15
|
const triggers_1 = require("../../lib/triggers");
|
|
16
16
|
const commitment_product_1 = require("../../lib/commitment-product");
|
|
17
17
|
const commitments_1 = require("../../lib/commitments");
|
|
18
|
+
const COMMITMENT_ACTIVATION_REFUSAL_RE = /^[A-Za-z][A-Za-z0-9_]*$/;
|
|
18
19
|
const DEFAULT_EVENT_DRIVEN_BACKSTOP_MS = 24 * 60 * 60 * 1000;
|
|
19
20
|
const DEFAULT_EVENT_SOURCES = new Set(['github', 'slack', 'email', 'calendar']);
|
|
20
21
|
/**
|
|
@@ -212,7 +213,7 @@ function commitmentActivationRefusal(err, { id, bin }) {
|
|
|
212
213
|
const blockers = activationBlockers(refusal.body);
|
|
213
214
|
const errorField = refusal.body?.error;
|
|
214
215
|
const code = refusal.code ||
|
|
215
|
-
(typeof errorField === 'string' &&
|
|
216
|
+
(typeof errorField === 'string' && COMMITMENT_ACTIVATION_REFUSAL_RE.test(errorField)
|
|
216
217
|
? errorField
|
|
217
218
|
: undefined) ||
|
|
218
219
|
'COMMITMENT_ACTIVATION_REFUSED';
|
|
@@ -6,6 +6,7 @@ const base_command_1 = require("../../base-command");
|
|
|
6
6
|
const commitments_1 = require("../../lib/commitments");
|
|
7
7
|
const commitment_product_1 = require("../../lib/commitment-product");
|
|
8
8
|
const web_url_1 = require("../../lib/web-url");
|
|
9
|
+
const MODULE_RE = /-/g;
|
|
9
10
|
class CommitmentsDelivery extends base_command_1.BaseCommand {
|
|
10
11
|
static description = 'Declare the destination for Commitment work';
|
|
11
12
|
static examples = [
|
|
@@ -19,7 +20,7 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
|
|
|
19
20
|
description: 'Delivery destination.',
|
|
20
21
|
options: [
|
|
21
22
|
...commitment_product_1.COMMITMENT_DELIVERY_CHOICES,
|
|
22
|
-
...commitment_product_1.COMMITMENT_DELIVERY_CHOICES.map((mode) => mode.replace(
|
|
23
|
+
...commitment_product_1.COMMITMENT_DELIVERY_CHOICES.map((mode) => mode.replace(MODULE_RE, '_')),
|
|
23
24
|
],
|
|
24
25
|
}),
|
|
25
26
|
};
|
|
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
7
7
|
const base_command_1 = require("../../base-command");
|
|
8
8
|
const commitments_1 = require("../../lib/commitments");
|
|
9
|
+
const DOCTOR_VERDICT_RE = /^status_([a-z_]+)$/;
|
|
9
10
|
function doctorVerdict(input) {
|
|
10
11
|
const commitment = input.commitment || {};
|
|
11
12
|
const preflight = input.preflight || {};
|
|
@@ -14,7 +15,7 @@ function doctorVerdict(input) {
|
|
|
14
15
|
if (blocker?.code) {
|
|
15
16
|
// A lifecycle stop is a state, not a fault: a Commitment its owner paused is `paused`, with the
|
|
16
17
|
// way back as its next step, not `blocked` (OSK-15423).
|
|
17
|
-
const lifecycle =
|
|
18
|
+
const lifecycle = DOCTOR_VERDICT_RE.exec(String(blocker.code));
|
|
18
19
|
return {
|
|
19
20
|
verdict: lifecycle ? lifecycle[1] : blocker.code === 'deleted' ? 'deleted' : 'blocked',
|
|
20
21
|
// A typed blocker carries no remedy, only what happened (OSK-16230).
|
|
@@ -6,10 +6,10 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
7
7
|
const base_command_1 = require("../../base-command");
|
|
8
8
|
const commitments_1 = require("../../lib/commitments");
|
|
9
|
+
const TIMESTAMP_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
9
10
|
/** Explicit ISO FROM/TO intervals avoid local-time or rolling-window ambiguity. */
|
|
10
11
|
function parseObservationWindow(value) {
|
|
11
12
|
const parts = value.split('/');
|
|
12
|
-
const timestamp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
13
13
|
const [from, to] = parts.map((entry) => new Date(entry).getTime());
|
|
14
14
|
const realCalendarDay = (part) => {
|
|
15
15
|
const day = part.slice(0, 10);
|
|
@@ -17,7 +17,7 @@ function parseObservationWindow(value) {
|
|
|
17
17
|
return Number.isFinite(parsed.getTime()) && parsed.toISOString().slice(0, 10) === day;
|
|
18
18
|
};
|
|
19
19
|
if (parts.length !== 2 ||
|
|
20
|
-
!parts.every((part) =>
|
|
20
|
+
!parts.every((part) => TIMESTAMP_RE.test(part) && realCalendarDay(part)) ||
|
|
21
21
|
!Number.isFinite(from) ||
|
|
22
22
|
!Number.isFinite(to) ||
|
|
23
23
|
to <= from ||
|
|
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const base_command_1 = require("../../base-command");
|
|
7
7
|
const commitment_loop_status_1 = require("../../lib/commitment-loop-status");
|
|
8
8
|
const commitments_1 = require("../../lib/commitments");
|
|
9
|
+
const RUN_RE = /^obj_/;
|
|
9
10
|
/** What each silent loop is for, in the owner's terms rather than the role key. */
|
|
10
11
|
const ROLE_PURPOSE = {
|
|
11
12
|
conversation_continuity: 'remembers what we are working on',
|
|
@@ -124,7 +125,7 @@ class CommitmentsOperatingReview extends base_command_1.BaseCommand {
|
|
|
124
125
|
this.requireAuth();
|
|
125
126
|
const { args, flags } = await this.parse(CommitmentsOperatingReview);
|
|
126
127
|
// A Commitment id here answered "Agent not found" without saying an Agent id was wanted.
|
|
127
|
-
if (
|
|
128
|
+
if (RUN_RE.test(args.agentId)) {
|
|
128
129
|
this.error(`${args.agentId} is a Commitment id; operating-review takes an Agent id. ` +
|
|
129
130
|
`Use \`skrr commitments status ${args.agentId}\` for one Commitment.`, { exit: 1 });
|
|
130
131
|
}
|
|
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const base_command_1 = require("../../../base-command");
|
|
5
5
|
const commitments_1 = require("../../../lib/commitments");
|
|
6
6
|
const preflight_1 = require("../preflight");
|
|
7
|
+
const RUN_RE = /_/g;
|
|
7
8
|
/**
|
|
8
9
|
* Re-run a bound Pack's readiness probe and REWRITE its stored receipt.
|
|
9
10
|
*
|
|
@@ -52,7 +53,7 @@ class CommitmentsPackPreflight extends base_command_1.BaseCommand {
|
|
|
52
53
|
}
|
|
53
54
|
const receipt = result.preflight;
|
|
54
55
|
this.log(`Pack: ${result.pack?.id}@${result.pack?.version}`);
|
|
55
|
-
this.log(`Preflight: ${String(receipt?.verdict).replace(
|
|
56
|
+
this.log(`Preflight: ${String(receipt?.verdict).replace(RUN_RE, ' ')}`);
|
|
56
57
|
this.log(`Recorded: ${receipt?.at}`);
|
|
57
58
|
this.log('\nAdapters:');
|
|
58
59
|
for (const adapter of receipt?.adapterStatuses || []) {
|
|
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const commitments_1 = require("../../lib/commitments");
|
|
7
7
|
const commitment_event_wakes_1 = require("../../lib/commitment-event-wakes");
|
|
8
|
+
const FORMAT_TRIGGER_STATUS_RE = /\s+/g;
|
|
8
9
|
/**
|
|
9
10
|
* `skrr commitments trigger-status <id>` — what the SCHEDULER actually has.
|
|
10
11
|
*
|
|
@@ -88,7 +89,7 @@ function formatTriggerStatus(status) {
|
|
|
88
89
|
if (wake?.held) {
|
|
89
90
|
lines.push(`Wakes: HELD — ${wake.reason ?? 'blocked'}`);
|
|
90
91
|
if (wake.detail)
|
|
91
|
-
lines.push(` ${String(wake.detail).replace(
|
|
92
|
+
lines.push(` ${String(wake.detail).replace(FORMAT_TRIGGER_STATUS_RE, ' ').trim()}`);
|
|
92
93
|
}
|
|
93
94
|
const bindings = Array.isArray(status.bindings) ? status.bindings : [];
|
|
94
95
|
lines.push('');
|
|
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
6
|
const base_command_1 = require("../../base-command");
|
|
7
7
|
const message_content_1 = require("../../lib/message-content");
|
|
8
|
+
const FORMAT_MESSAGE_LINES_RE = /\s+/g;
|
|
8
9
|
/**
|
|
9
10
|
* The lines `skrr convos messages` prints for one message row.
|
|
10
11
|
*
|
|
@@ -24,7 +25,7 @@ function formatMessageLines(m, options = {}) {
|
|
|
24
25
|
// (OSK-4911). Whitespace is collapsed WITHIN a block for compactness; the
|
|
25
26
|
// blank line BETWEEN blocks is what the flattened `text` field dropped.
|
|
26
27
|
const body = (0, message_content_1.messageTextBlocks)(failure ? { ...m, text: failure.answer } : m)
|
|
27
|
-
.map((block) => block.replace(
|
|
28
|
+
.map((block) => block.replace(FORMAT_MESSAGE_LINES_RE, ' ').trim())
|
|
28
29
|
.join('\n\n');
|
|
29
30
|
const clipped = body.length > 300 ? `${body.slice(0, 300)}…` : body;
|
|
30
31
|
const lines = [`${when} ${who}${failure ? ' [failed]' : ''}`];
|
|
@@ -33,6 +33,15 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
33
33
|
const node_events_1 = require("node:events");
|
|
34
34
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
35
35
|
const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
|
|
36
|
+
const UNESCAPE_RE = /</g;
|
|
37
|
+
const UNESCAPE_RE_2 = />/g;
|
|
38
|
+
const UNESCAPE_RE_3 = /"/g;
|
|
39
|
+
const UNESCAPE_RE_4 = /'/g;
|
|
40
|
+
const UNESCAPE_RE_5 = /&/g;
|
|
41
|
+
const INSTALLED_SERVICE_LOG_DESTINATIONS_RE = /<key>\s*ProgramArguments\s*<\/key>\s*<array>([\s\S]*?)<\/array>/;
|
|
42
|
+
const INSTALLED_SERVICE_LOG_DESTINATIONS_RE_2 = /<string>([\s\S]*?)<\/string>/g;
|
|
43
|
+
const ESCAPE_RE = /[.*+?^${}()|[\]\\]/g;
|
|
44
|
+
const PARSE_RUNTIME_VERSION_RE = /(\d+)\.(\d+)\.(\d+)/;
|
|
36
45
|
const MAX_FALLBACK_LOG_BYTES = 1024 * 1024;
|
|
37
46
|
/**
|
|
38
47
|
* Older daemons already kept logs in this profile-scoped location, even
|
|
@@ -137,19 +146,19 @@ function installedServiceLogDestinations(profile, options = {}) {
|
|
|
137
146
|
return null;
|
|
138
147
|
}
|
|
139
148
|
const unescape = (v) => v
|
|
140
|
-
.replace(
|
|
141
|
-
.replace(
|
|
142
|
-
.replace(
|
|
143
|
-
.replace(
|
|
144
|
-
.replace(
|
|
149
|
+
.replace(UNESCAPE_RE, '<')
|
|
150
|
+
.replace(UNESCAPE_RE_2, '>')
|
|
151
|
+
.replace(UNESCAPE_RE_3, '"')
|
|
152
|
+
.replace(UNESCAPE_RE_4, "'")
|
|
153
|
+
.replace(UNESCAPE_RE_5, '&');
|
|
145
154
|
const stringFor = (key) => {
|
|
146
155
|
const m = new RegExp(`<key>\\s*${key}\\s*</key>\\s*<string>([\\s\\S]*?)</string>`).exec(xml);
|
|
147
156
|
return m?.[1]?.trim() ? unescape(m[1].trim()) : null;
|
|
148
157
|
};
|
|
149
158
|
let logFile = null;
|
|
150
|
-
const array =
|
|
159
|
+
const array = INSTALLED_SERVICE_LOG_DESTINATIONS_RE.exec(xml);
|
|
151
160
|
if (array?.[1]) {
|
|
152
|
-
const args = [...array[1].matchAll(
|
|
161
|
+
const args = [...array[1].matchAll(INSTALLED_SERVICE_LOG_DESTINATIONS_RE_2)].map((m) => unescape(m[1].trim()));
|
|
153
162
|
const at = args.lastIndexOf('--log-file');
|
|
154
163
|
if (at >= 0 && args[at + 1] && !args[at + 1].startsWith('-'))
|
|
155
164
|
logFile = args[at + 1];
|
|
@@ -260,7 +269,7 @@ function rotatedLogSiblings(filePath, readdir = (dir) => (0, node_fs_1.readdirSy
|
|
|
260
269
|
const dir = node_path_1.default.dirname(filePath);
|
|
261
270
|
const ext = node_path_1.default.extname(filePath);
|
|
262
271
|
const base = node_path_1.default.basename(filePath, ext);
|
|
263
|
-
const escape = (text) => text.replace(
|
|
272
|
+
const escape = (text) => text.replace(ESCAPE_RE, '\\$&');
|
|
264
273
|
const pattern = new RegExp(`^${escape(base)}\\.(\\d+)${escape(ext)}$`);
|
|
265
274
|
let names;
|
|
266
275
|
try {
|
|
@@ -427,7 +436,7 @@ async function streamLogFiles(files, out) {
|
|
|
427
436
|
}
|
|
428
437
|
/** `x.y.z` from a version string, or null. A prerelease suffix is ignored. */
|
|
429
438
|
function parseRuntimeVersion(text) {
|
|
430
|
-
const m =
|
|
439
|
+
const m = PARSE_RUNTIME_VERSION_RE.exec(text);
|
|
431
440
|
return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;
|
|
432
441
|
}
|
|
433
442
|
/** Whether `version` is at least `floor`; null when either is not a version. */
|
|
@@ -8,9 +8,10 @@ const core_1 = require("@oclif/core");
|
|
|
8
8
|
const node_child_process_1 = require("node:child_process");
|
|
9
9
|
const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
|
|
10
10
|
const index_1 = __importDefault(require("./index"));
|
|
11
|
+
const SUPPORTS_DAEMON_USAGE_RE = /^\s*usage(?:\s|\[|$)/m;
|
|
11
12
|
/** Whether an `oversky --help` surface actually supports the usage command. */
|
|
12
13
|
function supportsDaemonUsage(helpText) {
|
|
13
|
-
return
|
|
14
|
+
return SUPPORTS_DAEMON_USAGE_RE.test(helpText);
|
|
14
15
|
}
|
|
15
16
|
/** Read-only bridge to `oversky usage` for local Claude Code/Codex limits. */
|
|
16
17
|
class DaemonUsage extends index_1.default {
|
|
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
7
7
|
const format_1 = require("../../lib/format");
|
|
8
|
+
const RUN_RE = /\s+/g;
|
|
8
9
|
class DmMessages extends base_command_1.BaseCommand {
|
|
9
10
|
static description = "List messages from an agent's 1:1 DM";
|
|
10
11
|
static examples = [
|
|
@@ -89,7 +90,7 @@ class DmMessages extends base_command_1.BaseCommand {
|
|
|
89
90
|
(0, format_1.renderTable)(selected.map((message) => ({
|
|
90
91
|
when: (0, format_1.localTime)(message.createdAt),
|
|
91
92
|
role: String(message.sender ?? (message.isCreatedByUser ? 'user' : 'assistant')),
|
|
92
|
-
text: textFromMessage(message).replace(
|
|
93
|
+
text: textFromMessage(message).replace(RUN_RE, ' ').trim(),
|
|
93
94
|
id: String(message.messageId ?? message._id ?? message.id ?? '-'),
|
|
94
95
|
})), [
|
|
95
96
|
{ key: 'when', header: 'TIME', maxWidth: 20 },
|
|
@@ -6,6 +6,7 @@ const base_command_1 = require("../../../base-command");
|
|
|
6
6
|
const agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
7
7
|
const agent_thread_1 = require("../../../lib/agent-thread");
|
|
8
8
|
const format_1 = require("../../../lib/format");
|
|
9
|
+
const RUN_RE = /\s+/g;
|
|
9
10
|
/** Read replies in one Thread; root stays separately addressable in main chat. */
|
|
10
11
|
class DmThreadMessages extends base_command_1.BaseCommand {
|
|
11
12
|
static description = 'List replies in an Agent DM Thread';
|
|
@@ -93,7 +94,7 @@ class DmThreadMessages extends base_command_1.BaseCommand {
|
|
|
93
94
|
(0, format_1.renderTable)(page.messages.map((message) => ({
|
|
94
95
|
when: message.createdAt || '-',
|
|
95
96
|
role: message.isCreatedByUser ? 'user' : 'agent',
|
|
96
|
-
text: String(message.text || '').replace(
|
|
97
|
+
text: String(message.text || '').replace(RUN_RE, ' '),
|
|
97
98
|
id: message.messageId,
|
|
98
99
|
})), [
|
|
99
100
|
{ key: 'when', header: 'TIME', maxWidth: 26 },
|
|
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
7
7
|
const format_1 = require("../../lib/format");
|
|
8
|
+
const RUN_RE = /\s+/g;
|
|
8
9
|
/** List the Slack-style Threads the caller follows for one Agent DM. */
|
|
9
10
|
class DmThreads extends base_command_1.BaseCommand {
|
|
10
11
|
static description = 'List followed Threads in an agent’s 1:1 DM';
|
|
@@ -78,7 +79,7 @@ class DmThreads extends base_command_1.BaseCommand {
|
|
|
78
79
|
unread: String(thread.unreadCount || 0),
|
|
79
80
|
following: thread.isFollowing === false ? 'no' : 'yes',
|
|
80
81
|
updated: thread.lastReplyAt || '-',
|
|
81
|
-
preview: (thread.root.snapshot.text || thread.lastReplyPreview || '').replace(
|
|
82
|
+
preview: (thread.root.snapshot.text || thread.lastReplyPreview || '').replace(RUN_RE, ' '),
|
|
82
83
|
})), [
|
|
83
84
|
{ key: 'root', header: 'ROOT MESSAGE', maxWidth: 38, verbatim: true },
|
|
84
85
|
{ key: 'replies', header: 'REPLIES' },
|
package/dist/commands/doctor.js
CHANGED
|
@@ -53,6 +53,7 @@ const runtime_context_1 = require("../lib/runtime-context");
|
|
|
53
53
|
const deployed_build_1 = require("../lib/deployed-build");
|
|
54
54
|
const cli_installation_diagnostics_1 = require("../lib/cli-installation-diagnostics");
|
|
55
55
|
const outbox_1 = require("../lib/outbox");
|
|
56
|
+
const RUN_RE = /fetch failed|ECONNREFUSED|ENOTFOUND|ETIMEDOUT|socket hang up/i;
|
|
56
57
|
/**
|
|
57
58
|
* What each check actually verifies, in the words a reader thinks in.
|
|
58
59
|
*
|
|
@@ -248,7 +249,7 @@ class Doctor extends base_command_1.BaseCommand {
|
|
|
248
249
|
(e.code === 'ECONNREFUSED' ||
|
|
249
250
|
e.code === 'ENOTFOUND' ||
|
|
250
251
|
e.code === 'ETIMEDOUT' ||
|
|
251
|
-
|
|
252
|
+
RUN_RE.test(e.message || ''));
|
|
252
253
|
// 5xx and a dead transport are the server's problem. 4xx is ours: a
|
|
253
254
|
// 401/403 really does mean the credential is bad, and that is the one
|
|
254
255
|
// case where "re-authenticate" is the right advice.
|
|
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
6
|
const base_command_1 = require("../../../base-command");
|
|
7
7
|
const history_1 = require("./history");
|
|
8
|
+
const PARSE_EVIDENCE_REF_RE = /^https?:|^file:/;
|
|
8
9
|
/**
|
|
9
10
|
* `skrr goals key-results assess <goal-id> <kr-id>` — record a judgment of a
|
|
10
11
|
* key result (OSK-17987, decision D4). Wraps
|
|
@@ -106,5 +107,5 @@ function parseEvidenceRef(raw) {
|
|
|
106
107
|
}
|
|
107
108
|
const kind = raw.slice(0, split);
|
|
108
109
|
const value = raw.slice(split + 1);
|
|
109
|
-
return
|
|
110
|
+
return PARSE_EVIDENCE_REF_RE.test(value) ? { kind, uri: value } : { kind, id: value };
|
|
110
111
|
}
|
|
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
7
7
|
const base_command_1 = require("../../../base-command");
|
|
8
8
|
const format_1 = require("../../../lib/format");
|
|
9
|
+
const ONE_LINE_RE = /\s+/g;
|
|
9
10
|
/**
|
|
10
11
|
* `skrr goals key-results history <goal-id> <kr-id>` — every judgment of a key
|
|
11
12
|
* result, newest first (OSK-17987). Wraps
|
|
@@ -97,7 +98,7 @@ function describeAssessment(assessment) {
|
|
|
97
98
|
return lines;
|
|
98
99
|
}
|
|
99
100
|
function oneLine(text) {
|
|
100
|
-
return typeof text === 'string' ? text.replace(
|
|
101
|
+
return typeof text === 'string' ? text.replace(ONE_LINE_RE, ' ').trim() : '';
|
|
101
102
|
}
|
|
102
103
|
function formatAt(at) {
|
|
103
104
|
return at ? String(at).slice(0, 19).replace('T', ' ') : '-';
|
|
@@ -5,6 +5,7 @@ const base_command_1 = require("../../base-command");
|
|
|
5
5
|
const harnesses_1 = require("../../lib/harnesses");
|
|
6
6
|
const api_fetch_1 = require("../../lib/api-fetch");
|
|
7
7
|
const show_1 = require("./show");
|
|
8
|
+
const RUN_RE = /^[0-9a-f]{24}$/i;
|
|
8
9
|
/**
|
|
9
10
|
* Forget an harness — `forget`, not `delete`.
|
|
10
11
|
*
|
|
@@ -40,7 +41,7 @@ class HarnessesForget extends base_command_1.BaseCommand {
|
|
|
40
41
|
// (`describeWrongHarnessRef` names which KIND of id you passed and which
|
|
41
42
|
// command takes it). `forget` is the DESTRUCTIVE one and had the worse
|
|
42
43
|
// message; it now shares the explanation.
|
|
43
|
-
if (
|
|
44
|
+
if (!RUN_RE.test(args.harness.trim())) {
|
|
44
45
|
this.error(`Not a harness id: ${args.harness}\n${(0, show_1.describeWrongHarnessRef)(args.harness)}`, {
|
|
45
46
|
exit: 1,
|
|
46
47
|
});
|
|
@@ -13,6 +13,12 @@ const harness_labels_1 = require("../../lib/harness-labels");
|
|
|
13
13
|
const cli_installers_1 = require("../../lib/cli-installers");
|
|
14
14
|
const api_fetch_1 = require("../../lib/api-fetch");
|
|
15
15
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
16
|
+
const DESCRIBE_WRONG_HARNESS_REF_RE = /^daemon_/;
|
|
17
|
+
const DESCRIBE_WRONG_HARNESS_REF_RE_2 = /^(dedicated-runtime-|hosted-machine-|hosted-runtime-)/;
|
|
18
|
+
const DESCRIBE_WRONG_HARNESS_REF_RE_3 = /^sbs_/;
|
|
19
|
+
const DESCRIBE_WRONG_HARNESS_REF_RE_4 = /^machine:/;
|
|
20
|
+
const DESCRIBE_WRONG_HARNESS_REF_RE_5 = /^(lease:|dedicated-runtime:|hosted-machine:)/;
|
|
21
|
+
const DESCRIBE_WRONG_HARNESS_REF_RE_6 = /^[0-9a-f]{24}$/i;
|
|
16
22
|
class HarnessesShow extends base_command_1.BaseCommand {
|
|
17
23
|
static description = 'Show one harness — one provider on one machine';
|
|
18
24
|
static examples = [
|
|
@@ -185,25 +191,25 @@ function harnessPermissionLines(harness) {
|
|
|
185
191
|
*/
|
|
186
192
|
function describeWrongHarnessRef(ref) {
|
|
187
193
|
const seeIds = 'Run `skrr harnesses list --all` to see the harness ids on this account.';
|
|
188
|
-
if (
|
|
194
|
+
if (DESCRIBE_WRONG_HARNESS_REF_RE.test(ref)) {
|
|
189
195
|
return `That is a daemon id. \`skrr machines show ${ref}\` takes those. ${seeIds}`;
|
|
190
196
|
}
|
|
191
|
-
if (
|
|
197
|
+
if (DESCRIBE_WRONG_HARNESS_REF_RE_2.test(ref)) {
|
|
192
198
|
// Printed in the DAEMON ID column for a rented machine, so it is the same
|
|
193
199
|
// redirect as `daemon_…`, not a malformed harness id (OSK-9313).
|
|
194
200
|
return `That is a daemon id. \`skrr machines show ${ref}\` takes those. ${seeIds}`;
|
|
195
201
|
}
|
|
196
|
-
if (
|
|
202
|
+
if (DESCRIBE_WRONG_HARNESS_REF_RE_3.test(ref)) {
|
|
197
203
|
return `That is a hosted machine id. \`skrr machines show ${ref}\` takes those. ${seeIds}`;
|
|
198
204
|
}
|
|
199
|
-
if (
|
|
205
|
+
if (DESCRIBE_WRONG_HARNESS_REF_RE_4.test(ref)) {
|
|
200
206
|
return `That is a machine id. \`skrr machines show ${ref}\` takes those. ${seeIds}`;
|
|
201
207
|
}
|
|
202
|
-
if (
|
|
208
|
+
if (DESCRIBE_WRONG_HARNESS_REF_RE_5.test(ref)) {
|
|
203
209
|
return ('That is a machine id for a rented runtime. `skrr machines show` takes it as printed; ' +
|
|
204
210
|
`\`skrr machines dedicated show\` takes the part after the colon. ${seeIds}`);
|
|
205
211
|
}
|
|
206
|
-
if (
|
|
212
|
+
if (DESCRIBE_WRONG_HARNESS_REF_RE_6.test(ref)) {
|
|
207
213
|
// Right shape, wrong row — so the id is not the thing to explain.
|
|
208
214
|
return `No harness on this account has that id. ${seeIds}`;
|
|
209
215
|
}
|
|
@@ -9,6 +9,7 @@ const inbox_1 = require("../../lib/inbox");
|
|
|
9
9
|
const format_1 = require("../../lib/format");
|
|
10
10
|
const agentic_stream_1 = require("../../lib/agentic-stream");
|
|
11
11
|
const dpop_auth_1 = require("../../lib/dpop-auth");
|
|
12
|
+
const RUN_RE = /\s+/g;
|
|
12
13
|
/**
|
|
13
14
|
* Stop `--follow` on Ctrl-C or SIGTERM, and end with the status a shell
|
|
14
15
|
* reports for that signal (130 / 143).
|
|
@@ -115,7 +116,7 @@ class Inbox extends base_command_1.BaseCommand {
|
|
|
115
116
|
conversation: dm.conversationId,
|
|
116
117
|
unread: String(dm.unreadCount),
|
|
117
118
|
when: dm.lastMessageAt ? dm.lastMessageAt.slice(0, 19) : '-',
|
|
118
|
-
preview: (dm.lastMessagePreview || '').replace(
|
|
119
|
+
preview: (dm.lastMessagePreview || '').replace(RUN_RE, ' ').trim(),
|
|
119
120
|
})), [
|
|
120
121
|
{ key: 'agent', header: 'AGENT', verbatim: true },
|
|
121
122
|
{ key: 'conversation', header: 'CONVERSATION', verbatim: true },
|
|
@@ -171,7 +172,7 @@ class Inbox extends base_command_1.BaseCommand {
|
|
|
171
172
|
: '-',
|
|
172
173
|
status: item.status.toUpperCase(),
|
|
173
174
|
when: item.createdAt.slice(0, 19),
|
|
174
|
-
notification: `${item.title} — ${item.body}`.replace(
|
|
175
|
+
notification: `${item.title} — ${item.body}`.replace(RUN_RE, ' ').trim(),
|
|
175
176
|
})), [
|
|
176
177
|
{ key: 'task', header: 'TASK', maxWidth: 24 },
|
|
177
178
|
{ key: 'status', header: 'STATUS', maxWidth: 8 },
|
|
@@ -193,7 +194,7 @@ class Inbox extends base_command_1.BaseCommand {
|
|
|
193
194
|
return;
|
|
194
195
|
}
|
|
195
196
|
const when = message.createdAt ? message.createdAt.slice(11, 19) : '--:--:--';
|
|
196
|
-
const body = message.text.replace(
|
|
197
|
+
const body = message.text.replace(RUN_RE, ' ').trim();
|
|
197
198
|
this.log(`[${when}] ${message.agentId}: ${body}`);
|
|
198
199
|
};
|
|
199
200
|
const sync = async (initial = false) => {
|
|
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const node_crypto_1 = require("node:crypto");
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const initiatives_1 = require("../../lib/initiatives");
|
|
7
|
+
const APPROVAL_PROOF_FOR_RE = /^[a-f0-9]{64}$/;
|
|
7
8
|
function approvalProofFor(initiativeId, contract) {
|
|
8
9
|
if (Number(contract?.version) !== 2)
|
|
9
10
|
return {};
|
|
@@ -11,7 +12,7 @@ function approvalProofFor(initiativeId, contract) {
|
|
|
11
12
|
const expectedDigest = String(contract?.digest || '');
|
|
12
13
|
if (!Number.isInteger(expectedRevision) ||
|
|
13
14
|
expectedRevision < 1 ||
|
|
14
|
-
|
|
15
|
+
!APPROVAL_PROOF_FOR_RE.test(expectedDigest)) {
|
|
15
16
|
return null;
|
|
16
17
|
}
|
|
17
18
|
// Deterministic proof makes a retried terminal command idempotent for this
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
|
+
const RESOLVE_VERSION_REF_RE = /^\d+$/;
|
|
6
7
|
class InstructionsDiff extends base_command_1.BaseCommand {
|
|
7
8
|
static description = 'Compare two immutable instruction versions';
|
|
8
9
|
static args = {
|
|
@@ -29,7 +30,7 @@ class InstructionsDiff extends base_command_1.BaseCommand {
|
|
|
29
30
|
*/
|
|
30
31
|
async resolveVersionRef(bundleId, ref) {
|
|
31
32
|
const trimmed = ref.trim();
|
|
32
|
-
if (
|
|
33
|
+
if (!RESOLVE_VERSION_REF_RE.test(trimmed))
|
|
33
34
|
return trimmed; // already an id
|
|
34
35
|
let versions;
|
|
35
36
|
try {
|
|
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const format_1 = require("../../lib/format");
|
|
7
7
|
const instruction_provenance_1 = require("../../lib/instruction-provenance");
|
|
8
|
+
const RUN_RE = /BUNDLE_NOT_FOUND/;
|
|
8
9
|
class InstructionsShow extends base_command_1.BaseCommand {
|
|
9
10
|
static description = 'Show exact prompt content and version history';
|
|
10
11
|
static args = {
|
|
@@ -88,7 +89,7 @@ class InstructionsShow extends base_command_1.BaseCommand {
|
|
|
88
89
|
// shape `diff.ts` already fixed for VERSION_NOT_FOUND.
|
|
89
90
|
const code = error?.code;
|
|
90
91
|
const body = error?.body ?? '';
|
|
91
|
-
if (code === 'BUNDLE_NOT_FOUND' ||
|
|
92
|
+
if (code === 'BUNDLE_NOT_FOUND' || RUN_RE.test(body)) {
|
|
92
93
|
this.failWithCliError({
|
|
93
94
|
message: `No instruction bundle ${args.id}. ` +
|
|
94
95
|
`Run \`${this.config.bin} instructions list\` to see the ids on this account.`,
|
package/dist/commands/login.js
CHANGED
|
@@ -21,6 +21,8 @@ const auth_storage_1 = require("../lib/auth-storage");
|
|
|
21
21
|
const credential_resolver_1 = require("../lib/credential-resolver");
|
|
22
22
|
const node_adapter_1 = require("../lib/node-adapter");
|
|
23
23
|
const prompt_1 = require("../lib/prompt");
|
|
24
|
+
const RUN_RECOVERY_CODE_LOGIN_RE = /[\s-]/g;
|
|
25
|
+
const RUN_RECOVERY_CODE_LOGIN_RE_2 = /^[A-Z2-7]+$/;
|
|
24
26
|
/**
|
|
25
27
|
* `skrr login`
|
|
26
28
|
*
|
|
@@ -440,8 +442,8 @@ class Login extends base_command_1.BaseCommand {
|
|
|
440
442
|
async runRecoveryCodeLogin(recoveryCode) {
|
|
441
443
|
// H15 — local pre-validation: strip formatting (dashes, whitespace,
|
|
442
444
|
// lowercase) and check every remaining character is in A-Z2-7.
|
|
443
|
-
const cleaned = recoveryCode.trim().toUpperCase().replace(
|
|
444
|
-
if (cleaned.length > 0 &&
|
|
445
|
+
const cleaned = recoveryCode.trim().toUpperCase().replace(RUN_RECOVERY_CODE_LOGIN_RE, '');
|
|
446
|
+
if (cleaned.length > 0 && !RUN_RECOVERY_CODE_LOGIN_RE_2.test(cleaned)) {
|
|
445
447
|
this.error('Recovery codes only contain letters A-Z and digits 2-7. Copy from where you stored it.', { exit: 1 });
|
|
446
448
|
}
|
|
447
449
|
let result;
|
|
@@ -5,6 +5,7 @@ const base_command_1 = require("../../../base-command");
|
|
|
5
5
|
const computer_files_1 = require("../../../lib/computer-files");
|
|
6
6
|
const dedicated_machines_1 = require("../../../lib/dedicated-machines");
|
|
7
7
|
const dedicated_copy_1 = require("../../../lib/dedicated-copy");
|
|
8
|
+
const RUN_RE = /--tag/g;
|
|
8
9
|
const LIMIT_MIB = dedicated_machines_1.DEDICATED_FILE_MAX_BYTES / (1024 * 1024);
|
|
9
10
|
/**
|
|
10
11
|
* `skrr machines dedicated cp` — copy ONE file to or from a Dedicated Runtime.
|
|
@@ -92,7 +93,7 @@ class DedicatedMachinesCp extends base_command_1.BaseCommand {
|
|
|
92
93
|
ifTag = (0, computer_files_1.parseComputerFileTag)(flags['if-tag']);
|
|
93
94
|
}
|
|
94
95
|
catch (err) {
|
|
95
|
-
this.error(err.message.replace(
|
|
96
|
+
this.error(err.message.replace(RUN_RE, '--if-tag'), { exit: 2 });
|
|
96
97
|
}
|
|
97
98
|
if (ifTag.contents !== undefined) {
|
|
98
99
|
this.error('--if-tag names a file version; a folder contents tag cannot be replaced.', {
|
|
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const dedicated_lease_command_1 = require("../../../../lib/dedicated-lease-command");
|
|
6
6
|
const dedicated_power_1 = require("../../../../lib/dedicated-power");
|
|
7
|
+
const RUN_RE = /^\d+(\.\d+)?$/;
|
|
7
8
|
/**
|
|
8
9
|
* `skrr machines dedicated power set` — the standing power policy.
|
|
9
10
|
*
|
|
@@ -55,7 +56,7 @@ class DedicatedMachinesPowerSet extends dedicated_lease_command_1.DedicatedLease
|
|
|
55
56
|
budget = null;
|
|
56
57
|
else if (flags['budget-hours'] !== undefined) {
|
|
57
58
|
const raw = flags['budget-hours'].trim();
|
|
58
|
-
budget =
|
|
59
|
+
budget = RUN_RE.test(raw) ? Number(raw) : Number.NaN;
|
|
59
60
|
if (!(budget > 0) || budget > data_provider_1.DEDICATED_POWER_BUDGET_HOURS_MAX) {
|
|
60
61
|
this.error(`--budget-hours must be a number greater than 0 and at most ${data_provider_1.DEDICATED_POWER_BUDGET_HOURS_MAX}. Use --no-budget to remove the budget.`, { exit: 2 });
|
|
61
62
|
}
|