@kb-labs/mcp-app 2.118.2 → 2.119.0-canary.85d060ea6

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
@@ -7115,12 +7115,13 @@ function createPluginAPI(options) {
7115
7115
  }
7116
7116
  function compileDocumentAcl(pluginId, perm) {
7117
7117
  const acl = /* @__PURE__ */ new Map();
7118
+ const storagePluginId = sanitizeForIdentifier(pluginId);
7118
7119
  for (const own of perm?.owns ?? []) {
7119
7120
  validateName("collection", own);
7120
7121
  if (acl.has(own)) {
7121
7122
  throw new PermissionError(`Collection '${own}' declared twice in owns for plugin '${pluginId}'`);
7122
7123
  }
7123
- acl.set(own, { ownedBy: "self", storageName: `${pluginId}${NAMESPACE_SEPARATOR}${own}` });
7124
+ acl.set(own, { ownedBy: "self", storageName: `${storagePluginId}${NAMESPACE_SEPARATOR}${own}` });
7124
7125
  }
7125
7126
  for (const grant of perm?.access ?? []) {
7126
7127
  validateName("collection", grant.collection);
@@ -7138,7 +7139,7 @@ function compileDocumentAcl(pluginId, perm) {
7138
7139
  acl.set(grant.collection, {
7139
7140
  ownedBy: "other",
7140
7141
  ops: new Set(grant.ops),
7141
- storageName: `${grant.owner}${NAMESPACE_SEPARATOR}${grant.collection}`
7142
+ storageName: `${sanitizeForIdentifier(grant.owner)}${NAMESPACE_SEPARATOR}${grant.collection}`
7142
7143
  });
7143
7144
  }
7144
7145
  return { acl, allowDDL: perm?.ddl?.ownCollections === true };
@@ -7963,7 +7964,7 @@ function wrapCliResult(runResult, descriptor) {
7963
7964
  meta: standardMeta
7964
7965
  };
7965
7966
  }
7966
- 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;
7967
+ 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;
7967
7968
  var init_dist6 = __esm({
7968
7969
  "../../../core/plugin-runtime/dist/index.js"() {
7969
7970
  init_dist();
@@ -8077,6 +8078,7 @@ var init_dist6 = __esm({
8077
8078
  );
8078
8079
  }
8079
8080
  };
8081
+ sanitizeForIdentifier = (pluginId) => pluginId.replace(/[^a-zA-Z0-9_]/g, "_");
8080
8082
  wrapLogger = (adapter, ctx) => adapter.child({ plugin: ctx.pluginId });
8081
8083
  wrapLlm = (adapter, ctx) => {
8082
8084
  if (!ctx.permissions.platform?.llm) {