@oh-my-pi/pi-coding-agent 15.11.8 → 15.12.1

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 (89) hide show
  1. package/CHANGELOG.md +46 -2
  2. package/dist/cli.js +8095 -7704
  3. package/dist/types/collab/crypto.d.ts +1 -6
  4. package/dist/types/collab/guest.d.ts +2 -0
  5. package/dist/types/collab/host.d.ts +16 -0
  6. package/dist/types/collab/protocol.d.ts +14 -1
  7. package/dist/types/config/settings-schema.d.ts +52 -6
  8. package/dist/types/export/custom-share.d.ts +1 -2
  9. package/dist/types/export/html/index.d.ts +39 -1
  10. package/dist/types/export/share.d.ts +43 -0
  11. package/dist/types/main.d.ts +2 -0
  12. package/dist/types/modes/components/agent-hub.d.ts +19 -1
  13. package/dist/types/modes/components/status-line/component.d.ts +6 -1
  14. package/dist/types/modes/components/status-line/types.d.ts +2 -0
  15. package/dist/types/modes/controllers/event-controller.d.ts +7 -0
  16. package/dist/types/modes/controllers/input-controller.d.ts +1 -1
  17. package/dist/types/modes/controllers/session-focus-controller.d.ts +31 -0
  18. package/dist/types/modes/interactive-mode.d.ts +9 -0
  19. package/dist/types/modes/session-observer-registry.d.ts +7 -0
  20. package/dist/types/modes/theme/theme.d.ts +2 -1
  21. package/dist/types/modes/types.d.ts +12 -0
  22. package/dist/types/session/agent-session.d.ts +2 -0
  23. package/dist/types/session/codex-auto-reset.d.ts +8 -4
  24. package/dist/types/task/executor.d.ts +7 -0
  25. package/dist/types/task/types.d.ts +9 -0
  26. package/dist/types/tools/tool-result.d.ts +2 -0
  27. package/package.json +13 -14
  28. package/scripts/build-binary.ts +4 -0
  29. package/scripts/bundle-dist.ts +4 -0
  30. package/scripts/generate-share-viewer.ts +34 -0
  31. package/src/collab/crypto.ts +10 -4
  32. package/src/collab/guest.ts +31 -2
  33. package/src/collab/host.ts +73 -11
  34. package/src/collab/protocol.ts +48 -7
  35. package/src/commands/join.ts +1 -1
  36. package/src/config/settings-schema.ts +54 -5
  37. package/src/config/settings.ts +12 -0
  38. package/src/export/custom-share.ts +1 -1
  39. package/src/export/html/index.ts +122 -17
  40. package/src/export/html/share-loader.js +102 -0
  41. package/src/export/html/template.css +745 -459
  42. package/src/export/html/template.html +6 -3
  43. package/src/export/html/template.js +240 -915
  44. package/src/export/html/tool-views.generated.js +38 -0
  45. package/src/export/share.ts +268 -0
  46. package/src/internal-urls/docs-index.generated.ts +73 -73
  47. package/src/lsp/index.ts +11 -0
  48. package/src/main.ts +22 -9
  49. package/src/modes/components/agent-hub.ts +541 -410
  50. package/src/modes/components/status-line/component.ts +38 -5
  51. package/src/modes/components/status-line/segments.ts +5 -1
  52. package/src/modes/components/status-line/types.ts +2 -0
  53. package/src/modes/components/tips.txt +3 -1
  54. package/src/modes/controllers/command-controller.ts +55 -96
  55. package/src/modes/controllers/event-controller.ts +45 -16
  56. package/src/modes/controllers/input-controller.ts +104 -4
  57. package/src/modes/controllers/selector-controller.ts +11 -15
  58. package/src/modes/controllers/session-focus-controller.ts +112 -0
  59. package/src/modes/interactive-mode.ts +44 -2
  60. package/src/modes/session-observer-registry.ts +11 -0
  61. package/src/modes/theme/theme.ts +6 -0
  62. package/src/modes/types.ts +12 -0
  63. package/src/modes/utils/ui-helpers.ts +16 -13
  64. package/src/prompts/tools/job.md +1 -1
  65. package/src/session/agent-session.ts +87 -19
  66. package/src/session/codex-auto-reset.ts +23 -11
  67. package/src/slash-commands/builtin-registry.ts +62 -35
  68. package/src/task/executor.ts +14 -0
  69. package/src/task/index.ts +5 -1
  70. package/src/task/render.ts +76 -5
  71. package/src/task/types.ts +9 -0
  72. package/src/tiny/worker.ts +17 -95
  73. package/src/tools/ast-grep.ts +3 -1
  74. package/src/tools/find.ts +3 -1
  75. package/src/tools/gh.ts +20 -6
  76. package/src/tools/irc.ts +4 -0
  77. package/src/tools/job.ts +18 -13
  78. package/src/tools/memory-recall.ts +2 -0
  79. package/src/tools/search.ts +3 -1
  80. package/src/tools/tool-result.ts +8 -0
  81. package/dist/tokenizers.linux-x64-gnu-xcjh3jwk.node +0 -0
  82. package/dist/types/export/html/template.generated.d.ts +0 -1
  83. package/dist/types/export/html/template.macro.d.ts +0 -5
  84. package/dist/types/tiny/compiled-runtime.d.ts +0 -35
  85. package/scripts/generate-template.ts +0 -33
  86. package/src/bun-imports.d.ts +0 -28
  87. package/src/export/html/template.generated.ts +0 -2
  88. package/src/export/html/template.macro.ts +0 -25
  89. package/src/tiny/compiled-runtime.ts +0 -179
package/src/lsp/index.ts CHANGED
@@ -2132,6 +2132,11 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
2132
2132
  const position = { line: resolvedLine - 1, character: resolvedCharacter };
2133
2133
 
2134
2134
  let output: string;
2135
+ // Set on bare empty-lookup outcomes (no definition/references/…): the
2136
+ // result carries no information once consumed, so compaction may elide
2137
+ // it. Clean diagnostics runs are NOT useless — they are verification
2138
+ // evidence.
2139
+ let useless = false;
2135
2140
 
2136
2141
  if (needsProjectIndex && !isRustAnalyzerServer) {
2137
2142
  await waitForProjectLoaded(client, signal);
@@ -2157,6 +2162,7 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
2157
2162
 
2158
2163
  if (locations.length === 0) {
2159
2164
  output = "No definition found";
2165
+ useless = true;
2160
2166
  } else {
2161
2167
  const lines = await Promise.all(
2162
2168
  locations.map(location => formatLocationWithContext(location, this.session.cwd)),
@@ -2181,6 +2187,7 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
2181
2187
 
2182
2188
  if (locations.length === 0) {
2183
2189
  output = "No type definition found";
2190
+ useless = true;
2184
2191
  } else {
2185
2192
  const lines = await Promise.all(
2186
2193
  locations.map(location => formatLocationWithContext(location, this.session.cwd)),
@@ -2205,6 +2212,7 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
2205
2212
 
2206
2213
  if (locations.length === 0) {
2207
2214
  output = "No implementation found";
2215
+ useless = true;
2208
2216
  } else {
2209
2217
  const lines = await Promise.all(
2210
2218
  locations.map(location => formatLocationWithContext(location, this.session.cwd)),
@@ -2242,6 +2250,7 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
2242
2250
 
2243
2251
  if (!result || result.length === 0) {
2244
2252
  output = "No references found";
2253
+ useless = true;
2245
2254
  } else {
2246
2255
  const contextualReferences = result.slice(0, REFERENCE_CONTEXT_LIMIT);
2247
2256
  const plainReferences = result.slice(REFERENCE_CONTEXT_LIMIT);
@@ -2381,6 +2390,7 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
2381
2390
 
2382
2391
  if (!result || result.length === 0) {
2383
2392
  output = "No symbols found";
2393
+ useless = true;
2384
2394
  } else {
2385
2395
  const relPath = formatPathRelativeToCwd(targetFile, this.session.cwd);
2386
2396
  if ("selectionRange" in result[0]) {
@@ -2444,6 +2454,7 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
2444
2454
  return {
2445
2455
  content: [{ type: "text", text: output }],
2446
2456
  details: { serverName, action, success: true, request: params },
2457
+ ...(useless ? { useless: true } : {}),
2447
2458
  };
2448
2459
  } catch (err) {
2449
2460
  if (err instanceof ToolError) throw err;
package/src/main.ts CHANGED
@@ -244,6 +244,22 @@ export interface InteractiveModeNotify {
244
244
  message: string;
245
245
  }
246
246
 
247
+ export function buildModelScopeNotification(
248
+ scopedModelsForDisplay: readonly Pick<ScopedModel, "model" | "thinkingLevel" | "explicitThinkingLevel">[],
249
+ startupQuiet: boolean,
250
+ ): InteractiveModeNotify | null {
251
+ if (startupQuiet || scopedModelsForDisplay.length === 0) {
252
+ return null;
253
+ }
254
+ const modelList = scopedModelsForDisplay
255
+ .map(scopedModel => {
256
+ const thinkingStr =
257
+ scopedModel.explicitThinkingLevel && scopedModel.thinkingLevel ? `:${scopedModel.thinkingLevel}` : "";
258
+ return `${scopedModel.model.id}${thinkingStr}`;
259
+ })
260
+ .join(", ");
261
+ return { kind: "info", message: `Model scope: ${modelList} (Ctrl+P to cycle)` };
262
+ }
247
263
  export async function submitInteractiveInput(
248
264
  mode: Pick<
249
265
  InteractiveMode,
@@ -1267,18 +1283,15 @@ export async function runRootCommand(
1267
1283
  const versionCheckPromise = checkForNewVersion(VERSION).catch(() => undefined);
1268
1284
  const changelogMarkdown = await logger.time("main:getChangelogForDisplay", getChangelogForDisplay, parsedArgs);
1269
1285
 
1270
- const scopedModelsForDisplay = sessionOptions.scopedModels ?? scopedModels;
1271
- if (scopedModelsForDisplay.length > 0) {
1272
- const modelList = scopedModelsForDisplay
1273
- .map(scopedModel => {
1274
- const thinkingStr = !scopedModel.thinkingLevel ? `:${scopedModel.thinkingLevel}` : "";
1275
- return `${scopedModel.model.id}${thinkingStr}`;
1276
- })
1277
- .join(", ");
1286
+ const modelScopeNotification = buildModelScopeNotification(
1287
+ scopedModels,
1288
+ settingsInstance.get("startup.quiet"),
1289
+ );
1290
+ if (modelScopeNotification) {
1278
1291
  // Routed through the TUI (not stdout): the startup capture owns the
1279
1292
  // terminal in raw mode here, and the TUI's first clearScrollback paint
1280
1293
  // would wipe a pre-TUI line anyway.
1281
- notifs.push({ kind: "info", message: `Model scope: ${modelList} (Ctrl+P to cycle)` });
1294
+ notifs.push(modelScopeNotification);
1282
1295
  }
1283
1296
 
1284
1297
  if ($env.PI_TIMING) {