tubeless 0.2.13 → 0.2.14
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/cli/cli-pipeline-command.d.ts +7 -2
- package/dist/cli/cli-pipeline-command.js +24 -3
- package/dist/cli/cli-pipeline-command.js.map +1 -1
- package/dist/core/child-execution.js +5 -3
- package/dist/core/child-execution.js.map +1 -1
- package/dist/core/child-progress.js +2 -0
- package/dist/core/child-progress.js.map +1 -1
- package/dist/core/pipeline-cache.d.ts +68 -0
- package/dist/core/pipeline-cache.js +157 -0
- package/dist/core/pipeline-cache.js.map +1 -0
- package/dist/core/pipeline-compiler.js +4 -2
- package/dist/core/pipeline-compiler.js.map +1 -1
- package/dist/core/pipeline-definition-identity.d.ts +3 -1
- package/dist/core/pipeline-definition-identity.js +38 -5
- package/dist/core/pipeline-definition-identity.js.map +1 -1
- package/dist/core/pipeline-definition-validation.d.ts +7 -2
- package/dist/core/pipeline-definition-validation.js +22 -2
- package/dist/core/pipeline-definition-validation.js.map +1 -1
- package/dist/core/pipeline-definition.d.ts +6 -0
- package/dist/core/pipeline-definition.js.map +1 -1
- package/dist/core/pipeline-execute.js +5 -0
- package/dist/core/pipeline-execute.js.map +1 -1
- package/dist/core/pipeline-graph.d.ts +2 -1
- package/dist/core/pipeline-graph.js +10 -4
- package/dist/core/pipeline-graph.js.map +1 -1
- package/dist/core/pipeline-mermaid.js +7 -1
- package/dist/core/pipeline-mermaid.js.map +1 -1
- package/dist/core/pipeline-plan.js +4 -0
- package/dist/core/pipeline-plan.js.map +1 -1
- package/dist/core/pipeline-query.d.ts +11 -0
- package/dist/core/pipeline-query.js +10 -0
- package/dist/core/pipeline-query.js.map +1 -0
- package/dist/core/pipeline-run-state.d.ts +2 -2
- package/dist/core/pipeline-run-state.js.map +1 -1
- package/dist/core/pipeline-step-executor.d.ts +2 -0
- package/dist/core/pipeline-step-executor.js +24 -9
- package/dist/core/pipeline-step-executor.js.map +1 -1
- package/dist/core/pipeline-step-metadata.d.ts +1 -0
- package/dist/core/pipeline-step-metadata.js +1 -0
- package/dist/core/pipeline-step-metadata.js.map +1 -1
- package/dist/core/pipeline-steps.d.ts +17 -3
- package/dist/core/pipeline-steps.js +11 -3
- package/dist/core/pipeline-steps.js.map +1 -1
- package/dist/core/pipeline-types.d.ts +20 -7
- package/dist/core/pipeline-types.js.map +1 -1
- package/dist/core/pipeline.d.ts +4 -0
- package/dist/core/pipeline.js +7 -1
- package/dist/core/pipeline.js.map +1 -1
- package/dist/node/node.d.ts +1 -0
- package/dist/node/node.js +1 -0
- package/dist/node/node.js.map +1 -1
- package/dist/reporter/interactive-reporter.js +3 -4
- package/dist/reporter/interactive-reporter.js.map +1 -1
- package/dist/reporter/reporter.d.ts +1 -0
- package/dist/reporter/reporter.js +4 -2
- package/dist/reporter/reporter.js.map +1 -1
- package/dist/run-store/cache-artifact.d.ts +7 -0
- package/dist/run-store/cache-artifact.js +22 -0
- package/dist/run-store/cache-artifact.js.map +1 -0
- package/dist/run-store/definition-diff.js +20 -8
- package/dist/run-store/definition-diff.js.map +1 -1
- package/dist/run-store/run-projection.js +2 -2
- package/dist/run-store/run-projection.js.map +1 -1
- package/dist/run-store/run-store.d.ts +2 -2
- package/dist/run-store/run-store.js.map +1 -1
- package/dist/studio/run-store-ui-artifacts.d.ts +5 -0
- package/dist/studio/run-store-ui-artifacts.js +18 -0
- package/dist/studio/run-store-ui-artifacts.js.map +1 -0
- package/dist/studio/run-store-ui-client-browser.js +2 -2
- package/dist/studio/run-store-ui-client-transport.js +9 -3
- package/dist/studio/run-store-ui-client-transport.js.map +1 -1
- package/dist/studio/run-store-ui-client.d.ts +2 -2
- package/dist/studio/run-store-ui-client.js +13 -7
- package/dist/studio/run-store-ui-client.js.map +1 -1
- package/dist/studio/run-store-ui-definitions.js +2 -1
- package/dist/studio/run-store-ui-definitions.js.map +1 -1
- package/dist/studio/run-store-ui-metadata.d.ts +13 -0
- package/dist/studio/run-store-ui-metadata.js +32 -0
- package/dist/studio/run-store-ui-metadata.js.map +1 -0
- package/dist/studio/run-store-ui-page.js +8 -0
- package/dist/studio/run-store-ui-page.js.map +1 -1
- package/dist/tracing/artifact-metadata.d.ts +1 -0
- package/dist/tracing/artifact-metadata.js +2 -2
- package/dist/tracing/artifact-metadata.js.map +1 -1
- package/dist/tracing/graph-metadata.d.ts +12 -0
- package/dist/tracing/graph-metadata.js +55 -0
- package/dist/tracing/graph-metadata.js.map +1 -0
- package/dist/tracing/tracing-internal.js +2 -2
- package/dist/tracing/tracing-internal.js.map +1 -1
- package/dist/tracing/tracing-schema.d.ts +58 -31
- package/dist/tracing/tracing-schema.js +26 -8
- package/dist/tracing/tracing-schema.js.map +1 -1
- package/dist/utilities/cache-duration.d.ts +2 -0
- package/dist/utilities/cache-duration.js +39 -0
- package/dist/utilities/cache-duration.js.map +1 -0
- package/dist/utilities/cache-key.d.ts +2 -0
- package/dist/utilities/cache-key.js +63 -0
- package/dist/utilities/cache-key.js.map +1 -0
- package/dist/utilities/cache-storage.d.ts +6 -0
- package/dist/utilities/cache-storage.js +83 -0
- package/dist/utilities/cache-storage.js.map +1 -0
- package/dist/utilities/canonical-json.d.ts +2 -0
- package/dist/utilities/canonical-json.js +12 -0
- package/dist/utilities/canonical-json.js.map +1 -0
- package/dist/workbench/workbench-commands.js +43 -3
- package/dist/workbench/workbench-commands.js.map +1 -1
- package/dist/workbench/workbench-history.js +2 -1
- package/dist/workbench/workbench-history.js.map +1 -1
- package/docs/agent-guide.md +23 -0
- package/docs/api-reference.md +98 -85
- package/docs/api-report.json +19 -6
- package/docs/artifacts.md +6 -2
- package/docs/cli.md +14 -0
- package/docs/concepts.md +10 -0
- package/docs/declarative-pipelines.md +4 -0
- package/docs/graph-metadata.md +108 -0
- package/docs/llms.txt +2 -0
- package/docs/recipes.md +5 -0
- package/docs/step-output-cache.md +242 -0
- package/docs/studio.md +11 -2
- package/examples/graph-metadata.ts +32 -0
- package/examples/project/tubeless.project.ts +5 -0
- package/examples/step-output-cache.ts +30 -0
- package/package.json +1 -1
- package/skills/tubeless/SKILL.md +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-store.js","sourceRoot":"","sources":["../../src/run-store/run-store.ts"],"names":[],"mappings":"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","sourcesContent":["import type {\n RUN_MODEL_VERSION,\n PipelineRunStatus,\n PipelineDefinitionIdentity,\n PipelineDefinitionSnapshot,\n PipelineStepLifecycleStatus,\n PipelineStepProgressDetail,\n} from \"../core/pipeline.js\";\nimport type {\n PipelineTraceError,\n PipelineTraceEvent,\n PipelineTraceExporter,\n} from \"../tracing/tracing-contracts.js\";\nimport { RunProjection } from \"./run-projection.js\";\nimport { DefinitionProjection } from \"./definition-projection.js\";\nexport { projectPipelineRun } from \"./run-projection.js\";\n\n/** One trace event after it has been appended to a durable local store. */\nexport type StoredPipelineEvent = PipelineTraceEvent & {\n /** Store-local, monotonically increasing sequence. `0` is a valid first id. */\n id: number;\n};\n\nexport interface PipelineRunEventQuery {\n /** Return events strictly after this store-local sequence. */\n afterId?: number;\n /** Restrict results to one pipeline definition. */\n pipelineId?: string;\n /** Restrict results to one run. */\n runId?: string;\n /** Maximum rows to return. Defaults to the store implementation's safe limit. */\n limit?: number;\n}\n\n/** Read-only event source consumed by run history and the local studio. */\nexport interface PipelineRunEventReader {\n close(): void | Promise<void>;\n listEvents(query?: PipelineRunEventQuery): Promise<readonly StoredPipelineEvent[]>;\n}\n\n/**\n * Append-only persistence boundary used by the local studio.\n * SQLite `export()` may return before the row is durable; call `flush()` or\n * `close()` before another connection can observe the tail.\n */\nexport interface PipelineRunEventStore extends PipelineRunEventReader, PipelineTraceExporter {}\n\nexport type StoredPipelineRunStatus = PipelineRunStatus | \"running\";\n\nexport interface StoredNestedPipeline {\n mode: \"for-each\" | \"single\" | \"iterate\";\n maxIterations?: number;\n pipelineId: string;\n stepCount: number;\n stepIds: string[];\n}\n\nexport interface StoredRemote {\n engine: string;\n target?: string;\n}\n\nexport interface StoredPipelineLog {\n attemptId?: string;\n id: number;\n level: \"error\" | \"log\" | \"warn\";\n message: string;\n stepId?: string;\n timestampMs: number;\n}\n\nexport interface StoredPipelineAttempt {\n outputSource?: \"override\";\n attemptId: string;\n durationMs?: number;\n finishedAtMs?: number;\n retries: number[];\n startedAtMs: number;\n status: Exclude<PipelineStepLifecycleStatus, \"planned\">;\n}\n\nexport type StoredPipelineArtifact = Extract<\n PipelineTraceEvent,\n { name: \"step.artifact\" }\n>[\"payload\"] & {\n attemptId: string;\n timestampMs: number;\n};\n\nexport interface StoredPipelineStep {\n artifacts?: StoredPipelineArtifact[];\n outputSource?: \"override\";\n /** One execution attempt; `retries` carries `reportAttempt` telemetry. */\n attempt?: StoredPipelineAttempt;\n description?: string;\n durationMs?: number;\n finishedAtMs?: number;\n id: string;\n name?: string;\n nestedPipeline?: StoredNestedPipeline;\n remote?: StoredRemote;\n progress?: {\n completed: number;\n detailCount?: number;\n details?: PipelineStepProgressDetail[];\n message?: string;\n total?: number;\n };\n startedAtMs?: number;\n status: PipelineStepLifecycleStatus;\n}\n\nexport interface StoredPipelineRun {\n iteration?: PipelineTraceEvent[\"iteration\"];\n definitionIdentity?: PipelineDefinitionIdentity;\n correlationId?: string;\n dryRun: boolean;\n durationMs?: number;\n error?: PipelineTraceError;\n eventCount: number;\n finishedAtMs?: number;\n logCount: number;\n logs: StoredPipelineLog[];\n parentRunId?: string;\n pipelineId: string;\n runId: string;\n startedAtMs: number;\n status: StoredPipelineRunStatus;\n steps: StoredPipelineStep[];\n /** Run-record schema version. Projector output is always `RUN_MODEL_VERSION`. */\n version: typeof RUN_MODEL_VERSION;\n}\n\nexport interface StoredPipelineDefinitionStep {\n dependencies: string[];\n description?: string;\n dryRun: string;\n id: string;\n name?: string;\n nestedPipeline?: StoredNestedPipeline;\n remote?: StoredRemote;\n optionalDependencies: string[];\n runtimeSkipPossible: boolean;\n skipAfterFailureOf: string[];\n}\n\nexport interface StoredPipelineDefinition {\n identity?: PipelineDefinitionIdentity;\n snapshot?: PipelineDefinitionSnapshot;\n activeRuns: number;\n firstSeenAtMs: number;\n lastSeenAtMs: number;\n pipelineId: string;\n runCount: number;\n steps: StoredPipelineDefinitionStep[];\n targetIds: string[];\n}\n\nexport interface PipelineRunStoreSnapshot {\n activeRunCount: number;\n completedRunCount: number;\n definitions: StoredPipelineDefinition[];\n failedRunCount: number;\n generatedAtMs: number;\n lastEventId: number;\n runs: StoredPipelineRun[];\n}\n\nfunction definitionKey(pipelineId: string, definitionId: string | undefined): string {\n return JSON.stringify([pipelineId, definitionId ?? null]);\n}\n\nexport interface PipelineRunProjector {\n append(events: readonly StoredPipelineEvent[]): void;\n clear(): void;\n snapshot(now?: number): PipelineRunStoreSnapshot;\n}\n\n/**\n * Incrementally fold accepted store events into the current run-history snapshot.\n * `{ retainLogs: false }` keeps `logCount` without retaining or cloning log bodies.\n * `{ retainArtifacts: false }` omits artifact metadata for workspace summaries.\n */\nexport function createPipelineRunProjector(\n options: { readonly retainLogs?: boolean; readonly retainArtifacts?: boolean } = {}\n): PipelineRunProjector {\n const pipelines = new Map<string, DefinitionProjection>();\n const runs = new Map<string, RunProjection>();\n let cached: PipelineRunStoreSnapshot | undefined;\n let lastAcceptedId: number | undefined;\n\n function applyEvent(event: StoredPipelineEvent): void {\n const run = runs.get(event.runId);\n if (run) run.append(event);\n else runs.set(event.runId, new RunProjection(event, options));\n\n const key = definitionKey(event.pipelineId, runs.get(event.runId)!.definitionId);\n const pipeline = pipelines.get(key);\n if (pipeline) pipeline.append(event);\n else pipelines.set(key, new DefinitionProjection(event));\n }\n\n function materialize(generatedAtMs: number): PipelineRunStoreSnapshot {\n const projectedRuns = [...runs.values()]\n .map((run) => run.snapshot())\n .sort((left, right) => right.startedAtMs - left.startedAtMs);\n const runsByPipeline = new Map<string, StoredPipelineRun[]>();\n for (const run of projectedRuns) {\n const key = definitionKey(run.pipelineId, run.definitionIdentity?.definitionId);\n const pipelineRuns = runsByPipeline.get(key) ?? [];\n pipelineRuns.push(run);\n runsByPipeline.set(key, pipelineRuns);\n }\n const definitions = [...runsByPipeline.entries()]\n .map(([key, pipelineRuns]): StoredPipelineDefinition => {\n return pipelines.get(key)!.snapshot(pipelineRuns);\n })\n .sort((left, right) => right.lastSeenAtMs - left.lastSeenAtMs);\n\n return {\n activeRunCount: projectedRuns.filter(({ status }) => status === \"running\").length,\n completedRunCount: projectedRuns.filter(({ status }) => status === \"completed\").length,\n definitions,\n failedRunCount: projectedRuns.filter(({ status }) => status === \"failed\").length,\n generatedAtMs,\n lastEventId: lastAcceptedId ?? 0,\n runs: projectedRuns,\n };\n }\n\n return {\n append(events) {\n const incoming = [...events]\n .filter((event) => lastAcceptedId === undefined || event.id > lastAcceptedId)\n .sort((left, right) => left.id - right.id);\n if (incoming.length === 0) return;\n for (const event of incoming) {\n if (lastAcceptedId !== undefined && event.id <= lastAcceptedId) continue;\n applyEvent(event);\n lastAcceptedId = event.id;\n cached = undefined;\n }\n },\n clear() {\n cached = undefined;\n lastAcceptedId = undefined;\n pipelines.clear();\n runs.clear();\n },\n snapshot(now) {\n if (!cached) {\n cached = materialize(now ?? Date.now());\n return cached;\n }\n if (now === undefined || now === cached.generatedAtMs) return cached;\n cached = { ...cached, generatedAtMs: now };\n return cached;\n },\n };\n}\n\n/** Fold an event stream into run history and observed pipeline definitions. */\nexport function projectPipelineRunStore(\n events: readonly StoredPipelineEvent[],\n generatedAtMs = Date.now()\n): PipelineRunStoreSnapshot {\n const projector = createPipelineRunProjector();\n projector.append(events);\n return projector.snapshot(generatedAtMs);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"run-store.js","sourceRoot":"","sources":["../../src/run-store/run-store.ts"],"names":[],"mappings":"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","sourcesContent":["import type {\n RUN_MODEL_VERSION,\n PipelineRunStatus,\n PipelineDefinitionIdentity,\n PipelineDefinitionSnapshot,\n PipelineStepLifecycleStatus,\n PipelineStepProgressDetail,\n} from \"../core/pipeline.js\";\nimport type {\n PipelineTraceError,\n PipelineTraceEvent,\n PipelineTraceExporter,\n} from \"../tracing/tracing-contracts.js\";\nimport { RunProjection } from \"./run-projection.js\";\nimport { DefinitionProjection } from \"./definition-projection.js\";\nexport { projectPipelineRun } from \"./run-projection.js\";\n\n/** One trace event after it has been appended to a durable local store. */\nexport type StoredPipelineEvent = PipelineTraceEvent & {\n /** Store-local, monotonically increasing sequence. `0` is a valid first id. */\n id: number;\n};\n\nexport interface PipelineRunEventQuery {\n /** Return events strictly after this store-local sequence. */\n afterId?: number;\n /** Restrict results to one pipeline definition. */\n pipelineId?: string;\n /** Restrict results to one run. */\n runId?: string;\n /** Maximum rows to return. Defaults to the store implementation's safe limit. */\n limit?: number;\n}\n\n/** Read-only event source consumed by run history and the local studio. */\nexport interface PipelineRunEventReader {\n close(): void | Promise<void>;\n listEvents(query?: PipelineRunEventQuery): Promise<readonly StoredPipelineEvent[]>;\n}\n\n/**\n * Append-only persistence boundary used by the local studio.\n * SQLite `export()` may return before the row is durable; call `flush()` or\n * `close()` before another connection can observe the tail.\n */\nexport interface PipelineRunEventStore extends PipelineRunEventReader, PipelineTraceExporter {}\n\nexport type StoredPipelineRunStatus = PipelineRunStatus | \"running\";\n\nexport interface StoredNestedPipeline {\n mode: \"for-each\" | \"single\" | \"iterate\";\n maxIterations?: number;\n pipelineId: string;\n stepCount: number;\n stepIds: string[];\n}\n\nexport interface StoredRemote {\n engine: string;\n target?: string;\n}\n\nexport interface StoredPipelineLog {\n attemptId?: string;\n id: number;\n level: \"error\" | \"log\" | \"warn\";\n message: string;\n stepId?: string;\n timestampMs: number;\n}\n\nexport interface StoredPipelineAttempt {\n outputSource?: \"override\" | \"cache\";\n attemptId: string;\n durationMs?: number;\n finishedAtMs?: number;\n retries: number[];\n startedAtMs: number;\n status: Exclude<PipelineStepLifecycleStatus, \"planned\">;\n}\n\nexport type StoredPipelineArtifact = Extract<\n PipelineTraceEvent,\n { name: \"step.artifact\" }\n>[\"payload\"] & {\n attemptId: string;\n timestampMs: number;\n};\n\nexport interface StoredPipelineStep {\n artifacts?: StoredPipelineArtifact[];\n outputSource?: \"override\" | \"cache\";\n /** One execution attempt; `retries` carries `reportAttempt` telemetry. */\n attempt?: StoredPipelineAttempt;\n description?: string;\n durationMs?: number;\n finishedAtMs?: number;\n id: string;\n name?: string;\n nestedPipeline?: StoredNestedPipeline;\n remote?: StoredRemote;\n progress?: {\n completed: number;\n detailCount?: number;\n details?: PipelineStepProgressDetail[];\n message?: string;\n total?: number;\n };\n startedAtMs?: number;\n status: PipelineStepLifecycleStatus;\n}\n\nexport interface StoredPipelineRun {\n iteration?: PipelineTraceEvent[\"iteration\"];\n definitionIdentity?: PipelineDefinitionIdentity;\n correlationId?: string;\n dryRun: boolean;\n durationMs?: number;\n error?: PipelineTraceError;\n eventCount: number;\n finishedAtMs?: number;\n logCount: number;\n logs: StoredPipelineLog[];\n parentRunId?: string;\n pipelineId: string;\n runId: string;\n startedAtMs: number;\n status: StoredPipelineRunStatus;\n steps: StoredPipelineStep[];\n /** Run-record schema version. Projector output is always `RUN_MODEL_VERSION`. */\n version: typeof RUN_MODEL_VERSION;\n}\n\nexport interface StoredPipelineDefinitionStep {\n dependencies: string[];\n description?: string;\n dryRun: string;\n id: string;\n name?: string;\n nestedPipeline?: StoredNestedPipeline;\n remote?: StoredRemote;\n optionalDependencies: string[];\n runtimeSkipPossible: boolean;\n skipAfterFailureOf: string[];\n}\n\nexport interface StoredPipelineDefinition {\n identity?: PipelineDefinitionIdentity;\n snapshot?: PipelineDefinitionSnapshot;\n activeRuns: number;\n firstSeenAtMs: number;\n lastSeenAtMs: number;\n pipelineId: string;\n runCount: number;\n steps: StoredPipelineDefinitionStep[];\n targetIds: string[];\n}\n\nexport interface PipelineRunStoreSnapshot {\n activeRunCount: number;\n completedRunCount: number;\n definitions: StoredPipelineDefinition[];\n failedRunCount: number;\n generatedAtMs: number;\n lastEventId: number;\n runs: StoredPipelineRun[];\n}\n\nfunction definitionKey(pipelineId: string, definitionId: string | undefined): string {\n return JSON.stringify([pipelineId, definitionId ?? null]);\n}\n\nexport interface PipelineRunProjector {\n append(events: readonly StoredPipelineEvent[]): void;\n clear(): void;\n snapshot(now?: number): PipelineRunStoreSnapshot;\n}\n\n/**\n * Incrementally fold accepted store events into the current run-history snapshot.\n * `{ retainLogs: false }` keeps `logCount` without retaining or cloning log bodies.\n * `{ retainArtifacts: false }` omits artifact metadata for workspace summaries.\n */\nexport function createPipelineRunProjector(\n options: { readonly retainLogs?: boolean; readonly retainArtifacts?: boolean } = {}\n): PipelineRunProjector {\n const pipelines = new Map<string, DefinitionProjection>();\n const runs = new Map<string, RunProjection>();\n let cached: PipelineRunStoreSnapshot | undefined;\n let lastAcceptedId: number | undefined;\n\n function applyEvent(event: StoredPipelineEvent): void {\n const run = runs.get(event.runId);\n if (run) run.append(event);\n else runs.set(event.runId, new RunProjection(event, options));\n\n const key = definitionKey(event.pipelineId, runs.get(event.runId)!.definitionId);\n const pipeline = pipelines.get(key);\n if (pipeline) pipeline.append(event);\n else pipelines.set(key, new DefinitionProjection(event));\n }\n\n function materialize(generatedAtMs: number): PipelineRunStoreSnapshot {\n const projectedRuns = [...runs.values()]\n .map((run) => run.snapshot())\n .sort((left, right) => right.startedAtMs - left.startedAtMs);\n const runsByPipeline = new Map<string, StoredPipelineRun[]>();\n for (const run of projectedRuns) {\n const key = definitionKey(run.pipelineId, run.definitionIdentity?.definitionId);\n const pipelineRuns = runsByPipeline.get(key) ?? [];\n pipelineRuns.push(run);\n runsByPipeline.set(key, pipelineRuns);\n }\n const definitions = [...runsByPipeline.entries()]\n .map(([key, pipelineRuns]): StoredPipelineDefinition => {\n return pipelines.get(key)!.snapshot(pipelineRuns);\n })\n .sort((left, right) => right.lastSeenAtMs - left.lastSeenAtMs);\n\n return {\n activeRunCount: projectedRuns.filter(({ status }) => status === \"running\").length,\n completedRunCount: projectedRuns.filter(({ status }) => status === \"completed\").length,\n definitions,\n failedRunCount: projectedRuns.filter(({ status }) => status === \"failed\").length,\n generatedAtMs,\n lastEventId: lastAcceptedId ?? 0,\n runs: projectedRuns,\n };\n }\n\n return {\n append(events) {\n const incoming = [...events]\n .filter((event) => lastAcceptedId === undefined || event.id > lastAcceptedId)\n .sort((left, right) => left.id - right.id);\n if (incoming.length === 0) return;\n for (const event of incoming) {\n if (lastAcceptedId !== undefined && event.id <= lastAcceptedId) continue;\n applyEvent(event);\n lastAcceptedId = event.id;\n cached = undefined;\n }\n },\n clear() {\n cached = undefined;\n lastAcceptedId = undefined;\n pipelines.clear();\n runs.clear();\n },\n snapshot(now) {\n if (!cached) {\n cached = materialize(now ?? Date.now());\n return cached;\n }\n if (now === undefined || now === cached.generatedAtMs) return cached;\n cached = { ...cached, generatedAtMs: now };\n return cached;\n },\n };\n}\n\n/** Fold an event stream into run history and observed pipeline definitions. */\nexport function projectPipelineRunStore(\n events: readonly StoredPipelineEvent[],\n generatedAtMs = Date.now()\n): PipelineRunStoreSnapshot {\n const projector = createPipelineRunProjector();\n projector.append(events);\n return projector.snapshot(generatedAtMs);\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { useState } from "preact/hooks";
|
|
3
|
+
import { cacheArtifactMetadata } from "../run-store/cache-artifact.js";
|
|
4
|
+
export function StepArtifacts({ artifacts, stepId, }) {
|
|
5
|
+
const [filter, setFilter] = useState("all");
|
|
6
|
+
const cached = artifacts.filter((entry) => cacheArtifactMetadata(entry.artifact));
|
|
7
|
+
const mixed = cached.length > 0 && cached.length < artifacts.length;
|
|
8
|
+
return (_jsxs(_Fragment, { children: [mixed && (_jsxs("label", { class: "artifact-filter", children: ["Artifacts for ", stepId, " ", _jsxs("select", { value: filter, onChange: (event) => setFilter(event.currentTarget.value), children: [_jsx("option", { value: "all", children: "All artifacts" }), _jsx("option", { value: "cache", children: "Cached outputs" }), _jsx("option", { value: "application", children: "Application artifacts" })] })] })), artifacts.map((entry, index) => {
|
|
9
|
+
const cache = cacheArtifactMetadata(entry.artifact);
|
|
10
|
+
if (mixed && ((filter === "cache" && !cache) || (filter === "application" && cache)))
|
|
11
|
+
return null;
|
|
12
|
+
const created = cache ? new Date(cache.createdAtMs) : undefined;
|
|
13
|
+
return (_jsxs("details", { class: "artifact-detail", children: [_jsxs("summary", { children: [cache ? "Cached output " : entry.preview ? "Preview " : "Artifact ", entry.operation, !cache && `: ${entry.artifact.id || entry.artifact.uri}`] }), cache && (_jsxs("div", { class: "artifact-info", children: [_jsxs("div", { children: ["Created:", " ", created && Number.isFinite(created.getTime())
|
|
14
|
+
? created.toISOString()
|
|
15
|
+
: String(cache.createdAtMs)] }), _jsxs("div", { children: ["Age at ", entry.operation, ": ", cache.ageMs, " ms"] }), entry.artifact.uri && _jsxs("div", { children: ["Location: ", entry.artifact.uri] }), entry.artifact.byteSize !== undefined && (_jsxs("div", { children: ["Size: ", entry.artifact.byteSize, " bytes"] })), _jsx("p", { class: "artifact-note", children: "Recorded operation; current cache availability is not checked." })] })), cache ? (_jsxs("details", { class: "artifact-receipt", children: [_jsx("summary", { children: "Receipt metadata" }), _jsx("pre", { children: JSON.stringify(entry.artifact, null, 2) })] })) : (_jsx("pre", { children: JSON.stringify(entry.artifact, null, 2) }))] }, index));
|
|
16
|
+
})] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=run-store-ui-artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-store-ui-artifacts.js","sourceRoot":"","sources":["../../src/studio/run-store-ui-artifacts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,MAAM,UAAU,aAAa,CAAC,EAC5B,SAAS,EACT,MAAM,GAIP;IACC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClF,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IACpE,OAAO,CACL,8BACG,KAAK,IAAI,CACR,iBAAO,KAAK,EAAC,iBAAiB,+BACb,MAAM,EAAE,GAAG,EAC1B,kBAAQ,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,aAC9E,iBAAQ,KAAK,EAAC,KAAK,8BAAuB,EAC1C,iBAAQ,KAAK,EAAC,OAAO,+BAAwB,EAC7C,iBAAQ,KAAK,EAAC,aAAa,sCAA+B,IACnD,IACH,CACT,EACA,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;gBAC9B,MAAM,KAAK,GAAG,qBAAqB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACpD,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,aAAa,IAAI,KAAK,CAAC,CAAC;oBAClF,OAAO,IAAI,CAAC;gBACd,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAChE,OAAO,CACL,mBAAS,KAAK,EAAC,iBAAiB,aAC9B,8BACG,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,EACnE,KAAK,CAAC,SAAS,EACf,CAAC,KAAK,IAAI,KAAK,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IACjD,EACT,KAAK,IAAI,CACR,eAAK,KAAK,EAAC,eAAe,aACxB,sCACW,GAAG,EACX,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;4CAC5C,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE;4CACvB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IACzB,EACN,qCACU,KAAK,CAAC,SAAS,QAAI,KAAK,CAAC,KAAK,WAClC,EACL,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,wCAAgB,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAO,EAC/D,KAAK,CAAC,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,CACxC,oCAAY,KAAK,CAAC,QAAQ,CAAC,QAAQ,cAAa,CACjD,EACD,YAAG,KAAK,EAAC,eAAe,+EAEpB,IACA,CACP,EACA,KAAK,CAAC,CAAC,CAAC,CACP,mBAAS,KAAK,EAAC,kBAAkB,aAC/B,iDAAmC,EACnC,wBAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,IAC5C,CACX,CAAC,CAAC,CAAC,CACF,wBAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,CACrD,KAjCmC,KAAK,CAkCjC,CACX,CAAC;YACJ,CAAC,CAAC,IACD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import { useState } from \"preact/hooks\";\nimport { cacheArtifactMetadata } from \"../run-store/cache-artifact.js\";\nimport type { StoredPipelineArtifact } from \"../run-store/run-store.js\";\n\nexport function StepArtifacts({\n artifacts,\n stepId,\n}: {\n artifacts: readonly StoredPipelineArtifact[];\n stepId: string;\n}) {\n const [filter, setFilter] = useState(\"all\");\n const cached = artifacts.filter((entry) => cacheArtifactMetadata(entry.artifact));\n const mixed = cached.length > 0 && cached.length < artifacts.length;\n return (\n <>\n {mixed && (\n <label class=\"artifact-filter\">\n Artifacts for {stepId}{\" \"}\n <select value={filter} onChange={(event) => setFilter(event.currentTarget.value)}>\n <option value=\"all\">All artifacts</option>\n <option value=\"cache\">Cached outputs</option>\n <option value=\"application\">Application artifacts</option>\n </select>\n </label>\n )}\n {artifacts.map((entry, index) => {\n const cache = cacheArtifactMetadata(entry.artifact);\n if (mixed && ((filter === \"cache\" && !cache) || (filter === \"application\" && cache)))\n return null;\n const created = cache ? new Date(cache.createdAtMs) : undefined;\n return (\n <details class=\"artifact-detail\" key={index}>\n <summary>\n {cache ? \"Cached output \" : entry.preview ? \"Preview \" : \"Artifact \"}\n {entry.operation}\n {!cache && `: ${entry.artifact.id || entry.artifact.uri}`}\n </summary>\n {cache && (\n <div class=\"artifact-info\">\n <div>\n Created:{\" \"}\n {created && Number.isFinite(created.getTime())\n ? created.toISOString()\n : String(cache.createdAtMs)}\n </div>\n <div>\n Age at {entry.operation}: {cache.ageMs} ms\n </div>\n {entry.artifact.uri && <div>Location: {entry.artifact.uri}</div>}\n {entry.artifact.byteSize !== undefined && (\n <div>Size: {entry.artifact.byteSize} bytes</div>\n )}\n <p class=\"artifact-note\">\n Recorded operation; current cache availability is not checked.\n </p>\n </div>\n )}\n {cache ? (\n <details class=\"artifact-receipt\">\n <summary>Receipt metadata</summary>\n <pre>{JSON.stringify(entry.artifact, null, 2)}</pre>\n </details>\n ) : (\n <pre>{JSON.stringify(entry.artifact, null, 2)}</pre>\n )}\n </details>\n );\n })}\n </>\n );\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var V0,C,f1,j2,$0,R1,I1,D1,n0,g0,O0,j1,K1,e0,G1,V2,I0={},D0=[],E2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,E0=Array.isArray;function G0(G,K){for(var Z in K)G[Z]=K[Z];return G}function Z1(G){G&&G.parentNode&&G.parentNode.removeChild(G)}function x2(G,K,Z){var $,Y,z,W={};for(z in K)z=="key"?$=K[z]:z=="ref"?Y=K[z]:W[z]=K[z];if(arguments.length>2&&(W.children=arguments.length>3?V0.call(arguments,2):Z),typeof G=="function"&&G.defaultProps!=null)for(z in G.defaultProps)W[z]===void 0&&(W[z]=G.defaultProps[z]);return y0(G,W,$,Y,null)}function y0(G,K,Z,$,Y){var z={type:G,props:K,key:Z,ref:$,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:Y==null?++f1:Y,__i:-1,__u:0};return Y==null&&C.vnode!=null&&C.vnode(z),z}function g(G){return G.children}function f0(G,K){this.props=G,this.context=K}function _0(G,K){if(K==null)return G.__?_0(G.__,G.__i+1):null;for(var Z;K<G.__k.length;K++)if((Z=G.__k[K])!=null&&Z.__e!=null)return Z.__e;return typeof G.type=="function"?_0(G):null}function h2(G){if(G.__P&&G.__d){var K=G.__v,Z=K.__e,$=[],Y=[],z=G0({},K);z.__v=K.__v+1,C.vnode&&C.vnode(z),X1(G.__P,z,K,G.__n,G.__P.namespaceURI,32&K.__u?[Z]:null,$,Z==null?_0(K):Z,!!(32&K.__u),Y),z.__v=K.__v,z.__.__k[z.__i]=z,v1($,z,Y),K.__e=K.__=null,z.__e!=Z&&V1(z)}}function V1(G){if((G=G.__)!=null&&G.__c!=null)return G.__e=G.__c.base=null,G.__k.some(function(K){if(K!=null&&K.__e!=null)return G.__e=G.__c.base=K.__e}),V1(G)}function S1(G){(!G.__d&&(G.__d=!0)&&$0.push(G)&&!j0.__r++||R1!=C.debounceRendering)&&((R1=C.debounceRendering)||I1)(j0)}function j0(){try{for(var G,K=1;$0.length;)$0.length>K&&$0.sort(D1),G=$0.shift(),K=$0.length,h2(G)}finally{$0.length=j0.__r=0}}function E1(G,K,Z,$,Y,z,W,Q,A,J,H){var M,U,_,q,O,F,L=$&&$.__k||D0,B=K.length;for(A=v2(Z,K,L,A,B),M=0;M<B;M++)(_=Z.__k[M])!=null&&(U=_.__i!=-1&&L[_.__i]||I0,_.__i=M,F=X1(G,_,U,Y,z,W,Q,A,J,H),q=_.__e,_.ref&&U.ref!=_.ref&&(U.ref&&$1(U.ref,null,_),H.push(_.ref,_.__c||q,_)),O==null&&q!=null&&(O=q),4&_.__u?(A=x1(_,A,G),U.__e&&(U.__e=null)):typeof _.type=="function"&&F!==void 0?A=F:q&&(A=q.nextSibling),_.__u&=-7);return Z.__e=O,A}function v2(G,K,Z,$,Y){var z,W,Q,A,J,H=Z.length,M=H,U=0;for(G.__k=Array(Y),z=0;z<Y;z++)(W=K[z])!=null&&typeof W!="boolean"&&typeof W!="function"?(typeof W=="string"||typeof W=="number"||typeof W=="bigint"||W.constructor==String?W=G.__k[z]=y0(null,W,null,null,null):E0(W)?W=G.__k[z]=y0(g,{children:W},null,null,null):W.constructor===void 0&&W.__b>0?W=G.__k[z]=y0(W.type,W.props,W.key,W.ref?W.ref:null,W.__v):G.__k[z]=W,A=z+U,W.__=G,W.__b=G.__b+1,Q=null,(J=W.__i=m2(W,Z,A,M))!=-1&&(M--,(Q=Z[J])&&(Q.__u|=2)),Q==null||Q.__v==null?(J==-1&&(Y>H?U--:Y<H&&U++),typeof W.type!="function"&&(W.__u|=4)):J!=A&&(J==A-1?U--:J==A+1?U++:(J>A?U--:U++,W.__u|=4))):G.__k[z]=null;if(M)for(z=0;z<H;z++)(Q=Z[z])!=null&&(2&Q.__u)==0&&(Q.__e==$&&($=_0(Q)),c1(Q,Q));return $}function x1(G,K,Z){var $,Y;if(typeof G.type=="function"){for($=G.__k,Y=0;$&&Y<$.length;Y++)$[Y]&&($[Y].__=G,K=x1($[Y],K,Z));return K}G.__e!=K&&(K&&G.type&&!K.parentNode&&(K=_0(G)),K=Z.insertBefore(G.__e,K||null));do K=K&&K.nextSibling;while(K!=null&&K.nodeType==8);return K}function m2(G,K,Z,$){var Y,z,W,Q=G.key,A=G.type,J=K[Z],H=J!=null&&(2&J.__u)==0;if(J===null&&Q==null||H&&Q==J.key&&A==J.type)return Z;if($>(H?1:0)){for(Y=Z-1,z=Z+1;Y>=0||z<K.length;)if((J=K[W=Y>=0?Y--:z++])!=null&&(2&J.__u)==0&&Q==J.key&&A==J.type)return W}return-1}function g1(G,K,Z){K[0]=="-"?G.setProperty(K,Z==null?"":Z):G[K]=Z==null?"":typeof Z!="number"||E2.test(K)?Z:Z+"px"}function S0(G,K,Z,$,Y){var z,W;G:if(K=="style")if(typeof Z=="string")G.style.cssText=Z;else{if(typeof $=="string"&&(G.style.cssText=$=""),$)for(K in $)Z&&K in Z||g1(G.style,K,"");if(Z)for(K in Z)$&&Z[K]==$[K]||g1(G.style,K,Z[K])}else if(K[0]=="o"&&K[1]=="n")z=K!=(K=K.replace(j1,"$1")),W=K.toLowerCase(),K=W in G||K=="onFocusOut"||K=="onFocusIn"?W.slice(2):K.slice(2),G.l||(G.l={}),G.l[K+z]=Z,Z?$?Z[O0]=$[O0]:(Z[O0]=K1,G.addEventListener(K,z?G1:e0,z)):G.removeEventListener(K,z?G1:e0,z);else{if(Y=="http://www.w3.org/2000/svg")K=K.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(K!="width"&&K!="height"&&K!="href"&&K!="list"&&K!="form"&&K!="tabIndex"&&K!="download"&&K!="rowSpan"&&K!="colSpan"&&K!="role"&&K!="popover"&&K in G)try{G[K]=Z==null?"":Z;break G}catch(Q){}typeof Z=="function"||(Z==null||Z===!1&&K[4]!="-"?G.removeAttribute(K):G.setAttribute(K,K=="popover"&&Z==1?"":Z))}}function y1(G){return function(K){if(this.l){var Z=this.l[K.type+G];if(K[g0]==null)K[g0]=K1++;else if(K[g0]<Z[O0])return;return Z(C.event?C.event(K):K)}}}function X1(G,K,Z,$,Y,z,W,Q,A,J){var H,M,U,_,q,O,F,L,B,b,x,h,t,e,X0,k,R=K.type;if(K.constructor!==void 0)return null;128&Z.__u&&(A=!!(32&Z.__u),z=[Q=K.__e=Z.__e]),(H=C.__b)&&H(K);G:if(typeof R=="function"){M=W.length;try{if(B=K.props,b=R.prototype&&R.prototype.render,x=(H=R.contextType)&&$[H.__c],h=H?x?x.props.value:H.__:$,Z.__c?L=(U=K.__c=Z.__c).__=U.__E:(b?K.__c=U=new R(B,h):(K.__c=U=new f0(B,h),U.constructor=R,U.render=d2),x&&x.sub(U),U.state||(U.state={}),U.__n=$,_=U.__d=!0,U.__h=[],U._sb=[]),b&&U.__s==null&&(U.__s=U.state),b&&R.getDerivedStateFromProps!=null&&(U.__s==U.state&&(U.__s=G0({},U.__s)),G0(U.__s,R.getDerivedStateFromProps(B,U.__s))),q=U.props,O=U.state,U.__v=K,_)b&&R.getDerivedStateFromProps==null&&U.componentWillMount!=null&&U.componentWillMount(),b&&U.componentDidMount!=null&&U.__h.push(U.componentDidMount);else{if(b&&R.getDerivedStateFromProps==null&&B!==q&&U.componentWillReceiveProps!=null&&U.componentWillReceiveProps(B,h),K.__v==Z.__v||!U.__e&&U.shouldComponentUpdate!=null&&U.shouldComponentUpdate(B,U.__s,h)===!1){K.__v!=Z.__v&&(U.props=B,U.state=U.__s,U.__d=!1),K.__e=Z.__e,K.__k=Z.__k,K.__k.some(function(m){m&&(m.__=K)}),D0.push.apply(U.__h,U._sb),U._sb=[],U.__h.length&&W.push(U),Q=_0(Z);break G}U.componentWillUpdate!=null&&U.componentWillUpdate(B,U.__s,h),b&&U.componentDidUpdate!=null&&U.__h.push(function(){U.componentDidUpdate(q,O,F)})}if(U.context=h,U.props=B,U.__P=G,U.__e=!1,t=C.__r,e=0,b)U.state=U.__s,U.__d=!1,t&&t(K),H=U.render(U.props,U.state,U.context),D0.push.apply(U.__h,U._sb),U._sb=[];else do U.__d=!1,t&&t(K),H=U.render(U.props,U.state,U.context),U.state=U.__s;while(U.__d&&++e<25);U.state=U.__s,U.getChildContext!=null&&($=G0(G0({},$),U.getChildContext())),b&&!_&&U.getSnapshotBeforeUpdate!=null&&(F=U.getSnapshotBeforeUpdate(q,O)),X0=H!=null&&H.type===g&&H.key==null?m1(H.props.children):H,Q=E1(G,E0(X0)?X0:[X0],K,Z,$,Y,z,W,Q,A,J),U.base=K.__e,K.__u&=-161,U.__h.length&&W.push(U),L&&(U.__E=U.__=null)}catch(m){if(W.length=M,K.__v=null,A||z!=null){if(m.then){for(K.__u|=A?160:128;Q&&Q.nodeType==8&&Q.nextSibling;)Q=Q.nextSibling;z!=null&&(z[z.indexOf(Q)]=null),K.__e=Q}else if(z!=null)for(k=z.length;k--;)Z1(z[k])}else K.__e=Z.__e;K.__k==null&&(K.__k=Z.__k||[]),m.then||h1(K),C.__e(m,K,Z)}}else z==null&&K.__v==Z.__v?(K.__k=Z.__k,K.__e=Z.__e):Q=K.__e=c2(Z.__e,K,Z,$,Y,z,W,A,J);return(H=C.diffed)&&H(K),128&K.__u?void 0:Q}function h1(G){G&&(G.__c&&(G.__c.__e=!0),G.__k&&G.__k.some(h1))}function v1(G,K,Z){for(var $=0;$<Z.length;$++)$1(Z[$],Z[++$],Z[++$]);C.__c&&C.__c(K,G),G.some(function(Y){try{G=Y.__h,Y.__h=[],G.some(function(z){z.call(Y)})}catch(z){C.__e(z,Y.__v)}})}function m1(G){return typeof G!="object"||G==null||G.__b>0?G:E0(G)?G.map(m1):G.constructor!==void 0?null:G0({},G)}function c2(G,K,Z,$,Y,z,W,Q,A){var J,H,M,U,_,q,O,F=Z.props||I0,L=K.props,B=K.type;if(B=="svg"?Y="http://www.w3.org/2000/svg":B=="math"?Y="http://www.w3.org/1998/Math/MathML":Y||(Y="http://www.w3.org/1999/xhtml"),z!=null){for(J=0;J<z.length;J++)if((_=z[J])&&"setAttribute"in _==!!B&&(B?_.localName==B:_.nodeType==3)){G=_,z[J]=null;break}}if(G==null){if(B==null)return document.createTextNode(L);G=document.createElementNS(Y,B,L.is&&L),Q&&(C.__m&&C.__m(K,z),Q=!1),z=null}if(B==null)F===L||Q&&G.data==L||(G.data=L);else{if(z=B=="textarea"&&L.defaultValue!=null?null:z&&V0.call(G.childNodes),!Q&&z!=null)for(F={},J=0;J<G.attributes.length;J++)F[(_=G.attributes[J]).name]=_.value;for(J in F)_=F[J],J=="dangerouslySetInnerHTML"?M=_:J=="children"||(J in L)||J=="value"&&("defaultValue"in L)||J=="checked"&&("defaultChecked"in L)||S0(G,J,null,_,Y);for(J in L)_=L[J],J=="children"?U=_:J=="dangerouslySetInnerHTML"?H=_:J=="value"?q=_:J=="checked"?O=_:Q&&typeof _!="function"||F[J]===_||S0(G,J,_,F[J],Y);if(H)Q||M&&(H.__html==M.__html||H.__html==G.innerHTML)||(G.innerHTML=H.__html),K.__k=[];else if(M&&(G.innerHTML=""),E1(K.type=="template"?G.content:G,E0(U)?U:[U],K,Z,$,B=="foreignObject"?"http://www.w3.org/1999/xhtml":Y,z,W,z?z[0]:Z.__k&&_0(Z,0),Q,A),z!=null)for(J=z.length;J--;)Z1(z[J]);Q&&B!="textarea"||(J="value",B=="progress"&&q==null?G.removeAttribute("value"):q!=null&&(q!==G[J]||B=="progress"&&!q||B=="option"&&q!=F[J])&&S0(G,J,q,F[J],Y),J="checked",O!=null&&O!=G[J]&&S0(G,J,O,F[J],Y))}return G}function $1(G,K,Z){try{if(typeof G=="function"){var $=typeof G.__u=="function";$&&G.__u(),$&&K==null||(G.__u=G(K))}else G.current=K}catch(Y){C.__e(Y,Z)}}function c1(G,K,Z){var $,Y;if(C.unmount&&C.unmount(G),($=G.ref)&&($.current&&$.current!=G.__e||$1($,null,K)),($=G.__c)!=null){if($.componentWillUnmount)try{$.componentWillUnmount()}catch(z){C.__e(z,K)}$.base=$.__P=$.__n=null}if($=G.__k)for(Y=0;Y<$.length;Y++)$[Y]&&c1($[Y],K,Z||typeof G.type!="function");Z||Z1(G.__e),G.__c=G.__=G.__e=void 0}function d2(G,K,Z){return this.constructor(G,Z)}function d1(G,K,Z){var $,Y,z,W;K==document&&(K=document.documentElement),C.__&&C.__(G,K),Y=($=typeof Z=="function")?null:Z&&Z.__k||K.__k,z=[],W=[],X1(K,G=(!$&&Z||K).__k=x2(g,null,[G]),Y||I0,I0,K.namespaceURI,!$&&Z?[Z]:Y?null:K.firstChild?V0.call(K.childNodes):null,z,!$&&Z?Z:Y?Y.__e:K.firstChild,$,W),v1(z,G,W),G.props.children=null}V0=D0.slice,C={__e:function(G,K,Z,$){for(var Y,z,W;K=K.__;)if((Y=K.__c)&&!Y.__)try{if((z=Y.constructor)&&z.getDerivedStateFromError!=null&&(Y.setState(z.getDerivedStateFromError(G)),W=Y.__d),Y.componentDidCatch!=null&&(Y.componentDidCatch(G,$||{}),W=Y.__d),W)return Y.__E=Y}catch(Q){G=Q}throw G}},f1=0,j2=function(G){return G!=null&&G.constructor===void 0},f0.prototype.setState=function(G,K){var Z;Z=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=G0({},this.state),typeof G=="function"&&(G=G(G0({},Z),this.props)),G&&G0(Z,G),G!=null&&this.__v&&(K&&this._sb.push(K),S1(this))},f0.prototype.forceUpdate=function(G){this.__v&&(this.__e=!0,G&&this.__h.push(G),S1(this))},f0.prototype.render=g,$0=[],I1=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,D1=function(G,K){return G.__v.__b-K.__v.__b},j0.__r=0,n0=Math.random().toString(8),g0="__d"+n0,O0="__a"+n0,j1=/(PointerCapture)$|Capture$/i,K1=0,e0=y1(!1),G1=y1(!0),V2=0;var P0,f,W1,p1,h0=0,t1=[],I=C,o1=I.__b,i1=I.__r,l1=I.diffed,u1=I.__c,r1=I.unmount,s1=I.__;function z1(G,K){I.__h&&I.__h(f,G,h0||K),h0=0;var Z=f.__H||(f.__H={__:[],__h:[]});return G>=Z.__.length&&Z.__.push({}),Z.__[G]}function y(G){return h0=1,p2(e1,G)}function p2(G,K,Z){var $=z1(P0++,2);if($.t=G,!$.__c&&($.__=[Z?Z(K):e1(void 0,K),function(Q){var A=$.__N?$.__N[0]:$.__[0],J=$.t(A,Q);A!==J&&($.__N=[J,$.__[1]],$.__c.setState({}))}],$.__c=f,!f.__f)){var Y=function(Q,A,J){if(!$.__c.__H)return!0;var H=!1,M=$.__c.props!==Q;if($.__c.__H.__.some(function(_){if(_.__N){H=!0;var q=_.__[0];_.__=_.__N,_.__N=void 0,q!==_.__[0]&&(M=!0)}}),z){var U=z.call(this,Q,A,J);return H?U||M:U}return!H||M};f.__f=!0;var{shouldComponentUpdate:z,componentWillUpdate:W}=f;f.componentWillUpdate=function(Q,A,J){if(this.__e){var H=z;z=void 0,Y(Q,A,J),z=H}W&&W.call(this,Q,A,J)},f.shouldComponentUpdate=Y}return $.__N||$.__}function s(G,K){var Z=z1(P0++,3);!I.__s&&n1(Z.__H,K)&&(Z.__=G,Z.u=K,f.__H.__h.push(Z))}function k0(G){return h0=5,v0(function(){return{current:G}},[])}function v0(G,K){var Z=z1(P0++,7);return n1(Z.__H,K)&&(Z.__=G(),Z.__H=K,Z.__h=G),Z.__}function o2(){for(var G;G=t1.shift();){var K=G.__H;if(G.__P&&K)try{K.__h.some(x0),K.__h.some(Q1),K.__h=[]}catch(Z){K.__h=[],I.__e(Z,G.__v)}}}I.__b=function(G){f=null,o1&&o1(G)},I.__=function(G,K){G&&K.__k&&K.__k.__m&&(G.__m=K.__k.__m),s1&&s1(G,K)},I.__r=function(G){i1&&i1(G),P0=0;var K=(f=G.__c).__H;K&&(W1===f?(K.__h=[],f.__h=[],K.__.some(function(Z){Z.__N&&(Z.__=Z.__N),Z.u=Z.__N=void 0})):(K.__h.some(x0),K.__h.some(Q1),K.__h=[],P0=0)),W1=f},I.diffed=function(G){l1&&l1(G);var K=G.__c;K&&K.__H&&(K.__H.__h.length&&(t1.push(K)!==1&&p1===I.requestAnimationFrame||((p1=I.requestAnimationFrame)||i2)(o2)),K.__H.__.some(function(Z){Z.u&&(Z.__H=Z.u,Z.u=void 0)})),W1=f=null},I.__c=function(G,K){K.some(function(Z){try{Z.__h.some(x0),Z.__h=Z.__h.filter(function($){return!$.__||Q1($)})}catch($){K.some(function(Y){Y.__h&&(Y.__h=[])}),K=[],I.__e($,Z.__v)}}),u1&&u1(G,K)},I.unmount=function(G){r1&&r1(G);var K,Z=G.__c;Z&&Z.__H&&(Z.__H.__.some(function($){try{x0($)}catch(Y){K=Y}}),Z.__H=void 0,K&&I.__e(K,Z.__v))};var a1=typeof requestAnimationFrame=="function";function i2(G){var K,Z=function(){clearTimeout($),a1&&cancelAnimationFrame(K),setTimeout(G)},$=setTimeout(Z,35);a1&&(K=requestAnimationFrame(Z))}function x0(G){var K=f,Z=G.__c;typeof Z=="function"&&(G.__c=void 0,Z()),f=K}function Q1(G){var K=f;G.__c=G.__(),f=K}function n1(G,K){return!G||G.length!==K.length||K.some(function(Z,$){return Z!==G[$]})}function e1(G,K){return typeof K=="function"?K(G):K}function G2(G,K){let Z=[],$=(W,Q,A,J)=>{let H=JSON.stringify(Q),M=JSON.stringify(A);if(H!==M)Z.push({field:W,before:H,after:M,...J?{stepId:J}:{}})};$("Implementation version",G.identity.implementationVersion,K.identity.implementationVersion),$("Execution order",G.steps.map(({id:W})=>W),K.steps.map(({id:W})=>W)),$("Targets",G.targetIds,K.targetIds),$("Required finalizer steps",G.requiredFinalizerStepIds,K.requiredFinalizerStepIds),$("Options validation",G.optionsValidated,K.optionsValidated),$("Result validation",G.resultValidated,K.resultValidated);let Y=new Map(G.steps.map((W)=>[W.id,W])),z=new Map(K.steps.map((W)=>[W.id,W]));for(let W of G.steps)if(!z.has(W.id))Z.push({stepId:W.id,field:"Removed step"});for(let W of K.steps){let Q=Y.get(W.id);if(!Q){Z.push({stepId:W.id,field:"Added step"});continue}$("Required edges",Q.dependencies,W.dependencies,W.id),$("Optional edges",Q.optionalDependencies,W.optionalDependencies,W.id),$("Failure gates",Q.skipAfterFailureOf,W.skipAfterFailureOf,W.id),$("Dry-run policy",Q.dryRun,W.dryRun,W.id),$("Skip policy",Q.runtimeSkipPossible,W.runtimeSkipPossible,W.id),$("Output validation",Q.outputValidated,W.outputValidated,W.id),$("Child pipeline",Q.nestedPipeline,W.nestedPipeline,W.id),$("Remote adapter",Q.remote,W.remote,W.id)}return Z}var l2=0;function X(G,K,Z,$,Y,z){K||(K={});var W,Q,A=K;if("ref"in A)for(Q in A={},K)Q=="ref"?W=K[Q]:A[Q]=K[Q];var J={type:G,props:A,key:Z,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--l2,__i:-1,__u:0,__source:Y,__self:z};if(typeof G=="function"&&(W=G.defaultProps))for(Q in W)A[Q]===void 0&&(A[Q]=W[Q]);return C.vnode&&C.vnode(J),J}function n(G){return JSON.stringify([G.pipelineId,G.identity?.definitionId??null])}function K2(G){let K=G.identity;return`${G.pipelineId} · ${K?K.definitionId.slice(7,19):"Legacy (identity not recorded)"} · ${K?.implementationVersion??"implementation unknown"} · ${G.runCount} ${G.runCount===1?"run":"runs"}`}function Z2({definitions:G,runs:K,onSelect:Z}){let[$,Y]=y(""),[z,W]=y(""),Q=G.find((U)=>n(U)===$)??G[0];if(!Q)return null;let A=G.filter((U)=>U.pipelineId===Q.pipelineId&&n(U)!==n(Q)),J=A.find((U)=>n(U)===z)??A[0],H=K.filter((U)=>U.pipelineId===Q.pipelineId&&U.definitionIdentity?.definitionId===Q.identity?.definitionId),M=J?.snapshot&&Q.snapshot?G2(J.snapshot,Q.snapshot):void 0;return X("section",{class:"sheet definition-history",children:[X("div",{class:"sheet-head",children:X("div",{children:[X("div",{class:"sheet-title",children:"Observed definitions"},void 0,!1,void 0,this),X("div",{class:"sheet-subtitle",children:"Graph fingerprints do not verify handler code. Implementation versions are supplied by the application."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),X("div",{class:"definition-body",children:[X("label",{class:"field",children:["Definition"," ",X("select",{"aria-label":"Definition",value:n(Q),onChange:(U)=>{Y(U.currentTarget.value),W("")},children:G.map((U)=>X("option",{value:n(U),children:K2(U)},n(U),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q.identity&&X("p",{class:"definition-identity",children:["Structural fingerprint: ",X("code",{children:Q.identity.structuralFingerprint},void 0,!1,void 0,this),X("br",{},void 0,!1,void 0,this),"Definition ID: ",X("code",{children:Q.identity.definitionId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("details",{children:[X("summary",{children:["Runs with this definition (",H.length,")"]},void 0,!0,void 0,this),X("ul",{children:H.map((U)=>X("li",{children:X("button",{type:"button",onClick:()=>Z(U.runId),children:[U.status," · ",new Date(U.startedAtMs).toLocaleString()," · ",U.runId]},void 0,!0,void 0,this)},U.runId,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J?X(g,{children:[X("label",{class:"field",children:["Compare from"," ",X("select",{"aria-label":"Compare from",value:n(J),onChange:(U)=>W(U.currentTarget.value),children:A.map((U)=>X("option",{value:n(U),children:K2(U)},n(U),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("p",{class:"sheet-subtitle",children:"Changes from the comparison definition to the selected definition."},void 0,!1,void 0,this),M?M.length?X("ul",{class:"definition-changes",children:M.map((U,_)=>X("li",{children:[X("strong",{children:[U.stepId?`${U.stepId}: `:"",U.field]},void 0,!0,void 0,this),(U.before!==void 0||U.after!==void 0)&&X("div",{children:[X("code",{children:U.before??"not supplied"},void 0,!1,void 0,this)," →"," ",X("code",{children:U.after??"not supplied"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},_,!0,void 0,this))},void 0,!1,void 0,this):X("p",{children:"No recorded semantic changes."},void 0,!1,void 0,this):X("p",{children:"A complete comparison is unavailable: a legacy recording has no identity, or a definition snapshot exceeded recording limits."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):X("p",{class:"sheet-subtitle",children:"Record another version of this pipeline to compare definitions."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Q6=Symbol("tubeless.wire-schema.type");function v(G,K,Z={}){return{decode:K,jsonSchema:G,optionalInput:Z.optionalInput??!1,optionalOutput:Z.optionalOutput??!1}}function u2(G,K){return G.length===0?K:`${G}.${K}`}function j(){return v({type:"boolean"},(G,K)=>{if(typeof G!=="boolean")throw Error(`${K} must be a boolean`);return G})}function N0(G={}){let K={type:G.integer?"integer":"number"};if(G.minimum!==void 0)K.minimum=G.minimum;return v(K,(Z,$)=>{if(typeof Z!=="number"||!Number.isFinite(Z))throw Error(`${$} must be a finite number`);if(G.integer&&(!Number.isSafeInteger(Z)||Z<(G.minimum??-1/0))){if(G.minimum===0)throw Error(`${$} must be a nonnegative safe integer`);throw Error(`${$} must be a safe integer`)}if(G.minimum!==void 0&&Z<G.minimum)throw Error(`${$} must be at least ${G.minimum}`);return Z})}function c(G={}){let K={type:"string"};if(G.allowEmpty!==!0)K.minLength=1;if(G.maxLength!==void 0)K.maxLength=G.maxLength;return v(K,(Z,$)=>{if(typeof Z!=="string"||G.allowEmpty!==!0&&Z.length===0)throw Error(G.allowEmpty===!0?`${$} must be a string`:`${$} must be a non-empty string`);if(G.maxLength!==void 0&&Z.length>G.maxLength)throw Error(`${$} exceeds ${G.maxLength} code units`);return Z})}function T(G,K){return v({const:G,type:typeof G},(Z,$)=>{if(Z!==G)throw Error(K?.($)??`${$} must be ${String(G)}`);return G})}function V(G,K=(Z)=>`${Z} is unsupported`){let Z=new Set(G);return v({enum:G,type:"string"},($,Y)=>{if(typeof $!=="string"||!Z.has($))throw Error(K(Y));return $})}function N(G){return v(G.jsonSchema,(K,Z)=>K===void 0?void 0:G.decode(K,Z),{optionalInput:!0,optionalOutput:!0})}function Y1(G,K){return v(G.jsonSchema,(Z,$)=>Z===void 0?K:G.decode(Z,$),{optionalInput:!0})}function W0(G,K={}){let Z={items:G.jsonSchema,type:"array"};if(K.maxItems!==void 0)Z.maxItems=K.maxItems;return v(Z,($,Y)=>{if(!Array.isArray($)||K.maxItems!==void 0&&$.length>K.maxItems){let z=K.maxItems===void 0?"":` of at most ${K.maxItems}${K.noun?` ${K.noun}`:""}`;throw Error(`${Y} must be an array${z}`)}return $.map((z,W)=>G.decode(z,`${Y}[${W}]`))})}function P(G){let K=Object.entries(G).filter(([,$])=>!$.optionalOutput).map(([$])=>$),Z=Object.fromEntries(Object.entries(G).map(([$,Y])=>[$,Y.jsonSchema]));return v({additionalProperties:!1,properties:Z,...K.length>0?{required:K}:{},type:"object"},($,Y)=>{if($===null||typeof $!=="object"||Array.isArray($))throw Error(`${Y} must be an object`);let z=$,W={};for(let[Q,A]of Object.entries(G)){let J=A.decode(z[Q],u2(Y,Q));if(J!==void 0)W[Q]=J}return W})}function X2(G,K){return v({additionalProperties:G.jsonSchema,type:"object"},(Z,$)=>{if(Z===null||typeof Z!=="object"||Array.isArray(Z))throw Error(`${$} must be an object`);let Y={};for(let[z,W]of Object.entries(Z))try{Y[z]=G.decode(W,`${$}.${z}`)}catch{throw Error(K?.($)??`${$} contains an unsupported value`)}return Y})}function b0(G,K){return v({oneOf:G.map((Z)=>Z.jsonSchema)},(Z,$)=>{for(let Y of G)try{return Y.decode(Z,$)}catch{}throw Error(K?.($)??`${$} is unsupported`)})}function a(G,K,Z=G.jsonSchema){return v(Z,($,Y)=>{let z=G.decode($,Y);return K(z,Y),z},{optionalInput:G.optionalInput,optionalOutput:G.optionalOutput})}function $2(G,K){return v(G.jsonSchema,(Z,$)=>K(G.decode(Z,$)),{optionalInput:G.optionalInput,optionalOutput:G.optionalOutput})}function Q0(G,K){return v(G,K)}function U1(G,K){return v({oneOf:Object.entries(K).map(([Z,$])=>({allOf:[$.jsonSchema,{properties:{[G]:{const:Z,type:"string"}},required:[G],type:"object"}]}))},(Z,$)=>{if(Z===null||typeof Z!=="object"||Array.isArray(Z))throw Error(`${$} must be an object`);let Y=Z[G];if(typeof Y!=="string"||!(Y in K))throw Error(`${G} is unsupported`);return K[Y].decode(Z,$)})}var B0=16384,W2=new TextEncoder;function r2(G,K){let Z=0,$=0,Y=(Q)=>{if(Q.length>B0)throw Error(`${K} exceeds ${B0} bytes`);if($+=W2.encode(JSON.stringify(Q)).byteLength,$>B0)throw Error(`${K} exceeds ${B0} bytes`)},z=(Q,A)=>{if(++Z>256||A>8)throw Error(`${K} exceeds metadata complexity limits`);if(Q===null||typeof Q==="boolean")return Q;if(typeof Q==="number"&&Number.isFinite(Q))return Q;if(typeof Q==="string")return Y(Q),Q;if(typeof Q!=="object"||Q===null)throw Error(`${K} must be JSON-safe`);let J=Array.isArray(Q),H=Object.getPrototypeOf(Q);if(!J&&H!==Object.prototype&&H!==null)throw Error(`${K} must contain only plain JSON objects`);let M=Reflect.ownKeys(Q);if(M.length>256)throw Error(`${K} exceeds metadata complexity limits`);let U=[];for(let _ of M){if(J&&_==="length")continue;if(typeof _!=="string")throw Error(`${K} must be JSON-safe`);let q=Object.getOwnPropertyDescriptor(Q,_);if(!("value"in q)||!q.enumerable)throw Error(`${K} must contain only enumerable data properties`);Y(_),U.push([_,z(q.value,A+1)])}if(J){if(U.length!==Q.length||U.some(([_],q)=>_!==String(q)))throw Error(`${K} must contain only dense JSON arrays`);return U.map(([,_])=>_)}return Object.fromEntries(U)},W=z(G,0);if(W2.encode(JSON.stringify(W)).byteLength>B0)throw Error(`${K} exceeds ${B0} bytes`);return W}var M0=c({maxLength:4096}),Q2=P({id:N(M0),uri:N(M0),mediaType:N(M0),checksum:N(M0),version:N(M0),byteSize:N(N0({integer:!0,minimum:0})),schemaVersion:N(M0),metadata:N(Q0({type:"object",additionalProperties:!0},(G,K)=>{if(!G||typeof G!=="object"||Array.isArray(G))throw Error(`${K} must be an object`);return G}))}),J1=Q0({...Q2.jsonSchema,anyOf:[{required:["id"]},{required:["uri"]}]},(G,K)=>{let Z=r2(G,K),$=Q2.decode(Z,K);if(!$.id&&!$.uri)throw Error(`${K} requires id or uri`);let Y=["id","uri","mediaType","checksum","version","byteSize","schemaVersion","metadata"];if(Object.keys(Z).some((z)=>!Y.includes(z)))throw Error(`${K} has unknown fields; use metadata for application fields`);return $.id?{...$,id:$.id}:{...$,uri:$.uri}}),H1=V(["read","write","reuse"]),z2=P({operation:H1,artifact:J1});var Y2=3,K0=128,z0=4096,A1=262144;var s2=["TUBELESS_CHILD_FAILED","TUBELESS_DEFINITION_DEPENDENCY_CONTRADICTORY","TUBELESS_DEFINITION_DEPENDENCY_CYCLE","TUBELESS_DEFINITION_DEPENDENCY_DUPLICATE","TUBELESS_DEFINITION_DEPENDENCY_NOT_IN_STEPS","TUBELESS_DEFINITION_DEPENDENCY_SELF_REFERENCE","TUBELESS_DEFINITION_FINALIZER_STEP_NOT_IN_STEPS","TUBELESS_DEFINITION_IMPLEMENTATION_VERSION_INVALID","TUBELESS_DEFINITION_OPTIONS_SCHEMA_CONFLICT","TUBELESS_DEFINITION_PIPELINE_DESCRIPTION_BLANK","TUBELESS_DEFINITION_PIPELINE_ID_BLANK","TUBELESS_DEFINITION_PIPELINE_NAME_BLANK","TUBELESS_DEFINITION_STEP_ID_BLANK","TUBELESS_DEFINITION_STEP_ID_RESERVED","TUBELESS_DEFINITION_STEP_IDS_DUPLICATE","TUBELESS_DEFINITION_STEP_NAME_BLANK","TUBELESS_DEFINITION_TARGET_FINALIZER_MISMATCH","TUBELESS_DEFINITION_TARGET_NOT_IN_STEPS","TUBELESS_DEFINITION_TARGETS_DUPLICATE","TUBELESS_FINALIZATION_CANCELLED","TUBELESS_FINALIZATION_FAILED","TUBELESS_FINAL_RESULT_VALIDATION_FAILED","TUBELESS_OPTIONS_VALIDATION_FAILED","TUBELESS_PLANNING_SELECTION_CONFLICT","TUBELESS_PLANNING_STEP_SELECTION_DUPLICATE","TUBELESS_PLANNING_STEP_SELECTION_EMPTY","TUBELESS_PLANNING_STEP_UNKNOWN","TUBELESS_PLANNING_TARGET_SELECTION_DUPLICATE","TUBELESS_PLANNING_TARGET_SELECTION_EMPTY","TUBELESS_PLANNING_TARGET_UNDECLARED","TUBELESS_PLANNING_TARGET_UNKNOWN","TUBELESS_RUN_CANCELLED","TUBELESS_RUN_CONCURRENCY_INVALID","TUBELESS_STEP_OUTPUT_VALIDATION_FAILED","TUBELESS_STEP_FAILED"],a2=["cancellation","child","definition","finalization","selection","step","validation"],t2=["definition","execution","finalization","planning"],n2=["cancelled","completed","failed"],e2=["dry-run","failed-dependency","fail-fast","filtered","policy","unmet-dependency"],G4=["cancelled","completed","failed","pending","running","skipped"],E=c({allowEmpty:!0}),p=c(),L1=c({allowEmpty:!0,maxLength:z0}),J0=N0({integer:!0,minimum:0}),o=N0(),m0=W0(p),K4=W0(p,{maxItems:K0,noun:"strings"});function M1(G,K,Z,$){if(G===null||typeof G!=="object"||Array.isArray(G))throw Error(`${K} must be an object`);if(!$&&Z>=16||$&&Z>8)throw Error($?"error.fanOut cause exceeds its depth limit":"error.cause exceeds 16 levels");let Y=G,z=(J)=>{let H=Y[J];if(H===void 0)return;if(typeof H!=="string")throw Error(`${K}.${J} must be a string`);return H},W={message:z("message")??""},Q=z("name"),A=z("sourceCode");if(Q!==void 0)W.name=Q;if(A!==void 0)W.sourceCode=A;if($&&[W.message,W.name,W.sourceCode].some((J)=>J!==void 0&&J.length>1024))throw Error("error.fanOut cause strings exceed 1024 code units");if(Y.cause!==void 0)W.cause=M1(Y.cause,K,Z+1,$);return W}var J2={additionalProperties:!1,properties:{cause:{$ref:"#/components/schemas/PipelineErrorCause"},message:{type:"string"},name:{type:"string"},sourceCode:{type:"string"}},required:["message"],type:"object"},Z4=Q0(J2,(G,K)=>M1(G,K,0,!1)),H2=Q0({$ref:"#/components/schemas/PipelineErrorCause"},(G,K)=>M1(G,K,0,!0)),X4=Q0({items:{oneOf:[{type:"number"},{type:"string",maxLength:z0}]},maxItems:K0,type:"array"},(G,K)=>{if(!Array.isArray(G)||G.length>K0||!G.every((Z)=>typeof Z==="string"||typeof Z==="number"&&Number.isFinite(Z)))throw Error(`${K} must contain strings or finite numbers`);if(G.some((Z)=>typeof Z==="string"&&Z.length>z0))throw Error(`${K} string exceeds ${z0} code units`);return G}),N1=P({message:c({maxLength:z0}),path:N(X4)}),$4=Q0({items:N1.jsonSchema,maxItems:K0,type:"array"},(G,K)=>{if(!Array.isArray(G))throw Error(`${K} must be an array`);if(G.length>K0)throw Error(`${K} must contain at most ${K0} entries`);return G.map((Z,$)=>N1.decode(Z,`${K}[${$}]`))}),A2=P({cancelled:j(),error:H2,index:J0,key:c({allowEmpty:!0,maxLength:1024}),keyTruncated:j()}),q2=a(P({failureCount:J0,failures:W0(A2,{maxItems:32,noun:"entries"}),omittedFailureCount:J0,schedulerError:N(H2)}),(G)=>{if(G.failureCount-G.failures.length!==G.omittedFailureCount)throw Error("error.fanOut counts do not match failures");let K=-1;for(let Z of G.failures){if(Z.index<=K)throw Error("error.fanOut indices must be in input order");K=Z.index}}),p0=P({cause:N(a(Z4,()=>{return},{$ref:"#/components/schemas/PipelineErrorCause"})),code:V(s2),fanOut:N(a(q2,()=>{return},{$ref:"#/components/schemas/PipelineFanOutDiagnostics"})),issues:N($4),kind:V(a2),message:Y1(E,""),phase:V(t2),sourceCode:N(E),stack:N(E)}),c0=a(p0,()=>{return},{$ref:"#/components/schemas/PipelineError"}),_2=P({outputSource:N(T("override")),completed:N(o),depth:N(o),id:c({maxLength:z0}),label:N(L1),name:N(L1),status:N(V(G4)),total:N(o)}),W4=a(W0(_2,{maxItems:K0,noun:"details"}),(G,K)=>{if(new TextEncoder().encode(JSON.stringify(G)).byteLength>A1)throw Error(`${K} exceeds the ${A1}-byte limit`)}),Q4=$2(a(P({completed:o,detailCount:N(J0),details:N(W4),message:N(E),total:N(o)}),(G)=>{if(G.details!==void 0&&G.detailCount!==void 0&&G.detailCount<G.details.length)throw Error("payload.progress.detailCount must be at least the retained details length")}),(G)=>G.details!==void 0&&G.detailCount===void 0?{...G,detailCount:G.details.length}:G),F1=N0({integer:!0,minimum:1}),L2=["for-each","single","iterate"],z4=a(P({mode:V(L2),maxIterations:N(F1),pipelineId:p,stepCount:J0,stepIds:K4}),(G,K)=>{if(G.mode==="iterate"!==(G.maxIterations!==void 0))throw Error(`${K}: only iterate requires maxIterations`);if(G.stepCount<G.stepIds.length)throw Error(`${K}.stepCount must be at least the retained stepIds length`)}),N2=P({engine:c({maxLength:z0}),target:N(L1)}),T0=a(P({version:b0([T(1),T(2)]),definitionId:c({maxLength:80}),structuralFingerprint:c({maxLength:80}),implementationVersion:N(c({maxLength:256}))}),(G,K)=>{if(![G.definitionId,G.structuralFingerprint].every((Z)=>/^sha256:[a-f0-9]{64}$/.test(Z)))throw Error(`${K} must contain SHA-256 fingerprints`);if(G.implementationVersion!==void 0&&G.implementationVersion.trim().length===0)throw Error(`${K}.implementationVersion must not be blank`)}),B1=c({maxLength:4096}),U0=W0(B1,{maxItems:4096}),Y4=P({dryRun:N(j()),continueOnError:N(j()),maxConcurrency:N(o),targets:N(U0),stepIds:N(U0)}),U4=P({id:B1,dependencies:U0,optionalDependencies:U0,skipAfterFailureOf:U0,dryRun:V(["custom","run","skip"]),runtimeSkipPossible:j(),outputValidated:j(),nestedPipeline:N(P({pipelineId:B1,mode:V(L2),maxIterations:N(F1),controls:N(Y4),identity:N(T0),stepIds:U0,concurrency:N(b0([o,T("dynamic")]))})),remote:N(N2)}),O1=a(P({identity:T0,steps:W0(U4,{maxItems:4096}),targetIds:U0,requiredFinalizerStepIds:N(U0),optionsValidated:j(),resultValidated:j()}),(G,K)=>{for(let Z of G.steps){let $=Z.nestedPipeline;if(!$)continue;if($.mode==="iterate"!==($.maxIterations!==void 0)||$.controls!==void 0&&$.mode!=="iterate")throw Error(`${K}: invalid iteration metadata`);if(G.identity.version===1&&($.mode==="iterate"||$.identity?.version===2))throw Error(`${K}: iteration requires identity version 2`)}if(new TextEncoder().encode(JSON.stringify(G)).byteLength>262144)throw Error(`${K} exceeds the 262144-byte definition limit`)}),d0=P({kind:V(["all","exact","not-selected","outside-target-closure"])}),J4=P({kind:T("target"),targetId:p}),q1=P({dependentId:p,kind:V(["failure-gate","optional-only","required-dependency"]),targetId:p}),H4=U1("kind",{all:d0,exact:d0,"failure-gate":q1,"not-selected":d0,"optional-only":q1,"outside-target-closure":d0,"required-dependency":q1,target:J4}),A4=W0(H4,{maxItems:K0,noun:"reasons"}),q4=X2(b0([j(),o,E]),(G)=>`${G} values must be booleans, finite numbers, or strings`),d={correlationId:N(E),itemKey:N(E),parentRunId:N(E),pipelineId:p,runId:p,timestampMs:o,version:b0([T(2),T(Y2)]),iteration:N(P({runId:p,stepId:p,attemptId:p,index:F1}))},w0={attemptId:N(E),durationMs:N(o)},Y0={stepId:p},_1=P({}),B2={"step.artifact":P({...d,...Y0,attemptId:p,name:T("step.artifact"),payload:P({operation:H1,preview:j(),artifact:J1})}),"pipeline.completed":P({...d,durationMs:N(o),error:N(c0),name:T("pipeline.completed"),payload:P({dryRun:j(),errorCount:J0,finalized:j(),status:V(n2,(G)=>`${G} must be cancelled, completed, or failed`),stepCount:J0})}),"pipeline.finalize.completed":P({...d,durationMs:o,name:T("pipeline.finalize.completed"),payload:_1}),"pipeline.finalize.failed":P({...d,durationMs:o,error:c0,name:T("pipeline.finalize.failed"),payload:_1}),"pipeline.finalize.started":P({...d,name:T("pipeline.finalize.started"),payload:_1}),"pipeline.log":P({...d,attemptId:N(E),name:T("pipeline.log"),payload:P({level:V(["error","log","warn"],(G)=>`${G} must be error, log, or warn`),message:Y1(E,"")}),stepId:N(E)}),"pipeline.started":P({...d,name:T("pipeline.started"),payload:a(P({definitionIdentity:N(T0),definitionSnapshot:N(O1),dryRun:j(),planOk:j(),stepCount:J0,targetIds:m0}),(G)=>{if(G.definitionSnapshot&&JSON.stringify(G.definitionSnapshot.identity)!==JSON.stringify(G.definitionIdentity))throw Error("Definition snapshot must match the run definition identity")})}),"step.attempted":P({...d,...w0,...Y0,name:T("step.attempted"),payload:P({attempt:o,attributes:q4})}),"step.cancelled":P({...d,...w0,...Y0,error:c0,name:T("step.cancelled"),payload:P({status:T("cancelled"),outputSource:N(T("override"))})}),"step.complete":P({...d,...w0,...Y0,name:T("step.complete"),payload:P({status:T("completed"),outputSource:N(T("override"))})}),"step.failed":P({...d,...w0,...Y0,error:c0,name:T("step.failed"),payload:P({status:T("failed"),outputSource:N(T("override"))})}),"step.planned":P({...d,...Y0,name:T("step.planned"),payload:P({dependencies:m0,description:N(E),dryRun:V(["custom","run","skip"],(G)=>`${G} must be custom, run, or skip`),name:N(E),nestedPipeline:N(z4),optionalDependencies:m0,remote:N(N2),runtimeSkipPossible:j(),selected:j(),selectionReasons:A4,skipAfterFailureOf:m0})}),"step.running":P({...d,...Y0,attemptId:p,name:T("step.running"),payload:P({progress:N(Q4),outputSource:N(T("override"))})}),"step.skipped":P({...d,...w0,...Y0,name:T("step.skipped"),payload:P({dependencyId:N(E),message:N(E),reason:V(e2),status:T("skipped"),outputSource:N(T("override"))})})},M2={if:{properties:{version:{const:2}},required:["version"]},then:{properties:{iteration:!1,payload:{properties:{definitionIdentity:{properties:{version:{const:1}}},nestedPipeline:{properties:{mode:{enum:["single","for-each"]},maxIterations:!1}}}}}}},U2=U1("name",B2),_4=a(U2,(G)=>{if(G.iteration!==void 0&&G.iteration.runId!==G.parentRunId)throw Error("iteration.runId must match parentRunId");if(G.version!==2)return;if(G.iteration!==void 0||G.name==="step.planned"&&G.payload.nestedPipeline?.mode==="iterate")throw Error("Iteration metadata requires trace version 3");if(G.name==="pipeline.started"&&G.payload.definitionIdentity?.version===2)throw Error("Trace version 2 requires identity version 1")},{...U2.jsonSchema,...M2}),_6={PipelineError:p0.jsonSchema,PipelineErrorCause:J2,PipelineFanOutDiagnostics:q2.jsonSchema,PipelineFanOutFailure:A2.jsonSchema,PipelineProgressDetail:_2.jsonSchema,PipelineValidationIssue:N1.jsonSchema,StoredPipelineEvent:{oneOf:Object.values(B2).map((G)=>{let K=G.jsonSchema;return{...K,...M2,properties:{...K.properties,id:{minimum:0,type:"integer"}},required:[...K.required,"id"]}})}};function F2(G){return p0.decode(G,"error")}function P1(G){try{return T0.decode(G,"identity"),!0}catch{return!1}}function O2(G){try{return O1.decode(G,"snapshot"),!0}catch{return!1}}function P2(G){try{return F2(G),!0}catch{return!1}}function k2(G){try{return z2.decode(G,"artifact record"),!0}catch{return!1}}function b2(G){if(typeof G!=="object"||G===null)return!1;let K=G;if(typeof K.key!=="string"||K.key.length===0||typeof K.flag!=="string"||K.flag.length===0||typeof K.multiple!=="boolean"||typeof K.positional!=="boolean"||typeof K.required!=="boolean"||!["boolean","number","path","string"].includes(String(K.type)))return!1;if(K.choices!==void 0&&(!Array.isArray(K.choices)||!K.choices.every((Z)=>typeof Z==="string")))return!1;if(K.default!==void 0&&typeof K.default!==(K.type==="boolean"?"boolean":K.type==="number"?"number":"string"))return!1;if(K.group!==void 0&&K.group!=="execution")return!1;if(K.exclusive!==void 0&&K.exclusive!==!0)return!1;return!0}function S(G){return typeof G==="object"&&G!==null&&!Array.isArray(G)}function D(G){return typeof G==="number"&&Number.isFinite(G)}function i(G){return G===void 0||typeof G==="string"}function Z0(G){return G===void 0||D(G)}function o0(G){return Array.isArray(G)&&G.every((K)=>typeof K==="string")}function L4(G){if(!S(G))return!1;return D(G.id)&&(G.level==="error"||G.level==="log"||G.level==="warn")&&typeof G.message==="string"&&D(G.timestampMs)&&i(G.attemptId)&&i(G.stepId)}function N4(G){if(!S(G))return!1;if(typeof G.id!=="string"||G.outputSource!==void 0&&G.outputSource!=="override"||!["cancelled","completed","failed","planned","running","skipped"].includes(String(G.status))||!i(G.description)||!i(G.name)||!Z0(G.durationMs)||!Z0(G.finishedAtMs)||!Z0(G.startedAtMs))return!1;if(G.attempt!==void 0){if(!S(G.attempt)||typeof G.attempt.attemptId!=="string"||!Z0(G.attempt.durationMs)||!Z0(G.attempt.finishedAtMs)||!Array.isArray(G.attempt.retries)||!G.attempt.retries.every(D)||!D(G.attempt.startedAtMs)||G.attempt.outputSource!==void 0&&G.attempt.outputSource!=="override"||!["cancelled","completed","failed","running","skipped"].includes(String(G.attempt.status)))return!1}if(G.artifacts!==void 0&&(!Array.isArray(G.artifacts)||!G.artifacts.every((K)=>S(K)&&typeof K.attemptId==="string"&&D(K.timestampMs)&&typeof K.preview==="boolean"&&k2(K))))return!1;if(G.progress!==void 0){if(!S(G.progress)||!D(G.progress.completed))return!1;if(!Z0(G.progress.detailCount)||!i(G.progress.message)||!Z0(G.progress.total))return!1;if(G.progress.details!==void 0&&(!Array.isArray(G.progress.details)||!G.progress.details.every((K)=>S(K)&&typeof K.id==="string"&&i(K.label)&&i(K.status)&&(K.outputSource===void 0||K.outputSource==="override"))))return!1}if(G.nestedPipeline!==void 0){if(!S(G.nestedPipeline)||!["single","for-each","iterate"].includes(String(G.nestedPipeline.mode))||G.nestedPipeline.mode==="iterate"&&(!Number.isSafeInteger(G.nestedPipeline.maxIterations)||Number(G.nestedPipeline.maxIterations)<1)||typeof G.nestedPipeline.pipelineId!=="string"||!D(G.nestedPipeline.stepCount)||!o0(G.nestedPipeline.stepIds))return!1}if(G.remote!==void 0){if(!S(G.remote)||typeof G.remote.engine!=="string"||!i(G.remote.target))return!1}return!0}function w2(G){if(!S(G))return!1;return(G.definitionIdentity===void 0||P1(G.definitionIdentity))&&typeof G.dryRun==="boolean"&&D(G.eventCount)&&D(G.logCount)&&Array.isArray(G.logs)&&G.logs.every(L4)&&typeof G.pipelineId==="string"&&typeof G.runId==="string"&&D(G.startedAtMs)&&Z0(G.durationMs)&&Z0(G.finishedAtMs)&&["cancelled","completed","failed","running"].includes(String(G.status))&&Array.isArray(G.steps)&&G.steps.every(N4)&&D(G.version)&&i(G.correlationId)&&i(G.parentRunId)&&(G.iteration===void 0||S(G.iteration)&&typeof G.iteration.runId==="string"&&typeof G.iteration.stepId==="string"&&typeof G.iteration.attemptId==="string"&&Number.isSafeInteger(G.iteration.index)&&Number(G.iteration.index)>0)&&(G.error===void 0||P2(G.error))}function B4(G){if(!S(G))return!1;if(!D(G.activeRunCount)||!D(G.completedRunCount)||!Array.isArray(G.definitions)||!G.definitions.every((K)=>S(K)&&typeof K.pipelineId==="string"&&D(K.runCount)&&(K.identity===void 0||P1(K.identity))&&(K.snapshot===void 0||O2(K.snapshot)))||!D(G.failedRunCount)||!D(G.generatedAtMs)||!D(G.lastEventId)||!Array.isArray(G.runs)||!G.runs.every(w2)||G.liveRunIds!==void 0&&!o0(G.liveRunIds))return!1;return!0}function M4(G){return B4(G)?G:void 0}function F4(G){return S(G)&&typeof G.canPlan==="boolean"&&typeof G.id==="string"&&typeof G.name==="string"&&i(G.description)&&Array.isArray(G.parameters)&&G.parameters.every(b2)}function O4(G){if(!S(G)||!Array.isArray(G.commands)||!G.commands.every(F4))return;return G.commands}function P4(G){if(!S(G)||!S(G.plan))return!1;let K=G.plan;if(typeof K.dryRun!=="boolean"||!Array.isArray(K.errors)||!K.errors.every((Z)=>S(Z)&&typeof Z.message==="string")||typeof K.ok!=="boolean"||typeof K.pipelineId!=="string"||!Array.isArray(K.steps))return!1;for(let Z of K.steps){if(!S(Z)||typeof Z.id!=="string"||!o0(Z.dependencies)||typeof Z.selected!=="boolean"||!i(Z.description)||!i(Z.name))return!1;if(Z.nestedPipeline!==void 0&&(!S(Z.nestedPipeline)||!["single","for-each","iterate"].includes(String(Z.nestedPipeline.mode))||Z.nestedPipeline.mode==="iterate"&&(!Number.isSafeInteger(Z.nestedPipeline.maxIterations)||Number(Z.nestedPipeline.maxIterations)<1)||typeof Z.nestedPipeline.pipelineId!=="string"||!o0(Z.nestedPipeline.stepIds)))return!1;if(Z.remote!==void 0&&(!S(Z.remote)||typeof Z.remote.engine!=="string"||!i(Z.remote.target)))return!1}return!0}function k4(G){return P4(G)?G.plan:void 0}function H0(G,K){if(!S(G))return Error(K);if(Array.isArray(G.errors)&&G.errors.every((Z)=>typeof Z==="string"))return Error(G.errors.join(`
|
|
2
|
-
`));return Error(typeof G.message==="string"?G.message:K)}async function A0(G){try{return await G.json()}catch{throw Error("Studio API returned invalid JSON.")}}function q0(G){return Error(`Studio API returned an invalid response for ${G}.`)}function T2(G=fetch){return{async loadSnapshot(){let K=await G("/api/snapshot",{cache:"no-store"}),Z=await A0(K);if(!K.ok)throw H0(Z,"Snapshot request failed.");let $=M4(Z);if(!$)throw q0("snapshot");return $},async loadRunDetail(K){let Z=await G("/api/runs/"+encodeURIComponent(K),{cache:"no-store"}),$=await A0(Z);if(Z.status===404)return null;if(!Z.ok)throw H0($,"Run detail request failed.");if(!S($)||!w2($.run))throw q0("run detail");return{run:$.run}},async loadCommands(){let K=await G("/api/commands",{cache:"no-store"}),Z=await A0(K);if(!K.ok)throw H0(Z,"Commands request failed.");let $=O4(Z);if(!$)throw q0("commands");return $},async loadCapabilities(){let K=await G("/api/capabilities",{cache:"no-store"}),Z=await A0(K);if(!K.ok||!S(Z)||typeof Z.canCancel!=="boolean"||typeof Z.canClearHistory!=="boolean"){if(!K.ok)throw H0(Z,"Capabilities request failed.");throw q0("capabilities")}return{canCancel:Z.canCancel,canClearHistory:Z.canClearHistory}},async clearHistory(){let K=await G("/api/history",{method:"DELETE",headers:{"x-tubeless-studio-clear-history":"1"}}),Z=await A0(K);if(!K.ok)throw H0(Z,"History could not be cleared.");if(!S(Z)||Z.cleared!==!0||!D(Z.eventCount))throw q0("clear history");return{eventCount:Z.eventCount}},async previewPlan(K,Z){let $=await G("/api/commands/"+encodeURIComponent(K)+"/plan",{method:"POST",headers:{"content-type":"application/json","x-tubeless-studio-plan":"1"},body:JSON.stringify(Z)}),Y=await A0($);if(!$.ok)throw H0(Y,"Plan request failed.");let z=k4(Y);if(!z)throw q0("plan");return z},async cancelRun(K){let Z=await G("/api/runs/"+encodeURIComponent(K)+"/cancel",{method:"POST",headers:{"x-tubeless-studio-cancel":"1"}}),$=await A0(Z);if(!Z.ok)throw H0($,"Run could not be cancelled.");if(!S($)||$.cancelled!==!0||$.runId!==K)throw q0("cancel run")},async launch(K,Z){let $=await G("/api/commands/"+encodeURIComponent(K)+"/runs",{method:"POST",headers:{"content-type":"application/json","x-tubeless-studio-launch":"1"},body:JSON.stringify({values:Z})}),Y=await A0($);if(!$.ok)throw H0(Y,"Launch failed.");if(!S(Y)||Y.accepted!==!0||typeof Y.runId!=="string"||Y.runId.length===0)throw q0("launch");return Y.runId}}}function b4(G){return{...G,activeRunCount:0,completedRunCount:0,definitions:[],failedRunCount:0,lastEventId:0,liveRunIds:[],runs:[]}}class k1{#H;#L;#J=new Set;#$=null;#G;#Z={fingerprint:null,runId:null};#W=0;#K=!1;#Q;#A=!1;#Y=0;#q=!1;#_=!1;#X={connected:!0,detail:null,manualRefreshing:!1,snapshot:null};constructor(G,K=1200){this.#H=G,this.#L=K}getState(){return this.#X}subscribe(G){return this.#J.add(G),()=>this.#J.delete(G)}refresh(G=!1){if(this.#K)return;if(G)this.#A=!0,this.#z({manualRefreshing:!0});if(this.#q){if(G)this.#_=!0;return}this.#N()}invalidate({delayMs:G=0,resetHistory:K=!1}={}){if(this.#K)return;if(this.#Y+=1,K)this.#F(),this.#z({detail:null,snapshot:this.#X.snapshot?b4(this.#X.snapshot):null});else this.#O(G);if(this.#Q)clearTimeout(this.#Q);if(this.#Q=void 0,G>0){this.#Q=setTimeout(()=>{this.#Q=void 0,this.refresh(!0)},G);return}this.refresh(!0)}selectRun(G,K){if(this.#K)return;if(this.#Z.runId===G&&this.#Z.fingerprint===K)return;if(this.#Z.runId!==G||!K)this.#F(),this.#z({detail:null});if(this.#Z={fingerprint:K,runId:G},G&&K)this.#U(this.#W)}dispose(){if(this.#K)return;if(this.#K=!0,this.#Y+=1,this.#W+=1,this.#$=null,this.#G)clearTimeout(this.#G);if(this.#Q)clearTimeout(this.#Q);this.#G=void 0,this.#Q=void 0,this.#J.clear()}#N(){if(this.#K)return;this.#q=!0;let G=this.#Y;this.#A=!1,this.#H.loadSnapshot().then((K)=>{if(this.#K||G!==this.#Y)return;this.#z({connected:!0,snapshot:K})}).catch(()=>{if(this.#K||G!==this.#Y)return;this.#z({connected:!1})}).finally(()=>{if(this.#K)return;if(this.#q=!1,this.#_){this.#_=!1,this.#N();return}if(!this.#A)this.#z({manualRefreshing:!1})})}#U(G){let{fingerprint:K,runId:Z}=this.#Z;if(this.#K||this.#$!==null||this.#G!==void 0||!Z||!K||G!==this.#W)return;let $={};this.#$=$,this.#H.loadRunDetail(Z).then((Y)=>{if(!this.#B($,G))return;if(this.#$=null,Y){if(this.#z({detail:Y}),K!==this.#Z.fingerprint)this.#U(G);return}this.#M(G)}).catch(()=>{if(!this.#B($,G))return;this.#$=null,this.#M(G)})}#B(G,K){return!this.#K&&this.#$===G&&this.#W===K}#M(G){if(this.#K||G!==this.#W)return;if(this.#G)clearTimeout(this.#G);this.#G=setTimeout(()=>{this.#G=void 0,this.#U(G)},this.#L)}#O(G){if(this.#W+=1,this.#$=null,this.#G)clearTimeout(this.#G);this.#G=void 0,this.#z({detail:null});let K=this.#W;if(!this.#Z.runId||!this.#Z.fingerprint)return;if(G>0){this.#G=setTimeout(()=>{this.#G=void 0,this.#U(K)},G);return}this.#U(K)}#F(){if(this.#W+=1,this.#$=null,this.#Z={fingerprint:null,runId:null},this.#G)clearTimeout(this.#G);this.#G=void 0}#z(G){let K={...this.#X,...G};if(K.connected===this.#X.connected&&K.detail===this.#X.detail&&K.manualRefreshing===this.#X.manualRefreshing&&K.snapshot===this.#X.snapshot)return;this.#X=K;for(let Z of this.#J)Z(K)}}var b1=[];function w4(G){let K=new Map,Z=new Map,$=new Map;for(let q of G){if(!K.has(q.runId))K.set(q.runId,q);let O=q.parentRunId;if(!$.has(q.runId))$.set(q.runId,O)}let Y=new Set;for(let q of G){if(Y.has(q.runId))continue;let O=[],F=new Set,L=q.runId;while(L&&K.has(L)&&!Y.has(L)){if(F.has(L)){$.set(L,void 0);break}F.add(L),O.push(L),L=$.get(L)}for(let B of O)Y.add(B)}for(let q of G){let O=$.get(q.runId);if(!O)continue;let F=Z.get(O);if(F)F.push(q);else Z.set(O,[q])}for(let q of Z.values())q.sort((O,F)=>F.startedAtMs-O.startedAtMs);let z=[],W=new Set;for(let q of G){let O=$.get(q.runId);if(O&&K.has(O))continue;z.push(q),W.add(q.runId)}let Q=new Map;for(let q of G){if(Q.has(q.runId))continue;let O=[],F=new Set,L=q.runId,B;while(L){if(Q.has(L)){B=Q.get(L);break}if(W.has(L)){B=L;break}if(F.has(L)){B=void 0;break}F.add(L),O.push(L);let b=$.get(L);if(!b||!K.has(b)){B=L;break}L=b}if(B!==void 0)Q.set(B,B);for(let b of O)Q.set(b,B)}let A=new Map,J=new Map;for(let q of G){if(A.has(q.runId))continue;let O=[{exiting:!1,id:q.runId}],F=new Set;while(O.length>0){let L=O.pop();if(!L)break;if(L.exiting){F.delete(L.id);let B=0,b=K.get(L.id)?.status==="running";for(let x of Z.get(L.id)??b1){let h=A.get(x.runId);if(h===void 0)continue;B+=1+h,b=b||J.get(x.runId)===!0}A.set(L.id,B),J.set(L.id,b);continue}if(A.has(L.id)||F.has(L.id))continue;F.add(L.id),O.push({exiting:!0,id:L.id});for(let B of Z.get(L.id)??b1)if(!A.has(B.runId)&&!F.has(B.runId))O.push({exiting:!1,id:B.runId})}}function H(q){return q==null?void 0:K.get(q)}function M(q){return Z.get(q)??b1}function U(q){let O=[],F=new Set,L=H(q);while(L){let B=$.get(L.runId);if(!B||F.has(B))break;F.add(B);let b=K.get(B);if(!b)break;O.unshift(b),L=b}return O}function _(q){let O=q.toLowerCase(),F=new Set;if(!O){for(let L of z)F.add(L.runId);return F}for(let L of G){if(!L.pipelineId.toLowerCase().includes(O)&&!L.runId.toLowerCase().includes(O)&&!L.correlationId?.toLowerCase().includes(O))continue;let B=Q.get(L.runId);if(B)F.add(B)}return F}return{roots:z,ancestorsOf:U,childrenOf:M,descendantCount(q){return A.get(q)??0},matchingRootIds:_,rootRunId(q){return q==null?q:Q.get(q)??q},runById:H,subtreeIsRunning(q){return J.get(q)===!0}}}function T4(G){return G.parameters.map((K)=>{if(K.type==="boolean")return[Boolean(K.default)];if(K.multiple)return K.choices?[]:[""];return K.default===void 0?[""]:[K.default]})}function C4(G,K){let Z={};return G.parameters.forEach(($,Y)=>{let z=K($,Y);if($.type==="boolean"){let Q=z[0];if(Q!==Boolean($.default))Z[$.key]=Q;return}if($.multiple){Z[$.key]=$.type==="number"?z.filter((Q)=>typeof Q==="number"):z.filter((Q)=>typeof Q==="string");return}let W=z[0];if(W!==""&&W!==void 0)Z[$.key]=W}),Z}function R4(G,K){let Z={};return G.parameters.forEach(($,Y)=>{if($.group!=="execution")return;let z=K($,Y);if($.type==="boolean"){if(z[0]===!0)Z[$.key]=!0;return}if($.multiple&&z.length)Z[$.key]=z.filter((W)=>typeof W==="string")}),Z}var i0=(G)=>G.length>24?G.slice(0,12)+"…"+G.slice(-7):G;function l0(G){return G==null?"—":G<1000?Math.max(0,Math.round(G))+" ms":G<60000?(G/1000).toFixed(G<1e4?1:0)+" s":Math.floor(G/60000)+"m "+Math.round(G%60000/1000)+"s"}function S4(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(G)}function C2(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(G)}function R2(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Date(G).toISOString()}function S2(G,K){let Z=Math.max(0,K-G);if(Z<60000)return Math.floor(Z/1000)+"s ago";if(Z<3600000)return Math.floor(Z/60000)+"m ago";if(Z<86400000)return Math.floor(Z/3600000)+"h ago";return Math.floor(Z/86400000)+"d ago"}function g4(G){return G==="completed"?"✓":G==="skipped"?"×":G==="cancelled"?"■":G==="failed"?"!":G==="planned"?"…":""}function u0({value:G,outputSource:K}){return X("span",{class:`status ${G}`,children:[X("i",{class:"status-mark","aria-hidden":"true",children:g4(G)},void 0,!1,void 0,this),G,K==="override"&&" (overridden)"]},void 0,!0,void 0,this)}function r0({copy:G,title:K}){return X("div",{class:"empty",children:X("div",{children:[X("div",{class:"empty-icon",children:X("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:X("path",{d:"M4 5.5h12M4 10h12M4 14.5h8"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),X("strong",{children:K},void 0,!1,void 0,this),X("p",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function s0({children:G,label:K,secondary:Z,stepIds:$}){return X("div",{class:"plan-nested",children:[X("strong",{children:K},void 0,!1,void 0,this),Z&&X("span",{children:Z},void 0,!1,void 0,this),$?.map((Y)=>X("code",{children:Y},Y,!1,void 0,this)),G]},void 0,!0,void 0,this)}function w1(G){return G.description||"Run this typed pipeline command."}function y4(G){return G.key.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\b\w/g,(K)=>K.toUpperCase())}function f4(G){let K=[];if(G.description)K.push(G.description);if(G.environment)K.push("Environment fallback: "+G.environment);if(G.multiple)K.push(G.choices?"Choose one or more values.":"Enter one value per line.");if(G.mustExist)K.push("Must be an existing "+(G.pathKind||"path")+".");return K.join(" ")}function I4({index:G,onChange:K,parameter:Z,values:$}){let Y="run-param-"+G,z=f4(Z),W=y4(Z);if(Z.type==="boolean")return X("label",{class:"boolean-field",for:Y,children:[X("span",{children:[X("strong",{children:W},void 0,!1,void 0,this),X("small",{children:z||"Enable this option."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("input",{id:Y,type:"checkbox",checked:$[0]===!0,onChange:(J)=>K(G,[J.currentTarget.checked])},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let Q=X("label",{for:Y,children:[W,Z.required&&X("span",{class:"required-mark",children:"required"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A;if(Z.choices){let J=$.filter((H)=>typeof H==="string");A=X("select",{id:Y,multiple:Z.multiple,required:Z.required,value:Z.multiple?void 0:J[0]??"",onChange:(H)=>K(G,Z.multiple?Array.from(H.currentTarget.selectedOptions,(M)=>M.value):[H.currentTarget.value]),children:[!Z.multiple&&!Z.required&&X("option",{value:"",children:"Use default or leave unset"},void 0,!1,void 0,this),Z.choices.map((H)=>X("option",{value:H,selected:Z.multiple?J.includes(H):void 0,children:H},H,!1,void 0,this))]},void 0,!0,void 0,this)}else if(Z.multiple)A=X("textarea",{id:Y,spellcheck:!1,placeholder:"One value per line",value:String($[0]??""),onInput:(J)=>K(G,[J.currentTarget.value])},void 0,!1,void 0,this);else{let J=$[0]??"";A=X("input",{id:Y,type:Z.type==="number"?"number":"text",value:String(J),placeholder:Z.type==="path"?Z.pathKind==="directory"?"./directory":"./file":"",step:Z.type==="number"?Z.integer?"1":"any":void 0,min:Z.type==="number"?Z.min:void 0,max:Z.type==="number"?Z.max:void 0,required:Z.required,onInput:(H)=>K(G,Z.type==="number"&&H.currentTarget.value!==""?[Number(H.currentTarget.value)]:[H.currentTarget.value])},void 0,!1,void 0,this)}return X("div",{class:"field",children:[Q,A,z&&X("div",{class:"field-hint",children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function D4({command:G,onChange:K,values:Z}){let $=(z,W,Q)=>{let A=G.parameters.map((J,H)=>({index:H,parameter:J})).filter(({parameter:J})=>J.group==="execution"===z);if(!A.length)return null;return X("section",{class:"form-section",children:[X("div",{class:"form-section-head",children:[X("strong",{children:W},void 0,!1,void 0,this),X("span",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"parameter-grid",children:A.map(({index:J,parameter:H})=>X(I4,{index:J,onChange:K,parameter:H,values:Z[J]??[]},H.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Y=G.parameters.filter((z)=>z.group!=="execution").length;return X("div",{class:"parameter-fields",id:"parameterFields",children:[$(!1,"Pipeline inputs",Y+" parameter"+(Y===1?"":"s")),$(!0,"Execution controls","Built into Tubeless")]},void 0,!0,void 0,this)}function j4({commands:G,onConfigure:K}){if(!G.length)return X("div",{class:"sheet",children:X(r0,{title:"No pipelines found",copy:"Try a different pipeline name or description."},void 0,!1,void 0,this)},void 0,!1,void 0,this);return X("section",{class:"sheet",children:[X("div",{class:"sheet-head",children:[X("div",{children:[X("div",{class:"sheet-title",children:"Available pipelines"},void 0,!1,void 0,this),X("div",{class:"sheet-subtitle",children:"Available in this Studio session"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("span",{class:"sheet-subtitle",children:[G.length," shown"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"catalog",children:G.map((Z)=>X("article",{class:"catalog-card",children:[X("h3",{children:Z.name},void 0,!1,void 0,this),X("p",{children:w1(Z)},void 0,!1,void 0,this),X("div",{class:"catalog-actions",children:X("button",{class:"primary-button",onClick:()=>K(Z.id),children:"Configure"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},Z.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function V4({plan:G}){let K=G.steps.filter((Z)=>Z.selected&&!Z.skipReason).length;return X(g,{children:[G.errors.length>0&&X("div",{class:"launch-error",children:G.errors.map((Z)=>X("div",{children:Z.message},Z.message,!1,void 0,this))},void 0,!1,void 0,this),X("div",{class:"plan-summary",children:[X("strong",{children:G.pipelineId},void 0,!1,void 0,this),X("span",{children:[K," of ",G.steps.length," steps will run",G.dryRun?" · dry run":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"plan-steps",children:G.steps.map((Z)=>{let $=!Z.selected?"Not selected":Z.skipReason==="dry-run"?"Dry-run skip":Z.skipReason?"Skipped":"Will run",Y=Z.description||(Z.dependencies.length?"After "+Z.dependencies.join(", "):"No required dependencies"),z=Z.nestedPipeline,W=Z.remote,Q=W?"Remote step":z?z.mode==="iterate"?"Pipeline iteration":z.mode==="for-each"?"Pipeline fan-out":"Nested pipeline":"Step";return X("div",{class:"plan-step",children:[X("div",{class:"plan-step-title",children:[X("strong",{children:Z.name||Z.id},void 0,!1,void 0,this),X("span",{class:`plan-kind${z?" pipeline":""}`,children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("small",{children:Y},void 0,!1,void 0,this),X("span",{class:`plan-disposition${$==="Will run"?"":" skipped"}`,children:$},void 0,!1,void 0,this),z&&X(s0,{label:z.pipelineId,secondary:`${z.stepIds.length} declared steps${z.mode==="iterate"?` per iteration, at most ${z.maxIterations} iterations`:z.mode==="for-each"?" per runtime item":""}`,stepIds:z.stepIds},void 0,!1,void 0,this),W&&X(s0,{label:W.engine,secondary:W.target},void 0,!1,void 0,this)]},Z.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function E4({commandCount:G,snapshot:K}){let Z=K.completedRunCount+K.failedRunCount,$=Z?Math.round(K.completedRunCount/Z*100):0,Y=G||new Set(K.definitions.map(({pipelineId:W})=>W)).size,z=[["Active now",K.activeRunCount,K.activeRunCount?"Live execution in progress":"No work in flight"],["Recorded runs",K.runs.length,"Append-only local history"],["Success rate",$+"%",Z+" terminal runs"],["Pipelines",Y,G?"Available to configure":"Observed in run history"]];return X(g,{children:z.map(([W,Q,A])=>X("article",{class:"metric",children:[X("div",{class:"metric-label",children:W},void 0,!1,void 0,this),X("div",{class:"metric-value",children:Q},void 0,!1,void 0,this),X("div",{class:"metric-note",children:A},void 0,!1,void 0,this)]},W,!0,void 0,this))},void 0,!1,void 0,this)}function x4({nowMs:G,onSelect:K,run:Z,runIndex:$,selectedRunId:Y}){let z=Z.steps.filter((A)=>A.status==="running"),W=z[0],Q=$.descendantCount(Z.runId);return X("button",{class:`run-row ${Z.status} ${$.rootRunId(Y)===Z.runId?"selected":""}`,"data-run-id":Z.runId,onClick:()=>K(Z.runId),children:[X("div",{class:"run-primary",children:[X(u0,{value:Z.status},void 0,!1,void 0,this),X("strong",{children:Z.pipelineId},void 0,!1,void 0,this),X("time",{class:"run-time",datetime:R2(Z.startedAtMs),title:C2(Z.startedAtMs),children:S2(Z.startedAtMs,G)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"run-secondary",children:[X("code",{children:i0(Z.runId)},void 0,!1,void 0,this),X("i",{class:"dot"},void 0,!1,void 0,this),Z.correlationId&&X(g,{children:[X("span",{children:["correlation ",Z.correlationId]},void 0,!0,void 0,this),X("i",{class:"dot"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("span",{children:l0(Z.durationMs)},void 0,!1,void 0,this),X("i",{class:"dot"},void 0,!1,void 0,this),X("span",{children:[Z.steps.length," steps"]},void 0,!0,void 0,this),Q>0&&X(g,{children:[X("i",{class:"dot"},void 0,!1,void 0,this),X("span",{children:[Q," nested run",Q===1?"":"s"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.dryRun&&X(g,{children:[X("i",{class:"dot"},void 0,!1,void 0,this),X("span",{children:"dry run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.status==="running"&&X("div",{class:"run-activity",children:[X("strong",{children:z.length>1?`${z.length} steps running`:W?.name||W?.id||"Starting"},void 0,!1,void 0,this),X("span",{children:z.length>1?`${z.slice(0,3).map((A)=>A.name||A.id).join(", ")}${z.length>3?` +${z.length-3} more`:""}`:W?.progress?.message||"Execution in progress"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function h4({value:G}){let K=G.charAt(0).toUpperCase()+G.slice(1),Z=G==="completed"?X("svg",{viewBox:"0 0 12 12",children:X("path",{d:"m2 6 2.4 2.4L10 3"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="running"?X("i",{},void 0,!1,void 0,this):G==="skipped"?X("svg",{viewBox:"0 0 12 12",children:X("path",{d:"m3 3 6 6M9 3 3 9"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="cancelled"?X("svg",{viewBox:"0 0 12 12",children:X("rect",{x:"3",y:"3",width:"6",height:"6",rx:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="failed"?"!":"…";return X("span",{class:`step-status-icon ${G}`,role:"img","aria-label":K,title:K,children:Z},void 0,!1,void 0,this)}function v4({step:G}){let K=G.progress?.total,Z=K?Math.max(0,Math.min(100,(G.progress?.completed??0)/K*100)):G.status==="completed"?100:18,$=G.nestedPipeline,Y=$?$.stepCount??$.stepIds.length:0,z=$&&$.stepIds.length<Y?$.stepIds.length+" of "+Y+" declared steps":Y+" declared steps",W=G.progress?.detailCount;return X("article",{class:`step ${G.status}`,children:[X(h4,{value:G.status},void 0,!1,void 0,this),X("div",{class:"step-head",children:[X("strong",{children:G.name||G.id},void 0,!1,void 0,this),G.outputSource==="override"&&X(u0,{value:G.status,outputSource:G.outputSource},void 0,!1,void 0,this),G.name&&X("code",{children:G.id},void 0,!1,void 0,this),X("span",{class:"step-duration",children:l0(G.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G.description&&X("div",{class:"step-description",children:G.description},void 0,!1,void 0,this),$&&X(s0,{label:$.pipelineId,secondary:`${z}${$.mode==="iterate"?` per iteration, at most ${$.maxIterations} iterations`:$.mode==="for-each"?" per runtime item":""}`,stepIds:$.stepIds},void 0,!1,void 0,this),G.remote&&X(s0,{label:G.remote.engine,secondary:G.remote.target},void 0,!1,void 0,this),G.attempt&&X("div",{class:"execution",children:X("span",{class:"execution-summary",title:G.attempt.attemptId,children:[X("b",{children:G.attempt.outputSource==="override"?"Override validation":"Execution"},void 0,!1,void 0,this)," ","· ",i0(G.attempt.attemptId),G.attempt.retries.length>0&&` · ${G.attempt.retries.length} retr${G.attempt.retries.length===1?"y":"ies"}`]},void 0,!0,void 0,this)},void 0,!1,void 0,this),G.artifacts?.map((Q,A)=>X("details",{class:"execution",children:[X("summary",{children:[Q.preview?"Preview ":"Artifact ",Q.operation,": ",Q.artifact.id||Q.artifact.uri]},void 0,!0,void 0,this),X("pre",{children:JSON.stringify(Q.artifact,null,2)},void 0,!1,void 0,this)]},A,!0,void 0,this)),G.progress&&X(g,{children:[X("div",{class:"progress",children:X("i",{class:`w${Math.round(Z)}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),X("div",{class:"progress-copy",children:G.progress.message||G.progress.completed+(K?" / "+K:"")+" complete"},void 0,!1,void 0,this),G.progress.details&&G.progress.details.length>0&&X("div",{class:"progress-details",children:[G.progress.details.map((Q)=>X("div",{class:`progress-detail ${Q.status||"running"}`,children:[X("b",{children:Q.id},void 0,!1,void 0,this),Q.label&&X("span",{children:Q.label},void 0,!1,void 0,this),Q.outputSource==="override"&&X("span",{children:"(overridden)"},void 0,!1,void 0,this)]},Q.id,!0,void 0,this)),W&&G.progress.details.length<W?X("div",{class:"progress-detail-truncated",children:["Showing ",G.progress.details.length," of ",W," items"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function m4(G){return["running","failed","cancelled","skipped","completed","planned"].map((Z)=>[Z,G.steps.filter(($)=>$.status===Z).length]).filter(([,Z])=>Z).map(([Z,$])=>$+" "+Z).join(" · ")||"No steps"}function c4({canCancel:G,cancelling:K,liveRunIds:Z,nowMs:$,onCancel:Y,onSelect:z,run:W,runIndex:Q}){if(!W)return X("div",{class:"sheet detail",children:X(r0,{title:"Select a run",copy:"Choose a run from the history to inspect its steps, retry telemetry, logs, and errors."},void 0,!1,void 0,this)},void 0,!1,void 0,this);let A=Q.ancestorsOf(W.runId),J=Q.childrenOf(W.runId);return X("article",{class:"sheet detail",children:X("div",{class:"detail-body",children:[A.length>0&&X("div",{class:"run-parentage",children:[A.map((H)=>X("span",{children:[X("button",{type:"button",onClick:()=>z(H.runId),children:H.pipelineId},void 0,!1,void 0,this),X("span",{children:" / "},void 0,!1,void 0,this)]},H.runId,!0,void 0,this)),X("span",{children:W.pipelineId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"detail-heading",children:[X("div",{class:"detail-heading-copy",children:[X("div",{class:"detail-kicker",children:[W.parentRunId?"Nested run":"Top-level run"," ·"," ",S2(W.startedAtMs,$)]},void 0,!0,void 0,this),X("h2",{children:W.pipelineId},void 0,!1,void 0,this),X("p",{class:"definition-identity",children:["Definition:"," ",X("code",{children:W.definitionIdentity?.definitionId??"Not recorded (legacy trace)"},void 0,!1,void 0,this),X("br",{},void 0,!1,void 0,this),"Implementation: ",W.definitionIdentity?.implementationVersion??"Unknown"]},void 0,!0,void 0,this),X("div",{class:"run-id",children:W.runId},void 0,!1,void 0,this),W.correlationId&&X("div",{class:"run-id",children:["Correlation: ",W.correlationId]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"detail-heading-actions",children:[X(u0,{value:W.status},void 0,!1,void 0,this),G&&W.status==="running"&&!W.parentRunId&&Z.includes(W.runId)&&X("button",{class:"danger-button",type:"button",disabled:K,onClick:()=>Y(W.runId),children:"Cancel run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"detail-meta",children:[X("div",{children:[X("label",{children:"Started"},void 0,!1,void 0,this),X("span",{title:R2(W.startedAtMs),children:C2(W.startedAtMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{children:[X("label",{children:"Duration"},void 0,!1,void 0,this),X("span",{children:l0(W.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{children:[X("label",{children:"Steps"},void 0,!1,void 0,this),X("span",{children:W.steps.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{children:[X("label",{children:"Events"},void 0,!1,void 0,this),X("span",{children:W.eventCount},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),J.length>0&&X(g,{children:[X("div",{class:"section-title",children:[X("span",{children:"Nested runs"},void 0,!1,void 0,this),X("span",{children:[J.length," direct · ",Q.descendantCount(W.runId)," total"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"nested-runs",children:J.map((H)=>{let M=Q.descendantCount(H.runId);return X("button",{class:"nested-run",type:"button",onClick:()=>z(H.runId),children:[X(u0,{value:H.status},void 0,!1,void 0,this),X("strong",{children:H.pipelineId},void 0,!1,void 0,this),X("small",{children:[l0(H.durationMs)," · ",H.steps.length," steps",M?" · "+M+" nested":""]},void 0,!0,void 0,this)]},H.runId,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"section-title",children:[X("span",{children:"Step timeline"},void 0,!1,void 0,this),X("span",{children:m4(W)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.steps.length?X("div",{class:"step-list",children:W.steps.map((H)=>X(v4,{step:H},H.id,!1,void 0,this))},void 0,!1,void 0,this):X(r0,{title:"No planned steps",copy:"This run ended before a step plan was recorded."},void 0,!1,void 0,this),W.error&&X(g,{children:[X("div",{class:"section-title",children:X("span",{children:"Error"},void 0,!1,void 0,this)},void 0,!1,void 0,this),X("div",{class:"error-card",children:[X("div",{class:"error-code",children:[W.error.code," · ",W.error.phase]},void 0,!0,void 0,this),X("div",{class:"error-message",children:W.error.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W.logs.length>0&&X(g,{children:[X("div",{class:"section-title",children:[X("span",{children:"Logs"},void 0,!1,void 0,this),X("span",{children:W.logs.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"logs",children:W.logs.map((H)=>X("div",{class:"log-line",children:[X("time",{class:"log-time",children:S4(H.timestampMs)},void 0,!1,void 0,this),X("span",{class:`log-level ${H.level}`,children:H.level},void 0,!1,void 0,this),X("span",{class:"log-message",children:[H.stepId&&X(g,{children:[X("b",{children:H.stepId},void 0,!1,void 0,this)," ·"," "]},void 0,!0,void 0,this),H.message]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function d4(G){let K=G.roots.filter((Y)=>G.runIndex.subtreeIsRunning(Y.runId)),Z=G.roots.filter((Y)=>!G.runIndex.subtreeIsRunning(Y.runId)),$=(Y,z)=>z.length?X(g,{children:[X("div",{class:"run-group",children:[Y," · ",z.length]},void 0,!0,void 0,this),z.map((W)=>X(x4,{nowMs:G.nowMs,onSelect:G.onSelect,run:W,runIndex:G.runIndex,selectedRunId:G.selectedRunId},W.runId,!1,void 0,this))]},void 0,!0,void 0,this):null;return X(g,{children:[X(Z2,{definitions:G.definitions??[],runs:G.runs??[],onSelect:G.onSelect},void 0,!1,void 0,this),X("div",{class:"content-grid",children:[X("section",{class:"sheet",children:[X("div",{class:"sheet-head",children:[X("div",{children:[X("div",{class:"sheet-title",children:"Pipeline runs"},void 0,!1,void 0,this),X("div",{class:"sheet-subtitle",children:"Top-level runs · nested work stays with its parent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("span",{class:"sheet-subtitle",children:[G.roots.length," top-level · ",G.totalRunCount," total"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"run-list",children:G.roots.length?X(g,{children:[$("Running now",K),$("Recent",Z)]},void 0,!0,void 0,this):X(r0,{title:"No recorded runs",copy:"Choose Pipelines to start a run and create local history."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X(c4,{...G,run:G.selectedRun},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function a0(G){return G instanceof Error?G.message||String(G):String(G)}function p4({api:G,commands:K,commandId:Z,onClose:$,onLaunched:Y}){let[z,W]=y(Z??K[0]?.id??""),Q=K.find((k)=>k.id===z),[A,J]=y([]),[H,M]=y(null),[U,_]=y(""),[q,O]=y(!1),[F,L]=y(!1),B=k0(null),b=k0(0);if(s(()=>{W(Z??K[0]?.id??"")},[Z,K]),s(()=>{b.current+=1,J(Q?T4(Q):[]),M(null),_(""),requestAnimationFrame(()=>B.current?.querySelector("input, select, textarea")?.focus())},[Q]),s(()=>{if(Z===null)return;let k=(R)=>{if(R.key==="Escape"&&!q&&!F)$()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[Z,q,$,F]),Z===null)return null;let x=()=>{if(!q&&!F)$()},h=(k,R)=>{if(!Q)return;b.current+=1,J((m)=>m.map((u,r)=>{if(r===k)return R;let F0=Q.parameters[r];return Q.parameters[k]?.exclusive&&Q.parameters[k]?.multiple&&R.length>0&&F0?.exclusive&&F0.multiple?[]:u})),M(null)},t=(k,R)=>{let m=A[R]??[];if(!k.multiple||k.choices)return m;return String(m[0]??"").split(/\r?\n/).map((u)=>u.trim()).filter(Boolean).map((u)=>k.type==="number"?Number(u):u)},e=async()=>{if(!Q?.canPlan||F)return;let k=b.current;L(!0),_("");try{let R=await G.previewPlan(Q.id,R4(Q,t));if(b.current===k)M(R)}catch(R){if(b.current===k)_(a0(R))}finally{L(!1)}},X0=async(k)=>{if(k.preventDefault(),!Q||q)return;O(!0),_("");try{Y(await G.launch(Q.id,C4(Q,t)))}catch(R){_(a0(R))}finally{O(!1)}};return X("div",{class:"modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"launchTitle",onClick:(k)=>k.target===k.currentTarget&&x(),children:X("div",{class:"modal",children:[X("div",{class:"modal-head",children:[X("div",{children:[X("div",{class:"detail-kicker",children:"Configure pipeline"},void 0,!1,void 0,this),X("h2",{id:"launchTitle",children:Q?.name||"Run a pipeline"},void 0,!1,void 0,this),X("p",{children:Q?w1(Q):"Choose a declared pipeline and provide its inputs."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("button",{class:"close-button",type:"button","aria-label":"Close",onClick:x,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("form",{class:"launch-form",onSubmit:X0,children:[X("div",{class:"field",children:[X("label",{for:"launchCommand",children:"Pipeline command"},void 0,!1,void 0,this),X("select",{id:"launchCommand",value:z,onChange:(k)=>{b.current+=1,M(null),_(""),W(k.currentTarget.value)},children:K.map((k)=>X("option",{value:k.id,children:k.name},k.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{ref:B,children:Q&&X(D4,{command:Q,onChange:h,values:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),H&&X("div",{class:"plan-result","aria-live":"polite",children:X(V4,{plan:H},void 0,!1,void 0,this)},void 0,!1,void 0,this),U&&X("div",{class:"launch-error",children:U},void 0,!1,void 0,this),X("div",{class:"modal-actions",children:[X("button",{class:"secondary-button",type:"button",onClick:x,children:"Cancel"},void 0,!1,void 0,this),Q?.canPlan&&X("button",{class:"secondary-button",type:"button",disabled:F||q,onClick:()=>void e(),children:F?"Planning…":"Preview plan"},void 0,!1,void 0,this),X("button",{class:"primary-button",type:"submit",disabled:q||F,children:q?"Starting…":"Run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function o4({api:G,onCleared:K,onClose:Z,snapshot:$}){let[Y,z]=y(!1),[W,Q]=y(""),A=k0(null);s(()=>A.current?.focus(),[]),s(()=>{let _=(q)=>{if(q.key==="Escape"&&!Y)Z()};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[Y,Z]);let J=$.runs.length,H=$.runs.reduce((_,q)=>_+q.eventCount,0),M=()=>{if(!Y)Z()},U=async()=>{if(Y)return;z(!0),Q("");try{K((await G.clearHistory()).eventCount)}catch(_){Q(a0(_))}finally{z(!1)}};return X("div",{class:"modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"clearHistoryTitle",onClick:(_)=>_.target===_.currentTarget&&M(),children:X("div",{class:"modal confirm-modal",children:[X("div",{class:"modal-head",children:[X("div",{children:[X("div",{class:"detail-kicker",children:"Local maintenance"},void 0,!1,void 0,this),X("h2",{id:"clearHistoryTitle",children:"Clear run history?"},void 0,!1,void 0,this),X("p",{children:"This permanently resets the local studio history."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("button",{class:"close-button",type:"button","aria-label":"Close",onClick:M,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"confirm-body",children:[X("p",{class:"confirm-copy",children:["Remove ",J," recorded run",J===1?"":"s"," and ",H," event",H===1?"":"s"," from this SQLite store.",$.activeRunCount?` ${$.activeRunCount} recorded run${$.activeRunCount===1?" is":"s are"} still marked active; continue only if no external process is writing to this store.`:""]},void 0,!0,void 0,this),X("div",{class:"confirm-warning",children:"This cannot be undone. Pipeline definitions and execution remain unchanged; only recorded local events are removed."},void 0,!1,void 0,this),W&&X("div",{class:"launch-error",children:W},void 0,!1,void 0,this),X("div",{class:"confirm-actions",children:[X("button",{class:"secondary-button",type:"button",onClick:M,children:"Cancel"},void 0,!1,void 0,this),X("button",{ref:A,class:"danger-button",type:"button",disabled:Y,onClick:()=>void U(),children:Y?"Clearing…":"Clear history"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var i4=T2();function l4(G){return{className:`pulse${G?"":" lost"}`,label:G?"Connected · local":"Connection lost"}}function u4(G,K,Z,$){if(G&&G===K&&!$.runById(G))return G;if(!G||!Z.some((Y)=>Y.runId===$.rootRunId(G)))return Z[0]?.runId??null;return G}function r4({api:G=i4}){let K=v0(()=>new k1(G),[G]),[Z,$]=y(()=>K.getState()),{connected:Y,detail:z,manualRefreshing:W,snapshot:Q}=Z,[A,J]=y([]),[H,M]=y("runs"),[U,_]=y(""),[q,O]=y(null),[F,L]=y(!1),[B,b]=y(!1),[x,h]=y(!1),[t,e]=y(null),[X0,k]=y(!1),[R,m]=y(""),u=k0(null),r=v0(()=>w4(Q?.runs??[]),[Q]);s(()=>{return $(K.getState()),K.subscribe($)},[K]),s(()=>()=>K.dispose(),[K]),s(()=>{G.loadCommands().then((l)=>{if(J(l),l.length)M("pipelines")}).catch(()=>{}),G.loadCapabilities().then((l)=>{L(l.canCancel),b(l.canClearHistory)}).catch(()=>{}),K.refresh();let w=setInterval(()=>K.refresh(),1200);return()=>clearInterval(w)},[G,K]),s(()=>{if(!R)return;let w=setTimeout(()=>m(""),4200);return()=>clearTimeout(w)},[R]);let F0=U?r.matchingRootIds(U):null,t0=r.roots.filter((w)=>!F0||F0.has(w.runId)).sort((w,l)=>Number(r.subtreeIsRunning(l.runId))-Number(r.subtreeIsRunning(w.runId))||l.startedAtMs-w.startedAtMs);s(()=>{let w=u.current,l=u4(q,w,t0,r);if(w&&r.runById(w))u.current=null;if(l!==q)O(l)},[t0,r,q]);let C0=r.runById(q),T1=C0?[C0.runId,C0.eventCount,C0.status].join(":"):null;s(()=>{K.selectRun(q,T1)},[K,T1,q]);let R0=(w)=>m(w),y2=(w)=>{u.current=null,O(w)},f2=async(w)=>{if(!F||x)return;h(!0);try{await G.cancelRun(w),R0("Run cancelled · "+i0(w)),K.invalidate({delayMs:80})}catch(l){R0(a0(l))}finally{h(!1)}},I2=A.filter((w)=>!U||w.name.toLowerCase().includes(U.toLowerCase())||w1(w).toLowerCase().includes(U.toLowerCase())),L0=H==="pipelines",D2=z?.run.runId===q?z.run:null,C1=l4(Y);return X(g,{children:[X("div",{class:"shell",children:[X("aside",{class:"rail",children:[X("div",{class:"brand",children:[X("div",{class:"mark","aria-hidden":"true",children:X("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[X("path",{d:"M3 4.5h6a3 3 0 0 1 3 3v6",stroke:"#f7f8f3",strokeWidth:"1.5"},void 0,!1,void 0,this),X("circle",{cx:"3",cy:"4.5",r:"2",fill:"#7396ff"},void 0,!1,void 0,this),X("circle",{cx:"12",cy:"13.5",r:"2",fill:"#63d297"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),X("div",{class:"brand-copy",children:[X("strong",{children:"Tubeless"},void 0,!1,void 0,this),X("small",{children:"Local studio"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"rail-label",children:"Workspace"},void 0,!1,void 0,this),X("nav",{class:"nav","aria-label":"Studio sections",children:[A.length>0&&X("button",{class:L0?"active":"",type:"button",title:"Pipelines",onClick:()=>M("pipelines"),children:[X("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[X("path",{d:"M4 5h7M4 10h12M9 15h7"},void 0,!1,void 0,this),X("circle",{cx:"14.5",cy:"5",r:"1.5"},void 0,!1,void 0,this),X("circle",{cx:"5.5",cy:"15",r:"1.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("span",{children:"Pipelines"},void 0,!1,void 0,this),X("b",{class:"nav-count",children:A.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("button",{class:L0?"":"active",type:"button",title:"Runs",onClick:()=>M("runs"),children:[X("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[X("path",{d:"M10 3v4l2.5 1.5M17 10a7 7 0 1 1-2.05-4.95"},void 0,!1,void 0,this),X("path",{d:"M14.5 2.8v3.5H18"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("span",{children:"Runs"},void 0,!1,void 0,this),X("b",{class:"nav-count",children:Q?.runs.length??0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"rail-foot",children:[X("div",{class:"connection",children:[X("i",{class:C1.className},void 0,!1,void 0,this),X("span",{children:C1.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"database",children:"append-only SQLite"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X("main",{class:"workspace",children:[X("header",{class:"topbar",children:[X("div",{children:[X("div",{class:"eyebrow",children:"Execution workspace"},void 0,!1,void 0,this),X("h1",{children:L0?"Pipelines":"Runs"},void 0,!1,void 0,this),X("p",{class:"lede",children:L0?"Choose a declared workflow to configure and run.":"Live work and durable history in one place."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("div",{class:"toolbar",children:[X("input",{class:"search",type:"search",value:U,placeholder:L0?"Filter pipelines":"Filter runs or IDs","aria-label":"Filter",onInput:(w)=>_(w.currentTarget.value.trim())},void 0,!1,void 0,this),A.length>0&&X("button",{class:"primary-button",onClick:()=>e(A[0]?.id??""),children:"Run pipeline"},void 0,!1,void 0,this),B&&X("button",{class:"danger-button",id:"clearHistoryButton",type:"button",disabled:!Q?.runs.length,title:Q?.activeRunCount?"Clear history, including runs left active by an interrupted process":"Clear history",onClick:()=>k(!0),children:[X("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",children:X("path",{d:"M3 4.5h10M6 2.5h4M5 4.5l.5 9h5l.5-9M7 7v4M9 7v4"},void 0,!1,void 0,this)},void 0,!1,void 0,this),X("span",{children:"Clear history"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X("button",{class:`icon-button${W?" spinning":""}`,type:"button",title:"Refresh now","aria-label":"Refresh now",onClick:()=>K.refresh(!0),children:X("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[X("path",{d:"M16.5 7A7 7 0 1 0 17 11"},void 0,!1,void 0,this),X("path",{d:"M16.5 3v4h-4"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q&&X(g,{children:[X("section",{class:"metrics",children:X(E4,{commandCount:A.length,snapshot:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this),X("section",{children:L0?X(j4,{commands:I2,onConfigure:e},void 0,!1,void 0,this):X(d4,{definitions:Q.definitions,runs:Q.runs,canCancel:F,cancelling:x,liveRunIds:Q.liveRunIds??[],nowMs:Date.now(),onCancel:(w)=>void f2(w),onSelect:y2,roots:t0,runIndex:r,selectedRun:D2,selectedRunId:q,totalRunCount:Q.runs.length},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t!==null&&X(p4,{api:G,commands:A,commandId:t,onClose:()=>e(null),onLaunched:(w)=>{u.current=w,O(w),M("runs"),_(""),e(null),R0("Run accepted · "+i0(w)),K.invalidate({delayMs:80})}},void 0,!1,void 0,this),X0&&Q&&X(o4,{api:G,snapshot:Q,onClose:()=>k(!1),onCleared:(w)=>{u.current=null,O(null),k(!1),R0("Cleared "+w+" recorded event"+(w===1?"":"s")),K.invalidate({resetHistory:!0})}},void 0,!1,void 0,this),R&&X("div",{class:"toast",role:"status",children:R},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function g2(){let G=document.querySelector("#studio-root");if(!(G instanceof HTMLElement))throw Error("Missing #studio-root");d1(X(r4,{},void 0,!1,void 0,this),G)}g2();
|
|
1
|
+
var x0,T,x1,p2,W0,D1,h1,m1,$1,y0,b0,v1,X1,K1,Z1,o2,j0={},V0=[],i2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h0=Array.isArray;function $0(G,$){for(var K in $)G[K]=$[K];return G}function W1(G){G&&G.parentNode&&G.parentNode.removeChild(G)}function l2(G,$,K){var X,Q,z,W={};for(z in $)z=="key"?X=$[z]:z=="ref"?Q=$[z]:W[z]=$[z];if(arguments.length>2&&(W.children=arguments.length>3?x0.call(arguments,2):K),typeof G=="function"&&G.defaultProps!=null)for(z in G.defaultProps)W[z]===void 0&&(W[z]=G.defaultProps[z]);return I0(G,W,X,Q,null)}function I0(G,$,K,X,Q){var z={type:G,props:$,key:K,ref:X,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:Q==null?++x1:Q,__i:-1,__u:0};return Q==null&&T.vnode!=null&&T.vnode(z),z}function g(G){return G.children}function D0(G,$){this.props=G,this.context=$}function N0(G,$){if($==null)return G.__?N0(G.__,G.__i+1):null;for(var K;$<G.__k.length;$++)if((K=G.__k[$])!=null&&K.__e!=null)return K.__e;return typeof G.type=="function"?N0(G):null}function u2(G){if(G.__P&&G.__d){var $=G.__v,K=$.__e,X=[],Q=[],z=$0({},$);z.__v=$.__v+1,T.vnode&&T.vnode(z),z1(G.__P,z,$,G.__n,G.__P.namespaceURI,32&$.__u?[K]:null,X,K==null?N0($):K,!!(32&$.__u),Q),z.__v=$.__v,z.__.__k[z.__i]=z,i1(X,z,Q),$.__e=$.__=null,z.__e!=K&&c1(z)}}function c1(G){if((G=G.__)!=null&&G.__c!=null)return G.__e=G.__c.base=null,G.__k.some(function($){if($!=null&&$.__e!=null)return G.__e=G.__c.base=$.__e}),c1(G)}function j1(G){(!G.__d&&(G.__d=!0)&&W0.push(G)&&!E0.__r++||D1!=T.debounceRendering)&&((D1=T.debounceRendering)||h1)(E0)}function E0(){try{for(var G,$=1;W0.length;)W0.length>$&&W0.sort(m1),G=W0.shift(),$=W0.length,u2(G)}finally{W0.length=E0.__r=0}}function d1(G,$,K,X,Q,z,W,U,A,J,H){var M,Y,N,q,P,O,L=X&&X.__k||V0,B=$.length;for(A=r2(K,$,L,A,B),M=0;M<B;M++)(N=K.__k[M])!=null&&(Y=N.__i!=-1&&L[N.__i]||j0,N.__i=M,O=z1(G,N,Y,Q,z,W,U,A,J,H),q=N.__e,N.ref&&Y.ref!=N.ref&&(Y.ref&&Q1(Y.ref,null,N),H.push(N.ref,N.__c||q,N)),P==null&&q!=null&&(P=q),4&N.__u?(A=p1(N,A,G),Y.__e&&(Y.__e=null)):typeof N.type=="function"&&O!==void 0?A=O:q&&(A=q.nextSibling),N.__u&=-7);return K.__e=P,A}function r2(G,$,K,X,Q){var z,W,U,A,J,H=K.length,M=H,Y=0;for(G.__k=Array(Q),z=0;z<Q;z++)(W=$[z])!=null&&typeof W!="boolean"&&typeof W!="function"?(typeof W=="string"||typeof W=="number"||typeof W=="bigint"||W.constructor==String?W=G.__k[z]=I0(null,W,null,null,null):h0(W)?W=G.__k[z]=I0(g,{children:W},null,null,null):W.constructor===void 0&&W.__b>0?W=G.__k[z]=I0(W.type,W.props,W.key,W.ref?W.ref:null,W.__v):G.__k[z]=W,A=z+Y,W.__=G,W.__b=G.__b+1,U=null,(J=W.__i=s2(W,K,A,M))!=-1&&(M--,(U=K[J])&&(U.__u|=2)),U==null||U.__v==null?(J==-1&&(Q>H?Y--:Q<H&&Y++),typeof W.type!="function"&&(W.__u|=4)):J!=A&&(J==A-1?Y--:J==A+1?Y++:(J>A?Y--:Y++,W.__u|=4))):G.__k[z]=null;if(M)for(z=0;z<H;z++)(U=K[z])!=null&&(2&U.__u)==0&&(U.__e==X&&(X=N0(U)),u1(U,U));return X}function p1(G,$,K){var X,Q;if(typeof G.type=="function"){for(X=G.__k,Q=0;X&&Q<X.length;Q++)X[Q]&&(X[Q].__=G,$=p1(X[Q],$,K));return $}G.__e!=$&&($&&G.type&&!$.parentNode&&($=N0(G)),$=K.insertBefore(G.__e,$||null));do $=$&&$.nextSibling;while($!=null&&$.nodeType==8);return $}function s2(G,$,K,X){var Q,z,W,U=G.key,A=G.type,J=$[K],H=J!=null&&(2&J.__u)==0;if(J===null&&U==null||H&&U==J.key&&A==J.type)return K;if(X>(H?1:0)){for(Q=K-1,z=K+1;Q>=0||z<$.length;)if((J=$[W=Q>=0?Q--:z++])!=null&&(2&J.__u)==0&&U==J.key&&A==J.type)return W}return-1}function V1(G,$,K){$[0]=="-"?G.setProperty($,K==null?"":K):G[$]=K==null?"":typeof K!="number"||i2.test($)?K:K+"px"}function S0(G,$,K,X,Q){var z,W;G:if($=="style")if(typeof K=="string")G.style.cssText=K;else{if(typeof X=="string"&&(G.style.cssText=X=""),X)for($ in X)K&&$ in K||V1(G.style,$,"");if(K)for($ in K)X&&K[$]==X[$]||V1(G.style,$,K[$])}else if($[0]=="o"&&$[1]=="n")z=$!=($=$.replace(v1,"$1")),W=$.toLowerCase(),$=W in G||$=="onFocusOut"||$=="onFocusIn"?W.slice(2):$.slice(2),G.l||(G.l={}),G.l[$+z]=K,K?X?K[b0]=X[b0]:(K[b0]=X1,G.addEventListener($,z?Z1:K1,z)):G.removeEventListener($,z?Z1:K1,z);else{if(Q=="http://www.w3.org/2000/svg")$=$.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if($!="width"&&$!="height"&&$!="href"&&$!="list"&&$!="form"&&$!="tabIndex"&&$!="download"&&$!="rowSpan"&&$!="colSpan"&&$!="role"&&$!="popover"&&$ in G)try{G[$]=K==null?"":K;break G}catch(U){}typeof K=="function"||(K==null||K===!1&&$[4]!="-"?G.removeAttribute($):G.setAttribute($,$=="popover"&&K==1?"":K))}}function E1(G){return function($){if(this.l){var K=this.l[$.type+G];if($[y0]==null)$[y0]=X1++;else if($[y0]<K[b0])return;return K(T.event?T.event($):$)}}}function z1(G,$,K,X,Q,z,W,U,A,J){var H,M,Y,N,q,P,O,L,B,k,x,h,n,G0,X0,b,C=$.type;if($.constructor!==void 0)return null;128&K.__u&&(A=!!(32&K.__u),z=[U=$.__e=K.__e]),(H=T.__b)&&H($);G:if(typeof C=="function"){M=W.length;try{if(B=$.props,k=C.prototype&&C.prototype.render,x=(H=C.contextType)&&X[H.__c],h=H?x?x.props.value:H.__:X,K.__c?L=(Y=$.__c=K.__c).__=Y.__E:(k?$.__c=Y=new C(B,h):($.__c=Y=new D0(B,h),Y.constructor=C,Y.render=n2),x&&x.sub(Y),Y.state||(Y.state={}),Y.__n=X,N=Y.__d=!0,Y.__h=[],Y._sb=[]),k&&Y.__s==null&&(Y.__s=Y.state),k&&C.getDerivedStateFromProps!=null&&(Y.__s==Y.state&&(Y.__s=$0({},Y.__s)),$0(Y.__s,C.getDerivedStateFromProps(B,Y.__s))),q=Y.props,P=Y.state,Y.__v=$,N)k&&C.getDerivedStateFromProps==null&&Y.componentWillMount!=null&&Y.componentWillMount(),k&&Y.componentDidMount!=null&&Y.__h.push(Y.componentDidMount);else{if(k&&C.getDerivedStateFromProps==null&&B!==q&&Y.componentWillReceiveProps!=null&&Y.componentWillReceiveProps(B,h),$.__v==K.__v||!Y.__e&&Y.shouldComponentUpdate!=null&&Y.shouldComponentUpdate(B,Y.__s,h)===!1){$.__v!=K.__v&&(Y.props=B,Y.state=Y.__s,Y.__d=!1),$.__e=K.__e,$.__k=K.__k,$.__k.some(function(d){d&&(d.__=$)}),V0.push.apply(Y.__h,Y._sb),Y._sb=[],Y.__h.length&&W.push(Y),U=N0(K);break G}Y.componentWillUpdate!=null&&Y.componentWillUpdate(B,Y.__s,h),k&&Y.componentDidUpdate!=null&&Y.__h.push(function(){Y.componentDidUpdate(q,P,O)})}if(Y.context=h,Y.props=B,Y.__P=G,Y.__e=!1,n=T.__r,G0=0,k)Y.state=Y.__s,Y.__d=!1,n&&n($),H=Y.render(Y.props,Y.state,Y.context),V0.push.apply(Y.__h,Y._sb),Y._sb=[];else do Y.__d=!1,n&&n($),H=Y.render(Y.props,Y.state,Y.context),Y.state=Y.__s;while(Y.__d&&++G0<25);Y.state=Y.__s,Y.getChildContext!=null&&(X=$0($0({},X),Y.getChildContext())),k&&!N&&Y.getSnapshotBeforeUpdate!=null&&(O=Y.getSnapshotBeforeUpdate(q,P)),X0=H!=null&&H.type===g&&H.key==null?l1(H.props.children):H,U=d1(G,h0(X0)?X0:[X0],$,K,X,Q,z,W,U,A,J),Y.base=$.__e,$.__u&=-161,Y.__h.length&&W.push(Y),L&&(Y.__E=Y.__=null)}catch(d){if(W.length=M,$.__v=null,A||z!=null){if(d.then){for($.__u|=A?160:128;U&&U.nodeType==8&&U.nextSibling;)U=U.nextSibling;z!=null&&(z[z.indexOf(U)]=null),$.__e=U}else if(z!=null)for(b=z.length;b--;)W1(z[b])}else $.__e=K.__e;$.__k==null&&($.__k=K.__k||[]),d.then||o1($),T.__e(d,$,K)}}else z==null&&$.__v==K.__v?($.__k=K.__k,$.__e=K.__e):U=$.__e=t2(K.__e,$,K,X,Q,z,W,A,J);return(H=T.diffed)&&H($),128&$.__u?void 0:U}function o1(G){G&&(G.__c&&(G.__c.__e=!0),G.__k&&G.__k.some(o1))}function i1(G,$,K){for(var X=0;X<K.length;X++)Q1(K[X],K[++X],K[++X]);T.__c&&T.__c($,G),G.some(function(Q){try{G=Q.__h,Q.__h=[],G.some(function(z){z.call(Q)})}catch(z){T.__e(z,Q.__v)}})}function l1(G){return typeof G!="object"||G==null||G.__b>0?G:h0(G)?G.map(l1):G.constructor!==void 0?null:$0({},G)}function t2(G,$,K,X,Q,z,W,U,A){var J,H,M,Y,N,q,P,O=K.props||j0,L=$.props,B=$.type;if(B=="svg"?Q="http://www.w3.org/2000/svg":B=="math"?Q="http://www.w3.org/1998/Math/MathML":Q||(Q="http://www.w3.org/1999/xhtml"),z!=null){for(J=0;J<z.length;J++)if((N=z[J])&&"setAttribute"in N==!!B&&(B?N.localName==B:N.nodeType==3)){G=N,z[J]=null;break}}if(G==null){if(B==null)return document.createTextNode(L);G=document.createElementNS(Q,B,L.is&&L),U&&(T.__m&&T.__m($,z),U=!1),z=null}if(B==null)O===L||U&&G.data==L||(G.data=L);else{if(z=B=="textarea"&&L.defaultValue!=null?null:z&&x0.call(G.childNodes),!U&&z!=null)for(O={},J=0;J<G.attributes.length;J++)O[(N=G.attributes[J]).name]=N.value;for(J in O)N=O[J],J=="dangerouslySetInnerHTML"?M=N:J=="children"||(J in L)||J=="value"&&("defaultValue"in L)||J=="checked"&&("defaultChecked"in L)||S0(G,J,null,N,Q);for(J in L)N=L[J],J=="children"?Y=N:J=="dangerouslySetInnerHTML"?H=N:J=="value"?q=N:J=="checked"?P=N:U&&typeof N!="function"||O[J]===N||S0(G,J,N,O[J],Q);if(H)U||M&&(H.__html==M.__html||H.__html==G.innerHTML)||(G.innerHTML=H.__html),$.__k=[];else if(M&&(G.innerHTML=""),d1($.type=="template"?G.content:G,h0(Y)?Y:[Y],$,K,X,B=="foreignObject"?"http://www.w3.org/1999/xhtml":Q,z,W,z?z[0]:K.__k&&N0(K,0),U,A),z!=null)for(J=z.length;J--;)W1(z[J]);U&&B!="textarea"||(J="value",B=="progress"&&q==null?G.removeAttribute("value"):q!=null&&(q!==G[J]||B=="progress"&&!q||B=="option"&&q!=O[J])&&S0(G,J,q,O[J],Q),J="checked",P!=null&&P!=G[J]&&S0(G,J,P,O[J],Q))}return G}function Q1(G,$,K){try{if(typeof G=="function"){var X=typeof G.__u=="function";X&&G.__u(),X&&$==null||(G.__u=G($))}else G.current=$}catch(Q){T.__e(Q,K)}}function u1(G,$,K){var X,Q;if(T.unmount&&T.unmount(G),(X=G.ref)&&(X.current&&X.current!=G.__e||Q1(X,null,$)),(X=G.__c)!=null){if(X.componentWillUnmount)try{X.componentWillUnmount()}catch(z){T.__e(z,$)}X.base=X.__P=X.__n=null}if(X=G.__k)for(Q=0;Q<X.length;Q++)X[Q]&&u1(X[Q],$,K||typeof G.type!="function");K||W1(G.__e),G.__c=G.__=G.__e=void 0}function n2(G,$,K){return this.constructor(G,K)}function r1(G,$,K){var X,Q,z,W;$==document&&($=document.documentElement),T.__&&T.__(G,$),Q=(X=typeof K=="function")?null:K&&K.__k||$.__k,z=[],W=[],z1($,G=(!X&&K||$).__k=l2(g,null,[G]),Q||j0,j0,$.namespaceURI,!X&&K?[K]:Q?null:$.firstChild?x0.call($.childNodes):null,z,!X&&K?K:Q?Q.__e:$.firstChild,X,W),i1(z,G,W),G.props.children=null}x0=V0.slice,T={__e:function(G,$,K,X){for(var Q,z,W;$=$.__;)if((Q=$.__c)&&!Q.__)try{if((z=Q.constructor)&&z.getDerivedStateFromError!=null&&(Q.setState(z.getDerivedStateFromError(G)),W=Q.__d),Q.componentDidCatch!=null&&(Q.componentDidCatch(G,X||{}),W=Q.__d),W)return Q.__E=Q}catch(U){G=U}throw G}},x1=0,p2=function(G){return G!=null&&G.constructor===void 0},D0.prototype.setState=function(G,$){var K;K=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$0({},this.state),typeof G=="function"&&(G=G($0({},K),this.props)),G&&$0(K,G),G!=null&&this.__v&&($&&this._sb.push($),j1(this))},D0.prototype.forceUpdate=function(G){this.__v&&(this.__e=!0,G&&this.__h.push(G),j1(this))},D0.prototype.render=g,W0=[],h1=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,m1=function(G,$){return G.__v.__b-$.__v.__b},E0.__r=0,$1=Math.random().toString(8),y0="__d"+$1,b0="__a"+$1,v1=/(PointerCapture)$|Capture$/i,X1=0,K1=E1(!1),Z1=E1(!0),o2=0;var k0,I,U1,s1,v0=0,Z2=[],D=T,t1=D.__b,n1=D.__r,a1=D.diffed,e1=D.__c,G2=D.unmount,$2=D.__;function J1(G,$){D.__h&&D.__h(I,G,v0||$),v0=0;var K=I.__H||(I.__H={__:[],__h:[]});return G>=K.__.length&&K.__.push({}),K.__[G]}function R(G){return v0=1,a2(W2,G)}function a2(G,$,K){var X=J1(k0++,2);if(X.t=G,!X.__c&&(X.__=[K?K($):W2(void 0,$),function(U){var A=X.__N?X.__N[0]:X.__[0],J=X.t(A,U);A!==J&&(X.__N=[J,X.__[1]],X.__c.setState({}))}],X.__c=I,!I.__f)){var Q=function(U,A,J){if(!X.__c.__H)return!0;var H=!1,M=X.__c.props!==U;if(X.__c.__H.__.some(function(N){if(N.__N){H=!0;var q=N.__[0];N.__=N.__N,N.__N=void 0,q!==N.__[0]&&(M=!0)}}),z){var Y=z.call(this,U,A,J);return H?Y||M:Y}return!H||M};I.__f=!0;var{shouldComponentUpdate:z,componentWillUpdate:W}=I;I.componentWillUpdate=function(U,A,J){if(this.__e){var H=z;z=void 0,Q(U,A,J),z=H}W&&W.call(this,U,A,J)},I.shouldComponentUpdate=Q}return X.__N||X.__}function s(G,$){var K=J1(k0++,3);!D.__s&&X2(K.__H,$)&&(K.__=G,K.u=$,I.__H.__h.push(K))}function w0(G){return v0=5,c0(function(){return{current:G}},[])}function c0(G,$){var K=J1(k0++,7);return X2(K.__H,$)&&(K.__=G(),K.__H=$,K.__h=G),K.__}function e2(){for(var G;G=Z2.shift();){var $=G.__H;if(G.__P&&$)try{$.__h.some(m0),$.__h.some(Y1),$.__h=[]}catch(K){$.__h=[],D.__e(K,G.__v)}}}D.__b=function(G){I=null,t1&&t1(G)},D.__=function(G,$){G&&$.__k&&$.__k.__m&&(G.__m=$.__k.__m),$2&&$2(G,$)},D.__r=function(G){n1&&n1(G),k0=0;var $=(I=G.__c).__H;$&&(U1===I?($.__h=[],I.__h=[],$.__.some(function(K){K.__N&&(K.__=K.__N),K.u=K.__N=void 0})):($.__h.some(m0),$.__h.some(Y1),$.__h=[],k0=0)),U1=I},D.diffed=function(G){a1&&a1(G);var $=G.__c;$&&$.__H&&($.__H.__h.length&&(Z2.push($)!==1&&s1===D.requestAnimationFrame||((s1=D.requestAnimationFrame)||G4)(e2)),$.__H.__.some(function(K){K.u&&(K.__H=K.u,K.u=void 0)})),U1=I=null},D.__c=function(G,$){$.some(function(K){try{K.__h.some(m0),K.__h=K.__h.filter(function(X){return!X.__||Y1(X)})}catch(X){$.some(function(Q){Q.__h&&(Q.__h=[])}),$=[],D.__e(X,K.__v)}}),e1&&e1(G,$)},D.unmount=function(G){G2&&G2(G);var $,K=G.__c;K&&K.__H&&(K.__H.__.some(function(X){try{m0(X)}catch(Q){$=Q}}),K.__H=void 0,$&&D.__e($,K.__v))};var K2=typeof requestAnimationFrame=="function";function G4(G){var $,K=function(){clearTimeout(X),K2&&cancelAnimationFrame($),setTimeout(G)},X=setTimeout(K,35);K2&&($=requestAnimationFrame(K))}function m0(G){var $=I,K=G.__c;typeof K=="function"&&(G.__c=void 0,K()),I=$}function Y1(G){var $=I;G.__c=G.__(),I=$}function X2(G,$){return!G||G.length!==$.length||$.some(function(K,X){return K!==G[X]})}function W2(G,$){return typeof $=="function"?$(G):$}var $4=0;function Z(G,$,K,X,Q,z){$||($={});var W,U,A=$;if("ref"in A)for(U in A={},$)U=="ref"?W=$[U]:A[U]=$[U];var J={type:G,props:A,key:K,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--$4,__i:-1,__u:0,__source:Q,__self:z};if(typeof G=="function"&&(W=G.defaultProps))for(U in W)A[U]===void 0&&(A[U]=W[U]);return T.vnode&&T.vnode(J),J}function B0({metadata:G}){if(!G)return null;return Z("details",{class:"step-metadata",children:[Z("summary",{children:[G.owner,G.domain,...G.tags??[]].filter(Boolean).join(" · ")||"Metadata"},void 0,!1,void 0,this),Z("pre",{children:JSON.stringify(G,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function K4(G,$,K){let X=new Map,Q=$.trim().toLowerCase();for(let z of G){if(!`${z.id} ${JSON.stringify(z.metadata??{})}`.toLowerCase().includes(Q))continue;let W=K==="none"?"Steps":z.metadata?.[K],U=X.get(W)??[];U.push(z),X.set(W,U)}return X}function d0({steps:G}){let[$,K]=R(""),[X,Q]=R("none"),z=K4(G,$,X);return Z("details",{children:[Z("summary",{children:["Explore steps (",G.length,")"]},void 0,!0,void 0,this),Z("label",{class:"field",children:["Search steps and metadata",Z("input",{type:"search",value:$,onInput:(W)=>K(W.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("label",{class:"field",children:["Group steps",Z("select",{value:X,onChange:(W)=>{let U=W.currentTarget.value;if(U==="owner"||U==="domain"||U==="none")Q(U)},children:[Z("option",{value:"none",children:"Execution order"},void 0,!1,void 0,this),Z("option",{value:"owner",children:"Owner"},void 0,!1,void 0,this),Z("option",{value:"domain",children:"Domain"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.size===0&&Z("p",{children:"No matching steps."},void 0,!1,void 0,this),[...z].map(([W,U])=>Z("section",{children:[Z("h4",{children:W??"Unassigned"},void 0,!1,void 0,this),W===void 0&&Z("small",{children:["No ",X," specified"]},void 0,!0,void 0,this),Z("ul",{children:U.map((A)=>Z("li",{children:[Z("code",{children:A.id},void 0,!1,void 0,this),Z(B0,{metadata:A.metadata},void 0,!1,void 0,this)]},A.id,!0,void 0,this))},void 0,!1,void 0,this)]},JSON.stringify([W]),!0,void 0,this))]},void 0,!0,void 0,this)}function A1(G){let $=G.metadata?.tubelessCache;if(!$||typeof $!=="object"||Array.isArray($)||!("implementationVersion"in $)||typeof $.implementationVersion!=="string"||!("createdAtMs"in $)||typeof $.createdAtMs!=="number"||!Number.isFinite($.createdAtMs)||!("ageMs"in $)||typeof $.ageMs!=="number"||!Number.isFinite($.ageMs))return;return{implementationVersion:$.implementationVersion,createdAtMs:$.createdAtMs,ageMs:$.ageMs}}function z2({artifacts:G,stepId:$}){let[K,X]=R("all"),Q=G.filter((W)=>A1(W.artifact)),z=Q.length>0&&Q.length<G.length;return Z(g,{children:[z&&Z("label",{class:"artifact-filter",children:["Artifacts for ",$," ",Z("select",{value:K,onChange:(W)=>X(W.currentTarget.value),children:[Z("option",{value:"all",children:"All artifacts"},void 0,!1,void 0,this),Z("option",{value:"cache",children:"Cached outputs"},void 0,!1,void 0,this),Z("option",{value:"application",children:"Application artifacts"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.map((W,U)=>{let A=A1(W.artifact);if(z&&(K==="cache"&&!A||K==="application"&&A))return null;let J=A?new Date(A.createdAtMs):void 0;return Z("details",{class:"artifact-detail",children:[Z("summary",{children:[A?"Cached output ":W.preview?"Preview ":"Artifact ",W.operation,!A&&`: ${W.artifact.id||W.artifact.uri}`]},void 0,!0,void 0,this),A&&Z("div",{class:"artifact-info",children:[Z("div",{children:["Created:"," ",J&&Number.isFinite(J.getTime())?J.toISOString():String(A.createdAtMs)]},void 0,!0,void 0,this),Z("div",{children:["Age at ",W.operation,": ",A.ageMs," ms"]},void 0,!0,void 0,this),W.artifact.uri&&Z("div",{children:["Location: ",W.artifact.uri]},void 0,!0,void 0,this),W.artifact.byteSize!==void 0&&Z("div",{children:["Size: ",W.artifact.byteSize," bytes"]},void 0,!0,void 0,this),Z("p",{class:"artifact-note",children:"Recorded operation; current cache availability is not checked."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A?Z("details",{class:"artifact-receipt",children:[Z("summary",{children:"Receipt metadata"},void 0,!1,void 0,this),Z("pre",{children:JSON.stringify(W.artifact,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z("pre",{children:JSON.stringify(W.artifact,null,2)},void 0,!1,void 0,this)]},U,!0,void 0,this)})]},void 0,!0,void 0,this)}function _0(G){if(Array.isArray(G))return G.map(_0);if(G!==null&&typeof G==="object")return Object.fromEntries(Object.entries(G).sort(([$],[K])=>$<K?-1:$>K?1:0).map(([$,K])=>[$,_0(K)]));return G}var Q2={dependencies:"Required edges",optionalDependencies:"Optional edges",skipAfterFailureOf:"Failure gates",dryRun:"Dry-run policy",runtimeSkipPossible:"Skip policy",outputValidated:"Output validation",cache:"Cache settings",nestedPipeline:"Child pipeline",remote:"Remote adapter"};function U2(G,$){let K=[],X=(W,U,A,J)=>{let H=JSON.stringify(U),M=JSON.stringify(A);if(H!==M)K.push({field:W,before:H,after:M,...J?{stepId:J}:{}})};X("Implementation version",G.identity.implementationVersion,$.identity.implementationVersion),X("Execution order",G.steps.map(({id:W})=>W),$.steps.map(({id:W})=>W)),X("Metadata",_0(G.metadata),_0($.metadata)),X("Targets",G.targetIds,$.targetIds),X("Required finalizer steps",G.requiredFinalizerStepIds,$.requiredFinalizerStepIds),X("Options validation",G.optionsValidated,$.optionsValidated),X("Result validation",G.resultValidated,$.resultValidated);let Q=new Map(G.steps.map((W)=>[W.id,W])),z=new Map($.steps.map((W)=>[W.id,W]));for(let W of G.steps)if(!z.has(W.id))K.push({stepId:W.id,field:"Removed step"});for(let W of $.steps){let U=Q.get(W.id);if(!U){K.push({stepId:W.id,field:"Added step"});continue}X("Metadata",_0(U.metadata),_0(W.metadata),W.id);for(let A of Object.keys(Q2)){let J=A;X(Q2[J],U[J],W[J],W.id)}}return K}function a(G){return JSON.stringify([G.pipelineId,G.identity?.definitionId??null])}function Y2(G){let $=G.identity;return`${G.pipelineId} · ${$?$.definitionId.slice(7,19):"Legacy (identity not recorded)"} · ${$?.implementationVersion??"implementation unknown"} · ${G.runCount} ${G.runCount===1?"run":"runs"}`}function J2({definitions:G,runs:$,onSelect:K}){let[X,Q]=R(""),[z,W]=R(""),U=G.find((Y)=>a(Y)===X)??G[0];if(!U)return null;let A=G.filter((Y)=>Y.pipelineId===U.pipelineId&&a(Y)!==a(U)),J=A.find((Y)=>a(Y)===z)??A[0],H=$.filter((Y)=>Y.pipelineId===U.pipelineId&&Y.definitionIdentity?.definitionId===U.identity?.definitionId),M=J?.snapshot&&U.snapshot?U2(J.snapshot,U.snapshot):void 0;return Z("section",{class:"sheet definition-history",children:[Z("div",{class:"sheet-head",children:Z("div",{children:[Z("div",{class:"sheet-title",children:"Observed definitions"},void 0,!1,void 0,this),Z("div",{class:"sheet-subtitle",children:"Graph fingerprints do not verify handler code. Implementation versions are supplied by the application."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Z("div",{class:"definition-body",children:[Z("label",{class:"field",children:["Definition"," ",Z("select",{"aria-label":"Definition",value:a(U),onChange:(Y)=>{Q(Y.currentTarget.value),W("")},children:G.map((Y)=>Z("option",{value:a(Y),children:Y2(Y)},a(Y),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U.identity&&Z("p",{class:"definition-identity",children:["Structural fingerprint: ",Z("code",{children:U.identity.structuralFingerprint},void 0,!1,void 0,this),Z("br",{},void 0,!1,void 0,this),"Definition ID: ",Z("code",{children:U.identity.definitionId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U.snapshot&&Z(g,{children:[Z(B0,{metadata:U.snapshot.metadata},void 0,!1,void 0,this),Z(d0,{steps:U.snapshot.steps},a(U),!1,void 0,this)]},void 0,!0,void 0,this),Z("details",{children:[Z("summary",{children:["Runs with this definition (",H.length,")"]},void 0,!0,void 0,this),Z("ul",{children:H.map((Y)=>Z("li",{children:Z("button",{type:"button",onClick:()=>K(Y.runId),children:[Y.status," · ",new Date(Y.startedAtMs).toLocaleString()," · ",Y.runId]},void 0,!0,void 0,this)},Y.runId,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J?Z(g,{children:[Z("label",{class:"field",children:["Compare from"," ",Z("select",{"aria-label":"Compare from",value:a(J),onChange:(Y)=>W(Y.currentTarget.value),children:A.map((Y)=>Z("option",{value:a(Y),children:Y2(Y)},a(Y),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("p",{class:"sheet-subtitle",children:"Changes from the comparison definition to the selected definition."},void 0,!1,void 0,this),M?M.length?Z("ul",{class:"definition-changes",children:M.map((Y,N)=>Z("li",{children:[Z("strong",{children:[Y.stepId?`${Y.stepId}: `:"",Y.field]},void 0,!0,void 0,this),(Y.before!==void 0||Y.after!==void 0)&&Z("div",{children:[Z("code",{children:Y.before??"not supplied"},void 0,!1,void 0,this)," →"," ",Z("code",{children:Y.after??"not supplied"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},N,!0,void 0,this))},void 0,!1,void 0,this):Z("p",{children:"No recorded semantic changes."},void 0,!1,void 0,this):Z("p",{children:"A complete comparison is unavailable: a legacy recording has no identity, or a definition snapshot exceeded recording limits."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z("p",{class:"sheet-subtitle",children:"Record another version of this pipeline to compare definitions."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var CG=Symbol("tubeless.wire-schema.type");function m(G,$,K={}){return{decode:$,jsonSchema:G,optionalInput:K.optionalInput??!1,optionalOutput:K.optionalOutput??!1}}function Z4(G,$){return G.length===0?$:`${G}.${$}`}function V(){return m({type:"boolean"},(G,$)=>{if(typeof G!=="boolean")throw Error(`${$} must be a boolean`);return G})}function M0(G={}){let $={type:G.integer?"integer":"number"};if(G.minimum!==void 0)$.minimum=G.minimum;return m($,(K,X)=>{if(typeof K!=="number"||!Number.isFinite(K))throw Error(`${X} must be a finite number`);if(G.integer&&(!Number.isSafeInteger(K)||K<(G.minimum??-1/0))){if(G.minimum===0)throw Error(`${X} must be a nonnegative safe integer`);throw Error(`${X} must be a safe integer`)}if(G.minimum!==void 0&&K<G.minimum)throw Error(`${X} must be at least ${G.minimum}`);return K})}function v(G={}){let $={type:"string"};if(G.allowEmpty!==!0)$.minLength=1;if(G.maxLength!==void 0)$.maxLength=G.maxLength;return m($,(K,X)=>{if(typeof K!=="string"||G.allowEmpty!==!0&&K.length===0)throw Error(G.allowEmpty===!0?`${X} must be a string`:`${X} must be a non-empty string`);if(G.maxLength!==void 0&&K.length>G.maxLength)throw Error(`${X} exceeds ${G.maxLength} code units`);return K})}function f(G,$){return m({const:G,type:typeof G},(K,X)=>{if(K!==G)throw Error($?.(X)??`${X} must be ${String(G)}`);return G})}function y(G,$=(K)=>`${K} is unsupported`){let K=new Set(G);return m({enum:G,type:"string"},(X,Q)=>{if(typeof X!=="string"||!K.has(X))throw Error($(Q));return X})}function _(G){return m(G.jsonSchema,($,K)=>$===void 0?void 0:G.decode($,K),{optionalInput:!0,optionalOutput:!0})}function H1(G,$){return m(G.jsonSchema,(K,X)=>K===void 0?$:G.decode(K,X),{optionalInput:!0})}function z0(G,$={}){let K={items:G.jsonSchema,type:"array"};if($.maxItems!==void 0)K.maxItems=$.maxItems;return m(K,(X,Q)=>{if(!Array.isArray(X)||$.maxItems!==void 0&&X.length>$.maxItems){let z=$.maxItems===void 0?"":` of at most ${$.maxItems}${$.noun?` ${$.noun}`:""}`;throw Error(`${Q} must be an array${z}`)}return X.map((z,W)=>G.decode(z,`${Q}[${W}]`))})}function F(G){let $=Object.entries(G).filter(([,X])=>!X.optionalOutput).map(([X])=>X),K=Object.fromEntries(Object.entries(G).map(([X,Q])=>[X,Q.jsonSchema]));return m({additionalProperties:!1,properties:K,...$.length>0?{required:$}:{},type:"object"},(X,Q)=>{if(X===null||typeof X!=="object"||Array.isArray(X))throw Error(`${Q} must be an object`);let z=X,W={};for(let[U,A]of Object.entries(G)){let J=A.decode(z[U],Z4(Q,U));if(J!==void 0)W[U]=J}return W})}function A2(G,$){return m({additionalProperties:G.jsonSchema,type:"object"},(K,X)=>{if(K===null||typeof K!=="object"||Array.isArray(K))throw Error(`${X} must be an object`);let Q={};for(let[z,W]of Object.entries(K))try{Q[z]=G.decode(W,`${X}.${z}`)}catch{throw Error($?.(X)??`${X} contains an unsupported value`)}return Q})}function T0(G,$){return m({oneOf:G.map((K)=>K.jsonSchema)},(K,X)=>{for(let Q of G)try{return Q.decode(K,X)}catch{}throw Error($?.(X)??`${X} is unsupported`)})}function t(G,$,K=G.jsonSchema){return m(K,(X,Q)=>{let z=G.decode(X,Q);return $(z,Q),z},{optionalInput:G.optionalInput,optionalOutput:G.optionalOutput})}function H2(G,$){return m(G.jsonSchema,(K,X)=>$(G.decode(K,X)),{optionalInput:G.optionalInput,optionalOutput:G.optionalOutput})}function e(G,$){return m(G,$)}function q1(G,$){return m({oneOf:Object.entries($).map(([K,X])=>({allOf:[X.jsonSchema,{properties:{[G]:{const:K,type:"string"}},required:[G],type:"object"}]}))},(K,X)=>{if(K===null||typeof K!=="object"||Array.isArray(K))throw Error(`${X} must be an object`);let Q=K[G];if(typeof Q!=="string"||!(Q in $))throw Error(`${G} is unsupported`);return $[Q].decode(K,X)})}var O0=16384,q2=new TextEncoder;function N1(G,$){let K=0,X=0,Q=(U)=>{if(U.length>O0)throw Error(`${$} exceeds ${O0} bytes`);if(X+=q2.encode(JSON.stringify(U)).byteLength,X>O0)throw Error(`${$} exceeds ${O0} bytes`)},z=(U,A)=>{if(++K>256||A>8)throw Error(`${$} exceeds metadata complexity limits`);if(U===null||typeof U==="boolean")return U;if(typeof U==="number"&&Number.isFinite(U))return U;if(typeof U==="string")return Q(U),U;if(typeof U!=="object"||U===null)throw Error(`${$} must be JSON-safe`);let J=Array.isArray(U),H=Object.getPrototypeOf(U);if(!J&&H!==Object.prototype&&H!==null)throw Error(`${$} must contain only plain JSON objects`);let M=Reflect.ownKeys(U);if(M.length>256)throw Error(`${$} exceeds metadata complexity limits`);let Y=[];for(let N of M){if(J&&N==="length")continue;if(typeof N!=="string")throw Error(`${$} must be JSON-safe`);let q=Object.getOwnPropertyDescriptor(U,N);if(!("value"in q)||!q.enumerable)throw Error(`${$} must contain only enumerable data properties`);Q(N),Y.push([N,z(q.value,A+1)])}if(J){if(Y.length!==U.length||Y.some(([N],q)=>N!==String(q)))throw Error(`${$} must contain only dense JSON arrays`);return Y.map(([,N])=>N)}return Object.fromEntries(Y)},W=z(G,0);if(q2.encode(JSON.stringify(W)).byteLength>O0)throw Error(`${$} exceeds ${O0} bytes`);return W}var P0=v({maxLength:4096}),N2=F({id:_(P0),uri:_(P0),mediaType:_(P0),checksum:_(P0),version:_(P0),byteSize:_(M0({integer:!0,minimum:0})),schemaVersion:_(P0),metadata:_(e({type:"object",additionalProperties:!0},(G,$)=>{if(!G||typeof G!=="object"||Array.isArray(G))throw Error(`${$} must be an object`);return G}))}),_1=e({...N2.jsonSchema,anyOf:[{required:["id"]},{required:["uri"]}]},(G,$)=>{let K=N1(G,$),X=N2.decode(K,$);if(!X.id&&!X.uri)throw Error(`${$} requires id or uri`);let Q=["id","uri","mediaType","checksum","version","byteSize","schemaVersion","metadata"];if(Object.keys(K).some((z)=>!Q.includes(z)))throw Error(`${$} has unknown fields; use metadata for application fields`);return X.id?{...X,id:X.id}:{...X,uri:X.uri}}),L1=y(["read","write","reuse"]),_2=F({operation:L1,artifact:_1});function L2(G){if(G!==null&&typeof G==="object"){for(let $ of Object.values(G))L2($);Object.freeze(G)}return G}var B1=e({type:"object",additionalProperties:!1,properties:{tags:{type:"array",maxItems:64,items:{type:"string",minLength:1,maxLength:256}},owner:{type:"string",minLength:1,maxLength:256},domain:{type:"string",minLength:1,maxLength:256},annotations:{type:"object",additionalProperties:!0}}},(G,$)=>{let K=N1(G,$);if(!K||typeof K!=="object"||Array.isArray(K))throw TypeError(`${$} must be an object`);let X=(Q)=>typeof Q==="string"&&Q.trim().length>0&&Q.length<=256;for(let[Q,z]of Object.entries(K))if(Q==="tags"){if(!Array.isArray(z)||z.length>64||!z.every(X))throw TypeError(`${$}.tags must contain at most 64 nonblank strings of at most 256 characters`)}else if(Q==="owner"||Q==="domain"){if(!X(z))throw TypeError(`${$}.${Q} must be a nonblank string of at most 256 characters`)}else if(Q==="annotations"){if(!z||typeof z!=="object"||Array.isArray(z))throw TypeError(`${$}.annotations must be an object`)}else throw TypeError(`${$}.${Q} is unknown; use annotations for application fields`);return L2(K)});var B2=3,K0=128,Q0=4096,M1=262144;var X4=["TUBELESS_CHILD_FAILED","TUBELESS_DEFINITION_CACHE_INVALID","TUBELESS_DEFINITION_DEPENDENCY_CONTRADICTORY","TUBELESS_DEFINITION_DEPENDENCY_CYCLE","TUBELESS_DEFINITION_DEPENDENCY_DUPLICATE","TUBELESS_DEFINITION_DEPENDENCY_NOT_IN_STEPS","TUBELESS_DEFINITION_DEPENDENCY_SELF_REFERENCE","TUBELESS_DEFINITION_FINALIZER_STEP_NOT_IN_STEPS","TUBELESS_DEFINITION_IMPLEMENTATION_VERSION_INVALID","TUBELESS_DEFINITION_OPTIONS_SCHEMA_CONFLICT","TUBELESS_DEFINITION_PIPELINE_DESCRIPTION_BLANK","TUBELESS_DEFINITION_PIPELINE_ID_BLANK","TUBELESS_DEFINITION_PIPELINE_NAME_BLANK","TUBELESS_DEFINITION_STEP_CACHE_INVALID","TUBELESS_DEFINITION_STEP_ID_BLANK","TUBELESS_DEFINITION_STEP_ID_RESERVED","TUBELESS_DEFINITION_STEP_IDS_DUPLICATE","TUBELESS_DEFINITION_STEP_NAME_BLANK","TUBELESS_DEFINITION_TARGET_FINALIZER_MISMATCH","TUBELESS_DEFINITION_TARGET_NOT_IN_STEPS","TUBELESS_DEFINITION_TARGETS_DUPLICATE","TUBELESS_FINALIZATION_CANCELLED","TUBELESS_FINALIZATION_FAILED","TUBELESS_FINAL_RESULT_VALIDATION_FAILED","TUBELESS_OPTIONS_VALIDATION_FAILED","TUBELESS_PLANNING_SELECTION_CONFLICT","TUBELESS_PLANNING_STEP_SELECTION_DUPLICATE","TUBELESS_PLANNING_STEP_SELECTION_EMPTY","TUBELESS_PLANNING_STEP_UNKNOWN","TUBELESS_PLANNING_TARGET_SELECTION_DUPLICATE","TUBELESS_PLANNING_TARGET_SELECTION_EMPTY","TUBELESS_PLANNING_TARGET_UNDECLARED","TUBELESS_PLANNING_TARGET_UNKNOWN","TUBELESS_RUN_CANCELLED","TUBELESS_RUN_CONCURRENCY_INVALID","TUBELESS_RUN_CACHE_INVALID","TUBELESS_STEP_OUTPUT_VALIDATION_FAILED","TUBELESS_STEP_FAILED"],W4=["cancellation","child","definition","finalization","selection","step","validation"],z4=["definition","execution","finalization","planning"],Q4=["cancelled","completed","failed"],U4=["dry-run","failed-dependency","fail-fast","filtered","policy","unmet-dependency"],Y4=["cancelled","completed","failed","pending","running","skipped"],E=v({allowEmpty:!0}),o=v(),F1=v({allowEmpty:!0,maxLength:Q0}),J0=M0({integer:!0,minimum:0}),c=M0(),p0=z0(o),J4=z0(o,{maxItems:K0,noun:"strings"});function w1(G,$,K,X){if(G===null||typeof G!=="object"||Array.isArray(G))throw Error(`${$} must be an object`);if(!X&&K>=16||X&&K>8)throw Error(X?"error.fanOut cause exceeds its depth limit":"error.cause exceeds 16 levels");let Q=G,z=(J)=>{let H=Q[J];if(H===void 0)return;if(typeof H!=="string")throw Error(`${$}.${J} must be a string`);return H},W={message:z("message")??""},U=z("name"),A=z("sourceCode");if(U!==void 0)W.name=U;if(A!==void 0)W.sourceCode=A;if(X&&[W.message,W.name,W.sourceCode].some((J)=>J!==void 0&&J.length>1024))throw Error("error.fanOut cause strings exceed 1024 code units");if(Q.cause!==void 0)W.cause=w1(Q.cause,$,K+1,X);return W}var O2={additionalProperties:!1,properties:{cause:{$ref:"#/components/schemas/PipelineErrorCause"},message:{type:"string"},name:{type:"string"},sourceCode:{type:"string"}},required:["message"],type:"object"},A4=e(O2,(G,$)=>w1(G,$,0,!1)),P2=e({$ref:"#/components/schemas/PipelineErrorCause"},(G,$)=>w1(G,$,0,!0)),H4=e({items:{oneOf:[{type:"number"},{type:"string",maxLength:Q0}]},maxItems:K0,type:"array"},(G,$)=>{if(!Array.isArray(G)||G.length>K0||!G.every((K)=>typeof K==="string"||typeof K==="number"&&Number.isFinite(K)))throw Error(`${$} must contain strings or finite numbers`);if(G.some((K)=>typeof K==="string"&&K.length>Q0))throw Error(`${$} string exceeds ${Q0} code units`);return G}),b1=F({message:v({maxLength:Q0}),path:_(H4)}),q4=e({items:b1.jsonSchema,maxItems:K0,type:"array"},(G,$)=>{if(!Array.isArray(G))throw Error(`${$} must be an array`);if(G.length>K0)throw Error(`${$} must contain at most ${K0} entries`);return G.map((K,X)=>b1.decode(K,`${$}[${X}]`))}),F2=F({cancelled:V(),error:P2,index:J0,key:v({allowEmpty:!0,maxLength:1024}),keyTruncated:V()}),b2=t(F({failureCount:J0,failures:z0(F2,{maxItems:32,noun:"entries"}),omittedFailureCount:J0,schedulerError:_(P2)}),(G)=>{if(G.failureCount-G.failures.length!==G.omittedFailureCount)throw Error("error.fanOut counts do not match failures");let $=-1;for(let K of G.failures){if(K.index<=$)throw Error("error.fanOut indices must be in input order");$=K.index}}),l0=F({cause:_(t(A4,()=>{return},{$ref:"#/components/schemas/PipelineErrorCause"})),code:y(X4),fanOut:_(t(b2,()=>{return},{$ref:"#/components/schemas/PipelineFanOutDiagnostics"})),issues:_(q4),kind:y(W4),message:H1(E,""),phase:y(z4),sourceCode:_(E),stack:_(E)}),o0=t(l0,()=>{return},{$ref:"#/components/schemas/PipelineError"}),k2=F({outputSource:_(y(["override","cache"])),completed:_(c),depth:_(c),id:v({maxLength:Q0}),label:_(F1),name:_(F1),status:_(y(Y4)),total:_(c)}),N4=t(z0(k2,{maxItems:K0,noun:"details"}),(G,$)=>{if(new TextEncoder().encode(JSON.stringify(G)).byteLength>M1)throw Error(`${$} exceeds the ${M1}-byte limit`)}),_4=H2(t(F({completed:c,detailCount:_(J0),details:_(N4),message:_(E),total:_(c)}),(G)=>{if(G.details!==void 0&&G.detailCount!==void 0&&G.detailCount<G.details.length)throw Error("payload.progress.detailCount must be at least the retained details length")}),(G)=>G.details!==void 0&&G.detailCount===void 0?{...G,detailCount:G.details.length}:G),T1=M0({integer:!0,minimum:1}),w2=["for-each","single","iterate"],L4=t(F({mode:y(w2),maxIterations:_(T1),pipelineId:o,stepCount:J0,stepIds:J4}),(G,$)=>{if(G.mode==="iterate"!==(G.maxIterations!==void 0))throw Error(`${$}: only iterate requires maxIterations`);if(G.stepCount<G.stepIds.length)throw Error(`${$}.stepCount must be at least the retained stepIds length`)}),T2=F({engine:v({maxLength:Q0}),target:_(F1)}),R0=t(F({version:T0([f(1),f(2),f(3)]),definitionId:v({maxLength:80}),structuralFingerprint:v({maxLength:80}),implementationVersion:_(v({maxLength:256}))}),(G,$)=>{if(![G.definitionId,G.structuralFingerprint].every((K)=>/^sha256:[a-f0-9]{64}$/.test(K)))throw Error(`${$} must contain SHA-256 fingerprints`);if(G.implementationVersion!==void 0&&G.implementationVersion.trim().length===0)throw Error(`${$}.implementationVersion must not be blank`)}),k1=v({maxLength:4096}),Y0=z0(k1,{maxItems:4096}),B4=F({cache:_(y(["use","recompute","bypass"])),dryRun:_(V()),continueOnError:_(V()),maxConcurrency:_(c),targets:_(Y0),stepIds:_(Y0)}),M4=F({metadata:_(B1),id:k1,dependencies:Y0,optionalDependencies:Y0,skipAfterFailureOf:Y0,dryRun:y(["custom","run","skip"]),runtimeSkipPossible:V(),outputValidated:V(),cache:_(F({version:v({maxLength:256}),maxAgeMs:_(c),policy:y(["use","recompute","bypass","dynamic"])})),nestedPipeline:_(F({pipelineId:k1,mode:y(w2),maxIterations:_(T1),controls:_(B4),identity:_(R0),stepIds:Y0,concurrency:_(T0([c,f("dynamic")]))})),remote:_(T2)}),C1=t(F({identity:R0,metadata:_(B1),steps:z0(M4,{maxItems:4096}),targetIds:Y0,requiredFinalizerStepIds:_(Y0),optionsValidated:V(),resultValidated:V()}),(G,$)=>{if(G.identity.version!==3&&(G.metadata!==void 0||G.steps.some((K)=>K.metadata!==void 0||K.nestedPipeline?.identity?.version===3)))throw Error(`${$}: metadata requires identity version 3`);for(let K of G.steps){let X=K.nestedPipeline;if(!X)continue;if(X.mode==="iterate"!==(X.maxIterations!==void 0)||X.controls!==void 0&&X.mode!=="iterate")throw Error(`${$}: invalid iteration metadata`);if(G.identity.version===1&&(X.mode==="iterate"||X.identity?.version===2))throw Error(`${$}: iteration requires identity version 2`)}if(new TextEncoder().encode(JSON.stringify(G)).byteLength>262144)throw Error(`${$} exceeds the 262144-byte definition limit`)}),i0=F({kind:y(["all","exact","not-selected","outside-target-closure"])}),O4=F({kind:f("target"),targetId:o}),O1=F({dependentId:o,kind:y(["failure-gate","optional-only","required-dependency"]),targetId:o}),P4=q1("kind",{all:i0,exact:i0,"failure-gate":O1,"not-selected":i0,"optional-only":O1,"outside-target-closure":i0,"required-dependency":O1,target:O4}),F4=z0(P4,{maxItems:K0,noun:"reasons"}),b4=A2(T0([V(),c,E]),(G)=>`${G} values must be booleans, finite numbers, or strings`),p={correlationId:_(E),itemKey:_(E),parentRunId:_(E),pipelineId:o,runId:o,timestampMs:c,version:T0([f(2),f(B2)]),iteration:_(F({runId:o,stepId:o,attemptId:o,index:T1}))},C0={attemptId:_(E),durationMs:_(c)},U0={stepId:o},P1=F({}),C2={"step.artifact":F({...p,...U0,attemptId:o,name:f("step.artifact"),payload:F({operation:L1,preview:V(),artifact:_1})}),"pipeline.completed":F({...p,durationMs:_(c),error:_(o0),name:f("pipeline.completed"),payload:F({dryRun:V(),errorCount:J0,finalized:V(),status:y(Q4,(G)=>`${G} must be cancelled, completed, or failed`),stepCount:J0})}),"pipeline.finalize.completed":F({...p,durationMs:c,name:f("pipeline.finalize.completed"),payload:P1}),"pipeline.finalize.failed":F({...p,durationMs:c,error:o0,name:f("pipeline.finalize.failed"),payload:P1}),"pipeline.finalize.started":F({...p,name:f("pipeline.finalize.started"),payload:P1}),"pipeline.log":F({...p,attemptId:_(E),name:f("pipeline.log"),payload:F({level:y(["error","log","warn"],(G)=>`${G} must be error, log, or warn`),message:H1(E,"")}),stepId:_(E)}),"pipeline.started":F({...p,name:f("pipeline.started"),payload:t(F({definitionIdentity:_(R0),definitionSnapshot:_(C1),dryRun:V(),planOk:V(),stepCount:J0,targetIds:p0}),(G)=>{if(G.definitionSnapshot&&JSON.stringify(G.definitionSnapshot.identity)!==JSON.stringify(G.definitionIdentity))throw Error("Definition snapshot must match the run definition identity")})}),"step.attempted":F({...p,...C0,...U0,name:f("step.attempted"),payload:F({attempt:c,attributes:b4})}),"step.cancelled":F({...p,...C0,...U0,error:o0,name:f("step.cancelled"),payload:F({status:f("cancelled"),outputSource:_(y(["override","cache"]))})}),"step.complete":F({...p,...C0,...U0,name:f("step.complete"),payload:F({status:f("completed"),outputSource:_(y(["override","cache"]))})}),"step.failed":F({...p,...C0,...U0,error:o0,name:f("step.failed"),payload:F({status:f("failed"),outputSource:_(y(["override","cache"]))})}),"step.planned":F({...p,...U0,name:f("step.planned"),payload:F({dependencies:p0,description:_(E),dryRun:y(["custom","run","skip"],(G)=>`${G} must be custom, run, or skip`),name:_(E),nestedPipeline:_(L4),optionalDependencies:p0,remote:_(T2),runtimeSkipPossible:V(),selected:V(),selectionReasons:F4,skipAfterFailureOf:p0})}),"step.running":F({...p,...U0,attemptId:o,name:f("step.running"),payload:F({progress:_(_4),outputSource:_(y(["override","cache"]))})}),"step.skipped":F({...p,...C0,...U0,name:f("step.skipped"),payload:F({dependencyId:_(E),message:_(E),reason:y(U4),status:f("skipped"),outputSource:_(y(["override","cache"]))})})},R2={if:{properties:{version:{const:2}},required:["version"]},then:{properties:{iteration:!1,payload:{properties:{definitionIdentity:{properties:{version:{const:1}}},nestedPipeline:{properties:{mode:{enum:["single","for-each"]},maxIterations:!1}}}}}}},M2=q1("name",C2),k4=t(M2,(G)=>{if(G.iteration!==void 0&&G.iteration.runId!==G.parentRunId)throw Error("iteration.runId must match parentRunId");if(G.version!==2)return;if(G.iteration!==void 0||G.name==="step.planned"&&G.payload.nestedPipeline?.mode==="iterate")throw Error("Iteration metadata requires trace version 3");if(G.name==="pipeline.started"&&G.payload.definitionIdentity!==void 0&&G.payload.definitionIdentity.version!==1)throw Error("Trace version 2 requires identity version 1")},{...M2.jsonSchema,...R2}),hG={PipelineError:l0.jsonSchema,PipelineErrorCause:O2,PipelineFanOutDiagnostics:b2.jsonSchema,PipelineFanOutFailure:F2.jsonSchema,PipelineProgressDetail:k2.jsonSchema,PipelineValidationIssue:b1.jsonSchema,StoredPipelineEvent:{oneOf:Object.values(C2).map((G)=>{let $=G.jsonSchema;return{...$,...R2,properties:{...$.properties,id:{minimum:0,type:"integer"}},required:[...$.required,"id"]}})}};function g2(G){return l0.decode(G,"error")}function R1(G){try{return R0.decode(G,"identity"),!0}catch{return!1}}function f2(G){try{return C1.decode(G,"snapshot"),!0}catch{return!1}}function S2(G){try{return g2(G),!0}catch{return!1}}function y2(G){try{return _2.decode(G,"artifact record"),!0}catch{return!1}}function I2(G){if(typeof G!=="object"||G===null)return!1;let $=G;if(typeof $.key!=="string"||$.key.length===0||typeof $.flag!=="string"||$.flag.length===0||typeof $.multiple!=="boolean"||typeof $.positional!=="boolean"||typeof $.required!=="boolean"||!["boolean","number","path","string"].includes(String($.type)))return!1;if($.choices!==void 0&&(!Array.isArray($.choices)||!$.choices.every((K)=>typeof K==="string")))return!1;if($.default!==void 0&&typeof $.default!==($.type==="boolean"?"boolean":$.type==="number"?"number":"string"))return!1;if($.group!==void 0&&$.group!=="execution")return!1;if($.exclusive!==void 0&&$.exclusive!==!0)return!1;return!0}function S(G){return typeof G==="object"&&G!==null&&!Array.isArray(G)}function j(G){return typeof G==="number"&&Number.isFinite(G)}function i(G){return G===void 0||typeof G==="string"}function Z0(G){return G===void 0||j(G)}function u0(G){return Array.isArray(G)&&G.every(($)=>typeof $==="string")}function w4(G){if(!S(G))return!1;return j(G.id)&&(G.level==="error"||G.level==="log"||G.level==="warn")&&typeof G.message==="string"&&j(G.timestampMs)&&i(G.attemptId)&&i(G.stepId)}function T4(G){if(!S(G))return!1;if(typeof G.id!=="string"||G.outputSource!==void 0&&G.outputSource!=="override"&&G.outputSource!=="cache"||!["cancelled","completed","failed","planned","running","skipped"].includes(String(G.status))||!i(G.description)||!i(G.name)||!Z0(G.durationMs)||!Z0(G.finishedAtMs)||!Z0(G.startedAtMs))return!1;if(G.attempt!==void 0){if(!S(G.attempt)||typeof G.attempt.attemptId!=="string"||!Z0(G.attempt.durationMs)||!Z0(G.attempt.finishedAtMs)||!Array.isArray(G.attempt.retries)||!G.attempt.retries.every(j)||!j(G.attempt.startedAtMs)||G.attempt.outputSource!==void 0&&G.attempt.outputSource!=="override"&&G.attempt.outputSource!=="cache"||!["cancelled","completed","failed","running","skipped"].includes(String(G.attempt.status)))return!1}if(G.artifacts!==void 0&&(!Array.isArray(G.artifacts)||!G.artifacts.every(($)=>S($)&&typeof $.attemptId==="string"&&j($.timestampMs)&&typeof $.preview==="boolean"&&y2($))))return!1;if(G.progress!==void 0){if(!S(G.progress)||!j(G.progress.completed))return!1;if(!Z0(G.progress.detailCount)||!i(G.progress.message)||!Z0(G.progress.total))return!1;if(G.progress.details!==void 0&&(!Array.isArray(G.progress.details)||!G.progress.details.every(($)=>S($)&&typeof $.id==="string"&&i($.label)&&i($.status)&&($.outputSource===void 0||$.outputSource==="override"||$.outputSource==="cache"))))return!1}if(G.nestedPipeline!==void 0){if(!S(G.nestedPipeline)||!["single","for-each","iterate"].includes(String(G.nestedPipeline.mode))||G.nestedPipeline.mode==="iterate"&&(!Number.isSafeInteger(G.nestedPipeline.maxIterations)||Number(G.nestedPipeline.maxIterations)<1)||typeof G.nestedPipeline.pipelineId!=="string"||!j(G.nestedPipeline.stepCount)||!u0(G.nestedPipeline.stepIds))return!1}if(G.remote!==void 0){if(!S(G.remote)||typeof G.remote.engine!=="string"||!i(G.remote.target))return!1}return!0}function D2(G){if(!S(G))return!1;return(G.definitionIdentity===void 0||R1(G.definitionIdentity))&&typeof G.dryRun==="boolean"&&j(G.eventCount)&&j(G.logCount)&&Array.isArray(G.logs)&&G.logs.every(w4)&&typeof G.pipelineId==="string"&&typeof G.runId==="string"&&j(G.startedAtMs)&&Z0(G.durationMs)&&Z0(G.finishedAtMs)&&["cancelled","completed","failed","running"].includes(String(G.status))&&Array.isArray(G.steps)&&G.steps.every(T4)&&j(G.version)&&i(G.correlationId)&&i(G.parentRunId)&&(G.iteration===void 0||S(G.iteration)&&typeof G.iteration.runId==="string"&&typeof G.iteration.stepId==="string"&&typeof G.iteration.attemptId==="string"&&Number.isSafeInteger(G.iteration.index)&&Number(G.iteration.index)>0)&&(G.error===void 0||S2(G.error))}function C4(G){if(!S(G))return!1;if(!j(G.activeRunCount)||!j(G.completedRunCount)||!Array.isArray(G.definitions)||!G.definitions.every(($)=>S($)&&typeof $.pipelineId==="string"&&j($.runCount)&&($.identity===void 0||R1($.identity))&&($.snapshot===void 0||f2($.snapshot)))||!j(G.failedRunCount)||!j(G.generatedAtMs)||!j(G.lastEventId)||!Array.isArray(G.runs)||!G.runs.every(D2)||G.liveRunIds!==void 0&&!u0(G.liveRunIds))return!1;return!0}function R4(G){return C4(G)?G:void 0}function g4(G){return S(G)&&typeof G.canPlan==="boolean"&&typeof G.id==="string"&&typeof G.name==="string"&&i(G.description)&&Array.isArray(G.parameters)&&G.parameters.every(I2)}function f4(G){if(!S(G)||!Array.isArray(G.commands)||!G.commands.every(g4))return;return G.commands}function S4(G){if(!S(G)||!S(G.plan))return!1;let $=G.plan;if(typeof $.dryRun!=="boolean"||!Array.isArray($.errors)||!$.errors.every((K)=>S(K)&&typeof K.message==="string")||typeof $.ok!=="boolean"||typeof $.pipelineId!=="string"||!Array.isArray($.steps))return!1;for(let K of $.steps){if(!S(K)||typeof K.id!=="string"||!u0(K.dependencies)||typeof K.selected!=="boolean"||!i(K.description)||!i(K.name))return!1;if(K.nestedPipeline!==void 0&&(!S(K.nestedPipeline)||!["single","for-each","iterate"].includes(String(K.nestedPipeline.mode))||K.nestedPipeline.mode==="iterate"&&(!Number.isSafeInteger(K.nestedPipeline.maxIterations)||Number(K.nestedPipeline.maxIterations)<1)||typeof K.nestedPipeline.pipelineId!=="string"||!u0(K.nestedPipeline.stepIds)))return!1;if(K.remote!==void 0&&(!S(K.remote)||typeof K.remote.engine!=="string"||!i(K.remote.target)))return!1}return!0}function y4(G){return S4(G)?G.plan:void 0}function A0(G,$){if(!S(G))return Error($);if(Array.isArray(G.errors)&&G.errors.every((K)=>typeof K==="string"))return Error(G.errors.join(`
|
|
2
|
+
`));return Error(typeof G.message==="string"?G.message:$)}async function H0(G){try{return await G.json()}catch{throw Error("Studio API returned invalid JSON.")}}function q0(G){return Error(`Studio API returned an invalid response for ${G}.`)}function j2(G=fetch){return{async loadSnapshot(){let $=await G("/api/snapshot",{cache:"no-store"}),K=await H0($);if(!$.ok)throw A0(K,"Snapshot request failed.");let X=R4(K);if(!X)throw q0("snapshot");return X},async loadRunDetail($){let K=await G("/api/runs/"+encodeURIComponent($),{cache:"no-store"}),X=await H0(K);if(K.status===404)return null;if(!K.ok)throw A0(X,"Run detail request failed.");if(!S(X)||!D2(X.run))throw q0("run detail");return{run:X.run}},async loadCommands(){let $=await G("/api/commands",{cache:"no-store"}),K=await H0($);if(!$.ok)throw A0(K,"Commands request failed.");let X=f4(K);if(!X)throw q0("commands");return X},async loadCapabilities(){let $=await G("/api/capabilities",{cache:"no-store"}),K=await H0($);if(!$.ok||!S(K)||typeof K.canCancel!=="boolean"||typeof K.canClearHistory!=="boolean"){if(!$.ok)throw A0(K,"Capabilities request failed.");throw q0("capabilities")}return{canCancel:K.canCancel,canClearHistory:K.canClearHistory}},async clearHistory(){let $=await G("/api/history",{method:"DELETE",headers:{"x-tubeless-studio-clear-history":"1"}}),K=await H0($);if(!$.ok)throw A0(K,"History could not be cleared.");if(!S(K)||K.cleared!==!0||!j(K.eventCount))throw q0("clear history");return{eventCount:K.eventCount}},async previewPlan($,K){let X=await G("/api/commands/"+encodeURIComponent($)+"/plan",{method:"POST",headers:{"content-type":"application/json","x-tubeless-studio-plan":"1"},body:JSON.stringify(K)}),Q=await H0(X);if(!X.ok)throw A0(Q,"Plan request failed.");let z=y4(Q);if(!z)throw q0("plan");return z},async cancelRun($){let K=await G("/api/runs/"+encodeURIComponent($)+"/cancel",{method:"POST",headers:{"x-tubeless-studio-cancel":"1"}}),X=await H0(K);if(!K.ok)throw A0(X,"Run could not be cancelled.");if(!S(X)||X.cancelled!==!0||X.runId!==$)throw q0("cancel run")},async launch($,K){let X=await G("/api/commands/"+encodeURIComponent($)+"/runs",{method:"POST",headers:{"content-type":"application/json","x-tubeless-studio-launch":"1"},body:JSON.stringify({values:K})}),Q=await H0(X);if(!X.ok)throw A0(Q,"Launch failed.");if(!S(Q)||Q.accepted!==!0||typeof Q.runId!=="string"||Q.runId.length===0)throw q0("launch");return Q.runId}}}function I4(G){return{...G,activeRunCount:0,completedRunCount:0,definitions:[],failedRunCount:0,lastEventId:0,liveRunIds:[],runs:[]}}class g1{#A;#_;#J=new Set;#X=null;#G;#K={fingerprint:null,runId:null};#W=0;#$=!1;#z;#H=!1;#U=0;#q=!1;#N=!1;#Z={connected:!0,detail:null,manualRefreshing:!1,snapshot:null};constructor(G,$=1200){this.#A=G,this.#_=$}getState(){return this.#Z}subscribe(G){return this.#J.add(G),()=>this.#J.delete(G)}refresh(G=!1){if(this.#$)return;if(G)this.#H=!0,this.#Q({manualRefreshing:!0});if(this.#q){if(G)this.#N=!0;return}this.#L()}invalidate({delayMs:G=0,resetHistory:$=!1}={}){if(this.#$)return;if(this.#U+=1,$)this.#O(),this.#Q({detail:null,snapshot:this.#Z.snapshot?I4(this.#Z.snapshot):null});else this.#P(G);if(this.#z)clearTimeout(this.#z);if(this.#z=void 0,G>0){this.#z=setTimeout(()=>{this.#z=void 0,this.refresh(!0)},G);return}this.refresh(!0)}selectRun(G,$){if(this.#$)return;if(this.#K.runId===G&&this.#K.fingerprint===$)return;if(this.#K.runId!==G||!$)this.#O(),this.#Q({detail:null});if(this.#K={fingerprint:$,runId:G},G&&$)this.#Y(this.#W)}dispose(){if(this.#$)return;if(this.#$=!0,this.#U+=1,this.#W+=1,this.#X=null,this.#G)clearTimeout(this.#G);if(this.#z)clearTimeout(this.#z);this.#G=void 0,this.#z=void 0,this.#J.clear()}#L(){if(this.#$)return;this.#q=!0;let G=this.#U;this.#H=!1,this.#A.loadSnapshot().then(($)=>{if(this.#$||G!==this.#U)return;this.#Q({connected:!0,snapshot:$})}).catch(()=>{if(this.#$||G!==this.#U)return;this.#Q({connected:!1})}).finally(()=>{if(this.#$)return;if(this.#q=!1,this.#N){this.#N=!1,this.#L();return}if(!this.#H)this.#Q({manualRefreshing:!1})})}#Y(G){let{fingerprint:$,runId:K}=this.#K;if(this.#$||this.#X!==null||this.#G!==void 0||!K||!$||G!==this.#W)return;let X={};this.#X=X,this.#A.loadRunDetail(K).then((Q)=>{if(!this.#B(X,G))return;if(this.#X=null,Q){if(this.#Q({detail:Q}),$!==this.#K.fingerprint)this.#Y(G);return}this.#M(G)}).catch(()=>{if(!this.#B(X,G))return;this.#X=null,this.#M(G)})}#B(G,$){return!this.#$&&this.#X===G&&this.#W===$}#M(G){if(this.#$||G!==this.#W)return;if(this.#G)clearTimeout(this.#G);this.#G=setTimeout(()=>{this.#G=void 0,this.#Y(G)},this.#_)}#P(G){if(this.#W+=1,this.#X=null,this.#G)clearTimeout(this.#G);this.#G=void 0,this.#Q({detail:null});let $=this.#W;if(!this.#K.runId||!this.#K.fingerprint)return;if(G>0){this.#G=setTimeout(()=>{this.#G=void 0,this.#Y($)},G);return}this.#Y($)}#O(){if(this.#W+=1,this.#X=null,this.#K={fingerprint:null,runId:null},this.#G)clearTimeout(this.#G);this.#G=void 0}#Q(G){let $={...this.#Z,...G};if($.connected===this.#Z.connected&&$.detail===this.#Z.detail&&$.manualRefreshing===this.#Z.manualRefreshing&&$.snapshot===this.#Z.snapshot)return;this.#Z=$;for(let K of this.#J)K($)}}var f1=[];function D4(G){let $=new Map,K=new Map,X=new Map;for(let q of G){if(!$.has(q.runId))$.set(q.runId,q);let P=q.parentRunId;if(!X.has(q.runId))X.set(q.runId,P)}let Q=new Set;for(let q of G){if(Q.has(q.runId))continue;let P=[],O=new Set,L=q.runId;while(L&&$.has(L)&&!Q.has(L)){if(O.has(L)){X.set(L,void 0);break}O.add(L),P.push(L),L=X.get(L)}for(let B of P)Q.add(B)}for(let q of G){let P=X.get(q.runId);if(!P)continue;let O=K.get(P);if(O)O.push(q);else K.set(P,[q])}for(let q of K.values())q.sort((P,O)=>O.startedAtMs-P.startedAtMs);let z=[],W=new Set;for(let q of G){let P=X.get(q.runId);if(P&&$.has(P))continue;z.push(q),W.add(q.runId)}let U=new Map;for(let q of G){if(U.has(q.runId))continue;let P=[],O=new Set,L=q.runId,B;while(L){if(U.has(L)){B=U.get(L);break}if(W.has(L)){B=L;break}if(O.has(L)){B=void 0;break}O.add(L),P.push(L);let k=X.get(L);if(!k||!$.has(k)){B=L;break}L=k}if(B!==void 0)U.set(B,B);for(let k of P)U.set(k,B)}let A=new Map,J=new Map;for(let q of G){if(A.has(q.runId))continue;let P=[{exiting:!1,id:q.runId}],O=new Set;while(P.length>0){let L=P.pop();if(!L)break;if(L.exiting){O.delete(L.id);let B=0,k=$.get(L.id)?.status==="running";for(let x of K.get(L.id)??f1){let h=A.get(x.runId);if(h===void 0)continue;B+=1+h,k=k||J.get(x.runId)===!0}A.set(L.id,B),J.set(L.id,k);continue}if(A.has(L.id)||O.has(L.id))continue;O.add(L.id),P.push({exiting:!0,id:L.id});for(let B of K.get(L.id)??f1)if(!A.has(B.runId)&&!O.has(B.runId))P.push({exiting:!1,id:B.runId})}}function H(q){return q==null?void 0:$.get(q)}function M(q){return K.get(q)??f1}function Y(q){let P=[],O=new Set,L=H(q);while(L){let B=X.get(L.runId);if(!B||O.has(B))break;O.add(B);let k=$.get(B);if(!k)break;P.unshift(k),L=k}return P}function N(q){let P=q.toLowerCase(),O=new Set;if(!P){for(let L of z)O.add(L.runId);return O}for(let L of G){if(!L.pipelineId.toLowerCase().includes(P)&&!L.runId.toLowerCase().includes(P)&&!L.correlationId?.toLowerCase().includes(P))continue;let B=U.get(L.runId);if(B)O.add(B)}return O}return{roots:z,ancestorsOf:Y,childrenOf:M,descendantCount(q){return A.get(q)??0},matchingRootIds:N,rootRunId(q){return q==null?q:U.get(q)??q},runById:H,subtreeIsRunning(q){return J.get(q)===!0}}}function j4(G){return G.parameters.map(($)=>{if($.type==="boolean")return[Boolean($.default)];if($.multiple)return $.choices?[]:[""];return $.default===void 0?[""]:[$.default]})}function V4(G,$){let K={};return G.parameters.forEach((X,Q)=>{let z=$(X,Q);if(X.type==="boolean"){let U=z[0];if(U!==Boolean(X.default))K[X.key]=U;return}if(X.multiple){K[X.key]=X.type==="number"?z.filter((U)=>typeof U==="number"):z.filter((U)=>typeof U==="string");return}let W=z[0];if(W!==""&&W!==void 0)K[X.key]=W}),K}function E4(G,$){let K={};return G.parameters.forEach((X,Q)=>{if(X.group!=="execution")return;let z=$(X,Q);if(X.type==="boolean"){if(z[0]===!0)K[X.key]=!0;return}if(X.multiple&&z.length)K[X.key]=z.filter((W)=>typeof W==="string")}),K}var r0=(G)=>G.length>24?G.slice(0,12)+"…"+G.slice(-7):G;function s0(G){return G==null?"—":G<1000?Math.max(0,Math.round(G))+" ms":G<60000?(G/1000).toFixed(G<1e4?1:0)+" s":Math.floor(G/60000)+"m "+Math.round(G%60000/1000)+"s"}function x4(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(G)}function V2(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(G)}function E2(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Date(G).toISOString()}function x2(G,$){let K=Math.max(0,$-G);if(K<60000)return Math.floor(K/1000)+"s ago";if(K<3600000)return Math.floor(K/60000)+"m ago";if(K<86400000)return Math.floor(K/3600000)+"h ago";return Math.floor(K/86400000)+"d ago"}function h4(G){return G==="completed"?"✓":G==="skipped"?"×":G==="cancelled"?"■":G==="failed"?"!":G==="planned"?"…":""}function t0({value:G,outputSource:$}){return Z("span",{class:`status ${G}`,children:[Z("i",{class:"status-mark","aria-hidden":"true",children:h4(G)},void 0,!1,void 0,this),G,$==="override"&&" (overridden)",$==="cache"&&" (cached)"]},void 0,!0,void 0,this)}function n0({copy:G,title:$}){return Z("div",{class:"empty",children:Z("div",{children:[Z("div",{class:"empty-icon",children:Z("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:Z("path",{d:"M4 5.5h12M4 10h12M4 14.5h8"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("strong",{children:$},void 0,!1,void 0,this),Z("p",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function a0({children:G,label:$,secondary:K,stepIds:X}){return Z("div",{class:"plan-nested",children:[Z("strong",{children:$},void 0,!1,void 0,this),K&&Z("span",{children:K},void 0,!1,void 0,this),X?.map((Q)=>Z("code",{children:Q},Q,!1,void 0,this)),G]},void 0,!0,void 0,this)}function S1(G){return G.description||"Run this typed pipeline command."}function m4(G){return G.key.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\b\w/g,($)=>$.toUpperCase())}function v4(G){let $=[];if(G.description)$.push(G.description);if(G.environment)$.push("Environment fallback: "+G.environment);if(G.multiple)$.push(G.choices?"Choose one or more values.":"Enter one value per line.");if(G.mustExist)$.push("Must be an existing "+(G.pathKind||"path")+".");return $.join(" ")}function c4({index:G,onChange:$,parameter:K,values:X}){let Q="run-param-"+G,z=v4(K),W=m4(K);if(K.type==="boolean")return Z("label",{class:"boolean-field",for:Q,children:[Z("span",{children:[Z("strong",{children:W},void 0,!1,void 0,this),Z("small",{children:z||"Enable this option."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("input",{id:Q,type:"checkbox",checked:X[0]===!0,onChange:(J)=>$(G,[J.currentTarget.checked])},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let U=Z("label",{for:Q,children:[W,K.required&&Z("span",{class:"required-mark",children:"required"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A;if(K.choices){let J=X.filter((H)=>typeof H==="string");A=Z("select",{id:Q,multiple:K.multiple,required:K.required,value:K.multiple?void 0:J[0]??"",onChange:(H)=>$(G,K.multiple?Array.from(H.currentTarget.selectedOptions,(M)=>M.value):[H.currentTarget.value]),children:[!K.multiple&&!K.required&&Z("option",{value:"",children:"Use default or leave unset"},void 0,!1,void 0,this),K.choices.map((H)=>Z("option",{value:H,selected:K.multiple?J.includes(H):void 0,children:H},H,!1,void 0,this))]},void 0,!0,void 0,this)}else if(K.multiple)A=Z("textarea",{id:Q,spellcheck:!1,placeholder:"One value per line",value:String(X[0]??""),onInput:(J)=>$(G,[J.currentTarget.value])},void 0,!1,void 0,this);else{let J=X[0]??"";A=Z("input",{id:Q,type:K.type==="number"?"number":"text",value:String(J),placeholder:K.type==="path"?K.pathKind==="directory"?"./directory":"./file":"",step:K.type==="number"?K.integer?"1":"any":void 0,min:K.type==="number"?K.min:void 0,max:K.type==="number"?K.max:void 0,required:K.required,onInput:(H)=>$(G,K.type==="number"&&H.currentTarget.value!==""?[Number(H.currentTarget.value)]:[H.currentTarget.value])},void 0,!1,void 0,this)}return Z("div",{class:"field",children:[U,A,z&&Z("div",{class:"field-hint",children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function d4({command:G,onChange:$,values:K}){let X=(z,W,U)=>{let A=G.parameters.map((J,H)=>({index:H,parameter:J})).filter(({parameter:J})=>J.group==="execution"===z);if(!A.length)return null;return Z("section",{class:"form-section",children:[Z("div",{class:"form-section-head",children:[Z("strong",{children:W},void 0,!1,void 0,this),Z("span",{children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"parameter-grid",children:A.map(({index:J,parameter:H})=>Z(c4,{index:J,onChange:$,parameter:H,values:K[J]??[]},H.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Q=G.parameters.filter((z)=>z.group!=="execution").length;return Z("div",{class:"parameter-fields",id:"parameterFields",children:[X(!1,"Pipeline inputs",Q+" parameter"+(Q===1?"":"s")),X(!0,"Execution controls","Built into Tubeless")]},void 0,!0,void 0,this)}function p4({commands:G,onConfigure:$}){if(!G.length)return Z("div",{class:"sheet",children:Z(n0,{title:"No pipelines found",copy:"Try a different pipeline name or description."},void 0,!1,void 0,this)},void 0,!1,void 0,this);return Z("section",{class:"sheet",children:[Z("div",{class:"sheet-head",children:[Z("div",{children:[Z("div",{class:"sheet-title",children:"Available pipelines"},void 0,!1,void 0,this),Z("div",{class:"sheet-subtitle",children:"Available in this Studio session"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{class:"sheet-subtitle",children:[G.length," shown"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"catalog",children:G.map((K)=>Z("article",{class:"catalog-card",children:[Z("h3",{children:K.name},void 0,!1,void 0,this),Z("p",{children:S1(K)},void 0,!1,void 0,this),Z("div",{class:"catalog-actions",children:Z("button",{class:"primary-button",onClick:()=>$(K.id),children:"Configure"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},K.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function o4({plan:G}){let $=G.steps.filter((K)=>K.selected&&!K.skipReason).length;return Z(g,{children:[G.errors.length>0&&Z("div",{class:"launch-error",children:G.errors.map((K)=>Z("div",{children:K.message},K.message,!1,void 0,this))},void 0,!1,void 0,this),Z("div",{class:"plan-summary",children:[Z("strong",{children:G.pipelineId},void 0,!1,void 0,this),Z("span",{children:[$," of ",G.steps.length," steps will run",G.dryRun?" · dry run":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(B0,{metadata:G.definition?.metadata},void 0,!1,void 0,this),Z(d0,{steps:G.steps},void 0,!1,void 0,this),Z("div",{class:"plan-steps",children:G.steps.map((K)=>{let X=!K.selected?"Not selected":K.skipReason==="dry-run"?"Dry-run skip":K.skipReason?"Skipped":"Will run",Q=K.description||(K.dependencies.length?"After "+K.dependencies.join(", "):"No required dependencies"),z=K.nestedPipeline,W=K.remote,U=W?"Remote step":z?z.mode==="iterate"?"Pipeline iteration":z.mode==="for-each"?"Pipeline fan-out":"Nested pipeline":"Step";return Z("div",{class:"plan-step",children:[Z("div",{class:"plan-step-title",children:[Z("strong",{children:K.name||K.id},void 0,!1,void 0,this),Z("span",{class:`plan-kind${z?" pipeline":""}`,children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("small",{children:Q},void 0,!1,void 0,this),Z(B0,{metadata:K.metadata},void 0,!1,void 0,this),Z("span",{class:`plan-disposition${X==="Will run"?"":" skipped"}`,children:X},void 0,!1,void 0,this),z&&Z(a0,{label:z.pipelineId,secondary:`${z.stepIds.length} declared steps${z.mode==="iterate"?` per iteration, at most ${z.maxIterations} iterations`:z.mode==="for-each"?" per runtime item":""}`,stepIds:z.stepIds},void 0,!1,void 0,this),W&&Z(a0,{label:W.engine,secondary:W.target},void 0,!1,void 0,this)]},K.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function i4({commandCount:G,snapshot:$}){let K=$.completedRunCount+$.failedRunCount,X=K?Math.round($.completedRunCount/K*100):0,Q=G||new Set($.definitions.map(({pipelineId:W})=>W)).size,z=[["Active now",$.activeRunCount,$.activeRunCount?"Live execution in progress":"No work in flight"],["Recorded runs",$.runs.length,"Append-only local history"],["Success rate",X+"%",K+" terminal runs"],["Pipelines",Q,G?"Available to configure":"Observed in run history"]];return Z(g,{children:z.map(([W,U,A])=>Z("article",{class:"metric",children:[Z("div",{class:"metric-label",children:W},void 0,!1,void 0,this),Z("div",{class:"metric-value",children:U},void 0,!1,void 0,this),Z("div",{class:"metric-note",children:A},void 0,!1,void 0,this)]},W,!0,void 0,this))},void 0,!1,void 0,this)}function l4({nowMs:G,onSelect:$,run:K,runIndex:X,selectedRunId:Q}){let z=K.steps.filter((A)=>A.status==="running"),W=z[0],U=X.descendantCount(K.runId);return Z("button",{class:`run-row ${K.status} ${X.rootRunId(Q)===K.runId?"selected":""}`,"data-run-id":K.runId,onClick:()=>$(K.runId),children:[Z("div",{class:"run-primary",children:[Z(t0,{value:K.status},void 0,!1,void 0,this),Z("strong",{children:K.pipelineId},void 0,!1,void 0,this),Z("time",{class:"run-time",datetime:E2(K.startedAtMs),title:V2(K.startedAtMs),children:x2(K.startedAtMs,G)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"run-secondary",children:[Z("code",{children:r0(K.runId)},void 0,!1,void 0,this),Z("i",{class:"dot"},void 0,!1,void 0,this),K.correlationId&&Z(g,{children:[Z("span",{children:["correlation ",K.correlationId]},void 0,!0,void 0,this),Z("i",{class:"dot"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{children:s0(K.durationMs)},void 0,!1,void 0,this),Z("i",{class:"dot"},void 0,!1,void 0,this),Z("span",{children:[K.steps.length," steps"]},void 0,!0,void 0,this),U>0&&Z(g,{children:[Z("i",{class:"dot"},void 0,!1,void 0,this),Z("span",{children:[U," nested run",U===1?"":"s"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K.dryRun&&Z(g,{children:[Z("i",{class:"dot"},void 0,!1,void 0,this),Z("span",{children:"dry run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K.status==="running"&&Z("div",{class:"run-activity",children:[Z("strong",{children:z.length>1?`${z.length} steps running`:W?.name||W?.id||"Starting"},void 0,!1,void 0,this),Z("span",{children:z.length>1?`${z.slice(0,3).map((A)=>A.name||A.id).join(", ")}${z.length>3?` +${z.length-3} more`:""}`:W?.progress?.message||"Execution in progress"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function u4({value:G}){let $=G.charAt(0).toUpperCase()+G.slice(1),K=G==="completed"?Z("svg",{viewBox:"0 0 12 12",children:Z("path",{d:"m2 6 2.4 2.4L10 3"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="running"?Z("i",{},void 0,!1,void 0,this):G==="skipped"?Z("svg",{viewBox:"0 0 12 12",children:Z("path",{d:"m3 3 6 6M9 3 3 9"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="cancelled"?Z("svg",{viewBox:"0 0 12 12",children:Z("rect",{x:"3",y:"3",width:"6",height:"6",rx:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="failed"?"!":"…";return Z("span",{class:`step-status-icon ${G}`,role:"img","aria-label":$,title:$,children:K},void 0,!1,void 0,this)}function r4({step:G}){let $=G.progress?.total,K=$?Math.max(0,Math.min(100,(G.progress?.completed??0)/$*100)):G.status==="completed"?100:18,X=G.nestedPipeline,Q=X?X.stepCount??X.stepIds.length:0,z=X&&X.stepIds.length<Q?X.stepIds.length+" of "+Q+" declared steps":Q+" declared steps",W=G.progress?.detailCount;return Z("article",{class:`step ${G.status}`,children:[Z(u4,{value:G.status},void 0,!1,void 0,this),Z("div",{class:"step-head",children:[Z("strong",{children:G.name||G.id},void 0,!1,void 0,this),G.outputSource&&Z(t0,{value:G.status,outputSource:G.outputSource},void 0,!1,void 0,this),G.name&&Z("code",{children:G.id},void 0,!1,void 0,this),Z("span",{class:"step-duration",children:s0(G.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G.description&&Z("div",{class:"step-description",children:G.description},void 0,!1,void 0,this),X&&Z(a0,{label:X.pipelineId,secondary:`${z}${X.mode==="iterate"?` per iteration, at most ${X.maxIterations} iterations`:X.mode==="for-each"?" per runtime item":""}`,stepIds:X.stepIds},void 0,!1,void 0,this),G.remote&&Z(a0,{label:G.remote.engine,secondary:G.remote.target},void 0,!1,void 0,this),G.attempt&&Z("div",{class:"execution",children:Z("span",{class:"execution-summary",title:G.attempt.attemptId,children:[Z("b",{children:G.attempt.outputSource==="override"?"Override validation":G.attempt.outputSource==="cache"?"Cache validation":"Execution"},void 0,!1,void 0,this)," ","· ",r0(G.attempt.attemptId),G.attempt.retries.length>0&&` · ${G.attempt.retries.length} retr${G.attempt.retries.length===1?"y":"ies"}`]},void 0,!0,void 0,this)},void 0,!1,void 0,this),G.artifacts&&Z(z2,{artifacts:G.artifacts,stepId:G.id},void 0,!1,void 0,this),G.progress&&Z(g,{children:[Z("div",{class:"progress",children:Z("i",{class:`w${Math.round(K)}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("div",{class:"progress-copy",children:G.progress.message||G.progress.completed+($?" / "+$:"")+" complete"},void 0,!1,void 0,this),G.progress.details&&G.progress.details.length>0&&Z("div",{class:"progress-details",children:[G.progress.details.map((U)=>Z("div",{class:`progress-detail ${U.status||"running"}`,children:[Z("b",{children:U.id},void 0,!1,void 0,this),U.label&&Z("span",{children:U.label},void 0,!1,void 0,this),U.outputSource==="override"&&Z("span",{children:"(overridden)"},void 0,!1,void 0,this),U.outputSource==="cache"&&Z("span",{children:"(cached)"},void 0,!1,void 0,this)]},U.id,!0,void 0,this)),W&&G.progress.details.length<W?Z("div",{class:"progress-detail-truncated",children:["Showing ",G.progress.details.length," of ",W," items"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function s4(G){return["running","failed","cancelled","skipped","completed","planned"].map((K)=>[K,G.steps.filter((X)=>X.status===K).length]).filter(([,K])=>K).map(([K,X])=>X+" "+K).join(" · ")||"No steps"}function t4({canCancel:G,cancelling:$,liveRunIds:K,nowMs:X,onCancel:Q,onSelect:z,run:W,runIndex:U}){if(!W)return Z("div",{class:"sheet detail",children:Z(n0,{title:"Select a run",copy:"Choose a run from the history to inspect its steps, retry telemetry, logs, and errors."},void 0,!1,void 0,this)},void 0,!1,void 0,this);let A=U.ancestorsOf(W.runId),J=U.childrenOf(W.runId);return Z("article",{class:"sheet detail",children:Z("div",{class:"detail-body",children:[A.length>0&&Z("div",{class:"run-parentage",children:[A.map((H)=>Z("span",{children:[Z("button",{type:"button",onClick:()=>z(H.runId),children:H.pipelineId},void 0,!1,void 0,this),Z("span",{children:" / "},void 0,!1,void 0,this)]},H.runId,!0,void 0,this)),Z("span",{children:W.pipelineId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"detail-heading",children:[Z("div",{class:"detail-heading-copy",children:[Z("div",{class:"detail-kicker",children:[W.parentRunId?"Nested run":"Top-level run"," ·"," ",x2(W.startedAtMs,X)]},void 0,!0,void 0,this),Z("h2",{children:W.pipelineId},void 0,!1,void 0,this),Z("p",{class:"definition-identity",children:["Definition:"," ",Z("code",{children:W.definitionIdentity?.definitionId??"Not recorded (legacy trace)"},void 0,!1,void 0,this),Z("br",{},void 0,!1,void 0,this),"Implementation: ",W.definitionIdentity?.implementationVersion??"Unknown"]},void 0,!0,void 0,this),Z("div",{class:"run-id",children:W.runId},void 0,!1,void 0,this),W.correlationId&&Z("div",{class:"run-id",children:["Correlation: ",W.correlationId]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"detail-heading-actions",children:[Z(t0,{value:W.status},void 0,!1,void 0,this),G&&W.status==="running"&&!W.parentRunId&&K.includes(W.runId)&&Z("button",{class:"danger-button",type:"button",disabled:$,onClick:()=>Q(W.runId),children:"Cancel run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"detail-meta",children:[Z("div",{children:[Z("label",{children:"Started"},void 0,!1,void 0,this),Z("span",{title:E2(W.startedAtMs),children:V2(W.startedAtMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{children:[Z("label",{children:"Duration"},void 0,!1,void 0,this),Z("span",{children:s0(W.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{children:[Z("label",{children:"Steps"},void 0,!1,void 0,this),Z("span",{children:W.steps.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{children:[Z("label",{children:"Events"},void 0,!1,void 0,this),Z("span",{children:W.eventCount},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),J.length>0&&Z(g,{children:[Z("div",{class:"section-title",children:[Z("span",{children:"Nested runs"},void 0,!1,void 0,this),Z("span",{children:[J.length," direct · ",U.descendantCount(W.runId)," total"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"nested-runs",children:J.map((H)=>{let M=U.descendantCount(H.runId);return Z("button",{class:"nested-run",type:"button",onClick:()=>z(H.runId),children:[Z(t0,{value:H.status},void 0,!1,void 0,this),Z("strong",{children:H.pipelineId},void 0,!1,void 0,this),Z("small",{children:[s0(H.durationMs)," · ",H.steps.length," steps",M?" · "+M+" nested":""]},void 0,!0,void 0,this)]},H.runId,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"section-title",children:[Z("span",{children:"Step timeline"},void 0,!1,void 0,this),Z("span",{children:s4(W)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.steps.length?Z("div",{class:"step-list",children:W.steps.map((H)=>Z(r4,{step:H},H.id,!1,void 0,this))},void 0,!1,void 0,this):Z(n0,{title:"No planned steps",copy:"This run ended before a step plan was recorded."},void 0,!1,void 0,this),W.error&&Z(g,{children:[Z("div",{class:"section-title",children:Z("span",{children:"Error"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("div",{class:"error-card",children:[Z("div",{class:"error-code",children:[W.error.code," · ",W.error.phase]},void 0,!0,void 0,this),Z("div",{class:"error-message",children:W.error.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W.logs.length>0&&Z(g,{children:[Z("div",{class:"section-title",children:[Z("span",{children:"Logs"},void 0,!1,void 0,this),Z("span",{children:W.logs.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"logs",children:W.logs.map((H)=>Z("div",{class:"log-line",children:[Z("time",{class:"log-time",children:x4(H.timestampMs)},void 0,!1,void 0,this),Z("span",{class:`log-level ${H.level}`,children:H.level},void 0,!1,void 0,this),Z("span",{class:"log-message",children:[H.stepId&&Z(g,{children:[Z("b",{children:H.stepId},void 0,!1,void 0,this)," ·"," "]},void 0,!0,void 0,this),H.message]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function n4(G){let $=G.roots.filter((Q)=>G.runIndex.subtreeIsRunning(Q.runId)),K=G.roots.filter((Q)=>!G.runIndex.subtreeIsRunning(Q.runId)),X=(Q,z)=>z.length?Z(g,{children:[Z("div",{class:"run-group",children:[Q," · ",z.length]},void 0,!0,void 0,this),z.map((W)=>Z(l4,{nowMs:G.nowMs,onSelect:G.onSelect,run:W,runIndex:G.runIndex,selectedRunId:G.selectedRunId},W.runId,!1,void 0,this))]},void 0,!0,void 0,this):null;return Z(g,{children:[Z(J2,{definitions:G.definitions??[],runs:G.runs??[],onSelect:G.onSelect},void 0,!1,void 0,this),Z("div",{class:"content-grid",children:[Z("section",{class:"sheet",children:[Z("div",{class:"sheet-head",children:[Z("div",{children:[Z("div",{class:"sheet-title",children:"Pipeline runs"},void 0,!1,void 0,this),Z("div",{class:"sheet-subtitle",children:"Top-level runs · nested work stays with its parent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{class:"sheet-subtitle",children:[G.roots.length," top-level · ",G.totalRunCount," total"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"run-list",children:G.roots.length?Z(g,{children:[X("Running now",$),X("Recent",K)]},void 0,!0,void 0,this):Z(n0,{title:"No recorded runs",copy:"Choose Pipelines to start a run and create local history."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(t4,{...G,run:G.selectedRun},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function e0(G){return G instanceof Error?G.message||String(G):String(G)}function a4({api:G,commands:$,commandId:K,onClose:X,onLaunched:Q}){let[z,W]=R(K??$[0]?.id??""),U=$.find((b)=>b.id===z),[A,J]=R([]),[H,M]=R(null),[Y,N]=R(""),[q,P]=R(!1),[O,L]=R(!1),B=w0(null),k=w0(0);if(s(()=>{W(K??$[0]?.id??"")},[K,$]),s(()=>{k.current+=1,J(U?j4(U):[]),M(null),N(""),requestAnimationFrame(()=>B.current?.querySelector("input, select, textarea")?.focus())},[U]),s(()=>{if(K===null)return;let b=(C)=>{if(C.key==="Escape"&&!q&&!O)X()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[K,q,X,O]),K===null)return null;let x=()=>{if(!q&&!O)X()},h=(b,C)=>{if(!U)return;k.current+=1,J((d)=>d.map((u,r)=>{if(r===b)return C;let F0=U.parameters[r];return U.parameters[b]?.exclusive&&U.parameters[b]?.multiple&&C.length>0&&F0?.exclusive&&F0.multiple?[]:u})),M(null)},n=(b,C)=>{let d=A[C]??[];if(!b.multiple||b.choices)return d;return String(d[0]??"").split(/\r?\n/).map((u)=>u.trim()).filter(Boolean).map((u)=>b.type==="number"?Number(u):u)},G0=async()=>{if(!U?.canPlan||O)return;let b=k.current;L(!0),N("");try{let C=await G.previewPlan(U.id,E4(U,n));if(k.current===b)M(C)}catch(C){if(k.current===b)N(e0(C))}finally{L(!1)}},X0=async(b)=>{if(b.preventDefault(),!U||q)return;P(!0),N("");try{Q(await G.launch(U.id,V4(U,n)))}catch(C){N(e0(C))}finally{P(!1)}};return Z("div",{class:"modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"launchTitle",onClick:(b)=>b.target===b.currentTarget&&x(),children:Z("div",{class:"modal",children:[Z("div",{class:"modal-head",children:[Z("div",{children:[Z("div",{class:"detail-kicker",children:"Configure pipeline"},void 0,!1,void 0,this),Z("h2",{id:"launchTitle",children:U?.name||"Run a pipeline"},void 0,!1,void 0,this),Z("p",{children:U?S1(U):"Choose a declared pipeline and provide its inputs."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("button",{class:"close-button",type:"button","aria-label":"Close",onClick:x,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("form",{class:"launch-form",onSubmit:X0,children:[Z("div",{class:"field",children:[Z("label",{for:"launchCommand",children:"Pipeline command"},void 0,!1,void 0,this),Z("select",{id:"launchCommand",value:z,onChange:(b)=>{k.current+=1,M(null),N(""),W(b.currentTarget.value)},children:$.map((b)=>Z("option",{value:b.id,children:b.name},b.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{ref:B,children:U&&Z(d4,{command:U,onChange:h,values:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),H&&Z("div",{class:"plan-result","aria-live":"polite",children:Z(o4,{plan:H},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&Z("div",{class:"launch-error",children:Y},void 0,!1,void 0,this),Z("div",{class:"modal-actions",children:[Z("button",{class:"secondary-button",type:"button",onClick:x,children:"Cancel"},void 0,!1,void 0,this),U?.canPlan&&Z("button",{class:"secondary-button",type:"button",disabled:O||q,onClick:()=>void G0(),children:O?"Planning…":"Preview plan"},void 0,!1,void 0,this),Z("button",{class:"primary-button",type:"submit",disabled:q||O,children:q?"Starting…":"Run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function e4({api:G,onCleared:$,onClose:K,snapshot:X}){let[Q,z]=R(!1),[W,U]=R(""),A=w0(null);s(()=>A.current?.focus(),[]),s(()=>{let N=(q)=>{if(q.key==="Escape"&&!Q)K()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[Q,K]);let J=X.runs.length,H=X.runs.reduce((N,q)=>N+q.eventCount,0),M=()=>{if(!Q)K()},Y=async()=>{if(Q)return;z(!0),U("");try{$((await G.clearHistory()).eventCount)}catch(N){U(e0(N))}finally{z(!1)}};return Z("div",{class:"modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"clearHistoryTitle",onClick:(N)=>N.target===N.currentTarget&&M(),children:Z("div",{class:"modal confirm-modal",children:[Z("div",{class:"modal-head",children:[Z("div",{children:[Z("div",{class:"detail-kicker",children:"Local maintenance"},void 0,!1,void 0,this),Z("h2",{id:"clearHistoryTitle",children:"Clear run history?"},void 0,!1,void 0,this),Z("p",{children:"This permanently resets the local studio history."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("button",{class:"close-button",type:"button","aria-label":"Close",onClick:M,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"confirm-body",children:[Z("p",{class:"confirm-copy",children:["Remove ",J," recorded run",J===1?"":"s"," and ",H," event",H===1?"":"s"," from this SQLite store.",X.activeRunCount?` ${X.activeRunCount} recorded run${X.activeRunCount===1?" is":"s are"} still marked active; continue only if no external process is writing to this store.`:""]},void 0,!0,void 0,this),Z("div",{class:"confirm-warning",children:"This cannot be undone. Pipeline definitions and execution remain unchanged; only recorded local events are removed."},void 0,!1,void 0,this),W&&Z("div",{class:"launch-error",children:W},void 0,!1,void 0,this),Z("div",{class:"confirm-actions",children:[Z("button",{class:"secondary-button",type:"button",onClick:M,children:"Cancel"},void 0,!1,void 0,this),Z("button",{ref:A,class:"danger-button",type:"button",disabled:Q,onClick:()=>void Y(),children:Q?"Clearing…":"Clear history"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var GG=j2();function $G(G){return{className:`pulse${G?"":" lost"}`,label:G?"Connected · local":"Connection lost"}}function KG(G,$,K,X){if(G&&G===$&&!X.runById(G))return G;if(!G||!K.some((Q)=>Q.runId===X.rootRunId(G)))return K[0]?.runId??null;return G}function ZG({api:G=GG}){let $=c0(()=>new g1(G),[G]),[K,X]=R(()=>$.getState()),{connected:Q,detail:z,manualRefreshing:W,snapshot:U}=K,[A,J]=R([]),[H,M]=R("runs"),[Y,N]=R(""),[q,P]=R(null),[O,L]=R(!1),[B,k]=R(!1),[x,h]=R(!1),[n,G0]=R(null),[X0,b]=R(!1),[C,d]=R(""),u=w0(null),r=c0(()=>D4(U?.runs??[]),[U]);s(()=>{return X($.getState()),$.subscribe(X)},[$]),s(()=>()=>$.dispose(),[$]),s(()=>{G.loadCommands().then((l)=>{if(J(l),l.length)M("pipelines")}).catch(()=>{}),G.loadCapabilities().then((l)=>{L(l.canCancel),k(l.canClearHistory)}).catch(()=>{}),$.refresh();let w=setInterval(()=>$.refresh(),1200);return()=>clearInterval(w)},[G,$]),s(()=>{if(!C)return;let w=setTimeout(()=>d(""),4200);return()=>clearTimeout(w)},[C]);let F0=Y?r.matchingRootIds(Y):null,G1=r.roots.filter((w)=>!F0||F0.has(w.runId)).sort((w,l)=>Number(r.subtreeIsRunning(l.runId))-Number(r.subtreeIsRunning(w.runId))||l.startedAtMs-w.startedAtMs);s(()=>{let w=u.current,l=KG(q,w,G1,r);if(w&&r.runById(w))u.current=null;if(l!==q)P(l)},[G1,r,q]);let g0=r.runById(q),y1=g0?[g0.runId,g0.eventCount,g0.status].join(":"):null;s(()=>{$.selectRun(q,y1)},[$,y1,q]);let f0=(w)=>d(w),m2=(w)=>{u.current=null,P(w)},v2=async(w)=>{if(!O||x)return;h(!0);try{await G.cancelRun(w),f0("Run cancelled · "+r0(w)),$.invalidate({delayMs:80})}catch(l){f0(e0(l))}finally{h(!1)}},c2=A.filter((w)=>!Y||w.name.toLowerCase().includes(Y.toLowerCase())||S1(w).toLowerCase().includes(Y.toLowerCase())),L0=H==="pipelines",d2=z?.run.runId===q?z.run:null,I1=$G(Q);return Z(g,{children:[Z("div",{class:"shell",children:[Z("aside",{class:"rail",children:[Z("div",{class:"brand",children:[Z("div",{class:"mark","aria-hidden":"true",children:Z("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[Z("path",{d:"M3 4.5h6a3 3 0 0 1 3 3v6",stroke:"#f7f8f3",strokeWidth:"1.5"},void 0,!1,void 0,this),Z("circle",{cx:"3",cy:"4.5",r:"2",fill:"#7396ff"},void 0,!1,void 0,this),Z("circle",{cx:"12",cy:"13.5",r:"2",fill:"#63d297"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Z("div",{class:"brand-copy",children:[Z("strong",{children:"Tubeless"},void 0,!1,void 0,this),Z("small",{children:"Local studio"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"rail-label",children:"Workspace"},void 0,!1,void 0,this),Z("nav",{class:"nav","aria-label":"Studio sections",children:[A.length>0&&Z("button",{class:L0?"active":"",type:"button",title:"Pipelines",onClick:()=>M("pipelines"),children:[Z("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[Z("path",{d:"M4 5h7M4 10h12M9 15h7"},void 0,!1,void 0,this),Z("circle",{cx:"14.5",cy:"5",r:"1.5"},void 0,!1,void 0,this),Z("circle",{cx:"5.5",cy:"15",r:"1.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{children:"Pipelines"},void 0,!1,void 0,this),Z("b",{class:"nav-count",children:A.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("button",{class:L0?"":"active",type:"button",title:"Runs",onClick:()=>M("runs"),children:[Z("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[Z("path",{d:"M10 3v4l2.5 1.5M17 10a7 7 0 1 1-2.05-4.95"},void 0,!1,void 0,this),Z("path",{d:"M14.5 2.8v3.5H18"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{children:"Runs"},void 0,!1,void 0,this),Z("b",{class:"nav-count",children:U?.runs.length??0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"rail-foot",children:[Z("div",{class:"connection",children:[Z("i",{class:I1.className},void 0,!1,void 0,this),Z("span",{children:I1.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"database",children:"append-only SQLite"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("main",{class:"workspace",children:[Z("header",{class:"topbar",children:[Z("div",{children:[Z("div",{class:"eyebrow",children:"Execution workspace"},void 0,!1,void 0,this),Z("h1",{children:L0?"Pipelines":"Runs"},void 0,!1,void 0,this),Z("p",{class:"lede",children:L0?"Choose a declared workflow to configure and run.":"Live work and durable history in one place."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"toolbar",children:[Z("input",{class:"search",type:"search",value:Y,placeholder:L0?"Filter pipelines":"Filter runs or IDs","aria-label":"Filter",onInput:(w)=>N(w.currentTarget.value.trim())},void 0,!1,void 0,this),A.length>0&&Z("button",{class:"primary-button",onClick:()=>G0(A[0]?.id??""),children:"Run pipeline"},void 0,!1,void 0,this),B&&Z("button",{class:"danger-button",id:"clearHistoryButton",type:"button",disabled:!U?.runs.length,title:U?.activeRunCount?"Clear history, including runs left active by an interrupted process":"Clear history",onClick:()=>b(!0),children:[Z("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",children:Z("path",{d:"M3 4.5h10M6 2.5h4M5 4.5l.5 9h5l.5-9M7 7v4M9 7v4"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("span",{children:"Clear history"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("button",{class:`icon-button${W?" spinning":""}`,type:"button",title:"Refresh now","aria-label":"Refresh now",onClick:()=>$.refresh(!0),children:Z("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[Z("path",{d:"M16.5 7A7 7 0 1 0 17 11"},void 0,!1,void 0,this),Z("path",{d:"M16.5 3v4h-4"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),U&&Z(g,{children:[Z("section",{class:"metrics",children:Z(i4,{commandCount:A.length,snapshot:U},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("section",{children:L0?Z(p4,{commands:c2,onConfigure:G0},void 0,!1,void 0,this):Z(n4,{definitions:U.definitions,runs:U.runs,canCancel:O,cancelling:x,liveRunIds:U.liveRunIds??[],nowMs:Date.now(),onCancel:(w)=>void v2(w),onSelect:m2,roots:G1,runIndex:r,selectedRun:d2,selectedRunId:q,totalRunCount:U.runs.length},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),n!==null&&Z(a4,{api:G,commands:A,commandId:n,onClose:()=>G0(null),onLaunched:(w)=>{u.current=w,P(w),M("runs"),N(""),G0(null),f0("Run accepted · "+r0(w)),$.invalidate({delayMs:80})}},void 0,!1,void 0,this),X0&&U&&Z(e4,{api:G,snapshot:U,onClose:()=>b(!1),onCleared:(w)=>{u.current=null,P(null),b(!1),f0("Cleared "+w+" recorded event"+(w===1?"":"s")),$.invalidate({resetHistory:!0})}},void 0,!1,void 0,this),C&&Z("div",{class:"toast",role:"status",children:C},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function h2(){let G=document.querySelector("#studio-root");if(!(G instanceof HTMLElement))throw Error("Missing #studio-root");r1(Z(ZG,{},void 0,!1,void 0,this),G)}h2();
|