@herbertgao/pi-extensions 2026.10.10 → 2026.10.11
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/README.md +10 -8
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +126 -42
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +24 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +69 -16
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/sticky-prompt.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@herbertgao/sol-pi/README.md +7 -1
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +28 -4
- package/node_modules/@herbertgao/sol-pi/docs/configuration.md +17 -4
- package/node_modules/@herbertgao/sol-pi/package.json +1 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +35 -25
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +95 -26
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/candidate.ts +39 -2
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/index.ts +24 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/index.ts +12 -7
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +138 -130
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/projection.ts +88 -14
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +9 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/index.ts +14 -5
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/shell-options.ts +22 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/tui.ts +11 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/answer-channel.ts +109 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +117 -71
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +2 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/startup-performance.md +83 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/tool-schema.md +74 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/events.ts +84 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/index.ts +10 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +4 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/reconcile.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/rpc-fallback.ts +5 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +19 -19
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/i18n-bridge.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +10 -10
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/row-intent.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/contract.ts +6 -6
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/derivations.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/focus.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/projections.ts +9 -9
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +5 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/external-answer.ts +125 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/format-answer.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/normalize-params.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/response-envelope.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/types.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/validate-questionnaire.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/component-binding.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/option-list-view.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/markdown-content-cache.ts +3 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +5 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-layout-decider.ts +3 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts +10 -10
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/submit-picker.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/tab-bar.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/wrapping-select.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +9 -9
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/props-adapter.ts +8 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-components.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +10 -10
- package/node_modules/@narumitw/pi-btw/dist/index.ts +3 -0
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-btw/package.json +4 -4
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +6 -0
- package/node_modules/@narumitw/pi-btw/src/keybindings.ts +1 -1
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +1 -0
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +1 -0
- package/node_modules/pi-antigravity/README.md +6 -2
- package/node_modules/pi-antigravity/package.json +2 -2
- package/node_modules/pi-antigravity/src/client/client.ts +44 -52
- package/node_modules/pi-antigravity/src/index.ts +13 -0
- package/node_modules/pi-antigravity/src/models/discovery.ts +25 -2
- package/node_modules/pi-antigravity/src/models/grouping.ts +107 -68
- package/node_modules/pi-antigravity/src/models/models.ts +10 -0
- package/node_modules/pi-antigravity/src/search/search.ts +581 -43
- package/node_modules/pi-antigravity/src/stream/stream.ts +53 -13
- package/node_modules/pi-antigravity/src/types/types.ts +13 -0
- package/node_modules/pi-antigravity/src/usage/usage.ts +11 -3
- package/node_modules/pi-web-access/CHANGELOG.md +21 -0
- package/node_modules/pi-web-access/README.md +22 -7
- package/node_modules/pi-web-access/credential-source.ts +54 -4
- package/node_modules/pi-web-access/curator-page.ts +3 -1
- package/node_modules/pi-web-access/curator-server.ts +1 -0
- package/node_modules/pi-web-access/deepseek.ts +204 -0
- package/node_modules/pi-web-access/dist/index.js +927 -642
- package/node_modules/pi-web-access/dist/mcp-cli.js +877 -615
- package/node_modules/pi-web-access/gemini-adc.ts +48 -1
- package/node_modules/pi-web-access/gemini-search.ts +8 -4
- package/node_modules/pi-web-access/index.ts +16 -1
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/page-query.ts +12 -6
- package/node_modules/pi-web-access/query-rewrite.ts +16 -13
- package/node_modules/pi-web-access/summary-review.ts +16 -6
- package/node_modules/pi-web-access/utils.ts +3 -0
- package/node_modules/pi-web-access/web-tool-core.ts +2 -0
- package/package.json +9 -9
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { AskUserAnswerRejectCode } from "../events.ts";
|
|
2
|
+
import type { QuestionAnswer, QuestionData, QuestionnaireResult } from "./types.ts";
|
|
3
|
+
|
|
4
|
+
export type ExternalAnswerOutcome =
|
|
5
|
+
| { ok: true; result: QuestionnaireResult }
|
|
6
|
+
| { ok: false; code: AskUserAnswerRejectCode; reason: string };
|
|
7
|
+
|
|
8
|
+
const reject = (code: AskUserAnswerRejectCode, reason: string): ExternalAnswerOutcome => ({ ok: false, code, reason });
|
|
9
|
+
|
|
10
|
+
const isRecord = (v: unknown): v is Record<string, unknown> => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
11
|
+
|
|
12
|
+
/** A note as the TUI stores it: trimmed, and absent when blank (`notesExitHandler`). */
|
|
13
|
+
function noteOf(v: string | undefined): string | undefined {
|
|
14
|
+
const trimmed = v?.trim();
|
|
15
|
+
return trimmed ? trimmed : undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Turn an inbound `rpiv:ask-user:answer` payload (`AskUserAnswerEventPayload`, still
|
|
20
|
+
* untrusted) into the `QuestionnaireResult` the dialog would have produced. Pure of
|
|
21
|
+
* `(questions, payload)`. Answers are shaped as the reducer shapes them — preview
|
|
22
|
+
* attached to a picked single-select option, multi-select labels in authored order
|
|
23
|
+
* with custom text in `answer`, notes trimmed — so the envelope and `details` are the
|
|
24
|
+
* same whether the user typed or a program answered.
|
|
25
|
+
*
|
|
26
|
+
* Strict by design: the contract can be relaxed later without breaking emitters,
|
|
27
|
+
* never tightened. `invalid_payload` is a wrong shape or type, `invalid_answer` a
|
|
28
|
+
* well-formed answer that does not fit these questions.
|
|
29
|
+
*/
|
|
30
|
+
export function resolveExternalAnswer(
|
|
31
|
+
questions: readonly QuestionData[],
|
|
32
|
+
payload: Record<string, unknown>,
|
|
33
|
+
): ExternalAnswerOutcome {
|
|
34
|
+
const { answers, globalNote, cancel } = payload;
|
|
35
|
+
if (cancel !== undefined && typeof cancel !== "boolean")
|
|
36
|
+
return reject("invalid_payload", "cancel must be a boolean");
|
|
37
|
+
if (globalNote !== undefined && typeof globalNote !== "string") {
|
|
38
|
+
return reject("invalid_payload", "globalNote must be a string");
|
|
39
|
+
}
|
|
40
|
+
const note = noteOf(globalNote);
|
|
41
|
+
const withNote = note ? { globalNote: note } : {};
|
|
42
|
+
|
|
43
|
+
if (cancel === true) {
|
|
44
|
+
if (answers !== undefined && !(Array.isArray(answers) && answers.length === 0)) {
|
|
45
|
+
return reject("invalid_payload", "cancel takes no answers");
|
|
46
|
+
}
|
|
47
|
+
return { ok: true, result: { answers: [], cancelled: true, ...withNote } };
|
|
48
|
+
}
|
|
49
|
+
if (!Array.isArray(answers)) return reject("invalid_payload", "answers must be an array");
|
|
50
|
+
|
|
51
|
+
const byQuestion = new Map<number, Record<string, unknown>>();
|
|
52
|
+
for (const entry of answers) {
|
|
53
|
+
if (!isRecord(entry)) return reject("invalid_payload", "each answer must be an object");
|
|
54
|
+
const index = entry.questionIndex;
|
|
55
|
+
if (!Number.isInteger(index)) return reject("invalid_payload", "questionIndex must be an integer");
|
|
56
|
+
const i = index as number;
|
|
57
|
+
if (i < 0 || i >= questions.length) {
|
|
58
|
+
return reject("invalid_answer", `questionIndex ${i} out of range (0..${questions.length - 1})`);
|
|
59
|
+
}
|
|
60
|
+
if (byQuestion.has(i)) return reject("invalid_answer", `question ${i} answered twice`);
|
|
61
|
+
byQuestion.set(i, entry);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const resolved: QuestionAnswer[] = [];
|
|
65
|
+
for (let i = 0; i < questions.length; i++) {
|
|
66
|
+
const entry = byQuestion.get(i);
|
|
67
|
+
if (!entry) return reject("invalid_answer", `no answer for question ${i} ("${questions[i]!.header}")`);
|
|
68
|
+
const answer = resolveEntry(questions[i]!, i, entry);
|
|
69
|
+
if (!answer.ok) return answer;
|
|
70
|
+
resolved.push(answer.answer);
|
|
71
|
+
}
|
|
72
|
+
return { ok: true, result: { answers: resolved, cancelled: false, ...withNote } };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function resolveEntry(
|
|
76
|
+
q: QuestionData,
|
|
77
|
+
i: number,
|
|
78
|
+
entry: Record<string, unknown>,
|
|
79
|
+
): { ok: true; answer: QuestionAnswer } | Extract<ExternalAnswerOutcome, { ok: false }> {
|
|
80
|
+
const { optionIndexes, text, notes } = entry;
|
|
81
|
+
if (optionIndexes !== undefined && (!Array.isArray(optionIndexes) || !optionIndexes.every(Number.isInteger))) {
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
code: "invalid_payload",
|
|
85
|
+
reason: `question ${i}: optionIndexes must be an array of integers`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (text !== undefined && typeof text !== "string") {
|
|
89
|
+
return { ok: false, code: "invalid_payload", reason: `question ${i}: text must be a string` };
|
|
90
|
+
}
|
|
91
|
+
if (notes !== undefined && typeof notes !== "string") {
|
|
92
|
+
return { ok: false, code: "invalid_payload", reason: `question ${i}: notes must be a string` };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const invalid = (reason: string) => ({
|
|
96
|
+
ok: false as const,
|
|
97
|
+
code: "invalid_answer" as const,
|
|
98
|
+
reason: `question ${i}: ${reason}`,
|
|
99
|
+
});
|
|
100
|
+
const picked = (optionIndexes ?? []) as number[];
|
|
101
|
+
const out = picked.find((n) => n < 0 || n >= q.options.length);
|
|
102
|
+
if (out !== undefined) return invalid(`option index ${out} out of range (0..${q.options.length - 1})`);
|
|
103
|
+
if (new Set(picked).size !== picked.length) return invalid("option index repeated");
|
|
104
|
+
if (text !== undefined && text.trim().length === 0) return invalid("text is blank");
|
|
105
|
+
if (picked.length === 0 && text === undefined) return invalid("needs optionIndexes or text");
|
|
106
|
+
|
|
107
|
+
const base = { questionIndex: i, question: q.question };
|
|
108
|
+
const note = noteOf(notes as string | undefined);
|
|
109
|
+
const withNote = note ? { notes: note } : {};
|
|
110
|
+
|
|
111
|
+
if (q.multiSelect) {
|
|
112
|
+
const selected = q.options.filter((_o, n) => picked.includes(n)).map((o) => o.label);
|
|
113
|
+
return {
|
|
114
|
+
ok: true,
|
|
115
|
+
answer: { ...base, kind: "multi", answer: (text as string | undefined) ?? null, selected, ...withNote },
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (picked.length > 0 && text !== undefined) return invalid("single-select takes optionIndexes or text, not both");
|
|
119
|
+
if (picked.length > 1) return invalid(`single-select takes one option, got ${picked.length}`);
|
|
120
|
+
if (text !== undefined)
|
|
121
|
+
return { ok: true, answer: { ...base, kind: "custom", answer: text as string, ...withNote } };
|
|
122
|
+
const option = q.options[picked[0]!]!;
|
|
123
|
+
const withPreview = option.preview && option.preview.length > 0 ? { preview: option.preview } : {};
|
|
124
|
+
return { ok: true, answer: { ...base, kind: "option", answer: option.label, ...withPreview, ...withNote } };
|
|
125
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { formatAnswerScalar } from "./format-answer.
|
|
2
|
-
import type { QuestionAnswer, QuestionnaireResult, QuestionParams } from "./types.
|
|
1
|
+
import { formatAnswerScalar } from "./format-answer.ts";
|
|
2
|
+
import type { QuestionAnswer, QuestionnaireResult, QuestionParams } from "./types.ts";
|
|
3
3
|
|
|
4
4
|
export const DECLINE_MESSAGE = "User declined to answer questions";
|
|
5
5
|
export const ENVELOPE_PREFIX = "User has answered your questions:";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MAX_QUESTIONS, MIN_OPTIONS, type QuestionnaireError, type QuestionParams, RESERVED_LABELS } from "./types.
|
|
1
|
+
import { MAX_QUESTIONS, MIN_OPTIONS, type QuestionnaireError, type QuestionParams, RESERVED_LABELS } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
export const ERROR_NO_QUESTIONS = "Error: At least one question is required";
|
|
4
4
|
export const ERROR_TOO_MANY_QUESTIONS = `Error: At most ${MAX_QUESTIONS} questions are allowed per invocation`;
|
|
@@ -3,10 +3,10 @@ import type {
|
|
|
3
3
|
GlobalSelector,
|
|
4
4
|
PerTabBindingContext,
|
|
5
5
|
PerTabSelector,
|
|
6
|
-
} from "../state/selectors/contract.
|
|
7
|
-
import type { QuestionnaireState } from "../state/state.
|
|
8
|
-
import type { StatefulView } from "./stateful-view.
|
|
9
|
-
import type { TabComponents } from "./tab-components.
|
|
6
|
+
} from "../state/selectors/contract.ts";
|
|
7
|
+
import type { QuestionnaireState } from "../state/state.ts";
|
|
8
|
+
import type { StatefulView } from "./stateful-view.ts";
|
|
9
|
+
import type { TabComponents } from "./tab-components.ts";
|
|
10
10
|
|
|
11
11
|
export interface ComponentBinding<P> {
|
|
12
12
|
readonly component: StatefulView<P>;
|
package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
3
|
-
import { displayLabel } from "../../state/i18n-bridge.
|
|
4
|
-
import type { QuestionData } from "../../tool/types.
|
|
5
|
-
import type { StatefulView } from "../stateful-view.
|
|
6
|
-
import { renderInlineInputRow } from "./inline-input.
|
|
3
|
+
import { displayLabel } from "../../state/i18n-bridge.ts";
|
|
4
|
+
import type { QuestionData } from "../../tool/types.ts";
|
|
5
|
+
import type { StatefulView } from "../stateful-view.ts";
|
|
6
|
+
import { renderInlineInputRow } from "./inline-input.ts";
|
|
7
7
|
|
|
8
8
|
const ACTIVE_POINTER = "❯ ";
|
|
9
9
|
const INACTIVE_POINTER = " ";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StatefulView } from "../stateful-view.
|
|
2
|
-
import { WrappingSelect, type WrappingSelectItem, type WrappingSelectTheme } from "./wrapping-select.
|
|
1
|
+
import type { StatefulView } from "../stateful-view.ts";
|
|
2
|
+
import { WrappingSelect, type WrappingSelectItem, type WrappingSelectTheme } from "./wrapping-select.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Maximum number of option rows visible in the WrappingSelect window. Lifted here from
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { Markdown, type MarkdownTheme, visibleWidth } from "@earendil-works/pi-tui";
|
|
3
|
-
import { t } from "../../../state/i18n-bridge.
|
|
4
|
-
import type { QuestionData } from "../../../tool/types.
|
|
5
|
-
import { stripFenceMarkers } from "./preview-box-renderer.
|
|
3
|
+
import { t } from "../../../state/i18n-bridge.ts";
|
|
4
|
+
import type { QuestionData } from "../../../tool/types.ts";
|
|
5
|
+
import { stripFenceMarkers } from "./preview-box-renderer.ts";
|
|
6
6
|
|
|
7
7
|
/** CC parity in side-by-side layout. */
|
|
8
8
|
export const MAX_PREVIEW_HEIGHT_SIDE_BY_SIDE = 20;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import type { MarkdownTheme } from "@earendil-works/pi-tui";
|
|
3
|
-
import { t } from "../../../state/i18n-bridge.
|
|
4
|
-
import type { QuestionData } from "../../../tool/types.
|
|
3
|
+
import { t } from "../../../state/i18n-bridge.ts";
|
|
4
|
+
import type { QuestionData } from "../../../tool/types.ts";
|
|
5
5
|
import {
|
|
6
6
|
MAX_PREVIEW_HEIGHT_SIDE_BY_SIDE,
|
|
7
7
|
MAX_PREVIEW_HEIGHT_STACKED,
|
|
8
8
|
MarkdownContentCache,
|
|
9
9
|
NOTES_AFFORDANCE_OVERHEAD,
|
|
10
|
-
} from "./markdown-content-cache.
|
|
10
|
+
} from "./markdown-content-cache.ts";
|
|
11
11
|
import {
|
|
12
12
|
BORDER_HORIZONTAL_OVERHEAD,
|
|
13
13
|
BORDER_INNER_PADDING_HORIZONTAL,
|
|
14
14
|
BORDER_VERTICAL_OVERHEAD,
|
|
15
15
|
computeBoxDimensions,
|
|
16
16
|
renderBorderedBox,
|
|
17
|
-
} from "./preview-box-renderer.
|
|
18
|
-
import type { PreviewLayoutMode } from "./preview-layout-decider.
|
|
17
|
+
} from "./preview-box-renderer.ts";
|
|
18
|
+
import type { PreviewLayoutMode } from "./preview-layout-decider.ts";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Affordance text shown below the bordered preview when focused on a preview-bearing option.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
2
|
-
import type { QuestionData } from "../../../tool/types.
|
|
3
|
-
import type { WrappingSelectItem } from "../wrapping-select.
|
|
4
|
-
import { BORDER_HORIZONTAL_OVERHEAD, BORDER_INNER_PADDING_HORIZONTAL } from "./preview-box-renderer.
|
|
2
|
+
import type { QuestionData } from "../../../tool/types.ts";
|
|
3
|
+
import type { WrappingSelectItem } from "../wrapping-select.ts";
|
|
4
|
+
import { BORDER_HORIZONTAL_OVERHEAD, BORDER_INNER_PADDING_HORIZONTAL } from "./preview-box-renderer.ts";
|
|
5
5
|
|
|
6
6
|
/** Min terminal/pane width for the side-by-side layout to engage. */
|
|
7
7
|
export const PREVIEW_MIN_WIDTH = 100;
|
package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { type Component, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
3
|
-
import type { QuestionData } from "../../../tool/types.
|
|
4
|
-
import { windowLines } from "../../scroll-window.
|
|
5
|
-
import type { StatefulView } from "../../stateful-view.
|
|
6
|
-
import type { OptionListView } from "../option-list-view.
|
|
7
|
-
import type { NotesAffordance, PreviewBlockRenderer } from "./preview-block-renderer.
|
|
3
|
+
import type { QuestionData } from "../../../tool/types.ts";
|
|
4
|
+
import { windowLines } from "../../scroll-window.ts";
|
|
5
|
+
import type { StatefulView } from "../../stateful-view.ts";
|
|
6
|
+
import type { OptionListView } from "../option-list-view.ts";
|
|
7
|
+
import type { NotesAffordance, PreviewBlockRenderer } from "./preview-block-renderer.ts";
|
|
8
8
|
import {
|
|
9
9
|
bodyWidths,
|
|
10
10
|
columnWidths,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
PREVIEW_PADDING_LEFT,
|
|
13
13
|
type PreviewLayoutMode,
|
|
14
14
|
STACKED_GAP_ROWS,
|
|
15
|
-
} from "./preview-layout-decider.
|
|
15
|
+
} from "./preview-layout-decider.ts";
|
|
16
16
|
|
|
17
17
|
/** Smallest preview box worth showing: top border, one content line, bottom border. */
|
|
18
18
|
const MIN_BOX_ROWS = 3;
|
|
@@ -23,8 +23,8 @@ export {
|
|
|
23
23
|
MAX_PREVIEW_HEIGHT_STACKED,
|
|
24
24
|
NO_PREVIEW_TEXT,
|
|
25
25
|
NOTES_AFFORDANCE_OVERHEAD,
|
|
26
|
-
} from "./markdown-content-cache.
|
|
27
|
-
export { NOTES_AFFORDANCE_TEXT, NOTES_EDIT_AFFORDANCE_TEXT, PreviewBlockRenderer } from "./preview-block-renderer.
|
|
26
|
+
} from "./markdown-content-cache.ts";
|
|
27
|
+
export { NOTES_AFFORDANCE_TEXT, NOTES_EDIT_AFFORDANCE_TEXT, PreviewBlockRenderer } from "./preview-block-renderer.ts";
|
|
28
28
|
export {
|
|
29
29
|
BORDER_HORIZONTAL_OVERHEAD,
|
|
30
30
|
BORDER_INNER_PADDING_HORIZONTAL,
|
|
@@ -32,13 +32,13 @@ export {
|
|
|
32
32
|
BOX_MIN_CONTENT_WIDTH,
|
|
33
33
|
renderBorderedBox,
|
|
34
34
|
stripFenceMarkers,
|
|
35
|
-
} from "./preview-box-renderer.
|
|
35
|
+
} from "./preview-box-renderer.ts";
|
|
36
36
|
export {
|
|
37
37
|
PREVIEW_COLUMN_GAP,
|
|
38
38
|
PREVIEW_MIN_WIDTH,
|
|
39
39
|
PREVIEW_PADDING_LEFT,
|
|
40
40
|
STACKED_GAP_ROWS,
|
|
41
|
-
} from "./preview-layout-decider.
|
|
41
|
+
} from "./preview-layout-decider.ts";
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Per-tick projection of PreviewPane state. Replaces the prior
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
3
|
-
import { t } from "../../state/i18n-bridge.
|
|
4
|
-
import type { StatefulView } from "../stateful-view.
|
|
3
|
+
import { t } from "../../state/i18n-bridge.ts";
|
|
4
|
+
import type { StatefulView } from "../stateful-view.ts";
|
|
5
5
|
|
|
6
6
|
const ACTIVE_POINTER = "❯ ";
|
|
7
7
|
const INACTIVE_POINTER = " ";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
3
|
-
import type { StatefulView } from "../stateful-view.
|
|
3
|
+
import type { StatefulView } from "../stateful-view.ts";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Per-tick projection of TabBar state. The selector
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Component } from "@earendil-works/pi-tui";
|
|
2
2
|
import { visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
3
|
-
import { renderInlineInputRow } from "./inline-input.
|
|
3
|
+
import { renderInlineInputRow } from "./inline-input.ts";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Row-intent discriminated union. `kind` is the single discriminator —
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { DynamicBorder, type Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { type Component, Container, type Editor, Spacer } from "@earendil-works/pi-tui";
|
|
3
|
-
import type { QuestionnaireState } from "../state/state.
|
|
4
|
-
import type { QuestionData } from "../tool/types.
|
|
5
|
-
import type { PreviewPaneProps } from "./components/preview/preview-pane.
|
|
6
|
-
import type { TabBar } from "./components/tab-bar.
|
|
7
|
-
import { computeScrollStart, decorateOverflow } from "./scroll-window.
|
|
8
|
-
import type { StatefulView } from "./stateful-view.
|
|
9
|
-
import type { TabComponents } from "./tab-components.
|
|
10
|
-
import { QuestionTabStrategy, SubmitTabStrategy, type TabContentStrategy } from "./tab-content-strategy.
|
|
3
|
+
import type { QuestionnaireState } from "../state/state.ts";
|
|
4
|
+
import type { QuestionData } from "../tool/types.ts";
|
|
5
|
+
import type { PreviewPaneProps } from "./components/preview/preview-pane.ts";
|
|
6
|
+
import type { TabBar } from "./components/tab-bar.ts";
|
|
7
|
+
import { computeScrollStart, decorateOverflow } from "./scroll-window.ts";
|
|
8
|
+
import type { StatefulView } from "./stateful-view.ts";
|
|
9
|
+
import type { TabComponents } from "./tab-components.ts";
|
|
10
|
+
import { QuestionTabStrategy, SubmitTabStrategy, type TabContentStrategy } from "./tab-content-strategy.ts";
|
|
11
11
|
|
|
12
12
|
export {
|
|
13
13
|
COLLAPSED_HINT_TEMPLATE,
|
|
@@ -28,7 +28,7 @@ export {
|
|
|
28
28
|
KEY_PLACEHOLDER,
|
|
29
29
|
READY_PROMPT,
|
|
30
30
|
REVIEW_HEADING,
|
|
31
|
-
} from "./dialog-copy.
|
|
31
|
+
} from "./dialog-copy.ts";
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Rows the scroll window must keep for the body before the heading (header badge +
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_COLLAPSE_KEY, formatKeySpecForDisplay } from "../config.
|
|
1
|
+
import { DEFAULT_COLLAPSE_KEY, formatKeySpecForDisplay } from "../config.ts";
|
|
2
2
|
|
|
3
3
|
/** Leaf: imports nothing from `view/`, so `dialog-builder` and `tab-content-strategy` never form a runtime cycle (#208). */
|
|
4
4
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Editor } from "@earendil-works/pi-tui";
|
|
2
|
-
import type { BindingContext, PerTabBindingContext } from "../state/selectors/contract.
|
|
3
|
-
import { selectActivePreviewPaneIndex } from "../state/selectors/derivations.
|
|
4
|
-
import { selectActiveView } from "../state/selectors/focus.
|
|
5
|
-
import type { QuestionnaireState } from "../state/state.
|
|
6
|
-
import type { QuestionData } from "../tool/types.
|
|
7
|
-
import type { BoundGlobalBinding, BoundPerTabBinding } from "./component-binding.
|
|
8
|
-
import type { WrappingSelectItem } from "./components/wrapping-select.
|
|
9
|
-
import type { TabComponents } from "./tab-components.
|
|
2
|
+
import type { BindingContext, PerTabBindingContext } from "../state/selectors/contract.ts";
|
|
3
|
+
import { selectActivePreviewPaneIndex } from "../state/selectors/derivations.ts";
|
|
4
|
+
import { selectActiveView } from "../state/selectors/focus.ts";
|
|
5
|
+
import type { QuestionnaireState } from "../state/state.ts";
|
|
6
|
+
import type { QuestionData } from "../tool/types.ts";
|
|
7
|
+
import type { BoundGlobalBinding, BoundPerTabBinding } from "./component-binding.ts";
|
|
8
|
+
import type { WrappingSelectItem } from "./components/wrapping-select.ts";
|
|
9
|
+
import type { TabComponents } from "./tab-components.ts";
|
|
10
10
|
|
|
11
11
|
/** Cache-invalidation contract used by the adapter. `pi-tui` `Component` already satisfies it. */
|
|
12
12
|
interface Invalidatable {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { MultiSelectView } from "./components/multi-select-view.
|
|
2
|
-
import type { OptionListViewProps } from "./components/option-list-view.
|
|
3
|
-
import type { PreviewPane } from "./components/preview/preview-pane.
|
|
4
|
-
import type { StatefulView } from "./stateful-view.
|
|
1
|
+
import type { MultiSelectView } from "./components/multi-select-view.ts";
|
|
2
|
+
import type { OptionListViewProps } from "./components/option-list-view.ts";
|
|
3
|
+
import type { PreviewPane } from "./components/preview/preview-pane.ts";
|
|
4
|
+
import type { StatefulView } from "./stateful-view.ts";
|
|
5
5
|
|
|
6
6
|
export interface TabBodyHeights {
|
|
7
7
|
current: number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { type Component, Container, type Editor, Spacer, Text, truncateToWidth } from "@earendil-works/pi-tui";
|
|
3
|
-
import { COLLAPSE_KEY_OFF, formatKeySpecForDisplay } from "../config.
|
|
4
|
-
import { t } from "../state/i18n-bridge.
|
|
5
|
-
import { selectSavedNote } from "../state/selectors/derivations.
|
|
6
|
-
import { formatAnswerScalar } from "../tool/format-answer.
|
|
7
|
-
import type { QuestionData } from "../tool/types.
|
|
8
|
-
import type { PreviewPane, PreviewPaneProps } from "./components/preview/preview-pane.
|
|
9
|
-
import type { DialogState } from "./dialog-builder.
|
|
3
|
+
import { COLLAPSE_KEY_OFF, formatKeySpecForDisplay } from "../config.ts";
|
|
4
|
+
import { t } from "../state/i18n-bridge.ts";
|
|
5
|
+
import { selectSavedNote } from "../state/selectors/derivations.ts";
|
|
6
|
+
import { formatAnswerScalar } from "../tool/format-answer.ts";
|
|
7
|
+
import type { QuestionData } from "../tool/types.ts";
|
|
8
|
+
import type { PreviewPane, PreviewPaneProps } from "./components/preview/preview-pane.ts";
|
|
9
|
+
import type { DialogState } from "./dialog-builder.ts";
|
|
10
10
|
import {
|
|
11
11
|
HINT_PART_CANCEL,
|
|
12
12
|
HINT_PART_CLEAR,
|
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
KEY_PLACEHOLDER,
|
|
22
22
|
READY_PROMPT,
|
|
23
23
|
REVIEW_HEADING,
|
|
24
|
-
} from "./dialog-copy.
|
|
25
|
-
import type { StatefulView } from "./stateful-view.
|
|
26
|
-
import type { TabComponents } from "./tab-components.
|
|
24
|
+
} from "./dialog-copy.ts";
|
|
25
|
+
import type { StatefulView } from "./stateful-view.ts";
|
|
26
|
+
import type { TabComponents } from "./tab-components.ts";
|
|
27
27
|
|
|
28
28
|
const NOTES_HEADER = "Notes:";
|
|
29
29
|
const GLOBAL_NOTES_HEADER = "Global note:";
|
|
@@ -1733,6 +1733,9 @@ function normalizedKeyId(key) {
|
|
|
1733
1733
|
const parts = key.toLowerCase().split("+");
|
|
1734
1734
|
const base = parts.at(-1);
|
|
1735
1735
|
if (!base) return "";
|
|
1736
|
+
const configuredModifiers = parts.slice(0, -1);
|
|
1737
|
+
if (new Set(configuredModifiers).size !== configuredModifiers.length || configuredModifiers.some((modifier) => !KEY_MODIFIER_ORDER.includes(modifier)))
|
|
1738
|
+
return "";
|
|
1736
1739
|
const normalizedBase = base === "esc" ? "escape" : base === "return" ? "enter" : base;
|
|
1737
1740
|
const modifiers = KEY_MODIFIER_ORDER.filter((modifier) => parts.includes(modifier));
|
|
1738
1741
|
return [...modifiers, normalizedBase].join("+");
|