@kb-labs/core-state-daemon 2.118.2 → 2.119.0-canary.0b1ec4151

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/bin.cjs CHANGED
@@ -7102,12 +7102,13 @@ function createPluginAPI(options) {
7102
7102
  }
7103
7103
  function compileDocumentAcl(pluginId, perm) {
7104
7104
  const acl = /* @__PURE__ */ new Map();
7105
+ const storagePluginId = sanitizeForIdentifier(pluginId);
7105
7106
  for (const own of perm?.owns ?? []) {
7106
7107
  validateName("collection", own);
7107
7108
  if (acl.has(own)) {
7108
7109
  throw new PermissionError(`Collection '${own}' declared twice in owns for plugin '${pluginId}'`);
7109
7110
  }
7110
- acl.set(own, { ownedBy: "self", storageName: `${pluginId}${NAMESPACE_SEPARATOR}${own}` });
7111
+ acl.set(own, { ownedBy: "self", storageName: `${storagePluginId}${NAMESPACE_SEPARATOR}${own}` });
7111
7112
  }
7112
7113
  for (const grant of perm?.access ?? []) {
7113
7114
  validateName("collection", grant.collection);
@@ -7125,7 +7126,7 @@ function compileDocumentAcl(pluginId, perm) {
7125
7126
  acl.set(grant.collection, {
7126
7127
  ownedBy: "other",
7127
7128
  ops: new Set(grant.ops),
7128
- storageName: `${grant.owner}${NAMESPACE_SEPARATOR}${grant.collection}`
7129
+ storageName: `${sanitizeForIdentifier(grant.owner)}${NAMESPACE_SEPARATOR}${grant.collection}`
7129
7130
  });
7130
7131
  }
7131
7132
  return { acl, allowDDL: perm?.ddl?.ownCollections === true };
@@ -7904,7 +7905,7 @@ function makeAssemblyHook(getLogger) {
7904
7905
  getLogger?.()
7905
7906
  );
7906
7907
  }
7907
- var PluginError, PermissionError, TimeoutError2, AbortError, PLATFORM_CONTEXT_KEY, platformContext, RUNTIME_CONTEXT_KEY, runtimeContext, HARDCODED_DENIED_PATTERNS, ALWAYS_ALLOWED, BLOCKED_COMMANDS, ANALYTICS_EVENT, EVENT_BUS_TOPIC, NAMESPACE_SEPARATOR, KV_NAMESPACE_SEPARATOR, validateName, wrapLogger, wrapLlm, wrapEmbeddings, wrapVectorStore, wrapCache, wrapStorage, wrapNotifier, ADAPTER_REGISTRY, PIPELINE_SLOTS, SLOT_ORDER, NOOP_LIFECYCLE, ANSI_RE, GovernedProcessError, NodeProcessBackend, DarwinProcessBackend, LinuxProcessBackend, registered, BrokeredProcessExecutor;
7908
+ var PluginError, PermissionError, TimeoutError2, AbortError, PLATFORM_CONTEXT_KEY, platformContext, RUNTIME_CONTEXT_KEY, runtimeContext, HARDCODED_DENIED_PATTERNS, ALWAYS_ALLOWED, BLOCKED_COMMANDS, ANALYTICS_EVENT, EVENT_BUS_TOPIC, NAMESPACE_SEPARATOR, KV_NAMESPACE_SEPARATOR, validateName, sanitizeForIdentifier, wrapLogger, wrapLlm, wrapEmbeddings, wrapVectorStore, wrapCache, wrapStorage, wrapNotifier, ADAPTER_REGISTRY, PIPELINE_SLOTS, SLOT_ORDER, NOOP_LIFECYCLE, ANSI_RE, GovernedProcessError, NodeProcessBackend, DarwinProcessBackend, LinuxProcessBackend, registered, BrokeredProcessExecutor;
7908
7909
  var init_dist6 = __esm({
7909
7910
  "../../../core/plugin-runtime/dist/index.js"() {
7910
7911
  init_dist();
@@ -8018,6 +8019,7 @@ var init_dist6 = __esm({
8018
8019
  );
8019
8020
  }
8020
8021
  };
8022
+ sanitizeForIdentifier = (pluginId) => pluginId.replace(/[^a-zA-Z0-9_]/g, "_");
8021
8023
  wrapLogger = (adapter, ctx) => adapter.child({ plugin: ctx.pluginId });
8022
8024
  wrapLlm = (adapter, ctx) => {
8023
8025
  if (!ctx.permissions.platform?.llm) {