@agimon-ai/doompi-major-mode 0.0.1-alpha.2

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.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/adapters/pi/extension.cjs +2 -0
  4. package/dist/adapters/pi/extension.cjs.map +1 -0
  5. package/dist/adapters/pi/extension.d.cts +13 -0
  6. package/dist/adapters/pi/extension.d.cts.map +1 -0
  7. package/dist/adapters/pi/extension.d.mts +13 -0
  8. package/dist/adapters/pi/extension.d.mts.map +1 -0
  9. package/dist/adapters/pi/extension.mjs +2 -0
  10. package/dist/adapters/pi/extension.mjs.map +1 -0
  11. package/dist/adapters/pi/voiceTool.cjs +2 -0
  12. package/dist/adapters/pi/voiceTool.cjs.map +1 -0
  13. package/dist/adapters/pi/voiceTool.d.cts +15 -0
  14. package/dist/adapters/pi/voiceTool.d.cts.map +1 -0
  15. package/dist/adapters/pi/voiceTool.d.mts +15 -0
  16. package/dist/adapters/pi/voiceTool.d.mts.map +1 -0
  17. package/dist/adapters/pi/voiceTool.mjs +2 -0
  18. package/dist/adapters/pi/voiceTool.mjs.map +1 -0
  19. package/dist/adapters/telemetry/logSinkTelemetry.cjs +2 -0
  20. package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +1 -0
  21. package/dist/adapters/telemetry/logSinkTelemetry.d.cts +14 -0
  22. package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -0
  23. package/dist/adapters/telemetry/logSinkTelemetry.d.mts +14 -0
  24. package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -0
  25. package/dist/adapters/telemetry/logSinkTelemetry.mjs +2 -0
  26. package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +1 -0
  27. package/dist/commands/majorModeCommand.cjs +2 -0
  28. package/dist/commands/majorModeCommand.cjs.map +1 -0
  29. package/dist/commands/majorModeCommand.d.cts +15 -0
  30. package/dist/commands/majorModeCommand.d.cts.map +1 -0
  31. package/dist/commands/majorModeCommand.d.mts +15 -0
  32. package/dist/commands/majorModeCommand.d.mts.map +1 -0
  33. package/dist/commands/majorModeCommand.mjs +2 -0
  34. package/dist/commands/majorModeCommand.mjs.map +1 -0
  35. package/dist/extensions/pi.cjs +1 -0
  36. package/dist/extensions/pi.d.cts +2 -0
  37. package/dist/extensions/pi.d.mts +2 -0
  38. package/dist/extensions/pi.mjs +1 -0
  39. package/dist/index.cjs +1 -0
  40. package/dist/index.d.cts +11 -0
  41. package/dist/index.d.mts +11 -0
  42. package/dist/index.mjs +1 -0
  43. package/dist/schemas/majorModeVoiceTools.cjs +2 -0
  44. package/dist/schemas/majorModeVoiceTools.cjs.map +1 -0
  45. package/dist/schemas/majorModeVoiceTools.d.cts +30 -0
  46. package/dist/schemas/majorModeVoiceTools.d.cts.map +1 -0
  47. package/dist/schemas/majorModeVoiceTools.d.mts +30 -0
  48. package/dist/schemas/majorModeVoiceTools.d.mts.map +1 -0
  49. package/dist/schemas/majorModeVoiceTools.mjs +2 -0
  50. package/dist/schemas/majorModeVoiceTools.mjs.map +1 -0
  51. package/dist/services/majorModeText.cjs +8 -0
  52. package/dist/services/majorModeText.cjs.map +1 -0
  53. package/dist/services/majorModeText.d.cts +25 -0
  54. package/dist/services/majorModeText.d.cts.map +1 -0
  55. package/dist/services/majorModeText.d.mts +25 -0
  56. package/dist/services/majorModeText.d.mts.map +1 -0
  57. package/dist/services/majorModeText.mjs +8 -0
  58. package/dist/services/majorModeText.mjs.map +1 -0
  59. package/dist/services/pendingSelection.cjs +2 -0
  60. package/dist/services/pendingSelection.cjs.map +1 -0
  61. package/dist/services/pendingSelection.d.cts +17 -0
  62. package/dist/services/pendingSelection.d.cts.map +1 -0
  63. package/dist/services/pendingSelection.d.mts +17 -0
  64. package/dist/services/pendingSelection.d.mts.map +1 -0
  65. package/dist/services/pendingSelection.mjs +2 -0
  66. package/dist/services/pendingSelection.mjs.map +1 -0
  67. package/dist/services/statusLine.cjs +2 -0
  68. package/dist/services/statusLine.cjs.map +1 -0
  69. package/dist/services/statusLine.d.cts +16 -0
  70. package/dist/services/statusLine.d.cts.map +1 -0
  71. package/dist/services/statusLine.d.mts +16 -0
  72. package/dist/services/statusLine.d.mts.map +1 -0
  73. package/dist/services/statusLine.mjs +2 -0
  74. package/dist/services/statusLine.mjs.map +1 -0
  75. package/dist/types/majorMode.cjs +2 -0
  76. package/dist/types/majorMode.cjs.map +1 -0
  77. package/dist/types/majorMode.d.cts +16 -0
  78. package/dist/types/majorMode.d.cts.map +1 -0
  79. package/dist/types/majorMode.d.mts +16 -0
  80. package/dist/types/majorMode.d.mts.map +1 -0
  81. package/dist/types/majorMode.mjs +2 -0
  82. package/dist/types/majorMode.mjs.map +1 -0
  83. package/dist/types/telemetry.cjs +2 -0
  84. package/dist/types/telemetry.cjs.map +1 -0
  85. package/dist/types/telemetry.d.cts +15 -0
  86. package/dist/types/telemetry.d.cts.map +1 -0
  87. package/dist/types/telemetry.d.mts +15 -0
  88. package/dist/types/telemetry.d.mts.map +1 -0
  89. package/dist/types/telemetry.mjs +2 -0
  90. package/dist/types/telemetry.mjs.map +1 -0
  91. package/llms.txt +7 -0
  92. package/package.json +93 -0
@@ -0,0 +1,30 @@
1
+ import { Static, Type } from "typebox";
2
+ //#region src/schemas/majorModeVoiceTools.d.ts
3
+ declare const MAJOR_MODE_VOICE_TOOL_NAME = "major_mode";
4
+ declare const MAJOR_MODE_VOICE_INPUT_SCHEMA: Type.TUnion<[Type.TObject<{
5
+ action: Type.TLiteral<"list">;
6
+ }>, Type.TObject<{
7
+ action: Type.TLiteral<"switch">;
8
+ majorMode: Type.TString;
9
+ }>]>;
10
+ declare const MAJOR_MODE_VOICE_RESULT_SCHEMA: Type.TUnion<[Type.TObject<{
11
+ status: Type.TLiteral<"listed">;
12
+ current: Type.TString;
13
+ modes: Type.TArray<Type.TObject<{
14
+ name: Type.TString;
15
+ description: Type.TString;
16
+ layers: Type.TArray<Type.TString>;
17
+ }>>;
18
+ }>, Type.TObject<{
19
+ status: Type.TLiteral<"unchanged">;
20
+ majorMode: Type.TString;
21
+ }>, Type.TObject<{
22
+ status: Type.TLiteral<"queued">;
23
+ majorMode: Type.TString;
24
+ stopBatch: Type.TLiteral<"session-reload">;
25
+ }>]>;
26
+ type MajorModeVoiceInput = Static<typeof MAJOR_MODE_VOICE_INPUT_SCHEMA>;
27
+ type MajorModeVoiceResult = Static<typeof MAJOR_MODE_VOICE_RESULT_SCHEMA>;
28
+ //#endregion
29
+ export { MAJOR_MODE_VOICE_INPUT_SCHEMA, MAJOR_MODE_VOICE_RESULT_SCHEMA, MAJOR_MODE_VOICE_TOOL_NAME, MajorModeVoiceInput, MajorModeVoiceResult };
30
+ //# sourceMappingURL=majorModeVoiceTools.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorModeVoiceTools.d.mts","names":[],"sources":["../../src/schemas/majorModeVoiceTools.ts"],"mappings":";;cAGa;cASA,+BAA6B,KAAA,QAAA,KAAA;;;;;;cAW7B,gCAA8B,KAAA,QAAA,KAAA;;;;;;;;;;;;;;;;KAmC/B,sBAAsB,cAAc;KACpC,uBAAuB,cAAc"}
@@ -0,0 +1,2 @@
1
+ import{VOICE_TOOL_MAX_IDENTIFIER_LENGTH as e}from"@agimon-ai/doompi-extension-contracts/voice-tools";import{Type as t}from"typebox";const n=`major_mode`,r=t.String({minLength:1,maxLength:e}),i=t.String({minLength:1}),a=t.Array(i),o=t.Union([t.Object({action:t.Literal(`list`)},{additionalProperties:!1}),t.Object({action:t.Literal(`switch`),majorMode:r},{additionalProperties:!1})]),s=t.Union([t.Object({status:t.Literal(`listed`),current:i,modes:t.Array(t.Object({name:i,description:t.String({minLength:1}),layers:a},{additionalProperties:!1}))},{additionalProperties:!1}),t.Object({status:t.Literal(`unchanged`),majorMode:i},{additionalProperties:!1}),t.Object({status:t.Literal(`queued`),majorMode:i,stopBatch:t.Literal(`session-reload`)},{additionalProperties:!1})]);export{o as MAJOR_MODE_VOICE_INPUT_SCHEMA,s as MAJOR_MODE_VOICE_RESULT_SCHEMA,n as MAJOR_MODE_VOICE_TOOL_NAME};
2
+ //# sourceMappingURL=majorModeVoiceTools.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorModeVoiceTools.mjs","names":[],"sources":["../../src/schemas/majorModeVoiceTools.ts"],"sourcesContent":["import { VOICE_TOOL_MAX_IDENTIFIER_LENGTH } from '@agimon-ai/doompi-extension-contracts/voice-tools';\nimport { type Static, Type } from 'typebox';\n\nexport const MAJOR_MODE_VOICE_TOOL_NAME = 'major_mode';\n\nconst MAJOR_MODE_INPUT_NAME_SCHEMA = Type.String({\n minLength: 1,\n maxLength: VOICE_TOOL_MAX_IDENTIFIER_LENGTH,\n});\nconst CONFIGURED_NAME_SCHEMA = Type.String({ minLength: 1 });\nconst MAJOR_MODE_LAYERS_SCHEMA = Type.Array(CONFIGURED_NAME_SCHEMA);\n\nexport const MAJOR_MODE_VOICE_INPUT_SCHEMA = Type.Union([\n Type.Object({ action: Type.Literal('list') }, { additionalProperties: false }),\n Type.Object(\n {\n action: Type.Literal('switch'),\n majorMode: MAJOR_MODE_INPUT_NAME_SCHEMA,\n },\n { additionalProperties: false },\n ),\n]);\n\nexport const MAJOR_MODE_VOICE_RESULT_SCHEMA = Type.Union([\n Type.Object(\n {\n status: Type.Literal('listed'),\n current: CONFIGURED_NAME_SCHEMA,\n modes: Type.Array(\n Type.Object(\n {\n name: CONFIGURED_NAME_SCHEMA,\n description: Type.String({ minLength: 1 }),\n layers: MAJOR_MODE_LAYERS_SCHEMA,\n },\n { additionalProperties: false },\n ),\n ),\n },\n { additionalProperties: false },\n ),\n Type.Object(\n {\n status: Type.Literal('unchanged'),\n majorMode: CONFIGURED_NAME_SCHEMA,\n },\n { additionalProperties: false },\n ),\n Type.Object(\n {\n status: Type.Literal('queued'),\n majorMode: CONFIGURED_NAME_SCHEMA,\n stopBatch: Type.Literal('session-reload'),\n },\n { additionalProperties: false },\n ),\n]);\n\nexport type MajorModeVoiceInput = Static<typeof MAJOR_MODE_VOICE_INPUT_SCHEMA>;\nexport type MajorModeVoiceResult = Static<typeof MAJOR_MODE_VOICE_RESULT_SCHEMA>;\n"],"mappings":"oIAGA,MAAa,EAA6B,aAEpC,EAA+B,EAAK,OAAO,CAC/C,UAAW,EACX,UAAW,CACb,CAAC,EACK,EAAyB,EAAK,OAAO,CAAE,UAAW,CAAE,CAAC,EACrD,EAA2B,EAAK,MAAM,CAAsB,EAErD,EAAgC,EAAK,MAAM,CACtD,EAAK,OAAO,CAAE,OAAQ,EAAK,QAAQ,MAAM,CAAE,EAAG,CAAE,qBAAsB,EAAM,CAAC,EAC7E,EAAK,OACH,CACE,OAAQ,EAAK,QAAQ,QAAQ,EAC7B,UAAW,CACb,EACA,CAAE,qBAAsB,EAAM,CAChC,CACF,CAAC,EAEY,EAAiC,EAAK,MAAM,CACvD,EAAK,OACH,CACE,OAAQ,EAAK,QAAQ,QAAQ,EAC7B,QAAS,EACT,MAAO,EAAK,MACV,EAAK,OACH,CACE,KAAM,EACN,YAAa,EAAK,OAAO,CAAE,UAAW,CAAE,CAAC,EACzC,OAAQ,CACV,EACA,CAAE,qBAAsB,EAAM,CAChC,CACF,CACF,EACA,CAAE,qBAAsB,EAAM,CAChC,EACA,EAAK,OACH,CACE,OAAQ,EAAK,QAAQ,WAAW,EAChC,UAAW,CACb,EACA,CAAE,qBAAsB,EAAM,CAChC,EACA,EAAK,OACH,CACE,OAAQ,EAAK,QAAQ,QAAQ,EAC7B,UAAW,EACX,UAAW,EAAK,QAAQ,gBAAgB,CAC1C,EACA,CAAE,qBAAsB,EAAM,CAChC,CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ const e=/^\[[ x]\] /,t=`core only`,n=`--major-mode`;function r(e,n){return n.map(n=>({value:n,label:n,description:e.majorMode[n]?.description??t}))}function i(e,n,r){return`${e===r?`[x]`:`[ ]`} ${e}: ${n.join(`, `)||t}`}function a(t){return t.replace(e,``).split(`:`)[0]??t}function o(e,r,i,a=!1,o){let s=`Switched to ${e}: ${r.join(`, `)||t}`;return o===`process-relaunch`?[`Major mode ${e} is pending; the current process remains active.`,` ./pi.sh ${n} ${e}`].join(`
2
+ `):o===`pi-reload`?[s,`Pi reloaded.`].join(`
3
+ `):!i||a?[s,`Hooks reloaded.`].join(`
4
+ `):[s,`Hooks reloaded. Extensions are fixed at launch, so for those:`,` ./pi.sh ${n} ${e}`].join(`
5
+ `)}function s(e,r,i,a=!1){let o=`Major mode ${e}: ${r.join(`, `)||t}`;return e!==i&&!a?[o,`Relaunch with:\n ./pi.sh ${n} ${e}`].join(`
6
+ `):e===i?[o,`Already using this major mode.`].join(`
7
+ `):o}function c(e){let t=e.trim();if(!t.startsWith(`--voice-switch-token=`))return;let n=t.split(/\s+/u);if(n.length!==1)throw Error(`The voice major-mode switch token must be the only command argument.`);let r=n[0]?.slice(21).trim();if(!r)throw Error(`The voice major-mode switch token is missing.`);return r}function l(e){return e instanceof Error?e.message:String(e)}exports.MAJOR_MODE_COMMAND=`mode`,exports.VOICE_SWITCH_TOKEN_PREFIX=`--voice-switch-token=`,exports.applySummary=o,exports.errorMessage=l,exports.majorModeItems=r,exports.majorModeOptionLabel=i,exports.majorModeSummary=s,exports.optionName=a,exports.voiceSwitchToken=c;
8
+ //# sourceMappingURL=majorModeText.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorModeText.cjs","names":[],"sources":["../../src/services/majorModeText.ts"],"sourcesContent":["import type { MajorModesConfig } from '@agimon-ai/doompi-config/majorModes';\nimport type { TransitionExecutionStrategy } from '@agimon-ai/doompi-extension-contracts/transition';\nimport type { SelectItem } from '@earendil-works/pi-tui';\n\nconst OPTION_PREFIX = /^\\[[ x]\\] /;\nconst CORE_ONLY = 'core only';\nconst MARK_ON = '[x]';\nconst MARK_OFF = '[ ]';\nconst RELAUNCH = 'Relaunch with:';\nconst MAJOR_MODE_OPTION = '--major-mode';\nexport const MAJOR_MODE_COMMAND = 'mode';\nexport const VOICE_SWITCH_TOKEN_PREFIX = '--voice-switch-token=';\n\n/** Picker rows show the resolved layers while retaining bare major mode values. */\nexport function majorModeItems(config: MajorModesConfig, names: string[]): SelectItem[] {\n return names.map((name) => ({\n value: name,\n label: name,\n description: config.majorMode[name]?.description ?? CORE_ONLY,\n }));\n}\n\nexport function majorModeOptionLabel(name: string, layers: string[], current: string): string {\n return `${name === current ? MARK_ON : MARK_OFF} ${name}: ${layers.join(', ') || CORE_ONLY}`;\n}\n\nexport function optionName(option: string): string {\n return option.replace(OPTION_PREFIX, '').split(':')[0] ?? option;\n}\n\n/**\n * What a switch actually applied.\n *\n * A synced session composes its extension set on every load, so a reload picks\n * up the new layers outright. A launcher session cannot: Pi freezes the CLI\n * `--extension` list at construction, so a layer that contributes extensions\n * needs a relaunch there and only the hooks change in place.\n */\nexport function applySummary(\n picked: string,\n layers: string[],\n stale: boolean,\n composed = false,\n strategy?: TransitionExecutionStrategy,\n): string {\n const head = `Switched to ${picked}: ${layers.join(', ') || CORE_ONLY}`;\n if (strategy === 'process-relaunch') {\n return [\n `Major mode ${picked} is pending; the current process remains active.`,\n ` ./pi.sh ${MAJOR_MODE_OPTION} ${picked}`,\n ].join('\\n');\n }\n if (strategy === 'pi-reload') return [head, 'Pi reloaded.'].join('\\n');\n if (!stale || composed) return [head, 'Hooks reloaded.'].join('\\n');\n return [\n head,\n 'Hooks reloaded. Extensions are fixed at launch, so for those:',\n ` ./pi.sh ${MAJOR_MODE_OPTION} ${picked}`,\n ].join('\\n');\n}\n\nexport function majorModeSummary(picked: string, layers: string[], current: string, composed = false): string {\n const contents = `Major mode ${picked}: ${layers.join(', ') || CORE_ONLY}`;\n if (picked !== current && !composed) {\n return [contents, `${RELAUNCH}\\n ./pi.sh ${MAJOR_MODE_OPTION} ${picked}`].join('\\n');\n }\n if (picked !== current) return contents;\n return [contents, 'Already using this major mode.'].join('\\n');\n}\n\n/** The opaque token a voice switch hands to the follow-up command invocation. */\nexport function voiceSwitchToken(args: string): string | undefined {\n const trimmed = args.trim();\n if (!trimmed.startsWith(VOICE_SWITCH_TOKEN_PREFIX)) return undefined;\n const parts = trimmed.split(/\\s+/u);\n if (parts.length !== 1) throw new Error('The voice major-mode switch token must be the only command argument.');\n const token = parts[0]?.slice(VOICE_SWITCH_TOKEN_PREFIX.length).trim();\n if (!token) throw new Error('The voice major-mode switch token is missing.');\n return token;\n}\n\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n"],"mappings":"AAIA,MAAM,EAAgB,aAChB,EAAY,YAIZ,EAAoB,eAK1B,SAAgB,EAAe,EAA0B,EAA+B,CACtF,OAAO,EAAM,IAAK,IAAU,CAC1B,MAAO,EACP,MAAO,EACP,YAAa,EAAO,UAAU,EAAK,EAAE,aAAe,CACtD,EAAE,CACJ,CAEA,SAAgB,EAAqB,EAAc,EAAkB,EAAyB,CAC5F,MAAO,GAAG,IAAS,EAAU,MAAU,MAAS,GAAG,EAAK,IAAI,EAAO,KAAK,IAAI,GAAK,GACnF,CAEA,SAAgB,EAAW,EAAwB,CACjD,OAAO,EAAO,QAAQ,EAAe,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAM,CAC5D,CAUA,SAAgB,EACd,EACA,EACA,EACA,EAAW,GACX,EACQ,CACR,IAAM,EAAO,eAAe,EAAO,IAAI,EAAO,KAAK,IAAI,GAAK,IAS5D,OARI,IAAa,mBACR,CACL,cAAc,EAAO,kDACrB,aAAa,EAAkB,GAAG,GACpC,CAAC,CAAC,KAAK;CAAI,EAET,IAAa,YAAoB,CAAC,EAAM,cAAc,CAAC,CAAC,KAAK;CAAI,EACjE,CAAC,GAAS,EAAiB,CAAC,EAAM,iBAAiB,CAAC,CAAC,KAAK;CAAI,EAC3D,CACL,EACA,gEACA,aAAa,EAAkB,GAAG,GACpC,CAAC,CAAC,KAAK;CAAI,CACb,CAEA,SAAgB,EAAiB,EAAgB,EAAkB,EAAiB,EAAW,GAAe,CAC5G,IAAM,EAAW,cAAc,EAAO,IAAI,EAAO,KAAK,IAAI,GAAK,IAK/D,OAJI,IAAW,GAAW,CAAC,EAClB,CAAC,EAAU,6BAA0B,EAAkB,GAAG,GAAQ,CAAC,CAAC,KAAK;CAAI,EAElF,IAAW,EACR,CAAC,EAAU,gCAAgC,CAAC,CAAC,KAAK;CAAI,EAD9B,CAEjC,CAGA,SAAgB,EAAiB,EAAkC,CACjE,IAAM,EAAU,EAAK,KAAK,EAC1B,GAAI,CAAC,EAAQ,WAAA,uBAAoC,EAAG,OACpD,IAAM,EAAQ,EAAQ,MAAM,MAAM,EAClC,GAAI,EAAM,SAAW,EAAG,MAAU,MAAM,sEAAsE,EAC9G,IAAM,EAAQ,EAAM,EAAE,EAAE,MAAM,EAAgC,CAAC,CAAC,KAAK,EACrE,GAAI,CAAC,EAAO,MAAU,MAAM,+CAA+C,EAC3E,OAAO,CACT,CAEA,SAAgB,EAAa,EAAwB,CACnD,OAAO,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,CAC9D"}
@@ -0,0 +1,25 @@
1
+ import { MajorModesConfig } from "@agimon-ai/doompi-config/majorModes";
2
+ import { TransitionExecutionStrategy } from "@agimon-ai/doompi-extension-contracts/transition";
3
+ import { SelectItem } from "@earendil-works/pi-tui";
4
+ //#region src/services/majorModeText.d.ts
5
+ declare const MAJOR_MODE_COMMAND = "mode";
6
+ declare const VOICE_SWITCH_TOKEN_PREFIX = "--voice-switch-token=";
7
+ /** Picker rows show the resolved layers while retaining bare major mode values. */
8
+ declare function majorModeItems(config: MajorModesConfig, names: string[]): SelectItem[];
9
+ declare function majorModeOptionLabel(name: string, layers: string[], current: string): string;
10
+ declare function optionName(option: string): string;
11
+ /**
12
+ * What a switch actually applied.
13
+ *
14
+ * A synced session composes its extension set on every load, so a reload picks
15
+ * up the new layers outright. A launcher session cannot: Pi freezes the CLI
16
+ * `--extension` list at construction, so a layer that contributes extensions
17
+ * needs a relaunch there and only the hooks change in place.
18
+ */
19
+ declare function applySummary(picked: string, layers: string[], stale: boolean, composed?: boolean, strategy?: TransitionExecutionStrategy): string;
20
+ declare function majorModeSummary(picked: string, layers: string[], current: string, composed?: boolean): string;
21
+ /** The opaque token a voice switch hands to the follow-up command invocation. */
22
+ declare function voiceSwitchToken(args: string): string | undefined;
23
+ //#endregion
24
+ export { MAJOR_MODE_COMMAND, VOICE_SWITCH_TOKEN_PREFIX, applySummary, majorModeItems, majorModeOptionLabel, majorModeSummary, optionName, voiceSwitchToken };
25
+ //# sourceMappingURL=majorModeText.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorModeText.d.cts","names":[],"sources":["../../src/services/majorModeText.ts"],"mappings":";;;;cAUa;cACA;;iBAGG,eAAe,QAAQ,kBAAkB,kBAAkB;iBAQ3D,qBAAqB,cAAc,kBAAkB;iBAIrD,WAAW;;;;;;;;;iBAYX,aACd,gBACA,kBACA,gBACA,oBACA,WAAW;iBAkBG,iBAAiB,gBAAgB,kBAAkB,iBAAiB;;iBAUpE,iBAAiB"}
@@ -0,0 +1,25 @@
1
+ import { MajorModesConfig } from "@agimon-ai/doompi-config/majorModes";
2
+ import { TransitionExecutionStrategy } from "@agimon-ai/doompi-extension-contracts/transition";
3
+ import { SelectItem } from "@earendil-works/pi-tui";
4
+ //#region src/services/majorModeText.d.ts
5
+ declare const MAJOR_MODE_COMMAND = "mode";
6
+ declare const VOICE_SWITCH_TOKEN_PREFIX = "--voice-switch-token=";
7
+ /** Picker rows show the resolved layers while retaining bare major mode values. */
8
+ declare function majorModeItems(config: MajorModesConfig, names: string[]): SelectItem[];
9
+ declare function majorModeOptionLabel(name: string, layers: string[], current: string): string;
10
+ declare function optionName(option: string): string;
11
+ /**
12
+ * What a switch actually applied.
13
+ *
14
+ * A synced session composes its extension set on every load, so a reload picks
15
+ * up the new layers outright. A launcher session cannot: Pi freezes the CLI
16
+ * `--extension` list at construction, so a layer that contributes extensions
17
+ * needs a relaunch there and only the hooks change in place.
18
+ */
19
+ declare function applySummary(picked: string, layers: string[], stale: boolean, composed?: boolean, strategy?: TransitionExecutionStrategy): string;
20
+ declare function majorModeSummary(picked: string, layers: string[], current: string, composed?: boolean): string;
21
+ /** The opaque token a voice switch hands to the follow-up command invocation. */
22
+ declare function voiceSwitchToken(args: string): string | undefined;
23
+ //#endregion
24
+ export { MAJOR_MODE_COMMAND, VOICE_SWITCH_TOKEN_PREFIX, applySummary, majorModeItems, majorModeOptionLabel, majorModeSummary, optionName, voiceSwitchToken };
25
+ //# sourceMappingURL=majorModeText.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorModeText.d.mts","names":[],"sources":["../../src/services/majorModeText.ts"],"mappings":";;;;cAUa;cACA;;iBAGG,eAAe,QAAQ,kBAAkB,kBAAkB;iBAQ3D,qBAAqB,cAAc,kBAAkB;iBAIrD,WAAW;;;;;;;;;iBAYX,aACd,gBACA,kBACA,gBACA,oBACA,WAAW;iBAkBG,iBAAiB,gBAAgB,kBAAkB,iBAAiB;;iBAUpE,iBAAiB"}
@@ -0,0 +1,8 @@
1
+ const e=/^\[[ x]\] /,t=`core only`,n=`--major-mode`,r=`mode`,i=`--voice-switch-token=`;function a(e,n){return n.map(n=>({value:n,label:n,description:e.majorMode[n]?.description??t}))}function o(e,n,r){return`${e===r?`[x]`:`[ ]`} ${e}: ${n.join(`, `)||t}`}function s(t){return t.replace(e,``).split(`:`)[0]??t}function c(e,r,i,a=!1,o){let s=`Switched to ${e}: ${r.join(`, `)||t}`;return o===`process-relaunch`?[`Major mode ${e} is pending; the current process remains active.`,` ./pi.sh ${n} ${e}`].join(`
2
+ `):o===`pi-reload`?[s,`Pi reloaded.`].join(`
3
+ `):!i||a?[s,`Hooks reloaded.`].join(`
4
+ `):[s,`Hooks reloaded. Extensions are fixed at launch, so for those:`,` ./pi.sh ${n} ${e}`].join(`
5
+ `)}function l(e,r,i,a=!1){let o=`Major mode ${e}: ${r.join(`, `)||t}`;return e!==i&&!a?[o,`Relaunch with:\n ./pi.sh ${n} ${e}`].join(`
6
+ `):e===i?[o,`Already using this major mode.`].join(`
7
+ `):o}function u(e){let t=e.trim();if(!t.startsWith(`--voice-switch-token=`))return;let n=t.split(/\s+/u);if(n.length!==1)throw Error(`The voice major-mode switch token must be the only command argument.`);let r=n[0]?.slice(21).trim();if(!r)throw Error(`The voice major-mode switch token is missing.`);return r}function d(e){return e instanceof Error?e.message:String(e)}export{r as MAJOR_MODE_COMMAND,i as VOICE_SWITCH_TOKEN_PREFIX,c as applySummary,d as errorMessage,a as majorModeItems,o as majorModeOptionLabel,l as majorModeSummary,s as optionName,u as voiceSwitchToken};
8
+ //# sourceMappingURL=majorModeText.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorModeText.mjs","names":[],"sources":["../../src/services/majorModeText.ts"],"sourcesContent":["import type { MajorModesConfig } from '@agimon-ai/doompi-config/majorModes';\nimport type { TransitionExecutionStrategy } from '@agimon-ai/doompi-extension-contracts/transition';\nimport type { SelectItem } from '@earendil-works/pi-tui';\n\nconst OPTION_PREFIX = /^\\[[ x]\\] /;\nconst CORE_ONLY = 'core only';\nconst MARK_ON = '[x]';\nconst MARK_OFF = '[ ]';\nconst RELAUNCH = 'Relaunch with:';\nconst MAJOR_MODE_OPTION = '--major-mode';\nexport const MAJOR_MODE_COMMAND = 'mode';\nexport const VOICE_SWITCH_TOKEN_PREFIX = '--voice-switch-token=';\n\n/** Picker rows show the resolved layers while retaining bare major mode values. */\nexport function majorModeItems(config: MajorModesConfig, names: string[]): SelectItem[] {\n return names.map((name) => ({\n value: name,\n label: name,\n description: config.majorMode[name]?.description ?? CORE_ONLY,\n }));\n}\n\nexport function majorModeOptionLabel(name: string, layers: string[], current: string): string {\n return `${name === current ? MARK_ON : MARK_OFF} ${name}: ${layers.join(', ') || CORE_ONLY}`;\n}\n\nexport function optionName(option: string): string {\n return option.replace(OPTION_PREFIX, '').split(':')[0] ?? option;\n}\n\n/**\n * What a switch actually applied.\n *\n * A synced session composes its extension set on every load, so a reload picks\n * up the new layers outright. A launcher session cannot: Pi freezes the CLI\n * `--extension` list at construction, so a layer that contributes extensions\n * needs a relaunch there and only the hooks change in place.\n */\nexport function applySummary(\n picked: string,\n layers: string[],\n stale: boolean,\n composed = false,\n strategy?: TransitionExecutionStrategy,\n): string {\n const head = `Switched to ${picked}: ${layers.join(', ') || CORE_ONLY}`;\n if (strategy === 'process-relaunch') {\n return [\n `Major mode ${picked} is pending; the current process remains active.`,\n ` ./pi.sh ${MAJOR_MODE_OPTION} ${picked}`,\n ].join('\\n');\n }\n if (strategy === 'pi-reload') return [head, 'Pi reloaded.'].join('\\n');\n if (!stale || composed) return [head, 'Hooks reloaded.'].join('\\n');\n return [\n head,\n 'Hooks reloaded. Extensions are fixed at launch, so for those:',\n ` ./pi.sh ${MAJOR_MODE_OPTION} ${picked}`,\n ].join('\\n');\n}\n\nexport function majorModeSummary(picked: string, layers: string[], current: string, composed = false): string {\n const contents = `Major mode ${picked}: ${layers.join(', ') || CORE_ONLY}`;\n if (picked !== current && !composed) {\n return [contents, `${RELAUNCH}\\n ./pi.sh ${MAJOR_MODE_OPTION} ${picked}`].join('\\n');\n }\n if (picked !== current) return contents;\n return [contents, 'Already using this major mode.'].join('\\n');\n}\n\n/** The opaque token a voice switch hands to the follow-up command invocation. */\nexport function voiceSwitchToken(args: string): string | undefined {\n const trimmed = args.trim();\n if (!trimmed.startsWith(VOICE_SWITCH_TOKEN_PREFIX)) return undefined;\n const parts = trimmed.split(/\\s+/u);\n if (parts.length !== 1) throw new Error('The voice major-mode switch token must be the only command argument.');\n const token = parts[0]?.slice(VOICE_SWITCH_TOKEN_PREFIX.length).trim();\n if (!token) throw new Error('The voice major-mode switch token is missing.');\n return token;\n}\n\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n"],"mappings":"AAIA,MAAM,EAAgB,aAChB,EAAY,YAIZ,EAAoB,eACb,EAAqB,OACrB,EAA4B,wBAGzC,SAAgB,EAAe,EAA0B,EAA+B,CACtF,OAAO,EAAM,IAAK,IAAU,CAC1B,MAAO,EACP,MAAO,EACP,YAAa,EAAO,UAAU,EAAK,EAAE,aAAe,CACtD,EAAE,CACJ,CAEA,SAAgB,EAAqB,EAAc,EAAkB,EAAyB,CAC5F,MAAO,GAAG,IAAS,EAAU,MAAU,MAAS,GAAG,EAAK,IAAI,EAAO,KAAK,IAAI,GAAK,GACnF,CAEA,SAAgB,EAAW,EAAwB,CACjD,OAAO,EAAO,QAAQ,EAAe,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAM,CAC5D,CAUA,SAAgB,EACd,EACA,EACA,EACA,EAAW,GACX,EACQ,CACR,IAAM,EAAO,eAAe,EAAO,IAAI,EAAO,KAAK,IAAI,GAAK,IAS5D,OARI,IAAa,mBACR,CACL,cAAc,EAAO,kDACrB,aAAa,EAAkB,GAAG,GACpC,CAAC,CAAC,KAAK;CAAI,EAET,IAAa,YAAoB,CAAC,EAAM,cAAc,CAAC,CAAC,KAAK;CAAI,EACjE,CAAC,GAAS,EAAiB,CAAC,EAAM,iBAAiB,CAAC,CAAC,KAAK;CAAI,EAC3D,CACL,EACA,gEACA,aAAa,EAAkB,GAAG,GACpC,CAAC,CAAC,KAAK;CAAI,CACb,CAEA,SAAgB,EAAiB,EAAgB,EAAkB,EAAiB,EAAW,GAAe,CAC5G,IAAM,EAAW,cAAc,EAAO,IAAI,EAAO,KAAK,IAAI,GAAK,IAK/D,OAJI,IAAW,GAAW,CAAC,EAClB,CAAC,EAAU,6BAA0B,EAAkB,GAAG,GAAQ,CAAC,CAAC,KAAK;CAAI,EAElF,IAAW,EACR,CAAC,EAAU,gCAAgC,CAAC,CAAC,KAAK;CAAI,EAD9B,CAEjC,CAGA,SAAgB,EAAiB,EAAkC,CACjE,IAAM,EAAU,EAAK,KAAK,EAC1B,GAAI,CAAC,EAAQ,WAAA,uBAAoC,EAAG,OACpD,IAAM,EAAQ,EAAQ,MAAM,MAAM,EAClC,GAAI,EAAM,SAAW,EAAG,MAAU,MAAM,sEAAsE,EAC9G,IAAM,EAAQ,EAAM,EAAE,EAAE,MAAM,EAAgC,CAAC,CAAC,KAAK,EACrE,GAAI,CAAC,EAAO,MAAU,MAAM,+CAA+C,EAC3E,OAAO,CACT,CAEA,SAAgB,EAAa,EAAwB,CACnD,OAAO,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,CAC9D"}
@@ -0,0 +1,2 @@
1
+ let e=require("@agimon-ai/doompi-config/piContext");function t(e){return{version:1,majorMode:e.majorMode,domains:[...e.domains],profile:e.profile,compositionFingerprint:e.compositionFingerprint}}function n(t,n){let r=(0,e.requireDoomConfigContext)(n),i=r.pendingSelection;i&&((0,e.supersedeDoomConfigTransition)(t,i),(0,e.provideDoomConfigContext)(n,Object.freeze({...r,pendingSelection:void 0})))}function r(e,t){let n=e=>Object.freeze({...e,domains:Object.freeze([...e.domains])});return Object.freeze({...e,pendingSelection:Object.freeze({...t,active:n(t.active),target:n(t.target)})})}exports.bindPendingSelection=r,exports.clearPendingSelection=n,exports.selectionFromSnapshot=t;
2
+ //# sourceMappingURL=pendingSelection.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingSelection.cjs","names":["requireDoomConfigContext","provideDoomConfigContext"],"sources":["../../src/services/pendingSelection.ts"],"sourcesContent":["import {\n provideDoomConfigContext,\n requireDoomConfigContext,\n supersedeDoomConfigTransition,\n} from '@agimon-ai/doompi-config/piContext';\nimport type { DoomConfigContext, DoomConfigPendingSelection } from '@agimon-ai/doompi-config/types';\nimport type { TransitionSelectionSnapshot } from '@agimon-ai/doompi-extension-contracts/transition';\nimport type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\n\n/** The journal shape a transition records for the session that resumes after it. */\nexport function selectionFromSnapshot(snapshot: TransitionSelectionSnapshot) {\n return {\n version: 1 as const,\n majorMode: snapshot.majorMode,\n domains: [...snapshot.domains],\n profile: snapshot.profile,\n compositionFingerprint: snapshot.compositionFingerprint,\n };\n}\n\nexport function clearPendingSelection(pi: ExtensionAPI, ctx: ExtensionContext): void {\n const context = requireDoomConfigContext(ctx);\n const pendingSelection = context.pendingSelection;\n if (!pendingSelection) return;\n supersedeDoomConfigTransition(pi, pendingSelection);\n void provideDoomConfigContext(ctx, Object.freeze({ ...context, pendingSelection: undefined }));\n}\n\nexport function bindPendingSelection(\n context: DoomConfigContext,\n pendingSelection: DoomConfigPendingSelection,\n): DoomConfigContext {\n const freezeSelection = (selection: DoomConfigPendingSelection['active']) =>\n Object.freeze({ ...selection, domains: Object.freeze([...selection.domains]) });\n return Object.freeze({\n ...context,\n pendingSelection: Object.freeze({\n ...pendingSelection,\n active: freezeSelection(pendingSelection.active),\n target: freezeSelection(pendingSelection.target),\n }),\n });\n}\n"],"mappings":"oDAUA,SAAgB,EAAsB,EAAuC,CAC3E,MAAO,CACL,QAAS,EACT,UAAW,EAAS,UACpB,QAAS,CAAC,GAAG,EAAS,OAAO,EAC7B,QAAS,EAAS,QAClB,uBAAwB,EAAS,sBACnC,CACF,CAEA,SAAgB,EAAsB,EAAkB,EAA6B,CACnF,IAAM,GAAA,EAAUA,EAAAA,yBAAAA,CAAyB,CAAG,EACtC,EAAmB,EAAQ,iBAC5B,KACL,EAAA,EAAA,8BAAA,CAA8B,EAAI,CAAgB,GAClD,EAAKC,EAAAA,yBAAAA,CAAyB,EAAK,OAAO,OAAO,CAAE,GAAG,EAAS,iBAAkB,IAAA,EAAU,CAAC,CAAC,EAC/F,CAEA,SAAgB,EACd,EACA,EACmB,CACnB,IAAM,EAAmB,GACvB,OAAO,OAAO,CAAE,GAAG,EAAW,QAAS,OAAO,OAAO,CAAC,GAAG,EAAU,OAAO,CAAC,CAAE,CAAC,EAChF,OAAO,OAAO,OAAO,CACnB,GAAG,EACH,iBAAkB,OAAO,OAAO,CAC9B,GAAG,EACH,OAAQ,EAAgB,EAAiB,MAAM,EAC/C,OAAQ,EAAgB,EAAiB,MAAM,CACjD,CAAC,CACH,CAAC,CACH"}
@@ -0,0 +1,17 @@
1
+ import { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
2
+ import { TransitionSelectionSnapshot } from "@agimon-ai/doompi-extension-contracts/transition";
3
+ import { DoomConfigContext, DoomConfigPendingSelection } from "@agimon-ai/doompi-config/types";
4
+ //#region src/services/pendingSelection.d.ts
5
+ /** The journal shape a transition records for the session that resumes after it. */
6
+ declare function selectionFromSnapshot(snapshot: TransitionSelectionSnapshot): {
7
+ version: 1;
8
+ majorMode: string;
9
+ domains: string[];
10
+ profile: string | undefined;
11
+ compositionFingerprint: string | undefined;
12
+ };
13
+ declare function clearPendingSelection(pi: ExtensionAPI, ctx: ExtensionContext): void;
14
+ declare function bindPendingSelection(context: DoomConfigContext, pendingSelection: DoomConfigPendingSelection): DoomConfigContext;
15
+ //#endregion
16
+ export { bindPendingSelection, clearPendingSelection, selectionFromSnapshot };
17
+ //# sourceMappingURL=pendingSelection.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingSelection.d.cts","names":[],"sources":["../../src/services/pendingSelection.ts"],"mappings":";;;;;iBAUgB,sBAAsB,UAAU;;;;;;;iBAUhC,sBAAsB,IAAI,cAAc,KAAK;iBAQ7C,qBACd,SAAS,mBACT,kBAAkB,6BACjB"}
@@ -0,0 +1,17 @@
1
+ import { TransitionSelectionSnapshot } from "@agimon-ai/doompi-extension-contracts/transition";
2
+ import { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
3
+ import { DoomConfigContext, DoomConfigPendingSelection } from "@agimon-ai/doompi-config/types";
4
+ //#region src/services/pendingSelection.d.ts
5
+ /** The journal shape a transition records for the session that resumes after it. */
6
+ declare function selectionFromSnapshot(snapshot: TransitionSelectionSnapshot): {
7
+ version: 1;
8
+ majorMode: string;
9
+ domains: string[];
10
+ profile: string | undefined;
11
+ compositionFingerprint: string | undefined;
12
+ };
13
+ declare function clearPendingSelection(pi: ExtensionAPI, ctx: ExtensionContext): void;
14
+ declare function bindPendingSelection(context: DoomConfigContext, pendingSelection: DoomConfigPendingSelection): DoomConfigContext;
15
+ //#endregion
16
+ export { bindPendingSelection, clearPendingSelection, selectionFromSnapshot };
17
+ //# sourceMappingURL=pendingSelection.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingSelection.d.mts","names":[],"sources":["../../src/services/pendingSelection.ts"],"mappings":";;;;;iBAUgB,sBAAsB,UAAU;;;;;;;iBAUhC,sBAAsB,IAAI,cAAc,KAAK;iBAQ7C,qBACd,SAAS,mBACT,kBAAkB,6BACjB"}
@@ -0,0 +1,2 @@
1
+ import{provideDoomConfigContext as e,requireDoomConfigContext as t,supersedeDoomConfigTransition as n}from"@agimon-ai/doompi-config/piContext";function r(e){return{version:1,majorMode:e.majorMode,domains:[...e.domains],profile:e.profile,compositionFingerprint:e.compositionFingerprint}}function i(r,i){let a=t(i),o=a.pendingSelection;o&&(n(r,o),e(i,Object.freeze({...a,pendingSelection:void 0})))}function a(e,t){let n=e=>Object.freeze({...e,domains:Object.freeze([...e.domains])});return Object.freeze({...e,pendingSelection:Object.freeze({...t,active:n(t.active),target:n(t.target)})})}export{a as bindPendingSelection,i as clearPendingSelection,r as selectionFromSnapshot};
2
+ //# sourceMappingURL=pendingSelection.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingSelection.mjs","names":[],"sources":["../../src/services/pendingSelection.ts"],"sourcesContent":["import {\n provideDoomConfigContext,\n requireDoomConfigContext,\n supersedeDoomConfigTransition,\n} from '@agimon-ai/doompi-config/piContext';\nimport type { DoomConfigContext, DoomConfigPendingSelection } from '@agimon-ai/doompi-config/types';\nimport type { TransitionSelectionSnapshot } from '@agimon-ai/doompi-extension-contracts/transition';\nimport type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\n\n/** The journal shape a transition records for the session that resumes after it. */\nexport function selectionFromSnapshot(snapshot: TransitionSelectionSnapshot) {\n return {\n version: 1 as const,\n majorMode: snapshot.majorMode,\n domains: [...snapshot.domains],\n profile: snapshot.profile,\n compositionFingerprint: snapshot.compositionFingerprint,\n };\n}\n\nexport function clearPendingSelection(pi: ExtensionAPI, ctx: ExtensionContext): void {\n const context = requireDoomConfigContext(ctx);\n const pendingSelection = context.pendingSelection;\n if (!pendingSelection) return;\n supersedeDoomConfigTransition(pi, pendingSelection);\n void provideDoomConfigContext(ctx, Object.freeze({ ...context, pendingSelection: undefined }));\n}\n\nexport function bindPendingSelection(\n context: DoomConfigContext,\n pendingSelection: DoomConfigPendingSelection,\n): DoomConfigContext {\n const freezeSelection = (selection: DoomConfigPendingSelection['active']) =>\n Object.freeze({ ...selection, domains: Object.freeze([...selection.domains]) });\n return Object.freeze({\n ...context,\n pendingSelection: Object.freeze({\n ...pendingSelection,\n active: freezeSelection(pendingSelection.active),\n target: freezeSelection(pendingSelection.target),\n }),\n });\n}\n"],"mappings":"+IAUA,SAAgB,EAAsB,EAAuC,CAC3E,MAAO,CACL,QAAS,EACT,UAAW,EAAS,UACpB,QAAS,CAAC,GAAG,EAAS,OAAO,EAC7B,QAAS,EAAS,QAClB,uBAAwB,EAAS,sBACnC,CACF,CAEA,SAAgB,EAAsB,EAAkB,EAA6B,CACnF,IAAM,EAAU,EAAyB,CAAG,EACtC,EAAmB,EAAQ,iBAC5B,IACL,EAA8B,EAAI,CAAgB,EAClD,EAA8B,EAAK,OAAO,OAAO,CAAE,GAAG,EAAS,iBAAkB,IAAA,EAAU,CAAC,CAAC,EAC/F,CAEA,SAAgB,EACd,EACA,EACmB,CACnB,IAAM,EAAmB,GACvB,OAAO,OAAO,CAAE,GAAG,EAAW,QAAS,OAAO,OAAO,CAAC,GAAG,EAAU,OAAO,CAAC,CAAE,CAAC,EAChF,OAAO,OAAO,OAAO,CACnB,GAAG,EACH,iBAAkB,OAAO,OAAO,CAC9B,GAAG,EACH,OAAQ,EAAgB,EAAiB,MAAM,EAC/C,OAAQ,EAAgB,EAAiB,MAAM,CACjD,CAAC,CACH,CAAC,CACH"}
@@ -0,0 +1,2 @@
1
+ function e(e,t,n){return[n?`*${n}*`:void 0,`[${e}]`,t.join(`,`)].filter(e=>!!e).join(`:`)}function t(e,t,n,r,i){return[r?e.fg(`success`,e.bold(`*${r}*`)):void 0,e.fg(i?`warning`:`accent`,`[${t}]`),n.length>0?e.fg(`muted`,n.join(`,`)):void 0].filter(e=>!!e).join(e.fg(`dim`,`:`))}exports.STATUS_KEY=`doom-major-mode`,exports.colorStatus=t,exports.statusText=e;
2
+ //# sourceMappingURL=statusLine.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusLine.cjs","names":[],"sources":["../../src/services/statusLine.ts"],"sourcesContent":["import type { Theme } from '@earendil-works/pi-coding-agent';\n\nexport const STATUS_KEY = 'doom-major-mode';\n\n/** Compact footer text for the selected major mode, domains, and profile. */\nexport function statusText(majorMode: string, domains: readonly string[], profile?: string): string {\n return [profile ? `*${profile}*` : undefined, `[${majorMode}]`, domains.join(',')]\n .filter((part) => Boolean(part))\n .join(':');\n}\n\n/**\n * The same footer, coloured.\n *\n * A pure function of the theme it is handed rather than of an ambient one, so it\n * stays testable with a plain object and lives beside statusText rather than in\n * the TUI layer the command may not reach.\n */\nexport function colorStatus(\n theme: Theme,\n majorMode: string,\n domains: readonly string[],\n profile: string | undefined,\n pending: boolean,\n): string {\n const parts = [\n profile ? theme.fg('success', theme.bold(`*${profile}*`)) : undefined,\n theme.fg(pending ? 'warning' : 'accent', `[${majorMode}]`),\n domains.length > 0 ? theme.fg('muted', domains.join(',')) : undefined,\n ].filter((part): part is string => Boolean(part));\n return parts.join(theme.fg('dim', ':'));\n}\n"],"mappings":"AAKA,SAAgB,EAAW,EAAmB,EAA4B,EAA0B,CAClG,MAAO,CAAC,EAAU,IAAI,EAAQ,GAAK,IAAA,GAAW,IAAI,EAAU,GAAI,EAAQ,KAAK,GAAG,CAAC,CAAC,CAC/E,OAAQ,GAAS,EAAQ,CAAK,CAAC,CAC/B,KAAK,GAAG,CACb,CASA,SAAgB,EACd,EACA,EACA,EACA,EACA,EACQ,CAMR,MALc,CACZ,EAAU,EAAM,GAAG,UAAW,EAAM,KAAK,IAAI,EAAQ,EAAE,CAAC,EAAI,IAAA,GAC5D,EAAM,GAAG,EAAU,UAAY,SAAU,IAAI,EAAU,EAAE,EACzD,EAAQ,OAAS,EAAI,EAAM,GAAG,QAAS,EAAQ,KAAK,GAAG,CAAC,EAAI,IAAA,EAC9D,CAAC,CAAC,OAAQ,GAAyB,EAAQ,CAChC,CAAC,CAAC,KAAK,EAAM,GAAG,MAAO,GAAG,CAAC,CACxC"}
@@ -0,0 +1,16 @@
1
+ import { Theme } from "@earendil-works/pi-coding-agent";
2
+ //#region src/services/statusLine.d.ts
3
+ declare const STATUS_KEY = "doom-major-mode";
4
+ /** Compact footer text for the selected major mode, domains, and profile. */
5
+ declare function statusText(majorMode: string, domains: readonly string[], profile?: string): string;
6
+ /**
7
+ * The same footer, coloured.
8
+ *
9
+ * A pure function of the theme it is handed rather than of an ambient one, so it
10
+ * stays testable with a plain object and lives beside statusText rather than in
11
+ * the TUI layer the command may not reach.
12
+ */
13
+ declare function colorStatus(theme: Theme, majorMode: string, domains: readonly string[], profile: string | undefined, pending: boolean): string;
14
+ //#endregion
15
+ export { STATUS_KEY, colorStatus, statusText };
16
+ //# sourceMappingURL=statusLine.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusLine.d.cts","names":[],"sources":["../../src/services/statusLine.ts"],"mappings":";;cAEa;;iBAGG,WAAW,mBAAmB,4BAA4B;;;;;;;;iBAa1D,YACd,OAAO,OACP,mBACA,4BACA,6BACA"}
@@ -0,0 +1,16 @@
1
+ import { Theme } from "@earendil-works/pi-coding-agent";
2
+ //#region src/services/statusLine.d.ts
3
+ declare const STATUS_KEY = "doom-major-mode";
4
+ /** Compact footer text for the selected major mode, domains, and profile. */
5
+ declare function statusText(majorMode: string, domains: readonly string[], profile?: string): string;
6
+ /**
7
+ * The same footer, coloured.
8
+ *
9
+ * A pure function of the theme it is handed rather than of an ambient one, so it
10
+ * stays testable with a plain object and lives beside statusText rather than in
11
+ * the TUI layer the command may not reach.
12
+ */
13
+ declare function colorStatus(theme: Theme, majorMode: string, domains: readonly string[], profile: string | undefined, pending: boolean): string;
14
+ //#endregion
15
+ export { STATUS_KEY, colorStatus, statusText };
16
+ //# sourceMappingURL=statusLine.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusLine.d.mts","names":[],"sources":["../../src/services/statusLine.ts"],"mappings":";;cAEa;;iBAGG,WAAW,mBAAmB,4BAA4B;;;;;;;;iBAa1D,YACd,OAAO,OACP,mBACA,4BACA,6BACA"}
@@ -0,0 +1,2 @@
1
+ const e=`doom-major-mode`;function t(e,t,n){return[n?`*${n}*`:void 0,`[${e}]`,t.join(`,`)].filter(e=>!!e).join(`:`)}function n(e,t,n,r,i){return[r?e.fg(`success`,e.bold(`*${r}*`)):void 0,e.fg(i?`warning`:`accent`,`[${t}]`),n.length>0?e.fg(`muted`,n.join(`,`)):void 0].filter(e=>!!e).join(e.fg(`dim`,`:`))}export{e as STATUS_KEY,n as colorStatus,t as statusText};
2
+ //# sourceMappingURL=statusLine.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusLine.mjs","names":[],"sources":["../../src/services/statusLine.ts"],"sourcesContent":["import type { Theme } from '@earendil-works/pi-coding-agent';\n\nexport const STATUS_KEY = 'doom-major-mode';\n\n/** Compact footer text for the selected major mode, domains, and profile. */\nexport function statusText(majorMode: string, domains: readonly string[], profile?: string): string {\n return [profile ? `*${profile}*` : undefined, `[${majorMode}]`, domains.join(',')]\n .filter((part) => Boolean(part))\n .join(':');\n}\n\n/**\n * The same footer, coloured.\n *\n * A pure function of the theme it is handed rather than of an ambient one, so it\n * stays testable with a plain object and lives beside statusText rather than in\n * the TUI layer the command may not reach.\n */\nexport function colorStatus(\n theme: Theme,\n majorMode: string,\n domains: readonly string[],\n profile: string | undefined,\n pending: boolean,\n): string {\n const parts = [\n profile ? theme.fg('success', theme.bold(`*${profile}*`)) : undefined,\n theme.fg(pending ? 'warning' : 'accent', `[${majorMode}]`),\n domains.length > 0 ? theme.fg('muted', domains.join(',')) : undefined,\n ].filter((part): part is string => Boolean(part));\n return parts.join(theme.fg('dim', ':'));\n}\n"],"mappings":"AAEA,MAAa,EAAa,kBAG1B,SAAgB,EAAW,EAAmB,EAA4B,EAA0B,CAClG,MAAO,CAAC,EAAU,IAAI,EAAQ,GAAK,IAAA,GAAW,IAAI,EAAU,GAAI,EAAQ,KAAK,GAAG,CAAC,CAAC,CAC/E,OAAQ,GAAS,EAAQ,CAAK,CAAC,CAC/B,KAAK,GAAG,CACb,CASA,SAAgB,EACd,EACA,EACA,EACA,EACA,EACQ,CAMR,MALc,CACZ,EAAU,EAAM,GAAG,UAAW,EAAM,KAAK,IAAI,EAAQ,EAAE,CAAC,EAAI,IAAA,GAC5D,EAAM,GAAG,EAAU,UAAY,SAAU,IAAI,EAAU,EAAE,EACzD,EAAQ,OAAS,EAAI,EAAM,GAAG,QAAS,EAAQ,KAAK,GAAG,CAAC,EAAI,IAAA,EAC9D,CAAC,CAAC,OAAQ,GAAyB,EAAQ,CAChC,CAAC,CAAC,KAAK,EAAM,GAAG,MAAO,GAAG,CAAC,CACxC"}
@@ -0,0 +1,2 @@
1
+ exports.MAJOR_MODE_SOURCE=`@agimon-ai/doompi-major-mode`,exports.MAJOR_MODE_SWITCH_HANDOFF_KIND=`major-mode-switch`;
2
+ //# sourceMappingURL=majorMode.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorMode.cjs","names":[],"sources":["../../src/types/majorMode.ts"],"sourcesContent":["import type { MajorModesConfig } from '@agimon-ai/doompi-config/majorModes';\n\n/** The npm name this package registers its voice tool and contributions under. */\nexport const MAJOR_MODE_SOURCE = '@agimon-ai/doompi-major-mode';\n/** Discriminates this package's reload handoffs from every other axis's. */\nexport const MAJOR_MODE_SWITCH_HANDOFF_KIND = 'major-mode-switch';\n\n/** The selection as both the command and the voice tool need to see it. */\nexport interface MajorModeView {\n config: MajorModesConfig;\n majorMode: string;\n domains: readonly string[];\n profile?: string;\n}\n"],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { MajorModesConfig } from "@agimon-ai/doompi-config/majorModes";
2
+ //#region src/types/majorMode.d.ts
3
+ /** The npm name this package registers its voice tool and contributions under. */
4
+ declare const MAJOR_MODE_SOURCE = "@agimon-ai/doompi-major-mode";
5
+ /** Discriminates this package's reload handoffs from every other axis's. */
6
+ declare const MAJOR_MODE_SWITCH_HANDOFF_KIND = "major-mode-switch";
7
+ /** The selection as both the command and the voice tool need to see it. */
8
+ interface MajorModeView {
9
+ config: MajorModesConfig;
10
+ majorMode: string;
11
+ domains: readonly string[];
12
+ profile?: string;
13
+ }
14
+ //#endregion
15
+ export { MAJOR_MODE_SOURCE, MAJOR_MODE_SWITCH_HANDOFF_KIND, MajorModeView };
16
+ //# sourceMappingURL=majorMode.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorMode.d.cts","names":[],"sources":["../../src/types/majorMode.ts"],"mappings":";;;cAGa;;cAEA;;UAGI;EACf,QAAQ;EACR;EACA;EACA"}
@@ -0,0 +1,16 @@
1
+ import { MajorModesConfig } from "@agimon-ai/doompi-config/majorModes";
2
+ //#region src/types/majorMode.d.ts
3
+ /** The npm name this package registers its voice tool and contributions under. */
4
+ declare const MAJOR_MODE_SOURCE = "@agimon-ai/doompi-major-mode";
5
+ /** Discriminates this package's reload handoffs from every other axis's. */
6
+ declare const MAJOR_MODE_SWITCH_HANDOFF_KIND = "major-mode-switch";
7
+ /** The selection as both the command and the voice tool need to see it. */
8
+ interface MajorModeView {
9
+ config: MajorModesConfig;
10
+ majorMode: string;
11
+ domains: readonly string[];
12
+ profile?: string;
13
+ }
14
+ //#endregion
15
+ export { MAJOR_MODE_SOURCE, MAJOR_MODE_SWITCH_HANDOFF_KIND, MajorModeView };
16
+ //# sourceMappingURL=majorMode.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorMode.d.mts","names":[],"sources":["../../src/types/majorMode.ts"],"mappings":";;;cAGa;;cAEA;;UAGI;EACf,QAAQ;EACR;EACA;EACA"}
@@ -0,0 +1,2 @@
1
+ const e=`@agimon-ai/doompi-major-mode`,t=`major-mode-switch`;export{e as MAJOR_MODE_SOURCE,t as MAJOR_MODE_SWITCH_HANDOFF_KIND};
2
+ //# sourceMappingURL=majorMode.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"majorMode.mjs","names":[],"sources":["../../src/types/majorMode.ts"],"sourcesContent":["import type { MajorModesConfig } from '@agimon-ai/doompi-config/majorModes';\n\n/** The npm name this package registers its voice tool and contributions under. */\nexport const MAJOR_MODE_SOURCE = '@agimon-ai/doompi-major-mode';\n/** Discriminates this package's reload handoffs from every other axis's. */\nexport const MAJOR_MODE_SWITCH_HANDOFF_KIND = 'major-mode-switch';\n\n/** The selection as both the command and the voice tool need to see it. */\nexport interface MajorModeView {\n config: MajorModesConfig;\n majorMode: string;\n domains: readonly string[];\n profile?: string;\n}\n"],"mappings":"AAGA,MAAa,EAAoB,+BAEpB,EAAiC"}
@@ -0,0 +1,2 @@
1
+ const e={majorModeSwitched:`doom_pi_major_mode.switched`,majorModeUnavailable:`doom_pi_major_mode.unavailable`};exports.MAJOR_MODE_EVENT=e;
2
+ //# sourceMappingURL=telemetry.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.cjs","names":[],"sources":["../../src/types/telemetry.ts"],"sourcesContent":["/** Telemetry events this package reports, and the port that records them. */\nexport const MAJOR_MODE_EVENT = {\n majorModeSwitched: 'doom_pi_major_mode.switched',\n majorModeUnavailable: 'doom_pi_major_mode.unavailable',\n} as const;\n\nexport type MajorModeEventName = (typeof MAJOR_MODE_EVENT)[keyof typeof MAJOR_MODE_EVENT];\nexport type MajorModeEventAttributes = Record<string, string | number | boolean>;\n\nexport interface MajorModeTelemetry {\n recordError(event: MajorModeEventName, error: unknown, attributes?: MajorModeEventAttributes): Promise<void>;\n recordEvent(event: MajorModeEventName, attributes?: MajorModeEventAttributes): Promise<void>;\n}\n"],"mappings":"AACA,MAAa,EAAmB,CAC9B,kBAAmB,8BACnB,qBAAsB,gCACxB"}
@@ -0,0 +1,15 @@
1
+ //#region src/types/telemetry.d.ts
2
+ /** Telemetry events this package reports, and the port that records them. */
3
+ declare const MAJOR_MODE_EVENT: {
4
+ readonly majorModeSwitched: "doom_pi_major_mode.switched";
5
+ readonly majorModeUnavailable: "doom_pi_major_mode.unavailable";
6
+ };
7
+ type MajorModeEventName = (typeof MAJOR_MODE_EVENT)[keyof typeof MAJOR_MODE_EVENT];
8
+ type MajorModeEventAttributes = Record<string, string | number | boolean>;
9
+ interface MajorModeTelemetry {
10
+ recordError(event: MajorModeEventName, error: unknown, attributes?: MajorModeEventAttributes): Promise<void>;
11
+ recordEvent(event: MajorModeEventName, attributes?: MajorModeEventAttributes): Promise<void>;
12
+ }
13
+ //#endregion
14
+ export { MAJOR_MODE_EVENT, MajorModeEventAttributes, MajorModeEventName, MajorModeTelemetry };
15
+ //# sourceMappingURL=telemetry.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.cts","names":[],"sources":["../../src/types/telemetry.ts"],"mappings":";;cACa;WAAA;WAAA;;KAKD,6BAA6B,+BAA+B;KAC5D,2BAA2B;UAEtB;EACf,YAAY,OAAO,oBAAoB,gBAAgB,aAAa,2BAA2B;EAC/F,YAAY,OAAO,oBAAoB,aAAa,2BAA2B"}
@@ -0,0 +1,15 @@
1
+ //#region src/types/telemetry.d.ts
2
+ /** Telemetry events this package reports, and the port that records them. */
3
+ declare const MAJOR_MODE_EVENT: {
4
+ readonly majorModeSwitched: "doom_pi_major_mode.switched";
5
+ readonly majorModeUnavailable: "doom_pi_major_mode.unavailable";
6
+ };
7
+ type MajorModeEventName = (typeof MAJOR_MODE_EVENT)[keyof typeof MAJOR_MODE_EVENT];
8
+ type MajorModeEventAttributes = Record<string, string | number | boolean>;
9
+ interface MajorModeTelemetry {
10
+ recordError(event: MajorModeEventName, error: unknown, attributes?: MajorModeEventAttributes): Promise<void>;
11
+ recordEvent(event: MajorModeEventName, attributes?: MajorModeEventAttributes): Promise<void>;
12
+ }
13
+ //#endregion
14
+ export { MAJOR_MODE_EVENT, MajorModeEventAttributes, MajorModeEventName, MajorModeTelemetry };
15
+ //# sourceMappingURL=telemetry.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.mts","names":[],"sources":["../../src/types/telemetry.ts"],"mappings":";;cACa;WAAA;WAAA;;KAKD,6BAA6B,+BAA+B;KAC5D,2BAA2B;UAEtB;EACf,YAAY,OAAO,oBAAoB,gBAAgB,aAAa,2BAA2B;EAC/F,YAAY,OAAO,oBAAoB,aAAa,2BAA2B"}
@@ -0,0 +1,2 @@
1
+ const e={majorModeSwitched:`doom_pi_major_mode.switched`,majorModeUnavailable:`doom_pi_major_mode.unavailable`};export{e as MAJOR_MODE_EVENT};
2
+ //# sourceMappingURL=telemetry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.mjs","names":[],"sources":["../../src/types/telemetry.ts"],"sourcesContent":["/** Telemetry events this package reports, and the port that records them. */\nexport const MAJOR_MODE_EVENT = {\n majorModeSwitched: 'doom_pi_major_mode.switched',\n majorModeUnavailable: 'doom_pi_major_mode.unavailable',\n} as const;\n\nexport type MajorModeEventName = (typeof MAJOR_MODE_EVENT)[keyof typeof MAJOR_MODE_EVENT];\nexport type MajorModeEventAttributes = Record<string, string | number | boolean>;\n\nexport interface MajorModeTelemetry {\n recordError(event: MajorModeEventName, error: unknown, attributes?: MajorModeEventAttributes): Promise<void>;\n recordEvent(event: MajorModeEventName, attributes?: MajorModeEventAttributes): Promise<void>;\n}\n"],"mappings":"AACA,MAAa,EAAmB,CAC9B,kBAAmB,8BACnB,qBAAsB,gCACxB"}
package/llms.txt ADDED
@@ -0,0 +1,7 @@
1
+ # Doom Pi Major Mode
2
+
3
+ Named major-mode selection for Doom Pi sessions.
4
+
5
+ ## Resources
6
+
7
+ - [Package README](./README.md): the `/mode` command, the `major_mode` voice tool, and how a mode resolves to layers.
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "@agimon-ai/doompi-major-mode",
3
+ "version": "0.0.1-alpha.2",
4
+ "description": "Named major-mode selection and layer composition switching for DoomPi sessions.",
5
+ "keywords": [
6
+ "ai",
7
+ "coding-agent",
8
+ "developer-tools",
9
+ "doompi",
10
+ "layer-composition",
11
+ "major-mode",
12
+ "pi-coding-agent",
13
+ "pi-extension",
14
+ "pi-package",
15
+ "session-reload"
16
+ ],
17
+ "homepage": "https://agimon.ai",
18
+ "license": "MIT",
19
+ "author": "Vuong Ngo",
20
+ "files": [
21
+ "dist",
22
+ "llms.txt",
23
+ "README.md",
24
+ "LICENSE",
25
+ "package.json"
26
+ ],
27
+ "type": "module",
28
+ "main": "./dist/index.cjs",
29
+ "types": "./dist/index.d.mts",
30
+ "jsnext:main": "./dist/index.mjs",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.mts",
34
+ "import": "./dist/index.mjs",
35
+ "require": "./dist/index.cjs"
36
+ },
37
+ "./extensions/pi": {
38
+ "types": "./dist/extensions/pi.d.mts",
39
+ "import": "./dist/extensions/pi.mjs",
40
+ "require": "./dist/extensions/pi.cjs"
41
+ },
42
+ "./package.json": "./package.json"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "dependencies": {
48
+ "@deepseek-ai/cordis": "4.0.1",
49
+ "typebox": "1.1.38",
50
+ "@agimon-ai/doompi-config": "0.0.1-alpha.24",
51
+ "@agimon-ai/doompi-telemetry": "0.0.1-alpha.24",
52
+ "@agimon-ai/doompi-ui": "0.0.1-alpha.24",
53
+ "@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.24"
54
+ },
55
+ "devDependencies": {
56
+ "@deepseek-ai/cordis": "4.0.1",
57
+ "@earendil-works/pi-coding-agent": "0.84.2",
58
+ "@earendil-works/pi-tui": "0.84.2",
59
+ "@types/node": "26.1.1",
60
+ "@vitest/coverage-v8": "4.1.10",
61
+ "tsdown": "0.22.14",
62
+ "typescript": "6.0.3",
63
+ "vitest": "4.1.10",
64
+ "@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.1-alpha.24"
65
+ },
66
+ "peerDependencies": {
67
+ "@earendil-works/pi-coding-agent": "0.84.2",
68
+ "@earendil-works/pi-tui": "0.84.2"
69
+ },
70
+ "peerDependenciesMeta": {
71
+ "@earendil-works/pi-coding-agent": {
72
+ "optional": true
73
+ },
74
+ "@earendil-works/pi-tui": {
75
+ "optional": true
76
+ }
77
+ },
78
+ "engines": {
79
+ "node": ">=22.19.0"
80
+ },
81
+ "pi": {
82
+ "extensions": [
83
+ "./dist/extensions/pi.mjs"
84
+ ]
85
+ },
86
+ "scripts": {
87
+ "build": "tsdown",
88
+ "test": "vitest --run",
89
+ "typecheck": "tsc --noEmit",
90
+ "lint": "oxlint . && oxfmt . --check",
91
+ "fixcode": "oxlint . --fix && oxfmt ."
92
+ }
93
+ }