@apotech-os/cli 3.0.1 → 3.1.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
@@ -22957,8 +22957,13 @@ var AppRoleSchema = external_exports.object({
22957
22957
  actions: external_exports.array(external_exports.object({ provider: external_exports.string(), action: external_exports.string() })),
22958
22958
  /**
22959
22959
  * Framework primitive capabilities granted to the app token.
22960
- * Each string is a capability name, e.g. 'inbox'.
22961
- * Absence means the capability is denied (deny-by-default, backward-compatible).
22960
+ * Each string is a capability name: 'inbox', 'prompts', 'langfuse',
22961
+ * 'agents', 'quality', … Absence means the capability is denied
22962
+ * (deny-by-default, backward-compatible).
22963
+ *
22964
+ * Unlike 'prompts', 'quality' needs no companion allowlist — the quality
22965
+ * surface (experiments, expert reviews) is unscoped by design, so holding
22966
+ * the capability grants the whole of it.
22962
22967
  * P2 approvals will reuse this field.
22963
22968
  */
22964
22969
  capabilities: external_exports.array(external_exports.string()).optional(),
@@ -23032,6 +23037,13 @@ var PromptDefSchema = external_exports.object({
23032
23037
  template: external_exports.string(),
23033
23038
  labels: external_exports.array(external_exports.string()).optional()
23034
23039
  });
23040
+ var SuggestedToolBindingSchema = external_exports.object({
23041
+ /** Provider ref: `mcp:<slug>`, `app:<slug>`, or a bare integration slug. */
23042
+ provider: external_exports.string().min(1),
23043
+ /** Actions to enable; absent = everything the provider exposes. */
23044
+ enabledActions: external_exports.array(external_exports.string()).optional(),
23045
+ allowDestructive: external_exports.boolean().optional()
23046
+ });
23035
23047
  var AgentDeclarationSchema = external_exports.object({
23036
23048
  /** Stable per platform; becomes the Langfuse prompt name `agent.platform.<slug>`. */
23037
23049
  slug: external_exports.string().regex(/^[a-z][a-z0-9-]*$/),
@@ -23042,7 +23054,9 @@ var AgentDeclarationSchema = external_exports.object({
23042
23054
  provider: external_exports.enum(["openai", "anthropic"]).optional(),
23043
23055
  model: external_exports.string().optional(),
23044
23056
  /** System prompt: seeded as Langfuse v1, re-versioned when the app changes it. */
23045
- prompt: external_exports.string().min(1)
23057
+ prompt: external_exports.string().min(1),
23058
+ /** Recommended wiring, applied only by an admin (no `.default()` — checksum). */
23059
+ suggestedToolBindings: external_exports.array(SuggestedToolBindingSchema).optional()
23046
23060
  });
23047
23061
  var AppManifestFieldsSchema = external_exports.object({
23048
23062
  universalIdentifier: external_exports.string().uuid(),
@@ -23590,10 +23604,35 @@ function checkManifestSemantics(manifest) {
23590
23604
  errors.push(`agents: duplicate slug '${agent.slug}' \u2014 each declared agent needs its own`);
23591
23605
  }
23592
23606
  agentSlugs.add(agent.slug);
23607
+ errors.push(...checkSuggestedToolBindings(agent));
23593
23608
  }
23594
23609
  errors.push(...checkPromptsCapabilityPairing(manifest));
23595
23610
  return errors;
23596
23611
  }
23612
+ var SUGGESTED_PROVIDER_REF = /^(?:(?:mcp|app):)?[a-z][a-z0-9-]*$/;
23613
+ function checkSuggestedToolBindings(agent) {
23614
+ const errors = [];
23615
+ const seen = /* @__PURE__ */ new Set();
23616
+ for (const suggestion of agent.suggestedToolBindings ?? []) {
23617
+ const ref = suggestion.provider;
23618
+ if (ref === "builtin" || ref.startsWith("builtin:")) {
23619
+ errors.push(
23620
+ `agents.${agent.slug}.suggestedToolBindings: 'builtin' capabilities cannot be suggested`
23621
+ );
23622
+ } else if (!SUGGESTED_PROVIDER_REF.test(ref)) {
23623
+ errors.push(
23624
+ `agents.${agent.slug}.suggestedToolBindings: malformed provider ref '${ref}' \u2014 expected 'mcp:<slug>', 'app:<slug>' or a bare integration slug`
23625
+ );
23626
+ }
23627
+ if (seen.has(ref)) {
23628
+ errors.push(
23629
+ `agents.${agent.slug}.suggestedToolBindings: duplicate provider '${ref}' \u2014 the proposal is keyed by provider`
23630
+ );
23631
+ }
23632
+ seen.add(ref);
23633
+ }
23634
+ return errors;
23635
+ }
23597
23636
  function checkPromptsCapabilityPairing(manifest) {
23598
23637
  const role = manifest.role;
23599
23638
  if (!role) return [];