@ai-ecoverse/slicc-spectrum 1.84.2 → 1.85.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 -2
- package/dist/slicc-dummy.js +7 -0
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-ui.js +22 -7
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/app/follow.d.ts +1 -1
- package/dist/types/dummy/follow.d.ts +1 -1
- package/dist/types/model/types.d.ts +1 -0
- package/package.json +4 -4
package/dist/slicc-ui.js
CHANGED
|
@@ -8675,6 +8675,15 @@ var o43 = class extends a10 {
|
|
|
8675
8675
|
e25("swc-icon-close", o43);
|
|
8676
8676
|
|
|
8677
8677
|
// src/app/base.ts
|
|
8678
|
+
var typed = false;
|
|
8679
|
+
document.addEventListener("keydown", () => typed = true, true);
|
|
8680
|
+
document.addEventListener("pointerdown", () => typed = false, true);
|
|
8681
|
+
function keyboardFocus() {
|
|
8682
|
+
let active = document.activeElement;
|
|
8683
|
+
while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
|
|
8684
|
+
if (!active || active === document.body) return typed;
|
|
8685
|
+
return active.matches(":focus-visible");
|
|
8686
|
+
}
|
|
8678
8687
|
var ModelElement = class extends i2 {
|
|
8679
8688
|
static properties = { model: { attribute: false } };
|
|
8680
8689
|
static shadowRootOptions = {
|
|
@@ -8693,7 +8702,8 @@ var ModelElement = class extends i2 {
|
|
|
8693
8702
|
this.focusWith({}, ...selectors);
|
|
8694
8703
|
}
|
|
8695
8704
|
focusWith(options, ...selectors) {
|
|
8696
|
-
const
|
|
8705
|
+
const settled3 = { focusVisible: keyboardFocus(), ...options };
|
|
8706
|
+
const focus = () => selectors.map((selector) => this.renderRoot.querySelector(selector)).find(Boolean)?.focus(settled3);
|
|
8697
8707
|
if (this.hasUpdated) focus();
|
|
8698
8708
|
else void this.updateComplete.then(focus);
|
|
8699
8709
|
}
|
|
@@ -9750,6 +9760,8 @@ var lights = {
|
|
|
9750
9760
|
failed: ["negative", (owner) => `Can\u2019t reach ${owner}`]
|
|
9751
9761
|
};
|
|
9752
9762
|
function followLight(state2) {
|
|
9763
|
+
if (state2.refused && state2.link === "connected")
|
|
9764
|
+
return { variant: "neutral", text: `Can\u2019t follow ${state2.owner}` };
|
|
9753
9765
|
const [variant, text2] = lights[state2.link];
|
|
9754
9766
|
return { variant, text: text2(state2.owner) };
|
|
9755
9767
|
}
|
|
@@ -9787,6 +9799,7 @@ function list(items, last) {
|
|
|
9787
9799
|
return `${items.slice(0, -1).join(", ")} ${last} ${items.at(-1)}`;
|
|
9788
9800
|
}
|
|
9789
9801
|
function followCan(state2) {
|
|
9802
|
+
if (state2.refused) return state2.refused;
|
|
9790
9803
|
const allowed = ["watch the agent"];
|
|
9791
9804
|
const missing = [];
|
|
9792
9805
|
(state2.access.control ? allowed : missing).push("send prompts");
|
|
@@ -9802,7 +9815,9 @@ function watchOnly(model) {
|
|
|
9802
9815
|
const text2 = model?.agent?.readOnly?.();
|
|
9803
9816
|
if (text2) return text2;
|
|
9804
9817
|
const state2 = following(model);
|
|
9805
|
-
if (!state2
|
|
9818
|
+
if (!state2) return "";
|
|
9819
|
+
if (state2.refused) return state2.refused;
|
|
9820
|
+
if (state2.access.control) return "";
|
|
9806
9821
|
return `Watch only. To send prompts from this device, allow Control for it on ${state2.owner}.`;
|
|
9807
9822
|
}
|
|
9808
9823
|
function onWatch(model, listener) {
|
|
@@ -9813,7 +9828,7 @@ function onWatch(model, listener) {
|
|
|
9813
9828
|
}
|
|
9814
9829
|
function terminalsAllowed(model) {
|
|
9815
9830
|
const state2 = model?.follow?.state();
|
|
9816
|
-
return !state2 || !!state2.access.terminal;
|
|
9831
|
+
return !state2 || !state2.refused && !!state2.access.terminal;
|
|
9817
9832
|
}
|
|
9818
9833
|
var SliccFollow = class extends ModelElement {
|
|
9819
9834
|
static properties = {
|
|
@@ -35188,7 +35203,7 @@ function called(value = "") {
|
|
|
35188
35203
|
return `Called ${url}`.trim();
|
|
35189
35204
|
}
|
|
35190
35205
|
}
|
|
35191
|
-
function
|
|
35206
|
+
function typed2(action) {
|
|
35192
35207
|
const count = action.length === void 0 ? "" : ` ${action.length} ${action.length === 1 ? "character" : "characters"}`;
|
|
35193
35208
|
return `Typed${count}${action.target ? ` into ${action.target}` : ""}`;
|
|
35194
35209
|
}
|
|
@@ -35203,8 +35218,8 @@ var verbs2 = {
|
|
|
35203
35218
|
screenshot: () => "Took a screenshot",
|
|
35204
35219
|
eval: () => "Ran a script",
|
|
35205
35220
|
click: (action) => `Clicked${action.target ? ` ${action.target}` : ""}`,
|
|
35206
|
-
fill:
|
|
35207
|
-
type:
|
|
35221
|
+
fill: typed2,
|
|
35222
|
+
type: typed2,
|
|
35208
35223
|
press: (action) => `Pressed${action.value ? ` ${action.value}` : ""}`,
|
|
35209
35224
|
scroll: () => "Scrolled",
|
|
35210
35225
|
request: (action) => called(action.value)
|
|
@@ -37625,7 +37640,7 @@ var SliccChat = class extends ThemedElement {
|
|
|
37625
37640
|
</div>
|
|
37626
37641
|
</div>
|
|
37627
37642
|
${this.dropping ? b`<swc-dropzone dragged size="l" aria-label="Attach files" dragged-message="Drop to attach"><p>Drop to attach</p></swc-dropzone>` : A}
|
|
37628
|
-
${watch ? b`<p class="watch-only" role="note" data-follow="watch">${watch}</p>` : this.model && !agent?.frozen ? b`<slicc-composer .model=${this.model} .agent=${this.agent}></slicc-composer>` : A}
|
|
37643
|
+
${watch ? watch === following(this.model)?.refused ? A : b`<p class="watch-only" role="note" data-follow="watch">${watch}</p>` : this.model && !agent?.frozen ? b`<slicc-composer .model=${this.model} .agent=${this.agent}></slicc-composer>` : A}
|
|
37629
37644
|
`;
|
|
37630
37645
|
}
|
|
37631
37646
|
};
|