gentle-pi 5.0.0 → 5.1.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 +1 -1
- package/assets/agents/gentle-ai-explore.md +3 -6
- package/assets/agents/gentle-ai-verify.md +1 -1
- package/assets/agents/gentle-ai-worker.md +9 -9
- package/assets/agents/jd-fix-agent.md +1 -1
- package/assets/agents/jd-judge-a.md +0 -1
- package/assets/agents/jd-judge-b.md +0 -1
- package/assets/migrations/agent-body-history.json +6 -0
- package/assets/orchestrator-full-delegation.md +1 -1
- package/assets/orchestrator-maintenance.md +11 -0
- package/assets/orchestrator-quota-recovery.md +1 -1
- package/assets/orchestrator-skills.md +10 -0
- package/assets/orchestrator-verification.md +9 -7
- package/assets/orchestrator.md +1 -1
- package/bin/gentle-shell.mjs +67 -15
- package/contracts/review-provider-contract-mirror/provider-contract.lock.json +10 -10
- package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/manifest.json +5 -5
- package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/orchestration/pi.md +5 -3
- package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/routing/pi.md +1 -1
- package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/schemas/lens.schema.json +3 -3
- package/contracts/review-provider-contract-mirror/v1.7.0/bundle/vectors/lens.json +1 -0
- package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/generated/provider-capabilities.baseline.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/generated/provider-roles.baseline.json +3 -3
- package/docs/bundled-install.md +2 -2
- package/docs/delegated-verification.md +8 -4
- package/docs/desktop-feed.md +15 -6
- package/docs/desktop-rpc.md +44 -20
- package/docs/gentle-shell-desktop.md +10 -3
- package/docs/gentle-shell.md +17 -13
- package/docs/install-wizard.md +2 -2
- package/docs/odd-preparation-continuity.md +2 -2
- package/docs/permission-modes.md +10 -2
- package/docs/readme-reference.md +46 -11
- package/docs/session-profile-format.md +33 -7
- package/docs/work-continuity.md +7 -7
- package/docs/yolo-mode.md +1 -1
- package/extensions/child-context.ts +2 -11
- package/extensions/gentle-agents.ts +47 -28
- package/extensions/gentle-ai.ts +573 -353
- package/extensions/gentle-desktop-feed.ts +13 -3
- package/extensions/gentle-fast.ts +9 -2
- package/extensions/gentle-shell.ts +142 -55
- package/extensions/gentle-tps.ts +5 -0
- package/extensions/quiet-tools.ts +13 -22
- package/extensions/skill-registry.ts +9 -1
- package/herdr/mods/gentle-agents/snapshot.js +30 -23
- package/herdr/mods/gentle-chat/feed.js +6 -0
- package/herdr/mods/gentle-chat/main.js +76 -16
- package/herdr/mods/gentle-chat/session.js +13 -5
- package/herdr/mods/gentle-chat/snapshot.js +30 -23
- package/herdr/mods/gentle-chat/ui.js +7 -1
- package/herdr/mods/gentle-inspector/main.js +2 -0
- package/herdr/mods/gentle-inspector/snapshot.js +30 -23
- package/herdr/mods/gentle-palette/main.js +1 -1
- package/herdr/mods/gentle-palette/snapshot.js +30 -23
- package/herdr/mods/gentle-pane/snapshot.js +30 -23
- package/herdr/mods/gentle-sidebar/snapshot.js +30 -23
- package/herdr/mods/gentle-spaces/snapshot.js +30 -23
- package/herdr/mods/gentle-status/snapshot.js +30 -23
- package/herdr/mods/gentle-tabs/main.js +3 -2
- package/herdr/mods/gentle-tabs/new-tab.js +9 -0
- package/herdr/mods/gentle-tabs/snapshot.js +30 -23
- package/herdr/mods/gentle-tokens/snapshot.js +30 -23
- package/lib/agent-profiles.ts +50 -10
- package/lib/agents-config.ts +59 -4
- package/lib/agents-runner.ts +34 -1
- package/lib/auto-permission-runtime.ts +2 -1
- package/lib/background-jobs-tools.ts +24 -16
- package/lib/claude-bridge-config.ts +41 -0
- package/lib/desktop-agent-definitions-service.ts +10 -6
- package/lib/desktop-command-rpc.ts +71 -0
- package/lib/desktop-feed-sources.ts +44 -1
- package/lib/desktop-feed.ts +41 -29
- package/lib/desktop-rpc-agent-definitions.ts +7 -3
- package/lib/desktop-rpc-changes.ts +13 -4
- package/lib/desktop-rpc-config.ts +106 -3
- package/lib/exploration-budget.ts +3 -7
- package/lib/gentle-design.ts +23 -4
- package/lib/gentle-shell-desktop.ts +85 -0
- package/lib/gentle-shell-launcher.ts +106 -3
- package/lib/mcp-config.ts +214 -0
- package/lib/native-review-cli.ts +78 -34
- package/lib/odd-phase-inference.ts +1 -1
- package/lib/orchestrator-mode-policy.ts +25 -12
- package/lib/path-consent-fence.ts +113 -0
- package/lib/pi-settings.ts +157 -0
- package/lib/review-continuation-registry.ts +7 -20
- package/lib/review-coordinator.ts +5 -0
- package/lib/review-host-relay.ts +2 -35
- package/lib/review-integration-v2.ts +31 -12
- package/lib/sensitive-paths.ts +22 -2
- package/lib/session-profile-freeze.ts +11 -4
- package/lib/session-worktree-registry.ts +11 -5
- package/lib/shell-card.ts +27 -1
- package/lib/shell-changes-view.ts +6 -2
- package/lib/shell-changes.ts +94 -37
- package/lib/shell-git-worker.ts +158 -0
- package/lib/shell-idle-changes.ts +88 -0
- package/lib/shell-untracked-cache.ts +142 -0
- package/lib/shell-untracked-lines.ts +178 -0
- package/lib/tps-policy.ts +85 -0
- package/lib/vim-editor-adapter.ts +3 -2
- package/lib/voice-artifacts.ts +8 -1
- package/lib/voice-install.ts +7 -3
- package/lib/yolo-session-policy.ts +2 -2
- package/package.json +1 -1
- package/runtime/gentle-shell-desktop.mjs +85 -0
- package/runtime/gentle-shell-launcher.mjs +106 -3
- package/runtime/native-review-cli.mjs +77 -33
- package/runtime/review-integration-v2.mjs +31 -12
- package/runtime/sensitive-paths.mjs +22 -2
- package/scripts/gentle-ai-installer.mjs +10 -10
- package/scripts/main-channel.mjs +27 -7
- package/scripts/verify-package-files.mjs +13 -12
- package/skills/rdd-defect-workflow/SKILL.md +2 -2
- package/tests/agent-profiles-workflow.test.ts +102 -0
- package/tests/agents-config.test.ts +1 -2
- package/tests/agents-protocol.test.ts +1 -1
- package/tests/agents-runner.test.ts +94 -2
- package/tests/append-system-prompt-route.test.ts +16 -11
- package/tests/auto-permission-runtime.test.ts +4 -4
- package/tests/bounded-stop-contract.test.ts +50 -62
- package/tests/child-context-files.test.ts +6 -6
- package/tests/child-web-package.test.ts +1 -1
- package/tests/controlled-engineering-editor.test.ts +192 -0
- package/tests/controlled-engineering-launch.test.ts +136 -0
- package/tests/controlled-engineering.test.ts +244 -0
- package/tests/delivery-b-rendered-surfaces.test.ts +1 -1
- package/tests/desktop-feed-tool-summaries.test.ts +1 -1
- package/tests/desktop-feed-transcript.test.ts +17 -0
- package/tests/desktop-feed.test.ts +141 -7
- package/tests/desktop-liveness.test.ts +125 -0
- package/tests/desktop-persona.test.ts +17 -0
- package/tests/desktop-rpc-agent-definitions.test.ts +23 -2
- package/tests/desktop-rpc-changes.test.ts +80 -3
- package/tests/desktop-rpc-config-mcp-fidelity.test.ts +106 -0
- package/tests/desktop-rpc-config-readonly-stores.test.ts +458 -0
- package/tests/desktop-rpc-config.test.ts +5 -2
- package/tests/desktop-rpc-design.test.ts +21 -0
- package/tests/desktop-rpc-session-snapshot-commands.test.ts +50 -0
- package/tests/desktop-session-switch.test.ts +237 -0
- package/tests/desktop-target-session.test.ts +104 -0
- package/tests/destructive-command-guard.test.ts +187 -0
- package/tests/devbinary/pi-host-relay.devtest.ts +73 -9
- package/tests/exploration-budget.test.ts +2 -26
- package/tests/fixtures/primary-session-prompt/gentleman.golden.md +14 -10
- package/tests/full-delegation-closure.test.ts +19 -9
- package/tests/generic-agent-tools.test.ts +3 -3
- package/tests/gentle-agents.test.ts +214 -9
- package/tests/gentle-ai-exploration-budget.test.ts +3 -2
- package/tests/gentle-ai-installer.test.ts +52 -51
- package/tests/gentle-ai.test.ts +29 -5
- package/tests/gentle-chat-read-failure.test.ts +74 -0
- package/tests/gentle-chat-session-read.test.ts +127 -0
- package/tests/gentle-design.test.ts +39 -0
- package/tests/gentle-shell-desktop.test.ts +108 -0
- package/tests/gentle-shell-launcher-auto-provision.test.ts +152 -0
- package/tests/gentle-shell-launcher-machine-output.test.ts +356 -0
- package/tests/gentle-shell.test.ts +93 -12
- package/tests/gentle-tps.test.ts +57 -0
- package/tests/independent-recovery-delivery.test.ts +15 -13
- package/tests/installer-preflight.test.ts +3 -2
- package/tests/job-turn-end-texts.test.ts +57 -0
- package/tests/lazy-module-contradictions-contract.test.ts +1 -2
- package/tests/main-channel.test.ts +12 -1
- package/tests/maintainer/desktop-rpc.maintest.ts +2 -2
- package/tests/native-review-capability-contract.test.ts +7 -1
- package/tests/native-review-cli.test.ts +113 -1
- package/tests/no-self-pause-contract.test.ts +8 -7
- package/tests/odd-phase-inference.test.ts +2 -2
- package/tests/odd-routing-canonical-ratchet.test.ts +1 -1
- package/tests/odd-routing-contract.test.ts +1 -1
- package/tests/orchestrator-budget.test.ts +7 -2
- package/tests/orchestrator-prompt-diet-contract.test.ts +5 -5
- package/tests/orchestrator-skills-inline-contract.test.ts +26 -0
- package/tests/package-manifest.test.ts +11 -16
- package/tests/packaged-agent-codemode.test.ts +79 -0
- package/tests/path-consent-fence.test.ts +326 -0
- package/tests/pi-update-launcher.test.ts +1 -1
- package/tests/primary-session-prompt.test.ts +9 -7
- package/tests/profile-fast-tier.test.ts +79 -4
- package/tests/progress-rule-contract.test.ts +54 -0
- package/tests/rdd-delivery-warning.test.ts +42 -4
- package/tests/review-actor-tool-deny.test.ts +1 -2
- package/tests/review-continuation-registry.test.ts +17 -17
- package/tests/review-controller-native-recovery.test.ts +100 -0
- package/tests/review-controller-native-routing.test.ts +129 -24
- package/tests/review-coordinator.test.ts +14 -0
- package/tests/review-host-relay-restart-parity.test.ts +2 -52
- package/tests/review-host-relay-routing.test.ts +57 -297
- package/tests/review-host-relay.test.ts +0 -46
- package/tests/review-integration-v2-forward.test.ts +39 -2
- package/tests/review-json-arguments.test.ts +30 -9
- package/tests/review-one-call-findings.test.ts +1 -0
- package/tests/review-untracked-inventory-replay.test.ts +181 -0
- package/tests/runtime-harness.mjs +27 -1
- package/tests/sensitive-path-tools.test.ts +155 -4
- package/tests/session-profile-extension.test.ts +90 -11
- package/tests/session-profile-freeze.test.ts +49 -2
- package/tests/session-profile-v1-compat.test.ts +11 -3
- package/tests/session-worktree-registry.test.ts +23 -0
- package/tests/shell-changes-idle-start.test.ts +510 -0
- package/tests/shell-changes-untracked-bound.test.ts +230 -0
- package/tests/shell-changes-view.test.ts +8 -2
- package/tests/shell-changes.test.ts +134 -0
- package/tests/shell-git-runner-stall.test.ts +74 -0
- package/tests/shell-git-worker-fallback.test.ts +140 -0
- package/tests/shell-git-worker-lifetime.test.ts +91 -0
- package/tests/shell-render-cache-runtime.test.ts +256 -3
- package/tests/shell-untracked-cache.test.ts +213 -0
- package/tests/short-check-routing-contract.test.ts +11 -7
- package/tests/skill-registry.test.ts +3 -3
- package/tests/support/chat-ui.ts +39 -0
- package/tests/t7-recovery-preservation.test.ts +68 -0
- package/tests/tps-policy.test.ts +96 -0
- package/tests/turn-end-rule-contract.test.ts +155 -0
- package/tests/turn-end-scope.test.ts +39 -0
- package/tests/verification-scoped-stop-contract.test.ts +1 -1
- package/tests/verification-tiers-contract.test.ts +4 -3
- package/tests/verify-first-launch-contract.test.ts +19 -7
- package/tests/vim-editor-adapter.test.ts +4 -4
- package/tests/voice-install.test.ts +97 -11
- package/tests/windows-hidden-processes.test.ts +11 -44
- package/tests/work-continuity-contract.test.ts +48 -55
- package/tests/yolo-session-policy.test.ts +2 -0
- package/contracts/review-provider-contract-mirror/v1.6.0/bundle/vectors/lens.json +0 -1
- package/extensions/codegraph-tools.ts +0 -437
- package/tests/child-codegraph-bootstrap.test.ts +0 -74
- package/tests/codegraph-tools.test.ts +0 -554
- /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/README.md +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/schemas/refuter.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/schemas/targeted-validator.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/vectors/refuter.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/vectors/targeted-validator.json +0 -0
package/docs/yolo-mode.md
CHANGED
|
@@ -23,7 +23,7 @@ While it is active:
|
|
|
23
23
|
|
|
24
24
|
- Every shell-guard confirmation is waived, data loss included: recursive `rm`, SQL drops, ordinary pushes, rebases, forced branch deletion, `npm publish` and configured guardrail `confirm`/`block` rules all run without dialogs. Code-level hard denies stay blocked (`git reset --hard`, forced clean, force push); see below.
|
|
25
25
|
- The Auto classifier does not run.
|
|
26
|
-
- The **sensitive-path guard stays
|
|
26
|
+
- The **sensitive-path guard stays on**: the `read`, `grep`, `find`, `ls`, `write` and `edit` tools refuse `.env` files, `.ssh`, keychains, `*.pem/*.key/*.p12/*.pfx`, `auth.json`, `secrets/` directories and cloud credential files in every mode, Super Yolo included. A shell command is judged as a whole line, and a sensitive path in it is blocked when the line contains a command that shows, copies, sends, opens, deletes or prints the environment (`cat`, `grep`, `cp`, `tar`, `scp`, `curl`, `git`, `vim`, `rm`, `printenv`, `env`, `xargs` and similar), `cd`/`pushd`, or `.`/`source` (env files excepted); when the path is under `.ssh` and the line contains a program that creates files there (`install`, `touch`, `mkdir`, `ssh-keygen`, `ssh-copy-id`); or when the path is a script rather than a path (`bash -c "true;cat key"`), the first word of a command, or a redirection target (`< .env`, `> .env`). Any other command may hand the file to a program, as in `docker compose --env-file .env.local up` or `ssh -i ~/.ssh/id_ed25519 host`, but a line that uses a secret file and also holds a reader (`docker compose --env-file .env.local logs app | tail -50`) is blocked as a whole: run the parts separately. The identity word of `ssh -i key host …` is exempt from the `.ssh` writer rule only, so `ssh -i key host npm install` passes. `printenv` and `env` are blocked, but not every way of printing the environment is: `export -p`, `declare`, `set` and `echo "$VAR"` after sourcing an env file pass. Other limits: the guard does not see a program not on the list that prints or sends a file, a write into `.ssh` through `docker run -v` or an unlisted program, a reader whose name is assembled at run time (`x=cat; $x .env`), an interpreter that receives the key as an argument, or what a program prints.
|
|
27
27
|
- Code-level catastrophic denies remain: `rm -rf /`, `rm -rf ~`, `--no-preserve-root`, `git reset --hard`, forced clean and force push are blocked without a dialog.
|
|
28
28
|
- `ask_user` tools, provider consent, maintenance/recovery authorization and opaque-token decisions are never automatically answered.
|
|
29
29
|
- `/gentle:yolo status` identifies Super Yolo while it is active, and `/gentle:yolo disable` returns to Normal. Children never inherit Super Yolo; their bounded delegation and child guards are unchanged.
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { filterChildSessionContextFiles, type ContextFileOptions } from "../lib/child-context-files.ts";
|
|
3
|
-
import { CHILD_SKILLS_CATALOG_ENV
|
|
4
|
-
import { registerCodeGraphTool } from "./codegraph-tools.ts";
|
|
3
|
+
import { CHILD_SKILLS_CATALOG_ENV } from "../lib/agents-runner.ts";
|
|
5
4
|
|
|
6
5
|
// gentle-shell#1587: delegated children drop the orchestrator-only gentle-ai
|
|
7
6
|
// managed blocks and the engram-protocol memory block from their context files
|
|
8
7
|
// and keep everything else. Gentle Agents passes this file to every child with
|
|
9
8
|
// --extension because children do not load the gentle-pi package in the
|
|
10
|
-
// isolated Gentle Shell home.
|
|
11
|
-
// CodeGraph implementation only when explicitly requested and absent (the full
|
|
12
|
-
// package already registers it). Outside a child session it is inert.
|
|
9
|
+
// isolated Gentle Shell home. Outside a child session it is inert.
|
|
13
10
|
export function createChildContextExtension(env: NodeJS.ProcessEnv = process.env): (pi: ExtensionAPI) => void {
|
|
14
11
|
return (pi) => {
|
|
15
|
-
const requested = (env[REQUESTED_TOOLS_ENV] ?? "").split(",").map(name => name.trim());
|
|
16
|
-
if (env.GENTLE_PI_AGENTS_CHILD === "1" && requested.includes("codegraph")) {
|
|
17
|
-
pi.on("session_start", () => {
|
|
18
|
-
if (!pi.getAllTools().some(tool => tool.name === "codegraph")) registerCodeGraphTool(pi);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
12
|
pi.on("before_agent_start", (event) => {
|
|
22
13
|
if (env.GENTLE_PI_AGENTS_CHILD !== "1") return undefined;
|
|
23
14
|
// The filtered copies replace contextFiles on the same options object
|
|
@@ -5,6 +5,7 @@ import type { ThinkingLevel } from "../lib/model-routing-authority.ts";
|
|
|
5
5
|
import { agentsViewKey, agentsCollapseKey, agentsStopKey } from "../lib/agents-keys.ts";
|
|
6
6
|
import { loadKeymaps } from "../lib/keymaps.ts";
|
|
7
7
|
import { CHILD_TIER_ENV } from "../lib/openai-fast-tier.ts";
|
|
8
|
+
import { CONTROLLED_ENGINEERING_ENV, workflowFromProfile, type ControlledEngineeringRole } from "../lib/orchestrator-mode-policy.ts";
|
|
8
9
|
import { spawn } from "node:child_process";
|
|
9
10
|
import { Type } from "typebox";
|
|
10
11
|
import { recordReviewMutation } from "../lib/review-reminder-receipt.ts";
|
|
@@ -73,7 +74,7 @@ import { createNativeFullscreenInteraction } from "../lib/native-fullscreen-inte
|
|
|
73
74
|
import { HERDR_BUSY_CHANNEL, nextHerdrBusyAction, type HerdrBusyEmitted } from "../lib/herdr-busy.ts";
|
|
74
75
|
import { HERDR_DESKTOP_TASKS, HERDR_DESKTOP_TASKS_REQUEST, HERDR_DESKTOP_TASK_FINISHED, HERDR_DESKTOP_JOBS, HERDR_DESKTOP_JOB_SETTLED, HERDR_DESKTOP_CONSULT, HERDR_DESKTOP_SEND, HERDR_DESKTOP_INBOUND, type HerdrDesktopInbound, type HerdrDesktopJobSettled } from "../lib/herdr-desktop-events.ts";
|
|
75
76
|
import { AGENTS_GLYPH, agentsCardTone, agentsSpend, agentsSummary, renderAgentsAlert, renderAgentsCard, renderAgentsSection, widgetExpiryMs, widgetRows } from "../lib/agents-widget.ts";
|
|
76
|
-
import { CARD_TONE, cardAwaitingResult, cardBodyRows, cardBottom, cardInnerWidth, cardRunningLine, cardTop, floatRows, headingFits, markCardResult, panelHeaderRow, panelInnerWidth, renderCard, type CardRowContext, type CardTheme, type CardTone } from "../lib/shell-card.ts";
|
|
77
|
+
import { CARD_TONE, cachedCard, cardAwaitingResult, cardBodyRows, cardBottom, cardInnerWidth, cardRunningLine, cardTop, floatRows, headingFits, markCardResult, panelHeaderRow, panelInnerWidth, renderCard, type CardRowContext, type CardTheme, type CardTone } from "../lib/shell-card.ts";
|
|
77
78
|
import { openInExternalEditor } from "./gentle-shell.ts";
|
|
78
79
|
import { gentlePiConfigHome } from "../lib/agent-home.ts";
|
|
79
80
|
import { resolveAgentHomeDirectory } from "../lib/agent-model-resolution.ts";
|
|
@@ -197,6 +198,13 @@ export interface SessionTransportFactory {
|
|
|
197
198
|
createClient(registry: SessionTransportRegistry, sessionId: string): SessionTransportClient;
|
|
198
199
|
}
|
|
199
200
|
|
|
201
|
+
/** Which Controlled Engineering section each child agent gets (controlled-engineering S3). */
|
|
202
|
+
const CONTROLLED_ENGINEERING_AGENT_ROLES: Partial<Record<string, ControlledEngineeringRole>> = {
|
|
203
|
+
"gentle-ai-worker": "writer",
|
|
204
|
+
"jd-fix-agent": "writer",
|
|
205
|
+
"gentle-ai-verify": "verify",
|
|
206
|
+
};
|
|
207
|
+
|
|
200
208
|
export interface AgentsDeps extends RunnerDeps {
|
|
201
209
|
home: string;
|
|
202
210
|
agentHome?: string;
|
|
@@ -1531,7 +1539,7 @@ export default function gentleAgents(pi: ExtensionAPI, env: NodeJS.ProcessEnv =
|
|
|
1531
1539
|
if (tasks + running === 0) return undefined;
|
|
1532
1540
|
return {
|
|
1533
1541
|
block: true,
|
|
1534
|
-
reason: `Standalone sleep is blocked while background work is active (${tasks} task(s), ${running} job(s)).
|
|
1542
|
+
reason: `Standalone sleep is blocked while background work is active (${tasks} task(s), ${running} job(s)). Continue independent in-scope work; end the turn to wait only when none remains. Each completion arrives automatically as a session message and starts a new turn.`,
|
|
1535
1543
|
};
|
|
1536
1544
|
});
|
|
1537
1545
|
let activeAgentRuns = 0;
|
|
@@ -2242,23 +2250,21 @@ export default function gentleAgents(pi: ExtensionAPI, env: NodeJS.ProcessEnv =
|
|
|
2242
2250
|
const content = message.content as string | Array<{ type: string; text?: string }>;
|
|
2243
2251
|
const text = typeof content === "string" ? content : content.map((part) => (part.type === "text" ? (part.text ?? "") : "")).join("\n");
|
|
2244
2252
|
const tone = details?.status === "completed" ? CARD_TONE.SUCCESS : CARD_TONE.ERROR;
|
|
2245
|
-
const
|
|
2253
|
+
const expanded = options.expanded;
|
|
2254
|
+
const hint = expandHint(expanded);
|
|
2246
2255
|
// The same answer card as the tool result: iris chrome, the state pill
|
|
2247
2256
|
// on top, the answer below ("answer" keeps its name through the flow).
|
|
2248
2257
|
const t = agentTheme(theme, tone);
|
|
2249
2258
|
const facts = details?.status ? statusCardFacts({ gentleAgents: details }) : undefined;
|
|
2250
2259
|
const chips = [details?.agent, modelChip(facts?.model), facts?.thinking ? sanitizeTerminalText(facts.thinking) : undefined];
|
|
2251
|
-
const answer =
|
|
2260
|
+
const answer = expanded ? text.split("\n") : agentResultPreview(text).split("\n").filter((line) => line.trim() !== "");
|
|
2252
2261
|
const body = facts ? [statusCardRows(facts, t, false)[0], ...answer] : answer;
|
|
2253
|
-
return {
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
},
|
|
2260
|
-
invalidate() {},
|
|
2261
|
-
};
|
|
2262
|
+
return cachedCard((width) => {
|
|
2263
|
+
// Same one-line heading budget as the tool cards: the answer card's
|
|
2264
|
+
// inner columns are the style's, not the terminal's.
|
|
2265
|
+
const subtitle = fitSubject({ title: "Agent answer", tone, glyph: ACTION_GLYPH.result }, hint, panelInnerWidth(theme, width, tone), chips);
|
|
2266
|
+
return renderCard({ title: "Agent answer", subtitle, body, tone, glyph: ACTION_GLYPH.result }, t, width, { expanded, previewRows: 3, hint });
|
|
2267
|
+
});
|
|
2262
2268
|
});
|
|
2263
2269
|
|
|
2264
2270
|
// A stale completion is appended as a custom entry: durable transcript
|
|
@@ -2803,12 +2809,24 @@ export default function gentleAgents(pi: ExtensionAPI, env: NodeJS.ProcessEnv =
|
|
|
2803
2809
|
if (profile.tier && childModel?.provider && childModel.id) {
|
|
2804
2810
|
childEnv[CHILD_TIER_ENV] = JSON.stringify({ tier: profile.tier, model: `${childModel.provider}/${childModel.id}` });
|
|
2805
2811
|
}
|
|
2812
|
+
// controlled-engineering S3: only the writers and the verifier, and only when
|
|
2813
|
+
// the launching session's profile enables the option; read live per launch.
|
|
2814
|
+
const sessionProfileName = sessionProfile.kind === "explicit" ? sessionProfile.name : sessionProfile.profile?.name;
|
|
2815
|
+
delete childEnv[CONTROLLED_ENGINEERING_ENV];
|
|
2816
|
+
const controlledRole = CONTROLLED_ENGINEERING_AGENT_ROLES[agent.name];
|
|
2817
|
+
if (controlledRole !== undefined && sessionProfileName !== undefined
|
|
2818
|
+
&& workflowFromProfile(profileConfigHome, sessionProfileName).controlledEngineering === true) {
|
|
2819
|
+
childEnv[CONTROLLED_ENGINEERING_ENV] = controlledRole;
|
|
2820
|
+
}
|
|
2806
2821
|
if (foreign) for (const key of inheritedUnsafeGitEnvironmentKeys(childEnv)) delete childEnv[key];
|
|
2807
2822
|
const extensions = childExtensionRequest(deps.env, deps.childExtensionPaths);
|
|
2808
2823
|
if (profile.tier && !parseChildPackageInjection(deps.env)) {
|
|
2809
2824
|
const fastPath = fileURLToPath(new URL("./gentle-fast.ts", import.meta.url));
|
|
2810
2825
|
if (existsSync(fastPath)) extensions.extensionPaths = [...new Set([...(extensions.extensionPaths ?? []), fastPath])];
|
|
2811
2826
|
}
|
|
2827
|
+
const activeMcpTools = typeof pi.getAllTools === "function"
|
|
2828
|
+
? pi.getAllTools().map((tool) => tool.name).filter((name) => name.startsWith("mcp__"))
|
|
2829
|
+
: undefined;
|
|
2812
2830
|
const request: TaskRequest = {
|
|
2813
2831
|
agent,
|
|
2814
2832
|
prompt,
|
|
@@ -2817,6 +2835,7 @@ export default function gentleAgents(pi: ExtensionAPI, env: NodeJS.ProcessEnv =
|
|
|
2817
2835
|
mode,
|
|
2818
2836
|
cwd: target ?? parentWorktreeRoot,
|
|
2819
2837
|
parentSessionId,
|
|
2838
|
+
...(activeMcpTools && activeMcpTools.length > 0 ? { mcpTools: activeMcpTools } : {}),
|
|
2820
2839
|
...(admittedModel === undefined ? {} : { beforeSpawn: () => {
|
|
2821
2840
|
if (!current()) throw new Error("Writer session changed before spawn.");
|
|
2822
2841
|
registry.validate(originalCwd);
|
|
@@ -2834,8 +2853,7 @@ export default function gentleAgents(pi: ExtensionAPI, env: NodeJS.ProcessEnv =
|
|
|
2834
2853
|
thinking: profile.thinking,
|
|
2835
2854
|
...(() => {
|
|
2836
2855
|
// The chain of the profile this launch resolved, else the active profile's.
|
|
2837
|
-
const
|
|
2838
|
-
const fallbacks = profileFallbackChain(profileConfigHome, name, agent.name);
|
|
2856
|
+
const fallbacks = profileFallbackChain(profileConfigHome, sessionProfileName, agent.name);
|
|
2839
2857
|
return fallbacks.length ? { fallbacks } : {};
|
|
2840
2858
|
})(),
|
|
2841
2859
|
sessionDir,
|
|
@@ -3080,20 +3098,21 @@ export default function gentleAgents(pi: ExtensionAPI, env: NodeJS.ProcessEnv =
|
|
|
3080
3098
|
facts?.thinking ? headingText(facts.thinking) : undefined,
|
|
3081
3099
|
]
|
|
3082
3100
|
: [];
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
},
|
|
3095
|
-
invalidate() {},
|
|
3101
|
+
const expanded = options.expanded;
|
|
3102
|
+
const render = (width: number) => {
|
|
3103
|
+
if (width <= 0) return [];
|
|
3104
|
+
const hint = expandHint(expanded);
|
|
3105
|
+
return floatRows(tone, iris, width, (inner) => ({
|
|
3106
|
+
...(ownHeading ? {
|
|
3107
|
+
head: [cardTop({ title: heading, subtitle: fitSubject({ title: heading, tone, glyph }, hint, inner, ownChips), body: [], tone, glyph }, iris, inner, hint)],
|
|
3108
|
+
} : { afterHeading: true }),
|
|
3109
|
+
body: cardBodyRows(fitRows ? rows.map((row) => truncateToWidth(row, cardInnerWidth(inner), "…")) : rows, tone, iris, inner, { expanded, previewRows: ownHeading ? 3 : undefined }),
|
|
3110
|
+
bottom: cardBottom(tone, iris, inner),
|
|
3111
|
+
}));
|
|
3096
3112
|
};
|
|
3113
|
+
// Pi reconstructs the result on output, expansion, and theme changes;
|
|
3114
|
+
// the separate call still reads its live task and shared state.
|
|
3115
|
+
return options.isPartial === false ? cachedCard(render) : { render, invalidate() {} };
|
|
3097
3116
|
},
|
|
3098
3117
|
async execute(_id, params, signal, _onUpdate, ctx) {
|
|
3099
3118
|
return execute(params as Record<string, unknown>, ctx, signal);
|