@oh-my-pi/pi-coding-agent 15.7.6 → 15.8.2
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 +172 -198
- package/dist/types/async/job-manager.d.ts +3 -3
- package/dist/types/cli/args.d.ts +1 -0
- package/dist/types/cli/claude-trace-cli.d.ts +54 -0
- package/dist/types/cli/session-picker.d.ts +10 -3
- package/dist/types/cli/update-cli.d.ts +17 -0
- package/dist/types/commands/launch.d.ts +3 -0
- package/dist/types/config/keybindings.d.ts +10 -1
- package/dist/types/config/settings-schema.d.ts +2 -2
- package/dist/types/config/settings.d.ts +13 -0
- package/dist/types/edit/index.d.ts +6 -0
- package/dist/types/edit/streaming.d.ts +8 -0
- package/dist/types/eval/concurrency-bridge.d.ts +26 -0
- package/dist/types/eval/js/tool-bridge.d.ts +2 -1
- package/dist/types/export/ttsr.d.ts +9 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +11 -0
- package/dist/types/main.d.ts +5 -0
- package/dist/types/mcp/transports/stdio.d.ts +19 -0
- package/dist/types/modes/components/custom-editor.d.ts +3 -1
- package/dist/types/modes/components/hook-selector.d.ts +3 -0
- package/dist/types/modes/components/session-selector.d.ts +32 -5
- package/dist/types/modes/components/tool-execution.d.ts +8 -0
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +2 -2
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +9 -2
- package/dist/types/modes/types.d.ts +4 -2
- package/dist/types/registry/agent-registry.d.ts +1 -1
- package/dist/types/sdk.d.ts +2 -2
- package/dist/types/session/agent-session.d.ts +4 -2
- package/dist/types/session/history-storage.d.ts +16 -1
- package/dist/types/session/session-manager.d.ts +4 -0
- package/dist/types/task/output-manager.d.ts +6 -15
- package/dist/types/tools/find.d.ts +0 -9
- package/dist/types/tools/index.d.ts +1 -1
- package/dist/types/tools/path-utils.d.ts +16 -0
- package/dist/types/tools/sqlite-reader.d.ts +25 -8
- package/dist/types/tools/write.d.ts +2 -0
- package/dist/types/utils/clipboard.d.ts +4 -0
- package/dist/types/utils/jj.d.ts +49 -0
- package/dist/types/web/kagi.d.ts +76 -0
- package/dist/types/web/search/providers/exa.d.ts +7 -1
- package/dist/types/web/search/providers/kagi.d.ts +1 -0
- package/package.json +9 -9
- package/src/async/job-manager.ts +3 -3
- package/src/cli/args.ts +6 -2
- package/src/cli/claude-trace-cli.ts +783 -0
- package/src/cli/session-picker.ts +36 -10
- package/src/cli/update-cli.ts +35 -2
- package/src/commands/launch.ts +3 -0
- package/src/config/keybindings.ts +14 -1
- package/src/config/model-registry.ts +18 -7
- package/src/config/settings-schema.ts +2 -2
- package/src/config/settings.ts +23 -0
- package/src/discovery/builtin-rules/index.ts +2 -0
- package/src/discovery/builtin-rules/ts-no-deprecated-leftovers.md +44 -0
- package/src/discovery/claude-plugins.ts +7 -9
- package/src/edit/index.ts +10 -0
- package/src/edit/streaming.ts +65 -0
- package/src/eval/__tests__/agent-bridge.test.ts +58 -4
- package/src/eval/concurrency-bridge.ts +34 -0
- package/src/eval/js/shared/prelude.txt +20 -17
- package/src/eval/js/tool-bridge.ts +5 -0
- package/src/eval/py/prelude.py +23 -15
- package/src/export/ttsr.ts +18 -1
- package/src/extensibility/custom-commands/bundled/review/index.ts +74 -45
- package/src/extensibility/plugins/legacy-pi-compat.ts +115 -131
- package/src/extensibility/skills.ts +0 -1
- package/src/internal-urls/docs-index.generated.ts +12 -11
- package/src/main.ts +92 -24
- package/src/mcp/transports/stdio.ts +55 -22
- package/src/modes/acp/acp-event-mapper.ts +54 -4
- package/src/modes/components/custom-editor.ts +10 -0
- package/src/modes/components/hook-selector.ts +89 -31
- package/src/modes/components/oauth-selector.ts +12 -6
- package/src/modes/components/session-selector.ts +179 -24
- package/src/modes/components/tool-execution.ts +16 -3
- package/src/modes/controllers/command-controller.ts +2 -11
- package/src/modes/controllers/extension-ui-controller.ts +3 -2
- package/src/modes/controllers/input-controller.ts +19 -1
- package/src/modes/controllers/selector-controller.ts +61 -21
- package/src/modes/interactive-mode.ts +125 -15
- package/src/modes/types.ts +5 -2
- package/src/prompts/agents/reviewer.md +2 -2
- package/src/prompts/review-request.md +1 -1
- package/src/prompts/system/empty-stop-retry.md +6 -0
- package/src/prompts/system/orchestrate-notice.md +5 -3
- package/src/prompts/system/workflow-notice.md +2 -2
- package/src/prompts/tools/eval.md +5 -5
- package/src/prompts/tools/find.md +1 -1
- package/src/prompts/tools/irc.md +6 -6
- package/src/prompts/tools/search-tool-bm25.md +9 -2
- package/src/prompts/tools/search.md +1 -1
- package/src/prompts/tools/task.md +1 -1
- package/src/registry/agent-registry.ts +1 -1
- package/src/sdk.ts +85 -31
- package/src/session/agent-session.ts +209 -54
- package/src/session/history-storage.ts +56 -12
- package/src/session/session-manager.ts +34 -0
- package/src/task/output-manager.ts +40 -48
- package/src/task/render.ts +3 -8
- package/src/tools/browser/tab-worker.ts +8 -5
- package/src/tools/find.ts +5 -29
- package/src/tools/index.ts +1 -1
- package/src/tools/path-utils.ts +144 -1
- package/src/tools/read.ts +47 -0
- package/src/tools/search-tool-bm25.ts +7 -1
- package/src/tools/search.ts +2 -27
- package/src/tools/sqlite-reader.ts +92 -9
- package/src/tools/write.ts +6 -0
- package/src/utils/clipboard.ts +38 -1
- package/src/utils/git.ts +19 -23
- package/src/utils/jj.ts +225 -0
- package/src/utils/open.ts +37 -2
- package/src/web/kagi.ts +168 -49
- package/src/web/search/providers/anthropic.ts +1 -1
- package/src/web/search/providers/exa.ts +20 -86
- package/src/web/search/providers/kagi.ts +4 -0
|
@@ -3,6 +3,8 @@ export interface HistoryEntry {
|
|
|
3
3
|
prompt: string;
|
|
4
4
|
created_at: number;
|
|
5
5
|
cwd?: string;
|
|
6
|
+
/** ID of the session the prompt was submitted from, if known. */
|
|
7
|
+
sessionId?: string;
|
|
6
8
|
}
|
|
7
9
|
export declare class HistoryStorage {
|
|
8
10
|
#private;
|
|
@@ -10,7 +12,20 @@ export declare class HistoryStorage {
|
|
|
10
12
|
static open(dbPath?: string): HistoryStorage;
|
|
11
13
|
/** @internal Reset the singleton — test-only. */
|
|
12
14
|
static resetInstance(): void;
|
|
13
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Register a resolver that supplies the current session ID for prompts added
|
|
17
|
+
* without an explicit `sessionId`. Evaluated synchronously at `add()` time so
|
|
18
|
+
* batched writes capture the session active when the prompt was submitted.
|
|
19
|
+
*/
|
|
20
|
+
setSessionResolver(resolver: () => string | undefined): void;
|
|
21
|
+
add(prompt: string, cwd?: string, sessionId?: string): Promise<void>;
|
|
14
22
|
getRecent(limit: number): HistoryEntry[];
|
|
15
23
|
search(query: string, limit: number): HistoryEntry[];
|
|
24
|
+
/**
|
|
25
|
+
* IDs of the sessions whose stored prompts match `query`, ordered by match
|
|
26
|
+
* relevance (most relevant/recent first) and de-duplicated. Prompts with no
|
|
27
|
+
* recorded session are skipped. Used to augment session ranking in the
|
|
28
|
+
* resume picker with prompts that the 4KB session-list prefix never sees.
|
|
29
|
+
*/
|
|
30
|
+
matchingSessionIds(query: string, limit?: number): string[];
|
|
16
31
|
}
|
|
@@ -169,6 +169,8 @@ export interface SessionContext {
|
|
|
169
169
|
/** Mode-specific data from the last mode_change entry */
|
|
170
170
|
modeData?: Record<string, unknown>;
|
|
171
171
|
}
|
|
172
|
+
/** Lists session model strings to try when restoring, in fallback order. */
|
|
173
|
+
export declare function getRestorableSessionModels(models: Readonly<Record<string, string>>, lastModelChangeRole: string | undefined): string[];
|
|
172
174
|
export interface SessionInfo {
|
|
173
175
|
path: string;
|
|
174
176
|
id: string;
|
|
@@ -253,6 +255,8 @@ export interface ResolvedSessionMatch {
|
|
|
253
255
|
}
|
|
254
256
|
export declare function resolveResumableSession(sessionArg: string, cwd: string, sessionDir?: string, storage?: SessionStorage): Promise<ResolvedSessionMatch | undefined>;
|
|
255
257
|
interface SessionManagerStateSnapshot {
|
|
258
|
+
cwd: string;
|
|
259
|
+
sessionDir: string;
|
|
256
260
|
sessionId: string;
|
|
257
261
|
sessionName: string | undefined;
|
|
258
262
|
titleSource: "auto" | "user" | undefined;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Manages agent output ID allocation to ensure uniqueness.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* On resume, scans existing files to find the next available index.
|
|
4
|
+
* The first allocation of a given name keeps the name as-is; subsequent
|
|
5
|
+
* allocations of the same name get a `-2`, `-3`, … suffix. On resume, scans
|
|
6
|
+
* existing output files so previously written outputs are never overwritten.
|
|
8
7
|
*/
|
|
9
8
|
export declare class AgentOutputManager {
|
|
10
9
|
#private;
|
|
@@ -12,10 +11,10 @@ export declare class AgentOutputManager {
|
|
|
12
11
|
parentPrefix?: string;
|
|
13
12
|
});
|
|
14
13
|
/**
|
|
15
|
-
* Allocate a unique ID
|
|
14
|
+
* Allocate a unique ID.
|
|
16
15
|
*
|
|
17
|
-
* @param id Requested ID (e.g., "
|
|
18
|
-
* @returns Unique ID
|
|
16
|
+
* @param id Requested ID (e.g., "Anna")
|
|
17
|
+
* @returns Unique ID ("Anna" first, then "Anna-2", "Anna-3", …)
|
|
19
18
|
*/
|
|
20
19
|
allocate(id: string): Promise<string>;
|
|
21
20
|
/**
|
|
@@ -25,12 +24,4 @@ export declare class AgentOutputManager {
|
|
|
25
24
|
* @returns Array of unique IDs in same order
|
|
26
25
|
*/
|
|
27
26
|
allocateBatch(ids: string[]): Promise<string[]>;
|
|
28
|
-
/**
|
|
29
|
-
* Get the next ID that would be allocated (without allocating).
|
|
30
|
-
*/
|
|
31
|
-
peekNextIndex(): Promise<number>;
|
|
32
|
-
/**
|
|
33
|
-
* Reset state (primarily for testing).
|
|
34
|
-
*/
|
|
35
|
-
reset(): void;
|
|
36
27
|
}
|
|
@@ -14,15 +14,6 @@ declare const findSchema: z.ZodObject<{
|
|
|
14
14
|
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
15
15
|
}, z.core.$strict>;
|
|
16
16
|
export type FindToolInput = z.infer<typeof findSchema>;
|
|
17
|
-
/**
|
|
18
|
-
* Reject comma-separated path lists packed into a single array element
|
|
19
|
-
* (`["a.py,b.py"]`). The schema is array-of-string; agents that pass a
|
|
20
|
-
* single comma-joined element get silent no-matches otherwise.
|
|
21
|
-
*
|
|
22
|
-
* Commas inside brace expansion (`{a,b}`) are legitimate glob syntax and
|
|
23
|
-
* must pass through.
|
|
24
|
-
*/
|
|
25
|
-
export declare function validateFindPathInputs(paths: readonly string[]): void;
|
|
26
17
|
/**
|
|
27
18
|
* Group find matches by their directory so the model doesn't pay repeated
|
|
28
19
|
* tokens for shared path prefixes. Preserves the input order: groups appear in
|
|
@@ -112,7 +112,7 @@ export interface ToolSession {
|
|
|
112
112
|
getHindsightSessionState?: () => HindsightSessionState | undefined;
|
|
113
113
|
/** Get Mnemopi runtime state for this agent session. */
|
|
114
114
|
getMnemopiSessionState?: () => MnemopiSessionState | undefined;
|
|
115
|
-
/** Agent identity used for IRC routing. Returns the registry id (e.g. "
|
|
115
|
+
/** Agent identity used for IRC routing. Returns the registry id (e.g. "Main", "AuthLoader"). */
|
|
116
116
|
getAgentId?: () => string | null;
|
|
117
117
|
/** Look up a registered tool by name (used by the eval js backend's tool bridge). */
|
|
118
118
|
getToolByName?: (name: string) => AgentTool | undefined;
|
|
@@ -69,6 +69,21 @@ export declare function formatPathRelativeToCwd(filePath: string, cwd: string, o
|
|
|
69
69
|
export declare function stripOuterDoubleQuotes(input: string): string;
|
|
70
70
|
export declare function normalizePathLikeInput(input: string): string;
|
|
71
71
|
export declare function hasGlobPathChars(filePath: string): boolean;
|
|
72
|
+
type PathEntrySplitter = (item: string) => {
|
|
73
|
+
basePath: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Split one path-like entry whose multiple targets were flattened into one
|
|
77
|
+
* string. Existing paths are kept intact, so real filenames containing spaces,
|
|
78
|
+
* commas, or semicolons win over delimiter recovery.
|
|
79
|
+
*/
|
|
80
|
+
export declare function splitDelimitedPathEntry(entry: string, cwd: string, options?: {
|
|
81
|
+
splitter?: PathEntrySplitter;
|
|
82
|
+
}): Promise<string[] | null>;
|
|
83
|
+
/** Expand delimited entries in-place while preserving unsplit entries. */
|
|
84
|
+
export declare function expandDelimitedPathEntries(entries: readonly string[], cwd: string, options?: {
|
|
85
|
+
splitter?: PathEntrySplitter;
|
|
86
|
+
}): Promise<string[]>;
|
|
72
87
|
export interface ParsedSearchPath {
|
|
73
88
|
basePath: string;
|
|
74
89
|
glob?: string;
|
|
@@ -170,3 +185,4 @@ export interface ToolScopeResolution {
|
|
|
170
185
|
* 5. stat the resolved base path so callers can branch on directory vs file scope.
|
|
171
186
|
*/
|
|
172
187
|
export declare function resolveToolSearchScope(opts: ToolScopeOptions): Promise<ToolScopeResolution>;
|
|
188
|
+
export {};
|
|
@@ -32,13 +32,33 @@ export type SqliteRowLookup = {
|
|
|
32
32
|
} | {
|
|
33
33
|
kind: "rowid";
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Row count for a table in the listing.
|
|
37
|
+
* - `exact`: counted in full (the table is small enough to count cheaply).
|
|
38
|
+
* - `estimate`: the planner's `sqlite_stat1` figure; the table is too large to
|
|
39
|
+
* scan, so this may be stale.
|
|
40
|
+
* - `atLeast`: a lower bound; counting was capped before reaching the end.
|
|
41
|
+
*/
|
|
42
|
+
export type TableRowCount = {
|
|
43
|
+
kind: "exact";
|
|
44
|
+
rows: number;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "estimate";
|
|
47
|
+
rows: number;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "atLeast";
|
|
50
|
+
rows: number;
|
|
51
|
+
};
|
|
52
|
+
export interface SqliteTableSummary {
|
|
53
|
+
name: string;
|
|
54
|
+
count: TableRowCount;
|
|
55
|
+
}
|
|
35
56
|
export declare function parseSqlitePathCandidates(filePath: string): SqlitePathCandidate[];
|
|
36
57
|
export declare function isSqliteFile(absolutePath: string): Promise<boolean>;
|
|
37
58
|
export declare function parseSqliteSelector(subPath: string, queryString: string): SqliteSelector;
|
|
38
|
-
export declare function listTables(db: Database
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}[];
|
|
59
|
+
export declare function listTables(db: Database, options?: {
|
|
60
|
+
probeCap?: number;
|
|
61
|
+
}): SqliteTableSummary[];
|
|
42
62
|
export declare function getTableSchema(db: Database, table: string): string;
|
|
43
63
|
export declare function getTablePrimaryKey(db: Database, table: string): {
|
|
44
64
|
column: string;
|
|
@@ -75,10 +95,7 @@ export declare function deleteRowByKey(db: Database, table: string, pk: {
|
|
|
75
95
|
type?: string;
|
|
76
96
|
}, key: string): number;
|
|
77
97
|
export declare function deleteRowByRowId(db: Database, table: string, key: string): number;
|
|
78
|
-
export declare function renderTableList(tables:
|
|
79
|
-
name: string;
|
|
80
|
-
rowCount: number;
|
|
81
|
-
}[]): string;
|
|
98
|
+
export declare function renderTableList(tables: SqliteTableSummary[]): string;
|
|
82
99
|
export declare function renderSchema(createSql: string, sampleRows: {
|
|
83
100
|
columns: string[];
|
|
84
101
|
rows: Record<string, unknown>[];
|
|
@@ -41,6 +41,8 @@ export declare class WriteTool implements AgentTool<typeof writeSchema, WriteToo
|
|
|
41
41
|
readonly concurrency = "exclusive";
|
|
42
42
|
readonly loadMode = "discoverable";
|
|
43
43
|
readonly summary = "Write content to a file (creates or overwrites)";
|
|
44
|
+
/** Stream matchers should see the real file content, not its JSON-escaped argument encoding. */
|
|
45
|
+
matcherDigest(args: unknown): string | undefined;
|
|
44
46
|
constructor(session: ToolSession);
|
|
45
47
|
execute(_toolCallId: string, { path, content }: WriteParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<WriteToolDetails>, context?: AgentToolContext): Promise<AgentToolResult<WriteToolDetails>>;
|
|
46
48
|
}
|
|
@@ -20,3 +20,7 @@ export declare function copyToClipboard(text: string): Promise<void>;
|
|
|
20
20
|
* @returns PNG payload or null when no image is available.
|
|
21
21
|
*/
|
|
22
22
|
export declare function readImageFromClipboard(): Promise<ClipboardImage | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Read plain text from the system clipboard.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readTextFromClipboard(): Promise<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Result from a completed `jj` subprocess invocation. */
|
|
2
|
+
export interface JjCommandResult {
|
|
3
|
+
/** Process exit code reported by `jj`. */
|
|
4
|
+
exitCode: number;
|
|
5
|
+
/** Captured standard output as UTF-8 text. */
|
|
6
|
+
stdout: string;
|
|
7
|
+
/** Captured standard error as UTF-8 text. */
|
|
8
|
+
stderr: string;
|
|
9
|
+
}
|
|
10
|
+
/** Resolved Jujutsu workspace metadata. */
|
|
11
|
+
export interface JjRepository {
|
|
12
|
+
/** Root directory containing the `.jj` workspace metadata. */
|
|
13
|
+
repoRoot: string;
|
|
14
|
+
/** Path to the workspace store directory used to verify a real JJ checkout. */
|
|
15
|
+
storeDir: string;
|
|
16
|
+
}
|
|
17
|
+
/** Options for `jj diff` invocations. */
|
|
18
|
+
export interface DiffOptions {
|
|
19
|
+
/** Optional file paths to restrict the diff with `-- <files>`. */
|
|
20
|
+
readonly files?: readonly string[];
|
|
21
|
+
/** Return only changed file names instead of Git-format diff text. */
|
|
22
|
+
readonly nameOnly?: boolean;
|
|
23
|
+
/** Optional abort signal passed to the spawned `jj` process. */
|
|
24
|
+
readonly signal?: AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
/** Error thrown when a checked `jj` command exits non-zero. */
|
|
27
|
+
export declare class JjCommandError extends Error {
|
|
28
|
+
/** Arguments passed after the common `jj --no-pager --color=never` prefix. */
|
|
29
|
+
readonly args: readonly string[];
|
|
30
|
+
/** Captured command result that caused the failure. */
|
|
31
|
+
readonly result: JjCommandResult;
|
|
32
|
+
/** Create an error for a failed checked `jj` command. */
|
|
33
|
+
constructor(args: readonly string[], result: JjCommandResult);
|
|
34
|
+
}
|
|
35
|
+
/** Run `jj diff --git` for the current workspace commit and return the raw Git-format diff text. */
|
|
36
|
+
export declare const diff: ((cwd: string, options?: DiffOptions) => Promise<string>) & {
|
|
37
|
+
/** List changed file paths. */
|
|
38
|
+
changedFiles(cwd: string, options?: Pick<DiffOptions, "files" | "signal">): Promise<string[]>;
|
|
39
|
+
};
|
|
40
|
+
export declare const repo: {
|
|
41
|
+
/** Clear cached workspace roots. Intended for tests that mutate JJ metadata under an existing path. */
|
|
42
|
+
clearRootCache(): void;
|
|
43
|
+
/** Resolve the current Jujutsu workspace root, or `null` when `cwd` is not in a JJ repository. */
|
|
44
|
+
root(cwd: string): Promise<string | null>;
|
|
45
|
+
/** Full Jujutsu workspace metadata. */
|
|
46
|
+
resolve(cwd: string): Promise<JjRepository | null>;
|
|
47
|
+
/** Check whether `cwd` is inside a Jujutsu repository. */
|
|
48
|
+
is(cwd: string): Promise<boolean>;
|
|
49
|
+
};
|
package/dist/types/web/kagi.d.ts
CHANGED
|
@@ -1,10 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kagi API Client
|
|
3
|
+
*
|
|
4
|
+
* Implements the Kagi V1 Search API (POST /api/v1/search), the public-preview
|
|
5
|
+
* successor to the sunset V0 endpoint. Authentication is resolved exclusively
|
|
6
|
+
* through the shared {@link AuthStorage} broker (Bearer token), and responses
|
|
7
|
+
* are categorized result buckets rather than the legacy flat object array.
|
|
8
|
+
*/
|
|
1
9
|
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
10
|
+
/** V1 search request body. */
|
|
11
|
+
export interface KagiSearchRequest {
|
|
12
|
+
query: string;
|
|
13
|
+
/** Workflow mode: "search" | "research". */
|
|
14
|
+
workflow?: string;
|
|
15
|
+
/** Number of results (1-100). */
|
|
16
|
+
limit?: number;
|
|
17
|
+
/** Lens identifier (e.g. "news", "reddit"). */
|
|
18
|
+
lens?: string;
|
|
19
|
+
/** Time-based filters as ISO date strings (YYYY-MM-DD). */
|
|
20
|
+
filters?: {
|
|
21
|
+
after?: string;
|
|
22
|
+
before?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Individual V1 result item. */
|
|
26
|
+
export interface KagiSearchResultItem {
|
|
27
|
+
url: string;
|
|
28
|
+
title: string;
|
|
29
|
+
snippet?: string;
|
|
30
|
+
/** ISO timestamp or relative string ("2h ago"). */
|
|
31
|
+
time?: string;
|
|
32
|
+
/** Thumbnail image. */
|
|
33
|
+
image?: {
|
|
34
|
+
url: string;
|
|
35
|
+
height?: number;
|
|
36
|
+
width?: number;
|
|
37
|
+
};
|
|
38
|
+
/** Extra metadata key-value pairs. */
|
|
39
|
+
props?: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
/** V1 categorizes results into named buckets; only consumed buckets are typed. */
|
|
42
|
+
export interface KagiSearchData {
|
|
43
|
+
search?: KagiSearchResultItem[];
|
|
44
|
+
video?: KagiSearchResultItem[];
|
|
45
|
+
news?: KagiSearchResultItem[];
|
|
46
|
+
infobox?: KagiSearchResultItem[];
|
|
47
|
+
adjacent_question?: KagiSearchResultItem[];
|
|
48
|
+
related_search?: KagiSearchResultItem[];
|
|
49
|
+
direct_answer?: KagiSearchResultItem[];
|
|
50
|
+
}
|
|
51
|
+
/** V1 error entry. */
|
|
52
|
+
export interface KagiErrorEntry {
|
|
53
|
+
code?: number;
|
|
54
|
+
url?: string;
|
|
55
|
+
message?: string;
|
|
56
|
+
msg?: string;
|
|
57
|
+
location?: string;
|
|
58
|
+
}
|
|
59
|
+
/** V1 success response. */
|
|
60
|
+
export interface KagiSearchResponse {
|
|
61
|
+
meta?: {
|
|
62
|
+
trace?: string;
|
|
63
|
+
id?: string;
|
|
64
|
+
ms?: number;
|
|
65
|
+
};
|
|
66
|
+
data?: KagiSearchData;
|
|
67
|
+
error?: KagiErrorEntry[];
|
|
68
|
+
}
|
|
69
|
+
/** V1 error response. */
|
|
70
|
+
export interface KagiErrorResponse {
|
|
71
|
+
meta?: Record<string, unknown>;
|
|
72
|
+
error?: string | KagiErrorEntry[];
|
|
73
|
+
message?: string;
|
|
74
|
+
detail?: string;
|
|
75
|
+
}
|
|
2
76
|
export declare class KagiApiError extends Error {
|
|
3
77
|
readonly statusCode?: number;
|
|
4
78
|
constructor(message: string, statusCode?: number);
|
|
5
79
|
}
|
|
6
80
|
export interface KagiSearchOptions {
|
|
7
81
|
limit?: number;
|
|
82
|
+
recency?: "day" | "week" | "month" | "year";
|
|
8
83
|
sessionId?: string;
|
|
9
84
|
signal?: AbortSignal;
|
|
10
85
|
}
|
|
@@ -18,6 +93,7 @@ export interface KagiSearchResult {
|
|
|
18
93
|
requestId: string;
|
|
19
94
|
sources: KagiSearchSource[];
|
|
20
95
|
relatedQuestions: string[];
|
|
96
|
+
answer?: string;
|
|
21
97
|
}
|
|
22
98
|
export declare function findKagiApiKey(authStorage: AuthStorage, sessionId?: string, signal?: AbortSignal): Promise<string | null>;
|
|
23
99
|
export declare function searchWithKagi(query: string, options: KagiSearchOptions | undefined, authStorage: AuthStorage): Promise<KagiSearchResult>;
|
|
@@ -21,6 +21,12 @@ export interface ExaSearchParams {
|
|
|
21
21
|
start_published_date?: string;
|
|
22
22
|
end_published_date?: string;
|
|
23
23
|
signal?: AbortSignal;
|
|
24
|
+
/**
|
|
25
|
+
* Credential source. Resolved before falling back to `EXA_API_KEY` so
|
|
26
|
+
* Exa works when the key is stored via the broker/auth pipeline.
|
|
27
|
+
*/
|
|
28
|
+
authStorage?: AuthStorage;
|
|
29
|
+
sessionId?: string;
|
|
24
30
|
}
|
|
25
31
|
interface ExaSearchResult {
|
|
26
32
|
title?: string | null;
|
|
@@ -46,7 +52,7 @@ export declare function searchExa(params: ExaSearchParams): Promise<SearchRespon
|
|
|
46
52
|
export declare class ExaProvider extends SearchProvider {
|
|
47
53
|
readonly id = "exa";
|
|
48
54
|
readonly label = "Exa";
|
|
49
|
-
isAvailable(
|
|
55
|
+
isAvailable(authStorage: AuthStorage): boolean;
|
|
50
56
|
search(params: SearchParams): Promise<SearchResponse>;
|
|
51
57
|
}
|
|
52
58
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.8.2",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"@agentclientprotocol/sdk": "0.22.1",
|
|
48
48
|
"@babel/parser": "^7.29.7",
|
|
49
49
|
"@mozilla/readability": "^0.6.0",
|
|
50
|
-
"@oh-my-pi/hashline": "15.
|
|
51
|
-
"@oh-my-pi/omp-stats": "15.
|
|
52
|
-
"@oh-my-pi/pi-agent-core": "15.
|
|
53
|
-
"@oh-my-pi/pi-ai": "15.
|
|
54
|
-
"@oh-my-pi/pi-mnemopi": "15.
|
|
55
|
-
"@oh-my-pi/pi-natives": "15.
|
|
56
|
-
"@oh-my-pi/pi-tui": "15.
|
|
57
|
-
"@oh-my-pi/pi-utils": "15.
|
|
50
|
+
"@oh-my-pi/hashline": "15.8.2",
|
|
51
|
+
"@oh-my-pi/omp-stats": "15.8.2",
|
|
52
|
+
"@oh-my-pi/pi-agent-core": "15.8.2",
|
|
53
|
+
"@oh-my-pi/pi-ai": "15.8.2",
|
|
54
|
+
"@oh-my-pi/pi-mnemopi": "15.8.2",
|
|
55
|
+
"@oh-my-pi/pi-natives": "15.8.2",
|
|
56
|
+
"@oh-my-pi/pi-tui": "15.8.2",
|
|
57
|
+
"@oh-my-pi/pi-utils": "15.8.2",
|
|
58
58
|
"@puppeteer/browsers": "^3.0.4",
|
|
59
59
|
"@types/turndown": "5.0.6",
|
|
60
60
|
"@xterm/headless": "^6.0.0",
|
package/src/async/job-manager.ts
CHANGED
|
@@ -17,8 +17,8 @@ export interface AsyncJob {
|
|
|
17
17
|
resultText?: string;
|
|
18
18
|
errorText?: string;
|
|
19
19
|
/**
|
|
20
|
-
* Registry id of the agent that registered the job (e.g. "
|
|
21
|
-
* "
|
|
20
|
+
* Registry id of the agent that registered the job (e.g. "Main",
|
|
21
|
+
* "AuthLoader"). Used by scoped cancel/list APIs so a subagent's teardown
|
|
22
22
|
* does not cancel its parent's jobs. Undefined for callers that don't
|
|
23
23
|
* supply an id (e.g. legacy tests, SDK consumers without an agent context).
|
|
24
24
|
*/
|
|
@@ -58,7 +58,7 @@ export interface AsyncJobRegisterOptions {
|
|
|
58
58
|
/**
|
|
59
59
|
* Filter applied to job query/cancel APIs. With `ownerId`, results are
|
|
60
60
|
* restricted to jobs registered by that agent (registry id from
|
|
61
|
-
* `AgentRegistry`, e.g. "
|
|
61
|
+
* `AgentRegistry`, e.g. "Main", "AuthLoader").
|
|
62
62
|
*/
|
|
63
63
|
export interface AsyncJobFilter {
|
|
64
64
|
ownerId?: string;
|
package/src/cli/args.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface Args {
|
|
|
21
21
|
systemPrompt?: string;
|
|
22
22
|
appendSystemPrompt?: string;
|
|
23
23
|
thinking?: Effort;
|
|
24
|
+
hideThinking?: boolean;
|
|
24
25
|
continue?: boolean;
|
|
25
26
|
resume?: string | true;
|
|
26
27
|
help?: boolean;
|
|
@@ -182,6 +183,8 @@ export function parseArgs(inputArgs: string[], extensionFlags?: Map<string, { ty
|
|
|
182
183
|
validThinkingLevels: THINKING_EFFORTS,
|
|
183
184
|
});
|
|
184
185
|
}
|
|
186
|
+
} else if (arg === "--hide-thinking") {
|
|
187
|
+
result.hideThinking = true;
|
|
185
188
|
} else if (arg === "--print" || arg === "-p") {
|
|
186
189
|
result.print = true;
|
|
187
190
|
} else if (arg === "--export" && i + 1 < args.length) {
|
|
@@ -249,7 +252,7 @@ export function getExtraHelpText(): string {
|
|
|
249
252
|
CLAUDE_CODE_USE_FOUNDRY - Enable Anthropic Foundry mode (uses Foundry endpoint + mTLS)
|
|
250
253
|
FOUNDRY_BASE_URL - Anthropic Foundry base URL (e.g., https://<foundry-host>)
|
|
251
254
|
ANTHROPIC_FOUNDRY_API_KEY - Anthropic token used as Authorization: Bearer <token> in Foundry mode
|
|
252
|
-
ANTHROPIC_CUSTOM_HEADERS - Extra Foundry
|
|
255
|
+
ANTHROPIC_CUSTOM_HEADERS - Extra headers for Foundry or any custom ANTHROPIC_BASE_URL gateway (e.g., "user-id: USERNAME")
|
|
253
256
|
CLAUDE_CODE_CLIENT_CERT - Client certificate (PEM path or inline PEM) for mTLS
|
|
254
257
|
CLAUDE_CODE_CLIENT_KEY - Client private key (PEM path or inline PEM) for mTLS
|
|
255
258
|
NODE_EXTRA_CA_CERTS - CA bundle path (or inline PEM) for server certificate validation
|
|
@@ -284,7 +287,8 @@ export function getExtraHelpText(): string {
|
|
|
284
287
|
PERPLEXITY_API_KEY - Perplexity web search (API)
|
|
285
288
|
PERPLEXITY_COOKIES - Perplexity web search (session cookie)
|
|
286
289
|
TAVILY_API_KEY - Tavily web search
|
|
287
|
-
ANTHROPIC_SEARCH_API_KEY - Anthropic search
|
|
290
|
+
ANTHROPIC_SEARCH_API_KEY - Anthropic web search (override; isolates search from main ANTHROPIC_API_KEY)
|
|
291
|
+
ANTHROPIC_SEARCH_BASE_URL - Anthropic web search base URL (override; pairs with ANTHROPIC_SEARCH_API_KEY)
|
|
288
292
|
|
|
289
293
|
${chalk.dim("# Configuration")}
|
|
290
294
|
PI_CODING_AGENT_DIR - Session storage directory (default: ~/${CONFIG_DIR_NAME}/agent)
|