@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
package/dist/lib/triggers.js
CHANGED
|
@@ -54,6 +54,7 @@ exports.renderTriggerList = renderTriggerList;
|
|
|
54
54
|
exports.formatDuplicateSubscriptionWarning = formatDuplicateSubscriptionWarning;
|
|
55
55
|
exports.windowAuthoringAdvice = windowAuthoringAdvice;
|
|
56
56
|
exports.schedulerLimitSentence = schedulerLimitSentence;
|
|
57
|
+
exports.claimsAwaitingStartLine = claimsAwaitingStartLine;
|
|
57
58
|
exports.armedStateLabel = armedStateLabel;
|
|
58
59
|
exports.writeModeLabel = writeModeLabel;
|
|
59
60
|
exports.webhookIngestUrl = webhookIngestUrl;
|
|
@@ -79,6 +80,9 @@ const node_fs_1 = require("node:fs");
|
|
|
79
80
|
const http_error_1 = require("./http-error");
|
|
80
81
|
const format_1 = require("./format");
|
|
81
82
|
const planOutcome_1 = require("./planOutcome");
|
|
83
|
+
const PARSE_JSON_ARRAY_RE = /^[[{]/;
|
|
84
|
+
const ARMED_STATE_LABEL_RE = /^skipped:(.+)$/;
|
|
85
|
+
const WEBHOOK_INGEST_URL_RE = /\/+$/;
|
|
82
86
|
exports.TRIGGER_KINDS = [
|
|
83
87
|
'schedule',
|
|
84
88
|
'once',
|
|
@@ -451,7 +455,7 @@ function parseJsonArray(raw, flagName) {
|
|
|
451
455
|
return undefined;
|
|
452
456
|
let text = raw;
|
|
453
457
|
const trimmed = raw.trim();
|
|
454
|
-
if (trimmed.startsWith('@') || (
|
|
458
|
+
if (trimmed.startsWith('@') || (!PARSE_JSON_ARRAY_RE.test(trimmed) && (0, node_fs_1.existsSync)(trimmed))) {
|
|
455
459
|
const path = trimmed.startsWith('@') ? trimmed.slice(1) : trimmed;
|
|
456
460
|
try {
|
|
457
461
|
text = (0, node_fs_1.readFileSync)(path, 'utf8');
|
|
@@ -1426,6 +1430,28 @@ function schedulerLimitSentence(limits) {
|
|
|
1426
1430
|
return (`the scheduler has used ${used} (the trigger itself has ${counted}), so it skips every slot` +
|
|
1427
1431
|
`${lifetime ? '' : ' until the day rolls over'}; see \`skrr triggers preflight\``);
|
|
1428
1432
|
}
|
|
1433
|
+
/** A claim younger than this is an ordinary dispatch in flight, not a late slot (OSK-22638). */
|
|
1434
|
+
const LATE_CLAIM_GRACE_MS = 2 * 60 * 1000;
|
|
1435
|
+
/**
|
|
1436
|
+
* Slots the scheduler has claimed and charged to the run limit whose trigger has not started, once they
|
|
1437
|
+
* are late enough to matter. The audit has no row for such a slot and `claimed` runs ahead of the fires
|
|
1438
|
+
* counted, which reads like a lost claim; it is a durable outbox row the dispatcher keeps retrying
|
|
1439
|
+
* (a rollout, a held admission gate or a dead dispatcher's lease makes it late). Undefined when there
|
|
1440
|
+
* is nothing late to say, so a healthy trigger prints nothing.
|
|
1441
|
+
*/
|
|
1442
|
+
function claimsAwaitingStartLine(limits) {
|
|
1443
|
+
const waiting = limits?.awaitingStart;
|
|
1444
|
+
const age = waiting?.oldestAgeMs;
|
|
1445
|
+
if (!waiting || !waiting.awaitingStart || age === undefined || age < LATE_CLAIM_GRACE_MS) {
|
|
1446
|
+
return undefined;
|
|
1447
|
+
}
|
|
1448
|
+
const count = waiting.awaitingStart;
|
|
1449
|
+
const minutes = Math.round(age / 60_000);
|
|
1450
|
+
const late = minutes >= 120 ? `${Math.round(minutes / 60)} h` : `${minutes} min`;
|
|
1451
|
+
return (`Claimed: ${count} slot${count === 1 ? '' : 's'} the scheduler claimed ${count === 1 ? 'has' : 'have'} ` +
|
|
1452
|
+
`not started: the oldest was due ${waiting.oldestDueAt ?? '-'} (${late} ago). Each is charged to the run ` +
|
|
1453
|
+
`limit and the dispatcher keeps retrying it, so it is late, not lost`);
|
|
1454
|
+
}
|
|
1429
1455
|
/**
|
|
1430
1456
|
* Human phrasing for a trigger's enabled state (OSK-4886).
|
|
1431
1457
|
*
|
|
@@ -1477,7 +1503,7 @@ windowVerdict) {
|
|
|
1477
1503
|
// "Will fire" is the row's intent. A platform-managed row whose owner is fenced (Always-On off) ticks on
|
|
1478
1504
|
// schedule and is skipped every time, and the same screen's `Fires:` line says so; the first line a reader
|
|
1479
1505
|
// meets must not say the opposite (dogfood df-261031-commitment-authoring, OSK-21103).
|
|
1480
|
-
const skipped = typeof lastResult === 'string' ?
|
|
1506
|
+
const skipped = typeof lastResult === 'string' ? ARMED_STATE_LABEL_RE.exec(lastResult) : null;
|
|
1481
1507
|
return skipped
|
|
1482
1508
|
? `yes — but its last tick was skipped (${skipped[1]}), so it did not run`
|
|
1483
1509
|
: 'yes — will fire';
|
|
@@ -1514,7 +1540,7 @@ const WEBHOOK_INGEST_KINDS = new Set(['on_demand', 'form', 'chat_message']);
|
|
|
1514
1540
|
* the configured base URL rather than guessed.
|
|
1515
1541
|
*/
|
|
1516
1542
|
function webhookIngestUrl(baseURL, triggerId) {
|
|
1517
|
-
return `${String(baseURL).replace(
|
|
1543
|
+
return `${String(baseURL).replace(WEBHOOK_INGEST_URL_RE, '')}/api/triggers/webhook/${encodeURIComponent(triggerId)}`;
|
|
1518
1544
|
}
|
|
1519
1545
|
/** An id or token that is short and plain, so it is safe in a command a person will paste. */
|
|
1520
1546
|
const PLAIN_TOKEN = /^[A-Za-z0-9_.-]{1,64}$/;
|
|
@@ -1830,6 +1856,9 @@ function renderTriggerSummary(trigger, log, options = {}) {
|
|
|
1830
1856
|
log(`${upcoming ? (dropped || windowed ? 'Next slot:' : 'Next run:') : 'Last run:'}${next.length > 0 ? ` ${next}` : ''}` +
|
|
1831
1857
|
`${dropped ? ' (will be skipped: the scheduler\'s run limit is reached)' : windowNote}`);
|
|
1832
1858
|
}
|
|
1859
|
+
const lateClaims = claimsAwaitingStartLine(trigger.schedulerLimits);
|
|
1860
|
+
if (lateClaims)
|
|
1861
|
+
log(lateClaims);
|
|
1833
1862
|
/*
|
|
1834
1863
|
* What actually happened when it fired.
|
|
1835
1864
|
*
|
package/dist/lib/update-check.js
CHANGED
|
@@ -55,6 +55,12 @@ const path = __importStar(require("node:path"));
|
|
|
55
55
|
const node_crypto_1 = require("node:crypto");
|
|
56
56
|
const node_util_1 = require("node:util");
|
|
57
57
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
58
|
+
const NORMALIZE_BASE_URL_RE = /\/+$/;
|
|
59
|
+
const CLASSIFY_CLI_INSTALL_RE = /[/\\]Cellar[/\\]/;
|
|
60
|
+
const CLI_UPDATE_COMMAND_RE = /'/g;
|
|
61
|
+
const UPDATER_ENVIRONMENT_RE = /(?:TOKEN|SECRET|PASSWORD|CREDENTIAL|API_KEY|PRIVATE_KEY|AUTH_FD|AUTH_SOCK)/i;
|
|
62
|
+
const UPDATER_ENVIRONMENT_RE_2 = /^(?:SKRR_|OVERSKY_|OPENAI_|ANTHROPIC_|CODEX_|CLAUDE_|NODE_OPTIONS$)/i;
|
|
63
|
+
const SHOULD_CHECK_CLI_UPDATE_AT_STARTUP_RE = /^(?:--json(?:=|$)|--help$|-h$|--version$|-v$|--headless$|--print$|-p$|--non-interactive$|--no-interactive$)/;
|
|
58
64
|
/** One update owner and one startup advisory. npm continues to own npm bytes;
|
|
59
65
|
* the durable worker waits for cooperating CLI sessions before replacing them.
|
|
60
66
|
* All update decisions are observable, and checking never schedules a change. */
|
|
@@ -69,7 +75,7 @@ function cacheFilePath(env = process.env) {
|
|
|
69
75
|
return path.join((0, auth_core_1.resolveConfigRoot)(env), 'cli-update-check.json');
|
|
70
76
|
}
|
|
71
77
|
function normalizeBaseUrl(url) {
|
|
72
|
-
return url.trim().replace(
|
|
78
|
+
return url.trim().replace(NORMALIZE_BASE_URL_RE, '').toLowerCase();
|
|
73
79
|
}
|
|
74
80
|
function isTruthyEnv(value) {
|
|
75
81
|
return !!value && ['1', 'true', 'on', 'yes'].includes(value.trim().toLowerCase());
|
|
@@ -179,7 +185,7 @@ function classifyCliInstall(env, argv, npmGlobalRoot, probeWritable = true) {
|
|
|
179
185
|
return { kind: 'bundled' };
|
|
180
186
|
const entry = argv[1];
|
|
181
187
|
try {
|
|
182
|
-
if (entry &&
|
|
188
|
+
if (entry && CLASSIFY_CLI_INSTALL_RE.test(fs.realpathSync(entry)))
|
|
183
189
|
return { kind: 'homebrew' };
|
|
184
190
|
}
|
|
185
191
|
catch {
|
|
@@ -285,7 +291,7 @@ function cliUpdateCommand(owner, npmPrefix) {
|
|
|
285
291
|
switch (owner) {
|
|
286
292
|
case 'npm-global':
|
|
287
293
|
return npmPrefix
|
|
288
|
-
? `npm install --global --prefix '${npmPrefix.replace(
|
|
294
|
+
? `npm install --global --prefix '${npmPrefix.replace(CLI_UPDATE_COMMAND_RE, "'\\''")}' ${CLI_PACKAGE}@latest`
|
|
289
295
|
: `npm install -g ${CLI_PACKAGE}@latest`;
|
|
290
296
|
case 'npm-local':
|
|
291
297
|
return `Use npm in the project that owns ${CLI_PACKAGE}`;
|
|
@@ -503,7 +509,7 @@ async function checkCliUpdate(opts) {
|
|
|
503
509
|
// Independent probes share the same 1.5-second bound rather than adding
|
|
504
510
|
// an npm probe after the network timeout on every first invocation.
|
|
505
511
|
const [response, npmRoot] = await Promise.all([
|
|
506
|
-
fetch(`${opts.baseURL.replace(
|
|
512
|
+
fetch(`${opts.baseURL.replace(NORMALIZE_BASE_URL_RE, '')}/api/config/cli-version`, {
|
|
507
513
|
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
|
|
508
514
|
headers: { accept: 'application/json' },
|
|
509
515
|
}),
|
|
@@ -557,8 +563,7 @@ function npmExecutable(env) {
|
|
|
557
563
|
}
|
|
558
564
|
function updaterEnvironment(env) {
|
|
559
565
|
// The public npm package update does not require application credentials.
|
|
560
|
-
return Object.fromEntries(Object.entries(env).filter(([key]) =>
|
|
561
|
-
!/^(?:SKRR_|OVERSKY_|OPENAI_|ANTHROPIC_|CODEX_|CLAUDE_|NODE_OPTIONS$)/i.test(key)));
|
|
566
|
+
return Object.fromEntries(Object.entries(env).filter(([key]) => !UPDATER_ENVIRONMENT_RE.test(key) && !UPDATER_ENVIRONMENT_RE_2.test(key)));
|
|
562
567
|
}
|
|
563
568
|
function startWorker(directory, env) {
|
|
564
569
|
const sourceDir = path.resolve(__dirname, '..', '..', 'bin');
|
|
@@ -704,7 +709,7 @@ async function maybeWarnOutdatedCli(opts) {
|
|
|
704
709
|
function shouldCheckCliUpdateAtStartup(argv, isTTY, env = process.env) {
|
|
705
710
|
if (!isTTY || isNudgeSuppressed(env) || isTruthyEnv(env.CI))
|
|
706
711
|
return false;
|
|
707
|
-
if (argv.some((arg) =>
|
|
712
|
+
if (argv.some((arg) => SHOULD_CHECK_CLI_UPDATE_AT_STARTUP_RE.test(arg)))
|
|
708
713
|
return false;
|
|
709
714
|
const command = argv
|
|
710
715
|
.filter((arg) => !arg.startsWith('-'))
|
|
@@ -10,6 +10,7 @@ exports.renderUsageOverview = renderUsageOverview;
|
|
|
10
10
|
exports.renderUsageReference = renderUsageReference;
|
|
11
11
|
exports.auditUsageBudgets = auditUsageBudgets;
|
|
12
12
|
const command_manifest_1 = require("./command-manifest");
|
|
13
|
+
const COMPACT_RE = /\s+/g;
|
|
13
14
|
/**
|
|
14
15
|
* `skrr commands --json` is intentionally exhaustive. That makes it the right
|
|
15
16
|
* source of truth, but a bad first read for an agent: loading several hundred
|
|
@@ -236,7 +237,7 @@ function exampleFor(entry, bin) {
|
|
|
236
237
|
return compact(raw || `${bin} ${entry.command}`, 96);
|
|
237
238
|
}
|
|
238
239
|
function compact(value, maxCharacters) {
|
|
239
|
-
const normalized = value.replace(
|
|
240
|
+
const normalized = value.replace(COMPACT_RE, ' ').trim();
|
|
240
241
|
if (normalized.length <= maxCharacters)
|
|
241
242
|
return normalized;
|
|
242
243
|
return `${normalized.slice(0, Math.max(0, maxCharacters - 1)).trimEnd()}…`;
|
package/dist/lib/usd-micros.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.expectedPriceFlagMicros = expectedPriceFlagMicros;
|
|
|
6
6
|
exports.expectedPriceMismatchMessage = expectedPriceMismatchMessage;
|
|
7
7
|
exports.withUsdPrices = withUsdPrices;
|
|
8
8
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
9
|
+
const PARSE_USD_CENTS_RE = /^\d+(\.\d{1,2})?$/;
|
|
9
10
|
/**
|
|
10
11
|
* Parse a user-typed USD amount ("5", "2.50") into integer micros.
|
|
11
12
|
*
|
|
@@ -30,7 +31,7 @@ function usdToMicrosOrZero(amount) {
|
|
|
30
31
|
}
|
|
31
32
|
function parseUsdCents(amount) {
|
|
32
33
|
const trimmed = amount.trim();
|
|
33
|
-
if (
|
|
34
|
+
if (!PARSE_USD_CENTS_RE.test(trimmed))
|
|
34
35
|
return null;
|
|
35
36
|
const [whole, frac = ''] = trimmed.split('.');
|
|
36
37
|
const cents = Number(whole) * 100 + Number(frac.padEnd(2, '0'));
|
package/dist/lib/web-url.js
CHANGED
|
@@ -46,6 +46,7 @@ exports.withDataUrls = withDataUrls;
|
|
|
46
46
|
exports.workflowUrlFrom = workflowUrlFrom;
|
|
47
47
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
48
48
|
const publicEndpoints_generated_1 = require("./publicEndpoints.generated");
|
|
49
|
+
const TRIM_TRAILING_SLASH_RE = /\/+$/;
|
|
49
50
|
/**
|
|
50
51
|
* Site-relative canonical path for an entity, or `null` when the required id is
|
|
51
52
|
* missing. When a task/goal knows its hosting space we emit the canonical
|
|
@@ -430,5 +431,5 @@ function encodeId(value) {
|
|
|
430
431
|
return raw ? encodeURIComponent(raw) : '';
|
|
431
432
|
}
|
|
432
433
|
function trimTrailingSlash(value) {
|
|
433
|
-
return value.replace(
|
|
434
|
+
return value.replace(TRIM_TRAILING_SLASH_RE, '');
|
|
434
435
|
}
|
package/dist/lib/widgetCheck.js
CHANGED
|
@@ -68,6 +68,12 @@ exports.formatWidgetCheckReport = formatWidgetCheckReport;
|
|
|
68
68
|
const vm = __importStar(require("node:vm"));
|
|
69
69
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
70
70
|
const widgetStaticScan_1 = require("./widgetStaticScan");
|
|
71
|
+
const SYNTAX_ISSUE_RE = /^widget\.js:(\d+)/;
|
|
72
|
+
const GRAMMAR_FIX_RE = /more than once/;
|
|
73
|
+
const GRAMMAR_FIX_RE_2 = /no html or js/;
|
|
74
|
+
const GRAMMAR_FIX_RE_3 = /before the first section marker/;
|
|
75
|
+
const CHECK_FENCE_TEXT_RE = /\r\n?/g;
|
|
76
|
+
const SCHEMA_ISSUES_RE = /exceeds .* characters/;
|
|
71
77
|
// ── report types (the `--json` shape; stable) ───────────────────────────────
|
|
72
78
|
exports.WIDGET_CHECK_REPORT_VERSION = 1;
|
|
73
79
|
exports.WIDGET_CHECK_HEURISTIC_NOTE = 'Grammar, schema, size and JavaScript syntax findings are exact. Static findings are a heuristic ' +
|
|
@@ -202,7 +208,7 @@ function syntaxIssue(script, section, firstLine) {
|
|
|
202
208
|
const message = errorMessage(err);
|
|
203
209
|
const stack = err?.stack;
|
|
204
210
|
const head = typeof stack === 'string' ? stack.split('\n')[0] : '';
|
|
205
|
-
const at =
|
|
211
|
+
const at = SYNTAX_ISSUE_RE.exec(head);
|
|
206
212
|
const fix = SYNTAX_FIXES.find(([pattern]) => pattern.test(message))?.[1];
|
|
207
213
|
return {
|
|
208
214
|
severity: 'error',
|
|
@@ -291,13 +297,13 @@ function grammarFix(reason, message) {
|
|
|
291
297
|
case 'invalid-header':
|
|
292
298
|
return `Write the opening line like ${exampleOpener()}: the title in quotes, height an integer, nothing after the closing brace.`;
|
|
293
299
|
case 'invalid-payload':
|
|
294
|
-
if (
|
|
300
|
+
if (GRAMMAR_FIX_RE.test(message)) {
|
|
295
301
|
return `Use each section at most once (${order}; the platform reads them in any order). Any of them may be left out.`;
|
|
296
302
|
}
|
|
297
|
-
if (
|
|
303
|
+
if (GRAMMAR_FIX_RE_2.test(message)) {
|
|
298
304
|
return 'Add an html section or a js section; a stylesheet alone is refused.';
|
|
299
305
|
}
|
|
300
|
-
if (
|
|
306
|
+
if (GRAMMAR_FIX_RE_3.test(message)) {
|
|
301
307
|
return `Start the first line after the opening line with a section marker (${order}).`;
|
|
302
308
|
}
|
|
303
309
|
return undefined;
|
|
@@ -331,7 +337,7 @@ function fenceReportFromPartial(partial) {
|
|
|
331
337
|
function checkFenceText(text, strict) {
|
|
332
338
|
// CR and CRLF each count as one line break in the grammar, and inside a block
|
|
333
339
|
// they are normalised to LF anyway, so normalising first changes no verdict.
|
|
334
|
-
const normalised = text.replace(
|
|
340
|
+
const normalised = text.replace(CHECK_FENCE_TEXT_RE, '\n');
|
|
335
341
|
const trailingBreak = normalised.endsWith('\n');
|
|
336
342
|
const lines = normalised.split('\n');
|
|
337
343
|
if (trailingBreak) {
|
|
@@ -470,7 +476,7 @@ function schemaIssues(issues, schema, handled) {
|
|
|
470
476
|
if (issue.code === 'too_big' && field && handled.has(field)) {
|
|
471
477
|
continue;
|
|
472
478
|
}
|
|
473
|
-
if (issue.code === 'custom' &&
|
|
479
|
+
if (issue.code === 'custom' && SCHEMA_ISSUES_RE.test(issue.message)) {
|
|
474
480
|
continue;
|
|
475
481
|
}
|
|
476
482
|
let message;
|
|
@@ -898,9 +904,9 @@ function renderWidgetFences(result) {
|
|
|
898
904
|
}
|
|
899
905
|
const back = (0, data_provider_1.parseUiWidgetFences)(block);
|
|
900
906
|
const widget = back.widgets[0];
|
|
901
|
-
const css = (input.css ?? '').replace(
|
|
902
|
-
const html = (input.html ?? '').replace(
|
|
903
|
-
const js = (input.js ?? '').replace(
|
|
907
|
+
const css = (input.css ?? '').replace(CHECK_FENCE_TEXT_RE, '\n');
|
|
908
|
+
const html = (input.html ?? '').replace(CHECK_FENCE_TEXT_RE, '\n');
|
|
909
|
+
const js = (input.js ?? '').replace(CHECK_FENCE_TEXT_RE, '\n');
|
|
904
910
|
const matches = back.errors.length === 0 &&
|
|
905
911
|
back.widgets.length === 1 &&
|
|
906
912
|
widget.title === input.title &&
|
|
@@ -6,6 +6,19 @@ exports.maskCssComments = maskCssComments;
|
|
|
6
6
|
exports.maskHtmlComments = maskHtmlComments;
|
|
7
7
|
exports.classifyUrl = classifyUrl;
|
|
8
8
|
exports.scanWidgetSource = scanWidgetSource;
|
|
9
|
+
const IS_IDENT_CHAR_RE = /[A-Za-z0-9_$]/;
|
|
10
|
+
const LEX_JS_RE = /[a-z]/i;
|
|
11
|
+
const LEX_JS_RE_2 = /[A-Za-z_$]/;
|
|
12
|
+
const LEX_JS_RE_3 = /[0-9A-Za-z_.]/;
|
|
13
|
+
const CLASSIFY_URL_RE = /^[a-z][a-z0-9+.-]*:/;
|
|
14
|
+
const IS_NAMESPACE_URL_RE = /^https?:\/\/www\.w3\.org\//i;
|
|
15
|
+
const SCAN_CSS_INTO_RE = /@import\s+(?:url\(\s*)?['"]?([^'")\s;]+)/i;
|
|
16
|
+
const SCAN_CSS_INTO_RE_2 = /^['"]|['"]$/g;
|
|
17
|
+
const CALLS_RE = /\b(?:window\s*\.\s*)?skrr\s*\.\s*app\s*\.\s*(?:http|service)\s*\.\s*fetch\s*\(/g;
|
|
18
|
+
const BROKER_FETCH_OFFSETS_RE = /\s/;
|
|
19
|
+
const SCAN_JS_INTO_RE = /\bopenLink\b/;
|
|
20
|
+
const SCAN_JS_INTO_RE_2 = /<\/script/i;
|
|
21
|
+
const SRCSET_URLS_RE = /\s+/;
|
|
9
22
|
const OPEN_LINK = 'window.skrr.openLink(url)';
|
|
10
23
|
// ── small text helpers ──────────────────────────────────────────────────────
|
|
11
24
|
/** ASCII-only lowercase: the same length as the input, so offsets stay valid. */
|
|
@@ -75,7 +88,7 @@ const REGEX_PRECEDING_WORDS = new Set([
|
|
|
75
88
|
'yield',
|
|
76
89
|
'await',
|
|
77
90
|
]);
|
|
78
|
-
const isIdentChar = (c) =>
|
|
91
|
+
const isIdentChar = (c) => IS_IDENT_CHAR_RE.test(c) || c > '\u007f';
|
|
79
92
|
/**
|
|
80
93
|
* Read a script once. Total and linear: it never throws, every loop advances, and
|
|
81
94
|
* a misread costs a missed or an extra finding, never a hang. It is a heuristic
|
|
@@ -191,7 +204,7 @@ function lexJs(src) {
|
|
|
191
204
|
if (closed !== -1) {
|
|
192
205
|
keep('regex', i, i + 1, closed);
|
|
193
206
|
i = closed + 1;
|
|
194
|
-
while (i < n &&
|
|
207
|
+
while (i < n && LEX_JS_RE.test(src.charAt(i))) {
|
|
195
208
|
i += 1;
|
|
196
209
|
}
|
|
197
210
|
regexAllowed = false;
|
|
@@ -201,7 +214,7 @@ function lexJs(src) {
|
|
|
201
214
|
regexAllowed = true;
|
|
202
215
|
}
|
|
203
216
|
}
|
|
204
|
-
else if (
|
|
217
|
+
else if (LEX_JS_RE_2.test(c) || c > '\u007f') {
|
|
205
218
|
let j = i + 1;
|
|
206
219
|
while (j < n && isIdentChar(src.charAt(j))) {
|
|
207
220
|
j += 1;
|
|
@@ -211,7 +224,7 @@ function lexJs(src) {
|
|
|
211
224
|
}
|
|
212
225
|
else if (c >= '0' && c <= '9') {
|
|
213
226
|
let j = i + 1;
|
|
214
|
-
while (j < n &&
|
|
227
|
+
while (j < n && LEX_JS_RE_3.test(src.charAt(j))) {
|
|
215
228
|
j += 1;
|
|
216
229
|
}
|
|
217
230
|
regexAllowed = false;
|
|
@@ -296,14 +309,14 @@ function classifyUrl(raw) {
|
|
|
296
309
|
lower.startsWith('tel:')) {
|
|
297
310
|
return 'inline';
|
|
298
311
|
}
|
|
299
|
-
if (lower.startsWith('//') ||
|
|
312
|
+
if (lower.startsWith('//') || CLASSIFY_URL_RE.test(lower)) {
|
|
300
313
|
return 'external';
|
|
301
314
|
}
|
|
302
315
|
return 'relative';
|
|
303
316
|
}
|
|
304
317
|
/** XML namespace identifiers look like URLs and load nothing. */
|
|
305
318
|
function isNamespaceUrl(url) {
|
|
306
|
-
return
|
|
319
|
+
return IS_NAMESPACE_URL_RE.test(url);
|
|
307
320
|
}
|
|
308
321
|
// ── collector ───────────────────────────────────────────────────────────────
|
|
309
322
|
class Collector {
|
|
@@ -333,7 +346,7 @@ function scanCssInto(source, baseLine, out) {
|
|
|
333
346
|
while (i !== -1) {
|
|
334
347
|
const end = lower.indexOf(';', i);
|
|
335
348
|
const statement = masked.slice(i, end === -1 ? undefined : end);
|
|
336
|
-
const target =
|
|
349
|
+
const target = SCAN_CSS_INTO_RE.exec(statement);
|
|
337
350
|
const kind = target ? classifyUrl(target[1]) : 'relative';
|
|
338
351
|
if (kind === 'external') {
|
|
339
352
|
out.add('error', 'external-resource', lineOf(i), '@import of a URL: the frame allows no stylesheet from a URL, so the rules never load.', 'Write the rules inline in this section; there are no web fonts or remote stylesheets.');
|
|
@@ -347,7 +360,7 @@ function scanCssInto(source, baseLine, out) {
|
|
|
347
360
|
while (u !== -1) {
|
|
348
361
|
const close = masked.indexOf(')', u + 4);
|
|
349
362
|
const inner = masked.slice(u + 4, close === -1 ? undefined : close).trim();
|
|
350
|
-
const value = inner.replace(
|
|
363
|
+
const value = inner.replace(SCAN_CSS_INTO_RE_2, '');
|
|
351
364
|
const kind = classifyUrl(value);
|
|
352
365
|
if (kind === 'external') {
|
|
353
366
|
out.add('error', 'external-resource', lineOf(u), 'url() of an external address: img-src and font-src allow only data: and blob: URLs here, so it is blocked.', 'Use inline SVG, a gradient, or a data: URI.');
|
|
@@ -508,14 +521,13 @@ const STRING_ARGUMENT_RULES = [
|
|
|
508
521
|
/** Broker calls send a capability message; they never use the frame's network API. */
|
|
509
522
|
function brokerFetchOffsets(code) {
|
|
510
523
|
const offsets = new Set();
|
|
511
|
-
const
|
|
512
|
-
for (const match of code.matchAll(calls)) {
|
|
524
|
+
for (const match of code.matchAll(CALLS_RE)) {
|
|
513
525
|
const start = match.index ?? 0;
|
|
514
526
|
if (start > 0 && isIdentChar(code[start - 1]))
|
|
515
527
|
continue;
|
|
516
528
|
// `other . skrr.app.http.fetch` is another object's property, not the host SDK.
|
|
517
529
|
let before = start - 1;
|
|
518
|
-
while (before >= 0 &&
|
|
530
|
+
while (before >= 0 && BROKER_FETCH_OFFSETS_RE.test(code[before]))
|
|
519
531
|
before -= 1;
|
|
520
532
|
if (before >= 0 && code[before] === '.')
|
|
521
533
|
continue;
|
|
@@ -561,14 +573,14 @@ function scanJsInto(source, baseLine, out) {
|
|
|
561
573
|
const url = match[1];
|
|
562
574
|
const index = literal.start + (match.index ?? 0);
|
|
563
575
|
const text = codeLines[lineAt(starts, index) - 1] ?? '';
|
|
564
|
-
if (isNamespaceUrl(url) ||
|
|
576
|
+
if (isNamespaceUrl(url) || SCAN_JS_INTO_RE.test(text)) {
|
|
565
577
|
continue;
|
|
566
578
|
}
|
|
567
579
|
out.add('warn', 'external-url', lineOf(index), `A URL string (${url.length > 60 ? `${url.slice(0, 57)}...` : url}): the frame can load nothing from a URL.`, `If it is a link, pass it to ${OPEN_LINK}; if it is data or an image, inline it.`);
|
|
568
580
|
}
|
|
569
581
|
}
|
|
570
582
|
// The one rule that reads the text as the HTML parser would, and so reads strings too.
|
|
571
|
-
if (
|
|
583
|
+
if (SCAN_JS_INTO_RE_2.test(commentless)) {
|
|
572
584
|
const at = asciiLower(commentless).indexOf('</script');
|
|
573
585
|
out.add('warn', 'element-close', lineOf(at), 'The text contains a closing script tag, which can end the script early depending on how the frame embeds it.', 'Write it as <\\/script> inside a string.');
|
|
574
586
|
}
|
|
@@ -676,7 +688,7 @@ const RESOURCE_ATTRIBUTES = ['src', 'srcset', 'poster', 'data', 'background', 'x
|
|
|
676
688
|
function srcsetUrls(value) {
|
|
677
689
|
return value
|
|
678
690
|
.split(',')
|
|
679
|
-
.map((candidate) => candidate.trim().split(
|
|
691
|
+
.map((candidate) => candidate.trim().split(SRCSET_URLS_RE)[0])
|
|
680
692
|
.filter(Boolean);
|
|
681
693
|
}
|
|
682
694
|
const STYLESHEET_LIKE_REL = /\b(?:stylesheet|preload|modulepreload|prefetch|icon|manifest)\b/i;
|
|
@@ -8,10 +8,12 @@ exports.describeSignalHints = describeSignalHints;
|
|
|
8
8
|
exports.describePartialOutcomes = describePartialOutcomes;
|
|
9
9
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
10
10
|
const format_1 = require("./format");
|
|
11
|
+
// eslint-disable-next-line no-control-regex
|
|
12
|
+
const PRINTABLE_RE = /[\u0000-\u001f\u007f-\u009f]/g;
|
|
13
|
+
const DESCRIBE_NODE_DETAIL_RE = /_/g;
|
|
11
14
|
/** One printable line: control characters (an ESC sequence included) become spaces. */
|
|
12
15
|
function printable(value) {
|
|
13
|
-
|
|
14
|
-
return (0, format_1.collapseWhitespace)(value.replace(/[\u0000-\u001f\u007f-\u009f]/g, ' '));
|
|
16
|
+
return (0, format_1.collapseWhitespace)(value.replace(PRINTABLE_RE, ' '));
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* Nodes in graph order: the server's topological `depth` first, then the order the server
|
|
@@ -65,7 +67,7 @@ function describeNodeDetail(node, attention = '') {
|
|
|
65
67
|
// `succeeded` with half its graph unrun looked unexplained; only --json said why (OSK-22461).
|
|
66
68
|
const extra = node;
|
|
67
69
|
if (node.status === 'skipped' && typeof extra.output?.reason === 'string') {
|
|
68
|
-
parts.push(`skipped: ${extra.output.reason.replace(
|
|
70
|
+
parts.push(`skipped: ${extra.output.reason.replace(DESCRIBE_NODE_DETAIL_RE, ' ')}`);
|
|
69
71
|
}
|
|
70
72
|
if (extra.nodeType === 'condition' && node.status === 'succeeded' && typeof extra.outcome === 'string') {
|
|
71
73
|
parts.push(`took "${extra.outcome}"`);
|
|
@@ -114,6 +114,15 @@ export declare function buildTemplateInsertPayload(input: {
|
|
|
114
114
|
semanticRevision: number;
|
|
115
115
|
presentationRevision: number;
|
|
116
116
|
}): WorkflowTemplateInsertParams;
|
|
117
|
+
/**
|
|
118
|
+
* One `--keep-concrete nodeKey.configPath` value, as the server's override list wants it.
|
|
119
|
+
*
|
|
120
|
+
* The extraction scrubs space-locked values (a `workflow_call`'s workflow id, an assignee) into
|
|
121
|
+
* slots so the fragment is portable. Keeping one concrete is a deliberate act the API supports
|
|
122
|
+
* (`slotOverrides[].keepConcrete`) and the canvas offers; without this flag the CLI could not
|
|
123
|
+
* reach it, so the template that results from the same selection differed by surface.
|
|
124
|
+
*/
|
|
125
|
+
export declare function parseKeepConcrete(values: readonly string[] | undefined, nodeKeys: readonly string[]): TemplatePlan<NonNullable<WorkflowTemplateExtractParams['slotOverrides']>>;
|
|
117
126
|
/** Shape the save-from-selection request. The client names node keys only. */
|
|
118
127
|
export declare function buildTemplateExtractPayload(flags: {
|
|
119
128
|
nodes?: string;
|
|
@@ -122,6 +131,7 @@ export declare function buildTemplateExtractPayload(flags: {
|
|
|
122
131
|
tags?: string;
|
|
123
132
|
scope?: string;
|
|
124
133
|
publish?: boolean;
|
|
134
|
+
keepConcrete?: readonly string[];
|
|
125
135
|
}): TemplatePlan<WorkflowTemplateExtractParams>;
|
|
126
136
|
/**
|
|
127
137
|
* Whether a failed insert lost the draft compare-and-swap.
|
|
@@ -12,6 +12,7 @@ exports.buildInsertConnect = buildInsertConnect;
|
|
|
12
12
|
exports.parseSlotBindings = parseSlotBindings;
|
|
13
13
|
exports.resolveTemplateVersionId = resolveTemplateVersionId;
|
|
14
14
|
exports.buildTemplateInsertPayload = buildTemplateInsertPayload;
|
|
15
|
+
exports.parseKeepConcrete = parseKeepConcrete;
|
|
15
16
|
exports.buildTemplateExtractPayload = buildTemplateExtractPayload;
|
|
16
17
|
exports.isWorkflowDraftConflict = isWorkflowDraftConflict;
|
|
17
18
|
exports.toTemplateListRow = toTemplateListRow;
|
|
@@ -491,6 +492,48 @@ function buildTemplateInsertPayload(input) {
|
|
|
491
492
|
expectedPresentationRevision: input.presentationRevision,
|
|
492
493
|
};
|
|
493
494
|
}
|
|
495
|
+
/**
|
|
496
|
+
* One `--keep-concrete nodeKey.configPath` value, as the server's override list wants it.
|
|
497
|
+
*
|
|
498
|
+
* The extraction scrubs space-locked values (a `workflow_call`'s workflow id, an assignee) into
|
|
499
|
+
* slots so the fragment is portable. Keeping one concrete is a deliberate act the API supports
|
|
500
|
+
* (`slotOverrides[].keepConcrete`) and the canvas offers; without this flag the CLI could not
|
|
501
|
+
* reach it, so the template that results from the same selection differed by surface.
|
|
502
|
+
*/
|
|
503
|
+
function parseKeepConcrete(values, nodeKeys) {
|
|
504
|
+
const overrides = [];
|
|
505
|
+
const seen = new Set();
|
|
506
|
+
for (const raw of values ?? []) {
|
|
507
|
+
const value = raw.trim();
|
|
508
|
+
const dot = value.indexOf('.');
|
|
509
|
+
const nodeKey = dot > 0 ? value.slice(0, dot) : '';
|
|
510
|
+
const configPath = dot > 0 ? value.slice(dot + 1) : '';
|
|
511
|
+
if (!nodeKey || !configPath) {
|
|
512
|
+
return {
|
|
513
|
+
ok: false,
|
|
514
|
+
error: {
|
|
515
|
+
code: 'WORKFLOW_TEMPLATE_KEEP_CONCRETE_INVALID',
|
|
516
|
+
message: `--keep-concrete takes nodeKey.configPath, for example call_1.definitionId (got "${raw}").`,
|
|
517
|
+
},
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
// An override for a node that is not being extracted would change nothing and say nothing.
|
|
521
|
+
if (!nodeKeys.includes(nodeKey)) {
|
|
522
|
+
return {
|
|
523
|
+
ok: false,
|
|
524
|
+
error: {
|
|
525
|
+
code: 'WORKFLOW_TEMPLATE_KEEP_CONCRETE_NOT_SELECTED',
|
|
526
|
+
message: `--keep-concrete ${value}: node "${nodeKey}" is not in --nodes (${nodeKeys.join(', ')}).`,
|
|
527
|
+
},
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
if (seen.has(value))
|
|
531
|
+
continue;
|
|
532
|
+
seen.add(value);
|
|
533
|
+
overrides.push({ nodeKey, configPath, keepConcrete: true });
|
|
534
|
+
}
|
|
535
|
+
return { ok: true, payload: overrides };
|
|
536
|
+
}
|
|
494
537
|
/** Shape the save-from-selection request. The client names node keys only. */
|
|
495
538
|
function buildTemplateExtractPayload(flags) {
|
|
496
539
|
const nodeKeys = flags.nodes ? csv(flags.nodes) : [];
|
|
@@ -524,6 +567,9 @@ function buildTemplateExtractPayload(flags) {
|
|
|
524
567
|
const scope = parseTemplateScope(flags.scope);
|
|
525
568
|
if (!scope.ok)
|
|
526
569
|
return scope;
|
|
570
|
+
const keepConcrete = parseKeepConcrete(flags.keepConcrete, nodeKeys);
|
|
571
|
+
if (!keepConcrete.ok)
|
|
572
|
+
return keepConcrete;
|
|
527
573
|
return {
|
|
528
574
|
ok: true,
|
|
529
575
|
payload: defined({
|
|
@@ -532,6 +578,7 @@ function buildTemplateExtractPayload(flags) {
|
|
|
532
578
|
description: flags.description,
|
|
533
579
|
tags: tags.payload,
|
|
534
580
|
scope: scope.payload,
|
|
581
|
+
slotOverrides: keepConcrete.payload.length ? keepConcrete.payload : undefined,
|
|
535
582
|
// The server default is `true`; an explicit `false` has to survive so
|
|
536
583
|
// `--no-publish` actually leaves the row unpublished.
|
|
537
584
|
publish: flags.publish,
|
package/dist/lib/write-target.js
CHANGED
|
@@ -19,6 +19,7 @@ exports.firstUnmetExpectation = firstUnmetExpectation;
|
|
|
19
19
|
* them and whether an expectation holds.
|
|
20
20
|
*/
|
|
21
21
|
const core_1 = require("@oclif/core");
|
|
22
|
+
const HOST_OF_RE = /^[a-z][a-z0-9+.-]*:\/\//i;
|
|
22
23
|
/** `stevedu518@gmail.com on https://skrr.ai (no workspace)` */
|
|
23
24
|
function formatWriteTarget(target) {
|
|
24
25
|
const who = target.account ?? target.accountId ?? 'an account that could not be read';
|
|
@@ -27,7 +28,7 @@ function formatWriteTarget(target) {
|
|
|
27
28
|
}
|
|
28
29
|
function hostOf(value) {
|
|
29
30
|
try {
|
|
30
|
-
return new URL(
|
|
31
|
+
return new URL(HOST_OF_RE.test(value) ? value : `https://${value}`).host.toLowerCase();
|
|
31
32
|
}
|
|
32
33
|
catch {
|
|
33
34
|
return null;
|
|
@@ -48,12 +49,10 @@ function matchesExpectedTarget(target, expected) {
|
|
|
48
49
|
const value = expected.trim();
|
|
49
50
|
if (!value)
|
|
50
51
|
return false;
|
|
51
|
-
if (value.includes('@') &&
|
|
52
|
+
if (value.includes('@') && !HOST_OF_RE.test(value)) {
|
|
52
53
|
return target.account !== null && target.account.toLowerCase() === value.toLowerCase();
|
|
53
54
|
}
|
|
54
|
-
if (
|
|
55
|
-
value.includes('.') ||
|
|
56
|
-
value.startsWith('localhost')) {
|
|
55
|
+
if (HOST_OF_RE.test(value) || value.includes('.') || value.startsWith('localhost')) {
|
|
57
56
|
const expectedHost = hostOf(value);
|
|
58
57
|
return expectedHost !== null && expectedHost === hostOf(target.server);
|
|
59
58
|
}
|
|
@@ -39,6 +39,7 @@ var import_node_child_process = require("node:child_process");
|
|
|
39
39
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
40
40
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
41
41
|
var import_runtime = require("./runtime.js");
|
|
42
|
+
const PARSE_HELPER_OUTPUT_RE = /\s/;
|
|
42
43
|
const MAX_OUTPUT_BYTES = 64 * 1024;
|
|
43
44
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
44
45
|
const DEFAULT_TTL_MS = 5 * 6e4;
|
|
@@ -234,7 +235,7 @@ function parseHelperOutput(stdout, log) {
|
|
|
234
235
|
return null;
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
|
-
if (
|
|
238
|
+
if (PARSE_HELPER_OUTPUT_RE.test(trimmed)) {
|
|
238
239
|
log.error("[authHelper] bare-token output contains whitespace \u2014 refusing (use JSON if helper logs to stdout)");
|
|
239
240
|
return null;
|
|
240
241
|
}
|