shadok-ai 0.20.23 → 0.20.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.20.23",
3
+ "version": "0.20.24",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test --test-timeout=120000 test/*.ts context/*/test/*.test.mjs",
package/public/index.html CHANGED
@@ -4226,7 +4226,7 @@
4226
4226
  <div class="field"><span class="label">Deny (one per line)</span><textarea id="profDeny" rows="2" placeholder="Bash(git commit:*)"></textarea></div>
4227
4227
  <div class="field"><span class="label">Model (optional)</span><input id="profModel" placeholder="claude-opus-4-8" autocomplete="off" spellcheck="false"></div>
4228
4228
  <div class="field"><span class="label">Thinking effort <span class="check-hint">— how hard agents of this role think before answering; higher costs more tokens</span></span><select id="profEffort"></select></div>
4229
- <div class="field"><span class="label">Secrets injected <span class="check-hint">— read-only: values resolve per group when an agent starts (its own group's, then shared with it, then Main's)</span></span><ul id="profSecretsList" class="prof-secrets-ro"></ul><button type="button" class="linkish" id="profToSecrets">→ Manage secrets</button></div>
4229
+ <div class="field"><span class="label">Secrets injected <span class="check-hint">— read-only: values resolve per group when an agent starts (its own group's, then shared with it, then the public ones' — Main included)</span></span><ul id="profSecretsList" class="prof-secrets-ro"></ul><button type="button" class="linkish" id="profToSecrets">→ Manage secrets</button></div>
4230
4230
  <div class="field"><span class="label">MCP servers (JSON, optional) <span class="check-hint">— passed to its agents at spawn; write a secret as <code>${NAME}</code> and tick NAME above, never its value</span></span><textarea id="profMcp" rows="4" spellcheck="false" placeholder='{ "matomo": { "type": "http", "url": "https://…", "headers": { "Authorization": "Bearer ${MATOMO_TOKEN}" } } }'></textarea></div>
4231
4231
  <div style="display:flex;gap:8px;margin-top:12px">
4232
4232
  <button id="profSave" class="primary">Save profile</button>
@@ -5158,7 +5158,7 @@
5158
5158
  chanOverflowItems: () => [],
5159
5159
  // Before the module lands: the flat list (today's look) and no groups.
5160
5160
  secretsPanelMode: () => "flat",
5161
- secretSections: () => ({ own: [], sharedIn: [], inheritedMain: [] }),
5161
+ secretSections: () => ({ own: [], sharedIn: [], commons: [] }),
5162
5162
  panelGroupOptions: () => [],
5163
5163
  publicWriteTarget: () => null,
5164
5164
  keyGroups: () => [],
@@ -13605,6 +13605,10 @@
13605
13605
  const PUBLIC_BUCKET = "__public__";
13606
13606
  function groupName(id) {
13607
13607
  if (String(id) === PUBLIC_BUCKET) return "Public";
13608
+ // The commons row says "from Public", never "from main": the selector has no
13609
+ // Main entry (it folds into the bucket), so the internal id would be the one
13610
+ // name on screen nothing else uses.
13611
+ if (String(id) === "main") return "Public";
13608
13612
  const g = vaultGroups.find((x) => String(x.id) === String(id));
13609
13613
  if (!g) return String(id);
13610
13614
  // Match the rail + the selector: a private group is the sealed "Personal"
@@ -13903,7 +13907,10 @@
13903
13907
  };
13904
13908
  section("Own — " + groupName(panelGroup), sec.own, false, "no secret of its own yet");
13905
13909
  section("Shared with this group", sec.sharedIn, true, "nothing lent by another group");
13906
- section("Inherited from Main", sec.inheritedMain, true, "nothing in Main");
13910
+ // Main AND every public group: one commons, the tier `commonsGroupIds`
13911
+ // resolves from. Naming it "Main" hid every public group's secret from a
13912
+ // walled group's view (see `secretSections`).
13913
+ section("Inherited from Public", sec.commons, true, "nothing in the public groups");
13907
13914
  }
13908
13915
  $("secretsGroup").addEventListener("change", () => { panelGroup = $("secretsGroup").value; renderSecrets(); });
13909
13916
 
@@ -69,11 +69,26 @@ export function secretsPanelMode(groups) {
69
69
  * Partition the server's tagged list into the three sections. `selectedGroupId`
70
70
  * scopes the OWN section to one group (null = every own secret). Unknown or
71
71
  * malformed rows are dropped rather than guessed into a section.
72
+ *
73
+ * `commons` is the READ-ONLY tier a walled group inherits, and it is Main AND
74
+ * every public group — the same set `commonsGroupIds` resolves values from
75
+ * (src/connected-accounts.ts), because "public = commun" means a public group's
76
+ * secret reaches every agent on the instance exactly like Main's.
77
+ *
78
+ * It used to be Main alone (the field was called `inheritedMain`), so a public
79
+ * group's secret, tagged `own` by the server for everyone, matched neither the
80
+ * selected group nor the bucket in a walled group's view and was dropped from
81
+ * ALL THREE sections. The panel then showed a restricted group an empty vault
82
+ * while its agents were in fact receiving those values — a denial that did not
83
+ * exist, which is the worst direction for an access panel to be wrong in: it
84
+ * invites someone to copy a credential into a second group to "fix" it.
72
85
  */
73
86
  export function secretSections(secrets, selectedGroupId, groups) {
74
- const out = { own: [], sharedIn: [], inheritedMain: [] };
87
+ const out = { own: [], sharedIn: [], commons: [] };
75
88
  if (!Array.isArray(secrets)) return out;
76
89
  const pubIds = new Set(publicGroupIds(groups));
90
+ // A concrete non-public group: a real sealed vault, which inherits the commons.
91
+ const walled = selectedGroupId != null && selectedGroupId !== PUBLIC_BUCKET;
77
92
  for (const s of secrets) {
78
93
  if (!s || typeof s.name !== "string") continue;
79
94
  if (s.source === "own") {
@@ -81,15 +96,18 @@ export function secretSections(secrets, selectedGroupId, groups) {
81
96
  // The "Public groups" view aggregates every public group's own secrets;
82
97
  // a concrete group view scopes to that id; null shows all own secrets.
83
98
  const inBucket = selectedGroupId === PUBLIC_BUCKET && pubIds.has(owner);
84
- const inGroup =
85
- selectedGroupId != null && selectedGroupId !== PUBLIC_BUCKET && owner === String(selectedGroupId);
99
+ const inGroup = walled && owner === String(selectedGroupId);
86
100
  if (selectedGroupId == null || inBucket || inGroup) out.own.push(s);
101
+ // Seen from a walled group, a public group's secret is the commons tier —
102
+ // read there, edited in the "Public" view (`canWriteSecretGroup` would
103
+ // refuse a write from a member of the walled group anyway).
104
+ else if (walled && pubIds.has(owner)) out.commons.push(s);
87
105
  } else if (s.source === "shared") out.sharedIn.push(s);
88
106
  else if (s.source === "main") {
89
107
  // In "Public groups", a Main secret the caller may write is one of its
90
108
  // own (Main is public); everywhere else it is the inherited tier.
91
109
  if (selectedGroupId === PUBLIC_BUCKET && s.editable === true) out.own.push(s);
92
- else out.inheritedMain.push(s);
110
+ else out.commons.push(s);
93
111
  }
94
112
  }
95
113
  return out;