my-pi 0.1.24 → 0.1.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/README.md +29 -1
- package/dist/api.d.ts +53 -0
- package/dist/api.js +2172 -2
- package/dist/api.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +99 -22
- package/dist/index.js.map +1 -1
- package/package.json +25 -18
- package/dist/api-CJN_JYzx.js +0 -2087
- package/dist/api-CJN_JYzx.js.map +0 -1
- package/src/extensions/hooks-resolution/env.test.ts +0 -41
- package/src/extensions/hooks-resolution/env.ts +0 -12
- package/src/extensions/hooks-resolution/index.test.ts +0 -380
- package/src/extensions/hooks-resolution/index.ts +0 -691
- package/src/extensions/hooks-resolution/trust.test.ts +0 -46
- package/src/extensions/hooks-resolution/trust.ts +0 -61
- package/src/extensions/manager/config.test.ts +0 -108
- package/src/extensions/manager/config.ts +0 -253
- package/src/extensions/manager/index.test.ts +0 -114
- package/src/extensions/manager/index.ts +0 -315
- package/src/extensions/prompt-presets/index.test.ts +0 -306
- package/src/extensions/prompt-presets/index.ts +0 -1797
- package/src/extensions/session-name/index.ts +0 -234
package/README.md
CHANGED
|
@@ -59,9 +59,17 @@ priority order):
|
|
|
59
59
|
1. **`pi auth`** — interactive login, stores credentials in
|
|
60
60
|
`~/.pi/agent/auth.json`
|
|
61
61
|
2. **Environment variables** — `ANTHROPIC_API_KEY`, `MISTRAL_API_KEY`,
|
|
62
|
-
`CLOUDFLARE_API_KEY` + `CLOUDFLARE_ACCOUNT_ID`,
|
|
62
|
+
`XIAOMI_API_KEY`, `CLOUDFLARE_API_KEY` + `CLOUDFLARE_ACCOUNT_ID`,
|
|
63
|
+
etc.
|
|
63
64
|
3. **OAuth** — supported for providers that offer it
|
|
64
65
|
|
|
66
|
+
Xiaomi MiMo Token Plan is available through Pi's built-in `xiaomi`
|
|
67
|
+
provider:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
XIAOMI_API_KEY=... pnpx my-pi@latest -m xiaomi/mimo-v2.5-pro "summarize this repo"
|
|
71
|
+
```
|
|
72
|
+
|
|
65
73
|
Cloudflare Workers AI model IDs contain slashes. Pass the provider and
|
|
66
74
|
model together when needed:
|
|
67
75
|
|
|
@@ -227,6 +235,21 @@ The agent directory holds Pi-managed state such as:
|
|
|
227
235
|
- `sessions/`
|
|
228
236
|
- `telemetry.db`
|
|
229
237
|
- `telemetry.json`
|
|
238
|
+
- `mcp.json`, MCP backups, and MCP profiles
|
|
239
|
+
- project trust stores for MCP, hooks, LSP binaries, and project
|
|
240
|
+
resources
|
|
241
|
+
- imported Pi-native skills under `skills/`
|
|
242
|
+
|
|
243
|
+
Intentional exceptions: my-pi still reads user-local Claude
|
|
244
|
+
skill/plugin sources from `~/.claude` when the skills extension is
|
|
245
|
+
enabled. Those are upstream sources for discovery/import, not
|
|
246
|
+
Pi-managed state. Use `--no-skills` or `--untrusted` for hermetic
|
|
247
|
+
sandbox runs.
|
|
248
|
+
|
|
249
|
+
During runtime startup my-pi temporarily exposes the effective agent
|
|
250
|
+
directory through `PI_CODING_AGENT_DIR` for built-in extension
|
|
251
|
+
compatibility. SDK-created runtimes restore values they changed when
|
|
252
|
+
`runtime.dispose()` completes.
|
|
230
253
|
|
|
231
254
|
A practical sandbox command looks like:
|
|
232
255
|
|
|
@@ -449,6 +472,7 @@ In interactive mode:
|
|
|
449
472
|
- `/lsp status|list|restart` — inspect or restart language server
|
|
450
473
|
state
|
|
451
474
|
- `/redact-stats` — show how many secrets were redacted this session
|
|
475
|
+
- `/context-stats` — show context sidecar byte accounting
|
|
452
476
|
- `/telemetry status|stats|query|export|on|off|path` — inspect, query,
|
|
453
477
|
export, or toggle local SQLite telemetry
|
|
454
478
|
|
|
@@ -598,6 +622,7 @@ published only as dependencies and are not Pi packages to install via
|
|
|
598
622
|
```bash
|
|
599
623
|
pi install npm:@spences10/pi-redact
|
|
600
624
|
pi install npm:@spences10/pi-telemetry
|
|
625
|
+
pi install npm:@spences10/pi-context
|
|
601
626
|
pi install npm:@spences10/pi-mcp
|
|
602
627
|
pi install npm:@spences10/pi-lsp
|
|
603
628
|
pi install npm:@spences10/pi-confirm-destructive
|
|
@@ -614,6 +639,8 @@ pi install npm:@spences10/pi-themes
|
|
|
614
639
|
redaction and `/redact-stats`
|
|
615
640
|
- [`@spences10/pi-telemetry`](./packages/pi-telemetry/README.md) —
|
|
616
641
|
local SQLite telemetry and `/telemetry`
|
|
642
|
+
- [`@spences10/pi-context`](./packages/pi-context/README.md) — local
|
|
643
|
+
SQLite FTS sidecar for oversized tool output
|
|
617
644
|
- [`@spences10/pi-mcp`](./packages/pi-mcp/README.md) — MCP server
|
|
618
645
|
integration and `/mcp`
|
|
619
646
|
- [`@spences10/pi-lsp`](./packages/pi-lsp/README.md) — LSP-backed
|
|
@@ -653,6 +680,7 @@ src/
|
|
|
653
680
|
packages/
|
|
654
681
|
pi-redact/ Installable Pi package for output redaction
|
|
655
682
|
pi-telemetry/ Installable Pi package for SQLite telemetry
|
|
683
|
+
pi-context/ Installable Pi package for context sidecar
|
|
656
684
|
pi-mcp/ Installable Pi package for MCP integration
|
|
657
685
|
pi-lsp/ Installable Pi package for LSP tools
|
|
658
686
|
pi-confirm-destructive/ Installable Pi package for destructive action confirmations
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Api, Model } from "@mariozechner/pi-ai";
|
|
2
|
+
import * as _$_mariozechner_pi_coding_agent0 from "@mariozechner/pi-coding-agent";
|
|
3
|
+
import { AgentSessionRuntime, CreateAgentSessionFromServicesOptions, ExtensionFactory, ExtensionFactory as ExtensionFactory$1, InteractiveMode, InteractiveModeOptions, PrintModeOptions, runPrintMode, runRpcMode } from "@mariozechner/pi-coding-agent";
|
|
4
|
+
|
|
5
|
+
//#region src/extensions/manager/config.d.ts
|
|
6
|
+
type BuiltinExtensionKey = 'context-sidecar' | 'mcp' | 'skills' | 'filter-output' | 'recall' | 'nopeek' | 'omnisearch' | 'sqlite-tools' | 'prompt-presets' | 'lsp' | 'session-name' | 'confirm-destructive' | 'hooks-resolution' | 'team-mode';
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/api.d.ts
|
|
9
|
+
type MyPiRuntimeMode = 'interactive' | 'print' | 'json' | 'rpc';
|
|
10
|
+
type MyPiThinkingLevel = NonNullable<CreateAgentSessionFromServicesOptions['thinkingLevel']>;
|
|
11
|
+
interface CreateMyPiOptions {
|
|
12
|
+
cwd?: string;
|
|
13
|
+
agent_dir?: string;
|
|
14
|
+
extensions?: string[];
|
|
15
|
+
extensionFactories?: ExtensionFactory$1[];
|
|
16
|
+
runtime_mode?: MyPiRuntimeMode;
|
|
17
|
+
context_sidecar?: boolean;
|
|
18
|
+
mcp?: boolean;
|
|
19
|
+
skills?: boolean;
|
|
20
|
+
filter_output?: boolean;
|
|
21
|
+
recall?: boolean;
|
|
22
|
+
nopeek?: boolean;
|
|
23
|
+
omnisearch?: boolean;
|
|
24
|
+
sqlite_tools?: boolean;
|
|
25
|
+
prompt_presets?: boolean;
|
|
26
|
+
lsp?: boolean;
|
|
27
|
+
session_name?: boolean;
|
|
28
|
+
confirm_destructive?: boolean;
|
|
29
|
+
hooks_resolution?: boolean;
|
|
30
|
+
team_mode?: boolean;
|
|
31
|
+
telemetry?: boolean;
|
|
32
|
+
telemetry_db_path?: string;
|
|
33
|
+
model?: string;
|
|
34
|
+
thinking?: MyPiThinkingLevel;
|
|
35
|
+
selected_tools?: string[];
|
|
36
|
+
selected_skills?: string[];
|
|
37
|
+
session_dir?: string;
|
|
38
|
+
system_prompt?: string;
|
|
39
|
+
append_system_prompt?: string;
|
|
40
|
+
untrusted_repo?: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare function apply_untrusted_repo_defaults(env?: NodeJS.ProcessEnv): string[];
|
|
43
|
+
declare function is_project_local_skill_path(cwd: string, file_path: string | undefined): boolean;
|
|
44
|
+
interface ModelRegistryLike {
|
|
45
|
+
getAll(): Model<Api>[];
|
|
46
|
+
}
|
|
47
|
+
declare function resolve_model_reference(model_reference: string | undefined, model_registry: ModelRegistryLike): Model<Api> | undefined;
|
|
48
|
+
declare function resolve_effective_thinking_level(model: Model<Api> | undefined, thinking: MyPiThinkingLevel | undefined): MyPiThinkingLevel | undefined;
|
|
49
|
+
declare function get_force_disabled_builtins(options: Pick<CreateMyPiOptions, 'runtime_mode' | 'context_sidecar' | 'mcp' | 'skills' | 'filter_output' | 'recall' | 'nopeek' | 'omnisearch' | 'sqlite_tools' | 'prompt_presets' | 'lsp' | 'session_name' | 'confirm_destructive' | 'hooks_resolution' | 'team_mode'>): ReadonlySet<BuiltinExtensionKey>;
|
|
50
|
+
declare function create_my_pi(options?: CreateMyPiOptions): Promise<_$_mariozechner_pi_coding_agent0.AgentSessionRuntime>;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { type AgentSessionRuntime, CreateMyPiOptions, type ExtensionFactory, InteractiveMode, type InteractiveModeOptions, MyPiRuntimeMode, MyPiThinkingLevel, type PrintModeOptions, apply_untrusted_repo_defaults, create_my_pi, get_force_disabled_builtins, is_project_local_skill_path, resolve_effective_thinking_level, resolve_model_reference, runPrintMode, runRpcMode };
|
|
53
|
+
//# sourceMappingURL=api.d.ts.map
|