@nmzpy/pi-ember-stack 0.1.4 → 0.1.5

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 CHANGED
@@ -30,8 +30,8 @@ plugins under `plugins/`. Ember projects enable them in `.pi/ember-stack.json`:
30
30
  Remove a plugin ID to disable it, or use `/stack-plugins` to toggle one from
31
31
  the TUI. Restart pi after changing the list. The available plugins are:
32
32
 
33
- - `pi-compact-tools`: collapsed native edit rendering and questionnaire UI.
34
- - `pi-custom-agents`: primary modes, plans, subagent tool, and bundled agent definitions.
33
+ - `pi-compact-tools`: collapsed native edit rendering.
34
+ - `pi-custom-agents`: questionnaire UI, primary modes, plans, subagent tool, and bundled agent definitions.
35
35
  - `devin-auth`: Devin provider, OAuth, catalog refresh, and streaming.
36
36
 
37
37
  ## Project setup
@@ -39,7 +39,7 @@ the TUI. Restart pi after changing the list. The available plugins are:
39
39
  The Ember repository contains a project-local `.pi/settings.json` entry for:
40
40
 
41
41
  ```json
42
- "npm:@nmzpy/pi-ember-stack@0.1.4"
42
+ "npm:@nmzpy/pi-ember-stack@0.1.5"
43
43
  ```
44
44
 
45
45
  On a new clone, start pi from the project directory. Pi will ask for a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nmzpy/pi-ember-stack",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Ember's configurable pi plugin stack with modes, questionnaire, compact edits, subagents, and Devin auth",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/plugins/index.ts CHANGED
@@ -4,18 +4,13 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
4
4
 
5
5
  import devinAuthPlugin from "./devin-auth/extensions/index.ts";
6
6
  import piCompactToolsPlugin from "./pi-compact-tools/index.ts";
7
- import piCustomAgentsPlugin, {
8
- type PiCustomAgentsOptions,
9
- } from "./pi-custom-agents/index.ts";
7
+ import piCustomAgentsPlugin from "./pi-custom-agents/index.ts";
10
8
 
11
9
  type PluginId = "pi-compact-tools" | "pi-custom-agents" | "devin-auth";
12
10
  type StackPlugin = {
13
11
  id: PluginId;
14
12
  description: string;
15
- extension: (
16
- pi: ExtensionAPI,
17
- options?: PiCustomAgentsOptions,
18
- ) => void | Promise<void>;
13
+ extension: (pi: ExtensionAPI) => void | Promise<void>;
19
14
  };
20
15
 
21
16
  type StackPluginConfig = {
@@ -32,7 +27,7 @@ const DEFAULT_PLUGIN_IDS: readonly PluginId[] = [
32
27
  const PLUGINS: readonly StackPlugin[] = [
33
28
  {
34
29
  id: "pi-compact-tools",
35
- description: "Collapsed native edit rendering and questionnaire UI",
30
+ description: "Collapsed native edit rendering",
36
31
  extension: piCompactToolsPlugin,
37
32
  },
38
33
  {
@@ -135,12 +130,9 @@ function registerPluginCommand(
135
130
  export default async function piEmberStackPlugin(pi: ExtensionAPI): Promise<void> {
136
131
  const cwd = process.cwd();
137
132
  const enabledPlugins = readEnabledPlugins(cwd);
138
- const pluginOptions: PiCustomAgentsOptions = {
139
- compactToolsEnabled: enabledPlugins.has("pi-compact-tools"),
140
- };
141
133
  for (const plugin of PLUGINS) {
142
134
  if (!enabledPlugins.has(plugin.id)) continue;
143
- await plugin.extension(pi, pluginOptions);
135
+ await plugin.extension(pi);
144
136
  }
145
137
  registerPluginCommand(pi, cwd, enabledPlugins);
146
138
  }
@@ -3,8 +3,6 @@ import { fileURLToPath } from "node:url";
3
3
  import { createEditTool } from "@earendil-works/pi-coding-agent";
4
4
  import { Text } from "@earendil-works/pi-tui";
5
5
 
6
- import { registerQuestionnaireTool } from "./questionnaire-tool.ts";
7
-
8
6
  const SOURCE_ROOT = path.dirname(fileURLToPath(import.meta.url));
9
7
 
10
8
  function registerCollapsedEditTool(extensionApi: any): void {
@@ -69,6 +67,5 @@ function registerCollapsedEditTool(extensionApi: any): void {
69
67
  }
70
68
 
71
69
  export default function piCompactToolsPlugin(pi: any): void {
72
- registerQuestionnaireTool(pi);
73
70
  registerCollapsedEditTool(pi);
74
71
  }
@@ -24,7 +24,8 @@ import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
24
24
  import {
25
25
  askQuestionnaire,
26
26
  type QuestionnaireQuestion,
27
- } from "../pi-compact-tools/questionnaire-tool.ts";
27
+ registerQuestionnaireTool,
28
+ } from "./questionnaire-tool.ts";
28
29
  import subagentPlugin from "./subagent/extensions/index.ts";
29
30
 
30
31
  function formatTokens(count: number): string {
@@ -558,21 +559,11 @@ function getLastModeFromSession(ctx: any): string | null {
558
559
  return null;
559
560
  }
560
561
 
561
- export type PiCustomAgentsOptions = {
562
- compactToolsEnabled: boolean;
563
- };
564
-
565
- export default async function piCustomAgentsPlugin(
566
- pi: any,
567
- options: PiCustomAgentsOptions = { compactToolsEnabled: true },
568
- ) {
562
+ export default async function piCustomAgentsPlugin(pi: any): Promise<void> {
569
563
  let currentMode: string = DEFAULT_MODE;
570
564
  let lastMessagedMode: string | null = null;
571
565
  let waitingForPlan = false;
572
- const compactToolsEnabled = options.compactToolsEnabled;
573
- const toolsForMode = (tools: string[]): string[] => compactToolsEnabled
574
- ? tools
575
- : tools.filter((toolName) => toolName !== "questionnaire");
566
+ registerQuestionnaireTool(pi);
576
567
 
577
568
  for (const modeId of MODE_IDS) {
578
569
  const mode = MODES[modeId];
@@ -602,11 +593,11 @@ export default async function piCustomAgentsPlugin(
602
593
  const mode = MODES[modeId];
603
594
  if (!mode) return;
604
595
  currentMode = modeId;
605
- pi.setActiveTools(toolsForMode(mode.tools));
596
+ pi.setActiveTools(mode.tools);
606
597
  if (modeId === DEFAULT_MODE) {
607
598
  ctx.ui.notify("Coder mode. Full access restored.");
608
599
  } else {
609
- ctx.ui.notify(`${mode.label} mode enabled. Tools: ${toolsForMode(mode.tools).join(", ")}`);
600
+ ctx.ui.notify(`${mode.label} mode enabled. Tools: ${mode.tools.join(", ")}`);
610
601
  }
611
602
  updateStatus(ctx);
612
603
  }
@@ -903,11 +894,11 @@ export default async function piCustomAgentsPlugin(
903
894
  if (restored && restored !== DEFAULT_MODE) {
904
895
  currentMode = restored;
905
896
  lastMessagedMode = restored;
906
- pi.setActiveTools(toolsForMode(MODES[restored].tools));
897
+ pi.setActiveTools(MODES[restored].tools);
907
898
  } else {
908
899
  currentMode = DEFAULT_MODE;
909
900
  lastMessagedMode = null;
910
- pi.setActiveTools(toolsForMode(FULL_TOOLS));
901
+ pi.setActiveTools(FULL_TOOLS);
911
902
  }
912
903
  installCustomFooter(ctx);
913
904
  updateStatus(ctx);
@@ -918,11 +909,11 @@ export default async function piCustomAgentsPlugin(
918
909
  if (restored && restored !== DEFAULT_MODE) {
919
910
  currentMode = restored;
920
911
  lastMessagedMode = restored;
921
- pi.setActiveTools(toolsForMode(MODES[restored].tools));
912
+ pi.setActiveTools(MODES[restored].tools);
922
913
  } else {
923
914
  currentMode = DEFAULT_MODE;
924
915
  lastMessagedMode = null;
925
- pi.setActiveTools(toolsForMode(FULL_TOOLS));
916
+ pi.setActiveTools(FULL_TOOLS);
926
917
  }
927
918
  updateStatus(ctx);
928
919
  installCustomFooter(ctx);