@skrr-ai/cli 0.1.146 → 0.1.148
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/triggers/policy.js +11 -1
- package/dist/commands/agents/visibility.js +2 -1
- package/dist/commands/balance/show.js +28 -5
- 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/preflight.js +5 -1
- package/dist/commands/commitments/trigger-status.js +2 -1
- package/dist/commands/commitments/wake-capabilities.d.ts +2 -0
- package/dist/commands/commitments/wake-capabilities.js +16 -0
- 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.d.ts +33 -3
- package/dist/lib/balance.js +39 -7
- 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 +13 -0
- package/dist/lib/commitments.js +24 -9
- 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/ingress.js +2 -1
- 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/preflight-copy.js +31 -0
- 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 +21 -0
- package/dist/lib/triggers.js +41 -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
|
@@ -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
|
}
|
package/dist/lib/ingress.js
CHANGED
|
@@ -42,7 +42,8 @@ function renderIngressList(rows, log) {
|
|
|
42
42
|
rate: `${r.rateLimit.maxPerMinute}/min`,
|
|
43
43
|
state: r.enabled ? 'enabled' : 'disabled',
|
|
44
44
|
})), [
|
|
45
|
-
|
|
45
|
+
// Labels share a run tag and differ at the end, so clip the middle (OSK-22596).
|
|
46
|
+
{ key: 'label', header: 'LABEL', maxWidth: 26, truncate: 'middle' },
|
|
46
47
|
{ key: 'type', header: 'EVENT TYPE', maxWidth: 24 },
|
|
47
48
|
{ key: 'published', header: 'PUBLISHED', maxWidth: 10 },
|
|
48
49
|
{ key: 'rejected', header: 'REJECTED', maxWidth: 9 },
|
|
@@ -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)) {
|
package/dist/lib/iso-instant.js
CHANGED
|
@@ -25,6 +25,8 @@ exports.parseUtcInstant = parseUtcInstant;
|
|
|
25
25
|
exports.formatUtcInstant = formatUtcInstant;
|
|
26
26
|
exports.formatLocalInstant = formatLocalInstant;
|
|
27
27
|
exports.describeInstant = describeInstant;
|
|
28
|
+
const PARSE_UTC_INSTANT_RE = /\.000Z$/;
|
|
29
|
+
const DESCRIBE_INSTANT_RE = / (UTC|GMT)$/;
|
|
28
30
|
const EXAMPLE = '2026-12-01T09:00:00Z';
|
|
29
31
|
const UTC_INSTANT = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?Z$/;
|
|
30
32
|
const ZONELESS = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?$/;
|
|
@@ -111,7 +113,7 @@ function parseUtcInstant(raw, label = '--at') {
|
|
|
111
113
|
let converted = '';
|
|
112
114
|
if (!calendarProblem(year, month, day) && !clockProblem(hour, minute, second)) {
|
|
113
115
|
const at = new Date(Date.UTC(year, month - 1, day, hour, minute, second) - shiftMinutes * 60_000);
|
|
114
|
-
converted = ` (${value} is ${at.toISOString().replace(
|
|
116
|
+
converted = ` (${value} is ${at.toISOString().replace(PARSE_UTC_INSTANT_RE, 'Z')})`;
|
|
115
117
|
}
|
|
116
118
|
return fail('numeric_offset', `Numeric offsets such as ${offset[8]}${offset[9]}:${offset[10]} are not accepted; convert the time to UTC and end it with Z${converted}.`);
|
|
117
119
|
}
|
|
@@ -126,7 +128,7 @@ function parseUtcInstant(raw, label = '--at') {
|
|
|
126
128
|
}
|
|
127
129
|
/** `2027-02-02T09:00:00Z` - the instant in UTC, whole seconds when there are no milliseconds. */
|
|
128
130
|
function formatUtcInstant(date) {
|
|
129
|
-
return date.toISOString().replace(
|
|
131
|
+
return date.toISOString().replace(PARSE_UTC_INSTANT_RE, 'Z');
|
|
130
132
|
}
|
|
131
133
|
/**
|
|
132
134
|
* `2027-02-02 01:00:00 PST` - the same instant on this machine's wall clock, with the
|
|
@@ -156,7 +158,7 @@ function formatLocalInstant(date, timeZone) {
|
|
|
156
158
|
function describeInstant(date, timeZone) {
|
|
157
159
|
const utc = formatUtcInstant(date);
|
|
158
160
|
const local = formatLocalInstant(date, timeZone);
|
|
159
|
-
if (
|
|
161
|
+
if (DESCRIBE_INSTANT_RE.test(local))
|
|
160
162
|
return utc;
|
|
161
163
|
return `${utc} (${local})`;
|
|
162
164
|
}
|
package/dist/lib/keychain.js
CHANGED
|
@@ -121,6 +121,12 @@ const os = __importStar(require("node:os"));
|
|
|
121
121
|
const path = __importStar(require("node:path"));
|
|
122
122
|
const cred_envelope_1 = require("./cred-envelope");
|
|
123
123
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
124
|
+
const DISPLACED_SERVICE_RE = /^[A-Za-z0-9_-]{1,64}$/;
|
|
125
|
+
const EXEC_READ_SLOT_RE = /\n$/;
|
|
126
|
+
const QUOTE_FOR_SECURITY_INTERACTIVE_RE = /\\/g;
|
|
127
|
+
const QUOTE_FOR_SECURITY_INTERACTIVE_RE_2 = /"/g;
|
|
128
|
+
const DISCOVER_LEGACY_BRAND_SERVICES_RE = /"svce"<blob>="([^"]*)"/g;
|
|
129
|
+
const MODULE_RE = /\./g;
|
|
124
130
|
/** Service-name prefix. Always followed by `.<profile>`. */
|
|
125
131
|
const SERVICE_BASE = 'ai.skrr.cli';
|
|
126
132
|
/** Default profile when no profile flag or environment override is present. */
|
|
@@ -244,7 +250,7 @@ function currentService() {
|
|
|
244
250
|
function displacedService(cliId) {
|
|
245
251
|
// A cliId is `cli_<hex>` in practice; anything else is hashed so the service
|
|
246
252
|
// name never carries characters `security -i` quoting has to worry about.
|
|
247
|
-
const safe =
|
|
253
|
+
const safe = DISPLACED_SERVICE_RE.test(cliId)
|
|
248
254
|
? cliId
|
|
249
255
|
: (0, node_crypto_1.createHash)('sha256').update(cliId).digest('hex').slice(0, 16);
|
|
250
256
|
return `${legacyService()}.cli-${safe}`;
|
|
@@ -345,7 +351,7 @@ function readRawSlot(account, service) {
|
|
|
345
351
|
function execReadSlot(account, service) {
|
|
346
352
|
try {
|
|
347
353
|
const out = (0, node_child_process_1.execFileSync)('security', ['find-generic-password', '-s', service, '-a', account, '-w'], { stdio: ['ignore', 'pipe', 'ignore'], encoding: 'utf-8' });
|
|
348
|
-
const trimmed = out.replace(
|
|
354
|
+
const trimmed = out.replace(EXEC_READ_SLOT_RE, '');
|
|
349
355
|
if (trimmed.length === 0)
|
|
350
356
|
return null;
|
|
351
357
|
return trimmed;
|
|
@@ -427,7 +433,11 @@ function foreignOwnerRootAt(service) {
|
|
|
427
433
|
* `security` accepts double-quoted args with `\"` and `\\` backslash escapes.
|
|
428
434
|
*/
|
|
429
435
|
function quoteForSecurityInteractive(v) {
|
|
430
|
-
return
|
|
436
|
+
return ('"' +
|
|
437
|
+
v
|
|
438
|
+
.replace(QUOTE_FOR_SECURITY_INTERACTIVE_RE, '\\\\')
|
|
439
|
+
.replace(QUOTE_FOR_SECURITY_INTERACTIVE_RE_2, '\\"') +
|
|
440
|
+
'"');
|
|
431
441
|
}
|
|
432
442
|
function writeSlot(account, value, service = currentService(), raw = false) {
|
|
433
443
|
forgetSlotInPass(account, service);
|
|
@@ -664,7 +674,7 @@ function discoverLegacyBrandServices() {
|
|
|
664
674
|
return [];
|
|
665
675
|
}
|
|
666
676
|
const found = new Set();
|
|
667
|
-
for (const match of dump.matchAll(
|
|
677
|
+
for (const match of dump.matchAll(DISCOVER_LEGACY_BRAND_SERVICES_RE)) {
|
|
668
678
|
const service = match[1];
|
|
669
679
|
if (auth_core_1.LEGACY_NATIVE_ID_PREFIXES.some((prefix) => service.startsWith(`${prefix}.`))) {
|
|
670
680
|
found.add(service);
|
|
@@ -744,7 +754,7 @@ function deleteLegacyBrandEntries(options = {}) {
|
|
|
744
754
|
* two previous prefixes. Positive on the whole name, so the bare `.cli` word alone, or a
|
|
745
755
|
* service that merely begins with these words, is not one.
|
|
746
756
|
*/
|
|
747
|
-
const RETIRED_CLI_SERVICE_PATTERN = new RegExp(`^(?:${auth_core_1.LEGACY_NATIVE_ID_PREFIXES.map((prefix) => prefix.replace(
|
|
757
|
+
const RETIRED_CLI_SERVICE_PATTERN = new RegExp(`^(?:${auth_core_1.LEGACY_NATIVE_ID_PREFIXES.map((prefix) => prefix.replace(MODULE_RE, '\\.')).join('|')})` +
|
|
748
758
|
'\\.cli\\.[A-Za-z0-9][A-Za-z0-9._-]*$');
|
|
749
759
|
/**
|
|
750
760
|
* Whether the legacy sweep deletes this previous-brand service. Named, not matched by prefix:
|
package/dist/lib/label-scope.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.normalizeLabelColor = normalizeLabelColor;
|
|
|
16
16
|
exports.resolveLabelScope = resolveLabelScope;
|
|
17
17
|
exports.resolveApplicableTo = resolveApplicableTo;
|
|
18
18
|
const core_1 = require("@oclif/core");
|
|
19
|
+
const NORMALIZE_LABEL_COLOR_RE = /^#/;
|
|
19
20
|
exports.LABEL_SCOPES = ['user', 'workspace'];
|
|
20
21
|
/**
|
|
21
22
|
* Scopes whose id the server cannot infer, so `--scope-id` must name it.
|
|
@@ -43,7 +44,7 @@ exports.LABEL_APPLICABLE = ['task', 'space', 'goal', 'routine'];
|
|
|
43
44
|
*/
|
|
44
45
|
exports.HEX_COLOR_RE = /^#?[0-9a-fA-F]{6}$/;
|
|
45
46
|
function normalizeLabelColor(input) {
|
|
46
|
-
return input.replace(
|
|
47
|
+
return input.replace(NORMALIZE_LABEL_COLOR_RE, '');
|
|
47
48
|
}
|
|
48
49
|
/** `--scope` / `--scope-id`, shared by every `skrr labels` command. */
|
|
49
50
|
exports.labelScopeFlags = {
|
|
@@ -34,6 +34,10 @@ const node_os_1 = __importDefault(require("node:os"));
|
|
|
34
34
|
const node_path_1 = __importDefault(require("node:path"));
|
|
35
35
|
const daemonBroker_1 = require("./daemonBroker");
|
|
36
36
|
const exec_runtime_binary_1 = require("./exec-runtime-binary");
|
|
37
|
+
const IS_RUNTIME_NAME_RE = /\.(exe|cmd)$/;
|
|
38
|
+
const SCRIPT_FROM_ARGS_RE = /^\S+/;
|
|
39
|
+
const SCRIPT_FROM_ARGS_RE_2 = /\s+/;
|
|
40
|
+
const LIVE_PID_FROM_LOCK_INFO_RE = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
|
37
41
|
function safeRealpath(deps, p) {
|
|
38
42
|
try {
|
|
39
43
|
return deps.realpath(p);
|
|
@@ -43,10 +47,7 @@ function safeRealpath(deps, p) {
|
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
function isRuntimeName(p) {
|
|
46
|
-
const base = node_path_1.default
|
|
47
|
-
.basename(p)
|
|
48
|
-
.toLowerCase()
|
|
49
|
-
.replace(/\.(exe|cmd)$/, '');
|
|
50
|
+
const base = node_path_1.default.basename(p).toLowerCase().replace(IS_RUNTIME_NAME_RE, '');
|
|
50
51
|
return exec_runtime_binary_1.RUNTIME_BINARY_NAMES.some((name) => base === name || base.startsWith(`${name}-`));
|
|
51
52
|
}
|
|
52
53
|
/** The profile a forwarded argv names, `default` otherwise. */
|
|
@@ -151,8 +152,10 @@ const INTERPRETER_VALUE_OPTIONS = new Set([
|
|
|
151
152
|
function scriptFromArgs(exec, args) {
|
|
152
153
|
if (isRuntimeName(exec))
|
|
153
154
|
return null;
|
|
154
|
-
const rest = args.startsWith(exec)
|
|
155
|
-
|
|
155
|
+
const rest = args.startsWith(exec)
|
|
156
|
+
? args.slice(exec.length)
|
|
157
|
+
: args.replace(SCRIPT_FROM_ARGS_RE, '');
|
|
158
|
+
const tokens = rest.split(SCRIPT_FROM_ARGS_RE_2).filter(Boolean);
|
|
156
159
|
for (let i = 0; i < tokens.length; i += 1) {
|
|
157
160
|
const token = tokens[i];
|
|
158
161
|
if (INTERPRETER_VALUE_OPTIONS.has(token)) {
|
|
@@ -171,7 +174,7 @@ function scriptFromArgs(exec, args) {
|
|
|
171
174
|
* need to address that live process during recovery (OSK-12807).
|
|
172
175
|
*/
|
|
173
176
|
function livePidFromLockInfo(profile, homeDir = node_os_1.default.homedir()) {
|
|
174
|
-
if (
|
|
177
|
+
if (!LIVE_PID_FROM_LOCK_INFO_RE.test(profile) || profile === '..')
|
|
175
178
|
return null;
|
|
176
179
|
try {
|
|
177
180
|
const lockInfoPath = node_path_1.default.join(homeDir, '.skrr', 'profiles', profile, 'daemon.lock.info.json');
|
package/dist/lib/local-skills.js
CHANGED
|
@@ -14,6 +14,10 @@ exports.summarizeSkillActionImport = summarizeSkillActionImport;
|
|
|
14
14
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
15
15
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
16
16
|
const instruction_input_1 = require("./instruction-input");
|
|
17
|
+
const RESOLVE_LOCAL_SKILL_REFS_RE = /^\//;
|
|
18
|
+
const WITH_SKILL_INVOCATIONS_RE = /[.*+?^${}()|[\]\\]/g;
|
|
19
|
+
const LOOKS_LIKE_SKILL_PATH_RE = /[\\/]/;
|
|
20
|
+
const PARSE_RE = /^(\d+)\.(\d+)\.(\d+)/;
|
|
17
21
|
/**
|
|
18
22
|
* Which machine to ask, or why there is no single answer.
|
|
19
23
|
*
|
|
@@ -67,7 +71,7 @@ function resolveLocalSkillRefs(inventory, requested, options = {}) {
|
|
|
67
71
|
const problems = [];
|
|
68
72
|
const seen = new Set();
|
|
69
73
|
for (const raw of requested) {
|
|
70
|
-
const request = raw.trim().replace(
|
|
74
|
+
const request = raw.trim().replace(RESOLVE_LOCAL_SKILL_REFS_RE, '');
|
|
71
75
|
const slash = request.lastIndexOf('/');
|
|
72
76
|
const root = slash > 0 ? request.slice(0, slash) : null;
|
|
73
77
|
const name = slash > 0 ? request.slice(slash + 1) : request;
|
|
@@ -108,14 +112,14 @@ function resolveLocalSkillRefs(inventory, requested, options = {}) {
|
|
|
108
112
|
* the agent reads the same invocation either way.
|
|
109
113
|
*/
|
|
110
114
|
function withSkillInvocations(prompt, refs) {
|
|
111
|
-
const missing = refs.filter((ref) => !new RegExp(`(^|\\s)/${ref.name.replace(
|
|
115
|
+
const missing = refs.filter((ref) => !new RegExp(`(^|\\s)/${ref.name.replace(WITH_SKILL_INVOCATIONS_RE, '\\$&')}(?=\\s|$)`).test(prompt));
|
|
112
116
|
if (missing.length === 0)
|
|
113
117
|
return prompt;
|
|
114
118
|
return `${missing.map((ref) => `/${ref.name}`).join(' ')} ${prompt}`;
|
|
115
119
|
}
|
|
116
120
|
/** Whether a skill argument names a place on disk rather than a store id. */
|
|
117
121
|
function looksLikeSkillPath(arg) {
|
|
118
|
-
return
|
|
122
|
+
return LOOKS_LIKE_SKILL_PATH_RE.test(arg) || arg.startsWith('.') || arg.startsWith('~');
|
|
119
123
|
}
|
|
120
124
|
/**
|
|
121
125
|
* Where a skill with this name exists on the caller's connected machines.
|
|
@@ -125,7 +129,7 @@ function looksLikeSkillPath(arg) {
|
|
|
125
129
|
* than replacing the real error with a second one.
|
|
126
130
|
*/
|
|
127
131
|
async function findLocalSkillsNamed(name) {
|
|
128
|
-
const bare = name.replace(
|
|
132
|
+
const bare = name.replace(RESOLVE_LOCAL_SKILL_REFS_RE, '');
|
|
129
133
|
let active = [];
|
|
130
134
|
try {
|
|
131
135
|
active = (await data_provider_1.dataService.getDaemons()).active ?? [];
|
|
@@ -177,7 +181,7 @@ function describeStoreSkillMiss(arg, sightings, command) {
|
|
|
177
181
|
return [
|
|
178
182
|
`No store skill has the id "${arg}", but a skill named "${arg}" is on your machine: ${where}.`,
|
|
179
183
|
'It needs no install.',
|
|
180
|
-
`→ Use it on a turn: skrr agents chat <agent-id> --local-skill ${arg.replace(
|
|
184
|
+
`→ Use it on a turn: skrr agents chat <agent-id> --local-skill ${arg.replace(RESOLVE_LOCAL_SKILL_REFS_RE, '')}`,
|
|
181
185
|
].join('\n');
|
|
182
186
|
}
|
|
183
187
|
return [
|
|
@@ -202,7 +206,7 @@ exports.SKILL_CONVENTION_DISCOVERY_SINCE = '0.8.44';
|
|
|
202
206
|
*/
|
|
203
207
|
function daemonPredates(version, floor) {
|
|
204
208
|
const parse = (value) => {
|
|
205
|
-
const match =
|
|
209
|
+
const match = PARSE_RE.exec(String(value ?? '').trim());
|
|
206
210
|
return match ? match.slice(1).map(Number) : null;
|
|
207
211
|
};
|
|
208
212
|
const have = parse(version);
|
package/dist/lib/login.js
CHANGED
|
@@ -40,6 +40,7 @@ const daemonBroker_1 = require("./daemonBroker");
|
|
|
40
40
|
const daemonIslandProfile_1 = require("./daemonIslandProfile");
|
|
41
41
|
const dedicated_guest_1 = require("./dedicated-guest");
|
|
42
42
|
const daemonBrokerRefusal_1 = require("./daemonBrokerRefusal");
|
|
43
|
+
const CLI_LOGIN_RE = /\/+$/;
|
|
43
44
|
/**
|
|
44
45
|
* What a shell with no terminal can do instead (OSK-12117). The refusal used to
|
|
45
46
|
* name only CI tokens, which is not a sign-in: an agent session asking for one
|
|
@@ -81,7 +82,7 @@ function describeBrokerBaseUrlMismatch(failure, serverUrl) {
|
|
|
81
82
|
*/
|
|
82
83
|
async function cliLogin(opts = {}) {
|
|
83
84
|
const cfg = (0, config_1.loadConfig)();
|
|
84
|
-
const serverUrl = (opts.serverUrl ?? cfg.baseURL).replace(
|
|
85
|
+
const serverUrl = (opts.serverUrl ?? cfg.baseURL).replace(CLI_LOGIN_RE, '');
|
|
85
86
|
const scope = opts.scope ?? 'cli';
|
|
86
87
|
// Persist the cliId on first login so future refreshes present a
|
|
87
88
|
// stable device identity. A named profile signing in with no credential is
|
|
@@ -316,7 +317,7 @@ async function cliLogin(opts = {}) {
|
|
|
316
317
|
*/
|
|
317
318
|
async function cliLoginWithRefreshToken(opts) {
|
|
318
319
|
const cfg = (0, config_1.loadConfig)();
|
|
319
|
-
const serverUrl = (opts.serverUrl ?? cfg.baseURL).replace(
|
|
320
|
+
const serverUrl = (opts.serverUrl ?? cfg.baseURL).replace(CLI_LOGIN_RE, '');
|
|
320
321
|
// Persist the cliId BEFORE the exchange so subsequent commands have
|
|
321
322
|
// device identity even if the network call fails halfway through and
|
|
322
323
|
// the operator retries. The refresh exchange itself is idempotent on
|