@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
|
@@ -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) => {
|
|
@@ -24,6 +24,8 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
24
24
|
const agentic_stream_1 = require("./agentic-stream");
|
|
25
25
|
const dpop_auth_1 = require("./dpop-auth");
|
|
26
26
|
const ssh_ordered_bytes_1 = require("./ssh-ordered-bytes");
|
|
27
|
+
const ENSURE_SSH_IDENTITY_RE = /\s+/;
|
|
28
|
+
const WRITE_KNOWN_HOSTS_RE = /^[A-Za-z0-9+/]+=*$/;
|
|
27
29
|
/**
|
|
28
30
|
* Owner SSH to a Dedicated Runtime — SSH protocol over the admitted relay.
|
|
29
31
|
*
|
|
@@ -121,7 +123,7 @@ function ensureSshIdentity(home = (0, node_os_1.homedir)()) {
|
|
|
121
123
|
(0, node_fs_1.chmodSync)(publicKeyPath, 0o644);
|
|
122
124
|
}
|
|
123
125
|
const line = (0, node_fs_1.readFileSync)(publicKeyPath, 'utf8').trim();
|
|
124
|
-
const [keyType, keyBlob] = line.split(
|
|
126
|
+
const [keyType, keyBlob] = line.split(ENSURE_SSH_IDENTITY_RE);
|
|
125
127
|
if (!keyType || !keyBlob) {
|
|
126
128
|
throw new DedicatedSshError(`could not read ${publicKeyPath}`, 'SSH_KEY_UNREADABLE');
|
|
127
129
|
}
|
|
@@ -141,7 +143,7 @@ function writeKnownHosts(host, hostKeys, home = (0, node_os_1.homedir)()) {
|
|
|
141
143
|
(0, node_fs_1.mkdirSync)(dir, { recursive: true, mode: 0o700 });
|
|
142
144
|
(0, node_fs_1.chmodSync)(dir, 0o700);
|
|
143
145
|
const lines = hostKeys
|
|
144
|
-
.filter((k) => k && HOSTKEY_TYPES.has(k.type) &&
|
|
146
|
+
.filter((k) => k && HOSTKEY_TYPES.has(k.type) && WRITE_KNOWN_HOSTS_RE.test(k.key))
|
|
145
147
|
.map((k) => `${host} ${k.type} ${k.key}`);
|
|
146
148
|
if (lines.length === 0)
|
|
147
149
|
return false;
|
|
@@ -155,7 +157,7 @@ function writeKnownHosts(host, hostKeys, home = (0, node_os_1.homedir)()) {
|
|
|
155
157
|
catch {
|
|
156
158
|
/* first connect */
|
|
157
159
|
}
|
|
158
|
-
const kept = existing.filter((l) => l.split(
|
|
160
|
+
const kept = existing.filter((l) => l.split(ENSURE_SSH_IDENTITY_RE)[0] !== host);
|
|
159
161
|
const tmp = `${target}.${process.pid}.${(0, node_crypto_1.randomUUID)()}.tmp`;
|
|
160
162
|
(0, node_fs_1.writeFileSync)(tmp, `${[...kept, ...lines].join('\n')}\n`, { mode: 0o600 });
|
|
161
163
|
(0, node_fs_1.renameSync)(tmp, target);
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.readDeployedBuild = readDeployedBuild;
|
|
23
23
|
exports.deployedBuildLines = deployedBuildLines;
|
|
24
|
+
const READ_DEPLOYED_BUILD_RE = /\/+$/;
|
|
24
25
|
const COMMIT = /^[a-f0-9]{40}$/;
|
|
25
26
|
const TIMEOUT_MS = 5_000;
|
|
26
27
|
async function readCommit(url, pick, unstamped, fetchImpl) {
|
|
@@ -46,7 +47,7 @@ async function readCommit(url, pick, unstamped, fetchImpl) {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
async function readDeployedBuild(baseURL, fetchImpl = fetch) {
|
|
49
|
-
const origin = baseURL.replace(
|
|
50
|
+
const origin = baseURL.replace(READ_DEPLOYED_BUILD_RE, '');
|
|
50
51
|
const [api, web] = await Promise.all([
|
|
51
52
|
readCommit(`${origin}/api/health`, (body) => body?.build?.commit, 'the server does not report the commit its API was built from', fetchImpl),
|
|
52
53
|
readCommit(`${origin}/web-version.json`, (body) => body?.sha, 'the published web shell carries no commit', fetchImpl),
|
package/dist/lib/device-code.js
CHANGED
|
@@ -25,6 +25,7 @@ exports.DeviceCodeLoginCancelledError = void 0;
|
|
|
25
25
|
exports.startDeviceCode = startDeviceCode;
|
|
26
26
|
exports.pollDeviceCode = pollDeviceCode;
|
|
27
27
|
exports.revokeDeviceRefreshToken = revokeDeviceRefreshToken;
|
|
28
|
+
const START_DEVICE_CODE_RE = /\/$/;
|
|
28
29
|
const DEFAULT_POLL_INTERVAL_MS = 2_000;
|
|
29
30
|
/** Server-side TTL is 300s; we add a small safety margin for clock drift. */
|
|
30
31
|
const DEFAULT_OVERALL_TIMEOUT_MS = 320_000;
|
|
@@ -49,7 +50,7 @@ exports.DeviceCodeLoginCancelledError = DeviceCodeLoginCancelledError;
|
|
|
49
50
|
* default to `'daemon'`, which still works for the CLI's REST surface.
|
|
50
51
|
*/
|
|
51
52
|
async function startDeviceCode(baseURL, daemonId) {
|
|
52
|
-
const res = await fetch(`${baseURL.replace(
|
|
53
|
+
const res = await fetch(`${baseURL.replace(START_DEVICE_CODE_RE, '')}/api/daemons/device-code`, {
|
|
53
54
|
method: 'POST',
|
|
54
55
|
headers: { Accept: 'application/json', 'Content-Type': 'application/json' },
|
|
55
56
|
body: JSON.stringify({ daemonId, source: 'cli' }),
|
|
@@ -88,7 +89,7 @@ async function pollDeviceCode(baseURL, code, opts = {}) {
|
|
|
88
89
|
}
|
|
89
90
|
let res;
|
|
90
91
|
try {
|
|
91
|
-
res = await fetch(`${baseURL.replace(
|
|
92
|
+
res = await fetch(`${baseURL.replace(START_DEVICE_CODE_RE, '')}/api/daemons/device-code/${encodeURIComponent(code)}/status`, { method: 'GET', headers: { Accept: 'application/json' }, ...(signal ? { signal } : {}) });
|
|
92
93
|
}
|
|
93
94
|
catch {
|
|
94
95
|
if (signal?.aborted)
|
|
@@ -137,7 +138,7 @@ async function pollDeviceCode(baseURL, code, opts = {}) {
|
|
|
137
138
|
async function revokeDeviceRefreshToken(baseURL, refreshToken) {
|
|
138
139
|
if (!refreshToken)
|
|
139
140
|
return;
|
|
140
|
-
const url = `${baseURL.replace(
|
|
141
|
+
const url = `${baseURL.replace(START_DEVICE_CODE_RE, '')}/api/daemons/token/revoke`;
|
|
141
142
|
const controller = new AbortController();
|
|
142
143
|
const timer = setTimeout(() => controller.abort(), 5_000);
|
|
143
144
|
try {
|
package/dist/lib/dpop-auth.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.dpopHeadersFor = dpopHeadersFor;
|
|
|
18
18
|
exports.socketHandshakeHtu = socketHandshakeHtu;
|
|
19
19
|
exports.socketAuthWithDpop = socketAuthWithDpop;
|
|
20
20
|
const brokered_dpop_1 = require("./brokered-dpop");
|
|
21
|
+
const SOCKET_HANDSHAKE_HTU_RE = /\/+$/;
|
|
21
22
|
/** RFC 9449 §4.1. */
|
|
22
23
|
exports.DPOP_HEADER = 'DPoP';
|
|
23
24
|
/** Headers to add to one HTTP request made with `token`; `{}` when unbound. */
|
|
@@ -35,7 +36,7 @@ async function dpopHeadersFor(token, method, url) {
|
|
|
35
36
|
function socketHandshakeHtu(wsOrigin, ioPath = '/ws/agentic') {
|
|
36
37
|
const u = new URL(wsOrigin);
|
|
37
38
|
u.protocol = u.protocol === 'wss:' ? 'https:' : u.protocol === 'ws:' ? 'http:' : u.protocol;
|
|
38
|
-
u.pathname = ioPath.replace(
|
|
39
|
+
u.pathname = ioPath.replace(SOCKET_HANDSHAKE_HTU_RE, '');
|
|
39
40
|
u.search = '';
|
|
40
41
|
u.hash = '';
|
|
41
42
|
return u.toString();
|
package/dist/lib/earnings.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.renderStatement = renderStatement;
|
|
|
7
7
|
exports.renderPayoutHistory = renderPayoutHistory;
|
|
8
8
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
9
9
|
const format_1 = require("./format");
|
|
10
|
+
const DOLLARS_RE = /^\$/;
|
|
10
11
|
/**
|
|
11
12
|
* earnings.ts — the read-only publisher payout surface (OSK-12272).
|
|
12
13
|
*
|
|
@@ -34,7 +35,7 @@ exports.PERIOD_PATTERN = /^\d{4}-(0[1-9]|1[0-2])$/;
|
|
|
34
35
|
function dollars(usd) {
|
|
35
36
|
if (usd == null || usd === '')
|
|
36
37
|
return '-';
|
|
37
|
-
const trimmed = String(usd).replace(
|
|
38
|
+
const trimmed = String(usd).replace(DOLLARS_RE, '');
|
|
38
39
|
return trimmed.startsWith('-') ? `-$${trimmed.slice(1)}` : `$${trimmed}`;
|
|
39
40
|
}
|
|
40
41
|
function day(value) {
|
|
@@ -33,6 +33,8 @@ exports.runtimeBinarySupportsSubcommand = runtimeBinarySupportsSubcommand;
|
|
|
33
33
|
const node_child_process_1 = require("node:child_process");
|
|
34
34
|
const node_fs_1 = require("node:fs");
|
|
35
35
|
const node_path_1 = __importDefault(require("node:path"));
|
|
36
|
+
const EXEC_RUNTIME_BINARY_RE = /\.(cmd|bat)$/i;
|
|
37
|
+
const RUNTIME_BINARY_SUPPORTS_SUBCOMMAND_RE = /[.*+?^${}()|[\]\\]/g;
|
|
36
38
|
/** Runtime binary names, current first. */
|
|
37
39
|
exports.RUNTIME_BINARY_NAMES = ['skrrd', 'oversky'];
|
|
38
40
|
/**
|
|
@@ -240,7 +242,7 @@ function execRuntimeBinary(args, opts = {}) {
|
|
|
240
242
|
// binaries keep the safer argv-array exec path. Node 20.12+ (required
|
|
241
243
|
// by package.json engines `>=20.0.0` — pin at install time) quotes
|
|
242
244
|
// args when shell:true on Windows per CVE-2024-27980's fix.
|
|
243
|
-
const isWinShim = process.platform === 'win32' &&
|
|
245
|
+
const isWinShim = process.platform === 'win32' && EXEC_RUNTIME_BINARY_RE.test(bin);
|
|
244
246
|
const child = (0, node_child_process_1.spawn)(bin, normalizeRuntimeGlobalArgs(args), {
|
|
245
247
|
stdio: 'inherit',
|
|
246
248
|
env: runtimeEnv(),
|
|
@@ -272,7 +274,7 @@ function execRuntimeBinaryCapture(args, opts = {}) {
|
|
|
272
274
|
reject(new Error('runtime-binary-not-installed'));
|
|
273
275
|
return;
|
|
274
276
|
}
|
|
275
|
-
const isWinShim = process.platform === 'win32' &&
|
|
277
|
+
const isWinShim = process.platform === 'win32' && EXEC_RUNTIME_BINARY_RE.test(bin);
|
|
276
278
|
const child = (0, node_child_process_1.spawn)(bin, normalizeRuntimeGlobalArgs(args), {
|
|
277
279
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
278
280
|
env: runtimeEnv(),
|
|
@@ -353,7 +355,7 @@ function runtimeBinarySupportsSubcommand(subcommand) {
|
|
|
353
355
|
child.on('exit', (code) => {
|
|
354
356
|
if (code !== 0)
|
|
355
357
|
return settle(null);
|
|
356
|
-
const escaped = subcommand.replace(
|
|
358
|
+
const escaped = subcommand.replace(RUNTIME_BINARY_SUPPORTS_SUBCOMMAND_RE, '\\$&');
|
|
357
359
|
settle(new RegExp(`^\\s*${escaped}(?:\\s|$)`, 'm').test(output));
|
|
358
360
|
});
|
|
359
361
|
});
|
|
@@ -86,6 +86,7 @@ const first_party_harness_1 = require("./first-party-harness");
|
|
|
86
86
|
const first_party_harness_agent_1 = require("./first-party-harness-agent");
|
|
87
87
|
const first_party_harness_managed_1 = require("./first-party-harness-managed");
|
|
88
88
|
const task_execution_1 = require("./task-execution");
|
|
89
|
+
const RELEASE_LEASE_RE = /\/+$/;
|
|
89
90
|
/**
|
|
90
91
|
* Harness selections the POLICY resolves, mirroring the server's own set.
|
|
91
92
|
*
|
|
@@ -548,7 +549,7 @@ async function acquireManagedSession(input = {}, deps = {}) {
|
|
|
548
549
|
* than a lease the server's reaper collects a couple of minutes later.
|
|
549
550
|
*/
|
|
550
551
|
async function releaseLease(input, fetchImpl, log) {
|
|
551
|
-
const url = `${input.serverUrl.replace(
|
|
552
|
+
const url = `${input.serverUrl.replace(RELEASE_LEASE_RE, '')}` +
|
|
552
553
|
`/api/agentic/sessions/${encodeURIComponent(input.sessionId)}/inference/release`;
|
|
553
554
|
const controller = new AbortController();
|
|
554
555
|
const timeout = setTimeout(() => controller.abort(), RELEASE_TIMEOUT_MS);
|
|
@@ -643,7 +644,7 @@ async function mintSessionToken(input, api, signal) {
|
|
|
643
644
|
* alive.
|
|
644
645
|
*/
|
|
645
646
|
async function refreshSessionCapability(input, fetchImpl) {
|
|
646
|
-
const url = `${input.serverUrl.replace(
|
|
647
|
+
const url = `${input.serverUrl.replace(RELEASE_LEASE_RE, '')}` +
|
|
647
648
|
`/api/agentic/sessions/${encodeURIComponent(input.sessionId)}/session-token/renew`;
|
|
648
649
|
const controller = new AbortController();
|
|
649
650
|
const timeout = setTimeout(() => controller.abort(), CAPABILITY_REFRESH_TIMEOUT_MS);
|
|
@@ -802,7 +803,7 @@ async function admitLease(input, fetchImpl,
|
|
|
802
803
|
// path is one line away, and the user was promised one number for the whole
|
|
803
804
|
// handshake rather than one per hop.
|
|
804
805
|
signal) {
|
|
805
|
-
const url = `${input.serverUrl.replace(
|
|
806
|
+
const url = `${input.serverUrl.replace(RELEASE_LEASE_RE, '')}` +
|
|
806
807
|
`/api/agentic/sessions/${encodeURIComponent(input.sessionId)}/inference/admit`;
|
|
807
808
|
let response;
|
|
808
809
|
try {
|
|
@@ -48,6 +48,7 @@ const node_fs_1 = require("node:fs");
|
|
|
48
48
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
49
49
|
const config_1 = require("./config");
|
|
50
50
|
const runtime_context_1 = require("./runtime-context");
|
|
51
|
+
const CAMEL_CASE_SLUG_RE = /-([a-z0-9])/g;
|
|
51
52
|
/** The neutral operator switch for CLI-hosted managed inference. */
|
|
52
53
|
exports.MANAGED_ENV_FLAG = auth_core_1.FIRST_PARTY_HARNESS_ENV.managed.name;
|
|
53
54
|
/**
|
|
@@ -88,7 +89,7 @@ exports.AGENT_FLAG_SPELLINGS = [exports.SKRR_AGENT_FLAG, exports.OVERSKY_AGENT_F
|
|
|
88
89
|
exports.AGENT_CONFIG_KEY = 'firstPartyHarnessAgentId';
|
|
89
90
|
/** `a-b` → `aB`: how a hyphenated spelling became part of a config key. */
|
|
90
91
|
function camelCaseSlug(slug) {
|
|
91
|
-
return slug.replace(
|
|
92
|
+
return slug.replace(CAMEL_CASE_SLUG_RE, (_, next) => next.toUpperCase());
|
|
92
93
|
}
|
|
93
94
|
// TODO(identity): move to auth-core — the identity module derives on-disk binary
|
|
94
95
|
// names from its artifact spellings; it has no notion of a legacy CONFIG key yet.
|
|
@@ -12,6 +12,10 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
12
12
|
const node_readline_1 = __importDefault(require("node:readline"));
|
|
13
13
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
14
14
|
const first_party_harness_update_1 = require("./first-party-harness-update");
|
|
15
|
+
const DISABLED_RE = /^(0|false|off|no|disabled)$/i;
|
|
16
|
+
const ENABLED_RE = /^(1|true|on|yes)$/i;
|
|
17
|
+
const SHOULD_CHECK_CODE_AT_STARTUP_RE = /^(--help|-h|--version|-v|--json|--print|-p|--no-tui|--output|--format)(=|$)/;
|
|
18
|
+
const SHOULD_CHECK_CODE_AT_STARTUP_RE_2 = /^(run|acp|serve|web|auth|upgrade|update|doctor|install|rollback|export|import|session|models)$/;
|
|
15
19
|
function preferencesPath(env) {
|
|
16
20
|
return node_path_1.default.join((0, auth_core_1.resolveConfigRoot)(env), 'code-update-preferences.json');
|
|
17
21
|
}
|
|
@@ -71,8 +75,8 @@ function configureCodeStartupChecks(enabled, env = process.env) {
|
|
|
71
75
|
(0, node_fs_1.renameSync)(staging, file);
|
|
72
76
|
return { enabled, preferencesPath: file };
|
|
73
77
|
}
|
|
74
|
-
const disabled = (value) =>
|
|
75
|
-
const enabled = (value) =>
|
|
78
|
+
const disabled = (value) => DISABLED_RE.test(value ?? '');
|
|
79
|
+
const enabled = (value) => ENABLED_RE.test(value ?? '');
|
|
76
80
|
function shouldCheckCodeAtStartup(input) {
|
|
77
81
|
const env = input.env ?? process.env;
|
|
78
82
|
if (!(input.stdinTTY ?? process.stdin.isTTY) ||
|
|
@@ -87,9 +91,9 @@ function shouldCheckCodeAtStartup(input) {
|
|
|
87
91
|
return false;
|
|
88
92
|
if ((0, first_party_harness_update_1.localCodeUpdateOwner)(env) !== 'managed' || readPreferences(env).promptOnStartup === false)
|
|
89
93
|
return false;
|
|
90
|
-
if (input.argv.some((arg) =>
|
|
94
|
+
if (input.argv.some((arg) => SHOULD_CHECK_CODE_AT_STARTUP_RE.test(arg)))
|
|
91
95
|
return false;
|
|
92
|
-
if (
|
|
96
|
+
if (SHOULD_CHECK_CODE_AT_STARTUP_RE_2.test(input.argv[0] ?? ''))
|
|
93
97
|
return false;
|
|
94
98
|
return true;
|
|
95
99
|
}
|
|
@@ -17,6 +17,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
17
17
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
18
18
|
const first_party_harness_updater_1 = require("@skrr-ai/auth-core/first-party-harness-updater");
|
|
19
19
|
const first_party_harness_1 = require("./first-party-harness");
|
|
20
|
+
const LOCAL_CODE_UPDATE_OWNER_RE = /\.app[/\\]/i;
|
|
20
21
|
function localCodeUpdateOwner(env = process.env) {
|
|
21
22
|
if ((0, first_party_harness_1.isDedicatedRuntimeWorkload)(env) ||
|
|
22
23
|
['dedicated-runtime', 'hosted-machine', 'cloud-coding'].includes(env.OVERSKY_DAEMON_SOURCE ?? '') ||
|
|
@@ -34,7 +35,7 @@ function localCodeUpdateOwner(env = process.env) {
|
|
|
34
35
|
/* Resolution reports a disappearing binary separately. */
|
|
35
36
|
}
|
|
36
37
|
if (env.SKRR_FIRST_PARTY_HARNESS_OWNER === 'desktop' ||
|
|
37
|
-
(activePath &&
|
|
38
|
+
(activePath && LOCAL_CODE_UPDATE_OWNER_RE.test(activePath)))
|
|
38
39
|
return 'desktop';
|
|
39
40
|
return ['managed', 'legacy-managed', 'unresolved'].includes(resolution.source) &&
|
|
40
41
|
!resolution.envName
|
|
@@ -51,6 +51,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
51
51
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
52
52
|
const inference_broker_1 = require("@skrr-ai/inference-broker");
|
|
53
53
|
const config_1 = require("./config");
|
|
54
|
+
const SPAWN_ENGINE_RE = /\.(cmd|bat)$/i;
|
|
54
55
|
// Deliberately does NOT import the managed marker any more. This module used to
|
|
55
56
|
// read it to decide whether a run was managed; that decision now arrives as a
|
|
56
57
|
// declared `credentialMode`, and re-introducing the import here would be the first
|
|
@@ -689,7 +690,7 @@ function spawnEngine(bin, args, env, extraEnv, mode,
|
|
|
689
690
|
// every path — including one where this promise rejects.
|
|
690
691
|
outcome, policyEnv) {
|
|
691
692
|
return new Promise((resolve, reject) => {
|
|
692
|
-
const isWinShim = process.platform === 'win32' &&
|
|
693
|
+
const isWinShim = process.platform === 'win32' && SPAWN_ENGINE_RE.test(bin);
|
|
693
694
|
const child = (0, node_child_process_1.spawn)(bin, args, {
|
|
694
695
|
stdio: 'inherit',
|
|
695
696
|
env: engineSpawnEnv(env, extraEnv, mode, policyEnv),
|
package/dist/lib/format.js
CHANGED
|
@@ -16,6 +16,10 @@ exports.zonedTime = zonedTime;
|
|
|
16
16
|
exports.localizeIsoInstants = localizeIsoInstants;
|
|
17
17
|
exports.formatWhen = formatWhen;
|
|
18
18
|
exports.formatElapsed = formatElapsed;
|
|
19
|
+
const TRIM_RE = /[\s,;:(\-—]+$/u;
|
|
20
|
+
const TRUNCATE_AT_WORD_RE = /^\s/u;
|
|
21
|
+
const TRUNCATE_AT_WORD_RE_2 = /\s\S*$/u;
|
|
22
|
+
const COLLAPSE_WHITESPACE_RE = /\s+/g;
|
|
19
23
|
/**
|
|
20
24
|
* Code points that occupy TWO terminal columns (Unicode East Asian Wide and
|
|
21
25
|
* Fullwidth), plus the emoji blocks terminals render double-width.
|
|
@@ -169,11 +173,11 @@ function truncateAtWord(s, max) {
|
|
|
169
173
|
const hard = truncate(s, max);
|
|
170
174
|
const kept = hard.slice(0, -1); // the longest prefix that leaves room for the ellipsis
|
|
171
175
|
const rest = s.slice(kept.length);
|
|
172
|
-
const trim = (value) => value.replace(
|
|
176
|
+
const trim = (value) => value.replace(TRIM_RE, '');
|
|
173
177
|
// The cut already fell on a word boundary.
|
|
174
|
-
if (
|
|
178
|
+
if (TRUNCATE_AT_WORD_RE.test(rest))
|
|
175
179
|
return `${trim(kept)}…`;
|
|
176
|
-
const boundary = kept.search(
|
|
180
|
+
const boundary = kept.search(TRUNCATE_AT_WORD_RE_2);
|
|
177
181
|
if (boundary > 0 && displayWidth(kept.slice(0, boundary)) >= max * 0.4) {
|
|
178
182
|
return `${trim(kept.slice(0, boundary))}…`;
|
|
179
183
|
}
|
|
@@ -225,7 +229,7 @@ function stringifyCell(value, depth) {
|
|
|
225
229
|
* that happened to come through `formatCell`.
|
|
226
230
|
*/
|
|
227
231
|
function collapseWhitespace(value) {
|
|
228
|
-
return value.replace(
|
|
232
|
+
return value.replace(COLLAPSE_WHITESPACE_RE, ' ').trim();
|
|
229
233
|
}
|
|
230
234
|
function renderTable(rows, columns, log) {
|
|
231
235
|
if (rows.length === 0)
|
package/dist/lib/git-task.js
CHANGED
|
@@ -41,6 +41,10 @@ exports.currentGitTaskBranch = currentGitTaskBranch;
|
|
|
41
41
|
exports.checkoutTaskBranch = checkoutTaskBranch;
|
|
42
42
|
const node_child_process_1 = require("node:child_process");
|
|
43
43
|
const taskReferences = __importStar(require("@skrr-ai/data-provider"));
|
|
44
|
+
const SAFE_TASK_BRANCH_REF_RE = /[A-Za-z][A-Za-z0-9]{1,31}-\d{1,12}/;
|
|
45
|
+
const RESOLVE_REMOTE_DEFAULT_RE = /^ref:\s+refs\/heads\/(\S+)\s+HEAD$/m;
|
|
46
|
+
const INSPECT_TASK_DELIVERY_ARTIFACTS_RE = /^[0-9a-f]{40}$/i;
|
|
47
|
+
const INSPECT_TASK_DELIVERY_ARTIFACTS_RE_2 = /^[0-9a-f]{7,40}$/i;
|
|
44
48
|
const COMMIT_ARTIFACT_RE = /(?:^|[\s,;:(/])(?:commit\s+)?([0-9a-f]{7,40})(?=$|[\s,;:)?#])/gi;
|
|
45
49
|
const GITHUB_PR_ARTIFACT_RE = /https:\/\/github\.com\/[^/\s]+\/[^/\s]+\/pull\/\d+/i;
|
|
46
50
|
function runCommand(command, args, cwd) {
|
|
@@ -66,14 +70,14 @@ function commitArtifacts(deliverables) {
|
|
|
66
70
|
return commits;
|
|
67
71
|
}
|
|
68
72
|
function safeTaskBranchRef(taskRef, sha) {
|
|
69
|
-
const match = taskRef.match(
|
|
73
|
+
const match = taskRef.match(SAFE_TASK_BRANCH_REF_RE);
|
|
70
74
|
const label = match?.[0].toUpperCase() || 'recovery';
|
|
71
75
|
return `oversky/task/${label}/recovery-${sha.slice(0, 12)}`;
|
|
72
76
|
}
|
|
73
77
|
function resolveRemoteDefault(cwd, remote, runner) {
|
|
74
78
|
const live = runner('git', ['ls-remote', '--symref', remote, 'HEAD'], cwd);
|
|
75
79
|
if (live.status === 0) {
|
|
76
|
-
const match = live.stdout.match(
|
|
80
|
+
const match = live.stdout.match(RESOLVE_REMOTE_DEFAULT_RE);
|
|
77
81
|
if (match)
|
|
78
82
|
return match[1];
|
|
79
83
|
}
|
|
@@ -103,7 +107,7 @@ function inspectTaskDeliveryArtifacts(opts) {
|
|
|
103
107
|
let containingBranch;
|
|
104
108
|
for (const claimed of commits) {
|
|
105
109
|
const resolved = runner('git', ['rev-parse', '--verify', `${claimed}^{commit}`], cwd);
|
|
106
|
-
if (resolved.status !== 0 ||
|
|
110
|
+
if (resolved.status !== 0 || !INSPECT_TASK_DELIVERY_ARTIFACTS_RE.test(resolved.stdout))
|
|
107
111
|
continue;
|
|
108
112
|
const sha = resolved.stdout.toLowerCase();
|
|
109
113
|
verifiedCommits.push(sha);
|
|
@@ -148,9 +152,10 @@ function inspectTaskDeliveryArtifacts(opts) {
|
|
|
148
152
|
state: pr.mergedAt ? 'integrated' : 'pr_open',
|
|
149
153
|
prUrl,
|
|
150
154
|
...(typeof pr.headRefName === 'string' ? { branch: pr.headRefName } : {}),
|
|
151
|
-
...(headSha &&
|
|
155
|
+
...(headSha && INSPECT_TASK_DELIVERY_ARTIFACTS_RE_2.test(headSha) ? { headSha } : {}),
|
|
152
156
|
...(typeof pr.baseRefName === 'string' ? { integrationBranch: pr.baseRefName } : {}),
|
|
153
|
-
...(typeof mergeCommit === 'string' &&
|
|
157
|
+
...(typeof mergeCommit === 'string' &&
|
|
158
|
+
INSPECT_TASK_DELIVERY_ARTIFACTS_RE_2.test(mergeCommit)
|
|
154
159
|
? { mergeCommit }
|
|
155
160
|
: {}),
|
|
156
161
|
};
|
package/dist/lib/github-tools.js
CHANGED
|
@@ -10,6 +10,9 @@ exports.isGitHubTool = isGitHubTool;
|
|
|
10
10
|
exports.filterGitHubTools = filterGitHubTools;
|
|
11
11
|
exports.isGitHubConnection = isGitHubConnection;
|
|
12
12
|
exports.filterGitHubConnections = filterGitHubConnections;
|
|
13
|
+
const NORMALIZE_GIT_HUB_TOOL_SLUG_RE = /^github[._:-]+/i;
|
|
14
|
+
const NORMALIZE_GIT_HUB_TOOL_SLUG_RE_2 = /[\s.:-]+/g;
|
|
15
|
+
const IS_GIT_HUB_TOOL_RE = /^GITHUB(_|$)/i;
|
|
13
16
|
exports.GITHUB_TOOLKIT = 'github';
|
|
14
17
|
exports.DEFAULT_INTEGRATION_PROVIDER = 'composio';
|
|
15
18
|
const FATAL_POLL_STATUSES = new Set([401, 403, 503]);
|
|
@@ -23,8 +26,8 @@ function normalizeGitHubToolSlug(value) {
|
|
|
23
26
|
if (!raw) {
|
|
24
27
|
throw new Error('GitHub tool slug is required.');
|
|
25
28
|
}
|
|
26
|
-
const withoutPrefix = raw.replace(
|
|
27
|
-
const normalized = withoutPrefix.replace(
|
|
29
|
+
const withoutPrefix = raw.replace(NORMALIZE_GIT_HUB_TOOL_SLUG_RE, '');
|
|
30
|
+
const normalized = withoutPrefix.replace(NORMALIZE_GIT_HUB_TOOL_SLUG_RE_2, '_').toUpperCase();
|
|
28
31
|
return normalized.startsWith('GITHUB_') ? normalized : `GITHUB_${normalized}`;
|
|
29
32
|
}
|
|
30
33
|
function normalizeGitHubToolList(value) {
|
|
@@ -55,7 +58,7 @@ function assertTrustedIntegrationRedirectUrl(redirectUrl) {
|
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
function isGitHubTool(tool) {
|
|
58
|
-
return
|
|
61
|
+
return IS_GIT_HUB_TOOL_RE.test(tool.name || '');
|
|
59
62
|
}
|
|
60
63
|
function filterGitHubTools(tools) {
|
|
61
64
|
return tools.filter(isGitHubTool);
|
package/dist/lib/harnesses.js
CHANGED
|
@@ -28,6 +28,8 @@ exports.performHarnessLeaseAction = performHarnessLeaseAction;
|
|
|
28
28
|
exports.setHarnessLeaseBilling = setHarnessLeaseBilling;
|
|
29
29
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
30
30
|
const api_fetch_1 = require("./api-fetch");
|
|
31
|
+
const DESCRIBE_HEALTH_REASON_SENTENCES_RE = /\.$/;
|
|
32
|
+
const PARSE_HARNESS_PRUNE_AGE_RE = /^(\d+)\s*(m|h|d)?$/i;
|
|
31
33
|
/**
|
|
32
34
|
* A machine's health reason codes as the sentences a person reads, from the
|
|
33
35
|
* copy map the web renders too (`describeMachineHealthReasons`,
|
|
@@ -47,7 +49,7 @@ function describeHealthReasonSentences(reasons, state) {
|
|
|
47
49
|
return lines
|
|
48
50
|
.map((line) => line.known || line.codes.length === 0
|
|
49
51
|
? line.sentence
|
|
50
|
-
: `${line.sentence.replace(
|
|
52
|
+
: `${line.sentence.replace(DESCRIBE_HEALTH_REASON_SENTENCES_RE, '')} (${line.codes.join(', ')}).`)
|
|
51
53
|
.join(' ');
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
@@ -202,7 +204,7 @@ async function pruneHarnesses(options = { dryRun: true }) {
|
|
|
202
204
|
* window whatever this says.
|
|
203
205
|
*/
|
|
204
206
|
function parseHarnessPruneAge(value) {
|
|
205
|
-
const match = value.trim().match(
|
|
207
|
+
const match = value.trim().match(PARSE_HARNESS_PRUNE_AGE_RE);
|
|
206
208
|
if (!match) {
|
|
207
209
|
throw new Error(`Invalid --older-than value "${value}". Use a number with m, h or d, such as 90m, 36h or 7d.`);
|
|
208
210
|
}
|
|
@@ -29,6 +29,7 @@ exports.offlineForLabel = offlineForLabel;
|
|
|
29
29
|
const api_fetch_1 = require("./api-fetch");
|
|
30
30
|
const edge_error_page_1 = require("./edge-error-page");
|
|
31
31
|
const machine_spend_cap_1 = require("./machine-spend-cap");
|
|
32
|
+
const PARSE_DURATION_MS_RE = /^(\d+)(ms|s|m|h)?$/i;
|
|
32
33
|
function curateHostedMachineList(response) {
|
|
33
34
|
return {
|
|
34
35
|
object: 'list',
|
|
@@ -146,7 +147,7 @@ function isHostedMachineTerminal(session) {
|
|
|
146
147
|
function parseDurationMs(value, flagName) {
|
|
147
148
|
if (!value)
|
|
148
149
|
return undefined;
|
|
149
|
-
const match = value.trim().match(
|
|
150
|
+
const match = value.trim().match(PARSE_DURATION_MS_RE);
|
|
150
151
|
if (!match)
|
|
151
152
|
throw new Error(`Invalid ${flagName} value: ${value}`);
|
|
152
153
|
const amount = Number(match[1]);
|
package/dist/lib/html-text.js
CHANGED
|
@@ -15,9 +15,25 @@
|
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.htmlToDisplayText = htmlToDisplayText;
|
|
18
|
+
const LOOKS_LIKE_HTML_RE = /<\/?[a-z][^>]*>/i;
|
|
19
|
+
const HTML_TO_DISPLAY_TEXT_RE = /<video\b([^>]*)>([\s\S]*?)<\/video\s*>|<video\b([^>]*)\/?>/gi;
|
|
20
|
+
const HTML_TO_DISPLAY_TEXT_RE_2 = /<source\b[^>]*>/i;
|
|
21
|
+
const HTML_TO_DISPLAY_TEXT_RE_3 = /<img\b[^>]*>/gi;
|
|
22
|
+
const HTML_TO_DISPLAY_TEXT_RE_4 = /<br\s*\/?>/gi;
|
|
23
|
+
const HTML_TO_DISPLAY_TEXT_RE_5 = /<\/(p|div|li|h[1-6])>/gi;
|
|
24
|
+
const HTML_TO_DISPLAY_TEXT_RE_6 = /<li[^>]*>/gi;
|
|
25
|
+
const HTML_TO_DISPLAY_TEXT_RE_7 = /<[^>]+>/g;
|
|
26
|
+
const HTML_TO_DISPLAY_TEXT_RE_8 = / /g;
|
|
27
|
+
const HTML_TO_DISPLAY_TEXT_RE_9 = /'/g;
|
|
28
|
+
const HTML_TO_DISPLAY_TEXT_RE_10 = /"/g;
|
|
29
|
+
const HTML_TO_DISPLAY_TEXT_RE_11 = /</g;
|
|
30
|
+
const HTML_TO_DISPLAY_TEXT_RE_12 = />/g;
|
|
31
|
+
const HTML_TO_DISPLAY_TEXT_RE_13 = /&/g;
|
|
32
|
+
const HTML_TO_DISPLAY_TEXT_RE_14 = /[ \t]+/g;
|
|
33
|
+
const HTML_TO_DISPLAY_TEXT_RE_15 = /\n{3,}/g;
|
|
18
34
|
/** Cheap, deliberate: a tag-shaped substring is the only trigger. */
|
|
19
35
|
function looksLikeHtml(value) {
|
|
20
|
-
return
|
|
36
|
+
return LOOKS_LIKE_HTML_RE.test(value);
|
|
21
37
|
}
|
|
22
38
|
/** Pull one attribute out of a tag body — `src="…"`, `src='…'`, `src=…`. */
|
|
23
39
|
function tagAttr(tag, name) {
|
|
@@ -34,32 +50,33 @@ function htmlToDisplayText(value) {
|
|
|
34
50
|
// it becomes a labelled link to the stable reference. The element's
|
|
35
51
|
// children — `<source>` and fallback text — go with it; a `<source>` src
|
|
36
52
|
// is used when the element itself carries none (OSK-10129).
|
|
37
|
-
.replace(
|
|
53
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE, (_m, open, inner, bare) => {
|
|
38
54
|
const tag = String(open ?? bare ?? '');
|
|
39
|
-
const src = tagAttr(tag, 'src') ||
|
|
55
|
+
const src = tagAttr(tag, 'src') ||
|
|
56
|
+
tagAttr(HTML_TO_DISPLAY_TEXT_RE_2.exec(inner ?? '')?.[0] ?? '', 'src');
|
|
40
57
|
const title = tagAttr(tag, 'title');
|
|
41
58
|
return src ? `[video: ${title || 'recording'}](${src})\n` : '';
|
|
42
59
|
})
|
|
43
60
|
// An <img> carries meaning — the asset reference or URL — that the
|
|
44
61
|
// generic tag strip below would erase entirely. Keep it as a markdown
|
|
45
62
|
// image so `task-asset:<id>` refs stay legible in a terminal (OSK-9856).
|
|
46
|
-
.replace(
|
|
63
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_3, (tag) => {
|
|
47
64
|
const src = tagAttr(tag, 'src');
|
|
48
65
|
const alt = tagAttr(tag, 'alt');
|
|
49
66
|
return src ? `` : '';
|
|
50
67
|
})
|
|
51
|
-
.replace(
|
|
52
|
-
.replace(
|
|
53
|
-
.replace(
|
|
54
|
-
.replace(
|
|
55
|
-
.replace(
|
|
56
|
-
.replace(
|
|
57
|
-
.replace(
|
|
58
|
-
.replace(
|
|
59
|
-
.replace(
|
|
68
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_4, '\n')
|
|
69
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_5, '\n')
|
|
70
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_6, ' - ')
|
|
71
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_7, '')
|
|
72
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_8, ' ')
|
|
73
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_9, "'")
|
|
74
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_10, '"')
|
|
75
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_11, '<')
|
|
76
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_12, '>')
|
|
60
77
|
// `&` LAST, or `&lt;` would decode twice into a bare `<`.
|
|
61
|
-
.replace(
|
|
62
|
-
.replace(
|
|
63
|
-
.replace(
|
|
78
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_13, '&')
|
|
79
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_14, ' ')
|
|
80
|
+
.replace(HTML_TO_DISPLAY_TEXT_RE_15, '\n\n')
|
|
64
81
|
.trim());
|
|
65
82
|
}
|
|
@@ -12,6 +12,7 @@ exports.moveEntry = moveEntry;
|
|
|
12
12
|
exports.findBlock = findBlock;
|
|
13
13
|
exports.renderInstructionBlockDetail = renderInstructionBlockDetail;
|
|
14
14
|
const node_crypto_1 = require("node:crypto");
|
|
15
|
+
const PARSE_BINDINGS_RE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
15
16
|
/**
|
|
16
17
|
* Helpers shared by the reusable Block Library commands and the per-Agent
|
|
17
18
|
* composition commands. Keep this deliberately about data shape, not HTTP:
|
|
@@ -48,7 +49,7 @@ function parseBindings(values) {
|
|
|
48
49
|
throw new Error(`Invalid binding "${value}". Use --binding key=value.`);
|
|
49
50
|
}
|
|
50
51
|
const key = value.slice(0, separator).trim();
|
|
51
|
-
if (
|
|
52
|
+
if (!PARSE_BINDINGS_RE.test(key)) {
|
|
52
53
|
throw new Error(`Invalid binding key "${key}".`);
|
|
53
54
|
}
|
|
54
55
|
if (Object.prototype.hasOwnProperty.call(bindings, key)) {
|