@apotech-os/cli 2.5.0 → 2.6.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/index.js CHANGED
@@ -22978,7 +22978,16 @@ var AppRoleSchema = external_exports.object({
22978
22978
  * '*' grants access to all agents (wildcard). Requires role.capabilities to
22979
22979
  * include 'agents' — checked by `checkManifestSemantics`, not by this schema.
22980
22980
  */
22981
- agents: external_exports.array(external_exports.string()).optional()
22981
+ agents: external_exports.array(external_exports.string()).optional(),
22982
+ /**
22983
+ * S3 — glob allowlist for ctx.api.prompts, checked on every call (read and
22984
+ * write alike) by `isPromptAllowed`. Absent or empty means deny-all: unlike
22985
+ * `capabilities`, there is no way to hold the 'prompts' capability without
22986
+ * also naming at least one prompt it covers — `checkManifestSemantics`
22987
+ * enforces that pairing at authoring time.
22988
+ * Example: ['triage', 'escalation', 'agent/*', 'shared/*'].
22989
+ */
22990
+ prompts: external_exports.array(external_exports.string()).optional()
22982
22991
  });
22983
22992
  var UI_ENTRY_REGEX = /^dist\/ui\/[A-Za-z0-9_-]+\.js$/;
22984
22993
  var PageDefSchema = external_exports.object({
@@ -23582,8 +23591,26 @@ function checkManifestSemantics(manifest) {
23582
23591
  }
23583
23592
  agentSlugs.add(agent.slug);
23584
23593
  }
23594
+ errors.push(...checkPromptsCapabilityPairing(manifest));
23585
23595
  return errors;
23586
23596
  }
23597
+ function checkPromptsCapabilityPairing(manifest) {
23598
+ const role = manifest.role;
23599
+ if (!role) return [];
23600
+ const hasCapability = (role.capabilities ?? []).includes("prompts");
23601
+ const hasAllowlist = (role.prompts ?? []).length > 0;
23602
+ if (hasCapability && !hasAllowlist) {
23603
+ return [
23604
+ 'role.capabilities includes "prompts" but role.prompts is empty. Declare at least one glob (e.g. role.prompts: ["triage", "shared/*"]) naming which prompts this app may access \u2014 an absent or empty role.prompts denies every prompt.'
23605
+ ];
23606
+ }
23607
+ if (!hasCapability && hasAllowlist) {
23608
+ return [
23609
+ 'role.prompts is declared but role.capabilities does not include "prompts". Add "prompts" to role.capabilities, or remove role.prompts.'
23610
+ ];
23611
+ }
23612
+ return [];
23613
+ }
23587
23614
 
23588
23615
  // src/manifest-build.ts
23589
23616
  var ManifestBuildError = class extends Error {