@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
|
@@ -4,6 +4,7 @@ exports.localPlatformUpdateDependencies = void 0;
|
|
|
4
4
|
const update_check_1 = require("./update-check");
|
|
5
5
|
const first_party_harness_update_1 = require("./first-party-harness-update");
|
|
6
6
|
const exec_runtime_binary_1 = require("./exec-runtime-binary");
|
|
7
|
+
const DAEMON_STATUS_RE = /^v?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/;
|
|
7
8
|
function parseDaemonStatus(stdout) {
|
|
8
9
|
let parsed;
|
|
9
10
|
try {
|
|
@@ -30,9 +31,7 @@ async function daemonStatus(check) {
|
|
|
30
31
|
? await (0, exec_runtime_binary_1.execRuntimeBinaryCapture)(['update', '--check'], { timeoutMs: 8000 })
|
|
31
32
|
: null;
|
|
32
33
|
const version = await (0, exec_runtime_binary_1.execRuntimeBinaryCapture)(['--version'], { timeoutMs: 2500 });
|
|
33
|
-
const installedVersion = version.stdout
|
|
34
|
-
.trim()
|
|
35
|
-
.match(/^v?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/)?.[1] ?? null;
|
|
34
|
+
const installedVersion = version.stdout.trim().match(DAEMON_STATUS_RE)?.[1] ?? null;
|
|
36
35
|
return {
|
|
37
36
|
state: legacy && legacy.code !== 0 ? 'check-failed' : 'legacy-runtime',
|
|
38
37
|
owner: 'legacy-runtime',
|
|
@@ -27,6 +27,7 @@ exports.rateLimitWaitMs = rateLimitWaitMs;
|
|
|
27
27
|
exports.maxRateLimitRetries = maxRateLimitRetries;
|
|
28
28
|
exports.isRateLimitRetrySafe = isRateLimitRetrySafe;
|
|
29
29
|
exports.fetchWithRateLimitRetry = fetchWithRateLimitRetry;
|
|
30
|
+
const PARSE_RETRY_AFTER_MS_RE = /^\d+(\.\d+)?$/;
|
|
30
31
|
exports.DEFAULT_MAX_RATE_LIMIT_RETRIES = 2;
|
|
31
32
|
exports.MAX_RATE_LIMIT_WAIT_MS = 10_000;
|
|
32
33
|
const MIN_WAIT_MS = 250;
|
|
@@ -35,7 +36,7 @@ function parseRetryAfterMs(value, now = Date.now()) {
|
|
|
35
36
|
if (!value)
|
|
36
37
|
return undefined;
|
|
37
38
|
const trimmed = value.trim();
|
|
38
|
-
if (
|
|
39
|
+
if (PARSE_RETRY_AFTER_MS_RE.test(trimmed))
|
|
39
40
|
return Math.round(Number(trimmed) * 1000);
|
|
40
41
|
const at = Date.parse(trimmed);
|
|
41
42
|
if (Number.isNaN(at))
|
package/dist/lib/reflection.js
CHANGED
|
@@ -36,6 +36,7 @@ exports.buildReflectionTriggerPayload = buildReflectionTriggerPayload;
|
|
|
36
36
|
* reuse the exact same prompt, cadence bounds, and payload shape.
|
|
37
37
|
*/
|
|
38
38
|
const triggers_1 = require("./triggers");
|
|
39
|
+
const PARSE_CADENCE_TO_MINUTES_RE = /^\d+(\.\d+)?$/;
|
|
39
40
|
/** Stable label used to locate an agent's single self-reflection trigger. */
|
|
40
41
|
exports.REFLECTION_LABEL = 'self-reflection';
|
|
41
42
|
/** Default cadence: reflect every 6 hours. */
|
|
@@ -109,7 +110,7 @@ function parseCadenceToMinutes(input) {
|
|
|
109
110
|
throw new InvalidCadenceError('Empty cadence. Use a form like "6h", "90m", "2h30m", or "360".');
|
|
110
111
|
}
|
|
111
112
|
// Bare number → minutes.
|
|
112
|
-
if (
|
|
113
|
+
if (PARSE_CADENCE_TO_MINUTES_RE.test(raw)) {
|
|
113
114
|
return requirePositiveMinutes(Math.round(Number(raw)), raw);
|
|
114
115
|
}
|
|
115
116
|
if (!CADENCE_FULL.test(raw)) {
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.translateRequestFieldPaths = translateRequestFieldPaths;
|
|
18
|
+
const ESCAPE_REG_EXP_RE = /[.*+?^${}()|[\]\\]/g;
|
|
18
19
|
function escapeRegExp(value) {
|
|
19
|
-
return value.replace(
|
|
20
|
+
return value.replace(ESCAPE_REG_EXP_RE, '\\$&');
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Replace every declared body path in `message` with its flag. Longest path first, so
|
|
@@ -7,6 +7,7 @@ exports.daemonLoginRecoveryCommand = daemonLoginRecoveryCommand;
|
|
|
7
7
|
exports.verifyRuntimeStart = verifyRuntimeStart;
|
|
8
8
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
9
9
|
const keychain_1 = require("./keychain");
|
|
10
|
+
const QUOTE_SHELL_ARG_RE = /^[A-Za-z0-9_./:@+=-]+$/;
|
|
10
11
|
/** Matches the runtime's EX_CONFIG result for a permanent local configuration failure. */
|
|
11
12
|
exports.DAEMON_START_REAUTH_EXIT = 78;
|
|
12
13
|
/** Matches the runtime's EX_TEMPFAIL result when a service cannot remain running. */
|
|
@@ -23,7 +24,7 @@ function profileFromArgv(argv) {
|
|
|
23
24
|
return (0, keychain_1.profileForChildProcess)(argv);
|
|
24
25
|
}
|
|
25
26
|
function quoteShellArg(value) {
|
|
26
|
-
return
|
|
27
|
+
return QUOTE_SHELL_ARG_RE.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* The status probe must observe the same profile as the start request. A
|
package/dist/lib/schedule.js
CHANGED
|
@@ -46,6 +46,7 @@ exports.formatStamp = formatStamp;
|
|
|
46
46
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
47
47
|
const format_1 = require("./format");
|
|
48
48
|
const triggers_1 = require("./triggers");
|
|
49
|
+
const RENDER_PROPOSAL_RE = / 00:00:00 /;
|
|
49
50
|
function isPlanAccepted(value) {
|
|
50
51
|
return (Boolean(value) &&
|
|
51
52
|
typeof value === 'object' &&
|
|
@@ -383,7 +384,7 @@ function renderProposal(proposal, log) {
|
|
|
383
384
|
log(`Task scope: ${taskScope}`);
|
|
384
385
|
if (proposal.expiresAt) {
|
|
385
386
|
const expires = (0, format_1.zonedTime)(proposal.expiresAt, zone);
|
|
386
|
-
log(`Expires: ${expires}${
|
|
387
|
+
log(`Expires: ${expires}${RENDER_PROPOSAL_RE.test(expires) ? ' (midnight at the end of the plan day)' : ''}`);
|
|
387
388
|
}
|
|
388
389
|
renderCapacityWarning(proposal.capacity, log, proposal.agentId);
|
|
389
390
|
if (proposal.nextRunSuggestion) {
|
|
@@ -13,6 +13,8 @@ const node_crypto_1 = require("node:crypto");
|
|
|
13
13
|
const base_command_1 = require("../base-command");
|
|
14
14
|
const api_fetch_1 = require("./api-fetch");
|
|
15
15
|
const memory_history_session_1 = require("./memory-history-session");
|
|
16
|
+
const UNCERTAIN_MEMORY_MUTATION_RECOVERY_RE = /\/mutations\/[^/?]+$/;
|
|
17
|
+
const MEMORY_HISTORY_API_RE = /^(agent|space):[^:]+$/;
|
|
16
18
|
function parseMemoryStoreResolutions(value) {
|
|
17
19
|
if (value === undefined)
|
|
18
20
|
return undefined;
|
|
@@ -194,7 +196,9 @@ function parseMemoryApiError(error) {
|
|
|
194
196
|
}
|
|
195
197
|
/** A gateway timeout can arrive after the canonical mutation committed. */
|
|
196
198
|
function uncertainMemoryMutationRecovery(path, options, status) {
|
|
197
|
-
if (status !== 504 ||
|
|
199
|
+
if (status !== 504 ||
|
|
200
|
+
options.method !== 'POST' ||
|
|
201
|
+
!UNCERTAIN_MEMORY_MUTATION_RECOVERY_RE.test(path))
|
|
198
202
|
return null;
|
|
199
203
|
const body = options.body;
|
|
200
204
|
if (!body || body.dryRun === true || typeof body.idempotencyKey !== 'string' || typeof body.targetStoreId !== 'string')
|
|
@@ -227,7 +231,7 @@ class ScopedMemoryCommand extends base_command_1.BaseCommand {
|
|
|
227
231
|
if (Boolean(flags.store) === Boolean(flags.scope)) {
|
|
228
232
|
this.error('Pass exactly one of --store <id> or --scope agent:<id>|space:<id>.', { exit: 2 });
|
|
229
233
|
}
|
|
230
|
-
if (flags.scope &&
|
|
234
|
+
if (flags.scope && !MEMORY_HISTORY_API_RE.test(flags.scope)) {
|
|
231
235
|
this.error('--scope must be agent:<id> or space:<id>.', { exit: 2 });
|
|
232
236
|
}
|
|
233
237
|
if (flags.scope?.startsWith('space:') && !flags.space) {
|
|
@@ -283,7 +287,7 @@ class ScopedMemoryCommand extends base_command_1.BaseCommand {
|
|
|
283
287
|
if (!flags.scope) {
|
|
284
288
|
this.error('Pass exactly one of --store <id> or --scope agent:<id>|space:<id>.', { exit: 2 });
|
|
285
289
|
}
|
|
286
|
-
if (
|
|
290
|
+
if (!MEMORY_HISTORY_API_RE.test(flags.scope)) {
|
|
287
291
|
this.error('--scope must be agent:<id> or space:<id>.', { exit: 2 });
|
|
288
292
|
}
|
|
289
293
|
const [kind, id] = flags.scope.split(':', 2);
|
|
@@ -5,19 +5,26 @@ exports.isPrintableSearchCursor = isPrintableSearchCursor;
|
|
|
5
5
|
exports.shellSearchCursor = shellSearchCursor;
|
|
6
6
|
exports.isSearchListPage = isSearchListPage;
|
|
7
7
|
const node_util_1 = require("node:util");
|
|
8
|
+
const SEARCH_DISPLAY_TEXT_RE = /[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g;
|
|
9
|
+
const SEARCH_DISPLAY_TEXT_RE_2 = /\s+/g;
|
|
10
|
+
const IS_PRINTABLE_SEARCH_CURSOR_RE = /[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/;
|
|
11
|
+
const SHELL_SEARCH_CURSOR_RE = /^[A-Za-z0-9_@%+=:,./-]+$/;
|
|
12
|
+
const SHELL_SEARCH_CURSOR_RE_2 = /'/g;
|
|
8
13
|
/** Keep untrusted search content from controlling or reordering a terminal. */
|
|
9
14
|
function searchDisplayText(value) {
|
|
10
15
|
return (0, node_util_1.stripVTControlCharacters)(value)
|
|
11
|
-
.replace(
|
|
12
|
-
.replace(
|
|
16
|
+
.replace(SEARCH_DISPLAY_TEXT_RE, ' ')
|
|
17
|
+
.replace(SEARCH_DISPLAY_TEXT_RE_2, ' ')
|
|
13
18
|
.trim();
|
|
14
19
|
}
|
|
15
20
|
/** Cursor values stay opaque, but must be safe to print and copy into a shell. */
|
|
16
21
|
function isPrintableSearchCursor(value) {
|
|
17
|
-
return value.length > 0 &&
|
|
22
|
+
return value.length > 0 && !IS_PRINTABLE_SEARCH_CURSOR_RE.test(value);
|
|
18
23
|
}
|
|
19
24
|
function shellSearchCursor(value) {
|
|
20
|
-
return
|
|
25
|
+
return SHELL_SEARCH_CURSOR_RE.test(value)
|
|
26
|
+
? value
|
|
27
|
+
: `'${value.replace(SHELL_SEARCH_CURSOR_RE_2, `'\\''`)}'`;
|
|
21
28
|
}
|
|
22
29
|
/** A missing or malformed list is an error, not proof of zero matches. */
|
|
23
30
|
function isSearchListPage(value) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.skillStoreSearchIncomplete = skillStoreSearchIncomplete;
|
|
4
4
|
exports.skillStorePageState = skillStorePageState;
|
|
5
5
|
exports.reportSkillStorePage = reportSkillStorePage;
|
|
6
|
+
const SKILL_STORE_PAGE_STATE_RE = /^[A-Za-z0-9_+/=-]{1,4096}$/;
|
|
6
7
|
/** The Store can return an empty page while more candidates remain to inspect. */
|
|
7
8
|
function skillStoreSearchIncomplete(response) {
|
|
8
9
|
if (!response || Array.isArray(response) || typeof response !== 'object')
|
|
@@ -19,7 +20,7 @@ function skillStorePageState(response, cursor) {
|
|
|
19
20
|
return { hasMore: false, invalidCursor: false };
|
|
20
21
|
// Server cursors are opaque base64 tokens. Do not print arbitrary terminal
|
|
21
22
|
// control characters from a malformed response, or suggest a cursor loop.
|
|
22
|
-
const next = typeof page.after === 'string' &&
|
|
23
|
+
const next = typeof page.after === 'string' && SKILL_STORE_PAGE_STATE_RE.test(page.after)
|
|
23
24
|
? page.after
|
|
24
25
|
: undefined;
|
|
25
26
|
if (!next || next === cursor)
|
|
@@ -17,6 +17,9 @@ exports.notebookLines = notebookLines;
|
|
|
17
17
|
* removed, so a summary cannot forge a row of its own.
|
|
18
18
|
*/
|
|
19
19
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
20
|
+
// eslint-disable-next-line no-control-regex
|
|
21
|
+
const ONE_LINE_RE = /[\u0000-\u001f\u007f-\u009f--]/g;
|
|
22
|
+
const ONE_LINE_RE_2 = /\s+/g;
|
|
20
23
|
const KIND_TAG = {
|
|
21
24
|
task_result: 'result',
|
|
22
25
|
loop_cycle: 'cycle',
|
|
@@ -33,9 +36,8 @@ const VERDICT_WORD = {
|
|
|
33
36
|
/** One printable line: no control or bidi characters, whitespace collapsed. */
|
|
34
37
|
function oneLine(value, max = 240) {
|
|
35
38
|
const text = String(value ?? '')
|
|
36
|
-
|
|
37
|
-
.replace(
|
|
38
|
-
.replace(/\s+/g, ' ')
|
|
39
|
+
.replace(ONE_LINE_RE, ' ')
|
|
40
|
+
.replace(ONE_LINE_RE_2, ' ')
|
|
39
41
|
.trim();
|
|
40
42
|
return text.length > max ? `${text.slice(0, max - 1).trimEnd()}…` : text;
|
|
41
43
|
}
|
|
@@ -13,6 +13,7 @@ exports.outcomesWindowLine = outcomesWindowLine;
|
|
|
13
13
|
exports.suppressedCellsLine = suppressedCellsLine;
|
|
14
14
|
exports.exclusionValue = exclusionValue;
|
|
15
15
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
16
|
+
const HUMANIZE_RE = /([a-z])([A-Z])/g;
|
|
16
17
|
/**
|
|
17
18
|
* Terminal wording for a Store listing (`skrr store show`) and its publisher
|
|
18
19
|
* readouts (`skrr store stats`). Pure functions, so the commands only fetch
|
|
@@ -179,7 +180,7 @@ function suppressedCellsLine(cells, minimumCohort, unit) {
|
|
|
179
180
|
return `Withheld rows (fewer than ${minimumCohort} ${unit} each): ${parts.join(', ')}.`;
|
|
180
181
|
}
|
|
181
182
|
function humanize(key) {
|
|
182
|
-
return key.replace(
|
|
183
|
+
return key.replace(HUMANIZE_RE, '$1 $2').toLowerCase();
|
|
183
184
|
}
|
|
184
185
|
/** An exclusion count; `null` is "some, from too few buyers to say how many". */
|
|
185
186
|
function exclusionValue(value) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TASK_AGENT_CONTEXT_COMMAND_IDS = void 0;
|
|
4
4
|
exports.taskAgentContextCommandCapability = taskAgentContextCommandCapability;
|
|
5
|
+
const TASK_AGENT_CONTEXT_COMMAND_CAPABILITY_RE = /:/g;
|
|
5
6
|
/**
|
|
6
7
|
* Semantic capabilities advertised by a CLI that can safely render Task Agent
|
|
7
8
|
* Context recovery instructions. This ships with the CLI (unlike build-only
|
|
@@ -18,5 +19,5 @@ exports.TASK_AGENT_CONTEXT_COMMAND_IDS = [
|
|
|
18
19
|
'tasks:retry-receipt',
|
|
19
20
|
];
|
|
20
21
|
function taskAgentContextCommandCapability(commandId) {
|
|
21
|
-
return `task-agent-context.command.${commandId.replace(
|
|
22
|
+
return `task-agent-context.command.${commandId.replace(TASK_AGENT_CONTEXT_COMMAND_CAPABILITY_RE, '-')}.v1`;
|
|
22
23
|
}
|
|
@@ -74,6 +74,10 @@ const base_command_1 = require("../base-command");
|
|
|
74
74
|
const file_mime_1 = require("./file-mime");
|
|
75
75
|
const api_fetch_1 = require("./api-fetch");
|
|
76
76
|
const session_task_write_1 = require("./session-task-write");
|
|
77
|
+
const TASK_ASSET_MARKDOWN_REF_RE = /[\\[\]]/g;
|
|
78
|
+
const QUOTED_HEADER_VALUE_RE = /[\r\n]/g;
|
|
79
|
+
const QUOTED_HEADER_VALUE_RE_2 = /"/g;
|
|
80
|
+
const POST_FILE_TO_STORAGE_RE = /<Code>([^<]+)<\/Code>/;
|
|
77
81
|
function mb(bytes) {
|
|
78
82
|
return `${Math.floor(bytes / (1024 * 1024))} MB`;
|
|
79
83
|
}
|
|
@@ -213,7 +217,7 @@ async function attachTaskAssetFiles(opts) {
|
|
|
213
217
|
* close the alt early and break the reference.
|
|
214
218
|
*/
|
|
215
219
|
function taskAssetMarkdownRef(asset) {
|
|
216
|
-
const alt = asset.filename.replace(
|
|
220
|
+
const alt = asset.filename.replace(TASK_ASSET_MARKDOWN_REF_RE, (ch) => `\\${ch}`);
|
|
217
221
|
return ``;
|
|
218
222
|
}
|
|
219
223
|
/**
|
|
@@ -534,7 +538,7 @@ async function sha256OfFile(filePath) {
|
|
|
534
538
|
}
|
|
535
539
|
/** A form-data header value: no CR/LF, and quotes percent-encoded. */
|
|
536
540
|
function quotedHeaderValue(value) {
|
|
537
|
-
return value.replace(
|
|
541
|
+
return value.replace(QUOTED_HEADER_VALUE_RE, ' ').replace(QUOTED_HEADER_VALUE_RE_2, '%22');
|
|
538
542
|
}
|
|
539
543
|
/**
|
|
540
544
|
* POST the file to the presigned URL as multipart/form-data, streamed from
|
|
@@ -595,7 +599,7 @@ async function postFileToStorage(p) {
|
|
|
595
599
|
// S3 names the refusal in XML (`<Code>BadDigest</Code>`,
|
|
596
600
|
// `EntityTooLarge`, `AccessDenied` once the POST policy expired).
|
|
597
601
|
// The code is the only part a person can act on.
|
|
598
|
-
const code =
|
|
602
|
+
const code = POST_FILE_TO_STORAGE_RE.exec(body)?.[1];
|
|
599
603
|
fail(new Error(`Storage rejected the upload (${status}${code ? ` ${code}` : ''})`));
|
|
600
604
|
});
|
|
601
605
|
});
|
package/dist/lib/task-closure.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.taskIsSettled = taskIsSettled;
|
|
|
5
5
|
exports.closureReport = closureReport;
|
|
6
6
|
exports.reopenRequiredLines = reopenRequiredLines;
|
|
7
7
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
8
|
+
const TRUNCATE_RE = /\s+/g;
|
|
8
9
|
/**
|
|
9
10
|
* Is this Task SETTLED — closed in a way that refuses a new Result until it is
|
|
10
11
|
* reopened (`TASK_REOPEN_REQUIRED`)?
|
|
@@ -133,7 +134,7 @@ function reopenRequiredLines({ bin, task, command, }) {
|
|
|
133
134
|
var data_provider_2 = require("@skrr-ai/data-provider");
|
|
134
135
|
Object.defineProperty(exports, "describeAssessor", { enumerable: true, get: function () { return data_provider_2.describeAssessorKind; } });
|
|
135
136
|
function truncate(value, max) {
|
|
136
|
-
const flat = value.replace(
|
|
137
|
+
const flat = value.replace(TRUNCATE_RE, ' ').trim();
|
|
137
138
|
return flat.length > max ? `${flat.slice(0, max - 1)}…` : flat;
|
|
138
139
|
}
|
|
139
140
|
function capitalize(value) {
|
|
@@ -7,6 +7,7 @@ exports.scoreText = scoreText;
|
|
|
7
7
|
exports.estimateUnchangedLine = estimateUnchangedLine;
|
|
8
8
|
exports.describeEconomicsChange = describeEconomicsChange;
|
|
9
9
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
10
|
+
const AMOUNT_FLAG_RE = /,/;
|
|
10
11
|
/**
|
|
11
12
|
* A flag's amount as a number, or an error that names the flag and the value (OSK-15366). A raw
|
|
12
13
|
* Zod issue array named internal paths (`savings.amount`, `effortHours`) and no flag, so a person
|
|
@@ -15,7 +16,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
15
16
|
function amountFlag(flag, value) {
|
|
16
17
|
const amount = Number(value);
|
|
17
18
|
if (value.trim() === '' || !Number.isFinite(amount) || amount < 0) {
|
|
18
|
-
const hint =
|
|
19
|
+
const hint = AMOUNT_FLAG_RE.test(value) ? ' Write it without a thousands separator.' : '';
|
|
19
20
|
throw new Error(`${flag} must be a non-negative number (got '${value}').${hint}`);
|
|
20
21
|
}
|
|
21
22
|
return amount;
|
|
@@ -28,6 +28,14 @@ exports.compactSnapshotSignature = compactSnapshotSignature;
|
|
|
28
28
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
29
29
|
const tasks_1 = require("./tasks");
|
|
30
30
|
const html_text_1 = require("./html-text");
|
|
31
|
+
const IS_RECOVERED_EXECUTION_TASK_RE = /\b(stuck|timeout|timed out|reaped|reset|lost|expired|usage|quota|rate limit|token)\b/i;
|
|
32
|
+
const RECOVERY_REASON_RE = /stuck|reaped|reset/i;
|
|
33
|
+
const RECOVERY_REASON_RE_2 = /usage|quota|rate limit|token/i;
|
|
34
|
+
const RECOVERY_REASON_RE_3 = /timeout|timed out/i;
|
|
35
|
+
const WORKSTREAM_KEY_RE = /\bWS[-\s]?(\d+)[.-](\d+)\b/i;
|
|
36
|
+
const DEPENDENCY_KEYS_RE = /\bdepends(?:\s+on)?\s*:\s*([^\n\r]+)/i;
|
|
37
|
+
const DEPENDENCY_KEYS_RE_2 = /^(none|—|-|n\/a)\b/i;
|
|
38
|
+
const DEPENDENCY_KEYS_RE_3 = /\bWS[-\s]?(\d+)[.-](\d+)\b/gi;
|
|
31
39
|
/**
|
|
32
40
|
* Statuses at which an execution is OVER — nothing further will move the task
|
|
33
41
|
* without new input.
|
|
@@ -94,7 +102,7 @@ function isRecoveredExecutionTask(task) {
|
|
|
94
102
|
const error = stringValue(task.executionError);
|
|
95
103
|
if (!error)
|
|
96
104
|
return false;
|
|
97
|
-
return (
|
|
105
|
+
return (IS_RECOVERED_EXECUTION_TASK_RE.test(error) ||
|
|
98
106
|
isNonEmptyString(task.startedAt) ||
|
|
99
107
|
isNonEmptyString(task.conversationId) ||
|
|
100
108
|
Number(task.executionAttempts) > 0);
|
|
@@ -136,11 +144,11 @@ function recoveryReason(task) {
|
|
|
136
144
|
const error = stringValue(task.executionError);
|
|
137
145
|
if (!error)
|
|
138
146
|
return 'recovered stale execution';
|
|
139
|
-
if (
|
|
147
|
+
if (RECOVERY_REASON_RE.test(error))
|
|
140
148
|
return 'reaped stale execution';
|
|
141
|
-
if (
|
|
149
|
+
if (RECOVERY_REASON_RE_2.test(error))
|
|
142
150
|
return 'execution limit/auth failure';
|
|
143
|
-
if (
|
|
151
|
+
if (RECOVERY_REASON_RE_3.test(error))
|
|
144
152
|
return 'execution timeout';
|
|
145
153
|
return 'previous execution failed to complete';
|
|
146
154
|
}
|
|
@@ -242,7 +250,7 @@ function workstreamKey(task) {
|
|
|
242
250
|
...(Array.isArray(task.tags) ? task.tags.map((tag) => String(tag)) : []),
|
|
243
251
|
];
|
|
244
252
|
for (const candidate of candidates) {
|
|
245
|
-
const match = candidate.match(
|
|
253
|
+
const match = candidate.match(WORKSTREAM_KEY_RE);
|
|
246
254
|
if (match)
|
|
247
255
|
return `ws-${match[1]}-${match[2]}`;
|
|
248
256
|
}
|
|
@@ -250,13 +258,13 @@ function workstreamKey(task) {
|
|
|
250
258
|
}
|
|
251
259
|
function dependencyKeys(task) {
|
|
252
260
|
const text = stripHtml(String(task.description ?? ''));
|
|
253
|
-
const dependsMatch = text.match(
|
|
261
|
+
const dependsMatch = text.match(DEPENDENCY_KEYS_RE);
|
|
254
262
|
if (!dependsMatch)
|
|
255
263
|
return [];
|
|
256
264
|
const line = dependsMatch[1];
|
|
257
|
-
if (
|
|
265
|
+
if (DEPENDENCY_KEYS_RE_2.test(line.trim()))
|
|
258
266
|
return [];
|
|
259
|
-
return Array.from(line.matchAll(
|
|
267
|
+
return Array.from(line.matchAll(DEPENDENCY_KEYS_RE_3)).map((match) => `ws-${match[1]}-${match[2]}`);
|
|
260
268
|
}
|
|
261
269
|
function blockingDependencies(task, candidates) {
|
|
262
270
|
const byKey = new Map();
|
package/dist/lib/task-extras.js
CHANGED
|
@@ -24,6 +24,8 @@ exports.taskLabelSuggestion = taskLabelSuggestion;
|
|
|
24
24
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
25
25
|
const triggers_1 = require("./triggers");
|
|
26
26
|
const api_fetch_1 = require("./api-fetch");
|
|
27
|
+
const PARSE_EXECUTION_TARGET_REF_RE = /^hosted-machine:(.+)$/;
|
|
28
|
+
const PARSE_EXECUTION_TARGET_REF_RE_2 = /^harness:(.+)$/;
|
|
27
29
|
const MOUNT = '/api/tasks';
|
|
28
30
|
const base = (id) => `${MOUNT}/${encodeURIComponent(id)}`;
|
|
29
31
|
exports.taskWorkflowApi = {
|
|
@@ -146,10 +148,10 @@ function parseExecutionTargetRef(value) {
|
|
|
146
148
|
return { kind: 'agent-worker' };
|
|
147
149
|
if (HOSTED_MACHINE_SELECTORS.has(trimmed))
|
|
148
150
|
return { kind: 'hosted-machine' };
|
|
149
|
-
const hosted =
|
|
151
|
+
const hosted = PARSE_EXECUTION_TARGET_REF_RE.exec(trimmed);
|
|
150
152
|
if (hosted)
|
|
151
153
|
return { kind: 'hosted-machine', ref: hosted[1] };
|
|
152
|
-
const harness =
|
|
154
|
+
const harness = PARSE_EXECUTION_TARGET_REF_RE_2.exec(trimmed);
|
|
153
155
|
return { kind: 'harness', ref: harness ? harness[1] : trimmed };
|
|
154
156
|
}
|
|
155
157
|
exports.taskChatApi = {
|
|
@@ -11,6 +11,7 @@ exports.parseTaskOperationWatchDuration = parseTaskOperationWatchDuration;
|
|
|
11
11
|
exports.classifyTaskOperation = classifyTaskOperation;
|
|
12
12
|
exports.watchTaskOperation = watchTaskOperation;
|
|
13
13
|
exports.taskOperationCheckpointLine = taskOperationCheckpointLine;
|
|
14
|
+
const PARSE_TASK_OPERATION_WATCH_DURATION_RE = /^(\d+)(ms|s|m|h)?$/i;
|
|
14
15
|
// These are operation outcomes, not Task-execution outcomes. A start can be
|
|
15
16
|
// successfully accepted and a retry successfully admitted while its execution
|
|
16
17
|
// Run is still active; waiting on the Operation must stop successfully at that
|
|
@@ -21,7 +22,7 @@ const FAILED_STATES = new Set(['failed', 'cancelled', 'canceled', 'abandoned', '
|
|
|
21
22
|
function parseTaskOperationWatchDuration(value) {
|
|
22
23
|
if (!value)
|
|
23
24
|
return null;
|
|
24
|
-
const match = value.trim().match(
|
|
25
|
+
const match = value.trim().match(PARSE_TASK_OPERATION_WATCH_DURATION_RE);
|
|
25
26
|
if (!match)
|
|
26
27
|
throw new Error(`Invalid --timeout value: ${value}`);
|
|
27
28
|
const amount = Number(match[1]);
|
|
@@ -4,6 +4,7 @@ exports.readTaskPreflight = readTaskPreflight;
|
|
|
4
4
|
exports.taskPreflightLines = taskPreflightLines;
|
|
5
5
|
const task_admission_1 = require("./task-admission");
|
|
6
6
|
const task_operations_1 = require("./task-operations");
|
|
7
|
+
const UNAVAILABLE_RE = /^[A-Z][A-Z0-9_]{0,100}$/;
|
|
7
8
|
const LIMITS = [
|
|
8
9
|
'Workflow and execution checks are separate server observations, not an atomic reservation.',
|
|
9
10
|
'No Run, shell command, machine probe, or branch checkout was performed.',
|
|
@@ -13,13 +14,13 @@ const LIMITS = [
|
|
|
13
14
|
function unavailable(error, label) {
|
|
14
15
|
const row = error && typeof error === 'object' ? error : {};
|
|
15
16
|
const status = typeof row.status === 'number' ? row.status : undefined;
|
|
16
|
-
let code = typeof row.code === 'string' &&
|
|
17
|
+
let code = typeof row.code === 'string' && UNAVAILABLE_RE.test(row.code) ? row.code : undefined;
|
|
17
18
|
// Keep the native typed refusal without echoing an arbitrary response body,
|
|
18
19
|
// HTML proxy page, request URL, or credential into diagnostics.
|
|
19
20
|
if (!code && typeof row.body === 'string') {
|
|
20
21
|
try {
|
|
21
22
|
const body = JSON.parse(row.body);
|
|
22
|
-
if (typeof body?.code === 'string' &&
|
|
23
|
+
if (typeof body?.code === 'string' && UNAVAILABLE_RE.test(body.code))
|
|
23
24
|
code = body.code;
|
|
24
25
|
}
|
|
25
26
|
catch {
|
|
@@ -15,6 +15,8 @@ exports.recurrenceSummaryLines = recurrenceSummaryLines;
|
|
|
15
15
|
* the caller prints the raw pattern alone rather than a confident wrong sentence.
|
|
16
16
|
*/
|
|
17
17
|
const iso_instant_1 = require("./iso-instant");
|
|
18
|
+
const TO_NUMBER_RE = /^\d+$/;
|
|
19
|
+
const DESCRIBE_CRON_PATTERN_RE = /\s+/;
|
|
18
20
|
const WEEKDAYS = [
|
|
19
21
|
'Sunday',
|
|
20
22
|
'Monday',
|
|
@@ -64,7 +66,7 @@ function expandField(raw, domain) {
|
|
|
64
66
|
if (!Number.isInteger(step) || step < 1)
|
|
65
67
|
return null;
|
|
66
68
|
const toNumber = (token) => {
|
|
67
|
-
if (
|
|
69
|
+
if (TO_NUMBER_RE.test(token))
|
|
68
70
|
return Number(token);
|
|
69
71
|
const index = domain.names?.indexOf(token.toUpperCase()) ?? -1;
|
|
70
72
|
return index >= 0 ? index + (domain.nameBase ?? 0) : null;
|
|
@@ -158,7 +160,7 @@ function describeWeekdays(values) {
|
|
|
158
160
|
function describeCronPattern(pattern) {
|
|
159
161
|
const fields = String(pattern ?? '')
|
|
160
162
|
.trim()
|
|
161
|
-
.split(
|
|
163
|
+
.split(DESCRIBE_CRON_PATTERN_RE);
|
|
162
164
|
if (fields.length !== 5)
|
|
163
165
|
return null;
|
|
164
166
|
const [minute, hour, dayOfMonth, month, dayOfWeek] = fields;
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withTaskRuntimeHeaders = withTaskRuntimeHeaders;
|
|
4
4
|
exports.taskRuntimeRedirectOptions = taskRuntimeRedirectOptions;
|
|
5
|
+
const WITH_TASK_RUNTIME_HEADERS_RE = /^\/api\/tasks(?:\/|$)/;
|
|
6
|
+
const WITH_TASK_RUNTIME_HEADERS_RE_2 = /^\/api\/agents\/[^/]+\/agent-actions\/[^/]+\/run\/?$/;
|
|
7
|
+
const WITH_TASK_RUNTIME_HEADERS_RE_3 = /^\/api\/(?:shortcuts|task-templates)\/[^/]+\/(?:instantiate|trigger)\/?$/;
|
|
8
|
+
const WITH_TASK_RUNTIME_HEADERS_RE_4 = /^\/api\/templates\/[^/]+\/(?:instantiate|fork)\/?$/;
|
|
9
|
+
const WITH_TASK_RUNTIME_HEADERS_RE_5 = /^\/api\/store\/services\/[^/]+\/install\/?$/;
|
|
5
10
|
/**
|
|
6
11
|
* Account Authorization decides access; a separate server-issued session
|
|
7
12
|
* credential proves Agent authorship. Environment ids are selectors only.
|
|
@@ -34,12 +39,12 @@ function withTaskRuntimeHeaders(headers, requestUrl, method, env = process.env)
|
|
|
34
39
|
// Some platform operations materialize Tasks outside the Task router. Keep
|
|
35
40
|
// their exact POST routes here; action/library edits, picker reads and other
|
|
36
41
|
// integration routes must never receive the companion credential.
|
|
37
|
-
const taskMutation =
|
|
42
|
+
const taskMutation = WITH_TASK_RUNTIME_HEADERS_RE.test(target.pathname);
|
|
38
43
|
const taskCreation = method.toUpperCase() === 'POST' && [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
WITH_TASK_RUNTIME_HEADERS_RE_2,
|
|
45
|
+
WITH_TASK_RUNTIME_HEADERS_RE_3,
|
|
46
|
+
WITH_TASK_RUNTIME_HEADERS_RE_4,
|
|
47
|
+
WITH_TASK_RUNTIME_HEADERS_RE_5,
|
|
43
48
|
].some((route) => route.test(target.pathname));
|
|
44
49
|
if (!taskMutation && !taskCreation)
|
|
45
50
|
return sent;
|
|
@@ -20,6 +20,7 @@ exports.unverifiedOutcomeNote = unverifiedOutcomeNote;
|
|
|
20
20
|
* functions below.
|
|
21
21
|
*/
|
|
22
22
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
23
|
+
const PARSE_TASK_OUTPUT_BLOCK_RE = /---TASK_OUTPUT---\s*([\s\S]*?)\s*---END_OUTPUT---/;
|
|
23
24
|
const TASK_OUTPUT_FIELDS = ['status', 'summary', 'artifacts', 'verdict'];
|
|
24
25
|
/**
|
|
25
26
|
* Mirror of `api/server/services/taskCompletionFormatting.js:parseTaskOutputBlock`.
|
|
@@ -36,7 +37,7 @@ const TASK_OUTPUT_FIELDS = ['status', 'summary', 'artifacts', 'verdict'];
|
|
|
36
37
|
function parseTaskOutputBlock(body) {
|
|
37
38
|
if (!body)
|
|
38
39
|
return null;
|
|
39
|
-
const match = body.match(
|
|
40
|
+
const match = body.match(PARSE_TASK_OUTPUT_BLOCK_RE);
|
|
40
41
|
if (!match)
|
|
41
42
|
return null;
|
|
42
43
|
const block = match[1];
|
|
@@ -60,7 +61,7 @@ function parseTaskOutputBlock(body) {
|
|
|
60
61
|
function unattributedBlockLines(body) {
|
|
61
62
|
if (!body)
|
|
62
63
|
return [];
|
|
63
|
-
const match = body.match(
|
|
64
|
+
const match = body.match(PARSE_TASK_OUTPUT_BLOCK_RE);
|
|
64
65
|
if (!match)
|
|
65
66
|
return [];
|
|
66
67
|
const known = new RegExp(`^(?:${TASK_OUTPUT_FIELDS.join('|')}):`, 'i');
|
|
@@ -9,6 +9,10 @@ exports.parsePortableTaskExport = parsePortableTaskExport;
|
|
|
9
9
|
exports.importExternalKey = importExternalKey;
|
|
10
10
|
exports.importableTaskNode = importableTaskNode;
|
|
11
11
|
const node_crypto_1 = require("node:crypto");
|
|
12
|
+
const CSV_CELL_RE = /[",\r\n]/;
|
|
13
|
+
const CSV_CELL_RE_2 = /"/g;
|
|
14
|
+
const PARSE_CSV_RE = /\r$/;
|
|
15
|
+
const IMPORT_EXTERNAL_KEY_RE = /\/+$/;
|
|
12
16
|
const PORTABLE_FIELDS = [
|
|
13
17
|
'identifier',
|
|
14
18
|
'externalKey',
|
|
@@ -98,7 +102,7 @@ function csvCell(value) {
|
|
|
98
102
|
let raw = '';
|
|
99
103
|
if (value !== undefined && value !== null)
|
|
100
104
|
raw = typeof value === 'string' ? value : JSON.stringify(value);
|
|
101
|
-
return
|
|
105
|
+
return CSV_CELL_RE.test(raw) ? `"${raw.replace(CSV_CELL_RE_2, '""')}"` : raw;
|
|
102
106
|
}
|
|
103
107
|
/** CSV intentionally keeps arrays as JSON cells: commas in tags and comments round-trip safely. */
|
|
104
108
|
function portableTaskExportToCsv(exported) {
|
|
@@ -141,7 +145,7 @@ function parseCsv(text) {
|
|
|
141
145
|
cell = '';
|
|
142
146
|
}
|
|
143
147
|
else if (char === '\n') {
|
|
144
|
-
row.push(cell.replace(
|
|
148
|
+
row.push(cell.replace(PARSE_CSV_RE, ''));
|
|
145
149
|
rows.push(row);
|
|
146
150
|
row = [];
|
|
147
151
|
cell = '';
|
|
@@ -152,7 +156,7 @@ function parseCsv(text) {
|
|
|
152
156
|
if (quoted)
|
|
153
157
|
throw new Error('CSV has an unterminated quoted field');
|
|
154
158
|
if (cell || row.length) {
|
|
155
|
-
row.push(cell.replace(
|
|
159
|
+
row.push(cell.replace(PARSE_CSV_RE, ''));
|
|
156
160
|
rows.push(row);
|
|
157
161
|
}
|
|
158
162
|
return rows.filter((value) => value.some((cellValue) => cellValue.length > 0));
|
|
@@ -269,11 +273,11 @@ function importExternalKey(prefix, node) {
|
|
|
269
273
|
: node.tempId;
|
|
270
274
|
if (!prefix)
|
|
271
275
|
return current === node.tempId && !node.externalKey ? undefined : current;
|
|
272
|
-
const base = `${prefix.replace(
|
|
276
|
+
const base = `${prefix.replace(IMPORT_EXTERNAL_KEY_RE, '')}/${current}`;
|
|
273
277
|
if (base.length <= 300)
|
|
274
278
|
return base;
|
|
275
279
|
const hash = (0, node_crypto_1.createHash)('sha256').update(current).digest('hex').slice(0, 16);
|
|
276
|
-
const shortPrefix = prefix.replace(
|
|
280
|
+
const shortPrefix = prefix.replace(IMPORT_EXTERNAL_KEY_RE, '').slice(0, 280 - hash.length);
|
|
277
281
|
return `${shortPrefix}/${hash}`;
|
|
278
282
|
}
|
|
279
283
|
/** Remove unsupported/sensitive fields before passing a portable row to create-tree's planner. */
|
package/dist/lib/tasks.js
CHANGED
|
@@ -46,6 +46,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
46
46
|
const prompt_1 = require("./prompt");
|
|
47
47
|
const projects_1 = require("./projects");
|
|
48
48
|
const node_path_1 = require("node:path");
|
|
49
|
+
const NORMALIZE_VERDICT_RE = /[\s-]+/g;
|
|
49
50
|
/**
|
|
50
51
|
* `--goal` on `tasks update`. `none`, `null` and `clear` detach the goal: PATCH
|
|
51
52
|
* sends `goalId: null`. Anything else names a goal. `clear` is accepted because
|
|
@@ -1228,7 +1229,7 @@ function normalizeVerdict(value) {
|
|
|
1228
1229
|
return String(value ?? '')
|
|
1229
1230
|
.trim()
|
|
1230
1231
|
.toLowerCase()
|
|
1231
|
-
.replace(
|
|
1232
|
+
.replace(NORMALIZE_VERDICT_RE, '_');
|
|
1232
1233
|
}
|
|
1233
1234
|
/**
|
|
1234
1235
|
* Does this verdict mean anything to the server?
|
package/dist/lib/triggers.d.ts
CHANGED
|
@@ -111,6 +111,13 @@ export interface SchedulerLimits {
|
|
|
111
111
|
triggerFireCount?: number;
|
|
112
112
|
triggerFiresToday?: number;
|
|
113
113
|
note?: string;
|
|
114
|
+
/** Slots the scheduler claimed whose trigger has not started yet (OSK-22638); a single-trigger read only. */
|
|
115
|
+
awaitingStart?: {
|
|
116
|
+
awaitingStart: number;
|
|
117
|
+
running: number;
|
|
118
|
+
oldestDueAt?: string;
|
|
119
|
+
oldestAgeMs?: number;
|
|
120
|
+
};
|
|
114
121
|
}
|
|
115
122
|
export interface TriggerDefinition {
|
|
116
123
|
id?: string;
|
|
@@ -689,6 +696,14 @@ export declare const TRIGGER_WINDOW_FLAG_HELP = "JSON object {\"enabled\":true,\
|
|
|
689
696
|
* the limit is reached it drops every later slot without running or recording it (OSK-22526).
|
|
690
697
|
*/
|
|
691
698
|
export declare function schedulerLimitSentence(limits: SchedulerLimits): string;
|
|
699
|
+
/**
|
|
700
|
+
* Slots the scheduler has claimed and charged to the run limit whose trigger has not started, once they
|
|
701
|
+
* are late enough to matter. The audit has no row for such a slot and `claimed` runs ahead of the fires
|
|
702
|
+
* counted, which reads like a lost claim; it is a durable outbox row the dispatcher keeps retrying
|
|
703
|
+
* (a rollout, a held admission gate or a dead dispatcher's lease makes it late). Undefined when there
|
|
704
|
+
* is nothing late to say, so a healthy trigger prints nothing.
|
|
705
|
+
*/
|
|
706
|
+
export declare function claimsAwaitingStartLine(limits?: SchedulerLimits | null): string | undefined;
|
|
692
707
|
/**
|
|
693
708
|
* Human phrasing for a trigger's enabled state (OSK-4886).
|
|
694
709
|
*
|