@akagilnc/pi-workflow-roles 0.1.5899 → 0.1.5903
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/pi/adapter.js +3 -1
- package/package.json +3 -3
- package/src/host-contracts.ts +1 -1
- package/src/pi/adapter.ts +3 -1
package/dist/pi/adapter.js
CHANGED
|
@@ -186,7 +186,9 @@ export function createPiRoleHostAdapter(pi, options = {}) {
|
|
|
186
186
|
}
|
|
187
187
|
return folded;
|
|
188
188
|
};
|
|
189
|
-
|
|
189
|
+
// Pi 1.2+ also fires this for runs started by sendMessage(triggerTurn): messageType "custom", no prompt.
|
|
190
|
+
// Older Pi sends no messageType at all, so only an explicit "custom" drops the prompt.
|
|
191
|
+
const result = handler({ ...(value.messageType === "custom" ? {} : { prompt: value.prompt }), systemPrompt: value.systemPrompt, systemPromptOptions: value.systemPromptOptions }, projected);
|
|
190
192
|
if (result instanceof Promise)
|
|
191
193
|
return result.then(fold);
|
|
192
194
|
return fold(result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akagilnc/pi-workflow-roles",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5903",
|
|
4
4
|
"description": "Soul-bound workflow roles for Pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@earendil-works/pi-ai": "
|
|
79
|
-
"@earendil-works/pi-coding-agent": "
|
|
78
|
+
"@earendil-works/pi-ai": "latest",
|
|
79
|
+
"@earendil-works/pi-coding-agent": "latest",
|
|
80
80
|
"@types/node": "latest",
|
|
81
81
|
"esbuild": "^0.28.1",
|
|
82
82
|
"tsx": "latest",
|
package/src/host-contracts.ts
CHANGED
|
@@ -286,7 +286,7 @@ export function courtAttemptIdFromHostContext(context: HostContext): string | un
|
|
|
286
286
|
|
|
287
287
|
export type HostToolDefinition<S extends TSchema = TSchema, D = unknown, C = HostContext> = { name: string; label: string; description: string; promptSnippet?: string; parameters: S; execute( toolCallId: string, params: Static<S>, signal: AbortSignal | undefined, update: ((result: HostToolResult<D>) => void) | undefined, context: C, ): Promise<HostToolResult<D>>; };
|
|
288
288
|
|
|
289
|
-
type BeforeAgentStartEvent = { prompt
|
|
289
|
+
type BeforeAgentStartEvent = { prompt?: string; systemPrompt: string; systemPromptOptions: { skills?: readonly unknown[]; contextFiles?: readonly unknown[]; appendSystemPrompt?: string } };
|
|
290
290
|
type InputEvent = { text: string; images?: Array<{ type: "image"; data: string; mimeType: string }>; source?: string };
|
|
291
291
|
type ToolCallEvent = { toolName: string; toolCallId: string; input: Record<string, unknown> };
|
|
292
292
|
type ToolResultEvent = { toolName: string; toolCallId: string; isError: boolean; content: HostToolResult["content"]; details: unknown };
|
package/src/pi/adapter.ts
CHANGED
|
@@ -229,7 +229,9 @@ export function createPiRoleHostAdapter(
|
|
|
229
229
|
}
|
|
230
230
|
return folded;
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
// Pi 1.2+ also fires this for runs started by sendMessage(triggerTurn): messageType "custom", no prompt.
|
|
233
|
+
// Older Pi sends no messageType at all, so only an explicit "custom" drops the prompt.
|
|
234
|
+
const result = handler({ ...(value.messageType === "custom" ? {} : { prompt: value.prompt }), systemPrompt: value.systemPrompt, systemPromptOptions: value.systemPromptOptions }, projected);
|
|
233
235
|
if (result instanceof Promise) return result.then(fold);
|
|
234
236
|
return fold(result);
|
|
235
237
|
});
|