ns-omp-provider 0.3.1 → 0.4.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.
- package/CHANGELOG.md +13 -0
- package/README.md +25 -50
- package/dist/compat/transcript.d.ts +5 -41
- package/dist/index.js +10190 -3420
- package/package.json +17 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
Bundles `@ngosangns/ns-pi-provider@0.3.0`.
|
|
6
|
+
|
|
7
|
+
Moved into the [ns-bridge](https://github.com/ngosangns/ns-bridge) monorepo; bundles the
|
|
8
|
+
workspace `@ngosangns/ns-pi-provider` (see its changelog: Kiro and Devin now run on the
|
|
9
|
+
shared `ns-kiro-core` / `ns-devin-core`).
|
|
10
|
+
|
|
11
|
+
- The opt-in `kiro` now logs in from the kiro-cli / Kiro IDE session, like
|
|
12
|
+
`ns-omp-provider-kiro`.
|
|
13
|
+
- Build: the `kiroRootPlugin` esbuild shim is gone — it only existed for the Pi
|
|
14
|
+
adapter's former vendored Kiro code.
|
|
15
|
+
|
|
3
16
|
## 0.3.1
|
|
4
17
|
|
|
5
18
|
Bundles `@ngosangns/ns-pi-provider@0.2.2`.
|
package/README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
# ns-omp-provider
|
|
2
2
|
|
|
3
3
|
[OMP](https://omp.sh) (oh-my-pi) plugin that exposes the **Kiro**, **Devin**, and
|
|
4
|
-
**Grok** providers from [`@ngosangns/ns-pi-provider`](
|
|
4
|
+
**Grok** providers from [`@ngosangns/ns-pi-provider`](../pi-provider), part of
|
|
5
|
+
[ns-bridge](https://github.com/ngosangns/ns-bridge).
|
|
5
6
|
|
|
6
7
|
`ns-pi-provider` targets Pi 1.0. OMP is a Pi fork whose extension API is close
|
|
7
8
|
but not identical — this package is the adapter. It does **not** modify
|
|
8
|
-
`ns-pi-provider`; the Pi sources
|
|
9
|
-
compat layer.
|
|
9
|
+
`ns-pi-provider`; the workspace's Pi sources (and the vendor cores under them)
|
|
10
|
+
are bundled at build time with a small compat layer.
|
|
10
11
|
|
|
11
12
|
| Provider | Auth | Notes |
|
|
12
13
|
|----------|------|-------|
|
|
13
|
-
| `kiro` (**opt-in**) |
|
|
14
|
+
| `kiro` (**opt-in**) | kiro-cli / Kiro IDE session (`/login kiro`) + `KIRO_API_KEY` | Off by default — use [`ns-omp-provider-kiro`](https://www.npmjs.com/package/ns-omp-provider-kiro); see below |
|
|
14
15
|
| `devin` | OAuth (`/login devin`) + `credentials.toml` / env | Swe-2 catalog when authenticated |
|
|
15
16
|
| `grok` (+ `grok-sdk` alias) | Local `grok` CLI / `~/.grok` / `XAI_API_KEY` | Commands: `/grok status \| models \| refresh` |
|
|
16
17
|
|
|
@@ -22,11 +23,8 @@ Shared command: `/ns-pi status | refresh [all\|kiro\|devin\|grok]`.
|
|
|
22
23
|
# from npm
|
|
23
24
|
omp plugin install ns-omp-provider
|
|
24
25
|
|
|
25
|
-
#
|
|
26
|
-
omp plugin
|
|
27
|
-
|
|
28
|
-
# local link (dev)
|
|
29
|
-
omp plugin link ~/Github/ngosangns/ns-omp-provider
|
|
26
|
+
# local link (dev, after `pnpm -r build` in ns-bridge)
|
|
27
|
+
omp plugin link ~/Github/ngosangns/ns-bridge/packages/omp-provider
|
|
30
28
|
|
|
31
29
|
# one-shot without installing
|
|
32
30
|
omp -e ./dist/index.js ...
|
|
@@ -53,15 +51,16 @@ export NS_OMP_PROVIDER_DISABLE=grok
|
|
|
53
51
|
```
|
|
54
52
|
|
|
55
53
|
Don't opt in to `kiro` while `ns-omp-provider-kiro` is installed — both would
|
|
56
|
-
register the same `kiro` provider id.
|
|
54
|
+
register the same `kiro` provider id. Both run the same `ns-kiro-core`, so the
|
|
55
|
+
dedicated plugin loses nothing.
|
|
57
56
|
|
|
58
57
|
## How the wrapper works
|
|
59
58
|
|
|
60
59
|
1. **Build-time** — esbuild bundles `@ngosangns/ns-pi-provider` into
|
|
61
60
|
`dist/index.js`, rewriting `@earendil-works/pi-ai*` imports onto
|
|
62
61
|
`src/compat/` (OMP's `@oh-my-pi/pi-ai` plus Pi 1.0 transcript helpers that
|
|
63
|
-
OMP does not ship
|
|
64
|
-
`withoutInitialSystemMessage`).
|
|
62
|
+
OMP does not ship — `getCurrentSystemPrompt`, `getCurrentTools`,
|
|
63
|
+
`withoutInitialSystemMessage` — re-exported from `ns-bridge-core/pi`).
|
|
65
64
|
2. **Runtime** — the OMP `ExtensionAPI` is wrapped so that:
|
|
66
65
|
- OMP contexts (`systemPrompt: string[]`, `developer` messages) become the
|
|
67
66
|
Pi shape (`systemPrompt: string`, no developer role) before
|
|
@@ -84,50 +83,26 @@ register the same `kiro` provider id.
|
|
|
84
83
|
models from `omp models` even though the provider is registered. After
|
|
85
84
|
`/login` (or with CLI creds present) the live catalog, including Devin
|
|
86
85
|
`swe-2-*`, appears via `fetchDynamicModels`.
|
|
87
|
-
- **Kiro catalog** (when opted in) — models come only from Kiro's `ListAvailableModels
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
Bumping it is a deliberate change (rebuild + retest).
|
|
86
|
+
- **Kiro catalog** (when opted in) — models come only from Kiro's `ListAvailableModels`:
|
|
87
|
+
with no Kiro session and no saved catalog snapshot, `kiro` registers zero models.
|
|
88
|
+
- **Bundled Pi adapter** — the build bundles the workspace's
|
|
89
|
+
`@ngosangns/ns-pi-provider` (`workspace:*`), so an ns-omp-provider release
|
|
90
|
+
ships whatever the Pi adapter is at that commit; note it in the changelog.
|
|
93
91
|
|
|
94
92
|
## Development
|
|
95
93
|
|
|
94
|
+
From the ns-bridge root:
|
|
95
|
+
|
|
96
96
|
```bash
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
npm run smoke # optional: real `omp models -e dist/index.js` under a temp HOME
|
|
97
|
+
pnpm install && pnpm -r build
|
|
98
|
+
pnpm vitest run --project omp # hermetic unit + bundle load tests
|
|
99
|
+
pnpm --filter ns-omp-provider typecheck
|
|
100
|
+
pnpm --filter ns-omp-provider smoke # optional: real `omp models -e dist/index.js` under a temp HOME
|
|
102
101
|
```
|
|
103
102
|
|
|
104
|
-
|
|
105
|
-
your real `~/.omp`.
|
|
103
|
+
The smoke script needs `omp` on `PATH` and does not touch your real `~/.omp`.
|
|
106
104
|
|
|
107
105
|
## Publish
|
|
108
106
|
|
|
109
|
-
|
|
110
|
-
[
|
|
111
|
-
publishes with **provenance** from a GitHub-hosted runner:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
# bump "version" in package.json first, then
|
|
115
|
-
npm run check
|
|
116
|
-
git tag v0.3.0 && git push origin v0.3.0
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Auth, in the order npm tries it:
|
|
120
|
-
|
|
121
|
-
1. **Trusted publishing (OIDC)**, if a trusted publisher is attached to the
|
|
122
|
-
package. npm only allows that once the package exists:
|
|
123
|
-
```bash
|
|
124
|
-
npm trust github ns-omp-provider --file publish.yml \
|
|
125
|
-
--repo ngosangns/ns-omp-provider --allow-publish
|
|
126
|
-
```
|
|
127
|
-
2. **`NPM_TOKEN` repository secret** (currently set): a granular npm token with
|
|
128
|
-
package write and "bypass 2FA", passed to npm as `NODE_AUTH_TOKEN`. This
|
|
129
|
-
covers the first publish. After trusted publishing is configured the secret
|
|
130
|
-
can be removed (`gh secret delete NPM_TOKEN --repo ngosangns/ns-omp-provider`).
|
|
131
|
-
|
|
132
|
-
Manual publish from a logged-in machine still works:
|
|
133
|
-
`npm run check && npm publish --access public`.
|
|
107
|
+
Released from the ns-bridge workflow with tag `ns-omp-provider@<version>`; see
|
|
108
|
+
[DEVELOPER.md](../../DEVELOPER.md#releasing).
|
|
@@ -1,43 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pi 1.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* these helpers. OMP keeps them on `context.systemPrompt` / `context.tools`
|
|
7
|
-
* and never puts system messages in the transcript, so on OMP these resolve
|
|
8
|
-
* to "" / [] / the messages unchanged — and the providers fall through to
|
|
9
|
-
* the (normalized) `context.systemPrompt` / `context.tools` they check first.
|
|
10
|
-
*
|
|
11
|
-
* Semantics mirror @earendil-works/pi-ai 1.0 `dist/utils/transcript.js`.
|
|
2
|
+
* Pi 1.x transcript helpers that OMP's pi-ai does not ship, for the bundled
|
|
3
|
+
* ns-pi-provider sources. One implementation shared with every Pi-family host:
|
|
4
|
+
* ns-bridge-core/pi. On OMP (no `system` messages in the transcript) they
|
|
5
|
+
* resolve to "" / [] / the messages unchanged.
|
|
12
6
|
*/
|
|
13
|
-
export
|
|
14
|
-
name: string;
|
|
15
|
-
[key: string]: unknown;
|
|
16
|
-
}
|
|
17
|
-
export interface MessageLike {
|
|
18
|
-
role: string;
|
|
19
|
-
content?: unknown;
|
|
20
|
-
toolsAdded?: ToolLike[];
|
|
21
|
-
toolsRemoved?: Array<{
|
|
22
|
-
name: string;
|
|
23
|
-
}>;
|
|
24
|
-
sections?: Record<string, string | null>;
|
|
25
|
-
timestamp?: number;
|
|
26
|
-
[key: string]: unknown;
|
|
27
|
-
}
|
|
28
|
-
/** Drop the leading system message for APIs that carry the prompt outside the message list. */
|
|
29
|
-
export declare function withoutInitialSystemMessage<T extends {
|
|
30
|
-
role: string;
|
|
31
|
-
}>(messages: T[]): T[];
|
|
32
|
-
/** Resolve the tools available after applying every transcript delta in order. */
|
|
33
|
-
export declare function getCurrentTools<T = ToolLike>(messages: ReadonlyArray<{
|
|
34
|
-
role: string;
|
|
35
|
-
}>): T[];
|
|
36
|
-
/**
|
|
37
|
-
* Render the current system prompt after replaying every system message:
|
|
38
|
-
* base `content` blocks are concatenated, named `sections` are patched in
|
|
39
|
-
* order (null deletes) and appended after the base prompt.
|
|
40
|
-
*/
|
|
41
|
-
export declare function getCurrentSystemPrompt(messages: ReadonlyArray<{
|
|
42
|
-
role: string;
|
|
43
|
-
}>): string;
|
|
7
|
+
export { getCurrentSystemPrompt, getCurrentTools, withoutInitialSystemMessage } from "ns-bridge-core/pi";
|