mixdog 1.3.3 → 1.3.5
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/LICENSES/oh-my-pi-MIT.txt +23 -0
- package/NOTICE.md +15 -0
- package/README.md +11 -0
- package/package.json +3 -2
- package/scripts/embed-google-oauth-client.mjs +49 -0
- package/scripts/lib/test-spawn-ledger.mjs +46 -1
- package/scripts/test.mjs +5 -0
- package/src/defaults/shipped-history.json +8 -0
- package/src/defaults/skills/browser-use/SKILL.md +21 -9
- package/src/defaults/skills/setup/SKILL.md +7 -2
- package/src/defaults/skills/setup/references/actions.md +82 -27
- package/src/defaults/skills/setup/references/surfaces.md +67 -34
- package/src/defaults/skills/setup-guide/SKILL.md +3 -3
- package/src/lib/keychain-cjs.cjs +359 -29
- package/src/rules/agent-mode/AGENT_MODE.md +10 -2
- package/src/rules/agent-mode/MIXY.md +12 -0
- package/src/runtime/agent/orchestrator/agent-runtime/heartbeat-completion.mjs +193 -0
- package/src/runtime/agent/orchestrator/config.mjs +18 -0
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +2 -2
- package/src/runtime/agent/orchestrator/mcp/client.mjs +6 -2
- package/src/runtime/agent/orchestrator/mcp/oauth-callback.mjs +31 -2
- package/src/runtime/agent/orchestrator/mcp/oauth-client.mjs +16 -3
- package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +42 -7
- package/src/runtime/agent/orchestrator/mcp/oauth-provider.mjs +21 -2
- package/src/runtime/agent/orchestrator/mcp/oauth-shared.mjs +23 -0
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +11 -1
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +68 -23
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +22 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +18 -5
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +15 -3
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-catalog.mjs +52 -8
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +10 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-request.mjs +22 -6
- package/src/runtime/agent/orchestrator/providers/antigravity-response.mjs +15 -4
- package/src/runtime/agent/orchestrator/providers/antigravity-stream.mjs +17 -2
- package/src/runtime/agent/orchestrator/providers/antigravity-transport.mjs +19 -2
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/cursor-wire-normalization.mjs +10 -4
- package/src/runtime/agent/orchestrator/providers/cursor-wire-protobuf.mjs +10 -217
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +7 -0
- package/src/runtime/agent/orchestrator/providers/devin-auth.mjs +409 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-families.mjs +187 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-identity.mjs +342 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-models.mjs +541 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-protobuf.mjs +305 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-request.mjs +558 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-schema.mjs +880 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-session.mjs +190 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-tool-args.mjs +351 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-transport.mjs +560 -0
- package/src/runtime/agent/orchestrator/providers/devin.mjs +491 -0
- package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/gemini-output-limit.mjs +46 -0
- package/src/runtime/agent/orchestrator/providers/gemini-reasoning-relay.mjs +30 -0
- package/src/runtime/agent/orchestrator/providers/gemini-request-body.mjs +7 -11
- package/src/runtime/agent/orchestrator/providers/gemini-retry-policy.mjs +61 -22
- package/src/runtime/agent/orchestrator/providers/gemini-sdk-request.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +71 -4
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +25 -2
- package/src/runtime/agent/orchestrator/providers/grok-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +96 -5
- package/src/runtime/agent/orchestrator/providers/lib/tail-reminder-split.mjs +23 -5
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +17 -0
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +39 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-state.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/openai-error-contract.mjs +6 -1
- package/src/runtime/agent/orchestrator/providers/opencode-go-gemini.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/provider-availability.mjs +19 -0
- package/src/runtime/agent/orchestrator/providers/registry.mjs +17 -3
- package/src/runtime/agent/orchestrator/providers/wire-protobuf-codec.mjs +368 -0
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +1 -1
- package/src/runtime/agent/orchestrator/runtime-core/reaction-tool-defs.mjs +133 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +23 -5
- package/src/runtime/agent/orchestrator/runtime-core/tool-profile.mjs +35 -10
- package/src/runtime/agent/orchestrator/runtime-core/workflow/agents.mjs +57 -10
- package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +9 -6
- package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +18 -0
- package/src/runtime/agent/orchestrator/session/agent-room.d.mts +0 -3
- package/src/runtime/agent/orchestrator/session/agent-room.mjs +10 -4
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +15 -3
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/human-gate/gate.mjs +36 -4
- package/src/runtime/agent/orchestrator/session/human-gate/outbound-policy.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/human-gate/store.mjs +15 -3
- package/src/runtime/agent/orchestrator/session/loop/assistant-commit.mjs +8 -0
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/segments.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +50 -2
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-phase.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/loop/turn-limits.mjs +60 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-commit.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +14 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +13 -0
- package/src/runtime/agent/orchestrator/session/message-ids.mjs +5 -3
- package/src/runtime/agent/orchestrator/session/message-reactions.mjs +89 -0
- package/src/runtime/agent/orchestrator/session/message-reactions.test-support.mjs +75 -0
- package/src/runtime/agent/orchestrator/session/routine-result.d.mts +0 -2
- package/src/runtime/agent/orchestrator/session/routine-result.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +20 -2
- package/src/runtime/agent/orchestrator/session/store-agent-worker-header-cache.mjs +85 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +125 -12
- package/src/runtime/agent/orchestrator/session/tail-reminder-rules.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/tool-batch/state.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/tool-batch.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +7 -1
- package/src/runtime/channels/lib/schedule-errors.mjs +51 -0
- package/src/runtime/channels/lib/scheduler.mjs +109 -14
- package/src/runtime/channels/lib/schedules-db.mjs +49 -0
- package/src/runtime/channels/lib/tool-dispatch.mjs +13 -0
- package/src/runtime/channels/lib/worker-main.mjs +9 -0
- package/src/runtime/office/com/com-adapter.mjs +17 -1
- package/src/runtime/office/com/office-com-host.ps1 +51 -1
- package/src/runtime/office/pdf/cfb-fixture.mjs +328 -0
- package/src/runtime/office/pdf/cfb-protection.mjs +311 -0
- package/src/runtime/office/pdf/document-preview.mjs +326 -8
- package/src/runtime/office/pdf/ooxml-crypto.mjs +469 -0
- package/src/runtime/office/pdf/ooxml-key-worker.mjs +14 -0
- package/src/runtime/office/portable/portable-soffice.mjs +45 -5
- package/src/runtime/shared/agent-room-host.mjs +1 -1
- package/src/runtime/shared/bot-hops.mjs +62 -2
- package/src/runtime/shared/config.mjs +49 -22
- package/src/runtime/shared/connector-catalog.d.mts +4 -2
- package/src/runtime/shared/connector-catalog.mjs +16 -8
- package/src/runtime/shared/developer-options.mjs +32 -1
- package/src/runtime/shared/google-oauth-client.generated.json +4 -0
- package/src/runtime/shared/google-oauth-client.mjs +34 -9
- package/src/runtime/shared/llm/anthropic-betas.mjs +7 -0
- package/src/runtime/shared/llm/anthropic-thinking-contract.mjs +12 -0
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +1 -0
- package/src/runtime/shared/llm/usage-rollup.mjs +4 -383
- package/src/runtime/shared/llm/well-formed.mjs +66 -0
- package/src/runtime/shared/provider-accounts.mjs +224 -58
- package/src/runtime/shared/provider-api-key.mjs +19 -8
- package/src/runtime/shared/routine-trigger.mjs +42 -0
- package/src/runtime/shared/tool-execution-contract.mjs +2 -0
- package/src/runtime/shared/transcript-metadata.mjs +38 -0
- package/src/runtime/shared/user-data-guard.mjs +30 -2
- package/src/runtime/shared/worktrees/activity-gate.mjs +12 -5
- package/src/session-runtime/agent-home-delivery.mjs +57 -13
- package/src/session-runtime/agent-room-delivery.mjs +28 -1
- package/src/session-runtime/agent-task-sessions.mjs +292 -79
- package/src/session-runtime/agent-tool-routing.mjs +49 -4
- package/src/session-runtime/boot/begin.mjs +3 -2
- package/src/session-runtime/boot/tools.mjs +4 -0
- package/src/session-runtime/bot-chain.mjs +32 -0
- package/src/session-runtime/bot-status.mjs +7 -4
- package/src/session-runtime/channel-config-api.mjs +63 -17
- package/src/session-runtime/internal-tool-executor/reaction-tool.mjs +45 -0
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +72 -5
- package/src/session-runtime/internal-tool-executor.mjs +4 -0
- package/src/session-runtime/mcp-glue/server-catalog.mjs +7 -1
- package/src/session-runtime/mixy-heartbeat.mjs +807 -0
- package/src/session-runtime/model-route/route-tuning.mjs +10 -6
- package/src/session-runtime/owned-automation-run.mjs +33 -12
- package/src/session-runtime/provider-auth/login.mjs +7 -0
- package/src/session-runtime/provider-models/row-hydration.mjs +13 -2
- package/src/session-runtime/routine-home-turn.mjs +33 -6
- package/src/session-runtime/schedule-session-run.mjs +7 -3
- package/src/session-runtime/services/agent-tool/close-flow.mjs +14 -2
- package/src/session-runtime/services/agent-tool/execute.mjs +6 -1
- package/src/session-runtime/services/agent-tool/job-views/agent-list.mjs +11 -2
- package/src/session-runtime/services/agent-tool/render.mjs +3 -1
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-plan.mjs +8 -12
- package/src/session-runtime/services/agent-tool/tool-def.mjs +1 -1
- package/src/session-runtime/services/channel-admin.mjs +66 -18
- package/src/session-runtime/services/channel-worker.mjs +1 -1
- package/src/session-runtime/services/provider-admin.mjs +128 -25
- package/src/session-runtime/services/schedule-access.mjs +14 -0
- package/src/session-runtime/services/usage-dashboard-model.mjs +1 -0
- package/src/session-runtime/session-create/session-options.mjs +7 -4
- package/src/session-runtime/settings-system-api.mjs +16 -1
- package/src/session-runtime/setup-tool/executor.mjs +49 -14
- package/src/session-runtime/setup-tool/extended-actions.mjs +29 -3
- package/src/session-runtime/setup-tool/settings-contract.mjs +65 -4
- package/src/session-runtime/setup-tool/tool-defs.mjs +30 -3
- package/src/session-runtime/task-session-route.mjs +99 -0
- package/src/session-runtime/tool-policy/policy-stage.mjs +5 -2
- package/src/session-runtime/tool-policy/surface-helpers.mjs +2 -3
- package/src/session-runtime/tool-surface.mjs +4 -0
- package/src/session-runtime/usage-stats-api.mjs +1 -1
- package/src/session-runtime/workflow-agents-api/agent-editor.mjs +98 -21
- package/src/session-runtime/workflow-agents-api/workflow-packs.mjs +6 -1
- package/src/session-runtime/workspace/transitions.mjs +10 -2
- package/src/standalone/daemon-session-control.mjs +88 -20
- package/src/standalone/daemon.mjs +8 -0
- package/src/standalone/session-protocol.mjs +5 -0
- package/src/standalone/session-service/agent-tree/agent-cancel.mjs +6 -2
- package/src/standalone/session-service/session-calls/session-turns.mjs +6 -0
- package/src/standalone/session-service.mjs +13 -0
- package/src/standalone/session-tool-output.mjs +8 -5
- package/src/tui/app/model-options.mjs +2 -0
- package/src/tui/dist/index.mjs +335 -172
- package/src/tui/session/notice-surface.mjs +17 -1
- package/src/tui/session/session-api/integrations.mjs +1 -0
- package/src/tui/session/session-api/lifecycle.mjs +8 -0
- package/src/tui/session/session-api/settings.mjs +14 -2
- package/src/tui/session/turn-stream.mjs +17 -1
- package/src/tui/session/turn.mjs +22 -2
- package/src/vendor/statusline/src/gateway/claude-current.mjs +0 -58
- package/src/vendor/statusline/src/gateway/route-meta.mjs +1 -361
- package/src/vendor/statusline/src/gateway/session-routes.mjs +0 -55
- package/src/vendor/statusline/scripts/lib/gateway-settings.mjs +0 -285
package/src/tui/dist/index.mjs
CHANGED
|
@@ -27484,8 +27484,8 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
27484
27484
|
|
|
27485
27485
|
// node_modules/string-width/index.js
|
|
27486
27486
|
var segmenter = new Intl.Segmenter();
|
|
27487
|
-
var
|
|
27488
|
-
var
|
|
27487
|
+
var visibleCharacterRegex = new RegExp("[^\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]", "v");
|
|
27488
|
+
var spacingMarkRegex = new RegExp("\\p{Spacing_Mark}", "v");
|
|
27489
27489
|
var rgiEmojiRegex = new RegExp("^\\p{RGI_Emoji}$", "v");
|
|
27490
27490
|
var unqualifiedKeycapRegex = /^[\d#*]\u20E3$/;
|
|
27491
27491
|
var extendedPictographicRegex = new RegExp("\\p{Extended_Pictographic}", "gu");
|
|
@@ -27503,10 +27503,8 @@ function isDoubleWidthNonRgiEmojiSequence(segment) {
|
|
|
27503
27503
|
return false;
|
|
27504
27504
|
}
|
|
27505
27505
|
function baseVisible(segment) {
|
|
27506
|
-
|
|
27507
|
-
|
|
27508
|
-
function isZeroWidthCluster(segment) {
|
|
27509
|
-
return zeroWidthClusterRegex.test(segment);
|
|
27506
|
+
const index = segment.search(visibleCharacterRegex);
|
|
27507
|
+
return index === -1 ? void 0 : segment.slice(index);
|
|
27510
27508
|
}
|
|
27511
27509
|
function isHangulLeadingJamo(codePoint) {
|
|
27512
27510
|
return codePoint >= 4352 && codePoint <= 4447 || codePoint >= 43360 && codePoint <= 43388;
|
|
@@ -27523,7 +27521,7 @@ function isHangulJamo(codePoint) {
|
|
|
27523
27521
|
function hangulClusterWidth(visibleSegment, eastAsianWidthOptions) {
|
|
27524
27522
|
const codePoints = [];
|
|
27525
27523
|
for (const character of visibleSegment) {
|
|
27526
|
-
if (
|
|
27524
|
+
if (!visibleCharacterRegex.test(character)) {
|
|
27527
27525
|
continue;
|
|
27528
27526
|
}
|
|
27529
27527
|
codePoints.push(character.codePointAt(0));
|
|
@@ -27552,7 +27550,7 @@ function hangulClusterWidth(visibleSegment, eastAsianWidthOptions) {
|
|
|
27552
27550
|
}
|
|
27553
27551
|
return width;
|
|
27554
27552
|
}
|
|
27555
|
-
function
|
|
27553
|
+
function trailingWidth(visibleSegment, eastAsianWidthOptions) {
|
|
27556
27554
|
let extra = 0;
|
|
27557
27555
|
let first = true;
|
|
27558
27556
|
for (const character of visibleSegment) {
|
|
@@ -27560,7 +27558,7 @@ function trailingHalfwidthWidth(visibleSegment, eastAsianWidthOptions) {
|
|
|
27560
27558
|
first = false;
|
|
27561
27559
|
continue;
|
|
27562
27560
|
}
|
|
27563
|
-
if (character >= "\uFF00" && character <= "\uFFEF") {
|
|
27561
|
+
if (spacingMarkRegex.test(character) || character >= "\uFF00" && character <= "\uFFEF") {
|
|
27564
27562
|
extra += eastAsianWidth(character.codePointAt(0), eastAsianWidthOptions);
|
|
27565
27563
|
}
|
|
27566
27564
|
}
|
|
@@ -27587,14 +27585,14 @@ function stringWidth(input, options = {}) {
|
|
|
27587
27585
|
let width = 0;
|
|
27588
27586
|
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
27589
27587
|
for (const { segment } of segmenter.segment(string)) {
|
|
27590
|
-
|
|
27588
|
+
const visibleSegment = baseVisible(segment);
|
|
27589
|
+
if (visibleSegment === void 0) {
|
|
27591
27590
|
continue;
|
|
27592
27591
|
}
|
|
27593
27592
|
if (rgiEmojiRegex.test(segment) || isDoubleWidthNonRgiEmojiSequence(segment)) {
|
|
27594
27593
|
width += 2;
|
|
27595
27594
|
continue;
|
|
27596
27595
|
}
|
|
27597
|
-
const visibleSegment = baseVisible(segment);
|
|
27598
27596
|
const hangulWidth = hangulClusterWidth(visibleSegment, eastAsianWidthOptions);
|
|
27599
27597
|
if (hangulWidth !== void 0) {
|
|
27600
27598
|
width += hangulWidth;
|
|
@@ -27602,7 +27600,7 @@ function stringWidth(input, options = {}) {
|
|
|
27602
27600
|
}
|
|
27603
27601
|
const codePoint = visibleSegment.codePointAt(0);
|
|
27604
27602
|
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
27605
|
-
width +=
|
|
27603
|
+
width += trailingWidth(visibleSegment, eastAsianWidthOptions);
|
|
27606
27604
|
}
|
|
27607
27605
|
return width;
|
|
27608
27606
|
}
|
|
@@ -27795,12 +27793,8 @@ var ansi_styles_default = ansiStyles;
|
|
|
27795
27793
|
|
|
27796
27794
|
// node_modules/wrap-ansi/index.js
|
|
27797
27795
|
var ANSI_ESCAPE = "\x1B";
|
|
27798
|
-
var ANSI_ESCAPE_CSI = "\x9B";
|
|
27799
|
-
var ESCAPES = /* @__PURE__ */ new Set([
|
|
27800
|
-
ANSI_ESCAPE,
|
|
27801
|
-
ANSI_ESCAPE_CSI
|
|
27802
|
-
]);
|
|
27803
27796
|
var ANSI_ESCAPE_BELL = "\x07";
|
|
27797
|
+
var C1_CSI = "\x9B";
|
|
27804
27798
|
var ANSI_CSI = "[";
|
|
27805
27799
|
var ANSI_OSC = "]";
|
|
27806
27800
|
var ANSI_SGR_TERMINATOR = "m";
|
|
@@ -27811,47 +27805,168 @@ var ANSI_SGR_RESET_UNDERLINE_COLOR = 59;
|
|
|
27811
27805
|
var ANSI_SGR_FOREGROUND_EXTENDED = 38;
|
|
27812
27806
|
var ANSI_SGR_BACKGROUND_EXTENDED = 48;
|
|
27813
27807
|
var ANSI_SGR_UNDERLINE_COLOR_EXTENDED = 58;
|
|
27814
|
-
var ANSI_SGR_COLOR_MODE_256 = 5;
|
|
27815
27808
|
var ANSI_SGR_COLOR_MODE_RGB = 2;
|
|
27816
|
-
var
|
|
27817
|
-
var
|
|
27818
|
-
var
|
|
27809
|
+
var ANSI_SGR_COLOR_MODE_256 = 5;
|
|
27810
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;`;
|
|
27811
|
+
var ESCAPES = /* @__PURE__ */ new Set([
|
|
27812
|
+
ANSI_ESCAPE,
|
|
27813
|
+
C1_CSI
|
|
27814
|
+
]);
|
|
27815
|
+
var ESCAPE_CHARACTERS = [...ESCAPES].join("");
|
|
27816
|
+
var CSI_INTRODUCER = `(?:${ANSI_ESCAPE}\\${ANSI_CSI}|${C1_CSI})`;
|
|
27817
|
+
var CSI_PARAMETERS = "[0-?]*[ -/]*[@-~]";
|
|
27818
|
+
var SGR_PARAMETERS = `(?<sgr>[0-9;:]*)${ANSI_SGR_TERMINATOR}`;
|
|
27819
|
+
var OSC_STRING_TERMINATOR = `(?:${ANSI_ESCAPE_BELL}|${ANSI_ESCAPE}\\\\)`;
|
|
27820
|
+
var OSC_STRING_PAYLOAD = String.raw`[^\u0000-\u001F\u007F-\u009F]*`;
|
|
27821
|
+
var LINK_PARAMETERS = String.raw`8;(?<parameters>[^;\u0000-\u001F\u007F-\u009F]*);(?<uri>${OSC_STRING_PAYLOAD})${OSC_STRING_TERMINATOR}`;
|
|
27822
|
+
var OSC_STRING = `${OSC_STRING_PAYLOAD}${OSC_STRING_TERMINATOR}`;
|
|
27823
|
+
var ANSI_ESCAPE_REGEX = new RegExp(
|
|
27824
|
+
`${CSI_INTRODUCER}(?:${SGR_PARAMETERS}|${CSI_PARAMETERS})|${ANSI_ESCAPE}\\${ANSI_OSC}(?:${LINK_PARAMETERS}|${OSC_STRING})`,
|
|
27825
|
+
"y"
|
|
27826
|
+
);
|
|
27819
27827
|
var ANSI_SGR_MODIFIER_CLOSE_CODES = new Set(ansi_styles_default.codes.values());
|
|
27820
27828
|
ANSI_SGR_MODIFIER_CLOSE_CODES.delete(ANSI_SGR_RESET);
|
|
27821
27829
|
var segmenter2 = new Intl.Segmenter();
|
|
27822
|
-
var
|
|
27830
|
+
var getStringWidth = (string) => stringWidth(string, { countAnsiEscapeCodes: true });
|
|
27823
27831
|
var TAB_SIZE = 8;
|
|
27832
|
+
var ESCAPE_INTRODUCER_REGEX = new RegExp(`[${ESCAPE_CHARACTERS}]`, "g");
|
|
27833
|
+
var ROW_BOUNDARY_REGEX = new RegExp(`[\\n${ESCAPE_CHARACTERS}]`, "g");
|
|
27834
|
+
var ASCII_PRINTABLE_REGEX = /^[ -~]*$/;
|
|
27824
27835
|
var wrapAnsiCode = (code) => `${ANSI_ESCAPE}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
27825
|
-
var wrapAnsiHyperlink = (url) => `${ANSI_ESCAPE}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
27836
|
+
var wrapAnsiHyperlink = (url, parameters = "") => `${ANSI_ESCAPE}${ANSI_ESCAPE_LINK}${parameters};${url}${ANSI_ESCAPE_BELL}`;
|
|
27837
|
+
var matchAnsiEscape = (string, index) => {
|
|
27838
|
+
if (!ESCAPES.has(string[index])) {
|
|
27839
|
+
return;
|
|
27840
|
+
}
|
|
27841
|
+
ANSI_ESCAPE_REGEX.lastIndex = index;
|
|
27842
|
+
return ANSI_ESCAPE_REGEX.exec(string) ?? void 0;
|
|
27843
|
+
};
|
|
27844
|
+
var forEachSegment = (string, onPlainText, onEscape = () => {
|
|
27845
|
+
}) => {
|
|
27846
|
+
let plainStart = 0;
|
|
27847
|
+
let index = 0;
|
|
27848
|
+
while (index < string.length) {
|
|
27849
|
+
ESCAPE_INTRODUCER_REGEX.lastIndex = index;
|
|
27850
|
+
const introducer = ESCAPE_INTRODUCER_REGEX.exec(string);
|
|
27851
|
+
if (!introducer) {
|
|
27852
|
+
break;
|
|
27853
|
+
}
|
|
27854
|
+
const escape3 = matchAnsiEscape(string, introducer.index);
|
|
27855
|
+
if (!escape3) {
|
|
27856
|
+
index = introducer.index + 1;
|
|
27857
|
+
continue;
|
|
27858
|
+
}
|
|
27859
|
+
if (introducer.index > plainStart) {
|
|
27860
|
+
onPlainText(string.slice(plainStart, introducer.index));
|
|
27861
|
+
}
|
|
27862
|
+
onEscape(escape3[0]);
|
|
27863
|
+
index = introducer.index + escape3[0].length;
|
|
27864
|
+
plainStart = index;
|
|
27865
|
+
}
|
|
27866
|
+
if (plainStart < string.length) {
|
|
27867
|
+
onPlainText(string.slice(plainStart));
|
|
27868
|
+
}
|
|
27869
|
+
};
|
|
27870
|
+
var getWidth = (string) => {
|
|
27871
|
+
let plainText = "";
|
|
27872
|
+
forEachSegment(string, (part) => {
|
|
27873
|
+
plainText += part;
|
|
27874
|
+
});
|
|
27875
|
+
return getStringWidth(plainText);
|
|
27876
|
+
};
|
|
27877
|
+
var getTokens = (string) => {
|
|
27878
|
+
const tokens = [];
|
|
27879
|
+
forEachSegment(string, (plainText) => {
|
|
27880
|
+
if (ASCII_PRINTABLE_REGEX.test(plainText)) {
|
|
27881
|
+
for (const character of plainText) {
|
|
27882
|
+
tokens.push({ value: character, width: 1 });
|
|
27883
|
+
}
|
|
27884
|
+
return;
|
|
27885
|
+
}
|
|
27886
|
+
for (const { segment } of segmenter2.segment(plainText)) {
|
|
27887
|
+
tokens.push({ value: segment, width: getStringWidth(segment) });
|
|
27888
|
+
}
|
|
27889
|
+
}, (escape3) => {
|
|
27890
|
+
tokens.push({ value: escape3, width: 0 });
|
|
27891
|
+
});
|
|
27892
|
+
return tokens;
|
|
27893
|
+
};
|
|
27894
|
+
var splitWords = (string) => {
|
|
27895
|
+
let currentWord = { value: "", plainText: "" };
|
|
27896
|
+
const words = [currentWord];
|
|
27897
|
+
forEachSegment(string, (plainText) => {
|
|
27898
|
+
const parts = plainText.split(" ");
|
|
27899
|
+
currentWord.value += parts[0];
|
|
27900
|
+
currentWord.plainText += parts[0];
|
|
27901
|
+
for (let index = 1; index < parts.length; index++) {
|
|
27902
|
+
currentWord = { value: parts[index], plainText: parts[index] };
|
|
27903
|
+
words.push(currentWord);
|
|
27904
|
+
}
|
|
27905
|
+
}, (escape3) => {
|
|
27906
|
+
currentWord.value += escape3;
|
|
27907
|
+
});
|
|
27908
|
+
for (const word of words) {
|
|
27909
|
+
word.width = getStringWidth(word.plainText);
|
|
27910
|
+
}
|
|
27911
|
+
return words;
|
|
27912
|
+
};
|
|
27913
|
+
var getColonColorToken = (parameter) => {
|
|
27914
|
+
const parts = parameter.split(":");
|
|
27915
|
+
const code = Number.parseInt(parts[0], 10);
|
|
27916
|
+
const mode = Number.parseInt(parts[1], 10);
|
|
27917
|
+
if (![ANSI_SGR_FOREGROUND_EXTENDED, ANSI_SGR_BACKGROUND_EXTENDED, ANSI_SGR_UNDERLINE_COLOR_EXTENDED].includes(code)) {
|
|
27918
|
+
return;
|
|
27919
|
+
}
|
|
27920
|
+
if (mode === ANSI_SGR_COLOR_MODE_256 && parts.length === 3 && /^\d+$/.test(parts[2])) {
|
|
27921
|
+
return { code, open: parameter, hasArguments: true };
|
|
27922
|
+
}
|
|
27923
|
+
if (mode !== ANSI_SGR_COLOR_MODE_RGB) {
|
|
27924
|
+
return;
|
|
27925
|
+
}
|
|
27926
|
+
const components = parts.length === 6 ? parts.slice(3) : parts.slice(2);
|
|
27927
|
+
const colorSpace = parts.length === 6 ? parts[2] : void 0;
|
|
27928
|
+
if (components.length === 3 && components.every((component) => /^\d+$/.test(component)) && (colorSpace === void 0 || /^\d*$/.test(colorSpace))) {
|
|
27929
|
+
return { code, open: parameter, hasArguments: true };
|
|
27930
|
+
}
|
|
27931
|
+
};
|
|
27826
27932
|
var getSgrTokens = (sgrParameters) => {
|
|
27827
|
-
const
|
|
27933
|
+
const parameters = sgrParameters.split(";");
|
|
27828
27934
|
const sgrTokens = [];
|
|
27829
|
-
for (let index = 0; index <
|
|
27830
|
-
const
|
|
27935
|
+
for (let index = 0; index < parameters.length; index++) {
|
|
27936
|
+
const parameter = parameters[index];
|
|
27937
|
+
if (parameter.includes(":")) {
|
|
27938
|
+
const colonColorToken = getColonColorToken(parameter);
|
|
27939
|
+
if (colonColorToken) {
|
|
27940
|
+
sgrTokens.push(colonColorToken);
|
|
27941
|
+
}
|
|
27942
|
+
continue;
|
|
27943
|
+
}
|
|
27944
|
+
const code = parameter === "" ? ANSI_SGR_RESET : Number.parseInt(parameter, 10);
|
|
27831
27945
|
if (!Number.isFinite(code)) {
|
|
27832
27946
|
continue;
|
|
27833
27947
|
}
|
|
27834
27948
|
if (code === ANSI_SGR_FOREGROUND_EXTENDED || code === ANSI_SGR_BACKGROUND_EXTENDED || code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED) {
|
|
27835
|
-
if (index + 1 >=
|
|
27949
|
+
if (index + 1 >= parameters.length) {
|
|
27836
27950
|
break;
|
|
27837
27951
|
}
|
|
27838
|
-
const mode =
|
|
27839
|
-
|
|
27840
|
-
|
|
27952
|
+
const mode = Number.parseInt(parameters[index + 1], 10);
|
|
27953
|
+
const colorIndex = Number.parseInt(parameters[index + 2], 10);
|
|
27954
|
+
if (mode === ANSI_SGR_COLOR_MODE_256 && Number.isFinite(colorIndex)) {
|
|
27955
|
+
sgrTokens.push({ code, open: [code, mode, colorIndex].join(";"), hasArguments: true });
|
|
27841
27956
|
index += 2;
|
|
27842
27957
|
continue;
|
|
27843
27958
|
}
|
|
27844
|
-
const red2 =
|
|
27845
|
-
const green2 =
|
|
27846
|
-
const blue2 =
|
|
27959
|
+
const red2 = Number.parseInt(parameters[index + 2], 10);
|
|
27960
|
+
const green2 = Number.parseInt(parameters[index + 3], 10);
|
|
27961
|
+
const blue2 = Number.parseInt(parameters[index + 4], 10);
|
|
27847
27962
|
if (mode === ANSI_SGR_COLOR_MODE_RGB && Number.isFinite(red2) && Number.isFinite(green2) && Number.isFinite(blue2)) {
|
|
27848
|
-
sgrTokens.push([code, mode, red2, green2, blue2]);
|
|
27963
|
+
sgrTokens.push({ code, open: [code, mode, red2, green2, blue2].join(";"), hasArguments: true });
|
|
27849
27964
|
index += 4;
|
|
27850
27965
|
continue;
|
|
27851
27966
|
}
|
|
27852
27967
|
break;
|
|
27853
27968
|
}
|
|
27854
|
-
sgrTokens.push(
|
|
27969
|
+
sgrTokens.push({ code, open: String(code), hasArguments: false });
|
|
27855
27970
|
}
|
|
27856
27971
|
return sgrTokens;
|
|
27857
27972
|
};
|
|
@@ -27873,25 +27988,26 @@ var removeModifierStylesByClose = (activeStyles, closeCode) => {
|
|
|
27873
27988
|
}
|
|
27874
27989
|
}
|
|
27875
27990
|
};
|
|
27876
|
-
var getColorStyle = (
|
|
27877
|
-
|
|
27991
|
+
var getColorStyle = (sgrToken) => {
|
|
27992
|
+
const { code, open, hasArguments } = sgrToken;
|
|
27993
|
+
if (code >= 30 && code <= 37 || code >= 90 && code <= 97 || code === ANSI_SGR_FOREGROUND_EXTENDED && hasArguments) {
|
|
27878
27994
|
return {
|
|
27879
27995
|
family: "foreground",
|
|
27880
|
-
open
|
|
27996
|
+
open,
|
|
27881
27997
|
close: ANSI_SGR_RESET_FOREGROUND
|
|
27882
27998
|
};
|
|
27883
27999
|
}
|
|
27884
|
-
if (code >= 40 && code <= 47 || code >= 100 && code <= 107 || code === ANSI_SGR_BACKGROUND_EXTENDED &&
|
|
28000
|
+
if (code >= 40 && code <= 47 || code >= 100 && code <= 107 || code === ANSI_SGR_BACKGROUND_EXTENDED && hasArguments) {
|
|
27885
28001
|
return {
|
|
27886
28002
|
family: "background",
|
|
27887
|
-
open
|
|
28003
|
+
open,
|
|
27888
28004
|
close: ANSI_SGR_RESET_BACKGROUND
|
|
27889
28005
|
};
|
|
27890
28006
|
}
|
|
27891
|
-
if (code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED &&
|
|
28007
|
+
if (code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED && hasArguments) {
|
|
27892
28008
|
return {
|
|
27893
28009
|
family: "underlineColor",
|
|
27894
|
-
open
|
|
28010
|
+
open,
|
|
27895
28011
|
close: ANSI_SGR_RESET_UNDERLINE_COLOR
|
|
27896
28012
|
};
|
|
27897
28013
|
}
|
|
@@ -27920,11 +28036,11 @@ var applySgrResetCode = (code, activeStyles) => {
|
|
|
27920
28036
|
return false;
|
|
27921
28037
|
};
|
|
27922
28038
|
var applySgrToken = (sgrToken, activeStyles) => {
|
|
27923
|
-
const
|
|
28039
|
+
const { code } = sgrToken;
|
|
27924
28040
|
if (applySgrResetCode(code, activeStyles)) {
|
|
27925
28041
|
return;
|
|
27926
28042
|
}
|
|
27927
|
-
const colorStyle = getColorStyle(
|
|
28043
|
+
const colorStyle = getColorStyle(sgrToken);
|
|
27928
28044
|
if (colorStyle) {
|
|
27929
28045
|
upsertActiveStyle(activeStyles, colorStyle);
|
|
27930
28046
|
return;
|
|
@@ -27933,7 +28049,7 @@ var applySgrToken = (sgrToken, activeStyles) => {
|
|
|
27933
28049
|
if (close !== void 0 && close !== ANSI_SGR_RESET) {
|
|
27934
28050
|
upsertActiveStyle(activeStyles, {
|
|
27935
28051
|
family: `modifier-${code}`,
|
|
27936
|
-
open: sgrToken.
|
|
28052
|
+
open: sgrToken.open,
|
|
27937
28053
|
close
|
|
27938
28054
|
});
|
|
27939
28055
|
}
|
|
@@ -27944,71 +28060,37 @@ var applySgrParameters = (sgrParameters, activeStyles) => {
|
|
|
27944
28060
|
}
|
|
27945
28061
|
};
|
|
27946
28062
|
var applySgrResets = (sgrParameters, activeStyles) => {
|
|
27947
|
-
for (const
|
|
27948
|
-
const [code] = sgrToken;
|
|
28063
|
+
for (const { code } of getSgrTokens(sgrParameters)) {
|
|
27949
28064
|
applySgrResetCode(code, activeStyles);
|
|
27950
28065
|
}
|
|
27951
28066
|
};
|
|
27952
|
-
var applyLeadingSgrResets = (string, activeStyles) => {
|
|
27953
|
-
let
|
|
27954
|
-
while (
|
|
27955
|
-
|
|
27956
|
-
|
|
27957
|
-
|
|
27958
|
-
break;
|
|
27959
|
-
}
|
|
27960
|
-
if (match.groups.sgr !== void 0) {
|
|
27961
|
-
applySgrResets(match.groups.sgr, activeStyles);
|
|
27962
|
-
}
|
|
27963
|
-
remainder = remainder.slice(match[0].length);
|
|
27964
|
-
continue;
|
|
28067
|
+
var applyLeadingSgrResets = (string, startIndex, activeStyles) => {
|
|
28068
|
+
let index = startIndex;
|
|
28069
|
+
while (index < string.length) {
|
|
28070
|
+
const match = matchAnsiEscape(string, index);
|
|
28071
|
+
if (!match) {
|
|
28072
|
+
break;
|
|
27965
28073
|
}
|
|
27966
|
-
if (
|
|
27967
|
-
const match = ANSI_ESCAPE_CSI_REGEX.exec(remainder);
|
|
27968
|
-
if (!match || match.groups.sgr === void 0) {
|
|
27969
|
-
break;
|
|
27970
|
-
}
|
|
28074
|
+
if (match.groups.sgr !== void 0) {
|
|
27971
28075
|
applySgrResets(match.groups.sgr, activeStyles);
|
|
27972
|
-
remainder = remainder.slice(match[0].length);
|
|
27973
|
-
continue;
|
|
27974
28076
|
}
|
|
27975
|
-
|
|
28077
|
+
index += match[0].length;
|
|
27976
28078
|
}
|
|
27977
28079
|
};
|
|
27978
28080
|
var getClosingSgrSequence = (activeStyles) => [...activeStyles].reverse().map((activeStyle) => wrapAnsiCode(activeStyle.close)).join("");
|
|
27979
28081
|
var getOpeningSgrSequence = (activeStyles) => activeStyles.map((activeStyle) => wrapAnsiCode(activeStyle.open)).join("");
|
|
27980
|
-
var
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
let
|
|
27984
|
-
|
|
27985
|
-
|
|
27986
|
-
|
|
27987
|
-
const characterLength = stringWidth(character);
|
|
27988
|
-
if (visible + characterLength <= columns) {
|
|
27989
|
-
rows2[rows2.length - 1] += character;
|
|
27990
|
-
} else {
|
|
27991
|
-
rows2.push(character);
|
|
28082
|
+
var wrapWord = (rows2, word, columns, rowWidth) => {
|
|
28083
|
+
const tokens = getTokens(word);
|
|
28084
|
+
let visible = rowWidth;
|
|
28085
|
+
for (let index = 0; index < tokens.length; index++) {
|
|
28086
|
+
const token = tokens[index];
|
|
28087
|
+
if (token.width > 0 && visible > 0 && visible + token.width > columns) {
|
|
28088
|
+
rows2.push("");
|
|
27992
28089
|
visible = 0;
|
|
27993
28090
|
}
|
|
27994
|
-
|
|
27995
|
-
|
|
27996
|
-
|
|
27997
|
-
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
27998
|
-
}
|
|
27999
|
-
if (isInsideEscape) {
|
|
28000
|
-
if (isInsideLinkEscape) {
|
|
28001
|
-
if (character === ANSI_ESCAPE_BELL || character === "\\" && index > 0 && characters[index - 1] === ANSI_ESCAPE) {
|
|
28002
|
-
isInsideEscape = false;
|
|
28003
|
-
isInsideLinkEscape = false;
|
|
28004
|
-
}
|
|
28005
|
-
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
28006
|
-
isInsideEscape = false;
|
|
28007
|
-
}
|
|
28008
|
-
continue;
|
|
28009
|
-
}
|
|
28010
|
-
visible += characterLength;
|
|
28011
|
-
if (visible === columns && index < characters.length - 1) {
|
|
28091
|
+
rows2[rows2.length - 1] += token.value;
|
|
28092
|
+
visible += token.width;
|
|
28093
|
+
if (visible === columns && index < tokens.length - 1) {
|
|
28012
28094
|
rows2.push("");
|
|
28013
28095
|
visible = 0;
|
|
28014
28096
|
}
|
|
@@ -28016,54 +28098,134 @@ var wrapWord = (rows2, word, columns) => {
|
|
|
28016
28098
|
if (!visible && rows2.at(-1).length > 0 && rows2.length > 1) {
|
|
28017
28099
|
rows2[rows2.length - 2] += rows2.pop();
|
|
28018
28100
|
}
|
|
28101
|
+
return getWidth(rows2.at(-1));
|
|
28019
28102
|
};
|
|
28020
28103
|
var stringVisibleTrimSpacesRight = (string) => {
|
|
28021
|
-
|
|
28022
|
-
|
|
28023
|
-
|
|
28024
|
-
|
|
28104
|
+
if (!string.includes(" ")) {
|
|
28105
|
+
return string;
|
|
28106
|
+
}
|
|
28107
|
+
const segments = [];
|
|
28108
|
+
forEachSegment(string, (plainText) => {
|
|
28109
|
+
segments.push({ value: plainText, isEscape: false });
|
|
28110
|
+
}, (escape3) => {
|
|
28111
|
+
segments.push({ value: escape3, isEscape: true });
|
|
28112
|
+
});
|
|
28113
|
+
for (let index = segments.length - 1; index >= 0; index--) {
|
|
28114
|
+
const segment = segments[index];
|
|
28115
|
+
if (segment.isEscape) {
|
|
28116
|
+
continue;
|
|
28117
|
+
}
|
|
28118
|
+
let end = segment.value.length;
|
|
28119
|
+
while (end > 0 && segment.value[end - 1] === " ") {
|
|
28120
|
+
end--;
|
|
28121
|
+
}
|
|
28122
|
+
segment.value = segment.value.slice(0, end);
|
|
28123
|
+
if (getStringWidth(segment.value) > 0) {
|
|
28025
28124
|
break;
|
|
28026
28125
|
}
|
|
28027
|
-
last--;
|
|
28028
28126
|
}
|
|
28029
|
-
|
|
28030
|
-
return string;
|
|
28031
|
-
}
|
|
28032
|
-
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
28127
|
+
return segments.map((segment) => segment.value).join("");
|
|
28033
28128
|
};
|
|
28034
28129
|
var expandTabs = (line) => {
|
|
28035
28130
|
if (!line.includes(" ")) {
|
|
28036
28131
|
return line;
|
|
28037
28132
|
}
|
|
28038
|
-
const segments = line.split(" ");
|
|
28039
28133
|
let visible = 0;
|
|
28040
28134
|
let expandedLine = "";
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
|
|
28135
|
+
let plainTextSinceTab = "";
|
|
28136
|
+
const expandPlainText = (plainText) => {
|
|
28137
|
+
const segments = plainText.split(" ");
|
|
28138
|
+
for (const [index, segment] of segments.entries()) {
|
|
28139
|
+
expandedLine += segment;
|
|
28140
|
+
plainTextSinceTab += segment;
|
|
28141
|
+
if (index < segments.length - 1) {
|
|
28142
|
+
visible += getStringWidth(plainTextSinceTab);
|
|
28143
|
+
plainTextSinceTab = "";
|
|
28144
|
+
const spaces = TAB_SIZE - visible % TAB_SIZE;
|
|
28145
|
+
expandedLine += " ".repeat(spaces);
|
|
28146
|
+
visible += spaces;
|
|
28147
|
+
}
|
|
28048
28148
|
}
|
|
28049
|
-
}
|
|
28149
|
+
};
|
|
28150
|
+
forEachSegment(line, expandPlainText, (escape3) => {
|
|
28151
|
+
expandedLine += escape3;
|
|
28152
|
+
});
|
|
28050
28153
|
return expandedLine;
|
|
28051
28154
|
};
|
|
28155
|
+
var restoreStylesAcrossRows = (preString) => {
|
|
28156
|
+
let returnValue = "";
|
|
28157
|
+
let activeHyperlink;
|
|
28158
|
+
const activeStyles = [];
|
|
28159
|
+
let index = 0;
|
|
28160
|
+
let copiedIndex = 0;
|
|
28161
|
+
while (index < preString.length) {
|
|
28162
|
+
ROW_BOUNDARY_REGEX.lastIndex = index;
|
|
28163
|
+
const boundary = ROW_BOUNDARY_REGEX.exec(preString);
|
|
28164
|
+
if (!boundary) {
|
|
28165
|
+
break;
|
|
28166
|
+
}
|
|
28167
|
+
index = boundary.index;
|
|
28168
|
+
if (boundary[0] !== "\n") {
|
|
28169
|
+
const escape3 = matchAnsiEscape(preString, index);
|
|
28170
|
+
if (!escape3) {
|
|
28171
|
+
index++;
|
|
28172
|
+
continue;
|
|
28173
|
+
}
|
|
28174
|
+
const { groups } = escape3;
|
|
28175
|
+
if (groups.sgr !== void 0) {
|
|
28176
|
+
applySgrParameters(groups.sgr, activeStyles);
|
|
28177
|
+
} else if (groups.uri !== void 0) {
|
|
28178
|
+
activeHyperlink = groups.uri.length === 0 ? void 0 : { parameters: groups.parameters, uri: groups.uri };
|
|
28179
|
+
}
|
|
28180
|
+
index += escape3[0].length;
|
|
28181
|
+
continue;
|
|
28182
|
+
}
|
|
28183
|
+
returnValue += preString.slice(copiedIndex, index);
|
|
28184
|
+
if (index > copiedIndex) {
|
|
28185
|
+
if (activeHyperlink) {
|
|
28186
|
+
returnValue += wrapAnsiHyperlink("");
|
|
28187
|
+
}
|
|
28188
|
+
returnValue += getClosingSgrSequence(activeStyles);
|
|
28189
|
+
}
|
|
28190
|
+
returnValue += "\n";
|
|
28191
|
+
index++;
|
|
28192
|
+
copiedIndex = index;
|
|
28193
|
+
if (index < preString.length && preString[index] !== "\n") {
|
|
28194
|
+
const openingStyles = [...activeStyles];
|
|
28195
|
+
applyLeadingSgrResets(preString, index, openingStyles);
|
|
28196
|
+
returnValue += getOpeningSgrSequence(openingStyles);
|
|
28197
|
+
if (activeHyperlink) {
|
|
28198
|
+
returnValue += wrapAnsiHyperlink(activeHyperlink.uri, activeHyperlink.parameters);
|
|
28199
|
+
}
|
|
28200
|
+
}
|
|
28201
|
+
}
|
|
28202
|
+
return returnValue + preString.slice(copiedIndex);
|
|
28203
|
+
};
|
|
28052
28204
|
var exec = (string, columns, options = {}) => {
|
|
28053
28205
|
if (options.trim !== false && string.trim() === "") {
|
|
28054
28206
|
return "";
|
|
28055
28207
|
}
|
|
28056
|
-
|
|
28057
|
-
let escapeUrl;
|
|
28058
|
-
const activeStyles = [];
|
|
28059
|
-
const lengths = wordLengths(string);
|
|
28208
|
+
const words = splitWords(string);
|
|
28060
28209
|
let rows2 = [""];
|
|
28061
|
-
|
|
28062
|
-
|
|
28063
|
-
|
|
28064
|
-
|
|
28065
|
-
|
|
28066
|
-
if (
|
|
28210
|
+
let rowLength = 0;
|
|
28211
|
+
let trimmedRowIndex = -1;
|
|
28212
|
+
let isFirstWord = true;
|
|
28213
|
+
for (const word of words) {
|
|
28214
|
+
const rowIndex = rows2.length - 1;
|
|
28215
|
+
if (options.trim !== false && trimmedRowIndex !== rowIndex) {
|
|
28216
|
+
const row = rows2[rowIndex];
|
|
28217
|
+
const trimmedRow = row.trimStart();
|
|
28218
|
+
if (trimmedRow.length !== row.length) {
|
|
28219
|
+
rows2[rowIndex] = trimmedRow;
|
|
28220
|
+
rowLength = getWidth(trimmedRow);
|
|
28221
|
+
}
|
|
28222
|
+
if (trimmedRow.length > 0) {
|
|
28223
|
+
trimmedRowIndex = rowIndex;
|
|
28224
|
+
}
|
|
28225
|
+
}
|
|
28226
|
+
if (isFirstWord) {
|
|
28227
|
+
isFirstWord = false;
|
|
28228
|
+
} else {
|
|
28067
28229
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
28068
28230
|
rows2.push("");
|
|
28069
28231
|
rowLength = 0;
|
|
@@ -28073,69 +28235,48 @@ var exec = (string, columns, options = {}) => {
|
|
|
28073
28235
|
rowLength++;
|
|
28074
28236
|
}
|
|
28075
28237
|
}
|
|
28076
|
-
if (options.hard && options.wordWrap !== false &&
|
|
28238
|
+
if (options.hard && options.wordWrap !== false && word.width > columns) {
|
|
28077
28239
|
const remainingColumns = columns - rowLength;
|
|
28078
|
-
const breaksStartingThisLine = 1 + Math.floor((
|
|
28079
|
-
const breaksStartingNextLine = Math.floor((
|
|
28240
|
+
const breaksStartingThisLine = 1 + Math.floor((word.width - remainingColumns - 1) / columns);
|
|
28241
|
+
const breaksStartingNextLine = Math.floor((word.width - 1) / columns);
|
|
28080
28242
|
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
28081
28243
|
rows2.push("");
|
|
28244
|
+
rowLength = 0;
|
|
28082
28245
|
}
|
|
28083
|
-
wrapWord(rows2, word, columns);
|
|
28246
|
+
rowLength = wrapWord(rows2, word.value, columns, rowLength);
|
|
28084
28247
|
continue;
|
|
28085
28248
|
}
|
|
28086
|
-
if (rowLength +
|
|
28249
|
+
if (rowLength + word.width > columns && rowLength > 0 && word.width > 0) {
|
|
28087
28250
|
if (options.wordWrap === false && rowLength < columns) {
|
|
28088
|
-
wrapWord(rows2, word, columns);
|
|
28251
|
+
rowLength = wrapWord(rows2, word.value, columns, rowLength);
|
|
28089
28252
|
continue;
|
|
28090
28253
|
}
|
|
28091
28254
|
rows2.push("");
|
|
28255
|
+
rowLength = 0;
|
|
28092
28256
|
}
|
|
28093
|
-
if (rowLength +
|
|
28094
|
-
wrapWord(rows2, word, columns);
|
|
28257
|
+
if (rowLength + word.width > columns && options.wordWrap === false) {
|
|
28258
|
+
rowLength = wrapWord(rows2, word.value, columns, rowLength);
|
|
28095
28259
|
continue;
|
|
28096
28260
|
}
|
|
28097
|
-
rows2[rows2.length - 1] += word;
|
|
28261
|
+
rows2[rows2.length - 1] += word.value;
|
|
28262
|
+
rowLength += word.width;
|
|
28098
28263
|
}
|
|
28099
28264
|
if (options.trim !== false) {
|
|
28100
28265
|
rows2 = rows2.map((row) => stringVisibleTrimSpacesRight(row));
|
|
28101
28266
|
}
|
|
28102
|
-
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
|
|
28107
|
-
|
|
28108
|
-
|
|
28109
|
-
|
|
28110
|
-
|
|
28111
|
-
|
|
28112
|
-
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
28113
|
-
}
|
|
28114
|
-
} else if (character === ANSI_ESCAPE_CSI) {
|
|
28115
|
-
const { groups } = ANSI_ESCAPE_CSI_REGEX.exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
28116
|
-
if (groups.sgr !== void 0) {
|
|
28117
|
-
applySgrParameters(groups.sgr, activeStyles);
|
|
28118
|
-
}
|
|
28119
|
-
}
|
|
28120
|
-
if (pre[index + 1] === "\n") {
|
|
28121
|
-
if (escapeUrl) {
|
|
28122
|
-
returnValue += wrapAnsiHyperlink("");
|
|
28123
|
-
}
|
|
28124
|
-
returnValue += getClosingSgrSequence(activeStyles);
|
|
28125
|
-
} else if (character === "\n") {
|
|
28126
|
-
const openingStyles = [...activeStyles];
|
|
28127
|
-
applyLeadingSgrResets(preString.slice(preStringIndex + 1), openingStyles);
|
|
28128
|
-
returnValue += getOpeningSgrSequence(openingStyles);
|
|
28129
|
-
if (escapeUrl) {
|
|
28130
|
-
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
28131
|
-
}
|
|
28132
|
-
}
|
|
28133
|
-
preStringIndex += character.length;
|
|
28134
|
-
}
|
|
28135
|
-
return returnValue;
|
|
28267
|
+
return restoreStylesAcrossRows(rows2.join("\n"));
|
|
28268
|
+
};
|
|
28269
|
+
var normalizeText = (string) => {
|
|
28270
|
+
let normalizedString = "";
|
|
28271
|
+
forEachSegment(string, (plainText) => {
|
|
28272
|
+
normalizedString += plainText.normalize();
|
|
28273
|
+
}, (escape3) => {
|
|
28274
|
+
normalizedString += escape3;
|
|
28275
|
+
});
|
|
28276
|
+
return normalizedString;
|
|
28136
28277
|
};
|
|
28137
28278
|
function wrapAnsi(string, columns, options) {
|
|
28138
|
-
return String(string)
|
|
28279
|
+
return normalizeText(String(string)).replaceAll("\r\n", "\n").split("\n").map((line) => exec(expandTabs(line), columns, options)).join("\n");
|
|
28139
28280
|
}
|
|
28140
28281
|
|
|
28141
28282
|
// node_modules/terminal-size/index.js
|
|
@@ -51206,6 +51347,7 @@ var PROVIDER_CATALOGS = Object.freeze({
|
|
|
51206
51347
|
rosterLimitsAuthoritative: true
|
|
51207
51348
|
},
|
|
51208
51349
|
"cursor-oauth": { relay: true },
|
|
51350
|
+
"devin-oauth": { relay: true },
|
|
51209
51351
|
"cursor-api": { relay: true },
|
|
51210
51352
|
// The models.dev listing id of the Go gateway: a relay catalog, not a
|
|
51211
51353
|
// selectable provider (the model lookup needs it flagged as a relay).
|
|
@@ -59529,6 +59671,7 @@ var PROVIDER_DISPLAY_NAMES = /* @__PURE__ */ new Map([
|
|
|
59529
59671
|
["command-code-oauth", "Command Code"],
|
|
59530
59672
|
["mimo-oauth", "MiMo"],
|
|
59531
59673
|
["cursor-oauth", "Cursor OAuth"],
|
|
59674
|
+
["devin-oauth", "Devin"],
|
|
59532
59675
|
["antigravity-oauth", "Antigravity OAuth"],
|
|
59533
59676
|
["openai", "OpenAI API"],
|
|
59534
59677
|
["openai-api", "OpenAI API"],
|
|
@@ -59613,6 +59756,7 @@ var PROVIDER_DISPLAY_RANKS = {
|
|
|
59613
59756
|
"mimo-oauth": 34,
|
|
59614
59757
|
"antigravity-oauth": 31,
|
|
59615
59758
|
"cursor-oauth": 32,
|
|
59759
|
+
"devin-oauth": 32.5,
|
|
59616
59760
|
"opencode-go-oauth": 34.5,
|
|
59617
59761
|
openai: 40,
|
|
59618
59762
|
"openai-api": 40,
|
|
@@ -61990,12 +62134,30 @@ function markUserDataInitialized(dataDir2) {
|
|
|
61990
62134
|
}
|
|
61991
62135
|
var ensuredDataDirs = /* @__PURE__ */ new Set();
|
|
61992
62136
|
function ensureUserDataInitialized(dataDir2) {
|
|
61993
|
-
if (!dataDir2) return;
|
|
62137
|
+
if (!dataDir2 || skipBackups()) return;
|
|
61994
62138
|
const key = normalizeDataDir(dataDir2);
|
|
61995
62139
|
if (ensuredDataDirs.has(key)) return;
|
|
61996
|
-
if (!
|
|
62140
|
+
if (!hasPublishedBackup(dataDir2)) {
|
|
62141
|
+
backupUserData(dataDir2, "initial-snapshot");
|
|
62142
|
+
if (!hasPublishedBackup(dataDir2)) return;
|
|
62143
|
+
}
|
|
61997
62144
|
ensuredDataDirs.add(key);
|
|
61998
62145
|
}
|
|
62146
|
+
function hasPublishedBackup(dataDir2) {
|
|
62147
|
+
const instanceId = readInitInstanceId(dataDir2);
|
|
62148
|
+
if (!instanceId) return false;
|
|
62149
|
+
const key = normalizeDataDir(dataDir2);
|
|
62150
|
+
const scopeDir = scopeDirFor(dataDir2);
|
|
62151
|
+
return listBackupDirsNewestFirst(scopeDir).some((name) => {
|
|
62152
|
+
try {
|
|
62153
|
+
const manifest = JSON.parse(readFileSync10(manifestPath(scopeDir, name), "utf8"));
|
|
62154
|
+
return typeof manifest?.dataDir === "string" && normalizeDataDir(manifest.dataDir) === key && manifest.instanceId === instanceId;
|
|
62155
|
+
} catch (error) {
|
|
62156
|
+
if (isAbsentBackupError(error)) return false;
|
|
62157
|
+
throw error;
|
|
62158
|
+
}
|
|
62159
|
+
});
|
|
62160
|
+
}
|
|
61999
62161
|
function skipBackups() {
|
|
62000
62162
|
return process.env.MIXDOG_SKIP_USER_DATA_BACKUP === "1" || process.env.MIXDOG_SKIP_USER_DATA_BACKUP === "true";
|
|
62001
62163
|
}
|
|
@@ -62129,6 +62291,7 @@ var {
|
|
|
62129
62291
|
setSecret: _setSecret,
|
|
62130
62292
|
deleteSecret: _deleteSecret,
|
|
62131
62293
|
hasSecret: _hasSecret,
|
|
62294
|
+
hasFallbackSecret: _hasFallbackSecret,
|
|
62132
62295
|
setSecretAsync: _setSecretAsyncImpl,
|
|
62133
62296
|
deleteSecretAsync: _deleteSecretAsyncImpl,
|
|
62134
62297
|
keychainStatus: _keychainStatus,
|