@talonic/mcp 0.1.100 → 0.1.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/http-server.js +114 -39
- package/dist/http-server.js.map +1 -1
- package/dist/index.js +114 -39
- package/dist/index.js.map +1 -1
- package/dist/server.js +114 -39
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -497,24 +497,34 @@ function widgetMeta(description) {
|
|
|
497
497
|
return meta;
|
|
498
498
|
}
|
|
499
499
|
var BASE_CSS = `
|
|
500
|
+
/* Ink tokens (platform ink/restructure, src/app/globals.css --void-*). */
|
|
500
501
|
:root {
|
|
501
|
-
--bg: #
|
|
502
|
-
--
|
|
503
|
-
--
|
|
502
|
+
--bg: #FFFFFF; --fg: #1B1B1F; --muted: #5B5B64; --faint: #6A6A71;
|
|
503
|
+
--border: rgba(20, 20, 30, 0.12); --divider: rgba(20, 20, 30, 0.07);
|
|
504
|
+
--accent: #512DA8; --accent-dim: rgba(81, 45, 168, 0.07); --accent-tint: #EEE8F8;
|
|
505
|
+
--good: #1F9D5B; --warn: #B97E14; --bad: #C94343;
|
|
506
|
+
--chip: #F5F5F3; --surface-2: #F5F5F3;
|
|
504
507
|
}
|
|
505
508
|
@media (prefers-color-scheme: dark) {
|
|
506
509
|
:root:not([data-theme="light"]) {
|
|
507
|
-
--bg: #
|
|
508
|
-
--
|
|
510
|
+
--bg: #101013; --fg: #EDEDEF; --muted: #A2A2AB; --faint: #86868E;
|
|
511
|
+
--border: rgba(255, 255, 255, 0.08); --divider: rgba(255, 255, 255, 0.06);
|
|
512
|
+
--accent: #C9B6F5; --accent-dim: rgba(201, 182, 245, 0.10); --accent-tint: #2A1F3D;
|
|
513
|
+
--good: #5BC98B; --warn: #E8B45A; --bad: #E36D6D;
|
|
514
|
+
--chip: #1A1A1F; --surface-2: #16161A;
|
|
509
515
|
}
|
|
510
516
|
}
|
|
511
517
|
:root[data-theme="dark"] {
|
|
512
|
-
--bg: #
|
|
513
|
-
--
|
|
518
|
+
--bg: #101013; --fg: #EDEDEF; --muted: #A2A2AB; --faint: #86868E;
|
|
519
|
+
--border: rgba(255, 255, 255, 0.08); --divider: rgba(255, 255, 255, 0.06);
|
|
520
|
+
--accent: #C9B6F5; --accent-dim: rgba(201, 182, 245, 0.10); --accent-tint: #2A1F3D;
|
|
521
|
+
--good: #5BC98B; --warn: #E8B45A; --bad: #E36D6D;
|
|
522
|
+
--chip: #1A1A1F; --surface-2: #16161A;
|
|
514
523
|
}
|
|
515
524
|
:root[data-host="mcp-apps"] { --bg: transparent; }
|
|
516
525
|
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
|
|
517
|
-
font: 14px/1.
|
|
526
|
+
font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
527
|
+
-webkit-font-smoothing: antialiased; }
|
|
518
528
|
.root { padding: 20px; box-sizing: border-box; }
|
|
519
529
|
* { box-sizing: border-box; }
|
|
520
530
|
.empty { color: var(--muted); padding: 28px; text-align: center; }
|
|
@@ -522,10 +532,26 @@ var BASE_CSS = `
|
|
|
522
532
|
.small { font-size: 12px; }
|
|
523
533
|
.header { display: flex; align-items: flex-start; justify-content: space-between;
|
|
524
534
|
gap: 12px; margin-bottom: 16px; }
|
|
525
|
-
.title { font-weight: 600; }
|
|
526
|
-
.subtitle { color: var(--
|
|
535
|
+
.title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
|
|
536
|
+
.subtitle { color: var(--faint); font-size: 12px; }
|
|
537
|
+
.eyebrow { color: var(--faint); font-size: 12px; font-weight: 500; margin-bottom: 2px; }
|
|
538
|
+
.prose { font-size: 14.5px; line-height: 1.6; color: var(--fg); }
|
|
539
|
+
.prose p { margin: 0 0 10px; }
|
|
540
|
+
.prose p:last-child, .prose ul:last-child, .prose ol:last-child { margin-bottom: 0; }
|
|
541
|
+
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 20px; }
|
|
542
|
+
.prose li { margin: 3px 0; }
|
|
543
|
+
.prose h3, .prose h4 { font-size: 14.5px; font-weight: 600; margin: 14px 0 6px; }
|
|
544
|
+
.prose code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--chip);
|
|
545
|
+
border: 1px solid var(--divider); border-radius: 4px; padding: 0 4px; }
|
|
546
|
+
.prose strong { font-weight: 600; }
|
|
547
|
+
.prose a { color: var(--accent); text-decoration: none; }
|
|
548
|
+
.prose a:hover { text-decoration: underline; }
|
|
549
|
+
.prose table { margin: 6px 0 12px; }
|
|
550
|
+
.section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--divider); }
|
|
551
|
+
.section-label { color: var(--faint); font-size: 12px; font-weight: 500; margin-bottom: 8px; }
|
|
552
|
+
.meta { color: var(--faint); font-size: 12px; margin-top: 14px; }
|
|
527
553
|
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
|
|
528
|
-
th, td { text-align: left; padding:
|
|
554
|
+
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--divider);
|
|
529
555
|
vertical-align: top; font-size: 13px; }
|
|
530
556
|
th { color: var(--muted); font-weight: 500; font-size: 12px; }
|
|
531
557
|
th:first-child, td:first-child { padding-left: 0; }
|
|
@@ -543,15 +569,18 @@ var BASE_CSS = `
|
|
|
543
569
|
border-radius: 6px; padding: 6px 10px; font: inherit; cursor: pointer;
|
|
544
570
|
text-decoration: none; display: inline-block; }
|
|
545
571
|
button:hover, a.btn:hover { border-color: var(--accent); }
|
|
546
|
-
a.btn.primary { background: var(--accent); color:
|
|
547
|
-
.
|
|
548
|
-
|
|
572
|
+
a.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
|
|
573
|
+
:root[data-host="mcp-apps"] a.btn.primary { color: #fff; }
|
|
574
|
+
@media (prefers-color-scheme: dark) { :root[data-host="mcp-apps"]:not([data-theme="light"]) a.btn.primary { color: #17102A; } }
|
|
575
|
+
:root[data-host="mcp-apps"][data-theme="dark"] a.btn.primary { color: #17102A; }
|
|
576
|
+
.chip { display: inline-block; background: var(--chip); border-radius: 6px; color: var(--muted);
|
|
577
|
+
padding: 1px 7px; font-size: 12px; font-weight: 500; margin: 2px 4px 2px 0; }
|
|
549
578
|
.big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
|
|
550
579
|
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
551
580
|
gap: 10px; margin-top: 14px; }
|
|
552
581
|
/* Stat tile: label stacked above value, padded, never crowding an edge. */
|
|
553
582
|
.kv { display: flex; flex-direction: column; gap: 3px;
|
|
554
|
-
background: var(--
|
|
583
|
+
background: var(--surface-2); border: 1px solid var(--divider); border-radius: 10px;
|
|
555
584
|
padding: 10px 12px; min-width: 0; }
|
|
556
585
|
.kv .k { color: var(--muted); font-size: 12px; }
|
|
557
586
|
.kv .val { font-weight: 500; }
|
|
@@ -562,7 +591,7 @@ var BASE_CSS = `
|
|
|
562
591
|
.chip.good { background: rgba(22,163,74,.12); color: var(--good); }
|
|
563
592
|
.chip.warn { background: rgba(217,119,6,.14); color: var(--warn); }
|
|
564
593
|
.chip.bad { background: rgba(220,38,38,.12); color: var(--bad); }
|
|
565
|
-
.chip.info { background:
|
|
594
|
+
.chip.info { background: var(--accent-dim); color: var(--accent); }
|
|
566
595
|
.plane { margin-top: 14px; }
|
|
567
596
|
.plane .subtitle { margin-bottom: 4px; }
|
|
568
597
|
.num { text-align: right; }
|
|
@@ -601,6 +630,45 @@ var BASE_CSS = `
|
|
|
601
630
|
}
|
|
602
631
|
@media (prefers-reduced-motion: reduce) { .tl-spin, .tl-core, .tl-arm { animation: none; } }
|
|
603
632
|
`;
|
|
633
|
+
var MD_JS = String.raw`
|
|
634
|
+
// Minimal, escape-first markdown: paragraphs, - / 1. lists, ### headings,
|
|
635
|
+
// **bold**, *em*, code spans, https links, pipe tables. Input is escaped before
|
|
636
|
+
// any markup is added, so model text can never inject HTML.
|
|
637
|
+
function mdInline(t) {
|
|
638
|
+
return esc(t)
|
|
639
|
+
.replace(/\x60([^\x60]+)\x60/g, "<code>$1</code>")
|
|
640
|
+
.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>")
|
|
641
|
+
.replace(/(^|[^*])\*([^*\s][^*]*)\*/g, "$1<em>$2</em>")
|
|
642
|
+
.replace(/\[([^\]]+)\]\((https:\/\/[^\s)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>');
|
|
643
|
+
}
|
|
644
|
+
function md(text) {
|
|
645
|
+
var lines = String(text == null ? "" : text).replace(/\r/g, "").split("\n");
|
|
646
|
+
var out = [], para = [], list = null, i = 0;
|
|
647
|
+
function flushPara() { if (para.length) { out.push("<p>" + para.map(mdInline).join("<br>") + "</p>"); para = []; } }
|
|
648
|
+
function flushList() { if (list) { out.push("<" + list.tag + ">" + list.items.map(function (x) { return "<li>" + mdInline(x) + "</li>"; }).join("") + "</" + list.tag + ">"); list = null; } }
|
|
649
|
+
for (; i < lines.length; i++) {
|
|
650
|
+
var l = lines[i], m;
|
|
651
|
+
if (/^\s*$/.test(l)) { flushPara(); flushList(); continue; }
|
|
652
|
+
if (/^\s*\|.*\|\s*$/.test(l) && i + 1 < lines.length && /^\s*\|?\s*:?-{2,}/.test(lines[i + 1])) {
|
|
653
|
+
flushPara(); flushList();
|
|
654
|
+
var cells = function (row) { return row.trim().replace(/^\||\|$/g, "").split("|").map(function (c) { return c.trim(); }); };
|
|
655
|
+
var head = cells(l); i += 2; var rows = [];
|
|
656
|
+
while (i < lines.length && /^\s*\|.*\|\s*$/.test(lines[i])) { rows.push(cells(lines[i])); i++; }
|
|
657
|
+
i--;
|
|
658
|
+
out.push("<table><thead><tr>" + head.map(function (h) { return "<th>" + mdInline(h) + "</th>"; }).join("") + "</tr></thead><tbody>"
|
|
659
|
+
+ rows.slice(0, 50).map(function (r) { return "<tr>" + r.map(function (c) { return '<td class="val">' + mdInline(c) + "</td>"; }).join("") + "</tr>"; }).join("") + "</tbody></table>");
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
if ((m = /^\s*#{1,6}\s+(.*)$/.exec(l))) { flushPara(); flushList(); out.push("<h3>" + mdInline(m[1]) + "</h3>"); continue; }
|
|
663
|
+
if ((m = /^\s*[-*•]\s+(.*)$/.exec(l))) { flushPara(); if (!list || list.tag !== "ul") { flushList(); list = { tag: "ul", items: [] }; } list.items.push(m[1]); continue; }
|
|
664
|
+
if ((m = /^\s*\d+[.)]\s+(.*)$/.exec(l))) { flushPara(); if (!list || list.tag !== "ol") { flushList(); list = { tag: "ol", items: [] }; } list.items.push(m[1]); continue; }
|
|
665
|
+
if (list) { list.items[list.items.length - 1] += " " + l.trim(); continue; }
|
|
666
|
+
para.push(l.trim());
|
|
667
|
+
}
|
|
668
|
+
flushPara(); flushList();
|
|
669
|
+
return out.join("");
|
|
670
|
+
}
|
|
671
|
+
`;
|
|
604
672
|
var HELPERS_JS = `
|
|
605
673
|
var root = document.getElementById("root");
|
|
606
674
|
function esc(s) {
|
|
@@ -623,6 +691,7 @@ var HELPERS_JS = `
|
|
|
623
691
|
var p = Math.round(v * 100);
|
|
624
692
|
return '<span class="bar ' + confClass(v) + '"><span style="width:' + p + '%"></span></span> <span class="muted small">' + p + '%</span>';
|
|
625
693
|
}
|
|
694
|
+
${MD_JS}
|
|
626
695
|
function empty(msg) { root.innerHTML = '<div class="empty">' + esc(msg) + '</div>'; }
|
|
627
696
|
function copyButton(id, text) {
|
|
628
697
|
var btn = document.getElementById(id);
|
|
@@ -1918,9 +1987,13 @@ function getAnswerPolledWidgetHtml() {
|
|
|
1918
1987
|
return POLLED_HTML;
|
|
1919
1988
|
}
|
|
1920
1989
|
var CSS3 = `
|
|
1921
|
-
.
|
|
1922
|
-
.
|
|
1923
|
-
|
|
1990
|
+
.cites { list-style: none; padding: 0; margin: 0; counter-reset: c; display: grid; gap: 10px; }
|
|
1991
|
+
.cites li { counter-increment: c; display: grid; grid-template-columns: 22px 1fr; gap: 0 6px; font-size: 13px; }
|
|
1992
|
+
.cites li::before { content: counter(c); color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
1993
|
+
.cites .q { color: var(--fg); }
|
|
1994
|
+
.cites .src { grid-column: 2; color: var(--faint); font-size: 12px; margin-top: 2px; }
|
|
1995
|
+
.correction { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--accent-dim); font-size: 13px; }
|
|
1996
|
+
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); }
|
|
1924
1997
|
`;
|
|
1925
1998
|
var ANSWER_BODY = `
|
|
1926
1999
|
if (!payload || typeof payload !== "object" || !payload.ask_id) { empty("No answer."); return; }
|
|
@@ -1930,34 +2003,36 @@ var ANSWER_BODY = `
|
|
|
1930
2003
|
var usage = obj(payload.usage);
|
|
1931
2004
|
var cites = Array.isArray(payload.citations) ? payload.citations : [];
|
|
1932
2005
|
var arts = Array.isArray(payload.artifacts) ? payload.artifacts : [];
|
|
1933
|
-
var
|
|
1934
|
-
var
|
|
1935
|
-
|
|
2006
|
+
var verdict = { supported: ["Verified", "good"], issues: ["Has issues", "warn"], unverifiable: ["Unverified", "bad"] }[ver.verdict];
|
|
2007
|
+
var ids = "ask " + payload.ask_id + (payload.conversation_id ? " \xB7 conversation " + payload.conversation_id : "");
|
|
2008
|
+
var head = '<div class="header"><div class="title" title="' + esc(ids) + '">' + HEADLINE + '</div>'
|
|
2009
|
+
+ '<div>' + (status === "completed" ? (verdict ? chip(verdict[0], verdict[1]) : "") : status === "error" ? chip("Error", "bad") : "") + '</div></div>';
|
|
1936
2010
|
if (status === "processing") {
|
|
1937
|
-
root.innerHTML = head + '<div class="
|
|
2011
|
+
root.innerHTML = head + '<div class="thinking">Still working on it. The answer appears here in a few seconds.</div>';
|
|
1938
2012
|
return;
|
|
1939
2013
|
}
|
|
1940
2014
|
var answer = typeof payload.answer === "string" ? payload.answer : (payload.answer == null ? "" : fmt(payload.answer));
|
|
1941
|
-
var citeHtml = cites.length ? '<div class="
|
|
2015
|
+
var citeHtml = cites.length ? '<div class="section"><div class="section-label">Sources</div><ol class="cites">' + cites.slice(0, 12).map(function (c) {
|
|
1942
2016
|
c = obj(c);
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
2017
|
+
var where = esc(c.filename || shortId(c.document_id)) + (c.reference ? ' \xB7 ' + esc(c.reference) : "");
|
|
2018
|
+
var link = typeof c.app_url === "string" && /^https:\\/\\//.test(c.app_url) ? c.app_url : "";
|
|
2019
|
+
return '<li><span class="q">' + (c.quote ? "\u201C" + esc(clamp(c.quote, 220)) + "\u201D" : where) + '</span>'
|
|
2020
|
+
+ '<span class="src">' + (link ? '<a href="' + esc(link) + '" target="_blank" rel="noopener noreferrer" style="color:inherit">' + where + '</a>' : where) + '</span></li>';
|
|
2021
|
+
}).join("") + '</ol>' + (cites.length > 12 ? '<div class="meta">+' + (cites.length - 12) + ' more sources</div>' : "") + '</div>' : "";
|
|
2022
|
+
var artHtml = arts.length ? '<div class="section"><div class="section-label">Files</div>' + arts.slice(0, 10).map(function (a) {
|
|
1946
2023
|
a = obj(a);
|
|
1947
2024
|
var link = typeof a.link === "string" && /^https:\\/\\//.test(a.link) ? a.link : "";
|
|
1948
|
-
return '<
|
|
2025
|
+
return link ? '<a class="btn" href="' + esc(link) + '" target="_blank" rel="noopener noreferrer" style="margin:0 6px 6px 0">' + esc(a.label || a.type || "Open file") + '</a>' : '<span class="chip">' + esc(a.label || a.type || "file") + '</span>';
|
|
1949
2026
|
}).join("") + '</div>' : "";
|
|
1950
|
-
var
|
|
1951
|
-
if (typeof usage.credits_charged === "number")
|
|
1952
|
-
if (typeof
|
|
1953
|
-
if (typeof payload.
|
|
1954
|
-
if (typeof payload.waited_ms === "number") tiles.push((payload.waited_ms / 1000).toFixed(1) + " s");
|
|
1955
|
-
if (typeof ver.checks_total === "number") tiles.push(ver.checks_total + " checks, " + (ver.checks_unsupported || 0) + " unsupported");
|
|
2027
|
+
var meta = [];
|
|
2028
|
+
if (typeof usage.credits_charged === "number") meta.push(usage.credits_charged + " credits");
|
|
2029
|
+
if (typeof payload.tool_calls === "number") meta.push(payload.tool_calls + (payload.tool_calls === 1 ? " query" : " queries"));
|
|
2030
|
+
if (typeof payload.waited_ms === "number") meta.push((payload.waited_ms / 1000).toFixed(1) + " s");
|
|
1956
2031
|
root.innerHTML = head
|
|
1957
|
-
+ (answer ? '<
|
|
1958
|
-
+ (ver.correction ? '<div class="
|
|
2032
|
+
+ (answer ? '<div class="prose">' + md(answer) + '</div>' : '<div class="muted small">No answer text came back.</div>')
|
|
2033
|
+
+ (ver.correction ? '<div class="correction"><strong>Correction.</strong> ' + esc(ver.correction) + '</div>' : "")
|
|
1959
2034
|
+ citeHtml + artHtml
|
|
1960
|
-
+ (
|
|
2035
|
+
+ (meta.length ? '<div class="meta">' + esc(meta.join(" \xB7 ")) + '</div>' : "");
|
|
1961
2036
|
`;
|
|
1962
2037
|
function answerWidget(headline, title) {
|
|
1963
2038
|
return buildWidgetHtml({
|
|
@@ -1967,7 +2042,7 @@ function answerWidget(headline, title) {
|
|
|
1967
2042
|
});
|
|
1968
2043
|
}
|
|
1969
2044
|
var ANSWER_HTML = answerWidget("Answer", "Talonic \u2014 Answer");
|
|
1970
|
-
var POLLED_HTML = answerWidget("Answer
|
|
2045
|
+
var POLLED_HTML = answerWidget("Answer", "Talonic \u2014 Answer");
|
|
1971
2046
|
|
|
1972
2047
|
// src/widgets/decision-task-shared.ts
|
|
1973
2048
|
var DECISION_JS = `
|
|
@@ -8647,7 +8722,7 @@ function registerAskTools(server, getToken, baseUrl) {
|
|
|
8647
8722
|
|
|
8648
8723
|
// package.json
|
|
8649
8724
|
var package_default = {
|
|
8650
|
-
version: "0.1.
|
|
8725
|
+
version: "0.1.101"};
|
|
8651
8726
|
|
|
8652
8727
|
// src/version.ts
|
|
8653
8728
|
var VERSION = package_default.version;
|