orion-super-agent-dev 0.1.22 → 0.1.23
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/out/brains/darwin-arm64/orion-brain +0 -0
- package/out/brains/darwin-x64/orion-brain +0 -0
- package/out/brains/linux-arm64/orion-brain +0 -0
- package/out/brains/linux-x64/orion-brain +0 -0
- package/out/brains/win32-x64/orion-brain.exe +0 -0
- package/out/main.js +254 -33
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/out/main.js
CHANGED
|
@@ -29206,12 +29206,13 @@ var require_duetEntry = __commonJS({
|
|
|
29206
29206
|
{
|
|
29207
29207
|
value: "planner",
|
|
29208
29208
|
label: "Planner decides",
|
|
29209
|
-
|
|
29209
|
+
// A few words each — these render as one-line row descriptions in the pickers.
|
|
29210
|
+
description: "Plans first, or hands off. Recommended."
|
|
29210
29211
|
},
|
|
29211
29212
|
{
|
|
29212
29213
|
value: "router",
|
|
29213
29214
|
label: "Router decides",
|
|
29214
|
-
description: "
|
|
29215
|
+
description: "Local model routes. No planner call."
|
|
29215
29216
|
}
|
|
29216
29217
|
];
|
|
29217
29218
|
function duetEntryLabel2(entry) {
|
|
@@ -29682,6 +29683,7 @@ var require_duetRouterModel = __commonJS({
|
|
|
29682
29683
|
loading = (async () => {
|
|
29683
29684
|
mod2.env.localModelPath = modelsDir;
|
|
29684
29685
|
mod2.env.allowLocalModels = true;
|
|
29686
|
+
mod2.env.allowRemoteModels = false;
|
|
29685
29687
|
const tokenizer = await mod2.AutoTokenizer.from_pretrained(modelId);
|
|
29686
29688
|
let model;
|
|
29687
29689
|
if (opts.dtype) {
|
|
@@ -48283,9 +48285,9 @@ var require_toolText = __commonJS({
|
|
|
48283
48285
|
const ambiguous = content.indexOf(needle, index + 1) >= 0;
|
|
48284
48286
|
return { matchStr: needle, index, ambiguous };
|
|
48285
48287
|
};
|
|
48286
|
-
const
|
|
48287
|
-
if (
|
|
48288
|
-
return
|
|
48288
|
+
const literal2 = tryOne(oldStr);
|
|
48289
|
+
if (literal2)
|
|
48290
|
+
return literal2;
|
|
48289
48291
|
const stripped = stripLineNumberPrefixes(oldStr);
|
|
48290
48292
|
if (stripped !== oldStr) {
|
|
48291
48293
|
const viaStripped = tryOne(stripped);
|
|
@@ -48605,7 +48607,7 @@ var require_transcript = __commonJS({
|
|
|
48605
48607
|
exports2.shiftSegments = shiftSegments;
|
|
48606
48608
|
exports2.formatTranscript = formatTranscript;
|
|
48607
48609
|
var TS_RE = /^(\d{2,}):(\d{2}):(\d{2})[.,](\d{3})\s+-->\s+(\d{2,}):(\d{2}):(\d{2})[.,](\d{3})/;
|
|
48608
|
-
var
|
|
48610
|
+
var TAG_RE2 = /<[^>]+>/g;
|
|
48609
48611
|
function toSeconds(h, m2, s, ms) {
|
|
48610
48612
|
return Number(h) * 3600 + Number(m2) * 60 + Number(s) + Number(ms) / 1e3;
|
|
48611
48613
|
}
|
|
@@ -48624,7 +48626,7 @@ var require_transcript = __commonJS({
|
|
|
48624
48626
|
i2 += 1;
|
|
48625
48627
|
const cueLines = [];
|
|
48626
48628
|
while (i2 < lines.length && lines[i2].trim()) {
|
|
48627
|
-
const cleaned = lines[i2].replace(
|
|
48629
|
+
const cleaned = lines[i2].replace(TAG_RE2, "").trim();
|
|
48628
48630
|
if (cleaned)
|
|
48629
48631
|
cueLines.push(cleaned);
|
|
48630
48632
|
i2 += 1;
|
|
@@ -55679,14 +55681,14 @@ var require_extractor = __commonJS({
|
|
|
55679
55681
|
}
|
|
55680
55682
|
return "";
|
|
55681
55683
|
}
|
|
55682
|
-
function moduleNameFromSourceLiteral(
|
|
55683
|
-
const stripped =
|
|
55684
|
+
function moduleNameFromSourceLiteral(literal2) {
|
|
55685
|
+
const stripped = literal2.replace(/^['"]|['"]$/g, "");
|
|
55684
55686
|
const parts2 = stripped.split(/[\\/]/);
|
|
55685
55687
|
const last = parts2[parts2.length - 1] || stripped;
|
|
55686
55688
|
return last.replace(/\.(d\.)?ts$/, "").replace(/\.js$/, "");
|
|
55687
55689
|
}
|
|
55688
|
-
function moduleSpecFromSourceLiteral(
|
|
55689
|
-
return
|
|
55690
|
+
function moduleSpecFromSourceLiteral(literal2) {
|
|
55691
|
+
return literal2.replace(/^['"]|['"]$/g, "");
|
|
55690
55692
|
}
|
|
55691
55693
|
function extractFromMatches(matches, path14, allLines) {
|
|
55692
55694
|
const symbols = [];
|
|
@@ -61183,15 +61185,15 @@ var require_ruleMatcher = __commonJS({
|
|
|
61183
61185
|
home: input.home
|
|
61184
61186
|
}))
|
|
61185
61187
|
});
|
|
61186
|
-
const
|
|
61188
|
+
const literal2 = trips(input.literal);
|
|
61187
61189
|
for (const form of input.resolvedForms) {
|
|
61188
61190
|
if (form === input.literal)
|
|
61189
61191
|
continue;
|
|
61190
61192
|
const resolved = trips(form);
|
|
61191
|
-
if (resolved.protected && !
|
|
61193
|
+
if (resolved.protected && !literal2.protected) {
|
|
61192
61194
|
return `refused: ${input.literal} resolves to ${form}, a protected path \u2014 address the real target directly so the write can be reviewed`;
|
|
61193
61195
|
}
|
|
61194
|
-
if (resolved.deny && !
|
|
61196
|
+
if (resolved.deny && !literal2.deny) {
|
|
61195
61197
|
return `refused: ${input.literal} resolves to ${form}, which a permission rule denies`;
|
|
61196
61198
|
}
|
|
61197
61199
|
}
|
|
@@ -62553,13 +62555,13 @@ var require_toolExecutor = __commonJS({
|
|
|
62553
62555
|
const fileNormalized = fileContent.replace(/\s+/g, " ");
|
|
62554
62556
|
const normIdx = fileNormalized.indexOf(oldNormalized);
|
|
62555
62557
|
if (normIdx >= 0 && oldNormalized.length > 0) {
|
|
62556
|
-
const
|
|
62557
|
-
if (
|
|
62558
|
+
const literal2 = findFuzzyLiteralSlice(fileContent, oldStr);
|
|
62559
|
+
if (literal2) {
|
|
62558
62560
|
return [
|
|
62559
62561
|
`old_string not found in ${path15} \u2014 but a whitespace-different version exists.`,
|
|
62560
62562
|
`Likely cause: invented indentation/tabs/spaces. Use the exact bytes from the file:`,
|
|
62561
62563
|
"---",
|
|
62562
|
-
clipLines(
|
|
62564
|
+
clipLines(literal2, 8),
|
|
62563
62565
|
"---",
|
|
62564
62566
|
`Re-read the file with read_file if needed and retry edit_file with the literal text above.`
|
|
62565
62567
|
].join("\n");
|
|
@@ -84445,12 +84447,12 @@ function reorderBidi(characters) {
|
|
|
84445
84447
|
if (!needsBidi() || characters.length === 0) {
|
|
84446
84448
|
return characters;
|
|
84447
84449
|
}
|
|
84448
|
-
const
|
|
84449
|
-
if (!hasRTLCharacters(
|
|
84450
|
+
const plainText2 = characters.map((c3) => c3.value).join("");
|
|
84451
|
+
if (!hasRTLCharacters(plainText2)) {
|
|
84450
84452
|
return characters;
|
|
84451
84453
|
}
|
|
84452
84454
|
const bidi = getBidi();
|
|
84453
|
-
const { levels } = bidi.getEmbeddingLevels(
|
|
84455
|
+
const { levels } = bidi.getEmbeddingLevels(plainText2, "auto");
|
|
84454
84456
|
const charLevels = [];
|
|
84455
84457
|
let offset = 0;
|
|
84456
84458
|
for (let i2 = 0; i2 < characters.length; i2++) {
|
|
@@ -85238,14 +85240,14 @@ function applyStylesToWrappedText(wrappedPlain, segments, charToSegment, origina
|
|
|
85238
85240
|
}
|
|
85239
85241
|
return resultLines.join("\n");
|
|
85240
85242
|
}
|
|
85241
|
-
function wrapWithSoftWrap(
|
|
85243
|
+
function wrapWithSoftWrap(plainText2, maxWidth, textWrap) {
|
|
85242
85244
|
if (textWrap !== "wrap" && textWrap !== "wrap-trim") {
|
|
85243
85245
|
return {
|
|
85244
|
-
wrapped: wrapText(
|
|
85246
|
+
wrapped: wrapText(plainText2, maxWidth, textWrap),
|
|
85245
85247
|
softWrap: void 0
|
|
85246
85248
|
};
|
|
85247
85249
|
}
|
|
85248
|
-
const origLines =
|
|
85250
|
+
const origLines = plainText2.split("\n");
|
|
85249
85251
|
const outLines = [];
|
|
85250
85252
|
const softWrap = [];
|
|
85251
85253
|
for (const orig of origLines) {
|
|
@@ -85361,16 +85363,16 @@ function renderNodeToOutput(node, output, {
|
|
|
85361
85363
|
node,
|
|
85362
85364
|
inheritedBackgroundColor ? { backgroundColor: inheritedBackgroundColor } : void 0
|
|
85363
85365
|
);
|
|
85364
|
-
const
|
|
85365
|
-
if (
|
|
85366
|
+
const plainText2 = segments.map((s) => s.text).join("");
|
|
85367
|
+
if (plainText2.length > 0) {
|
|
85366
85368
|
const maxWidth = Math.min(get_max_width_default(yogaNode), output.width - x2);
|
|
85367
85369
|
const textWrap = node.style.textWrap ?? "wrap";
|
|
85368
|
-
const needsWrapping = widestLine(
|
|
85370
|
+
const needsWrapping = widestLine(plainText2) > maxWidth;
|
|
85369
85371
|
let text;
|
|
85370
85372
|
let softWrap;
|
|
85371
85373
|
if (needsWrapping && segments.length === 1) {
|
|
85372
85374
|
const segment = segments[0];
|
|
85373
|
-
const w2 = wrapWithSoftWrap(
|
|
85375
|
+
const w2 = wrapWithSoftWrap(plainText2, maxWidth, textWrap);
|
|
85374
85376
|
softWrap = w2.softWrap;
|
|
85375
85377
|
text = w2.wrapped.split("\n").map((line) => {
|
|
85376
85378
|
let styled = applyTextStyles(line, segment.styles);
|
|
@@ -85380,14 +85382,14 @@ function renderNodeToOutput(node, output, {
|
|
|
85380
85382
|
return styled;
|
|
85381
85383
|
}).join("\n");
|
|
85382
85384
|
} else if (needsWrapping) {
|
|
85383
|
-
const w2 = wrapWithSoftWrap(
|
|
85385
|
+
const w2 = wrapWithSoftWrap(plainText2, maxWidth, textWrap);
|
|
85384
85386
|
softWrap = w2.softWrap;
|
|
85385
85387
|
const charToSegment = buildCharToSegmentMap(segments);
|
|
85386
85388
|
text = applyStylesToWrappedText(
|
|
85387
85389
|
w2.wrapped,
|
|
85388
85390
|
segments,
|
|
85389
85391
|
charToSegment,
|
|
85390
|
-
|
|
85392
|
+
plainText2,
|
|
85391
85393
|
textWrap === "wrap-trim"
|
|
85392
85394
|
);
|
|
85393
85395
|
} else {
|
|
@@ -89545,7 +89547,7 @@ function fmtTok(n) {
|
|
|
89545
89547
|
}
|
|
89546
89548
|
function pct(part, whole) {
|
|
89547
89549
|
if (whole <= 0) return "0%";
|
|
89548
|
-
const v2 = (part / whole * 100).toFixed(1).replace(/\.0$/, "");
|
|
89550
|
+
const v2 = Math.min(100, part / whole * 100).toFixed(1).replace(/\.0$/, "");
|
|
89549
89551
|
return `${v2}%`;
|
|
89550
89552
|
}
|
|
89551
89553
|
function gridRows(allocation) {
|
|
@@ -90740,6 +90742,12 @@ async function resolveListedModel(ctx, model) {
|
|
|
90740
90742
|
return void 0;
|
|
90741
90743
|
}
|
|
90742
90744
|
}
|
|
90745
|
+
function windowShrinkAdvisory(heldTokens, ceiling, triggerRatio) {
|
|
90746
|
+
if (!(heldTokens > 0) || !(ceiling > 0)) return null;
|
|
90747
|
+
if (heldTokens < ceiling * triggerRatio) return null;
|
|
90748
|
+
const k = (n) => `${Math.round(n / 1e3)}k`;
|
|
90749
|
+
return `This conversation holds ~${k(heldTokens)} tokens against a ${k(ceiling)} window \u2014 it will be compacted automatically on your next message (original ask and recent turns kept verbatim, the middle summarized). Run /compact to do it now.`;
|
|
90750
|
+
}
|
|
90743
90751
|
async function applyModel(ctx, sid, modelId, provider, label, contextWindow) {
|
|
90744
90752
|
if (provider && provider !== ctx.appStore.getState().provider) {
|
|
90745
90753
|
await ctx.bridge.rpc("set_provider", { session_id: sid, provider }).catch(() => void 0);
|
|
@@ -90756,6 +90764,12 @@ async function applyModel(ctx, sid, modelId, provider, label, contextWindow) {
|
|
|
90756
90764
|
// (A missing/zero window leaves the current value so we never blank the gauge.)
|
|
90757
90765
|
contextWindow: s.contextWindowOverride == null && contextWindow && contextWindow > 0 ? contextWindow : s.contextWindow
|
|
90758
90766
|
}));
|
|
90767
|
+
{
|
|
90768
|
+
const s = ctx.appStore.getState();
|
|
90769
|
+
const ceiling = s.contextWindowOverride ?? (contextWindow && contextWindow > 0 ? contextWindow : 0);
|
|
90770
|
+
const advisory = windowShrinkAdvisory(s.contextTokens, ceiling, s.contextTriggerRatio);
|
|
90771
|
+
if (advisory) ctx.print(advisory, "warning");
|
|
90772
|
+
}
|
|
90759
90773
|
try {
|
|
90760
90774
|
saveConfig({ model: modelId, provider: ctx.appStore.getState().provider });
|
|
90761
90775
|
} catch {
|
|
@@ -92215,6 +92229,11 @@ ${(0, import_client_core20.duetRoutingSummaryLine)(await (0, import_client_core2
|
|
|
92215
92229
|
contextWindowOverride: cw
|
|
92216
92230
|
}));
|
|
92217
92231
|
ctx.print(`Context window: ${cw ?? "model default"}`, "success");
|
|
92232
|
+
if (cw) {
|
|
92233
|
+
const s2 = ctx.appStore.getState();
|
|
92234
|
+
const advisory = windowShrinkAdvisory(s2.contextTokens, cw, s2.contextTriggerRatio);
|
|
92235
|
+
if (advisory) ctx.print(advisory, "warning");
|
|
92236
|
+
}
|
|
92218
92237
|
}
|
|
92219
92238
|
},
|
|
92220
92239
|
{
|
|
@@ -93317,6 +93336,7 @@ function initialAppState(partial) {
|
|
|
93317
93336
|
contextTokens: 0,
|
|
93318
93337
|
contextWindow: 0,
|
|
93319
93338
|
contextWindowOverride: null,
|
|
93339
|
+
contextTriggerRatio: 0.9,
|
|
93320
93340
|
contextBreakdown: null,
|
|
93321
93341
|
signedIn: false,
|
|
93322
93342
|
accountTier: null,
|
|
@@ -93793,6 +93813,10 @@ function renderLane(transcript, app, ev) {
|
|
|
93793
93813
|
...s,
|
|
93794
93814
|
contextTokens: typeof d2.tokens === "number" ? d2.tokens : s.contextTokens,
|
|
93795
93815
|
contextWindow: typeof d2.window === "number" ? d2.window : s.contextWindow,
|
|
93816
|
+
// The backend's enforcement threshold rides the event; a garbage or absent
|
|
93817
|
+
// ratio keeps the previous value (0.9 default) rather than skewing the
|
|
93818
|
+
// shrink advisory.
|
|
93819
|
+
contextTriggerRatio: typeof d2.trigger_ratio === "number" && Number.isFinite(d2.trigger_ratio) && d2.trigger_ratio > 0 && d2.trigger_ratio <= 1 ? d2.trigger_ratio : s.contextTriggerRatio,
|
|
93796
93820
|
contextBreakdown: d2.breakdown && typeof d2.breakdown === "object" ? d2.breakdown : s.contextBreakdown
|
|
93797
93821
|
}));
|
|
93798
93822
|
break;
|
|
@@ -109734,10 +109758,19 @@ function GradientText({
|
|
|
109734
109758
|
var EOL = "\n";
|
|
109735
109759
|
var BLOCKQUOTE_BAR = "\u2502";
|
|
109736
109760
|
var configured = false;
|
|
109761
|
+
var DEL_RULE = /^~~(?=[^\s~])([\s\S]*?[^\s~])~~(?=[^~]|$)/;
|
|
109737
109762
|
function configureMarked() {
|
|
109738
109763
|
if (configured) return;
|
|
109739
109764
|
configured = true;
|
|
109740
|
-
g.use({
|
|
109765
|
+
g.use({
|
|
109766
|
+
tokenizer: {
|
|
109767
|
+
del(src) {
|
|
109768
|
+
const cap = DEL_RULE.exec(src);
|
|
109769
|
+
if (!cap) return void 0;
|
|
109770
|
+
return { type: "del", raw: cap[0], text: cap[1], tokens: this.lexer.inlineTokens(cap[1]) };
|
|
109771
|
+
}
|
|
109772
|
+
}
|
|
109773
|
+
});
|
|
109741
109774
|
}
|
|
109742
109775
|
function gradientHeading(text) {
|
|
109743
109776
|
const chars = [...text];
|
|
@@ -109827,6 +109860,8 @@ function formatToken(token, theme, listDepth = 0, orderedListNumber = null, pare
|
|
|
109827
109860
|
return import_chalk3.default.italic(kids(token, 0, null, parent));
|
|
109828
109861
|
case "strong":
|
|
109829
109862
|
return import_chalk3.default.bold(kids(token, 0, null, parent));
|
|
109863
|
+
case "del":
|
|
109864
|
+
return import_chalk3.default.strikethrough(kids(token, 0, null, parent));
|
|
109830
109865
|
case "heading": {
|
|
109831
109866
|
const t = token;
|
|
109832
109867
|
const grad = gradientHeading((0, import_strip_ansi2.default)(kids(token)));
|
|
@@ -109892,11 +109927,197 @@ function formatToken(token, theme, listDepth = 0, orderedListNumber = null, pare
|
|
|
109892
109927
|
}
|
|
109893
109928
|
case "escape":
|
|
109894
109929
|
return token.text;
|
|
109930
|
+
case "html":
|
|
109931
|
+
return token.text;
|
|
109895
109932
|
default:
|
|
109896
109933
|
return "";
|
|
109897
109934
|
}
|
|
109898
109935
|
}
|
|
109899
109936
|
|
|
109937
|
+
// src/components/markdown/inlineHtml.ts
|
|
109938
|
+
var STYLE_TAGS = {
|
|
109939
|
+
b: "strong",
|
|
109940
|
+
strong: "strong",
|
|
109941
|
+
i: "em",
|
|
109942
|
+
em: "em",
|
|
109943
|
+
del: "del",
|
|
109944
|
+
s: "del",
|
|
109945
|
+
strike: "del",
|
|
109946
|
+
code: "codespan",
|
|
109947
|
+
kbd: "codespan"
|
|
109948
|
+
};
|
|
109949
|
+
var TRANSPARENT_TAGS = /* @__PURE__ */ new Set([
|
|
109950
|
+
"u",
|
|
109951
|
+
"ins",
|
|
109952
|
+
"mark",
|
|
109953
|
+
"small",
|
|
109954
|
+
"sub",
|
|
109955
|
+
"sup",
|
|
109956
|
+
"abbr",
|
|
109957
|
+
"cite",
|
|
109958
|
+
"q",
|
|
109959
|
+
"samp",
|
|
109960
|
+
"var",
|
|
109961
|
+
"tt",
|
|
109962
|
+
"span",
|
|
109963
|
+
"summary",
|
|
109964
|
+
"details"
|
|
109965
|
+
]);
|
|
109966
|
+
var TAG_RE = /^<(\/?)([A-Za-z][A-Za-z0-9-]*)((?:\s+[A-Za-z_:][-\w.:]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*(\/?)>$/;
|
|
109967
|
+
function parseTag(raw) {
|
|
109968
|
+
const m2 = TAG_RE.exec(raw.trim());
|
|
109969
|
+
if (!m2) return null;
|
|
109970
|
+
return { close: m2[1] === "/", name: m2[2].toLowerCase(), attrs: m2[3] ?? "", selfClosing: m2[4] === "/" };
|
|
109971
|
+
}
|
|
109972
|
+
function attr(attrs, name2) {
|
|
109973
|
+
const m2 = new RegExp(`${name2}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i").exec(attrs);
|
|
109974
|
+
return m2 ? m2[1] ?? m2[2] ?? m2[3] : void 0;
|
|
109975
|
+
}
|
|
109976
|
+
function plainText(tokens) {
|
|
109977
|
+
return tokens.map((t) => {
|
|
109978
|
+
const tk = t;
|
|
109979
|
+
if (tk.tokens?.length) return plainText(tk.tokens);
|
|
109980
|
+
return tk.text ?? tk.raw ?? "";
|
|
109981
|
+
}).join("");
|
|
109982
|
+
}
|
|
109983
|
+
function literal(raw) {
|
|
109984
|
+
return { type: "text", raw, text: raw };
|
|
109985
|
+
}
|
|
109986
|
+
function foldInlineTokens(tokens) {
|
|
109987
|
+
const out2 = [];
|
|
109988
|
+
let i2 = 0;
|
|
109989
|
+
while (i2 < tokens.length) {
|
|
109990
|
+
const t = tokens[i2];
|
|
109991
|
+
if (t.type !== "html") {
|
|
109992
|
+
const container = t;
|
|
109993
|
+
if (container.tokens?.length) container.tokens = foldInlineTokens(container.tokens);
|
|
109994
|
+
out2.push(t);
|
|
109995
|
+
i2 += 1;
|
|
109996
|
+
continue;
|
|
109997
|
+
}
|
|
109998
|
+
const raw = t.raw;
|
|
109999
|
+
if (raw.startsWith("<!--")) {
|
|
110000
|
+
i2 += 1;
|
|
110001
|
+
continue;
|
|
110002
|
+
}
|
|
110003
|
+
const tag = parseTag(raw);
|
|
110004
|
+
if (!tag) {
|
|
110005
|
+
out2.push(literal(raw));
|
|
110006
|
+
i2 += 1;
|
|
110007
|
+
continue;
|
|
110008
|
+
}
|
|
110009
|
+
if (tag.name === "br" || tag.name === "hr") {
|
|
110010
|
+
out2.push({ type: "br", raw });
|
|
110011
|
+
i2 += 1;
|
|
110012
|
+
continue;
|
|
110013
|
+
}
|
|
110014
|
+
if (tag.name === "wbr") {
|
|
110015
|
+
i2 += 1;
|
|
110016
|
+
continue;
|
|
110017
|
+
}
|
|
110018
|
+
if (tag.name === "img" && !tag.close) {
|
|
110019
|
+
const src = attr(tag.attrs, "src");
|
|
110020
|
+
const alt = attr(tag.attrs, "alt");
|
|
110021
|
+
out2.push(src ? { type: "image", raw, href: src, text: alt ?? src, title: null } : literal(raw));
|
|
110022
|
+
i2 += 1;
|
|
110023
|
+
continue;
|
|
110024
|
+
}
|
|
110025
|
+
const style2 = STYLE_TAGS[tag.name];
|
|
110026
|
+
const transparent = TRANSPARENT_TAGS.has(tag.name);
|
|
110027
|
+
const isLink = tag.name === "a";
|
|
110028
|
+
if (tag.close || tag.selfClosing || !style2 && !transparent && !isLink) {
|
|
110029
|
+
out2.push(literal(raw));
|
|
110030
|
+
i2 += 1;
|
|
110031
|
+
continue;
|
|
110032
|
+
}
|
|
110033
|
+
let depth = 0;
|
|
110034
|
+
let close = -1;
|
|
110035
|
+
for (let j2 = i2 + 1; j2 < tokens.length; j2++) {
|
|
110036
|
+
const tj = tokens[j2];
|
|
110037
|
+
if (tj.type !== "html") continue;
|
|
110038
|
+
const pj = parseTag(tj.raw);
|
|
110039
|
+
if (!pj || pj.name !== tag.name) continue;
|
|
110040
|
+
if (pj.close) {
|
|
110041
|
+
if (depth === 0) {
|
|
110042
|
+
close = j2;
|
|
110043
|
+
break;
|
|
110044
|
+
}
|
|
110045
|
+
depth -= 1;
|
|
110046
|
+
} else if (!pj.selfClosing) {
|
|
110047
|
+
depth += 1;
|
|
110048
|
+
}
|
|
110049
|
+
}
|
|
110050
|
+
if (close === -1) {
|
|
110051
|
+
out2.push(literal(raw));
|
|
110052
|
+
i2 += 1;
|
|
110053
|
+
continue;
|
|
110054
|
+
}
|
|
110055
|
+
const inner = foldInlineTokens(tokens.slice(i2 + 1, close));
|
|
110056
|
+
const seg2 = tokens.slice(i2, close + 1).map((x2) => x2.raw ?? "").join("");
|
|
110057
|
+
if (style2 === "codespan") {
|
|
110058
|
+
out2.push({ type: "codespan", raw: seg2, text: plainText(inner) });
|
|
110059
|
+
} else if (style2) {
|
|
110060
|
+
out2.push({ type: style2, raw: seg2, text: plainText(inner), tokens: inner });
|
|
110061
|
+
} else if (isLink) {
|
|
110062
|
+
const href = attr(tag.attrs, "href");
|
|
110063
|
+
if (href && /^(https?:|mailto:)/i.test(href)) {
|
|
110064
|
+
out2.push({ type: "link", raw: seg2, href, title: null, text: plainText(inner), tokens: inner });
|
|
110065
|
+
} else {
|
|
110066
|
+
out2.push(...inner);
|
|
110067
|
+
}
|
|
110068
|
+
} else {
|
|
110069
|
+
out2.push(...inner);
|
|
110070
|
+
}
|
|
110071
|
+
i2 = close + 1;
|
|
110072
|
+
}
|
|
110073
|
+
return out2;
|
|
110074
|
+
}
|
|
110075
|
+
function htmlBlockToText(raw) {
|
|
110076
|
+
let s = raw.replace(/<!--[\s\S]*?(?:-->|$)/g, "");
|
|
110077
|
+
s = s.replace(/<\s*br\s*\/?>/gi, "\n");
|
|
110078
|
+
s = s.replace(/<li[^>]*>/gi, "\u2022 ");
|
|
110079
|
+
s = s.replace(/<\/(li|p|div|tr|ul|ol|table|details|summary|blockquote|dt|dd|dl|h[1-6])>/gi, "\n");
|
|
110080
|
+
s = s.replace(/<\/(td|th)>/gi, " ");
|
|
110081
|
+
s = s.replace(
|
|
110082
|
+
/<\/?(b|strong|i|em|u|ins|s|del|strike|mark|kbd|code|small|sub|sup|abbr|cite|q|samp|var|tt|p|div|ul|ol|table|thead|tbody|tfoot|tr|td|th|caption|colgroup|col|details|summary|figure|figcaption|a|img|span|pre|hr|wbr|blockquote|dl|dt|dd|h[1-6])(\s[^>]*)?\/?>/gi,
|
|
110083
|
+
""
|
|
110084
|
+
);
|
|
110085
|
+
return s.replace(/[ \t]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
110086
|
+
}
|
|
110087
|
+
function foldMarkdownTokens(tokens) {
|
|
110088
|
+
const out2 = [];
|
|
110089
|
+
for (const t of tokens) {
|
|
110090
|
+
if (t.type === "html") {
|
|
110091
|
+
const text = htmlBlockToText(t.raw);
|
|
110092
|
+
if (text) {
|
|
110093
|
+
out2.push({ type: "paragraph", raw: t.raw, text, tokens: [literal(text)] });
|
|
110094
|
+
}
|
|
110095
|
+
continue;
|
|
110096
|
+
}
|
|
110097
|
+
if (t.type === "table") {
|
|
110098
|
+
const table = t;
|
|
110099
|
+
for (const cell2 of table.header) cell2.tokens = foldInlineTokens(cell2.tokens ?? []);
|
|
110100
|
+
for (const row of table.rows) for (const cell2 of row) cell2.tokens = foldInlineTokens(cell2.tokens ?? []);
|
|
110101
|
+
out2.push(t);
|
|
110102
|
+
continue;
|
|
110103
|
+
}
|
|
110104
|
+
if (t.type === "list") {
|
|
110105
|
+
for (const item of t.items) item.tokens = foldMarkdownTokens(item.tokens ?? []);
|
|
110106
|
+
out2.push(t);
|
|
110107
|
+
continue;
|
|
110108
|
+
}
|
|
110109
|
+
if (t.type === "blockquote") {
|
|
110110
|
+
t.tokens = foldMarkdownTokens(t.tokens ?? []);
|
|
110111
|
+
out2.push(t);
|
|
110112
|
+
continue;
|
|
110113
|
+
}
|
|
110114
|
+
const container = t;
|
|
110115
|
+
if (container.tokens?.length) container.tokens = foldInlineTokens(container.tokens);
|
|
110116
|
+
out2.push(t);
|
|
110117
|
+
}
|
|
110118
|
+
return out2;
|
|
110119
|
+
}
|
|
110120
|
+
|
|
109900
110121
|
// src/components/markdown/Markdown.tsx
|
|
109901
110122
|
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
109902
110123
|
var MIN_COL = 3;
|
|
@@ -109960,7 +110181,7 @@ function Markdown({ text, width }) {
|
|
|
109960
110181
|
const theme = useTheme();
|
|
109961
110182
|
const contentWidth = width ?? (process.stdout.columns ?? 80) - 2;
|
|
109962
110183
|
const elements = import_react19.default.useMemo(() => {
|
|
109963
|
-
const tokens = g.lexer(text);
|
|
110184
|
+
const tokens = foldMarkdownTokens(g.lexer(text));
|
|
109964
110185
|
const out2 = [];
|
|
109965
110186
|
let nonTable = "";
|
|
109966
110187
|
const flush = () => {
|
|
@@ -110944,7 +111165,7 @@ function OrionRing() {
|
|
|
110944
111165
|
|
|
110945
111166
|
// src/services/version.ts
|
|
110946
111167
|
function tuiVersion() {
|
|
110947
|
-
return "0.1.
|
|
111168
|
+
return "0.1.23".length > 0 ? "0.1.23" : null;
|
|
110948
111169
|
}
|
|
110949
111170
|
|
|
110950
111171
|
// src/components/layout/WelcomeCard.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orion-super-agent-dev",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "[dev] Orion \u2014 a terminal AI super-agent, strongest at coding. Local brain, local disk: the agent loop runs on your machine; only the metered model call leaves it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|