@openontology/opencode-palantir 0.1.0-next.26

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shpit.dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # opencode-palantir
2
+
3
+ OpenCode plugin that provides Palantir Foundry documentation to AI agents via local Parquet storage.
4
+
5
+ ## Features
6
+
7
+ - Fetches all ~3,600 pages from Palantir's public documentation
8
+ - Stores in local Parquet file for fast offline access (~17MB)
9
+ - Exposes `get_doc_page` and `list_all_docs` tools for AI agents
10
+
11
+ ## Setup
12
+
13
+ ```bash
14
+ bun install
15
+ ```
16
+
17
+ ## Fetching Documentation
18
+
19
+ Fetch all Palantir docs into `data/docs.parquet` (~2 minutes, ~17MB file):
20
+
21
+ ```bash
22
+ bun run src/docs/fetch-cli.ts
23
+ ```
24
+
25
+ ## Querying the Data
26
+
27
+ ### Schema
28
+
29
+ The Parquet file contains a single row group with the following columns:
30
+
31
+ | Column | Type | Description |
32
+ | ------------ | ------- | ----------------------------------- |
33
+ | `url` | string | Page URL path (e.g. `/foundry/...`) |
34
+ | `title` | string | Page title |
35
+ | `content` | string | Full page content (Markdown) |
36
+ | `word_count` | integer | Word count of content |
37
+ | `meta` | string | JSON-encoded metadata |
38
+ | `fetched_at` | string | ISO 8601 timestamp of when fetched |
39
+
40
+ ### Bun
41
+
42
+ ```typescript
43
+ import { parquetReadObjects } from 'hyparquet';
44
+
45
+ const file = await Bun.file('data/docs.parquet').arrayBuffer();
46
+
47
+ // List all pages (url + title only)
48
+ const pages = await parquetReadObjects({ file, columns: ['url', 'title'] });
49
+ console.log(`${pages.length} pages`);
50
+
51
+ // Search by title
52
+ const matches = pages.filter((p) => p.title.includes('Pipeline'));
53
+ console.log(matches.slice(0, 10));
54
+
55
+ // Get a specific page's content by row index
56
+ const urlToRow = new Map(pages.map((p, i) => [p.url, i]));
57
+ const rowIndex = urlToRow.get('/foundry/ontology/overview/');
58
+ if (rowIndex !== undefined) {
59
+ const [page] = await parquetReadObjects({
60
+ file,
61
+ rowStart: rowIndex,
62
+ rowEnd: rowIndex + 1,
63
+ });
64
+ console.log(page.content);
65
+ }
66
+ ```
67
+
68
+ ## OpenCode Tools
69
+
70
+ When installed as an OpenCode plugin, exposes:
71
+
72
+ - **`get_doc_page`** - Retrieve a specific doc page by URL
73
+ - **`list_all_docs`** - List all available documentation pages
74
+ - **`/refresh-docs`** - Command hook to re-fetch all documentation
75
+
76
+ ### Installing in OpenCode (this project only)
77
+
78
+ Create a tiny wrapper plugin file that re-exports the built artifact into the project-level auto-discovered plugins directory:
79
+
80
+ ```bash
81
+ mkdir -p .opencode/plugins
82
+ ```
83
+
84
+ ```bash
85
+ cat > .opencode/plugins/opencode-palantir.js <<'EOF'
86
+ import plugin from '../../dist/index.js';
87
+
88
+ export default plugin;
89
+ EOF
90
+ ```
91
+
92
+ OpenCode automatically loads any `.js`/`.ts` files in `.opencode/plugins/` at startup.
93
+
94
+ ## Development
95
+
96
+ Build the plugin:
97
+
98
+ ```bash
99
+ mise run build
100
+ ```
101
+
102
+ Run tests:
103
+
104
+ ```bash
105
+ mise run test
106
+ ```
107
+
108
+ Smoke test the built artifact (build + verify tools load from `dist/index.js`):
109
+
110
+ ```bash
111
+ mise run smoke
112
+ ```
113
+
114
+ Lint code:
115
+
116
+ ```bash
117
+ mise run lint
118
+ ```
119
+
120
+ Format with Prettier:
121
+
122
+ ```bash
123
+ mise run format
124
+ ```
125
+
126
+ ## Author
127
+
128
+ Anand Pant <anand@shpit.dev>
@@ -0,0 +1,4 @@
1
+ import type { Plugin } from '@opencode-ai/plugin';
2
+
3
+ declare const plugin: Plugin;
4
+ export default plugin;