@signalridge/pi-subagents 1.10.1 → 1.10.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.
- package/CHANGELOG.md +10 -0
- package/package.json +2 -2
- package/src/agent-runner.ts +5 -3
- package/src/supervisor.ts +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.10.3
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- e939fa0: Fix Pi 0.85.1 tool-approval argument forwarding, ambient-auth and credential-specific model routing, and cross-platform workspace session validation.
|
|
7
|
+
|
|
8
|
+
## 1.10.2
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 65e2481: Show supervisor questions in subagent input dialogs and identify the asking agent by its actual name.
|
|
12
|
+
|
|
3
13
|
## 1.10.1
|
|
4
14
|
### Patch Changes
|
|
5
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalridge/pi-subagents",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.3",
|
|
4
4
|
"description": "Signalridge's managed subagent runtime with workflow-owned orchestration RPC.",
|
|
5
5
|
"author": "tintinweb and signalridge contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"croner": "^10.0.1",
|
|
35
35
|
"@signalridge/pi-subagents-protocol": "^1.5.0",
|
|
36
36
|
"@signalridge/pi-ui": "^1.3.1",
|
|
37
|
-
"nanoid": "^5.
|
|
37
|
+
"nanoid": "^5.1.16"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsc",
|
package/src/agent-runner.ts
CHANGED
|
@@ -314,7 +314,7 @@ export function installExtensionToolScope(
|
|
|
314
314
|
}
|
|
315
315
|
// Scope first, then approval: a tool this agent may not use at all is
|
|
316
316
|
// refused without troubling the user about it.
|
|
317
|
-
const gated = await askGate?.(context.toolCall.name,
|
|
317
|
+
const gated = await askGate?.(context.toolCall.name, context.args);
|
|
318
318
|
if (gated) return gated;
|
|
319
319
|
return priorBeforeToolCall?.(context, signal);
|
|
320
320
|
};
|
|
@@ -1126,7 +1126,9 @@ export async function runAgent(
|
|
|
1126
1126
|
const supervisorTools =
|
|
1127
1127
|
ctx.hasUI && !isolated && options.supervisorQuestions !== false
|
|
1128
1128
|
? createSupervisorTool({
|
|
1129
|
-
|
|
1129
|
+
// Use the canonical agent type, not display_name: the question must
|
|
1130
|
+
// identify the actual subagent that requested the decision.
|
|
1131
|
+
agentLabel: agentConfig?.name ?? type,
|
|
1130
1132
|
ask: {
|
|
1131
1133
|
input: (title, placeholder) => ctx.ui.input(title, placeholder),
|
|
1132
1134
|
select: (title, choices) => ctx.ui.select(title, choices),
|
|
@@ -1310,7 +1312,7 @@ export async function runAgent(
|
|
|
1310
1312
|
const priorBeforeToolCall = session.agent.beforeToolCall;
|
|
1311
1313
|
session.agent.beforeToolCall = async (context, signal) => {
|
|
1312
1314
|
const run = async () => {
|
|
1313
|
-
const gated = await askGate(context.toolCall.name,
|
|
1315
|
+
const gated = await askGate(context.toolCall.name, context.args);
|
|
1314
1316
|
if (gated) return gated;
|
|
1315
1317
|
return priorBeforeToolCall?.(context, signal);
|
|
1316
1318
|
};
|
package/src/supervisor.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface SupervisorAsk {
|
|
|
36
36
|
export interface SupervisorToolContext {
|
|
37
37
|
/** The parent's UI. Omitted when there is no human to ask. */
|
|
38
38
|
ask?: SupervisorAsk;
|
|
39
|
-
/**
|
|
39
|
+
/** Actual type/name of the asking agent, for the prompt title. */
|
|
40
40
|
agentLabel: string;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -82,7 +82,10 @@ export function createSupervisorTool(context: SupervisorToolContext) {
|
|
|
82
82
|
const question = truncateCodePoints(sanitizeDisplayText(params.question), MAX_QUESTION, "…").trim();
|
|
83
83
|
if (!question) return textResult("Ask a non-empty question.", true);
|
|
84
84
|
|
|
85
|
-
const title = `${context.agentLabel} asks`;
|
|
85
|
+
const title = `${sanitizeDisplayText(context.agentLabel)} asks`;
|
|
86
|
+
// Pi 0.85.1 ignores ui.input()'s placeholder argument. Keep the
|
|
87
|
+
// question in the title so the human sees it in both old and new hosts.
|
|
88
|
+
const promptTitle = `${title}: ${question}`;
|
|
86
89
|
const options = (params.options ?? [])
|
|
87
90
|
.map((option) => truncateCodePoints(sanitizeDisplayText(option), MAX_OPTION, "…").trim())
|
|
88
91
|
.filter((option) => option.length > 0)
|
|
@@ -92,8 +95,8 @@ export function createSupervisorTool(context: SupervisorToolContext) {
|
|
|
92
95
|
try {
|
|
93
96
|
answer =
|
|
94
97
|
options.length > 0
|
|
95
|
-
? await ask.select(
|
|
96
|
-
: await ask.input(
|
|
98
|
+
? await ask.select(promptTitle, options)
|
|
99
|
+
: await ask.input(promptTitle);
|
|
97
100
|
} catch (error: unknown) {
|
|
98
101
|
// A dialog that cannot open must not fail the child's whole run; it
|
|
99
102
|
// is told nobody answered and carries on under its own judgement.
|