@vicary/pi-subagents 0.87.0 → 0.88.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/CHANGELOG.md +50 -0
- package/bundle/agents.js +3 -3
- package/bundle/child-tool-plan.js +3 -3
- package/bundle/{chunk-3CVOAS77.js → chunk-2DIEL4WG.js} +2 -2
- package/bundle/{chunk-75LVXBSA.js → chunk-2HKPEANZ.js} +114 -49
- package/bundle/{chunk-ESWW6XSX.js → chunk-47ZN7NKR.js} +1 -1
- package/bundle/{chunk-C3KWLXDH.js → chunk-4MVDMA5C.js} +9 -1
- package/bundle/{chunk-XV7RTWTS.js → chunk-4ZQBZDF3.js} +21 -6
- package/bundle/{chunk-LZKVUWIY.js → chunk-5EMPFFO4.js} +30 -5
- package/bundle/{chunk-OOE3R7IQ.js → chunk-6CG2VAG4.js} +2 -2
- package/bundle/{chunk-HDICKROY.js → chunk-7OX6O7DQ.js} +31 -14
- package/bundle/{chunk-Z4TR7MK6.js → chunk-AZPP3G4N.js} +14 -5
- package/bundle/{chunk-PUSTU4Q7.js → chunk-BKISQ5CJ.js} +130 -49
- package/bundle/{chunk-NMYBVCGP.js → chunk-CGWNA6EJ.js} +75 -44
- package/bundle/{chunk-PGU4TZV3.js → chunk-CPSUJHZE.js} +417 -455
- package/bundle/{chunk-W52LJANO.js → chunk-CYKNHFXB.js} +1 -1
- package/bundle/{chunk-SIAQXPJ4.js → chunk-D32H53HM.js} +21 -9
- package/bundle/{chunk-YEXKJJVS.js → chunk-DSHQWGHO.js} +4 -4
- package/bundle/{chunk-6O7YH2QV.js → chunk-GDR2ILWY.js} +1 -1
- package/bundle/{chunk-O7A26O6B.js → chunk-IYT7X46U.js} +6 -4
- package/bundle/{chunk-NJTSXIMG.js → chunk-JQTHG2ID.js} +12 -12
- package/bundle/{chunk-C5QWQSSM.js → chunk-KXW62VBU.js} +1 -1
- package/bundle/{chunk-BFF6YDK6.js → chunk-L4YY2TOE.js} +1 -1
- package/bundle/{chunk-2NY5PCKQ.js → chunk-LV3CPYXJ.js} +4 -4
- package/bundle/{chunk-2D2DQGC2.js → chunk-PYKBTBY6.js} +27 -10
- package/bundle/{chunk-M2VBGET6.js → chunk-RMZAAXIR.js} +7 -2
- package/bundle/{chunk-HTI7DD5D.js → chunk-V7SZMS6W.js} +2 -2
- package/bundle/{chunk-VFUFOZBU.js → chunk-W6HIYD2Z.js} +1 -1
- package/bundle/{chunk-USRX7QXD.js → chunk-XIA5GSEU.js} +2 -2
- package/bundle/{chunk-CTPAE36Y.js → chunk-YARY7JWU.js} +22 -0
- package/bundle/chunk-YDZ7BZD5.js +523 -0
- package/bundle/control-channel.js +2 -2
- package/bundle/index.js +1 -1
- package/bundle/intercom-bridge.js +2 -2
- package/bundle/preflight.js +9 -9
- package/bundle/project-panes.js +3 -3
- package/bundle/required-child-extensions.js +1 -1
- package/docs/agents.md +4 -2
- package/docs/configuration.md +4 -2
- package/docs/observability.md +2 -0
- package/docs/tool-reference.md +4 -1
- package/docs/workflows.md +3 -1
- package/package.json +3 -3
- package/skills/pi-subagents/SKILL.md +8 -2
- package/src/agents/agent-management.d.ts +1 -0
- package/src/agents/agent-management.js +12 -4
- package/src/agents/agents.d.ts +1 -0
- package/src/agents/agents.js +2 -2
- package/src/extension/config.d.ts +9 -0
- package/src/extension/config.js +13 -0
- package/src/extension/index.d.ts +1 -1
- package/src/extension/index.js +47 -23
- package/src/extension/schemas.d.ts +2 -0
- package/src/extension/schemas.js +1 -0
- package/src/extension/subagent-launch-tool.d.ts +6 -2
- package/src/extension/subagent-launch-tool.js +13 -9
- package/src/extension/tool-activation.js +20 -3
- package/src/runs/background/async-resume.js +2 -1
- package/src/runs/background/async-retention.d.ts +0 -2
- package/src/runs/background/async-retention.js +11 -5
- package/src/runs/background/async-status.d.ts +2 -0
- package/src/runs/background/async-status.js +4 -0
- package/src/runs/background/run-child-session.d.ts +2 -2
- package/src/runs/background/run-child-session.js +4 -7
- package/src/runs/background/stale-run-reconciler.js +17 -8
- package/src/runs/background/steering.d.ts +2 -11
- package/src/runs/background/steering.js +11 -6
- package/src/runs/background/subagent-runner.d.ts +0 -2
- package/src/runs/background/subagent-runner.js +73 -58
- package/src/runs/foreground/async-steering-action.js +24 -9
- package/src/runs/foreground/execution.js +32 -15
- package/src/runs/foreground/prompt-audit.js +1 -0
- package/src/runs/foreground/subagent-executor.d.ts +1 -8
- package/src/runs/foreground/subagent-executor.js +17 -21
- package/src/runs/shared/async-status-projection.d.ts +2 -0
- package/src/runs/shared/async-status-projection.js +10 -0
- package/src/runs/shared/child-launch.js +6 -3
- package/src/runs/shared/child-session.d.ts +1 -1
- package/src/runs/shared/child-session.js +24 -30
- package/src/runs/shared/mcp-config-sources.d.ts +2 -0
- package/src/runs/shared/mcp-direct-tool-allowlist.d.ts +5 -5
- package/src/runs/shared/mcp-direct-tool-allowlist.js +26 -15
- package/src/runs/shared/subagent-prompt-runtime.js +14 -2
- package/src/runs/shared/supervisor-wait-timer.d.ts +16 -0
- package/src/runs/shared/supervisor-wait-timer.js +61 -0
- package/src/shared/artifacts.d.ts +1 -0
- package/src/shared/artifacts.js +107 -9
- package/src/shared/compaction-interruption.d.ts +9 -0
- package/src/shared/compaction-interruption.js +47 -0
- package/src/shared/parent-wake.d.ts +3 -2
- package/src/shared/parent-wake.js +14 -3
- package/src/shared/reported-progress.d.ts +1 -0
- package/src/shared/reported-progress.js +12 -0
- package/src/shared/required-child-extensions.d.ts +2 -0
- package/src/shared/required-child-extensions.js +27 -0
- package/src/shared/status-format.d.ts +1 -0
- package/src/shared/status-format.js +1 -1
- package/src/shared/types.d.ts +9 -0
- package/src/shared/utils.d.ts +3 -1
- package/src/shared/utils.js +4 -0
- package/src/tui/fleet.d.ts +7 -2
- package/src/tui/fleet.js +22 -0
- package/src/tui/render.js +33 -2
- package/src/watchdog/permission-arbiter.js +1 -0
- package/src/watchdog/review.d.ts +0 -5
- package/src/watchdog/review.js +2 -1
- package/src/workflows/workflow-script-worker.js +3 -1
- package/bundle/chunk-XSDYTXHF.js +0 -242
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
snapshotRequiredChildExtensions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YARY7JWU.js";
|
|
4
4
|
import {
|
|
5
5
|
THINKING_LEVELS,
|
|
6
6
|
findConfiguredProjectRoot,
|
|
7
7
|
getAgentDir,
|
|
8
8
|
getConfigDirName,
|
|
9
9
|
getProjectConfigDir
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4MVDMA5C.js";
|
|
11
11
|
import {
|
|
12
12
|
TEMP_ROOT_DIR
|
|
13
13
|
} from "./chunk-JEZOSEWG.js";
|
|
@@ -509,17 +509,20 @@ function resolveMcpDirectToolResolution(mcpDirectTools, cwd = process.cwd(), run
|
|
|
509
509
|
const runtimeSelectionServers = /* @__PURE__ */ new Set([...selectedServers, ...selectedTools.keys()]);
|
|
510
510
|
const runtimeServers = resolveRuntimeMcpServers(config, runtimeSelectionServers, runtimeSnapshotHost);
|
|
511
511
|
const resolvedConfig = Object.keys(runtimeServers).length > 0 ? mergeConfigs(config, { mcpServers: runtimeServers }) : config;
|
|
512
|
-
|
|
512
|
+
const enabledSelectors = selectors.filter((selector) => resolvedConfig.mcpServers[selector.split("/", 1)[0]]?.disabled !== true);
|
|
513
|
+
validateSelectedServerDefinitions(resolvedConfig, enabledSelectors);
|
|
513
514
|
const runtime = Object.keys(runtimeServers).length > 0 ? { mcpConfig: resolvedConfig, runtimeServerNames: Object.keys(runtimeServers) } : {};
|
|
515
|
+
if (enabledSelectors.length === 0) return { selections: [], unresolvedSelectors: [], ...runtime };
|
|
514
516
|
const cache = loadMetadataCache();
|
|
515
|
-
if (!cache) return { selections: [], unresolvedSelectors:
|
|
517
|
+
if (!cache) return { selections: [], unresolvedSelectors: enabledSelectors, ...runtime };
|
|
516
518
|
const validMetadata = {};
|
|
517
519
|
for (const [serverName, definition] of Object.entries(resolvedConfig.mcpServers)) {
|
|
520
|
+
if (definition.disabled === true) continue;
|
|
518
521
|
const serverCache = cache.servers[serverName];
|
|
519
522
|
if (isServerCacheValid(serverCache, definition)) validMetadata[serverName] = serverCache;
|
|
520
523
|
}
|
|
521
524
|
const grant = planMcpDirectToolGrant({
|
|
522
|
-
selectors,
|
|
525
|
+
selectors: enabledSelectors,
|
|
523
526
|
servers: resolvedConfig.mcpServers,
|
|
524
527
|
metadata: validMetadata,
|
|
525
528
|
toolPrefix: resolvedConfig.settings?.toolPrefix
|
|
@@ -560,8 +563,8 @@ function formatUnresolvedBuiltinMcpSelectors(agentName, selectors) {
|
|
|
560
563
|
const subject = agentName ? `Agent '${agentName}'` : "Subagent";
|
|
561
564
|
return `${subject} selects MCP tools that Pi's built-in MCP does not offer: ${selectors.map((selector) => `mcp:${selector}`).join(", ")}. The server may be missing, disconnected, still connecting, or its tools hidden; check /mcp.`;
|
|
562
565
|
}
|
|
563
|
-
function extensionOnlyMcpServers(selections, host, cwd, projectTrusted) {
|
|
564
|
-
const registered = new Set(host.getMcpServers?.().map(({ name }) => name));
|
|
566
|
+
function extensionOnlyMcpServers(selections, host, cwd, projectTrusted, loadedByChild) {
|
|
567
|
+
const registered = new Set(host.getMcpServers?.().filter(({ extensionPath }) => !loadedByChild(extensionPath)).map(({ name }) => name));
|
|
565
568
|
const servers = [...new Set(selections.map(({ selector }) => selector.split("/")[0]))].filter((server) => registered.has(server));
|
|
566
569
|
if (servers.length === 0) return [];
|
|
567
570
|
const files = [path2.join(getAgentDir(), "mcp.json"), ...projectTrusted ? [path2.join(cwd, ".pi", "mcp.json")] : []];
|
|
@@ -714,11 +717,20 @@ function parseSettings(value) {
|
|
|
714
717
|
function mergeConfigs(base, next) {
|
|
715
718
|
const imports = [...base.imports ?? [], ...next.imports ?? []];
|
|
716
719
|
return {
|
|
717
|
-
mcpServers:
|
|
720
|
+
mcpServers: mergeServerDefinitions(base.mcpServers, next.mcpServers),
|
|
718
721
|
imports: imports.length ? [...new Set(imports)] : void 0,
|
|
719
722
|
settings: next.settings ? { ...base.settings, ...next.settings } : base.settings
|
|
720
723
|
};
|
|
721
724
|
}
|
|
725
|
+
function mergeServerDefinitions(base, next) {
|
|
726
|
+
const servers = { ...base };
|
|
727
|
+
for (const [name, definition] of Object.entries(next)) {
|
|
728
|
+
const previous = base[name];
|
|
729
|
+
if (previous && Object.keys(definition).every((key) => key === "disabled")) servers[name] = { ...previous, ...definition };
|
|
730
|
+
else servers[name] = previous?.disabled === void 0 ? definition : { disabled: previous.disabled, ...definition };
|
|
731
|
+
}
|
|
732
|
+
return servers;
|
|
733
|
+
}
|
|
722
734
|
function expandImports(config, cwd) {
|
|
723
735
|
if (!config.imports?.length) return config;
|
|
724
736
|
const importedServers = {};
|
|
@@ -738,7 +750,7 @@ function expandImports(config, cwd) {
|
|
|
738
750
|
return {
|
|
739
751
|
imports: config.imports,
|
|
740
752
|
settings: config.settings,
|
|
741
|
-
mcpServers:
|
|
753
|
+
mcpServers: mergeServerDefinitions(importedServers, config.mcpServers)
|
|
742
754
|
};
|
|
743
755
|
}
|
|
744
756
|
function resolveImportPath(importKind, cwd) {
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
remoteShellCommand,
|
|
5
5
|
runBoundedCommand,
|
|
6
6
|
sshMachineAccess
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GDR2ILWY.js";
|
|
8
8
|
import {
|
|
9
9
|
package_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6CG2VAG4.js";
|
|
11
11
|
import {
|
|
12
12
|
ensureSupervisorChannelDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CYKNHFXB.js";
|
|
14
14
|
import "./chunk-HXRB42AF.js";
|
|
15
15
|
import "./chunk-NIXWDZZV.js";
|
|
16
16
|
import {
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
resolveRexBinary,
|
|
35
35
|
rexCommandEnv,
|
|
36
36
|
rexGlobalArgs
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-4MVDMA5C.js";
|
|
38
38
|
import "./chunk-JEZOSEWG.js";
|
|
39
39
|
import "./chunk-YFCK7H2S.js";
|
|
40
40
|
import "./chunk-QXASAHIA.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
projectTimeoutRecovery,
|
|
9
9
|
readAsyncRecoveryDescriptor,
|
|
10
10
|
utf8Tail
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4ZQBZDF3.js";
|
|
12
12
|
import {
|
|
13
13
|
MAX_ARGS_BYTES,
|
|
14
14
|
MAX_ARGS_DEPTH,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
resultFilePath,
|
|
22
22
|
resultPayloadMatchesSessionRun,
|
|
23
23
|
resultPayloadPathForSessionRun
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CPSUJHZE.js";
|
|
25
25
|
import {
|
|
26
26
|
PROJECT_SUBAGENTS_RELATIVE_DIR
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-YDZ7BZD5.js";
|
|
28
28
|
import {
|
|
29
29
|
listBackgroundWorkWakeChannels,
|
|
30
30
|
snapshotBackgroundWork
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
waitToolName,
|
|
51
51
|
withSettingsFileLease,
|
|
52
52
|
writePrivateAtomicJson
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-4MVDMA5C.js";
|
|
54
54
|
import {
|
|
55
55
|
DIRS,
|
|
56
56
|
INTERCOM_DETACH_REQUEST_EVENT,
|
|
@@ -820,6 +820,7 @@ var SubagentParamProperties = {
|
|
|
820
820
|
description: 'Management/control only; omit for execution. validate accepts workflow: true or a script path. Discover actions with {action:"guide",options:{topic:"tool-reference"}}.'
|
|
821
821
|
})),
|
|
822
822
|
capabilities: Type2.Optional(Type2.Boolean({ description: "list: compact capability rows/details without system prompts." })),
|
|
823
|
+
search: Type2.Optional(Type2.String({ minLength: 1, description: "list: case-insensitive match on agent name, alias, or description." })),
|
|
823
824
|
name: Type2.Optional(Type2.String({ description: "schedule.create name." })),
|
|
824
825
|
id: Type2.Optional(Type2.String({
|
|
825
826
|
description: "Run id/prefix for status/control."
|
|
@@ -4401,6 +4402,7 @@ async function runWatchdogAttempt(ctx, request, options) {
|
|
|
4401
4402
|
hasDiff: diffBaseline !== void 0
|
|
4402
4403
|
});
|
|
4403
4404
|
const agent2 = new Agent({
|
|
4405
|
+
sessionId,
|
|
4404
4406
|
initialState: {
|
|
4405
4407
|
systemPrompt,
|
|
4406
4408
|
model: selection.model,
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rewriteSubagentPrompt
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AZPP3G4N.js";
|
|
4
4
|
import {
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6CG2VAG4.js";
|
|
7
7
|
import {
|
|
8
8
|
WATCHDOG_DIFF_TOOL_NAME,
|
|
9
9
|
captureWatchdogDiffBaseline,
|
|
10
10
|
createWatchdogDiffTool
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-IYT7X46U.js";
|
|
12
|
+
import "./chunk-4ZQBZDF3.js";
|
|
13
|
+
import "./chunk-CYKNHFXB.js";
|
|
14
14
|
import {
|
|
15
15
|
MODEL_ONLY_TOOL
|
|
16
16
|
} from "./chunk-HXRB42AF.js";
|
|
17
17
|
import "./chunk-W2BZS6UC.js";
|
|
18
18
|
import {
|
|
19
19
|
appendAgentRefinementOverlay
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-XIA5GSEU.js";
|
|
21
|
+
import "./chunk-CPSUJHZE.js";
|
|
22
22
|
import "./chunk-NIXWDZZV.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-47ZN7NKR.js";
|
|
24
24
|
import "./chunk-7F6RKT6W.js";
|
|
25
25
|
import {
|
|
26
26
|
assertNoToolModifierEntries
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-D32H53HM.js";
|
|
28
|
+
import "./chunk-YARY7JWU.js";
|
|
29
|
+
import "./chunk-YDZ7BZD5.js";
|
|
30
30
|
import {
|
|
31
31
|
HERDR_PI_MAX_FRAME_BYTES,
|
|
32
32
|
HERDR_PI_PROTOCOL,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
discoverAgents,
|
|
44
44
|
resolveExistingReadPaths,
|
|
45
45
|
resolveSkills
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-4MVDMA5C.js";
|
|
47
47
|
import "./chunk-JEZOSEWG.js";
|
|
48
48
|
import "./chunk-YFCK7H2S.js";
|
|
49
49
|
import "./chunk-QXASAHIA.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
validateCodeOwnedProfileRunner,
|
|
9
9
|
validatePermissionRules,
|
|
10
10
|
validateToolBudgetConfig
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4MVDMA5C.js";
|
|
12
12
|
|
|
13
13
|
// src/agents/runtime-agent-registry.ts
|
|
14
14
|
var RUNTIME_AGENT_REGISTRY_KEY = "pi-subagents.runtime-agents.v1";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
summarizeContextModes,
|
|
13
13
|
utf8Tail,
|
|
14
14
|
workflowPreflightLaneForRuntimeKey
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4ZQBZDF3.js";
|
|
16
16
|
import {
|
|
17
17
|
ownsRun
|
|
18
18
|
} from "./chunk-HXRB42AF.js";
|
|
@@ -34,11 +34,11 @@ import {
|
|
|
34
34
|
updateActiveRunIndex,
|
|
35
35
|
validateModelResponseAliases,
|
|
36
36
|
writeAsyncResultFile
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-CPSUJHZE.js";
|
|
38
38
|
import {
|
|
39
39
|
deliverStopRequest,
|
|
40
40
|
stopInboxClosedPath
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-W6HIYD2Z.js";
|
|
42
42
|
import {
|
|
43
43
|
SUBAGENT_STOPPED_MESSAGE,
|
|
44
44
|
formatDuration,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
waitToolName,
|
|
51
51
|
writeAtomicJson,
|
|
52
52
|
writePrivateAtomicJson
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-4MVDMA5C.js";
|
|
54
54
|
import {
|
|
55
55
|
DIRS
|
|
56
56
|
} from "./chunk-JEZOSEWG.js";
|
|
@@ -7,37 +7,37 @@ import {
|
|
|
7
7
|
safeTranscriptEvent,
|
|
8
8
|
steerAsyncRun,
|
|
9
9
|
steerWorkflowForegroundTarget
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7OX6O7DQ.js";
|
|
11
11
|
import {
|
|
12
12
|
FLEET_STATUS_WIDGET_KEY,
|
|
13
13
|
runningTone,
|
|
14
14
|
stepTaskSummary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5EMPFFO4.js";
|
|
16
16
|
import {
|
|
17
17
|
foregroundChildStateLabel,
|
|
18
18
|
formatAsyncRunTranscript,
|
|
19
19
|
stopAsyncRun
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LV3CPYXJ.js";
|
|
21
21
|
import {
|
|
22
22
|
contextModeBadge,
|
|
23
23
|
contextModeLabel,
|
|
24
24
|
decodeUtf8Tail,
|
|
25
25
|
listAsyncRuns
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4ZQBZDF3.js";
|
|
27
27
|
import {
|
|
28
28
|
reportSessionWarning
|
|
29
29
|
} from "./chunk-HXRB42AF.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-CPSUJHZE.js";
|
|
31
|
+
import "./chunk-W6HIYD2Z.js";
|
|
32
32
|
import "./chunk-NIXWDZZV.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-47ZN7NKR.js";
|
|
34
34
|
import "./chunk-7F6RKT6W.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-YARY7JWU.js";
|
|
36
36
|
import "./chunk-7J4ZXMY7.js";
|
|
37
37
|
import {
|
|
38
38
|
getArtifactPaths,
|
|
39
39
|
getArtifactsDir
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-YDZ7BZD5.js";
|
|
41
41
|
import {
|
|
42
42
|
snapshotExternalRuns
|
|
43
43
|
} from "./chunk-UKG4V45O.js";
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
formatTokens,
|
|
50
50
|
readStatus,
|
|
51
51
|
shortenPath
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-4MVDMA5C.js";
|
|
53
53
|
import {
|
|
54
54
|
DIRS
|
|
55
55
|
} from "./chunk-JEZOSEWG.js";
|
|
@@ -940,6 +940,10 @@ var SubagentFleetComponent = class {
|
|
|
940
940
|
actionBusy = false;
|
|
941
941
|
transcriptCache;
|
|
942
942
|
disposed = false;
|
|
943
|
+
// Undefined until a TUI first focuses the overlay, so a fleet rendered outside one still draws.
|
|
944
|
+
hasFocus;
|
|
945
|
+
// The component focused when the fleet opened (the overlay's preFocus).
|
|
946
|
+
openedOver;
|
|
943
947
|
refreshTimer;
|
|
944
948
|
refreshMs;
|
|
945
949
|
tui;
|
|
@@ -951,6 +955,7 @@ var SubagentFleetComponent = class {
|
|
|
951
955
|
keybindings;
|
|
952
956
|
constructor(tui, theme, state, done, options = {}) {
|
|
953
957
|
this.tui = tui;
|
|
958
|
+
this.openedOver = tui.getFocusedComponent?.();
|
|
954
959
|
this.viewport = new FleetViewport(() => this.tui.requestRender());
|
|
955
960
|
this.theme = theme;
|
|
956
961
|
this.markdownTheme = options.markdownTheme ?? getMarkdownTheme();
|
|
@@ -1120,6 +1125,14 @@ var SubagentFleetComponent = class {
|
|
|
1120
1125
|
scrollDetail(delta) {
|
|
1121
1126
|
this.viewport.scroll.scrollBy(delta);
|
|
1122
1127
|
}
|
|
1128
|
+
get focused() {
|
|
1129
|
+
return this.hasFocus === true;
|
|
1130
|
+
}
|
|
1131
|
+
set focused(value) {
|
|
1132
|
+
if (value === this.hasFocus) return;
|
|
1133
|
+
this.hasFocus = value;
|
|
1134
|
+
this.tui.requestRender();
|
|
1135
|
+
}
|
|
1123
1136
|
handleMouse(event) {
|
|
1124
1137
|
if (this.steerDraft !== void 0 || this.redoGuidanceDraft !== void 0 || this.stopConfirming || this.actionBusy) {
|
|
1125
1138
|
return { handled: true, render: false };
|
|
@@ -1417,6 +1430,10 @@ var SubagentFleetComponent = class {
|
|
|
1417
1430
|
return { header: [], body: this.withActionLines(lines) };
|
|
1418
1431
|
}
|
|
1419
1432
|
render(width) {
|
|
1433
|
+
if (this.hasFocus === false && this.tui.getFocusedComponent?.() !== this.openedOver) {
|
|
1434
|
+
this.renderedLayout = void 0;
|
|
1435
|
+
return [];
|
|
1436
|
+
}
|
|
1420
1437
|
const layout = fleetLayout(width, this.tui.terminal?.rows ?? 32, this.selected, this.snapshot.items);
|
|
1421
1438
|
this.renderedLayout = layout;
|
|
1422
1439
|
if (!layout) return [truncateToWidth2("Subagent fleet needs at least 36 columns. Esc closes.", width)];
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
validateAuthorityPolicy,
|
|
12
12
|
validateMissionStoreConfig,
|
|
13
13
|
validateModelResponseAliases
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CPSUJHZE.js";
|
|
15
15
|
import {
|
|
16
16
|
getAgentDir,
|
|
17
17
|
readStatus,
|
|
18
18
|
validatePermissionConfig,
|
|
19
19
|
writePrivateAtomicJson
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4MVDMA5C.js";
|
|
21
21
|
import {
|
|
22
22
|
FLEET_KEYBINDING_ACTIONS,
|
|
23
23
|
RUNNER_LAUNCHER_NAME_PATTERN,
|
|
@@ -702,6 +702,10 @@ function validateConfig(config) {
|
|
|
702
702
|
validateOrcaProgressTabsConfig(config.orcaProgressTabs);
|
|
703
703
|
validateRunnerLaunchersConfig(config.runnerLaunchers);
|
|
704
704
|
}
|
|
705
|
+
function resolveConfigDefaultTimeoutMs(raw) {
|
|
706
|
+
if (typeof raw !== "number" || !Number.isInteger(raw) || raw <= 0 || raw > 2147483647) return void 0;
|
|
707
|
+
return raw;
|
|
708
|
+
}
|
|
705
709
|
function getConfigPath() {
|
|
706
710
|
return path2.join(getAgentDir(), "extensions", "subagent", "config.json");
|
|
707
711
|
}
|
|
@@ -747,6 +751,7 @@ export {
|
|
|
747
751
|
acquireActiveAsyncCapacity,
|
|
748
752
|
transferActiveAsyncCapacity,
|
|
749
753
|
resolveScheduledStoreRoot,
|
|
754
|
+
resolveConfigDefaultTimeoutMs,
|
|
750
755
|
resolveAsyncByDefault,
|
|
751
756
|
loadConfig
|
|
752
757
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appendAgentRefinementOverlay
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XIA5GSEU.js";
|
|
4
4
|
import {
|
|
5
5
|
buildAgentMemoryInjection,
|
|
6
6
|
buildSkillInjection
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4MVDMA5C.js";
|
|
8
8
|
|
|
9
9
|
// src/runs/shared/effective-system-prompt.ts
|
|
10
10
|
function appendSection(prompt, section) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getProjectSubagentsDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YDZ7BZD5.js";
|
|
4
4
|
import {
|
|
5
5
|
discoverAgents,
|
|
6
6
|
formatUnknownAgentError,
|
|
7
7
|
resolveAgentName,
|
|
8
8
|
unknownAgentDiagnosticContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4MVDMA5C.js";
|
|
10
10
|
|
|
11
11
|
// src/agents/agent-refinements.ts
|
|
12
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -68,6 +68,27 @@ function assertRequiredChildExtensionsAdmitted(snapshots, launch) {
|
|
|
68
68
|
const route = launch.machine ? `machine '${launch.machine}'` : launch.runnerType !== void 0 && launch.runnerType !== "pi" ? `runner.type='${launch.runnerType}'` : void 0;
|
|
69
69
|
if (route) throw new Error(`Agent '${launch.agent}' cannot run on ${route}: the host requires child extensions (${ids.join(", ")}) for every runner, and only local native Pi children load them.`);
|
|
70
70
|
}
|
|
71
|
+
function childExtensionFileIdentity(extensionPath) {
|
|
72
|
+
if (!path.isAbsolute(extensionPath)) return void 0;
|
|
73
|
+
try {
|
|
74
|
+
const stat = fs.statSync(extensionPath, { bigint: true });
|
|
75
|
+
return stat.isFile() ? `${stat.dev}:${stat.ino}` : void 0;
|
|
76
|
+
} catch {
|
|
77
|
+
return void 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function createRequiredChildExtensionIdentity(requiredPaths) {
|
|
81
|
+
const aliases = new Map([...requiredPaths].map((extensionPath) => [extensionPath, childExtensionFileIdentity(extensionPath) ?? extensionPath]));
|
|
82
|
+
const identities = new Set(aliases.values());
|
|
83
|
+
return (extensionPath) => {
|
|
84
|
+
const known = aliases.get(extensionPath);
|
|
85
|
+
if (known !== void 0) return known;
|
|
86
|
+
const identity = childExtensionFileIdentity(extensionPath);
|
|
87
|
+
if (identity === void 0 || !identities.has(identity)) return void 0;
|
|
88
|
+
aliases.set(extensionPath, identity);
|
|
89
|
+
return identity;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
71
92
|
function hasMandatoryRequiredChildExtensions(snapshot) {
|
|
72
93
|
return snapshot?.some((entry) => entry.requireForAllRunners) === true;
|
|
73
94
|
}
|
|
@@ -88,6 +109,7 @@ export {
|
|
|
88
109
|
registerRequiredChildExtensions,
|
|
89
110
|
resolveRequiredChildExtensions,
|
|
90
111
|
assertRequiredChildExtensionsAdmitted,
|
|
112
|
+
createRequiredChildExtensionIdentity,
|
|
91
113
|
hasMandatoryRequiredChildExtensions,
|
|
92
114
|
writeRetainedRequiredChildExtensions,
|
|
93
115
|
readRetainedRequiredChildExtensions
|