@agimon-ai/po-config 0.0.0-alpha.147 → 0.0.0-alpha.148

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 (29) hide show
  1. package/dist/{config-Cg7egyk2.d.mts → config-CVYzn7z_.d.mts} +2 -2
  2. package/dist/{config-Cg7egyk2.d.mts.map → config-CVYzn7z_.d.mts.map} +1 -1
  3. package/dist/config.d.mts +2 -2
  4. package/dist/harnessState.d.mts +1 -1
  5. package/dist/harnessStore.d.mts +1 -1
  6. package/dist/{index-Bstndgcw.d.mts → index-BOgscJoN.d.mts} +2 -2
  7. package/dist/{index-Bstndgcw.d.mts.map → index-BOgscJoN.d.mts.map} +1 -1
  8. package/dist/{index-C5Bj_IA6.d.mts → index-Bg4cw4Lq.d.mts} +2 -2
  9. package/dist/{index-C5Bj_IA6.d.mts.map → index-Bg4cw4Lq.d.mts.map} +1 -1
  10. package/dist/{index-D272M5qh.d.mts → index-CW2A--aK.d.mts} +3 -3
  11. package/dist/{index-D272M5qh.d.mts.map → index-CW2A--aK.d.mts.map} +1 -1
  12. package/dist/{index-DNEkm_mv.d.mts → index-DeP6F4Rv.d.mts} +2 -2
  13. package/dist/{index-DNEkm_mv.d.mts.map → index-DeP6F4Rv.d.mts.map} +1 -1
  14. package/dist/{index-kKiK2G4M.d.mts → index-Dm0JKpCH.d.mts} +2 -2
  15. package/dist/{index-kKiK2G4M.d.mts.map → index-Dm0JKpCH.d.mts.map} +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.mts +6 -6
  18. package/dist/index.mjs +1 -1
  19. package/dist/{init-MwgLrvYK.cjs → init-B9tCCwA3.cjs} +3 -3
  20. package/dist/{init-MwgLrvYK.cjs.map → init-B9tCCwA3.cjs.map} +1 -1
  21. package/dist/{init-DLNiuso4.mjs → init-lw06fOB4.mjs} +3 -3
  22. package/dist/{init-DLNiuso4.mjs.map → init-lw06fOB4.mjs.map} +1 -1
  23. package/dist/init.cjs +1 -1
  24. package/dist/init.mjs +1 -1
  25. package/dist/majorModes.d.mts +1 -1
  26. package/dist/piContext.d.mts +2 -2
  27. package/dist/selectionSwitch.d.mts +2 -2
  28. package/dist/types.d.mts +1 -1
  29. package/package.json +4 -4
@@ -264,7 +264,7 @@ interface PoConfig {
264
264
  selection?: PoSelectionConfig;
265
265
  /**
266
266
  * Default layout identifier, resolved against the available web template packages, and the chosen
267
- * background: `<pluginId>/<fillId>` of an installed `backdrop` fill, or `none`. Unset shows Po's meadow.
267
+ * background: `<pluginId>/<fillId>` of an installed `backdrop` fill, or `none`. Unset shows Po's bamboo.
268
268
  */
269
269
  web?: {
270
270
  template?: string;
@@ -397,4 +397,4 @@ interface LenientParseResult {
397
397
  }
398
398
  //#endregion
399
399
  export { PoSelectionConfig as A, VoiceTtsConfig as B, PoConfigLayers as C, PoConfigTransitionRecord as D, PoConfigTransitionPhase as E, VoiceAutoCaptureConfig as F, WorkspaceDeclaration as H, VoiceConfig as I, VoiceEngine as L, ResolvedVoiceAutoCaptureConfig as M, ResolvedVoiceConfig as N, PoConfigTransitionStrategy as O, VoiceAdapterConfig as P, VoiceMode as R, PoConfigLayer as S, PoConfigSelection as T, VoiceTtsEngine as V, PlanningAgentConfig as _, ConfigDiagnostic as a, PoConfig as b, DesktopEnvironmentConfig as c, IPoConfigLoader as d, IPoConfigService$1 as f, PackageAttribution$1 as g, PO_CONFIG_SERVICE as h, AutocompactTokenConfig as i, ProjectTrust as j, PoHarnessContext as k, EditorConfig as l, LenientParseResult as m, AutocompactOverrideConfig as n, ConfigValueOrigin as o, LenientParseOptions as p, AutocompactThresholdConfig as r, DeepReadonly as s, AutocompactModeConfig as t, HarnessState as u, PlanningModeConfig as v, PoConfigPendingSelection as w, PoConfigContext as x, PlanningThinkingLevel as y, VoiceModelConfig as z };
400
- //# sourceMappingURL=config-Cg7egyk2.d.mts.map
400
+ //# sourceMappingURL=config-CVYzn7z_.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-Cg7egyk2.d.mts","names":["IPoConfigService","PoConfigServiceContract"],"sources":["../src/types/config.ts"],"mappings":";;;;;KAOY;KACA;KACA;KACA;KACA;UAEK;EACf;EACA,WAAW;;UAEI;EACf,OAAO;EACP,YAAY;EACZ;;;;;;;;;UASe;EACf;EACA;EACA;;;;;;;;;UASe;EACf;EACA;EACA;;;;;;;;;UASe;EACf;EACA,QAAQ;;UAEO;EACf;EACA;EACA,WAAW;EACX,aAAa;EACb,YAAY;;;UAGG;EACf;;;;;;UAMe;EACf;EACA,WAAW;EACX;EACA;;UAEe;EACf;;;;;;;UAOe;;EAEf;;EAEA;;EAEA;;EAEA,MAAM;;UAGS;EACf;;;UAGe;;EAEf;;EAEA;;;UAGe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;UAGe;EACf,OAAO;;EAEP;EACA;;IAEE;;IAEA,eAAe;;;UAGF;EACf;EACA;;UAEe;EACf;EACA,OAAO;;UAEQ;EACf,QAAQ;EACR;EACA;;UAEe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KAAK;;UAEU;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KAAK;;UAEU;EACf,OAAO;EACP,SAAS;EACT;EACA;IAAa;IAAiB;;EAC9B;IACE,gBAAgB;IAChB,mBAAmB;IACnB,gBAAgB;;EAElB,cAAc;;EAEd;IACE;IACA;;;UAGa;EACf,MAAM;EACN,QAAQ;EACR;EACA;IAAY;IAAiB;;EAC7B,UAAU,YAAY;EACtB,cAAc;;;;;;;;;UASC;EACf;EACA;EACA;;;UAIe;WACN;WACA;WACA;WACA;;WAEA;;KAGC;KACA;UAEK;WACN;WACA;WACA,QAAQ;WACR,QAAQ;WACR,UAAU;WACV,OAAO;;;KAIN,2BAA2B;WAAsC;;;UAG5D;EACf;;EAEA;EACA;EACA;;EAEA,WAAW;;UAGI;;EAEf,aAAa;EACb;IAAU,WAAW;IAAoB,cAAc;;EACvD,cAAc;EACd,qBAAqB;EACrB,gBAAgB;EAChB,YAAY;EACZ,cAAc;EACd,SAAS;EACT,SAAS;EACT,MAAM;EACN,QAAQ;EACR,YAAY;;;;;EAKZ;IAAQ;IAAmB;;;EAE3B;IAAW;;;UAMI;EACf;;EAEA;EACA;EACA;;EAEA;;;;;;;;;;;EAWA,qBAAqB,eAAe;;EAEpC;EACA;EACA,oBAAoB;EACpB;EACA;EACA;EACA;EACA;;EAEA,gBAAgB;EAChB;EACA;;;;;;EAMA,kBAAkB;;EAElB,eAAe;EACf;EACA;EACA;;KAGU,aAAa,UAAU,oBAAmB,6BAClD,SACA,+BAA+B,oBACpB,aAAa,WACtB,oCACc,cAAc,SAAS,aAAa,OAAO,YACvD;KAEI,mBAAmB,aAAa;UAE3B;WACN,UAAU,aAAa;WACvB,SAAS;;WAET,mBAAmB,aAAa;;WAEhC;;;UAIM;EACf,KAAK,kBAAkB,yBAAyB;;;UAIjCA,2BAAyBC,iBAAwB,iBAAiB;;YAGvE;IACR,aAAaD;;;;KAQL;;UAGK;EACf;EACA;;;;;;EAMA;;EAEA;;;;;;;;;;UAWe;;EAEf,YAAY;EACZ,gBAAgB;EAChB,WAAW;;EAEX,SAAS,6BAA6B;;EAEtC,QAAQ;;;;;;;;;UAUO;EACf;;EAEA;EACA;;;UAIe;EACf;;;UAIe;EACf,QAAQ;EACR,aAAa"}
1
+ {"version":3,"file":"config-CVYzn7z_.d.mts","names":["IPoConfigService","PoConfigServiceContract"],"sources":["../src/types/config.ts"],"mappings":";;;;;KAOY;KACA;KACA;KACA;KACA;UAEK;EACf;EACA,WAAW;;UAEI;EACf,OAAO;EACP,YAAY;EACZ;;;;;;;;;UASe;EACf;EACA;EACA;;;;;;;;;UASe;EACf;EACA;EACA;;;;;;;;;UASe;EACf;EACA,QAAQ;;UAEO;EACf;EACA;EACA,WAAW;EACX,aAAa;EACb,YAAY;;;UAGG;EACf;;;;;;UAMe;EACf;EACA,WAAW;EACX;EACA;;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EACA;EACA;;KAGU,aAAa,UAAU,oBAAmB,6BAClD,SACA,+BAA+B,oBACpB,aAAa,WACtB,oCACc,cAAc,SAAS,aAAa,OAAO,YACvD;KAEI,mBAAmB,aAAa;UAE3B;WACN,UAAU,aAAa;WACvB,SAAS;;WAET,mBAAmB,aAAa;;WAEhC;;;UAIM;EACf,KAAK,kBAAkB,yBAAyB;;;UAIjCA,2BAAyBC,iBAAwB,iBAAiB;;YAGvE;IACR,aAAaD;;;;KAQL;;UAGK;EACf;EACA;;;;;;EAMA;;EAEA;;;;;;;;;;UAWe;;EAEf,YAAY;EACZ,gBAAgB;EAChB,WAAW;;EAEX,SAAS,6BAA6B;;EAEtC,QAAQ;;;;;;;;;UAUO;EACf;;EAEA;EACA;;;UAIe;EACf;;;UAIe;EACf,QAAQ;EACR,aAAa"}
package/dist/config.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { C as PoConfigLayers, S as PoConfigLayer, a as ConfigDiagnostic, m as LenientParseResult, o as ConfigValueOrigin, p as LenientParseOptions } from "./config-Cg7egyk2.mjs";
2
- import { A as loadPoConfigLayers, C as readPoConfig, D as refreshGlobalSettingsCache, E as readWorkspaceDeclarations, F as repositoryPoConfigPath, I as resolvePlanningPlansDirectory, M as globalPoConfigDirectory, N as globalPoConfigPath, O as loadPoConfig, P as globalSettingsCachePath, S as WorkspaceDeclarationsResult, T as readPoConfigLenient, _ as parsePoConfig, a as PO_VOICE_MODES, b as ReadPoConfigOptions, c as configRootKeys, d as mergeGlobalConfigLayer, f as mergePoConfigs, g as parsePlanningModeConfig, h as parseAutocompactModeConfig, i as PO_VOICE_LIVE_VOICES, j as loadPoConfigLenient, k as loadPoConfigAsync, l as configScopeOf, m as nonPortableConfigText, n as PO_PLANNING_THINKING_LEVELS, o as PO_VOICE_TTS_ENGINES, p as nonPortableConfigKeys, r as PO_VOICE_ENGINES, s as configLeafKeys, t as ConfigKeyScope, u as isPortableConfigKey, v as resolveVoiceConfig, w as readPoConfigLayers, x as ReadWorkspaceDeclarationsOptions, y as valueAtKeyPath } from "./index-Bstndgcw.mjs";
1
+ import { C as PoConfigLayers, S as PoConfigLayer, a as ConfigDiagnostic, m as LenientParseResult, o as ConfigValueOrigin, p as LenientParseOptions } from "./config-CVYzn7z_.mjs";
2
+ import { A as loadPoConfigLayers, C as readPoConfig, D as refreshGlobalSettingsCache, E as readWorkspaceDeclarations, F as repositoryPoConfigPath, I as resolvePlanningPlansDirectory, M as globalPoConfigDirectory, N as globalPoConfigPath, O as loadPoConfig, P as globalSettingsCachePath, S as WorkspaceDeclarationsResult, T as readPoConfigLenient, _ as parsePoConfig, a as PO_VOICE_MODES, b as ReadPoConfigOptions, c as configRootKeys, d as mergeGlobalConfigLayer, f as mergePoConfigs, g as parsePlanningModeConfig, h as parseAutocompactModeConfig, i as PO_VOICE_LIVE_VOICES, j as loadPoConfigLenient, k as loadPoConfigAsync, l as configScopeOf, m as nonPortableConfigText, n as PO_PLANNING_THINKING_LEVELS, o as PO_VOICE_TTS_ENGINES, p as nonPortableConfigKeys, r as PO_VOICE_ENGINES, s as configLeafKeys, t as ConfigKeyScope, u as isPortableConfigKey, v as resolveVoiceConfig, w as readPoConfigLayers, x as ReadWorkspaceDeclarationsOptions, y as valueAtKeyPath } from "./index-BOgscJoN.mjs";
3
3
  export { type ConfigDiagnostic, type ConfigKeyScope, type ConfigValueOrigin, type LenientParseOptions, type LenientParseResult, PO_PLANNING_THINKING_LEVELS, PO_VOICE_ENGINES, PO_VOICE_LIVE_VOICES, PO_VOICE_MODES, PO_VOICE_TTS_ENGINES, type PoConfigLayer, type PoConfigLayers, type ReadPoConfigOptions, type ReadWorkspaceDeclarationsOptions, type WorkspaceDeclarationsResult, configLeafKeys, configRootKeys, configScopeOf, globalPoConfigDirectory, globalPoConfigPath, globalSettingsCachePath, isPortableConfigKey, loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient, mergeGlobalConfigLayer, mergePoConfigs, nonPortableConfigKeys, nonPortableConfigText, parseAutocompactModeConfig, parsePlanningModeConfig, parsePoConfig, readPoConfig, readPoConfigLayers, readPoConfigLenient, readWorkspaceDeclarations, refreshGlobalSettingsCache, repositoryPoConfigPath, resolvePlanningPlansDirectory, resolveVoiceConfig, valueAtKeyPath };
@@ -1,2 +1,2 @@
1
- import { a as readHarnessState, i as projectHarnessEnvironment, n as HARNESS_STATE_KEYS, r as HarnessStateParseReporter, t as FILE_ONLY_STATE_FIELDS } from "./index-C5Bj_IA6.mjs";
1
+ import { a as readHarnessState, i as projectHarnessEnvironment, n as HARNESS_STATE_KEYS, r as HarnessStateParseReporter, t as FILE_ONLY_STATE_FIELDS } from "./index-Bg4cw4Lq.mjs";
2
2
  export { FILE_ONLY_STATE_FIELDS, HARNESS_STATE_KEYS, type HarnessStateParseReporter, projectHarnessEnvironment, readHarnessState };
@@ -1,2 +1,2 @@
1
- import { _ as HARNESS_STATE_POINTER, a as requireHarnessPaths, b as resetHarnessStore, c as updateHarnessStateAsync, d as getHarnessState, f as getSessionHarnessState, g as updateHarnessState, h as snapshotHarnessState, i as loadHarnessStateAsync, l as createHarnessSession, m as restoreHarnessStateSnapshot, n as disposeHarnessStateAsync, o as requireHarnessRoot, p as loadHarnessState, r as harnessRoot, s as snapshotHarnessStateAsync, t as createHarnessSessionAsync, u as disposeHarnessState, v as HarnessStateFile, x as LoadedHarnessState, y as HarnessStateTransactionSnapshot } from "./index-D272M5qh.mjs";
1
+ import { _ as HARNESS_STATE_POINTER, a as requireHarnessPaths, b as resetHarnessStore, c as updateHarnessStateAsync, d as getHarnessState, f as getSessionHarnessState, g as updateHarnessState, h as snapshotHarnessState, i as loadHarnessStateAsync, l as createHarnessSession, m as restoreHarnessStateSnapshot, n as disposeHarnessStateAsync, o as requireHarnessRoot, p as loadHarnessState, r as harnessRoot, s as snapshotHarnessStateAsync, t as createHarnessSessionAsync, u as disposeHarnessState, v as HarnessStateFile, x as LoadedHarnessState, y as HarnessStateTransactionSnapshot } from "./index-CW2A--aK.mjs";
2
2
  export { HARNESS_STATE_POINTER, type HarnessStateFile, type HarnessStateTransactionSnapshot, type LoadedHarnessState, createHarnessSession, createHarnessSessionAsync, disposeHarnessState, disposeHarnessStateAsync, getHarnessState, getSessionHarnessState, harnessRoot, loadHarnessState, loadHarnessStateAsync, requireHarnessPaths, requireHarnessRoot, resetHarnessStore, restoreHarnessStateSnapshot, snapshotHarnessState, snapshotHarnessStateAsync, updateHarnessState, updateHarnessStateAsync };
@@ -1,5 +1,5 @@
1
1
  import { i as PersonaVoiceOverride } from "./profiles-BPaJfNIs.mjs";
2
- import { C as PoConfigLayers, H as WorkspaceDeclaration, I as VoiceConfig, N as ResolvedVoiceConfig, b as PoConfig, m as LenientParseResult, p as LenientParseOptions, t as AutocompactModeConfig, v as PlanningModeConfig } from "./config-Cg7egyk2.mjs";
2
+ import { C as PoConfigLayers, H as WorkspaceDeclaration, I as VoiceConfig, N as ResolvedVoiceConfig, b as PoConfig, m as LenientParseResult, p as LenientParseOptions, t as AutocompactModeConfig, v as PlanningModeConfig } from "./config-CVYzn7z_.mjs";
3
3
  import { FileSystem } from "@agimon-ai/po-core/platform";
4
4
  import { isPortableConfigKey as isPortableConfigKey$1, nonPortableConfigKeys as nonPortableConfigKeys$1 } from "@agimon-ai/po-core";
5
5
  //#region src/services/config/core.d.ts
@@ -165,4 +165,4 @@ declare function configLeafKeys(value: unknown, prefix?: readonly string[]): str
165
165
  declare function valueAtKeyPath(value: unknown, keyPath: readonly string[]): unknown;
166
166
  //#endregion
167
167
  export { loadPoConfigLayers as A, readPoConfig as C, refreshGlobalSettingsCache as D, readWorkspaceDeclarations as E, repositoryPoConfigPath as F, resolvePlanningPlansDirectory as I, globalPoConfigDirectory as M, globalPoConfigPath as N, loadPoConfig as O, globalSettingsCachePath as P, WorkspaceDeclarationsResult as S, readPoConfigLenient as T, parsePoConfig as _, PO_VOICE_MODES as a, ReadPoConfigOptions as b, configRootKeys as c, mergeGlobalConfigLayer as d, mergePoConfigs as f, parsePlanningModeConfig as g, parseAutocompactModeConfig as h, PO_VOICE_LIVE_VOICES as i, loadPoConfigLenient as j, loadPoConfigAsync as k, configScopeOf as l, nonPortableConfigText as m, PO_PLANNING_THINKING_LEVELS as n, PO_VOICE_TTS_ENGINES as o, nonPortableConfigKeys$1 as p, PO_VOICE_ENGINES as r, configLeafKeys as s, ConfigKeyScope as t, isPortableConfigKey$1 as u, resolveVoiceConfig as v, readPoConfigLayers as w, ReadWorkspaceDeclarationsOptions as x, valueAtKeyPath as y };
168
- //# sourceMappingURL=index-Bstndgcw.d.mts.map
168
+ //# sourceMappingURL=index-BOgscJoN.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-Bstndgcw.d.mts","names":[],"sources":["../src/services/config/core.ts","../src/services/config/sync.ts","../src/services/config/index.ts","../src/services/configPolicy/index.ts"],"mappings":";;;;;KAkCY,oBAAoB,SAAS;;iBAGzB,wBACd,wBACA,cAAc;iBAKA,mBAAmB,wBAA0C,cAAc;;iBAK3E,wBAAwB,uBAAuB,cAAc;iBA+E7D,8BACd,gCACA,kBACA;iBAYc,uBAAuB;;;;iBCpGvB,aACd,kBACA,wBACA,cAAa,OAAO,aACnB;;;;;;;;;;;iBA2Ba,oBACd,kBACA,wBACA,cAAa,OAAO,aACnB;;iBAWmB,kBACpB,kBACA,wBACA,cAAa,OAAO,aACnB,QAAQ;;iBAiBK,mBACd,8BACA,wBACA,cAAa,OAAO,aACnB;;;KCxFE,YAAY,WAAW;UAEX;EACf,IAAI;EACJ;EACA,SAAS;;UAGM;EACf,cAAc;EACd;EACA;;;iBAmBoB,4BACpB,IACA,gBACA,WACC,mCAAmC,QAAQ;UA4E7B;;WAEN;;WAEA,cAAc;;;;;;;;iBAmBH,aACpB,IAAI,YACJ,kBACA,SAAS,WACT,UAAS,sBACR,QAAQ;;;;;;iBAoBW,2BACpB,IAAI,YACJ,cAAc,mBAAmB,mBAAmB,kBACpD,SAAS,WACT,SAAS,SAAS,uBACjB;;iBAkCmB,oBACpB,IAAI,YACJ,kBACA,SAAS,WACT,UAAS,sBACR,QAAQ;;;;;;;iBAkBW,mBACpB,IAAI,YACJ,8BACA,SAAS,WACT,UAAS,sBACR,QAAQ;;;;;;;;;;cClFE;cACA;cACA;cAMA;;cAEA;iBAsXG,2BACd,gBACA,kBACA,oBACC;iBAgBa,wBACd,gBACA,kBACA,oBACC;;;;;;;;;;iBAmUa,cAAc,iBAAiB,mBAAmB;iBAClD,cAAc,iBAAiB,kBAAkB,SAAS,sBAAsB;iBAoFhF,eAAe,cAAc,UAAU,kBAAkB,WAAW;;;;;;;;;;;;;;iBAoIpE,mBAAmB,QAAQ,aAAa,cAAc,uBAAuB;;;;;;;;;;;;;;KA8CjF;;;;;;iBA4BI,cAAc,6BAA6B;;;;;iBAe3C,sBAAsB,iBAAiB;;;;;iBA8BvC,uBAAuB,yBAAyB,wBAAwB;;iBAOxE;;;;;;;;;;;;;iBAsBA,eAAe,gBAAgB;;iBAQ/B,eAAe,gBAAgB"}
1
+ {"version":3,"file":"index-BOgscJoN.d.mts","names":[],"sources":["../src/services/config/core.ts","../src/services/config/sync.ts","../src/services/config/index.ts","../src/services/configPolicy/index.ts"],"mappings":";;;;;KAkCY,oBAAoB,SAAS;;iBAGzB,wBACd,wBACA,cAAc;iBAKA,mBAAmB,wBAA0C,cAAc;;iBAK3E,wBAAwB,uBAAuB,cAAc;iBA+E7D,8BACd,gCACA,kBACA;iBAYc,uBAAuB;;;;iBCpGvB,aACd,kBACA,wBACA,cAAa,OAAO,aACnB;;;;;;;;;;;iBA2Ba,oBACd,kBACA,wBACA,cAAa,OAAO,aACnB;;iBAWmB,kBACpB,kBACA,wBACA,cAAa,OAAO,aACnB,QAAQ;;iBAiBK,mBACd,8BACA,wBACA,cAAa,OAAO,aACnB;;;KCxFE,YAAY,WAAW;UAEX;EACf,IAAI;EACJ;EACA,SAAS;;UAGM;EACf,cAAc;EACd;EACA;;;iBAmBoB,4BACpB,IACA,gBACA,WACC,mCAAmC,QAAQ;UA4E7B;;WAEN;;WAEA,cAAc;;;;;;;;iBAmBH,aACpB,IAAI,YACJ,kBACA,SAAS,WACT,UAAS,sBACR,QAAQ;;;;;;iBAoBW,2BACpB,IAAI,YACJ,cAAc,mBAAmB,mBAAmB,kBACpD,SAAS,WACT,SAAS,SAAS,uBACjB;;iBAkCmB,oBACpB,IAAI,YACJ,kBACA,SAAS,WACT,UAAS,sBACR,QAAQ;;;;;;;iBAkBW,mBACpB,IAAI,YACJ,8BACA,SAAS,WACT,UAAS,sBACR,QAAQ;;;;;;;;;;cClFE;cACA;cACA;cAMA;;cAEA;iBAsXG,2BACd,gBACA,kBACA,oBACC;iBAgBa,wBACd,gBACA,kBACA,oBACC;;;;;;;;;;iBAmUa,cAAc,iBAAiB,mBAAmB;iBAClD,cAAc,iBAAiB,kBAAkB,SAAS,sBAAsB;iBAoFhF,eAAe,cAAc,UAAU,kBAAkB,WAAW;;;;;;;;;;;;;;iBAoIpE,mBAAmB,QAAQ,aAAa,cAAc,uBAAuB;;;;;;;;;;;;;;KA8CjF;;;;;;iBA4BI,cAAc,6BAA6B;;;;;iBAe3C,sBAAsB,iBAAiB;;;;;iBA8BvC,uBAAuB,yBAAyB,wBAAwB;;iBAOxE;;;;;;;;;;;;;iBAsBA,eAAe,gBAAgB;;iBAQ/B,eAAe,gBAAgB"}
@@ -1,4 +1,4 @@
1
- import { u as HarnessState } from "./config-Cg7egyk2.mjs";
1
+ import { u as HarnessState } from "./config-CVYzn7z_.mjs";
2
2
  //#region src/services/harnessState/index.d.ts
3
3
  /**
4
4
  * State that lives in the file only.
@@ -44,4 +44,4 @@ declare function readHarnessState(environment?: NodeJS.ProcessEnv, report?: Harn
44
44
  declare function projectHarnessEnvironment(patch: Partial<HarnessState>, environment?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
45
45
  //#endregion
46
46
  export { readHarnessState as a, projectHarnessEnvironment as i, HARNESS_STATE_KEYS as n, HarnessStateParseReporter as r, FILE_ONLY_STATE_FIELDS as t };
47
- //# sourceMappingURL=index-C5Bj_IA6.d.mts.map
47
+ //# sourceMappingURL=index-Bg4cw4Lq.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-C5Bj_IA6.d.mts","names":[],"sources":["../src/services/harnessState/index.ts"],"mappings":";;;;;;;;;;cAyBa,wBAAwB,kBAAkB;KAa3C,6BAA6B,aAAa;cAEzC;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;iBAsDc,iBACd,cAAa,OAAO,YACpB,SAAS,4BACR;;;;;;;;;;;iBAkCa,0BACd,OAAO,QAAQ,eACf,cAAa,OAAO,aACnB,OAAO"}
1
+ {"version":3,"file":"index-Bg4cw4Lq.d.mts","names":[],"sources":["../src/services/harnessState/index.ts"],"mappings":";;;;;;;;;;cAyBa,wBAAwB,kBAAkB;KAa3C,6BAA6B,aAAa;cAEzC;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;iBAsDc,iBACd,cAAa,OAAO,YACpB,SAAS,4BACR;;;;;;;;;;;iBAkCa,0BACd,OAAO,QAAQ,eACf,cAAa,OAAO,aACnB,OAAO"}
@@ -1,5 +1,5 @@
1
- import { u as HarnessState } from "./config-Cg7egyk2.mjs";
2
- import { r as HarnessStateParseReporter } from "./index-C5Bj_IA6.mjs";
1
+ import { u as HarnessState } from "./config-CVYzn7z_.mjs";
2
+ import { r as HarnessStateParseReporter } from "./index-Bg4cw4Lq.mjs";
3
3
  import { FileSystem } from "@agimon-ai/po-core/platform";
4
4
  //#region src/models/harnessCache.d.ts
5
5
  interface LoadedHarnessState {
@@ -169,4 +169,4 @@ declare function requireHarnessPaths(state?: Pick<HarnessState, 'root' | 'tempor
169
169
  };
170
170
  //#endregion
171
171
  export { HARNESS_STATE_POINTER as _, requireHarnessPaths as a, resetHarnessStore as b, updateHarnessStateAsync as c, getHarnessState as d, getSessionHarnessState as f, updateHarnessState as g, snapshotHarnessState as h, loadHarnessStateAsync as i, createHarnessSession as l, restoreHarnessStateSnapshot as m, disposeHarnessStateAsync as n, requireHarnessRoot as o, loadHarnessState as p, harnessRoot as r, snapshotHarnessStateAsync as s, createHarnessSessionAsync as t, disposeHarnessState as u, HarnessStateFile as v, LoadedHarnessState as x, HarnessStateTransactionSnapshot as y };
172
- //# sourceMappingURL=index-D272M5qh.d.mts.map
172
+ //# sourceMappingURL=index-CW2A--aK.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-D272M5qh.d.mts","names":[],"sources":["../src/models/harnessCache.ts","../src/services/harnessStore/core.ts","../src/services/harnessStore/sync.ts","../src/services/harnessStore/index.ts"],"mappings":";;;;UAEiB;;EAEf;EACA;EACA,OAAO;;;;;cCCI;UAYI;EACf;EACA;IAAS;IAAa;;EACtB,OAAO;;UAGQ;WACN;WACA;WACA,OAAO;WACP,aAAa,SAAS;;;iBAIjB;;;;;;;;;;;;;;iBC6BA,iBACd,cAAa,OAAO,YACpB,SAAS,4BACR;;;;;;iBA2Ba,qBAAqB,cAAa,OAAO,aAA2B;;;;;;iBASpE,4BACd,UAAU,iCACV,cAAa,OAAO;;iBAkCN,gBAAgB,SAAS,4BAA4B;;;;;;;;;;iBAarD,uBACd,+BACA,SAAS,4BACR;;;;;;;;;;;iBAkBa,qBACd,OAAO,cACP;EACE;EACA,aAAa,OAAO;;;;;;;;EAQpB;;;;;;;;;;iBAqBY,mBACd,OAAO,QAAQ,eACf,cAAa,OAAO,aACnB;;;;;;iBAiBa,oBAAoB,cAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCnKnD,YAAY,WAAW;;iBAMN,sBACpB,IAAI,YACJ,aAAa,OAAO,YACpB,SAAS,WACT,SAAS,4BACR,QAAQ;;iBAiBW,0BACpB,IAAI,YACJ,aAAa,OAAO,YACpB,SAAS,YACR,QAAQ;;iBAeW,0BACpB,IAAI,YACJ,OAAO,cACP;EAAW;EAAmB,aAAa,OAAO;EAAY;GAC9D,SAAS,YACR;;;;;;iBAiBmB,wBACpB,IAAI,YACJ,OAAO,QAAQ,eACf,aAAa,OAAO,YACpB,SAAS,YACR,QAAQ;;iBAkBW,yBACpB,IAAI,YACJ,aAAa,OAAO,YACpB,SAAS,YACR;iBAQa,YAAY,QAAO,KAAK;;;;;;;;;iBAYxB,mBAAmB,QAAO,KAAK;;iBAM/B,oBAAoB,QAAO,KAAK;EAC9C;EACA"}
1
+ {"version":3,"file":"index-CW2A--aK.d.mts","names":[],"sources":["../src/models/harnessCache.ts","../src/services/harnessStore/core.ts","../src/services/harnessStore/sync.ts","../src/services/harnessStore/index.ts"],"mappings":";;;;UAEiB;;EAEf;EACA;EACA,OAAO;;;;;cCCI;UAYI;EACf;EACA;IAAS;IAAa;;EACtB,OAAO;;UAGQ;WACN;WACA;WACA,OAAO;WACP,aAAa,SAAS;;;iBAIjB;;;;;;;;;;;;;;iBC6BA,iBACd,cAAa,OAAO,YACpB,SAAS,4BACR;;;;;;iBA2Ba,qBAAqB,cAAa,OAAO,aAA2B;;;;;;iBASpE,4BACd,UAAU,iCACV,cAAa,OAAO;;iBAkCN,gBAAgB,SAAS,4BAA4B;;;;;;;;;;iBAarD,uBACd,+BACA,SAAS,4BACR;;;;;;;;;;;iBAkBa,qBACd,OAAO,cACP;EACE;EACA,aAAa,OAAO;;;;;;;;EAQpB;;;;;;;;;;iBAqBY,mBACd,OAAO,QAAQ,eACf,cAAa,OAAO,aACnB;;;;;;iBAiBa,oBAAoB,cAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCnKnD,YAAY,WAAW;;iBAMN,sBACpB,IAAI,YACJ,aAAa,OAAO,YACpB,SAAS,WACT,SAAS,4BACR,QAAQ;;iBAiBW,0BACpB,IAAI,YACJ,aAAa,OAAO,YACpB,SAAS,YACR,QAAQ;;iBAeW,0BACpB,IAAI,YACJ,OAAO,cACP;EAAW;EAAmB,aAAa,OAAO;EAAY;GAC9D,SAAS,YACR;;;;;;iBAiBmB,wBACpB,IAAI,YACJ,OAAO,QAAQ,eACf,aAAa,OAAO,YACpB,SAAS,YACR,QAAQ;;iBAkBW,yBACpB,IAAI,YACJ,aAAa,OAAO,YACpB,SAAS,YACR;iBAQa,YAAY,QAAO,KAAK;;;;;;;;;iBAYxB,mBAAmB,QAAO,KAAK;;iBAM/B,oBAAoB,QAAO,KAAK;EAC9C;EACA"}
@@ -1,4 +1,4 @@
1
- import { a as ConfigDiagnostic } from "./config-Cg7egyk2.mjs";
1
+ import { a as ConfigDiagnostic } from "./config-CVYzn7z_.mjs";
2
2
  import { r as PoConfigProvenance } from "./index-DNEK9W6n.mjs";
3
3
  import { FileSystem } from "@agimon-ai/po-core/platform";
4
4
  //#region src/services/majorModes/core.d.ts
@@ -152,4 +152,4 @@ declare function readMajorModesConfigLenient(fs: FileSystem, repoRoot: string, c
152
152
  declare function readPackageConfigurations(fs: FileSystem, config: MajorModesConfig, names: string[], packageName: string, context: IoContext): Promise<ResolvedPackageConfiguration[]>;
153
153
  //#endregion
154
154
  export { layerEntries as _, loadMajorModesConfig as a, LayerPackage as c, MajorModeDefinition as d, MajorModesConfig as f, isLocalPackageSpecifier as g, ResolvedPackageConfiguration as h, readPackageConfigurations as i, LayerPackageConfig as l, ResolvedLayerDefinition as m, readMajorModesConfig as n, loadMajorModesConfigLenient as o, PackageNameResolver as p, readMajorModesConfigLenient as r, LayerDefinition as s, ReadMajorModesConfigOptions as t, LayerResolvers as u, resolveLayers as v, resolvePackageConfigurations as y };
155
- //# sourceMappingURL=index-DNEkm_mv.d.mts.map
155
+ //# sourceMappingURL=index-DeP6F4Rv.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-DNEkm_mv.d.mts","names":[],"sources":["../src/services/majorModes/core.ts","../src/services/majorModes/sync.ts","../src/services/majorModes/index.ts"],"mappings":";;;;KAKY,qBAAqB;;UAGhB;EACf;EACA;EACA,SAAS;;;UAIM;EACf;EACA;EACA,QAAQ;EACR;EACA;;UAGe;;;;;;;EAOf;;;;;;;EAOA,WAAW,eAAe;;EAE1B;;;UAIe,gCAAgC;EAC/C;;EAEA;;UAGe;;EAEf;;EAEA;;UAGe;;EAEf,UAAU;EACV,QAAQ,eAAe;;EAEvB;;EAEA,yBAAyB;;EAEzB,WAAW,eAAe;;EAE1B,mBAAmB,eAAe;;UAGnB;EACf,WAAW;EACX,eAAe;EACf,uBAAuB;;EAEvB,kBAAkB;;EAElB,0BAA0B;;EAE1B,aAAa,mBAAmB;;EAEhC,gBAAgB,mBAAmB;;;;;;;;KASzB,uBAAuB,mBAAmB;;;;;;;iBAqBtC,wBAAwB;;;;;iBAsRxB,6BACd,QAAQ,kBACR,iBACA,qBACA,qBAAqB,sBACpB;;iBA6Ba,cAAc,QAAQ,kBAAkB;;iBAqBxC,aAAa,QAAQ,kBAAkB,cAAc,WAAW;;;;;;;;;;;;;iBC5ZhE,qBACd,kBACA,wBACA,cAAa,OAAO,aACnB;;;;;;;;;;iBAca,4BACd,kBACA,wBACA,cAAa,OAAO;EACjB,QAAQ;EAAkB,aAAa;;;;KCpCvC,YAAY,WAAW;UAKX;;WAEN;;WAEA,cAAc,OAAO;;;;;;WAMrB,qBAAqB;;;iBA+EV,qBACpB,IAAI,YACJ,kBACA,SAAS,WACT,UAAS,8BACR,QAAQ;;iBAMW,4BACpB,IAAI,YACJ,kBACA,SAAS,WACT,UAAS,8BACR;EAAU,QAAQ;EAAkB,aAAa;;;;;;;iBAU9B,0BACpB,IAAI,YACJ,QAAQ,kBACR,iBACA,qBACA,SAAS,YACR,QAAQ"}
1
+ {"version":3,"file":"index-DeP6F4Rv.d.mts","names":[],"sources":["../src/services/majorModes/core.ts","../src/services/majorModes/sync.ts","../src/services/majorModes/index.ts"],"mappings":";;;;KAKY,qBAAqB;;UAGhB;EACf;EACA;EACA,SAAS;;;UAIM;EACf;EACA;EACA,QAAQ;EACR;EACA;;UAGe;;;;;;;EAOf;;;;;;;EAOA,WAAW,eAAe;;EAE1B;;;UAIe,gCAAgC;EAC/C;;EAEA;;UAGe;;EAEf;;EAEA;;UAGe;;EAEf,UAAU;EACV,QAAQ,eAAe;;EAEvB;;EAEA,yBAAyB;;EAEzB,WAAW,eAAe;;EAE1B,mBAAmB,eAAe;;UAGnB;EACf,WAAW;EACX,eAAe;EACf,uBAAuB;;EAEvB,kBAAkB;;EAElB,0BAA0B;;EAE1B,aAAa,mBAAmB;;EAEhC,gBAAgB,mBAAmB;;;;;;;;KASzB,uBAAuB,mBAAmB;;;;;;;iBAqBtC,wBAAwB;;;;;iBAsRxB,6BACd,QAAQ,kBACR,iBACA,qBACA,qBAAqB,sBACpB;;iBA6Ba,cAAc,QAAQ,kBAAkB;;iBAqBxC,aAAa,QAAQ,kBAAkB,cAAc,WAAW;;;;;;;;;;;;;iBC5ZhE,qBACd,kBACA,wBACA,cAAa,OAAO,aACnB;;;;;;;;;;iBAca,4BACd,kBACA,wBACA,cAAa,OAAO;EACjB,QAAQ;EAAkB,aAAa;;;;KCpCvC,YAAY,WAAW;UAKX;;WAEN;;WAEA,cAAc,OAAO;;;;;;WAMrB,qBAAqB;;;iBA+EV,qBACpB,IAAI,YACJ,kBACA,SAAS,WACT,UAAS,8BACR,QAAQ;;iBAMW,4BACpB,IAAI,YACJ,kBACA,SAAS,WACT,UAAS,8BACR;EAAU,QAAQ;EAAkB,aAAa;;;;;;;iBAU9B,0BACpB,IAAI,YACJ,QAAQ,kBACR,iBACA,qBACA,SAAS,YACR,QAAQ"}
@@ -1,4 +1,4 @@
1
- import { D as PoConfigTransitionRecord, T as PoConfigSelection$1, f as IPoConfigService, u as HarnessState, w as PoConfigPendingSelection, x as PoConfigContext } from "./config-Cg7egyk2.mjs";
1
+ import { D as PoConfigTransitionRecord, T as PoConfigSelection$1, f as IPoConfigService, u as HarnessState, w as PoConfigPendingSelection, x as PoConfigContext } from "./config-CVYzn7z_.mjs";
2
2
  import { FileSystem } from "@agimon-ai/po-core/platform";
3
3
  import { PO_CONFIG_ENTRY_TYPE as PO_CONFIG_ENTRY_TYPE$1, PO_CONFIG_TRANSITION_ENTRY_TYPE as PO_CONFIG_TRANSITION_ENTRY_TYPE$1 } from "@agimon-ai/po-core/contextProjection";
4
4
  import { Context } from "@deepseek-ai/cordis";
@@ -34,4 +34,4 @@ declare function replacePoConfigContext(ctx: Context, context: PoConfigContext):
34
34
  declare function requirePoConfigContext(ctx: Context): PoConfigContext;
35
35
  //#endregion
36
36
  export { supersedePoConfigTransition as _, appendPoConfigSelection as a, createPoConfigContextAsync as c, providePoConfigContext as d, readPoConfigContextGeneration as f, requirePoConfigContext as g, replacePoConfigContext as h, acknowledgePoConfigTransition as i, freezePoConfigContext as l, readPoConfigSelection as m, PO_CONFIG_TRANSITION_ENTRY_TYPE$1 as n, appendPoConfigTransition as o, readPoConfigPendingSelection as p, PoConfigSelection as r, createPoConfigContext as s, PO_CONFIG_ENTRY_TYPE$1 as t, persistHarnessSelection as u };
37
- //# sourceMappingURL=index-kKiK2G4M.d.mts.map
37
+ //# sourceMappingURL=index-Dm0JKpCH.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-kKiK2G4M.d.mts","names":["ConfigSelection"],"sources":["../src/services/sessionConfig/index.ts"],"mappings":";;;;;;;KAqBK,YAAY,WAAW;KAIhB,oBAAoBA;iBAkHhB,sBAAsB,KAAK,KAAK,sCAAsC;iBAyCtE,sBAAsB,KAAK,KAAK,8CAA8C;;iBAMxE,2BACpB,KAAK,KAAK,6CACV,IAAI,YACJ,UAAS,YACR,QAAQ;iBAqCK,wBAAwB,IAAI,KAAK,8BAA8B,WAAW;;iBAK1E,wBACd,IAAI,KAAK,8BACT;WACW;WACA;WACA;WACA;;iBAYG,yBACd,IAAI,KAAK,8BACT,YAAY;iBAKE,4BACd,IAAI,KAAK,8BACT,YAAY;;iBAME,8BACd,IAAI,KAAK,8BACT,KAAK,KAAK,qCACV,SAAS;iBAUK,6BACd,KAAK,KAAK,sCACT;iBASa,uBACd,KAAK,SACL,SAAS,iBACT,sBACC;;iBAKa,8BAA8B,KAAK;;iBAKnC,sBAAsB,SAAS,kBAAkB;;iBAKjD,uBAAuB,KAAK,SAAS,SAAS,kBAAkB;iBAehE,uBAAuB,KAAK,UAAU"}
1
+ {"version":3,"file":"index-Dm0JKpCH.d.mts","names":["ConfigSelection"],"sources":["../src/services/sessionConfig/index.ts"],"mappings":";;;;;;;KAqBK,YAAY,WAAW;KAIhB,oBAAoBA;iBAkHhB,sBAAsB,KAAK,KAAK,sCAAsC;iBAyCtE,sBAAsB,KAAK,KAAK,8CAA8C;;iBAMxE,2BACpB,KAAK,KAAK,6CACV,IAAI,YACJ,UAAS,YACR,QAAQ;iBAqCK,wBAAwB,IAAI,KAAK,8BAA8B,WAAW;;iBAK1E,wBACd,IAAI,KAAK,8BACT;WACW;WACA;WACA;WACA;;iBAYG,yBACd,IAAI,KAAK,8BACT,YAAY;iBAKE,4BACd,IAAI,KAAK,8BACT,YAAY;;iBAME,8BACd,IAAI,KAAK,8BACT,KAAK,KAAK,qCACV,SAAS;iBAUK,6BACd,KAAK,KAAK,sCACT;iBASa,uBACd,KAAK,SACL,SAAS,iBACT,sBACC;;iBAKa,8BAA8B,KAAK;;iBAKnC,sBAAsB,SAAS,kBAAkB;;iBAKjD,uBAAuB,KAAK,SAAS,SAAS,kBAAkB;iBAehE,uBAAuB,KAAK,UAAU"}
package/dist/index.cjs CHANGED
@@ -13,7 +13,7 @@ const require_settingsApi = require("./settingsApi-DZ0hKFXA.cjs");
13
13
  const require_piConfig = require("./piConfig-cluCie5i.cjs");
14
14
  const require_majorModes = require("./majorModes-C6xu8OTJ.cjs");
15
15
  const require_profiles = require("./profiles-DZP_-bFs.cjs");
16
- const require_init = require("./init-MwgLrvYK.cjs");
16
+ const require_init = require("./init-B9tCCwA3.cjs");
17
17
  require("./config-zZz80Mh5.cjs");
18
18
  const require_sessionConfig = require("./sessionConfig-Kj6vmVtE.cjs");
19
19
  let _agimon_ai_po_core_contextProjection = require("@agimon-ai/po-core/contextProjection");
package/dist/index.d.mts CHANGED
@@ -1,19 +1,19 @@
1
1
  import { a as GitPluginSource, c as PluginCatalog, d as PluginManifestMetadata, f as PluginSkillDiscovery, i as DomainPlugin, l as PluginCatalogEntry, m as ResolvedDomain, n as DomainManifest, o as LocalPluginSource, p as PluginSource, r as DomainMcpAllowlist, s as NpmPluginSource, t as DomainDefinition, u as PluginEntry } from "./domains-DQBJLW8S.mjs";
2
2
  import { n as writePrivateAtomicJson, t as writePrivateAtomicJsonAsync } from "./index-fTuf8tVH.mjs";
3
- import { A as PoSelectionConfig, B as VoiceTtsConfig, C as PoConfigLayers, D as PoConfigTransitionRecord, E as PoConfigTransitionPhase, F as VoiceAutoCaptureConfig, H as WorkspaceDeclaration, I as VoiceConfig, L as VoiceEngine, M as ResolvedVoiceAutoCaptureConfig, N as ResolvedVoiceConfig, O as PoConfigTransitionStrategy, P as VoiceAdapterConfig, R as VoiceMode, S as PoConfigLayer, V as VoiceTtsEngine, _ as PlanningAgentConfig, b as PoConfig, c as DesktopEnvironmentConfig, d as IPoConfigLoader, f as IPoConfigService, g as PackageAttribution, h as PO_CONFIG_SERVICE, i as AutocompactTokenConfig, j as ProjectTrust, k as PoHarnessContext, l as EditorConfig, n as AutocompactOverrideConfig, o as ConfigValueOrigin, r as AutocompactThresholdConfig, s as DeepReadonly, t as AutocompactModeConfig, u as HarnessState, v as PlanningModeConfig, w as PoConfigPendingSelection, x as PoConfigContext, y as PlanningThinkingLevel, z as VoiceModelConfig } from "./config-Cg7egyk2.mjs";
4
- import { A as loadPoConfigLayers, C as readPoConfig, E as readWorkspaceDeclarations, F as repositoryPoConfigPath, I as resolvePlanningPlansDirectory, M as globalPoConfigDirectory, N as globalPoConfigPath, O as loadPoConfig, S as WorkspaceDeclarationsResult, T as readPoConfigLenient, _ as parsePoConfig, a as PO_VOICE_MODES, b as ReadPoConfigOptions, c as configRootKeys, d as mergeGlobalConfigLayer, f as mergePoConfigs, g as parsePlanningModeConfig, h as parseAutocompactModeConfig, i as PO_VOICE_LIVE_VOICES, j as loadPoConfigLenient, k as loadPoConfigAsync, l as configScopeOf, m as nonPortableConfigText, n as PO_PLANNING_THINKING_LEVELS, o as PO_VOICE_TTS_ENGINES, p as nonPortableConfigKeys, r as PO_VOICE_ENGINES, s as configLeafKeys, t as ConfigKeyScope, u as isPortableConfigKey, v as resolveVoiceConfig, w as readPoConfigLayers, x as ReadWorkspaceDeclarationsOptions, y as valueAtKeyPath } from "./index-Bstndgcw.mjs";
3
+ import { A as PoSelectionConfig, B as VoiceTtsConfig, C as PoConfigLayers, D as PoConfigTransitionRecord, E as PoConfigTransitionPhase, F as VoiceAutoCaptureConfig, H as WorkspaceDeclaration, I as VoiceConfig, L as VoiceEngine, M as ResolvedVoiceAutoCaptureConfig, N as ResolvedVoiceConfig, O as PoConfigTransitionStrategy, P as VoiceAdapterConfig, R as VoiceMode, S as PoConfigLayer, V as VoiceTtsEngine, _ as PlanningAgentConfig, b as PoConfig, c as DesktopEnvironmentConfig, d as IPoConfigLoader, f as IPoConfigService, g as PackageAttribution, h as PO_CONFIG_SERVICE, i as AutocompactTokenConfig, j as ProjectTrust, k as PoHarnessContext, l as EditorConfig, n as AutocompactOverrideConfig, o as ConfigValueOrigin, r as AutocompactThresholdConfig, s as DeepReadonly, t as AutocompactModeConfig, u as HarnessState, v as PlanningModeConfig, w as PoConfigPendingSelection, x as PoConfigContext, y as PlanningThinkingLevel, z as VoiceModelConfig } from "./config-CVYzn7z_.mjs";
4
+ import { A as loadPoConfigLayers, C as readPoConfig, E as readWorkspaceDeclarations, F as repositoryPoConfigPath, I as resolvePlanningPlansDirectory, M as globalPoConfigDirectory, N as globalPoConfigPath, O as loadPoConfig, S as WorkspaceDeclarationsResult, T as readPoConfigLenient, _ as parsePoConfig, a as PO_VOICE_MODES, b as ReadPoConfigOptions, c as configRootKeys, d as mergeGlobalConfigLayer, f as mergePoConfigs, g as parsePlanningModeConfig, h as parseAutocompactModeConfig, i as PO_VOICE_LIVE_VOICES, j as loadPoConfigLenient, k as loadPoConfigAsync, l as configScopeOf, m as nonPortableConfigText, n as PO_PLANNING_THINKING_LEVELS, o as PO_VOICE_TTS_ENGINES, p as nonPortableConfigKeys, r as PO_VOICE_ENGINES, s as configLeafKeys, t as ConfigKeyScope, u as isPortableConfigKey, v as resolveVoiceConfig, w as readPoConfigLayers, x as ReadWorkspaceDeclarationsOptions, y as valueAtKeyPath } from "./index-BOgscJoN.mjs";
5
5
  import { i as PiConfigPaths, n as PiConfig, r as PiConfigLoadOptions, t as ConfigAdapterRegistrationOptions } from "./piConfig-C9rGUqPe.mjs";
6
6
  import { a as unsetPoConfigValue, c as PoConfigScope, i as setPoConfigValue, l as WritePoConfigOptions, n as unsetPoConfigValueAsync, o as writePoConfigValues, r as writePoConfigValuesAsync, s as PoConfigEdit, t as setPoConfigValueAsync } from "./index-N_GmmWJz.mjs";
7
7
  import { n as PO_DIR } from "./index-DNEK9W6n.mjs";
8
8
  import { _ as findPluginManifestPathAsync, b as isRemotePluginSource, d as resolvePluginDirectories, f as resolvePluginEntries, l as listDomainNames, n as domainCompletionPrefix, p as resolveSharedSkills, r as expandDomainNames, t as domainCompletionItems, u as loadDomains, v as findPluginManifestPath, x as pluginDirectoryForSource, y as MARKETPLACE_MANIFEST_RELATIVE_PATHS } from "./completion-Cm4YbJ9H.mjs";
9
- import { a as readHarnessState, i as projectHarnessEnvironment, n as HARNESS_STATE_KEYS, r as HarnessStateParseReporter, t as FILE_ONLY_STATE_FIELDS } from "./index-C5Bj_IA6.mjs";
10
- import { _ as HARNESS_STATE_POINTER, a as requireHarnessPaths, b as resetHarnessStore, d as getHarnessState, f as getSessionHarnessState, g as updateHarnessState, h as snapshotHarnessState, l as createHarnessSession, m as restoreHarnessStateSnapshot, o as requireHarnessRoot, p as loadHarnessState, r as harnessRoot, u as disposeHarnessState, v as HarnessStateFile, x as LoadedHarnessState, y as HarnessStateTransactionSnapshot } from "./index-D272M5qh.mjs";
9
+ import { a as readHarnessState, i as projectHarnessEnvironment, n as HARNESS_STATE_KEYS, r as HarnessStateParseReporter, t as FILE_ONLY_STATE_FIELDS } from "./index-Bg4cw4Lq.mjs";
10
+ import { _ as HARNESS_STATE_POINTER, a as requireHarnessPaths, b as resetHarnessStore, d as getHarnessState, f as getSessionHarnessState, g as updateHarnessState, h as snapshotHarnessState, l as createHarnessSession, m as restoreHarnessStateSnapshot, o as requireHarnessRoot, p as loadHarnessState, r as harnessRoot, u as disposeHarnessState, v as HarnessStateFile, x as LoadedHarnessState, y as HarnessStateTransactionSnapshot } from "./index-CW2A--aK.mjs";
11
11
  import { a as loadPiConfigAsync, c as piConfigPaths, d as MIN_IMAGE_MAX_DIMENSION, f as PiImageSettings, h as parsePiImageSettings, i as loadPiConfig, l as piImageSettingsPath, m as clampImageMaxDimension, o as loadPiImageSettings, p as PiImageSettingsUpdate, s as savePiImageSettings, u as DEFAULT_IMAGE_MAX_DIMENSION } from "./index-7RuIAWX1.mjs";
12
12
  import { a as GLOBAL_PO_SEED_FILES, c as PO_CONFIG_TEMPLATES, d as RepositoryPoInitResult, i as initializeRepositoryPoConfig, l as REPOSITORY_PO_CONFIG_TEMPLATES, r as initializeGlobalPoConfig, s as GlobalPoInitResult, u as RepositoryPoInitOptions } from "./index-nVcEC1jO.mjs";
13
- import { _ as layerEntries, a as loadMajorModesConfig, c as LayerPackage, d as MajorModeDefinition, f as MajorModesConfig, g as isLocalPackageSpecifier, h as ResolvedPackageConfiguration, i as readPackageConfigurations, l as LayerPackageConfig, m as ResolvedLayerDefinition, o as loadMajorModesConfigLenient, p as PackageNameResolver, s as LayerDefinition, u as LayerResolvers, v as resolveLayers, y as resolvePackageConfigurations } from "./index-DNEkm_mv.mjs";
13
+ import { _ as layerEntries, a as loadMajorModesConfig, c as LayerPackage, d as MajorModeDefinition, f as MajorModesConfig, g as isLocalPackageSpecifier, h as ResolvedPackageConfiguration, i as readPackageConfigurations, l as LayerPackageConfig, m as ResolvedLayerDefinition, o as loadMajorModesConfigLenient, p as PackageNameResolver, s as LayerDefinition, u as LayerResolvers, v as resolveLayers, y as resolvePackageConfigurations } from "./index-DeP6F4Rv.mjs";
14
14
  import { f as PERSONA_FILES, g as replaceProfileEnvironment, m as applyProfileEnvironment, u as AgentProfile } from "./index-BmY30wlf.mjs";
15
15
  import { a as resolveProfile, i as loadProfiles, n as listProfileNames, t as buildPersonaPrompt } from "./sync-CIeHcR-h.mjs";
16
- import { _ as supersedePoConfigTransition, a as appendPoConfigSelection, c as createPoConfigContextAsync, d as providePoConfigContext, f as readPoConfigContextGeneration, g as requirePoConfigContext, h as replacePoConfigContext, i as acknowledgePoConfigTransition, l as freezePoConfigContext, m as readPoConfigSelection, n as PO_CONFIG_TRANSITION_ENTRY_TYPE, o as appendPoConfigTransition, p as readPoConfigPendingSelection, r as PoConfigSelection, s as createPoConfigContext, t as PO_CONFIG_ENTRY_TYPE } from "./index-kKiK2G4M.mjs";
16
+ import { _ as supersedePoConfigTransition, a as appendPoConfigSelection, c as createPoConfigContextAsync, d as providePoConfigContext, f as readPoConfigContextGeneration, g as requirePoConfigContext, h as replacePoConfigContext, i as acknowledgePoConfigTransition, l as freezePoConfigContext, m as readPoConfigSelection, n as PO_CONFIG_TRANSITION_ENTRY_TYPE, o as appendPoConfigTransition, p as readPoConfigPendingSelection, r as PoConfigSelection, s as createPoConfigContext, t as PO_CONFIG_ENTRY_TYPE } from "./index-Dm0JKpCH.mjs";
17
17
  import { FileSystem } from "@agimon-ai/po-core/platform";
18
18
  import { PoApi } from "@agimon-ai/po-core/packageApi";
19
19
  //#region src/services/settingsApi/index.d.ts
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import { t as createSettingsApi } from "./settingsApi-CSog84S1.mjs";
12
12
  import { a as loadPiConfigAsync, c as piConfigPaths, d as MIN_IMAGE_MAX_DIMENSION, f as clampImageMaxDimension, i as loadPiConfig, l as piImageSettingsPath, o as loadPiImageSettings, p as parsePiImageSettings, s as savePiImageSettings, u as DEFAULT_IMAGE_MAX_DIMENSION } from "./piConfig-Bq36PQFF.mjs";
13
13
  import { a as loadMajorModesConfigLenient, c as layerEntries, i as loadMajorModesConfig, l as resolveLayers, r as readPackageConfigurations, s as isLocalPackageSpecifier, u as resolvePackageConfigurations } from "./majorModes-BQVTbC7k.mjs";
14
14
  import { _ as replaceProfileEnvironment, f as loadProfiles, h as applyProfileEnvironment, l as buildPersonaPrompt, m as PERSONA_FILES, p as resolveProfile, u as listProfileNames } from "./profiles-Lf9s1Fb6.mjs";
15
- import { a as GLOBAL_PO_SEED_FILES, i as initializeRepositoryPoConfig, o as PO_CONFIG_TEMPLATES, r as initializeGlobalPoConfig, s as REPOSITORY_PO_CONFIG_TEMPLATES } from "./init-DLNiuso4.mjs";
15
+ import { a as GLOBAL_PO_SEED_FILES, i as initializeRepositoryPoConfig, o as PO_CONFIG_TEMPLATES, r as initializeGlobalPoConfig, s as REPOSITORY_PO_CONFIG_TEMPLATES } from "./init-lw06fOB4.mjs";
16
16
  import { t as PO_CONFIG_SERVICE } from "./config-BBvn_ZLP.mjs";
17
17
  import { _ as supersedePoConfigTransition, a as appendPoConfigTransition, c as createPoConfigContextAsync, d as providePoConfigContext, f as readPoConfigContextGeneration, g as requirePoConfigContext, h as replacePoConfigContext, i as appendPoConfigSelection, l as freezePoConfigContext, m as readPoConfigSelection, n as PO_CONFIG_TRANSITION_ENTRY_TYPE, p as readPoConfigPendingSelection, r as acknowledgePoConfigTransition, s as createPoConfigContext, t as PO_CONFIG_ENTRY_TYPE } from "./sessionConfig-0eGoap9R.mjs";
18
18
  export { DEFAULT_IMAGE_MAX_DIMENSION, FILE_ONLY_STATE_FIELDS, GLOBAL_PO_SEED_FILES, HARNESS_STATE_KEYS, HARNESS_STATE_POINTER, MARKETPLACE_MANIFEST_RELATIVE_PATHS, MIN_IMAGE_MAX_DIMENSION, PERSONA_FILES, PO_CONFIG_ENTRY_TYPE, PO_CONFIG_SERVICE, PO_CONFIG_TEMPLATES, PO_CONFIG_TRANSITION_ENTRY_TYPE, PO_DIR, PO_PLANNING_THINKING_LEVELS, PO_VOICE_ENGINES, PO_VOICE_LIVE_VOICES, PO_VOICE_MODES, PO_VOICE_TTS_ENGINES, REPOSITORY_PO_CONFIG_TEMPLATES, acknowledgePoConfigTransition, appendPoConfigSelection, appendPoConfigTransition, applyProfileEnvironment, buildPersonaPrompt, clampImageMaxDimension, configLeafKeys, configRootKeys, configScopeOf, createHarnessSession, createPoConfigContext, createPoConfigContextAsync, createSettingsApi, disposeHarnessState, domainCompletionItems, domainCompletionPrefix, expandDomainNames, findPluginManifestPath, findPluginManifestPathAsync, freezePoConfigContext, getHarnessState, getSessionHarnessState, globalPoConfigDirectory, globalPoConfigPath, harnessRoot, initializeGlobalPoConfig, initializeRepositoryPoConfig, isLocalPackageSpecifier, isPortableConfigKey, isRemotePluginSource, layerEntries, listDomainNames, listProfileNames, loadDomains, loadHarnessState, loadMajorModesConfig, loadMajorModesConfigLenient, loadPiConfig, loadPiConfigAsync, loadPiImageSettings, loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient, loadProfiles, mergeGlobalConfigLayer, mergePoConfigs, nonPortableConfigKeys, nonPortableConfigText, parseAutocompactModeConfig, parsePiImageSettings, parsePlanningModeConfig, parsePoConfig, piConfigPaths, piImageSettingsPath, pluginDirectoryForSource, projectHarnessEnvironment, providePoConfigContext, readHarnessState, readPackageConfigurations, readPoConfig, readPoConfigContextGeneration, readPoConfigLayers, readPoConfigLenient, readPoConfigPendingSelection, readPoConfigSelection, readWorkspaceDeclarations, replacePoConfigContext, replaceProfileEnvironment, repositoryPoConfigPath, requireHarnessPaths, requireHarnessRoot, requirePoConfigContext, resetHarnessStore, resolveLayers, resolvePackageConfigurations, resolvePlanningPlansDirectory, resolvePluginDirectories, resolvePluginEntries, resolveProfile, resolveSharedSkills, resolveVoiceConfig, restoreHarnessStateSnapshot, savePiImageSettings, setPoConfigValue, setPoConfigValueAsync, snapshotHarnessState, supersedePoConfigTransition, unsetPoConfigValue, unsetPoConfigValueAsync, updateHarnessState, valueAtKeyPath, writePoConfigValues, writePoConfigValuesAsync, writePrivateAtomicJson, writePrivateAtomicJsonAsync };
@@ -100,7 +100,7 @@ default:
100
100
  - '@agimon-ai/po-template-advanced'
101
101
  - '@agimon-ai/po-template-elegant'
102
102
  - '@agimon-ai/po-template-desktop'
103
- - '@agimon-ai/po-backdrop-meadow'
103
+ - '@agimon-ai/po-backdrop-bamboo'
104
104
  layers:
105
105
  # Durable scheduling. Keep this in the home default major mode.
106
106
  calendar:
@@ -285,7 +285,7 @@ default:
285
285
  - '@agimon-ai/po-template-advanced'
286
286
  - '@agimon-ai/po-template-elegant'
287
287
  - '@agimon-ai/po-template-desktop'
288
- - '@agimon-ai/po-backdrop-meadow'
288
+ - '@agimon-ai/po-backdrop-bamboo'
289
289
  layers:
290
290
  # Durable scheduling. Keep this in the home default major mode.
291
291
  calendar:
@@ -638,4 +638,4 @@ Object.defineProperty(exports, "initializeRepositoryPoConfigAsync", {
638
638
  }
639
639
  });
640
640
 
641
- //# sourceMappingURL=init-MwgLrvYK.cjs.map
641
+ //# sourceMappingURL=init-B9tCCwA3.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-MwgLrvYK.cjs","names":["ensureDirectory","fs","path","classifyTarget","nodeHost","randomUUID","initializePoConfig","globalPoConfigDirectory","createSerialRunner","nodeHost","getOrThrow","writeFileAtomic","path","globalPoConfigDirectory"],"sources":["../src/services/init/templates.ts","../src/services/init/sync.ts","../src/services/init/index.ts"],"sourcesContent":["export const PRIVATE_DIRECTORY_MODE = 0o700;\nexport const PRIVATE_FILE_MODE = 0o600;\nexport const REPOSITORY_DIRECTORY_MODE = 0o755;\nexport const REPOSITORY_FILE_MODE = 0o644;\nexport const PO_DIRECTORY = '.po';\n\n/** The global seed files are processed in this fixed order. */\nexport const GLOBAL_PO_SEED_FILES = ['config.yaml', 'modes.yaml', 'domains.yaml', 'profiles.yaml'] as const;\n\nexport type PoSeedFile = (typeof GLOBAL_PO_SEED_FILES)[number];\n\n/** Personal-only: a repository pin would override the layout the person picks during onboarding. */\nconst WEB_TEMPLATE_SEED = `# Default web layout, resolved against the installed web template packages.\nweb:\n template: po-template-elegant\n\n`;\n\n/** Portable defaults for a new global Po configuration directory. */\nexport const PO_CONFIG_TEMPLATES: Readonly<Record<PoSeedFile, string>> = {\n 'config.yaml': `projectTrust: ask\n\n${WEB_TEMPLATE_SEED}\n# Workspace declarations belong in the repository's .po/workspaces.yaml, not this personal file.\n# Entries accept name, path (default .), alias, instructions and free-form metadata.\n# Autonomous voice is opt-in and uses an explicitly configured Pi model.\n# voice:\n# autoCapture:\n# model: provider/model-id\n# startPhrases:\n# - hey po\n# stopPhrases:\n# - stop speaking\n# utteranceIdleMs: 3000\n# # Long prompts only: open a draft, keep talking, then send it in one piece.\n# # Short utterances are delivered as you finish them and need no phrase.\n# composeOpenPhrases:\n# - hey po\n# composeSendPhrases:\n# - that's it\n# composeCancelPhrases:\n# - scratch that\n# # Endpoint window while a draft collects, so a short command lands on its own.\n# composeUtteranceIdleMs: 1200\n# # Silence before Voice reminds you a draft is open. 0 turns the reminder off.\n# composeNudgeMs: 10000\n# tts:\n# engine: macos-say\n# voice: Samantha\n# rate: 190\n`,\n 'modes.yaml': `# A layer is a reusable named bundle of packages, built-in or local extensions,\n# and hook groups. Major modes below choose which layers load together for a session.\n#\n# Layers and modes defined here apply to every repository. A repository's own\n# .po/modes.yaml is read after this file and replaces any layer or mode of the\n# same name, so a repository can override one entry without restating the rest.\n#\n# Add a layer by giving it a unique name under layers. Local Pi scripts belong\n# under extensions, while installed Pi packages belong under packages:\n# review-tools:\n# extensions:\n# - './extensions/local-review.ts'\n# packages:\n# - '@scope/review-extension'\n# A bare extension name selects a Po built-in. A path beginning with ./ or\n# ../ loads a custom script or extension directory. A bare package loads its\n# ordered package.json pi.extensions entries, while an exported subpath selects\n# one adapter. Relative paths resolve beside this file here (~/.po), or\n# from the repository root in .po/modes.yaml.\n#\n# Use a package mapping when that package accepts configuration. Configuration\n# belongs under the package entry that consumes it, not beside packages.\n# The top-level default bundle loads before every major mode. Replace this whole\n# packages list to customize the distribution defaults. Po core packages\n# remain active independently of this list.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - '@agimon-ai/po-goal'\n - '@agimon-ai/po-voice'\n - '@agimon-ai/po-runner'\n - '@agimon-ai/po-codemode'\n - '@agimon-ai/po-read'\n - '@agimon-ai/po-grep'\n - '@agimon-ai/po-edit'\n - '@agimon-ai/po-file-edit'\n - '@agimon-ai/po-autocompact'\n - '@agimon-ai/po-plan'\n - '@agimon-ai/po-author'\n - '@agimon-ai/po-computer-use'\n - '@agimon-ai/po-log'\n - '@agimon-ai/po-mcp'\n - '@agimon-ai/po-prompt'\n - '@agimon-ai/po-template-advanced'\n - '@agimon-ai/po-template-elegant'\n - '@agimon-ai/po-template-desktop'\n - '@agimon-ai/po-backdrop-meadow'\nlayers:\n # Durable scheduling. Keep this in the home default major mode.\n calendar:\n packages:\n - '@agimon-ai/po-calendar'\n # Workflow graphs, launch, recovery and the\n # workflow/dynamicWorkflow code-mode namespaces.\n # Remove 'workflow' from a mode to turn it off there.\n workflow:\n packages:\n - '@agimon-ai/po-workflow'\n coding:\n packages:\n - '@agimon-ai/po-vibe-lint'\n team:\n packages:\n - name: '@agimon-ai/po-team'\n # Optional Team configuration. Uncomment and choose models available to Pi.\n # config:\n # models:\n # - model: openai-codex/gpt-5.6-luna\n # thinking: xhigh\n # # Tool names excluded from subagents launched by this package. These\n # # remove model-visible tools while preserving hidden team transport.\n # excludeTools: [ask_user_question, intercom, subagent]\n ask-user:\n packages:\n - '@agimon-ai/po-user-feedback'\n task:\n packages:\n - '@agimon-ai/po-task'\n sandbox:\n packages:\n - '@agimon-ai/po-sandbox'\n design:\n packages:\n - '@agimon-ai/po-style-system'\n llm:\n packages:\n - '@agimon-ai/po-model-guidance'\n - '@agimon-ai/po-gateway'\n source-control:\n packages:\n - '@agimon-ai/po-git'\n image-gen:\n packages:\n - '@agimon-ai/po-image-gen'\n web-search:\n packages:\n - '@agimon-ai/po-web-search'\n browser:\n packages:\n - '@agimon-ai/po-browse'\n# A major mode explains when it should be used and names its ordered layers.\n# Add another entry under majorMode, then select it with\n# po --major-mode <name>. Change defaultMajorMode to make it the default.\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Lean mode with Team delegation and persistent tasks.\n layers: [team, task, llm, workflow, calendar]\n copilot:\n description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.\n layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]\n assistant:\n description: Everyday assistant with delegation, tasks, web research, browsing and calendar.\n layers: [team, ask-user, task, llm, web-search, browser, calendar, workflow]\n marketing:\n description: Marketing work with research, browsing and image generation.\n layers: [team, ask-user, task, llm, web-search, browser, image-gen, calendar, workflow]\n examples:\n description: Base mode for the repository's plugin and workflow examples.\n layers: [workflow]\n # review:\n # description: Focused review mode for inspecting changes and reporting risks.\n # layers: [team, task, ask-user]\n`,\n 'domains.yaml': `# Plugins are named once in this catalog, then selected by one or more domains.\n# Po automatically inspects personal and repository Codex marketplaces.\n# Each configured root may also be a folder whose direct children are plugins;\n# use roots: [plugins] to discover a repository plugin folder without one entry\n# per plugin. Discovery never scans recursively.\ndefaultDomains: [default]\nplugins:\n roots: []\n entries: {}\n # Local paths resolve beside this file in ~/.po. Repository paths in a\n # repository .po/domains.yaml resolve from that repository root.\n # entries:\n # development:\n # source: local\n # path: plugins/development\n # remote-review:\n # source: url\n # url: https://github.com/acme/review-plugin.git\n # ref: v1.2.0\n # published-review:\n # source: npm\n # package: '@acme/review-plugin'\n # version: 1.2.0\n# Domains carry descriptions and refer to catalog names, not filesystem paths.\ndomains:\n default:\n description: Shared skills and repository MCP only.\n plugins: []\n # development:\n # description: TypeScript implementation and review tools.\n # plugins:\n # - development\n # # Mapping form can load only selected resources from a shared plugin.\n # - name: remote-review\n # skills: [typescript]\n # agents: [reviewer]\n # hooks: false\n # mcp: true\n # # Set false only when this domain should omit shared .claude/skills.\n # sharedSkills: false\n # # Domain mcp is an allowlist over servers configured elsewhere, not a\n # # request to start new ones. Listing servers here drops the tool schemas\n # # of the ones left out, usually the largest context saving a domain can\n # # make. Run po --explain to see the token cost before and after.\n # # Filtering applies only when every selected domain declares mcp, so a\n # # selection mixing this with a domain that omits it stays unfiltered.\n # mcp:\n # servers: [code-intel]\n # proxy: [repository-search]\n# Select it with po --domains development, or add it to defaultDomains.\n#\n# Aliases let one selection enable multiple domains. Replace the empty mapping\n# below with entries like the commented example.\naliases: {}\n# aliases:\n# work: [default, development]\n`,\n 'profiles.yaml': `# Profiles select a persona and optional environment defaults for a session.\n# Each configured root may itself be a profile or contain direct-child profile\n# folders. A folder is discovered when it contains profile.md, SOUL.md, or\n# AGENTS.md; discovery never scans recursively.\nprofiles:\n roots: []\n entries: {}\n # Roots resolve beside this file in ~/.po. Repository roots in a\n # repository .po/profiles.yaml resolve from that repository root.\n # roots: [agents/acme]\n # Explicit entries override an automatically discovered folder of the same\n # name. Environment values must be strings; already exported values win.\n # entries:\n # writer:\n # persona: agents/special/writer\n # env:\n # BRAND: acme\n # TONE: concise\n# Po Pi concatenates profile.md, SOUL.md, then AGENTS.md for the persona.\n# Select one with: po --profile writer\n`,\n};\n\n/** Standalone defaults for a repository that is trying Po through Po. */\nexport const REPOSITORY_PO_CONFIG_TEMPLATES: Readonly<Record<PoSeedFile, string>> = {\n 'config.yaml': PO_CONFIG_TEMPLATES['config.yaml'].replace(WEB_TEMPLATE_SEED, ''),\n 'modes.yaml': `# Repository-local layers and major modes. These entries override personal\n# entries with the same name from ~/.po/modes.yaml.\n# This repository-local default replaces the personal top-level default as one\n# whole package list. Edit it to customize the standalone package baseline.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - '@agimon-ai/po-goal'\n - '@agimon-ai/po-voice'\n - '@agimon-ai/po-runner'\n - '@agimon-ai/po-codemode'\n - '@agimon-ai/po-read'\n - '@agimon-ai/po-grep'\n - '@agimon-ai/po-edit'\n - '@agimon-ai/po-file-edit'\n - '@agimon-ai/po-autocompact'\n - '@agimon-ai/po-plan'\n - '@agimon-ai/po-author'\n - '@agimon-ai/po-computer-use'\n - '@agimon-ai/po-log'\n - '@agimon-ai/po-mcp'\n - '@agimon-ai/po-prompt'\n - '@agimon-ai/po-template-advanced'\n - '@agimon-ai/po-template-elegant'\n - '@agimon-ai/po-template-desktop'\n - '@agimon-ai/po-backdrop-meadow'\nlayers:\n # Durable scheduling. Keep this in the home default major mode.\n calendar:\n packages:\n - '@agimon-ai/po-calendar'\n # Workflow graphs, launch, recovery and the\n # workflow/dynamicWorkflow code-mode namespaces.\n # Remove 'workflow' from a mode to turn it off there.\n workflow:\n packages:\n - '@agimon-ai/po-workflow'\n coding:\n packages:\n - '@agimon-ai/po-vibe-lint'\n team:\n packages:\n - name: '@agimon-ai/po-team'\n ask-user:\n packages:\n - '@agimon-ai/po-user-feedback'\n task:\n packages:\n - '@agimon-ai/po-task'\n sandbox:\n packages:\n - '@agimon-ai/po-sandbox'\n design:\n packages:\n - '@agimon-ai/po-style-system'\n llm:\n packages:\n - '@agimon-ai/po-model-guidance'\n - '@agimon-ai/po-gateway'\n source-control:\n packages:\n - '@agimon-ai/po-git'\n image-gen:\n packages:\n - '@agimon-ai/po-image-gen'\n web-search:\n packages:\n - '@agimon-ai/po-web-search'\n browser:\n packages:\n - '@agimon-ai/po-browse'\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Lean mode with Team delegation and persistent tasks.\n layers: [team, task, llm, workflow, calendar]\n copilot:\n description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.\n layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]\n examples:\n description: Base mode for the repository's plugin and workflow examples.\n layers: [workflow]\n`,\n 'domains.yaml': `# Repository-local plugin catalog and domain selection.\ndefaultDomains: [default]\nplugins:\n roots: []\n entries: {}\ndomains:\n default:\n description: Shared skills and repository MCP only.\n plugins: []\naliases: {}\n`,\n 'profiles.yaml': `# Repository-local persona roots and environment defaults.\nprofiles:\n roots: []\n entries: {}\n`,\n};\n\n/** Result of filling a Po seed directory. File arrays contain names in seed order. */\nexport interface GlobalPoInitResult {\n directory: string;\n created: string[];\n preserved: string[];\n /** Existing files overwritten from the template. Only ever non-empty under `force`. */\n replaced: string[];\n}\n\nexport interface GlobalPoInitOptions {\n /**\n * Overwrite existing seed files instead of preserving them.\n *\n * Off by default: init is safe to re-run, and hand-edited config is the\n * normal case rather than the exception.\n */\n force?: boolean;\n}\n\nexport type RepositoryPoInitOptions = GlobalPoInitOptions;\nexport type RepositoryPoInitResult = GlobalPoInitResult;\n","import { randomUUID } from 'node:crypto';\n// sync: These helpers implement exported Node-only synchronous initialization APIs.\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport { globalPoConfigDirectory } from '../config';\nimport {\n PO_CONFIG_TEMPLATES,\n PO_DIRECTORY,\n GLOBAL_PO_SEED_FILES,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n REPOSITORY_FILE_MODE,\n type PoSeedFile,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\n\nconst UTF8_ENCODING = 'utf8';\nconst FILE_ALREADY_EXISTS = 'EEXIST';\nconst FILE_NOT_FOUND = 'ENOENT';\n\nfunction errorCode(error: unknown): string | undefined {\n if (!(error instanceof Error)) return undefined;\n const code = (error as NodeJS.ErrnoException).code;\n return typeof code === 'string' ? code : undefined;\n}\n\nfunction ensureDirectory(directory: string, mode: number): void {\n let stats: fs.Stats;\n try {\n stats = fs.lstatSync(directory);\n } catch (error) {\n if (errorCode(error) !== FILE_NOT_FOUND) throw error;\n try {\n fs.mkdirSync(directory, { mode });\n stats = fs.lstatSync(directory);\n } catch (mkdirError) {\n if (errorCode(mkdirError) !== FILE_ALREADY_EXISTS) throw mkdirError;\n stats = fs.lstatSync(directory);\n }\n }\n\n if (stats.isSymbolicLink()) {\n throw new Error(`Refusing to initialize through symlinked directory: ${directory}`);\n }\n if (!stats.isDirectory()) {\n throw new Error(`Po config path is not a directory: ${directory}`);\n }\n}\n\nfunction ensurePoDirectory(directory: string, mode: number): void {\n ensureDirectory(path.dirname(directory), mode);\n ensureDirectory(directory, mode);\n}\n\nfunction classifyTarget(targetPath: string): 'missing' | 'file' {\n let stats: fs.Stats;\n try {\n stats = fs.lstatSync(targetPath);\n } catch (error) {\n if (errorCode(error) === FILE_NOT_FOUND) return 'missing';\n throw error;\n }\n\n if (stats.isFile()) return 'file';\n if (stats.isSymbolicLink()) {\n try {\n if (fs.statSync(targetPath).isFile()) return 'file';\n } catch (error) {\n throw new Error(`Po config seed symlink is not file-like: ${targetPath}`, { cause: error });\n }\n }\n throw new Error(`Po config seed path is not file-like: ${targetPath}`);\n}\n\nfunction cleanupTemporaryFile(temporaryPath: string): void {\n try {\n fs.unlinkSync(temporaryPath);\n } catch (error) {\n if (errorCode(error) !== FILE_NOT_FOUND) throw error;\n }\n}\n\nfunction publishExclusively(targetPath: string, content: string, mode: number): boolean {\n const temporaryPath = `${targetPath}.${nodeHost.processId()}.${randomUUID()}.tmp`;\n let fileDescriptor: number | undefined;\n try {\n fileDescriptor = fs.openSync(temporaryPath, 'wx', mode);\n fs.writeFileSync(fileDescriptor, content, UTF8_ENCODING);\n fs.fchmodSync(fileDescriptor, mode);\n fs.fsyncSync(fileDescriptor);\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n\n try {\n fs.linkSync(temporaryPath, targetPath);\n return true;\n } catch (error) {\n if (errorCode(error) === FILE_ALREADY_EXISTS && classifyTarget(targetPath) === 'file') return false;\n throw error;\n }\n } finally {\n if (fileDescriptor !== undefined) {\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n }\n cleanupTemporaryFile(temporaryPath);\n }\n}\n\n/**\n * Replaces a seed file with the template, atomically.\n *\n * The rename swaps the directory entry in one step, so a reader either sees the\n * whole old file or the whole new one. Renaming onto a symlinked seed replaces\n * the link rather than writing through it.\n */\nfunction publishForcefully(targetPath: string, content: string, mode: number): void {\n const temporaryPath = `${targetPath}.${nodeHost.processId()}.${randomUUID()}.tmp`;\n let fileDescriptor: number | undefined;\n try {\n fileDescriptor = fs.openSync(temporaryPath, 'wx', mode);\n fs.writeFileSync(fileDescriptor, content, UTF8_ENCODING);\n fs.fchmodSync(fileDescriptor, mode);\n fs.fsyncSync(fileDescriptor);\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n\n fs.renameSync(temporaryPath, targetPath);\n } finally {\n if (fileDescriptor !== undefined) {\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n }\n cleanupTemporaryFile(temporaryPath);\n }\n}\n\nfunction initializePoConfig(\n directory: string,\n templates: Readonly<Record<PoSeedFile, string>>,\n options: GlobalPoInitOptions,\n directoryMode: number,\n fileMode: number,\n): GlobalPoInitResult {\n ensurePoDirectory(directory, directoryMode);\n\n const created: string[] = [];\n const preserved: string[] = [];\n const replaced: string[] = [];\n for (const fileName of GLOBAL_PO_SEED_FILES) {\n const targetPath = path.join(directory, fileName);\n const existed = classifyTarget(targetPath) === 'file';\n\n if (options.force) {\n publishForcefully(targetPath, templates[fileName], fileMode);\n (existed ? replaced : created).push(fileName);\n continue;\n }\n if (existed) {\n preserved.push(fileName);\n continue;\n }\n if (publishExclusively(targetPath, templates[fileName], fileMode)) created.push(fileName);\n else preserved.push(fileName);\n }\n\n return { directory, created, preserved, replaced };\n}\n\n/**\n * Fills missing global seed files.\n *\n * Existing files are left alone so that re-running init never discards\n * hand-edited config; pass `force` to overwrite them from the template. A new\n * file is published with an exclusive hard link, so a concurrent writer in\n * another process never loses its file to this one.\n *\n * @deprecated Node-only sync shim; use initializeGlobalPoConfigAsync. Removed in M2.\n */\nexport function initializeGlobalPoConfig(\n homeDirectory = nodeHost.homeDirectory(),\n options: GlobalPoInitOptions = {},\n): GlobalPoInitResult {\n return initializePoConfig(\n globalPoConfigDirectory(homeDirectory),\n PO_CONFIG_TEMPLATES,\n options,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n );\n}\n\n/**\n * Seeds repository-local configuration without creating or changing Pi settings.\n *\n * @deprecated Node-only sync shim; use initializeRepositoryPoConfigAsync. Removed in M2.\n */\nexport function initializeRepositoryPoConfig(\n repositoryRoot = process.cwd(),\n options: RepositoryPoInitOptions = {},\n): RepositoryPoInitResult {\n return initializePoConfig(\n path.join(path.resolve(repositoryRoot), PO_DIRECTORY),\n REPOSITORY_PO_CONFIG_TEMPLATES,\n options,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_FILE_MODE,\n );\n}\n","import path from 'node:path';\n\nimport {\n createSerialRunner,\n getOrThrow,\n nodeHost,\n writeFileAtomic,\n type FileSystem,\n} from '@agimon-ai/po-core/platform';\n\nimport { globalPoConfigDirectory } from '../config';\nimport {\n PO_CONFIG_TEMPLATES,\n PO_DIRECTORY,\n GLOBAL_PO_SEED_FILES,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n REPOSITORY_FILE_MODE,\n type PoSeedFile,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport {\n PO_CONFIG_TEMPLATES,\n GLOBAL_PO_SEED_FILES,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\nexport { initializeGlobalPoConfig, initializeRepositoryPoConfig } from './sync';\n\n/** Seed writes in this process are queued per file, so a check and its write are not interleaved. */\nconst seedWrites = createSerialRunner();\n\nasync function ensureDirectory(fs: FileSystem, directory: string, mode: number, context: IoContext): Promise<void> {\n let info = await fs.fileInfo(directory, context);\n if (!info.ok && info.error.code === 'not_found') {\n const created = await fs.createDir(directory, { recursive: false }, context);\n if (created.ok) await nodeHost.setMode(directory, mode);\n info = await fs.fileInfo(directory, context);\n }\n const kind = getOrThrow(info).kind;\n if (kind === 'symlink') throw new Error(`Refusing to initialize through symlinked directory: ${directory}`);\n if (kind !== 'directory') throw new Error(`Po config path is not a directory: ${directory}`);\n}\n\nasync function classifyTarget(fs: FileSystem, targetPath: string, context: IoContext): Promise<'missing' | 'file'> {\n const info = await fs.fileInfo(targetPath, context);\n if (!info.ok && info.error.code === 'not_found') return 'missing';\n const kind = getOrThrow(info).kind;\n if (kind === 'file') return 'file';\n if (kind === 'symlink') {\n try {\n const target = getOrThrow(await fs.canonicalPath(targetPath, context));\n if (getOrThrow(await fs.fileInfo(target, context)).kind === 'file') return 'file';\n } catch (error) {\n throw new Error(`Po config seed symlink is not file-like: ${targetPath}`, { cause: error });\n }\n }\n throw new Error(`Po config seed path is not file-like: ${targetPath}`);\n}\n\nasync function publish(fs: FileSystem, targetPath: string, content: string, mode: number, context: IoContext) {\n await writeFileAtomic(fs, targetPath, content, context);\n await nodeHost.setMode(targetPath, mode);\n}\n\n/**\n * Fills one seed directory over a FileSystem.\n *\n * Without `force`, a missing file is checked and written inside one queued step\n * per file. The FileSystem has no exclusive create, so a second process writing\n * the same new file at the same instant can be overwritten; the Node-only sync\n * shim keeps its hard-link publication for that case.\n */\nasync function initializePoConfig(\n fs: FileSystem,\n directory: string,\n templates: Readonly<Record<PoSeedFile, string>>,\n options: GlobalPoInitOptions,\n directoryMode: number,\n fileMode: number,\n context: IoContext,\n): Promise<GlobalPoInitResult> {\n await ensureDirectory(fs, path.dirname(directory), directoryMode, context);\n await ensureDirectory(fs, directory, directoryMode, context);\n\n const created: string[] = [];\n const preserved: string[] = [];\n const replaced: string[] = [];\n for (const fileName of GLOBAL_PO_SEED_FILES) {\n const targetPath = path.join(directory, fileName);\n await seedWrites.forKey(path.resolve(targetPath))(async () => {\n const existed = (await classifyTarget(fs, targetPath, context)) === 'file';\n if (existed && !options.force) {\n preserved.push(fileName);\n return;\n }\n await publish(fs, targetPath, templates[fileName], fileMode, context);\n (existed ? replaced : created).push(fileName);\n });\n }\n return { directory, created, preserved, replaced };\n}\n\n/**\n * Fills missing global seed files over a FileSystem.\n *\n * Existing files are left alone so that re-running init never discards\n * hand-edited config; pass `force` to overwrite them from the template.\n */\nexport function initializeGlobalPoConfigAsync(\n fs: FileSystem,\n context: IoContext,\n homeDirectory = nodeHost.homeDirectory(),\n options: GlobalPoInitOptions = {},\n): Promise<GlobalPoInitResult> {\n return initializePoConfig(\n fs,\n globalPoConfigDirectory(homeDirectory),\n PO_CONFIG_TEMPLATES,\n options,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n context,\n );\n}\n\n/** Seeds repository-local configuration over a FileSystem without creating or changing Pi settings. */\nexport function initializeRepositoryPoConfigAsync(\n fs: FileSystem,\n repositoryRoot: string,\n context: IoContext,\n options: RepositoryPoInitOptions = {},\n): Promise<RepositoryPoInitResult> {\n return initializePoConfig(\n fs,\n path.join(path.resolve(repositoryRoot), PO_DIRECTORY),\n REPOSITORY_PO_CONFIG_TEMPLATES,\n options,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_FILE_MODE,\n context,\n );\n}\n"],"mappings":";;;;;;;;;;;AAOA,MAAa,uBAAuB;CAAC;CAAe;CAAc;CAAgB;AAAe;;AAKjG,MAAM,oBAAoB;;;;;;AAO1B,MAAa,sBAA4D;CACvE,eAAe;;EAEf,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlB,cAAc;;;;;;;;;;;;;;;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AAI,YAAY,UAAU,WAAW,UAAU,OAAO;GACpE,CAAC,UAAU,WAAW,QAAA,CAAS,KAAK,QAAQ;EAC9C,CAAC;CACH;CACA,OAAO;EAAE;EAAW;EAAS;EAAW;CAAS;AACnD;;;;;;;AAQA,SAAgB,8BACd,IACA,SACA,gBAAgBH,4BAAAA,SAAS,cAAc,GACvC,UAA+B,CAAC,GACH;CAC7B,OAAO,mBACL,IACAI,aAAAA,wBAAwB,aAAa,GACrC,qBACA,SAAA,KAAA,KAGA,OACF;AACF;;AAGA,SAAgB,kCACd,IACA,gBACA,SACA,UAAmC,CAAC,GACH;CACjC,OAAO,mBACL,IACAD,UAAAA,QAAK,KAAKA,UAAAA,QAAK,QAAQ,cAAc,GAAA,KAAe,GACpD,gCACA,SAAA,KAAA,KAGA,OACF;AACF"}
1
+ {"version":3,"file":"init-B9tCCwA3.cjs","names":["ensureDirectory","fs","path","classifyTarget","nodeHost","randomUUID","initializePoConfig","globalPoConfigDirectory","createSerialRunner","nodeHost","getOrThrow","writeFileAtomic","path","globalPoConfigDirectory"],"sources":["../src/services/init/templates.ts","../src/services/init/sync.ts","../src/services/init/index.ts"],"sourcesContent":["export const PRIVATE_DIRECTORY_MODE = 0o700;\nexport const PRIVATE_FILE_MODE = 0o600;\nexport const REPOSITORY_DIRECTORY_MODE = 0o755;\nexport const REPOSITORY_FILE_MODE = 0o644;\nexport const PO_DIRECTORY = '.po';\n\n/** The global seed files are processed in this fixed order. */\nexport const GLOBAL_PO_SEED_FILES = ['config.yaml', 'modes.yaml', 'domains.yaml', 'profiles.yaml'] as const;\n\nexport type PoSeedFile = (typeof GLOBAL_PO_SEED_FILES)[number];\n\n/** Personal-only: a repository pin would override the layout the person picks during onboarding. */\nconst WEB_TEMPLATE_SEED = `# Default web layout, resolved against the installed web template packages.\nweb:\n template: po-template-elegant\n\n`;\n\n/** Portable defaults for a new global Po configuration directory. */\nexport const PO_CONFIG_TEMPLATES: Readonly<Record<PoSeedFile, string>> = {\n 'config.yaml': `projectTrust: ask\n\n${WEB_TEMPLATE_SEED}\n# Workspace declarations belong in the repository's .po/workspaces.yaml, not this personal file.\n# Entries accept name, path (default .), alias, instructions and free-form metadata.\n# Autonomous voice is opt-in and uses an explicitly configured Pi model.\n# voice:\n# autoCapture:\n# model: provider/model-id\n# startPhrases:\n# - hey po\n# stopPhrases:\n# - stop speaking\n# utteranceIdleMs: 3000\n# # Long prompts only: open a draft, keep talking, then send it in one piece.\n# # Short utterances are delivered as you finish them and need no phrase.\n# composeOpenPhrases:\n# - hey po\n# composeSendPhrases:\n# - that's it\n# composeCancelPhrases:\n# - scratch that\n# # Endpoint window while a draft collects, so a short command lands on its own.\n# composeUtteranceIdleMs: 1200\n# # Silence before Voice reminds you a draft is open. 0 turns the reminder off.\n# composeNudgeMs: 10000\n# tts:\n# engine: macos-say\n# voice: Samantha\n# rate: 190\n`,\n 'modes.yaml': `# A layer is a reusable named bundle of packages, built-in or local extensions,\n# and hook groups. Major modes below choose which layers load together for a session.\n#\n# Layers and modes defined here apply to every repository. A repository's own\n# .po/modes.yaml is read after this file and replaces any layer or mode of the\n# same name, so a repository can override one entry without restating the rest.\n#\n# Add a layer by giving it a unique name under layers. Local Pi scripts belong\n# under extensions, while installed Pi packages belong under packages:\n# review-tools:\n# extensions:\n# - './extensions/local-review.ts'\n# packages:\n# - '@scope/review-extension'\n# A bare extension name selects a Po built-in. A path beginning with ./ or\n# ../ loads a custom script or extension directory. A bare package loads its\n# ordered package.json pi.extensions entries, while an exported subpath selects\n# one adapter. Relative paths resolve beside this file here (~/.po), or\n# from the repository root in .po/modes.yaml.\n#\n# Use a package mapping when that package accepts configuration. Configuration\n# belongs under the package entry that consumes it, not beside packages.\n# The top-level default bundle loads before every major mode. Replace this whole\n# packages list to customize the distribution defaults. Po core packages\n# remain active independently of this list.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - '@agimon-ai/po-goal'\n - '@agimon-ai/po-voice'\n - '@agimon-ai/po-runner'\n - '@agimon-ai/po-codemode'\n - '@agimon-ai/po-read'\n - '@agimon-ai/po-grep'\n - '@agimon-ai/po-edit'\n - '@agimon-ai/po-file-edit'\n - '@agimon-ai/po-autocompact'\n - '@agimon-ai/po-plan'\n - '@agimon-ai/po-author'\n - '@agimon-ai/po-computer-use'\n - '@agimon-ai/po-log'\n - '@agimon-ai/po-mcp'\n - '@agimon-ai/po-prompt'\n - '@agimon-ai/po-template-advanced'\n - '@agimon-ai/po-template-elegant'\n - '@agimon-ai/po-template-desktop'\n - '@agimon-ai/po-backdrop-bamboo'\nlayers:\n # Durable scheduling. Keep this in the home default major mode.\n calendar:\n packages:\n - '@agimon-ai/po-calendar'\n # Workflow graphs, launch, recovery and the\n # workflow/dynamicWorkflow code-mode namespaces.\n # Remove 'workflow' from a mode to turn it off there.\n workflow:\n packages:\n - '@agimon-ai/po-workflow'\n coding:\n packages:\n - '@agimon-ai/po-vibe-lint'\n team:\n packages:\n - name: '@agimon-ai/po-team'\n # Optional Team configuration. Uncomment and choose models available to Pi.\n # config:\n # models:\n # - model: openai-codex/gpt-5.6-luna\n # thinking: xhigh\n # # Tool names excluded from subagents launched by this package. These\n # # remove model-visible tools while preserving hidden team transport.\n # excludeTools: [ask_user_question, intercom, subagent]\n ask-user:\n packages:\n - '@agimon-ai/po-user-feedback'\n task:\n packages:\n - '@agimon-ai/po-task'\n sandbox:\n packages:\n - '@agimon-ai/po-sandbox'\n design:\n packages:\n - '@agimon-ai/po-style-system'\n llm:\n packages:\n - '@agimon-ai/po-model-guidance'\n - '@agimon-ai/po-gateway'\n source-control:\n packages:\n - '@agimon-ai/po-git'\n image-gen:\n packages:\n - '@agimon-ai/po-image-gen'\n web-search:\n packages:\n - '@agimon-ai/po-web-search'\n browser:\n packages:\n - '@agimon-ai/po-browse'\n# A major mode explains when it should be used and names its ordered layers.\n# Add another entry under majorMode, then select it with\n# po --major-mode <name>. Change defaultMajorMode to make it the default.\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Lean mode with Team delegation and persistent tasks.\n layers: [team, task, llm, workflow, calendar]\n copilot:\n description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.\n layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]\n assistant:\n description: Everyday assistant with delegation, tasks, web research, browsing and calendar.\n layers: [team, ask-user, task, llm, web-search, browser, calendar, workflow]\n marketing:\n description: Marketing work with research, browsing and image generation.\n layers: [team, ask-user, task, llm, web-search, browser, image-gen, calendar, workflow]\n examples:\n description: Base mode for the repository's plugin and workflow examples.\n layers: [workflow]\n # review:\n # description: Focused review mode for inspecting changes and reporting risks.\n # layers: [team, task, ask-user]\n`,\n 'domains.yaml': `# Plugins are named once in this catalog, then selected by one or more domains.\n# Po automatically inspects personal and repository Codex marketplaces.\n# Each configured root may also be a folder whose direct children are plugins;\n# use roots: [plugins] to discover a repository plugin folder without one entry\n# per plugin. Discovery never scans recursively.\ndefaultDomains: [default]\nplugins:\n roots: []\n entries: {}\n # Local paths resolve beside this file in ~/.po. Repository paths in a\n # repository .po/domains.yaml resolve from that repository root.\n # entries:\n # development:\n # source: local\n # path: plugins/development\n # remote-review:\n # source: url\n # url: https://github.com/acme/review-plugin.git\n # ref: v1.2.0\n # published-review:\n # source: npm\n # package: '@acme/review-plugin'\n # version: 1.2.0\n# Domains carry descriptions and refer to catalog names, not filesystem paths.\ndomains:\n default:\n description: Shared skills and repository MCP only.\n plugins: []\n # development:\n # description: TypeScript implementation and review tools.\n # plugins:\n # - development\n # # Mapping form can load only selected resources from a shared plugin.\n # - name: remote-review\n # skills: [typescript]\n # agents: [reviewer]\n # hooks: false\n # mcp: true\n # # Set false only when this domain should omit shared .claude/skills.\n # sharedSkills: false\n # # Domain mcp is an allowlist over servers configured elsewhere, not a\n # # request to start new ones. Listing servers here drops the tool schemas\n # # of the ones left out, usually the largest context saving a domain can\n # # make. Run po --explain to see the token cost before and after.\n # # Filtering applies only when every selected domain declares mcp, so a\n # # selection mixing this with a domain that omits it stays unfiltered.\n # mcp:\n # servers: [code-intel]\n # proxy: [repository-search]\n# Select it with po --domains development, or add it to defaultDomains.\n#\n# Aliases let one selection enable multiple domains. Replace the empty mapping\n# below with entries like the commented example.\naliases: {}\n# aliases:\n# work: [default, development]\n`,\n 'profiles.yaml': `# Profiles select a persona and optional environment defaults for a session.\n# Each configured root may itself be a profile or contain direct-child profile\n# folders. A folder is discovered when it contains profile.md, SOUL.md, or\n# AGENTS.md; discovery never scans recursively.\nprofiles:\n roots: []\n entries: {}\n # Roots resolve beside this file in ~/.po. Repository roots in a\n # repository .po/profiles.yaml resolve from that repository root.\n # roots: [agents/acme]\n # Explicit entries override an automatically discovered folder of the same\n # name. Environment values must be strings; already exported values win.\n # entries:\n # writer:\n # persona: agents/special/writer\n # env:\n # BRAND: acme\n # TONE: concise\n# Po Pi concatenates profile.md, SOUL.md, then AGENTS.md for the persona.\n# Select one with: po --profile writer\n`,\n};\n\n/** Standalone defaults for a repository that is trying Po through Po. */\nexport const REPOSITORY_PO_CONFIG_TEMPLATES: Readonly<Record<PoSeedFile, string>> = {\n 'config.yaml': PO_CONFIG_TEMPLATES['config.yaml'].replace(WEB_TEMPLATE_SEED, ''),\n 'modes.yaml': `# Repository-local layers and major modes. These entries override personal\n# entries with the same name from ~/.po/modes.yaml.\n# This repository-local default replaces the personal top-level default as one\n# whole package list. Edit it to customize the standalone package baseline.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - '@agimon-ai/po-goal'\n - '@agimon-ai/po-voice'\n - '@agimon-ai/po-runner'\n - '@agimon-ai/po-codemode'\n - '@agimon-ai/po-read'\n - '@agimon-ai/po-grep'\n - '@agimon-ai/po-edit'\n - '@agimon-ai/po-file-edit'\n - '@agimon-ai/po-autocompact'\n - '@agimon-ai/po-plan'\n - '@agimon-ai/po-author'\n - '@agimon-ai/po-computer-use'\n - '@agimon-ai/po-log'\n - '@agimon-ai/po-mcp'\n - '@agimon-ai/po-prompt'\n - '@agimon-ai/po-template-advanced'\n - '@agimon-ai/po-template-elegant'\n - '@agimon-ai/po-template-desktop'\n - '@agimon-ai/po-backdrop-bamboo'\nlayers:\n # Durable scheduling. Keep this in the home default major mode.\n calendar:\n packages:\n - '@agimon-ai/po-calendar'\n # Workflow graphs, launch, recovery and the\n # workflow/dynamicWorkflow code-mode namespaces.\n # Remove 'workflow' from a mode to turn it off there.\n workflow:\n packages:\n - '@agimon-ai/po-workflow'\n coding:\n packages:\n - '@agimon-ai/po-vibe-lint'\n team:\n packages:\n - name: '@agimon-ai/po-team'\n ask-user:\n packages:\n - '@agimon-ai/po-user-feedback'\n task:\n packages:\n - '@agimon-ai/po-task'\n sandbox:\n packages:\n - '@agimon-ai/po-sandbox'\n design:\n packages:\n - '@agimon-ai/po-style-system'\n llm:\n packages:\n - '@agimon-ai/po-model-guidance'\n - '@agimon-ai/po-gateway'\n source-control:\n packages:\n - '@agimon-ai/po-git'\n image-gen:\n packages:\n - '@agimon-ai/po-image-gen'\n web-search:\n packages:\n - '@agimon-ai/po-web-search'\n browser:\n packages:\n - '@agimon-ai/po-browse'\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Lean mode with Team delegation and persistent tasks.\n layers: [team, task, llm, workflow, calendar]\n copilot:\n description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.\n layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]\n examples:\n description: Base mode for the repository's plugin and workflow examples.\n layers: [workflow]\n`,\n 'domains.yaml': `# Repository-local plugin catalog and domain selection.\ndefaultDomains: [default]\nplugins:\n roots: []\n entries: {}\ndomains:\n default:\n description: Shared skills and repository MCP only.\n plugins: []\naliases: {}\n`,\n 'profiles.yaml': `# Repository-local persona roots and environment defaults.\nprofiles:\n roots: []\n entries: {}\n`,\n};\n\n/** Result of filling a Po seed directory. File arrays contain names in seed order. */\nexport interface GlobalPoInitResult {\n directory: string;\n created: string[];\n preserved: string[];\n /** Existing files overwritten from the template. Only ever non-empty under `force`. */\n replaced: string[];\n}\n\nexport interface GlobalPoInitOptions {\n /**\n * Overwrite existing seed files instead of preserving them.\n *\n * Off by default: init is safe to re-run, and hand-edited config is the\n * normal case rather than the exception.\n */\n force?: boolean;\n}\n\nexport type RepositoryPoInitOptions = GlobalPoInitOptions;\nexport type RepositoryPoInitResult = GlobalPoInitResult;\n","import { randomUUID } from 'node:crypto';\n// sync: These helpers implement exported Node-only synchronous initialization APIs.\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport { globalPoConfigDirectory } from '../config';\nimport {\n PO_CONFIG_TEMPLATES,\n PO_DIRECTORY,\n GLOBAL_PO_SEED_FILES,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n REPOSITORY_FILE_MODE,\n type PoSeedFile,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\n\nconst UTF8_ENCODING = 'utf8';\nconst FILE_ALREADY_EXISTS = 'EEXIST';\nconst FILE_NOT_FOUND = 'ENOENT';\n\nfunction errorCode(error: unknown): string | undefined {\n if (!(error instanceof Error)) return undefined;\n const code = (error as NodeJS.ErrnoException).code;\n return typeof code === 'string' ? code : undefined;\n}\n\nfunction ensureDirectory(directory: string, mode: number): void {\n let stats: fs.Stats;\n try {\n stats = fs.lstatSync(directory);\n } catch (error) {\n if (errorCode(error) !== FILE_NOT_FOUND) throw error;\n try {\n fs.mkdirSync(directory, { mode });\n stats = fs.lstatSync(directory);\n } catch (mkdirError) {\n if (errorCode(mkdirError) !== FILE_ALREADY_EXISTS) throw mkdirError;\n stats = fs.lstatSync(directory);\n }\n }\n\n if (stats.isSymbolicLink()) {\n throw new Error(`Refusing to initialize through symlinked directory: ${directory}`);\n }\n if (!stats.isDirectory()) {\n throw new Error(`Po config path is not a directory: ${directory}`);\n }\n}\n\nfunction ensurePoDirectory(directory: string, mode: number): void {\n ensureDirectory(path.dirname(directory), mode);\n ensureDirectory(directory, mode);\n}\n\nfunction classifyTarget(targetPath: string): 'missing' | 'file' {\n let stats: fs.Stats;\n try {\n stats = fs.lstatSync(targetPath);\n } catch (error) {\n if (errorCode(error) === FILE_NOT_FOUND) return 'missing';\n throw error;\n }\n\n if (stats.isFile()) return 'file';\n if (stats.isSymbolicLink()) {\n try {\n if (fs.statSync(targetPath).isFile()) return 'file';\n } catch (error) {\n throw new Error(`Po config seed symlink is not file-like: ${targetPath}`, { cause: error });\n }\n }\n throw new Error(`Po config seed path is not file-like: ${targetPath}`);\n}\n\nfunction cleanupTemporaryFile(temporaryPath: string): void {\n try {\n fs.unlinkSync(temporaryPath);\n } catch (error) {\n if (errorCode(error) !== FILE_NOT_FOUND) throw error;\n }\n}\n\nfunction publishExclusively(targetPath: string, content: string, mode: number): boolean {\n const temporaryPath = `${targetPath}.${nodeHost.processId()}.${randomUUID()}.tmp`;\n let fileDescriptor: number | undefined;\n try {\n fileDescriptor = fs.openSync(temporaryPath, 'wx', mode);\n fs.writeFileSync(fileDescriptor, content, UTF8_ENCODING);\n fs.fchmodSync(fileDescriptor, mode);\n fs.fsyncSync(fileDescriptor);\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n\n try {\n fs.linkSync(temporaryPath, targetPath);\n return true;\n } catch (error) {\n if (errorCode(error) === FILE_ALREADY_EXISTS && classifyTarget(targetPath) === 'file') return false;\n throw error;\n }\n } finally {\n if (fileDescriptor !== undefined) {\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n }\n cleanupTemporaryFile(temporaryPath);\n }\n}\n\n/**\n * Replaces a seed file with the template, atomically.\n *\n * The rename swaps the directory entry in one step, so a reader either sees the\n * whole old file or the whole new one. Renaming onto a symlinked seed replaces\n * the link rather than writing through it.\n */\nfunction publishForcefully(targetPath: string, content: string, mode: number): void {\n const temporaryPath = `${targetPath}.${nodeHost.processId()}.${randomUUID()}.tmp`;\n let fileDescriptor: number | undefined;\n try {\n fileDescriptor = fs.openSync(temporaryPath, 'wx', mode);\n fs.writeFileSync(fileDescriptor, content, UTF8_ENCODING);\n fs.fchmodSync(fileDescriptor, mode);\n fs.fsyncSync(fileDescriptor);\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n\n fs.renameSync(temporaryPath, targetPath);\n } finally {\n if (fileDescriptor !== undefined) {\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n }\n cleanupTemporaryFile(temporaryPath);\n }\n}\n\nfunction initializePoConfig(\n directory: string,\n templates: Readonly<Record<PoSeedFile, string>>,\n options: GlobalPoInitOptions,\n directoryMode: number,\n fileMode: number,\n): GlobalPoInitResult {\n ensurePoDirectory(directory, directoryMode);\n\n const created: string[] = [];\n const preserved: string[] = [];\n const replaced: string[] = [];\n for (const fileName of GLOBAL_PO_SEED_FILES) {\n const targetPath = path.join(directory, fileName);\n const existed = classifyTarget(targetPath) === 'file';\n\n if (options.force) {\n publishForcefully(targetPath, templates[fileName], fileMode);\n (existed ? replaced : created).push(fileName);\n continue;\n }\n if (existed) {\n preserved.push(fileName);\n continue;\n }\n if (publishExclusively(targetPath, templates[fileName], fileMode)) created.push(fileName);\n else preserved.push(fileName);\n }\n\n return { directory, created, preserved, replaced };\n}\n\n/**\n * Fills missing global seed files.\n *\n * Existing files are left alone so that re-running init never discards\n * hand-edited config; pass `force` to overwrite them from the template. A new\n * file is published with an exclusive hard link, so a concurrent writer in\n * another process never loses its file to this one.\n *\n * @deprecated Node-only sync shim; use initializeGlobalPoConfigAsync. Removed in M2.\n */\nexport function initializeGlobalPoConfig(\n homeDirectory = nodeHost.homeDirectory(),\n options: GlobalPoInitOptions = {},\n): GlobalPoInitResult {\n return initializePoConfig(\n globalPoConfigDirectory(homeDirectory),\n PO_CONFIG_TEMPLATES,\n options,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n );\n}\n\n/**\n * Seeds repository-local configuration without creating or changing Pi settings.\n *\n * @deprecated Node-only sync shim; use initializeRepositoryPoConfigAsync. Removed in M2.\n */\nexport function initializeRepositoryPoConfig(\n repositoryRoot = process.cwd(),\n options: RepositoryPoInitOptions = {},\n): RepositoryPoInitResult {\n return initializePoConfig(\n path.join(path.resolve(repositoryRoot), PO_DIRECTORY),\n REPOSITORY_PO_CONFIG_TEMPLATES,\n options,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_FILE_MODE,\n );\n}\n","import path from 'node:path';\n\nimport {\n createSerialRunner,\n getOrThrow,\n nodeHost,\n writeFileAtomic,\n type FileSystem,\n} from '@agimon-ai/po-core/platform';\n\nimport { globalPoConfigDirectory } from '../config';\nimport {\n PO_CONFIG_TEMPLATES,\n PO_DIRECTORY,\n GLOBAL_PO_SEED_FILES,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n REPOSITORY_FILE_MODE,\n type PoSeedFile,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport {\n PO_CONFIG_TEMPLATES,\n GLOBAL_PO_SEED_FILES,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\nexport { initializeGlobalPoConfig, initializeRepositoryPoConfig } from './sync';\n\n/** Seed writes in this process are queued per file, so a check and its write are not interleaved. */\nconst seedWrites = createSerialRunner();\n\nasync function ensureDirectory(fs: FileSystem, directory: string, mode: number, context: IoContext): Promise<void> {\n let info = await fs.fileInfo(directory, context);\n if (!info.ok && info.error.code === 'not_found') {\n const created = await fs.createDir(directory, { recursive: false }, context);\n if (created.ok) await nodeHost.setMode(directory, mode);\n info = await fs.fileInfo(directory, context);\n }\n const kind = getOrThrow(info).kind;\n if (kind === 'symlink') throw new Error(`Refusing to initialize through symlinked directory: ${directory}`);\n if (kind !== 'directory') throw new Error(`Po config path is not a directory: ${directory}`);\n}\n\nasync function classifyTarget(fs: FileSystem, targetPath: string, context: IoContext): Promise<'missing' | 'file'> {\n const info = await fs.fileInfo(targetPath, context);\n if (!info.ok && info.error.code === 'not_found') return 'missing';\n const kind = getOrThrow(info).kind;\n if (kind === 'file') return 'file';\n if (kind === 'symlink') {\n try {\n const target = getOrThrow(await fs.canonicalPath(targetPath, context));\n if (getOrThrow(await fs.fileInfo(target, context)).kind === 'file') return 'file';\n } catch (error) {\n throw new Error(`Po config seed symlink is not file-like: ${targetPath}`, { cause: error });\n }\n }\n throw new Error(`Po config seed path is not file-like: ${targetPath}`);\n}\n\nasync function publish(fs: FileSystem, targetPath: string, content: string, mode: number, context: IoContext) {\n await writeFileAtomic(fs, targetPath, content, context);\n await nodeHost.setMode(targetPath, mode);\n}\n\n/**\n * Fills one seed directory over a FileSystem.\n *\n * Without `force`, a missing file is checked and written inside one queued step\n * per file. The FileSystem has no exclusive create, so a second process writing\n * the same new file at the same instant can be overwritten; the Node-only sync\n * shim keeps its hard-link publication for that case.\n */\nasync function initializePoConfig(\n fs: FileSystem,\n directory: string,\n templates: Readonly<Record<PoSeedFile, string>>,\n options: GlobalPoInitOptions,\n directoryMode: number,\n fileMode: number,\n context: IoContext,\n): Promise<GlobalPoInitResult> {\n await ensureDirectory(fs, path.dirname(directory), directoryMode, context);\n await ensureDirectory(fs, directory, directoryMode, context);\n\n const created: string[] = [];\n const preserved: string[] = [];\n const replaced: string[] = [];\n for (const fileName of GLOBAL_PO_SEED_FILES) {\n const targetPath = path.join(directory, fileName);\n await seedWrites.forKey(path.resolve(targetPath))(async () => {\n const existed = (await classifyTarget(fs, targetPath, context)) === 'file';\n if (existed && !options.force) {\n preserved.push(fileName);\n return;\n }\n await publish(fs, targetPath, templates[fileName], fileMode, context);\n (existed ? replaced : created).push(fileName);\n });\n }\n return { directory, created, preserved, replaced };\n}\n\n/**\n * Fills missing global seed files over a FileSystem.\n *\n * Existing files are left alone so that re-running init never discards\n * hand-edited config; pass `force` to overwrite them from the template.\n */\nexport function initializeGlobalPoConfigAsync(\n fs: FileSystem,\n context: IoContext,\n homeDirectory = nodeHost.homeDirectory(),\n options: GlobalPoInitOptions = {},\n): Promise<GlobalPoInitResult> {\n return initializePoConfig(\n fs,\n globalPoConfigDirectory(homeDirectory),\n PO_CONFIG_TEMPLATES,\n options,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n context,\n );\n}\n\n/** Seeds repository-local configuration over a FileSystem without creating or changing Pi settings. */\nexport function initializeRepositoryPoConfigAsync(\n fs: FileSystem,\n repositoryRoot: string,\n context: IoContext,\n options: RepositoryPoInitOptions = {},\n): Promise<RepositoryPoInitResult> {\n return initializePoConfig(\n fs,\n path.join(path.resolve(repositoryRoot), PO_DIRECTORY),\n REPOSITORY_PO_CONFIG_TEMPLATES,\n options,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_FILE_MODE,\n context,\n );\n}\n"],"mappings":";;;;;;;;;;;AAOA,MAAa,uBAAuB;CAAC;CAAe;CAAc;CAAgB;AAAe;;AAKjG,MAAM,oBAAoB;;;;;;AAO1B,MAAa,sBAA4D;CACvE,eAAe;;EAEf,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Hd,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyD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,UAA+B,CAAC,GACH;CAC7B,OAAO,mBACL,IACAI,aAAAA,wBAAwB,aAAa,GACrC,qBACA,SAAA,KAAA,KAGA,OACF;AACF;;AAGA,SAAgB,kCACd,IACA,gBACA,SACA,UAAmC,CAAC,GACH;CACjC,OAAO,mBACL,IACAD,UAAAA,QAAK,KAAKA,UAAAA,QAAK,QAAQ,cAAc,GAAA,KAAe,GACpD,gCACA,SAAA,KAAA,KAGA,OACF;AACF"}
@@ -97,7 +97,7 @@ default:
97
97
  - '@agimon-ai/po-template-advanced'
98
98
  - '@agimon-ai/po-template-elegant'
99
99
  - '@agimon-ai/po-template-desktop'
100
- - '@agimon-ai/po-backdrop-meadow'
100
+ - '@agimon-ai/po-backdrop-bamboo'
101
101
  layers:
102
102
  # Durable scheduling. Keep this in the home default major mode.
103
103
  calendar:
@@ -282,7 +282,7 @@ default:
282
282
  - '@agimon-ai/po-template-advanced'
283
283
  - '@agimon-ai/po-template-elegant'
284
284
  - '@agimon-ai/po-template-desktop'
285
- - '@agimon-ai/po-backdrop-meadow'
285
+ - '@agimon-ai/po-backdrop-bamboo'
286
286
  layers:
287
287
  # Durable scheduling. Keep this in the home default major mode.
288
288
  calendar:
@@ -594,4 +594,4 @@ function initializeRepositoryPoConfigAsync(fs, repositoryRoot, context, options
594
594
  //#endregion
595
595
  export { GLOBAL_PO_SEED_FILES as a, initializeRepositoryPoConfig as i, initializeRepositoryPoConfigAsync as n, PO_CONFIG_TEMPLATES as o, initializeGlobalPoConfig as r, REPOSITORY_PO_CONFIG_TEMPLATES as s, initializeGlobalPoConfigAsync as t };
596
596
 
597
- //# sourceMappingURL=init-DLNiuso4.mjs.map
597
+ //# sourceMappingURL=init-lw06fOB4.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-DLNiuso4.mjs","names":["ensureDirectory","classifyTarget","initializePoConfig"],"sources":["../src/services/init/templates.ts","../src/services/init/sync.ts","../src/services/init/index.ts"],"sourcesContent":["export const PRIVATE_DIRECTORY_MODE = 0o700;\nexport const PRIVATE_FILE_MODE = 0o600;\nexport const REPOSITORY_DIRECTORY_MODE = 0o755;\nexport const REPOSITORY_FILE_MODE = 0o644;\nexport const PO_DIRECTORY = '.po';\n\n/** The global seed files are processed in this fixed order. */\nexport const GLOBAL_PO_SEED_FILES = ['config.yaml', 'modes.yaml', 'domains.yaml', 'profiles.yaml'] as const;\n\nexport type PoSeedFile = (typeof GLOBAL_PO_SEED_FILES)[number];\n\n/** Personal-only: a repository pin would override the layout the person picks during onboarding. */\nconst WEB_TEMPLATE_SEED = `# Default web layout, resolved against the installed web template packages.\nweb:\n template: po-template-elegant\n\n`;\n\n/** Portable defaults for a new global Po configuration directory. */\nexport const PO_CONFIG_TEMPLATES: Readonly<Record<PoSeedFile, string>> = {\n 'config.yaml': `projectTrust: ask\n\n${WEB_TEMPLATE_SEED}\n# Workspace declarations belong in the repository's .po/workspaces.yaml, not this personal file.\n# Entries accept name, path (default .), alias, instructions and free-form metadata.\n# Autonomous voice is opt-in and uses an explicitly configured Pi model.\n# voice:\n# autoCapture:\n# model: provider/model-id\n# startPhrases:\n# - hey po\n# stopPhrases:\n# - stop speaking\n# utteranceIdleMs: 3000\n# # Long prompts only: open a draft, keep talking, then send it in one piece.\n# # Short utterances are delivered as you finish them and need no phrase.\n# composeOpenPhrases:\n# - hey po\n# composeSendPhrases:\n# - that's it\n# composeCancelPhrases:\n# - scratch that\n# # Endpoint window while a draft collects, so a short command lands on its own.\n# composeUtteranceIdleMs: 1200\n# # Silence before Voice reminds you a draft is open. 0 turns the reminder off.\n# composeNudgeMs: 10000\n# tts:\n# engine: macos-say\n# voice: Samantha\n# rate: 190\n`,\n 'modes.yaml': `# A layer is a reusable named bundle of packages, built-in or local extensions,\n# and hook groups. Major modes below choose which layers load together for a session.\n#\n# Layers and modes defined here apply to every repository. A repository's own\n# .po/modes.yaml is read after this file and replaces any layer or mode of the\n# same name, so a repository can override one entry without restating the rest.\n#\n# Add a layer by giving it a unique name under layers. Local Pi scripts belong\n# under extensions, while installed Pi packages belong under packages:\n# review-tools:\n# extensions:\n# - './extensions/local-review.ts'\n# packages:\n# - '@scope/review-extension'\n# A bare extension name selects a Po built-in. A path beginning with ./ or\n# ../ loads a custom script or extension directory. A bare package loads its\n# ordered package.json pi.extensions entries, while an exported subpath selects\n# one adapter. Relative paths resolve beside this file here (~/.po), or\n# from the repository root in .po/modes.yaml.\n#\n# Use a package mapping when that package accepts configuration. Configuration\n# belongs under the package entry that consumes it, not beside packages.\n# The top-level default bundle loads before every major mode. Replace this whole\n# packages list to customize the distribution defaults. Po core packages\n# remain active independently of this list.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - '@agimon-ai/po-goal'\n - '@agimon-ai/po-voice'\n - '@agimon-ai/po-runner'\n - '@agimon-ai/po-codemode'\n - '@agimon-ai/po-read'\n - '@agimon-ai/po-grep'\n - '@agimon-ai/po-edit'\n - '@agimon-ai/po-file-edit'\n - '@agimon-ai/po-autocompact'\n - '@agimon-ai/po-plan'\n - '@agimon-ai/po-author'\n - '@agimon-ai/po-computer-use'\n - '@agimon-ai/po-log'\n - '@agimon-ai/po-mcp'\n - '@agimon-ai/po-prompt'\n - '@agimon-ai/po-template-advanced'\n - '@agimon-ai/po-template-elegant'\n - '@agimon-ai/po-template-desktop'\n - '@agimon-ai/po-backdrop-meadow'\nlayers:\n # Durable scheduling. Keep this in the home default major mode.\n calendar:\n packages:\n - '@agimon-ai/po-calendar'\n # Workflow graphs, launch, recovery and the\n # workflow/dynamicWorkflow code-mode namespaces.\n # Remove 'workflow' from a mode to turn it off there.\n workflow:\n packages:\n - '@agimon-ai/po-workflow'\n coding:\n packages:\n - '@agimon-ai/po-vibe-lint'\n team:\n packages:\n - name: '@agimon-ai/po-team'\n # Optional Team configuration. Uncomment and choose models available to Pi.\n # config:\n # models:\n # - model: openai-codex/gpt-5.6-luna\n # thinking: xhigh\n # # Tool names excluded from subagents launched by this package. These\n # # remove model-visible tools while preserving hidden team transport.\n # excludeTools: [ask_user_question, intercom, subagent]\n ask-user:\n packages:\n - '@agimon-ai/po-user-feedback'\n task:\n packages:\n - '@agimon-ai/po-task'\n sandbox:\n packages:\n - '@agimon-ai/po-sandbox'\n design:\n packages:\n - '@agimon-ai/po-style-system'\n llm:\n packages:\n - '@agimon-ai/po-model-guidance'\n - '@agimon-ai/po-gateway'\n source-control:\n packages:\n - '@agimon-ai/po-git'\n image-gen:\n packages:\n - '@agimon-ai/po-image-gen'\n web-search:\n packages:\n - '@agimon-ai/po-web-search'\n browser:\n packages:\n - '@agimon-ai/po-browse'\n# A major mode explains when it should be used and names its ordered layers.\n# Add another entry under majorMode, then select it with\n# po --major-mode <name>. Change defaultMajorMode to make it the default.\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Lean mode with Team delegation and persistent tasks.\n layers: [team, task, llm, workflow, calendar]\n copilot:\n description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.\n layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]\n assistant:\n description: Everyday assistant with delegation, tasks, web research, browsing and calendar.\n layers: [team, ask-user, task, llm, web-search, browser, calendar, workflow]\n marketing:\n description: Marketing work with research, browsing and image generation.\n layers: [team, ask-user, task, llm, web-search, browser, image-gen, calendar, workflow]\n examples:\n description: Base mode for the repository's plugin and workflow examples.\n layers: [workflow]\n # review:\n # description: Focused review mode for inspecting changes and reporting risks.\n # layers: [team, task, ask-user]\n`,\n 'domains.yaml': `# Plugins are named once in this catalog, then selected by one or more domains.\n# Po automatically inspects personal and repository Codex marketplaces.\n# Each configured root may also be a folder whose direct children are plugins;\n# use roots: [plugins] to discover a repository plugin folder without one entry\n# per plugin. Discovery never scans recursively.\ndefaultDomains: [default]\nplugins:\n roots: []\n entries: {}\n # Local paths resolve beside this file in ~/.po. Repository paths in a\n # repository .po/domains.yaml resolve from that repository root.\n # entries:\n # development:\n # source: local\n # path: plugins/development\n # remote-review:\n # source: url\n # url: https://github.com/acme/review-plugin.git\n # ref: v1.2.0\n # published-review:\n # source: npm\n # package: '@acme/review-plugin'\n # version: 1.2.0\n# Domains carry descriptions and refer to catalog names, not filesystem paths.\ndomains:\n default:\n description: Shared skills and repository MCP only.\n plugins: []\n # development:\n # description: TypeScript implementation and review tools.\n # plugins:\n # - development\n # # Mapping form can load only selected resources from a shared plugin.\n # - name: remote-review\n # skills: [typescript]\n # agents: [reviewer]\n # hooks: false\n # mcp: true\n # # Set false only when this domain should omit shared .claude/skills.\n # sharedSkills: false\n # # Domain mcp is an allowlist over servers configured elsewhere, not a\n # # request to start new ones. Listing servers here drops the tool schemas\n # # of the ones left out, usually the largest context saving a domain can\n # # make. Run po --explain to see the token cost before and after.\n # # Filtering applies only when every selected domain declares mcp, so a\n # # selection mixing this with a domain that omits it stays unfiltered.\n # mcp:\n # servers: [code-intel]\n # proxy: [repository-search]\n# Select it with po --domains development, or add it to defaultDomains.\n#\n# Aliases let one selection enable multiple domains. Replace the empty mapping\n# below with entries like the commented example.\naliases: {}\n# aliases:\n# work: [default, development]\n`,\n 'profiles.yaml': `# Profiles select a persona and optional environment defaults for a session.\n# Each configured root may itself be a profile or contain direct-child profile\n# folders. A folder is discovered when it contains profile.md, SOUL.md, or\n# AGENTS.md; discovery never scans recursively.\nprofiles:\n roots: []\n entries: {}\n # Roots resolve beside this file in ~/.po. Repository roots in a\n # repository .po/profiles.yaml resolve from that repository root.\n # roots: [agents/acme]\n # Explicit entries override an automatically discovered folder of the same\n # name. Environment values must be strings; already exported values win.\n # entries:\n # writer:\n # persona: agents/special/writer\n # env:\n # BRAND: acme\n # TONE: concise\n# Po Pi concatenates profile.md, SOUL.md, then AGENTS.md for the persona.\n# Select one with: po --profile writer\n`,\n};\n\n/** Standalone defaults for a repository that is trying Po through Po. */\nexport const REPOSITORY_PO_CONFIG_TEMPLATES: Readonly<Record<PoSeedFile, string>> = {\n 'config.yaml': PO_CONFIG_TEMPLATES['config.yaml'].replace(WEB_TEMPLATE_SEED, ''),\n 'modes.yaml': `# Repository-local layers and major modes. These entries override personal\n# entries with the same name from ~/.po/modes.yaml.\n# This repository-local default replaces the personal top-level default as one\n# whole package list. Edit it to customize the standalone package baseline.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - '@agimon-ai/po-goal'\n - '@agimon-ai/po-voice'\n - '@agimon-ai/po-runner'\n - '@agimon-ai/po-codemode'\n - '@agimon-ai/po-read'\n - '@agimon-ai/po-grep'\n - '@agimon-ai/po-edit'\n - '@agimon-ai/po-file-edit'\n - '@agimon-ai/po-autocompact'\n - '@agimon-ai/po-plan'\n - '@agimon-ai/po-author'\n - '@agimon-ai/po-computer-use'\n - '@agimon-ai/po-log'\n - '@agimon-ai/po-mcp'\n - '@agimon-ai/po-prompt'\n - '@agimon-ai/po-template-advanced'\n - '@agimon-ai/po-template-elegant'\n - '@agimon-ai/po-template-desktop'\n - '@agimon-ai/po-backdrop-meadow'\nlayers:\n # Durable scheduling. Keep this in the home default major mode.\n calendar:\n packages:\n - '@agimon-ai/po-calendar'\n # Workflow graphs, launch, recovery and the\n # workflow/dynamicWorkflow code-mode namespaces.\n # Remove 'workflow' from a mode to turn it off there.\n workflow:\n packages:\n - '@agimon-ai/po-workflow'\n coding:\n packages:\n - '@agimon-ai/po-vibe-lint'\n team:\n packages:\n - name: '@agimon-ai/po-team'\n ask-user:\n packages:\n - '@agimon-ai/po-user-feedback'\n task:\n packages:\n - '@agimon-ai/po-task'\n sandbox:\n packages:\n - '@agimon-ai/po-sandbox'\n design:\n packages:\n - '@agimon-ai/po-style-system'\n llm:\n packages:\n - '@agimon-ai/po-model-guidance'\n - '@agimon-ai/po-gateway'\n source-control:\n packages:\n - '@agimon-ai/po-git'\n image-gen:\n packages:\n - '@agimon-ai/po-image-gen'\n web-search:\n packages:\n - '@agimon-ai/po-web-search'\n browser:\n packages:\n - '@agimon-ai/po-browse'\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Lean mode with Team delegation and persistent tasks.\n layers: [team, task, llm, workflow, calendar]\n copilot:\n description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.\n layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]\n examples:\n description: Base mode for the repository's plugin and workflow examples.\n layers: [workflow]\n`,\n 'domains.yaml': `# Repository-local plugin catalog and domain selection.\ndefaultDomains: [default]\nplugins:\n roots: []\n entries: {}\ndomains:\n default:\n description: Shared skills and repository MCP only.\n plugins: []\naliases: {}\n`,\n 'profiles.yaml': `# Repository-local persona roots and environment defaults.\nprofiles:\n roots: []\n entries: {}\n`,\n};\n\n/** Result of filling a Po seed directory. File arrays contain names in seed order. */\nexport interface GlobalPoInitResult {\n directory: string;\n created: string[];\n preserved: string[];\n /** Existing files overwritten from the template. Only ever non-empty under `force`. */\n replaced: string[];\n}\n\nexport interface GlobalPoInitOptions {\n /**\n * Overwrite existing seed files instead of preserving them.\n *\n * Off by default: init is safe to re-run, and hand-edited config is the\n * normal case rather than the exception.\n */\n force?: boolean;\n}\n\nexport type RepositoryPoInitOptions = GlobalPoInitOptions;\nexport type RepositoryPoInitResult = GlobalPoInitResult;\n","import { randomUUID } from 'node:crypto';\n// sync: These helpers implement exported Node-only synchronous initialization APIs.\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport { globalPoConfigDirectory } from '../config';\nimport {\n PO_CONFIG_TEMPLATES,\n PO_DIRECTORY,\n GLOBAL_PO_SEED_FILES,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n REPOSITORY_FILE_MODE,\n type PoSeedFile,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\n\nconst UTF8_ENCODING = 'utf8';\nconst FILE_ALREADY_EXISTS = 'EEXIST';\nconst FILE_NOT_FOUND = 'ENOENT';\n\nfunction errorCode(error: unknown): string | undefined {\n if (!(error instanceof Error)) return undefined;\n const code = (error as NodeJS.ErrnoException).code;\n return typeof code === 'string' ? code : undefined;\n}\n\nfunction ensureDirectory(directory: string, mode: number): void {\n let stats: fs.Stats;\n try {\n stats = fs.lstatSync(directory);\n } catch (error) {\n if (errorCode(error) !== FILE_NOT_FOUND) throw error;\n try {\n fs.mkdirSync(directory, { mode });\n stats = fs.lstatSync(directory);\n } catch (mkdirError) {\n if (errorCode(mkdirError) !== FILE_ALREADY_EXISTS) throw mkdirError;\n stats = fs.lstatSync(directory);\n }\n }\n\n if (stats.isSymbolicLink()) {\n throw new Error(`Refusing to initialize through symlinked directory: ${directory}`);\n }\n if (!stats.isDirectory()) {\n throw new Error(`Po config path is not a directory: ${directory}`);\n }\n}\n\nfunction ensurePoDirectory(directory: string, mode: number): void {\n ensureDirectory(path.dirname(directory), mode);\n ensureDirectory(directory, mode);\n}\n\nfunction classifyTarget(targetPath: string): 'missing' | 'file' {\n let stats: fs.Stats;\n try {\n stats = fs.lstatSync(targetPath);\n } catch (error) {\n if (errorCode(error) === FILE_NOT_FOUND) return 'missing';\n throw error;\n }\n\n if (stats.isFile()) return 'file';\n if (stats.isSymbolicLink()) {\n try {\n if (fs.statSync(targetPath).isFile()) return 'file';\n } catch (error) {\n throw new Error(`Po config seed symlink is not file-like: ${targetPath}`, { cause: error });\n }\n }\n throw new Error(`Po config seed path is not file-like: ${targetPath}`);\n}\n\nfunction cleanupTemporaryFile(temporaryPath: string): void {\n try {\n fs.unlinkSync(temporaryPath);\n } catch (error) {\n if (errorCode(error) !== FILE_NOT_FOUND) throw error;\n }\n}\n\nfunction publishExclusively(targetPath: string, content: string, mode: number): boolean {\n const temporaryPath = `${targetPath}.${nodeHost.processId()}.${randomUUID()}.tmp`;\n let fileDescriptor: number | undefined;\n try {\n fileDescriptor = fs.openSync(temporaryPath, 'wx', mode);\n fs.writeFileSync(fileDescriptor, content, UTF8_ENCODING);\n fs.fchmodSync(fileDescriptor, mode);\n fs.fsyncSync(fileDescriptor);\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n\n try {\n fs.linkSync(temporaryPath, targetPath);\n return true;\n } catch (error) {\n if (errorCode(error) === FILE_ALREADY_EXISTS && classifyTarget(targetPath) === 'file') return false;\n throw error;\n }\n } finally {\n if (fileDescriptor !== undefined) {\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n }\n cleanupTemporaryFile(temporaryPath);\n }\n}\n\n/**\n * Replaces a seed file with the template, atomically.\n *\n * The rename swaps the directory entry in one step, so a reader either sees the\n * whole old file or the whole new one. Renaming onto a symlinked seed replaces\n * the link rather than writing through it.\n */\nfunction publishForcefully(targetPath: string, content: string, mode: number): void {\n const temporaryPath = `${targetPath}.${nodeHost.processId()}.${randomUUID()}.tmp`;\n let fileDescriptor: number | undefined;\n try {\n fileDescriptor = fs.openSync(temporaryPath, 'wx', mode);\n fs.writeFileSync(fileDescriptor, content, UTF8_ENCODING);\n fs.fchmodSync(fileDescriptor, mode);\n fs.fsyncSync(fileDescriptor);\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n\n fs.renameSync(temporaryPath, targetPath);\n } finally {\n if (fileDescriptor !== undefined) {\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n }\n cleanupTemporaryFile(temporaryPath);\n }\n}\n\nfunction initializePoConfig(\n directory: string,\n templates: Readonly<Record<PoSeedFile, string>>,\n options: GlobalPoInitOptions,\n directoryMode: number,\n fileMode: number,\n): GlobalPoInitResult {\n ensurePoDirectory(directory, directoryMode);\n\n const created: string[] = [];\n const preserved: string[] = [];\n const replaced: string[] = [];\n for (const fileName of GLOBAL_PO_SEED_FILES) {\n const targetPath = path.join(directory, fileName);\n const existed = classifyTarget(targetPath) === 'file';\n\n if (options.force) {\n publishForcefully(targetPath, templates[fileName], fileMode);\n (existed ? replaced : created).push(fileName);\n continue;\n }\n if (existed) {\n preserved.push(fileName);\n continue;\n }\n if (publishExclusively(targetPath, templates[fileName], fileMode)) created.push(fileName);\n else preserved.push(fileName);\n }\n\n return { directory, created, preserved, replaced };\n}\n\n/**\n * Fills missing global seed files.\n *\n * Existing files are left alone so that re-running init never discards\n * hand-edited config; pass `force` to overwrite them from the template. A new\n * file is published with an exclusive hard link, so a concurrent writer in\n * another process never loses its file to this one.\n *\n * @deprecated Node-only sync shim; use initializeGlobalPoConfigAsync. Removed in M2.\n */\nexport function initializeGlobalPoConfig(\n homeDirectory = nodeHost.homeDirectory(),\n options: GlobalPoInitOptions = {},\n): GlobalPoInitResult {\n return initializePoConfig(\n globalPoConfigDirectory(homeDirectory),\n PO_CONFIG_TEMPLATES,\n options,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n );\n}\n\n/**\n * Seeds repository-local configuration without creating or changing Pi settings.\n *\n * @deprecated Node-only sync shim; use initializeRepositoryPoConfigAsync. Removed in M2.\n */\nexport function initializeRepositoryPoConfig(\n repositoryRoot = process.cwd(),\n options: RepositoryPoInitOptions = {},\n): RepositoryPoInitResult {\n return initializePoConfig(\n path.join(path.resolve(repositoryRoot), PO_DIRECTORY),\n REPOSITORY_PO_CONFIG_TEMPLATES,\n options,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_FILE_MODE,\n );\n}\n","import path from 'node:path';\n\nimport {\n createSerialRunner,\n getOrThrow,\n nodeHost,\n writeFileAtomic,\n type FileSystem,\n} from '@agimon-ai/po-core/platform';\n\nimport { globalPoConfigDirectory } from '../config';\nimport {\n PO_CONFIG_TEMPLATES,\n PO_DIRECTORY,\n GLOBAL_PO_SEED_FILES,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n REPOSITORY_FILE_MODE,\n type PoSeedFile,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport {\n PO_CONFIG_TEMPLATES,\n GLOBAL_PO_SEED_FILES,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\nexport { initializeGlobalPoConfig, initializeRepositoryPoConfig } from './sync';\n\n/** Seed writes in this process are queued per file, so a check and its write are not interleaved. */\nconst seedWrites = createSerialRunner();\n\nasync function ensureDirectory(fs: FileSystem, directory: string, mode: number, context: IoContext): Promise<void> {\n let info = await fs.fileInfo(directory, context);\n if (!info.ok && info.error.code === 'not_found') {\n const created = await fs.createDir(directory, { recursive: false }, context);\n if (created.ok) await nodeHost.setMode(directory, mode);\n info = await fs.fileInfo(directory, context);\n }\n const kind = getOrThrow(info).kind;\n if (kind === 'symlink') throw new Error(`Refusing to initialize through symlinked directory: ${directory}`);\n if (kind !== 'directory') throw new Error(`Po config path is not a directory: ${directory}`);\n}\n\nasync function classifyTarget(fs: FileSystem, targetPath: string, context: IoContext): Promise<'missing' | 'file'> {\n const info = await fs.fileInfo(targetPath, context);\n if (!info.ok && info.error.code === 'not_found') return 'missing';\n const kind = getOrThrow(info).kind;\n if (kind === 'file') return 'file';\n if (kind === 'symlink') {\n try {\n const target = getOrThrow(await fs.canonicalPath(targetPath, context));\n if (getOrThrow(await fs.fileInfo(target, context)).kind === 'file') return 'file';\n } catch (error) {\n throw new Error(`Po config seed symlink is not file-like: ${targetPath}`, { cause: error });\n }\n }\n throw new Error(`Po config seed path is not file-like: ${targetPath}`);\n}\n\nasync function publish(fs: FileSystem, targetPath: string, content: string, mode: number, context: IoContext) {\n await writeFileAtomic(fs, targetPath, content, context);\n await nodeHost.setMode(targetPath, mode);\n}\n\n/**\n * Fills one seed directory over a FileSystem.\n *\n * Without `force`, a missing file is checked and written inside one queued step\n * per file. The FileSystem has no exclusive create, so a second process writing\n * the same new file at the same instant can be overwritten; the Node-only sync\n * shim keeps its hard-link publication for that case.\n */\nasync function initializePoConfig(\n fs: FileSystem,\n directory: string,\n templates: Readonly<Record<PoSeedFile, string>>,\n options: GlobalPoInitOptions,\n directoryMode: number,\n fileMode: number,\n context: IoContext,\n): Promise<GlobalPoInitResult> {\n await ensureDirectory(fs, path.dirname(directory), directoryMode, context);\n await ensureDirectory(fs, directory, directoryMode, context);\n\n const created: string[] = [];\n const preserved: string[] = [];\n const replaced: string[] = [];\n for (const fileName of GLOBAL_PO_SEED_FILES) {\n const targetPath = path.join(directory, fileName);\n await seedWrites.forKey(path.resolve(targetPath))(async () => {\n const existed = (await classifyTarget(fs, targetPath, context)) === 'file';\n if (existed && !options.force) {\n preserved.push(fileName);\n return;\n }\n await publish(fs, targetPath, templates[fileName], fileMode, context);\n (existed ? replaced : created).push(fileName);\n });\n }\n return { directory, created, preserved, replaced };\n}\n\n/**\n * Fills missing global seed files over a FileSystem.\n *\n * Existing files are left alone so that re-running init never discards\n * hand-edited config; pass `force` to overwrite them from the template.\n */\nexport function initializeGlobalPoConfigAsync(\n fs: FileSystem,\n context: IoContext,\n homeDirectory = nodeHost.homeDirectory(),\n options: GlobalPoInitOptions = {},\n): Promise<GlobalPoInitResult> {\n return initializePoConfig(\n fs,\n globalPoConfigDirectory(homeDirectory),\n PO_CONFIG_TEMPLATES,\n options,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n context,\n );\n}\n\n/** Seeds repository-local configuration over a FileSystem without creating or changing Pi settings. */\nexport function initializeRepositoryPoConfigAsync(\n fs: FileSystem,\n repositoryRoot: string,\n context: IoContext,\n options: RepositoryPoInitOptions = {},\n): Promise<RepositoryPoInitResult> {\n return initializePoConfig(\n fs,\n path.join(path.resolve(repositoryRoot), PO_DIRECTORY),\n REPOSITORY_PO_CONFIG_TEMPLATES,\n options,\n REPOSITORY_DIRECTOR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ACA,gBAAgB,SAAS,cAAc,GACvC,UAA+B,CAAC,GACH;CAC7B,OAAO,mBACL,IACA,wBAAwB,aAAa,GACrC,qBACA,SAAA,KAAA,KAGA,OACF;AACF;;AAGA,SAAgB,kCACd,IACA,gBACA,SACA,UAAmC,CAAC,GACH;CACjC,OAAO,mBACL,IACA,KAAK,KAAK,KAAK,QAAQ,cAAc,GAAA,KAAe,GACpD,gCACA,SAAA,KAAA,KAGA,OACF;AACF"}
1
+ {"version":3,"file":"init-lw06fOB4.mjs","names":["ensureDirectory","classifyTarget","initializePoConfig"],"sources":["../src/services/init/templates.ts","../src/services/init/sync.ts","../src/services/init/index.ts"],"sourcesContent":["export const PRIVATE_DIRECTORY_MODE = 0o700;\nexport const PRIVATE_FILE_MODE = 0o600;\nexport const REPOSITORY_DIRECTORY_MODE = 0o755;\nexport const REPOSITORY_FILE_MODE = 0o644;\nexport const PO_DIRECTORY = '.po';\n\n/** The global seed files are processed in this fixed order. */\nexport const GLOBAL_PO_SEED_FILES = ['config.yaml', 'modes.yaml', 'domains.yaml', 'profiles.yaml'] as const;\n\nexport type PoSeedFile = (typeof GLOBAL_PO_SEED_FILES)[number];\n\n/** Personal-only: a repository pin would override the layout the person picks during onboarding. */\nconst WEB_TEMPLATE_SEED = `# Default web layout, resolved against the installed web template packages.\nweb:\n template: po-template-elegant\n\n`;\n\n/** Portable defaults for a new global Po configuration directory. */\nexport const PO_CONFIG_TEMPLATES: Readonly<Record<PoSeedFile, string>> = {\n 'config.yaml': `projectTrust: ask\n\n${WEB_TEMPLATE_SEED}\n# Workspace declarations belong in the repository's .po/workspaces.yaml, not this personal file.\n# Entries accept name, path (default .), alias, instructions and free-form metadata.\n# Autonomous voice is opt-in and uses an explicitly configured Pi model.\n# voice:\n# autoCapture:\n# model: provider/model-id\n# startPhrases:\n# - hey po\n# stopPhrases:\n# - stop speaking\n# utteranceIdleMs: 3000\n# # Long prompts only: open a draft, keep talking, then send it in one piece.\n# # Short utterances are delivered as you finish them and need no phrase.\n# composeOpenPhrases:\n# - hey po\n# composeSendPhrases:\n# - that's it\n# composeCancelPhrases:\n# - scratch that\n# # Endpoint window while a draft collects, so a short command lands on its own.\n# composeUtteranceIdleMs: 1200\n# # Silence before Voice reminds you a draft is open. 0 turns the reminder off.\n# composeNudgeMs: 10000\n# tts:\n# engine: macos-say\n# voice: Samantha\n# rate: 190\n`,\n 'modes.yaml': `# A layer is a reusable named bundle of packages, built-in or local extensions,\n# and hook groups. Major modes below choose which layers load together for a session.\n#\n# Layers and modes defined here apply to every repository. A repository's own\n# .po/modes.yaml is read after this file and replaces any layer or mode of the\n# same name, so a repository can override one entry without restating the rest.\n#\n# Add a layer by giving it a unique name under layers. Local Pi scripts belong\n# under extensions, while installed Pi packages belong under packages:\n# review-tools:\n# extensions:\n# - './extensions/local-review.ts'\n# packages:\n# - '@scope/review-extension'\n# A bare extension name selects a Po built-in. A path beginning with ./ or\n# ../ loads a custom script or extension directory. A bare package loads its\n# ordered package.json pi.extensions entries, while an exported subpath selects\n# one adapter. Relative paths resolve beside this file here (~/.po), or\n# from the repository root in .po/modes.yaml.\n#\n# Use a package mapping when that package accepts configuration. Configuration\n# belongs under the package entry that consumes it, not beside packages.\n# The top-level default bundle loads before every major mode. Replace this whole\n# packages list to customize the distribution defaults. Po core packages\n# remain active independently of this list.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - '@agimon-ai/po-goal'\n - '@agimon-ai/po-voice'\n - '@agimon-ai/po-runner'\n - '@agimon-ai/po-codemode'\n - '@agimon-ai/po-read'\n - '@agimon-ai/po-grep'\n - '@agimon-ai/po-edit'\n - '@agimon-ai/po-file-edit'\n - '@agimon-ai/po-autocompact'\n - '@agimon-ai/po-plan'\n - '@agimon-ai/po-author'\n - '@agimon-ai/po-computer-use'\n - '@agimon-ai/po-log'\n - '@agimon-ai/po-mcp'\n - '@agimon-ai/po-prompt'\n - '@agimon-ai/po-template-advanced'\n - '@agimon-ai/po-template-elegant'\n - '@agimon-ai/po-template-desktop'\n - '@agimon-ai/po-backdrop-bamboo'\nlayers:\n # Durable scheduling. Keep this in the home default major mode.\n calendar:\n packages:\n - '@agimon-ai/po-calendar'\n # Workflow graphs, launch, recovery and the\n # workflow/dynamicWorkflow code-mode namespaces.\n # Remove 'workflow' from a mode to turn it off there.\n workflow:\n packages:\n - '@agimon-ai/po-workflow'\n coding:\n packages:\n - '@agimon-ai/po-vibe-lint'\n team:\n packages:\n - name: '@agimon-ai/po-team'\n # Optional Team configuration. Uncomment and choose models available to Pi.\n # config:\n # models:\n # - model: openai-codex/gpt-5.6-luna\n # thinking: xhigh\n # # Tool names excluded from subagents launched by this package. These\n # # remove model-visible tools while preserving hidden team transport.\n # excludeTools: [ask_user_question, intercom, subagent]\n ask-user:\n packages:\n - '@agimon-ai/po-user-feedback'\n task:\n packages:\n - '@agimon-ai/po-task'\n sandbox:\n packages:\n - '@agimon-ai/po-sandbox'\n design:\n packages:\n - '@agimon-ai/po-style-system'\n llm:\n packages:\n - '@agimon-ai/po-model-guidance'\n - '@agimon-ai/po-gateway'\n source-control:\n packages:\n - '@agimon-ai/po-git'\n image-gen:\n packages:\n - '@agimon-ai/po-image-gen'\n web-search:\n packages:\n - '@agimon-ai/po-web-search'\n browser:\n packages:\n - '@agimon-ai/po-browse'\n# A major mode explains when it should be used and names its ordered layers.\n# Add another entry under majorMode, then select it with\n# po --major-mode <name>. Change defaultMajorMode to make it the default.\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Lean mode with Team delegation and persistent tasks.\n layers: [team, task, llm, workflow, calendar]\n copilot:\n description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.\n layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]\n assistant:\n description: Everyday assistant with delegation, tasks, web research, browsing and calendar.\n layers: [team, ask-user, task, llm, web-search, browser, calendar, workflow]\n marketing:\n description: Marketing work with research, browsing and image generation.\n layers: [team, ask-user, task, llm, web-search, browser, image-gen, calendar, workflow]\n examples:\n description: Base mode for the repository's plugin and workflow examples.\n layers: [workflow]\n # review:\n # description: Focused review mode for inspecting changes and reporting risks.\n # layers: [team, task, ask-user]\n`,\n 'domains.yaml': `# Plugins are named once in this catalog, then selected by one or more domains.\n# Po automatically inspects personal and repository Codex marketplaces.\n# Each configured root may also be a folder whose direct children are plugins;\n# use roots: [plugins] to discover a repository plugin folder without one entry\n# per plugin. Discovery never scans recursively.\ndefaultDomains: [default]\nplugins:\n roots: []\n entries: {}\n # Local paths resolve beside this file in ~/.po. Repository paths in a\n # repository .po/domains.yaml resolve from that repository root.\n # entries:\n # development:\n # source: local\n # path: plugins/development\n # remote-review:\n # source: url\n # url: https://github.com/acme/review-plugin.git\n # ref: v1.2.0\n # published-review:\n # source: npm\n # package: '@acme/review-plugin'\n # version: 1.2.0\n# Domains carry descriptions and refer to catalog names, not filesystem paths.\ndomains:\n default:\n description: Shared skills and repository MCP only.\n plugins: []\n # development:\n # description: TypeScript implementation and review tools.\n # plugins:\n # - development\n # # Mapping form can load only selected resources from a shared plugin.\n # - name: remote-review\n # skills: [typescript]\n # agents: [reviewer]\n # hooks: false\n # mcp: true\n # # Set false only when this domain should omit shared .claude/skills.\n # sharedSkills: false\n # # Domain mcp is an allowlist over servers configured elsewhere, not a\n # # request to start new ones. Listing servers here drops the tool schemas\n # # of the ones left out, usually the largest context saving a domain can\n # # make. Run po --explain to see the token cost before and after.\n # # Filtering applies only when every selected domain declares mcp, so a\n # # selection mixing this with a domain that omits it stays unfiltered.\n # mcp:\n # servers: [code-intel]\n # proxy: [repository-search]\n# Select it with po --domains development, or add it to defaultDomains.\n#\n# Aliases let one selection enable multiple domains. Replace the empty mapping\n# below with entries like the commented example.\naliases: {}\n# aliases:\n# work: [default, development]\n`,\n 'profiles.yaml': `# Profiles select a persona and optional environment defaults for a session.\n# Each configured root may itself be a profile or contain direct-child profile\n# folders. A folder is discovered when it contains profile.md, SOUL.md, or\n# AGENTS.md; discovery never scans recursively.\nprofiles:\n roots: []\n entries: {}\n # Roots resolve beside this file in ~/.po. Repository roots in a\n # repository .po/profiles.yaml resolve from that repository root.\n # roots: [agents/acme]\n # Explicit entries override an automatically discovered folder of the same\n # name. Environment values must be strings; already exported values win.\n # entries:\n # writer:\n # persona: agents/special/writer\n # env:\n # BRAND: acme\n # TONE: concise\n# Po Pi concatenates profile.md, SOUL.md, then AGENTS.md for the persona.\n# Select one with: po --profile writer\n`,\n};\n\n/** Standalone defaults for a repository that is trying Po through Po. */\nexport const REPOSITORY_PO_CONFIG_TEMPLATES: Readonly<Record<PoSeedFile, string>> = {\n 'config.yaml': PO_CONFIG_TEMPLATES['config.yaml'].replace(WEB_TEMPLATE_SEED, ''),\n 'modes.yaml': `# Repository-local layers and major modes. These entries override personal\n# entries with the same name from ~/.po/modes.yaml.\n# This repository-local default replaces the personal top-level default as one\n# whole package list. Edit it to customize the standalone package baseline.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - '@agimon-ai/po-goal'\n - '@agimon-ai/po-voice'\n - '@agimon-ai/po-runner'\n - '@agimon-ai/po-codemode'\n - '@agimon-ai/po-read'\n - '@agimon-ai/po-grep'\n - '@agimon-ai/po-edit'\n - '@agimon-ai/po-file-edit'\n - '@agimon-ai/po-autocompact'\n - '@agimon-ai/po-plan'\n - '@agimon-ai/po-author'\n - '@agimon-ai/po-computer-use'\n - '@agimon-ai/po-log'\n - '@agimon-ai/po-mcp'\n - '@agimon-ai/po-prompt'\n - '@agimon-ai/po-template-advanced'\n - '@agimon-ai/po-template-elegant'\n - '@agimon-ai/po-template-desktop'\n - '@agimon-ai/po-backdrop-bamboo'\nlayers:\n # Durable scheduling. Keep this in the home default major mode.\n calendar:\n packages:\n - '@agimon-ai/po-calendar'\n # Workflow graphs, launch, recovery and the\n # workflow/dynamicWorkflow code-mode namespaces.\n # Remove 'workflow' from a mode to turn it off there.\n workflow:\n packages:\n - '@agimon-ai/po-workflow'\n coding:\n packages:\n - '@agimon-ai/po-vibe-lint'\n team:\n packages:\n - name: '@agimon-ai/po-team'\n ask-user:\n packages:\n - '@agimon-ai/po-user-feedback'\n task:\n packages:\n - '@agimon-ai/po-task'\n sandbox:\n packages:\n - '@agimon-ai/po-sandbox'\n design:\n packages:\n - '@agimon-ai/po-style-system'\n llm:\n packages:\n - '@agimon-ai/po-model-guidance'\n - '@agimon-ai/po-gateway'\n source-control:\n packages:\n - '@agimon-ai/po-git'\n image-gen:\n packages:\n - '@agimon-ai/po-image-gen'\n web-search:\n packages:\n - '@agimon-ai/po-web-search'\n browser:\n packages:\n - '@agimon-ai/po-browse'\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Lean mode with Team delegation and persistent tasks.\n layers: [team, task, llm, workflow, calendar]\n copilot:\n description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.\n layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]\n examples:\n description: Base mode for the repository's plugin and workflow examples.\n layers: [workflow]\n`,\n 'domains.yaml': `# Repository-local plugin catalog and domain selection.\ndefaultDomains: [default]\nplugins:\n roots: []\n entries: {}\ndomains:\n default:\n description: Shared skills and repository MCP only.\n plugins: []\naliases: {}\n`,\n 'profiles.yaml': `# Repository-local persona roots and environment defaults.\nprofiles:\n roots: []\n entries: {}\n`,\n};\n\n/** Result of filling a Po seed directory. File arrays contain names in seed order. */\nexport interface GlobalPoInitResult {\n directory: string;\n created: string[];\n preserved: string[];\n /** Existing files overwritten from the template. Only ever non-empty under `force`. */\n replaced: string[];\n}\n\nexport interface GlobalPoInitOptions {\n /**\n * Overwrite existing seed files instead of preserving them.\n *\n * Off by default: init is safe to re-run, and hand-edited config is the\n * normal case rather than the exception.\n */\n force?: boolean;\n}\n\nexport type RepositoryPoInitOptions = GlobalPoInitOptions;\nexport type RepositoryPoInitResult = GlobalPoInitResult;\n","import { randomUUID } from 'node:crypto';\n// sync: These helpers implement exported Node-only synchronous initialization APIs.\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport { globalPoConfigDirectory } from '../config';\nimport {\n PO_CONFIG_TEMPLATES,\n PO_DIRECTORY,\n GLOBAL_PO_SEED_FILES,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n REPOSITORY_FILE_MODE,\n type PoSeedFile,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\n\nconst UTF8_ENCODING = 'utf8';\nconst FILE_ALREADY_EXISTS = 'EEXIST';\nconst FILE_NOT_FOUND = 'ENOENT';\n\nfunction errorCode(error: unknown): string | undefined {\n if (!(error instanceof Error)) return undefined;\n const code = (error as NodeJS.ErrnoException).code;\n return typeof code === 'string' ? code : undefined;\n}\n\nfunction ensureDirectory(directory: string, mode: number): void {\n let stats: fs.Stats;\n try {\n stats = fs.lstatSync(directory);\n } catch (error) {\n if (errorCode(error) !== FILE_NOT_FOUND) throw error;\n try {\n fs.mkdirSync(directory, { mode });\n stats = fs.lstatSync(directory);\n } catch (mkdirError) {\n if (errorCode(mkdirError) !== FILE_ALREADY_EXISTS) throw mkdirError;\n stats = fs.lstatSync(directory);\n }\n }\n\n if (stats.isSymbolicLink()) {\n throw new Error(`Refusing to initialize through symlinked directory: ${directory}`);\n }\n if (!stats.isDirectory()) {\n throw new Error(`Po config path is not a directory: ${directory}`);\n }\n}\n\nfunction ensurePoDirectory(directory: string, mode: number): void {\n ensureDirectory(path.dirname(directory), mode);\n ensureDirectory(directory, mode);\n}\n\nfunction classifyTarget(targetPath: string): 'missing' | 'file' {\n let stats: fs.Stats;\n try {\n stats = fs.lstatSync(targetPath);\n } catch (error) {\n if (errorCode(error) === FILE_NOT_FOUND) return 'missing';\n throw error;\n }\n\n if (stats.isFile()) return 'file';\n if (stats.isSymbolicLink()) {\n try {\n if (fs.statSync(targetPath).isFile()) return 'file';\n } catch (error) {\n throw new Error(`Po config seed symlink is not file-like: ${targetPath}`, { cause: error });\n }\n }\n throw new Error(`Po config seed path is not file-like: ${targetPath}`);\n}\n\nfunction cleanupTemporaryFile(temporaryPath: string): void {\n try {\n fs.unlinkSync(temporaryPath);\n } catch (error) {\n if (errorCode(error) !== FILE_NOT_FOUND) throw error;\n }\n}\n\nfunction publishExclusively(targetPath: string, content: string, mode: number): boolean {\n const temporaryPath = `${targetPath}.${nodeHost.processId()}.${randomUUID()}.tmp`;\n let fileDescriptor: number | undefined;\n try {\n fileDescriptor = fs.openSync(temporaryPath, 'wx', mode);\n fs.writeFileSync(fileDescriptor, content, UTF8_ENCODING);\n fs.fchmodSync(fileDescriptor, mode);\n fs.fsyncSync(fileDescriptor);\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n\n try {\n fs.linkSync(temporaryPath, targetPath);\n return true;\n } catch (error) {\n if (errorCode(error) === FILE_ALREADY_EXISTS && classifyTarget(targetPath) === 'file') return false;\n throw error;\n }\n } finally {\n if (fileDescriptor !== undefined) {\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n }\n cleanupTemporaryFile(temporaryPath);\n }\n}\n\n/**\n * Replaces a seed file with the template, atomically.\n *\n * The rename swaps the directory entry in one step, so a reader either sees the\n * whole old file or the whole new one. Renaming onto a symlinked seed replaces\n * the link rather than writing through it.\n */\nfunction publishForcefully(targetPath: string, content: string, mode: number): void {\n const temporaryPath = `${targetPath}.${nodeHost.processId()}.${randomUUID()}.tmp`;\n let fileDescriptor: number | undefined;\n try {\n fileDescriptor = fs.openSync(temporaryPath, 'wx', mode);\n fs.writeFileSync(fileDescriptor, content, UTF8_ENCODING);\n fs.fchmodSync(fileDescriptor, mode);\n fs.fsyncSync(fileDescriptor);\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n\n fs.renameSync(temporaryPath, targetPath);\n } finally {\n if (fileDescriptor !== undefined) {\n const descriptorToClose = fileDescriptor;\n fileDescriptor = undefined;\n fs.closeSync(descriptorToClose);\n }\n cleanupTemporaryFile(temporaryPath);\n }\n}\n\nfunction initializePoConfig(\n directory: string,\n templates: Readonly<Record<PoSeedFile, string>>,\n options: GlobalPoInitOptions,\n directoryMode: number,\n fileMode: number,\n): GlobalPoInitResult {\n ensurePoDirectory(directory, directoryMode);\n\n const created: string[] = [];\n const preserved: string[] = [];\n const replaced: string[] = [];\n for (const fileName of GLOBAL_PO_SEED_FILES) {\n const targetPath = path.join(directory, fileName);\n const existed = classifyTarget(targetPath) === 'file';\n\n if (options.force) {\n publishForcefully(targetPath, templates[fileName], fileMode);\n (existed ? replaced : created).push(fileName);\n continue;\n }\n if (existed) {\n preserved.push(fileName);\n continue;\n }\n if (publishExclusively(targetPath, templates[fileName], fileMode)) created.push(fileName);\n else preserved.push(fileName);\n }\n\n return { directory, created, preserved, replaced };\n}\n\n/**\n * Fills missing global seed files.\n *\n * Existing files are left alone so that re-running init never discards\n * hand-edited config; pass `force` to overwrite them from the template. A new\n * file is published with an exclusive hard link, so a concurrent writer in\n * another process never loses its file to this one.\n *\n * @deprecated Node-only sync shim; use initializeGlobalPoConfigAsync. Removed in M2.\n */\nexport function initializeGlobalPoConfig(\n homeDirectory = nodeHost.homeDirectory(),\n options: GlobalPoInitOptions = {},\n): GlobalPoInitResult {\n return initializePoConfig(\n globalPoConfigDirectory(homeDirectory),\n PO_CONFIG_TEMPLATES,\n options,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n );\n}\n\n/**\n * Seeds repository-local configuration without creating or changing Pi settings.\n *\n * @deprecated Node-only sync shim; use initializeRepositoryPoConfigAsync. Removed in M2.\n */\nexport function initializeRepositoryPoConfig(\n repositoryRoot = process.cwd(),\n options: RepositoryPoInitOptions = {},\n): RepositoryPoInitResult {\n return initializePoConfig(\n path.join(path.resolve(repositoryRoot), PO_DIRECTORY),\n REPOSITORY_PO_CONFIG_TEMPLATES,\n options,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_FILE_MODE,\n );\n}\n","import path from 'node:path';\n\nimport {\n createSerialRunner,\n getOrThrow,\n nodeHost,\n writeFileAtomic,\n type FileSystem,\n} from '@agimon-ai/po-core/platform';\n\nimport { globalPoConfigDirectory } from '../config';\nimport {\n PO_CONFIG_TEMPLATES,\n PO_DIRECTORY,\n GLOBAL_PO_SEED_FILES,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n REPOSITORY_FILE_MODE,\n type PoSeedFile,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport {\n PO_CONFIG_TEMPLATES,\n GLOBAL_PO_SEED_FILES,\n REPOSITORY_PO_CONFIG_TEMPLATES,\n type GlobalPoInitOptions,\n type GlobalPoInitResult,\n type RepositoryPoInitOptions,\n type RepositoryPoInitResult,\n} from './templates';\nexport { initializeGlobalPoConfig, initializeRepositoryPoConfig } from './sync';\n\n/** Seed writes in this process are queued per file, so a check and its write are not interleaved. */\nconst seedWrites = createSerialRunner();\n\nasync function ensureDirectory(fs: FileSystem, directory: string, mode: number, context: IoContext): Promise<void> {\n let info = await fs.fileInfo(directory, context);\n if (!info.ok && info.error.code === 'not_found') {\n const created = await fs.createDir(directory, { recursive: false }, context);\n if (created.ok) await nodeHost.setMode(directory, mode);\n info = await fs.fileInfo(directory, context);\n }\n const kind = getOrThrow(info).kind;\n if (kind === 'symlink') throw new Error(`Refusing to initialize through symlinked directory: ${directory}`);\n if (kind !== 'directory') throw new Error(`Po config path is not a directory: ${directory}`);\n}\n\nasync function classifyTarget(fs: FileSystem, targetPath: string, context: IoContext): Promise<'missing' | 'file'> {\n const info = await fs.fileInfo(targetPath, context);\n if (!info.ok && info.error.code === 'not_found') return 'missing';\n const kind = getOrThrow(info).kind;\n if (kind === 'file') return 'file';\n if (kind === 'symlink') {\n try {\n const target = getOrThrow(await fs.canonicalPath(targetPath, context));\n if (getOrThrow(await fs.fileInfo(target, context)).kind === 'file') return 'file';\n } catch (error) {\n throw new Error(`Po config seed symlink is not file-like: ${targetPath}`, { cause: error });\n }\n }\n throw new Error(`Po config seed path is not file-like: ${targetPath}`);\n}\n\nasync function publish(fs: FileSystem, targetPath: string, content: string, mode: number, context: IoContext) {\n await writeFileAtomic(fs, targetPath, content, context);\n await nodeHost.setMode(targetPath, mode);\n}\n\n/**\n * Fills one seed directory over a FileSystem.\n *\n * Without `force`, a missing file is checked and written inside one queued step\n * per file. The FileSystem has no exclusive create, so a second process writing\n * the same new file at the same instant can be overwritten; the Node-only sync\n * shim keeps its hard-link publication for that case.\n */\nasync function initializePoConfig(\n fs: FileSystem,\n directory: string,\n templates: Readonly<Record<PoSeedFile, string>>,\n options: GlobalPoInitOptions,\n directoryMode: number,\n fileMode: number,\n context: IoContext,\n): Promise<GlobalPoInitResult> {\n await ensureDirectory(fs, path.dirname(directory), directoryMode, context);\n await ensureDirectory(fs, directory, directoryMode, context);\n\n const created: string[] = [];\n const preserved: string[] = [];\n const replaced: string[] = [];\n for (const fileName of GLOBAL_PO_SEED_FILES) {\n const targetPath = path.join(directory, fileName);\n await seedWrites.forKey(path.resolve(targetPath))(async () => {\n const existed = (await classifyTarget(fs, targetPath, context)) === 'file';\n if (existed && !options.force) {\n preserved.push(fileName);\n return;\n }\n await publish(fs, targetPath, templates[fileName], fileMode, context);\n (existed ? replaced : created).push(fileName);\n });\n }\n return { directory, created, preserved, replaced };\n}\n\n/**\n * Fills missing global seed files over a FileSystem.\n *\n * Existing files are left alone so that re-running init never discards\n * hand-edited config; pass `force` to overwrite them from the template.\n */\nexport function initializeGlobalPoConfigAsync(\n fs: FileSystem,\n context: IoContext,\n homeDirectory = nodeHost.homeDirectory(),\n options: GlobalPoInitOptions = {},\n): Promise<GlobalPoInitResult> {\n return initializePoConfig(\n fs,\n globalPoConfigDirectory(homeDirectory),\n PO_CONFIG_TEMPLATES,\n options,\n PRIVATE_DIRECTORY_MODE,\n PRIVATE_FILE_MODE,\n context,\n );\n}\n\n/** Seeds repository-local configuration over a FileSystem without creating or changing Pi settings. */\nexport function initializeRepositoryPoConfigAsync(\n fs: FileSystem,\n repositoryRoot: string,\n context: IoContext,\n options: RepositoryPoInitOptions = {},\n): Promise<RepositoryPoInitResult> {\n return initializePoConfig(\n fs,\n path.join(path.resolve(repositoryRoot), PO_DIRECTORY),\n REPOSITORY_PO_CONFIG_TEMPLATES,\n options,\n REPOSITORY_DIRECTORY_MODE,\n REPOSITORY_FILE_MODE,\n context,\n );\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,uBAAuB;CAAC;CAAe;CAAc;CAAgB;AAAe;;AAKjG,MAAM,oBAAoB;;;;;;AAO1B,MAAa,sBAA4D;CACvE,eAAe;;EAEf,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Hd,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDhB,iBAAiB;;;;;;;;;;;;;;;;;;;;;AAqBnB;;AAGA,MAAa,iCAAuE;CAClF,eAAe,oBAAoB,cAAc,CAAC,QAAQ,mBAAmB,EAAE;CAC/E,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmFd,gBAAgB;;;;;;;;;;;CAWhB,iBAAiB;;;;;AAKnB;;;AC7UA,MAAM,gBAAg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sB;EAC3C,MAAM,aAAa,KAAK,KAAK,WAAW,QAAQ;EAChD,MAAM,WAAW,OAAO,KAAK,QAAQ,UAAU,CAAC,CAAC,CAAC,YAAY;GAC5D,MAAM,UAAW,MAAM,eAAe,IAAI,YAAY,OAAO,MAAO;GACpE,IAAI,WAAW,CAAC,QAAQ,OAAO;IAC7B,UAAU,KAAK,QAAQ;IACvB;GACF;GACA,MAAM,QAAQ,IAAI,YAAY,UAAU,WAAW,UAAU,OAAO;GACpE,CAAC,UAAU,WAAW,QAAA,CAAS,KAAK,QAAQ;EAC9C,CAAC;CACH;CACA,OAAO;EAAE;EAAW;EAAS;EAAW;CAAS;AACnD;;;;;;;AAQA,SAAgB,8BACd,IACA,SACA,gBAAgB,SAAS,cAAc,GACvC,UAA+B,CAAC,GACH;CAC7B,OAAO,mBACL,IACA,wBAAwB,aAAa,GACrC,qBACA,SAAA,KAAA,KAGA,OACF;AACF;;AAGA,SAAgB,kCACd,IACA,gBACA,SACA,UAAmC,CAAC,GACH;CACjC,OAAO,mBACL,IACA,KAAK,KAAK,KAAK,QAAQ,cAAc,GAAA,KAAe,GACpD,gCACA,SAAA,KAAA,KAGA,OACF;AACF"}
package/dist/init.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_init = require("./init-MwgLrvYK.cjs");
2
+ const require_init = require("./init-B9tCCwA3.cjs");
3
3
  exports.GLOBAL_PO_SEED_FILES = require_init.GLOBAL_PO_SEED_FILES;
4
4
  exports.PO_CONFIG_TEMPLATES = require_init.PO_CONFIG_TEMPLATES;
5
5
  exports.REPOSITORY_PO_CONFIG_TEMPLATES = require_init.REPOSITORY_PO_CONFIG_TEMPLATES;
package/dist/init.mjs CHANGED
@@ -1 +1 @@
1
- export { a as GLOBAL_PO_SEED_FILES, o as PO_CONFIG_TEMPLATES, s as REPOSITORY_PO_CONFIG_TEMPLATES, r as initializeGlobalPoConfig, t as initializeGlobalPoConfigAsync, i as initializeRepositoryPoConfig, n as initializeRepositoryPoConfigAsync } from "./init-DLNiuso4.mjs";
1
+ export { a as GLOBAL_PO_SEED_FILES, o as PO_CONFIG_TEMPLATES, s as REPOSITORY_PO_CONFIG_TEMPLATES, r as initializeGlobalPoConfig, t as initializeGlobalPoConfigAsync, i as initializeRepositoryPoConfig, n as initializeRepositoryPoConfigAsync } from "./init-lw06fOB4.mjs";
@@ -1,2 +1,2 @@
1
- import { _ as layerEntries, a as loadMajorModesConfig, c as LayerPackage, d as MajorModeDefinition, f as MajorModesConfig, g as isLocalPackageSpecifier, h as ResolvedPackageConfiguration, i as readPackageConfigurations, l as LayerPackageConfig, m as ResolvedLayerDefinition, n as readMajorModesConfig, o as loadMajorModesConfigLenient, p as PackageNameResolver, r as readMajorModesConfigLenient, s as LayerDefinition, t as ReadMajorModesConfigOptions, u as LayerResolvers, v as resolveLayers, y as resolvePackageConfigurations } from "./index-DNEkm_mv.mjs";
1
+ import { _ as layerEntries, a as loadMajorModesConfig, c as LayerPackage, d as MajorModeDefinition, f as MajorModesConfig, g as isLocalPackageSpecifier, h as ResolvedPackageConfiguration, i as readPackageConfigurations, l as LayerPackageConfig, m as ResolvedLayerDefinition, n as readMajorModesConfig, o as loadMajorModesConfigLenient, p as PackageNameResolver, r as readMajorModesConfigLenient, s as LayerDefinition, t as ReadMajorModesConfigOptions, u as LayerResolvers, v as resolveLayers, y as resolvePackageConfigurations } from "./index-DeP6F4Rv.mjs";
2
2
  export { type LayerDefinition, type LayerPackage, type LayerPackageConfig, type LayerResolvers, type MajorModeDefinition, type MajorModesConfig, type PackageNameResolver, type ReadMajorModesConfigOptions, type ResolvedLayerDefinition, type ResolvedPackageConfiguration, isLocalPackageSpecifier, layerEntries, loadMajorModesConfig, loadMajorModesConfigLenient, readMajorModesConfig, readMajorModesConfigLenient, readPackageConfigurations, resolveLayers, resolvePackageConfigurations };
@@ -1,3 +1,3 @@
1
- import { D as PoConfigTransitionRecord, E as PoConfigTransitionPhase, O as PoConfigTransitionStrategy, w as PoConfigPendingSelection } from "./config-Cg7egyk2.mjs";
2
- import { _ as supersedePoConfigTransition, a as appendPoConfigSelection, c as createPoConfigContextAsync, d as providePoConfigContext, f as readPoConfigContextGeneration, g as requirePoConfigContext, h as replacePoConfigContext, i as acknowledgePoConfigTransition, l as freezePoConfigContext, m as readPoConfigSelection, n as PO_CONFIG_TRANSITION_ENTRY_TYPE, o as appendPoConfigTransition, p as readPoConfigPendingSelection, r as PoConfigSelection, s as createPoConfigContext, t as PO_CONFIG_ENTRY_TYPE, u as persistHarnessSelection } from "./index-kKiK2G4M.mjs";
1
+ import { D as PoConfigTransitionRecord, E as PoConfigTransitionPhase, O as PoConfigTransitionStrategy, w as PoConfigPendingSelection } from "./config-CVYzn7z_.mjs";
2
+ import { _ as supersedePoConfigTransition, a as appendPoConfigSelection, c as createPoConfigContextAsync, d as providePoConfigContext, f as readPoConfigContextGeneration, g as requirePoConfigContext, h as replacePoConfigContext, i as acknowledgePoConfigTransition, l as freezePoConfigContext, m as readPoConfigSelection, n as PO_CONFIG_TRANSITION_ENTRY_TYPE, o as appendPoConfigTransition, p as readPoConfigPendingSelection, r as PoConfigSelection, s as createPoConfigContext, t as PO_CONFIG_ENTRY_TYPE, u as persistHarnessSelection } from "./index-Dm0JKpCH.mjs";
3
3
  export { PO_CONFIG_ENTRY_TYPE, PO_CONFIG_TRANSITION_ENTRY_TYPE, type PoConfigPendingSelection, type PoConfigSelection, type PoConfigTransitionPhase, type PoConfigTransitionRecord, type PoConfigTransitionStrategy, acknowledgePoConfigTransition, appendPoConfigSelection, appendPoConfigTransition, createPoConfigContext, createPoConfigContextAsync, freezePoConfigContext, persistHarnessSelection, providePoConfigContext, readPoConfigContextGeneration, readPoConfigPendingSelection, readPoConfigSelection, replacePoConfigContext, requirePoConfigContext, supersedePoConfigTransition };
@@ -1,5 +1,5 @@
1
- import { k as PoHarnessContext, u as HarnessState } from "./config-Cg7egyk2.mjs";
2
- import { f as MajorModesConfig } from "./index-DNEkm_mv.mjs";
1
+ import { k as PoHarnessContext, u as HarnessState } from "./config-CVYzn7z_.mjs";
2
+ import { f as MajorModesConfig } from "./index-DeP6F4Rv.mjs";
3
3
  import { u as AgentProfile } from "./index-BmY30wlf.mjs";
4
4
  import { FileSystem } from "@agimon-ai/po-core/platform";
5
5
  //#region src/services/selectionSwitch/sync.d.ts
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as PoSelectionConfig, B as VoiceTtsConfig, C as PoConfigLayers, D as PoConfigTransitionRecord, E as PoConfigTransitionPhase, F as VoiceAutoCaptureConfig, H as WorkspaceDeclaration, I as VoiceConfig, L as VoiceEngine, M as ResolvedVoiceAutoCaptureConfig, N as ResolvedVoiceConfig, O as PoConfigTransitionStrategy, P as VoiceAdapterConfig, R as VoiceMode, S as PoConfigLayer, T as PoConfigSelection, V as VoiceTtsEngine, _ as PlanningAgentConfig, a as ConfigDiagnostic, b as PoConfig, d as IPoConfigLoader, f as IPoConfigService, g as PackageAttribution, h as PO_CONFIG_SERVICE, i as AutocompactTokenConfig, j as ProjectTrust, k as PoHarnessContext, l as EditorConfig, m as LenientParseResult, n as AutocompactOverrideConfig, o as ConfigValueOrigin, p as LenientParseOptions, r as AutocompactThresholdConfig, s as DeepReadonly, t as AutocompactModeConfig, u as HarnessState, v as PlanningModeConfig, w as PoConfigPendingSelection, x as PoConfigContext, y as PlanningThinkingLevel, z as VoiceModelConfig } from "./config-Cg7egyk2.mjs";
1
+ import { A as PoSelectionConfig, B as VoiceTtsConfig, C as PoConfigLayers, D as PoConfigTransitionRecord, E as PoConfigTransitionPhase, F as VoiceAutoCaptureConfig, H as WorkspaceDeclaration, I as VoiceConfig, L as VoiceEngine, M as ResolvedVoiceAutoCaptureConfig, N as ResolvedVoiceConfig, O as PoConfigTransitionStrategy, P as VoiceAdapterConfig, R as VoiceMode, S as PoConfigLayer, T as PoConfigSelection, V as VoiceTtsEngine, _ as PlanningAgentConfig, a as ConfigDiagnostic, b as PoConfig, d as IPoConfigLoader, f as IPoConfigService, g as PackageAttribution, h as PO_CONFIG_SERVICE, i as AutocompactTokenConfig, j as ProjectTrust, k as PoHarnessContext, l as EditorConfig, m as LenientParseResult, n as AutocompactOverrideConfig, o as ConfigValueOrigin, p as LenientParseOptions, r as AutocompactThresholdConfig, s as DeepReadonly, t as AutocompactModeConfig, u as HarnessState, v as PlanningModeConfig, w as PoConfigPendingSelection, x as PoConfigContext, y as PlanningThinkingLevel, z as VoiceModelConfig } from "./config-CVYzn7z_.mjs";
2
2
  export { type AutocompactModeConfig, type AutocompactOverrideConfig, type AutocompactThresholdConfig, type AutocompactTokenConfig, type ConfigDiagnostic, type ConfigValueOrigin, type DeepReadonly, type EditorConfig, type HarnessState, type IPoConfigLoader, type IPoConfigService, type LenientParseOptions, type LenientParseResult, PO_CONFIG_SERVICE, type PackageAttribution, type PlanningAgentConfig, type PlanningModeConfig, type PlanningThinkingLevel, type PoConfig, type PoConfigContext, type PoConfigLayer, type PoConfigLayers, type PoConfigPendingSelection, type PoConfigSelection, type PoConfigTransitionPhase, type PoConfigTransitionRecord, type PoConfigTransitionStrategy, type PoHarnessContext, type PoSelectionConfig, type ProjectTrust, type ResolvedVoiceAutoCaptureConfig, type ResolvedVoiceConfig, type VoiceAdapterConfig, type VoiceAutoCaptureConfig, type VoiceConfig, type VoiceEngine, type VoiceMode, type VoiceModelConfig, type VoiceTtsConfig, type VoiceTtsEngine, type WorkspaceDeclaration };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-config",
3
- "version": "0.0.0-alpha.147",
3
+ "version": "0.0.0-alpha.148",
4
4
  "description": "Typed configuration loading, validation, and host services for composing Po sessions.",
5
5
  "keywords": [
6
6
  "agent-configuration",
@@ -139,14 +139,14 @@
139
139
  "registry": "https://registry.npmjs.org/"
140
140
  },
141
141
  "dependencies": {
142
- "@agimon-ai/po-core": "0.0.0-alpha.147",
143
- "@agimon-ai/po-web-components": "0.0.0-alpha.147",
142
+ "@agimon-ai/po-core": "0.0.0-alpha.148",
143
+ "@agimon-ai/po-web-components": "0.0.0-alpha.148",
144
144
  "@deepseek-ai/cordis": "4.0.5",
145
145
  "typebox": "1.4.2",
146
146
  "yaml": "2.9.1"
147
147
  },
148
148
  "devDependencies": {
149
- "@agimon-ai/po-build": "0.0.0-alpha.147",
149
+ "@agimon-ai/po-build": "0.0.0-alpha.148",
150
150
  "@earendil-works/pi-coding-agent": "1.5.1",
151
151
  "@modelcontextprotocol/ext-apps": "2.0.3",
152
152
  "@modelcontextprotocol/server": "2.3.1",