@botonic/nx-plugin 2.30.0 → 2.31.1-alpha.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/executors.json +0 -5
  3. package/index.js +44 -0
  4. package/{src/executors/build-node-app/executor.js → libs/botonic/nx-plugin/src/executors/build-node-app/executor-impl.js} +3 -3
  5. package/libs/botonic/nx-plugin/src/executors/build-node-app/executor.js +27 -0
  6. package/{src/executors/delete-bot/executor.js → libs/botonic/nx-plugin/src/executors/delete-bot/executor-impl.js} +3 -5
  7. package/libs/botonic/nx-plugin/src/executors/delete-bot/executor.js +27 -0
  8. package/{src/executors/deploy-netlify-snapshot/executor.js → libs/botonic/nx-plugin/src/executors/deploy-netlify-snapshot/executor-impl.js} +3 -3
  9. package/libs/botonic/nx-plugin/src/executors/deploy-netlify-snapshot/executor.js +27 -0
  10. package/libs/botonic/nx-plugin/src/executors/deploy-to-hubtype/executor-impl.js +172 -0
  11. package/libs/botonic/nx-plugin/src/executors/deploy-to-hubtype/executor.js +27 -0
  12. package/{src/executors/e2e-webchat/executor.js → libs/botonic/nx-plugin/src/executors/e2e-webchat/executor-impl.js} +5 -5
  13. package/libs/botonic/nx-plugin/src/executors/e2e-webchat/executor.js +27 -0
  14. package/{src/executors/integrate-provider/executor.js → libs/botonic/nx-plugin/src/executors/integrate-provider/executor-impl.js} +3 -5
  15. package/libs/botonic/nx-plugin/src/executors/integrate-provider/executor.js +27 -0
  16. package/{src/executors/login-to-hubtype/executor.js → libs/botonic/nx-plugin/src/executors/login-to-hubtype/executor-impl.js} +3 -5
  17. package/libs/botonic/nx-plugin/src/executors/login-to-hubtype/executor.js +27 -0
  18. package/{src/executors/logout-from-hubtype/executor.js → libs/botonic/nx-plugin/src/executors/logout-from-hubtype/executor-impl.js} +5 -5
  19. package/libs/botonic/nx-plugin/src/executors/logout-from-hubtype/executor.js +27 -0
  20. package/{src/executors/run-lambda/executor.js → libs/botonic/nx-plugin/src/executors/run-lambda/executor-impl.js} +3 -3
  21. package/libs/botonic/nx-plugin/src/executors/run-lambda/executor.js +27 -0
  22. package/{src/executors/serve-bot/executor.js → libs/botonic/nx-plugin/src/executors/serve-bot/executor-impl.js} +145 -27
  23. package/libs/botonic/nx-plugin/src/executors/serve-bot/executor.js +27 -0
  24. package/{src/generators/action/generator.js → libs/botonic/nx-plugin/src/generators/action/generator-impl.js} +5 -5
  25. package/libs/botonic/nx-plugin/src/generators/action/generator.js +27 -0
  26. package/{src/generators/bot-app/generator.js → libs/botonic/nx-plugin/src/generators/bot-app/generator-impl.js} +6 -5
  27. package/libs/botonic/nx-plugin/src/generators/bot-app/generator.js +34 -0
  28. package/{src/generators/custom-message/generator.js → libs/botonic/nx-plugin/src/generators/custom-message/generator-impl.js} +5 -5
  29. package/libs/botonic/nx-plugin/src/generators/custom-message/generator.js +27 -0
  30. package/{src/generators/preset/generator.js → libs/botonic/nx-plugin/src/generators/preset/generator-impl.js} +5 -5
  31. package/libs/botonic/nx-plugin/src/generators/preset/generator.js +34 -0
  32. package/{src/generators/remove-custom-message/generator.js → libs/botonic/nx-plugin/src/generators/remove-custom-message/generator-impl.js} +5 -5
  33. package/libs/botonic/nx-plugin/src/generators/remove-custom-message/generator.js +27 -0
  34. package/{src/generators/webview/generator.js → libs/botonic/nx-plugin/src/generators/webview/generator-impl.js} +5 -5
  35. package/libs/botonic/nx-plugin/src/generators/webview/generator.js +27 -0
  36. package/{src → libs/botonic/nx-plugin/src}/index.js +3 -1
  37. package/{src → libs/botonic/nx-plugin/src}/lib/api-service.js +150 -82
  38. package/{src → libs/botonic/nx-plugin/src}/lib/constants.js +6 -9
  39. package/{src → libs/botonic/nx-plugin/src}/lib/credentials-handler.js +42 -24
  40. package/libs/botonic/nx-plugin/src/lib/delegate/delegate-executor.js +119 -0
  41. package/libs/botonic/nx-plugin/src/lib/delegate/delegate-generator.js +128 -0
  42. package/libs/botonic/nx-plugin/src/lib/serve-mode/index.js +183 -0
  43. package/{src → libs/botonic/nx-plugin/src}/lib/util/executor-helpers.js +494 -106
  44. package/{src → libs/botonic/nx-plugin/src}/plugin.js +5 -14
  45. package/migrations.json +1 -8
  46. package/package.json +7 -4
  47. package/src/executors/build-node-app/executor-impl.d.ts +5 -0
  48. package/src/executors/build-node-app/executor.d.ts +4 -2
  49. package/src/executors/delete-bot/executor-impl.d.ts +5 -0
  50. package/src/executors/delete-bot/executor.d.ts +4 -2
  51. package/src/executors/deploy-netlify-snapshot/executor-impl.d.ts +8 -0
  52. package/src/executors/deploy-netlify-snapshot/executor.d.ts +4 -5
  53. package/src/executors/deploy-to-hubtype/executor-impl.d.ts +5 -0
  54. package/src/executors/deploy-to-hubtype/executor.d.ts +4 -2
  55. package/src/executors/e2e-webchat/botonic-package-publish.spec.ts +7 -11
  56. package/src/executors/e2e-webchat/executor-impl.d.ts +5 -0
  57. package/src/executors/e2e-webchat/executor.d.ts +4 -2
  58. package/src/executors/integrate-provider/executor-impl.d.ts +5 -0
  59. package/src/executors/integrate-provider/executor.d.ts +4 -2
  60. package/src/executors/login-to-hubtype/executor-impl.d.ts +5 -0
  61. package/src/executors/login-to-hubtype/executor.d.ts +4 -2
  62. package/src/executors/logout-from-hubtype/executor-impl.d.ts +3 -0
  63. package/src/executors/logout-from-hubtype/executor.d.ts +5 -1
  64. package/src/executors/run-lambda/executor-impl.d.ts +5 -0
  65. package/src/executors/run-lambda/executor.d.ts +4 -2
  66. package/src/executors/serve-bot/executor-impl.d.ts +5 -0
  67. package/src/executors/serve-bot/executor.d.ts +4 -2
  68. package/src/executors/serve-bot/schema.json +13 -5
  69. package/src/generators/action/generator-impl.d.ts +4 -0
  70. package/src/generators/action/generator.d.ts +2 -3
  71. package/src/generators/bot-app/files/vite/node.config.ts.template +2 -7
  72. package/src/generators/bot-app/files/vite/webchat.config.ts.template +10 -2
  73. package/src/generators/bot-app/generator-impl.d.ts +4 -0
  74. package/src/generators/bot-app/generator.d.ts +2 -4
  75. package/src/generators/custom-message/generator-impl.d.ts +4 -0
  76. package/src/generators/custom-message/generator.d.ts +2 -3
  77. package/src/generators/preset/generator-impl.d.ts +4 -0
  78. package/src/generators/preset/generator.d.ts +2 -4
  79. package/src/generators/remove-custom-message/generator-impl.d.ts +4 -0
  80. package/src/generators/remove-custom-message/generator.d.ts +2 -3
  81. package/src/generators/webview/generator-impl.d.ts +4 -0
  82. package/src/generators/webview/generator.d.ts +2 -3
  83. package/src/index.d.ts +1 -0
  84. package/src/lib/api-service.d.ts +19 -20
  85. package/src/lib/constants.d.ts +2 -3
  86. package/src/lib/credentials-handler.d.ts +9 -18
  87. package/src/lib/delegate/delegate-executor.d.ts +6 -0
  88. package/src/lib/delegate/delegate-generator.d.ts +2 -0
  89. package/src/lib/interfaces.d.ts +10 -13
  90. package/src/lib/serve-mode/index.d.ts +25 -0
  91. package/src/lib/util/executor-helpers.d.ts +52 -23
  92. package/src/executors/deploy-local-runtime/executor.d.ts +0 -5
  93. package/src/executors/deploy-local-runtime/executor.js +0 -148
  94. package/src/executors/deploy-local-runtime/schema.json +0 -34
  95. package/src/executors/deploy-to-hubtype/executor.js +0 -308
  96. package/src/executors/serve-bot/schema.d.js +0 -16
  97. package/src/generators/bot-app/files/vite/botonic-ssr-deps.ts.template +0 -56
  98. package/src/generators/bot-app/files/vite/plugins/dev-log-viewer-html.plugin.ts.template +0 -65
  99. package/src/generators/preset/files/package.json +0 -26
  100. package/src/migrations/install-claude-update-skills/install-claude-update-skills.migration.d.ts +0 -2
  101. package/src/migrations/install-claude-update-skills/install-claude-update-skills.migration.js +0 -290
  102. /package/{src → libs/botonic/nx-plugin/src}/executors/build-node-app/schema.d.js +0 -0
  103. /package/{src → libs/botonic/nx-plugin/src}/executors/delete-bot/schema.d.js +0 -0
  104. /package/{src/executors/deploy-local-runtime → libs/botonic/nx-plugin/src/executors/deploy-netlify-snapshot}/schema.d.js +0 -0
  105. /package/{src/executors/deploy-netlify-snapshot → libs/botonic/nx-plugin/src/executors/deploy-to-hubtype}/schema.d.js +0 -0
  106. /package/{src/executors/deploy-to-hubtype → libs/botonic/nx-plugin/src/executors/e2e-webchat}/schema.d.js +0 -0
  107. /package/{src/executors/e2e-webchat → libs/botonic/nx-plugin/src/executors/integrate-provider}/schema.d.js +0 -0
  108. /package/{src/executors/integrate-provider → libs/botonic/nx-plugin/src/executors/login-to-hubtype}/schema.d.js +0 -0
  109. /package/{src/executors/login-to-hubtype → libs/botonic/nx-plugin/src/executors/logout-from-hubtype}/schema.d.js +0 -0
  110. /package/{src/executors/logout-from-hubtype → libs/botonic/nx-plugin/src/executors/run-lambda}/schema.d.js +0 -0
  111. /package/{src/executors/run-lambda → libs/botonic/nx-plugin/src/executors/serve-bot}/schema.d.js +0 -0
  112. /package/{src → libs/botonic/nx-plugin/src}/generators/action/schema.js +0 -0
  113. /package/{src → libs/botonic/nx-plugin/src}/generators/bot-app/schema.js +0 -0
  114. /package/{src → libs/botonic/nx-plugin/src}/generators/custom-message/schema.js +0 -0
  115. /package/{src → libs/botonic/nx-plugin/src}/generators/preset/schema.js +0 -0
  116. /package/{src → libs/botonic/nx-plugin/src}/generators/remove-custom-message/schema.js +0 -0
  117. /package/{src → libs/botonic/nx-plugin/src}/generators/shared/bot-app-utils.js +0 -0
  118. /package/{src → libs/botonic/nx-plugin/src}/generators/webview/schema.js +0 -0
  119. /package/{src → libs/botonic/nx-plugin/src}/lib/bot-config.js +0 -0
  120. /package/{src → libs/botonic/nx-plugin/src}/lib/cloudflared-tunnel.js +0 -0
  121. /package/{src → libs/botonic/nx-plugin/src}/lib/index.js +0 -0
  122. /package/{src → libs/botonic/nx-plugin/src}/lib/interfaces.js +0 -0
  123. /package/{src → libs/botonic/nx-plugin/src}/lib/util/file-system.js +0 -0
  124. /package/{src → libs/botonic/nx-plugin/src}/lib/util/sam-container-cleanup.js +0 -0
  125. /package/{src → libs/botonic/nx-plugin/src}/lib/util/sam-template.js +0 -0
  126. /package/{src → libs/botonic/nx-plugin/src}/lib/util/system.js +0 -0
  127. /package/{src → libs/botonic/nx-plugin/src}/migrations/utils/migration-utils.js +0 -0
@@ -140,34 +140,29 @@ async function createBotonicTargets(projectRoot, options, context) {
140
140
  targets[options.serveTargetName] = {
141
141
  executor: "@botonic/nx-plugin:serve-bot",
142
142
  options: {},
143
- configurations,
144
- continuous: true
143
+ configurations
145
144
  };
146
145
  targets["serve:webchat"] = {
147
146
  executor: "@botonic/nx-plugin:serve-bot",
148
147
  options: {
149
148
  skipWebviews: true
150
149
  },
151
- configurations,
152
- continuous: true
150
+ configurations
153
151
  };
154
152
  targets["serve:webview"] = {
155
153
  executor: "@botonic/nx-plugin:serve-bot",
156
154
  options: {},
157
- configurations,
158
- continuous: true
155
+ configurations
159
156
  };
160
157
  targets["serve-dev"] = {
161
158
  executor: "@botonic/nx-plugin:serve-bot",
162
159
  options: {},
163
- configurations,
164
- continuous: true
160
+ configurations
165
161
  };
166
162
  targets["serve-dev-tunnel"] = {
167
163
  executor: "@botonic/nx-plugin:serve-bot",
168
164
  options: {},
169
- configurations,
170
- continuous: true
165
+ configurations
171
166
  };
172
167
  targets["build-node-app"] = {
173
168
  executor: "nx:run-commands",
@@ -213,10 +208,6 @@ async function createBotonicTargets(projectRoot, options, context) {
213
208
  executor: "@botonic/nx-plugin:deploy-to-hubtype",
214
209
  configurations
215
210
  };
216
- targets["deploy-local-runtime"] = {
217
- executor: "@botonic/nx-plugin:deploy-local-runtime",
218
- configurations
219
- };
220
211
  targets["integrate-provider"] = {
221
212
  executor: "@botonic/nx-plugin:integrate-provider",
222
213
  configurations
package/migrations.json CHANGED
@@ -1,10 +1,3 @@
1
1
  {
2
- "generators": {
3
- "install-claude-update-skills": {
4
- "version": "2.29.0",
5
- "description": "Replace .cursor/.claude command stubs with .claude/skills/botonic-update and .claude/skills/botonic-bot-update",
6
- "cli": "nx",
7
- "implementation": "./src/migrations/install-claude-update-skills/install-claude-update-skills.migration"
8
- }
9
- }
2
+ "generators": {}
10
3
  }
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@botonic/nx-plugin",
3
- "version": "2.30.0",
3
+ "version": "2.31.1-alpha.0",
4
4
  "description": "Nx plugin for creating Botonic bot applications",
5
- "main": "./src/index.js",
5
+ "main": "./dist/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
9
  "types": "./src/index.d.ts",
10
- "require": "./src/index.js"
10
+ "require": "./dist/index.js",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
11
13
  },
12
14
  "./generators.json": "./generators.json",
13
15
  "./executors.json": "./executors.json",
14
16
  "./migrations.json": "./migrations.json",
15
- "./package.json": "./package.json"
17
+ "./package.json": "./package.json",
18
+ "./serve-mode/serve-mode.js": "./serve-mode/serve-mode.js"
16
19
  },
17
20
  "generators": "./generators.json",
18
21
  "executors": "./executors.json",
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { BuildNodeAppExecutorSchema } from './schema';
3
+ export default function buildNodeAppExecutor(options: BuildNodeAppExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { BuildNodeAppExecutorSchema } from './schema';
3
- export default function buildNodeAppExecutor(options: BuildNodeAppExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function buildNodeAppExecutor(options: BuildNodeAppExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { DeleteBotExecutorSchema } from './schema';
3
+ export default function deleteBotExecutor(options: DeleteBotExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { DeleteBotExecutorSchema } from './schema';
3
- export default function deleteBotExecutor(options: DeleteBotExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function deleteBotExecutor(options: DeleteBotExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -0,0 +1,8 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { DeployNetlifySnapshotExecutorSchema } from './schema';
3
+ export interface DeployNetlifySnapshotResult {
4
+ success: boolean;
5
+ deployUrl?: string;
6
+ claimUrl?: string;
7
+ }
8
+ export default function deployNetlifySnapshotExecutor(options: DeployNetlifySnapshotExecutorSchema, context: ExecutorContext): Promise<DeployNetlifySnapshotResult>;
@@ -1,8 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { DeployNetlifySnapshotExecutorSchema } from './schema';
3
- export interface DeployNetlifySnapshotResult {
3
+ export default function deployNetlifySnapshotExecutor(options: DeployNetlifySnapshotExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- deployUrl?: string;
6
- claimUrl?: string;
7
- }
8
- export default function deployNetlifySnapshotExecutor(options: DeployNetlifySnapshotExecutorSchema, context: ExecutorContext): Promise<DeployNetlifySnapshotResult>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { DeployToHubtypeExecutorSchema } from './schema';
3
+ export default function deployToHubtypeExecutor(options: DeployToHubtypeExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { DeployToHubtypeExecutorSchema } from './schema';
3
- export default function deployToHubtypeExecutor(options: DeployToHubtypeExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function deployToHubtypeExecutor(options: DeployToHubtypeExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -14,13 +14,13 @@ test.describe('Botonic Publish E2E', () => {
14
14
 
15
15
  await page.goto('/')
16
16
  await page.waitForLoadState('networkidle')
17
- await page.waitForSelector('button[class*="webchat-trigger"]', {
17
+ await page.waitForSelector('[data-testid="webchat-trigger"]', {
18
18
  timeout: 3000,
19
19
  })
20
20
  })
21
21
 
22
22
  async function ensureWebchatOpen(page: any) {
23
- const trigger = page.locator('button[class*="webchat-trigger"]').first()
23
+ const trigger = page.getByTestId('webchat-trigger')
24
24
  await expect(trigger).toBeVisible({ timeout: 10000 })
25
25
 
26
26
  const ariaExpanded = await trigger.getAttribute('aria-expanded')
@@ -29,16 +29,14 @@ test.describe('Botonic Publish E2E', () => {
29
29
  await page.waitForTimeout(300)
30
30
  }
31
31
 
32
- const container = page
33
- .locator('[class*="webchat-container-module"]')
34
- .first()
32
+ const container = page.getByTestId('webchat-container')
35
33
  await expect(container).toBeVisible({ timeout: 5000 })
36
34
 
37
35
  return { trigger, container }
38
36
  }
39
37
 
40
38
  test('webchat trigger renders and opens webchat', async ({ page }) => {
41
- const trigger = page.locator('button[class*="webchat-trigger"]').first()
39
+ const trigger = page.getByTestId('webchat-trigger')
42
40
  await expect(trigger).toBeVisible({ timeout: 10000 })
43
41
 
44
42
  const ariaExpanded = await trigger.getAttribute('aria-expanded')
@@ -47,9 +45,7 @@ test.describe('Botonic Publish E2E', () => {
47
45
  await page.waitForTimeout(300)
48
46
  }
49
47
 
50
- const container = page
51
- .locator('[class*="webchat-container-module"]')
52
- .first()
48
+ const container = page.getByTestId('webchat-container')
53
49
  await expect(container).toBeVisible({ timeout: 5000 })
54
50
  })
55
51
 
@@ -62,7 +58,7 @@ test.describe('Botonic Publish E2E', () => {
62
58
  await input.fill('hello')
63
59
  await input.press('Enter')
64
60
 
65
- const messages = page.locator('[class*="message-module"]')
61
+ const messages = page.locator('[data-testid^="webchat-message-"]')
66
62
  await expect(messages.first()).toBeVisible({ timeout: 15000 })
67
63
  })
68
64
 
@@ -78,7 +74,7 @@ test.describe('Botonic Publish E2E', () => {
78
74
  await expect(sendButton).toBeVisible()
79
75
  await sendButton.click()
80
76
 
81
- const messages = page.locator('[class*="message-module"]')
77
+ const messages = page.locator('[data-testid^="webchat-message-"]')
82
78
  await expect(messages.first()).toBeVisible({ timeout: 15000 })
83
79
  })
84
80
  })
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { E2EExecutorSchema } from './schema';
3
+ export default function e2eExecutor(options: E2EExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { E2EExecutorSchema } from './schema';
3
- export default function e2eExecutor(options: E2EExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function e2eWebchatExecutor(options: E2EExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { IntegrateProviderExecutorSchema } from './schema';
3
+ export default function integrateProviderExecutor(options: IntegrateProviderExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { IntegrateProviderExecutorSchema } from './schema';
3
- export default function integrateProviderExecutor(options: IntegrateProviderExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function integrateProviderExecutor(options: IntegrateProviderExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { LoginToHubtypeExecutorSchema } from './schema';
3
+ export default function loginToHubtypeExecutor(options: LoginToHubtypeExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { LoginToHubtypeExecutorSchema } from './schema';
3
- export default function loginToHubtypeExecutor(options: LoginToHubtypeExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function loginToHubtypeExecutor(options: LoginToHubtypeExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -0,0 +1,3 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { LogoutFromHubtypeExecutorSchema } from './schema';
3
+ export default function logoutFromHubtypeExecutor(options: LogoutFromHubtypeExecutorSchema, context: ExecutorContext): Promise<void>;
@@ -1,3 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { LogoutFromHubtypeExecutorSchema } from './schema';
3
- export default function logoutFromHubtypeExecutor(options: LogoutFromHubtypeExecutorSchema, context: ExecutorContext): Promise<void>;
3
+ export default function logoutFromHubtypeExecutor(options: LogoutFromHubtypeExecutorSchema, ctx: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { RunLambdaExecutorSchema } from './schema';
3
+ export default function runLambdaExecutor(options: RunLambdaExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { RunLambdaExecutorSchema } from './schema';
3
- export default function runLambdaExecutor(options: RunLambdaExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function runLambdaExecutor(options: RunLambdaExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { ServeBotExecutorSchema } from './schema';
3
+ export default function serveBotExecutor(options: ServeBotExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { ServeBotExecutorSchema } from './schema';
3
- export default function serveBotExecutor(options: ServeBotExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function serveBotExecutor(options: ServeBotExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -34,15 +34,23 @@
34
34
  "description": "Local port the Lambda listens on (used for cloudflared --url). Default 3001.",
35
35
  "default": 3001
36
36
  },
37
- "logViewer": {
38
- "type": "boolean",
39
- "description": "When true, start a web-based log viewer (frontail) and open webchat with an embedded logs panel.",
40
- "default": false
41
- },
42
37
  "logViewerPort": {
43
38
  "type": "number",
44
39
  "description": "Port for the log viewer web interface",
45
40
  "default": 9001
41
+ },
42
+ "provider": {
43
+ "type": "string",
44
+ "description": "Channel provider to enable local routing for. Currently only 'whatsapp' is supported.",
45
+ "enum": ["whatsapp"]
46
+ },
47
+ "phone": {
48
+ "type": "string",
49
+ "description": "Your phone number in E.164 format (e.g. +34612345678). Required when provider=whatsapp. Messages from this number will route to your local Lambda."
50
+ },
51
+ "botName": {
52
+ "type": "string",
53
+ "description": "Name of the Hubtype bot to use for local development. Skips the interactive bot-selection prompt."
46
54
  }
47
55
  },
48
56
  "required": []
@@ -0,0 +1,4 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import type { ActionGeneratorSchema } from './schema';
3
+ export default function (tree: Tree, options: ActionGeneratorSchema): Promise<void>;
4
+ export { ActionGeneratorSchema };
@@ -1,4 +1,3 @@
1
- import { Tree } from '@nx/devkit';
1
+ import type { Tree } from '@nx/devkit';
2
2
  import type { ActionGeneratorSchema } from './schema';
3
- export default function (tree: Tree, options: ActionGeneratorSchema): Promise<void>;
4
- export { ActionGeneratorSchema };
3
+ export default function (tree: Tree, options: ActionGeneratorSchema): Promise<void | import("@nx/devkit").GeneratorCallback>;
@@ -1,7 +1,6 @@
1
1
  import { resolve } from 'path'
2
2
  import type { UserConfig } from 'vite'
3
3
 
4
- import { getBotonicThirdPartyDeps } from './botonic-ssr-deps'
5
4
  import { BUILD_CONFIG } from './build.config'
6
5
 
7
6
  const projectRoot = resolve(__dirname, '..')
@@ -13,13 +12,9 @@ export function getNodeConfig(): UserConfig {
13
12
  root: projectRoot,
14
13
  cacheDir: resolve(projectRoot, BUILD_CONFIG.CACHE_DIR.node),
15
14
 
16
- // Bundle all @botonic/* packages and their third-party deps into the Lambda
17
- // artifact. By default Vite SSR externalizes node_modules, but Lambda has no
18
- // node_modules at runtime so everything must be self-contained.
19
- // Third-party deps are derived programmatically from the @botonic/* package.json
20
- // files so this list stays correct as plugins add new dependencies.
15
+ // Bundle all dependencies into the Lambda artifact no node_modules at runtime.
21
16
  ssr: {
22
- noExternal: [/@botonic\/.*/, ...getBotonicThirdPartyDeps(projectRoot)],
17
+ noExternal: true,
23
18
  },
24
19
 
25
20
  build: {
@@ -1,8 +1,12 @@
1
1
  import { resolve } from 'path'
2
2
  import type { UserConfig } from 'vite'
3
+ import {
4
+ createLogViewerPlugin,
5
+ createWebchatPanelPlugin,
6
+ createWhatsappPanelPlugin,
7
+ } from '@botonic/nx-plugin'
3
8
 
4
9
  import { BUILD_CONFIG } from './build.config'
5
- import { devLogViewerIndexHtmlPlugin } from './plugins/dev-log-viewer-html.plugin'
6
10
  import { moveHtmlToRootPlugin } from './plugins/move-html.plugin'
7
11
 
8
12
  const projectRoot = resolve(__dirname, '..')
@@ -83,7 +87,11 @@ export function getWebchatConfig(command: 'serve' | 'build'): UserConfig {
83
87
  },
84
88
 
85
89
  plugins: [
86
- devLogViewerIndexHtmlPlugin(),
90
+ createLogViewerPlugin(),
91
+ createWhatsappPanelPlugin({
92
+ registeredPhone: process.env.WHATSAPP_PANEL_PHONE,
93
+ }),
94
+ createWebchatPanelPlugin(),
87
95
  moveHtmlToRootPlugin(projectRoot, BUILD_CONFIG.TARGET_APPS.WEBCHAT),
88
96
  ],
89
97
  }
@@ -0,0 +1,4 @@
1
+ import { GeneratorCallback, Tree } from '@nx/devkit';
2
+ import type { BotAppGeneratorSchema } from './schema';
3
+ export default function (tree: Tree, options: BotAppGeneratorSchema): Promise<GeneratorCallback>;
4
+ export { BotAppGeneratorSchema };
@@ -1,4 +1,2 @@
1
- import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import type { BotAppGeneratorSchema } from './schema';
3
- export default function (tree: Tree, options: BotAppGeneratorSchema): Promise<GeneratorCallback>;
4
- export { BotAppGeneratorSchema };
1
+ export { default } from './generator-impl';
2
+ export type { BotAppGeneratorSchema } from './schema';
@@ -0,0 +1,4 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import type { CustomMessageGeneratorSchema } from './schema';
3
+ export default function (tree: Tree, options: CustomMessageGeneratorSchema): Promise<void>;
4
+ export { CustomMessageGeneratorSchema };
@@ -1,4 +1,3 @@
1
- import { Tree } from '@nx/devkit';
1
+ import type { Tree } from '@nx/devkit';
2
2
  import type { CustomMessageGeneratorSchema } from './schema';
3
- export default function (tree: Tree, options: CustomMessageGeneratorSchema): Promise<void>;
4
- export { CustomMessageGeneratorSchema };
3
+ export default function (tree: Tree, options: CustomMessageGeneratorSchema): Promise<void | import("@nx/devkit").GeneratorCallback>;
@@ -0,0 +1,4 @@
1
+ import { GeneratorCallback, Tree } from '@nx/devkit';
2
+ import type { PresetGeneratorSchema } from './schema';
3
+ export default function (tree: Tree, options: PresetGeneratorSchema): Promise<GeneratorCallback>;
4
+ export { PresetGeneratorSchema };
@@ -1,4 +1,2 @@
1
- import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import type { PresetGeneratorSchema } from './schema';
3
- export default function (tree: Tree, options: PresetGeneratorSchema): Promise<GeneratorCallback>;
4
- export { PresetGeneratorSchema };
1
+ export { default } from './generator-impl';
2
+ export type { PresetGeneratorSchema } from './schema';
@@ -0,0 +1,4 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import type { RemoveCustomMessageGeneratorSchema } from './schema';
3
+ export default function (tree: Tree, options: RemoveCustomMessageGeneratorSchema): Promise<void>;
4
+ export { RemoveCustomMessageGeneratorSchema };
@@ -1,4 +1,3 @@
1
- import { Tree } from '@nx/devkit';
1
+ import type { Tree } from '@nx/devkit';
2
2
  import type { RemoveCustomMessageGeneratorSchema } from './schema';
3
- export default function (tree: Tree, options: RemoveCustomMessageGeneratorSchema): Promise<void>;
4
- export { RemoveCustomMessageGeneratorSchema };
3
+ export default function (tree: Tree, options: RemoveCustomMessageGeneratorSchema): Promise<void | import("@nx/devkit").GeneratorCallback>;
@@ -0,0 +1,4 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import type { WebviewGeneratorSchema } from './schema';
3
+ export default function (tree: Tree, options: WebviewGeneratorSchema): Promise<void>;
4
+ export { WebviewGeneratorSchema };
@@ -1,4 +1,3 @@
1
- import { Tree } from '@nx/devkit';
1
+ import type { Tree } from '@nx/devkit';
2
2
  import type { WebviewGeneratorSchema } from './schema';
3
- export default function (tree: Tree, options: WebviewGeneratorSchema): Promise<void>;
4
- export { WebviewGeneratorSchema };
3
+ export default function (tree: Tree, options: WebviewGeneratorSchema): Promise<void | import("@nx/devkit").GeneratorCallback>;
package/src/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export { default as buildNodeAppExecutor } from './executors/build-node-app/exec
4
4
  export { default as runLambdaExecutor } from './executors/run-lambda/executor';
5
5
  export { default as serveBotExecutor } from './executors/serve-bot/executor';
6
6
  export * from './lib';
7
+ export * from './lib/serve-mode';
7
8
  export { BotonicPlugin, createNodesV2 } from './plugin';
@@ -1,7 +1,6 @@
1
1
  import { AxiosHeaders, AxiosInstance, AxiosResponse } from 'axios';
2
- import { BotConfigJSON } from './bot-config';
3
- import { BotCredentialsHandler, GlobalCredentialsHandler } from './credentials-handler';
4
- import type { BotDetail, Me, OAuth } from './interfaces';
2
+ import { GlobalCredentialsHandler } from './credentials-handler';
3
+ import type { BotDetail, Me, OAuth, ProviderAccountEntry } from './interfaces';
5
4
  interface IntegrationResponse {
6
5
  detail: string;
7
6
  provider_account: {
@@ -26,9 +25,8 @@ interface IntegrationResponse {
26
25
  netlify_url: string | null;
27
26
  }
28
27
  interface BotonicAPIServiceConfig {
29
- isLocalRuntimeDeployment?: boolean;
30
28
  projectRoot?: string;
31
- /** Monorepo/workspace root. When set, global credentials are stored at workspaceRoot/.botonic/credentials.json (source of truth). */
29
+ /** Monorepo/workspace root. When set, global credentials are stored at workspaceRoot/.botonic/env-credentials.json (source of truth). */
32
30
  workspaceRoot?: string;
33
31
  environmentVariables?: Record<string, string>;
34
32
  targetEnvironment?: string;
@@ -37,18 +35,17 @@ export declare class BotonicAPIService {
37
35
  clientId: string;
38
36
  baseUrl: string;
39
37
  loginUrl: string;
40
- botCredentialsHandler: InstanceType<typeof BotCredentialsHandler>;
38
+ private botsRegistryHandler;
41
39
  globalCredentialsHandler: InstanceType<typeof GlobalCredentialsHandler>;
42
40
  oauth?: OAuth;
41
+ private _tokenExpiresAt?;
43
42
  me?: Me;
44
43
  /** Cached from credentials for display when me is not loaded yet. */
45
44
  loggedUserName?: string;
46
45
  loggedEnvironmentUrl?: string;
47
46
  bot: BotDetail | null;
48
- localRuntimeBot: BotDetail | null;
49
47
  headers: AxiosHeaders;
50
48
  apiClient: AxiosInstance;
51
- isLocalRuntimeDeployment?: boolean;
52
49
  projectRoot?: string;
53
50
  targetEnvironment?: string;
54
51
  constructor(config?: BotonicAPIServiceConfig);
@@ -56,20 +53,21 @@ export declare class BotonicAPIService {
56
53
  botInfo(): BotDetail;
57
54
  getOauth(): OAuth;
58
55
  isAuthenticated(): boolean;
59
- /** True when in local runtime mode and a bot was loaded (e.g. from app .botonic.json). */
60
- hasLocalRuntimeBot(): boolean;
61
56
  ensureAuthenticated(): Promise<void>;
62
- setCurrentBot(bot: any): void;
63
- setLocalRuntimeBot(bot: any): void;
57
+ setCurrentBot(bot: BotDetail | null): void;
58
+ selectBot(bot: BotDetail): Promise<void>;
64
59
  private loadGlobalCredentials;
65
60
  /**
66
61
  * Returns store as env -> credentials. Migrates old single-credential format to { local: creds }.
67
62
  */
68
63
  private normalizeCredentialsStore;
69
- private loadBotCredentials;
64
+ private loadBotFromRegistry;
65
+ private saveToBotsRegistry;
66
+ saveProviders(providers: ProviderAccountEntry[]): void;
67
+ fetchProviders(botId: string): Promise<ProviderAccountEntry[]>;
68
+ saveBotEntry(bot: BotDetail): void;
70
69
  private setHeaders;
71
70
  private saveGlobalCredentials;
72
- private saveBotCredentials;
73
71
  private refreshToken;
74
72
  login(email: string, password: string): Promise<void>;
75
73
  logout(): Promise<void>;
@@ -83,17 +81,12 @@ export declare class BotonicAPIService {
83
81
  getDisplayName(): string;
84
82
  createWebchatIntegration(botId: string, integrationName: string): Promise<AxiosResponse<IntegrationResponse>>;
85
83
  signup(email: string, password: string, orgName: string, campaign: any): Promise<any>;
86
- createBot(botName: string): Promise<AxiosResponse>;
84
+ createBot(botName: string, isTest?: boolean): Promise<AxiosResponse>;
87
85
  getBots(): Promise<AxiosResponse>;
88
86
  deleteBot(botId: string): Promise<AxiosResponse>;
89
87
  getProviders(botId?: string): Promise<AxiosResponse>;
90
88
  deployBot(bundlePath: string, botConfigJson: any): Promise<any>;
91
89
  deployStatus(deployId: string): Promise<AxiosResponse>;
92
- deployLocalRuntime({ botConfigJson, lambdaFunctionName, lambdaEndpoint, }: {
93
- botConfigJson: BotConfigJSON;
94
- lambdaFunctionName: string;
95
- lambdaEndpoint: string;
96
- }): Promise<AxiosResponse<unknown, any, {}>>;
97
90
  build({ projectRoot, projectName, }: {
98
91
  projectRoot: string;
99
92
  projectName: string;
@@ -102,6 +95,12 @@ export declare class BotonicAPIService {
102
95
  private apiPost;
103
96
  private apiGet;
104
97
  private apiDelete;
98
+ private apiPut;
99
+ registerDevSessionWhatsapp(botId: string, chatProviderId: string, devSessionUrl: string, lambdaFunctionName: string, botConfig?: object): Promise<AxiosResponse>;
100
+ registerDevSessionWebchat(botId: string, chatProviderId: string, devSessionUrl: string, lambdaFunctionName: string, botConfig?: object): Promise<AxiosResponse>;
101
+ unregisterDevSessionWhatsapp(botId: string, chatProviderId: string): Promise<AxiosResponse>;
102
+ unregisterDevSessionWebchat(botId: string, chatProviderId: string): Promise<AxiosResponse>;
103
+ refreshTokenIfNeeded(): Promise<void>;
105
104
  private getMe;
106
105
  private validateToken;
107
106
  private isTokenExpired;
@@ -1,9 +1,8 @@
1
1
  export declare const BOTONIC_NPM_NAMESPACE = "@botonic";
2
2
  export declare const BOTONIC_HOME_DIRNAME = ".botonic";
3
- export declare const GLOBAL_CREDS_FILENAME = "credentials.json";
3
+ export declare const ENV_CREDENTIALS_FILENAME = "env-credentials.json";
4
+ export declare const BOTS_REGISTRY_FILENAME = "bots.json";
4
5
  export declare const BOTONIC_PROJECT_PATH: string;
5
- export declare const BOT_CREDENTIALS_FILENAME = ".botonic.json";
6
- export declare const LOCAL_RUNTIME_BOT_CREDENTIALS_FILENAME = ".local-runtime-botonic.json";
7
6
  export declare const ANALYTICS_WRITE_KEY = "YD0jpJHNGW12uhLNbgB4wbdTRQ4Cy1Zu";
8
7
  export declare const CLOUD_PROVIDERS: Readonly<{
9
8
  AWS: "aws";