@ferris1225/pi-subagents 4.3.30 → 4.3.31

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 CHANGED
@@ -3,6 +3,14 @@
3
3
  Release notes for `@ferris1225/pi-subagents`. Only the most recent releases
4
4
  are kept here; every published version is preserved as a GitHub Release.
5
5
 
6
+ ## 4.3.31
7
+
8
+ - Write the config on first start instead of prompting. A missing
9
+ `pi-subagents.json` is created with both roles enabled and no model overrides,
10
+ so scout and artisan follow the main model immediately. Session start announces
11
+ `/subagents-setup` once; the file's presence keeps later sessions silent. The
12
+ first-run confirm dialog is gone.
13
+
6
14
  ## 4.3.30
7
15
 
8
16
  - Restore pi's own footer. The extension no longer replaces the built-in
package/README.md CHANGED
@@ -13,10 +13,14 @@ is clear, and delegation will actually reduce cost or improve completion quality
13
13
 
14
14
  ## What's new
15
15
 
16
+ **4.3.31** — a first start writes `pi-subagents.json` instead of prompting. Both
17
+ roles are enabled with no model overrides, so scout and artisan follow the main
18
+ model immediately; session start announces `/subagents-setup` once, and later
19
+ sessions stay silent because the file itself is the marker.
20
+
16
21
  **4.3.30** — pi's own footer is back: the per-model cost footer is removed, so
17
- pi's built-in consumption line shows unchanged. On a fresh install pi-subagents
18
- announces `/subagents-setup` and asks whether to configure now; the wizard then
19
- asks each role's model and immediately its thinking level.
22
+ pi's built-in consumption line shows unchanged. The wizard asks each role's model
23
+ and immediately its thinking level.
20
24
 
21
25
  **4.3.29** — the retired `steward` and `sentinel` roles lose their leftover
22
26
  routing rules: a custom file with either name is now an ordinary custom role.
@@ -153,9 +157,9 @@ Pi's extension list shows `@ferris1225/pi-subagents` without an internal source-
153
157
  Open pi and run `/subagents-setup`. The original menu flow lets you enable or
154
158
  disable roles, configure one role's model and thinking level, or run the full setup
155
159
  again. Each screen uses the usual arrow-key/Enter/Esc navigation, and model lists
156
- remain searchable. A fresh install announces the command at session start and
157
- offers to open the wizard right away; the full setup asks each enabled role's
158
- model, then its thinking level. Fresh installs select both roles. A newly shipped
160
+ remain searchable. A fresh install writes a default config at session start — both
161
+ roles enabled, both following the main model — and announces the command once; the
162
+ full setup asks each enabled role's model, then its thinking level. A newly shipped
159
163
  built-in is surfaced once without being re-enabled after you deliberately turn it
160
164
  off. Then ask for work:
161
165
 
@@ -494,8 +498,10 @@ scope, including roles never configured before. Project files require Pi's proje
494
498
  Config-only names are not role definitions and never appear in the enable or configure
495
499
  picker. Saving an enable selection or full setup discards unavailable role names and their
496
500
  model/thinking settings; no retired-name aliases or configuration migration are applied.
497
- To start over, remove `pi-subagents.json` and run `/subagents-setup` again. Other settings live in
498
- `~/.pi/agent/pi-subagents.json` (following `PI_CODING_AGENT_DIR`):
501
+ The file is created on first start, and its presence is what keeps later sessions
502
+ silent. To start over, delete it and run `/subagents-setup`; the next session writes
503
+ the defaults again. Settings live in `~/.pi/agent/pi-subagents.json` (following
504
+ `PI_CODING_AGENT_DIR`):
499
505
 
500
506
  ```json
501
507
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ferris1225/pi-subagents",
3
- "version": "4.3.30",
3
+ "version": "4.3.31",
4
4
  "description": "A managed sub-agent team for pi: lightweight scout research and artisan implementation, one-shot runs, read-only status, and Git worktree isolation.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -126,10 +126,6 @@ export const DEFAULT_CONFIG: SubagentsConfig = {
126
126
  idleTimeoutSec: DEFAULT_IDLE_TIMEOUT_SEC,
127
127
  };
128
128
 
129
- export const FIRST_RUN_SETUP_HINT =
130
- "Run /subagents-setup to pick each role's model and thinking level. " +
131
- "Scout does lightweight read-only research. Artisan implements one substantial change.";
132
-
133
129
  export function getConfigPath(agentDir: string = getAgentDir()): string {
134
130
  return join(agentDir, CONFIG_FILE_NAME);
135
131
  }
@@ -15,7 +15,6 @@ import {
15
15
  BUILTIN_AGENT_NAMES,
16
16
  DEFAULT_CONFIG,
17
17
  DEFAULT_ENABLED_AGENTS,
18
- FIRST_RUN_SETUP_HINT,
19
18
  agentProfile,
20
19
  errorMessage,
21
20
  getConfigPath,
@@ -387,20 +386,19 @@ export async function runSetup(ctx: ExtensionContext, configPath: string = getCo
387
386
  }
388
387
 
389
388
  /**
390
- * First-install offer: announce the command, then let the user start the wizard
391
- * right away. Declining leaves the config untouched and the notice is enough to
392
- * run `/subagents-setup` later.
389
+ * First start: write the shipped defaults so both roles work immediately — no
390
+ * model overrides means each child follows the main model — then announce the
391
+ * command that customizes them. The file is the marker: once it exists, later
392
+ * sessions stay silent.
393
393
  */
394
- export async function offerFirstRunSetup(
394
+ export async function ensureDefaultConfig(
395
395
  ctx: ExtensionContext,
396
396
  configPath: string = getConfigPath(),
397
397
  ): Promise<void> {
398
- ctx.ui.notify(`pi-subagents: ${FIRST_RUN_SETUP_HINT}`, "info");
399
- if (ctx.mode !== "tui") return;
400
- const start = await ctx.ui.confirm(
401
- "Configure pi-subagents now?",
402
- "Pick each role's model, then its thinking level. Esc in the wizard stops setup; run /subagents-setup later if you skip now.",
398
+ if (await configExists(configPath)) return;
399
+ await saveConfig(DEFAULT_CONFIG, configPath);
400
+ ctx.ui.notify(
401
+ `pi-subagents: wrote ${configPath} with scout and artisan enabled; both follow the main model. Run /subagents-setup to pick a model and thinking level per role.`,
402
+ "info",
403
403
  );
404
- if (!start) return;
405
- await runSetup(ctx, configPath);
406
404
  }
@@ -1,10 +1,9 @@
1
1
  /** Session-start recovery, stale-model cleanup, and progress-surface installation. */
2
2
 
3
3
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
4
- import { existsSync } from "node:fs";
5
4
  import { loadConfig, saveConfig } from "../configuration/config.ts";
6
5
  import { availableModelsInScope, filterUnavailableModelOverrides } from "../configuration/models.ts";
7
- import { offerFirstRunSetup } from "../configuration/setup.ts";
6
+ import { ensureDefaultConfig } from "../configuration/setup.ts";
8
7
  import { announceRecoveryRecords, relocateRecoveryManifest } from "../isolation/recovery.ts";
9
8
  import type { SubagentRuntime } from "../lifecycle/runtime.ts";
10
9
  import { installActiveRunsWidget } from "./widget.ts";
@@ -35,7 +34,7 @@ async function removeUnavailableAgentModels(
35
34
 
36
35
  export function registerAnnouncements(pi: ExtensionAPI, runtime: SubagentRuntime): void {
37
36
  pi.on("session_start", async (_event, ctx) => {
38
- const firstRun = !existsSync(runtime.configPath);
37
+ await ensureDefaultConfig(ctx, runtime.configPath);
39
38
  await relocateRecoveryManifest(runtime.configPath);
40
39
  await announceRecoveryRecords(runtime.configPath, ctx);
41
40
  await removeUnavailableAgentModels(ctx, runtime);
@@ -53,7 +52,6 @@ export function registerAnnouncements(pi: ExtensionAPI, runtime: SubagentRuntime
53
52
  // The active-run widget is TUI-only.
54
53
  if (ctx.mode !== "tui") return;
55
54
  installActiveRunsWidget(ctx);
56
- if (firstRun) await offerFirstRunSetup(ctx, runtime.configPath);
57
55
  });
58
56
 
59
57
  // Compaction failures are otherwise silent in long orchestration sessions