@skydiveai/pi-extensions 0.1.0 → 0.1.251-beta.0
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/README.md +10 -0
- package/dist/index.d.mts +56 -3
- package/dist/index.mjs +2575 -932
- package/package.json +3 -9
package/README.md
CHANGED
|
@@ -14,6 +14,16 @@ Extensions (load agent workspace content):
|
|
|
14
14
|
daemon session tracking, sandbox heartbeats, OTel self-tracing. Every
|
|
15
15
|
session must include these.
|
|
16
16
|
|
|
17
|
+
Proactive evaluation sessions additionally receive `submit_proactive_action_result`.
|
|
18
|
+
The tool schema comes from the authenticated sandbox API, which validates and
|
|
19
|
+
stores the result for the originating evaluation. Ordinary sessions do not
|
|
20
|
+
discover or register this tool. Submission does not deliver a message; the
|
|
21
|
+
worker reconciles it only after the run succeeds.
|
|
22
|
+
|
|
23
|
+
The native tool reaches agents through the normal reviewed pi-extensions
|
|
24
|
+
release and opt-in harness upgrade, not by rewriting their harness files.
|
|
25
|
+
Already-started v1/v2/v3 evaluations retain text-result compatibility.
|
|
26
|
+
|
|
17
27
|
Platform layer:
|
|
18
28
|
|
|
19
29
|
- `createHarness` — composes @skydiveai/pi-server's protocol handlers
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { A2AOptions, Middleware, ProtocolsOptions } from "@skydiveai/pi-server";
|
|
3
3
|
import { ExtensionFactory } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
import { Type } from "typebox";
|
|
5
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
4
6
|
import * as _$qs from "qs";
|
|
5
7
|
import * as _$express from "express";
|
|
6
8
|
import { Logger } from "pino";
|
|
@@ -101,6 +103,13 @@ declare const _default: ExtensionFactory;
|
|
|
101
103
|
//#region src/extensions/memory.d.ts
|
|
102
104
|
declare const memoryExtension: ExtensionFactory;
|
|
103
105
|
//#endregion
|
|
106
|
+
//#region src/extensions/provider-api-compat.d.ts
|
|
107
|
+
/**
|
|
108
|
+
* Keep older harnesses compatible with provider-native model specs that use
|
|
109
|
+
* the OpenAI-compatible wire through the transparent proxy.
|
|
110
|
+
*/
|
|
111
|
+
declare const providerApiCompatExtension: ExtensionFactory;
|
|
112
|
+
//#endregion
|
|
104
113
|
//#region src/extensions/soul.d.ts
|
|
105
114
|
declare const soulExtension: ExtensionFactory;
|
|
106
115
|
//#endregion
|
|
@@ -130,7 +139,7 @@ declare function platformExtensions({
|
|
|
130
139
|
}): ExtensionFactory[];
|
|
131
140
|
//#endregion
|
|
132
141
|
//#region src/tool-update-loop.d.ts
|
|
133
|
-
type SessionLike = {
|
|
142
|
+
type SessionLike$1 = {
|
|
134
143
|
reload: () => Promise<void>;
|
|
135
144
|
bindExtensions: (vars: Record<string, unknown>) => Promise<void>;
|
|
136
145
|
sendCustomMessage: (msg: {
|
|
@@ -144,7 +153,7 @@ type SessionLike = {
|
|
|
144
153
|
};
|
|
145
154
|
type SessionWithAgent = {
|
|
146
155
|
agent: unknown;
|
|
147
|
-
} & SessionLike;
|
|
156
|
+
} & SessionLike$1;
|
|
148
157
|
declare function installToolUpdateAutoStop({
|
|
149
158
|
session,
|
|
150
159
|
log
|
|
@@ -155,9 +164,53 @@ declare function installToolUpdateAutoStop({
|
|
|
155
164
|
declare function runToolUpdateLoop({
|
|
156
165
|
session,
|
|
157
166
|
log
|
|
167
|
+
}: {
|
|
168
|
+
session: SessionLike$1;
|
|
169
|
+
log: Logger;
|
|
170
|
+
}): Promise<void>;
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/closing-text-loop.d.ts
|
|
173
|
+
type TextBlock = {
|
|
174
|
+
type: 'text';
|
|
175
|
+
text?: string;
|
|
176
|
+
};
|
|
177
|
+
type ContentBlock = TextBlock | {
|
|
178
|
+
type: string;
|
|
179
|
+
};
|
|
180
|
+
type SessionMessage = {
|
|
181
|
+
role: string;
|
|
182
|
+
content?: string | ContentBlock[];
|
|
183
|
+
stopReason?: string;
|
|
184
|
+
};
|
|
185
|
+
type SessionLike = {
|
|
186
|
+
messages: SessionMessage[];
|
|
187
|
+
sendCustomMessage: (msg: {
|
|
188
|
+
customType: string;
|
|
189
|
+
content: string;
|
|
190
|
+
display: boolean;
|
|
191
|
+
details: Record<string, unknown>;
|
|
192
|
+
}, options: {
|
|
193
|
+
triggerTurn: boolean;
|
|
194
|
+
}) => Promise<void>;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* True when the assistant produced no visible text since the human's last
|
|
198
|
+
* message this turn — i.e. the turn ended on tool calls / thinking only.
|
|
199
|
+
*
|
|
200
|
+
* We scan from the end back to the most recent `user` message (the human turn
|
|
201
|
+
* that triggered this run) and inspect every `assistant` message after it.
|
|
202
|
+
* A string-content assistant message (rare, but pi allows it) counts as text
|
|
203
|
+
* when non-blank. `toolResult` and custom messages are ignored.
|
|
204
|
+
*/
|
|
205
|
+
declare function turnEndedWithoutVisibleText(messages: readonly SessionMessage[]): boolean;
|
|
206
|
+
declare function runClosingTextLoop({
|
|
207
|
+
session,
|
|
208
|
+
log,
|
|
209
|
+
enabled
|
|
158
210
|
}: {
|
|
159
211
|
session: SessionLike;
|
|
160
212
|
log: Logger;
|
|
213
|
+
enabled?: boolean;
|
|
161
214
|
}): Promise<void>;
|
|
162
215
|
//#endregion
|
|
163
|
-
export { type CreateHarnessOptions, all, createHarness, createHealthHandler, createPlatformEnvMiddleware, installToolUpdateAutoStop, isPlatformConfigLoaded, loadPlatformConfig, localToolsExtension, _default as mcpExtension, memoryExtension, platformExtensions, runToolUpdateLoop, soulExtension, toolCallEnvExtension };
|
|
216
|
+
export { type CreateHarnessOptions, all, createHarness, createHealthHandler, createPlatformEnvMiddleware, installToolUpdateAutoStop, isPlatformConfigLoaded, loadPlatformConfig, localToolsExtension, _default as mcpExtension, memoryExtension, platformExtensions, providerApiCompatExtension, runClosingTextLoop, runToolUpdateLoop, soulExtension, toolCallEnvExtension, turnEndedWithoutVisibleText };
|