@ai-ecoverse/slicc-spectrum 1.27.3 → 1.28.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/dist/slicc-ui.js CHANGED
@@ -9582,7 +9582,7 @@ var SliccAgents = class extends ModelElement {
9582
9582
  if (!port?.drop) return;
9583
9583
  const ok = await confirm({
9584
9584
  title: `Drop scoop ${agent.name}?`,
9585
- body: "It stops working. Its files stay.",
9585
+ body: "It stops, and its working folder is deleted. Its conversation and reports are kept. You can\u2019t undo this.",
9586
9586
  action: "Drop",
9587
9587
  variant: "destructive",
9588
9588
  trigger: trigger2
@@ -21826,6 +21826,7 @@ function visible(memories, scope, tag3, query) {
21826
21826
  (memory) => memory.scope === scope && (tag3 === "all" || (tag3 === "untagged" ? memory.tag === null : memory.tag === tag3)) && (!needle || `${memory.title} ${memory.body} ${memory.section}`.toLowerCase().includes(needle))
21827
21827
  );
21828
21828
  }
21829
+ var scopeGroups = { cones: "Cones", roles: "Roles" };
21829
21830
  var tagLabels = {
21830
21831
  user: "User",
21831
21832
  feedback: "Feedback",
@@ -21918,6 +21919,12 @@ var SliccMemory = class extends ModelElement {
21918
21919
  font-weight: var(--swc-bold-font-weight);
21919
21920
  line-height: var(--swc-line-height-100);
21920
21921
  }
21922
+ .from {
21923
+ grid-column: 1 / -1;
21924
+ margin-top: var(--swc-spacing-50);
21925
+ font-size: var(--swc-font-size-75);
21926
+ color: var(--swc-neutral-subdued-content-color-default);
21927
+ }
21921
21928
  .summary {
21922
21929
  grid-column: 1 / -1;
21923
21930
  color: var(--swc-neutral-subdued-content-color-default);
@@ -22008,6 +22015,7 @@ var SliccMemory = class extends ModelElement {
22008
22015
  <span class="title">${memory.title}</span>
22009
22016
  ${memory.tag ? b`<swc-badge size="s" variant="neutral" subtle>${tagLabels[memory.tag]}</swc-badge>` : A}
22010
22017
  ${open ? A : b`<span class="summary">${memory.body}</span>`}
22018
+ ${memory.source === "notes" ? b`<span class="from">From MEMORY.md</span>` : A}
22011
22019
  </button>
22012
22020
  ${open ? b`<div class="body">${markdown(memory.body)}</div>
22013
22021
  <div class="actions">
@@ -22020,19 +22028,33 @@ var SliccMemory = class extends ModelElement {
22020
22028
  </div>` : A}
22021
22029
  </div>`;
22022
22030
  }
22023
- render() {
22031
+ #scopes = [];
22032
+ willUpdate(changed) {
22033
+ super.willUpdate(changed);
22024
22034
  const model = this.model;
22025
- const all2 = model?.memory.list() ?? [];
22026
- const shown = visible(all2, this.scope, this.tag, this.query);
22027
- const cones = (model?.agent.list() ?? []).filter((agent) => agent.kind === "cone");
22028
- return b`<div class="bar"><span>${shown.length} of ${all2.filter((memory) => memory.scope === this.scope).length} memories</span><span class="spacer"></span>
22035
+ this.#scopes = model?.memory.scopes?.() ?? [
22036
+ { id: "global", label: "Everyone" },
22037
+ ...(model?.agent.list() ?? []).filter((agent) => agent.kind === "cone").map((cone) => ({ id: cone.id, label: cone.name }))
22038
+ ];
22039
+ if (!this.#scopes.some((item2) => item2.id === this.scope)) this.scope = "global";
22040
+ }
22041
+ render() {
22042
+ const all2 = this.model?.memory.list() ?? [];
22043
+ const scopes = this.#scopes;
22044
+ const scope = this.scope;
22045
+ const option2 = (item2) => b`<sp-menu-item value=${item2.id}>${item2.label}</sp-menu-item>`;
22046
+ const shown = visible(all2, scope, this.tag, this.query);
22047
+ return b`<div class="bar"><span>${shown.length} of ${all2.filter((memory) => memory.scope === scope).length} memories</span><span class="spacer"></span>
22029
22048
  <swc-action-button size="s" quiet @click=${() => this.editing = "new"}><swc-icon-add slot="icon"></swc-icon-add>Remember</swc-action-button>
22030
22049
  </div>
22031
22050
  <div class="tools">
22032
22051
  <sp-search size="s" label="Search memories" placeholder="Search memories" .value=${this.query} @input=${(event2) => this.query = event2.target.value} @submit=${(event2) => event2.preventDefault()}></sp-search>
22033
- <sp-picker size="s" label="Scope" value=${this.scope} @change=${(event2) => this.scope = event2.target.value}>
22034
- <sp-menu-item value="global">Everyone</sp-menu-item>
22035
- ${cones.map((cone) => b`<sp-menu-item value=${cone.id}>${cone.name}</sp-menu-item>`)}
22052
+ <sp-picker size="s" label="Scope" value=${scope} @change=${(event2) => this.scope = event2.target.value}>
22053
+ ${scopes.filter((item2) => !item2.group).map(option2)}
22054
+ ${["cones", "roles"].map((group) => {
22055
+ const items = scopes.filter((item2) => item2.group === group);
22056
+ return items.length ? b`<sp-menu-group size="s"><span slot="header">${scopeGroups[group]}</span>${items.map(option2)}</sp-menu-group>` : A;
22057
+ })}
22036
22058
  </sp-picker>
22037
22059
  <sp-picker size="s" label="Tag" value=${this.tag} @change=${(event2) => this.tag = event2.target.value}>
22038
22060
  <sp-menu-item value="all">All tags</sp-menu-item>
@@ -22043,7 +22065,7 @@ var SliccMemory = class extends ModelElement {
22043
22065
  </sp-picker>
22044
22066
  </div>
22045
22067
  <div class="list">
22046
- ${this.editing === "new" ? b`<div class="row">${this.#form({ scope: this.scope })}</div>` : A}
22068
+ ${this.editing === "new" ? b`<div class="row">${this.#form({ scope })}</div>` : A}
22047
22069
  ${shown.length ? sections(shown).map(
22048
22070
  ([section, items]) => b`<h3>${section}</h3>${items.map((memory) => this.#row(memory))}`
22049
22071
  ) : b`<div class="note">${all2.length ? "No memories match." : "No memories yet."}</div>`}