@botpress/adk 1.19.0-beta.9 → 2.0.0-alpha.1

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.
Files changed (199) hide show
  1. package/dist/agent-init/agent-project-generator.d.ts +5 -1
  2. package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
  3. package/dist/agent-project/agent-project.d.ts +3 -3
  4. package/dist/agent-project/agent-project.d.ts.map +1 -1
  5. package/dist/agent-project/agent-resolver.d.ts.map +1 -1
  6. package/dist/agent-project/config-writer.d.ts +1 -1
  7. package/dist/agent-project/dependency-state-to-dependencies.d.ts +11 -0
  8. package/dist/agent-project/dependency-state-to-dependencies.d.ts.map +1 -0
  9. package/dist/agent-project/types.d.ts +9 -4
  10. package/dist/agent-project/types.d.ts.map +1 -1
  11. package/dist/agent0/capabilities/commands/adk-build.md +6 -5
  12. package/dist/agent0/capabilities/commands/adk-debug.md +1 -1
  13. package/dist/agent0/capabilities/commands/adk-dev-console.md +1 -1
  14. package/dist/agent0/capabilities/commands/adk-document.md +10 -2
  15. package/dist/agent0/capabilities/commands/adk-eval.md +1 -1
  16. package/dist/agent0/capabilities/commands/adk-explain.md +2 -2
  17. package/dist/agent0/capabilities/commands/adk-init.md +2 -2
  18. package/dist/agent0/capabilities/commands/adk-ship.md +1 -1
  19. package/dist/agent0/capabilities/commands/adk-test.md +3 -3
  20. package/dist/agent0/capabilities/commands/adk-validate.md +3 -3
  21. package/dist/agent0/capabilities/skills/adk/SKILL.md +21 -21
  22. package/dist/agent0/capabilities/skills/adk/references/actions.md +245 -239
  23. package/dist/agent0/capabilities/skills/adk/references/advanced-patterns.md +185 -218
  24. package/dist/agent0/capabilities/skills/adk/references/agent-config.md +74 -71
  25. package/dist/agent0/capabilities/skills/adk/references/assets.md +45 -48
  26. package/dist/agent0/capabilities/skills/adk/references/autonomous-execution.md +40 -46
  27. package/dist/agent0/capabilities/skills/adk/references/cli.md +17 -7
  28. package/dist/agent0/capabilities/skills/adk/references/context-api.md +98 -94
  29. package/dist/agent0/capabilities/skills/adk/references/conversation-lifecycle.md +65 -62
  30. package/dist/agent0/capabilities/skills/adk/references/conversations.md +395 -385
  31. package/dist/agent0/capabilities/skills/adk/references/custom-components.md +1 -1
  32. package/dist/agent0/capabilities/skills/adk/references/desk.md +236 -234
  33. package/dist/agent0/capabilities/skills/adk/references/explain-config.md +54 -37
  34. package/dist/agent0/capabilities/skills/adk/references/files.md +301 -306
  35. package/dist/agent0/capabilities/skills/adk/references/integration-actions.md +211 -214
  36. package/dist/agent0/capabilities/skills/adk/references/integrations.md +33 -31
  37. package/dist/agent0/capabilities/skills/adk/references/interfaces.md +13 -12
  38. package/dist/agent0/capabilities/skills/adk/references/knowledge-bases.md +98 -111
  39. package/dist/agent0/capabilities/skills/adk/references/mcp-server.md +6 -0
  40. package/dist/agent0/capabilities/skills/adk/references/messages.md +280 -256
  41. package/dist/agent0/capabilities/skills/adk/references/model-configuration.md +52 -49
  42. package/dist/agent0/capabilities/skills/adk/references/patterns-mistakes.md +102 -101
  43. package/dist/agent0/capabilities/skills/adk/references/plugins.md +15 -15
  44. package/dist/agent0/capabilities/skills/adk/references/tables.md +204 -210
  45. package/dist/agent0/capabilities/skills/adk/references/tags.md +141 -143
  46. package/dist/agent0/capabilities/skills/adk/references/tools.md +191 -199
  47. package/dist/agent0/capabilities/skills/adk/references/triggers.md +331 -336
  48. package/dist/agent0/capabilities/skills/adk/references/workflow-steps.md +132 -96
  49. package/dist/agent0/capabilities/skills/adk/references/workflows.md +479 -464
  50. package/dist/agent0/capabilities/skills/adk/references/zai-agent-reference.md +127 -129
  51. package/dist/agent0/capabilities/skills/adk/references/zai-complete-guide.md +255 -276
  52. package/dist/agent0/capabilities/skills/adk-debugger/SKILL.md +21 -17
  53. package/dist/agent0/capabilities/skills/adk-debugger/references/common-failures.md +25 -25
  54. package/dist/agent0/capabilities/skills/adk-debugger/references/conversation-analysis.md +49 -41
  55. package/dist/agent0/capabilities/skills/adk-debugger/references/debug-workflow.md +20 -14
  56. package/dist/agent0/capabilities/skills/adk-debugger/references/llm-debugging.md +13 -13
  57. package/dist/agent0/capabilities/skills/adk-debugger/references/trace-summarization.md +18 -18
  58. package/dist/agent0/capabilities/skills/adk-debugger/references/traces-and-logs.md +67 -67
  59. package/dist/agent0/capabilities/skills/adk-dev-console/SKILL.md +36 -36
  60. package/dist/agent0/capabilities/skills/adk-dev-console/references/agent-steps.md +14 -6
  61. package/dist/agent0/capabilities/skills/adk-dev-console/references/multi-agent-dashboard.md +13 -13
  62. package/dist/agent0/capabilities/skills/adk-dev-console/references/pages.md +18 -0
  63. package/dist/agent0/capabilities/skills/adk-docs/SKILL.md +13 -13
  64. package/dist/agent0/capabilities/skills/adk-docs/references/doc-standards.md +15 -0
  65. package/dist/agent0/capabilities/skills/adk-evals/SKILL.md +29 -23
  66. package/dist/agent0/capabilities/skills/adk-evals/references/eval-format.md +31 -23
  67. package/dist/agent0/capabilities/skills/adk-evals/references/test-patterns.md +25 -36
  68. package/dist/agent0/capabilities/skills/adk-evals/references/testing-workflow.md +6 -4
  69. package/dist/agent0/index.js +41 -19
  70. package/dist/agent0/index.js.map +7 -7
  71. package/dist/agent0/runtime/client.d.ts +2 -0
  72. package/dist/agent0/runtime/client.d.ts.map +1 -1
  73. package/dist/agent0/runtime/engine.d.ts +2 -1
  74. package/dist/agent0/runtime/engine.d.ts.map +1 -1
  75. package/dist/agent0/runtime/process.d.ts +1 -0
  76. package/dist/agent0/runtime/process.d.ts.map +1 -1
  77. package/dist/assets/manager.d.ts +3 -0
  78. package/dist/assets/manager.d.ts.map +1 -1
  79. package/dist/auth/credentials.d.ts +1 -1
  80. package/dist/bot-generator/generator.d.ts +22 -0
  81. package/dist/bot-generator/generator.d.ts.map +1 -1
  82. package/dist/bot-generator/plugin-sync.d.ts.map +1 -1
  83. package/dist/commands/base-command.d.ts +1 -0
  84. package/dist/commands/base-command.d.ts.map +1 -1
  85. package/dist/commands/bp-dev-command.d.ts +1 -1
  86. package/dist/commands/bp-dev-command.d.ts.map +1 -1
  87. package/dist/commands/bp-dev-stderr.d.ts +9 -0
  88. package/dist/commands/bp-dev-stderr.d.ts.map +1 -1
  89. package/dist/commands/index.d.ts +1 -0
  90. package/dist/commands/index.d.ts.map +1 -1
  91. package/dist/dependencies/catalog/catalog-service.d.ts +53 -0
  92. package/dist/dependencies/catalog/catalog-service.d.ts.map +1 -0
  93. package/dist/dependencies/catalog/client-factory.d.ts +33 -0
  94. package/dist/dependencies/catalog/client-factory.d.ts.map +1 -0
  95. package/dist/dependencies/catalog/integration-source.d.ts +34 -0
  96. package/dist/dependencies/catalog/integration-source.d.ts.map +1 -0
  97. package/dist/dependencies/catalog/interface-source.d.ts +23 -0
  98. package/dist/dependencies/catalog/interface-source.d.ts.map +1 -0
  99. package/dist/dependencies/catalog/plugin-source.d.ts +49 -0
  100. package/dist/dependencies/catalog/plugin-source.d.ts.map +1 -0
  101. package/dist/dependencies/catalog/resolution-cache.d.ts +76 -0
  102. package/dist/dependencies/catalog/resolution-cache.d.ts.map +1 -0
  103. package/dist/dependencies/dependency-manager.d.ts +31 -16
  104. package/dist/dependencies/dependency-manager.d.ts.map +1 -1
  105. package/dist/dependencies/errors.d.ts +2 -2
  106. package/dist/dependencies/errors.d.ts.map +1 -1
  107. package/dist/dependencies/index.d.ts +5 -4
  108. package/dist/dependencies/index.d.ts.map +1 -1
  109. package/dist/dependencies/index.js +2089 -1670
  110. package/dist/dependencies/index.js.map +37 -30
  111. package/dist/dependencies/legacy-lock-file.d.ts +15 -0
  112. package/dist/dependencies/legacy-lock-file.d.ts.map +1 -0
  113. package/dist/dependencies/migration.d.ts +19 -0
  114. package/dist/dependencies/migration.d.ts.map +1 -1
  115. package/dist/dependencies/resolvers/integration-resolver.d.ts +4 -3
  116. package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -1
  117. package/dist/dependencies/resolvers/plugin-resolver.d.ts +4 -4
  118. package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -1
  119. package/dist/dependencies/snapshot-store.d.ts +59 -0
  120. package/dist/dependencies/snapshot-store.d.ts.map +1 -0
  121. package/dist/dependencies/status-resolver.d.ts +36 -0
  122. package/dist/dependencies/status-resolver.d.ts.map +1 -0
  123. package/dist/dependencies/status.d.ts +214 -0
  124. package/dist/dependencies/status.d.ts.map +1 -0
  125. package/dist/dependencies/types.d.ts +380 -29
  126. package/dist/dependencies/types.d.ts.map +1 -1
  127. package/dist/file-watcher/watcher.d.ts +21 -5
  128. package/dist/file-watcher/watcher.d.ts.map +1 -1
  129. package/dist/generators/action-types.d.ts.map +1 -1
  130. package/dist/generators/client-wrapper.d.ts.map +1 -1
  131. package/dist/index.d.ts +4 -5
  132. package/dist/index.d.ts.map +1 -1
  133. package/dist/index.js +3134 -2226
  134. package/dist/index.js.map +55 -48
  135. package/dist/integrations/config-utils.d.ts +11 -7
  136. package/dist/integrations/config-utils.d.ts.map +1 -1
  137. package/dist/integrations/hub-cache.d.ts +0 -58
  138. package/dist/integrations/hub-cache.d.ts.map +1 -1
  139. package/dist/integrations/index.d.ts +1 -3
  140. package/dist/integrations/index.d.ts.map +1 -1
  141. package/dist/integrations/manager.d.ts +19 -53
  142. package/dist/integrations/manager.d.ts.map +1 -1
  143. package/dist/interfaces/enhanced-cache.d.ts +7 -7
  144. package/dist/interfaces/enhanced-cache.d.ts.map +1 -1
  145. package/dist/interfaces/manager.d.ts +11 -17
  146. package/dist/interfaces/manager.d.ts.map +1 -1
  147. package/dist/knowledge/manager.d.ts +3 -0
  148. package/dist/knowledge/manager.d.ts.map +1 -1
  149. package/dist/plugins/index.d.ts +0 -1
  150. package/dist/plugins/index.d.ts.map +1 -1
  151. package/dist/plugins/manager.d.ts +16 -48
  152. package/dist/plugins/manager.d.ts.map +1 -1
  153. package/dist/preflight/checker.d.ts +6 -1
  154. package/dist/preflight/checker.d.ts.map +1 -1
  155. package/dist/preflight/dependency-gate.d.ts +37 -0
  156. package/dist/preflight/dependency-gate.d.ts.map +1 -0
  157. package/dist/preflight/index.d.ts +2 -1
  158. package/dist/preflight/index.d.ts.map +1 -1
  159. package/dist/preflight/types.d.ts +18 -0
  160. package/dist/preflight/types.d.ts.map +1 -1
  161. package/dist/runner/script-runner.d.ts.map +1 -1
  162. package/dist/tables/table-manager.d.ts +3 -0
  163. package/dist/tables/table-manager.d.ts.map +1 -1
  164. package/dist/templates/README.md +23 -13
  165. package/dist/templates/blank/agent.config.ts +3 -3
  166. package/dist/templates/blank/src/triggers/index.ts +1 -1
  167. package/dist/templates/botpress-desk/evals/index.eval.ts +1 -1
  168. package/dist/templates/botpress-desk/src/triggers/index.ts +1 -1
  169. package/dist/templates/crm-enrichment/README.md +3 -3
  170. package/dist/templates/crm-enrichment/agent.config.ts +2 -2
  171. package/dist/templates/crm-enrichment/src/conversations/index.ts +1 -1
  172. package/dist/templates/hello-world/agent.config.ts +3 -3
  173. package/dist/templates/hello-world/src/triggers/index.ts +1 -1
  174. package/dist/templates/knowledge-assistant/src/triggers/index.ts +1 -1
  175. package/dist/templates/template.config.json +3 -3
  176. package/dist/utils/ids.d.ts +10 -0
  177. package/dist/utils/ids.d.ts.map +1 -1
  178. package/dist/workspace/workspace-cache.d.ts +2 -1
  179. package/dist/workspace/workspace-cache.d.ts.map +1 -1
  180. package/package.json +3 -3
  181. package/dist/agent-project/lock-to-dependencies.d.ts +0 -11
  182. package/dist/agent-project/lock-to-dependencies.d.ts.map +0 -1
  183. package/dist/dependencies/lock-file.d.ts +0 -15
  184. package/dist/dependencies/lock-file.d.ts.map +0 -1
  185. package/dist/integrations/enhanced-cache.d.ts +0 -53
  186. package/dist/integrations/enhanced-cache.d.ts.map +0 -1
  187. package/dist/plugins/enhanced-cache.d.ts +0 -53
  188. package/dist/plugins/enhanced-cache.d.ts.map +0 -1
  189. package/dist/templates/blank/package.json +0 -17
  190. package/dist/templates/blank/tsconfig.json +0 -25
  191. package/dist/templates/botpress-desk/package.json +0 -17
  192. package/dist/templates/crm-enrichment/package.json +0 -18
  193. package/dist/templates/crm-enrichment/tsconfig.json +0 -25
  194. package/dist/templates/hello-world/package.json +0 -18
  195. package/dist/templates/hello-world/tsconfig.json +0 -25
  196. package/dist/templates/knowledge-assistant/package.json +0 -18
  197. package/dist/templates/knowledge-assistant/tsconfig.json +0 -25
  198. package/dist/templates/slack-triage/package.json +0 -18
  199. package/dist/templates/slack-triage/tsconfig.json +0 -25
@@ -0,0 +1,15 @@
1
+ import { type DependencyStateData, type Environment } from './types.js';
2
+ export declare class LegacyDependencyLockFile {
3
+ private readonly filePath;
4
+ private readonly env;
5
+ constructor(opts: {
6
+ projectPath: string;
7
+ env: Environment;
8
+ });
9
+ exists(): Promise<boolean>;
10
+ read(options?: {
11
+ tolerant?: boolean;
12
+ }): Promise<DependencyStateData>;
13
+ delete(): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=legacy-lock-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-lock-file.d.ts","sourceRoot":"","sources":["../../src/dependencies/legacy-lock-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAG9F,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;gBAErB,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,WAAW,CAAA;KAAE;IAKrD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAS1B,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyBpE,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAO9B"}
@@ -1,8 +1,27 @@
1
1
  import type { Client } from '@botpress/client';
2
2
  import type { MigrationResult } from './types.js';
3
+ import { IntegrationResolver } from './resolvers/integration-resolver.js';
4
+ import { PluginResolver } from './resolvers/plugin-resolver.js';
3
5
  export interface MigrateOptions {
4
6
  projectPath: string;
5
7
  client: Client;
8
+ integrationResolver?: Pick<IntegrationResolver, 'applyToCloud'>;
9
+ pluginResolver?: Pick<PluginResolver, 'applyToCloud'>;
10
+ }
11
+ export declare class DependencyMigrationManager {
12
+ private readonly projectPath;
13
+ private readonly client;
14
+ private readonly snapshotStore;
15
+ private readonly integrationRegistry;
16
+ private readonly pluginRegistry;
17
+ private readonly integrationResolver;
18
+ private readonly pluginResolver;
19
+ constructor(opts: MigrateOptions);
20
+ run(): Promise<MigrationResult>;
21
+ private deleteLegacyLock;
22
+ private readLegacyState;
23
+ private fetchBot;
24
+ private importLegacyToCloud;
6
25
  }
7
26
  export declare function migrateFromConfig(opts: MigrateOptions): Promise<MigrationResult>;
8
27
  //# sourceMappingURL=migration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/dependencies/migration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAI9C,OAAO,KAAK,EAAe,eAAe,EAAgB,MAAM,YAAY,CAAA;AAI5E,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAoItF"}
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/dependencies/migration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAG9C,OAAO,KAAK,EAAoC,eAAe,EAAE,MAAM,YAAY,CAAA;AAKnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAE/D,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,mBAAmB,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAA;IAC/D,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;CACtD;AAID,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAyB;IACvD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAqB;IACzD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA2C;IAC/E,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsC;gBAEzD,IAAI,EAAE,cAAc;IAiB1B,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC;YAuGvB,gBAAgB;YAahB,eAAe;YAgBf,QAAQ;YAkBR,mBAAmB;CAQlC;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAEtF"}
@@ -1,11 +1,12 @@
1
1
  import type { Client } from '@botpress/client';
2
2
  import type { IntegrationRegistry } from '../registry/integration-registry.js';
3
- import type { IntegrationLockEntry } from '../types.js';
3
+ import type { IntegrationDependencyEntry } from '../types.js';
4
4
  interface CloudIntegration {
5
5
  name?: string;
6
6
  version?: string;
7
7
  enabled?: boolean;
8
8
  configuration?: Record<string, unknown>;
9
+ configurationType?: string | null;
9
10
  }
10
11
  export interface IntegrationResolverOptions {
11
12
  registry: IntegrationRegistry;
@@ -15,11 +16,11 @@ export declare class IntegrationResolver {
15
16
  private readonly registry;
16
17
  private readonly client;
17
18
  constructor(opts: IntegrationResolverOptions);
18
- toLockEntry(cloud: CloudIntegration): IntegrationLockEntry;
19
+ toDependencyEntry(cloud: CloudIntegration): IntegrationDependencyEntry;
19
20
  applyToCloud(opts: {
20
21
  botId: string;
21
22
  alias: string;
22
- entry: IntegrationLockEntry;
23
+ entry: IntegrationDependencyEntry;
23
24
  }): Promise<void>;
24
25
  removeFromCloud(opts: {
25
26
  botId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"integration-resolver.d.ts","sourceRoot":"","sources":["../../../src/dependencies/resolvers/integration-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGvD,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACxC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,IAAI,EAAE,0BAA0B;IAK5C,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,oBAAoB;IASpD,YAAY,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,oBAAoB,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBhG,eAAe,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAM7E"}
1
+ {"version":3,"file":"integration-resolver.d.ts","sourceRoot":"","sources":["../../../src/dependencies/resolvers/integration-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAG7D,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,IAAI,EAAE,0BAA0B;IAK5C,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,0BAA0B;IAmBhE,YAAY,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,0BAA0B,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBtG,eAAe,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAM7E"}
@@ -1,7 +1,7 @@
1
1
  import type { Client } from '@botpress/client';
2
2
  import type { PluginRegistry } from '../registry/plugin-registry.js';
3
3
  import type { IntegrationRegistry } from '../registry/integration-registry.js';
4
- import type { LockFileData, PluginLockEntry } from '../types.js';
4
+ import type { DependencyStateData, PluginDependencyEntry } from '../types.js';
5
5
  interface CloudPlugin {
6
6
  name?: string;
7
7
  version?: string;
@@ -22,12 +22,12 @@ export declare class PluginResolver {
22
22
  private readonly integrationRegistry;
23
23
  private readonly client;
24
24
  constructor(opts: PluginResolverOptions);
25
- toLockEntry(cloud: CloudPlugin): PluginLockEntry;
25
+ toDependencyEntry(cloud: CloudPlugin): PluginDependencyEntry;
26
26
  applyToCloud(opts: {
27
27
  botId: string;
28
28
  alias: string;
29
- entry: PluginLockEntry;
30
- lock: LockFileData;
29
+ entry: PluginDependencyEntry;
30
+ state: DependencyStateData;
31
31
  }): Promise<void>;
32
32
  removeFromCloud(opts: {
33
33
  botId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-resolver.d.ts","sourceRoot":"","sources":["../../../src/dependencies/resolvers/plugin-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGhE,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,yBAAyB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/F;AAQD,MAAM,WAAW,qBAAqB;IACpC,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QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,yBAAyB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/F;AAQD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,cAAc,CAAA;IACxB,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,MAAM,EAAE,MAAM,CAAA;CACf;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAqB;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,IAAI,EAAE,qBAAqB;IAMvC,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,qBAAqB;IAgBtD,YAAY,CAAC,IAAI,EAAE;QACvB,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,qBAAqB,CAAA;QAC5B,KAAK,EAAE,mBAAmB,CAAA;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmEX,eAAe,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7E"}
@@ -0,0 +1,59 @@
1
+ import type { Client } from '@botpress/client';
2
+ import { type DependencyMigrationMarker, type DependencySnapshotData, type Environment } from './types.js';
3
+ export interface DependencySnapshotStoreOptions {
4
+ projectPath: string;
5
+ }
6
+ export interface DependencySnapshotWarning {
7
+ code: 'SNAPSHOT_CORRUPT';
8
+ message: string;
9
+ env: Environment;
10
+ path: string;
11
+ }
12
+ export interface IntegrationAuthorizationSpecSource {
13
+ getSpec(name: string, version?: string): Promise<unknown>;
14
+ }
15
+ export declare class DependencySnapshotStore {
16
+ private readonly projectPath;
17
+ private readonly dirPath;
18
+ constructor(opts: DependencySnapshotStoreOptions);
19
+ getSnapshotPath(env: Environment): string;
20
+ getMigrationMarkerPath(): string;
21
+ exists(env: Environment): Promise<boolean>;
22
+ read(env: Environment, options?: {
23
+ tolerant?: boolean;
24
+ }): Promise<DependencySnapshotData | null>;
25
+ readOrEmpty(env: Environment, options?: {
26
+ tolerant?: boolean;
27
+ botId?: string;
28
+ fetchedAt?: Date;
29
+ }): Promise<DependencySnapshotData>;
30
+ write(snapshot: DependencySnapshotData): Promise<void>;
31
+ delete(env: Environment): Promise<void>;
32
+ /**
33
+ * The migration marker is an existence-only tombstone: present ⟹ the one-way
34
+ * legacy→Cloud migration already ran. Its JSON contents (version, migratedAt,
35
+ * sources) are informational — never parsed for gating, so a corrupt marker
36
+ * still counts as migrated. The CLI patcher applies the same existence
37
+ * semantics to the same file.
38
+ */
39
+ hasMigrationMarker(): Promise<boolean>;
40
+ writeMigrationMarker(marker: DependencyMigrationMarker): Promise<void>;
41
+ refreshFromCloud(opts: {
42
+ client: Client;
43
+ botId: string;
44
+ env: Environment;
45
+ fetchedAt?: Date;
46
+ integrationRegistry?: IntegrationAuthorizationSpecSource;
47
+ onWarning?: (warning: DependencySnapshotWarning) => void;
48
+ }): Promise<DependencySnapshotData>;
49
+ private readForRefresh;
50
+ }
51
+ export declare function emptyDependencySnapshot(env: Environment, botId?: string, fetchedAt?: Date): DependencySnapshotData;
52
+ export declare function dependencySnapshotFromBot(opts: {
53
+ bot: Awaited<ReturnType<Client['getBot']>>['bot'];
54
+ botId: string;
55
+ env: Environment;
56
+ fetchedAt: Date;
57
+ previous?: DependencySnapshotData | null;
58
+ }): DependencySnapshotData;
59
+ //# sourceMappingURL=snapshot-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-store.d.ts","sourceRoot":"","sources":["../../src/dependencies/snapshot-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAK9C,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAGj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C,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAStE,gBAAgB,CAAC,IAAI,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,MAAM,CAAA;QACb,GAAG,EAAE,WAAW,CAAA;QAChB,SAAS,CAAC,EAAE,IAAI,CAAA;QAChB,mBAAmB,CAAC,EAAE,kCAAkC,CAAA;QACxD,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,IAAI,CAAA;KACzD,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAsBrB,cAAc;CAmB7B;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,WAAW,EAChB,KAAK,SAAU,EACf,SAAS,GAAE,IAAkB,GAC5B,sBAAsB,CASxB;AAyDD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,WAAW,CAAA;IAChB,SAAS,EAAE,IAAI,CAAA;IACf,QAAQ,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAA;CACzC,GAAG,sBAAsB,CAoGzB"}
@@ -0,0 +1,36 @@
1
+ import type { DependencySnapshotData, DependencyStateData, DependencyStatus } from './types.js';
2
+ import type { IntegrationDefinition } from '../integrations/types.js';
3
+ import type { PluginDefinition } from '../plugins/types.js';
4
+ /** Minimal registry surface the resolver needs (best-effort spec fetch). */
5
+ interface SpecSource<TDef> {
6
+ getSpec(name: string, version?: string): Promise<TDef>;
7
+ }
8
+ export interface ResolveDependencyStatusesInput {
9
+ /** The per-env dependency snapshot. */
10
+ snapshot: DependencySnapshotData | DependencyStateData;
11
+ /**
12
+ * Directory holding the synced `bp_modules/` (e.g. `<project>/.adk/bot/bp_modules`),
13
+ * used for the on-disk installed check (MODE B). When omitted, dependencies are
14
+ * assumed installed — a fresh checkout that hasn't built yet shouldn't report every
15
+ * dependency `not_installed`; the snapshot + config drives the verdict instead.
16
+ */
17
+ bpModulesDir?: string;
18
+ /** Optional catalog registries to enrich verdicts with specs. Best-effort: a fetch
19
+ * failure (offline / unauthenticated) degrades to a null spec, never throws. */
20
+ integrationRegistry?: SpecSource<IntegrationDefinition>;
21
+ pluginRegistry?: SpecSource<PluginDefinition>;
22
+ }
23
+ /**
24
+ * Offline-first capability resolver: the single place that turns a dependency snapshot (+ optional
25
+ * catalog specs + on-disk presence) into the flat {@link DependencyStatus} records
26
+ * the CLI (`adk integrations status`, `adk check`), the `adk dev` boot summary, and
27
+ * the deploy gate all consume. It gathers the I/O inputs and delegates the verdict to
28
+ * the pure `compute*Status` functions; integrations are resolved first so each plugin
29
+ * can see its backing integrations' verdicts (the transitive rule).
30
+ *
31
+ * Requires no auth/botId — a missing registry or a fetch failure simply yields a null
32
+ * spec (verdict falls back to Cloud's persisted WS0 verdict, or `unresolved`).
33
+ */
34
+ export declare function resolveDependencyStatuses(input: ResolveDependencyStatusesInput): Promise<DependencyStatus[]>;
35
+ export {};
36
+ //# sourceMappingURL=status-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-resolver.d.ts","sourceRoot":"","sources":["../../src/dependencies/status-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC/F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAU3D,4EAA4E;AAC5E,UAAU,UAAU,CAAC,IAAI;IACvB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvD;AAED,MAAM,WAAW,8BAA8B;IAC7C,uCAAuC;IACvC,QAAQ,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;IACtD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;qFACiF;IACjF,mBAAmB,CAAC,EAAE,UAAU,CAAC,qBAAqB,CAAC,CAAA;IACvD,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAA;CAC9C;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAwElH"}
@@ -0,0 +1,214 @@
1
+ import type { Integration as IntegrationDefinition, Plugin as PluginDefinition } from '@botpress/client';
2
+ import type { DependencyState, StatusVerdict } from '@botpress/runtime';
3
+ /**
4
+ * The canonical verdict for an OAuth/connection-gated integration the user has
5
+ * not authorized yet. Shared by the codegen carrier (the authorization gate) and
6
+ * the offline snapshot readers (via the persisted `authorizationPending` flag) so
7
+ * every surface words the same condition identically.
8
+ */
9
+ export declare function authorizationPendingVerdict(): StatusVerdict;
10
+ /**
11
+ * Whether an integration requires configuration before it can be enabled.
12
+ *
13
+ * The default-configuration branch of {@link computeIntegrationStatus}. Behavior is
14
+ * equivalent to the original `bot-generator/generator.ts` helper for all valid
15
+ * JSON-schema input, including the deliberately conservative
16
+ * `!configuration => requires config` rule (an integration whose definition could
17
+ * not be fully resolved is treated as requiring config, so it is not auto-enabled).
18
+ * The one intentional refinement: a malformed `required` entry that isn't a string
19
+ * is ignored (see {@link schemaRequiredFields}), where the original counted any
20
+ * non-empty array; real JSON schemas only contain string entries.
21
+ */
22
+ export declare function integrationRequiresConfiguration(definition: IntegrationDefinition): boolean;
23
+ /** Whether a plugin requires configuration before it can run. Plugins have no identifier. */
24
+ export declare function pluginRequiresConfiguration(definition: PluginDefinition): boolean;
25
+ /**
26
+ * Whether an integration's active configuration gates on an external *authorization*
27
+ * (an OAuth / connection identifier) rather than plain config fields. Such an integration
28
+ * cannot be registered until the user completes the connect flow — Cloud's `register`
29
+ * lifecycle hook hard-fails otherwise (e.g. "No refresh token found. Please complete the
30
+ * OAuth flow to obtain a refresh token"). Used by {@link isAuthorizationPending} to leave an
31
+ * unauthorized OAuth integration inert (`enabled: false`) rather than letting Cloud's
32
+ * `register` hook abort the whole deploy/dev boot.
33
+ *
34
+ * Narrower than {@link integrationRequiresConfiguration}, which also counts plain required
35
+ * schema fields — those CAN be satisfied from config without a cloud roundtrip, so they
36
+ * don't need this register-time guard (a missing one is already `unconfigured`).
37
+ */
38
+ export declare function integrationRequiresAuthorization(definition: IntegrationDefinition, configurationType?: string): boolean;
39
+ export interface ComputeIntegrationStatusInput {
40
+ /** Whether the integration's module exists on disk (`bp_modules/integration_<alias>`). */
41
+ installed: boolean;
42
+ /** Catalog/cloud definition; `null` when it could not be resolved. */
43
+ spec: IntegrationDefinition | null;
44
+ /** Resolved enabled flag — the snapshot's intent, optionally reconciled with cloud by the caller. */
45
+ enabled: boolean;
46
+ /** Effective merged configuration (server + local). */
47
+ config?: Record<string, unknown>;
48
+ /** Active variant key when the integration uses `configurations` (plural). */
49
+ configurationType?: string;
50
+ /**
51
+ * Authoritative missing-field set captured from Cloud at install time and
52
+ * persisted in the snapshot (WS0). Wins over schema-derived fields when provided:
53
+ * an explicit empty array means "Cloud confirms configured".
54
+ */
55
+ persistedMissingFields?: string[];
56
+ /**
57
+ * Cloud's current enabled state, when known (codegen path). Disambiguates
58
+ * identifier/OAuth integrations whose required fields aren't enumerable
59
+ * client-side: Cloud only keeps such an integration enabled once configured.
60
+ */
61
+ cloudEnabled?: boolean;
62
+ /**
63
+ * Last-known authorization state persisted in the snapshot (WS5/#7): `true` means
64
+ * the integration gates on an OAuth/connection identifier the cloud bot did
65
+ * not have at the last refresh. Yields the same `unconfigured` verdict the
66
+ * codegen authorization gate bakes into the runtime carrier.
67
+ */
68
+ authorizationPending?: boolean;
69
+ }
70
+ /**
71
+ * Resolve an integration's capability state. Precedence:
72
+ * `not_installed` > `unresolved` > `unconfigured` > `disabled` > `available`.
73
+ */
74
+ export declare function computeIntegrationStatus(input: ComputeIntegrationStatusInput): StatusVerdict;
75
+ export interface AuthorizationGateInput {
76
+ /** Whether the integration's active config gates on an OAuth/connection identifier. */
77
+ requiresAuthorization: boolean;
78
+ /**
79
+ * Whether the integration is authorized on the target cloud bot (has an `identifier`).
80
+ * `undefined` means it's not on the cloud bot yet → treated as not authorized.
81
+ */
82
+ cloudAuthorized?: boolean;
83
+ /** True when the cloud read failed this pass — then we can't conclude anything. */
84
+ cloudFetchErrored?: boolean;
85
+ }
86
+ /**
87
+ * Whether an integration must be left inert (emitted `enabled: false`, but still declared)
88
+ * because it gates on an authorization the user hasn't completed yet. The classic case: a
89
+ * managed-OAuth integration (`gmail`) toggled on but never connected — Cloud's `register`
90
+ * hook hard-fails ("No refresh token found …") and aborts the WHOLE `adk dev` / `adk deploy`
91
+ * boot if the integration is declared `enabled: true`.
92
+ *
93
+ * The fix is to demote it to `enabled: false`, NOT to omit it from the definition: `bp`
94
+ * skips registering a disabled integration (so the boot survives), yet keeps it on the bot
95
+ * so (a) the user can still authorize it in the Control Panel — omitting it makes `bp` prune
96
+ * it from the cloud bot, a first-auth dead end — and (b) any plugin whose dependency maps to
97
+ * this alias still resolves at `addPlugin` time. Once the user authorizes it the cloud
98
+ * integration gains an `identifier`, this returns false, and codegen re-enables it.
99
+ *
100
+ * Keyed off *authorization* (the `identifier`), NOT the registration lifecycle status: a
101
+ * disabled integration reports `unregistered`, which a status-based gate would read as
102
+ * "still blocked" forever even after the user connects it — a dead loop. The identifier
103
+ * persists across the enable/disable toggle, so it's the signal that lets us self-heal.
104
+ *
105
+ * Only authorization-gated integrations are affected: plain config/schema integrations
106
+ * register fine from their config without an out-of-band step. Guarded by `cloudFetchErrored`
107
+ * so a transient cloud-read failure never demotes a working integration (unknown ≠
108
+ * unauthorized).
109
+ */
110
+ export declare function isAuthorizationPending(input: AuthorizationGateInput): boolean;
111
+ export interface PluginDependencyStatus {
112
+ alias: string;
113
+ verdict: StatusVerdict;
114
+ }
115
+ /**
116
+ * Transitive rule shared by every plugin-verdict path (spec-aware, codegen
117
+ * carrier, snapshot-only): a plugin cannot run while a backing integration is inert.
118
+ * A deliberately *disabled* backing integration makes the plugin `disabled` —
119
+ * an intentional, supported state that must not read as a failure (or block a
120
+ * deploy) — while any other non-available state makes it `unresolved`.
121
+ * Returns `null` when every backing integration is available.
122
+ */
123
+ export declare function transitiveDependencyVerdict(dependencyStatuses: PluginDependencyStatus[] | undefined): StatusVerdict | null;
124
+ /**
125
+ * Shape a plugin's `dependencies` map into the {@link PluginDependencyStatus}
126
+ * list the transitive rule consumes, resolving each backing integration's
127
+ * verdict through the caller's lookup. Shared by codegen and the offline
128
+ * resolver so the fallback — a reference to an integration that has no verdict,
129
+ * i.e. one not declared in the project — reads identically everywhere.
130
+ */
131
+ export declare function mapPluginDependencyStatuses(dependencies: Record<string, {
132
+ integrationAlias?: string;
133
+ }> | undefined, verdictFor: (alias: string) => StatusVerdict | undefined): PluginDependencyStatus[];
134
+ export interface ComputePluginStatusInput {
135
+ /** Whether the plugin's module exists on disk (`bp_modules/plugin_<alias>`). */
136
+ installed: boolean;
137
+ /** Catalog/cloud definition; `null` when it could not be resolved. */
138
+ spec: PluginDefinition | null;
139
+ /** Resolved enabled flag. */
140
+ enabled: boolean;
141
+ /** Effective merged configuration (server + local). */
142
+ config?: Record<string, unknown>;
143
+ /** Authoritative missing-field set persisted in the snapshot (WS0). Wins when provided. */
144
+ persistedMissingFields?: string[];
145
+ /**
146
+ * Capability verdicts of the integrations backing this plugin's interface
147
+ * dependencies. A plugin cannot run if any backing integration is inert.
148
+ */
149
+ dependencyStatuses?: PluginDependencyStatus[];
150
+ }
151
+ /**
152
+ * Resolve a plugin's capability state. Same precedence as integrations, plus a
153
+ * transitive rule: a plugin is `unresolved` if any backing integration (the
154
+ * concrete fulfilment of an interface dependency) is itself not `available`.
155
+ * Precedence: `not_installed` > `unresolved` (own or transitive) > `unconfigured` > `disabled` > `available`.
156
+ */
157
+ export declare function computePluginStatus(input: ComputePluginStatusInput): StatusVerdict;
158
+ export interface ComputePluginCarrierStatusInput {
159
+ /** Whether the plugin's module exists on disk (`bp_modules/plugin_<alias>`). */
160
+ installed: boolean;
161
+ /** Cloud's persisted install-time missing-field verdict, if any. */
162
+ persistedMissingFields?: string[];
163
+ /**
164
+ * Capability verdicts of the integrations backing this plugin's interface
165
+ * dependencies. A plugin cannot run if any backing integration is inert.
166
+ */
167
+ dependencyStatuses?: PluginDependencyStatus[];
168
+ }
169
+ /**
170
+ * Plugin capability verdict for the **codegen carrier**, where the plugin spec
171
+ * is intentionally not loaded (the build pipeline loads integration and
172
+ * interface definitions, but not plugin definitions). It therefore covers
173
+ * on-disk presence, transitive integration-dependency availability, and the
174
+ * persisted Cloud missing-field verdict captured during install/refresh:
175
+ *
176
+ * - `not_installed` — the plugin module is missing on disk (MODE B)
177
+ * - `disabled` — a backing integration is deliberately disabled
178
+ * - `unresolved` — a backing integration is otherwise not `available`
179
+ * - `unconfigured` — Cloud rejected the plugin's own required config
180
+ * - `available` — installed, configured, and all backing integrations are available
181
+ *
182
+ * The runtime drift backstop still catches missing config that Cloud has not
183
+ * persisted yet. The spec-aware {@link computePluginStatus} is used by the
184
+ * offline CLI path, where the plugin definition is available.
185
+ */
186
+ export declare function computePluginCarrierStatus(input: ComputePluginCarrierStatusInput): StatusVerdict;
187
+ export interface ComputeSnapshotOnlyStatusInput {
188
+ /** Whether the dependency's module exists on disk (`bp_modules/...`). */
189
+ installed: boolean;
190
+ /** Resolved enabled flag (the snapshot's cloud-reflected intent). */
191
+ enabled: boolean;
192
+ /** Cloud's persisted install-time missing-field verdict (WS0), if any. */
193
+ missingFields?: string[];
194
+ /** Persisted last-known authorization state (WS5/#7), integrations only. */
195
+ authorizationPending?: boolean;
196
+ }
197
+ /**
198
+ * Capability verdict from the **snapshot alone** — no catalog spec. This is the
199
+ * offline reader's path (`adk integrations status`, `adk check`, the `adk dev`
200
+ * boot summary) when a spec wasn't (or couldn't be) fetched.
201
+ *
202
+ * It trusts the snapshot because the snapshot reflects Cloud's validated state: Cloud only
203
+ * keeps an integration `enabled` once its required config is satisfied, so
204
+ * `enabled` ⟹ `available`. A persisted missing-field verdict (WS0) overrides that
205
+ * with `unconfigured`. Unlike {@link computeIntegrationStatus}, this never returns
206
+ * `unresolved` for a missing spec — the absence of a spec here means "not fetched",
207
+ * not "unresolvable".
208
+ *
209
+ * Precedence: `not_installed` > `unconfigured` (persisted) > `disabled` > `available`.
210
+ */
211
+ export declare function computeSnapshotOnlyStatus(input: ComputeSnapshotOnlyStatusInput): StatusVerdict;
212
+ /** A dependency's capability state is callable only when `available`. */
213
+ export declare function isCallable(state: DependencyState): boolean;
214
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/dependencies/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxG,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AA+FvE;;;;;GAKG;AACH,wBAAgB,2BAA2B,IAAI,aAAa,CAM3D;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,qBAAqB,GAAG,OAAO,CAI3F;AAED,6FAA6F;AAC7F,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAEjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,qBAAqB,EACjC,iBAAiB,CAAC,EAAE,MAAM,GACzB,OAAO,CAGT;AAwBD,MAAM,WAAW,6BAA6B;IAC5C,0FAA0F;IAC1F,SAAS,EAAE,OAAO,CAAA;IAClB,sEAAsE;IACtE,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAA;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