@sayknow-cli/coding-agent 0.3.12 → 0.3.15
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/dist/types/autoresearch/tools/init-experiment.d.ts +1 -1
- package/dist/types/autoresearch/tools/log-experiment.d.ts +2 -2
- package/dist/types/cli/classify-install-target.d.ts +0 -10
- package/dist/types/cli/daemon-cli.d.ts +2 -0
- package/dist/types/cli/initial-message.d.ts +1 -1
- package/dist/types/cli/malloc-env-guard.d.ts +65 -0
- package/dist/types/cli/malloc-env-guard.test.d.ts +1 -0
- package/dist/types/cli/notify-cli.d.ts +3 -1
- package/dist/types/cli/session-picker.d.ts +4 -3
- package/dist/types/cli/update-cli.d.ts +22 -3
- package/dist/types/cli.d.ts +5 -0
- package/dist/types/commands/daemon.d.ts +6 -2
- package/dist/types/commands/launch.d.ts +1 -0
- package/dist/types/commands/notify.d.ts +6 -0
- package/dist/types/commands/web-search.d.ts +1 -1
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +4 -4
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +9 -9
- package/dist/types/commit/agentic/tools/schemas.d.ts +9 -9
- package/dist/types/commit/agentic/tools/split-commit.d.ts +9 -9
- package/dist/types/commit/analysis/conventional.d.ts +1 -1
- package/dist/types/commit/analysis/summary.d.ts +1 -1
- package/dist/types/commit/changelog/generate.d.ts +3 -3
- package/dist/types/commit/changelog/index.d.ts +2 -2
- package/dist/types/commit/map-reduce/map-phase.d.ts +1 -1
- package/dist/types/commit/map-reduce/reduce-phase.d.ts +1 -1
- package/dist/types/commit/shared-llm.d.ts +9 -9
- package/dist/types/config/keybindings.d.ts +134 -129
- package/dist/types/config/model-profile-activation.d.ts +1 -0
- package/dist/types/config/model-registry.d.ts +35 -35
- package/dist/types/config/models-config-schema.d.ts +111 -111
- package/dist/types/config/settings-schema.d.ts +56 -16
- package/dist/types/config/settings.d.ts +2 -0
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/coordinator-mcp/model-preset.d.ts +45 -0
- package/dist/types/coordinator-mcp/policy.d.ts +3 -0
- package/dist/types/coordinator-mcp/server.d.ts +79 -6
- package/dist/types/coordinator-mcp/session-reaper.d.ts +53 -0
- package/dist/types/daemon/control-types.d.ts +10 -0
- package/dist/types/daemon/operator-contract.d.ts +47 -0
- package/dist/types/defaults/skc/extensions/grok-cli-vendor/src/models/catalog.d.ts +4 -0
- package/dist/types/defaults/skc/extensions/grok-cli-vendor/src/shared/errors.d.ts +12 -12
- package/dist/types/discovery/helpers.d.ts +1 -1
- package/dist/types/discovery/substitute-plugin-root.d.ts +0 -4
- package/dist/types/edit/modes/patch.d.ts +2 -2
- package/dist/types/extensibility/extensions/types.d.ts +3 -1
- package/dist/types/goals/tools/goal-tool.d.ts +6 -6
- package/dist/types/i18n/messages/en.d.ts +8 -8
- package/dist/types/internal-urls/local-protocol.d.ts +13 -9
- package/dist/types/lsp/index.d.ts +9 -9
- package/dist/types/lsp/types.d.ts +9 -9
- package/dist/types/main.d.ts +66 -2
- package/dist/types/modes/acp/acp-agent.d.ts +19 -2
- package/dist/types/modes/acp/acp-mode.d.ts +12 -0
- package/dist/types/modes/components/assistant-message.d.ts +1 -1
- package/dist/types/modes/components/custom-editor.d.ts +2 -0
- package/dist/types/modes/components/hook-selector.d.ts +5 -0
- package/dist/types/modes/components/irc-sidebar.d.ts +32 -0
- package/dist/types/modes/components/pet-selector.d.ts +11 -0
- package/dist/types/modes/components/sayknow-pet-widget.d.ts +59 -0
- package/dist/types/modes/components/session-selector.d.ts +22 -9
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/status-line/types.d.ts +1 -1
- package/dist/types/modes/components/status-line.d.ts +0 -10
- package/dist/types/modes/components/tool-execution.d.ts +1 -0
- package/dist/types/modes/components/user-message.d.ts +2 -1
- package/dist/types/modes/controllers/event-controller.d.ts +4 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +24 -2
- package/dist/types/modes/irc-observation-ledger.d.ts +22 -0
- package/dist/types/modes/print-mode.d.ts +3 -4
- package/dist/types/modes/rpc/rpc-client.d.ts +7 -1
- package/dist/types/modes/rpc/rpc-mode.d.ts +2 -1
- package/dist/types/modes/rpc/rpc-types.d.ts +17 -1
- package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +8 -0
- package/dist/types/modes/shared/agent-wire/unattended-run-controller.d.ts +5 -0
- package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +45 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +42 -2
- package/dist/types/modes/theme/defaults/index.d.ts +568 -568
- package/dist/types/modes/types.d.ts +28 -2
- package/dist/types/modes/utils/abort-message.d.ts +1 -1
- package/dist/types/modes/utils/context-usage.d.ts +4 -19
- package/dist/types/modes/utils/irc-message.d.ts +38 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +13 -4
- package/dist/types/notifications/config.d.ts +34 -0
- package/dist/types/notifications/daemon-paths.d.ts +7 -0
- package/dist/types/notifications/index.d.ts +27 -0
- package/dist/types/notifications/lifecycle-control-runtime.d.ts +12 -4
- package/dist/types/notifications/notification-service.d.ts +144 -0
- package/dist/types/notifications/rate-limit-pool.d.ts +27 -9
- package/dist/types/notifications/telegram-daemon-control.d.ts +6 -0
- package/dist/types/notifications/telegram-daemon.d.ts +130 -3
- package/dist/types/notifications/telegram-reference.d.ts +19 -2
- package/dist/types/notifications/topic-registry.d.ts +24 -4
- package/dist/types/registry/agent-registry.d.ts +2 -0
- package/dist/types/rlm/index.d.ts +1 -1
- package/dist/types/sdk.d.ts +2 -0
- package/dist/types/secrets/obfuscator.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +40 -3
- package/dist/types/session/cache-economics.d.ts +79 -0
- package/dist/types/session/context-estimation.d.ts +31 -0
- package/dist/types/session/provider-safety-stop.d.ts +5 -0
- package/dist/types/session/session-manager.d.ts +124 -4
- package/dist/types/session/session-storage.d.ts +155 -13
- package/dist/types/setup/credential-auto-import.d.ts +2 -2
- package/dist/types/skc-runtime/session-state-sidecar.d.ts +34 -3
- package/dist/types/skc-runtime/state-schema.d.ts +19 -19
- package/dist/types/skc-runtime/tmux-common.d.ts +6 -0
- package/dist/types/skc-runtime/tmux-owner-isolation-cli.d.ts +5 -0
- package/dist/types/skc-runtime/tmux-owner-isolation.d.ts +309 -0
- package/dist/types/skc-runtime/tmux-sessions.d.ts +49 -17
- package/dist/types/task/agents.d.ts +2 -2
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/task/receipt.d.ts +3 -1
- package/dist/types/task/types.d.ts +35 -27
- package/dist/types/tools/ask-answer-registry.d.ts +5 -0
- package/dist/types/tools/bash.d.ts +1 -1
- package/dist/types/tools/browser/tab-supervisor.d.ts +6 -0
- package/dist/types/tools/browser.d.ts +28 -28
- package/dist/types/tools/computer.d.ts +20 -20
- package/dist/types/tools/cron.d.ts +2 -2
- package/dist/types/tools/debug.d.ts +40 -40
- package/dist/types/tools/gh.d.ts +10 -10
- package/dist/types/tools/image-gen.d.ts +2 -2
- package/dist/types/tools/index.d.ts +58 -6
- package/dist/types/tools/monitor.d.ts +6 -6
- package/dist/types/tools/skill-discovery.d.ts +4 -4
- package/dist/types/tools/subagent.d.ts +12 -12
- package/dist/types/tools/telegram-send.d.ts +7 -0
- package/dist/types/tools/todo-write.d.ts +8 -8
- package/dist/types/utils/external-editor.d.ts +2 -0
- package/dist/types/web/insane/bridge.d.ts +9 -9
- package/dist/types/web/search/index.d.ts +4 -4
- package/package.json +8 -8
- package/scripts/g004-tmux-smoke.ts +196 -36
- package/src/cli/daemon-cli.ts +19 -29
- package/src/cli/malloc-env-guard.test.ts +104 -0
- package/src/cli/malloc-env-guard.ts +149 -0
- package/src/cli/notify-cli.ts +78 -14
- package/src/cli/session-picker.ts +23 -40
- package/src/cli/update-cli.ts +56 -37
- package/src/cli.ts +51 -10
- package/src/commands/daemon.ts +19 -5
- package/src/commands/harness.ts +515 -47
- package/src/commands/launch.ts +11 -3
- package/src/commands/notify.ts +5 -1
- package/src/commands/session.ts +6 -1
- package/src/config/keybindings.ts +5 -0
- package/src/config/model-profile-activation.ts +1 -1
- package/src/config/model-profiles.ts +14 -14
- package/src/config/settings-schema.ts +41 -1
- package/src/config/settings.ts +96 -45
- package/src/coordinator/contract.ts +1 -0
- package/src/coordinator-mcp/model-preset.ts +100 -0
- package/src/coordinator-mcp/policy.ts +30 -0
- package/src/coordinator-mcp/server.ts +2958 -430
- package/src/coordinator-mcp/session-reaper.ts +129 -0
- package/src/daemon/control-types.ts +11 -0
- package/src/daemon/operator-contract.ts +121 -0
- package/src/defaults/skc/extensions/grok-cli-vendor/src/models/catalog.ts +57 -17
- package/src/defaults/skc/extensions/grok-cli-vendor/src/payload/sanitize.ts +15 -2
- package/src/defaults/skc/extensions/grok-cli-vendor/src/provider/register.ts +5 -1
- package/src/extensibility/extensions/runner.ts +1 -1
- package/src/extensibility/extensions/types.ts +3 -1
- package/src/internal-urls/docs-index.generated.ts +10 -9
- package/src/internal-urls/local-protocol.ts +29 -10
- package/src/main.ts +301 -80
- package/src/modes/acp/acp-agent.ts +730 -100
- package/src/modes/acp/acp-mode.ts +29 -2
- package/src/modes/components/assistant-message.ts +32 -3
- package/src/modes/components/bash-execution.ts +43 -13
- package/src/modes/components/custom-editor.ts +5 -0
- package/src/modes/components/footer.ts +3 -3
- package/src/modes/components/hook-selector.ts +12 -0
- package/src/modes/components/irc-sidebar.ts +206 -0
- package/src/modes/components/pet-selector.ts +55 -0
- package/src/modes/components/sayknow-pet-widget.ts +360 -0
- package/src/modes/components/session-selector.ts +222 -221
- package/src/modes/components/settings-selector.ts +10 -0
- package/src/modes/components/status-line/segments.ts +14 -7
- package/src/modes/components/status-line/types.ts +1 -1
- package/src/modes/components/status-line.ts +4 -171
- package/src/modes/components/tool-execution.ts +47 -6
- package/src/modes/components/user-message.ts +26 -9
- package/src/modes/controllers/command-controller.ts +28 -2
- package/src/modes/controllers/event-controller.ts +159 -36
- package/src/modes/controllers/extension-ui-controller.ts +37 -18
- package/src/modes/controllers/input-controller.ts +8 -2
- package/src/modes/controllers/selector-controller.ts +62 -15
- package/src/modes/interactive-mode.ts +199 -7
- package/src/modes/irc-observation-ledger.ts +127 -0
- package/src/modes/print-mode.ts +228 -92
- package/src/modes/rpc/rpc-client.ts +58 -1
- package/src/modes/rpc/rpc-mode.ts +286 -85
- package/src/modes/rpc/rpc-types.ts +15 -1
- package/src/modes/shared/agent-wire/command-dispatch.ts +33 -1
- package/src/modes/shared/agent-wire/command-validation.ts +10 -0
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +45 -2
- package/src/modes/shared/agent-wire/scopes.ts +1 -0
- package/src/modes/shared/agent-wire/unattended-session.ts +288 -1
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +130 -20
- package/src/modes/types.ts +34 -2
- package/src/modes/utils/context-usage.ts +56 -92
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/irc-message.ts +138 -0
- package/src/modes/utils/ui-helpers.ts +216 -50
- package/src/notifications/config.ts +44 -0
- package/src/notifications/daemon-paths.ts +8 -0
- package/src/notifications/index.ts +535 -75
- package/src/notifications/lifecycle-control-runtime.ts +930 -77
- package/src/notifications/notification-service.ts +710 -0
- package/src/notifications/rate-limit-pool.ts +46 -12
- package/src/notifications/telegram-daemon-control.ts +27 -2
- package/src/notifications/telegram-daemon.ts +635 -94
- package/src/notifications/telegram-reference.ts +73 -13
- package/src/notifications/topic-registry.ts +86 -9
- package/src/prompts/system/irc-peer-roster.md +1 -0
- package/src/prompts/system/subagent-system-prompt.md +1 -0
- package/src/prompts/system/system-prompt.md +1 -0
- package/src/prompts/tools/irc.md +1 -1
- package/src/registry/agent-registry.ts +3 -0
- package/src/sdk.ts +52 -1
- package/src/secrets/obfuscator.ts +4 -2
- package/src/session/agent-session.ts +670 -217
- package/src/session/cache-economics.ts +275 -0
- package/src/session/context-estimation.ts +91 -0
- package/src/session/provider-safety-stop.ts +9 -0
- package/src/session/session-dump-format.ts +6 -0
- package/src/session/session-manager.ts +809 -39
- package/src/session/session-storage.ts +582 -38
- package/src/skc-runtime/session-state-sidecar.ts +756 -135
- package/src/skc-runtime/tmux-common.ts +26 -7
- package/src/skc-runtime/tmux-gc.ts +52 -9
- package/src/skc-runtime/tmux-owner-isolation-cli.ts +185 -0
- package/src/skc-runtime/tmux-owner-isolation.ts +2060 -0
- package/src/skc-runtime/tmux-sessions.ts +871 -68
- package/src/slash-commands/builtin-registry.ts +153 -9
- package/src/slash-commands/helpers/context-report.ts +26 -4
- package/src/task/executor.ts +12 -3
- package/src/task/index.ts +8 -0
- package/src/task/receipt.ts +7 -2
- package/src/task/types.ts +26 -0
- package/src/tools/ask-answer-registry.ts +25 -0
- package/src/tools/browser/tab-supervisor.ts +63 -6
- package/src/tools/browser.ts +8 -3
- package/src/tools/index.ts +81 -6
- package/src/tools/sqlite-reader.ts +8 -4
- package/src/tui/output-block.ts +18 -6
- package/src/utils/external-editor.ts +6 -1
package/src/tools/index.ts
CHANGED
|
@@ -122,16 +122,91 @@ export type {
|
|
|
122
122
|
DiscoverableToolSource,
|
|
123
123
|
} from "../tool-discovery/tool-index";
|
|
124
124
|
|
|
125
|
+
/** A typed remote action available to an ask answer source. */
|
|
126
|
+
export type AskRemoteControlId = "navigation_forward";
|
|
127
|
+
|
|
128
|
+
export interface AskRemoteControl {
|
|
129
|
+
id: AskRemoteControlId;
|
|
130
|
+
kind: "navigation";
|
|
131
|
+
label: "Next" | "Done";
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface AskAnswerRequest {
|
|
136
|
+
question: string;
|
|
137
|
+
options: string[];
|
|
138
|
+
interaction: "selector" | "custom_editor" | "clarification_editor";
|
|
139
|
+
controls: readonly AskRemoteControl[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type AskRemoteInteraction =
|
|
143
|
+
| { kind: "value"; value: string }
|
|
144
|
+
| { kind: "control"; controlId: AskRemoteControlId };
|
|
145
|
+
|
|
146
|
+
export type AskSettlement =
|
|
147
|
+
| { kind: "commit" }
|
|
148
|
+
| {
|
|
149
|
+
kind: "resolve_without_commit";
|
|
150
|
+
reason:
|
|
151
|
+
| "toggle"
|
|
152
|
+
| "other_transition"
|
|
153
|
+
| "clarification_transition"
|
|
154
|
+
| "clarification_submitted"
|
|
155
|
+
| "empty_navigation"
|
|
156
|
+
| "back_navigation"
|
|
157
|
+
| "cancelled"
|
|
158
|
+
| "aborted"
|
|
159
|
+
| "timed_out"
|
|
160
|
+
| "exception"
|
|
161
|
+
| "shutdown";
|
|
162
|
+
}
|
|
163
|
+
| {
|
|
164
|
+
kind: "invalid";
|
|
165
|
+
reason:
|
|
166
|
+
| "invalid_option"
|
|
167
|
+
| "invalid_control"
|
|
168
|
+
| "invalid_structured_answer"
|
|
169
|
+
| "empty_custom"
|
|
170
|
+
| "empty_clarification";
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export type AskSelectedAckOutcome =
|
|
174
|
+
| { status: "delivered"; messageId: number }
|
|
175
|
+
| {
|
|
176
|
+
status: "failed";
|
|
177
|
+
reason:
|
|
178
|
+
| "unsupported"
|
|
179
|
+
| "no_participant"
|
|
180
|
+
| "ambiguous_participant"
|
|
181
|
+
| "route_missing"
|
|
182
|
+
| "expired"
|
|
183
|
+
| "cancelled"
|
|
184
|
+
| "telegram_rejected"
|
|
185
|
+
| "session_closed";
|
|
186
|
+
}
|
|
187
|
+
| { status: "unknown"; reason: "transport_ambiguous" | "origin_disconnected" | "host_timeout" | "shutdown" };
|
|
188
|
+
|
|
189
|
+
export type AskSettlementResult =
|
|
190
|
+
| { kind: "committed"; ack: AskSelectedAckOutcome }
|
|
191
|
+
| { kind: "resolved_without_commit" }
|
|
192
|
+
| { kind: "invalid_closed" };
|
|
193
|
+
|
|
194
|
+
export interface AskRemoteReceipt {
|
|
195
|
+
source: "remote";
|
|
196
|
+
interaction: AskRemoteInteraction;
|
|
197
|
+
settle(value: AskSettlement): Promise<AskSettlementResult>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export type AskAnswerSourceResult = AskRemoteReceipt | string | undefined;
|
|
201
|
+
|
|
125
202
|
/**
|
|
126
|
-
* Source of remote answers
|
|
127
|
-
*
|
|
203
|
+
* Source of remote answers. `awaitAnswer` remains the legacy wire for existing
|
|
204
|
+
* integrations; typed sources opt into `awaitAnswerRequest`. This keeps an old
|
|
205
|
+
* string-only source from accidentally acquiring acknowledgement authority.
|
|
128
206
|
*/
|
|
129
207
|
export interface AskAnswerSource {
|
|
130
|
-
/**
|
|
131
|
-
* Race a remote answer against the local UI for one question. Resolves with the
|
|
132
|
-
* chosen option label or free-text answer, or `undefined` to defer to local UI.
|
|
133
|
-
*/
|
|
134
208
|
awaitAnswer(question: string, options: string[], signal?: AbortSignal): Promise<string | undefined>;
|
|
209
|
+
awaitAnswerRequest?(request: AskAnswerRequest, signal?: AbortSignal): Promise<AskAnswerSourceResult>;
|
|
135
210
|
}
|
|
136
211
|
|
|
137
212
|
/** Session context for tool factories */
|
|
@@ -150,13 +150,16 @@ function buildAsciiTable(columns: string[], rows: SqliteRow[]): string {
|
|
|
150
150
|
return lines.map(line => truncateToWidth(replaceTabs(line), MAX_RENDER_WIDTH)).join("\n");
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
const DECIMAL_INTEGER_PATTERN = /^[+-]?\d+$/;
|
|
154
|
+
|
|
153
155
|
function parseLimit(value: string | null, fallback: number): number {
|
|
154
156
|
if (value === null || value.trim().length === 0) {
|
|
155
157
|
return fallback;
|
|
156
158
|
}
|
|
157
159
|
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
+
const normalizedValue = value.trim();
|
|
161
|
+
const parsed = Number(normalizedValue);
|
|
162
|
+
if (!DECIMAL_INTEGER_PATTERN.test(normalizedValue) || !Number.isFinite(parsed) || parsed < 1) {
|
|
160
163
|
throw new ToolError(`SQLite limit must be a positive integer; got '${value}'`);
|
|
161
164
|
}
|
|
162
165
|
return Math.min(parsed, MAX_QUERY_LIMIT);
|
|
@@ -167,8 +170,9 @@ function parseOffset(value: string | null): number {
|
|
|
167
170
|
return 0;
|
|
168
171
|
}
|
|
169
172
|
|
|
170
|
-
const
|
|
171
|
-
|
|
173
|
+
const normalizedValue = value.trim();
|
|
174
|
+
const parsed = Number(normalizedValue);
|
|
175
|
+
if (!DECIMAL_INTEGER_PATTERN.test(normalizedValue) || !Number.isFinite(parsed) || parsed < 0) {
|
|
172
176
|
throw new ToolError(`SQLite offset must be a non-negative integer; got '${value}'`);
|
|
173
177
|
}
|
|
174
178
|
return parsed;
|
package/src/tui/output-block.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bordered output container with optional header and sections.
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ImageProtocol,
|
|
6
|
+
isTerminalGraphicsFallbackActive,
|
|
7
|
+
padding,
|
|
8
|
+
TERMINAL,
|
|
9
|
+
visibleWidth,
|
|
10
|
+
wrapTextWithAnsi,
|
|
11
|
+
} from "@sayknow-cli/tui";
|
|
5
12
|
import type { Theme } from "../modes/theme/theme";
|
|
6
|
-
import { getSixelLineMask } from "../utils/sixel";
|
|
13
|
+
import { containsSixelSequence, getSixelLineMask } from "../utils/sixel";
|
|
7
14
|
import type { State } from "./types";
|
|
8
15
|
import type { RenderCache } from "./utils";
|
|
9
16
|
import { getStateBgColor, Hasher, padToWidth, truncateToWidth } from "./utils";
|
|
@@ -81,13 +88,17 @@ export function renderOutputBlock(options: OutputBlockOptions, theme: Theme): st
|
|
|
81
88
|
);
|
|
82
89
|
}
|
|
83
90
|
const allLines = section.lines.flatMap(l => l.split("\n"));
|
|
84
|
-
const
|
|
91
|
+
const fallbackActive = isTerminalGraphicsFallbackActive();
|
|
92
|
+
const sixelLineMask =
|
|
93
|
+
fallbackActive || TERMINAL.imageProtocol === ImageProtocol.Sixel ? getSixelLineMask(allLines) : undefined;
|
|
85
94
|
for (let lineIndex = 0; lineIndex < allLines.length; lineIndex++) {
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
lines.push(
|
|
95
|
+
const sixelLine = sixelLineMask?.[lineIndex] ?? false;
|
|
96
|
+
if (sixelLine && !fallbackActive) {
|
|
97
|
+
lines.push(allLines[lineIndex]!);
|
|
89
98
|
continue;
|
|
90
99
|
}
|
|
100
|
+
if (sixelLine && sixelLineMask?.[lineIndex - 1] && !containsSixelSequence(allLines[lineIndex]!)) continue;
|
|
101
|
+
const line = sixelLine ? "[SIXEL image hidden while IRC sidebar is visible]" : allLines[lineIndex]!;
|
|
91
102
|
const wrappedLines = wrapTextWithAnsi(line.trimEnd(), contentWidth);
|
|
92
103
|
for (const wrappedLine of wrappedLines) {
|
|
93
104
|
const innerPadding = padding(Math.max(0, contentWidth - visibleWidth(wrappedLine)));
|
|
@@ -137,6 +148,7 @@ export class CachedOutputBlock {
|
|
|
137
148
|
h.optional(options.headerMeta);
|
|
138
149
|
h.optional(options.state);
|
|
139
150
|
h.bool(options.applyBg ?? true);
|
|
151
|
+
h.bool(isTerminalGraphicsFallbackActive());
|
|
140
152
|
if (options.sections) {
|
|
141
153
|
for (const s of options.sections) {
|
|
142
154
|
h.optional(s.label);
|
|
@@ -21,6 +21,11 @@ export interface OpenInEditorOptions {
|
|
|
21
21
|
trimTrailingNewline?: boolean;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/** Remove one platform-standard trailing line terminator from editor content. */
|
|
25
|
+
export function trimEditorTrailingNewline(text: string): string {
|
|
26
|
+
return text.replace(/\r?\n$/, "");
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
/**
|
|
25
30
|
* Opens `content` in the user's external editor and returns the edited text.
|
|
26
31
|
* Returns `null` if the editor exits with a non-zero code.
|
|
@@ -52,7 +57,7 @@ export async function openInEditor(
|
|
|
52
57
|
if (options?.trimTrailingNewline === false) {
|
|
53
58
|
return text;
|
|
54
59
|
}
|
|
55
|
-
return text
|
|
60
|
+
return trimEditorTrailingNewline(text);
|
|
56
61
|
}
|
|
57
62
|
return null;
|
|
58
63
|
} finally {
|