@tangle-network/agent-runtime 0.79.1 → 0.79.3

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.
@@ -1,4 +1,5 @@
1
1
  import { a as Executor } from './types-C1sozrte.js';
2
+ import { L as LocalHarness } from './local-harness-DU7yV6mG.js';
2
3
 
3
4
  /**
4
5
  * @experimental
@@ -122,4 +123,75 @@ declare function captureWorktreeDiff(options: DiffOptions): Promise<DiffResult>;
122
123
  /** @experimental */
123
124
  declare function removeWorktree(options: RemoveWorktreeOptions): Promise<void>;
124
125
 
125
- export { type CreateWorktreeOptions as C, type DiffOptions as D, type GitRunner as G, type RemoveWorktreeOptions as R, type WorktreeHandle as W, type DiffResult as a, createWorktree as b, captureWorktreeDiff as c, type DeliverableSpec as d, gateOnDeliverable as g, removeWorktree as r };
126
+ /**
127
+ * @experimental
128
+ *
129
+ * The ONE worktree-harness execution core. The physical act — run a supervisor-authored
130
+ * `AgentProfile` on a local coding-harness CLI (claude / codex / opencode) against a fresh git
131
+ * worktree off `repoRoot`, capture the diff, derive the test/typecheck PASS signals, then clean
132
+ * up — lives here ONCE. Two executors adapt it to two ports without re-implementing it:
133
+ * - `createWorktreeCliExecutor` — the `Scope`/`Supervisor` leaf `Executor`.
134
+ * - `createInProcessExecutor` — the `runLoop` `SandboxClient` / coder-delegate path.
135
+ *
136
+ * §1.5 by construction: the authored `profile.prompt.systemPrompt` + `profile.model.default`
137
+ * reach the harness through `harnessInvocation` HERE, so neither port can drop them — the exact
138
+ * bug that existed while the in-process path called `runLocalHarness` with only the task prompt.
139
+ *
140
+ * Lifecycle: `createWorktree` → `harnessInvocation` + `runLocalHarness` → `captureWorktreeDiff`
141
+ * (BEFORE checks, so the patch is the harness's output, not polluted by files a test run writes)
142
+ * → the configured test/typecheck commands in the live worktree → return the result + a `cleanup`
143
+ * the caller invokes at its own teardown point. A throw cleans up before propagating, so a failed
144
+ * run never leaks a worktree.
145
+ */
146
+
147
+ /** Outcome of one verification command run in the worktree (test or typecheck). */
148
+ interface WorktreeCommandResult {
149
+ /** The shell command line that was run. */
150
+ command: string;
151
+ /** Did the command exit 0? The PASS signal a deliverable gate / coder output reads. */
152
+ passed: boolean;
153
+ /** OS exit code, or `null` when killed before exit. */
154
+ exitCode: number | null;
155
+ /** Combined stdout+stderr (capped) — surfaced in traces for diagnosis. */
156
+ output: string;
157
+ }
158
+ /** The canonical result of one worktree-harness run, projected by each port to its own shape. */
159
+ interface WorktreeHarnessResult {
160
+ /** The branch the worktree was cut on (`delegate/<runId>`). */
161
+ branch: string;
162
+ /** `git diff` of the worktree against its base — the unified patch the harness produced. */
163
+ patch: string;
164
+ /** Shortstat-derived change counts. */
165
+ stats: {
166
+ filesChanged: number;
167
+ insertions: number;
168
+ deletions: number;
169
+ };
170
+ /** The harness subprocess outcome. */
171
+ harness: {
172
+ name: LocalHarness | 'bridge';
173
+ exitCode: number | null;
174
+ timedOut: boolean;
175
+ killedBySignal: NodeJS.Signals | null;
176
+ durationMs: number;
177
+ stdout: string;
178
+ stderr: string;
179
+ };
180
+ /** Verification signals derived in the live worktree (present only when commands were given). */
181
+ checks?: {
182
+ tests?: WorktreeCommandResult;
183
+ typecheck?: WorktreeCommandResult;
184
+ };
185
+ }
186
+ /** The single shell-command-in-worktree runner seam (replaces the per-executor copies). */
187
+ type WorktreeCheckRunner = (opts: {
188
+ command: string;
189
+ cwd: string;
190
+ timeoutMs: number;
191
+ signal?: AbortSignal;
192
+ }) => Promise<{
193
+ exitCode: number | null;
194
+ output: string;
195
+ }>;
196
+
197
+ export { type CreateWorktreeOptions as C, type DeliverableSpec as D, type GitRunner as G, type RemoveWorktreeOptions as R, type WorktreeHarnessResult as W, type WorktreeCheckRunner as a, type DiffOptions as b, type DiffResult as c, type WorktreeHandle as d, captureWorktreeDiff as e, createWorktree as f, type WorktreeCommandResult as g, gateOnDeliverable as h, removeWorktree as r };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-runtime",
3
- "version": "0.79.1",
3
+ "version": "0.79.3",
4
4
  "description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.",
5
5
  "homepage": "https://github.com/tangle-network/agent-runtime#readme",
6
6
  "repository": {
@@ -129,9 +129,6 @@
129
129
  "playwright": "^1.40.0"
130
130
  },
131
131
  "peerDependenciesMeta": {
132
- "@tangle-network/agent-eval": {
133
- "optional": true
134
- },
135
132
  "@tangle-network/agent-interface": {
136
133
  "optional": true
137
134
  },