@yaag/runtime 0.6.0 → 0.6.1

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 (93) hide show
  1. package/package.json +1 -1
  2. package/src/{agent-usage.ts → agent/agent-usage.ts} +1 -1
  3. package/src/{agent.ts → agent/agent.ts} +8 -8
  4. package/src/{define-agent.ts → agent/define-agent.ts} +3 -3
  5. package/src/agent/index.ts +13 -0
  6. package/src/{spawn.ts → agent/spawn.ts} +10 -10
  7. package/src/{ask-activity.ts → ask/ask-activity.ts} +3 -3
  8. package/src/{ask-exchange-events.ts → ask/ask-exchange-events.ts} +4 -4
  9. package/src/{ask-exchange-options.ts → ask/ask-exchange-options.ts} +4 -5
  10. package/src/{ask-exchange.ts → ask/ask-exchange.ts} +21 -17
  11. package/src/{ask-hash.ts → ask/ask-hash.ts} +4 -4
  12. package/src/{ask-output-steering.ts → ask/ask-output-steering.ts} +1 -1
  13. package/src/{ask-output-tail.ts → ask/ask-output-tail.ts} +3 -3
  14. package/src/{ask-settlement.ts → ask/ask-settlement.ts} +1 -1
  15. package/src/{ask-turn.ts → ask/ask-turn.ts} +1 -1
  16. package/src/{idle-watch.ts → ask/idle-watch.ts} +2 -2
  17. package/src/ask/index.ts +7 -0
  18. package/src/{stall-watchdog.ts → ask/stall-watchdog.ts} +3 -4
  19. package/src/{ask-limit.ts → ask-contract/ask-limit.ts} +3 -3
  20. package/src/{ask-output.ts → ask-contract/ask-output.ts} +4 -4
  21. package/src/ask-contract/index.ts +36 -0
  22. package/src/{report-result-output.ts → ask-contract/report-result-output.ts} +2 -2
  23. package/src/{report-result.ts → ask-contract/report-result.ts} +1 -1
  24. package/src/{cassette-loader.ts → cassette/cassette-loader.ts} +2 -5
  25. package/src/{cassette-replay.ts → cassette/cassette-replay.ts} +4 -4
  26. package/src/{cassette-schema.ts → cassette/cassette-schema.ts} +2 -2
  27. package/src/{cassette.ts → cassette/cassette.ts} +5 -5
  28. package/src/{checkpoint-dir.ts → cassette/checkpoint-dir.ts} +9 -1
  29. package/src/cassette/index.ts +37 -0
  30. package/src/{recording-transport.ts → cassette/recording-transport.ts} +3 -3
  31. package/src/{replay-divergence.ts → cassette/replay-divergence.ts} +2 -2
  32. package/src/{replay-transport.ts → cassette/replay-transport.ts} +4 -4
  33. package/src/{resume-preconditions.ts → cassette/resume-preconditions.ts} +1 -1
  34. package/src/{resume-transport.ts → cassette/resume-transport.ts} +6 -6
  35. package/src/{run-checkpoint.ts → cassette/run-checkpoint.ts} +1 -1
  36. package/src/errors.ts +2 -2
  37. package/src/events.ts +3 -3
  38. package/src/extension/index.ts +5 -0
  39. package/src/index.ts +36 -30
  40. package/src/model/index.ts +15 -0
  41. package/src/node/index.ts +8 -0
  42. package/src/{node-decoder-subagent.ts → node/node-decoder-subagent.ts} +1 -1
  43. package/src/{node-decoder-workflow.ts → node/node-decoder-workflow.ts} +1 -1
  44. package/src/{node-decoder.ts → node/node-decoder.ts} +1 -1
  45. package/src/{node-details.ts → node/node-details.ts} +3 -3
  46. package/src/{node-tracker.ts → node/node-tracker.ts} +2 -2
  47. package/src/prompt/index.ts +7 -0
  48. package/src/{prompt-gist.ts → prompt/prompt-gist.ts} +1 -1
  49. package/src/{args-validation.ts → run/args-validation.ts} +2 -2
  50. package/src/run/index.ts +13 -0
  51. package/src/{run-context.ts → run/run-context.ts} +2 -2
  52. package/src/{run.ts → run/run.ts} +29 -23
  53. package/src/summary/index.ts +22 -0
  54. package/src/{summary-agent.ts → summary/summary-agent.ts} +3 -3
  55. package/src/{summary-nodes.ts → summary/summary-nodes.ts} +3 -3
  56. package/src/{summary.ts → summary/summary.ts} +3 -3
  57. package/src/{connection.ts → transport/connection.ts} +1 -1
  58. package/src/{fake-transport.ts → transport/fake-transport.ts} +6 -3
  59. package/src/transport/index.ts +41 -0
  60. package/src/{live-transport.ts → transport/live-transport.ts} +1 -1
  61. package/src/{pi-state.ts → transport/pi-state.ts} +1 -1
  62. package/src/{tool-probe.ts → transport/tool-probe.ts} +1 -2
  63. package/src/{transport.ts → transport/transport.ts} +3 -4
  64. package/src/{worktree-transport.ts → transport/worktree-transport.ts} +1 -1
  65. package/src/types.ts +2 -3
  66. /package/src/{agent-names.ts → agent/agent-names.ts} +0 -0
  67. /package/src/{ask-contract-identity.ts → ask-contract/ask-contract-identity.ts} +0 -0
  68. /package/src/{report-result-extension.ts → ask-contract/report-result-extension.ts} +0 -0
  69. /package/src/{report-result-steering.ts → ask-contract/report-result-steering.ts} +0 -0
  70. /package/src/{cassette-publish.ts → cassette/cassette-publish.ts} +0 -0
  71. /package/src/{checkpoint-flush.ts → cassette/checkpoint-flush.ts} +0 -0
  72. /package/src/{git-facts.ts → cassette/git-facts.ts} +0 -0
  73. /package/src/{program-hash.ts → cassette/program-hash.ts} +0 -0
  74. /package/src/{resume-identity.ts → cassette/resume-identity.ts} +0 -0
  75. /package/src/{extension-package.ts → extension/extension-package.ts} +0 -0
  76. /package/src/{extension-paths.ts → extension/extension-paths.ts} +0 -0
  77. /package/src/{extension-source.ts → extension/extension-source.ts} +0 -0
  78. /package/src/{model-resolution.ts → model/model-resolution.ts} +0 -0
  79. /package/src/{model-suffix.ts → model/model-suffix.ts} +0 -0
  80. /package/src/{thinking-level.ts → model/thinking-level.ts} +0 -0
  81. /package/src/{node-decoders.ts → node/node-decoders.ts} +0 -0
  82. /package/src/{node-path.ts → node/node-path.ts} +0 -0
  83. /package/src/{prompt.ts → prompt/prompt.ts} +0 -0
  84. /package/src/{define-run.ts → run/define-run.ts} +0 -0
  85. /package/src/{frame-gap.ts → transport/frame-gap.ts} +0 -0
  86. /package/src/{frame-queue.ts → transport/frame-queue.ts} +0 -0
  87. /package/src/{jsonl.ts → transport/jsonl.ts} +0 -0
  88. /package/src/{reap.ts → transport/reap.ts} +0 -0
  89. /package/src/{skill-probe.ts → transport/skill-probe.ts} +0 -0
  90. /package/src/{skill-restriction-transport.ts → transport/skill-restriction-transport.ts} +0 -0
  91. /package/src/{system-prompt-recorder-extension.ts → transport/system-prompt-recorder-extension.ts} +0 -0
  92. /package/src/{system-prompt-recorder.ts → transport/system-prompt-recorder.ts} +0 -0
  93. /package/src/{tool-probe-extension.ts → transport/tool-probe-extension.ts} +0 -0
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export type { AgentConfig, AgentDefinition } from "./agent/index.ts";
2
+ export { agentDefinitionConfig, defineAgent, isAgentDefinition } from "./agent/index.ts";
1
3
  export type {
2
4
  Cassette,
3
5
  CassetteAgent,
@@ -7,13 +9,15 @@ export type {
7
9
  CassetteRun,
8
10
  CassetteSink,
9
11
  CassetteSpawn,
10
- } from "./cassette.ts";
11
- export { CASSETTE_VERSION } from "./cassette.ts";
12
- export { assertReplayable, loadCassette } from "./cassette-loader.ts";
13
- export type { AgentConfig, AgentDefinition } from "./define-agent.ts";
14
- export { agentDefinitionConfig, defineAgent, isAgentDefinition } from "./define-agent.ts";
15
- export type { OrchestrationProgram, ProgramDefinition } from "./define-run.ts";
16
- export { defineRun, isOrchestrationProgram, programDefinition } from "./define-run.ts";
12
+ } from "./cassette/index.ts";
13
+ export {
14
+ assertReplayable,
15
+ CASSETTE_VERSION,
16
+ loadCassette,
17
+ recordingTransport,
18
+ replayTransport,
19
+ resumeTransport,
20
+ } from "./cassette/index.ts";
17
21
  export type {
18
22
  AskInvalidOutputOutcome,
19
23
  AskLimitKind,
@@ -40,24 +44,23 @@ export type {
40
44
  ModelSpec,
41
45
  ThinkingResolver,
42
46
  ThinkingSpec,
43
- } from "./model-resolution.ts";
44
- export type { DecodedNode, NodeDecoder } from "./node-decoder.ts";
45
- export { DEFAULT_NODE_DECODERS } from "./node-decoders.ts";
46
- export type { NodePath } from "./node-path.ts";
47
- export { agentAskPath, childPath, sanitizeNodeName } from "./node-path.ts";
48
- export type { NodeSnapshot } from "./node-tracker.ts";
49
- export { NodeTracker } from "./node-tracker.ts";
50
- export { prompt } from "./prompt.ts";
51
- export { promptGist } from "./prompt-gist.ts";
52
- export type { ReapPath, ReapTarget } from "./reap.ts";
53
- export { reap } from "./reap.ts";
54
- export { recordingTransport } from "./recording-transport.ts";
55
- export { replayTransport } from "./replay-transport.ts";
56
- export { resumeTransport } from "./resume-transport.ts";
57
- export type { RunOptions } from "./run.ts";
58
- export { executeRun } from "./run.ts";
59
- export type { RunContext } from "./run-context.ts";
60
- export type { DiscoveredSkill, SkillProbeFactory } from "./skill-probe.ts";
47
+ } from "./model/index.ts";
48
+ export type { DecodedNode, NodeDecoder, NodePath, NodeSnapshot } from "./node/index.ts";
49
+ export {
50
+ agentAskPath,
51
+ childPath,
52
+ DEFAULT_NODE_DECODERS,
53
+ NodeTracker,
54
+ sanitizeNodeName,
55
+ } from "./node/index.ts";
56
+ export { prompt, promptGist } from "./prompt/index.ts";
57
+ export type {
58
+ OrchestrationProgram,
59
+ ProgramDefinition,
60
+ RunContext,
61
+ RunOptions,
62
+ } from "./run/index.ts";
63
+ export { defineRun, executeRun, isOrchestrationProgram, programDefinition } from "./run/index.ts";
61
64
  export type {
62
65
  AgentInfo,
63
66
  AgentState,
@@ -70,22 +73,26 @@ export type {
70
73
  RunOutcome,
71
74
  RunState,
72
75
  RunSummary,
73
- } from "./summary.ts";
74
- export { applyEvent, initialSummary } from "./summary.ts";
75
- export { readSystemPromptSidecar } from "./system-prompt-recorder.ts";
76
+ } from "./summary/index.ts";
77
+ export { applyEvent, initialSummary } from "./summary/index.ts";
76
78
  export type {
77
79
  AgentStats,
78
80
  AgentTransport,
79
81
  AskMarker,
80
82
  AskMarkerContext,
81
83
  AskPlayback,
84
+ DiscoveredSkill,
82
85
  Frame,
86
+ ReapPath,
87
+ ReapTarget,
88
+ SkillProbeFactory,
83
89
  TokenBreakdown,
84
90
  TransportFactory,
85
91
  TransportStartup,
86
92
  TransportStartupObserver,
87
93
  WorktreeResolution,
88
- } from "./transport.ts";
94
+ } from "./transport/index.ts";
95
+ export { readSystemPromptSidecar, reap, worktreeTransport } from "./transport/index.ts";
89
96
  export type {
90
97
  AskOptions,
91
98
  Handle,
@@ -104,4 +111,3 @@ export {
104
111
  PROMPT_GIST_MAX_CHARS,
105
112
  TOOL_ARGS_GIST_MAX_CHARS,
106
113
  } from "./wire-constants.ts";
107
- export { worktreeTransport } from "./worktree-transport.ts";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Public surface of the `model/` module: model resolution.
3
+ * Files inside this directory import each other directly.
4
+ */
5
+ export {
6
+ type ModelError,
7
+ type ModelErrorReason,
8
+ type ModelResolver,
9
+ type ModelSelection,
10
+ type ModelSpec,
11
+ normalizeModelResolution,
12
+ type ThinkingResolver,
13
+ type ThinkingSpec,
14
+ } from "./model-resolution.ts";
15
+ export type { ThinkingLevel } from "./thinking-level.ts";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Public surface of the `node/` module: Node decode and tracking.
3
+ * Files inside this directory import each other directly.
4
+ */
5
+ export type { DecodedNode, NodeDecoder } from "./node-decoder.ts";
6
+ export { DEFAULT_NODE_DECODERS } from "./node-decoders.ts";
7
+ export { agentAskPath, childPath, type NodePath, sanitizeNodeName } from "./node-path.ts";
8
+ export { type NodeSnapshot, NodeTracker } from "./node-tracker.ts";
@@ -1,4 +1,4 @@
1
- import type { NodeState } from "./events.ts";
1
+ import type { NodeState } from "../events.ts";
2
2
  import type { DecodedNode, NodeDecoder } from "./node-decoder.ts";
3
3
  import { isRecord, nodeGist, nodeUsage } from "./node-details.ts";
4
4
 
@@ -1,4 +1,4 @@
1
- import type { NodeState } from "./events.ts";
1
+ import type { NodeState } from "../events.ts";
2
2
  import type { DecodedNode, NodeDecoder } from "./node-decoder.ts";
3
3
  import { isRecord, nodeGist, nodeUsage } from "./node-details.ts";
4
4
 
@@ -1,4 +1,4 @@
1
- import type { NodeState, NodeUsage } from "./events.ts";
1
+ import type { NodeState, NodeUsage } from "../events.ts";
2
2
 
3
3
  /** One decoded Nested Node, relative to the tool call that produced it. */
4
4
  export interface DecodedNode {
@@ -1,6 +1,6 @@
1
- import type { NodeUsage } from "./events.ts";
2
- import type { TokenBreakdown } from "./transport.ts";
3
- import { NODE_GIST_MAX_CHARS } from "./wire-constants.ts";
1
+ import type { NodeUsage } from "../events.ts";
2
+ import type { TokenBreakdown } from "../transport/index.ts";
3
+ import { NODE_GIST_MAX_CHARS } from "../wire-constants.ts";
4
4
 
5
5
  /**
6
6
  * Reading untrusted nesting-tool detail payloads. Every decoder narrows from
@@ -1,9 +1,9 @@
1
- import type { NodeState, NodeUsage } from "./events.ts";
1
+ import type { NodeState, NodeUsage } from "../events.ts";
2
+ import type { Frame } from "../transport/index.ts";
2
3
  import type { DecodedNode, NodeDecoder } from "./node-decoder.ts";
3
4
  import { DEFAULT_NODE_DECODERS } from "./node-decoders.ts";
4
5
  import { isRecord } from "./node-details.ts";
5
6
  import { sanitizeNodeName } from "./node-path.ts";
6
- import type { Frame } from "./transport.ts";
7
7
 
8
8
  /** One Nested Node observation, relative to the tool call that produced it. */
9
9
  export interface NodeSnapshot {
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Public surface of the `prompt/` module: the prompt template.
3
+ * Files inside this directory import each other directly.
4
+ */
5
+
6
+ export { prompt } from "./prompt.ts";
7
+ export { promptGist } from "./prompt-gist.ts";
@@ -1,4 +1,4 @@
1
- import { PROMPT_GIST_MAX_CHARS } from "./wire-constants.ts";
1
+ import { PROMPT_GIST_MAX_CHARS } from "../wire-constants.ts";
2
2
 
3
3
  /**
4
4
  * Condenses an Ask prompt for the `ask_start` Lifecycle Event.
@@ -1,7 +1,7 @@
1
1
  import type { TSchema } from "typebox";
2
2
  import { Value } from "typebox/value";
3
- import { YaagError } from "./errors.ts";
4
- import { formatValidationErrors } from "./validation-errors.ts";
3
+ import { YaagError } from "../errors.ts";
4
+ import { formatValidationErrors } from "../validation-errors.ts";
5
5
 
6
6
  /** Throws ARGS_INVALID when value violates schema, without changing value. */
7
7
  export function validateArgs(schema: TSchema, value: unknown): void {
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Public surface of the `run/` module: the Run lifecycle.
3
+ * Files inside this directory import each other directly.
4
+ */
5
+ export {
6
+ defineRun,
7
+ isOrchestrationProgram,
8
+ type OrchestrationProgram,
9
+ type ProgramDefinition,
10
+ programDefinition,
11
+ } from "./define-run.ts";
12
+ export { executeRun, type RunOptions } from "./run.ts";
13
+ export type { RunContext } from "./run-context.ts";
@@ -1,5 +1,5 @@
1
- import type { AgentDefinition } from "./define-agent.ts";
2
- import type { Handle, SpawnOptions, SpawnOverrides } from "./types.ts";
1
+ import type { AgentDefinition } from "../agent/index.ts";
2
+ import type { Handle, SpawnOptions, SpawnOverrides } from "../types.ts";
3
3
 
4
4
  /** What an Orchestration Program is handed. */
5
5
  export interface RunContext<Args = unknown> {
@@ -1,37 +1,43 @@
1
1
  import { join } from "node:path";
2
2
  import type { TSchema } from "typebox";
3
- import type { Agent } from "./agent.ts";
4
- import { validateArgs } from "./args-validation.ts";
5
- import { type Cassette, CassetteCollector, type CassetteSink } from "./cassette.ts";
6
- import { assertReplayable, interruptedResumeWarning, loadCassette } from "./cassette-loader.ts";
3
+ import type { Agent } from "../agent/index.ts";
4
+ import { makeSpawn } from "../agent/index.ts";
7
5
  import {
6
+ assertReplayable,
7
+ type Cassette,
8
+ CassetteCollector,
9
+ type CassetteSink,
8
10
  checkpointFileName,
9
11
  cleanStaleCheckpointTemp,
10
- resolveCheckpointDirectory,
11
- } from "./checkpoint-dir.ts";
12
- import { createCheckpointFlusher, flushingSink } from "./checkpoint-flush.ts";
13
- import { type OrchestrationProgram, programDefinition } from "./define-run.ts";
14
- import { isYaagError, YaagError } from "./errors.ts";
15
- import type { EventSink, LifecycleEvent, RunOutcome, StampedEventSink } from "./events.ts";
16
- import { liveTransport } from "./live-transport.ts";
17
- import { recordingTransport } from "./recording-transport.ts";
18
- import { replayTransport } from "./replay-transport.ts";
19
- import { programIdentityWarning } from "./resume-identity.ts";
20
- import { resumeTransport } from "./resume-transport.ts";
21
- import {
12
+ createCheckpointFlusher,
13
+ flushingSink,
14
+ interruptedResumeWarning,
15
+ loadCassette,
22
16
  type ProgramIdentity,
17
+ programIdentityWarning,
23
18
  publishRunCheckpoint,
24
19
  type RunCheckpointResult,
20
+ recordingTransport,
21
+ replayTransport,
22
+ resolveCheckpointDirectory,
25
23
  resolveRunIdentity,
24
+ resumeTransport,
26
25
  writeRecordingDiagnostic,
27
- } from "./run-checkpoint.ts";
26
+ } from "../cassette/index.ts";
27
+ import { isYaagError, YaagError } from "../errors.ts";
28
+ import type { EventSink, LifecycleEvent, RunOutcome, StampedEventSink } from "../events.ts";
29
+ import { applyEvent, initialSummary, type RunSummary } from "../summary/index.ts";
30
+ import type { TransportFactory } from "../transport/index.ts";
31
+ import {
32
+ liveSkillProbe,
33
+ liveTransport,
34
+ type SkillProbeFactory,
35
+ skillRestrictionTransport,
36
+ worktreeTransport,
37
+ } from "../transport/index.ts";
38
+ import { validateArgs } from "./args-validation.ts";
39
+ import { type OrchestrationProgram, programDefinition } from "./define-run.ts";
28
40
  import type { RunContext } from "./run-context.ts";
29
- import { liveSkillProbe, type SkillProbeFactory } from "./skill-probe.ts";
30
- import { skillRestrictionTransport } from "./skill-restriction-transport.ts";
31
- import { makeSpawn } from "./spawn.ts";
32
- import { applyEvent, initialSummary, type RunSummary } from "./summary.ts";
33
- import type { TransportFactory } from "./transport.ts";
34
- import { worktreeTransport } from "./worktree-transport.ts";
35
41
 
36
42
  export interface RunOptions {
37
43
  /** Where Agents come from. Defaults to real `pi --mode rpc` processes. */
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Public surface of the `summary/` module: the Summary.
3
+ * Files inside this directory import each other directly.
4
+ */
5
+
6
+ export {
7
+ applyEvent,
8
+ type EndedRunSummary,
9
+ initialSummary,
10
+ type RunningRunSummary,
11
+ type RunOutcome,
12
+ type RunState,
13
+ type RunSummary,
14
+ } from "./summary.ts";
15
+ export type {
16
+ AgentInfo,
17
+ AgentState,
18
+ AskingAgentInfo,
19
+ ExitedAgentInfo,
20
+ IdleAgentInfo,
21
+ NodeInfo,
22
+ } from "./summary-agent.ts";
@@ -1,8 +1,8 @@
1
- import type { AgentActivity } from "./events.ts";
1
+ import type { AgentActivity } from "../events.ts";
2
+ import type { TokenBreakdown, WorktreeResolution } from "../transport/index.ts";
2
3
  import type { NodeInfo } from "./summary-nodes.ts";
3
- import type { TokenBreakdown, WorktreeResolution } from "./transport.ts";
4
4
 
5
- export type { AgentActivity } from "./events.ts";
5
+ export type { AgentActivity } from "../events.ts";
6
6
  export type { NodeInfo } from "./summary-nodes.ts";
7
7
 
8
8
  /** The observer-facing lifecycle state of an Agent. */
@@ -1,7 +1,7 @@
1
- import type { LifecycleEventBody, NodeState } from "./events.ts";
1
+ import type { LifecycleEventBody, NodeState } from "../events.ts";
2
+ import type { TokenBreakdown } from "../transport/index.ts";
3
+ import { AGENT_NODE_TABLE_MAX } from "../wire-constants.ts";
2
4
  import type { AgentRecord } from "./summary-agent.ts";
3
- import type { TokenBreakdown } from "./transport.ts";
4
- import { AGENT_NODE_TABLE_MAX } from "./wire-constants.ts";
5
5
 
6
6
  /** One Nested Node's folded row in an Agent's bounded node table. */
7
7
  export interface NodeInfo {
@@ -1,4 +1,5 @@
1
- import type { LifecycleEvent, LifecycleEventBody, RunOutcome } from "./events.ts";
1
+ import type { LifecycleEvent, LifecycleEventBody, RunOutcome } from "../events.ts";
2
+ import type { TokenBreakdown } from "../transport/index.ts";
2
3
  import type { AgentInfo } from "./summary-agent.ts";
3
4
  import {
4
5
  type AgentRecord,
@@ -11,9 +12,8 @@ import {
11
12
  totalsFromAgents,
12
13
  } from "./summary-agent.ts";
13
14
  import { applyNodeUpdate } from "./summary-nodes.ts";
14
- import type { TokenBreakdown } from "./transport.ts";
15
15
 
16
- export type { NodeState, NodeUsage, RunOutcome } from "./events.ts";
16
+ export type { NodeState, NodeUsage, RunOutcome } from "../events.ts";
17
17
  export type {
18
18
  AgentActivity,
19
19
  AgentInfo,
@@ -1,4 +1,4 @@
1
- import { YaagError } from "./errors.ts";
1
+ import { YaagError } from "../errors.ts";
2
2
  import type { AgentTransport, Frame } from "./transport.ts";
3
3
 
4
4
  /** The useful part of a `response` frame, once narrowed. */
@@ -1,7 +1,10 @@
1
- import { DEFAULT_WRAP_UP_PROMPT } from "./ask-limit.ts";
1
+ import {
2
+ DEFAULT_WRAP_UP_PROMPT,
3
+ isReportResultCommandFrame,
4
+ REPORT_RESULT_TOOL_NAME,
5
+ } from "../ask-contract/index.ts";
2
6
  import { FrameQueue } from "./frame-queue.ts";
3
7
  import { parseFrame } from "./jsonl.ts";
4
- import { isReportResultCommandFrame, REPORT_RESULT_TOOL_NAME } from "./report-result.ts";
5
8
  import type { AgentStats, AgentTransport, AskMarker, Frame } from "./transport.ts";
6
9
 
7
10
  /**
@@ -287,7 +290,7 @@ export function reportResultFrames(value: unknown, toolCallId = "call-1"): reado
287
290
  * Rejects when the fixture cannot be read or contains an invalid frame.
288
291
  */
289
292
  export async function recordedFrames(name: string): Promise<Frame[]> {
290
- const text = await Bun.file(`${import.meta.dir}/fixtures/${name}.jsonl`).text();
293
+ const text = await Bun.file(`${import.meta.dir}/../fixtures/${name}.jsonl`).text();
291
294
  return text
292
295
  .split("\n")
293
296
  .map(parseFrame)
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Public surface of the `transport/` module: the pi process seam and its probes.
3
+ * Files inside this directory import each other directly.
4
+ */
5
+ export { type CommandResponse, Connection } from "./connection.ts";
6
+ export {
7
+ FakeTransport,
8
+ type FakeTransportOptions,
9
+ recordedFrames,
10
+ reportResultFrames,
11
+ } from "./fake-transport.ts";
12
+ export { FrameGapTracker } from "./frame-gap.ts";
13
+ export { FrameQueue } from "./frame-queue.ts";
14
+ export { decodeFrames } from "./jsonl.ts";
15
+ export { liveTransport } from "./live-transport.ts";
16
+ export { type AgentProgress, piCommand, readAgentProgress } from "./pi-state.ts";
17
+ export { type ReapPath, type ReapTarget, reap } from "./reap.ts";
18
+ export { type DiscoveredSkill, liveSkillProbe, type SkillProbeFactory } from "./skill-probe.ts";
19
+ export { skillRestrictionTransport } from "./skill-restriction-transport.ts";
20
+ export { readSystemPromptSidecar } from "./system-prompt-recorder.ts";
21
+ export {
22
+ SYSTEM_PROMPT_SIDECAR_SUFFIX,
23
+ systemPromptSidecarPath,
24
+ } from "./system-prompt-recorder-extension.ts";
25
+ export type {
26
+ AgentStats,
27
+ AgentTransport,
28
+ AskCompletion,
29
+ AskInvalidOutputPlayback,
30
+ AskMarker,
31
+ AskMarkerContext,
32
+ AskPlayback,
33
+ Frame,
34
+ OpenOptions,
35
+ TokenBreakdown,
36
+ TransportFactory,
37
+ TransportStartup,
38
+ TransportStartupObserver,
39
+ WorktreeResolution,
40
+ } from "./transport.ts";
41
+ export { worktreeTransport } from "./worktree-transport.ts";
@@ -1,4 +1,4 @@
1
- import { YaagError } from "./errors.ts";
1
+ import { YaagError } from "../errors.ts";
2
2
  import { FrameQueue } from "./frame-queue.ts";
3
3
  import { decodeFrames } from "./jsonl.ts";
4
4
  import { piCommand, readModel, readSessionFile, readStats } from "./pi-state.ts";
@@ -1,4 +1,4 @@
1
- import { REPORT_RESULT_EXTENSION_PATH, REPORT_RESULT_TOOL_NAME } from "./report-result.ts";
1
+ import { REPORT_RESULT_EXTENSION_PATH, REPORT_RESULT_TOOL_NAME } from "../ask-contract/index.ts";
2
2
  import { SYSTEM_PROMPT_RECORDER_EXTENSION_PATH } from "./system-prompt-recorder.ts";
3
3
  import type { AgentStats, Frame, OpenOptions, TokenBreakdown } from "./transport.ts";
4
4
 
@@ -1,7 +1,6 @@
1
1
  import { fileURLToPath } from "node:url";
2
-
2
+ import { REPORT_RESULT_TOOL_NAME } from "../ask-contract/index.ts";
3
3
  import { type ToolSelection, toolAllowlist } from "./pi-state.ts";
4
- import { REPORT_RESULT_TOOL_NAME } from "./report-result.ts";
5
4
  import type { Frame } from "./transport.ts";
6
5
 
7
6
  /** The private status key used only by yaag's internal pi tool probe extension. */
@@ -1,7 +1,6 @@
1
- import type { CanonicalJsonObject } from "./ask-contract-identity.ts";
2
- import type { AskLimitOutcome, AskStalledOutcome } from "./errors.ts";
3
- import type { ReportedResult } from "./report-result.ts";
4
- import type { AskOptions, ResolvedSpawnOptions, ThinkingLevel } from "./types.ts";
1
+ import type { CanonicalJsonObject, ReportedResult } from "../ask-contract/index.ts";
2
+ import type { AskLimitOutcome, AskStalledOutcome } from "../errors.ts";
3
+ import type { AskOptions, ResolvedSpawnOptions, ThinkingLevel } from "../types.ts";
5
4
 
6
5
  /**
7
6
  * The one seam of the runtime (ticket 04). An AgentTransport represents a whole
@@ -1,6 +1,6 @@
1
1
  import { lstat, mkdir } from "node:fs/promises";
2
2
  import { basename, dirname, join } from "node:path";
3
- import { YaagError } from "./errors.ts";
3
+ import { YaagError } from "../errors.ts";
4
4
  import type {
5
5
  AgentTransport,
6
6
  OpenOptions,
package/src/types.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import type { Static, TSchema } from "typebox";
2
- import type { ModelSpec, ThinkingSpec } from "./model-resolution.ts";
3
- import type { ThinkingLevel } from "./thinking-level.ts";
2
+ import type { ModelSpec, ThinkingLevel, ThinkingSpec } from "./model/index.ts";
4
3
 
5
- export type { ThinkingLevel } from "./thinking-level.ts";
4
+ export type { ThinkingLevel } from "./model/index.ts";
6
5
 
7
6
  /** Options for spawning one Agent (ADR-0001, ADR-0009, ADR-0026). */
8
7
  export interface SpawnOptions {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes