@oh-my-pi/pi-coding-agent 15.11.7 → 15.12.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.
- package/CHANGELOG.md +63 -1
- package/dist/cli.js +8106 -7708
- package/dist/types/cli/args.d.ts +2 -0
- package/dist/types/collab/crypto.d.ts +7 -0
- package/dist/types/collab/guest.d.ts +23 -0
- package/dist/types/collab/host.d.ts +29 -0
- package/dist/types/collab/protocol.d.ts +113 -0
- package/dist/types/collab/relay-client.d.ts +22 -0
- package/dist/types/commands/join.d.ts +12 -0
- package/dist/types/config/settings-schema.d.ts +60 -5
- package/dist/types/export/custom-share.d.ts +1 -2
- package/dist/types/export/html/index.d.ts +39 -1
- package/dist/types/export/share.d.ts +43 -0
- package/dist/types/extensibility/slash-commands.d.ts +1 -11
- package/dist/types/main.d.ts +2 -0
- package/dist/types/modes/components/agent-hub.d.ts +32 -1
- package/dist/types/modes/components/collab-prompt-message.d.ts +10 -0
- package/dist/types/modes/components/hook-selector.d.ts +4 -6
- package/dist/types/modes/components/segment-track.d.ts +11 -6
- package/dist/types/modes/components/status-line/component.d.ts +10 -2
- package/dist/types/modes/components/status-line/types.d.ts +11 -0
- package/dist/types/modes/controllers/event-controller.d.ts +7 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -1
- package/dist/types/modes/controllers/session-focus-controller.d.ts +31 -0
- package/dist/types/modes/interactive-mode.d.ts +16 -0
- package/dist/types/modes/session-observer-registry.d.ts +7 -0
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/modes/types.d.ts +20 -0
- package/dist/types/session/agent-session.d.ts +13 -0
- package/dist/types/session/codex-auto-reset.d.ts +8 -4
- package/dist/types/session/session-manager.d.ts +21 -0
- package/dist/types/session/snapcompact-inline.d.ts +6 -3
- package/dist/types/slash-commands/builtin-registry.d.ts +9 -0
- package/dist/types/task/executor.d.ts +7 -0
- package/dist/types/task/types.d.ts +9 -0
- package/package.json +14 -13
- package/scripts/bench-guard.ts +71 -0
- package/scripts/build-binary.ts +4 -0
- package/scripts/bundle-dist.ts +4 -0
- package/scripts/generate-share-viewer.ts +34 -0
- package/src/cli/args.ts +2 -0
- package/src/cli-commands.ts +1 -0
- package/src/collab/crypto.ts +63 -0
- package/src/collab/guest.ts +450 -0
- package/src/collab/host.ts +556 -0
- package/src/collab/protocol.ts +232 -0
- package/src/collab/relay-client.ts +216 -0
- package/src/commands/join.ts +39 -0
- package/src/config/model-registry.ts +22 -14
- package/src/config/settings-schema.ts +67 -5
- package/src/config/settings.ts +12 -0
- package/src/export/custom-share.ts +1 -1
- package/src/export/html/index.ts +122 -17
- package/src/export/html/share-loader.js +102 -0
- package/src/export/html/template.css +745 -459
- package/src/export/html/template.html +6 -3
- package/src/export/html/template.js +240 -915
- package/src/export/html/tool-views.generated.js +38 -0
- package/src/export/share.ts +268 -0
- package/src/extensibility/slash-commands.ts +1 -97
- package/src/internal-urls/docs-index.generated.ts +74 -73
- package/src/main.ts +33 -11
- package/src/modes/components/agent-hub.ts +659 -431
- package/src/modes/components/assistant-message.ts +126 -6
- package/src/modes/components/collab-prompt-message.ts +30 -0
- package/src/modes/components/hook-selector.ts +4 -5
- package/src/modes/components/segment-track.ts +44 -7
- package/src/modes/components/status-line/component.ts +59 -6
- package/src/modes/components/status-line/presets.ts +1 -1
- package/src/modes/components/status-line/segments.ts +18 -1
- package/src/modes/components/status-line/types.ts +12 -0
- package/src/modes/components/tips.txt +4 -1
- package/src/modes/controllers/command-controller.ts +55 -96
- package/src/modes/controllers/event-controller.ts +45 -16
- package/src/modes/controllers/input-controller.ts +175 -9
- package/src/modes/controllers/selector-controller.ts +13 -15
- package/src/modes/controllers/session-focus-controller.ts +112 -0
- package/src/modes/controllers/streaming-reveal.ts +7 -0
- package/src/modes/interactive-mode.ts +56 -6
- package/src/modes/session-observer-registry.ts +11 -0
- package/src/modes/theme/theme.ts +6 -0
- package/src/modes/types.ts +20 -0
- package/src/modes/utils/ui-helpers.ts +23 -13
- package/src/prompts/tools/job.md +1 -1
- package/src/sdk.ts +239 -36
- package/src/session/agent-session.ts +82 -7
- package/src/session/codex-auto-reset.ts +23 -11
- package/src/session/session-manager.ts +44 -0
- package/src/session/snapcompact-inline.ts +9 -3
- package/src/slash-commands/builtin-registry.ts +261 -24
- package/src/task/executor.ts +14 -0
- package/src/task/index.ts +5 -1
- package/src/task/render.ts +76 -5
- package/src/task/types.ts +9 -0
- package/src/tiny/worker.ts +17 -95
- package/src/tools/job.ts +6 -9
- package/src/tools/read.ts +38 -5
- package/src/tools/write.ts +13 -42
- package/dist/tokenizers.linux-x64-gnu-xcjh3jwk.node +0 -0
- package/dist/types/export/html/template.generated.d.ts +0 -1
- package/dist/types/export/html/template.macro.d.ts +0 -5
- package/dist/types/tiny/compiled-runtime.d.ts +0 -35
- package/scripts/generate-template.ts +0 -33
- package/src/bun-imports.d.ts +0 -28
- package/src/export/html/template.generated.ts +0 -2
- package/src/export/html/template.macro.ts +0 -25
- package/src/tiny/compiled-runtime.ts +0 -179
package/src/main.ts
CHANGED
|
@@ -66,6 +66,7 @@ import {
|
|
|
66
66
|
import type { AgentSession } from "./session/agent-session";
|
|
67
67
|
import type { AuthStorage } from "./session/auth-storage";
|
|
68
68
|
import { resolveResumableSession, type SessionInfo, SessionManager } from "./session/session-manager";
|
|
69
|
+
import { executeBuiltinSlashCommand } from "./slash-commands/builtin-registry";
|
|
69
70
|
import { discoverTitleSystemPromptFile, resolvePromptInput } from "./system-prompt";
|
|
70
71
|
import { initTelemetryExport, isTelemetryExportEnabled } from "./telemetry-export";
|
|
71
72
|
import { AUTO_THINKING } from "./thinking";
|
|
@@ -243,6 +244,22 @@ export interface InteractiveModeNotify {
|
|
|
243
244
|
message: string;
|
|
244
245
|
}
|
|
245
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
|
+
}
|
|
246
263
|
export async function submitInteractiveInput(
|
|
247
264
|
mode: Pick<
|
|
248
265
|
InteractiveMode,
|
|
@@ -346,6 +363,7 @@ async function runInteractiveMode(
|
|
|
346
363
|
initialMessage?: string,
|
|
347
364
|
initialImages?: ImageContent[],
|
|
348
365
|
titleSystemPrompt?: string,
|
|
366
|
+
joinLink?: string,
|
|
349
367
|
): Promise<void> {
|
|
350
368
|
const mode = new InteractiveMode(
|
|
351
369
|
session,
|
|
@@ -414,6 +432,12 @@ async function runInteractiveMode(
|
|
|
414
432
|
}
|
|
415
433
|
}
|
|
416
434
|
|
|
435
|
+
// `omp join <link>`: dispatch through the same builtin path as a typed
|
|
436
|
+
// `/join` so collab guards and error rendering stay in one place.
|
|
437
|
+
if (joinLink !== undefined) {
|
|
438
|
+
await executeBuiltinSlashCommand(`/join ${joinLink}`, { ctx: mode });
|
|
439
|
+
}
|
|
440
|
+
|
|
417
441
|
if (initialMessage !== undefined) {
|
|
418
442
|
try {
|
|
419
443
|
using _keepalive = new EventLoopKeepalive();
|
|
@@ -889,7 +913,7 @@ export async function runRootCommand(
|
|
|
889
913
|
|
|
890
914
|
// Create AuthStorage and ModelRegistry upfront
|
|
891
915
|
const authStorage = await logger.time("discoverAuthStorage", deps.discoverAuthStorage ?? discoverAuthStorage);
|
|
892
|
-
const modelRegistry = new ModelRegistry(authStorage);
|
|
916
|
+
const modelRegistry = logger.time("modelRegistry:init", () => new ModelRegistry(authStorage));
|
|
893
917
|
|
|
894
918
|
if (parsedArgs.version) {
|
|
895
919
|
process.stdout.write(`${VERSION}\n`);
|
|
@@ -1138,7 +1162,7 @@ export async function runRootCommand(
|
|
|
1138
1162
|
// Both are no-ops when OTEL_EXPORTER_OTLP_ENDPOINT is unset. An empty config
|
|
1139
1163
|
// is enough to enable telemetry — content capture is governed by the
|
|
1140
1164
|
// standard OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT env var.
|
|
1141
|
-
await initTelemetryExport
|
|
1165
|
+
await logger.time("initTelemetryExport", initTelemetryExport);
|
|
1142
1166
|
if (isTelemetryExportEnabled()) {
|
|
1143
1167
|
sessionOptions.telemetry = {};
|
|
1144
1168
|
}
|
|
@@ -1259,18 +1283,15 @@ export async function runRootCommand(
|
|
|
1259
1283
|
const versionCheckPromise = checkForNewVersion(VERSION).catch(() => undefined);
|
|
1260
1284
|
const changelogMarkdown = await logger.time("main:getChangelogForDisplay", getChangelogForDisplay, parsedArgs);
|
|
1261
1285
|
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
return `${scopedModel.model.id}${thinkingStr}`;
|
|
1268
|
-
})
|
|
1269
|
-
.join(", ");
|
|
1286
|
+
const modelScopeNotification = buildModelScopeNotification(
|
|
1287
|
+
scopedModels,
|
|
1288
|
+
settingsInstance.get("startup.quiet"),
|
|
1289
|
+
);
|
|
1290
|
+
if (modelScopeNotification) {
|
|
1270
1291
|
// Routed through the TUI (not stdout): the startup capture owns the
|
|
1271
1292
|
// terminal in raw mode here, and the TUI's first clearScrollback paint
|
|
1272
1293
|
// would wipe a pre-TUI line anyway.
|
|
1273
|
-
notifs.push(
|
|
1294
|
+
notifs.push(modelScopeNotification);
|
|
1274
1295
|
}
|
|
1275
1296
|
|
|
1276
1297
|
if ($env.PI_TIMING) {
|
|
@@ -1298,6 +1319,7 @@ export async function runRootCommand(
|
|
|
1298
1319
|
initialMessage,
|
|
1299
1320
|
initialImages,
|
|
1300
1321
|
titleSystemPrompt,
|
|
1322
|
+
parsedArgs.join,
|
|
1301
1323
|
);
|
|
1302
1324
|
} else {
|
|
1303
1325
|
// Branch-only single-shot runner: keep print-mode code out of normal interactive startup.
|