@pasko70/pibo 1.16.6 → 2.1.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.
- package/dist/agent-runtime/auth.js +28 -0
- package/dist/agent-runtime/capabilities.js +221 -0
- package/dist/agent-runtime/context-build.js +313 -0
- package/dist/agent-runtime/contract.js +45 -0
- package/dist/agent-runtime/errors.js +57 -0
- package/dist/agent-runtime/events.js +1 -0
- package/dist/agent-runtime/history.js +1 -0
- package/dist/agent-runtime/profile-validation.js +109 -0
- package/dist/agent-runtime/registry.js +608 -0
- package/dist/agent-runtime/resource-files.js +87 -0
- package/dist/agent-runtime/resource-service.js +635 -0
- package/dist/agent-runtime/resources.js +1 -0
- package/dist/agent-runtime/routed-session.js +931 -0
- package/dist/agent-runtime/testing/contract.js +51 -0
- package/dist/agent-runtime/testing/fake-adapter.js +192 -0
- package/dist/agent-runtime/types.js +3 -0
- package/dist/agent-runtimes/codex-native/adapter.js +905 -0
- package/dist/agent-runtimes/codex-native/auth.js +476 -0
- package/dist/agent-runtimes/codex-native/client.js +734 -0
- package/dist/agent-runtimes/codex-native/config.js +152 -0
- package/dist/agent-runtimes/codex-native/history.js +283 -0
- package/dist/agent-runtimes/codex-native/mcp-stdio-launcher.js +89 -0
- package/dist/agent-runtimes/codex-native/models.js +581 -0
- package/dist/agent-runtimes/codex-native/process.js +459 -0
- package/dist/agent-runtimes/codex-native/protocol-types.js +1 -0
- package/dist/agent-runtimes/codex-native/protocol-version.js +7 -0
- package/dist/agent-runtimes/codex-native/redaction.js +31 -0
- package/dist/agent-runtimes/codex-native/requests.js +378 -0
- package/dist/agent-runtimes/codex-native/resource-delivery.js +445 -0
- package/dist/agent-runtimes/codex-native/thread.js +388 -0
- package/dist/agent-runtimes/codex-native/turn.js +849 -0
- package/dist/agent-runtimes/omp/adapter.js +581 -0
- package/dist/agent-runtimes/omp/auth.js +109 -0
- package/dist/agent-runtimes/omp/client.js +460 -0
- package/dist/agent-runtimes/omp/config.js +188 -0
- package/dist/agent-runtimes/omp/history.js +108 -0
- package/dist/agent-runtimes/omp/host-tools.js +201 -0
- package/dist/agent-runtimes/omp/models.js +86 -0
- package/dist/agent-runtimes/omp/process.js +283 -0
- package/dist/agent-runtimes/omp/protocol-types.js +17 -0
- package/dist/agent-runtimes/omp/resource-delivery.js +162 -0
- package/dist/agent-runtimes/omp/thread.js +141 -0
- package/dist/agent-runtimes/omp/turn.js +325 -0
- package/dist/agent-runtimes/pi/adapter.js +653 -0
- package/dist/agent-runtimes/pi/auth.js +455 -0
- package/dist/agent-runtimes/pi/history.js +640 -0
- package/dist/agent-runtimes/pi/model-catalog.js +87 -0
- package/dist/agent-runtimes/pi/routed-session.js +1464 -0
- package/dist/agent-runtimes/pi/runtime.js +534 -0
- package/dist/agent-runtimes/pi/tool-compiler.js +69 -0
- package/dist/apps/chat/agent-profiles.js +40 -23
- package/dist/apps/chat/agent-store.js +111 -64
- package/dist/apps/chat/chat-api-routes.js +1 -1
- package/dist/apps/chat/chat-request-normalizers.js +47 -0
- package/dist/apps/chat/data/chat-data-mappers.js +25 -9
- package/dist/apps/chat/data/history-query-service.js +108 -0
- package/dist/apps/chat/data/session-query-service.js +24 -3
- package/dist/apps/chat/data/timeline-query-service.js +3 -3
- package/dist/apps/chat/model-catalog.js +1 -55
- package/dist/apps/chat/provider-auth-actions.js +171 -23
- package/dist/apps/chat/stream.js +12 -0
- package/dist/apps/chat/trace-v2.js +1 -0
- package/dist/apps/chat/trace.js +126 -415
- package/dist/apps/chat/web-app.js +582 -157
- package/dist/apps/chat-ui/assets/{dist-BTLtT_Vf.js → dist-9v2ZXT6V.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CMk1aPug.js → dist-B1LVAytl.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CcwA_IWN.js → dist-C6LPDFXU.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-DKOthbxr.js → dist-DVtXxfHc.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-ls2I6BIw.js → dist-DW4Qrfbd.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-D1rAtRWs.js → dist-DmbsHdMC.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-C1JQRskW.js → dist-DyvwuSFO.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-DfpaylQ-.js → dist-I26VB0QO.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-D10bTFD5.js → dist-RtHbJRPV.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-5KpmmBBZ.js → dist-sZgJkWZb.js} +1 -1
- package/dist/apps/chat-ui/assets/index-BPbNvcZe.css +1 -0
- package/dist/apps/chat-ui/assets/index-CIOf2uL2.js +237 -0
- package/dist/apps/chat-ui/index.html +2 -2
- package/dist/apps/chat-vscode-web/assets/index-1ivRyjFs.js +41 -0
- package/dist/apps/chat-vscode-web/index.html +1 -1
- package/dist/auth/login-actions.js +5 -251
- package/dist/cli-session/localSessionSource.js +8 -1
- package/dist/core/context-build.js +124 -20
- package/dist/core/default-profile.js +8 -0
- package/dist/core/profiles.js +30 -3
- package/dist/core/routed-session.js +5 -1446
- package/dist/core/runtime.js +5 -561
- package/dist/core/session-router.js +637 -83
- package/dist/data/cli.js +20 -3
- package/dist/data/schema.js +104 -1
- package/dist/data/session-store.js +24 -1
- package/dist/debug/events.js +25 -10
- package/dist/debug/failures.js +23 -3
- package/dist/debug/index.js +24 -6
- package/dist/debug/messages.js +87 -7
- package/dist/debug/persisted-payloads.js +31 -0
- package/dist/debug/pty.js +7 -6
- package/dist/debug/runtime-binding.js +29 -0
- package/dist/debug/session.js +137 -0
- package/dist/debug/summary.js +12 -0
- package/dist/debug/telemetry.js +28 -0
- package/dist/debug/tools.js +12 -2
- package/dist/debug/trace.js +154 -76
- package/dist/gateway/server.js +87 -2
- package/dist/gateway/tool.js +5 -5
- package/dist/index.js +21 -2
- package/dist/loops/tools.js +13 -12
- package/dist/mcp/agent-context.js +13 -4
- package/dist/mcp/client.js +10 -6
- package/dist/mcp/config.js +5 -2
- package/dist/mcp/runtime-session.js +166 -0
- package/dist/plugins/builtin.js +193 -53
- package/dist/plugins/codex-native.js +29 -0
- package/dist/plugins/omp.js +57 -0
- package/dist/plugins/registry.js +66 -2
- package/dist/runs/tools.js +26 -25
- package/dist/session-ui/terminalRows.js +2 -2
- package/dist/sessions/pibo-data-store.js +125 -16
- package/dist/sessions/runtime-binding.js +107 -0
- package/dist/sessions/sqlite-store.js +239 -18
- package/dist/sessions/store.js +86 -7
- package/dist/shared/trace-engine.js +18 -9
- package/dist/shared/trace-event-projection.js +29 -11
- package/dist/shared/{trace-transcript.js → trace-history.js} +193 -195
- package/dist/shared/trace-order.js +9 -4
- package/dist/shared/trace-page-merge.js +1 -1
- package/dist/signals/projector.js +20 -2
- package/dist/signals/registry.js +11 -0
- package/dist/subagents/tool.js +8 -6
- package/dist/tools/codex-browser.js +20 -19
- package/dist/tools/codex-compat.js +10 -9
- package/dist/tools/codex-image-generation.js +8 -6
- package/dist/tools/contract.js +45 -0
- package/dist/tools/credential-registry.js +182 -0
- package/dist/tools/mcp-bridge.js +511 -0
- package/dist/tools/payload-writer.js +17 -0
- package/dist/tools/runtime/tool.js +10 -9
- package/dist/tools/schema.js +9 -0
- package/dist/tools/session-service.js +193 -0
- package/dist/tools/session-tool-set.js +85 -0
- package/dist/web-annotations/tools.js +17 -16
- package/docs/README.md +11 -0
- package/package.json +3 -2
- package/skills/builtin/pibo-agent-runtime-adapter/SKILL.md +183 -0
- package/skills/builtin/pibo-agent-runtime-adapter/evals/README.md +10 -0
- package/skills/builtin/pibo-agent-runtime-adapter/evals/evals.json +45 -0
- package/skills/builtin/pibo-agent-runtime-adapter/evals/fixtures/orion-full-harness.md +60 -0
- package/skills/builtin/pibo-agent-runtime-adapter/evals/fixtures/relay-partial-harness.md +52 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/capabilities-and-designer.md +194 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/history-debug-and-security.md +213 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/interfaces-and-registration.md +214 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/lifecycle-bindings-and-events.md +193 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/portable-delivery-and-native-behavior.md +226 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/testing-migration-and-validation.md +256 -0
- package/dist/apps/chat-ui/assets/index-C2YI0xfw.js +0 -237
- package/dist/apps/chat-ui/assets/index-E0RmuCkY.css +0 -1
- package/dist/apps/chat-vscode-web/assets/index-D-tSsXLG.js +0 -41
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { PiboToolMcpBridge, } from "./mcp-bridge.js";
|
|
3
|
+
import { createPiboSessionToolDefinitions } from "./session-tool-set.js";
|
|
4
|
+
function sessionKey(piboSessionId, sessionGeneration) {
|
|
5
|
+
return `${piboSessionId}\u0000${sessionGeneration}`;
|
|
6
|
+
}
|
|
7
|
+
function assertIdentifier(value, label) {
|
|
8
|
+
const normalized = value.trim();
|
|
9
|
+
if (!normalized)
|
|
10
|
+
throw new Error(`${label} is required`);
|
|
11
|
+
return normalized;
|
|
12
|
+
}
|
|
13
|
+
export class PiboPortableToolService {
|
|
14
|
+
bridge;
|
|
15
|
+
sessions = new Map();
|
|
16
|
+
constructor(options = {}) {
|
|
17
|
+
this.bridge = options.bridge ?? new PiboToolMcpBridge({
|
|
18
|
+
payloadWriter: options.payloadWriter,
|
|
19
|
+
resolveTools: (scope) => this.resolveTools(scope.piboSessionId, scope.sessionGeneration),
|
|
20
|
+
isSessionGenerationActive: (scope) => this.sessions.get(sessionKey(scope.piboSessionId, scope.sessionGeneration))?.active === true,
|
|
21
|
+
resolveExecutionContext: (scope) => {
|
|
22
|
+
const record = this.sessions.get(sessionKey(scope.piboSessionId, scope.sessionGeneration));
|
|
23
|
+
return record
|
|
24
|
+
? {
|
|
25
|
+
piboSessionId: record.input.piboSessionId,
|
|
26
|
+
piboRoomId: record.input.piboRoomId,
|
|
27
|
+
profileName: record.input.profile.profileName,
|
|
28
|
+
cwd: record.input.cwd,
|
|
29
|
+
getActiveMessage: record.input.getActiveMessage,
|
|
30
|
+
getConversationEntries: record.getConversationEntries,
|
|
31
|
+
}
|
|
32
|
+
: {};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
createSession(input) {
|
|
37
|
+
const piboSessionId = assertIdentifier(input.piboSessionId, "piboSessionId");
|
|
38
|
+
const runtimeInstanceId = assertIdentifier(input.runtimeInstanceId, "runtimeInstanceId");
|
|
39
|
+
const adapterId = assertIdentifier(input.adapterId, "adapterId");
|
|
40
|
+
const cwd = assertIdentifier(input.cwd, "cwd");
|
|
41
|
+
const sessionGeneration = input.sessionGeneration
|
|
42
|
+
? assertIdentifier(input.sessionGeneration, "sessionGeneration")
|
|
43
|
+
: randomUUID();
|
|
44
|
+
const key = sessionKey(piboSessionId, sessionGeneration);
|
|
45
|
+
const record = {
|
|
46
|
+
key,
|
|
47
|
+
active: true,
|
|
48
|
+
input: {
|
|
49
|
+
...input,
|
|
50
|
+
piboSessionId,
|
|
51
|
+
runtimeInstanceId,
|
|
52
|
+
adapterId,
|
|
53
|
+
cwd,
|
|
54
|
+
},
|
|
55
|
+
controllers: {
|
|
56
|
+
subagentRunner: input.subagentRunner,
|
|
57
|
+
runToolController: input.runToolController,
|
|
58
|
+
runtimeToolController: input.runtimeToolController,
|
|
59
|
+
codexBrowserController: input.codexBrowserController,
|
|
60
|
+
},
|
|
61
|
+
getConversationEntries: input.getConversationEntries,
|
|
62
|
+
sessionGeneration,
|
|
63
|
+
};
|
|
64
|
+
this.sessions.set(key, record);
|
|
65
|
+
return this.createSessionHandle(record);
|
|
66
|
+
}
|
|
67
|
+
async dispose() {
|
|
68
|
+
for (const record of this.sessions.values()) {
|
|
69
|
+
record.active = false;
|
|
70
|
+
this.bridge.credentials.revokeSessionGeneration(record.input.piboSessionId, record.sessionGeneration);
|
|
71
|
+
this.bridge.closeSessionGeneration(record.input.piboSessionId, record.sessionGeneration);
|
|
72
|
+
}
|
|
73
|
+
this.sessions.clear();
|
|
74
|
+
await this.bridge.stop();
|
|
75
|
+
}
|
|
76
|
+
createDefinitions(record, options = {}) {
|
|
77
|
+
if (!record.active)
|
|
78
|
+
throw new Error(`Portable tool session for "${record.input.piboSessionId}" is disposed.`);
|
|
79
|
+
return createPiboSessionToolDefinitions({
|
|
80
|
+
profile: record.input.profile,
|
|
81
|
+
toolContext: {
|
|
82
|
+
piboSessionId: record.input.piboSessionId,
|
|
83
|
+
piboRoomId: record.input.piboRoomId,
|
|
84
|
+
profileName: record.input.profile.profileName,
|
|
85
|
+
cwd: record.input.cwd,
|
|
86
|
+
getActiveMessage: record.input.getActiveMessage,
|
|
87
|
+
getConversationEntries: record.getConversationEntries,
|
|
88
|
+
},
|
|
89
|
+
...record.controllers,
|
|
90
|
+
nativeYieldableTools: options.nativeYieldableTools,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
resolveTools(piboSessionId, generation) {
|
|
94
|
+
const record = this.sessions.get(sessionKey(piboSessionId, generation));
|
|
95
|
+
if (!record?.active)
|
|
96
|
+
return [];
|
|
97
|
+
return this.createDefinitions(record).filter((tool) => tool.portable !== false);
|
|
98
|
+
}
|
|
99
|
+
createSessionHandle(record) {
|
|
100
|
+
return {
|
|
101
|
+
piboSessionId: record.input.piboSessionId,
|
|
102
|
+
runtimeInstanceId: record.input.runtimeInstanceId,
|
|
103
|
+
adapterId: record.input.adapterId,
|
|
104
|
+
sessionGeneration: record.sessionGeneration,
|
|
105
|
+
createDefinitions: (options) => this.createDefinitions(record, options),
|
|
106
|
+
configureControllers: (controllers) => {
|
|
107
|
+
if (!record.active)
|
|
108
|
+
throw new Error(`Portable tool session for "${record.input.piboSessionId}" is disposed.`);
|
|
109
|
+
record.controllers = { ...record.controllers, ...controllers };
|
|
110
|
+
},
|
|
111
|
+
setConversationEntriesProvider: (provider) => {
|
|
112
|
+
if (!record.active)
|
|
113
|
+
throw new Error(`Portable tool session for "${record.input.piboSessionId}" is disposed.`);
|
|
114
|
+
record.getConversationEntries = provider;
|
|
115
|
+
},
|
|
116
|
+
issueMcpAccess: async (options = {}) => {
|
|
117
|
+
if (!record.active)
|
|
118
|
+
throw new Error(`Portable tool session for "${record.input.piboSessionId}" is disposed.`);
|
|
119
|
+
const availableToolNames = this.createDefinitions(record)
|
|
120
|
+
.filter((tool) => tool.portable !== false)
|
|
121
|
+
.map((tool) => tool.name);
|
|
122
|
+
const requested = options.allowedToolNames
|
|
123
|
+
? [...new Set(options.allowedToolNames)]
|
|
124
|
+
: availableToolNames;
|
|
125
|
+
const available = new Set(availableToolNames);
|
|
126
|
+
const unavailable = requested.filter((name) => !available.has(name));
|
|
127
|
+
if (unavailable.length > 0) {
|
|
128
|
+
throw new Error(`Portable MCP tools are unavailable for this session: ${unavailable.join(", ")}`);
|
|
129
|
+
}
|
|
130
|
+
const address = await this.bridge.start();
|
|
131
|
+
const issued = this.bridge.issueCredential({
|
|
132
|
+
piboSessionId: record.input.piboSessionId,
|
|
133
|
+
piboRoomId: record.input.piboRoomId,
|
|
134
|
+
profileName: record.input.profile.profileName,
|
|
135
|
+
runtimeInstanceId: record.input.runtimeInstanceId,
|
|
136
|
+
adapterId: record.input.adapterId,
|
|
137
|
+
sessionGeneration: record.sessionGeneration,
|
|
138
|
+
cwd: record.input.cwd,
|
|
139
|
+
allowedToolNames: requested,
|
|
140
|
+
}, options.ttlMs);
|
|
141
|
+
return {
|
|
142
|
+
url: address.url,
|
|
143
|
+
token: issued.token,
|
|
144
|
+
credentialId: issued.info.credentialId,
|
|
145
|
+
expiresAt: issued.info.expiresAt,
|
|
146
|
+
allowedToolNames: [...issued.info.allowedToolNames],
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
renewMcpAccess: (token, ttlMs) => {
|
|
150
|
+
const current = this.bridge.credentials.authenticate(token, { touch: false });
|
|
151
|
+
if (current.piboSessionId !== record.input.piboSessionId
|
|
152
|
+
|| current.sessionGeneration !== record.sessionGeneration) {
|
|
153
|
+
throw new Error("Tool credential belongs to a different Pibo runtime session generation.");
|
|
154
|
+
}
|
|
155
|
+
const renewed = this.bridge.credentials.renew(token, ttlMs);
|
|
156
|
+
const address = this.bridge.getAddress();
|
|
157
|
+
if (!address)
|
|
158
|
+
throw new Error("Pibo tool MCP bridge is not running.");
|
|
159
|
+
return {
|
|
160
|
+
url: address.url,
|
|
161
|
+
token,
|
|
162
|
+
credentialId: renewed.credentialId,
|
|
163
|
+
expiresAt: renewed.expiresAt,
|
|
164
|
+
allowedToolNames: [...renewed.allowedToolNames],
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
revokeMcpAccess: (token) => {
|
|
168
|
+
let current;
|
|
169
|
+
try {
|
|
170
|
+
current = this.bridge.credentials.authenticate(token, { touch: false });
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
if (current.piboSessionId !== record.input.piboSessionId
|
|
176
|
+
|| current.sessionGeneration !== record.sessionGeneration)
|
|
177
|
+
return false;
|
|
178
|
+
const revoked = this.bridge.credentials.revoke(token);
|
|
179
|
+
if (revoked)
|
|
180
|
+
this.bridge.closeCredentialSessions(current.credentialId);
|
|
181
|
+
return revoked;
|
|
182
|
+
},
|
|
183
|
+
dispose: () => {
|
|
184
|
+
if (!record.active)
|
|
185
|
+
return;
|
|
186
|
+
record.active = false;
|
|
187
|
+
this.sessions.delete(record.key);
|
|
188
|
+
this.bridge.credentials.revokeSessionGeneration(record.input.piboSessionId, record.sessionGeneration);
|
|
189
|
+
this.bridge.closeSessionGeneration(record.input.piboSessionId, record.sessionGeneration);
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createPiboGoalToolDefinitions, PIBO_GOAL_TOOL_NAMES } from "../loops/tools.js";
|
|
2
|
+
import { createRunToolDefinitions } from "../runs/tools.js";
|
|
3
|
+
import { createSubagentToolDefinitions } from "../subagents/tool.js";
|
|
4
|
+
import { CODEX_BROWSER_TOOL_NAMES, createCodexBrowserToolDefinitions, } from "./codex-browser.js";
|
|
5
|
+
import { createCodexCompatToolDefinitions } from "./codex-compat.js";
|
|
6
|
+
import { createRuntimeToolDefinition } from "./runtime/tool.js";
|
|
7
|
+
export function isRuntimeToolProfile(tool) {
|
|
8
|
+
return tool.builtInPiboTool === "runtime" || tool.name === "runtime";
|
|
9
|
+
}
|
|
10
|
+
export function isEnabledRuntimeToolProfile(tool) {
|
|
11
|
+
return tool.enabled !== false && isRuntimeToolProfile(tool);
|
|
12
|
+
}
|
|
13
|
+
export function isCodexBrowserToolProfile(tool) {
|
|
14
|
+
return tool.builtInPiboTool === "codex_browser" || CODEX_BROWSER_TOOL_NAMES.includes(tool.name);
|
|
15
|
+
}
|
|
16
|
+
export function isEnabledCodexBrowserToolProfile(tool) {
|
|
17
|
+
return tool.enabled !== false && isCodexBrowserToolProfile(tool);
|
|
18
|
+
}
|
|
19
|
+
export function isGeneratedPiboTool(name) {
|
|
20
|
+
return name === "runtime"
|
|
21
|
+
|| name.startsWith("pibo_subagent_")
|
|
22
|
+
|| name.startsWith("pibo_run_")
|
|
23
|
+
|| PIBO_GOAL_TOOL_NAMES.includes(name);
|
|
24
|
+
}
|
|
25
|
+
function hasEnabledToolDefinition(tool) {
|
|
26
|
+
return tool.enabled !== false && (tool.definition !== undefined || tool.createDefinition !== undefined);
|
|
27
|
+
}
|
|
28
|
+
function getToolDefinition(tool, context = {}) {
|
|
29
|
+
if (tool.definition)
|
|
30
|
+
return tool.definition;
|
|
31
|
+
return tool.createDefinition(context);
|
|
32
|
+
}
|
|
33
|
+
/** Assemble the selected Pibo-managed tool set without importing any harness package. */
|
|
34
|
+
export function createPiboSessionToolDefinitions(options) {
|
|
35
|
+
const { profile } = options;
|
|
36
|
+
const runtimeProfileTool = profile.tools.find(isEnabledRuntimeToolProfile);
|
|
37
|
+
const runtimeTool = runtimeProfileTool && options.runtimeToolController
|
|
38
|
+
? createRuntimeToolDefinition(options.runtimeToolController)
|
|
39
|
+
: undefined;
|
|
40
|
+
const selectedCodexBrowserToolNames = profile.tools
|
|
41
|
+
.filter(isEnabledCodexBrowserToolProfile)
|
|
42
|
+
.map((tool) => tool.name);
|
|
43
|
+
const codexBrowserTools = options.codexBrowserController
|
|
44
|
+
? createCodexBrowserToolDefinitions(options.codexBrowserController, selectedCodexBrowserToolNames)
|
|
45
|
+
: [];
|
|
46
|
+
const profileTools = profile.tools
|
|
47
|
+
.filter((tool) => !isRuntimeToolProfile(tool) && !isCodexBrowserToolProfile(tool))
|
|
48
|
+
.filter(hasEnabledToolDefinition);
|
|
49
|
+
const profileToolDefinitions = profileTools.map((tool) => getToolDefinition(tool, options.toolContext));
|
|
50
|
+
const codexCompatTools = profile.toolPackages.codexCompat === true
|
|
51
|
+
? createCodexCompatToolDefinitions()
|
|
52
|
+
: [];
|
|
53
|
+
const goalTools = profile.toolPackages.goalControl !== false
|
|
54
|
+
? createPiboGoalToolDefinitions(options.toolContext ?? {})
|
|
55
|
+
: [];
|
|
56
|
+
const subagentTools = options.subagentRunner
|
|
57
|
+
? createSubagentToolDefinitions(profile.subagents, options.subagentRunner)
|
|
58
|
+
: [];
|
|
59
|
+
const nativeYieldableTools = [...(options.nativeYieldableTools ?? [])];
|
|
60
|
+
const yieldableTools = [
|
|
61
|
+
...nativeYieldableTools,
|
|
62
|
+
...profileTools
|
|
63
|
+
.filter((tool) => tool.yieldable !== false)
|
|
64
|
+
.map((tool) => getToolDefinition(tool, options.toolContext)),
|
|
65
|
+
...(runtimeTool && runtimeProfileTool?.yieldable !== false ? [runtimeTool] : []),
|
|
66
|
+
...codexBrowserTools.filter((definition) => profile.tools.find((tool) => tool.name === definition.name)?.yieldable !== false),
|
|
67
|
+
...subagentTools,
|
|
68
|
+
...codexCompatTools,
|
|
69
|
+
];
|
|
70
|
+
const runTools = profile.toolPackages.runControl === true
|
|
71
|
+
&& options.runToolController
|
|
72
|
+
&& yieldableTools.length > 0
|
|
73
|
+
? createRunToolDefinitions(yieldableTools, options.runToolController)
|
|
74
|
+
: [];
|
|
75
|
+
return [
|
|
76
|
+
...nativeYieldableTools,
|
|
77
|
+
...profileToolDefinitions,
|
|
78
|
+
...(runtimeTool ? [runtimeTool] : []),
|
|
79
|
+
...codexBrowserTools,
|
|
80
|
+
...subagentTools,
|
|
81
|
+
...codexCompatTools,
|
|
82
|
+
...goalTools,
|
|
83
|
+
...runTools,
|
|
84
|
+
];
|
|
85
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import { piboStringEnum } from "../tools/schema.js";
|
|
3
|
+
import { definePiboTool } from "../tools/contract.js";
|
|
3
4
|
import { WEB_ANNOTATION_STATUSES, } from "./types.js";
|
|
4
5
|
import { createDefaultWebAnnotationStore } from "./store.js";
|
|
5
6
|
import { assertWebAnnotationStatusTransition, sanitizeWebAnnotationText, WEB_ANNOTATION_LIMITS } from "./validation.js";
|
|
@@ -169,14 +170,14 @@ function assertLifecycleTransition(annotation, action) {
|
|
|
169
170
|
assertWebAnnotationStatusTransition(annotation.status, nextStatus);
|
|
170
171
|
}
|
|
171
172
|
function createListTool(store, context) {
|
|
172
|
-
return
|
|
173
|
+
return definePiboTool({
|
|
173
174
|
name: "web_annotations_list",
|
|
174
|
-
|
|
175
|
+
title: "Web Annotations List",
|
|
175
176
|
description: "List bounded web annotations for the current Pibo session or an explicitly authorized session.",
|
|
176
177
|
promptSnippet: "List web annotations for this Pibo session. Use status and limit to keep output compact.",
|
|
177
|
-
|
|
178
|
+
inputSchema: Type.Object({
|
|
178
179
|
piboSessionId: Type.Optional(Type.String({ description: "Optional Pibo Session ID; defaults to current runtime session." })),
|
|
179
|
-
status: Type.Optional(
|
|
180
|
+
status: Type.Optional(piboStringEnum([...WEB_ANNOTATION_STATUSES], { description: "Optional annotation status filter." })),
|
|
180
181
|
limit: Type.Optional(Type.Number({ description: "Maximum annotations to return; capped." })),
|
|
181
182
|
}),
|
|
182
183
|
async execute(_toolCallId, params) {
|
|
@@ -196,12 +197,12 @@ function createListTool(store, context) {
|
|
|
196
197
|
});
|
|
197
198
|
}
|
|
198
199
|
function createGetTool(store, context) {
|
|
199
|
-
return
|
|
200
|
+
return definePiboTool({
|
|
200
201
|
name: "web_annotations_get",
|
|
201
|
-
|
|
202
|
+
title: "Web Annotations Get",
|
|
202
203
|
description: "Get one authorized web annotation with bounded target metadata.",
|
|
203
204
|
promptSnippet: "Get one web annotation by id to inspect target metadata, source hints, note, status, and thread summary.",
|
|
204
|
-
|
|
205
|
+
inputSchema: Type.Object({
|
|
205
206
|
annotationId: Type.String({ description: "Web annotation id." }),
|
|
206
207
|
piboSessionId: Type.Optional(Type.String({ description: "Optional Pibo Session ID; defaults to current runtime session." })),
|
|
207
208
|
}),
|
|
@@ -223,12 +224,12 @@ function createGetTool(store, context) {
|
|
|
223
224
|
}
|
|
224
225
|
function createLifecycleTool(name, store, context) {
|
|
225
226
|
const action = name === "web_annotations_acknowledge" ? "acknowledge" : name === "web_annotations_resolve" ? "resolve" : "dismiss";
|
|
226
|
-
return
|
|
227
|
+
return definePiboTool({
|
|
227
228
|
name,
|
|
228
|
-
|
|
229
|
+
title: name.replaceAll("_", " "),
|
|
229
230
|
description: `${action[0].toUpperCase()}${action.slice(1)} an authorized web annotation.`,
|
|
230
231
|
promptSnippet: `${action[0].toUpperCase()}${action.slice(1)} a web annotation after inspecting it and deciding the lifecycle update is appropriate.`,
|
|
231
|
-
|
|
232
|
+
inputSchema: Type.Object({
|
|
232
233
|
annotationId: Type.String({ description: "Web annotation id." }),
|
|
233
234
|
piboSessionId: Type.Optional(Type.String({ description: "Optional Pibo Session ID; defaults to current runtime session." })),
|
|
234
235
|
summary: Type.Optional(Type.String({ description: "Optional work summary. Used by acknowledge/resolve." })),
|
|
@@ -259,14 +260,14 @@ function createLifecycleTool(name, store, context) {
|
|
|
259
260
|
});
|
|
260
261
|
}
|
|
261
262
|
function createWatchTool(store, context) {
|
|
262
|
-
return
|
|
263
|
+
return definePiboTool({
|
|
263
264
|
name: "web_annotations_watch",
|
|
264
|
-
|
|
265
|
+
title: "Web Annotations Watch",
|
|
265
266
|
description: "Wait briefly for new web annotations in the current or authorized Pibo session.",
|
|
266
267
|
promptSnippet: "Wait briefly for new web annotations. Keep timeout bounded; use run-control if a longer background wait is needed.",
|
|
267
|
-
|
|
268
|
+
inputSchema: Type.Object({
|
|
268
269
|
piboSessionId: Type.Optional(Type.String({ description: "Optional Pibo Session ID; defaults to current runtime session." })),
|
|
269
|
-
status: Type.Optional(
|
|
270
|
+
status: Type.Optional(piboStringEnum([...WEB_ANNOTATION_STATUSES], { description: "Optional annotation status filter." })),
|
|
270
271
|
afterCreatedAt: Type.Optional(Type.String({ description: "Only return annotations created after this ISO timestamp." })),
|
|
271
272
|
limit: Type.Optional(Type.Number({ description: "Maximum annotations to return; capped." })),
|
|
272
273
|
timeoutMs: Type.Optional(Type.Number({ description: "Bounded wait timeout in milliseconds; capped." })),
|
package/docs/README.md
CHANGED
|
@@ -13,6 +13,17 @@ docs/
|
|
|
13
13
|
legacy/ Previous documentation set kept for reference
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
## Active architecture change
|
|
17
|
+
|
|
18
|
+
The multi-agent runtime adapter work is tracked in:
|
|
19
|
+
|
|
20
|
+
- [proposal](specs/changes/multi-agent-runtime-adapters/proposal.md)
|
|
21
|
+
- [behavioral specification](specs/changes/multi-agent-runtime-adapters/spec.md)
|
|
22
|
+
- [technical design](specs/changes/multi-agent-runtime-adapters/design.md)
|
|
23
|
+
- [task ledger](specs/changes/multi-agent-runtime-adapters/tasks.md)
|
|
24
|
+
- [implementation plan](plans/multi-agent-runtime-adapter-implementation-plan-2026-08-14.md)
|
|
25
|
+
- [architecture investigation](reports/multi-agent-runtime-adapter-architecture-investigation-2026-08-14.md)
|
|
26
|
+
|
|
16
27
|
## Rules
|
|
17
28
|
|
|
18
29
|
- Put normal/current project docs and other canonical documentation in `docs/project/`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pasko70/pibo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/workflows",
|
|
@@ -82,7 +82,8 @@
|
|
|
82
82
|
"react-markdown": "^10.1.0",
|
|
83
83
|
"react-virtuoso": "^4.18.6",
|
|
84
84
|
"remark-gfm": "^4.0.1",
|
|
85
|
-
"tailwindcss": "^4.2.4"
|
|
85
|
+
"tailwindcss": "^4.2.4",
|
|
86
|
+
"typebox": "1.1.38"
|
|
86
87
|
},
|
|
87
88
|
"devDependencies": {
|
|
88
89
|
"@tanstack/router-plugin": "^1.167.28",
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pibo-agent-runtime-adapter
|
|
3
|
+
description: Design, assess, implement, review, or debug a Pibo Agent Runtime Adapter for any agent harness. Use this whenever work mentions adding or replacing a harness, runtime drivers or configured instances, native Codex or another app server, capability matrices, frozen runtime bindings, Agent Designer runtime support, portable Pibo tools or MCP delivery, selected skills and context, approvals, model and reasoning controls, native history, or partial-adapter limitations. This skill requires evidence for every capability and prevents invented support, Pi-shaped generic abstractions, native prompt replacement, and global harness configuration mutation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Pibo Agent Runtime Adapter
|
|
7
|
+
|
|
8
|
+
Build adapters around Pibo's runtime SPI, not around assumptions from Pi, Codex, or another harness. Preserve the harness's native model loop, base prompt, standard tools, and native session state. Pibo remains the product and orchestration layer.
|
|
9
|
+
|
|
10
|
+
## Non-negotiable rules
|
|
11
|
+
|
|
12
|
+
1. Use `PiboSession.id` as the product routing identity. Treat native thread/session ids as adapter-scoped binding data.
|
|
13
|
+
2. Separate the runtime driver, configured runtime instance, live adapter, and live runtime session. They are not interchangeable.
|
|
14
|
+
3. Declare only capabilities proven by an official protocol/schema, harness source, deterministic fixture, or exact-binary integration.
|
|
15
|
+
4. Treat unknown behavior as unsupported or pending evidence. Never mark it supported because a similar harness usually has it.
|
|
16
|
+
5. Preserve the harness's native prompt and native tools. Do not place Pibo's Pi base prompt over another harness. Add only explicit Pibo product contributions through documented harness channels.
|
|
17
|
+
6. Never mutate user-global harness configuration to start one Pibo Session. Use session/generation-scoped state.
|
|
18
|
+
7. Keep generic orchestration free of harness imports and literal adapter branches when capability dispatch is sufficient.
|
|
19
|
+
8. Make process, credential, generated-file, subscription, and tool-bridge cleanup adapter/session owned and idempotent.
|
|
20
|
+
9. Keep Pibo product history primary for new routed turns. Put native history parsing behind the adapter.
|
|
21
|
+
10. Make unsupported Designer selections visible with a reason and reject invalid saves/starts instead of silently dropping them.
|
|
22
|
+
|
|
23
|
+
## Start with evidence
|
|
24
|
+
|
|
25
|
+
Before proposing code:
|
|
26
|
+
|
|
27
|
+
1. Read `GLOSSARY.md` and repository instructions.
|
|
28
|
+
2. Inspect the current SPI in `src/agent-runtime/`; do not rely on an older architecture document alone.
|
|
29
|
+
3. Identify the exact harness executable, SDK, protocol version, generated schema, and official documentation available in the target environment.
|
|
30
|
+
4. Record each candidate capability with its evidence and confidence.
|
|
31
|
+
5. Classify the adapter as full, partial, or not currently viable.
|
|
32
|
+
|
|
33
|
+
Use this evidence table:
|
|
34
|
+
|
|
35
|
+
| Pibo capability | Harness surface | Evidence | Classification | Gap or constraint |
|
|
36
|
+
|---|---|---|---|---|
|
|
37
|
+
| Text turns | method/event names | official schema or source | native / degraded / unsupported / pending | concrete limitation |
|
|
38
|
+
|
|
39
|
+
A capability is not proven by a product announcement, terminal screenshot, or undocumented output that merely resembles a protocol.
|
|
40
|
+
|
|
41
|
+
## Choose the task path
|
|
42
|
+
|
|
43
|
+
### Assess or review a harness
|
|
44
|
+
|
|
45
|
+
Produce:
|
|
46
|
+
|
|
47
|
+
1. exact harness/version evidence;
|
|
48
|
+
2. a complete Pibo capability matrix;
|
|
49
|
+
3. native prompt/tool/session preservation analysis;
|
|
50
|
+
4. full versus partial classification;
|
|
51
|
+
5. unsupported and pending-evidence items with Designer behavior;
|
|
52
|
+
6. security and isolation risks;
|
|
53
|
+
7. implementation, test, migration, and exact Pibo2 validation plan.
|
|
54
|
+
|
|
55
|
+
Do not write implementation code until the evidence matrix is coherent.
|
|
56
|
+
|
|
57
|
+
### Implement an adapter
|
|
58
|
+
|
|
59
|
+
Proceed in this order:
|
|
60
|
+
|
|
61
|
+
1. Add protocol fixtures/client code inside `src/agent-runtimes/<adapter>/`.
|
|
62
|
+
2. Define a typed driver descriptor and parse operator config.
|
|
63
|
+
3. Create configured adapter instances through the plugin registry.
|
|
64
|
+
4. Implement one adapter-owned live session with prompt, events, abort, status, binding, and disposal.
|
|
65
|
+
5. Declare the smallest truthful capability set and implement every method implied by it.
|
|
66
|
+
6. Map profiles and Agent Designer selections through capability validation.
|
|
67
|
+
7. Deliver Pibo tools/resources through the existing session services instead of rebuilding them in the adapter.
|
|
68
|
+
8. Add native history only through `inspectHistory()` and `readHistory()`.
|
|
69
|
+
9. Run the fake/shared contract suite, adapter fixtures, migration tests, full suite, package checks, and exact-candidate Pibo2 scenarios.
|
|
70
|
+
10. Document remaining limitations; do not upgrade a capability claim until its end-to-end proof exists.
|
|
71
|
+
|
|
72
|
+
## Read references progressively
|
|
73
|
+
|
|
74
|
+
Load only the references needed for the current step:
|
|
75
|
+
|
|
76
|
+
- [Interfaces and registration](references/interfaces-and-registration.md) — descriptor, driver, configured instance, adapter, live session, plugin registration, diagnostics, source boundaries, extension points.
|
|
77
|
+
- [Capabilities and Agent Designer](references/capabilities-and-designer.md) — complete capability tree, method implications, delivery classifications, profile validation, full/partial behavior.
|
|
78
|
+
- [Lifecycle, bindings, and events](references/lifecycle-bindings-and-events.md) — lazy binding, resume, missing/error states, CAS, event normalization, approvals, user input, abort, disposal.
|
|
79
|
+
- [Portable delivery and native behavior](references/portable-delivery-and-native-behavior.md) — native prompt/tool preservation, Pibo tools, scoped MCP, external MCP, skills, context, subagents, models/auth/reasoning.
|
|
80
|
+
- [History, debug, and security](references/history-debug-and-security.md) — product history, native providers, payloads, runtime-aware debug, redaction, credential/process/file isolation.
|
|
81
|
+
- [Testing, migration, and Pibo2 validation](references/testing-migration-and-validation.md) — contract tests, full/partial fixtures, import boundaries, migrations, package checks, exact-server validation, evidence reports.
|
|
82
|
+
|
|
83
|
+
## Capability truth rules
|
|
84
|
+
|
|
85
|
+
Use these classifications consistently:
|
|
86
|
+
|
|
87
|
+
- **Native** — the harness exposes the behavior directly through a documented API/protocol.
|
|
88
|
+
- **Direct** — Pibo can deliver its own capability in-process without changing native harness behavior.
|
|
89
|
+
- **MCP** — the harness accepts Pibo's session-scoped MCP bridge over a declared transport.
|
|
90
|
+
- **Materialized** — Pibo can provide isolated generated files/config through a documented harness surface.
|
|
91
|
+
- **Degraded** — a real supported path exists but fidelity is lower; declare mode and reason.
|
|
92
|
+
- **Unsupported** — no safe supported path exists; declare a user-facing reason.
|
|
93
|
+
- **Pending evidence** — do not put this in runtime capabilities as support. Keep it in design/evidence notes until proven.
|
|
94
|
+
|
|
95
|
+
A partial adapter is valid. A dishonest full adapter is not.
|
|
96
|
+
|
|
97
|
+
## Minimal implementation shape
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
Pibo plugin
|
|
101
|
+
-> registerAgentRuntimeDriver(driver)
|
|
102
|
+
-> registerAgentRuntimeInstance(definition)
|
|
103
|
+
|
|
104
|
+
AgentRuntimeDriver
|
|
105
|
+
-> descriptor + config schema
|
|
106
|
+
-> defaultConfig / parseConfig / create
|
|
107
|
+
|
|
108
|
+
AgentRuntimeAdapter (configured instance)
|
|
109
|
+
-> diagnose / validateProfile / openSession
|
|
110
|
+
-> optional models, profile inspection, history, binding resolution
|
|
111
|
+
-> capability-backed auth status/start/complete/cancel/logout
|
|
112
|
+
|
|
113
|
+
AgentRuntimeSession (one live Pibo Session)
|
|
114
|
+
-> getBinding / subscribe / prompt / abort / dispose / getStatus
|
|
115
|
+
-> optional steer and capability-gated controls
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Do not let the configured adapter hold mutable state that belongs to one live session unless it is keyed, isolated, and disposed by session generation. Provider-login flow state is configured-instance state: keep native ids/verifiers adapter-private, expose only Pibo flow ids, bound it by timeout, and close owned processes on every terminal path.
|
|
119
|
+
|
|
120
|
+
## Partial-adapter decision pattern
|
|
121
|
+
|
|
122
|
+
When the harness lacks a feature:
|
|
123
|
+
|
|
124
|
+
1. cite the missing or insufficient official surface;
|
|
125
|
+
2. set the corresponding capability to `false` or `unsupportedAgentRuntimeCapability(reason)`;
|
|
126
|
+
3. omit the control method that would falsely imply support;
|
|
127
|
+
4. let profile validation reject selected unsupported resources;
|
|
128
|
+
5. keep the Designer control visible but disabled with the same reason;
|
|
129
|
+
6. test the negative path;
|
|
130
|
+
7. name the evidence that could justify enabling it later.
|
|
131
|
+
|
|
132
|
+
Do not scrape terminal output, inject Pi's prompt, expose global MCP config, or synthesize fake native history merely to make a capability appear available.
|
|
133
|
+
|
|
134
|
+
## Review checklist
|
|
135
|
+
|
|
136
|
+
### Architecture
|
|
137
|
+
|
|
138
|
+
- [ ] Adapter id and configured instance id are stable and distinct.
|
|
139
|
+
- [ ] Config uses a JSON Schema and typed parser.
|
|
140
|
+
- [ ] Generic modules do not import harness packages.
|
|
141
|
+
- [ ] Availability/version diagnostics are safe and actionable.
|
|
142
|
+
|
|
143
|
+
### Session and binding
|
|
144
|
+
|
|
145
|
+
- [ ] `PiboSession.id` remains the product id.
|
|
146
|
+
- [ ] Initial `unbound` and persistent `bound` behavior is explicit.
|
|
147
|
+
- [ ] Missing native state becomes `missing`, not a replacement conversation.
|
|
148
|
+
- [ ] Binding changes use revisions/CAS and repair/rebind rules.
|
|
149
|
+
- [ ] Abort and dispose are bounded and idempotent.
|
|
150
|
+
|
|
151
|
+
### Events and controls
|
|
152
|
+
|
|
153
|
+
- [ ] Native events map to Pibo semantic events with stable correlation ids.
|
|
154
|
+
- [ ] Every advertised optional control has an implementation.
|
|
155
|
+
- [ ] Approvals and structured input preserve request identity.
|
|
156
|
+
- [ ] Errors are normalized and secrets are removed.
|
|
157
|
+
|
|
158
|
+
### Portable capabilities
|
|
159
|
+
|
|
160
|
+
- [ ] Native prompt and tools remain intact.
|
|
161
|
+
- [ ] Pibo-managed tools use direct delivery or session-scoped MCP.
|
|
162
|
+
- [ ] External MCP, skills, and context are selected-only and generation-scoped.
|
|
163
|
+
- [ ] Secret values remain in scoped environment/process state, not generated files or inspection.
|
|
164
|
+
- [ ] Pibo subagents route through child Pibo Sessions and may select another runtime.
|
|
165
|
+
|
|
166
|
+
### Product surfaces
|
|
167
|
+
|
|
168
|
+
- [ ] Agent Designer shows truthful support, modes, diagnostics, and disabled reasons.
|
|
169
|
+
- [ ] Model/auth/reasoning/options come from the selected runtime instance.
|
|
170
|
+
- [ ] Auth capabilities name methods, completion mode, cancellation/logout, and credential scope.
|
|
171
|
+
- [ ] Product auth mutations require an explicit configured-runtime target; session compatibility uses the frozen binding.
|
|
172
|
+
- [ ] Missing required auth status is unauthenticated/failed, never implicitly connected.
|
|
173
|
+
- [ ] Public auth results use opaque Pibo flow ids and omit native login ids, separate OAuth state/verifier fields, tokens, API keys, account identifiers, and credential paths/content; ephemeral authorization URLs/codes are never captured as evidence.
|
|
174
|
+
- [ ] Product history, trace, debug, telemetry, Cron, Loop, workflow, and TUI behavior are assessed.
|
|
175
|
+
|
|
176
|
+
### Verification
|
|
177
|
+
|
|
178
|
+
- [ ] Shared adapter contract and deterministic protocol fixtures pass.
|
|
179
|
+
- [ ] Unsupported capability selections fail in tests.
|
|
180
|
+
- [ ] Existing data migrates without id/native-state rewriting.
|
|
181
|
+
- [ ] Package contents include adapter assets and skills.
|
|
182
|
+
- [ ] Exact candidate passes authenticated Pibo2 restart/resume, failure, cleanup, API, debug, and browser checks.
|
|
183
|
+
- [ ] Evidence report records commit, version, timings, limitations, and cleanup.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Runtime Adapter Skill Evals
|
|
2
|
+
|
|
3
|
+
`evals.json` contains two realistic capability-assessment tasks:
|
|
4
|
+
|
|
5
|
+
1. `orion-full-harness.md` exposes a broad official app-server surface but deliberately omits clone, tree navigation, audio, and structured output. A passing answer must scaffold the full useful adapter without claiming the omitted options.
|
|
6
|
+
2. `relay-partial-harness.md` exposes only one-shot text/final-output execution and applies product pressure to fake a full adapter. A passing answer must remain partial, reject unsafe shortcuts, and map every gap to visible product behavior and evidence needs.
|
|
7
|
+
|
|
8
|
+
Run each prompt with the bundled skill and with no skill. The with-skill executor must expose a read tool so the agent can follow the skill's progressive reference links; an execution limited to the top-level `SKILL.md` is not a complete eval. Grade every `expectations` statement against the produced assessment/scaffold. The partial eval is the primary anti-hallucination gate: any claim of durable Relay session ids, native history, MCP, skills/context, model catalog, reasoning, approvals, or Pi prompt replacement fails the eval even if the rest of the answer is useful.
|
|
9
|
+
|
|
10
|
+
The repository test `test/agent-runtime-adapter-skill.test.mjs` validates the eval schema, fixture completeness, anti-invention expectations, progressive references, and registration surface. Model-run outputs should be stored outside the shipped skill directory and summarized under `docs/reports/` when a configured evaluator is available.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "pibo-agent-runtime-adapter",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Using the supplied Orion App Server 2.4.1 fixture, assess whether Orion can be a full Pibo Agent Runtime Adapter and produce a review-ready implementation scaffold. Include the capability matrix, driver/config/adapter/session boundaries, binding and event maps, Agent Designer behavior, portable delivery, history/debug/security, tests, migration, and exact Pibo2 validation. Do not assume methods that are not in the fixture.",
|
|
7
|
+
"expected_output": "A complete evidence-based full-adapter assessment and scaffold that preserves Orion's native prompt/tools, uses Pibo's existing scoped tool/resource services, leaves undocumented clone/tree/audio/structured-output capabilities disabled, and names concrete tests and Pibo2 evidence.",
|
|
8
|
+
"files": [
|
|
9
|
+
"evals/fixtures/orion-full-harness.md"
|
|
10
|
+
],
|
|
11
|
+
"expectations": [
|
|
12
|
+
"Separates the driver, configured runtime instance, adapter, live session, and Pibo routed session responsibilities.",
|
|
13
|
+
"Builds a complete capability matrix and does not claim clone, native tree navigation, audio input, or structured output.",
|
|
14
|
+
"Uses a frozen Pibo runtime binding with stable Orion thread id, CAS binding, exact resume, and visible missing-thread behavior.",
|
|
15
|
+
"Maps documented Orion turn, assistant, reasoning, tool, usage, plan, diff, approval, user-input, compaction, and history surfaces to Pibo contracts.",
|
|
16
|
+
"Preserves Orion's base prompt and native tools, leaves preserveNativeTools enabled, and uses additive instruction fields only.",
|
|
17
|
+
"Uses Pibo's session-scoped MCP bridge for selected Pibo tools and the runtime resource session for external MCP, skills, context, scoped environment, and cleanup.",
|
|
18
|
+
"Explains Agent Designer support, delivery modes, remaining disabled controls, model/auth/reasoning options, and save/start validation.",
|
|
19
|
+
"Defines adapter-owned process correlation, bounded messages/backpressure, graceful shutdown, crash handling, abort, and idempotent disposal.",
|
|
20
|
+
"Implements native history only through inspectHistory and readHistory while keeping Pibo product history primary.",
|
|
21
|
+
"Names shared contract, deterministic protocol, import-boundary, migration, product integration, full-suite, package, exact Pibo2 restart/resume, browser, failure, and cleanup evidence."
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": 2,
|
|
26
|
+
"prompt": "The product manager insists that Relay Agent 0.9.0 must be presented as a full Pibo runtime. Use the supplied fixture to assess and scaffold the truthful integration. Explain exactly what can ship, what Agent Designer must disable or reject, and what evidence would be required to add the missing capabilities later.",
|
|
27
|
+
"expected_output": "An explicitly partial adapter assessment that refuses invented support, terminal-log history scraping, global config credential writes, and Pi prompt replacement; provides the smallest useful text/final-output adapter; and turns every missing capability into a visible reason plus negative tests.",
|
|
28
|
+
"files": [
|
|
29
|
+
"evals/fixtures/relay-partial-harness.md"
|
|
30
|
+
],
|
|
31
|
+
"expectations": [
|
|
32
|
+
"Explicitly classifies Relay as partial rather than yielding to the request to call it full.",
|
|
33
|
+
"Rejects debug-log history scraping, writes to user-global Relay config, Pibo credential persistence, and replacing Relay's native prompt with the Pi prompt.",
|
|
34
|
+
"Declares text input and one final assistant message only, with assistant deltas, reasoning, tools, usage, plans, diffs, images, audio, and structured output unsupported.",
|
|
35
|
+
"Keeps lifecycle persistence, resume, attach, native session listing, fork, clone, tree, and native history unsupported and does not treat invocationId as a native session id.",
|
|
36
|
+
"Uses an unbound Pibo binding and explains that independent Relay invocations do not provide native conversation continuity.",
|
|
37
|
+
"Does not claim a model catalog, model switching, reasoning controls, auth status, approvals, structured input, compaction, or context usage from the arbitrary --model flag.",
|
|
38
|
+
"Marks Pibo-managed tools, external MCP, skills, context, and Pibo subagents unsupported because no safe delivery surface exists.",
|
|
39
|
+
"Maps unsupported selections to visible Agent Designer disabled reasons and save/start validation errors instead of silently dropping them.",
|
|
40
|
+
"Uses Pibo product history for visible turns and refuses to fabricate native history.",
|
|
41
|
+
"Defines session-owned process termination for abort/disposal, negative capability tests, exact package/Pibo2 checks for the supported path, and specific official surfaces needed before capabilities can be enabled."
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|