omp-fabric 1.27.1 → 1.28.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 +46 -0
- package/README.md +1 -1
- package/dist/chunks/{chunk-KIH3KLZU.js → chunk-C2YMZNT5.js} +5 -5
- package/dist/chunks/chunk-C2YMZNT5.js.map +7 -0
- package/dist/chunks/{chunk-OJZNMROB.js → chunk-DKXNUCM2.js} +36 -50
- package/dist/chunks/chunk-DKXNUCM2.js.map +7 -0
- package/dist/chunks/chunk-K3OSK6AX.js +132 -0
- package/dist/chunks/chunk-K3OSK6AX.js.map +7 -0
- package/dist/chunks/{chunk-2BOZMRT5.js → chunk-LK66YHVL.js} +32 -49
- package/dist/chunks/chunk-LK66YHVL.js.map +7 -0
- package/dist/chunks/chunk-MIGBZN2K.js +81 -0
- package/dist/chunks/chunk-MIGBZN2K.js.map +7 -0
- package/dist/chunks/chunk-O337ZL5J.js +277 -0
- package/dist/chunks/chunk-O337ZL5J.js.map +7 -0
- package/dist/chunks/chunk-T76MXSP4.js +32 -0
- package/dist/chunks/chunk-T76MXSP4.js.map +7 -0
- package/dist/chunks/{chunk-NOZBB266.js → chunk-XZIQGFF7.js} +9 -13
- package/dist/chunks/chunk-XZIQGFF7.js.map +7 -0
- package/dist/chunks/{chunk-4XLJPEI4.js → chunk-ZJ7HHWW4.js} +20 -41
- package/dist/chunks/chunk-ZJ7HHWW4.js.map +7 -0
- package/dist/core/approval-controller.d.ts.map +1 -1
- package/dist/fabric-exec-tool.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +12 -5
- package/dist/fabric-runtime-state.js.map +2 -2
- package/dist/host-compatibility.d.ts +1 -1
- package/dist/index.js +169 -164
- package/dist/index.js.map +3 -3
- package/dist/providers/omp-tools-provider.d.ts.map +1 -1
- package/dist/ui/arc-group.d.ts +1 -1
- package/dist/ui/arc-group.d.ts.map +1 -1
- package/dist/ui/code-preview-shell.d.ts +2 -2
- package/dist/ui/code-preview-shell.d.ts.map +1 -1
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.d.ts +1 -5
- package/dist/ui/conversation-chrome.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +2 -2
- package/dist/ui/conversation-queue.d.ts +3 -2
- package/dist/ui/conversation-queue.d.ts.map +1 -1
- package/dist/ui/conversation-render.d.ts +19 -23
- package/dist/ui/conversation-render.d.ts.map +1 -1
- package/dist/ui/conversation.d.ts +7 -17
- package/dist/ui/conversation.d.ts.map +1 -1
- package/dist/ui/conversation.js +317 -318
- package/dist/ui/conversation.js.map +3 -3
- package/dist/ui/core-tool-render.d.ts +1 -1
- package/dist/ui/core-tool-render.d.ts.map +1 -1
- package/dist/ui/dashboard-detail.d.ts +4 -4
- package/dist/ui/dashboard-detail.d.ts.map +1 -1
- package/dist/ui/dashboard-fabric-graph.d.ts +1 -1
- package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -1
- package/dist/ui/dashboard-presentation.d.ts +1 -1
- package/dist/ui/dashboard-presentation.d.ts.map +1 -1
- package/dist/ui/dashboard.d.ts +8 -8
- package/dist/ui/dashboard.d.ts.map +1 -1
- package/dist/ui/dashboard.js +207 -343
- package/dist/ui/dashboard.js.map +3 -3
- package/dist/ui/diff-background.d.ts +1 -1
- package/dist/ui/diff-background.d.ts.map +1 -1
- package/dist/ui/fabric-actor-delivery-selector.d.ts +4 -4
- package/dist/ui/fabric-actor-delivery-selector.d.ts.map +1 -1
- package/dist/ui/fabric-actor-tool-selector.d.ts +5 -6
- package/dist/ui/fabric-actor-tool-selector.d.ts.map +1 -1
- package/dist/ui/fabric-host-event-selector.d.ts +4 -4
- package/dist/ui/fabric-host-event-selector.d.ts.map +1 -1
- package/dist/ui/fabric-model-selector.d.ts +4 -6
- package/dist/ui/fabric-model-selector.d.ts.map +1 -1
- package/dist/ui/fabric-render.d.ts +6 -6
- package/dist/ui/fabric-render.d.ts.map +1 -1
- package/dist/ui/fabric-thinking-selector.d.ts +4 -7
- package/dist/ui/fabric-thinking-selector.d.ts.map +1 -1
- package/dist/ui/highlight.d.ts +2 -13
- package/dist/ui/highlight.d.ts.map +1 -1
- package/dist/ui/row-balance.d.ts +6 -6
- package/dist/ui/row-balance.d.ts.map +1 -1
- package/dist/ui/settings.d.ts +6 -3
- package/dist/ui/settings.d.ts.map +1 -1
- package/dist/ui/settings.js +234 -112
- package/dist/ui/settings.js.map +3 -3
- package/dist/ui/state-file-preview.d.ts +1 -1
- package/dist/ui/state-file-preview.d.ts.map +1 -1
- package/dist/ui/tui/input.d.ts +16 -0
- package/dist/ui/tui/input.d.ts.map +1 -0
- package/dist/ui/tui/rows.d.ts +24 -0
- package/dist/ui/tui/rows.d.ts.map +1 -0
- package/dist/ui/tui/select-list.d.ts +28 -0
- package/dist/ui/tui/select-list.d.ts.map +1 -0
- package/dist/ui/tui/settings-list.d.ts +38 -0
- package/dist/ui/tui/settings-list.d.ts.map +1 -0
- package/dist/ui/tui/text-field.d.ts +40 -0
- package/dist/ui/tui/text-field.d.ts.map +1 -0
- package/dist/ui/tui/view.d.ts +26 -0
- package/dist/ui/tui/view.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +3 -3
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/worker.js +9 -0
- package/dist/worker.js.map +2 -2
- package/docs/interface.md +3 -3
- package/package.json +11 -11
- package/dist/chunks/chunk-2BOZMRT5.js.map +0 -7
- package/dist/chunks/chunk-4XLJPEI4.js.map +0 -7
- package/dist/chunks/chunk-G2IBGGBM.js +0 -42
- package/dist/chunks/chunk-G2IBGGBM.js.map +0 -7
- package/dist/chunks/chunk-KIH3KLZU.js.map +0 -7
- package/dist/chunks/chunk-NOZBB266.js.map +0 -7
- package/dist/chunks/chunk-OJZNMROB.js.map +0 -7
- package/dist/ui/symbol-theme.d.ts +0 -3
- package/dist/ui/symbol-theme.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const MINIMUM_OMP_HOST_VERSION = "
|
|
1
|
+
export declare const MINIMUM_OMP_HOST_VERSION = "19.2.0";
|
|
2
2
|
export declare const compareVersions: (left: string, right: string) => number | undefined;
|
|
3
3
|
export declare const detectOmpHostVersion: (cliPath?: string | undefined) => string | undefined;
|
|
4
4
|
export interface HostVersionWitnesses {
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,12 @@ import {
|
|
|
33
33
|
spinnerFrame,
|
|
34
34
|
updateSpinner,
|
|
35
35
|
wrapRowLimitFor
|
|
36
|
-
} from "./chunks/chunk-
|
|
36
|
+
} from "./chunks/chunk-ZJ7HHWW4.js";
|
|
37
|
+
import {
|
|
38
|
+
asRows,
|
|
39
|
+
isRows,
|
|
40
|
+
mountView
|
|
41
|
+
} from "./chunks/chunk-MIGBZN2K.js";
|
|
37
42
|
import {
|
|
38
43
|
activeStatuses,
|
|
39
44
|
isActiveStatus,
|
|
@@ -44,7 +49,7 @@ import {
|
|
|
44
49
|
formatDuration,
|
|
45
50
|
formatTokens,
|
|
46
51
|
safeText
|
|
47
|
-
} from "./chunks/chunk-
|
|
52
|
+
} from "./chunks/chunk-C2YMZNT5.js";
|
|
48
53
|
import {
|
|
49
54
|
ApprovalController,
|
|
50
55
|
CapturedToolCatalog,
|
|
@@ -67,7 +72,7 @@ import {
|
|
|
67
72
|
resolveFabricIdentity,
|
|
68
73
|
settleInPlacePrewalk,
|
|
69
74
|
streamedToolCallName
|
|
70
|
-
} from "./chunks/chunk-
|
|
75
|
+
} from "./chunks/chunk-LK66YHVL.js";
|
|
71
76
|
import {
|
|
72
77
|
AgentTranscriptReader,
|
|
73
78
|
fabricWriteBindings,
|
|
@@ -75,6 +80,11 @@ import {
|
|
|
75
80
|
} from "./chunks/chunk-IPI4UOTC.js";
|
|
76
81
|
import "./chunks/chunk-DLXPTBPL.js";
|
|
77
82
|
import "./chunks/chunk-7VIQNUPS.js";
|
|
83
|
+
import {
|
|
84
|
+
Stack,
|
|
85
|
+
TextBlock
|
|
86
|
+
} from "./chunks/chunk-K3OSK6AX.js";
|
|
87
|
+
import "./chunks/chunk-T76MXSP4.js";
|
|
78
88
|
import {
|
|
79
89
|
GUEST_TYPE_DECLARATIONS,
|
|
80
90
|
OMP_CORE_COMPATIBILITY_ARGUMENT_TYPE_NAMES
|
|
@@ -244,13 +254,7 @@ import {
|
|
|
244
254
|
import "./chunks/chunk-7363CD5A.js";
|
|
245
255
|
|
|
246
256
|
// src/ui/code-preview-shell.ts
|
|
247
|
-
import "@oh-my-pi/pi-tui";
|
|
248
|
-
import {
|
|
249
|
-
Container,
|
|
250
|
-
Text,
|
|
251
|
-
truncateToWidth,
|
|
252
|
-
visibleWidth
|
|
253
|
-
} from "@oh-my-pi/pi-tui";
|
|
257
|
+
import { truncate, visibleWidth } from "@oh-my-pi/pi-tui/text/width";
|
|
254
258
|
var timingState = (context) => context?.state;
|
|
255
259
|
var isTimingOnlyRender = (state) => state?.codePreviewTimingOnlyRenderToken !== void 0;
|
|
256
260
|
var unwrapTimingComponent = (component) => component instanceof TimingPreservedComponent ? component.component : component;
|
|
@@ -330,7 +334,7 @@ var TimingFooter = class {
|
|
|
330
334
|
render(width) {
|
|
331
335
|
return [
|
|
332
336
|
...continueArcGroup([...this.component.render(width)]),
|
|
333
|
-
|
|
337
|
+
truncate(this.footer, width, "")
|
|
334
338
|
];
|
|
335
339
|
}
|
|
336
340
|
invalidate() {
|
|
@@ -360,7 +364,6 @@ var shellStateFor = (key) => {
|
|
|
360
364
|
shellStates.set(object, created);
|
|
361
365
|
return created;
|
|
362
366
|
};
|
|
363
|
-
var isRenderComponent = (value) => value !== null && typeof value === "object" && typeof Reflect.get(value, "render") === "function";
|
|
364
367
|
var buildRenderContext = (args, options, supplied, fallbackState) => {
|
|
365
368
|
const executionStarted = typeof supplied.executionStarted === "boolean" ? supplied.executionStarted : !options.isPartial;
|
|
366
369
|
const argsComplete = typeof supplied.argsComplete === "boolean" ? supplied.argsComplete : !options.isPartial;
|
|
@@ -369,7 +372,7 @@ var buildRenderContext = (args, options, supplied, fallbackState) => {
|
|
|
369
372
|
args,
|
|
370
373
|
toolCallId: typeof supplied.toolCallId === "string" ? supplied.toolCallId : "fabric_exec",
|
|
371
374
|
invalidate: typeof supplied.invalidate === "function" ? supplied.invalidate : () => void 0,
|
|
372
|
-
lastComponent:
|
|
375
|
+
lastComponent: isRows(supplied.lastComponent) ? supplied.lastComponent : void 0,
|
|
373
376
|
state,
|
|
374
377
|
cwd: typeof supplied.cwd === "string" ? supplied.cwd : process.cwd(),
|
|
375
378
|
executionStarted,
|
|
@@ -448,7 +451,7 @@ var BorderedToolCall = class {
|
|
|
448
451
|
];
|
|
449
452
|
}
|
|
450
453
|
frameLine(line, innerWidth, border) {
|
|
451
|
-
const text =
|
|
454
|
+
const text = truncate(line, innerWidth, "");
|
|
452
455
|
const padding = " ".repeat(Math.max(0, innerWidth - visibleWidth(text)));
|
|
453
456
|
const hasDiffBackground = /^\x1b\[48;2;\d+;\d+;\d+m/.test(text);
|
|
454
457
|
return hasDiffBackground ? `${border("\u2502")} ${text}${padding} \x1B[49m${border("\u2502")}\x1B[0m` : `${border("\u2502")} ${text}\x1B[0m${padding} ${border("\u2502")}`;
|
|
@@ -463,11 +466,14 @@ var withCodePreviewShell = (tool, options = {}) => {
|
|
|
463
466
|
const originalRenderResult = tool.renderResult;
|
|
464
467
|
const renderCall = (args, options2, theme, context) => {
|
|
465
468
|
const renderOptions = { ...options2, renderContext: context };
|
|
466
|
-
return originalRenderCall ? originalRenderCall.call(tool, args, renderOptions, theme) : new
|
|
469
|
+
return originalRenderCall ? asRows(originalRenderCall.call(tool, args, renderOptions, theme), theme) : new TextBlock(theme.fg("toolTitle", theme.style("strong", tool.label || tool.name)));
|
|
467
470
|
};
|
|
468
471
|
const renderResult = (result, resultOptions, theme, context, args) => {
|
|
469
472
|
const renderOptions = { ...resultOptions, renderContext: context };
|
|
470
|
-
return
|
|
473
|
+
return asRows(
|
|
474
|
+
originalRenderResult?.call(tool, result, renderOptions, theme, args),
|
|
475
|
+
theme
|
|
476
|
+
);
|
|
471
477
|
};
|
|
472
478
|
return {
|
|
473
479
|
...tool,
|
|
@@ -475,7 +481,7 @@ var withCodePreviewShell = (tool, options = {}) => {
|
|
|
475
481
|
renderCall(args, options2, theme) {
|
|
476
482
|
const renderOptions = options2;
|
|
477
483
|
if (!renderOptions) {
|
|
478
|
-
return originalRenderCall ? originalRenderCall.call(tool, args, { expanded: false, isPartial: false }, theme) : new
|
|
484
|
+
return originalRenderCall ? originalRenderCall.call(tool, args, { expanded: false, isPartial: false }, theme) : new TextBlock(theme.fg("toolTitle", theme.style("strong", tool.label || tool.name)));
|
|
479
485
|
}
|
|
480
486
|
const supplied = renderOptions.renderContext && typeof renderOptions.renderContext === "object" ? renderOptions.renderContext : renderOptions;
|
|
481
487
|
const context = buildRenderContext(
|
|
@@ -2625,7 +2631,6 @@ Relevant to the current request: ${suggestion.name}. Ignore this if it does not
|
|
|
2625
2631
|
</skill_relevance>`;
|
|
2626
2632
|
|
|
2627
2633
|
// src/fabric-exec-tool.ts
|
|
2628
|
-
import { Container as Container2, Text as Text2 } from "@oh-my-pi/pi-tui";
|
|
2629
2634
|
import { Type } from "@oh-my-pi/pi-coding-agent/extensibility/legacy-typebox";
|
|
2630
2635
|
|
|
2631
2636
|
// src/speculation/summary.ts
|
|
@@ -2993,7 +2998,7 @@ var typeErrorRecoveryHint = (code, errors) => {
|
|
|
2993
2998
|
};
|
|
2994
2999
|
|
|
2995
3000
|
// src/ui/row-balance.ts
|
|
2996
|
-
import {
|
|
3001
|
+
import { truncate as truncate2 } from "@oh-my-pi/pi-tui/text/width";
|
|
2997
3002
|
var HiddenRowBorrowingComponent = class {
|
|
2998
3003
|
constructor(baseLimit, maxLimit, renderLimit, balance) {
|
|
2999
3004
|
this.baseLimit = baseLimit;
|
|
@@ -3025,7 +3030,7 @@ var HiddenRowBorrowingComponent = class {
|
|
|
3025
3030
|
}
|
|
3026
3031
|
this.#cachedWidth = width;
|
|
3027
3032
|
this.#cachedDeficit = deficit;
|
|
3028
|
-
this.#cachedRows = best.map((row) =>
|
|
3033
|
+
this.#cachedRows = best.map((row) => truncate2(row, Math.max(1, width)));
|
|
3029
3034
|
return this.#cachedRows;
|
|
3030
3035
|
}
|
|
3031
3036
|
invalidate() {
|
|
@@ -3117,7 +3122,6 @@ var rendererStateFor = (key) => {
|
|
|
3117
3122
|
rendererStates.set(object, created);
|
|
3118
3123
|
return created;
|
|
3119
3124
|
};
|
|
3120
|
-
var isRenderComponent2 = (value) => value !== null && typeof value === "object" && typeof Reflect.get(value, "render") === "function";
|
|
3121
3125
|
var previewContext = (options, state, args, rendererState) => {
|
|
3122
3126
|
const raw = options;
|
|
3123
3127
|
const supplied = raw.renderContext ?? options;
|
|
@@ -3127,7 +3131,7 @@ var previewContext = (options, state, args, rendererState) => {
|
|
|
3127
3131
|
args,
|
|
3128
3132
|
toolCallId: typeof supplied.toolCallId === "string" ? supplied.toolCallId : "fabric_exec",
|
|
3129
3133
|
invalidate: typeof supplied.invalidate === "function" ? supplied.invalidate : () => void 0,
|
|
3130
|
-
lastComponent:
|
|
3134
|
+
lastComponent: isRows(supplied.lastComponent) ? supplied.lastComponent : void 0,
|
|
3131
3135
|
state: supplied.state && typeof supplied.state === "object" ? supplied.state : rendererState,
|
|
3132
3136
|
cwd: typeof supplied.cwd === "string" ? supplied.cwd : state.cwd ?? process.cwd(),
|
|
3133
3137
|
executionStarted,
|
|
@@ -3240,15 +3244,15 @@ var createFabricExecTool = (state, codePreviewSettings, pendingHandoffs, decorat
|
|
|
3240
3244
|
if (mode === "compact" && !context.expanded) {
|
|
3241
3245
|
const display = normalizeRunDisplay(params.display);
|
|
3242
3246
|
const title2 = display?.name?.trim() || fabricExecTitleHintCached(code);
|
|
3243
|
-
const header = new
|
|
3244
|
-
header.
|
|
3245
|
-
[theme.fg("toolTitle", theme.
|
|
3247
|
+
const header = new Stack();
|
|
3248
|
+
header.add(renderBoundedLines(
|
|
3249
|
+
[theme.fg("toolTitle", theme.style("strong", safeTerminalText(title2 || "Fabric")))],
|
|
3246
3250
|
theme,
|
|
3247
3251
|
codePreviewSettings.diffIntensity,
|
|
3248
3252
|
1
|
|
3249
3253
|
));
|
|
3250
3254
|
if (display?.description) {
|
|
3251
|
-
header.
|
|
3255
|
+
header.add(renderBoundedLines(
|
|
3252
3256
|
[theme.fg("dim", safeTerminalText(display.description))],
|
|
3253
3257
|
theme,
|
|
3254
3258
|
codePreviewSettings.diffIntensity,
|
|
@@ -3256,16 +3260,15 @@ var createFabricExecTool = (state, codePreviewSettings, pendingHandoffs, decorat
|
|
|
3256
3260
|
));
|
|
3257
3261
|
}
|
|
3258
3262
|
if (!writePreview) return header;
|
|
3259
|
-
const composite2 = new
|
|
3260
|
-
composite2.
|
|
3261
|
-
composite2.
|
|
3262
|
-
composite2.addChild(writePreview);
|
|
3263
|
+
const composite2 = new Stack();
|
|
3264
|
+
composite2.add(header);
|
|
3265
|
+
composite2.add(writePreview);
|
|
3263
3266
|
return composite2;
|
|
3264
3267
|
}
|
|
3265
3268
|
const lines = safeTerminalText(code).split("\n");
|
|
3266
3269
|
const runDisplay = normalizeRunDisplay(params.display);
|
|
3267
3270
|
const displayName = runDisplay?.name ? safeTerminalText(runDisplay.name) : "";
|
|
3268
|
-
const title = `${theme.fg("toolTitle", theme.
|
|
3271
|
+
const title = `${theme.fg("toolTitle", theme.style("strong", "fabric"))}${displayName ? ` ${theme.fg("accent", displayName)}` : ""} ${theme.fg("dim", `TypeScript \xB7 ${countLabel(lines.length, "line")}`)}`;
|
|
3269
3272
|
const description = runDisplay?.description ? theme.fg("dim", safeTerminalText(runDisplay.description)) : "";
|
|
3270
3273
|
const baseLimit = context.expanded ? lines.length : Math.min(lines.length, 8);
|
|
3271
3274
|
const maxLimit = context.expanded ? lines.length : Math.min(lines.length, baseLimit + MAX_FABRIC_CODE_TRANSFER_LINES);
|
|
@@ -3278,13 +3281,11 @@ var createFabricExecTool = (state, codePreviewSettings, pendingHandoffs, decorat
|
|
|
3278
3281
|
const hidden = lines.length - shown.length;
|
|
3279
3282
|
const hiddenHint = hidden > 0 ? `
|
|
3280
3283
|
${theme.fg("dim", `\u2026 ${countLabel(hidden, "line")} hidden \xB7 `)}${expandHint(theme)}` : "";
|
|
3281
|
-
return
|
|
3284
|
+
return new TextBlock(
|
|
3282
3285
|
`${title}${description ? `
|
|
3283
3286
|
${description}` : ""}${preview ? `
|
|
3284
|
-
${preview}` : ""}${hiddenHint}
|
|
3285
|
-
|
|
3286
|
-
0
|
|
3287
|
-
).render(width)];
|
|
3287
|
+
${preview}` : ""}${hiddenHint}`
|
|
3288
|
+
).render(width);
|
|
3288
3289
|
};
|
|
3289
3290
|
const codePreview = new HiddenRowBorrowingComponent(
|
|
3290
3291
|
baseLimit,
|
|
@@ -3293,10 +3294,9 @@ ${preview}` : ""}${hiddenHint}`,
|
|
|
3293
3294
|
rowBalance
|
|
3294
3295
|
);
|
|
3295
3296
|
if (!writePreview) return codePreview;
|
|
3296
|
-
const composite = new
|
|
3297
|
-
composite.
|
|
3298
|
-
composite.
|
|
3299
|
-
composite.addChild(writePreview);
|
|
3297
|
+
const composite = new Stack();
|
|
3298
|
+
composite.add(codePreview);
|
|
3299
|
+
composite.add(writePreview);
|
|
3300
3300
|
return composite;
|
|
3301
3301
|
},
|
|
3302
3302
|
renderResult(result, options, theme, params) {
|
|
@@ -3397,7 +3397,7 @@ ${preview}` : ""}${hiddenHint}`,
|
|
|
3397
3397
|
if (audits.length === 0) {
|
|
3398
3398
|
const label = compact ? "Running\u2026" : progress ?? "Running Fabric program\u2026";
|
|
3399
3399
|
return trackRows(
|
|
3400
|
-
new
|
|
3400
|
+
new TextBlock(theme.fg("warning", `\u25C6 ${safeTerminalText(label)}`))
|
|
3401
3401
|
);
|
|
3402
3402
|
}
|
|
3403
3403
|
if (audits.length === 1) {
|
|
@@ -3506,25 +3506,19 @@ ${preview}` : ""}${hiddenHint}`,
|
|
|
3506
3506
|
if (audits.length === 0) {
|
|
3507
3507
|
if (failed && details.error) {
|
|
3508
3508
|
return trackRows(
|
|
3509
|
-
new
|
|
3510
|
-
theme.fg("error", `\u2717 ${safeTerminalText(details.error)}`),
|
|
3511
|
-
0,
|
|
3512
|
-
0
|
|
3513
|
-
)
|
|
3509
|
+
new TextBlock(theme.fg("error", `\u2717 ${safeTerminalText(details.error)}`))
|
|
3514
3510
|
);
|
|
3515
3511
|
}
|
|
3516
3512
|
if (!output) {
|
|
3517
|
-
return trackRows(new
|
|
3518
|
-
compact ? theme.fg(failed ? "error" : "success", failed ? "\u2717 Failed" : "\u2713 Evaluated") : theme.fg("dim", "\u2713 Fabric")
|
|
3519
|
-
0,
|
|
3520
|
-
0
|
|
3513
|
+
return trackRows(new TextBlock(
|
|
3514
|
+
compact ? theme.fg(failed ? "error" : "success", failed ? "\u2717 Failed" : "\u2713 Evaluated") : theme.fg("dim", "\u2713 Fabric")
|
|
3521
3515
|
));
|
|
3522
3516
|
}
|
|
3523
3517
|
const lines = safeTerminalText(output).split(nl);
|
|
3524
3518
|
const limit = expanded ? Math.min(lines.length, 200) : 12;
|
|
3525
3519
|
const shown = lines.slice(0, limit);
|
|
3526
3520
|
const displayName = normalizeRunDisplay(params?.display)?.name;
|
|
3527
|
-
const title = displayName ? theme.fg("toolTitle", theme.
|
|
3521
|
+
const title = displayName ? theme.fg("toolTitle", theme.style("strong", safeTerminalText(displayName))) : compact ? theme.fg(failed ? "error" : "success", failed ? "\u2717 Failed" : "\u2713 Evaluated") : "";
|
|
3528
3522
|
let text2 = styleOutputLines(shown).join(nl);
|
|
3529
3523
|
if (title) text2 = title + nl + text2;
|
|
3530
3524
|
if (lines.length > shown.length) {
|
|
@@ -3558,7 +3552,7 @@ ${preview}` : ""}${hiddenHint}`,
|
|
|
3558
3552
|
if (audit.error) {
|
|
3559
3553
|
text2 += nl + theme.fg("error", safeTerminalText(audit.error));
|
|
3560
3554
|
}
|
|
3561
|
-
return trackRows(new
|
|
3555
|
+
return trackRows(new TextBlock(text2));
|
|
3562
3556
|
}
|
|
3563
3557
|
if (previewLines[0]) {
|
|
3564
3558
|
text2 += ` ${previewLines[0]}`;
|
|
@@ -4392,7 +4386,7 @@ var classifyToolResult = (input) => {
|
|
|
4392
4386
|
// src/host-compatibility.ts
|
|
4393
4387
|
import { existsSync as existsSync3, readFileSync as readFileSync4, realpathSync as realpathSync2 } from "node:fs";
|
|
4394
4388
|
import path6 from "node:path";
|
|
4395
|
-
var MINIMUM_OMP_HOST_VERSION = "
|
|
4389
|
+
var MINIMUM_OMP_HOST_VERSION = "19.2.0";
|
|
4396
4390
|
var OMP_HOST_PACKAGE_NAMES = {
|
|
4397
4391
|
"@oh-my-pi/pi-coding-agent": true
|
|
4398
4392
|
};
|
|
@@ -4796,7 +4790,7 @@ var createDashboardSnapshot = (state, events, context, activityRuns) => {
|
|
|
4796
4790
|
};
|
|
4797
4791
|
|
|
4798
4792
|
// src/ui/widget.ts
|
|
4799
|
-
import {
|
|
4793
|
+
import { truncate as truncate3, visibleWidth as visibleWidth2 } from "@oh-my-pi/pi-tui/text/width";
|
|
4800
4794
|
var statusGlyph = (status) => {
|
|
4801
4795
|
if (status === "completed" || status === "done") return "\u2713";
|
|
4802
4796
|
if (status === "failed" || status === "timed_out") return "\u2717";
|
|
@@ -4829,7 +4823,7 @@ var totalTokens = (snapshot, run) => snapshot.agents.filter((agent) => run ? age
|
|
|
4829
4823
|
var totalCost = (snapshot, run) => snapshot.agents.filter((agent) => run ? agent.runId === run.id : isActiveStatus(agent.status)).reduce((sum, agent) => sum + (agent.usage?.cost ?? 0), 0);
|
|
4830
4824
|
var agentLines = (theme, agent, now) => {
|
|
4831
4825
|
const status = colorStatus(theme, agent.status, statusGlyph(agent.status));
|
|
4832
|
-
const activity = agent.currentTool ?? (agent.error ? `error: ${
|
|
4826
|
+
const activity = agent.currentTool ?? (agent.error ? `error: ${truncate3(safeText(agent.error), 48)}` : agent.text && !isActiveStatus(agent.status) ? `result: ${truncate3(safeText(agent.text), 48)}` : agent.status === "running" ? "thinking" : agent.status);
|
|
4833
4827
|
const metrics = [
|
|
4834
4828
|
agent.toolCalls !== void 0 ? `${agent.toolCalls} calls` : void 0,
|
|
4835
4829
|
agent.usage ? `${formatTokens(agent.usage.input + agent.usage.output)} tok` : void 0,
|
|
@@ -4953,10 +4947,10 @@ var FabricWidget = class {
|
|
|
4953
4947
|
if (content.length > bounded.length && bounded.length > 0) {
|
|
4954
4948
|
const marker = this.theme.fg("dim", `+${content.length - bounded.length}`);
|
|
4955
4949
|
const available = Math.max(0, width - visibleWidth2(marker) - 1);
|
|
4956
|
-
const last =
|
|
4950
|
+
const last = truncate3(bounded[bounded.length - 1] ?? "", available, "");
|
|
4957
4951
|
bounded[bounded.length - 1] = `${last} ${marker}`;
|
|
4958
4952
|
}
|
|
4959
|
-
return bounded.map((line) =>
|
|
4953
|
+
return bounded.map((line) => truncate3(line, width));
|
|
4960
4954
|
}
|
|
4961
4955
|
};
|
|
4962
4956
|
|
|
@@ -5006,8 +5000,9 @@ var FabricUiController = class {
|
|
|
5006
5000
|
#actorUnsubscribe;
|
|
5007
5001
|
#agentUnsubscribe;
|
|
5008
5002
|
#scheduledRefresh;
|
|
5009
|
-
#
|
|
5010
|
-
#
|
|
5003
|
+
#widgetUi;
|
|
5004
|
+
#dashboardHost;
|
|
5005
|
+
#dashboardView;
|
|
5011
5006
|
#widgetMounted = false;
|
|
5012
5007
|
#widget;
|
|
5013
5008
|
#lastRefreshErrorAt = 0;
|
|
@@ -5016,7 +5011,7 @@ var FabricUiController = class {
|
|
|
5016
5011
|
#conversationOpen = false;
|
|
5017
5012
|
#conversationState;
|
|
5018
5013
|
#conversationView;
|
|
5019
|
-
#
|
|
5014
|
+
#conversationHost;
|
|
5020
5015
|
#closeConversation;
|
|
5021
5016
|
#epoch = 0;
|
|
5022
5017
|
#activityRevision;
|
|
@@ -5048,7 +5043,7 @@ var FabricUiController = class {
|
|
|
5048
5043
|
this.#closeConversation = void 0;
|
|
5049
5044
|
this.#conversationView?.dispose();
|
|
5050
5045
|
this.#conversationView = void 0;
|
|
5051
|
-
this.#
|
|
5046
|
+
this.#conversationHost = void 0;
|
|
5052
5047
|
this.#conversationOpen = false;
|
|
5053
5048
|
this.#conversationState?.clear();
|
|
5054
5049
|
this.#conversationState = void 0;
|
|
@@ -5067,8 +5062,10 @@ var FabricUiController = class {
|
|
|
5067
5062
|
this.#context.ui.setWidget(WIDGET_ID, void 0);
|
|
5068
5063
|
}
|
|
5069
5064
|
this.#context = void 0;
|
|
5070
|
-
this.#
|
|
5071
|
-
this.#
|
|
5065
|
+
this.#widgetUi = void 0;
|
|
5066
|
+
this.#dashboardHost = void 0;
|
|
5067
|
+
this.#dashboardView?.dispose?.();
|
|
5068
|
+
this.#dashboardView = void 0;
|
|
5072
5069
|
this.#widgetMounted = false;
|
|
5073
5070
|
this.#events = [];
|
|
5074
5071
|
this.#meshOffset = 0;
|
|
@@ -5145,67 +5142,67 @@ var FabricUiController = class {
|
|
|
5145
5142
|
const { getAgentDir } = await import("@oh-my-pi/pi-utils");
|
|
5146
5143
|
const appearance = await readConversationAppearance(context.cwd, getAgentDir(), context.isProjectTrusted?.() ?? false);
|
|
5147
5144
|
this.#schedulePoll(true);
|
|
5148
|
-
await context.ui.custom((
|
|
5145
|
+
await context.ui.custom((ui, theme, keybindings, done) => {
|
|
5149
5146
|
if (epoch !== this.#epoch) {
|
|
5150
5147
|
done(void 0);
|
|
5151
|
-
return { render: () => []
|
|
5152
|
-
} };
|
|
5148
|
+
return { render: () => [] };
|
|
5153
5149
|
}
|
|
5154
|
-
this.#conversationTui = tui;
|
|
5155
5150
|
this.#closeConversation = () => done(void 0);
|
|
5156
|
-
const view =
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5151
|
+
const { node, view } = mountView(() => ui.size(), (host) => {
|
|
5152
|
+
this.#conversationHost = host;
|
|
5153
|
+
return new FabricConversationView(host, theme, {
|
|
5154
|
+
targets: () => conversationTargets(this.#snapshot).map((target) => {
|
|
5155
|
+
const split = target.model?.indexOf("/") ?? -1;
|
|
5156
|
+
if (split < 1 || !target.model) return target;
|
|
5157
|
+
const model = context.modelRegistry?.find?.(target.model.slice(0, split), target.model.slice(split + 1));
|
|
5158
|
+
return model && typeof model.contextWindow === "number" ? { ...target, contextWindow: model.contextWindow } : target;
|
|
5159
|
+
}),
|
|
5160
|
+
appearance,
|
|
5161
|
+
...initialTarget ? { initialTargetId: initialTarget.id } : {},
|
|
5162
|
+
state: this.#conversationState,
|
|
5163
|
+
keybindings,
|
|
5164
|
+
rendererOptions: this.conversationRenderers,
|
|
5165
|
+
queueEvents: this.state.omp?.events,
|
|
5166
|
+
transcript: (id, followLatest) => readerFor(id).read(source(id), followLatest),
|
|
5167
|
+
loadOlder: (id) => {
|
|
5168
|
+
const reader = readerFor(id);
|
|
5169
|
+
const before = reader.read(source(id), false);
|
|
5170
|
+
if (!before.hasMore) return false;
|
|
5171
|
+
const next = reader.loadOlder();
|
|
5172
|
+
return !!next && (next.revision !== before.revision || !next.hasMore);
|
|
5173
|
+
},
|
|
5174
|
+
loadNewer: (id) => {
|
|
5175
|
+
const reader = readerFor(id);
|
|
5176
|
+
const before = reader.read(source(id), false);
|
|
5177
|
+
const next = reader.loadNewer();
|
|
5178
|
+
return !!next && next.revision !== before.revision;
|
|
5179
|
+
},
|
|
5180
|
+
loadLatest: (id) => {
|
|
5181
|
+
const reader = readerFor(id);
|
|
5182
|
+
const before = reader.read(source(id), false);
|
|
5183
|
+
const next = reader.loadLatest();
|
|
5184
|
+
return !!next && next.revision !== before.revision;
|
|
5185
|
+
},
|
|
5186
|
+
send: async (id, message, delivery) => {
|
|
5187
|
+
requireTarget(id, delivery);
|
|
5188
|
+
const result = await this.state.queueUserMessage(id, message, delivery);
|
|
5189
|
+
if (epoch === this.#epoch) this.#refresh();
|
|
5190
|
+
return result;
|
|
5191
|
+
},
|
|
5192
|
+
stop: async (id) => {
|
|
5193
|
+
requireTarget(id, "stop");
|
|
5194
|
+
const result = await this.state.stopParticipant(id);
|
|
5195
|
+
if (epoch === this.#epoch) this.#refresh();
|
|
5196
|
+
return result;
|
|
5197
|
+
},
|
|
5198
|
+
close: () => done(void 0)
|
|
5199
|
+
});
|
|
5200
|
+
}, this.#viewErrorReporter(context, epoch));
|
|
5204
5201
|
this.#conversationView = view;
|
|
5205
|
-
return
|
|
5202
|
+
return node;
|
|
5206
5203
|
}, {
|
|
5207
5204
|
overlay: true,
|
|
5208
|
-
|
|
5205
|
+
fullscreen: true
|
|
5209
5206
|
});
|
|
5210
5207
|
} catch (error) {
|
|
5211
5208
|
if (epoch === this.#epoch) context.ui.notify(safeText(error instanceof Error ? error.message : String(error)), "error");
|
|
@@ -5213,13 +5210,19 @@ var FabricUiController = class {
|
|
|
5213
5210
|
if (!alreadyOpen && epoch === this.#epoch) {
|
|
5214
5211
|
this.#conversationView?.dispose();
|
|
5215
5212
|
this.#conversationView = void 0;
|
|
5216
|
-
this.#
|
|
5213
|
+
this.#conversationHost = void 0;
|
|
5217
5214
|
this.#closeConversation = void 0;
|
|
5218
5215
|
this.#conversationOpen = false;
|
|
5219
5216
|
this.#schedulePoll(true);
|
|
5220
5217
|
}
|
|
5221
5218
|
}
|
|
5222
5219
|
}
|
|
5220
|
+
#viewErrorReporter(context, epoch) {
|
|
5221
|
+
return (error) => {
|
|
5222
|
+
if (epoch !== this.#epoch) return;
|
|
5223
|
+
context.ui.notify(safeText(`Fabric view error: ${error instanceof Error ? error.message : String(error)}`), "error");
|
|
5224
|
+
};
|
|
5225
|
+
}
|
|
5223
5226
|
async openDashboard(context) {
|
|
5224
5227
|
if (this.ownsInput) return;
|
|
5225
5228
|
if (context.mode !== "tui") {
|
|
@@ -5347,57 +5350,59 @@ var FabricUiController = class {
|
|
|
5347
5350
|
};
|
|
5348
5351
|
this.#schedulePoll(true);
|
|
5349
5352
|
let conversationTarget;
|
|
5353
|
+
let dashboard;
|
|
5350
5354
|
const epoch = this.#epoch;
|
|
5351
5355
|
try {
|
|
5352
5356
|
await context.ui.custom(
|
|
5353
|
-
(
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5357
|
+
(ui, theme, keybindings, done) => {
|
|
5358
|
+
const mounted = mountView(() => ui.size(), (host) => {
|
|
5359
|
+
this.#dashboardHost = host;
|
|
5360
|
+
return new FabricDashboard(host, theme, () => this.#snapshot, () => done(void 0), {
|
|
5361
|
+
modelSource,
|
|
5362
|
+
keybindings,
|
|
5363
|
+
...this.codePreviewSettings ? { codePreviewSettings: this.codePreviewSettings } : {},
|
|
5364
|
+
...claudeModelSource ? { claudeModelSource } : {},
|
|
5365
|
+
onTargetMessage,
|
|
5366
|
+
onAgentStop,
|
|
5367
|
+
onConversation: (id) => {
|
|
5368
|
+
conversationTarget = id;
|
|
5369
|
+
done(void 0);
|
|
5370
|
+
},
|
|
5371
|
+
agentTranscript: (agent, followLatest) => this.#transcripts.read(this.#agentTranscriptSource(agent), followLatest),
|
|
5372
|
+
actorTranscript: (actor, followLatest) => this.#transcripts.read(this.#actorTranscriptSource(actor), followLatest),
|
|
5373
|
+
loadOlderTranscript: (target) => this.#transcripts.loadOlder(this.#transcriptSource(target)),
|
|
5374
|
+
loadNewerTranscript: (target) => this.#transcripts.loadNewer(this.#transcriptSource(target)),
|
|
5375
|
+
loadLatestTranscript: (target) => this.#transcripts.loadLatest(this.#transcriptSource(target)),
|
|
5376
|
+
onActorModel,
|
|
5377
|
+
onActorThinking,
|
|
5378
|
+
onActorEvents,
|
|
5379
|
+
onActorDeliveryPolicy,
|
|
5380
|
+
onGlobalDeliveryPolicy,
|
|
5381
|
+
onActorTools,
|
|
5382
|
+
actorDefaultTools: this.state.config.agents?.defaultTools ?? [],
|
|
5383
|
+
onClearMessages,
|
|
5384
|
+
onActorInstructions,
|
|
5385
|
+
onGlobalInstructions,
|
|
5386
|
+
onImportActor,
|
|
5387
|
+
onExportActor,
|
|
5388
|
+
onRemoveGlobalActor
|
|
5389
|
+
});
|
|
5390
|
+
}, this.#viewErrorReporter(context, epoch));
|
|
5391
|
+
dashboard = mounted.view;
|
|
5392
|
+
this.#dashboardView = mounted.view;
|
|
5393
|
+
return mounted.node;
|
|
5385
5394
|
},
|
|
5386
5395
|
{
|
|
5387
5396
|
overlay: true,
|
|
5388
|
-
|
|
5389
|
-
width: "94%",
|
|
5390
|
-
minWidth: 40,
|
|
5391
|
-
maxHeight: "90%",
|
|
5392
|
-
anchor: "center",
|
|
5393
|
-
margin: 1
|
|
5394
|
-
}
|
|
5397
|
+
fullscreen: true
|
|
5395
5398
|
}
|
|
5396
5399
|
);
|
|
5397
5400
|
} finally {
|
|
5401
|
+
dashboard?.dispose?.();
|
|
5402
|
+
if (this.#dashboardView === dashboard) this.#dashboardView = void 0;
|
|
5398
5403
|
if (epoch === this.#epoch) {
|
|
5399
5404
|
this.#dashboardOpen = false;
|
|
5400
|
-
this.#
|
|
5405
|
+
this.#dashboardHost = void 0;
|
|
5401
5406
|
this.#refresh();
|
|
5402
5407
|
this.#schedulePoll(true);
|
|
5403
5408
|
}
|
|
@@ -5481,9 +5486,9 @@ var FabricUiController = class {
|
|
|
5481
5486
|
this.#activityRuns
|
|
5482
5487
|
);
|
|
5483
5488
|
this.#renderWidget(context);
|
|
5484
|
-
if (this.#
|
|
5485
|
-
if (this.#
|
|
5486
|
-
else if (this.#
|
|
5489
|
+
if (this.#conversationHost) this.#conversationHost.requestRender();
|
|
5490
|
+
if (this.#dashboardHost) this.#dashboardHost.requestRender();
|
|
5491
|
+
else if (this.#widgetUi && this.#widget?.hasChanged()) this.#widgetUi.requestRender();
|
|
5487
5492
|
} catch (error) {
|
|
5488
5493
|
const now = Date.now();
|
|
5489
5494
|
if (now - this.#lastRefreshErrorAt >= 1e4) {
|
|
@@ -5510,8 +5515,8 @@ var FabricUiController = class {
|
|
|
5510
5515
|
this.#widgetMounted = true;
|
|
5511
5516
|
context.ui.setWidget(
|
|
5512
5517
|
WIDGET_ID,
|
|
5513
|
-
(
|
|
5514
|
-
this.#
|
|
5518
|
+
(ui, theme) => {
|
|
5519
|
+
this.#widgetUi = ui;
|
|
5515
5520
|
this.#widget = new FabricWidget(theme, () => this.#snapshot, config.maxRows, this.conversationShortcut);
|
|
5516
5521
|
return this.#widget;
|
|
5517
5522
|
},
|
|
@@ -5522,7 +5527,7 @@ var FabricUiController = class {
|
|
|
5522
5527
|
if (!this.#widgetMounted) return;
|
|
5523
5528
|
context.ui.setWidget(WIDGET_ID, void 0);
|
|
5524
5529
|
this.#widgetMounted = false;
|
|
5525
|
-
this.#
|
|
5530
|
+
this.#widgetUi = void 0;
|
|
5526
5531
|
this.#widget = void 0;
|
|
5527
5532
|
}
|
|
5528
5533
|
};
|