@openontology/opencode-palantir 0.1.1 → 0.1.2
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/README.md +109 -9
- package/dist/index.js +1831 -12
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,14 +1,114 @@
|
|
|
1
1
|
# opencode-palantir
|
|
2
2
|
|
|
3
|
-
OpenCode plugin that provides Palantir Foundry documentation to AI agents via local Parquet
|
|
3
|
+
OpenCode plugin that provides **Palantir Foundry documentation** to AI agents via a local Parquet
|
|
4
|
+
database.
|
|
4
5
|
|
|
5
6
|
## Features
|
|
6
7
|
|
|
7
8
|
- Fetches all ~3,600 pages from Palantir's public documentation
|
|
8
|
-
- Stores in local Parquet file for fast offline access (~17MB)
|
|
9
|
+
- Stores in a local Parquet file for fast offline access (~17MB)
|
|
9
10
|
- Exposes `get_doc_page` and `list_all_docs` tools for AI agents
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
+
## Quick start (OpenCode users)
|
|
13
|
+
|
|
14
|
+
### 1) Enable the plugin in `opencode.json` / `opencode.jsonc`
|
|
15
|
+
|
|
16
|
+
Add the plugin to your OpenCode config:
|
|
17
|
+
|
|
18
|
+
```jsonc
|
|
19
|
+
{
|
|
20
|
+
"$schema": "https://opencode.ai/config.json",
|
|
21
|
+
"plugin": ["@openontology/opencode-palantir@^0.1.1"]
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Restart OpenCode.
|
|
26
|
+
|
|
27
|
+
### 2) (Optional) Install per-project
|
|
28
|
+
|
|
29
|
+
In your project repo, add the plugin as a dependency inside `.opencode/` (keeps plugin deps separate
|
|
30
|
+
from your app deps):
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
mkdir -p .opencode
|
|
34
|
+
|
|
35
|
+
cat > .opencode/package.json <<'EOF'
|
|
36
|
+
{
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@openontology/opencode-palantir": "^0.1.1"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
EOF
|
|
42
|
+
|
|
43
|
+
(cd .opencode && bun install)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then create a tiny wrapper file in `.opencode/plugins/`:
|
|
47
|
+
|
|
48
|
+
Create a tiny wrapper file in `.opencode/plugins/`:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
mkdir -p .opencode/plugins
|
|
52
|
+
|
|
53
|
+
cat > .opencode/plugins/opencode-palantir.js <<'EOF'
|
|
54
|
+
import plugin from '@openontology/opencode-palantir';
|
|
55
|
+
|
|
56
|
+
export default plugin;
|
|
57
|
+
EOF
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
OpenCode automatically loads `.js`/`.ts` files from `.opencode/plugins/` at startup.
|
|
61
|
+
|
|
62
|
+
> If your OpenCode setup uses an `opencode.json` / `opencode.jsonc` that restricts plugin loading,
|
|
63
|
+
> make sure `.opencode/plugins/` (or the specific plugin file) is included.
|
|
64
|
+
|
|
65
|
+
### 3) Get `docs.parquet`
|
|
66
|
+
|
|
67
|
+
This package does **not** ship with docs bundled. You have two options:
|
|
68
|
+
|
|
69
|
+
#### Option A (recommended): fetch inside OpenCode
|
|
70
|
+
|
|
71
|
+
In OpenCode, run:
|
|
72
|
+
|
|
73
|
+
- `/refresh-docs`
|
|
74
|
+
|
|
75
|
+
This downloads the docs and writes them to `data/docs.parquet` in your project root.
|
|
76
|
+
|
|
77
|
+
#### Option B: download a prebuilt Parquet file
|
|
78
|
+
|
|
79
|
+
Download `data/docs.parquet` from this GitHub repo and place it at:
|
|
80
|
+
|
|
81
|
+
- `<your-project>/data/docs.parquet`
|
|
82
|
+
|
|
83
|
+
## Using the tools
|
|
84
|
+
|
|
85
|
+
When installed, this plugin exposes:
|
|
86
|
+
|
|
87
|
+
- **`get_doc_page`** - Retrieve a specific doc page by URL
|
|
88
|
+
- **`list_all_docs`** - List all available documentation pages
|
|
89
|
+
|
|
90
|
+
If `data/docs.parquet` is missing, both tools will instruct you to run `/refresh-docs`.
|
|
91
|
+
|
|
92
|
+
## Foundry MCP setup helpers
|
|
93
|
+
|
|
94
|
+
This plugin also provides two OpenCode commands to set up `palantir-mcp` with project-scoped tool
|
|
95
|
+
gating and Foundry sub-agents:
|
|
96
|
+
|
|
97
|
+
- **`/setup-palantir-mcp <foundry_api_url>`**
|
|
98
|
+
- Creates/patches repo-root `opencode.jsonc`
|
|
99
|
+
- Adds `mcp.palantir-mcp` (if missing) as a local `npx palantir-mcp --foundry-api-url ...` server
|
|
100
|
+
- Enforces global deny: `tools.palantir-mcp_* = false`
|
|
101
|
+
- Creates `foundry-librarian` and `foundry` agents
|
|
102
|
+
- Dynamically discovers the current `palantir-mcp` tool list and writes explicit `true/false`
|
|
103
|
+
per-tool toggles under each Foundry agent
|
|
104
|
+
- **`/rescan-palantir-mcp-tools`**
|
|
105
|
+
- Re-discovers the `palantir-mcp` tool list and adds any missing explicit toggles
|
|
106
|
+
- Never overwrites existing `palantir-mcp_*` toggles
|
|
107
|
+
|
|
108
|
+
Auth is always env-only. The token is referenced as `{env:FOUNDRY_TOKEN}` and is never written to
|
|
109
|
+
disk.
|
|
110
|
+
|
|
111
|
+
## Setup (this repo)
|
|
12
112
|
|
|
13
113
|
```bash
|
|
14
114
|
bun install
|
|
@@ -73,15 +173,13 @@ When installed as an OpenCode plugin, exposes:
|
|
|
73
173
|
- **`list_all_docs`** - List all available documentation pages
|
|
74
174
|
- **`/refresh-docs`** - Command hook to re-fetch all documentation
|
|
75
175
|
|
|
76
|
-
### Installing in OpenCode (this
|
|
176
|
+
### Installing in OpenCode (this repo only)
|
|
77
177
|
|
|
78
|
-
|
|
178
|
+
For local development against `dist/`, you can point the wrapper at the built artifact:
|
|
79
179
|
|
|
80
180
|
```bash
|
|
81
181
|
mkdir -p .opencode/plugins
|
|
82
|
-
```
|
|
83
182
|
|
|
84
|
-
```bash
|
|
85
183
|
cat > .opencode/plugins/opencode-palantir.js <<'EOF'
|
|
86
184
|
import plugin from '../../dist/index.js';
|
|
87
185
|
|
|
@@ -89,8 +187,6 @@ export default plugin;
|
|
|
89
187
|
EOF
|
|
90
188
|
```
|
|
91
189
|
|
|
92
|
-
OpenCode automatically loads any `.js`/`.ts` files in `.opencode/plugins/` at startup.
|
|
93
|
-
|
|
94
190
|
## Development
|
|
95
191
|
|
|
96
192
|
Build the plugin:
|
|
@@ -123,6 +219,10 @@ Format with Prettier:
|
|
|
123
219
|
mise run format
|
|
124
220
|
```
|
|
125
221
|
|
|
222
|
+
## Release notes
|
|
223
|
+
|
|
224
|
+
For maintainers, see `RELEASING.md`.
|
|
225
|
+
|
|
126
226
|
## Author
|
|
127
227
|
|
|
128
228
|
Anand Pant <anand@shpit.dev>
|