@vibesdotdev/integrations-pi 0.0.0-stage → 1.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/LICENSE +126 -0
  2. package/REFERENCE.md +284 -0
  3. package/dist/extension/active-tools.d.ts +17 -0
  4. package/dist/extension/active-tools.d.ts.map +1 -0
  5. package/dist/extension/active-tools.js +47 -0
  6. package/dist/extension/active-tools.js.map +1 -0
  7. package/dist/extension/approvals.d.ts +26 -0
  8. package/dist/extension/approvals.d.ts.map +1 -0
  9. package/dist/extension/approvals.js +124 -0
  10. package/dist/extension/approvals.js.map +1 -0
  11. package/dist/extension/boot.d.ts +18 -0
  12. package/dist/extension/boot.d.ts.map +1 -0
  13. package/dist/extension/boot.js +129 -0
  14. package/dist/extension/boot.js.map +1 -0
  15. package/dist/extension/chrome.d.ts +33 -0
  16. package/dist/extension/chrome.d.ts.map +1 -0
  17. package/dist/extension/chrome.js +167 -0
  18. package/dist/extension/chrome.js.map +1 -0
  19. package/dist/extension/commands.d.ts +41 -0
  20. package/dist/extension/commands.d.ts.map +1 -0
  21. package/dist/extension/commands.js +47 -0
  22. package/dist/extension/commands.js.map +1 -0
  23. package/dist/extension/entry.d.ts +9 -0
  24. package/dist/extension/entry.d.ts.map +1 -0
  25. package/dist/extension/entry.js +16 -0
  26. package/dist/extension/entry.js.map +1 -0
  27. package/dist/extension/events.d.ts +17 -0
  28. package/dist/extension/events.d.ts.map +1 -0
  29. package/dist/extension/events.js +42 -0
  30. package/dist/extension/events.js.map +1 -0
  31. package/dist/extension/index.d.ts +54 -0
  32. package/dist/extension/index.d.ts.map +1 -0
  33. package/dist/extension/index.js +541 -0
  34. package/dist/extension/index.js.map +1 -0
  35. package/dist/extension/models.d.ts +30 -0
  36. package/dist/extension/models.d.ts.map +1 -0
  37. package/dist/extension/models.js +104 -0
  38. package/dist/extension/models.js.map +1 -0
  39. package/dist/extension/render.d.ts +17 -0
  40. package/dist/extension/render.d.ts.map +1 -0
  41. package/dist/extension/render.js +107 -0
  42. package/dist/extension/render.js.map +1 -0
  43. package/dist/extension/runtime-host.d.ts +6 -0
  44. package/dist/extension/runtime-host.d.ts.map +1 -0
  45. package/dist/extension/runtime-host.js +2 -0
  46. package/dist/extension/runtime-host.js.map +1 -0
  47. package/dist/external/external.plugin.d.ts +7 -0
  48. package/dist/external/external.plugin.d.ts.map +1 -0
  49. package/dist/external/external.plugin.js +44 -0
  50. package/dist/external/external.plugin.js.map +1 -0
  51. package/dist/external/index.d.ts +8 -0
  52. package/dist/external/index.d.ts.map +1 -0
  53. package/dist/external/index.js +8 -0
  54. package/dist/external/index.js.map +1 -0
  55. package/dist/external/pi/bootstrap.d.ts +34 -0
  56. package/dist/external/pi/bootstrap.d.ts.map +1 -0
  57. package/dist/external/pi/bootstrap.js +238 -0
  58. package/dist/external/pi/bootstrap.js.map +1 -0
  59. package/dist/external/pi/guide.d.ts +3 -0
  60. package/dist/external/pi/guide.d.ts.map +1 -0
  61. package/dist/external/pi/guide.js +33 -0
  62. package/dist/external/pi/guide.js.map +1 -0
  63. package/dist/external/pi/index.d.ts +162 -0
  64. package/dist/external/pi/index.d.ts.map +1 -0
  65. package/dist/external/pi/index.js +7 -0
  66. package/dist/external/pi/index.js.map +1 -0
  67. package/dist/external/pi/installer.d.ts +19 -0
  68. package/dist/external/pi/installer.d.ts.map +1 -0
  69. package/dist/external/pi/installer.descriptor.d.ts +373 -0
  70. package/dist/external/pi/installer.descriptor.d.ts.map +1 -0
  71. package/dist/external/pi/installer.descriptor.js +43 -0
  72. package/dist/external/pi/installer.descriptor.js.map +1 -0
  73. package/dist/external/pi/installer.js +82 -0
  74. package/dist/external/pi/installer.js.map +1 -0
  75. package/dist/external/pi/installers/errors.d.ts +16 -0
  76. package/dist/external/pi/installers/errors.d.ts.map +1 -0
  77. package/dist/external/pi/installers/errors.js +15 -0
  78. package/dist/external/pi/installers/errors.js.map +1 -0
  79. package/dist/external/pi/installers/extension.d.ts +16 -0
  80. package/dist/external/pi/installers/extension.d.ts.map +1 -0
  81. package/dist/external/pi/installers/extension.js +292 -0
  82. package/dist/external/pi/installers/extension.js.map +1 -0
  83. package/dist/external/pi/installers/plan.d.ts +29 -0
  84. package/dist/external/pi/installers/plan.d.ts.map +1 -0
  85. package/dist/external/pi/installers/plan.js +391 -0
  86. package/dist/external/pi/installers/plan.js.map +1 -0
  87. package/dist/external/pi/installers/transaction.d.ts +5 -0
  88. package/dist/external/pi/installers/transaction.d.ts.map +1 -0
  89. package/dist/external/pi/installers/transaction.js +66 -0
  90. package/dist/external/pi/installers/transaction.js.map +1 -0
  91. package/dist/external/pi/manifest.d.ts +6 -0
  92. package/dist/external/pi/manifest.d.ts.map +1 -0
  93. package/dist/external/pi/manifest.js +91 -0
  94. package/dist/external/pi/manifest.js.map +1 -0
  95. package/dist/external/pi-presets.d.ts +817 -0
  96. package/dist/external/pi-presets.d.ts.map +1 -0
  97. package/dist/external/pi-presets.js +75 -0
  98. package/dist/external/pi-presets.js.map +1 -0
  99. package/dist/harness/constants.d.ts +46 -0
  100. package/dist/harness/constants.d.ts.map +1 -0
  101. package/dist/harness/constants.js +52 -0
  102. package/dist/harness/constants.js.map +1 -0
  103. package/dist/harness/identity.d.ts +29 -0
  104. package/dist/harness/identity.d.ts.map +1 -0
  105. package/dist/harness/identity.js +40 -0
  106. package/dist/harness/identity.js.map +1 -0
  107. package/dist/harness/index.d.ts +19 -0
  108. package/dist/harness/index.d.ts.map +1 -0
  109. package/dist/harness/index.js +18 -0
  110. package/dist/harness/index.js.map +1 -0
  111. package/dist/harness/managed-block.d.ts +20 -0
  112. package/dist/harness/managed-block.d.ts.map +1 -0
  113. package/dist/harness/managed-block.js +23 -0
  114. package/dist/harness/managed-block.js.map +1 -0
  115. package/dist/harness/pi-naming.d.ts +32 -0
  116. package/dist/harness/pi-naming.d.ts.map +1 -0
  117. package/dist/harness/pi-naming.js +110 -0
  118. package/dist/harness/pi-naming.js.map +1 -0
  119. package/dist/harness/preflight.d.ts +5 -0
  120. package/dist/harness/preflight.d.ts.map +1 -0
  121. package/dist/harness/preflight.js +163 -0
  122. package/dist/harness/preflight.js.map +1 -0
  123. package/dist/harness/prompt.d.ts +14 -0
  124. package/dist/harness/prompt.d.ts.map +1 -0
  125. package/dist/harness/prompt.js +15 -0
  126. package/dist/harness/prompt.js.map +1 -0
  127. package/dist/harness/runtime.d.ts +137 -0
  128. package/dist/harness/runtime.d.ts.map +1 -0
  129. package/dist/harness/runtime.js +53 -0
  130. package/dist/harness/runtime.js.map +1 -0
  131. package/dist/harness/scope.d.ts +11 -0
  132. package/dist/harness/scope.d.ts.map +1 -0
  133. package/dist/harness/scope.js +47 -0
  134. package/dist/harness/scope.js.map +1 -0
  135. package/dist/harness/themes.d.ts +30 -0
  136. package/dist/harness/themes.d.ts.map +1 -0
  137. package/dist/harness/themes.js +225 -0
  138. package/dist/harness/themes.js.map +1 -0
  139. package/dist/index.d.ts +2 -0
  140. package/dist/index.d.ts.map +1 -0
  141. package/dist/index.js +2 -0
  142. package/dist/index.js.map +1 -0
  143. package/dist/schemas/extension-api.d.ts +102 -0
  144. package/dist/schemas/extension-api.d.ts.map +1 -0
  145. package/dist/schemas/extension-api.js +2 -0
  146. package/dist/schemas/extension-api.js.map +1 -0
  147. package/dist/schemas/extension-host.d.ts +11 -0
  148. package/dist/schemas/extension-host.d.ts.map +1 -0
  149. package/dist/schemas/extension-host.js +12 -0
  150. package/dist/schemas/extension-host.js.map +1 -0
  151. package/dist/schemas/extension.d.ts +193 -0
  152. package/dist/schemas/extension.d.ts.map +1 -0
  153. package/dist/schemas/extension.js +82 -0
  154. package/dist/schemas/extension.js.map +1 -0
  155. package/dist/schemas/installer.d.ts +872 -0
  156. package/dist/schemas/installer.d.ts.map +1 -0
  157. package/dist/schemas/installer.js +138 -0
  158. package/dist/schemas/installer.js.map +1 -0
  159. package/dist/themes/vibes-dark.json +63 -0
  160. package/dist/themes/vibes-high-contrast.json +63 -0
  161. package/dist/themes/vibes-light.json +63 -0
  162. package/package.json +110 -4
  163. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-presets.d.ts","sourceRoot":"","sources":["../../src/external/pi-presets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA+DH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAG1C,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGjC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtB,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Pi-owned `external/preset` descriptors.
3
+ *
4
+ * Profiles: `guide` (alias `mcporter`) and `deep` (alias `plugin`).
5
+ */
6
+ import { externalPresetDescriptor } from '@vibesdotdev/external';
7
+ const piVibesMcporterGuide = {
8
+ id: 'pi-vibes-mcporter-guide',
9
+ name: 'Pi mcporter bridge guide',
10
+ description: 'Documents connecting vibes MCP to Pi via mcporter (no native MCP in core Pi)',
11
+ target: 'pi',
12
+ category: 'integration',
13
+ tags: ['pi', 'mcporter', 'docs', 'agent-pack'],
14
+ features: {
15
+ mcpServer: false,
16
+ hooks: [],
17
+ aliases: [],
18
+ modelConfig: false,
19
+ workflowConfig: false,
20
+ disableInternalTools: false
21
+ },
22
+ recipe: {
23
+ id: 'pi-vibes-mcporter-guide',
24
+ name: 'Pi mcporter guide',
25
+ description: 'Write AGENTS.md mcporter instructions',
26
+ variables: {},
27
+ steps: [
28
+ { type: 'operation', operationId: 'pi/guide', options: {} }
29
+ ]
30
+ },
31
+ version: '1.0.0'
32
+ };
33
+ const piVibesDeep = {
34
+ id: 'pi-vibes-deep',
35
+ name: 'Vibes as the Pi toolset',
36
+ description: 'Pi extension + defaultTools [] (builtins off, extensions stay) + SYSTEM.md replacement',
37
+ target: 'pi',
38
+ category: 'integration',
39
+ tags: ['plugin', 'recommended', 'deep', 'pi'],
40
+ features: {
41
+ mcpServer: false,
42
+ hooks: [],
43
+ aliases: ['vibes pi'],
44
+ modelConfig: false,
45
+ workflowConfig: true,
46
+ disableInternalTools: true
47
+ },
48
+ recipe: {
49
+ id: 'pi-vibes-deep',
50
+ name: 'Vibes Pi deep integration',
51
+ description: 'Extension + empty defaultTools + SYSTEM.md',
52
+ variables: {},
53
+ steps: [
54
+ {
55
+ type: 'operation',
56
+ operationId: 'pi/install',
57
+ options: { profile: 'isolated' }
58
+ }
59
+ ]
60
+ },
61
+ version: '1.0.0'
62
+ };
63
+ export const piMcporterGuidePresetDescriptor = externalPresetDescriptor({
64
+ preset: piVibesMcporterGuide,
65
+ profiles: [{ id: 'guide', presetId: piVibesMcporterGuide.id, aliases: ['mcporter'] }]
66
+ });
67
+ export const piDeepPresetDescriptor = externalPresetDescriptor({
68
+ preset: piVibesDeep,
69
+ profiles: [{ id: 'deep', presetId: piVibesDeep.id, aliases: ['plugin'] }]
70
+ });
71
+ export const piPresetDescriptors = [
72
+ piMcporterGuidePresetDescriptor,
73
+ piDeepPresetDescriptor
74
+ ];
75
+ //# sourceMappingURL=pi-presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-presets.js","sourceRoot":"","sources":["../../src/external/pi-presets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,wBAAwB,EAAc,MAAM,uBAAuB,CAAC;AAE7E,MAAM,oBAAoB,GAAW;IACpC,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,8EAA8E;IAC3F,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,aAAa;IACvB,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC;IAC9C,QAAQ,EAAE;QACT,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE,KAAK;QACrB,oBAAoB,EAAE,KAAK;KAC3B;IACD,MAAM,EAAE;QACP,EAAE,EAAE,yBAAyB;QAC7B,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,uCAAuC;QACpD,SAAS,EAAE,EAAE;QACb,KAAK,EAAE;YACN,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE;SAC3D;KACD;IACD,OAAO,EAAE,OAAO;CAChB,CAAC;AAEF,MAAM,WAAW,GAAW;IAC3B,EAAE,EAAE,eAA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PolicyProfile } from '../schemas/installer.ts';
2
+ import { PiProfileSchema } from '../schemas/installer.ts';
3
+ export type { PiToolPolicyProfile } from '../schemas/installer.ts';
4
+ /**
5
+ * Pi harness constants.
6
+ *
7
+ * One owner for the Pi package specifier, file layout, and tool-policy profiles
8
+ * that the installer, presets, extension, and CLI must agree on. The ownership
9
+ * markers every host shares (`VIBES_HARNESS_MARKER_VERSION`,
10
+ * `VIBES_MANAGED_SETTINGS_KEY`, managed-block markers) are host-neutral and
11
+ * live in `@vibesdotdev/external/harness`.
12
+ */
13
+ /** Entrypoint the generated Pi extension module imports. */
14
+ export declare const VIBES_PI_EXTENSION_PACKAGE = "@vibesdotdev/integrations-pi/extension/bun";
15
+ /**
16
+ * The extension entry `package.json` `pi.extensions` names, package-root
17
+ * relative.
18
+ *
19
+ * Pi installs this package through its own package manager and loads the entry
20
+ * from inside the installed tree, so the package itself is the extension and no
21
+ * generated re-export stub is placed in the user's project. Naming the built
22
+ * entry means the internal checkout loads the same artifact an end user gets;
23
+ * the public `./extension/bun` export resolves this same factory.
24
+ */
25
+ export declare const PI_EXTENSION_ENTRY = "dist/extension/entry.js";
26
+ /** Pi file layout, relative to a scope directory. */
27
+ export declare const PI_DIR = ".pi";
28
+ export declare const PI_GLOBAL_RELATIVE_DIR: readonly [".pi", "agent"];
29
+ export declare const PI_EXTENSION_FILE = "vibes.ts";
30
+ export declare const PI_EXTENSION_REF = "./extensions/vibes.ts";
31
+ export declare const PI_SYSTEM_PROMPT_FILE = "SYSTEM.md";
32
+ export declare const PI_SETTINGS_FILE = "settings.json";
33
+ export declare const PI_TOOL_POLICY_PROFILES: readonly ["isolated", "safe-hybrid", "native"];
34
+ export declare const DEFAULT_PI_TOOL_POLICY_PROFILE: PiToolPolicyProfile;
35
+ /**
36
+ * Pi builtins kept under `safe-hybrid`: read-only inspection, where a native
37
+ * Pi call is cheaper than a CLI round-trip and cannot mutate the workspace.
38
+ */
39
+ export declare const PI_SAFE_HYBRID_BUILTINS: readonly ["read", "grep", "find", "ls"];
40
+ export declare function isPiToolPolicyProfile(value: Parameters<typeof PiProfileSchema.safeParse>[0]): value is PiToolPolicyProfile;
41
+ /**
42
+ * `defaultTools` to write for a profile, or `undefined` when the profile leaves
43
+ * the host's own setting untouched.
44
+ */
45
+ export declare function piDefaultToolsForProfile(profile: PiToolPolicyProfile, knownBuiltins: readonly string[]): string[] | undefined;
46
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/harness/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE;;;;;;;;GAQG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,0BAA0B,+CAA+C,CAAC;AAEvF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,4BAA4B,CAAC;AAE5D,qDAAqD;AACrD,eAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,eAAO,MAAM,sBAAsB,2BAA4B,CAAC;AAChE,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAC5C,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AACxD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AACjD,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,eAAO,MAAM,uBAAuB,gDAAiD,CAAC;AAGtF,eAAO,MAAM,8BAA8B,EAAE,mBAAgC,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,yCAA0C,CAAC;AAE/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,mBAAmB,CAE1H;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,SAAS,MAAM,EAAE,GAC9B,MAAM,EAAE,GAAG,SAAS,CAItB"}
@@ -0,0 +1,52 @@
1
+ import { PiProfileSchema } from "../schemas/installer.js";
2
+ /**
3
+ * Pi harness constants.
4
+ *
5
+ * One owner for the Pi package specifier, file layout, and tool-policy profiles
6
+ * that the installer, presets, extension, and CLI must agree on. The ownership
7
+ * markers every host shares (`VIBES_HARNESS_MARKER_VERSION`,
8
+ * `VIBES_MANAGED_SETTINGS_KEY`, managed-block markers) are host-neutral and
9
+ * live in `@vibesdotdev/external/harness`.
10
+ */
11
+ /** Entrypoint the generated Pi extension module imports. */
12
+ export const VIBES_PI_EXTENSION_PACKAGE = '@vibesdotdev/integrations-pi/extension/bun';
13
+ /**
14
+ * The extension entry `package.json` `pi.extensions` names, package-root
15
+ * relative.
16
+ *
17
+ * Pi installs this package through its own package manager and loads the entry
18
+ * from inside the installed tree, so the package itself is the extension and no
19
+ * generated re-export stub is placed in the user's project. Naming the built
20
+ * entry means the internal checkout loads the same artifact an end user gets;
21
+ * the public `./extension/bun` export resolves this same factory.
22
+ */
23
+ export const PI_EXTENSION_ENTRY = 'dist/extension/entry.js';
24
+ /** Pi file layout, relative to a scope directory. */
25
+ export const PI_DIR = '.pi';
26
+ export const PI_GLOBAL_RELATIVE_DIR = ['.pi', 'agent'];
27
+ export const PI_EXTENSION_FILE = 'vibes.ts';
28
+ export const PI_EXTENSION_REF = './extensions/vibes.ts';
29
+ export const PI_SYSTEM_PROMPT_FILE = 'SYSTEM.md';
30
+ export const PI_SETTINGS_FILE = 'settings.json';
31
+ export const PI_TOOL_POLICY_PROFILES = ['isolated', 'safe-hybrid', 'native'];
32
+ export const DEFAULT_PI_TOOL_POLICY_PROFILE = 'isolated';
33
+ /**
34
+ * Pi builtins kept under `safe-hybrid`: read-only inspection, where a native
35
+ * Pi call is cheaper than a CLI round-trip and cannot mutate the workspace.
36
+ */
37
+ export const PI_SAFE_HYBRID_BUILTINS = ['read', 'grep', 'find', 'ls'];
38
+ export function isPiToolPolicyProfile(value) {
39
+ return PiProfileSchema.safeParse(value).success;
40
+ }
41
+ /**
42
+ * `defaultTools` to write for a profile, or `undefined` when the profile leaves
43
+ * the host's own setting untouched.
44
+ */
45
+ export function piDefaultToolsForProfile(profile, knownBuiltins) {
46
+ if (profile === 'isolated')
47
+ return [];
48
+ if (profile === 'native')
49
+ return undefined;
50
+ return knownBuiltins.filter((name) => PI_SAFE_HYBRID_BUILTINS.some(builtin => builtin === name));
51
+ }
52
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/harness/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;;;GAQG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,0BAA0B,GAAG,4CAA4C,CAAC;AAEvF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAE5D,qDAAqD;AACrD,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC;AAC5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,OAAO,CAAU,CAAC;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,QAAQ,CAAU,CAAC;AAGtF,MAAM,CAAC,MAAM,8BAA8B,GAAwB,UAAU,CAAC;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAU,CAAC;AAE/E,MAAM,UAAU,qBAAqB,CAAC,KAAsD;IAC3F,OAAO,eAAe,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CACvC,OAA4B,EAC5B,aAAgC;IAEhC,IAAI,OAAO,KAAK,UAAU;QAAE,OAAO,EAAE,CAAC;IACtC,IAAI,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;AAClG,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The Pi body: which agent owns brain, presence, and memories for a Pi session.
3
+ *
4
+ * Agent-scoped organs store per body (`~/.vibes/presence/<agentId>/inner.db`)
5
+ * and refuse an unnamed caller rather than defaulting, so a harness that never
6
+ * names its agent writes into whatever body the launching shell happened to
7
+ * name — or fails. Pi is one body per process, exactly like a Pi MCP install
8
+ * whose identity comes from the generated client env, so the harness declares
9
+ * its own identity through the composed runtime host environment. The native
10
+ * entry captures an environment copy; boot forwards it through host.spawnEnv.
11
+ *
12
+ * `pi` is not an invented name: it is the host identity the rest of the fleet
13
+ * already resolves for Pi — `externalHostIdentityId(piManifest)` (the same
14
+ * derivation every other installer uses) and the `pi` harness alias whose
15
+ * default agent slug is also `pi`. `identity.test.ts` fails if the two ever
16
+ * disagree.
17
+ *
18
+ * An explicit shell value always wins: a person who exports `VIBES_AGENT_ID`
19
+ * deliberately (or passes `--agent`) knows better than the harness does.
20
+ */
21
+ export declare const PI_AGENT_ID = "pi";
22
+ export declare const PI_HARNESS_ID = "pi";
23
+ /**
24
+ * Fill in the Pi identity for this process, leaving anything already declared
25
+ * alone. It mutates the env it is handed: the Pi host entry passes its own
26
+ * captured environment copy, forwarded to the in-process runtime host. Returns the assignments actually made, so a caller can report them.
27
+ */
28
+ export declare function declarePiAgentIdentity(env: Record<string, string | undefined>): readonly string[];
29
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/harness/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,WAAW,OAAO,CAAC;AAChC,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACrC,SAAS,MAAM,EAAE,CAWnB"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The Pi body: which agent owns brain, presence, and memories for a Pi session.
3
+ *
4
+ * Agent-scoped organs store per body (`~/.vibes/presence/<agentId>/inner.db`)
5
+ * and refuse an unnamed caller rather than defaulting, so a harness that never
6
+ * names its agent writes into whatever body the launching shell happened to
7
+ * name — or fails. Pi is one body per process, exactly like a Pi MCP install
8
+ * whose identity comes from the generated client env, so the harness declares
9
+ * its own identity through the composed runtime host environment. The native
10
+ * entry captures an environment copy; boot forwards it through host.spawnEnv.
11
+ *
12
+ * `pi` is not an invented name: it is the host identity the rest of the fleet
13
+ * already resolves for Pi — `externalHostIdentityId(piManifest)` (the same
14
+ * derivation every other installer uses) and the `pi` harness alias whose
15
+ * default agent slug is also `pi`. `identity.test.ts` fails if the two ever
16
+ * disagree.
17
+ *
18
+ * An explicit shell value always wins: a person who exports `VIBES_AGENT_ID`
19
+ * deliberately (or passes `--agent`) knows better than the harness does.
20
+ */
21
+ export const PI_AGENT_ID = 'pi';
22
+ export const PI_HARNESS_ID = 'pi';
23
+ /**
24
+ * Fill in the Pi identity for this process, leaving anything already declared
25
+ * alone. It mutates the env it is handed: the Pi host entry passes its own
26
+ * captured environment copy, forwarded to the in-process runtime host. Returns the assignments actually made, so a caller can report them.
27
+ */
28
+ export function declarePiAgentIdentity(env) {
29
+ const declared = [];
30
+ if (!env.VIBES_AGENT_ID?.trim()) {
31
+ env.VIBES_AGENT_ID = PI_AGENT_ID;
32
+ declared.push('VIBES_AGENT_ID=' + PI_AGENT_ID);
33
+ }
34
+ if (!env.VIBES_HARNESS?.trim()) {
35
+ env.VIBES_HARNESS = PI_HARNESS_ID;
36
+ declared.push('VIBES_HARNESS=' + PI_HARNESS_ID);
37
+ }
38
+ return declared;
39
+ }
40
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/harness/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAChC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACrC,GAAuC;IAEvC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,EAAE,CAAC;QACjC,GAAG,CAAC,cAAc,GAAG,WAAW,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,GAAG,WAAW,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,EAAE,EAAE,CAAC;QAChC,GAAG,CAAC,aAAa,GAAG,aAAa,CAAC;QAClC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @vibesdotdev/integrations-pi/harness
3
+ *
4
+ * The Pi-owned harness pieces: package specifier, file layout, agent identity,
5
+ * tool-policy profiles, scopes, preflight, provider-safe naming, the live Pi
6
+ * prompt, and legacy extension-module recognition. Host-neutral markers, managed blocks,
7
+ * prompt text, CLI runner, live catalog, and write transaction come from
8
+ * `@vibesdotdev/external/harness` and `@vibesdotdev/external/consumer/node/harness`.
9
+ */
10
+ export * from './constants.ts';
11
+ export * from './identity.ts';
12
+ export * from './managed-block.ts';
13
+ export * from './pi-naming.ts';
14
+ export * from './preflight.ts';
15
+ export * from './prompt.ts';
16
+ export * from './scope.ts';
17
+ export { DEFAULT_PI_VIBES_THEME, PI_THEMES_DIR, PI_THEME_COLOR_KEYS, PI_THEME_DIST_DIR, PI_THEME_NAMES, PI_THEME_REF, isPiVibesThemeName, piThemePackagePath, renderPiVibesThemes } from './themes.ts';
18
+ export type { PiThemeFile, PiVibesThemeName } from './themes.ts';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,OAAO,EACN,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @vibesdotdev/integrations-pi/harness
3
+ *
4
+ * The Pi-owned harness pieces: package specifier, file layout, agent identity,
5
+ * tool-policy profiles, scopes, preflight, provider-safe naming, the live Pi
6
+ * prompt, and legacy extension-module recognition. Host-neutral markers, managed blocks,
7
+ * prompt text, CLI runner, live catalog, and write transaction come from
8
+ * `@vibesdotdev/external/harness` and `@vibesdotdev/external/consumer/node/harness`.
9
+ */
10
+ export * from "./constants.js";
11
+ export * from "./identity.js";
12
+ export * from "./managed-block.js";
13
+ export * from "./pi-naming.js";
14
+ export * from "./preflight.js";
15
+ export * from "./prompt.js";
16
+ export * from "./scope.js";
17
+ export { DEFAULT_PI_VIBES_THEME, PI_THEMES_DIR, PI_THEME_COLOR_KEYS, PI_THEME_DIST_DIR, PI_THEME_NAMES, PI_THEME_REF, isPiVibesThemeName, piThemePackagePath, renderPiVibesThemes } from "./themes.js";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,OAAO,EACN,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Pi-specific managed-file recognition.
3
+ *
4
+ * The managed-block primitives are host-neutral (`@vibesdotdev/external/harness`).
5
+ * The exact bytes the
6
+ * pre-marker Pi installer wrote name the Pi package, so they live here with
7
+ * the Pi package specifier instead of making the neutral module import a host.
8
+ */
9
+ /**
10
+ * Exact bytes the pre-marker installer wrote. Recognized so an existing install
11
+ * upgrades in place instead of being reported as a foreign file. The package
12
+ * specifier was JSON-serialized, so double quotes are part of the legacy form.
13
+ */
14
+ export declare const LEGACY_PI_EXTENSION_MODULE: string;
15
+ /**
16
+ * Only the exact pre-marker Pi module is owned by this installer.
17
+ * Other packages' re-exports are foreign files and must remain untouched.
18
+ */
19
+ export declare function isLegacyPiExtensionModule(text: string): boolean;
20
+ //# sourceMappingURL=managed-block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-block.d.ts","sourceRoot":"","sources":["../../src/harness/managed-block.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QACuD,CAAC;AAE/F;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/D"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Pi-specific managed-file recognition.
3
+ *
4
+ * The managed-block primitives are host-neutral (`@vibesdotdev/external/harness`).
5
+ * The exact bytes the
6
+ * pre-marker Pi installer wrote name the Pi package, so they live here with
7
+ * the Pi package specifier instead of making the neutral module import a host.
8
+ */
9
+ import { VIBES_PI_EXTENSION_PACKAGE } from "./constants.js";
10
+ /**
11
+ * Exact bytes the pre-marker installer wrote. Recognized so an existing install
12
+ * upgrades in place instead of being reported as a foreign file. The package
13
+ * specifier was JSON-serialized, so double quotes are part of the legacy form.
14
+ */
15
+ export const LEGACY_PI_EXTENSION_MODULE = `import create from ${JSON.stringify(VIBES_PI_EXTENSION_PACKAGE)};\nexport default create;\n`;
16
+ /**
17
+ * Only the exact pre-marker Pi module is owned by this installer.
18
+ * Other packages' re-exports are foreign files and must remain untouched.
19
+ */
20
+ export function isLegacyPiExtensionModule(text) {
21
+ return text === LEGACY_PI_EXTENSION_MODULE;
22
+ }
23
+ //# sourceMappingURL=managed-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-block.js","sourceRoot":"","sources":["../../src/harness/managed-block.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACtC,sBAAsB,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC,6BAA6B,CAAC;AAE/F;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAY;IACrD,OAAO,IAAI,KAAK,0BAA0B,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { CapabilityError } from '@vibesdotdev/kernel';
2
+ import type { PiCatalogCheck, PiCatalogEntry, PiCatalogIssue } from '../schemas/installer.ts';
3
+ export type { PiCatalogCheck, PiCatalogEntry, PiCatalogIssue, PiCatalogIssueCode } from '../schemas/installer.ts';
4
+ /**
5
+ * Pi naming and catalog safety.
6
+ *
7
+ * Pi tool names must match [a-zA-Z0-9_-]+ for providers such as Bedrock, so a
8
+ * canonical dotted id is projected to underscores. The canonical id stays the
9
+ * CLI routing identity; the human-readable label is the display label. The
10
+ * projected name is only what the model emits. Both are validated before the first registration so a
11
+ * collision fails the whole projection instead of half-registering it.
12
+ */
13
+ import type { LiveToolDescriptor } from '@vibesdotdev/external/consumer/node/harness';
14
+ export declare const PI_TOOL_NAME_PATTERN: RegExp;
15
+ /** Pi built-in names reported by the Pi CLI. */
16
+ export declare const PI_BUILTIN_TOOLS: readonly ["read", "bash", "edit", "write", "grep", "find", "ls"];
17
+ /** Provider-safe Pi projection of a canonical dotted Vibes tool id. */
18
+ export declare function toPiToolName(toolId: string): string;
19
+ /**
20
+ * Validate a whole projection before any host registers a single tool.
21
+ * A name that collides with another projection or a Pi builtin would otherwise
22
+ * be silently dropped or shadow a native capability.
23
+ */
24
+ export declare function checkPiToolCatalog(tools: readonly Pick<LiveToolDescriptor, 'id'>[], reserved?: readonly string[]): PiCatalogCheck;
25
+ /** Thrown when a projection is refused before registration began. */
26
+ export declare class PiCatalogError extends CapabilityError {
27
+ readonly issues: readonly PiCatalogIssue[];
28
+ constructor(issues: readonly PiCatalogIssue[]);
29
+ }
30
+ /** Entries to register, or throw listing every problem at once. */
31
+ export declare function assertPiToolCatalog(tools: readonly Pick<LiveToolDescriptor, 'id'>[], reserved?: readonly string[]): PiCatalogEntry[];
32
+ //# sourceMappingURL=pi-naming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-naming.d.ts","sourceRoot":"","sources":["../../src/harness/pi-naming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAC,cAAc,EAAC,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC5F,YAAY,EAAE,cAAc,EAAC,cAAc,EAAC,cAAc,EAAC,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC/G;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,eAAO,MAAM,oBAAoB,QAAqB,CAAC;AAEvD,gDAAgD;AAChD,eAAO,MAAM,gBAAgB,kEAQnB,CAAC;AAEX,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAUD;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,SAAS,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAChD,QAAQ,GAAE,SAAS,MAAM,EAAqB,GAC5C,cAAc,CAoEhB;AAED,qEAAqE;AACrE,qBAAa,cAAe,SAAQ,eAAe;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;gBAC/B,MAAM,EAAE,SAAS,cAAc,EAAE;CAO7C;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,SAAS,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAChD,QAAQ,GAAE,SAAS,MAAM,EAAqB,GAC5C,cAAc,EAAE,CAIlB"}
@@ -0,0 +1,110 @@
1
+ import { CapabilityError } from '@vibesdotdev/kernel';
2
+ export const PI_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
3
+ /** Pi built-in names reported by the Pi CLI. */
4
+ export const PI_BUILTIN_TOOLS = [
5
+ 'read',
6
+ 'bash',
7
+ 'edit',
8
+ 'write',
9
+ 'grep',
10
+ 'find',
11
+ 'ls'
12
+ ];
13
+ /** Provider-safe Pi projection of a canonical dotted Vibes tool id. */
14
+ export function toPiToolName(toolId) {
15
+ return toolId.replaceAll('.', '_').replaceAll('-', '_');
16
+ }
17
+ /**
18
+ * Validate a whole projection before any host registers a single tool.
19
+ * A name that collides with another projection or a Pi builtin would otherwise
20
+ * be silently dropped or shadow a native capability.
21
+ */
22
+ export function checkPiToolCatalog(tools, reserved = PI_BUILTIN_TOOLS) {
23
+ const issues = [];
24
+ const entries = [];
25
+ if (tools.length === 0) {
26
+ issues.push({
27
+ code: 'empty-catalog',
28
+ toolId: '(none)',
29
+ name: '(none)',
30
+ detail: 'a projection with no tools registers nothing'
31
+ });
32
+ return { ok: false, issues, entries };
33
+ }
34
+ const byId = new Map();
35
+ const byName = new Map();
36
+ const reservedSet = new Set(reserved);
37
+ for (const tool of tools) {
38
+ const id = tool.id.trim();
39
+ if (id.length === 0) {
40
+ issues.push({
41
+ code: 'blank-id',
42
+ toolId: '(blank)',
43
+ name: '(blank)',
44
+ detail: 'every projected tool needs a canonical id'
45
+ });
46
+ continue;
47
+ }
48
+ byId.set(id, (byId.get(id) ?? 0) + 1);
49
+ const name = toPiToolName(id);
50
+ if (!PI_TOOL_NAME_PATTERN.test(name)) {
51
+ issues.push({
52
+ code: 'invalid-name',
53
+ toolId: id,
54
+ name,
55
+ detail: 'projected name must match [a-zA-Z0-9_-]+'
56
+ });
57
+ }
58
+ const previous = byName.get(name);
59
+ if (previous !== undefined && previous !== id) {
60
+ issues.push({
61
+ code: 'duplicate-name',
62
+ toolId: id,
63
+ name,
64
+ detail: 'already produced by ' + previous
65
+ });
66
+ }
67
+ else {
68
+ byName.set(name, id);
69
+ }
70
+ if (reservedSet.has(name)) {
71
+ issues.push({
72
+ code: 'builtin-shadow',
73
+ toolId: id,
74
+ name,
75
+ detail: 'the host already owns this tool name'
76
+ });
77
+ }
78
+ entries.push({ id, name });
79
+ }
80
+ for (const [id, count] of byId) {
81
+ if (count > 1) {
82
+ issues.push({
83
+ code: 'duplicate-id',
84
+ toolId: id,
85
+ name: toPiToolName(id),
86
+ detail: 'declared ' + count + ' times'
87
+ });
88
+ }
89
+ }
90
+ return issues.length === 0 ? { ok: true, issues: [], entries } : { ok: false, issues, entries };
91
+ }
92
+ /** Thrown when a projection is refused before registration began. */
93
+ export class PiCatalogError extends CapabilityError {
94
+ issues;
95
+ constructor(issues) {
96
+ super('Refusing to register the Vibes Pi tool catalog.', 'CONFLICT', {
97
+ reason: 'pi-catalog-invalid', details: { issueCount: issues.length, codes: issues.map(issue => issue.code) }
98
+ });
99
+ this.name = 'PiCatalogError';
100
+ this.issues = issues;
101
+ }
102
+ }
103
+ /** Entries to register, or throw listing every problem at once. */
104
+ export function assertPiToolCatalog(tools, reserved = PI_BUILTIN_TOOLS) {
105
+ const check = checkPiToolCatalog(tools, reserved);
106
+ if (!check.ok)
107
+ throw new PiCatalogError(check.issues);
108
+ return check.entries;
109
+ }
110
+ //# sourceMappingURL=pi-naming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-naming.js","sourceRoot":"","sources":["../../src/harness/pi-naming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAetD,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD,gDAAgD;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,IAAI;CACK,CAAC;AAEX,uEAAuE;AACvE,MAAM,UAAU,YAAY,CAAC,MAAc;IAC1C,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GA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AAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACjG,CAAC;AAED,qEAAqE;AACrE,MAAM,OAAO,cAAe,SAAQ,eAAe;IACzC,MAAM,CAA4B;IAC3C,YAAY,MAAiC;QAC5C,KAAK,CAAC,iDAAiD,EAAE,UAAU,EAAE;YACtE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;SAC3G,CAAC,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAED,mEAAmE;AACnE,MAAM,UAAU,mBAAmB,CAClC,KAAgD,EAChD,WAA8B,gBAAgB;IAE9C,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK,CAAC,EAAE;QAAE,MAAM,IAAI,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACtD,OAAO,KAAK,CAAC,OAAO,CAAC;AACtB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { PreflightInput, PreflightReport } from '../schemas/installer.ts';
2
+ export type { PreflightCheck, PreflightCheckId, PreflightConflict, PreflightInput, PreflightReport } from '../schemas/installer.ts';
3
+ export declare const PREFLIGHT_CHECK_IDS: readonly ["pi-cli", "vibes-cli", "bun", "package-resolution", "writability", "merge-safety"];
4
+ export declare function runPiInstallPreflight(rawInput: PreflightInput): Promise<PreflightReport>;
5
+ //# sourceMappingURL=preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/harness/preflight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkC,cAAc,EAAC,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE9G,YAAY,EAAE,cAAc,EAAC,gBAAgB,EAAC,iBAAiB,EAAC,cAAc,EAAC,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAehI,eAAO,MAAM,mBAAmB,8FAOtB,CAAC;AAgBX,wBAAsB,qBAAqB,CAC1C,QAAQ,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAiH1B"}