@oh-my-pi/pi-coding-agent 15.7.5 → 15.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/CHANGELOG.md +159 -182
  2. package/dist/types/async/job-manager.d.ts +3 -3
  3. package/dist/types/cli/args.d.ts +1 -0
  4. package/dist/types/cli/claude-trace-cli.d.ts +54 -0
  5. package/dist/types/cli/session-picker.d.ts +10 -3
  6. package/dist/types/cli/update-cli.d.ts +17 -0
  7. package/dist/types/commands/launch.d.ts +3 -0
  8. package/dist/types/config/keybindings.d.ts +5 -0
  9. package/dist/types/config/settings-schema.d.ts +11 -2
  10. package/dist/types/config/settings.d.ts +13 -0
  11. package/dist/types/eval/__tests__/heartbeat.test.d.ts +1 -0
  12. package/dist/types/eval/concurrency-bridge.d.ts +26 -0
  13. package/dist/types/eval/heartbeat.d.ts +45 -0
  14. package/dist/types/eval/js/tool-bridge.d.ts +2 -1
  15. package/dist/types/extensibility/extensions/loader.d.ts +2 -2
  16. package/dist/types/extensibility/extensions/runner.d.ts +2 -1
  17. package/dist/types/extensibility/extensions/types.d.ts +24 -5
  18. package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +11 -0
  19. package/dist/types/lsp/diagnostics-ledger.d.ts +10 -0
  20. package/dist/types/lsp/index.d.ts +2 -0
  21. package/dist/types/lsp/utils.d.ts +4 -0
  22. package/dist/types/main.d.ts +5 -0
  23. package/dist/types/modes/acp/acp-agent.d.ts +1 -1
  24. package/dist/types/modes/components/assistant-message.d.ts +3 -1
  25. package/dist/types/modes/components/custom-editor.d.ts +3 -2
  26. package/dist/types/modes/components/hook-selector.d.ts +10 -1
  27. package/dist/types/modes/components/session-selector.d.ts +32 -5
  28. package/dist/types/modes/components/tool-execution.d.ts +8 -0
  29. package/dist/types/modes/controllers/extension-ui-controller.d.ts +3 -3
  30. package/dist/types/modes/controllers/input-controller.d.ts +1 -0
  31. package/dist/types/modes/interactive-mode.d.ts +10 -3
  32. package/dist/types/modes/rpc/rpc-mode.d.ts +1 -1
  33. package/dist/types/modes/theme/theme.d.ts +1 -1
  34. package/dist/types/modes/types.d.ts +5 -3
  35. package/dist/types/registry/agent-registry.d.ts +1 -1
  36. package/dist/types/sdk.d.ts +2 -2
  37. package/dist/types/session/agent-session.d.ts +12 -3
  38. package/dist/types/session/history-storage.d.ts +16 -1
  39. package/dist/types/session/session-manager.d.ts +4 -0
  40. package/dist/types/task/output-manager.d.ts +6 -15
  41. package/dist/types/tools/ask.d.ts +8 -6
  42. package/dist/types/tools/eval-backends.d.ts +12 -0
  43. package/dist/types/tools/eval-render.d.ts +52 -0
  44. package/dist/types/tools/eval.d.ts +2 -35
  45. package/dist/types/tools/find.d.ts +0 -9
  46. package/dist/types/tools/index.d.ts +5 -12
  47. package/dist/types/tools/path-utils.d.ts +16 -0
  48. package/dist/types/tools/sqlite-reader.d.ts +25 -8
  49. package/dist/types/tui/output-block.d.ts +4 -3
  50. package/dist/types/utils/clipboard.d.ts +4 -0
  51. package/dist/types/web/kagi.d.ts +76 -0
  52. package/dist/types/web/search/providers/exa.d.ts +7 -1
  53. package/dist/types/web/search/providers/kagi.d.ts +1 -0
  54. package/examples/extensions/README.md +1 -0
  55. package/examples/extensions/thinking-note.ts +13 -0
  56. package/package.json +9 -9
  57. package/src/async/job-manager.ts +3 -3
  58. package/src/cli/args.ts +6 -2
  59. package/src/cli/claude-trace-cli.ts +783 -0
  60. package/src/cli/session-picker.ts +36 -10
  61. package/src/cli/update-cli.ts +35 -2
  62. package/src/commands/launch.ts +3 -0
  63. package/src/config/keybindings.ts +6 -0
  64. package/src/config/model-registry.ts +33 -4
  65. package/src/config/settings-schema.ts +12 -2
  66. package/src/config/settings.ts +23 -0
  67. package/src/discovery/claude-plugins.ts +7 -9
  68. package/src/discovery/claude.ts +41 -22
  69. package/src/edit/index.ts +23 -3
  70. package/src/eval/__tests__/agent-bridge.test.ts +148 -4
  71. package/src/eval/__tests__/heartbeat.test.ts +84 -0
  72. package/src/eval/__tests__/llm-bridge.test.ts +30 -0
  73. package/src/eval/agent-bridge.ts +44 -38
  74. package/src/eval/concurrency-bridge.ts +34 -0
  75. package/src/eval/heartbeat.ts +74 -0
  76. package/src/eval/js/executor.ts +13 -9
  77. package/src/eval/js/shared/prelude.txt +20 -17
  78. package/src/eval/js/tool-bridge.ts +5 -0
  79. package/src/eval/llm-bridge.ts +20 -14
  80. package/src/eval/py/executor.ts +14 -18
  81. package/src/eval/py/prelude.py +23 -15
  82. package/src/exec/bash-executor.ts +31 -5
  83. package/src/extensibility/extensions/loader.ts +16 -18
  84. package/src/extensibility/extensions/runner.ts +22 -17
  85. package/src/extensibility/extensions/types.ts +39 -5
  86. package/src/extensibility/plugins/legacy-pi-compat.ts +115 -131
  87. package/src/extensibility/skills.ts +0 -1
  88. package/src/internal-urls/docs-index.generated.ts +14 -13
  89. package/src/lsp/diagnostics-ledger.ts +51 -0
  90. package/src/lsp/index.ts +9 -22
  91. package/src/lsp/utils.ts +21 -0
  92. package/src/main.ts +92 -24
  93. package/src/modes/acp/acp-agent.ts +8 -4
  94. package/src/modes/acp/acp-event-mapper.ts +54 -4
  95. package/src/modes/components/assistant-message.ts +28 -1
  96. package/src/modes/components/custom-editor.ts +19 -7
  97. package/src/modes/components/hook-selector.ts +229 -44
  98. package/src/modes/components/oauth-selector.ts +12 -6
  99. package/src/modes/components/session-selector.ts +179 -24
  100. package/src/modes/components/tool-execution.ts +36 -7
  101. package/src/modes/controllers/command-controller.ts +2 -11
  102. package/src/modes/controllers/event-controller.ts +5 -2
  103. package/src/modes/controllers/extension-ui-controller.ts +6 -4
  104. package/src/modes/controllers/input-controller.ts +19 -16
  105. package/src/modes/controllers/selector-controller.ts +61 -21
  106. package/src/modes/interactive-mode.ts +127 -16
  107. package/src/modes/rpc/rpc-mode.ts +17 -6
  108. package/src/modes/theme/theme-schema.json +30 -0
  109. package/src/modes/theme/theme.ts +39 -2
  110. package/src/modes/types.ts +7 -3
  111. package/src/modes/utils/ui-helpers.ts +5 -2
  112. package/src/prompts/system/orchestrate-notice.md +5 -3
  113. package/src/prompts/system/workflow-notice.md +2 -2
  114. package/src/prompts/tools/ask.md +2 -1
  115. package/src/prompts/tools/eval.md +6 -6
  116. package/src/prompts/tools/find.md +1 -1
  117. package/src/prompts/tools/irc.md +6 -6
  118. package/src/prompts/tools/search.md +1 -1
  119. package/src/prompts/tools/task.md +1 -1
  120. package/src/registry/agent-registry.ts +1 -1
  121. package/src/sdk.ts +85 -31
  122. package/src/session/agent-session.ts +127 -57
  123. package/src/session/history-storage.ts +56 -12
  124. package/src/session/session-manager.ts +34 -0
  125. package/src/task/output-manager.ts +40 -48
  126. package/src/task/render.ts +3 -8
  127. package/src/tools/ask.ts +74 -32
  128. package/src/tools/browser/tab-worker.ts +8 -5
  129. package/src/tools/eval-backends.ts +38 -0
  130. package/src/tools/eval-render.ts +750 -0
  131. package/src/tools/eval.ts +27 -754
  132. package/src/tools/find.ts +5 -29
  133. package/src/tools/index.ts +8 -38
  134. package/src/tools/path-utils.ts +144 -1
  135. package/src/tools/read.ts +47 -0
  136. package/src/tools/renderers.ts +1 -1
  137. package/src/tools/search.ts +2 -27
  138. package/src/tools/sqlite-reader.ts +92 -9
  139. package/src/tools/write.ts +9 -1
  140. package/src/tui/output-block.ts +5 -4
  141. package/src/utils/clipboard.ts +38 -1
  142. package/src/utils/open.ts +37 -2
  143. package/src/web/kagi.ts +168 -49
  144. package/src/web/search/providers/anthropic.ts +1 -1
  145. package/src/web/search/providers/exa.ts +20 -86
  146. package/src/web/search/providers/kagi.ts +4 -0
@@ -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(_authStorage: AuthStorage): boolean;
55
+ isAvailable(authStorage: AuthStorage): boolean;
50
56
  search(params: SearchParams): Promise<SearchResponse>;
51
57
  }
52
58
  export {};
@@ -11,6 +11,7 @@ import { SearchProvider } from "./base";
11
11
  export declare function searchKagi(params: {
12
12
  query: string;
13
13
  num_results?: number;
14
+ recency?: SearchParams["recency"];
14
15
  signal?: AbortSignal;
15
16
  authStorage: AuthStorage;
16
17
  sessionId?: string;
@@ -41,6 +41,7 @@ cp permission-gate.ts ~/.omp/agent/extensions/
41
41
  | `handoff.ts` | Transfer context to a new focused session via `/handoff <goal>` |
42
42
  | `qna.ts` | Extracts questions from last response into editor via `ctx.ui.setEditorText()` |
43
43
  | `status-line.ts` | Shows turn progress in footer via `ctx.ui.setStatus()` with themed colors |
44
+ | `thinking-note.ts` | Adds display-only supplemental UI below assistant thinking blocks |
44
45
  | `snake.ts` | Snake game with custom UI, keyboard handling, and session persistence |
45
46
 
46
47
  ### Git Integration
@@ -0,0 +1,13 @@
1
+ import type { ExtensionFactory } from "@oh-my-pi/pi-coding-agent";
2
+ import { Container, Text } from "@oh-my-pi/pi-tui";
3
+
4
+ const extension: ExtensionFactory = pi => {
5
+ pi.setLabel("Thinking note");
6
+ pi.registerAssistantThinkingRenderer((context, theme) => {
7
+ const container = new Container();
8
+ container.addChild(new Text(theme.fg("dim", `thinking chars: ${context.text.length}`), 1, 0));
9
+ return container;
10
+ });
11
+ };
12
+
13
+ export default extension;
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.7.5",
4
+ "version": "15.8.0",
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.7.5",
51
- "@oh-my-pi/omp-stats": "15.7.5",
52
- "@oh-my-pi/pi-agent-core": "15.7.5",
53
- "@oh-my-pi/pi-ai": "15.7.5",
54
- "@oh-my-pi/pi-mnemopi": "15.7.5",
55
- "@oh-my-pi/pi-natives": "15.7.5",
56
- "@oh-my-pi/pi-tui": "15.7.5",
57
- "@oh-my-pi/pi-utils": "15.7.5",
50
+ "@oh-my-pi/hashline": "15.8.0",
51
+ "@oh-my-pi/omp-stats": "15.8.0",
52
+ "@oh-my-pi/pi-agent-core": "15.8.0",
53
+ "@oh-my-pi/pi-ai": "15.8.0",
54
+ "@oh-my-pi/pi-mnemopi": "15.8.0",
55
+ "@oh-my-pi/pi-natives": "15.8.0",
56
+ "@oh-my-pi/pi-tui": "15.8.0",
57
+ "@oh-my-pi/pi-utils": "15.8.0",
58
58
  "@puppeteer/browsers": "^3.0.4",
59
59
  "@types/turndown": "5.0.6",
60
60
  "@xterm/headless": "^6.0.0",
@@ -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. "0-Main",
21
- * "3-AuthLoader"). Used by scoped cancel/list APIs so a subagent's teardown
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. "0-Main", "3-AuthLoader").
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 headers (e.g., "user-id: USERNAME")
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 provider
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)