@oh-my-pi/pi-coding-agent 15.11.3 → 15.11.6
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 +107 -0
- package/dist/cli.js +692 -607
- package/dist/types/cli/usage-cli.d.ts +10 -1
- package/dist/types/commands/usage.d.ts +9 -0
- package/dist/types/config/api-key-resolver.d.ts +9 -3
- package/dist/types/config/keybindings.d.ts +1 -1
- package/dist/types/config/model-discovery.d.ts +6 -4
- package/dist/types/config/model-registry.d.ts +7 -4
- package/dist/types/config/settings-schema.d.ts +508 -155
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/mnemopi/config.d.ts +3 -1
- package/dist/types/modes/components/reset-usage-selector.d.ts +12 -0
- package/dist/types/modes/components/session-selector.d.ts +1 -1
- package/dist/types/modes/components/settings-defs.d.ts +9 -2
- package/dist/types/modes/components/settings-selector.d.ts +9 -4
- package/dist/types/modes/components/tool-execution.d.ts +26 -1
- package/dist/types/modes/components/transcript-container.d.ts +12 -0
- package/dist/types/modes/controllers/input-controller.d.ts +9 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +10 -0
- package/dist/types/modes/session-observer-registry.d.ts +2 -0
- package/dist/types/modes/theme/theme.d.ts +23 -3
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/modes/utils/context-usage.d.ts +6 -1
- package/dist/types/session/agent-session.d.ts +28 -8
- package/dist/types/session/auth-storage.d.ts +1 -1
- package/dist/types/session/codex-auto-reset.d.ts +107 -0
- package/dist/types/session/snapcompact-inline.d.ts +129 -0
- package/dist/types/slash-commands/helpers/active-oauth-account.d.ts +14 -0
- package/dist/types/slash-commands/helpers/reset-usage.d.ts +27 -0
- package/dist/types/system-prompt.d.ts +3 -1
- package/dist/types/task/render.d.ts +17 -6
- package/dist/types/tools/gh.d.ts +3 -0
- package/dist/types/tools/render-utils.d.ts +8 -16
- package/dist/types/tools/todo.d.ts +0 -11
- package/dist/types/utils/session-color.d.ts +15 -3
- package/dist/types/web/kagi.d.ts +1 -2
- package/dist/types/web/search/providers/codex.d.ts +1 -1
- package/dist/types/web/search/providers/gemini.d.ts +9 -6
- package/package.json +11 -11
- package/src/auto-thinking/classifier.ts +1 -5
- package/src/cli/usage-cli.ts +187 -16
- package/src/commands/usage.ts +8 -0
- package/src/commit/model-selection.ts +3 -6
- package/src/config/api-key-resolver.ts +10 -3
- package/src/config/keybindings.ts +1 -1
- package/src/config/model-discovery.ts +60 -46
- package/src/config/model-registry.ts +21 -8
- package/src/config/model-resolver.ts +57 -3
- package/src/config/settings-schema.ts +654 -153
- package/src/config/settings.ts +9 -0
- package/src/eval/completion-bridge.ts +1 -5
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +13 -6
- package/src/internal-urls/docs-index.generated.ts +6 -6
- package/src/internal-urls/issue-pr-protocol.ts +10 -4
- package/src/memories/index.ts +2 -10
- package/src/mnemopi/backend.ts +30 -8
- package/src/mnemopi/config.ts +6 -1
- package/src/mnemopi/state.ts +6 -0
- package/src/modes/components/extensions/inspector-panel.ts +6 -2
- package/src/modes/components/plan-review-overlay.ts +15 -17
- package/src/modes/components/plugin-settings.ts +22 -5
- package/src/modes/components/reset-usage-selector.ts +161 -0
- package/src/modes/components/session-selector.ts +8 -2
- package/src/modes/components/settings-defs.ts +19 -4
- package/src/modes/components/settings-selector.ts +510 -95
- package/src/modes/components/status-line/component.ts +3 -1
- package/src/modes/components/status-line/segments.ts +3 -1
- package/src/modes/components/tool-execution.ts +87 -12
- package/src/modes/components/transcript-container.ts +49 -1
- package/src/modes/components/tree-selector.ts +16 -6
- package/src/modes/controllers/command-controller.ts +61 -8
- package/src/modes/controllers/event-controller.ts +1 -0
- package/src/modes/controllers/input-controller.ts +68 -6
- package/src/modes/controllers/selector-controller.ts +149 -61
- package/src/modes/interactive-mode.ts +63 -2
- package/src/modes/rpc/rpc-mode.ts +2 -1
- package/src/modes/session-observer-registry.ts +61 -3
- package/src/modes/shared.ts +2 -0
- package/src/modes/theme/theme.ts +102 -9
- package/src/modes/types.ts +2 -0
- package/src/modes/utils/context-usage.ts +78 -2
- package/src/modes/utils/hotkeys-markdown.ts +1 -1
- package/src/modes/utils/ui-helpers.ts +9 -5
- package/src/prompts/system/personalities/default.md +26 -0
- package/src/prompts/system/personalities/friendly.md +17 -0
- package/src/prompts/system/personalities/pragmatic.md +15 -0
- package/src/prompts/system/snapcompact-context-frames-note.md +1 -0
- package/src/prompts/system/snapcompact-context-stub.md +1 -0
- package/src/prompts/system/snapcompact-system-frames-note.md +1 -0
- package/src/prompts/system/snapcompact-system-stub.md +1 -0
- package/src/prompts/system/snapcompact-toolresult-note.md +1 -0
- package/src/prompts/system/system-prompt.md +5 -22
- package/src/prompts/tools/browser.md +33 -43
- package/src/prompts/tools/eval.md +27 -50
- package/src/prompts/tools/irc.md +29 -31
- package/src/prompts/tools/read.md +31 -37
- package/src/prompts/tools/task.md +3 -3
- package/src/prompts/tools/todo.md +1 -2
- package/src/sdk.ts +23 -1
- package/src/session/agent-session.ts +221 -29
- package/src/session/auth-storage.ts +4 -0
- package/src/session/codex-auto-reset.ts +190 -0
- package/src/session/session-dump-format.ts +8 -1
- package/src/session/session-manager.ts +5 -5
- package/src/session/snapcompact-inline.ts +524 -0
- package/src/slash-commands/builtin-registry.ts +145 -8
- package/src/slash-commands/helpers/active-oauth-account.ts +44 -0
- package/src/slash-commands/helpers/context-report.ts +28 -1
- package/src/slash-commands/helpers/reset-usage.ts +66 -0
- package/src/slash-commands/helpers/usage-report.ts +36 -3
- package/src/system-prompt.ts +15 -1
- package/src/task/index.ts +30 -7
- package/src/task/render.ts +57 -32
- package/src/tool-discovery/tool-index.ts +2 -0
- package/src/tools/bash.ts +10 -3
- package/src/tools/eval-render.ts +13 -8
- package/src/tools/gh.ts +39 -1
- package/src/tools/image-gen.ts +114 -78
- package/src/tools/inspect-image.ts +1 -5
- package/src/tools/job.ts +25 -5
- package/src/tools/read.ts +1 -57
- package/src/tools/render-utils.ts +29 -31
- package/src/tools/ssh.ts +3 -3
- package/src/tools/todo.ts +8 -128
- package/src/tools/tts.ts +40 -20
- package/src/utils/clipboard.ts +56 -4
- package/src/utils/commit-message-generator.ts +1 -5
- package/src/utils/session-color.ts +83 -9
- package/src/utils/title-generator.ts +1 -1
- package/src/web/kagi.ts +26 -27
- package/src/web/search/providers/codex.ts +42 -40
- package/src/web/search/providers/gemini.ts +42 -22
- package/src/web/search/providers/perplexity.ts +22 -10
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
* credentials produced no usage report are listed too, so the output
|
|
8
8
|
* always covers the full credential pool.
|
|
9
9
|
*/
|
|
10
|
-
import type
|
|
10
|
+
import { type UsageHistoryEntry, type UsageReport } from "@oh-my-pi/pi-ai";
|
|
11
11
|
export interface UsageCommandArgs {
|
|
12
12
|
json?: boolean;
|
|
13
13
|
provider?: string;
|
|
14
14
|
redact?: boolean;
|
|
15
|
+
/** Show recorded usage-limit history instead of a live snapshot. */
|
|
16
|
+
history?: boolean;
|
|
17
|
+
/** History window in days (with `history`). */
|
|
18
|
+
days?: number;
|
|
15
19
|
}
|
|
16
20
|
/** Identity slice of a stored credential, for "every account" coverage. */
|
|
17
21
|
export interface UsageAccountIdentity {
|
|
@@ -69,4 +73,9 @@ export declare function computeProviderWindowStats(reports: UsageReport[]): Prov
|
|
|
69
73
|
* each provider section as "no usage data" rows.
|
|
70
74
|
*/
|
|
71
75
|
export declare function formatUsageBreakdown(reports: UsageReport[], accounts: UsageAccountIdentity[], nowMs: number, redaction?: Map<string, string>): string;
|
|
76
|
+
/**
|
|
77
|
+
* Render recorded usage-limit history: per provider, per account, one
|
|
78
|
+
* peak-per-bucket sparkline per limit window plus latest/peak percentages.
|
|
79
|
+
*/
|
|
80
|
+
export declare function formatUsageHistory(entries: UsageHistoryEntry[], sinceMs: number, nowMs: number, redaction?: Map<string, string>): string;
|
|
72
81
|
export declare function runUsageCommand(cmd: UsageCommandArgs): Promise<void>;
|
|
@@ -19,6 +19,15 @@ export default class Usage extends Command {
|
|
|
19
19
|
description: string;
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
|
+
history: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
|
|
23
|
+
description: string;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
days: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"integer"> & {
|
|
27
|
+
char: string;
|
|
28
|
+
description: string;
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
22
31
|
};
|
|
23
32
|
static examples: string[];
|
|
24
33
|
run(): Promise<void>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ApiKeyResolver, AuthStorage } from "@oh-my-pi/pi-ai";
|
|
1
|
+
import type { Api, ApiKeyResolver, AuthStorage, Model } from "@oh-my-pi/pi-ai";
|
|
2
|
+
/** Model slice accepted by the model-form `resolver(model, sessionId)` overload. */
|
|
3
|
+
export type ApiKeyResolverModel = Pick<Model<Api>, "provider" | "baseUrl" | "id">;
|
|
2
4
|
export interface ApiKeyResolverOptions {
|
|
3
5
|
/** Session id for credential stickiness; read at resolve time by the caller. */
|
|
4
6
|
sessionId?: string;
|
|
@@ -25,10 +27,14 @@ export interface ApiKeyResolverRegistry {
|
|
|
25
27
|
* policy: initial → resolve; step (b) → force-refresh same account; step (c)
|
|
26
28
|
* → rotate to a sibling credential, then re-resolve.
|
|
27
29
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
+
* Two call forms: `resolver(provider, options?)` for provider-scoped keys,
|
|
31
|
+
* and `resolver(model, sessionId?)` which derives `baseUrl`/`modelId` from
|
|
32
|
+
* the model. The resolver is stateless (safe to reuse across requests).
|
|
33
|
+
* Callers that need the initial key for a guard can call
|
|
34
|
+
* `resolveApiKeyOnce(resolver)`.
|
|
30
35
|
*/
|
|
31
36
|
resolver(provider: string, options?: ApiKeyResolverOptions): ApiKeyResolver;
|
|
37
|
+
resolver(model: ApiKeyResolverModel, sessionId?: string): ApiKeyResolver;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Default implementation of {@link ApiKeyResolverRegistry.resolver}.
|
|
@@ -239,7 +239,7 @@ export declare const KEYBINDINGS: {
|
|
|
239
239
|
};
|
|
240
240
|
readonly "app.clipboard.pasteImage": {
|
|
241
241
|
readonly defaultKeys: KeyId[];
|
|
242
|
-
readonly description: "Paste image from clipboard";
|
|
242
|
+
readonly description: "Paste image or text from clipboard";
|
|
243
243
|
};
|
|
244
244
|
readonly "app.clipboard.pasteTextRaw": {
|
|
245
245
|
readonly defaultKeys: ["ctrl+shift+v", "alt+shift+v"];
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `discoverModelsByProviderType` with a `DiscoveryContext`; built-in provider
|
|
6
6
|
* discovery lives in pi-catalog's provider-models.
|
|
7
7
|
*/
|
|
8
|
-
import type
|
|
8
|
+
import { type ApiKey, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
9
9
|
import type { Api, Model } from "@oh-my-pi/pi-ai/types";
|
|
10
10
|
import type { ModelSpec } from "@oh-my-pi/pi-catalog/types";
|
|
11
11
|
import type { ProviderDiscovery } from "./models-config-schema";
|
|
@@ -28,10 +28,12 @@ export interface DiscoveryContext {
|
|
|
28
28
|
/** Injected fetch implementation (tests stub this). */
|
|
29
29
|
fetch: FetchImpl;
|
|
30
30
|
/**
|
|
31
|
-
* Resolve a provider's
|
|
32
|
-
* undefined when no key is stored or it is a local/no-auth
|
|
31
|
+
* Resolve a provider's bearer credential for `Authorization: Bearer …`.
|
|
32
|
+
* Returns undefined when no key is stored or it is a local/no-auth
|
|
33
|
+
* sentinel; otherwise an {@link ApiKey} whose resolver participates in the
|
|
34
|
+
* central force-refresh/rotate auth-retry policy on 401/usage-limit.
|
|
33
35
|
*/
|
|
34
|
-
|
|
36
|
+
getBearerApiKeyResolver(provider: string): Promise<ApiKey | undefined>;
|
|
35
37
|
}
|
|
36
38
|
export declare function discoverModelsByProviderType(providerConfig: DiscoveryProviderConfig, ctx: DiscoveryContext): Promise<Model<Api>[]>;
|
|
37
39
|
export declare function discoverOllamaModels(providerConfig: DiscoveryProviderConfig, ctx: DiscoveryContext): Promise<Model<Api>[]>;
|
|
@@ -5,7 +5,7 @@ import type { ApiKeyResolver, FetchImpl } from "@oh-my-pi/pi-ai";
|
|
|
5
5
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/oauth/types";
|
|
6
6
|
import { type CanonicalModelIndex, type CanonicalModelRecord, type CanonicalModelVariant, type ModelEquivalenceConfig } from "@oh-my-pi/pi-catalog/identity";
|
|
7
7
|
import type { AuthStorage } from "../session/auth-storage";
|
|
8
|
-
import { type ApiKeyResolverOptions } from "./api-key-resolver";
|
|
8
|
+
import { type ApiKeyResolverModel, type ApiKeyResolverOptions } from "./api-key-resolver";
|
|
9
9
|
import type { ConfigError } from "./config-file";
|
|
10
10
|
export type { CanonicalModelIndex, CanonicalModelRecord, CanonicalModelVariant, ModelEquivalenceConfig };
|
|
11
11
|
export declare const kNoAuth = "N/A";
|
|
@@ -153,11 +153,14 @@ export declare class ModelRegistry {
|
|
|
153
153
|
signal?: AbortSignal;
|
|
154
154
|
}): Promise<string | undefined>;
|
|
155
155
|
/**
|
|
156
|
-
* Build an {@link ApiKeyResolver}
|
|
157
|
-
*
|
|
158
|
-
*
|
|
156
|
+
* Build an {@link ApiKeyResolver} implementing the central a/b/c auth-retry
|
|
157
|
+
* policy. Accepts a provider id with options, or a model with an optional
|
|
158
|
+
* session id (`resolver(model, sessionId)`) which derives `baseUrl`/`modelId`
|
|
159
|
+
* from the model. Callers that need the initial key for a guard can call
|
|
160
|
+
* `resolveApiKeyOnce(resolver)`.
|
|
159
161
|
*/
|
|
160
162
|
resolver(provider: string, options?: ApiKeyResolverOptions): ApiKeyResolver;
|
|
163
|
+
resolver(model: ApiKeyResolverModel, sessionId?: string): ApiKeyResolver;
|
|
161
164
|
/**
|
|
162
165
|
* Check if a model is using OAuth credentials (subscription).
|
|
163
166
|
*/
|