portable-agent-layer 0.88.1 → 0.89.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 (84) hide show
  1. package/README.md +8 -5
  2. package/assets/agents/gemini-researcher.md +13 -0
  3. package/assets/agents/grok-researcher.md +13 -0
  4. package/assets/agents/multi-perspective-researcher.md +12 -0
  5. package/assets/agents/perplexity-researcher.md +13 -0
  6. package/assets/agents/skill-author.md +17 -0
  7. package/assets/agents/subagent-author.md +18 -1
  8. package/assets/skills/create-subagent/SKILL.md +3 -2
  9. package/assets/skills/create-subagent/authoring-guide.md +16 -0
  10. package/assets/templates/PAL/MEMORY_SYSTEM.md +1 -1
  11. package/assets/templates/PAL/README.md +6 -5
  12. package/assets/templates/PAL/SYSTEM_ARCHITECTURE.md +4 -1
  13. package/assets/templates/hooks.antigravity.json +42 -0
  14. package/assets/templates/settings.antigravity.json +44 -0
  15. package/package.json +1 -1
  16. package/src/cli/builtin-tools.ts +28 -23
  17. package/src/cli/doctor/agents.ts +64 -64
  18. package/src/cli/identity.ts +26 -20
  19. package/src/cli/index.ts +109 -312
  20. package/src/cli/knowledge.ts +160 -201
  21. package/src/cli/ledger-command.ts +69 -0
  22. package/src/cli/ledger.ts +20 -101
  23. package/src/cli/personal-context.ts +15 -12
  24. package/src/cli/rule.ts +29 -29
  25. package/src/cli/server.ts +33 -52
  26. package/src/cli/session-agent.ts +7 -9
  27. package/src/cli/skill.ts +73 -64
  28. package/src/cli/subagent.ts +51 -58
  29. package/src/cli/tree.ts +177 -0
  30. package/src/hooks/InvocationContext.ts +26 -0
  31. package/src/hooks/LedgerCommit.ts +4 -2
  32. package/src/hooks/LedgerSnapshot.ts +2 -0
  33. package/src/hooks/SecurityValidator.ts +2 -0
  34. package/src/hooks/StopOrchestrator.ts +12 -2
  35. package/src/hooks/UserPromptOrchestrator.ts +3 -15
  36. package/src/hooks/handlers/context-digests.ts +21 -21
  37. package/src/hooks/handlers/readme-sync.ts +6 -2
  38. package/src/hooks/lib/agent-definition.ts +6 -16
  39. package/src/hooks/lib/agent-registry.ts +88 -0
  40. package/src/hooks/lib/agent.ts +47 -23
  41. package/src/hooks/lib/antigravity-inference.ts +84 -0
  42. package/src/hooks/lib/antigravity-transcript.ts +129 -0
  43. package/src/hooks/lib/claim-check.ts +13 -2
  44. package/src/hooks/lib/claim-log.ts +5 -1
  45. package/src/hooks/lib/claude-md.ts +21 -1
  46. package/src/hooks/lib/context.ts +5 -1
  47. package/src/hooks/lib/hook-turn.ts +25 -2
  48. package/src/hooks/lib/inference.ts +77 -1
  49. package/src/hooks/lib/invocation-context.ts +99 -0
  50. package/src/hooks/lib/ledger-hook.ts +14 -6
  51. package/src/hooks/lib/models.ts +34 -17
  52. package/src/hooks/lib/paths.ts +39 -6
  53. package/src/hooks/lib/prompt-capture.ts +28 -0
  54. package/src/hooks/lib/readme-sync.ts +3 -31
  55. package/src/hooks/lib/security-gate.ts +10 -3
  56. package/src/hooks/lib/semi-static.ts +13 -3
  57. package/src/hooks/lib/session-context.ts +3 -1
  58. package/src/hooks/lib/stop.ts +1 -0
  59. package/src/hooks/lib/transcript.ts +6 -3
  60. package/src/targets/agent-render.ts +3 -3
  61. package/src/targets/antigravity/install.ts +68 -0
  62. package/src/targets/antigravity/uninstall.ts +66 -0
  63. package/src/targets/lib.ts +81 -64
  64. package/src/targets/opencode/install.ts +2 -0
  65. package/src/targets/opencode/permission.ts +39 -0
  66. package/src/targets/opencode/uninstall.ts +9 -8
  67. package/src/tools/agent/algorithm-reflect.ts +70 -62
  68. package/src/tools/agent/algorithm-synthesize.ts +39 -14
  69. package/src/tools/agent/analyze.ts +31 -36
  70. package/src/tools/agent/handoff-note.ts +51 -54
  71. package/src/tools/agent/interaction.ts +32 -28
  72. package/src/tools/agent/project.ts +300 -287
  73. package/src/tools/agent/relationship-note.ts +40 -36
  74. package/src/tools/agent/relationship-reflect.ts +23 -32
  75. package/src/tools/agent/synthesize.ts +26 -27
  76. package/src/tools/agent/thread.ts +42 -51
  77. package/src/tools/agent/wisdom-frame.ts +45 -38
  78. package/src/tools/control-room/server.ts +0 -2
  79. package/src/tools/control-room/ui/dist/assets/{index-BZMDzWFa.js → index-mFpXpiBj.js} +1 -1
  80. package/src/tools/control-room/ui/dist/index.html +1 -1
  81. package/src/tools/control-room/ui/screens/log.tsx +10 -1
  82. package/src/tools/lib/command.ts +275 -0
  83. package/src/tools/subagent-doctor.ts +74 -9
  84. package/src/tools/token-cost.ts +18 -17
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A cross-platform, cross-agent layer for portable AI workflows, memory, and accumulated knowledge.
4
4
 
5
- PAL lets you carry your agent context across **Windows**, **macOS**, and **Linux**, and work across different agent runtimes and interfaces such as **Claude Code**, **opencode**, **Cursor**, **GitHub Copilot**, and **Codex**. Its core idea is simple: your knowledge and workflows should belong to **you**, not to a single machine, tool, or vendor.
5
+ PAL lets you carry your agent context across **Windows**, **macOS**, and **Linux**, and work across different agent runtimes and interfaces such as **Claude Code**, **opencode**, **Cursor**, **GitHub Copilot**, **Codex**, and **Antigravity CLI**. Its core idea is simple: your knowledge and workflows should belong to **you**, not to a single machine, tool, or vendor.
6
6
 
7
7
  > Inspired in part by [Daniel Miessler](https://danielmiessler.com)'s work on [Personal AI Infrastructure](https://github.com/danielmiessler/Personal_AI_Infrastructure). PAL is an independent open-source implementation focused on portability across platforms and agents. It is not affiliated with or endorsed by Daniel Miessler.
8
8
 
@@ -33,7 +33,7 @@ With PAL, you can:
33
33
  > **Bun is required.** PAL is built on [Bun](https://bun.sh) and will not work with Node.js or other runtimes. Install it with `curl -fsSL https://bun.sh/install | bash`.
34
34
 
35
35
  - [Bun](https://bun.sh) >= 1.4.0
36
- - At least one of: [Claude Code](https://claude.ai/code), [opencode](https://opencode.ai), [Cursor](https://cursor.com), [GitHub Copilot CLI](https://docs.github.com/en/copilot/github-copilot-in-the-cli), or [Codex](https://openai.com/index/introducing-codex/)
36
+ - At least one of: [Claude Code](https://claude.ai/code), [opencode](https://opencode.ai), [Cursor](https://cursor.com), [GitHub Copilot CLI](https://docs.github.com/en/copilot/github-copilot-in-the-cli), [Codex](https://openai.com/index/introducing-codex/), or [Antigravity CLI](https://antigravity.google/product/antigravity-cli)
37
37
 
38
38
  ### Package mode (recommended)
39
39
 
@@ -73,7 +73,7 @@ pal cli status # check your setup
73
73
 
74
74
  | Command | Description |
75
75
  |---------|-------------|
76
- | `pal` | Start the first installed agent, in order: Claude Code, Codex, Cursor CLI, Copilot CLI, opencode. Claude sessions print a summary on exit |
76
+ | `pal` | Start the first installed agent, in order: Claude Code, Codex, Cursor CLI, Copilot CLI, opencode, Antigravity CLI. Claude sessions print a summary on exit |
77
77
  | `pal cli init` | Scaffold PAL home directory and install hooks |
78
78
  | `pal cli install` | Register hooks/skills for targets |
79
79
  | `pal cli uninstall` | Remove hooks/skills for targets |
@@ -108,6 +108,7 @@ pal cli status # check your setup
108
108
  pal cli install --claude # Claude Code only
109
109
  pal cli install --opencode # opencode only
110
110
  pal cli install --cursor # Cursor only
111
+ pal cli install --antigravity # Antigravity CLI only
111
112
  pal cli install # all available (default)
112
113
  ```
113
114
 
@@ -119,7 +120,8 @@ pal cli install # all available (default)
119
120
  | opencode | Full | Yes | Yes (plugin) | Yes | Yes | `opencode run` |
120
121
  | Cursor | Full | Yes | Yes | Yes (injected via hook) | Yes | `cursor-agent` |
121
122
  | GitHub Copilot | Full | Yes | Yes | Yes (via `~/.copilot/instructions/*.instructions.md`) | Yes | `copilot` |
122
- | Codex | Full | Yes | Yes | Yes | No | `codex exec` |
123
+ | Codex | Full | Yes | Yes | Yes | Yes | `codex exec` |
124
+ | Antigravity CLI | Full | Yes | Yes (plugin) | Yes (via the plugin's `rules/`) | Yes | `agy` |
123
125
 
124
126
  PAL's background inference (session naming, summaries, failure capture, etc.) runs through whichever subscription CLI is active — no API key required by default.
125
127
 
@@ -156,6 +158,7 @@ Agents launched from a desktop app never read your shell profile, so the hooks t
156
158
  | `PAL_CURSOR_DIR` | Override Cursor config dir (default: `~/.cursor`) |
157
159
  | `PAL_COPILOT_DIR` | Override Copilot config dir (default: `~/.copilot`) |
158
160
  | `PAL_CODEX_DIR` | Override Codex config dir (default: `~/.codex`) |
161
+ | `PAL_GEMINI_DIR` | Override the Gemini dir Antigravity CLI reads (default: `~/.gemini`) |
159
162
  | `PAL_AGENTS_DIR` | Override agents dir (default: `~/.agents`) |
160
163
 
161
164
  ### Debug / test
@@ -232,7 +235,7 @@ Your setup should be able to travel with you.
232
235
  ## Features
233
236
 
234
237
  - **Cross-platform**: works on Windows, macOS, and Linux
235
- - **Cross-agent**: full support for Claude Code, opencode, Cursor, GitHub Copilot, and Codex
238
+ - **Cross-agent**: full support for Claude Code, opencode, Cursor, GitHub Copilot, Codex, and Antigravity CLI
236
239
  - **Subscription-first inference**: background inference routes through whichever subscription CLI is active — no API key needed by default
237
240
  - **Portable knowledge**: export and import accumulated knowledge
238
241
  - **A morning screen, not a dashboard**: `pal cli server` ranks your projects *and* your written goals in one urgent/important grid. Urgency is read off the files — blockers, an unfinished handoff, a date in a next step, an important thing gone quiet. Importance comes from one fact per project: whether it serves a goal you wrote down, is a way the work could pay, or is kept for its own sake. PAL guesses that once at session stop; you correct it on the page or with `project.ts serves <name> goal|revenue|fun`, and the correction survives every later guess
@@ -17,6 +17,19 @@ cursor:
17
17
  model: inherit
18
18
  readonly: false
19
19
  is_background: false
20
+
21
+ antigravity:
22
+ model: inherit
23
+ subagent: true
24
+ mainAgent: false
25
+ tools:
26
+ - run_command
27
+ - search_web
28
+ - read_url_content
29
+ - view_file
30
+ - grep_search
31
+ - find_by_name
32
+ - list_dir
20
33
  ---
21
34
 
22
35
  You are a research specialist focused on **depth and academic rigor**.
@@ -17,6 +17,19 @@ cursor:
17
17
  model: inherit
18
18
  readonly: false
19
19
  is_background: false
20
+
21
+ antigravity:
22
+ model: inherit
23
+ subagent: true
24
+ mainAgent: false
25
+ tools:
26
+ - search_web
27
+ - read_url_content
28
+ - run_command
29
+ - view_file
30
+ - grep_search
31
+ - find_by_name
32
+ - list_dir
20
33
  ---
21
34
 
22
35
  You are a research specialist focused on **real-time information and current events** using the Grok API and X (Twitter) data.
@@ -17,6 +17,18 @@ cursor:
17
17
  model: inherit
18
18
  readonly: false
19
19
  is_background: false
20
+
21
+ antigravity:
22
+ model: inherit
23
+ subagent: true
24
+ mainAgent: false
25
+ tools:
26
+ - search_web
27
+ - read_url_content
28
+ - view_file
29
+ - grep_search
30
+ - find_by_name
31
+ - list_dir
20
32
  ---
21
33
 
22
34
  You are a research specialist focused on **breadth and perspective diversity**.
@@ -17,6 +17,19 @@ cursor:
17
17
  model: inherit
18
18
  readonly: false
19
19
  is_background: false
20
+
21
+ antigravity:
22
+ model: inherit
23
+ subagent: true
24
+ mainAgent: false
25
+ tools:
26
+ - run_command
27
+ - search_web
28
+ - read_url_content
29
+ - view_file
30
+ - grep_search
31
+ - find_by_name
32
+ - list_dir
20
33
  ---
21
34
 
22
35
  You are a research specialist focused on **investigative rigor and source verification**.
@@ -18,6 +18,23 @@ cursor:
18
18
  model: inherit
19
19
  readonly: false
20
20
  is_background: false
21
+
22
+ codex:
23
+ model: gpt-6-astra
24
+
25
+ antigravity:
26
+ model: pro
27
+ subagent: true
28
+ mainAgent: false
29
+ tools:
30
+ - run_command
31
+ - view_file
32
+ - write_to_file
33
+ - replace_file_content
34
+ - multi_replace_file_content
35
+ - grep_search
36
+ - find_by_name
37
+ - list_dir
21
38
  ---
22
39
 
23
40
  You author a single new personal skill for this user. You are handed a **skill name** and a **skill description**, and optionally hints about tooling or triggers.
@@ -18,6 +18,23 @@ cursor:
18
18
  model: inherit
19
19
  readonly: false
20
20
  is_background: false
21
+
22
+ codex:
23
+ model: gpt-6-astra
24
+
25
+ antigravity:
26
+ model: pro
27
+ subagent: true
28
+ mainAgent: false
29
+ tools:
30
+ - run_command
31
+ - view_file
32
+ - write_to_file
33
+ - replace_file_content
34
+ - multi_replace_file_content
35
+ - grep_search
36
+ - find_by_name
37
+ - list_dir
21
38
  ---
22
39
 
23
40
  You author a single new personal subagent for this user. You are handed a **subagent name** and a **description**, and interview answers about its model, tools, skills, and system prompt.
@@ -29,7 +46,7 @@ You author a single new personal subagent for this user. You are handed a **suba
29
46
  cat ~/.pal/skills/create-subagent/authoring-guide.md
30
47
  ```
31
48
  2. Validate the name: lowercase-kebab, no spaces. It must not collide with an existing personal subagent (`pal cli subagent list`) or a shipped one. If it collides or is malformed, stop and report the conflict instead of overwriting.
32
- 3. Write `~/.pal/agents/<name>.md` (create `~/.pal/agents/` if missing), populated per the guide's merged schema: global `name` + `description`, then only the platform blocks that matter (`claude:`, `opencode:`, `cursor:`, `copilot:`, `codex:`), then the system prompt body. Remember: `skills:` is Claude-only and preloads — for other agents, name intended skills in the body.
49
+ 3. Write `~/.pal/agents/<name>.md` (create `~/.pal/agents/` if missing), populated per the guide's merged schema: global `name` + `description`, then only the platform blocks that matter (`claude:`, `opencode:`, `cursor:`, `copilot:`, `codex:`, `antigravity:`), then the system prompt body. Remember: `skills:` is Claude-only and preloads — for other agents, name intended skills in the body.
33
50
  4. Install it into every installed agent:
34
51
  ```bash
35
52
  pal cli subagent link <name>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: create-subagent
3
3
  license: MIT
4
- description: "Create a user-scoped subagent for every installed agent (Claude Code, opencode, Cursor, Copilot, Codex) from one merged definition, then install and run the doctor on it. Use when the user asks to create a subagent, add a custom agent, delegate a role to a specialized agent, or \"make a subagent that…\"."
4
+ description: "Create a user-scoped subagent for every installed agent (Claude Code, opencode, Cursor, Copilot, Codex, Antigravity) from one merged definition, then install and run the doctor on it. Use when the user asks to create a subagent, add a custom agent, delegate a role to a specialized agent, or \"make a subagent that…\"."
5
5
  argument-hint: <subagent name> <what it does + when to delegate>
6
6
  metadata:
7
7
  source: portable-agent-layer
@@ -38,7 +38,8 @@ cat ~/.pal/skills/create-subagent/authoring-guide.md
38
38
  cannot reasonably infer, then confirm your draft:
39
39
  - **model** — a flagship model or `inherit` the caller's model (can differ per agent).
40
40
  - **tools** — which tools it may use (a comma list for Claude/Copilot; a permission
41
- map for opencode; a `sandbox_mode` for Codex). Default: inherit all tools.
41
+ map for opencode; a `sandbox_mode` for Codex; a YAML list of exact tool names for
42
+ Antigravity). Default: inherit all tools — except Antigravity, which gives none.
42
43
  - **skills** — skills to PRELOAD. Claude Code only; the other agents have no such
43
44
  field (see the guide). Record intended skills in the body for the others.
44
45
  - **system prompt** — the role and behavior. Draft it and confirm with the user.
@@ -50,6 +50,14 @@ codex:
50
50
  model: gpt-6-sol # omit to inherit the parent session's model
51
51
  model_reasoning_effort: high
52
52
  sandbox_mode: read-only # read-only | workspace-write | danger-full-access
53
+ antigravity:
54
+ model: inherit # inherit | flash | pro
55
+ subagent: true
56
+ mainAgent: false # keep it out of the main-agent picker
57
+ tools: # YAML list of exact names; omitted = NO tools
58
+ - view_file
59
+ - grep_search
60
+ - run_command
53
61
  ---
54
62
 
55
63
  <system prompt — second-person instructions to the subagent>
@@ -79,6 +87,14 @@ with just `name` + `description` (a valid, minimal subagent).
79
87
  the agent); restrict access with `sandbox_mode` and name skills in the body. The
80
88
  global frontmatter may hold only `name` and `description`, because nothing else maps
81
89
  to a Codex key.
90
+ - **antigravity** — installs into the PAL plugin's `agents/` folder. `model` is
91
+ `inherit`, `flash` or `pro`. `tools` is a YAML list, and omitting it gives the subagent
92
+ **no** tools. Use Antigravity's own names, never Claude's: `view_file` (Read),
93
+ `grep_search` (Grep), `find_by_name` / `list_dir` (Glob), `write_to_file` (Write),
94
+ `replace_file_content` / `multi_replace_file_content` (Edit), `run_command` (Bash),
95
+ `search_web` (WebSearch), `read_url_content` (WebFetch). An unknown name can hang the
96
+ subagent, so the doctor treats it as an error. Set `subagent: true` and
97
+ `mainAgent: false` so it is offered only as a delegate.
82
98
 
83
99
  ## What makes a good subagent
84
100
 
@@ -1,6 +1,6 @@
1
1
  # Memory System
2
2
 
3
- PAL has its own memory system that persists across sessions AND across tools (Claude Code, opencode, Cursor, Copilot, Codex). Always prefer PAL memory over any tool-native memory system.
3
+ PAL has its own memory system that persists across sessions AND across tools (Claude Code, opencode, Cursor, Copilot, Codex, Antigravity CLI). Always prefer PAL memory over any tool-native memory system.
4
4
 
5
5
  ## Layout
6
6
 
@@ -1,12 +1,12 @@
1
1
  # PAL — Portable Agent Layer
2
2
 
3
- PAL is a persistent, cross-platform, cross-agent layer for portable AI workflows, memory, and accumulated knowledge. It runs inside any compatible AI coding agent (Claude Code, opencode, Cursor, Codex) as an interconnected set of skills, hooks, tools, memory, and configuration — all orchestrated by The Algorithm.
3
+ PAL is a persistent, cross-platform, cross-agent layer for portable AI workflows, memory, and accumulated knowledge. It runs inside any compatible AI coding agent (Claude Code, opencode, Cursor, GitHub Copilot, Codex, Antigravity CLI) as an interconnected set of skills, hooks, tools, memory, and configuration — all orchestrated by The Algorithm.
4
4
 
5
5
  ## How It Works
6
6
 
7
7
  **CLAUDE.md** (or the agent equivalent) is the entry point — generated from a template by the CLI installer. It defines execution modes, The Algorithm routing, and the context routing table. The agent loads it natively every session. A SessionStart hook keeps it fresh automatically.
8
8
 
9
- **The PAL home directory (`~/.pal/`)** contains all system documentation, user context (TELOS), memory, and tools. The rest of the system lives in the PAL package (`src/`) and the agent's config directory (`~/.claude/`, `~/.config/opencode/`, `~/.cursor/`, or `~/.codex/`).
9
+ **The PAL home directory (`~/.pal/`)** contains all system documentation, user context (TELOS), memory, and tools. The rest of the system lives in the PAL package (`src/`) and the agent's config directory (`~/.claude/`, `~/.config/opencode/`, `~/.cursor/`, `~/.copilot/`, `~/.codex/`, or `~/.gemini/`).
10
10
 
11
11
  ## Directory Structure
12
12
 
@@ -31,7 +31,7 @@ PAL is a persistent, cross-platform, cross-agent layer for portable AI workflows
31
31
  hooks/ # Session lifecycle hooks
32
32
  handlers/ # Individual stop/prompt handlers
33
33
  lib/ # Shared utilities
34
- targets/ # Agent-specific installers (Claude, opencode, Cursor)
34
+ targets/ # Agent-specific installers (one folder per agent)
35
35
  tools/ # Standalone CLI tools
36
36
  assets/
37
37
  skills/ # Bundled skills (16+)
@@ -107,6 +107,7 @@ pal cli init # Scaffold PAL home + install hooks
107
107
  pal cli install [--claude] # Register hooks/skills for Claude Code
108
108
  pal cli install [--opencode] # Register hooks/skills for opencode
109
109
  pal cli install [--cursor] # Register hooks/skills for Cursor
110
+ pal cli install [--antigravity] # Register hooks/skills for Antigravity CLI
110
111
  pal cli uninstall # Remove hooks/skills
111
112
  pal cli status # Show configuration
112
113
  pal cli doctor # Check prerequisites and health
@@ -119,8 +120,8 @@ pal cli update # Update PAL
119
120
 
120
121
  PAL is designed to work identically across:
121
122
  - **Platforms:** macOS, Linux, Windows
122
- - **Agents:** Claude Code (full), opencode (full), Cursor (full), Codex (partial — AGENTS.md and skills only, no hooks or subagents)
123
- - **Environment overrides:** `PAL_HOME`, `PAL_PKG`, `PAL_CLAUDE_DIR`, `PAL_OPENCODE_DIR`, `PAL_CURSOR_DIR`, `PAL_CODEX_DIR`, `PAL_AGENTS_DIR`
123
+ - **Agents:** Claude Code, opencode, Cursor, GitHub Copilot, Codex, Antigravity CLI (all full: skills, hooks, instructions, subagents)
124
+ - **Environment overrides:** `PAL_HOME`, `PAL_PKG`, `PAL_CLAUDE_DIR`, `PAL_OPENCODE_DIR`, `PAL_CURSOR_DIR`, `PAL_COPILOT_DIR`, `PAL_CODEX_DIR`, `PAL_GEMINI_DIR`, `PAL_AGENTS_DIR`
124
125
 
125
126
  ## Extending PAL
126
127
 
@@ -394,7 +394,7 @@ Relationship notes (O/B types)
394
394
  **Tier 2 — Semi-static** (pre-compiled at previous session stop, loaded natively):
395
395
  - Self-model, wisdom, opinions, synthesis, failures, steering rules
396
396
  - Written to disk by `writeContextDigests()` at Stop time
397
- - Loaded natively per-agent: `@imports` in CLAUDE.md (Claude Code), `instructions[]` in opencode config, `.mdc` rules in `~/.cursor/rules/` (Cursor), `.instructions.md` in `~/.copilot/instructions/` (Copilot)
397
+ - Loaded natively per-agent: `@imports` in CLAUDE.md (Claude Code), `instructions[]` in opencode config, `.mdc` rules in `~/.cursor/rules/` (Cursor), `.instructions.md` in `~/.copilot/instructions/` (Copilot), always-on rules in `~/.gemini/config/plugins/pal/rules/` (Antigravity)
398
398
  - Content is global/user-level — safe to pre-compile (not project-scoped)
399
399
 
400
400
  **Tier 3 — Dynamic** (injected fresh each session by LoadContext hook):
@@ -459,6 +459,7 @@ The active agent is detected via `getActiveAgent()` in `src/hooks/lib/agent.ts`
459
459
  | `cursor` | `cursor-agent` | argv-only, no stdin |
460
460
  | `copilot` | `copilot` | GitHub Copilot CLI |
461
461
  | `codex` | `codex exec` | Falls back to `PAL_OPENAI_API_KEY` if the `codex` binary is missing |
462
+ | `antigravity` | `agy --input-format stream-json` | Runs in an empty temp workspace under a tool-less `pal-inference` agent, which keeps PAL's plugin rules out of the reply; Gemini Flash low (small) / high (medium). The run's conversation files are deleted afterwards |
462
463
 
463
464
  If no CLI binary is available, the dispatcher falls back to `PAL_ANTHROPIC_API_KEY` (Haiku via the Anthropic API) or `PAL_OPENAI_API_KEY` (OpenAI API). `canInfer()` returns `false` only when both routes are unavailable — handlers then skip silently.
464
465
 
@@ -569,6 +570,8 @@ All paths resolve through `src/hooks/lib/paths.ts`:
569
570
  | Cursor config | `~/.cursor` | `PAL_CURSOR_DIR` |
570
571
  | Copilot config | `~/.copilot` | `PAL_COPILOT_DIR` |
571
572
  | Codex config | `~/.codex` | `PAL_CODEX_DIR` |
573
+ | Antigravity CLI plugin | `~/.gemini/config/plugins/pal` | `PAL_GEMINI_DIR` (replaces `~/.gemini`) |
574
+ | Antigravity CLI settings (PAL's command allowlist only) | `~/.gemini/antigravity-cli/settings.json` | `PAL_GEMINI_DIR` |
572
575
  | Agents dir | `~/.agents` | `PAL_AGENTS_DIR` |
573
576
 
574
577
  ### Portability Contract
@@ -0,0 +1,42 @@
1
+ {
2
+ "pal": {
3
+ "PreInvocation": [
4
+ {
5
+ "type": "command",
6
+ "command": "bun run {{PKG_ROOT}}/src/hooks/InvocationContext.ts --agent=antigravity"
7
+ }
8
+ ],
9
+ "PreToolUse": [
10
+ {
11
+ "matcher": "*",
12
+ "hooks": [
13
+ {
14
+ "type": "command",
15
+ "command": "bun run {{PKG_ROOT}}/src/hooks/SecurityValidator.ts --agent=antigravity"
16
+ },
17
+ {
18
+ "type": "command",
19
+ "command": "bun run {{PKG_ROOT}}/src/hooks/LedgerSnapshot.ts --agent=antigravity"
20
+ }
21
+ ]
22
+ }
23
+ ],
24
+ "PostToolUse": [
25
+ {
26
+ "matcher": "*",
27
+ "hooks": [
28
+ {
29
+ "type": "command",
30
+ "command": "bun run {{PKG_ROOT}}/src/hooks/LedgerCommit.ts --agent=antigravity"
31
+ }
32
+ ]
33
+ }
34
+ ],
35
+ "Stop": [
36
+ {
37
+ "type": "command",
38
+ "command": "bun run {{PKG_ROOT}}/src/hooks/StopOrchestrator.ts --agent=antigravity"
39
+ }
40
+ ]
41
+ }
42
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "command(cat)",
5
+ "command(head)",
6
+ "command(tail)",
7
+ "command(ls)",
8
+ "command(find)",
9
+ "command(grep)",
10
+ "command(rg)",
11
+ "command(wc)",
12
+ "command(diff)",
13
+ "command(which)",
14
+ "command(file)",
15
+ "command(stat)",
16
+ "command(readlink)",
17
+ "command(lsof)",
18
+ "command(rtk read)",
19
+ "command(rtk ls)",
20
+ "command(rtk tree)",
21
+ "command(rtk find)",
22
+ "command(rtk grep)",
23
+ "command(rtk rg)",
24
+ "command(rtk wc)",
25
+ "command(rtk diff)",
26
+ "command(rtk json)",
27
+ "command(rtk log)",
28
+ "command(rtk deps)",
29
+ "command(rtk env)",
30
+ "command(rtk smart)",
31
+ "command(rtk gain)",
32
+ "command(pal cli skill run)",
33
+ "command(pal cli algorithm-reflect)",
34
+ "command(pal cli algorithm-synthesize)",
35
+ "command(pal cli analyze)",
36
+ "command(pal cli handoff-note)",
37
+ "command(pal cli project)",
38
+ "command(pal cli relationship-note)",
39
+ "command(pal cli synthesize)",
40
+ "command(pal cli thread)",
41
+ "command(pal cli wisdom-frame)"
42
+ ]
43
+ }
44
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portable-agent-layer",
3
- "version": "0.88.1",
3
+ "version": "0.89.0",
4
4
  "description": "PAL — Portable Agent Layer: persistent personal context for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {
@@ -4,29 +4,34 @@
4
4
  * Instruction text names the verb rather than `bun ~/.pal/tools/<tool>.ts`, so
5
5
  * no shell has to expand a tilde — which cmd.exe never does and PowerShell
6
6
  * passes through literally — and a tool can move without breaking every doc
7
- * that calls it. Each entry imports lazily, so an unused verb costs nothing.
7
+ * that calls it.
8
8
  */
9
- const BUILTIN_TOOLS = {
10
- "algorithm-reflect": () => import("../tools/agent/algorithm-reflect"),
11
- "algorithm-synthesize": () => import("../tools/agent/algorithm-synthesize"),
12
- analyze: () => import("../tools/agent/analyze"),
13
- "handoff-note": () => import("../tools/agent/handoff-note"),
14
- interaction: () => import("../tools/agent/interaction"),
15
- project: () => import("../tools/agent/project"),
16
- "relationship-note": () => import("../tools/agent/relationship-note"),
17
- "relationship-reflect": () => import("../tools/agent/relationship-reflect"),
18
- synthesize: () => import("../tools/agent/synthesize"),
19
- thread: () => import("../tools/agent/thread"),
20
- "wisdom-frame": () => import("../tools/agent/wisdom-frame"),
21
- } satisfies Record<string, () => Promise<{ run: (argv: string[]) => unknown }>>;
22
9
 
23
- export const builtinToolVerbs = Object.keys(BUILTIN_TOOLS).sort();
10
+ import { command as algorithmReflect } from "../tools/agent/algorithm-reflect";
11
+ import { command as algorithmSynthesize } from "../tools/agent/algorithm-synthesize";
12
+ import { command as analyze } from "../tools/agent/analyze";
13
+ import { command as handoffNote } from "../tools/agent/handoff-note";
14
+ import { command as interaction } from "../tools/agent/interaction";
15
+ import { command as project } from "../tools/agent/project";
16
+ import { command as relationshipNote } from "../tools/agent/relationship-note";
17
+ import { command as relationshipReflect } from "../tools/agent/relationship-reflect";
18
+ import { command as synthesize } from "../tools/agent/synthesize";
19
+ import { command as thread } from "../tools/agent/thread";
20
+ import { command as wisdomFrame } from "../tools/agent/wisdom-frame";
21
+ import type { Command } from "../tools/lib/command";
24
22
 
25
- /** Dispatch a built-in verb; false means the command belongs to the main switch. */
26
- export async function runBuiltinTool(command: string, args: string[]): Promise<boolean> {
27
- const load = BUILTIN_TOOLS[command as keyof typeof BUILTIN_TOOLS];
28
- if (!load) return false;
29
- const { run } = await load();
30
- await run(args);
31
- return true;
32
- }
23
+ export const builtinTools: Record<string, Command> = {
24
+ "algorithm-reflect": algorithmReflect,
25
+ "algorithm-synthesize": algorithmSynthesize,
26
+ analyze,
27
+ "handoff-note": handoffNote,
28
+ interaction,
29
+ project,
30
+ "relationship-note": relationshipNote,
31
+ "relationship-reflect": relationshipReflect,
32
+ synthesize,
33
+ thread,
34
+ "wisdom-frame": wisdomFrame,
35
+ };
36
+
37
+ export const builtinToolVerbs = Object.keys(builtinTools).sort();