@herbertgao/pi-extensions 2026.9.17 → 2026.9.18
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 +14 -15
- package/node_modules/@herbertgao/pi-bark/package.json +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +75 -75
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +7 -7
- package/node_modules/@herbertgao/resume-from/package.json +4 -2
- package/node_modules/@herbertgao/sol-pi/package.json +6 -6
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +99 -99
- package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
- package/node_modules/@tifan/pi-handoff/package.json +1 -1
- package/node_modules/@tifan/pi-handoff/src/index.ts +56 -26
- package/node_modules/@tifan/pi-mermaid-open/package.json +1 -1
- package/node_modules/@tifan/pi-preferred-thinking/package.json +1 -1
- package/node_modules/@tifan/pi-recap/package.json +1 -1
- package/node_modules/@tifan/pi-rename/package.json +1 -1
- package/node_modules/pi-antigravity/package.json +2 -2
- package/node_modules/pi-lens/package.json +158 -158
- package/node_modules/pi-multi-account/package.json +2 -2
- package/node_modules/pi-typesafe/README.md +1 -1
- package/node_modules/pi-typesafe/dist/auth.d.ts +9 -5
- package/node_modules/pi-typesafe/dist/auth.js +7 -3
- package/node_modules/pi-typesafe/dist/backends.d.ts +33 -3
- package/node_modules/pi-typesafe/dist/backends.js +95 -1
- package/node_modules/pi-typesafe/dist/client.d.ts +5 -5
- package/node_modules/pi-typesafe/dist/client.js +12 -9
- package/node_modules/pi-typesafe/dist/credentials.d.ts +14 -8
- package/node_modules/pi-typesafe/dist/credentials.js +10 -7
- package/node_modules/pi-typesafe/dist/errors.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/dist/login.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/login.js +2 -2
- package/node_modules/pi-typesafe/package.json +5 -5
- package/node_modules/pi-web-access/package.json +2 -2
- package/node_modules/remote-pi/package.json +5 -1
- package/package.json +16 -28
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +0 -1013
- package/node_modules/pi-mcp-adapter/LICENSE +0 -21
- package/node_modules/pi-mcp-adapter/OAUTH.md +0 -369
- package/node_modules/pi-mcp-adapter/README.md +0 -1021
- package/node_modules/pi-mcp-adapter/abort.ts +0 -34
- package/node_modules/pi-mcp-adapter/agent-dir.ts +0 -68
- package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +0 -416
- package/node_modules/pi-mcp-adapter/agent-plugin-provenance.ts +0 -36
- package/node_modules/pi-mcp-adapter/app-bridge.bundle.js +0 -67
- package/node_modules/pi-mcp-adapter/banner.png +0 -0
- package/node_modules/pi-mcp-adapter/bearer-command-resolver.ts +0 -193
- package/node_modules/pi-mcp-adapter/claude-plugin-loader.ts +0 -365
- package/node_modules/pi-mcp-adapter/cli.js +0 -454
- package/node_modules/pi-mcp-adapter/commands.ts +0 -861
- package/node_modules/pi-mcp-adapter/config.ts +0 -1565
- package/node_modules/pi-mcp-adapter/consent-manager.ts +0 -95
- package/node_modules/pi-mcp-adapter/direct-tool-surface.ts +0 -244
- package/node_modules/pi-mcp-adapter/direct-tools.ts +0 -428
- package/node_modules/pi-mcp-adapter/dist/abort.d.ts +0 -2
- package/node_modules/pi-mcp-adapter/dist/abort.js +0 -36
- package/node_modules/pi-mcp-adapter/dist/abort.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/agent-dir.d.ts +0 -10
- package/node_modules/pi-mcp-adapter/dist/agent-dir.js +0 -63
- package/node_modules/pi-mcp-adapter/dist/agent-dir.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.d.ts +0 -8
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js +0 -398
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.d.ts +0 -1
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js +0 -31
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.d.ts +0 -6
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js +0 -194
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.d.ts +0 -9
- package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js +0 -362
- package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/config.d.ts +0 -134
- package/node_modules/pi-mcp-adapter/dist/config.js +0 -1361
- package/node_modules/pi-mcp-adapter/dist/config.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/consent-manager.d.ts +0 -18
- package/node_modules/pi-mcp-adapter/dist/consent-manager.js +0 -88
- package/node_modules/pi-mcp-adapter/dist/consent-manager.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.d.ts +0 -17
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js +0 -316
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/errors.d.ts +0 -131
- package/node_modules/pi-mcp-adapter/dist/errors.js +0 -278
- package/node_modules/pi-mcp-adapter/dist/errors.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/http-ca.d.ts +0 -8
- package/node_modules/pi-mcp-adapter/dist/http-ca.js +0 -88
- package/node_modules/pi-mcp-adapter/dist/http-ca.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/jev-client.d.ts +0 -14
- package/node_modules/pi-mcp-adapter/dist/jev-client.js +0 -367
- package/node_modules/pi-mcp-adapter/dist/jev-client.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.d.ts +0 -77
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.js +0 -2
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.d.ts +0 -51
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.js +0 -205
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.d.ts +0 -2
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js +0 -68
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/lifecycle.d.ts +0 -56
- package/node_modules/pi-mcp-adapter/dist/lifecycle.js +0 -410
- package/node_modules/pi-mcp-adapter/dist/lifecycle.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/logger.d.ts +0 -51
- package/node_modules/pi-mcp-adapter/dist/logger.js +0 -131
- package/node_modules/pi-mcp-adapter/dist/logger.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.d.ts +0 -26
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js +0 -103
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.d.ts +0 -118
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js +0 -1097
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.d.ts +0 -170
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.js +0 -1142
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.d.ts +0 -24
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +0 -203
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.d.ts +0 -53
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js +0 -441
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.d.ts +0 -148
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js +0 -689
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.d.ts +0 -6
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.js +0 -166
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.d.ts +0 -102
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js +0 -369
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.d.ts +0 -95
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.js +0 -242
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.d.ts +0 -19
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +0 -301
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.d.ts +0 -6
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.js +0 -505
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.d.ts +0 -2
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js +0 -144
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.d.ts +0 -10
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.js +0 -312
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/resource-tools.d.ts +0 -1
- package/node_modules/pi-mcp-adapter/dist/resource-tools.js +0 -15
- package/node_modules/pi-mcp-adapter/dist/resource-tools.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.d.ts +0 -13
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.js +0 -97
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.d.ts +0 -17
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.js +0 -203
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.d.ts +0 -11
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.js +0 -172
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/server-manager.d.ts +0 -157
- package/node_modules/pi-mcp-adapter/dist/server-manager.js +0 -1745
- package/node_modules/pi-mcp-adapter/dist/server-manager.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/session-approvals.d.ts +0 -34
- package/node_modules/pi-mcp-adapter/dist/session-approvals.js +0 -140
- package/node_modules/pi-mcp-adapter/dist/session-approvals.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/session-recovery.d.ts +0 -26
- package/node_modules/pi-mcp-adapter/dist/session-recovery.js +0 -142
- package/node_modules/pi-mcp-adapter/dist/session-recovery.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/state.d.ts +0 -73
- package/node_modules/pi-mcp-adapter/dist/state.js +0 -2
- package/node_modules/pi-mcp-adapter/dist/state.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +0 -642
- package/node_modules/pi-mcp-adapter/dist/types.js +0 -331
- package/node_modules/pi-mcp-adapter/dist/types.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.d.ts +0 -6
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js +0 -37
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.d.ts +0 -17
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js +0 -219
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.d.ts +0 -104
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js +0 -59
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.d.ts +0 -4
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js +0 -27
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.d.ts +0 -15
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js +0 -85
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/utils.d.ts +0 -41
- package/node_modules/pi-mcp-adapter/dist/utils.js +0 -417
- package/node_modules/pi-mcp-adapter/dist/utils.js.map +0 -1
- package/node_modules/pi-mcp-adapter/elicitation-handler.ts +0 -358
- package/node_modules/pi-mcp-adapter/error-signal.ts +0 -32
- package/node_modules/pi-mcp-adapter/errors.ts +0 -364
- package/node_modules/pi-mcp-adapter/examples/jev-accessibility-loop.mjs +0 -85
- package/node_modules/pi-mcp-adapter/examples/jev-semantic-filter.mjs +0 -34
- package/node_modules/pi-mcp-adapter/failure-backoff.ts +0 -23
- package/node_modules/pi-mcp-adapter/glimpse-ui.ts +0 -80
- package/node_modules/pi-mcp-adapter/host-html-template.ts +0 -515
- package/node_modules/pi-mcp-adapter/http-ca.ts +0 -84
- package/node_modules/pi-mcp-adapter/index.ts +0 -2106
- package/node_modules/pi-mcp-adapter/init.ts +0 -721
- package/node_modules/pi-mcp-adapter/jev-client.ts +0 -300
- package/node_modules/pi-mcp-adapter/jev-contracts.ts +0 -53
- package/node_modules/pi-mcp-adapter/jev-key-store.ts +0 -192
- package/node_modules/pi-mcp-adapter/json-schema-validator.ts +0 -83
- package/node_modules/pi-mcp-adapter/lazy-loader.ts +0 -7
- package/node_modules/pi-mcp-adapter/lifecycle.ts +0 -457
- package/node_modules/pi-mcp-adapter/logger.ts +0 -169
- package/node_modules/pi-mcp-adapter/mcp-auth-fetch.ts +0 -113
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +0 -1296
- package/node_modules/pi-mcp-adapter/mcp-auth.ts +0 -1287
- package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +0 -250
- package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +0 -534
- package/node_modules/pi-mcp-adapter/mcp-code.ts +0 -495
- package/node_modules/pi-mcp-adapter/mcp-install.ts +0 -60
- package/node_modules/pi-mcp-adapter/mcp-keyring-helper.cjs +0 -89
- package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +0 -819
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +0 -511
- package/node_modules/pi-mcp-adapter/mcp-panel-theme.ts +0 -104
- package/node_modules/pi-mcp-adapter/mcp-panel.ts +0 -1099
- package/node_modules/pi-mcp-adapter/mcp-probe.ts +0 -201
- package/node_modules/pi-mcp-adapter/mcp-references.ts +0 -373
- package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +0 -137
- package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +0 -747
- package/node_modules/pi-mcp-adapter/mcp-status.ts +0 -105
- package/node_modules/pi-mcp-adapter/mcp-tasks.ts +0 -467
- package/node_modules/pi-mcp-adapter/mcp-trace.ts +0 -306
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +0 -362
- package/node_modules/pi-mcp-adapter/namespace-tools.ts +0 -334
- package/node_modules/pi-mcp-adapter/npx-resolver.ts +0 -543
- package/node_modules/pi-mcp-adapter/oauth-handler.ts +0 -30
- package/node_modules/pi-mcp-adapter/oauth.ts +0 -52
- package/node_modules/pi-mcp-adapter/onboarding-state.ts +0 -76
- package/node_modules/pi-mcp-adapter/package-mcp-loader.ts +0 -156
- package/node_modules/pi-mcp-adapter/package.json +0 -219
- package/node_modules/pi-mcp-adapter/panel-keys.ts +0 -53
- package/node_modules/pi-mcp-adapter/prompts.ts +0 -385
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +0 -1735
- package/node_modules/pi-mcp-adapter/request-headers-command.ts +0 -333
- package/node_modules/pi-mcp-adapter/resource-tools.ts +0 -17
- package/node_modules/pi-mcp-adapter/runtime-owner.ts +0 -106
- package/node_modules/pi-mcp-adapter/sampling-handler.ts +0 -261
- package/node_modules/pi-mcp-adapter/sandbox-proxy-template.ts +0 -144
- package/node_modules/pi-mcp-adapter/search-ranking.ts +0 -309
- package/node_modules/pi-mcp-adapter/secure-keyring.ts +0 -170
- package/node_modules/pi-mcp-adapter/semantic-search.ts +0 -186
- package/node_modules/pi-mcp-adapter/server-manager.ts +0 -2088
- package/node_modules/pi-mcp-adapter/session-approvals.ts +0 -201
- package/node_modules/pi-mcp-adapter/session-recovery.ts +0 -158
- package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +0 -49
- package/node_modules/pi-mcp-adapter/state.ts +0 -71
- package/node_modules/pi-mcp-adapter/tool-approval.ts +0 -205
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +0 -302
- package/node_modules/pi-mcp-adapter/tool-registrar.ts +0 -255
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +0 -573
- package/node_modules/pi-mcp-adapter/ts-shape.ts +0 -149
- package/node_modules/pi-mcp-adapter/types.ts +0 -1120
- package/node_modules/pi-mcp-adapter/ui-app-bridge-helpers.ts +0 -40
- package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +0 -266
- package/node_modules/pi-mcp-adapter/ui-server.ts +0 -993
- package/node_modules/pi-mcp-adapter/ui-session.ts +0 -624
- package/node_modules/pi-mcp-adapter/ui-stream-types.ts +0 -89
- package/node_modules/pi-mcp-adapter/ui-tool-visibility.ts +0 -25
- package/node_modules/pi-mcp-adapter/unix-socket-transport.ts +0 -85
- package/node_modules/pi-mcp-adapter/utils.ts +0 -464
|
@@ -3,7 +3,7 @@ import { TypeSafeIntegrationError } from "./errors.js";
|
|
|
3
3
|
export const DEFAULT_BACKEND = "typesafe";
|
|
4
4
|
/** The environment variable and login store that the default backend reads. */
|
|
5
5
|
export const TYPESAFE_KEY_ENV = "TYPESAFE_API_KEY";
|
|
6
|
-
/** Registry of known judgment backends.
|
|
6
|
+
/** Registry of known judgment backends. Callers pass a `BackendEndpoint` for a host this registry does not name. */
|
|
7
7
|
export const DECISIONS_BACKENDS = {
|
|
8
8
|
typesafe: { label: "TypeSafe", host: "https://api.typesafe.ai", keyEnv: TYPESAFE_KEY_ENV },
|
|
9
9
|
openrouter: {
|
|
@@ -16,6 +16,16 @@ export const DECISIONS_BACKENDS = {
|
|
|
16
16
|
modelsIdField: "id",
|
|
17
17
|
modelsVerifyKey: false,
|
|
18
18
|
},
|
|
19
|
+
commandcode: {
|
|
20
|
+
label: "Command Code",
|
|
21
|
+
host: "https://api.commandcode.ai",
|
|
22
|
+
keyEnv: "COMMANDCODE_API_KEY",
|
|
23
|
+
path: "/provider/v1/systemone",
|
|
24
|
+
modelsPath: "/provider/v1/models",
|
|
25
|
+
modelsField: "data",
|
|
26
|
+
modelsIdField: "id",
|
|
27
|
+
modelsVerifyKey: false,
|
|
28
|
+
},
|
|
19
29
|
};
|
|
20
30
|
/** The registry entry for a backend name; a `configuration` error for a name the registry does not know. */
|
|
21
31
|
export function backendConfig(name) {
|
|
@@ -28,6 +38,7 @@ export function backendConfig(name) {
|
|
|
28
38
|
const DEFAULT_MODEL = {
|
|
29
39
|
typesafe: "jev-latest",
|
|
30
40
|
openrouter: "typesafe/jev-1.13",
|
|
41
|
+
commandcode: "typesafe/jev",
|
|
31
42
|
};
|
|
32
43
|
/**
|
|
33
44
|
* The model id to send for a caller's `model` on this backend. OpenRouter routes a bare Jev id under the `typesafe`
|
|
@@ -57,3 +68,86 @@ export function defaultModelId(backend) {
|
|
|
57
68
|
export function usesTypesafeKey(backend) {
|
|
58
69
|
return (backend.keyEnv ?? TYPESAFE_KEY_ENV) === TYPESAFE_KEY_ENV;
|
|
59
70
|
}
|
|
71
|
+
const KEY_ENV_MESSAGE = "Backend keyEnv must name an environment variable: letters, digits, and underscores, not starting with a digit.";
|
|
72
|
+
const HOST_MESSAGE = "Backend host must be an absolute https: URL with no user info, path, query, or fragment (http: is allowed only for localhost, 127.0.0.0/8, and [::1]).";
|
|
73
|
+
function refuse(message) {
|
|
74
|
+
throw new TypeSafeIntegrationError("configuration", message);
|
|
75
|
+
}
|
|
76
|
+
/** `https://gw.example.com?` and `https://gw.example.com#` parse clean, so the raw string itself must carry neither. */
|
|
77
|
+
function hasRawQueryOrFragment(value) {
|
|
78
|
+
return value.includes("?") || value.includes("#");
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Resolve a registry name or a caller-supplied endpoint into the validated form the client uses. A name resolves to
|
|
82
|
+
* its registry entry unchanged; an endpoint is validated field by field and returned as a fresh object whose `host`
|
|
83
|
+
* is origin-only. Messages never quote a caller value — a host can carry credentials in its user info — except the
|
|
84
|
+
* label, and only after it is validated. Validation runs on every call; nothing is cached.
|
|
85
|
+
*/
|
|
86
|
+
export function resolveBackend(backend) {
|
|
87
|
+
const spec = backend === undefined ? DEFAULT_BACKEND : backend;
|
|
88
|
+
if (typeof spec === "string") {
|
|
89
|
+
const entry = backendConfig(spec);
|
|
90
|
+
return {
|
|
91
|
+
...entry,
|
|
92
|
+
name: spec,
|
|
93
|
+
host: entry.host,
|
|
94
|
+
keyEnv: entry.keyEnv ?? TYPESAFE_KEY_ENV,
|
|
95
|
+
defaultModel: defaultModelId(spec),
|
|
96
|
+
modelsVerifyKey: entry.modelsVerifyKey !== false,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (spec === null || typeof spec !== "object") {
|
|
100
|
+
refuse("backend must be a registry name or a backend object.");
|
|
101
|
+
}
|
|
102
|
+
const label = typeof spec.label === "string" ? spec.label.trim() : "";
|
|
103
|
+
if (!label || label.length > 60)
|
|
104
|
+
refuse("Backend label must be a nonempty string of at most 60 characters.");
|
|
105
|
+
let host;
|
|
106
|
+
if (typeof spec.host !== "string" || hasRawQueryOrFragment(spec.host))
|
|
107
|
+
refuse(HOST_MESSAGE);
|
|
108
|
+
try {
|
|
109
|
+
host = new URL(spec.host);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
refuse(HOST_MESSAGE);
|
|
113
|
+
}
|
|
114
|
+
const loopback = host.hostname === "localhost" || host.hostname === "[::1]" || /^127(?:\.\d{1,3}){3}$/.test(host.hostname);
|
|
115
|
+
if (host.protocol !== "https:" && !(host.protocol === "http:" && loopback))
|
|
116
|
+
refuse(HOST_MESSAGE);
|
|
117
|
+
if (host.username !== "" || host.password !== "" || host.pathname !== "/" || host.search !== "" || host.hash !== "")
|
|
118
|
+
refuse(HOST_MESSAGE);
|
|
119
|
+
for (const [field, message] of [["path", 'Backend path must be a string that starts with "/".'], ["modelsPath", 'Backend modelsPath must be a string that starts with "/".']]) {
|
|
120
|
+
const value = spec[field];
|
|
121
|
+
if (value !== undefined && (typeof value !== "string" || !value.startsWith("/") || hasRawQueryOrFragment(value)))
|
|
122
|
+
refuse(message);
|
|
123
|
+
}
|
|
124
|
+
if (spec.modelsField !== undefined && (typeof spec.modelsField !== "string" || !spec.modelsField))
|
|
125
|
+
refuse("Backend modelsField must be a nonempty string.");
|
|
126
|
+
if (spec.modelsIdField !== undefined && (typeof spec.modelsIdField !== "string" || !spec.modelsIdField))
|
|
127
|
+
refuse("Backend modelsIdField must be a nonempty string.");
|
|
128
|
+
if (spec.modelsVerifyKey !== undefined && typeof spec.modelsVerifyKey !== "boolean")
|
|
129
|
+
refuse("Backend modelsVerifyKey must be a boolean.");
|
|
130
|
+
if (typeof spec.keyEnv !== "string" || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(spec.keyEnv))
|
|
131
|
+
refuse(KEY_ENV_MESSAGE);
|
|
132
|
+
if (spec.keyEnv.toUpperCase() === TYPESAFE_KEY_ENV) {
|
|
133
|
+
refuse("Backend keyEnv must not be TYPESAFE_API_KEY: the TypeSafe key is only sent to the typesafe backend. Give this endpoint its own variable.");
|
|
134
|
+
}
|
|
135
|
+
if (spec.defaultModel !== undefined && (typeof spec.defaultModel !== "string" || !spec.defaultModel.trim() || spec.defaultModel.length > 100)) {
|
|
136
|
+
refuse("Backend defaultModel must be a nonempty string of at most 100 characters.");
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
label,
|
|
140
|
+
host: host.origin,
|
|
141
|
+
keyEnv: spec.keyEnv,
|
|
142
|
+
modelsVerifyKey: spec.modelsVerifyKey === true,
|
|
143
|
+
...(spec.path === undefined ? {} : { path: spec.path }),
|
|
144
|
+
...(spec.modelsPath === undefined ? {} : { modelsPath: spec.modelsPath }),
|
|
145
|
+
...(spec.modelsField === undefined ? {} : { modelsField: spec.modelsField }),
|
|
146
|
+
...(spec.modelsIdField === undefined ? {} : { modelsIdField: spec.modelsIdField }),
|
|
147
|
+
...(spec.defaultModel === undefined ? {} : { defaultModel: spec.defaultModel }),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** The destination host only — scheme, host, and port, e.g. `api.commandcode.ai` — for consent text. */
|
|
151
|
+
export function backendHost(backend) {
|
|
152
|
+
return new URL(resolveBackend(backend).host).host;
|
|
153
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Fetch, Questions, SystemOneRequest, SystemOneResult } from "@typesafe-ai/sdk";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BackendSpec } from "./backends.js";
|
|
3
3
|
import type { BatchEvaluation, BatchOptions } from "./batch.js";
|
|
4
4
|
import type { BlockedCap, SpendCaps, UsageLedger, UsageReport } from "./usage.js";
|
|
5
|
-
export { DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./backends.js";
|
|
6
|
-
export type { BackendConfig, TypeSafeBackend } from "./backends.js";
|
|
5
|
+
export { backendHost, resolveBackend, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./backends.js";
|
|
6
|
+
export type { BackendConfig, BackendEndpoint, BackendSpec, ResolvedBackend, TypeSafeBackend } from "./backends.js";
|
|
7
7
|
export interface TypeSafeOptions {
|
|
8
8
|
/** Defaults to TYPESAFE_API_KEY, then the key saved by `/typesafe login`; never returned. */
|
|
9
9
|
apiKey?: string;
|
|
10
|
-
/** Judgment backend. When omitted, routes to the default TypeSafe host. */
|
|
11
|
-
backend?:
|
|
10
|
+
/** Judgment backend: a registry name or a caller-supplied endpoint. When omitted, routes to the default TypeSafe host. */
|
|
11
|
+
backend?: BackendSpec;
|
|
12
12
|
/** Defaults to the backend's own default (`jev-latest`, `typesafe/jev-1.13` on OpenRouter); a bare Jev id is mapped to the backend's id form before sending. No model is inferred from submitted content. */
|
|
13
13
|
model?: string;
|
|
14
14
|
/** Per request. Default: 15 seconds. No automatic retries. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TypeSafeClient } from "@typesafe-ai/sdk";
|
|
2
2
|
import { recordAuthFailure, recordAuthVerified } from "./auth.js";
|
|
3
|
-
import {
|
|
3
|
+
import { TYPESAFE_KEY_ENV, backendModelId, resolveBackend, usesTypesafeKey } from "./backends.js";
|
|
4
4
|
import { evaluateAll, evaluateMany } from "./batch.js";
|
|
5
5
|
import { keySituation } from "./credentials.js";
|
|
6
6
|
import { TypeSafeIntegrationError, safeError } from "./errors.js";
|
|
7
7
|
import { DEFAULT_MAX_INPUT_BYTES, assertWithinByteLimit, prepareEvaluationRequest } from "./schema.js";
|
|
8
8
|
import { DEFAULT_USD_PER_MTOK, capsFromEnvironment, estimateUsd, mergeCaps, openUsageLedger } from "./usage.js";
|
|
9
|
-
export { DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./backends.js";
|
|
9
|
+
export { backendHost, resolveBackend, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./backends.js";
|
|
10
10
|
/** The paths the SDK appends to whatever base URL it is given. */
|
|
11
11
|
const SDK_PATH = "/v1/systemone";
|
|
12
12
|
const SDK_MODELS_PATH = "/v1/models";
|
|
@@ -118,13 +118,14 @@ function capsDescription(caps) {
|
|
|
118
118
|
}
|
|
119
119
|
/** A bounded, server-side TypeSafe client independent of Pi's runtime. */
|
|
120
120
|
export function createTypeSafe(options = {}) {
|
|
121
|
+
const backend = resolveBackend(options.backend);
|
|
121
122
|
let apiKey = options.apiKey?.trim();
|
|
122
|
-
const backendName = options.backend ?? DEFAULT_BACKEND;
|
|
123
|
-
const backend = backendConfig(backendName);
|
|
124
123
|
const baseURL = backend.host;
|
|
124
|
+
// Only a registry backend maps ids; a caller-supplied endpoint's model is sent as the caller wrote it.
|
|
125
|
+
const mapModel = (model) => (backend.name === undefined ? model : backendModelId(backend.name, model));
|
|
125
126
|
if (!apiKey) {
|
|
126
127
|
// The same resolution that authState() and ensureApiKey() report, so the status line and the request agree.
|
|
127
|
-
const situation = keySituation(
|
|
128
|
+
const situation = keySituation(options.backend);
|
|
128
129
|
if (situation.kind === "unusable")
|
|
129
130
|
throw new TypeSafeIntegrationError("configuration", situation.reason);
|
|
130
131
|
if (situation.kind === "environment" || situation.kind === "stored")
|
|
@@ -148,10 +149,12 @@ export function createTypeSafe(options = {}) {
|
|
|
148
149
|
const transport = backend.path !== undefined || backend.modelsPath !== undefined ? backendFetch(backend, options.fetch) : options.fetch;
|
|
149
150
|
// The caller's input is validated as written, then mapped to the backend's id form; omitting it sends the backend's
|
|
150
151
|
// own default, which the mapping leaves unchanged.
|
|
151
|
-
const requested = options.model ??
|
|
152
|
+
const requested = options.model ?? backend.defaultModel;
|
|
153
|
+
if (requested === undefined)
|
|
154
|
+
throw new TypeSafeIntegrationError("configuration", `Backend "${backend.label}" names no defaultModel; pass model to createTypeSafe.`);
|
|
152
155
|
if (typeof requested !== "string" || !requested.trim() || requested.length > 100)
|
|
153
156
|
throw new TypeSafeIntegrationError("configuration", "model must be a nonempty string of at most 100 characters.");
|
|
154
|
-
const model =
|
|
157
|
+
const model = mapModel(requested);
|
|
155
158
|
// Do not inherit SDK debug logging or alternate destinations from the environment.
|
|
156
159
|
const client = new TypeSafeClient({
|
|
157
160
|
apiKey,
|
|
@@ -187,7 +190,7 @@ export function createTypeSafe(options = {}) {
|
|
|
187
190
|
if (!Array.isArray(models))
|
|
188
191
|
throw new TypeSafeIntegrationError("response", "TypeSafe returned an unexpected model list.");
|
|
189
192
|
// A backend that serves its list publicly accepts any key, so a success there proves nothing about one.
|
|
190
|
-
if (backend.modelsVerifyKey
|
|
193
|
+
if (backend.modelsVerifyKey && !verificationRecorded) {
|
|
191
194
|
verificationRecorded = true;
|
|
192
195
|
recordAuthVerified();
|
|
193
196
|
}
|
|
@@ -200,7 +203,7 @@ export function createTypeSafe(options = {}) {
|
|
|
200
203
|
async evaluate(input, callOptions = {}) {
|
|
201
204
|
const validated = prepareEvaluationRequest(input, { maxInputBytes });
|
|
202
205
|
// A per-request model meets the same mapping as the client default; the schema already limited the caller's own id.
|
|
203
|
-
const body = JSON.stringify({ ...validated, model: validated.model === undefined ? model :
|
|
206
|
+
const body = JSON.stringify({ ...validated, model: validated.model === undefined ? model : mapModel(validated.model) });
|
|
204
207
|
assertWithinByteLimit(body, maxInputBytes);
|
|
205
208
|
if (callOptions.signal?.aborted)
|
|
206
209
|
throw new TypeSafeIntegrationError("aborted", "TypeSafe request cancelled before submission.");
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BackendSpec } from "./backends.js";
|
|
2
2
|
export type KeySource = "environment" | "stored";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The complete answer to "which key is in effect" for a valid backend: it never throws. An invalid backend — an
|
|
5
|
+
* unknown name or an endpoint object that fails validation — throws the same `configuration` error as resolveBackend.
|
|
6
|
+
*/
|
|
4
7
|
export type KeySituation =
|
|
5
8
|
/** `keyEnv` names the variable that was read; absent means `TYPESAFE_API_KEY`. */
|
|
6
9
|
{
|
|
@@ -30,21 +33,24 @@ export declare function normalizeApiKey(value: unknown): string;
|
|
|
30
33
|
*/
|
|
31
34
|
export declare function readStoredApiKey(): string | undefined;
|
|
32
35
|
/**
|
|
33
|
-
* What the environment, the login store, and file permissions add up to right now for one judgment backend.
|
|
34
|
-
* throws
|
|
36
|
+
* What the environment, the login store, and file permissions add up to right now for one judgment backend. A valid
|
|
37
|
+
* backend never throws: the "unusable" kind carries the user-facing reason (a stored key that other local users can
|
|
38
|
+
* read). An invalid backend — an unknown name or an endpoint object that fails validation — throws the same
|
|
39
|
+
* `configuration` error as resolveBackend(), so validate a user-supplied endpoint with resolveBackend() first.
|
|
35
40
|
* The TypeSafe backend reads `TYPESAFE_API_KEY`, then the login store. Every other backend reads only its own
|
|
36
41
|
* environment variable, because the store holds a TypeSafe key and a login verifies against api.typesafe.ai.
|
|
37
42
|
*/
|
|
38
|
-
export declare function keySituation(backend?:
|
|
43
|
+
export declare function keySituation(backend?: BackendSpec): KeySituation;
|
|
39
44
|
/** Short phrase naming the source; full sentences stay with the caller. */
|
|
40
45
|
export declare function keySourceLabel(situation: KeySituation): string;
|
|
41
46
|
/**
|
|
42
47
|
* The pre-0.4.0 key interface, frozen for existing callers: environment first so CI and scripts stay explicit, the
|
|
43
48
|
* stored key as the interactive default, `undefined` when no key is configured, and a `configuration` error when a
|
|
44
|
-
* store must not be read. New code should call keySituation() instead: same precedence, never throws
|
|
45
|
-
* "must not be read" case arrives as
|
|
49
|
+
* store must not be read. New code should call keySituation() instead: same precedence, never throws for a valid
|
|
50
|
+
* backend (an invalid one throws resolveBackend's `configuration` error), and the "must not be read" case arrives as
|
|
51
|
+
* `unusable` with the reason.
|
|
46
52
|
*/
|
|
47
|
-
export declare function resolveApiKey(backend?:
|
|
53
|
+
export declare function resolveApiKey(backend?: BackendSpec): {
|
|
48
54
|
key: string;
|
|
49
55
|
source: KeySource;
|
|
50
56
|
} | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chmodSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
|
-
import { DEFAULT_BACKEND, TYPESAFE_KEY_ENV,
|
|
4
|
+
import { DEFAULT_BACKEND, TYPESAFE_KEY_ENV, resolveBackend, usesTypesafeKey } from "./backends.js";
|
|
5
5
|
import { TypeSafeIntegrationError } from "./errors.js";
|
|
6
6
|
/** Mirrors Pi's agent directory rule; every pi-typesafe file lives in this one directory. */
|
|
7
7
|
export function piTypesafeDir() {
|
|
@@ -45,14 +45,16 @@ export function readStoredApiKey() {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* What the environment, the login store, and file permissions add up to right now for one judgment backend.
|
|
49
|
-
* throws
|
|
48
|
+
* What the environment, the login store, and file permissions add up to right now for one judgment backend. A valid
|
|
49
|
+
* backend never throws: the "unusable" kind carries the user-facing reason (a stored key that other local users can
|
|
50
|
+
* read). An invalid backend — an unknown name or an endpoint object that fails validation — throws the same
|
|
51
|
+
* `configuration` error as resolveBackend(), so validate a user-supplied endpoint with resolveBackend() first.
|
|
50
52
|
* The TypeSafe backend reads `TYPESAFE_API_KEY`, then the login store. Every other backend reads only its own
|
|
51
53
|
* environment variable, because the store holds a TypeSafe key and a login verifies against api.typesafe.ai.
|
|
52
54
|
*/
|
|
53
55
|
export function keySituation(backend = DEFAULT_BACKEND) {
|
|
54
|
-
const config =
|
|
55
|
-
const keyEnv = config.keyEnv
|
|
56
|
+
const config = resolveBackend(backend);
|
|
57
|
+
const keyEnv = config.keyEnv;
|
|
56
58
|
const fromEnvironment = process.env[keyEnv]?.trim();
|
|
57
59
|
if (fromEnvironment)
|
|
58
60
|
return { kind: "environment", key: fromEnvironment, keyEnv };
|
|
@@ -82,8 +84,9 @@ export function keySourceLabel(situation) {
|
|
|
82
84
|
/**
|
|
83
85
|
* The pre-0.4.0 key interface, frozen for existing callers: environment first so CI and scripts stay explicit, the
|
|
84
86
|
* stored key as the interactive default, `undefined` when no key is configured, and a `configuration` error when a
|
|
85
|
-
* store must not be read. New code should call keySituation() instead: same precedence, never throws
|
|
86
|
-
* "must not be read" case arrives as
|
|
87
|
+
* store must not be read. New code should call keySituation() instead: same precedence, never throws for a valid
|
|
88
|
+
* backend (an invalid one throws resolveBackend's `configuration` error), and the "must not be read" case arrives as
|
|
89
|
+
* `unusable` with the reason.
|
|
87
90
|
*/
|
|
88
91
|
export function resolveApiKey(backend = DEFAULT_BACKEND) {
|
|
89
92
|
const situation = keySituation(backend);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BackendConfig,
|
|
1
|
+
import type { BackendConfig, BackendSpec } from "./backends.js";
|
|
2
2
|
export type IntegrationErrorCode = "configuration" | "validation" | "budget" | "aborted" | "timeout" | "http" | "connection" | "response";
|
|
3
3
|
/**
|
|
4
4
|
* Safe to display: never contains upstream bodies, keys, or submitted state. The only header value a message can
|
|
@@ -14,4 +14,4 @@ export declare class TypeSafeIntegrationError extends Error {
|
|
|
14
14
|
* Classify an error into a message safe to display. `backend` names the key variable the 401 advice tells the user
|
|
15
15
|
* to check and selects the 402 wording; omitting it keeps the one-argument call and assumes the default TypeSafe key.
|
|
16
16
|
*/
|
|
17
|
-
export declare function safeError(error: unknown, backend?:
|
|
17
|
+
export declare function safeError(error: unknown, backend?: BackendSpec | BackendConfig): TypeSafeIntegrationError;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createTypeSafe, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
|
|
2
|
-
export type { TypeSafe, TypeSafeOptions, EvaluationOptions, Evaluation, UsageSnapshot, SpendReport, TypeSafeBackend, BackendConfig, } from "./client.js";
|
|
1
|
+
export { createTypeSafe, backendHost, resolveBackend, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
|
|
2
|
+
export type { TypeSafe, TypeSafeOptions, EvaluationOptions, Evaluation, UsageSnapshot, SpendReport, TypeSafeBackend, BackendConfig, BackendEndpoint, BackendSpec, ResolvedBackend, } from "./client.js";
|
|
3
3
|
export { ask, DEFAULT_ASK_TIMEOUT_MS } from "./ask.js";
|
|
4
4
|
export type { AskAnswer, AskOptions, Judge } from "./ask.js";
|
|
5
5
|
export { fanOut, DEFAULT_CONCURRENCY, evaluateMany, evaluateAll, chunkEvaluationRequest } from "./batch.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createTypeSafe, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
|
|
1
|
+
export { createTypeSafe, backendHost, resolveBackend, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
|
|
2
2
|
export { ask, DEFAULT_ASK_TIMEOUT_MS } from "./ask.js";
|
|
3
3
|
export { fanOut, DEFAULT_CONCURRENCY, evaluateMany, evaluateAll, chunkEvaluationRequest } from "./batch.js";
|
|
4
4
|
export { authState, authStatePath, clearAuthState, describeAuth, recordAuthFailure, recordAuthVerified } from "./auth.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BackendSpec } from "./backends.js";
|
|
3
3
|
import type { KeySource } from "./credentials.js";
|
|
4
4
|
export interface LoginResult {
|
|
5
5
|
/** Where the verified key was saved. */
|
|
@@ -29,5 +29,5 @@ export type EnsureApiKeyResult = {
|
|
|
29
29
|
* the prompt would verify the key against the wrong service and store it where the TypeSafe key lives.
|
|
30
30
|
*/
|
|
31
31
|
export declare function ensureApiKey(ctx: ExtensionCommandContext, options?: {
|
|
32
|
-
backend?:
|
|
32
|
+
backend?: BackendSpec;
|
|
33
33
|
}): Promise<EnsureApiKeyResult | undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_BACKEND,
|
|
1
|
+
import { DEFAULT_BACKEND, resolveBackend, usesTypesafeKey } from "./backends.js";
|
|
2
2
|
import { createTypeSafe } from "./client.js";
|
|
3
3
|
import { keySituation, normalizeApiKey, storeApiKey } from "./credentials.js";
|
|
4
4
|
import { TypeSafeIntegrationError } from "./errors.js";
|
|
@@ -38,7 +38,7 @@ export async function ensureApiKey(ctx, options = {}) {
|
|
|
38
38
|
return { source: situation.kind };
|
|
39
39
|
if (situation.kind === "unusable")
|
|
40
40
|
throw new TypeSafeIntegrationError("configuration", situation.reason);
|
|
41
|
-
const config =
|
|
41
|
+
const config = resolveBackend(backend);
|
|
42
42
|
if (!usesTypesafeKey(config)) {
|
|
43
43
|
throw new TypeSafeIntegrationError("configuration", `No ${config.label} key. Set ${config.keyEnv} in the environment; /typesafe login stores a TypeSafe key only.`);
|
|
44
44
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-typesafe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "TypeSafe AI (Jev) decisions for Pi: batched Choice/Score/Noul evaluation tool, terminal playground, and a typed API other extensions build on.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"prepack": "npm run build"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@typesafe-ai/sdk": "^0.6.0"
|
|
68
|
-
"typebox": "^1.3.31"
|
|
67
|
+
"@typesafe-ai/sdk": "^0.6.0"
|
|
69
68
|
},
|
|
70
69
|
"peerDependencies": {
|
|
71
|
-
"@earendil-works/pi-coding-agent": "
|
|
72
|
-
"@earendil-works/pi-tui": "
|
|
70
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
71
|
+
"@earendil-works/pi-tui": "*",
|
|
72
|
+
"typebox": "*"
|
|
73
73
|
},
|
|
74
74
|
"peerDependenciesMeta": {
|
|
75
75
|
"@earendil-works/pi-coding-agent": {
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"p-limit": "^6.1.0",
|
|
61
61
|
"promise.try": "^2.0.1",
|
|
62
62
|
"turndown": "^7.2.0",
|
|
63
|
-
"typebox": "^1.1.38",
|
|
64
63
|
"unpdf": "^1.6.2",
|
|
65
64
|
"undici": "^8.9.0"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
67
|
"@earendil-works/pi-ai": "*",
|
|
69
68
|
"@earendil-works/pi-coding-agent": "*",
|
|
70
|
-
"@earendil-works/pi-tui": "*"
|
|
69
|
+
"@earendil-works/pi-tui": "*",
|
|
70
|
+
"typebox": "*"
|
|
71
71
|
},
|
|
72
72
|
"pi": {
|
|
73
73
|
"extensions": [
|
|
@@ -81,8 +81,12 @@
|
|
|
81
81
|
"@noble/ed25519": "^3.1.0",
|
|
82
82
|
"croner": "^10.0.1",
|
|
83
83
|
"qrcode-terminal": "^0.12.0",
|
|
84
|
-
"typebox": "^1.1.38",
|
|
85
84
|
"ws": "^8.21.0",
|
|
86
85
|
"zod": "^4.4.3"
|
|
86
|
+
},
|
|
87
|
+
"peerDependencies": {
|
|
88
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
89
|
+
"@earendil-works/pi-tui": "*",
|
|
90
|
+
"typebox": "*"
|
|
87
91
|
}
|
|
88
92
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-extensions",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.18",
|
|
4
4
|
"description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"extensions",
|
|
@@ -38,20 +38,13 @@
|
|
|
38
38
|
"@ast-grep/napi": "^0.45.0",
|
|
39
39
|
"@bufbuild/protobuf": "^2.14.0",
|
|
40
40
|
"@dietrichgebert/ponytail": "4.10.0",
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@herbertgao/
|
|
45
|
-
"@herbertgao/pi
|
|
46
|
-
"@herbertgao/pi-subagents": "0.18.3",
|
|
47
|
-
"@herbertgao/resume-from": "0.2.3",
|
|
48
|
-
"@herbertgao/sol-pi": "0.3.3",
|
|
41
|
+
"@herbertgao/pi-bark": "0.1.4",
|
|
42
|
+
"@herbertgao/pi-cc-extensions": "0.9.6",
|
|
43
|
+
"@herbertgao/pi-subagents": "0.18.4",
|
|
44
|
+
"@herbertgao/resume-from": "0.2.4",
|
|
45
|
+
"@herbertgao/sol-pi": "0.3.4",
|
|
49
46
|
"@juicesharp/rpiv-ask-user-question": "2.11.0",
|
|
50
47
|
"@juicesharp/rpiv-config": "^2.11.0",
|
|
51
|
-
"@modelcontextprotocol/client": "2.0.0",
|
|
52
|
-
"@modelcontextprotocol/core": "2.0.0",
|
|
53
|
-
"@modelcontextprotocol/ext-apps": "^1.2.2",
|
|
54
|
-
"@modelcontextprotocol/ext-tasks": "^0.1.0",
|
|
55
48
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
56
49
|
"@mozilla/readability": "^0.6.0",
|
|
57
50
|
"@napi-rs/keyring": "^2.1.0",
|
|
@@ -61,20 +54,16 @@
|
|
|
61
54
|
"@noble/ed25519": "^3.1.0",
|
|
62
55
|
"@pi-plugins/fast-mode": "0.1.12",
|
|
63
56
|
"@shikijs/cli": "^4.0.2",
|
|
64
|
-
"@sinclair/typebox": "^0.34.49",
|
|
65
57
|
"@tifan/pi-copy-response": "0.2.7",
|
|
66
|
-
"@tifan/pi-handoff": "2.2.
|
|
58
|
+
"@tifan/pi-handoff": "2.2.2",
|
|
67
59
|
"@tifan/pi-inline-skills": "1.0.6",
|
|
68
60
|
"@tifan/pi-mermaid-open": "0.2.1",
|
|
69
61
|
"@tifan/pi-preferred-thinking": "1.0.2",
|
|
70
62
|
"@tifan/pi-recap": "0.4.7",
|
|
71
63
|
"@tifan/pi-rename": "0.6.0",
|
|
72
64
|
"@typesafe-ai/sdk": "0.6.0",
|
|
73
|
-
"ajv": "^8.17.1",
|
|
74
|
-
"ajv-formats": "^3.0.1",
|
|
75
65
|
"chalk": "^6.0.0",
|
|
76
66
|
"croner": "^10.0.1",
|
|
77
|
-
"cross-spawn": "^7.0.6",
|
|
78
67
|
"dbus-native": "^0.15.2",
|
|
79
68
|
"defuddle": "0.19.3",
|
|
80
69
|
"gpt-tokenizer": "^3.4.0",
|
|
@@ -84,27 +73,21 @@
|
|
|
84
73
|
"linkedom": "^0.16.0",
|
|
85
74
|
"minimatch": "^10.2.6",
|
|
86
75
|
"nanoid": "^5.0.0",
|
|
87
|
-
"open": "^10.2.0",
|
|
88
76
|
"p-limit": "^6.1.0",
|
|
89
77
|
"pi-antigravity": "0.7.2",
|
|
90
78
|
"pi-footer": "0.5.1",
|
|
91
79
|
"pi-jev-auto-mode": "0.5.0",
|
|
92
80
|
"pi-lens": "4.3.0",
|
|
93
|
-
"pi-mcp-adapter": "2.38.0",
|
|
94
81
|
"pi-multi-account": "1.23.2",
|
|
95
82
|
"pi-next-cue": "1.0.7",
|
|
96
|
-
"pi-typesafe": "0.
|
|
83
|
+
"pi-typesafe": "0.8.0",
|
|
97
84
|
"pi-web-access": "0.31.0",
|
|
98
85
|
"pidusage": "^4.0.1",
|
|
99
86
|
"promise.try": "^2.0.1",
|
|
100
87
|
"proper-lockfile": "4.1.2",
|
|
101
88
|
"qrcode-terminal": "^0.12.0",
|
|
102
|
-
"recheck": "4.6.0-beta.3",
|
|
103
89
|
"remote-pi": "0.7.0",
|
|
104
|
-
"smol-toml": "^1.6.1",
|
|
105
|
-
"strip-json-comments": "^5.0.3",
|
|
106
90
|
"turndown": "^7.2.0",
|
|
107
|
-
"typebox": "^1.1.38",
|
|
108
91
|
"unbash": "4.0.10",
|
|
109
92
|
"undici": "^8.9.0",
|
|
110
93
|
"unpdf": "^1.6.2",
|
|
@@ -112,6 +95,14 @@
|
|
|
112
95
|
"ws": "^8.21.0",
|
|
113
96
|
"zod": "^3.25.0 || ^4.0.0"
|
|
114
97
|
},
|
|
98
|
+
"peerDependencies": {
|
|
99
|
+
"@earendil-works/pi-agent-core": "*",
|
|
100
|
+
"@earendil-works/pi-ai": "*",
|
|
101
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
102
|
+
"@earendil-works/pi-tui": "*",
|
|
103
|
+
"@sinclair/typebox": "*",
|
|
104
|
+
"typebox": "*"
|
|
105
|
+
},
|
|
115
106
|
"optionalDependencies": {
|
|
116
107
|
"web-tree-sitter": "0.25.10"
|
|
117
108
|
},
|
|
@@ -138,7 +129,6 @@
|
|
|
138
129
|
"pi-footer",
|
|
139
130
|
"pi-jev-auto-mode",
|
|
140
131
|
"pi-lens",
|
|
141
|
-
"pi-mcp-adapter",
|
|
142
132
|
"pi-multi-account",
|
|
143
133
|
"pi-next-cue",
|
|
144
134
|
"pi-typesafe",
|
|
@@ -168,7 +158,6 @@
|
|
|
168
158
|
"./node_modules/@narumitw/pi-btw/dist/index.ts",
|
|
169
159
|
"./node_modules/@narumitw/pi-caffeinate/dist/index.ts",
|
|
170
160
|
"./node_modules/@pi-plugins/fast-mode/dist/index.mjs",
|
|
171
|
-
"./node_modules/pi-mcp-adapter/index.ts",
|
|
172
161
|
"./node_modules/pi-jev-auto-mode/index.ts",
|
|
173
162
|
"./node_modules/pi-multi-account/index.ts",
|
|
174
163
|
"./node_modules/pi-next-cue/index.ts",
|
|
@@ -185,7 +174,6 @@
|
|
|
185
174
|
],
|
|
186
175
|
"skills": [
|
|
187
176
|
"./node_modules/@dietrichgebert/ponytail/skills",
|
|
188
|
-
"./node_modules/pi-mcp-adapter/skills",
|
|
189
177
|
"./node_modules/pi-lens/skills"
|
|
190
178
|
]
|
|
191
179
|
}
|