@ai-ecoverse/slicc-spectrum 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/slicc-dummy.js +8 -0
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-ui.js +84 -52
- package/dist/slicc-ui.js.map +4 -4
- package/dist/types/app/tool-title.d.ts +3 -0
- package/dist/types/dummy/agent.d.ts +1 -0
- package/package.json +2 -2
package/dist/slicc-ui.js
CHANGED
|
@@ -14414,48 +14414,6 @@ var o63 = class extends a8 {
|
|
|
14414
14414
|
};
|
|
14415
14415
|
e26("swc-icon-info-circle", o63);
|
|
14416
14416
|
|
|
14417
|
-
// src/app/guard.ts
|
|
14418
|
-
var prefixes = [
|
|
14419
|
-
"sk-",
|
|
14420
|
-
"sk_",
|
|
14421
|
-
"rk_",
|
|
14422
|
-
"pk_live",
|
|
14423
|
-
"ghp_",
|
|
14424
|
-
"gho_",
|
|
14425
|
-
"ghu_",
|
|
14426
|
-
"ghs_",
|
|
14427
|
-
"ghr_",
|
|
14428
|
-
"github_pat_",
|
|
14429
|
-
"glpat-",
|
|
14430
|
-
"xoxa-",
|
|
14431
|
-
"xoxb-",
|
|
14432
|
-
"xoxp-",
|
|
14433
|
-
"xoxs-",
|
|
14434
|
-
"AKIA",
|
|
14435
|
-
"ASIA",
|
|
14436
|
-
"AIza",
|
|
14437
|
-
"npm_",
|
|
14438
|
-
"pypi-",
|
|
14439
|
-
"hf_",
|
|
14440
|
-
"eyJ",
|
|
14441
|
-
"-----BEGIN"
|
|
14442
|
-
];
|
|
14443
|
-
var keyed = /(?:(?:[\w-]*(?:token|secret|passw(?:or)?d|pwd|api[_-]?key|access[_-]?key|private[_-]?key|credential)[\w-]*|\b(?:auth|authorization)\b)["']?\s*[:=]\s*|(?:^|\s)--?[\w-]*(?:token|secret|password|api-key|key)\s+|\bbearer\s+)/gi;
|
|
14444
|
-
var word = /[^\s'"=:,;(){}[\]`]+/g;
|
|
14445
|
-
function guard(text4, growing = false) {
|
|
14446
|
-
let cut = text4.length;
|
|
14447
|
-
for (const match of text4.matchAll(keyed)) cut = Math.min(cut, match.index + match[0].length);
|
|
14448
|
-
for (const match of text4.matchAll(word)) {
|
|
14449
|
-
const token = match[0];
|
|
14450
|
-
const last = growing && match.index + token.length === text4.length;
|
|
14451
|
-
const risky = prefixes.some(
|
|
14452
|
-
(prefix) => token.startsWith(prefix) || last && token.length >= 2 && prefix.startsWith(token)
|
|
14453
|
-
);
|
|
14454
|
-
if (risky) cut = Math.min(cut, match.index);
|
|
14455
|
-
}
|
|
14456
|
-
return cut < text4.length ? `${text4.slice(0, cut).trimEnd()} \u2026` : text4;
|
|
14457
|
-
}
|
|
14458
|
-
|
|
14459
14417
|
// node_modules/mdast-util-to-string/lib/index.js
|
|
14460
14418
|
var emptyOptions = {};
|
|
14461
14419
|
function toString(value, options2) {
|
|
@@ -33316,6 +33274,69 @@ var signInCss = i`
|
|
|
33316
33274
|
}
|
|
33317
33275
|
`;
|
|
33318
33276
|
|
|
33277
|
+
// src/app/guard.ts
|
|
33278
|
+
var prefixes = [
|
|
33279
|
+
"sk-",
|
|
33280
|
+
"sk_",
|
|
33281
|
+
"rk_",
|
|
33282
|
+
"pk_live",
|
|
33283
|
+
"ghp_",
|
|
33284
|
+
"gho_",
|
|
33285
|
+
"ghu_",
|
|
33286
|
+
"ghs_",
|
|
33287
|
+
"ghr_",
|
|
33288
|
+
"github_pat_",
|
|
33289
|
+
"glpat-",
|
|
33290
|
+
"xoxa-",
|
|
33291
|
+
"xoxb-",
|
|
33292
|
+
"xoxp-",
|
|
33293
|
+
"xoxs-",
|
|
33294
|
+
"AKIA",
|
|
33295
|
+
"ASIA",
|
|
33296
|
+
"AIza",
|
|
33297
|
+
"npm_",
|
|
33298
|
+
"pypi-",
|
|
33299
|
+
"hf_",
|
|
33300
|
+
"eyJ",
|
|
33301
|
+
"-----BEGIN"
|
|
33302
|
+
];
|
|
33303
|
+
var keyed = /(?:(?:[\w-]*(?:token|secret|passw(?:or)?d|pwd|api[_-]?key|access[_-]?key|private[_-]?key|credential)[\w-]*|\b(?:auth|authorization)\b)["']?\s*[:=]\s*|(?:^|\s)--?[\w-]*(?:token|secret|password|api-key|key)\s+|\bbearer\s+)/gi;
|
|
33304
|
+
var word = /[^\s'"=:,;(){}[\]`]+/g;
|
|
33305
|
+
function guard(text4, growing = false) {
|
|
33306
|
+
let cut = text4.length;
|
|
33307
|
+
for (const match of text4.matchAll(keyed)) cut = Math.min(cut, match.index + match[0].length);
|
|
33308
|
+
for (const match of text4.matchAll(word)) {
|
|
33309
|
+
const token = match[0];
|
|
33310
|
+
const last = growing && match.index + token.length === text4.length;
|
|
33311
|
+
const risky = prefixes.some(
|
|
33312
|
+
(prefix) => token.startsWith(prefix) || last && token.length >= 2 && prefix.startsWith(token)
|
|
33313
|
+
);
|
|
33314
|
+
if (risky) cut = Math.min(cut, match.index);
|
|
33315
|
+
}
|
|
33316
|
+
return cut < text4.length ? `${text4.slice(0, cut).trimEnd()} \u2026` : text4;
|
|
33317
|
+
}
|
|
33318
|
+
|
|
33319
|
+
// src/app/tool-title.ts
|
|
33320
|
+
var shellLead = /^(?:(?:git|npm|npx|pnpm|yarn|bun|node|deno|python3?|pip3?|curl|wget|ls|cd|cat|rm|mv|cp|chmod|chown|mkdir|touch|tar|zip|unzip|docker|kubectl|gh|wrangler|lsof|find|grep|rg|sed|awk|ssh|scp|rsync|make|cargo|go|ruby|perl|php|java|javac|swift|xcodebuild|brew|apt|yum|sudo|env|export|echo|printf|true|false|test|bash|sh|zsh|fish|source)(?=\s|$)|(?:\.\/))/;
|
|
33321
|
+
function rawTitle(title2) {
|
|
33322
|
+
const text4 = title2.trim();
|
|
33323
|
+
if (!text4) return false;
|
|
33324
|
+
if (text4.length > 80) return true;
|
|
33325
|
+
if (/[|;&><`]|\$\(|&&|\|\|/.test(text4)) return true;
|
|
33326
|
+
if (/^-[A-Za-z0-9]/.test(text4)) return true;
|
|
33327
|
+
if (/^[a-z]/.test(text4) && shellLead.test(text4)) return true;
|
|
33328
|
+
if (!/\s/.test(text4) && (/^[./~]/.test(text4) || /\.[A-Za-z0-9]+$/.test(text4))) return true;
|
|
33329
|
+
return false;
|
|
33330
|
+
}
|
|
33331
|
+
function headline(call) {
|
|
33332
|
+
const title2 = call.title.trim();
|
|
33333
|
+
const name = call.name.trim();
|
|
33334
|
+
const growing = call.status === "running";
|
|
33335
|
+
if (!title2) return guard(name, growing);
|
|
33336
|
+
if (rawTitle(title2)) return guard(`${name} ${title2}`.trim(), growing);
|
|
33337
|
+
return guard(title2, growing);
|
|
33338
|
+
}
|
|
33339
|
+
|
|
33319
33340
|
// src/app/messages.ts
|
|
33320
33341
|
var alone = { calls: [], live: false };
|
|
33321
33342
|
var lickLabels = {
|
|
@@ -33569,9 +33590,6 @@ function step(call, context, id) {
|
|
|
33569
33590
|
</div>`
|
|
33570
33591
|
];
|
|
33571
33592
|
}
|
|
33572
|
-
function headline(call) {
|
|
33573
|
-
return guard(`${call.name} ${call.title}`.trim(), call.status === "running");
|
|
33574
|
-
}
|
|
33575
33593
|
function phase(status2, calls, live, said = false, stopped = false) {
|
|
33576
33594
|
if (status2 === "stopped" || stopped) return "stopped";
|
|
33577
33595
|
if (!calls.length) return status2 === "streaming" && !said ? "active" : null;
|
|
@@ -35512,9 +35530,9 @@ var commands = [
|
|
|
35512
35530
|
name: "thinking",
|
|
35513
35531
|
detail: "Set the thinking level",
|
|
35514
35532
|
args: () => ["off", "low", "medium", "high"].map((value) => ({ value, label: value, detail: "" })),
|
|
35515
|
-
run: (model,
|
|
35533
|
+
run: (model, id, arg) => {
|
|
35516
35534
|
if (["off", "low", "medium", "high"].includes(arg))
|
|
35517
|
-
model.
|
|
35535
|
+
model.agent.setThinking(id, arg);
|
|
35518
35536
|
}
|
|
35519
35537
|
},
|
|
35520
35538
|
{
|
|
@@ -38556,7 +38574,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
|
|
|
38556
38574
|
${offered.length ? b`<sp-picker size="s" quiet label="Model" value=${agent.model} @change=${(event2) => model.agent.setModel(agent.id, event2.target.value)} @sp-opened=${this.#modelFilter.opened} @sp-closed=${this.#modelFilter.closed} @keydown=${this.#modelFilter.keys}>
|
|
38557
38575
|
${this.#modelFilter.items(offered)}
|
|
38558
38576
|
</sp-picker>` : b`<swc-action-button size="s" quiet data-action="set-up-model" @click=${() => this.#action("settings")}>Set up a model</swc-action-button>`}
|
|
38559
|
-
<sp-picker size="s" quiet label="Thinking" value=${model.settings.get().thinking} @change=${(event2) => model.
|
|
38577
|
+
<sp-picker size="s" quiet label="Thinking" value=${agent.thinking ?? model.settings.get().thinking} @change=${(event2) => model.agent.setThinking(agent.id, event2.target.value)}>
|
|
38560
38578
|
<sp-menu-item value="off">No thinking</sp-menu-item>
|
|
38561
38579
|
<sp-menu-item value="low">Think a little</sp-menu-item>
|
|
38562
38580
|
<sp-menu-item value="medium">Think</sp-menu-item>
|
|
@@ -39890,7 +39908,10 @@ function watchTitles(model, update) {
|
|
|
39890
39908
|
const seen = /* @__PURE__ */ new Map();
|
|
39891
39909
|
const check3 = (id) => {
|
|
39892
39910
|
const agent = model.agent.list().find((candidate) => candidate.id === id);
|
|
39893
|
-
if (!agent)
|
|
39911
|
+
if (!agent) {
|
|
39912
|
+
if (seen.delete(id)) update();
|
|
39913
|
+
return;
|
|
39914
|
+
}
|
|
39894
39915
|
const title2 = agentTitle(model, agent);
|
|
39895
39916
|
if (seen.get(id) === title2) return;
|
|
39896
39917
|
seen.set(id, title2);
|
|
@@ -39898,7 +39919,12 @@ function watchTitles(model, update) {
|
|
|
39898
39919
|
};
|
|
39899
39920
|
const stops = [
|
|
39900
39921
|
model.agent.on("messages", check3),
|
|
39901
|
-
model.agent.on("message", ({ agentId }) => check3(agentId))
|
|
39922
|
+
model.agent.on("message", ({ agentId }) => check3(agentId)),
|
|
39923
|
+
model.agent.on("agents", (agents) => {
|
|
39924
|
+
const live = new Set(agents.map((agent) => agent.id));
|
|
39925
|
+
for (const id of seen.keys()) if (!live.has(id)) check3(id);
|
|
39926
|
+
for (const agent of agents) check3(agent.id);
|
|
39927
|
+
})
|
|
39902
39928
|
];
|
|
39903
39929
|
return () => {
|
|
39904
39930
|
for (const stop of stops) stop();
|
|
@@ -58060,9 +58086,14 @@ var SliccStatusLabel = class extends i2 {
|
|
|
58060
58086
|
get #anchor() {
|
|
58061
58087
|
return `${this.agent} ${this.calls[0]?.id ?? ""}`;
|
|
58062
58088
|
}
|
|
58089
|
+
#needsLabel() {
|
|
58090
|
+
if (this.calls.length >= 2) return true;
|
|
58091
|
+
const only = this.calls[0];
|
|
58092
|
+
return !!only && rawTitle(only.title);
|
|
58093
|
+
}
|
|
58063
58094
|
#ask() {
|
|
58064
58095
|
const port = this.model?.agent;
|
|
58065
|
-
if (this
|
|
58096
|
+
if (!this.#needsLabel() || !port?.toolLabel) return;
|
|
58066
58097
|
const store2 = cache3(port);
|
|
58067
58098
|
const key = this.#key;
|
|
58068
58099
|
const anchor = this.#anchor;
|
|
@@ -58088,7 +58119,8 @@ var SliccStatusLabel = class extends i2 {
|
|
|
58088
58119
|
return store2?.done.get(this.#key) ?? store2?.latest.get(this.#anchor) ?? "";
|
|
58089
58120
|
}
|
|
58090
58121
|
#wanted() {
|
|
58091
|
-
|
|
58122
|
+
if (this.state === "stopped") return this.text;
|
|
58123
|
+
const base = this.#label() || this.text;
|
|
58092
58124
|
return base && this.note ? `${this.note} \xB7 ${base}` : base;
|
|
58093
58125
|
}
|
|
58094
58126
|
#cancel() {
|