@juicesharp/rpiv-workflow 2.13.8 → 2.13.9

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.
Files changed (111) hide show
  1. package/api.ts +4 -4
  2. package/audit-ctx.ts +4 -4
  3. package/audit-rows.ts +6 -6
  4. package/audit.ts +17 -17
  5. package/built-ins.ts +2 -2
  6. package/chain-state.ts +7 -7
  7. package/command-run.ts +12 -12
  8. package/command.ts +3 -3
  9. package/death-scene.ts +4 -4
  10. package/docs/embedding.md +1 -1
  11. package/events.ts +6 -6
  12. package/execution-host.ts +3 -3
  13. package/extension.ts +3 -3
  14. package/failure-memos.ts +3 -3
  15. package/index.ts +2 -2
  16. package/internal.ts +10 -10
  17. package/judge.ts +4 -4
  18. package/load/alias.ts +4 -4
  19. package/load/cache.ts +4 -4
  20. package/load/index.ts +19 -19
  21. package/load/issues.ts +2 -2
  22. package/load/legacy.ts +2 -2
  23. package/load/merge.ts +7 -7
  24. package/load/normalize.ts +2 -2
  25. package/load/resolve-default.ts +2 -2
  26. package/load/shape-guards.ts +1 -1
  27. package/load/skill-contract-phase.ts +4 -4
  28. package/loop-constructors.ts +6 -6
  29. package/loop-def.ts +3 -3
  30. package/loop-kinds.ts +10 -10
  31. package/loop-parallel.ts +9 -9
  32. package/loop-waves.ts +3 -3
  33. package/loop.ts +11 -11
  34. package/loops/constructors.ts +5 -5
  35. package/loops/derivations.ts +5 -5
  36. package/loops/introspection.ts +3 -3
  37. package/loops/panel.ts +4 -4
  38. package/loops/verify.ts +3 -3
  39. package/messages.ts +2 -2
  40. package/outcomes/collectors/directory-path.ts +4 -4
  41. package/outcomes/collectors/index.ts +7 -7
  42. package/outcomes/collectors/text-scan.ts +6 -6
  43. package/outcomes/collectors/tool-call.ts +5 -5
  44. package/outcomes/collectors/transcript-path.ts +5 -5
  45. package/outcomes/collectors/union.ts +4 -4
  46. package/outcomes/collectors/url.ts +5 -5
  47. package/outcomes/collectors/workspace-diff.ts +4 -4
  48. package/outcomes/git-commit.ts +4 -4
  49. package/outcomes/index.ts +4 -4
  50. package/outcomes/parsers/index.ts +1 -1
  51. package/outcomes/parsers/json-body.ts +3 -3
  52. package/outcomes/side-effect.ts +1 -1
  53. package/output-spec.ts +3 -3
  54. package/output.ts +1 -1
  55. package/package.json +2 -2
  56. package/preview.ts +5 -5
  57. package/registration.ts +24 -24
  58. package/routing-dsl.ts +3 -3
  59. package/routing.ts +2 -2
  60. package/runner/by-name.ts +4 -4
  61. package/runner/by-run-id.ts +6 -6
  62. package/runner/chain-advance.ts +10 -10
  63. package/runner/errors.ts +1 -1
  64. package/runner/failure.ts +5 -5
  65. package/runner/index.ts +6 -6
  66. package/runner/input-validation.ts +8 -8
  67. package/runner/preflight.ts +7 -7
  68. package/runner/resolve-stage.ts +4 -4
  69. package/runner/resume-entry.ts +9 -9
  70. package/runner/resume-loop.ts +9 -9
  71. package/runner/resume.ts +15 -15
  72. package/runner/run-context.ts +8 -8
  73. package/runner/run-stage.ts +26 -26
  74. package/runner/runner.ts +18 -18
  75. package/runner/script-stage.ts +12 -12
  76. package/schema-compat.ts +2 -2
  77. package/semaphore.ts +1 -1
  78. package/sessions/bash-strikes.ts +1 -1
  79. package/sessions/extraction.ts +16 -16
  80. package/sessions/halt-routing.ts +10 -10
  81. package/sessions/index.ts +3 -3
  82. package/sessions/locate.ts +3 -3
  83. package/sessions/reattach.ts +8 -8
  84. package/sessions/sessions.ts +9 -9
  85. package/sessions/spawn.ts +2 -2
  86. package/sessions/success-persist.ts +7 -7
  87. package/skill-contract.ts +3 -3
  88. package/skill-contracts/composition.ts +5 -5
  89. package/skill-contracts/extension-points.ts +3 -3
  90. package/skill-contracts/harvest.ts +6 -6
  91. package/skill-contracts/index.ts +6 -6
  92. package/skill-contracts/registry.ts +2 -2
  93. package/stage-def.ts +5 -5
  94. package/stage-errors.ts +1 -1
  95. package/stage-identity.ts +3 -3
  96. package/startup.ts +5 -5
  97. package/state/index.ts +2 -2
  98. package/state/names.ts +3 -3
  99. package/state/raw.ts +1 -1
  100. package/state/reads.ts +5 -5
  101. package/state/resolve.ts +3 -3
  102. package/state/state.ts +8 -8
  103. package/state/writes.ts +3 -3
  104. package/transcript.ts +1 -1
  105. package/typebox-adapter.ts +2 -2
  106. package/types.ts +11 -11
  107. package/validate/contract-compat.ts +8 -8
  108. package/validate/graph.ts +2 -2
  109. package/validate/stage-rules.ts +7 -7
  110. package/validate-output.ts +3 -3
  111. package/validate-workflow.ts +7 -7
package/api.ts CHANGED
@@ -25,7 +25,7 @@
25
25
  * READS_DATA / ROUTE_NOTE markers
26
26
  */
27
27
 
28
- export * from "./loop-def.js";
29
- export type { Outcome } from "./output-spec.js";
30
- export * from "./routing-dsl.js";
31
- export * from "./stage-def.js";
28
+ export * from "./loop-def.ts";
29
+ export type { Outcome } from "./output-spec.ts";
30
+ export * from "./routing-dsl.ts";
31
+ export * from "./stage-def.ts";
package/audit-ctx.ts CHANGED
@@ -5,16 +5,16 @@
5
5
  * runner + sessions has its own module, decoupled from the impure
6
6
  * terminal-outcome orchestration (`terminate`, the row writers, the notify
7
7
  * + lifecycle fires) that stayed behind in `audit.ts`. `audit.ts` re-exports
8
- * every symbol below, so existing `from "../audit.js"` import sites are
8
+ * every symbol below, so existing `from "../audit.ts"` import sites are
9
9
  * unchanged; new code imports directly from `audit-ctx.ts`.
10
10
  *
11
11
  * Depends on events (value: `skillStageRef`) + types + state (type-only).
12
12
  * Neither events nor the orchestrator imports back — one-way edges only.
13
13
  */
14
14
 
15
- import { skillStageRef } from "./events.js";
16
- import type { SessionRef } from "./state/index.js";
17
- import type { RunContext, SessionContext, UnitRef } from "./types.js";
15
+ import { skillStageRef } from "./events.ts";
16
+ import type { SessionRef } from "./state/index.ts";
17
+ import type { RunContext, SessionContext, UnitRef } from "./types.ts";
18
18
 
19
19
  /**
20
20
  * Minimal bookkeeping ctx. Structurally derived from `SessionContext` so any
package/audit-rows.ts CHANGED
@@ -9,12 +9,12 @@
9
9
  * + lifecycle events + `terminate`) lives in `audit.ts`.
10
10
  */
11
11
 
12
- import type { StageDef } from "./api.js";
13
- import { applyCompletedStage } from "./chain-state.js";
14
- import { nowIso } from "./internal-utils.js";
15
- import type { Output } from "./output.js";
16
- import { appendStage, type SessionRef, type WorkflowStage } from "./state/index.js";
17
- import type { RunState, UnitRef } from "./types.js";
12
+ import type { StageDef } from "./api.ts";
13
+ import { applyCompletedStage } from "./chain-state.ts";
14
+ import { nowIso } from "./internal-utils.ts";
15
+ import type { Output } from "./output.ts";
16
+ import { appendStage, type SessionRef, type WorkflowStage } from "./state/index.ts";
17
+ import type { RunState, UnitRef } from "./types.ts";
18
18
 
19
19
  /**
20
20
  * Advance the monotonic stage-number allocator and return the assigned
package/audit.ts CHANGED
@@ -16,13 +16,13 @@
16
16
  * `audit-rows.ts`.
17
17
  */
18
18
 
19
- import type { AuditContext } from "./audit-ctx.js";
20
- import { recordStage, unitRowFields } from "./audit-rows.js";
21
- import { writeDeathSceneArtifact } from "./death-scene.js";
22
- import { lifecycleCtxFromSession, scriptStageRef, skillStageRef } from "./events.js";
23
- import { appendFailureMemo } from "./failure-memos.js";
24
- import { handleToString } from "./handle.js";
25
- import { assertNever, nowIso } from "./internal-utils.js";
19
+ import type { AuditContext } from "./audit-ctx.ts";
20
+ import { recordStage, unitRowFields } from "./audit-rows.ts";
21
+ import { writeDeathSceneArtifact } from "./death-scene.ts";
22
+ import { lifecycleCtxFromSession, scriptStageRef, skillStageRef } from "./events.ts";
23
+ import { appendFailureMemo } from "./failure-memos.ts";
24
+ import { handleToString } from "./handle.ts";
25
+ import { assertNever, nowIso } from "./internal-utils.ts";
26
26
  import {
27
27
  abortedArgs,
28
28
  FAIL_AUDIT_WRITE,
@@ -36,23 +36,23 @@ import {
36
36
  MSG_PARTIAL_ARTIFACTS,
37
37
  MSG_STAGE_FAILED,
38
38
  MSG_WORKFLOW_CANCELLED,
39
- } from "./messages.js";
40
- import { listArtifacts } from "./state/index.js";
41
- import type { StopSignal } from "./transcript.js";
42
- import type { RunState, RunTermination, WorkflowHostContext } from "./types.js";
39
+ } from "./messages.ts";
40
+ import { listArtifacts } from "./state/index.ts";
41
+ import type { StopSignal } from "./transcript.ts";
42
+ import type { RunState, RunTermination, WorkflowHostContext } from "./types.ts";
43
43
 
44
44
  // Preserving barrel — the pre-split import surface is unchanged. Consumers
45
45
  // (`sessions/`, `runner/`, `loop-kinds`, `loop-parallel`, `internal.ts`,
46
46
  // `audit.test.ts`) keep importing `AuditContext`/`runIdentityOf`/`auditCtxFor`/
47
47
  // `currentStageRef`/`failedArgs`/`abortedArgs`/`FatalFailureArgs` from
48
- // "./audit.js" with no edit. Symbols now live in their post-split homes:
49
- export type { AuditContext } from "./audit-ctx.js";
50
- export { auditCtxFor, currentStageRef, runIdentityOf } from "./audit-ctx.js";
48
+ // "./audit.ts" with no edit. Symbols now live in their post-split homes:
49
+ export type { AuditContext } from "./audit-ctx.ts";
50
+ export { auditCtxFor, currentStageRef, runIdentityOf } from "./audit-ctx.ts";
51
51
  // Re-export the persistence half so existing audit-layer consumers keep one
52
52
  // import site; new code may import audit-rows.js directly.
53
- export { allocateStageNumber, decorateStage, recordStage, unitRowFields } from "./audit-rows.js";
54
- export type { FatalFailureArgs } from "./messages.js";
55
- export { abortedArgs, failedArgs } from "./messages.js";
53
+ export { allocateStageNumber, decorateStage, recordStage, unitRowFields } from "./audit-rows.ts";
54
+ export type { FatalFailureArgs } from "./messages.ts";
55
+ export { abortedArgs, failedArgs } from "./messages.ts";
56
56
 
57
57
  /**
58
58
  * `state.termination` mutator. Every terminal path — completion
package/built-ins.ts CHANGED
@@ -20,8 +20,8 @@
20
20
  * those copies. `globalThis[KEY]` is process-wide and survives the dup load.
21
21
  */
22
22
 
23
- import type { Workflow } from "./api.js";
24
- import { globalSlot, lazyProviderRegistry } from "./internal-utils.js";
23
+ import type { Workflow } from "./api.ts";
24
+ import { globalSlot, lazyProviderRegistry } from "./internal-utils.ts";
25
25
 
26
26
  const REGISTRY_KEY = Symbol.for("@juicesharp/rpiv-workflow:built-ins");
27
27
  const FAILURES_KEY = Symbol.for("@juicesharp/rpiv-workflow:built-in-provider-failures");
package/chain-state.ts CHANGED
@@ -11,18 +11,18 @@
11
11
  * `internal-utils.ts`; anything in this file is workflow-chain domain logic.
12
12
  */
13
13
 
14
- import type { PromptFn, StageDef } from "./api.js";
15
- import { type Artifact, handleToString } from "./handle.js";
16
- import { isFailedOutput, type Output } from "./output.js";
17
- import { readName, readsAll } from "./stage-def.js";
18
- import { actsPublishName, resolvePublishName } from "./stage-identity.js";
19
- import type { RunState } from "./types.js";
14
+ import type { PromptFn, StageDef } from "./api.ts";
15
+ import { type Artifact, handleToString } from "./handle.ts";
16
+ import { isFailedOutput, type Output } from "./output.ts";
17
+ import { readName, readsAll } from "./stage-def.ts";
18
+ import { actsPublishName, resolvePublishName } from "./stage-identity.ts";
19
+ import type { RunState } from "./types.ts";
20
20
 
21
21
  // Stage-identity projections live in the dependency-free `stage-identity.ts`
22
22
  // leaf so the load-time validators can consume them without importing this
23
23
  // runtime-state module. Re-exported here so this module's own runtime callers
24
24
  // (runner/*, registration) keep a single chain-state import.
25
- export { isDispatchingStage, resolvePublishName, resolveSkill } from "./stage-identity.js";
25
+ export { isDispatchingStage, resolvePublishName, resolveSkill } from "./stage-identity.ts";
26
26
 
27
27
  /**
28
28
  * Canonical accessor for "the primary artifact the chain is currently
package/command-run.ts CHANGED
@@ -4,12 +4,12 @@
4
4
  * `./command.ts`, so it evaluates lazily on first `/wf`, not at startup.
5
5
  */
6
6
 
7
- import { flushBuiltInProviders } from "./built-ins.js";
8
- import { parseArgs } from "./command.js";
9
- import type { WorkflowHost, WorkflowHostContext } from "./host.js";
10
- import { formatError } from "./internal-utils.js";
11
- import { renderConfigLayer } from "./layers.js";
12
- import { findWorkflow, type Issue, loadWorkflows } from "./load/index.js";
7
+ import { flushBuiltInProviders } from "./built-ins.ts";
8
+ import { parseArgs } from "./command.ts";
9
+ import type { WorkflowHost, WorkflowHostContext } from "./host.ts";
10
+ import { formatError } from "./internal-utils.ts";
11
+ import { renderConfigLayer } from "./layers.ts";
12
+ import { findWorkflow, type Issue, loadWorkflows } from "./load/index.ts";
13
13
  import {
14
14
  MSG_FLAG_REPEATED,
15
15
  MSG_INTERACTIVE_ONLY,
@@ -22,16 +22,16 @@ import {
22
22
  MSG_RESUME_USAGE,
23
23
  MSG_WORKFLOW_NOT_FOUND,
24
24
  MSG_WORKFLOW_THREW,
25
- } from "./messages.js";
26
- import { formatWorkflowDetails, formatWorkflowList } from "./preview.js";
27
- import { resumeWorkflowByRunId, runWorkflow } from "./runner/index.js";
25
+ } from "./messages.ts";
26
+ import { formatWorkflowDetails, formatWorkflowList } from "./preview.ts";
27
+ import { resumeWorkflowByRunId, runWorkflow } from "./runner/index.ts";
28
28
  // The warning thresholds come from the constants module DIRECTLY, not the
29
29
  // runner barrel: the handler suites mock the barrel wholesale (the float
30
30
  // boundary), and a barrel import would let those suites pin a stale 3/8 pair
31
31
  // while the real defaults drifted.
32
- import { MAX_BACKWARD_JUMPS, MAX_LAPS } from "./runner/run-context.js";
33
- import { flushSkillContractProviders } from "./skill-contracts/index.js";
34
- import { isValidName } from "./state/index.js";
32
+ import { MAX_BACKWARD_JUMPS, MAX_LAPS } from "./runner/run-context.ts";
33
+ import { flushSkillContractProviders } from "./skill-contracts/index.ts";
34
+ import { isValidName } from "./state/index.ts";
35
35
 
36
36
  // ---------------------------------------------------------------------------
37
37
  // Pre-warm
package/command.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * `parseArgs` stays here (pure, exported for tests).
15
15
  */
16
16
 
17
- import type { WorkflowHost, WorkflowHostContext, WorkflowLauncherContext } from "./host.js";
17
+ import type { WorkflowHost, WorkflowHostContext, WorkflowLauncherContext } from "./host.ts";
18
18
 
19
19
  /** Pi command registry — displayed by Pi's `/?` / command list. */
20
20
  export const CMD_DESCRIPTION = "Run a skill workflow: /wf [workflow] [description]";
@@ -36,7 +36,7 @@ export const PREWARM_DELAY_MS = 2000;
36
36
  // Public entry
37
37
  // ---------------------------------------------------------------------------
38
38
 
39
- type CommandRunModule = typeof import("./command-run.js");
39
+ type CommandRunModule = typeof import("./command-run.ts");
40
40
 
41
41
  export interface WfCommandHandler {
42
42
  (args: string, ctx: WorkflowLauncherContext): Promise<void>;
@@ -54,7 +54,7 @@ export interface WfCommandHandler {
54
54
  */
55
55
  export function makeWfHandler(
56
56
  host: WorkflowHost,
57
- importRun: () => Promise<CommandRunModule> = () => import("./command-run.js"),
57
+ importRun: () => Promise<CommandRunModule> = () => import("./command-run.ts"),
58
58
  ): WfCommandHandler {
59
59
  let memo: Promise<CommandRunModule> | undefined;
60
60
  let ready = false;
package/death-scene.ts CHANGED
@@ -25,10 +25,10 @@
25
25
 
26
26
  import { mkdirSync, writeFileSync } from "node:fs";
27
27
  import { dirname, join } from "node:path";
28
- import type { AuditContext } from "./audit-ctx.js";
29
- import type { WorkflowHostContext } from "./host.js";
30
- import { locateSessionFile } from "./sessions/locate.js";
31
- import { type BranchEntry, iterToolUses, lastAssistantText } from "./transcript.js";
28
+ import type { AuditContext } from "./audit-ctx.ts";
29
+ import type { WorkflowHostContext } from "./host.ts";
30
+ import { locateSessionFile } from "./sessions/locate.ts";
31
+ import { type BranchEntry, iterToolUses, lastAssistantText } from "./transcript.ts";
32
32
 
33
33
  /** How many trailing tool calls the artifact carries (most-recent first wins via slice). */
34
34
  export const DEATH_SCENE_MAX_TOOL_CALLS = 5;
package/docs/embedding.md CHANGED
@@ -37,7 +37,7 @@ runtime re-exports.
37
37
 
38
38
  The package's public type surface names **zero** `@earendil-works/pi-coding-agent`
39
39
  types, and imports no value from it. Every host capability the runtime needs is a
40
- workflow-owned port declared in `./host.js`:
40
+ workflow-owned port declared in `./host.ts`:
41
41
 
42
42
  | Port | What it is | Members the runtime touches |
43
43
  | --- | --- | --- |
package/events.ts CHANGED
@@ -26,12 +26,12 @@
26
26
  * caller through the existing path.
27
27
  */
28
28
 
29
- import type { CapPolicy, Unit, UnitRole } from "./api.js";
30
- import { formatError, globalSlot } from "./internal-utils.js";
31
- import { MSG_LIFECYCLE_THREW } from "./messages.js";
32
- import type { Output, RunView } from "./output.js";
33
- import type { RunTrigger } from "./triggers.js";
34
- import type { RunWorkflowResult } from "./types.js";
29
+ import type { CapPolicy, Unit, UnitRole } from "./api.ts";
30
+ import { formatError, globalSlot } from "./internal-utils.ts";
31
+ import { MSG_LIFECYCLE_THREW } from "./messages.ts";
32
+ import type { Output, RunView } from "./output.ts";
33
+ import type { RunTrigger } from "./triggers.ts";
34
+ import type { RunWorkflowResult } from "./types.ts";
35
35
 
36
36
  /**
37
37
  * Run-scoped context shared by every lifecycle callback. Mirrors the
package/execution-host.ts CHANGED
@@ -6,9 +6,9 @@
6
6
  * back to the live session). Absent provider ⇒ the live ctx executes directly
7
7
  * (graceful degrade for non-Pi embedders / tests).
8
8
  */
9
- import type { ModelSelection, WorkflowHostContext } from "./host.js";
10
- import { globalSlot } from "./internal-utils.js";
11
- import type { BranchEntry } from "./transcript.js";
9
+ import type { ModelSelection, WorkflowHostContext } from "./host.ts";
10
+ import { globalSlot } from "./internal-utils.ts";
11
+ import type { BranchEntry } from "./transcript.ts";
12
12
 
13
13
  /** What the provider hands back per run: the detached executor, an optional
14
14
  * cancellation `signal` (rpiv-pi wires it from `ctx.ui.onTerminalInput`),
package/extension.ts CHANGED
@@ -5,9 +5,9 @@
5
5
  * (`/wf` registration is itself lazy); the barrel stays the embedder API surface.
6
6
  */
7
7
 
8
- import { registerWorkflowCommand } from "./command.js";
9
- import { type DocsProtocolHost, registerDocsProtocol } from "./docs-protocol.js";
10
- import type { WorkflowHost } from "./host.js";
8
+ import { registerWorkflowCommand } from "./command.ts";
9
+ import { type DocsProtocolHost, registerDocsProtocol } from "./docs-protocol.ts";
10
+ import type { WorkflowHost } from "./host.ts";
11
11
 
12
12
  /** Host ports the `default` needs; Pi's `ExtensionAPI` structurally satisfies both. */
13
13
  type ExtensionHost = WorkflowHost & DocsProtocolHost;
package/failure-memos.ts CHANGED
@@ -13,9 +13,9 @@
13
13
  * No back-edges — the value-import DAG stays acyclic.
14
14
  */
15
15
 
16
- import type { AuditContext } from "./audit-ctx.js";
17
- import { nowIso } from "./internal-utils.js";
18
- import type { FailureMemo, RunState } from "./types.js";
16
+ import type { AuditContext } from "./audit-ctx.ts";
17
+ import { nowIso } from "./internal-utils.ts";
18
+ import type { FailureMemo, RunState } from "./types.ts";
19
19
 
20
20
  /**
21
21
  * Maximum number of memos retained on `RunState.failureMemos`. The array is
package/index.ts CHANGED
@@ -73,7 +73,7 @@
73
73
  // Runner-free surface (DSL, registrars, loader, outcomes, …) lives in
74
74
  // `./registration.js`; startup-time siblings import that to skip the ~530ms
75
75
  // engine. This entry layers the runner on top for embedders.
76
- export * from "./registration.js";
76
+ export * from "./registration.ts";
77
77
 
78
78
  // The execution engine — the only re-export unique to this entry. The budget
79
79
  // defaults and `validateRunBudgets` ride along: the runner refuses a malformed
@@ -94,7 +94,7 @@ export {
94
94
  runWorkflow,
95
95
  runWorkflowByName,
96
96
  validateRunBudgets,
97
- } from "./runner/index.js";
97
+ } from "./runner/index.ts";
98
98
 
99
99
  // NOTE: the Pi extension `default` entry is `./extension.ts`, not this barrel,
100
100
  // so loading the extension doesn't evaluate the runtime re-exports above.
package/internal.ts CHANGED
@@ -30,16 +30,16 @@
30
30
  * in a follow-up minor, not the pre-release window.
31
31
  */
32
32
 
33
- export { recordStage } from "./audit.js";
34
- export { __resetBuiltIns, flushBuiltInProviders, getBuiltIns } from "./built-ins.js";
35
- export { __resetLifecycleRegistry } from "./events.js";
36
- export { __resetWorkflowExecutionHost } from "./execution-host.js";
37
- export { __resetLoadCache } from "./load/cache.js";
33
+ export { recordStage } from "./audit.ts";
34
+ export { __resetBuiltIns, flushBuiltInProviders, getBuiltIns } from "./built-ins.ts";
35
+ export { __resetLifecycleRegistry } from "./events.ts";
36
+ export { __resetWorkflowExecutionHost } from "./execution-host.ts";
37
+ export { __resetLoadCache } from "./load/cache.ts";
38
38
  // Read-and-clear a gate's stop-pick note — test fixtures assert the reason a
39
39
  // bespoke `defineRoute` gate attached via `setRouteNote`; production consumption
40
40
  // stays inside the runner's routing audit.
41
- export { takeRouteNote } from "./routing-dsl.js";
42
- export { __resetStrikeBudgets } from "./sessions/bash-strikes.js";
41
+ export { takeRouteNote } from "./routing-dsl.ts";
42
+ export { __resetStrikeBudgets } from "./sessions/bash-strikes.ts";
43
43
  export {
44
44
  __resetSkillContracts,
45
45
  buildEffectiveContracts,
@@ -51,10 +51,10 @@ export {
51
51
  getSkillContracts,
52
52
  harvestStageContracts,
53
53
  registerBucketKindMapping,
54
- } from "./skill-contracts/index.js";
54
+ } from "./skill-contracts/index.ts";
55
55
  // Layout-coupled path helpers — test fixtures that WRITE synthetic run files
56
56
  // need them; production consumers use the opaque `runFileFor` instead.
57
- export { runsDir, stateFilePath } from "./state/index.js";
57
+ export { runsDir, stateFilePath } from "./state/index.ts";
58
58
  // Type-only: lets external test fixtures construct the full mutable run state
59
59
  // for direct `recordStage` calls. Production consumers read `RunView` instead.
60
- export type { RunState } from "./types.js";
60
+ export type { RunState } from "./types.ts";
package/judge.ts CHANGED
@@ -21,10 +21,10 @@
21
21
  * surface (siblings register built-ins without dragging the runner in).
22
22
  */
23
23
 
24
- import type { Artifact } from "./handle.js";
25
- import { markSymbol, readSymbol } from "./internal-utils.js";
26
- import type { Output, RunView } from "./output.js";
27
- import type { Outcome } from "./output-spec.js";
24
+ import type { Artifact } from "./handle.ts";
25
+ import { markSymbol, readSymbol } from "./internal-utils.ts";
26
+ import type { Output, RunView } from "./output.ts";
27
+ import type { Outcome } from "./output-spec.ts";
28
28
 
29
29
  export interface JudgeContext {
30
30
  cwd: string;
package/load/alias.ts CHANGED
@@ -20,14 +20,14 @@
20
20
  * slot) is never mutated in place; a changed workflow is a new frozen copy.
21
21
  */
22
22
 
23
- import type { Workflow } from "../api.js";
24
- import { isDispatchingStage, resolveSkill } from "../stage-identity.js";
25
- import type { LayerOutcome, LoadAccumulator } from "./merge.js";
23
+ import type { Workflow } from "../api.ts";
24
+ import { isDispatchingStage, resolveSkill } from "../stage-identity.ts";
25
+ import type { LayerOutcome, LoadAccumulator } from "./merge.ts";
26
26
 
27
27
  // `isDispatchingStage` lives beside `resolveSkill` in chain-state.ts (the
28
28
  // validator and harvest consume it without reaching into load/); re-exported
29
29
  // here for existing consumers.
30
- export { isDispatchingStage } from "../stage-identity.js";
30
+ export { isDispatchingStage } from "../stage-identity.ts";
31
31
 
32
32
  export function aliasSkills(w: Workflow, aliases: Record<string, string>): Workflow {
33
33
  if (!aliases || Object.keys(aliases).length === 0) return w;
package/load/cache.ts CHANGED
@@ -42,10 +42,10 @@ type Jiti = ReturnType<typeof createJiti>;
42
42
  */
43
43
  async function overlayVirtualModules(): Promise<Record<string, unknown>> {
44
44
  const [root, registration, startup, runner] = await Promise.all([
45
- import("../index.js"),
46
- import("../registration.js"),
47
- import("../startup.js"),
48
- import("../runner/index.js"),
45
+ import("../index.ts"),
46
+ import("../registration.ts"),
47
+ import("../startup.ts"),
48
+ import("../runner/index.ts"),
49
49
  ]);
50
50
  const modules: Record<string, unknown> = {
51
51
  "@juicesharp/rpiv-workflow": root,
package/load/index.ts CHANGED
@@ -53,30 +53,30 @@
53
53
  * ./cache.ts — mtime-keyed jiti import cache + __resetLoadCache
54
54
  */
55
55
 
56
- import type { Workflow } from "../api.js";
57
- import { drainBuiltInProviderErrors, flushBuiltInProviders, getBuiltIns } from "../built-ins.js";
58
- import { formatError } from "../internal-utils.js";
59
- import type { ConfigLayer } from "../layers.js";
60
- import type { SkillContractMap } from "../skill-contract.js";
61
- import { validateWorkflow } from "../validate-workflow.js";
62
- import { applySkillAliases } from "./alias.js";
63
- import type { Issue } from "./issues.js";
64
- import { pushLegacyNotices } from "./legacy.js";
65
- import { type LoadAccumulator, loadLayer } from "./merge.js";
66
- import { projectOverlayPaths, userOverlayPaths } from "./paths.js";
67
- import { resolveDefault } from "./resolve-default.js";
68
- import { applySkillContractPhase } from "./skill-contract-phase.js";
56
+ import type { Workflow } from "../api.ts";
57
+ import { drainBuiltInProviderErrors, flushBuiltInProviders, getBuiltIns } from "../built-ins.ts";
58
+ import { formatError } from "../internal-utils.ts";
59
+ import type { ConfigLayer } from "../layers.ts";
60
+ import type { SkillContractMap } from "../skill-contract.ts";
61
+ import { validateWorkflow } from "../validate-workflow.ts";
62
+ import { applySkillAliases } from "./alias.ts";
63
+ import type { Issue } from "./issues.ts";
64
+ import { pushLegacyNotices } from "./legacy.ts";
65
+ import { type LoadAccumulator, loadLayer } from "./merge.ts";
66
+ import { projectOverlayPaths, userOverlayPaths } from "./paths.ts";
67
+ import { resolveDefault } from "./resolve-default.ts";
68
+ import { applySkillContractPhase } from "./skill-contract-phase.ts";
69
69
 
70
70
  // ===========================================================================
71
71
  // Public types
72
72
  // ===========================================================================
73
73
 
74
- export type { ConfigLayer } from "../layers.js";
75
- export { aliasSkills } from "./alias.js";
76
- export { __resetLoadCache } from "./cache.js";
77
- export type { Issue, LoadIssue, LoadIssueOrigin } from "./issues.js";
78
- export type { OverlayPaths } from "./paths.js";
79
- export { projectOverlayPaths, userOverlayPaths } from "./paths.js";
74
+ export type { ConfigLayer } from "../layers.ts";
75
+ export { aliasSkills } from "./alias.ts";
76
+ export { __resetLoadCache } from "./cache.ts";
77
+ export type { Issue, LoadIssue, LoadIssueOrigin } from "./issues.ts";
78
+ export type { OverlayPaths } from "./paths.ts";
79
+ export { projectOverlayPaths, userOverlayPaths } from "./paths.ts";
80
80
 
81
81
  export interface LoadedWorkflows {
82
82
  workflows: readonly Workflow[];
package/load/issues.ts CHANGED
@@ -9,8 +9,8 @@
9
9
  * issue with the layer/path of the file the surviving workflow came from.
10
10
  */
11
11
 
12
- import type { ConfigLayer } from "../layers.js";
13
- import type { WorkflowValidationIssue } from "../validate/issue.js";
12
+ import type { ConfigLayer } from "../layers.ts";
13
+ import type { WorkflowValidationIssue } from "../validate/issue.ts";
14
14
 
15
15
  /**
16
16
  * Where a load issue originated: one of the config layers, or `"framework"`
package/load/legacy.ts CHANGED
@@ -11,8 +11,8 @@
11
11
 
12
12
  import { existsSync, readdirSync } from "node:fs";
13
13
  import { dirname, join } from "node:path";
14
- import type { LoadAccumulator } from "./merge.js";
15
- import type { OverlayPaths } from "./paths.js";
14
+ import type { LoadAccumulator } from "./merge.ts";
15
+ import type { OverlayPaths } from "./paths.ts";
16
16
 
17
17
  /**
18
18
  * Legacy `.rpiv-workflow/` overlay directory detected at load time. The
package/load/merge.ts CHANGED
@@ -15,13 +15,13 @@
15
15
 
16
16
  import { existsSync, readdirSync } from "node:fs";
17
17
  import { join } from "node:path";
18
- import type { Workflow } from "../api.js";
19
- import { formatError } from "../internal-utils.js";
20
- import type { ConfigLayer } from "../layers.js";
21
- import { cachedImport } from "./cache.js";
22
- import type { Issue } from "./issues.js";
23
- import { type FileKind, normalizeDefaultExport, type ParsedConfig } from "./normalize.js";
24
- import type { OverlayPaths } from "./paths.js";
18
+ import type { Workflow } from "../api.ts";
19
+ import { formatError } from "../internal-utils.ts";
20
+ import type { ConfigLayer } from "../layers.ts";
21
+ import { cachedImport } from "./cache.ts";
22
+ import type { Issue } from "./issues.ts";
23
+ import { type FileKind, normalizeDefaultExport, type ParsedConfig } from "./normalize.ts";
24
+ import type { OverlayPaths } from "./paths.ts";
25
25
 
26
26
  /**
27
27
  * Mutable bag of state threaded through `loadLayer` → `loadOverlayFile`
package/load/normalize.ts CHANGED
@@ -16,8 +16,8 @@
16
16
  * `Number(...)` coercion in the predicate body — not a loader concern.
17
17
  */
18
18
 
19
- import type { Workflow } from "../api.js";
20
- import { describe, isEnvelope, isWorkflow } from "./shape-guards.js";
19
+ import type { Workflow } from "../api.ts";
20
+ import { describe, isEnvelope, isWorkflow } from "./shape-guards.ts";
21
21
 
22
22
  export type FileKind = "config" | "pack";
23
23
 
@@ -16,8 +16,8 @@
16
16
  * preferred default set it via the config-file envelope at their own load time.
17
17
  */
18
18
 
19
- import type { ConfigLayer } from "../layers.js";
20
- import { type LoadAccumulator, loadError } from "./merge.js";
19
+ import type { ConfigLayer } from "../layers.ts";
20
+ import { type LoadAccumulator, loadError } from "./merge.ts";
21
21
 
22
22
  export function resolveDefault(
23
23
  projectDefault: string | undefined,
@@ -6,7 +6,7 @@
6
6
  * lives in `../internal-utils.ts` — it's package-wide, not loader-specific.)
7
7
  */
8
8
 
9
- import type { Workflow } from "../api.js";
9
+ import type { Workflow } from "../api.ts";
10
10
 
11
11
  export interface Envelope {
12
12
  workflows?: Workflow[];
@@ -11,8 +11,8 @@
11
11
  * any config file.
12
12
  */
13
13
 
14
- import { formatError } from "../internal-utils.js";
15
- import type { SkillContractMap } from "../skill-contract.js";
14
+ import { formatError } from "../internal-utils.ts";
15
+ import type { SkillContractMap } from "../skill-contract.ts";
16
16
  import {
17
17
  buildEffectiveContracts,
18
18
  drainSkillContractCollisions,
@@ -20,8 +20,8 @@ import {
20
20
  flushSkillContractProviders,
21
21
  getBucketKindMappings,
22
22
  getOutcomeDerivers,
23
- } from "../skill-contracts/index.js";
24
- import type { LoadAccumulator } from "./merge.js";
23
+ } from "../skill-contracts/index.ts";
24
+ import type { LoadAccumulator } from "./merge.ts";
25
25
 
26
26
  /**
27
27
  * Run the phase against the merged accumulator. Mutates `acc` (issues +
@@ -5,9 +5,9 @@
5
5
  * runner-free — safe on `registration`.
6
6
  */
7
7
 
8
- export type { UnitSelector } from "./api.js";
9
- export * from "./loops/constructors.js";
10
- export * from "./loops/derivations.js";
11
- export * from "./loops/introspection.js";
12
- export * from "./loops/panel.js";
13
- export * from "./loops/verify.js";
8
+ export type { UnitSelector } from "./api.ts";
9
+ export * from "./loops/constructors.ts";
10
+ export * from "./loops/derivations.ts";
11
+ export * from "./loops/introspection.ts";
12
+ export * from "./loops/panel.ts";
13
+ export * from "./loops/verify.ts";
package/loop-def.ts CHANGED
@@ -8,9 +8,9 @@
8
8
  * Leaf-ish: imports only types from judge/output/handle.
9
9
  */
10
10
 
11
- import type { Artifact } from "./handle.js";
12
- import type { AnyJudge } from "./judge.js";
13
- import type { Output, RunView } from "./output.js";
11
+ import type { Artifact } from "./handle.ts";
12
+ import type { AnyJudge } from "./judge.ts";
13
+ import type { Output, RunView } from "./output.ts";
14
14
 
15
15
  /**
16
16
  * One unit of loop work — the single unit type for all three loop kinds.