agentic-engineering-harness 0.6.9 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/permissions.d.ts +28 -1
- package/dist/agents/permissions.js +188 -29
- package/dist/agents/permissions.js.map +1 -1
- package/dist/paseo/launchSpec.d.ts +6 -0
- package/dist/paseo/launchSpec.js +33 -3
- package/dist/paseo/launchSpec.js.map +1 -1
- package/dist/paseo/modePreflight.d.ts +15 -0
- package/dist/paseo/modePreflight.js +118 -0
- package/dist/paseo/modePreflight.js.map +1 -0
- package/dist/paseo/runtime.d.ts +4 -0
- package/dist/paseo/runtime.js +48 -3
- package/dist/paseo/runtime.js.map +1 -1
- package/dist/paseo/sdk.d.ts +3 -0
- package/dist/paseo/sdk.js +122 -43
- package/dist/paseo/sdk.js.map +1 -1
- package/dist/workers/agentPrompt.js +232 -70
- package/dist/workers/agentPrompt.js.map +1 -1
- package/dist/workers/direct.js +85 -22
- package/dist/workers/direct.js.map +1 -1
- package/dist/workers/paseo.js +31 -7
- package/dist/workers/paseo.js.map +1 -1
- package/dist/workers/podman.js +97 -19
- package/dist/workers/podman.js.map +1 -1
- package/docs/PASEO_NATIVE.md +39 -0
- package/package.json +1 -1
- package/presets/agents/orchestration.jsonc +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct.js","sourceRoot":"","sources":["../../src/workers/direct.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"direct.js","sourceRoot":"","sources":["../../src/workers/direct.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAO5E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGnE,MAAM,OAAO,oBAAoB;IACtB,IAAI,GAAG,QAAQ,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CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,iCAAiC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC;QAC/E,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,IAAI,IAAI,CAAC;QACrE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE;YACvC,GAAG,EAAE,IAAI;YACT,SAAS,EAAE,OAAO,GAAG,IAAI;YACzB,GAAG;SACJ,CAAC,CAAC;QACH,OAAO;YACL,QAAQ,EAAE,SAAS,CAAC,cAAc;YAClC,KAAK,EAAE,SAAS,CAAC,SAAS;YAC1B,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,WAAW;YACX,OAAO,EAAE,SAAS,CAAC,WAAW;YAC9B,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;IACJ,CAAC;CACF;AAED,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AAC/C,CAAC"}
|
package/dist/workers/paseo.js
CHANGED
|
@@ -17,30 +17,54 @@ export class PaseoWorkerExecutor {
|
|
|
17
17
|
}
|
|
18
18
|
try {
|
|
19
19
|
const caps = await detectPaseoCapabilities(root);
|
|
20
|
-
if (!caps.background)
|
|
21
|
-
return {
|
|
22
|
-
|
|
20
|
+
if (!caps.background) {
|
|
21
|
+
return {
|
|
22
|
+
ok: false,
|
|
23
|
+
message: `Installed Paseo${caps.version ? ` ${caps.version}` : ""} does not advertise background runs required by the compatibility fallback.`
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
ok: true,
|
|
28
|
+
message: `Paseo detected${caps.version ? ` (${caps.version})` : ""}; @getpaseo/client is primary and the CLI remains available only as a compatibility path.`
|
|
29
|
+
};
|
|
23
30
|
}
|
|
24
31
|
catch (error) {
|
|
25
32
|
return { ok: false, message: `Paseo capability probe failed: ${String(error)}` };
|
|
26
33
|
}
|
|
27
34
|
}
|
|
28
|
-
async start(root, config, contract, selection) {
|
|
35
|
+
async start(root, config, contract, selection) {
|
|
36
|
+
return this.launch(root, config, contract, buildWorkerPrompt(contract, selection), selection);
|
|
37
|
+
}
|
|
29
38
|
async repair(root, config, contract, session, packet, selection) {
|
|
30
39
|
if (session.id && (!selection || session.logicalAgent === selection.logicalAgent)) {
|
|
31
40
|
const continued = await continueManagedPaseoAgent(root, session.id, buildRepairPrompt(packet), config.orchestration?.worker?.timeoutSeconds);
|
|
32
|
-
return {
|
|
41
|
+
return {
|
|
42
|
+
...session,
|
|
43
|
+
exitCode: continued.exitCode,
|
|
44
|
+
stdout: continued.stdout || session.stdout,
|
|
45
|
+
stderr: [session.stderr, continued.stderr].filter(Boolean).join("\n"),
|
|
46
|
+
transport: `paseo-${continued.transport}`,
|
|
47
|
+
status: continued.status,
|
|
48
|
+
finishedAt: new Date().toISOString()
|
|
49
|
+
};
|
|
33
50
|
}
|
|
34
51
|
return this.launch(root, config, contract, `${buildWorkerPrompt(contract, selection)}\n\n${buildRepairPrompt(packet)}`, selection);
|
|
35
52
|
}
|
|
36
53
|
async launch(root, config, contract, prompt, selection) {
|
|
37
|
-
const spec = await compilePaseoAgentLaunchSpec(root, config, contract, {
|
|
54
|
+
const spec = await compilePaseoAgentLaunchSpec(root, config, contract, {
|
|
55
|
+
selection,
|
|
56
|
+
phase: "implementation"
|
|
57
|
+
});
|
|
38
58
|
const startedAt = new Date().toISOString();
|
|
39
59
|
const launched = await launchManagedPaseoAgent(root, {
|
|
40
60
|
cwd: spec.cwd,
|
|
41
61
|
title: spec.title,
|
|
42
62
|
provider: spec.provider,
|
|
43
63
|
model: spec.model,
|
|
64
|
+
modeId: spec.modeId,
|
|
65
|
+
modeSource: spec.modeSource,
|
|
66
|
+
thinkingOptionId: spec.thinkingOptionId,
|
|
67
|
+
env: spec.env,
|
|
44
68
|
workspaceId: spec.workspaceId,
|
|
45
69
|
prompt,
|
|
46
70
|
labels: spec.labels,
|
|
@@ -51,7 +75,7 @@ export class PaseoWorkerExecutor {
|
|
|
51
75
|
provider: spec.provider,
|
|
52
76
|
model: spec.model,
|
|
53
77
|
logicalAgent: selection?.logicalAgent,
|
|
54
|
-
nativeAgent: selection?.nativeAgent,
|
|
78
|
+
nativeAgent: spec.nativeAgentId ?? selection?.nativeAgent,
|
|
55
79
|
runtime: selection?.runtimeName,
|
|
56
80
|
profile: selection?.profile,
|
|
57
81
|
transport: `paseo-${launched.transport}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paseo.js","sourceRoot":"","sources":["../../src/workers/paseo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"paseo.js","sourceRoot":"","sources":["../../src/workers/paseo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAOzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGnE,MAAM,OAAO,mBAAmB;IACrB,IAAI,GAAG,OAAO,CAAC;IAExB,KAAK,CAAC,MAAM,CACV,IAAY,EACZ,OAA6B,EAC7B,SAAmC;QAEnC,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,OAAO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YACpC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC;IACJ,CAAC;CACF"}
|
package/dist/workers/podman.js
CHANGED
|
@@ -1,44 +1,122 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { compileOpenCodeRuntimeProjection } from "../agents/permissions.js";
|
|
3
3
|
import { allowedSandboxEnvironment, hardenedPodmanArgs, sandboxImage } from "../security/sandbox.js";
|
|
4
4
|
import { commandExists, runProcess } from "../utils/process.js";
|
|
5
5
|
import { buildRepairPrompt, buildWorkerPrompt } from "./prompt.js";
|
|
6
6
|
export class PodmanWorkerExecutor {
|
|
7
7
|
name = "podman";
|
|
8
|
-
async doctor(root, config) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
async doctor(root, config) {
|
|
9
|
+
const ok = await commandExists("podman", root);
|
|
10
|
+
if (!ok)
|
|
11
|
+
return { ok: false, message: "Podman CLI not found." };
|
|
12
|
+
if (!config.security?.sandbox?.image) {
|
|
13
|
+
return {
|
|
14
|
+
ok: false,
|
|
15
|
+
message: "security.sandbox.image is required for Podman worker execution."
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return { ok: true, message: "Hardened Podman worker sandbox configured." };
|
|
19
|
+
}
|
|
20
|
+
async start(root, config, contract, selection) {
|
|
21
|
+
return this.run(root, config, contract, buildWorkerPrompt(contract, selection), selection);
|
|
22
|
+
}
|
|
23
|
+
async repair(root, config, contract, _session, packet, selection) {
|
|
24
|
+
return this.run(root, config, contract, `${buildWorkerPrompt(contract, selection)}\n\n${buildRepairPrompt(packet)}`, selection);
|
|
25
|
+
}
|
|
13
26
|
async run(root, config, contract, prompt, selection) {
|
|
14
27
|
const runtime = selection?.runtimeAdapter ?? "opencode";
|
|
15
|
-
if (runtime !== "opencode")
|
|
28
|
+
if (runtime !== "opencode") {
|
|
16
29
|
throw new Error(`Podman executor currently supports OpenCode runtime; selected ${runtime}.`);
|
|
30
|
+
}
|
|
17
31
|
const model = selection?.modelId ?? config.orchestration?.worker?.model;
|
|
18
32
|
const fallback = selection ?? legacySelection(model);
|
|
33
|
+
const projection = compileOpenCodeRuntimeProjection(fallback, config);
|
|
19
34
|
const podmanArgs = hardenedPodmanArgs(config, fallback, true);
|
|
20
|
-
const args = [
|
|
21
|
-
|
|
35
|
+
const args = [
|
|
36
|
+
"podman",
|
|
37
|
+
"run",
|
|
38
|
+
...podmanArgs,
|
|
39
|
+
"-v",
|
|
40
|
+
`${root}:/workspace:rw`
|
|
41
|
+
];
|
|
42
|
+
for (const relative of sealedArtifacts(config, contract)) {
|
|
22
43
|
args.push("-v", `${path.resolve(root, relative)}:/workspace/${relative}:ro`);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
for (const [name, value] of Object.entries(allowedSandboxEnvironment(config)))
|
|
44
|
+
}
|
|
45
|
+
args.push("-e", `OPENCODE_CONFIG_CONTENT=${projection.env.OPENCODE_CONFIG_CONTENT}`);
|
|
46
|
+
for (const [name, value] of Object.entries(allowedSandboxEnvironment(config))) {
|
|
26
47
|
args.push("-e", `${name}=${value}`);
|
|
48
|
+
}
|
|
27
49
|
const runtimeArgs = ["opencode", "run", "--auto", "--format", "json"];
|
|
28
50
|
if (model)
|
|
29
51
|
runtimeArgs.push("--model", model);
|
|
30
52
|
if (selection?.variant)
|
|
31
53
|
runtimeArgs.push("--variant", selection.variant);
|
|
32
|
-
|
|
33
|
-
runtimeArgs.push("--agent", selection.nativeAgent);
|
|
54
|
+
runtimeArgs.push("--agent", projection.binding.agentId);
|
|
34
55
|
runtimeArgs.push(...(selection?.args ?? []), prompt);
|
|
35
56
|
args.push(sandboxImage(config), "sh", "-lc", `cd /workspace && ${runtimeArgs.map(quote).join(" ")}`);
|
|
36
57
|
const timeout = config.orchestration?.worker?.timeoutSeconds ?? 1800;
|
|
37
|
-
const result = await runProcess(args.map(quote).join(" "), {
|
|
38
|
-
|
|
58
|
+
const result = await runProcess(args.map(quote).join(" "), {
|
|
59
|
+
cwd: root,
|
|
60
|
+
timeoutMs: timeout * 1000
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
provider: runtime,
|
|
64
|
+
model: selection?.modelName ?? model,
|
|
65
|
+
logicalAgent: selection?.logicalAgent,
|
|
66
|
+
nativeAgent: projection.binding.agentId,
|
|
67
|
+
runtime: selection?.runtimeName,
|
|
68
|
+
profile: selection?.profile,
|
|
69
|
+
exitCode: result.exitCode,
|
|
70
|
+
stdout: result.stdout,
|
|
71
|
+
stderr: result.stderr
|
|
72
|
+
};
|
|
39
73
|
}
|
|
40
74
|
}
|
|
41
|
-
function legacySelection(model) {
|
|
42
|
-
|
|
43
|
-
|
|
75
|
+
function legacySelection(model) {
|
|
76
|
+
return {
|
|
77
|
+
logicalAgent: "legacy-worker",
|
|
78
|
+
role: "implementer",
|
|
79
|
+
profile: "legacy",
|
|
80
|
+
domains: ["*"],
|
|
81
|
+
runtimeName: "opencode",
|
|
82
|
+
runtimeAdapter: "opencode",
|
|
83
|
+
paseoProvider: "opencode",
|
|
84
|
+
modelAlias: "legacy",
|
|
85
|
+
modelProvider: model?.split("/")[0] ?? "opencode",
|
|
86
|
+
modelName: model?.split("/").at(-1) ?? "default",
|
|
87
|
+
modelId: model ?? "opencode/default",
|
|
88
|
+
transport: "podman",
|
|
89
|
+
permissions: {
|
|
90
|
+
read: "allow",
|
|
91
|
+
write: "allow",
|
|
92
|
+
shell: "allow",
|
|
93
|
+
network: "ask",
|
|
94
|
+
delegate: "deny",
|
|
95
|
+
review: "deny",
|
|
96
|
+
validate: "allow",
|
|
97
|
+
gitWrite: "deny"
|
|
98
|
+
},
|
|
99
|
+
skills: [],
|
|
100
|
+
mcps: [],
|
|
101
|
+
args: [],
|
|
102
|
+
runtimeCapabilities: {
|
|
103
|
+
modelSelection: true,
|
|
104
|
+
sessions: false,
|
|
105
|
+
structuredOutput: false
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function sealedArtifacts(config, contract) {
|
|
110
|
+
const contractsDir = config.sdd?.contractsDir ?? ".harness/contracts";
|
|
111
|
+
return [
|
|
112
|
+
...new Set([
|
|
113
|
+
`${contractsDir}/${contract.task.id}.yaml`,
|
|
114
|
+
`.harness/seals/${contract.task.id}.json`,
|
|
115
|
+
...Object.values(contract.source ?? {}).filter((value) => Boolean(value))
|
|
116
|
+
])
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
function quote(value) {
|
|
120
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
121
|
+
}
|
|
44
122
|
//# sourceMappingURL=podman.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podman.js","sourceRoot":"","sources":["../../src/workers/podman.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"podman.js","sourceRoot":"","sources":["../../src/workers/podman.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAO5E,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGnE,MAAM,OAAO,oBAAoB;IACtB,IAAI,GAAG,QAAQ,CAAC;IAEzB,KAAK,CAAC,MAAM,CACV,IAAY,EACZ,MAA4B;QAE5B,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,EAAE;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAA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current state | Paseo | `agents.ref(id).refetch()` |
|
|
11
11
|
| Agent context-window usage | Paseo/provider | `AgentSnapshot.lastUsage` |
|
|
12
12
|
| Provider/model availability | Paseo | provider snapshot/listModels/diagnostic |
|
|
13
|
+
| OpenCode native execution identity | AEH topology + session-local OpenCode config | AEH runtime projection -> `OPENCODE_CONFIG_CONTENT` / `default_agent`; explicit external agents may use Paseo `modeId` |
|
|
13
14
|
| Generic create/send/status/activity tools | Paseo | injected native/MCP Paseo tools |
|
|
14
15
|
| AUDIT/RUN operation state | AEH | `aeh-control` / operation state |
|
|
15
16
|
| Detached operation completion wake-up | AEH + Paseo dispatch | durable completion target + follow-up to existing lead |
|
|
@@ -137,6 +138,41 @@ Before creating or materializing an agent, AEH attempts a public-SDK preflight:
|
|
|
137
138
|
|
|
138
139
|
AEH does not force provider refreshes on every launch. Paseo owns snapshot caching and explicit refresh semantics.
|
|
139
140
|
|
|
141
|
+
## Deterministic OpenCode native identity
|
|
142
|
+
|
|
143
|
+
AEH must not resolve a logical agent and then allow OpenCode to choose a different execution identity from ambient machine configuration. For every AEH-selected OpenCode agent, the Harness compiles a concrete native binding.
|
|
144
|
+
|
|
145
|
+
When `execution.nativeAgent` is absent, AEH synthesizes a deterministic session-local primary agent such as:
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
AEH logical agent: code-quality-reviewer
|
|
149
|
+
OpenCode agent: aeh-code-quality-reviewer
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
The generated OpenCode configuration contains the concrete model, projected permissions, primary mode, AEH identity prompt and `default_agent`. It is supplied only to that provider process through:
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
OPENCODE_CONFIG_CONTENT=<compiled JSON>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For an AEH-managed generated identity, Paseo **must not** receive that generated ID as `AgentSessionConfig.modeId`. Paseo validates explicit modes against its provider catalog before the per-session OpenCode process starts, so a session-local generated agent cannot exist at that validation point. AEH leaves `modeId` unset; Paseo therefore omits the OpenCode prompt `agent` selector, and OpenCode deterministically selects the injected session-local `default_agent`. The launch environment is passed as top-level create-agent `env`, not embedded in `AgentSessionConfig`.
|
|
159
|
+
|
|
160
|
+
If `execution.nativeAgent` is explicitly configured, AEH preserves that exact external identity instead of synthesizing a replacement. Because that identity is expected to exist in the provider-visible configuration, AEH passes it as Paseo `modeId` and uses provider mode discovery to verify that it is selectable for the target cwd. Missing explicit agents fail before a user prompt is sent; AEH does not silently fall back to OpenCode's default agent.
|
|
161
|
+
|
|
162
|
+
The same compiled binding is used by direct and Podman OpenCode execution. Transport therefore does not change native identity.
|
|
163
|
+
|
|
164
|
+
A session-scoped OpenCode launch environment is an SDK-required semantic boundary. If the Paseo SDK becomes unavailable, AEH refuses CLI launch fallback for that session rather than dropping `OPENCODE_CONFIG_CONTENT` and reintroducing ambient `default_agent` behavior.
|
|
165
|
+
|
|
166
|
+
Relevant labels/traces include:
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
aeh.native-agent
|
|
170
|
+
aeh.native-agent.source
|
|
171
|
+
harness.paseo.provider.mode.preflight
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`aeh.native-agent.source` is `aeh-managed` for compiled identities and `explicit` for externally configured native agents. Provider mode preflight applies only when AEH actually supplies an explicit `modeId`; generated session-local identities are represented by the native-agent labels and inline OpenCode configuration instead of a Paseo mode.
|
|
175
|
+
|
|
140
176
|
## Intentional CLI parity gaps (P2)
|
|
141
177
|
|
|
142
178
|
CLI usage is not forbidden when the public SDK lacks required semantics. It must be narrow and traced.
|
|
@@ -188,6 +224,8 @@ Representative events:
|
|
|
188
224
|
```text
|
|
189
225
|
harness.paseo.provider.preflight
|
|
190
226
|
harness.paseo.provider.preflight.skipped
|
|
227
|
+
harness.paseo.provider.mode.preflight
|
|
228
|
+
harness.paseo.agent.identity
|
|
191
229
|
harness.paseo.agent.launch
|
|
192
230
|
harness.paseo.agent.materialize
|
|
193
231
|
harness.paseo.agent.dispatch
|
|
@@ -215,6 +253,7 @@ A useful trace answers:
|
|
|
215
253
|
- which transport was selected (`sdk` or `cli`);
|
|
216
254
|
- which observation source was used (`subscription`, snapshot, sdk-wait, cli-wait);
|
|
217
255
|
- how the managed lead identity was resolved (`argument`, `environment`, `lead-state`);
|
|
256
|
+
- which AEH logical agent/native OpenCode identity was selected and whether it was generated or explicit;
|
|
218
257
|
- whether an `idle` completion had real turn evidence rather than a metadata-only update;
|
|
219
258
|
- whether a detached completion callback was registered and delivered;
|
|
220
259
|
- whether a fallback was exceptional or an intentional SDK parity gap;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-engineering-harness",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "OSS-first engineering harness for deterministic, spec-driven, issue-driven, audit-governed and orchestration-first multi-agent software delivery.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
3
|
"extends": ["aeh:default"],
|
|
4
|
+
"runtimes": {
|
|
5
|
+
"opencode": {
|
|
6
|
+
"capabilities": { "nativeAgentViaPaseo": true }
|
|
7
|
+
}
|
|
8
|
+
},
|
|
4
9
|
"agents": {
|
|
5
10
|
"lead": {
|
|
6
11
|
"description": "Own user intent, semantic decisions, exception handling and final acceptance. Operate as a thin orchestrator: delegate repository discovery, environment repair, specification authoring, planning, implementation and review. Prefer Paseo native/MCP orchestration tools and handoff skills over direct shell orchestration. Do not author SDD/OpenSpec artifacts or debug tooling interactively when a specialist can own that bounded operation.",
|