@reticlehq/server 2.12.0 → 2.13.0
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/SKILL.md +67 -109
- package/dist/bridge/auth-failure-reason.d.ts +6 -2
- package/dist/bridge/auth-failure-reason.js +15 -8
- package/dist/bridge/bridge.d.ts +18 -1
- package/dist/bridge/bridge.js +247 -164
- package/dist/bridge/pairing-token.d.ts +5 -0
- package/dist/bridge/pairing-token.js +28 -0
- package/dist/bridge/protocol-skew.d.ts +37 -0
- package/dist/bridge/protocol-skew.js +45 -0
- package/dist/capsule/capsule-store.d.ts +6 -6
- package/dist/capsule/causal-summary.js +7 -2
- package/dist/cli/cli-doctor.js +31 -1
- package/dist/cli/cli-launch.d.ts +11 -1
- package/dist/cli/cli-launch.js +59 -10
- package/dist/cli/cli-parse.d.ts +15 -1
- package/dist/cli/cli-parse.js +212 -8
- package/dist/cli/cli-verify.d.ts +1 -0
- package/dist/cli/cli-verify.js +3 -2
- package/dist/cli/cloud-cli.js +428 -259
- package/dist/cli/cloud-keystore.d.ts +37 -0
- package/dist/cli/cloud-keystore.js +97 -0
- package/dist/cli/cloud-kit.d.ts +37 -0
- package/dist/cli/cloud-kit.js +121 -0
- package/dist/cli/cloud-login.d.ts +17 -0
- package/dist/cli/cloud-login.js +183 -0
- package/dist/cli/cloud-session.d.ts +48 -0
- package/dist/cli/cloud-session.js +53 -0
- package/dist/cli/config-discovery.js +1 -0
- package/dist/cli/daemon-start-options.d.ts +32 -0
- package/dist/cli/daemon-start-options.js +38 -0
- package/dist/cli/device-flow.d.ts +76 -0
- package/dist/cli/device-flow.js +56 -0
- package/dist/cli/doctor-rows.d.ts +9 -0
- package/dist/cli/doctor-rows.js +9 -0
- package/dist/cli/drive-attach.d.ts +13 -0
- package/dist/cli/drive-attach.js +18 -0
- package/dist/cli/drive-command.js +7 -3
- package/dist/cli/mcp-command.js +51 -20
- package/dist/cli/project-name.d.ts +30 -0
- package/dist/cli/project-name.js +44 -0
- package/dist/cli/status-next-action.d.ts +14 -0
- package/dist/cli/status-next-action.js +4 -4
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +134 -80
- package/dist/cloud/cloud-config.d.ts +22 -1
- package/dist/cloud/cloud-config.js +64 -5
- package/dist/cloud/cloud-sync.d.ts +5 -5
- package/dist/cloud/cloud-sync.js +33 -2
- package/dist/cloud/sync-cycle.d.ts +110 -0
- package/dist/cloud/sync-cycle.js +270 -0
- package/dist/cloud/sync-daemon.d.ts +69 -0
- package/dist/cloud/sync-daemon.js +260 -0
- package/dist/cloud/sync-disk.d.ts +9 -0
- package/dist/cloud/sync-disk.js +191 -0
- package/dist/cloud/sync-hash.d.ts +2 -0
- package/dist/cloud/sync-hash.js +35 -0
- package/dist/crawl/crawl-tools.js +5 -3
- package/dist/crawl/crawl.d.ts +3 -0
- package/dist/crawl/crawl.js +5 -0
- package/dist/daemon/daemon-resolve.d.ts +43 -0
- package/dist/daemon/daemon-resolve.js +69 -0
- package/dist/daemon/dev-servers.d.ts +15 -0
- package/dist/daemon/dev-servers.js +68 -0
- package/dist/daemon/wake-decision.d.ts +32 -0
- package/dist/daemon/wake-decision.js +38 -0
- package/dist/domain/domain-tools.js +2 -2
- package/dist/events/contradictions.d.ts +18 -0
- package/dist/events/contradictions.js +134 -21
- package/dist/events/declared.d.ts +7 -4
- package/dist/events/declared.js +15 -6
- package/dist/events/echo-mismatch.js +64 -14
- package/dist/events/event-filters.d.ts +8 -0
- package/dist/events/event-filters.js +19 -2
- package/dist/events/predicate-eval.js +53 -5
- package/dist/events/predicate-precheck.d.ts +8 -0
- package/dist/events/predicate-precheck.js +41 -0
- package/dist/events/predicate-route.d.ts +14 -0
- package/dist/events/predicate-route.js +36 -8
- package/dist/events/predicate.d.ts +5 -0
- package/dist/events/predicate.js +37 -5
- package/dist/events/split-text-miss.d.ts +30 -0
- package/dist/events/split-text-miss.js +44 -0
- package/dist/flows/flake.d.ts +6 -6
- package/dist/flows/flow-memory-consult.d.ts +55 -0
- package/dist/flows/flow-memory-consult.js +38 -0
- package/dist/flows/flow-replay-run.d.ts +18 -7
- package/dist/flows/flow-replay-run.js +239 -22
- package/dist/flows/flow-replay.js +11 -2
- package/dist/flows/flow-step-runners.d.ts +8 -0
- package/dist/flows/flow-step-runners.js +8 -2
- package/dist/flows/flow-store-for-session.d.ts +31 -0
- package/dist/flows/flow-store-for-session.js +33 -0
- package/dist/flows/flow-tools.js +58 -32
- package/dist/flows/flows.d.ts +8 -0
- package/dist/flows/flows.js +468 -2
- package/dist/flows/heal-run.js +5 -2
- package/dist/flows/predicate-to-expect.d.ts +17 -12
- package/dist/flows/predicate-to-expect.js +30 -12
- package/dist/flows/recordings.d.ts +13 -1
- package/dist/flows/recordings.js +17 -2
- package/dist/flows/replay.d.ts +22 -2
- package/dist/flows/replay.js +28 -2
- package/dist/flows/verify-change-tools.js +5 -2
- package/dist/honesty/blind-spots.d.ts +55 -2
- package/dist/honesty/blind-spots.js +63 -3
- package/dist/honesty/honesty.d.ts +24 -0
- package/dist/honesty/honesty.js +25 -1
- package/dist/honesty/instrumentation-gaps.d.ts +9 -0
- package/dist/honesty/instrumentation-gaps.js +29 -2
- package/dist/honesty/verified.d.ts +2 -1
- package/dist/honesty/verified.js +16 -1
- package/dist/http-server.js +12 -0
- package/dist/impact/impact-recorder.d.ts +31 -8
- package/dist/impact/impact-recorder.js +104 -21
- package/dist/impact/impact-store.d.ts +15 -1
- package/dist/impact/impact-store.js +43 -2
- package/dist/index.js +113 -7
- package/dist/init/agent-rules.d.ts +13 -6
- package/dist/init/agent-rules.js +23 -12
- package/dist/init/astro-patch.d.ts +16 -0
- package/dist/init/astro-patch.js +28 -0
- package/dist/init/capabilities.d.ts +4 -1
- package/dist/init/capabilities.js +22 -2
- package/dist/init/confirm.d.ts +31 -7
- package/dist/init/confirm.js +48 -8
- package/dist/init/cra.d.ts +20 -4
- package/dist/init/cra.js +57 -17
- package/dist/init/csp-check.js +17 -2
- package/dist/init/csp-doctor.d.ts +8 -1
- package/dist/init/csp-doctor.js +8 -3
- package/dist/init/dev-script.d.ts +3 -1
- package/dist/init/dev-script.js +8 -5
- package/dist/init/format-generated.d.ts +18 -0
- package/dist/init/format-generated.js +39 -0
- package/dist/init/install-hint.d.ts +9 -0
- package/dist/init/install-hint.js +29 -0
- package/dist/init/mcp-clients.d.ts +7 -0
- package/dist/init/mcp-clients.js +7 -0
- package/dist/init/mcp.d.ts +1 -1
- package/dist/init/mcp.js +1 -1
- package/dist/init/node-io.js +11 -1
- package/dist/init/plan-framework.js +81 -45
- package/dist/init/plan.d.ts +20 -7
- package/dist/init/plan.js +20 -45
- package/dist/init/preflight.d.ts +28 -0
- package/dist/init/preflight.js +38 -0
- package/dist/init/run.d.ts +32 -9
- package/dist/init/run.js +141 -119
- package/dist/init/slash-command.d.ts +1 -1
- package/dist/init/snippets.js +41 -25
- package/dist/init/vite-config.d.ts +1 -1
- package/dist/init/vite-config.js +39 -25
- package/dist/init/workspace-apps.d.ts +17 -10
- package/dist/init/workspace-apps.js +110 -0
- package/dist/input/network-mock-tools.js +3 -6
- package/dist/input/real-input.js +25 -5
- package/dist/input/scroll-tools.js +4 -6
- package/dist/input/viewport-tools.js +5 -4
- package/dist/intent/inline-intent.d.ts +10 -19
- package/dist/intent/inline-intent.js +91 -1
- package/dist/intent/intent-shard-store.d.ts +72 -0
- package/dist/intent/intent-shard-store.js +203 -0
- package/dist/intent/intent-shard.d.ts +411 -0
- package/dist/intent/intent-shard.js +176 -0
- package/dist/intent/intent-store.d.ts +12 -0
- package/dist/intent/intent-store.js +21 -0
- package/dist/intent/intent-subject.d.ts +45 -0
- package/dist/intent/intent-subject.js +177 -0
- package/dist/intent/intent-tools.js +65 -2
- package/dist/intent/open-intents.d.ts +21 -0
- package/dist/intent/open-intents.js +15 -0
- package/dist/license/license-env.d.ts +29 -0
- package/dist/license/license-env.js +148 -0
- package/dist/loopback-agent.d.ts +31 -0
- package/dist/loopback-agent.js +57 -0
- package/dist/mcp/attach-memory.d.ts +18 -2
- package/dist/mcp/attach-memory.js +50 -7
- package/dist/mcp/client-identity.d.ts +31 -0
- package/dist/mcp/client-identity.js +51 -0
- package/dist/mcp/mcp-post-transport.d.ts +26 -0
- package/dist/mcp/mcp-post-transport.js +109 -0
- package/dist/mcp/mcp-proxy.d.ts +2 -1
- package/dist/mcp/mcp-proxy.js +52 -62
- package/dist/mcp/mcp.js +7 -1
- package/dist/mcp/proxy-backoff.d.ts +11 -0
- package/dist/mcp/proxy-backoff.js +13 -0
- package/dist/mcp/proxy-daemon-probe.d.ts +1 -0
- package/dist/mcp/proxy-daemon-probe.js +7 -1
- package/dist/mcp/proxy-handshake.d.ts +23 -0
- package/dist/mcp/proxy-handshake.js +31 -0
- package/dist/mcp/tool-catalog-cache.d.ts +8 -0
- package/dist/mcp/tool-catalog-cache.js +12 -0
- package/dist/memory/memory-tools.d.ts +2 -0
- package/dist/memory/memory-tools.js +82 -0
- package/dist/memory/project-memory.d.ts +34 -0
- package/dist/memory/project-memory.js +96 -0
- package/dist/oracles/propose-consequences.js +12 -3
- package/dist/pool/browser-pool.d.ts +63 -4
- package/dist/pool/browser-pool.js +113 -4
- package/dist/pool/playwright-launcher.js +9 -0
- package/dist/project/project-tools.js +3 -3
- package/dist/project/reticle-dir.d.ts +15 -2
- package/dist/project/reticle-dir.js +21 -4
- package/dist/runs/run-store.d.ts +10 -0
- package/dist/runs/run-store.js +10 -0
- package/dist/runs/verification-sync.d.ts +0 -11
- package/dist/runs/verification-sync.js +22 -1
- package/dist/runs/verify-server.d.ts +8 -1
- package/dist/runs/verify-server.js +14 -2
- package/dist/session/command-timeout.d.ts +5 -2
- package/dist/session/command-timeout.js +5 -4
- package/dist/session/lease-visibility.d.ts +67 -0
- package/dist/session/lease-visibility.js +76 -0
- package/dist/session/no-session-diagnosis.d.ts +23 -0
- package/dist/session/no-session-diagnosis.js +58 -17
- package/dist/session/no-session-next-action.d.ts +7 -0
- package/dist/session/no-session-next-action.js +42 -3
- package/dist/session/no-session-watch.d.ts +10 -6
- package/dist/session/no-session-watch.js +51 -19
- package/dist/session/pending-commands.d.ts +11 -1
- package/dist/session/pending-commands.js +12 -2
- package/dist/session/resolve-within.d.ts +34 -0
- package/dist/session/resolve-within.js +53 -0
- package/dist/session/session-info.d.ts +18 -0
- package/dist/session/session-info.js +11 -0
- package/dist/session/session-manager.d.ts +14 -0
- package/dist/session/session-manager.js +61 -3
- package/dist/session/session-mirror.d.ts +16 -0
- package/dist/session/session-mirror.js +22 -0
- package/dist/session/session-recommendation.d.ts +19 -5
- package/dist/session/session-recommendation.js +25 -9
- package/dist/session/session-successor.js +36 -1
- package/dist/session/session-tools.js +2 -2
- package/dist/session/session.d.ts +22 -2
- package/dist/session/session.js +87 -7
- package/dist/session/wall-clock.d.ts +12 -0
- package/dist/session/wall-clock.js +14 -0
- package/dist/setup/agent-configs.d.ts +96 -0
- package/dist/setup/agent-configs.js +333 -0
- package/dist/setup/agent-io.d.ts +9 -0
- package/dist/setup/agent-io.js +16 -0
- package/dist/setup/agent-writer.d.ts +51 -0
- package/dist/setup/agent-writer.js +115 -0
- package/dist/setup/approval-migration.d.ts +47 -0
- package/dist/setup/approval-migration.js +68 -0
- package/dist/setup/auto-approve.d.ts +85 -0
- package/dist/setup/auto-approve.js +150 -0
- package/dist/setup/bridge-port.d.ts +15 -0
- package/dist/setup/bridge-port.js +24 -0
- package/dist/setup/desktop-shape.d.ts +57 -0
- package/dist/setup/desktop-shape.js +63 -0
- package/dist/setup/dev-server-wait.d.ts +60 -0
- package/dist/setup/dev-server-wait.js +65 -0
- package/dist/setup/drive-agent.d.ts +71 -0
- package/dist/setup/drive-agent.js +171 -0
- package/dist/setup/drive-plan.d.ts +68 -0
- package/dist/setup/drive-plan.js +130 -0
- package/dist/setup/ensure-daemon.d.ts +29 -0
- package/dist/setup/ensure-daemon.js +58 -0
- package/dist/setup/init-runtime.d.ts +47 -0
- package/dist/setup/init-runtime.js +160 -0
- package/dist/setup/interrupt.d.ts +25 -0
- package/dist/setup/interrupt.js +40 -0
- package/dist/setup/license-key.d.ts +39 -0
- package/dist/setup/license-key.js +72 -0
- package/dist/setup/listeners.d.ts +37 -0
- package/dist/setup/listeners.js +85 -0
- package/dist/setup/node-effects.d.ts +60 -0
- package/dist/setup/node-effects.js +210 -0
- package/dist/setup/page-probe.d.ts +39 -0
- package/dist/setup/page-probe.js +49 -0
- package/dist/setup/relaunch.d.ts +36 -0
- package/dist/setup/relaunch.js +57 -0
- package/dist/setup/remaining-steps.d.ts +19 -0
- package/dist/setup/remaining-steps.js +31 -0
- package/dist/setup/run-setup.d.ts +99 -0
- package/dist/setup/run-setup.js +187 -0
- package/dist/setup/session-pick.d.ts +47 -0
- package/dist/setup/session-pick.js +51 -0
- package/dist/setup/setup-command.d.ts +45 -0
- package/dist/setup/setup-command.js +199 -0
- package/dist/setup/setup-options.d.ts +74 -0
- package/dist/setup/setup-options.js +67 -0
- package/dist/setup/transcripts.d.ts +16 -0
- package/dist/setup/transcripts.js +43 -0
- package/dist/status-payload.d.ts +14 -1
- package/dist/status-payload.js +23 -1
- package/dist/telemetry/daemon-telemetry.d.ts +8 -1
- package/dist/telemetry/daemon-telemetry.js +52 -5
- package/dist/telemetry/error-class.js +1 -1
- package/dist/telemetry/feedback-context.d.ts +9 -1
- package/dist/telemetry/feedback-context.js +60 -29
- package/dist/telemetry/feedback-local.d.ts +15 -0
- package/dist/telemetry/feedback-local.js +56 -0
- package/dist/telemetry/feedback.d.ts +11 -0
- package/dist/telemetry/feedback.js +19 -6
- package/dist/telemetry/init-telemetry.d.ts +2 -0
- package/dist/telemetry/init-telemetry.js +2 -0
- package/dist/telemetry/install-source.d.ts +14 -0
- package/dist/telemetry/install-source.js +30 -0
- package/dist/telemetry/license-activation.d.ts +7 -1
- package/dist/telemetry/license-activation.js +9 -5
- package/dist/telemetry/mcp-connection.js +7 -0
- package/dist/telemetry/project-profile.d.ts +12 -1
- package/dist/telemetry/project-profile.js +11 -6
- package/dist/telemetry/proxy-telemetry.d.ts +3 -0
- package/dist/telemetry/proxy-telemetry.js +21 -0
- package/dist/telemetry/session-metrics.d.ts +12 -0
- package/dist/telemetry/session-metrics.js +35 -1
- package/dist/telemetry/telemetry.js +17 -2
- package/dist/telemetry/tool-refused.d.ts +3 -1
- package/dist/telemetry/tool-refused.js +34 -2
- package/dist/tools/act-capsule.d.ts +10 -0
- package/dist/tools/act-capsule.js +8 -2
- package/dist/tools/act-danger.d.ts +2 -1
- package/dist/tools/act-danger.js +11 -3
- package/dist/tools/act-observation.d.ts +41 -0
- package/dist/tools/act-observation.js +36 -0
- package/dist/tools/act-preflight.d.ts +20 -0
- package/dist/tools/act-preflight.js +98 -0
- package/dist/tools/act-sequence-retry.d.ts +45 -0
- package/dist/tools/act-sequence-retry.js +58 -0
- package/dist/tools/act-sequence-tool.d.ts +13 -0
- package/dist/tools/act-sequence-tool.js +135 -0
- package/dist/tools/act-target.d.ts +14 -0
- package/dist/tools/act-target.js +47 -0
- package/dist/tools/act-tools.d.ts +21 -1
- package/dist/tools/act-tools.js +100 -213
- package/dist/tools/assert-verdict.js +22 -16
- package/dist/tools/browser-tools.js +6 -2
- package/dist/tools/dynamic-tools.js +24 -5
- package/dist/tools/error-recovery.d.ts +1 -0
- package/dist/tools/error-recovery.js +8 -0
- package/dist/tools/invoke-tool.js +59 -9
- package/dist/tools/lease-tools.d.ts +30 -4
- package/dist/tools/lease-tools.js +169 -5
- package/dist/tools/merged-name-redirect.d.ts +13 -0
- package/dist/tools/merged-name-redirect.js +22 -0
- package/dist/tools/numeric-bounds.d.ts +100 -0
- package/dist/tools/numeric-bounds.js +125 -0
- package/dist/tools/observe-tools.js +47 -40
- package/dist/tools/read-tools.js +28 -7
- package/dist/tools/real-input-attempt.d.ts +10 -0
- package/dist/tools/real-input-attempt.js +59 -1
- package/dist/tools/reconcile-tools.js +4 -4
- package/dist/tools/tool-kit.d.ts +12 -0
- package/dist/tools/tool-kit.js +6 -1
- package/dist/tools/tool-names.d.ts +2 -0
- package/dist/tools/tool-names.js +2 -0
- package/dist/tools/tools-helpers.d.ts +19 -0
- package/dist/tools/tools-helpers.js +46 -0
- package/dist/tools/tools.d.ts +2 -0
- package/dist/tools/tools.js +56 -8
- package/dist/update/reticle-deps.d.ts +9 -0
- package/dist/update/reticle-deps.js +27 -0
- package/dist/update/sdk-sync.d.ts +1 -2
- package/dist/update/sdk-sync.js +1 -21
- package/dist/update/update-nudge.d.ts +18 -0
- package/dist/update/update-nudge.js +20 -0
- package/dist/version/peer-announce.js +4 -2
- package/dist/version/sdk-fix.d.ts +47 -0
- package/dist/version/sdk-fix.js +127 -0
- package/dist/version/version-nudge.d.ts +14 -0
- package/dist/version/version-nudge.js +21 -0
- package/dist/version/version-skew.d.ts +38 -3
- package/dist/version/version-skew.js +83 -7
- package/dist/visual/visual-store.d.ts +6 -6
- package/dist/visual/visual-store.js +18 -16
- package/dist/visual/visual-tools.js +57 -12
- package/docs/cli/doctor.mdx +1 -0
- package/docs/cli/serve.mdx +4 -2
- package/docs/cli.mdx +7 -3
- package/docs/desktop.mdx +1 -1
- package/docs/docs.json +1 -1
- package/docs/getting-started.md +19 -3
- package/docs/index.mdx +9 -6
- package/docs/install-agentic.mdx +38 -12
- package/docs/install-manual.mdx +1 -1
- package/docs/packages.mdx +1 -1
- package/docs/skill-file.mdx +3 -3
- package/docs/telemetry-contract.md +108 -4
- package/docs/tools-act-sequence.mdx +16 -0
- package/docs/usage.md +1 -1
- package/package.json +4 -3
- package/dist/init/cursor.d.ts +0 -24
- package/dist/init/cursor.js +0 -80
package/dist/flows/flow-tools.js
CHANGED
|
@@ -5,6 +5,7 @@ import { FlowErrorCode, RecordedSaveError, ReplayStatus, } from '@reticlehq/core
|
|
|
5
5
|
import { recordSuiteFlakes } from './suite-flakes.js';
|
|
6
6
|
import { ReticleTool } from '../tools/tool-names.js';
|
|
7
7
|
import { asNumber, asString } from '../tools/tools-helpers.js';
|
|
8
|
+
import { workerCountSchema } from '../tools/numeric-bounds.js';
|
|
8
9
|
import { log } from '../log.js';
|
|
9
10
|
import { cloudFetch, syncFlowToCloud, SyncOutcome } from '../cloud/cloud-sync.js';
|
|
10
11
|
import { mapWithConcurrency, resolveConcurrency } from './parallel-suite.js';
|
|
@@ -14,14 +15,15 @@ import { resolveProjectCloud } from '../cloud/cloud-config.js';
|
|
|
14
15
|
import { buildSuiteVerdict } from './decision.js';
|
|
15
16
|
import { classifyFlowAssertions } from './flow-classify.js';
|
|
16
17
|
import { isValidFlowName, flowPath } from '../project/reticle-dir.js';
|
|
17
|
-
import {
|
|
18
|
+
import {} from './flows.js';
|
|
19
|
+
import { flowsForSession } from './flow-store-for-session.js';
|
|
18
20
|
import { replayNamedFlow, flowErrorMessage, latestRecordedFlow, sessionProjectId, } from './flow-replay-run.js';
|
|
19
21
|
import { persistAndSyncVerificationRun } from '../runs/verification-sync.js';
|
|
20
22
|
import { runServerVerify } from './server-verify.js';
|
|
21
23
|
import { healFlow } from './heal-run.js';
|
|
22
24
|
export { replayNamedFlow } from './flow-replay-run.js';
|
|
23
25
|
/**
|
|
24
|
-
* Best-effort mirror of a just-saved flow to Reticle
|
|
26
|
+
* Best-effort mirror of a just-saved flow to Reticle (only when logged in — both cloud env vars
|
|
25
27
|
* set). Fire-and-forget: resolves the config, POSTs via the platform fetch, and logs the outcome. Any
|
|
26
28
|
* failure is swallowed so a network hiccup never affects the local save.
|
|
27
29
|
*/
|
|
@@ -68,24 +70,6 @@ export function leaseFailureReplay(name, error) {
|
|
|
68
70
|
}
|
|
69
71
|
/** Stand-in path for a flow whose name fails the path-segment guard — never a real join. */
|
|
70
72
|
const INVALID_FLOW_NAME_PATH = '(invalid flow name — not a usable path)';
|
|
71
|
-
/**
|
|
72
|
-
* The flow store a SESSION's artifacts belong in, and the root it resolved to.
|
|
73
|
-
*
|
|
74
|
-
* `deps.flows` is bound to the daemon's own root at construction, which is right only when the
|
|
75
|
-
* daemon happens to have been started in the project it is driving. When a resolver is wired and it
|
|
76
|
-
* names a different project, the write has to go there instead — so the store is rebound for this
|
|
77
|
-
* call. Rebinding is cheap: a FlowStore is a filesystem port, a root and a clock.
|
|
78
|
-
*
|
|
79
|
-
* Returns `deps.flows` unchanged when nothing is wired or the roots already agree, so the common
|
|
80
|
-
* case allocates nothing and behaves exactly as before.
|
|
81
|
-
*/
|
|
82
|
-
function flowsForSession(deps, projectId) {
|
|
83
|
-
const resolved = deps.artifactRootFor?.(projectId);
|
|
84
|
-
if (resolved === undefined || resolved.root === deps.reticleRoot) {
|
|
85
|
-
return { flows: deps.flows, root: deps.reticleRoot };
|
|
86
|
-
}
|
|
87
|
-
return { flows: new FlowStore(deps.fs, resolved.root, { now: deps.now }), root: resolved.root };
|
|
88
|
-
}
|
|
89
73
|
/**
|
|
90
74
|
* How a save reports that nobody said what the flow is for.
|
|
91
75
|
*
|
|
@@ -108,7 +92,11 @@ export const FLOW_TOOLS = [
|
|
|
108
92
|
.describe('Alias for `flowName` (the name reticle_annotate uses).'),
|
|
109
93
|
flowName: z
|
|
110
94
|
.string()
|
|
111
|
-
.describe('
|
|
95
|
+
.describe('Which RECORDING to save — the name reticle_record{start} was called with. This is a lookup key, not the filename: pass `saveAs` to choose that.'),
|
|
96
|
+
saveAs: z
|
|
97
|
+
.string()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Name for the flow file (.reticle/flows/<saveAs>.json), and the name reticle_flow{action:"load"} / reticle_flow_replay take. Omit to reuse the recording name.'),
|
|
112
100
|
intent: z
|
|
113
101
|
.string()
|
|
114
102
|
.optional()
|
|
@@ -147,12 +135,40 @@ export const FLOW_TOOLS = [
|
|
|
147
135
|
const name = asString(aliasParam(args, 'flowName', ['flow'])['flowName']) ?? '';
|
|
148
136
|
const program = deps.recordings.getCompiled(name);
|
|
149
137
|
if (program === undefined) {
|
|
138
|
+
/*
|
|
139
|
+
* Name what DOES exist.
|
|
140
|
+
*
|
|
141
|
+
* `flowName` here is the RECORDING's name, while every other flow tool reads it as the name
|
|
142
|
+
* to save AS — so recording `default` and saving as `sign-in` looks obviously right and
|
|
143
|
+
* answers "no compiled recording by that name". The old message then said "record one
|
|
144
|
+
* first", which is advice to repeat the step that just succeeded. Cost a real investigation
|
|
145
|
+
* before the names were compared.
|
|
146
|
+
*/
|
|
147
|
+
const held = deps.recordings.compiled();
|
|
150
148
|
return Promise.resolve({
|
|
151
|
-
error:
|
|
149
|
+
error: 0 === held.length
|
|
150
|
+
? flowErrorMessage(FlowErrorCode.NO_RECORDING)
|
|
151
|
+
: `no recording named '${name}'. This is the name the RECORDING was made under, not ` +
|
|
152
|
+
`the name to save it as — stopped and ready to save: ${held.map((n) => `'${n}'`).join(', ')}.`,
|
|
152
153
|
code: FlowErrorCode.NO_RECORDING,
|
|
153
154
|
});
|
|
154
155
|
}
|
|
156
|
+
// The name to save AS, which is not the name looked up above.
|
|
157
|
+
//
|
|
158
|
+
// `flowName` selects the recording; a recording is named at `record{start}`, often `default`
|
|
159
|
+
// or whatever the drive began as. Every other flow tool reads a flow name as the thing you
|
|
160
|
+
// load and replay, so a caller naming their flow at save time had no way to do it and had to
|
|
161
|
+
// `mv` the file on disk. The error message below already had to explain this ambiguity; that
|
|
162
|
+
// it needed explaining is the bug (#698).
|
|
163
|
+
const saveAs = asString(args['saveAs']);
|
|
164
|
+
if (saveAs !== undefined && !isValidFlowName(saveAs)) {
|
|
165
|
+
return Promise.resolve({
|
|
166
|
+
error: `'${saveAs}' is not a usable flow name — it becomes a filename under .reticle/flows/.`,
|
|
167
|
+
code: FlowErrorCode.INVALID_NAME,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
155
170
|
// fold any structured annotations (expect/dynamic/success/intent) onto the saved flow.
|
|
171
|
+
// Keyed by the RECORDING name: annotations were left against the recording, not the file.
|
|
156
172
|
const success = deps.annotations.success(name);
|
|
157
173
|
// The inline argument wins over an annotation left from an earlier call: it is the more recent
|
|
158
174
|
// statement, and it is the one the author just typed.
|
|
@@ -170,7 +186,8 @@ export const FLOW_TOOLS = [
|
|
|
170
186
|
if (emptyRefusal !== undefined)
|
|
171
187
|
return Promise.resolve(emptyRefusal);
|
|
172
188
|
const { flows, root } = flowsForSession(deps, projectId);
|
|
173
|
-
|
|
189
|
+
const toSave = saveAs === undefined ? program : { ...program, name: saveAs };
|
|
190
|
+
return flows.save(toSave, annotations, projectId).then(async (res) => {
|
|
174
191
|
if (!res.ok)
|
|
175
192
|
return { error: flowErrorMessage(res.code), code: res.code };
|
|
176
193
|
deps.annotations.clear(name);
|
|
@@ -211,7 +228,10 @@ export const FLOW_TOOLS = [
|
|
|
211
228
|
// received string") — caught driving the live demo.
|
|
212
229
|
handler: (deps, args) => {
|
|
213
230
|
const projectId = sessionProjectId(deps, asString(args['sessionId']));
|
|
214
|
-
|
|
231
|
+
// The APP's flows, not the daemon's. Listing where the daemon was launched is what showed a
|
|
232
|
+
// React dashboard a HUD full of Electron and Tauri flows from an unrelated checkout.
|
|
233
|
+
const { flows: store, root } = flowsForSession(deps, projectId);
|
|
234
|
+
return store.list(projectId).then((names) => ({
|
|
215
235
|
// `list` deliberately returns invalid names so they are reported rather than silently
|
|
216
236
|
// dropped — but the declared outputSchema requires `path` on EVERY entry, and omitting it made
|
|
217
237
|
// a strict MCP client reject the whole listing (the agent then sees no flows at all, which is
|
|
@@ -219,7 +239,7 @@ export const FLOW_TOOLS = [
|
|
|
219
239
|
// gets an explanatory marker instead of a joined filesystem path, which is what must never
|
|
220
240
|
// happen for a traversal-shaped name.
|
|
221
241
|
flows: names.map((name) => isValidFlowName(name)
|
|
222
|
-
? { name, path: flowPath(
|
|
242
|
+
? { name, path: flowPath(root, name, projectId) }
|
|
223
243
|
: { name, path: INVALID_FLOW_NAME_PATH }),
|
|
224
244
|
}));
|
|
225
245
|
},
|
|
@@ -368,8 +388,7 @@ export const FLOW_TOOLS = [
|
|
|
368
388
|
.array(z.string())
|
|
369
389
|
.optional()
|
|
370
390
|
.describe('Flow names to verify. Omit to verify every saved flow.'),
|
|
371
|
-
parallel:
|
|
372
|
-
.number()
|
|
391
|
+
parallel: workerCountSchema
|
|
373
392
|
.optional()
|
|
374
393
|
.describe('Run this many flows at once, each in its own isolated leased browser context (needs the browser pool). Clamped to the pool capacity and the flow count. Omit for the sequential single-tab run.'),
|
|
375
394
|
sessionId: z
|
|
@@ -398,7 +417,7 @@ export const FLOW_TOOLS = [
|
|
|
398
417
|
const projectId = sessionProjectId(deps, sessionId);
|
|
399
418
|
const requested = Array.isArray(args['names'])
|
|
400
419
|
? args['names'].filter((n) => 'string' === typeof n)
|
|
401
|
-
: await deps.flows.list(projectId);
|
|
420
|
+
: await flowsForSession(deps, projectId).flows.list(projectId);
|
|
402
421
|
// verify:server — hand the whole suite to the hosted runner; it records the verification itself.
|
|
403
422
|
const cloud = await resolveProjectCloud(deps.fs, deps.reticleRoot, homedir(), process.env);
|
|
404
423
|
const server = await runServerVerify(deps, cloud, sessionId, requested);
|
|
@@ -435,7 +454,9 @@ export const FLOW_TOOLS = [
|
|
|
435
454
|
const parallelRuns = await Promise.all(outcomes.map(async (o, i) => {
|
|
436
455
|
const name = requested[i] ?? '';
|
|
437
456
|
const replay = o.ok && o.value !== undefined ? o.value.replay : leaseFailureReplay(name, o.error);
|
|
438
|
-
const loaded = await deps
|
|
457
|
+
const loaded = await flowsForSession(deps, projectId)
|
|
458
|
+
.flows.load(name, projectId)
|
|
459
|
+
.catch(() => null);
|
|
439
460
|
const flow = loaded !== null && loaded.ok ? loaded.value : undefined;
|
|
440
461
|
return flow === undefined ? { replay } : { replay, flow };
|
|
441
462
|
}));
|
|
@@ -459,7 +480,9 @@ export const FLOW_TOOLS = [
|
|
|
459
480
|
for (const flowName of requested) {
|
|
460
481
|
const start = deps.now();
|
|
461
482
|
const replay = await replayNamedFlow(deps, { flowName, sessionId });
|
|
462
|
-
const loaded = await deps
|
|
483
|
+
const loaded = await flowsForSession(deps, projectId)
|
|
484
|
+
.flows.load(flowName, projectId)
|
|
485
|
+
.catch(() => null);
|
|
463
486
|
const flow = loaded !== null && loaded.ok ? loaded.value : undefined;
|
|
464
487
|
runs.push(flow === undefined ? { replay } : { replay, flow });
|
|
465
488
|
timed.push({ replay, durationMs: deps.now() - start });
|
|
@@ -538,10 +561,13 @@ export const FLOW_TOOLS = [
|
|
|
538
561
|
const emptyRecorded = emptyFlowRefusal(flow.steps.length, flow.name);
|
|
539
562
|
if (emptyRecorded !== undefined)
|
|
540
563
|
return emptyRecorded;
|
|
541
|
-
|
|
564
|
+
// Resolved like every other path now. This save used to go to the daemon's root while the
|
|
565
|
+
// recorded-flow save resolved per session, so where a flow landed depended on which tool wrote
|
|
566
|
+
// it — and the pair that disagreed were the two ways to save the same thing.
|
|
567
|
+
const res = await flowsForSession(deps, session.projectId).flows.saveFlow(flow, session.projectId);
|
|
542
568
|
if (!res.ok)
|
|
543
569
|
return { error: flowErrorMessage(res.code), code: res.code };
|
|
544
|
-
// If logged
|
|
570
|
+
// If logged in to Reticle, mirror the saved flow to the team's regression suite. Best-effort
|
|
545
571
|
// and non-blocking: the flow is already on disk, so a sync failure never fails the save.
|
|
546
572
|
void syncSavedFlowToCloud(deps, flow, session.projectId);
|
|
547
573
|
// Return the SaveSummary as-is ({ name, stepCount, degraded, empty }) — the outputSchema
|
package/dist/flows/flows.d.ts
CHANGED
|
@@ -19,6 +19,14 @@ export declare function anchorForStep(args: Record<string, unknown>): {
|
|
|
19
19
|
anchor: FlowAnchor;
|
|
20
20
|
degraded: boolean;
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* What a redacted fill value is replaced WITH.
|
|
24
|
+
*
|
|
25
|
+
* Replaced, never dropped. Replay still needs a step there, and a flow that silently loses its
|
|
26
|
+
* password step drifts at sign-in forever with no explanation of why. The placeholder also tells a
|
|
27
|
+
* reader what to do: the value belongs in the environment, not in a file they are about to commit.
|
|
28
|
+
*/
|
|
29
|
+
export declare const REDACTED_FILL = "<redacted: supply at replay>";
|
|
22
30
|
/**
|
|
23
31
|
* Pure: map one normalized RecordedStep → FlowStep with a semantic anchor (+ degraded marker).
|
|
24
32
|
* A ref-only (stable:false) step is recorded with a best-effort anchor and degraded:true —
|