@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
@@ -28,23 +28,23 @@
28
28
  * - `stage.sessionPolicy !== "continue"` (no session to continue).
29
29
  */
30
30
 
31
- import type { ScriptContext } from "../api.js";
32
- import { auditCtxFor, failAuditWrite, failedArgs, recordFatalFailure } from "../audit.js";
33
- import { allocateStageNumber, persistStageSuccess } from "../audit-rows.js";
34
- import { lifecycleCtxFor, scriptStageRef } from "../events.js";
35
- import type { Artifact } from "../handle.js";
36
- import { formatError, nowIso } from "../internal-utils.js";
37
- import { FAIL_SCRIPT_THREW, FAIL_VALIDATION_EXHAUSTED } from "../messages.js";
38
- import { finalizeOutput, type Output, outputMeta } from "../output.js";
39
- import type { RunContext, WorkflowHostContext } from "../types.js";
31
+ import type { ScriptContext } from "../api.ts";
32
+ import { auditCtxFor, failAuditWrite, failedArgs, recordFatalFailure } from "../audit.ts";
33
+ import { allocateStageNumber, persistStageSuccess } from "../audit-rows.ts";
34
+ import { lifecycleCtxFor, scriptStageRef } from "../events.ts";
35
+ import type { Artifact } from "../handle.ts";
36
+ import { formatError, nowIso } from "../internal-utils.ts";
37
+ import { FAIL_SCRIPT_THREW, FAIL_VALIDATION_EXHAUSTED } from "../messages.ts";
38
+ import { finalizeOutput, type Output, outputMeta } from "../output.ts";
39
+ import type { RunContext, WorkflowHostContext } from "../types.ts";
40
40
  import {
41
41
  DEFAULT_VALIDATION_RETRIES,
42
42
  describeFailure,
43
43
  runValidationRetryLoop,
44
44
  validateOutputData,
45
- } from "../validate-output.js";
46
- import type { AdvanceFn, ChainOutcome } from "./failure.js";
47
- import type { ResolvedStage } from "./resolve-stage.js";
45
+ } from "../validate-output.ts";
46
+ import type { AdvanceFn, ChainOutcome } from "./failure.ts";
47
+ import type { ResolvedStage } from "./resolve-stage.ts";
48
48
 
49
49
  /**
50
50
  * Drive a script stage: lifecycle-fire `onStageStart`, retry-loop the
package/schema-compat.ts CHANGED
@@ -12,8 +12,8 @@
12
12
  * per-field type/enum/const rules are what catch most real producer↔consumer drift.
13
13
  */
14
14
 
15
- import { deepEqual } from "./internal-utils.js";
16
- import type { JsonSchemaObject } from "./json-schema.js";
15
+ import { deepEqual } from "./internal-utils.ts";
16
+ import type { JsonSchemaObject } from "./json-schema.ts";
17
17
 
18
18
  /**
19
19
  * Result of a conservative structural compatibility check between a
package/semaphore.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  * representation is then identical to the sequential path.
11
11
  */
12
12
 
13
- import { WorkflowAbortError, WorkflowConfigError } from "./internal-utils.js";
13
+ import { WorkflowAbortError, WorkflowConfigError } from "./internal-utils.ts";
14
14
 
15
15
  export class Semaphore {
16
16
  private active = 0;
@@ -22,7 +22,7 @@
22
22
  * (the resume fold's shape-filtered readers ignore it, like errMsg).
23
23
  */
24
24
 
25
- import type { StageSessionContext } from "../types.js";
25
+ import type { StageSessionContext } from "../types.ts";
26
26
 
27
27
  const DEFAULT_BASH_TIMEOUT_STRIKES = 2; // one retry of a hung command is the operator-grade default.
28
28
  const MIN_BASH_TIMEOUT_STRIKES = 1; // at least one strike before any escalation.
@@ -15,23 +15,23 @@
15
15
  * kind = "artifacts").
16
16
  */
17
17
 
18
- import type { StageDef, StageSchema } from "../api.js";
19
- import { allocateStageNumber, currentStageRef } from "../audit.js";
20
- import { lifecycleCtxFromSession } from "../events.js";
21
- import type { Artifact } from "../handle.js";
22
- import { assertNever, formatError, nowIso, withTimeout } from "../internal-utils.js";
18
+ import type { StageDef, StageSchema } from "../api.ts";
19
+ import { allocateStageNumber, currentStageRef } from "../audit.ts";
20
+ import { lifecycleCtxFromSession } from "../events.ts";
21
+ import type { Artifact } from "../handle.ts";
22
+ import { assertNever, formatError, nowIso, withTimeout } from "../internal-utils.ts";
23
23
  import {
24
24
  ERR_COLLECTOR_THREW,
25
25
  ERR_PARSER_THREW,
26
26
  ERR_SCHEMA_TIMEOUT,
27
27
  ERR_VALIDATE_RETRY_UNCHANGED,
28
- } from "../messages.js";
29
- import { sideEffectOutcome } from "../outcomes/index.js";
30
- import { finalizeOutput, type Output, outputMeta } from "../output.js";
31
- import type { CollectContext, Outcome } from "../output-spec.js";
32
- import { effectiveOutputSchemaOf } from "../stage-identity.js";
33
- import { type BranchEntry, readBranch } from "../transcript.js";
34
- import type { StageSessionContext, WorkflowSessionContext } from "../types.js";
28
+ } from "../messages.ts";
29
+ import { sideEffectOutcome } from "../outcomes/index.ts";
30
+ import { finalizeOutput, type Output, outputMeta } from "../output.ts";
31
+ import type { CollectContext, Outcome } from "../output-spec.ts";
32
+ import { effectiveOutputSchemaOf } from "../stage-identity.ts";
33
+ import { type BranchEntry, readBranch } from "../transcript.ts";
34
+ import type { StageSessionContext, WorkflowSessionContext } from "../types.ts";
35
35
  import {
36
36
  DEFAULT_VALIDATION_RETRIES,
37
37
  DEFAULT_VALIDATION_RETRY_TIMEOUT_MS,
@@ -44,10 +44,10 @@ import {
44
44
  type SchemaValidationFailure,
45
45
  type ValidationResult,
46
46
  validateOutputData,
47
- } from "../validate-output.js";
48
- import { clampRange } from "../validation-bounds.js";
49
- import { resolveDigest } from "../worktree-digest.js";
50
- import { resendIntoChild } from "./spawn.js";
47
+ } from "../validate-output.ts";
48
+ import { clampRange } from "../validation-bounds.ts";
49
+ import { resolveDigest } from "../worktree-digest.ts";
50
+ import { resendIntoChild } from "./spawn.ts";
51
51
 
52
52
  /**
53
53
  * The fatal arm shared by every extraction-stage outcome — `{ kind: "fatal";
@@ -17,16 +17,16 @@
17
17
  * lifecycle signal borrows `unitEventOf` from here).
18
18
  */
19
19
 
20
- import { type AuditContext, failedArgs, recordFatalFailure, recordStopFailure, recordUnitHalt } from "../audit.js";
21
- import { allocateStageNumber } from "../audit-rows.js";
22
- import { lifecycleCtxFromSession, skillStageRef } from "../events.js";
23
- import { nowIso } from "../internal-utils.js";
24
- import { FAIL_VALIDATION_EXHAUSTED, MSG_STAGE_FAILED } from "../messages.js";
25
- import { failedOutput, type OutputMeta, outputMeta } from "../output.js";
26
- import type { SessionRef } from "../state/index.js";
27
- import type { StopSignal } from "../transcript.js";
28
- import type { StageSessionContext, WorkflowHostContext } from "../types.js";
29
- import { unitEventOf } from "./success-persist.js";
20
+ import { type AuditContext, failedArgs, recordFatalFailure, recordStopFailure, recordUnitHalt } from "../audit.ts";
21
+ import { allocateStageNumber } from "../audit-rows.ts";
22
+ import { lifecycleCtxFromSession, skillStageRef } from "../events.ts";
23
+ import { nowIso } from "../internal-utils.ts";
24
+ import { FAIL_VALIDATION_EXHAUSTED, MSG_STAGE_FAILED } from "../messages.ts";
25
+ import { failedOutput, type OutputMeta, outputMeta } from "../output.ts";
26
+ import type { SessionRef } from "../state/index.ts";
27
+ import type { StopSignal } from "../transcript.ts";
28
+ import type { StageSessionContext, WorkflowHostContext } from "../types.ts";
29
+ import { unitEventOf } from "./success-persist.ts";
30
30
 
31
31
  /**
32
32
  * A stage's reason-to-halt, tagged by the post-processing arm that produced it.
package/sessions/index.ts CHANGED
@@ -4,6 +4,6 @@
4
4
  * barrel re-exports only the symbols the rest of the package consumes.
5
5
  */
6
6
 
7
- export { locateSessionFile, pruneOrphanedChildSessions } from "./locate.js";
8
- export { reattachStageSession } from "./reattach.js";
9
- export { continueStageSession, executeStageSession } from "./sessions.js";
7
+ export { locateSessionFile, pruneOrphanedChildSessions } from "./locate.ts";
8
+ export { reattachStageSession } from "./reattach.ts";
9
+ export { continueStageSession, executeStageSession } from "./sessions.ts";
@@ -14,9 +14,9 @@
14
14
 
15
15
  import { closeSync, existsSync, openSync, readdirSync, readSync, rmSync, statSync } from "node:fs";
16
16
  import { dirname, join } from "node:path";
17
- import type { SessionRef } from "../state/index.js";
18
- import { childSessionsDir } from "../state/paths.js";
19
- import { JSONL_PREFIX_READ_BYTES } from "../state/raw.js";
17
+ import type { SessionRef } from "../state/index.ts";
18
+ import { childSessionsDir } from "../state/paths.ts";
19
+ import { JSONL_PREFIX_READ_BYTES } from "../state/raw.ts";
20
20
 
21
21
  /**
22
22
  * id → on-disk session file. Fail-soft: `null` means "fall back to cold
@@ -27,14 +27,14 @@
27
27
  * Validation-exhausted from promotion halts exactly as live does.
28
28
  */
29
29
 
30
- import { MSG_RESUME_PROMOTED, MSG_RESUME_REATTACHED, REATTACH_PROMPT } from "../messages.js";
31
- import { readBranch, readSessionRef } from "../transcript.js";
32
- import type { StageSessionContext, WorkflowHostContext, WorkflowSessionContext } from "../types.js";
33
- import { produceAndValidateOutput } from "./extraction.js";
34
- import { haltStageWithValidationFailure } from "./halt-routing.js";
35
- import { postStage } from "./sessions.js";
36
- import { branchOffsetFor, resendIntoChild } from "./spawn.js";
37
- import { recordStageSuccess } from "./success-persist.js";
30
+ import { MSG_RESUME_PROMOTED, MSG_RESUME_REATTACHED, REATTACH_PROMPT } from "../messages.ts";
31
+ import { readBranch, readSessionRef } from "../transcript.ts";
32
+ import type { StageSessionContext, WorkflowHostContext, WorkflowSessionContext } from "../types.ts";
33
+ import { produceAndValidateOutput } from "./extraction.ts";
34
+ import { haltStageWithValidationFailure } from "./halt-routing.ts";
35
+ import { postStage } from "./sessions.ts";
36
+ import { branchOffsetFor, resendIntoChild } from "./spawn.ts";
37
+ import { recordStageSuccess } from "./success-persist.ts";
38
38
 
39
39
  // Same two-ctx split as `postStage`: `observerCtx` is the long-lived launcher/observer
40
40
  // (user-facing notifications + record + the chain continuation that spawns the
@@ -23,15 +23,15 @@
23
23
  * exported below instead of duplicating them.
24
24
  */
25
25
 
26
- import { WorkflowAbortError } from "../internal-utils.js";
27
- import type { SessionRef } from "../state/index.js";
28
- import { type BranchEntry, classifyStop, readBranch, readSessionRef, type StopSignal } from "../transcript.js";
29
- import type { StageSessionContext, WorkflowHostContext, WorkflowSessionContext } from "../types.js";
30
- import { bashStrikesRemaining, bashTimeoutSteeringMessage, consumeBashStrike } from "./bash-strikes.js";
31
- import { produceAndValidateOutput } from "./extraction.js";
32
- import { haltStageOrSoftHalt } from "./halt-routing.js";
33
- import { branchOffsetFor, resendIntoChild, spawnChildAndRun } from "./spawn.js";
34
- import { recordStageSuccess } from "./success-persist.js";
26
+ import { WorkflowAbortError } from "../internal-utils.ts";
27
+ import type { SessionRef } from "../state/index.ts";
28
+ import { type BranchEntry, classifyStop, readBranch, readSessionRef, type StopSignal } from "../transcript.ts";
29
+ import type { StageSessionContext, WorkflowHostContext, WorkflowSessionContext } from "../types.ts";
30
+ import { bashStrikesRemaining, bashTimeoutSteeringMessage, consumeBashStrike } from "./bash-strikes.ts";
31
+ import { produceAndValidateOutput } from "./extraction.ts";
32
+ import { haltStageOrSoftHalt } from "./halt-routing.ts";
33
+ import { branchOffsetFor, resendIntoChild, spawnChildAndRun } from "./spawn.ts";
34
+ import { recordStageSuccess } from "./success-persist.ts";
35
35
 
36
36
  // ===========================================================================
37
37
  // PUBLIC ENTRIES — what the orchestrator calls
package/sessions/spawn.ts CHANGED
@@ -18,8 +18,8 @@
18
18
  * identity.
19
19
  */
20
20
 
21
- import type { SessionPolicy } from "../api.js";
22
- import type { StageSessionContext, WorkflowHostContext, WorkflowSessionContext } from "../types.js";
21
+ import type { SessionPolicy } from "../api.ts";
22
+ import type { StageSessionContext, WorkflowHostContext, WorkflowSessionContext } from "../types.ts";
23
23
 
24
24
  /**
25
25
  * The per-policy branch offset — fresh ignores the stage-captured value;
@@ -9,13 +9,13 @@
9
9
  * - halt-routing.ts — the halt pipeline; consumes `unitEventOf`.
10
10
  */
11
11
 
12
- import { currentStageRef, failAuditWrite } from "../audit.js";
13
- import { persistStageSuccess, rollLastSession } from "../audit-rows.js";
14
- import { lifecycleCtxFromSession, skillStageRef, type UnitEvent } from "../events.js";
15
- import type { Output } from "../output.js";
16
- import type { SessionRef } from "../state/index.js";
17
- import type { StageSessionContext, WorkflowHostContext } from "../types.js";
18
- import { bashTimeoutStrikeHistory } from "./bash-strikes.js";
12
+ import { currentStageRef, failAuditWrite } from "../audit.ts";
13
+ import { persistStageSuccess, rollLastSession } from "../audit-rows.ts";
14
+ import { lifecycleCtxFromSession, skillStageRef, type UnitEvent } from "../events.ts";
15
+ import type { Output } from "../output.ts";
16
+ import type { SessionRef } from "../state/index.ts";
17
+ import type { StageSessionContext, WorkflowHostContext } from "../types.ts";
18
+ import { bashTimeoutStrikeHistory } from "./bash-strikes.ts";
19
19
 
20
20
  /**
21
21
  * Returns true on successful write — caller gates `onSuccess` on this so the
package/skill-contract.ts CHANGED
@@ -21,13 +21,13 @@
21
21
  * Every channel is optional — a pure chat side-effect declares none.
22
22
  */
23
23
 
24
- import type { JsonSchemaObject } from "./json-schema.js";
25
- import type { SchemaCompatResult } from "./schema-compat.js";
24
+ import type { JsonSchemaObject } from "./json-schema.ts";
25
+ import type { SchemaCompatResult } from "./schema-compat.ts";
26
26
 
27
27
  // `SchemaCompatResult` lives with the compat engine (schema-compat.ts) that
28
28
  // defines its semantics — re-exported here so the contract vocabulary stays
29
29
  // self-contained for consumers (`CompositionComparator` returns it).
30
- export type { SchemaCompatResult } from "./schema-compat.js";
30
+ export type { SchemaCompatResult } from "./schema-compat.ts";
31
31
 
32
32
  /**
33
33
  * Where a contract came from, in descending authority. `declared` = the skill's
@@ -7,17 +7,17 @@
7
7
  * (not provably incompatible).
8
8
  */
9
9
 
10
- import { formatError } from "../internal-utils.js";
11
- import type { JsonSchemaObject } from "../json-schema.js";
12
- import { isSchemaCompatible } from "../schema-compat.js";
10
+ import { formatError } from "../internal-utils.ts";
11
+ import type { JsonSchemaObject } from "../json-schema.ts";
12
+ import { isSchemaCompatible } from "../schema-compat.ts";
13
13
  import type {
14
14
  CompositionComparator,
15
15
  ConsumesSpec,
16
16
  ProducesSpec,
17
17
  SchemaCompatResult,
18
18
  SkillContractMap,
19
- } from "../skill-contract.js";
20
- import { getCompositionComparators } from "./extension-points.js";
19
+ } from "../skill-contract.ts";
20
+ import { getCompositionComparators } from "./extension-points.ts";
21
21
 
22
22
  /**
23
23
  * THE single data-channel comparison core — shared by `canCompose` and the
@@ -5,9 +5,9 @@
5
5
  * both anchored on `Symbol.for` global slots (same pattern as `registry.ts`).
6
6
  */
7
7
 
8
- import type { Workflow } from "../api.js";
9
- import { globalSlot } from "../internal-utils.js";
10
- import type { CompositionComparator, SkillContractMap } from "../skill-contract.js";
8
+ import type { Workflow } from "../api.ts";
9
+ import { globalSlot } from "../internal-utils.ts";
10
+ import type { CompositionComparator, SkillContractMap } from "../skill-contract.ts";
11
11
 
12
12
  const COMPARATORS_KEY = Symbol.for("@juicesharp/rpiv-workflow:composition-comparators");
13
13
  const DERIVERS_KEY = Symbol.for("@juicesharp/rpiv-workflow:outcome-derivers");
@@ -8,12 +8,12 @@
8
8
  * framework-native `kind`/`reads`; the opaque `meta` bag is declared-only.
9
9
  */
10
10
 
11
- import type { Workflow } from "../api.js";
12
- import { extractJsonSchema } from "../json-schema.js";
13
- import type { ConsumesSpec, ProducesSpec, SkillContract } from "../skill-contract.js";
14
- import { readName } from "../stage-def.js";
15
- import { isDispatchingStage, resolveSkill } from "../stage-identity.js";
16
- import { getSkillContracts } from "./registry.js";
11
+ import type { Workflow } from "../api.ts";
12
+ import { extractJsonSchema } from "../json-schema.ts";
13
+ import type { ConsumesSpec, ProducesSpec, SkillContract } from "../skill-contract.ts";
14
+ import { readName } from "../stage-def.ts";
15
+ import { isDispatchingStage, resolveSkill } from "../stage-identity.ts";
16
+ import { getSkillContracts } from "./registry.ts";
17
17
 
18
18
  /**
19
19
  * Derive a best-effort `harvested` contract per dispatched skill from how
@@ -10,7 +10,7 @@ export {
10
10
  canCompose,
11
11
  compareDataChannel,
12
12
  legalNextSkills,
13
- } from "./composition.js";
13
+ } from "./composition.ts";
14
14
  export {
15
15
  getBucketKindMappings,
16
16
  getCompositionComparators,
@@ -19,8 +19,8 @@ export {
19
19
  registerBucketKindMapping,
20
20
  registerCompositionComparator,
21
21
  registerOutcomeDeriver,
22
- } from "./extension-points.js";
23
- export { buildEffectiveContracts, harvestStageContracts } from "./harvest.js";
22
+ } from "./extension-points.ts";
23
+ export { buildEffectiveContracts, harvestStageContracts } from "./harvest.ts";
24
24
  export {
25
25
  drainSkillContractCollisions,
26
26
  drainSkillContractProviderErrors,
@@ -28,10 +28,10 @@ export {
28
28
  getSkillContracts,
29
29
  registerSkillContracts,
30
30
  registerSkillContractsProvider,
31
- } from "./registry.js";
31
+ } from "./registry.ts";
32
32
 
33
- import { __resetExtensionPoints } from "./extension-points.js";
34
- import { __resetContractRegistry } from "./registry.js";
33
+ import { __resetExtensionPoints } from "./extension-points.ts";
34
+ import { __resetContractRegistry } from "./registry.ts";
35
35
 
36
36
  /**
37
37
  * Test reset (wired into repo-wide setup). Clears the registry, pending lazy
@@ -12,8 +12,8 @@
12
12
  * - extension-points.ts — CompositionComparator + OutcomeDeriver registries (consumer extension points).
13
13
  */
14
14
 
15
- import { deepEqual, globalSlot, lazyProviderRegistry } from "../internal-utils.js";
16
- import type { SkillContract, SkillContractMap } from "../skill-contract.js";
15
+ import { deepEqual, globalSlot, lazyProviderRegistry } from "../internal-utils.ts";
16
+ import type { SkillContract, SkillContractMap } from "../skill-contract.ts";
17
17
 
18
18
  const REGISTRY_KEY = Symbol.for("@juicesharp/rpiv-workflow:skill-contracts");
19
19
  const FAILURES_KEY = Symbol.for("@juicesharp/rpiv-workflow:skill-contract-failures");
package/stage-def.ts CHANGED
@@ -11,11 +11,11 @@
11
11
  */
12
12
 
13
13
  import type { StandardSchemaV1 } from "@standard-schema/spec";
14
- import { requireNonEmptyString } from "./internal-utils.js";
15
- import type { AssessLoop, LoopDef, VerifySpec } from "./loop-def.js";
16
- import type { Output, RunView } from "./output.js";
17
- import type { Outcome } from "./output-spec.js";
18
- import type { EdgeTarget } from "./routing-dsl.js";
14
+ import { requireNonEmptyString } from "./internal-utils.ts";
15
+ import type { AssessLoop, LoopDef, VerifySpec } from "./loop-def.ts";
16
+ import type { Output, RunView } from "./output.ts";
17
+ import type { Outcome } from "./output-spec.ts";
18
+ import type { EdgeTarget } from "./routing-dsl.ts";
19
19
 
20
20
  /**
21
21
  * Schema attached to a stage's `outputSchema` / `inputSchema`. Structurally
package/stage-errors.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { FailureText } from "./messages.js";
1
+ import type { FailureText } from "./messages.ts";
2
2
 
3
3
  /**
4
4
  * Shared-kernel stage error vocabulary — a package-root LEAF (zero value
package/stage-identity.ts CHANGED
@@ -15,9 +15,9 @@
15
15
  * `chain-state.ts` re-exports them so its own runtime callers keep one import.
16
16
  */
17
17
 
18
- import type { SkillStage, StageDef, StageSchema } from "./api.js";
19
- import { isJsonSchemaObject, jsonSchemaToStandard } from "./json-schema.js";
20
- import type { SkillContractMap } from "./skill-contract.js";
18
+ import type { SkillStage, StageDef, StageSchema } from "./api.ts";
19
+ import { isJsonSchemaObject, jsonSchemaToStandard } from "./json-schema.ts";
20
+ import type { SkillContractMap } from "./skill-contract.ts";
21
21
 
22
22
  /**
23
23
  * Resolve the `state.named` key a produces stage appends its `Output`
package/startup.ts CHANGED
@@ -5,9 +5,9 @@
5
5
  * dynamically imports your definitions so they build on first `/wf`, not startup.
6
6
  */
7
7
 
8
- export { registerBuiltIns, registerBuiltInsProvider } from "./built-ins.js";
9
- export { registerLifecycle } from "./events.js";
10
- export { registerWorkflowExecutionHost } from "./execution-host.js";
8
+ export { registerBuiltIns, registerBuiltInsProvider } from "./built-ins.ts";
9
+ export { registerLifecycle } from "./events.ts";
10
+ export { registerWorkflowExecutionHost } from "./execution-host.ts";
11
11
  export {
12
12
  getBucketKindMappings,
13
13
  registerBucketKindMapping,
@@ -15,5 +15,5 @@ export {
15
15
  registerOutcomeDeriver,
16
16
  registerSkillContracts,
17
17
  registerSkillContractsProvider,
18
- } from "./skill-contracts/index.js";
19
- export { summarizeRun } from "./state/index.js";
18
+ } from "./skill-contracts/index.ts";
19
+ export { summarizeRun } from "./state/index.ts";
package/state/index.ts CHANGED
@@ -15,7 +15,7 @@ export type {
15
15
  StageStatus,
16
16
  WorkflowHeader,
17
17
  WorkflowStage,
18
- } from "./state.js";
18
+ } from "./state.ts";
19
19
  export {
20
20
  appendHeader,
21
21
  appendLoopCap,
@@ -44,4 +44,4 @@ export {
44
44
  stateFilePath,
45
45
  summarizeRun,
46
46
  VALID_NAME,
47
- } from "./state.js";
47
+ } from "./state.ts";
package/state/names.ts CHANGED
@@ -21,9 +21,9 @@
21
21
  */
22
22
 
23
23
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
24
- import { formatError } from "../internal-utils.js";
25
- import { namesFilePath, runsDir, stateFilePath } from "./paths.js";
26
- import { enumerateRunIds, readFirstJsonlLine } from "./raw.js";
24
+ import { formatError } from "../internal-utils.ts";
25
+ import { namesFilePath, runsDir, stateFilePath } from "./paths.ts";
26
+ import { enumerateRunIds, readFirstJsonlLine } from "./raw.ts";
27
27
 
28
28
  // ---------------------------------------------------------------------------
29
29
  // Types
package/state/raw.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import { closeSync, openSync, readdirSync, readSync } from "node:fs";
11
- import { runsDir, stateFilePath } from "./paths.js";
11
+ import { runsDir, stateFilePath } from "./paths.ts";
12
12
 
13
13
  /**
14
14
  * Shared one-shot prefix-read size for JSONL first lines — 8KB covers a header
package/state/reads.ts CHANGED
@@ -17,10 +17,10 @@
17
17
  */
18
18
 
19
19
  import { existsSync, readFileSync } from "node:fs";
20
- import { type Artifact, handleToString } from "../handle.js";
21
- import { formatError } from "../internal-utils.js";
22
- import { stateFilePath } from "./paths.js";
23
- import { enumerateRunIds, readFirstJsonlLine } from "./raw.js";
20
+ import { type Artifact, handleToString } from "../handle.ts";
21
+ import { formatError } from "../internal-utils.ts";
22
+ import { stateFilePath } from "./paths.ts";
23
+ import { enumerateRunIds, readFirstJsonlLine } from "./raw.ts";
24
24
  import type {
25
25
  LoopCapRow,
26
26
  RoutingDecision,
@@ -29,7 +29,7 @@ import type {
29
29
  StageStatus,
30
30
  WorkflowHeader,
31
31
  WorkflowStage,
32
- } from "./state.js";
32
+ } from "./state.ts";
33
33
 
34
34
  /**
35
35
  * Reads every line, filters by shape (not position). Header has no
package/state/resolve.ts CHANGED
@@ -6,9 +6,9 @@
6
6
  */
7
7
 
8
8
  import { basename } from "node:path";
9
- import { isValidName, readNamesIndex, rebuildIndex } from "./names.js";
10
- import { readHeader } from "./reads.js";
11
- import type { WorkflowHeader } from "./state.js";
9
+ import { isValidName, readNamesIndex, rebuildIndex } from "./names.ts";
10
+ import { readHeader } from "./reads.ts";
11
+ import type { WorkflowHeader } from "./state.ts";
12
12
 
13
13
  /**
14
14
  * Resolve a run *reference* to its header — the ref-resolution seam.
package/state/state.ts CHANGED
@@ -21,9 +21,9 @@
21
21
  * else lives in a focused module.
22
22
  */
23
23
 
24
- import type { UnitRole } from "../api.js";
25
- import type { Output } from "../output.js";
26
- import type { RunTrigger } from "../triggers.js";
24
+ import type { UnitRole } from "../api.ts";
25
+ import type { Output } from "../output.ts";
26
+ import type { RunTrigger } from "../triggers.ts";
27
27
 
28
28
  // ---------------------------------------------------------------------------
29
29
  // Row shapes
@@ -339,8 +339,8 @@ export {
339
339
  rebuildIndex,
340
340
  releaseName,
341
341
  VALID_NAME,
342
- } from "./names.js";
343
- export { generateRunId, namesFilePath, runFileFor, runsDir, stateFilePath } from "./paths.js";
342
+ } from "./names.ts";
343
+ export { generateRunId, namesFilePath, runFileFor, runsDir, stateFilePath } from "./paths.ts";
344
344
  export {
345
345
  listArtifacts,
346
346
  listRuns,
@@ -351,6 +351,6 @@ export {
351
351
  readLoopCaps,
352
352
  readRoutingDecisions,
353
353
  summarizeRun,
354
- } from "./reads.js";
355
- export { resolveRun } from "./resolve.js";
356
- export { appendHeader, appendLoopCap, appendRoutingDecision, appendStage } from "./writes.js";
354
+ } from "./reads.ts";
355
+ export { resolveRun } from "./resolve.ts";
356
+ export { appendHeader, appendLoopCap, appendRoutingDecision, appendStage } from "./writes.ts";
package/state/writes.ts CHANGED
@@ -13,9 +13,9 @@
13
13
  */
14
14
 
15
15
  import { appendFileSync, mkdirSync } from "node:fs";
16
- import { formatError } from "../internal-utils.js";
17
- import { runsDir, stateFilePath } from "./paths.js";
18
- import type { LoopCapRow, RoutingDecision, WorkflowHeader, WorkflowStage } from "./state.js";
16
+ import { formatError } from "../internal-utils.ts";
17
+ import { runsDir, stateFilePath } from "./paths.ts";
18
+ import type { LoopCapRow, RoutingDecision, WorkflowHeader, WorkflowStage } from "./state.ts";
19
19
 
20
20
  /**
21
21
  * Shared append primitive: ensure the runs directory exists, then
package/transcript.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  * "find the last regex match in assistant text" helper they reuse.
13
13
  */
14
14
 
15
- import type { SessionRef } from "./state/index.js";
15
+ import type { SessionRef } from "./state/index.ts";
16
16
 
17
17
  /** Mirror of pi-ai's StopReason union — values pi attaches to AssistantMessage. */
18
18
  export type StopReason = "stop" | "length" | "toolUse" | "error" | "aborted";
@@ -17,8 +17,8 @@
17
17
 
18
18
  import type { StandardSchemaV1 } from "@standard-schema/spec";
19
19
  import type { Static, TSchema } from "typebox";
20
- import type { JsonSchemaCapable, JsonSchemaObject } from "./json-schema.js";
21
- import { jsonSchemaConverter, validateToJsonSchemaIssues } from "./json-schema.js";
20
+ import type { JsonSchemaCapable, JsonSchemaObject } from "./json-schema.ts";
21
+ import { jsonSchemaConverter, validateToJsonSchemaIssues } from "./json-schema.ts";
22
22
 
23
23
  /**
24
24
  * Wrap a TypeBox schema to return a `JsonSchemaCapable` — a Standard Schema v1