pando-ai 0.6.1 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pando-ai",
3
- "version": "0.6.1",
3
+ "version": "0.6.5",
4
4
  "description": "AI coding firewall for Codex and Claude Code: supervised launchers, Pando MCP, policy enforcement, Claude hooks, and local provider gateway.",
5
5
  "bin": {
6
6
  "pando-ai": "bin/pando-ai.js"
@@ -47,11 +47,10 @@
47
47
  "replace-body(path, expectedHash, with, forceReplaceWillBreakSyntax)",
48
48
  "change-signature(path, expectedHash, parameters, returnType, makeAsync, makeSyncFromAsync, forceChangeWillBreakSyntax, boundary, batchSaves)",
49
49
  "filter-map-reduce(query, transforms, apply)",
50
- "shell-command(command, reason, timeoutMs, shell, maxOutputBytes)",
50
+ "shell-command(command, reasonWhyNotUsingPandoNativeTools, timeoutMs, shell, maxOutputBytes)",
51
51
  "list-snapshots(offset, limit)",
52
52
  "diff-snapshots(head, base, page)",
53
53
  "get-snapshot-trailers(snapshotId, keys)",
54
- "get-snapshot-file(snapshotId, path, oid)",
55
54
  "snapshot-worktree(message, trailers)",
56
55
  "restore-snapshot(snapshotId, trailers, page, shouldCreateNewSnapshot, deleteSnapshotId)",
57
56
  "restore-files(snapshotId, files, page, trailers)",
@@ -64,7 +63,7 @@
64
63
  "name": "read-this-first",
65
64
  "category": "pando",
66
65
  "signature": "read-this-first()",
67
- "description": "Pando is an AST-aware code navigation and editing layer for large repos. It keeps a light index of supported source files, uses that index to narrow candidate files, then parses exact AST details at query or edit time.\n\nFiles do not need to be indexed first. To work in a file that is not yet in the index, pass its workspace-relative path directly: as scope.files or scope.node on find-nodes, or as the target path of a writer. Pando indexes that file just-in-time, in any supported language. The light index only limits workspace-wide discovery (scope.workspace); an explicit file path always works even if the file has never been indexed. This means you can edit any AST node in any supported file without a separate indexing step.\n\nUse Pando for source-code search, navigation, references, callers, exports, renames, inserts, replacements, and deletes. Use shell/text tools for builds, tests, generated files, non-code files, and unsupported languages.\n\nRead next:\n- workspace-overview: quick inventory of indexed files and symbols.\n- find-nodes: search by language, scope, and Datalog; request include.self/topN when you need paths and hashes for edits.\n- get-content: read files or node paths returned by search tools.\n- list-exports, find-references, and find-callers: follow symbols before changing them.\n- Writers: rename, replace, replace-body, insert, and delete. Re-run find-nodes first if a path or hash is stale.\n\nUnnamed nodes can and should still be edited with Pando. Statements, returns, calls, arguments, branches, literals, and other unnamed syntax are normal AST nodes; find them by starting from a named entity or file, then narrowing by kind, text, role, parent, or child index.\n\nExamples:\n- In one find-nodes call, search for a function by name within the workspace and request include.self/topN to get the exact node path and hash.\n- To edit a statement inside a named function, find the function with include.self, then call find-nodes again with scope.node set to { path, expectedHash } for that function. Use predicates such as :node/kind \"ReturnStatement\" or :node/text \"oldValue\", then pass the returned statement path and hash without @ to replace or insert; delete uses expectedHashes.\n- For scripts or top-level code, scope find-nodes to the file path instead of a named node, find the statement by kind/text/role/index, then edit that returned node with a writer.\n- Insert code is literal: include the newline and indentation you want when inserting before or after a statement anchor.\n- Edit an unnamed node end to end: find the enclosing function with find-nodes include.self to get its { path, expectedHash }; re-run find-nodes with scope.node set to that path+hash and a predicate like :node/kind \"ReturnStatement\" or :node/text \"return null\" to get the exact statement's path and hash; then call replace with that path and expectedHash (no @) to rewrite it, or insert with an anchor to add code beside it. No indexing step is needed even if the file was never indexed.",
66
+ "description": "Pando is an AST-aware code navigation and editing layer for large repos. It keeps a light index of supported source files, uses that index to narrow candidate files, then parses exact AST details at query or edit time.\n\nFiles do not need to be indexed first. To work in a file that is not yet in the index, pass its workspace-relative path directly: as scope.files or scope.node on find-nodes, or as the target path of a writer. Pando indexes that file just-in-time, in any supported language. The light index only limits workspace-wide discovery (scope.workspace); an explicit file path always works even if the file has never been indexed. This means you can edit any AST node in any supported file without a separate indexing step.\n\nUse Pando for supported source-code search, navigation, references, callers, exports, renames, inserts, replacements, and deletes. Use find-nodes for structural code search and edit targets, find-references/find-callers for usages, list-exports/analyze-imports for module shape, query-db for indexed metadata, and workspace-overview for inventory. Use shell/text tools for builds, tests, package managers, git, generated files, non-code files, unsupported languages/file types, and anything Pando itself does not support. Pando AST writers are for supported source-code and AST-addressable edits; use shell-based patching for unsupported non-code files such as Markdown docs.\n\nRead next:\n- workspace-overview: quick inventory of indexed files and symbols.\n- find-nodes: structural code search and edit target discovery by language, scope, and Datalog; request include.self/topN when you need paths and hashes for edits.\n- get-content: read files or node paths returned by search tools.\n- list-exports, find-references, and find-callers: follow symbols before changing them.\n- Writers: rename, replace, replace-body, insert, and delete. Re-run find-nodes first if a path or hash is stale.\n\nUnnamed nodes can and should still be edited with Pando. Statements, returns, calls, arguments, branches, literals, and other unnamed syntax are normal AST nodes; find them by starting from a named entity or file, then narrowing by kind, text, role, parent, or child index.\n\nExamples:\n- In one find-nodes call, search for a function by name within the workspace and request include.self/topN to get the exact node path and hash.\n- To edit a statement inside a named function, find the function with include.self, then call find-nodes again with scope.node set to { path, expectedHash } for that function. Use predicates such as :node/kind \"ReturnStatement\" or :node/text \"oldValue\", then pass the returned statement path and hash without @ to replace or insert; delete uses expectedHashes.\n- For scripts or top-level code, scope find-nodes to the file path instead of a named node, find the statement by kind/text/role/index, then edit that returned node with a writer.\n- Insert code is literal: include the newline and indentation you want when inserting before or after a statement anchor.\n- Edit an unnamed node end to end: find the enclosing function with find-nodes include.self to get its { path, expectedHash }; re-run find-nodes with scope.node set to that path+hash and a predicate like :node/kind \"ReturnStatement\" or :node/text \"return null\" to get the exact statement's path and hash; then call replace with that path and expectedHash (no @) to rewrite it, or insert with an anchor to add code beside it. No indexing step is needed even if the file was never indexed.",
68
67
  "parameters": {
69
68
  "type": "object",
70
69
  "properties": {},
@@ -2020,8 +2019,8 @@
2020
2019
  {
2021
2020
  "name": "shell-command",
2022
2021
  "category": "pando",
2023
- "signature": "shell-command(command, reason, timeoutMs, shell, maxOutputBytes)",
2024
- "description": "Strongly discouraged: prefer Pando AST/index tools before raw shell for code search, navigation, references, and edits. Use shell freely for tests, builds/compiles, package managers, git, generated or non-code files, unsupported languages, and anything Pando itself does not support. Every operation that goes through Pando, including this shell command, is snapshotted before and after; snapshots are not touchable by the agent. If needed, read ../../../pando-backend/docs/tools.md for tool behavior details. Shell results repeat this reminder so agents reconsider Pando-native tools before the next shell call. Run a shell command with cwd fixed to the selected Pando project root, then synchronously snapshot any worktree changes before another modifying Pando operation can run. The project-root confinement is also enforced by the host environment. reason is required and is written into the snapshot receipt/trailers for auditability. Command failures are returned to the agent with exit code, stdout, stderr, timeout state, and snapshot metadata. Example: { command:'npm test', reason:'Verify the current change.' }",
2022
+ "signature": "shell-command(command, reasonWhyNotUsingPandoNativeTools, timeoutMs, shell, maxOutputBytes)",
2023
+ "description": "Strongly discouraged: prefer Pando AST/index tools before raw shell for code search, navigation, references, and supported source-code edits. Use find-nodes for structural code search and edit targets, find-references/find-callers for usages, list-exports/analyze-imports for module shape, query-db for indexed metadata, and workspace-overview for inventory. Use shell freely for tests, builds/compiles, package managers, git, generated files, non-code files, unsupported languages/file types, and anything Pando itself does not support. Pando AST writers are for supported source-code and AST-addressable edits; use shell-based patching for unsupported non-code files such as Markdown docs. Every operation that goes through Pando, including this shell command, is snapshotted before and after; snapshots are not touchable by the agent. If needed, read ../../../pando-backend/docs/tools.md for tool behavior details. Shell results repeat this reminder so agents reconsider Pando-native tools before the next shell call. Run a shell command with cwd fixed to the selected Pando project root, then synchronously snapshot any worktree changes before another modifying Pando operation can run. The project-root confinement is also enforced by the host environment. reasonWhyNotUsingPandoNativeTools is required and is written into the snapshot receipt/trailers for auditability. Command failures are returned to the agent with exit code, stdout, stderr, timeout state, and snapshot metadata. Example: { command:'npm test', reasonWhyNotUsingPandoNativeTools:'Run the project test suite; this is execution, not code navigation.' }",
2025
2024
  "parameters": {
2026
2025
  "type": "object",
2027
2026
  "properties": {
@@ -2029,10 +2028,6 @@
2029
2028
  "type": "string",
2030
2029
  "description": "Shell command to execute. It always runs with cwd set to the selected project root."
2031
2030
  },
2032
- "reason": {
2033
- "type": "string",
2034
- "description": "Required audit reason for running this command. State why shell is appropriate instead of a Pando AST/index tool. This is persisted in the snapshot metadata."
2035
- },
2036
2031
  "timeoutMs": {
2037
2032
  "type": "number",
2038
2033
  "description": "Optional timeout in milliseconds. Must be 1000..600000. Defaults to 120000."
@@ -2044,18 +2039,22 @@
2044
2039
  "maxOutputBytes": {
2045
2040
  "type": "number",
2046
2041
  "description": "Optional combined stdout/stderr output cap in bytes. Must be 1024..1000000. Defaults to 200000."
2042
+ },
2043
+ "reasonWhyNotUsingPandoNativeTools": {
2044
+ "type": "string",
2045
+ "description": "Required audit reason for running this command. Explain why a Pando-native tool is not appropriate: use find-nodes for code search/edit targets, find-references/find-callers for usages, list-exports/analyze-imports for module shape, and shell for tests/builds/package managers/git/generated files/non-code files/unsupported languages. This is persisted in snapshot metadata."
2047
2046
  }
2048
2047
  },
2049
2048
  "required": [
2050
2049
  "command",
2051
- "reason"
2050
+ "reasonWhyNotUsingPandoNativeTools"
2052
2051
  ],
2053
2052
  "additionalProperties": false
2054
2053
  },
2055
2054
  "examples": [
2056
2055
  {
2057
2056
  "command": "npm test",
2058
- "reason": "Verify the current change."
2057
+ "reasonWhyNotUsingPandoNativeTools": "Run the project test suite; this is execution, not code navigation."
2059
2058
  }
2060
2059
  ]
2061
2060
  },
@@ -2188,40 +2187,6 @@
2188
2187
  }
2189
2188
  ]
2190
2189
  },
2191
- {
2192
- "name": "get-snapshot-file",
2193
- "category": "pando",
2194
- "signature": "get-snapshot-file(snapshotId, path, oid)",
2195
- "description": "Read a file at a snapshot. Provide (snapshotId + path) or a direct blob oid (with or without 'blob:' prefix). Examples: { snapshotId:'S_prev', path:'src/app.ts' } or { oid:'blob:1234...' }",
2196
- "parameters": {
2197
- "type": "object",
2198
- "properties": {
2199
- "snapshotId": {
2200
- "type": "string",
2201
- "description": "SnapshotId."
2202
- },
2203
- "path": {
2204
- "type": "string",
2205
- "description": "Repo-relative file path."
2206
- },
2207
- "oid": {
2208
- "type": "string",
2209
- "description": "Blob oid (40 hex), optionally prefixed with 'blob:'"
2210
- }
2211
- },
2212
- "required": [],
2213
- "additionalProperties": false
2214
- },
2215
- "examples": [
2216
- {
2217
- "snapshotId": "S_previous",
2218
- "path": "src/app.ts"
2219
- },
2220
- {
2221
- "oid": "blob:1234abcdef1234abcdef1234abcdef1234abcd"
2222
- }
2223
- ]
2224
- },
2225
2190
  {
2226
2191
  "name": "snapshot-worktree",
2227
2192
  "category": "pando",