@earendil-works/pi-coding-agent 0.78.1 → 0.79.1

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 (174) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +21 -2
  3. package/dist/cli/args.d.ts +1 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +8 -0
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/project-trust.d.ts +10 -0
  8. package/dist/cli/project-trust.d.ts.map +1 -0
  9. package/dist/cli/project-trust.js +48 -0
  10. package/dist/cli/project-trust.js.map +1 -0
  11. package/dist/cli/startup-ui.d.ts +7 -0
  12. package/dist/cli/startup-ui.d.ts.map +1 -0
  13. package/dist/cli/startup-ui.js +59 -0
  14. package/dist/cli/startup-ui.js.map +1 -0
  15. package/dist/core/agent-session-runtime.d.ts +3 -1
  16. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  17. package/dist/core/agent-session-runtime.js +4 -1
  18. package/dist/core/agent-session-runtime.js.map +1 -1
  19. package/dist/core/agent-session-services.d.ts +2 -1
  20. package/dist/core/agent-session-services.d.ts.map +1 -1
  21. package/dist/core/agent-session-services.js +2 -2
  22. package/dist/core/agent-session-services.js.map +1 -1
  23. package/dist/core/agent-session.d.ts +1 -0
  24. package/dist/core/agent-session.d.ts.map +1 -1
  25. package/dist/core/agent-session.js +6 -0
  26. package/dist/core/agent-session.js.map +1 -1
  27. package/dist/core/compaction/utils.d.ts +1 -1
  28. package/dist/core/compaction/utils.d.ts.map +1 -1
  29. package/dist/core/compaction/utils.js +1 -1
  30. package/dist/core/compaction/utils.js.map +1 -1
  31. package/dist/core/experimental.d.ts +2 -0
  32. package/dist/core/experimental.d.ts.map +1 -0
  33. package/dist/core/experimental.js +4 -0
  34. package/dist/core/experimental.js.map +1 -0
  35. package/dist/core/extensions/index.d.ts +1 -1
  36. package/dist/core/extensions/index.d.ts.map +1 -1
  37. package/dist/core/extensions/index.js.map +1 -1
  38. package/dist/core/extensions/loader.d.ts +1 -1
  39. package/dist/core/extensions/loader.d.ts.map +1 -1
  40. package/dist/core/extensions/loader.js +4 -4
  41. package/dist/core/extensions/loader.js.map +1 -1
  42. package/dist/core/extensions/runner.d.ts +7 -2
  43. package/dist/core/extensions/runner.d.ts.map +1 -1
  44. package/dist/core/extensions/runner.js +34 -0
  45. package/dist/core/extensions/runner.js.map +1 -1
  46. package/dist/core/extensions/types.d.ts +21 -1
  47. package/dist/core/extensions/types.d.ts.map +1 -1
  48. package/dist/core/extensions/types.js.map +1 -1
  49. package/dist/core/index.d.ts +1 -0
  50. package/dist/core/index.d.ts.map +1 -1
  51. package/dist/core/index.js +1 -0
  52. package/dist/core/index.js.map +1 -1
  53. package/dist/core/model-registry.d.ts.map +1 -1
  54. package/dist/core/model-registry.js +1 -0
  55. package/dist/core/model-registry.js.map +1 -1
  56. package/dist/core/package-manager.d.ts +1 -0
  57. package/dist/core/package-manager.d.ts.map +1 -1
  58. package/dist/core/package-manager.js +25 -7
  59. package/dist/core/package-manager.js.map +1 -1
  60. package/dist/core/project-trust.d.ts +15 -0
  61. package/dist/core/project-trust.d.ts.map +1 -0
  62. package/dist/core/project-trust.js +58 -0
  63. package/dist/core/project-trust.js.map +1 -0
  64. package/dist/core/prompt-templates.d.ts +2 -1
  65. package/dist/core/prompt-templates.d.ts.map +1 -1
  66. package/dist/core/prompt-templates.js +24 -26
  67. package/dist/core/prompt-templates.js.map +1 -1
  68. package/dist/core/resource-loader.d.ts +13 -2
  69. package/dist/core/resource-loader.d.ts.map +1 -1
  70. package/dist/core/resource-loader.js +112 -37
  71. package/dist/core/resource-loader.js.map +1 -1
  72. package/dist/core/settings-manager.d.ts +14 -2
  73. package/dist/core/settings-manager.d.ts.map +1 -1
  74. package/dist/core/settings-manager.js +80 -30
  75. package/dist/core/settings-manager.js.map +1 -1
  76. package/dist/core/slash-commands.d.ts.map +1 -1
  77. package/dist/core/slash-commands.js +1 -0
  78. package/dist/core/slash-commands.js.map +1 -1
  79. package/dist/core/tools/bash.d.ts.map +1 -1
  80. package/dist/core/tools/bash.js +1 -1
  81. package/dist/core/tools/bash.js.map +1 -1
  82. package/dist/core/tools/find.d.ts.map +1 -1
  83. package/dist/core/tools/find.js +1 -1
  84. package/dist/core/tools/find.js.map +1 -1
  85. package/dist/core/tools/grep.d.ts.map +1 -1
  86. package/dist/core/tools/grep.js +1 -1
  87. package/dist/core/tools/grep.js.map +1 -1
  88. package/dist/core/tools/ls.d.ts.map +1 -1
  89. package/dist/core/tools/ls.js +1 -1
  90. package/dist/core/tools/ls.js.map +1 -1
  91. package/dist/core/tools/read.d.ts.map +1 -1
  92. package/dist/core/tools/read.js +1 -1
  93. package/dist/core/tools/read.js.map +1 -1
  94. package/dist/core/tools/write.d.ts.map +1 -1
  95. package/dist/core/tools/write.js +1 -1
  96. package/dist/core/tools/write.js.map +1 -1
  97. package/dist/core/trust-manager.d.ts +31 -0
  98. package/dist/core/trust-manager.d.ts.map +1 -0
  99. package/dist/core/trust-manager.js +187 -0
  100. package/dist/core/trust-manager.js.map +1 -0
  101. package/dist/index.d.ts +5 -4
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +2 -1
  104. package/dist/index.js.map +1 -1
  105. package/dist/main.d.ts.map +1 -1
  106. package/dist/main.js +61 -32
  107. package/dist/main.js.map +1 -1
  108. package/dist/migrations.d.ts.map +1 -1
  109. package/dist/migrations.js +39 -34
  110. package/dist/migrations.js.map +1 -1
  111. package/dist/modes/index.d.ts +1 -1
  112. package/dist/modes/index.d.ts.map +1 -1
  113. package/dist/modes/index.js.map +1 -1
  114. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  115. package/dist/modes/interactive/components/bash-execution.js +2 -2
  116. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  117. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  118. package/dist/modes/interactive/components/footer.js +7 -0
  119. package/dist/modes/interactive/components/footer.js.map +1 -1
  120. package/dist/modes/interactive/components/index.d.ts +1 -0
  121. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  122. package/dist/modes/interactive/components/index.js +1 -0
  123. package/dist/modes/interactive/components/index.js.map +1 -1
  124. package/dist/modes/interactive/components/login-dialog.d.ts +1 -0
  125. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  126. package/dist/modes/interactive/components/login-dialog.js +7 -1
  127. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  128. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  129. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  130. package/dist/modes/interactive/components/settings-selector.js +20 -0
  131. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  132. package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
  133. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  134. package/dist/modes/interactive/components/trust-selector.js +91 -0
  135. package/dist/modes/interactive/components/trust-selector.js.map +1 -0
  136. package/dist/modes/interactive/interactive-mode.d.ts +7 -0
  137. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  138. package/dist/modes/interactive/interactive-mode.js +99 -5
  139. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  140. package/dist/package-manager-cli.d.ts +6 -2
  141. package/dist/package-manager-cli.d.ts.map +1 -1
  142. package/dist/package-manager-cli.js +104 -10
  143. package/dist/package-manager-cli.js.map +1 -1
  144. package/dist/utils/changelog.d.ts +1 -0
  145. package/dist/utils/changelog.d.ts.map +1 -1
  146. package/dist/utils/changelog.js +78 -0
  147. package/dist/utils/changelog.js.map +1 -1
  148. package/docs/docs.json +4 -0
  149. package/docs/extensions.md +31 -2
  150. package/docs/index.md +1 -0
  151. package/docs/models.md +4 -3
  152. package/docs/packages.md +1 -1
  153. package/docs/prompt-templates.md +9 -2
  154. package/docs/sdk.md +5 -0
  155. package/docs/security.md +55 -0
  156. package/docs/settings.md +13 -0
  157. package/docs/skills.md +1 -1
  158. package/docs/terminal-setup.md +36 -2
  159. package/docs/themes.md +1 -1
  160. package/docs/tmux.md +4 -2
  161. package/docs/usage.md +18 -1
  162. package/examples/extensions/README.md +1 -0
  163. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  164. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  165. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  166. package/examples/extensions/gondolin/package-lock.json +2 -2
  167. package/examples/extensions/gondolin/package.json +1 -1
  168. package/examples/extensions/project-trust.ts +64 -0
  169. package/examples/extensions/sandbox/package-lock.json +2 -2
  170. package/examples/extensions/sandbox/package.json +1 -1
  171. package/examples/extensions/with-deps/package-lock.json +2 -2
  172. package/examples/extensions/with-deps/package.json +1 -1
  173. package/npm-shrinkwrap.json +12 -12
  174. package/package.json +4 -8
@@ -1,4 +1,82 @@
1
+ import path from "node:path";
1
2
  import { existsSync, readFileSync } from "fs";
3
+ const GITHUB_REPO = "earendil-works/pi";
4
+ const CHANGELOG_LINK_BASE_PATH = "packages/coding-agent";
5
+ const LEGACY_REPO_RE = /^https:\/\/github\.com\/(?:badlogic|earendil-works)\/pi-mono(?=\/|$)/;
6
+ const URL_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;
7
+ const INLINE_MARKDOWN_LINK_RE = /(!?\[[^\]\n]+\]\()([^\s)]+)((?:\s+[^)]*)?\))/g;
8
+ function entryVersion(entry) {
9
+ return `${entry.major}.${entry.minor}.${entry.patch}`;
10
+ }
11
+ function normalizeTag(version) {
12
+ const versionString = typeof version === "string" ? version : entryVersion(version);
13
+ return versionString.startsWith("v") ? versionString : `v${versionString}`;
14
+ }
15
+ function splitLocalTarget(target) {
16
+ const hashIndex = target.indexOf("#");
17
+ const beforeHash = hashIndex === -1 ? target : target.slice(0, hashIndex);
18
+ const fragment = hashIndex === -1 ? "" : target.slice(hashIndex);
19
+ const queryIndex = beforeHash.indexOf("?");
20
+ if (queryIndex === -1) {
21
+ return { fragment, pathPart: beforeHash, query: "" };
22
+ }
23
+ return {
24
+ fragment,
25
+ pathPart: beforeHash.slice(0, queryIndex),
26
+ query: beforeHash.slice(queryIndex),
27
+ };
28
+ }
29
+ function normalizePathPart(value) {
30
+ return value.replaceAll("\\", "/");
31
+ }
32
+ function resolveRepositoryPath(targetPath) {
33
+ const normalizedTarget = normalizePathPart(targetPath);
34
+ const joined = normalizedTarget.startsWith("/")
35
+ ? path.posix.normalize(normalizedTarget.replace(/^\/+/, ""))
36
+ : path.posix.normalize(path.posix.join(CHANGELOG_LINK_BASE_PATH, normalizedTarget));
37
+ if (joined === "." || joined.startsWith("../") || joined === "..") {
38
+ return undefined;
39
+ }
40
+ return joined;
41
+ }
42
+ function isDirectoryTarget(originalPath, repositoryPath) {
43
+ if (originalPath.endsWith("/")) {
44
+ return true;
45
+ }
46
+ const basename = path.posix.basename(repositoryPath);
47
+ return !basename.includes(".");
48
+ }
49
+ function normalizeChangelogLinkTarget(target, tag) {
50
+ let canonicalTarget = target.replace(LEGACY_REPO_RE, `https://github.com/${GITHUB_REPO}`);
51
+ const repoUrl = `https://github.com/${GITHUB_REPO}`;
52
+ for (const route of ["blob", "tree"]) {
53
+ for (const branch of ["main", "master"]) {
54
+ const floatingRefPrefix = `${repoUrl}/${route}/${branch}/`;
55
+ if (canonicalTarget.startsWith(floatingRefPrefix)) {
56
+ canonicalTarget = `${repoUrl}/${route}/${tag}/${canonicalTarget.slice(floatingRefPrefix.length)}`;
57
+ }
58
+ }
59
+ }
60
+ if (canonicalTarget.startsWith("#") || canonicalTarget.startsWith("//") || URL_SCHEME_RE.test(canonicalTarget)) {
61
+ return canonicalTarget;
62
+ }
63
+ const { fragment, pathPart, query } = splitLocalTarget(canonicalTarget);
64
+ if (!pathPart) {
65
+ return canonicalTarget;
66
+ }
67
+ const repositoryPath = resolveRepositoryPath(pathPart);
68
+ if (!repositoryPath) {
69
+ return canonicalTarget;
70
+ }
71
+ const route = isDirectoryTarget(pathPart, repositoryPath) ? "tree" : "blob";
72
+ return `https://github.com/${GITHUB_REPO}/${route}/${tag}/${encodeURI(repositoryPath)}${query}${fragment}`;
73
+ }
74
+ export function normalizeChangelogLinks(markdown, version) {
75
+ const tag = normalizeTag(version);
76
+ return markdown.replace(INLINE_MARKDOWN_LINK_RE, (_match, prefix, target, suffix) => {
77
+ return `${prefix}${normalizeChangelogLinkTarget(target, tag)}${suffix}`;
78
+ });
79
+ }
2
80
  /**
3
81
  * Parse changelog entries from CHANGELOG.md
4
82
  * Scans for ## lines and collects content until next ## or EOF
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/utils/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAS9C;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,aAAqB,EAAoB;IACvE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,OAAO,GAAG,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,OAAO,GAAqB,EAAE,CAAC;QAErC,IAAI,YAAY,GAAa,EAAE,CAAC;QAChC,IAAI,cAAc,GAA2D,IAAI,CAAC;QAElF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,qDAAqD;YACrD,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,gCAAgC;gBAChC,IAAI,cAAc,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC/C,OAAO,CAAC,IAAI,CAAC;wBACZ,GAAG,cAAc;wBACjB,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE;qBACvC,CAAC,CAAC;gBACJ,CA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AK;QAAE,OAAO,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;IACtD,IAAI,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;IACtD,OAAO,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;AAAA,CAC3B;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAAyB,EAAE,WAAmB,EAAoB;IAC/F,oBAAoB;IACpB,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,IAAI,GAAmB;QAC5B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QACpB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QACpB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QACpB,OAAO,EAAE,EAAE;KACX,CAAC;IAEF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA,CACnE;AAED,2DAA2D;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["import { existsSync, readFileSync } from \"fs\";\n\nexport interface ChangelogEntry {\n\tmajor: number;\n\tminor: number;\n\tpatch: number;\n\tcontent: string;\n}\n\n/**\n * Parse changelog entries from CHANGELOG.md\n * Scans for ## lines and collects content until next ## or EOF\n */\nexport function parseChangelog(changelogPath: string): ChangelogEntry[] {\n\tif (!existsSync(changelogPath)) {\n\t\treturn [];\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(changelogPath, \"utf-8\");\n\t\tconst lines = content.split(\"\\n\");\n\t\tconst entries: ChangelogEntry[] = [];\n\n\t\tlet currentLines: string[] = [];\n\t\tlet currentVersion: { major: number; minor: number; patch: number } | null = null;\n\n\t\tfor (const line of lines) {\n\t\t\t// Check if this is a version header (## [x.y.z] ...)\n\t\t\tif (line.startsWith(\"## \")) {\n\t\t\t\t// Save previous entry if exists\n\t\t\t\tif (currentVersion && currentLines.length > 0) {\n\t\t\t\t\tentries.push({\n\t\t\t\t\t\t...currentVersion,\n\t\t\t\t\t\tcontent: currentLines.join(\"\\n\").trim(),\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Try to parse version from this line\n\t\t\t\tconst versionMatch = line.match(/##\\s+\\[?(\\d+)\\.(\\d+)\\.(\\d+)\\]?/);\n\t\t\t\tif (versionMatch) {\n\t\t\t\t\tcurrentVersion = {\n\t\t\t\t\t\tmajor: Number.parseInt(versionMatch[1], 10),\n\t\t\t\t\t\tminor: Number.parseInt(versionMatch[2], 10),\n\t\t\t\t\t\tpatch: Number.parseInt(versionMatch[3], 10),\n\t\t\t\t\t};\n\t\t\t\t\tcurrentLines = [line];\n\t\t\t\t} else {\n\t\t\t\t\t// Reset if we can't parse version\n\t\t\t\t\tcurrentVersion = null;\n\t\t\t\t\tcurrentLines = [];\n\t\t\t\t}\n\t\t\t} else if (currentVersion) {\n\t\t\t\t// Collect lines for current version\n\t\t\t\tcurrentLines.push(line);\n\t\t\t}\n\t\t}\n\n\t\t// Save last entry\n\t\tif (currentVersion && currentLines.length > 0) {\n\t\t\tentries.push({\n\t\t\t\t...currentVersion,\n\t\t\t\tcontent: currentLines.join(\"\\n\").trim(),\n\t\t\t});\n\t\t}\n\n\t\treturn entries;\n\t} catch (error) {\n\t\tconsole.error(`Warning: Could not parse changelog: ${error}`);\n\t\treturn [];\n\t}\n}\n\n/**\n * Compare versions. Returns: -1 if v1 < v2, 0 if v1 === v2, 1 if v1 > v2\n */\nexport function compareVersions(v1: ChangelogEntry, v2: ChangelogEntry): number {\n\tif (v1.major !== v2.major) return v1.major - v2.major;\n\tif (v1.minor !== v2.minor) return v1.minor - v2.minor;\n\treturn v1.patch - v2.patch;\n}\n\n/**\n * Get entries newer than lastVersion\n */\nexport function getNewEntries(entries: ChangelogEntry[], lastVersion: string): ChangelogEntry[] {\n\t// Parse lastVersion\n\tconst parts = lastVersion.split(\".\").map(Number);\n\tconst last: ChangelogEntry = {\n\t\tmajor: parts[0] || 0,\n\t\tminor: parts[1] || 0,\n\t\tpatch: parts[2] || 0,\n\t\tcontent: \"\",\n\t};\n\n\treturn entries.filter((entry) => compareVersions(entry, last) > 0);\n}\n\n// Re-export getChangelogPath from paths.ts for convenience\nexport { getChangelogPath } from \"../config.ts\";\n"]}
1
+ {"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/utils/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAS9C,MAAM,WAAW,GAAG,mBAAmB,CAAC;AACxC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AACzD,MAAM,cAAc,GAAG,sEAAsE,CAAC;AAC9F,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAC7C,MAAM,uBAAuB,GAAG,+CAA+C,CAAC;AAEhF,SAAS,YAAY,CAAC,KAAqB,EAAU;IACpD,OAAO,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;AAAA,CACtD;AAED,SAAS,YAAY,CAAC,OAAgC,EAAU;IAC/D,MAAM,aAAa,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACpF,OAAO,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,CAAC;AAAA,CAC3E;AAED,SAAS,gBAAgB,CAAC,MAAc,EAAyD;IAChG,MA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AAe,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA,CACnE;AAED,2DAA2D;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["import path from \"node:path\";\nimport { existsSync, readFileSync } from \"fs\";\n\nexport interface ChangelogEntry {\n\tmajor: number;\n\tminor: number;\n\tpatch: number;\n\tcontent: string;\n}\n\nconst GITHUB_REPO = \"earendil-works/pi\";\nconst CHANGELOG_LINK_BASE_PATH = \"packages/coding-agent\";\nconst LEGACY_REPO_RE = /^https:\\/\\/github\\.com\\/(?:badlogic|earendil-works)\\/pi-mono(?=\\/|$)/;\nconst URL_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;\nconst INLINE_MARKDOWN_LINK_RE = /(!?\\[[^\\]\\n]+\\]\\()([^\\s)]+)((?:\\s+[^)]*)?\\))/g;\n\nfunction entryVersion(entry: ChangelogEntry): string {\n\treturn `${entry.major}.${entry.minor}.${entry.patch}`;\n}\n\nfunction normalizeTag(version: string | ChangelogEntry): string {\n\tconst versionString = typeof version === \"string\" ? version : entryVersion(version);\n\treturn versionString.startsWith(\"v\") ? versionString : `v${versionString}`;\n}\n\nfunction splitLocalTarget(target: string): { fragment: string; pathPart: string; query: string } {\n\tconst hashIndex = target.indexOf(\"#\");\n\tconst beforeHash = hashIndex === -1 ? target : target.slice(0, hashIndex);\n\tconst fragment = hashIndex === -1 ? \"\" : target.slice(hashIndex);\n\tconst queryIndex = beforeHash.indexOf(\"?\");\n\n\tif (queryIndex === -1) {\n\t\treturn { fragment, pathPart: beforeHash, query: \"\" };\n\t}\n\n\treturn {\n\t\tfragment,\n\t\tpathPart: beforeHash.slice(0, queryIndex),\n\t\tquery: beforeHash.slice(queryIndex),\n\t};\n}\n\nfunction normalizePathPart(value: string): string {\n\treturn value.replaceAll(\"\\\\\", \"/\");\n}\n\nfunction resolveRepositoryPath(targetPath: string): string | undefined {\n\tconst normalizedTarget = normalizePathPart(targetPath);\n\tconst joined = normalizedTarget.startsWith(\"/\")\n\t\t? path.posix.normalize(normalizedTarget.replace(/^\\/+/, \"\"))\n\t\t: path.posix.normalize(path.posix.join(CHANGELOG_LINK_BASE_PATH, normalizedTarget));\n\n\tif (joined === \".\" || joined.startsWith(\"../\") || joined === \"..\") {\n\t\treturn undefined;\n\t}\n\n\treturn joined;\n}\n\nfunction isDirectoryTarget(originalPath: string, repositoryPath: string): boolean {\n\tif (originalPath.endsWith(\"/\")) {\n\t\treturn true;\n\t}\n\n\tconst basename = path.posix.basename(repositoryPath);\n\treturn !basename.includes(\".\");\n}\n\nfunction normalizeChangelogLinkTarget(target: string, tag: string): string {\n\tlet canonicalTarget = target.replace(LEGACY_REPO_RE, `https://github.com/${GITHUB_REPO}`);\n\tconst repoUrl = `https://github.com/${GITHUB_REPO}`;\n\n\tfor (const route of [\"blob\", \"tree\"]) {\n\t\tfor (const branch of [\"main\", \"master\"]) {\n\t\t\tconst floatingRefPrefix = `${repoUrl}/${route}/${branch}/`;\n\t\t\tif (canonicalTarget.startsWith(floatingRefPrefix)) {\n\t\t\t\tcanonicalTarget = `${repoUrl}/${route}/${tag}/${canonicalTarget.slice(floatingRefPrefix.length)}`;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (canonicalTarget.startsWith(\"#\") || canonicalTarget.startsWith(\"//\") || URL_SCHEME_RE.test(canonicalTarget)) {\n\t\treturn canonicalTarget;\n\t}\n\n\tconst { fragment, pathPart, query } = splitLocalTarget(canonicalTarget);\n\tif (!pathPart) {\n\t\treturn canonicalTarget;\n\t}\n\n\tconst repositoryPath = resolveRepositoryPath(pathPart);\n\tif (!repositoryPath) {\n\t\treturn canonicalTarget;\n\t}\n\n\tconst route = isDirectoryTarget(pathPart, repositoryPath) ? \"tree\" : \"blob\";\n\treturn `https://github.com/${GITHUB_REPO}/${route}/${tag}/${encodeURI(repositoryPath)}${query}${fragment}`;\n}\n\nexport function normalizeChangelogLinks(markdown: string, version: string | ChangelogEntry): string {\n\tconst tag = normalizeTag(version);\n\treturn markdown.replace(INLINE_MARKDOWN_LINK_RE, (_match, prefix, target, suffix) => {\n\t\treturn `${prefix}${normalizeChangelogLinkTarget(target, tag)}${suffix}`;\n\t});\n}\n\n/**\n * Parse changelog entries from CHANGELOG.md\n * Scans for ## lines and collects content until next ## or EOF\n */\nexport function parseChangelog(changelogPath: string): ChangelogEntry[] {\n\tif (!existsSync(changelogPath)) {\n\t\treturn [];\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(changelogPath, \"utf-8\");\n\t\tconst lines = content.split(\"\\n\");\n\t\tconst entries: ChangelogEntry[] = [];\n\n\t\tlet currentLines: string[] = [];\n\t\tlet currentVersion: { major: number; minor: number; patch: number } | null = null;\n\n\t\tfor (const line of lines) {\n\t\t\t// Check if this is a version header (## [x.y.z] ...)\n\t\t\tif (line.startsWith(\"## \")) {\n\t\t\t\t// Save previous entry if exists\n\t\t\t\tif (currentVersion && currentLines.length > 0) {\n\t\t\t\t\tentries.push({\n\t\t\t\t\t\t...currentVersion,\n\t\t\t\t\t\tcontent: currentLines.join(\"\\n\").trim(),\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Try to parse version from this line\n\t\t\t\tconst versionMatch = line.match(/##\\s+\\[?(\\d+)\\.(\\d+)\\.(\\d+)\\]?/);\n\t\t\t\tif (versionMatch) {\n\t\t\t\t\tcurrentVersion = {\n\t\t\t\t\t\tmajor: Number.parseInt(versionMatch[1], 10),\n\t\t\t\t\t\tminor: Number.parseInt(versionMatch[2], 10),\n\t\t\t\t\t\tpatch: Number.parseInt(versionMatch[3], 10),\n\t\t\t\t\t};\n\t\t\t\t\tcurrentLines = [line];\n\t\t\t\t} else {\n\t\t\t\t\t// Reset if we can't parse version\n\t\t\t\t\tcurrentVersion = null;\n\t\t\t\t\tcurrentLines = [];\n\t\t\t\t}\n\t\t\t} else if (currentVersion) {\n\t\t\t\t// Collect lines for current version\n\t\t\t\tcurrentLines.push(line);\n\t\t\t}\n\t\t}\n\n\t\t// Save last entry\n\t\tif (currentVersion && currentLines.length > 0) {\n\t\t\tentries.push({\n\t\t\t\t...currentVersion,\n\t\t\t\tcontent: currentLines.join(\"\\n\").trim(),\n\t\t\t});\n\t\t}\n\n\t\treturn entries;\n\t} catch (error) {\n\t\tconsole.error(`Warning: Could not parse changelog: ${error}`);\n\t\treturn [];\n\t}\n}\n\n/**\n * Compare versions. Returns: -1 if v1 < v2, 0 if v1 === v2, 1 if v1 > v2\n */\nexport function compareVersions(v1: ChangelogEntry, v2: ChangelogEntry): number {\n\tif (v1.major !== v2.major) return v1.major - v2.major;\n\tif (v1.minor !== v2.minor) return v1.minor - v2.minor;\n\treturn v1.patch - v2.patch;\n}\n\n/**\n * Get entries newer than lastVersion\n */\nexport function getNewEntries(entries: ChangelogEntry[], lastVersion: string): ChangelogEntry[] {\n\t// Parse lastVersion\n\tconst parts = lastVersion.split(\".\").map(Number);\n\tconst last: ChangelogEntry = {\n\t\tmajor: parts[0] || 0,\n\t\tminor: parts[1] || 0,\n\t\tpatch: parts[2] || 0,\n\t\tcontent: \"\",\n\t};\n\n\treturn entries.filter((entry) => compareVersions(entry, last) > 0);\n}\n\n// Re-export getChangelogPath from paths.ts for convenience\nexport { getChangelogPath } from \"../config.ts\";\n"]}
package/docs/docs.json CHANGED
@@ -19,6 +19,10 @@
19
19
  "title": "Providers",
20
20
  "path": "providers.md"
21
21
  },
22
+ {
23
+ "title": "Security",
24
+ "path": "security.md"
25
+ },
22
26
  {
23
27
  "title": "Containerization",
24
28
  "path": "containerization.md"
@@ -109,7 +109,7 @@ pi -e ./my-extension.ts
109
109
 
110
110
  > **Security:** Extensions run with your full system permissions and can execute arbitrary code. Only install from sources you trust.
111
111
 
112
- Extensions are auto-discovered from:
112
+ Extensions are auto-discovered from trusted locations. Project-local `.pi/extensions` entries load only after the project is trusted.
113
113
 
114
114
  | Location | Scope |
115
115
  |----------|-------|
@@ -270,6 +270,7 @@ Run `npm install` in the extension directory, then imports from `node_modules/`
270
270
  ```
271
271
  pi starts
272
272
 
273
+ ├─► project_trust (user/global and CLI extensions only, before project resources load)
273
274
  ├─► session_start { reason: "startup" }
274
275
  └─► resources_discover { reason: "startup" }
275
276
 
@@ -334,6 +335,25 @@ exit (Ctrl+C, Ctrl+D, SIGHUP, SIGTERM)
334
335
  └─► session_shutdown
335
336
  ```
336
337
 
338
+ ### Startup Events
339
+
340
+ #### project_trust
341
+
342
+ Fired before pi decides whether to trust a project with dynamic configs (`.pi` or `.agents/skills`). It runs during startup and when session replacement (for example `/resume`) enters a cwd whose trust has not been resolved in the current process. Only user/global extensions and CLI `-e` extensions participate; project-local extensions are not loaded until after trust is resolved.
343
+
344
+ ```typescript
345
+ pi.on("project_trust", async (event, ctx) => {
346
+ // event.cwd - current working directory
347
+ // ctx has a limited trust context: cwd, mode, hasUI, and select/confirm/input/notify UI helpers
348
+ if (await ctx.ui.confirm("Trust project?", event.cwd)) {
349
+ return { trusted: "yes", remember: true };
350
+ }
351
+ return { trusted: "undecided" };
352
+ });
353
+ ```
354
+
355
+ A `project_trust` handler must return `{ trusted: "yes" | "no" | "undecided" }`. A user/global or CLI extension that returns `"yes"` or `"no"` owns the decision; the first yes/no decision wins and suppresses the built-in trust prompt. Use `remember: true` to persist a yes/no decision; otherwise it applies only to the current process. Return `"undecided"` to let later handlers or the built-in trust flow decide. Check `ctx.hasUI` before prompting. If no handler returns yes/no, normal trust resolution continues: saved `trust.json` decisions apply first, then `defaultProjectTrust` controls whether pi asks, trusts, or declines by default.
356
+
337
357
  ### Resource Events
338
358
 
339
359
  #### resources_discover
@@ -872,6 +892,12 @@ Current run mode: `"tui"`, `"rpc"`, `"json"`, or `"print"`. Use `ctx.mode === "t
872
892
 
873
893
  Current working directory.
874
894
 
895
+ ### ctx.isProjectTrusted()
896
+
897
+ Returns whether project-local trust is active for the current session context. This includes temporary trust decisions and CLI trust overrides, not just saved decisions in the global trust store.
898
+
899
+ Use this before reading project-local extension configuration that should only be honored for trusted projects.
900
+
875
901
  ### ctx.sessionManager
876
902
 
877
903
  Read-only access to session state. See [Session Format](session-format.md) for the full SessionManager API and entry types.
@@ -2255,6 +2281,7 @@ ctx.ui.pasteToEditor("pasted content");
2255
2281
 
2256
2282
  // Stack custom autocomplete behavior on top of the built-in provider
2257
2283
  ctx.ui.addAutocompleteProvider((current) => ({
2284
+ triggerCharacters: ["#"],
2258
2285
  async getSuggestions(lines, line, col, options) {
2259
2286
  const beforeCursor = (lines[line] ?? "").slice(0, col);
2260
2287
  const match = beforeCursor.match(/(?:^|[ \t])#([^\s#]*)$/);
@@ -2303,7 +2330,7 @@ Custom working-indicator frames are rendered verbatim. If you want colors, add t
2303
2330
 
2304
2331
  ### Autocomplete Providers
2305
2332
 
2306
- Use `ctx.ui.addAutocompleteProvider()` to stack custom autocomplete logic on top of the built-in slash-command and path provider.
2333
+ Use `ctx.ui.addAutocompleteProvider()` to stack custom autocomplete logic on top of the built-in slash-command and path provider. Set `triggerCharacters` for custom natural triggers such as `$`.
2307
2334
 
2308
2335
  Typical pattern:
2309
2336
 
@@ -2315,6 +2342,7 @@ Typical pattern:
2315
2342
  ```typescript
2316
2343
  pi.on("session_start", (_event, ctx) => {
2317
2344
  ctx.ui.addAutocompleteProvider((current) => ({
2345
+ triggerCharacters: ["#"],
2318
2346
  async getSuggestions(lines, cursorLine, cursorCol, options) {
2319
2347
  const line = lines[cursorLine] ?? "";
2320
2348
  const beforeCursor = line.slice(0, cursorCol);
@@ -2567,6 +2595,7 @@ All examples in [examples/extensions/](../examples/extensions/).
2567
2595
  | `shutdown-command.ts` | Graceful shutdown command | `registerCommand`, `shutdown()` |
2568
2596
  | **Events & Gates** |||
2569
2597
  | `permission-gate.ts` | Block dangerous commands | `on("tool_call")`, `ui.confirm` |
2598
+ | `project-trust.ts` | Decide or defer project trust from a user/global or CLI extension | `on("project_trust")`, trust UI, required trust result |
2570
2599
  | `protected-paths.ts` | Block writes to specific paths | `on("tool_call")` |
2571
2600
  | `confirm-destructive.ts` | Confirm session changes | `on("session_before_switch")`, `on("session_before_fork")` |
2572
2601
  | `dirty-repo-guard.ts` | Warn on dirty git repo | `on("session_before_*")`, `exec` |
package/docs/index.md CHANGED
@@ -41,6 +41,7 @@ For the full first-run flow, see [Quickstart](quickstart.md).
41
41
  - [Quickstart](quickstart.md) - install, authenticate, and run a first session.
42
42
  - [Using Pi](usage.md) - interactive mode, slash commands, context files, and CLI reference.
43
43
  - [Providers](providers.md) - subscription and API-key setup for built-in providers.
44
+ - [Security](security.md) - project trust, sandbox boundaries, and vulnerability reporting.
44
45
  - [Containerization](containerization.md) - sandbox pi with OpenShell, Gondolin, or Docker.
45
46
  - [Settings](settings.md) - global and project settings.
46
47
  - [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
package/docs/models.md CHANGED
@@ -198,7 +198,7 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
198
198
  | Field | Required | Default | Description |
199
199
  |-------|----------|---------|-------------|
200
200
  | `id` | Yes | — | Model identifier (passed to the API) |
201
- | `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown in model details/status text. |
201
+ | `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown as secondary model detail text. |
202
202
  | `api` | No | provider's `api` | Override provider's API for this model |
203
203
  | `reasoning` | No | `false` | Supports extended thinking |
204
204
  | `thinkingLevelMap` | No | omitted | Maps pi thinking levels to provider values and marks unsupported levels (see below) |
@@ -209,8 +209,8 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
209
209
  | `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
210
210
 
211
211
  Current behavior:
212
- - `/model` and `--list-models` list entries by model `id`.
213
- - The configured `name` is used for model matching and detail/status text.
212
+ - `/model`, `--list-models`, and the interactive footer display entries by model `id`.
213
+ - The configured `name` is used for model matching and secondary model detail text. It does not replace the footer/status-bar model id.
214
214
 
215
215
  ### Thinking Level Map
216
216
 
@@ -320,6 +320,7 @@ Behavior notes:
320
320
  - `modelOverrides` are applied to built-in provider models.
321
321
  - Unknown model IDs are ignored.
322
322
  - You can combine provider-level `baseUrl`/`headers` with `modelOverrides`.
323
+ - Overriding `name` changes model matching and secondary detail text only; the footer and primary model lists continue to show the model `id`.
323
324
  - If `models` is also defined for a provider, custom models are merged after built-in overrides. A custom model with the same `id` replaces the overridden built-in model entry.
324
325
 
325
326
  ## Anthropic Messages Compatibility
package/docs/packages.md CHANGED
@@ -38,7 +38,7 @@ pi update --extension npm:@foo/bar
38
38
 
39
39
  These commands manage pi packages, not the pi CLI installation. To uninstall pi itself, see [Quickstart](quickstart.md#uninstall).
40
40
 
41
- By default, `install` and `remove` write to user settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead. Project settings can be shared with your team, and pi installs any missing packages automatically on startup.
41
+ By default, `install` and `remove` write to user settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead. Project settings can be shared with your team, and pi installs any missing packages automatically on startup after the project is trusted.
42
42
 
43
43
  To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
44
44
 
@@ -9,7 +9,7 @@ Prompt templates are Markdown snippets that expand into full prompts. Type `/nam
9
9
  Pi loads prompt templates from:
10
10
 
11
11
  - Global: `~/.pi/agent/prompts/*.md`
12
- - Project: `.pi/prompts/*.md`
12
+ - Project: `.pi/prompts/*.md` (only after the project is trusted)
13
13
  - Packages: `prompts/` directories or `pi.prompts` entries in `package.json`
14
14
  - Settings: `prompts` array with files or directories
15
15
  - CLI: `--prompt-template <path>` (repeatable)
@@ -64,10 +64,11 @@ Type `/` followed by the template name in the editor. Autocomplete shows availab
64
64
 
65
65
  ## Arguments
66
66
 
67
- Templates support positional arguments and simple slicing:
67
+ Templates support positional arguments, defaults, and simple slicing:
68
68
 
69
69
  - `$1`, `$2`, ... positional args
70
70
  - `$@` or `$ARGUMENTS` for all args joined
71
+ - `${1:-default}` uses arg 1 when present/non-empty, otherwise `default`
71
72
  - `${@:N}` for args from the Nth position (1-indexed)
72
73
  - `${@:N:L}` for `L` args starting at N
73
74
 
@@ -80,6 +81,12 @@ description: Create a component
80
81
  Create a React component named $1 with features: $@
81
82
  ```
82
83
 
84
+ Default values are useful for optional arguments:
85
+
86
+ ```markdown
87
+ Summarize the current state in ${1:-7} bullet points.
88
+ ```
89
+
83
90
  Usage: `/component Button "onClick handler" "disabled support"`
84
91
 
85
92
  ## Loading Rules
package/docs/sdk.md CHANGED
@@ -1112,6 +1112,11 @@ createEventBus
1112
1112
 
1113
1113
  // Helpers
1114
1114
  defineTool
1115
+ getAgentDir
1116
+ getPackageDir
1117
+ getReadmePath
1118
+ getDocsPath
1119
+ getExamplesPath
1115
1120
 
1116
1121
  // Session management
1117
1122
  SessionManager
@@ -0,0 +1,55 @@
1
+ # Security
2
+
3
+ Pi is a local coding agent. It runs with the permissions of the user account that starts it, and it treats files writable by that user as inside the same local trust boundary.
4
+
5
+ ## Project Trust
6
+
7
+ Project trust controls whether pi loads project-local settings, resources, packages, and extensions. It is not a sandbox and it does not restrict what the model can ask tools to do after you start working in a directory.
8
+
9
+ Pi considers a project to have trust inputs when it finds any of these from the current working directory:
10
+
11
+ - `.pi/` in the current directory
12
+ - `.agents/skills` in the current directory or an ancestor directory
13
+
14
+ When an interactive session starts in a project with configs in `.pi` or `.agents/skills` and no saved decision for the current directory or a parent directory, pi follows `defaultProjectTrust` from global settings. The default value is `"ask"`, which asks whether to trust the project when UI is available. Saved decisions are stored by canonical directory in `~/.pi/agent/trust.json`, and the closest saved decision on the current or parent path applies before the global default.
15
+
16
+ Trusting a project allows pi to load trust-gated project inputs, including:
17
+
18
+ - `.pi/settings.json`
19
+ - `.pi` resources such as extensions, skills, prompt templates, themes, and system prompt files
20
+ - missing project packages configured through project settings
21
+ - project-local extensions and project package-managed extensions
22
+
23
+ Declining trust skips protected resources. `AGENTS.md` and `CLAUDE.md` context files are loaded regardless of project trust unless context loading is disabled. Before trust is resolved, pi only loads context files, user/global extensions, and CLI `-e` extensions. User/global and CLI extensions can handle the `project_trust` event; the first extension that returns a yes/no decision owns the decision.
24
+
25
+ Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, `defaultProjectTrust: "ask"` and `"never"` ignore such resources, while `"always"` trusts them. Use `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
26
+
27
+ ## No Built-in Sandbox
28
+
29
+ Pi does not include a built-in sandbox. Built-in tools can read files, write files, edit files, and run shell commands with the permissions of the pi process. Extensions are TypeScript modules that run with the same permissions. Package installs, shell commands, language servers, test commands, and other developer tools behave as ordinary local processes.
30
+
31
+ This is intentional. Pi is designed to operate on local source trees, invoke project toolchains, and integrate with the user's existing development environment. A partial in-process sandbox would be easy to misunderstand as a security boundary while still depending on the host shell, filesystem, package managers, credentials, and extension code. Real isolation needs to come from the operating system or a virtualization/container boundary.
32
+
33
+ Project trust is only an input-loading guard. It prevents a repository from silently changing pi's settings or extensions before you approve it. It does not make untrusted code, untrusted prompts, or untrusted model output safe. Prompt injection from repository files, comments, documentation, context files, or build output is expected local-agent risk and cannot be reliably prevented by pi.
34
+
35
+ ## Running Untrusted or Unmonitored Work
36
+
37
+ For untrusted repositories, generated code you do not intend to monitor closely, or unattended automation, run pi in a contained environment. Use a container, VM, micro-VM, remote sandbox, or policy-controlled sandbox with only the files and credentials required for the task.
38
+
39
+ Common patterns are documented in [Containerization](containerization.md):
40
+
41
+ - run the whole `pi` process inside OpenShell or Docker
42
+ - run host pi while routing built-in tool execution into a Gondolin micro-VM
43
+ - mount only the workspace paths the agent should access
44
+ - avoid mounting host `~/.pi/agent` unless the container should access host sessions, settings, and credentials
45
+ - pass the minimum required API keys or use short-lived credentials
46
+ - restrict network access when the task does not need it
47
+ - review diffs and outputs before copying results back to trusted systems
48
+
49
+ If you bind-mount a host workspace read/write, writes from inside the container or VM can still modify host files. Use read-only mounts or copy files into and out of the sandbox when you need stronger protection from unintended writes.
50
+
51
+ ## Reporting Security Issues
52
+
53
+ To report a security issue, follow the repository [Security Policy](https://github.com/earendil-works/pi-mono/blob/main/SECURITY.md). Do not open a public issue for security-sensitive reports.
54
+
55
+ Expected local-agent behavior, lack of a built-in sandbox, prompt injection from untrusted content, and behavior of user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a real privilege-boundary bypass or shows how pi grants access that the local user did not already have.
package/docs/settings.md CHANGED
@@ -9,6 +9,18 @@ Pi uses JSON settings files with project settings overriding global settings.
9
9
 
10
10
  Edit directly or use `/settings` for common options.
11
11
 
12
+ ## Project Trust
13
+
14
+ On interactive startup, pi asks before trusting a project folder that contains trust-gated project inputs and has no saved decision for the folder or a parent folder in `~/.pi/agent/trust.json`. Trusting a project allows pi to load `.pi/settings.json` and `.pi` resources, install missing project packages, and execute project extensions.
15
+
16
+ Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore trust-gated project inputs, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
17
+
18
+ If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.pi/agent/settings.json`, or change it with `/settings`.
19
+
20
+ `pi config` and package commands use the same project trust flow. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
21
+
22
+ Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.pi/agent/trust.json` only; the current session is not reloaded, so restart pi for changes to take effect.
23
+
12
24
  ## All Settings
13
25
 
14
26
  ### Model & Thinking
@@ -40,6 +52,7 @@ Edit directly or use `/settings` for common options.
40
52
  |---------|------|---------|-------------|
41
53
  | `theme` | string | `"dark"` | Theme name (`"dark"`, `"light"`, or custom) |
42
54
  | `quietStartup` | boolean | `false` | Hide startup header |
55
+ | `defaultProjectTrust` | string | `"ask"` | Fallback project trust behavior: `"ask"`, `"always"`, or `"never"`. Global setting only |
43
56
  | `collapseChangelog` | boolean | `false` | Show condensed changelog after updates |
44
57
  | `enableInstallTelemetry` | boolean | `true` | Send an anonymous install/update version ping after first install or changelog-detected updates. This does not control update checks |
45
58
  | `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
package/docs/skills.md CHANGED
@@ -26,7 +26,7 @@ Pi loads skills from:
26
26
  - Global:
27
27
  - `~/.pi/agent/skills/`
28
28
  - `~/.agents/skills/`
29
- - Project:
29
+ - Project (only after the project is trusted):
30
30
  - `.pi/skills/`
31
31
  - `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
32
32
  - Packages: `skills/` directories or `pi.skills` entries in `package.json`
@@ -40,7 +40,7 @@ If you want `Shift+Enter` to keep working in tmux via that remap, add `ctrl+j` t
40
40
 
41
41
  ## WezTerm
42
42
 
43
- Create `~/.wezterm.lua`:
43
+ WezTerm usually works out of the box for `Shift+Enter` via xterm modifyOtherKeys. To use the Kitty keyboard protocol explicitly, create `~/.wezterm.lua`:
44
44
 
45
45
  ```lua
46
46
  local wezterm = require 'wezterm'
@@ -49,16 +49,50 @@ config.enable_kitty_keyboard = true
49
49
  return config
50
50
  ```
51
51
 
52
+ On macOS, WezTerm binds `Option+Enter` to fullscreen by default. To use `Option+Enter` for pi follow-up queueing, add this key override:
53
+
54
+ ```lua
55
+ local wezterm = require 'wezterm'
56
+ local config = wezterm.config_builder()
57
+ config.keys = {
58
+ {
59
+ key = 'Enter',
60
+ mods = 'ALT',
61
+ action = wezterm.action.SendString('\x1b[13;3u'),
62
+ },
63
+ }
64
+ return config
65
+ ```
66
+
67
+ If you already have a `config.keys` table, add the entry to it.
68
+
52
69
  On WSL, WezTerm may require a visible hardware cursor for IME candidate window positioning. If CJK IME candidates do not follow the text cursor, set `PI_HARDWARE_CURSOR=1` before running pi or set `showHardwareCursor` to `true` in settings.
53
70
 
71
+ ## Alacritty
72
+
73
+ Alacritty usually works out of the box for `Shift+Enter`. On macOS, `Option+Enter` may arrive as plain `Enter`. To use `Option+Enter` for pi follow-up queueing, add to `~/.config/alacritty/alacritty.toml`:
74
+
75
+ ```toml
76
+ [[keyboard.bindings]]
77
+ key = "Enter"
78
+ mods = "Alt"
79
+ chars = "\u001b[13;3u"
80
+ ```
81
+
82
+ Restart Alacritty after changing the config.
83
+
54
84
  ## VS Code (Integrated Terminal)
55
85
 
86
+ VS Code 1.109.5 and newer enable Kitty keyboard protocol in the integrated terminal by default, so `Shift+Enter` should work out of the box.
87
+
88
+ VS Code versions older than 1.109.5 need an explicit terminal keybinding for `Shift+Enter`.
89
+
56
90
  `keybindings.json` locations:
57
91
  - macOS: `~/Library/Application Support/Code/User/keybindings.json`
58
92
  - Linux: `~/.config/Code/User/keybindings.json`
59
93
  - Windows: `%APPDATA%\\Code\\User\\keybindings.json`
60
94
 
61
- Add to `keybindings.json` to enable `Shift+Enter` for multi-line input:
95
+ Add to `keybindings.json`:
62
96
 
63
97
  ```json
64
98
  {
package/docs/themes.md CHANGED
@@ -20,7 +20,7 @@ Pi loads themes from:
20
20
 
21
21
  - Built-in: `dark`, `light`
22
22
  - Global: `~/.pi/agent/themes/*.json`
23
- - Project: `.pi/themes/*.json`
23
+ - Project: `.pi/themes/*.json` (only after the project is trusted)
24
24
  - Packages: `themes/` directories or `pi.themes` entries in `package.json`
25
25
  - Settings: `themes` array with files or directories
26
26
  - CLI: `--theme <path>` (repeatable)
package/docs/tmux.md CHANGED
@@ -18,7 +18,7 @@ tmux kill-server
18
18
  tmux
19
19
  ```
20
20
 
21
- Pi requests extended key reporting automatically when Kitty keyboard protocol is not available. With `extended-keys-format csi-u`, tmux forwards modified keys in CSI-u format, which is the most reliable configuration.
21
+ Pi requests extended key reporting automatically when Kitty keyboard protocol is not available. With `extended-keys-format csi-u`, tmux forwards modified keys in CSI-u format, which is the most reliable configuration. The `extended-keys-format` option requires tmux 3.5 or later.
22
22
 
23
23
  ## Why `csi-u` Is Recommended
24
24
 
@@ -57,5 +57,7 @@ This affects the default keybindings (`Enter` to submit, `Shift+Enter` for newli
57
57
 
58
58
  ## Requirements
59
59
 
60
- - tmux 3.2 or later (run `tmux -V` to check)
60
+ - tmux 3.5 or later for `extended-keys-format csi-u` (run `tmux -V` to check)
61
61
  - A terminal emulator that supports extended keys (Ghostty, Kitty, iTerm2, WezTerm, Windows Terminal)
62
+
63
+ With tmux 3.2 through 3.4, omit `extended-keys-format csi-u`; Pi still supports tmux's default xterm `modifyOtherKeys` format.
package/docs/usage.md CHANGED
@@ -110,6 +110,21 @@ Replace the default system prompt with:
110
110
 
111
111
  Append to the default prompt without replacing it with `APPEND_SYSTEM.md` in either location.
112
112
 
113
+ ### Project Trust
114
+
115
+ On interactive startup, pi asks before trusting a project folder that contains project-local extensions or settings and has no saved decision for the folder or a parent folder in `~/.pi/agent/trust.json`. Trusting a project allows pi to load `.pi/settings.json` and `.pi` resources, install missing project packages, and execute project extensions.
116
+
117
+ Before the trust decision, pi loads only context files, user/global extensions, and CLI `-e` extensions so they can handle the `project_trust` event. Project-local extensions, project package-managed extensions, and project settings are loaded only after the project is trusted. This split also applies when switching to a session from a different cwd whose trust has not been resolved in the current process.
118
+
119
+ Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore trust-gated project inputs, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
120
+
121
+ If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.pi/agent/settings.json`, or change it with `/settings`.
122
+
123
+ `pi config` and package commands use the same project trust flow. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
124
+
125
+ Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.pi/agent/trust.json` only; the current session is not reloaded, so restart pi for changes to take effect.
126
+
127
+
113
128
  ## Exporting and Sharing Sessions
114
129
 
115
130
  Use `/export [file]` to write a session to HTML.
@@ -138,7 +153,7 @@ pi list # List installed packages
138
153
  pi config # Enable/disable package resources
139
154
  ```
140
155
 
141
- These commands manage pi packages, not the pi CLI installation. To uninstall pi itself, see [Quickstart](quickstart.md#uninstall).
156
+ These commands manage pi packages, not the pi CLI installation. To uninstall pi itself, see [Quickstart](quickstart.md#uninstall). `pi config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command.
142
157
 
143
158
  See [Pi Packages](packages.md) for package sources and security notes.
144
159
 
@@ -219,6 +234,8 @@ pi --no-extensions -e ./my-extension.ts
219
234
  | `--system-prompt <text>` | Replace default prompt; context files and skills are still appended |
220
235
  | `--append-system-prompt <text>` | Append to system prompt |
221
236
  | `--verbose` | Force verbose startup |
237
+ | `-a`, `--approve` | Trust project-local files for this run |
238
+ | `-na`, `--no-approve` | Ignore project-local files for this run |
222
239
  | `-h`, `--help` | Show help |
223
240
  | `-v`, `--version` | Show version |
224
241
 
@@ -19,6 +19,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
19
19
  | Extension | Description |
20
20
  |-----------|-------------|
21
21
  | `permission-gate.ts` | Prompts for confirmation before dangerous bash commands (rm -rf, sudo, etc.) |
22
+ | `project-trust.ts` | Demonstrates the `project_trust` event for user/global and CLI extensions |
22
23
  | `protected-paths.ts` | Blocks writes to protected paths (.env, .git/, node_modules/) |
23
24
  | `confirm-destructive.ts` | Confirms before destructive session actions (clear, switch, fork) |
24
25
  | `dirty-repo-guard.ts` | Prevents session changes with uncommitted git changes |
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.78.1",
3
+ "version": "0.79.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.78.1",
9
+ "version": "0.79.1",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.78.1",
4
+ "version": "0.79.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.78.1",
4
+ "version": "0.79.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
- "version": "0.78.1",
3
+ "version": "0.79.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-gondolin",
9
- "version": "0.78.1",
9
+ "version": "0.79.1",
10
10
  "dependencies": {
11
11
  "@earendil-works/gondolin": "0.12.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
3
  "private": true,
4
- "version": "0.78.1",
4
+ "version": "0.79.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",