donobu 5.38.0 → 5.39.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.
@@ -1,3 +1,4 @@
1
+ import { z } from 'zod/v4';
1
2
  export { AnthropicGptClient } from './clients/AnthropicGptClient';
2
3
  export { DonobuGptClient } from './clients/DonobuGptClient';
3
4
  export { fixAssertFields, GoogleGenerativeAiGptClient, } from './clients/GoogleGenerativeAiGptClient';
@@ -78,8 +79,51 @@ export * from './utils/TargetUtils';
78
79
  * Starts a Donobu API server at the given port. The server assumes that the
79
80
  * Playwright browsers have been installed.
80
81
  */
81
- export declare function startDonobuServer({ port, controlPanelHost, }?: {
82
+ export declare function startDonobuServer({ port, controlPanelHost, environ, }?: {
82
83
  port?: number | undefined;
83
84
  controlPanelHost?: import("./models/ControlPanel").ControlPanelFactory | undefined;
85
+ environ?: import("env-struct").Env<{
86
+ BASE64_GPT_CONFIG: z.ZodOptional<z.ZodString>;
87
+ BROWSERBASE_API_KEY: z.ZodOptional<z.ZodString>;
88
+ BROWSERBASE_PROJECT_ID: z.ZodOptional<z.ZodString>;
89
+ DONOBU_DEPLOYMENT_ENVIRONMENT: z.ZodOptional<z.ZodEnum<{
90
+ LOCAL: "LOCAL";
91
+ DONOBU_HOSTED_MULTI_TENANT: "DONOBU_HOSTED_MULTI_TENANT";
92
+ DONOBU_HOSTED_SINGLE_TENANT: "DONOBU_HOSTED_SINGLE_TENANT";
93
+ }>>;
94
+ DONOBU_API_BASE_URL: z.ZodDefault<z.ZodString>;
95
+ ANTHROPIC_API_KEY: z.ZodOptional<z.ZodString>;
96
+ ANTHROPIC_MODEL_NAME: z.ZodOptional<z.ZodString>;
97
+ GOOGLE_GENERATIVE_AI_API_KEY: z.ZodOptional<z.ZodString>;
98
+ GOOGLE_GENERATIVE_AI_MODEL_NAME: z.ZodOptional<z.ZodString>;
99
+ OLLAMA_MODEL_NAME: z.ZodOptional<z.ZodString>;
100
+ OLLAMA_API_URL: z.ZodOptional<z.ZodString>;
101
+ OPENAI_API_KEY: z.ZodOptional<z.ZodString>;
102
+ OPENAI_API_MODEL_NAME: z.ZodOptional<z.ZodString>;
103
+ PERSISTENCE_PRIORITY: z.ZodDefault<z.ZodArray<z.ZodString>>;
104
+ AWS_BEDROCK_MODEL_NAME: z.ZodOptional<z.ZodString>;
105
+ AWS_ACCESS_KEY_ID: z.ZodOptional<z.ZodString>;
106
+ AWS_SECRET_ACCESS_KEY: z.ZodOptional<z.ZodString>;
107
+ DONOBU_API_KEY: z.ZodOptional<z.ZodString>;
108
+ }, {
109
+ BASE64_GPT_CONFIG?: string | undefined;
110
+ BROWSERBASE_API_KEY?: string | undefined;
111
+ BROWSERBASE_PROJECT_ID?: string | undefined;
112
+ DONOBU_DEPLOYMENT_ENVIRONMENT?: "LOCAL" | "DONOBU_HOSTED_MULTI_TENANT" | "DONOBU_HOSTED_SINGLE_TENANT" | undefined;
113
+ DONOBU_API_BASE_URL: string;
114
+ ANTHROPIC_API_KEY?: string | undefined;
115
+ ANTHROPIC_MODEL_NAME?: string | undefined;
116
+ GOOGLE_GENERATIVE_AI_API_KEY?: string | undefined;
117
+ GOOGLE_GENERATIVE_AI_MODEL_NAME?: string | undefined;
118
+ OLLAMA_MODEL_NAME?: string | undefined;
119
+ OLLAMA_API_URL?: string | undefined;
120
+ OPENAI_API_KEY?: string | undefined;
121
+ OPENAI_API_MODEL_NAME?: string | undefined;
122
+ PERSISTENCE_PRIORITY: string[];
123
+ AWS_BEDROCK_MODEL_NAME?: string | undefined;
124
+ AWS_ACCESS_KEY_ID?: string | undefined;
125
+ AWS_SECRET_ACCESS_KEY?: string | undefined;
126
+ DONOBU_API_KEY?: string | undefined;
127
+ }> | undefined;
84
128
  }): Promise<void>;
85
129
  //# sourceMappingURL=main.d.ts.map
package/dist/esm/main.js CHANGED
@@ -113,10 +113,10 @@ const DEFAULT_PORT = 31000;
113
113
  * Starts a Donobu API server at the given port. The server assumes that the
114
114
  * Playwright browsers have been installed.
115
115
  */
116
- async function startDonobuServer({ port = DEFAULT_PORT, controlPanelHost = ControlPanel_1.NoOpControlPanelFactory, } = {}) {
116
+ async function startDonobuServer({ port = DEFAULT_PORT, controlPanelHost = ControlPanel_1.NoOpControlPanelFactory, environ = envVars_1.env.pick('ANTHROPIC_API_KEY', 'ANTHROPIC_MODEL_NAME', 'AWS_ACCESS_KEY_ID', 'AWS_BEDROCK_MODEL_NAME', 'AWS_SECRET_ACCESS_KEY', 'BASE64_GPT_CONFIG', 'BROWSERBASE_API_KEY', 'BROWSERBASE_PROJECT_ID', 'DONOBU_DEPLOYMENT_ENVIRONMENT', 'DONOBU_API_BASE_URL', 'DONOBU_API_KEY', 'GOOGLE_GENERATIVE_AI_API_KEY', 'GOOGLE_GENERATIVE_AI_MODEL_NAME', 'OLLAMA_API_URL', 'OLLAMA_MODEL_NAME', 'OPENAI_API_KEY', 'OPENAI_API_MODEL_NAME', 'PERSISTENCE_PRIORITY'), } = {}) {
117
117
  try {
118
- const adminController = await AdminApiController_1.AdminApiController.create(envVars_1.env.data.DONOBU_DEPLOYMENT_ENVIRONMENT ?? 'LOCAL', controlPanelHost, envVars_1.env);
119
- adminController.start(port);
118
+ const adminController = await AdminApiController_1.AdminApiController.create(environ.data.DONOBU_DEPLOYMENT_ENVIRONMENT ?? 'LOCAL', controlPanelHost, environ);
119
+ await adminController.start(port);
120
120
  Logger_1.appLogger.info(`Donobu API server available on http://localhost:${port}`);
121
121
  // Keep the process running until a process signal is detected.
122
122
  await new Promise((resolve) => {
@@ -132,8 +132,7 @@ async function startDonobuServer({ port = DEFAULT_PORT, controlPanelHost = Contr
132
132
  ['SIGTERM', 'SIGINT', 'SIGHUP'].forEach((signal) => {
133
133
  process.on(signal, () => {
134
134
  Logger_1.appLogger.info(`Received ${signal}, shutting down...`);
135
- adminController.stop();
136
- resolve();
135
+ void adminController.stop().finally(resolve);
137
136
  });
138
137
  });
139
138
  });
@@ -62,14 +62,20 @@ export declare class AdminApiController {
62
62
  static create(donobuDeploymentEnvironment: DonobuDeploymentEnvironment, controlPanelFactory: ControlPanelFactory, environ: EnvPick<typeof env, 'ANTHROPIC_API_KEY' | 'ANTHROPIC_MODEL_NAME' | 'AWS_ACCESS_KEY_ID' | 'AWS_BEDROCK_MODEL_NAME' | 'AWS_SECRET_ACCESS_KEY' | 'BASE64_GPT_CONFIG' | 'BROWSERBASE_API_KEY' | 'BROWSERBASE_PROJECT_ID' | 'DONOBU_API_BASE_URL' | 'DONOBU_API_KEY' | 'GOOGLE_GENERATIVE_AI_API_KEY' | 'GOOGLE_GENERATIVE_AI_MODEL_NAME' | 'OLLAMA_API_URL' | 'OLLAMA_MODEL_NAME' | 'OPENAI_API_KEY' | 'OPENAI_API_MODEL_NAME' | 'PERSISTENCE_PRIORITY'>): Promise<AdminApiController>;
63
63
  private constructor();
64
64
  /**
65
- * Serves the API and web assets; this blocks until stop() is called.
66
- * If the given port is 0, a random port is assigned.
65
+ * Binds the API/web-asset server to `port` and resolves once the socket is
66
+ * listening. If the given port is 0, a random port is assigned. Rejects on
67
+ * bind errors (e.g. EADDRINUSE) so callers — particularly those doing a
68
+ * stop/start bounce — can recover instead of crashing on an uncaught
69
+ * 'error' event.
67
70
  */
68
- start(port: number): void;
71
+ start(port: number): Promise<void>;
69
72
  /**
70
- * Stops the server.
73
+ * Stops accepting new connections and forcibly tears down any in-flight
74
+ * ones, then resolves. Forceful close keeps bounces predictable — a slow
75
+ * or stuck client request can't hold the port open. Callers that want to
76
+ * let in-flight work drain should do so before invoking stop().
71
77
  */
72
- stop(): void;
78
+ stop(): Promise<void>;
73
79
  private static setupExpressFramework;
74
80
  /**
75
81
  * Sets up URL error handler middleware to catch URL parsing/decoding errors.
@@ -87,22 +87,35 @@ class AdminApiController {
87
87
  this.app = app;
88
88
  }
89
89
  /**
90
- * Serves the API and web assets; this blocks until stop() is called.
91
- * If the given port is 0, a random port is assigned.
90
+ * Binds the API/web-asset server to `port` and resolves once the socket is
91
+ * listening. If the given port is 0, a random port is assigned. Rejects on
92
+ * bind errors (e.g. EADDRINUSE) so callers — particularly those doing a
93
+ * stop/start bounce — can recover instead of crashing on an uncaught
94
+ * 'error' event.
92
95
  */
93
- start(port) {
96
+ async start(port) {
94
97
  Logger_1.appLogger.debug(`Starting AdminController on port ${port}`);
95
- this.server = this.app.listen(port);
98
+ await new Promise((resolve, reject) => {
99
+ this.server = this.app.listen(port, () => resolve());
100
+ this.server.once('error', reject);
101
+ });
96
102
  }
97
103
  /**
98
- * Stops the server.
104
+ * Stops accepting new connections and forcibly tears down any in-flight
105
+ * ones, then resolves. Forceful close keeps bounces predictable — a slow
106
+ * or stuck client request can't hold the port open. Callers that want to
107
+ * let in-flight work drain should do so before invoking stop().
99
108
  */
100
- stop() {
109
+ async stop() {
101
110
  if (this.server) {
102
111
  const address = this.server.address();
103
112
  const port = typeof address === 'string' ? address : address?.port;
104
113
  Logger_1.appLogger.debug(`Stopping AdminController on port ${port}`);
105
- this.server.close();
114
+ const server = this.server;
115
+ await new Promise((resolve, reject) => {
116
+ server.close((err) => (err ? reject(err) : resolve()));
117
+ server.closeAllConnections();
118
+ });
106
119
  }
107
120
  }
108
121
  static async setupExpressFramework(donobuDeploymentEnvironment, controlPanelFactory, environ) {
@@ -7,20 +7,21 @@ const FlowMetadata_1 = require("./FlowMetadata");
7
7
  const ProposedToolCall_1 = require("./ProposedToolCall");
8
8
  const RunMode_1 = require("./RunMode");
9
9
  exports.CreateDonobuFlowSchema = v4_1.z
10
- .object({
10
+ .looseObject({
11
11
  id: v4_1.z
12
12
  .string()
13
- .uuid()
13
+ .min(1)
14
+ .max(128)
15
+ .regex(/^[a-zA-Z0-9._:-]+$/)
14
16
  .optional()
15
- .describe('⚠️ ADVANCED — DO NOT USE unless you have a specific reason. ' +
16
- 'Pre-assigned flow ID (UUID). Useful only when the caller must know ' +
17
- 'the ID before flow creation completes (e.g. orchestrators that ' +
18
- 'pre-allocate IDs to track an in-flight execution). The SDK does a ' +
19
- 'best-effort collision check against the persistence layer and ' +
20
- 'throws FlowIdCollisionException if the ID already exists, but ' +
21
- 'concurrent calls with the same ID are RACY: there is no locking, ' +
22
- 'so two callers can both pass the check and create dueling rows. ' +
23
- 'If you do not need this, omit it and let the SDK mint a UUID.'),
17
+ .describe(`⚠️ ADVANCED — DO NOT USE unless you have a specific reason.
18
+ Pre-assigned flow ID. Useful only when the caller must know the ID before
19
+ flow creation completes (e.g. orchestrators that pre-allocate IDs to track
20
+ an in-flight execution). The SDK does a best-effort collision check against
21
+ the persistence layer and throws FlowIdCollisionException if the ID already
22
+ exists, but concurrent calls with the same ID are RACY: there is no locking,
23
+ so two callers can both pass the check and create dueling rows. If you do
24
+ not need this, omit it and let the SDK mint an ID.`),
24
25
  target: v4_1.z
25
26
  .string()
26
27
  .describe('The target type: "web", "mobile", or a plugin-provided target.'),
@@ -82,6 +83,5 @@ is not defined or unresolvable, the default flow agent configuration will be use
82
83
  .optional()
83
84
  .describe('The ID of the test that this flow is associated with. Only optional to support legacy flow creation scenarios.'),
84
85
  })
85
- .passthrough()
86
86
  .describe('This is the expected payload for a request to create a new Donobu flow');
87
87
  //# sourceMappingURL=CreateDonobuFlow.js.map
package/dist/main.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { z } from 'zod/v4';
1
2
  export { AnthropicGptClient } from './clients/AnthropicGptClient';
2
3
  export { DonobuGptClient } from './clients/DonobuGptClient';
3
4
  export { fixAssertFields, GoogleGenerativeAiGptClient, } from './clients/GoogleGenerativeAiGptClient';
@@ -78,8 +79,51 @@ export * from './utils/TargetUtils';
78
79
  * Starts a Donobu API server at the given port. The server assumes that the
79
80
  * Playwright browsers have been installed.
80
81
  */
81
- export declare function startDonobuServer({ port, controlPanelHost, }?: {
82
+ export declare function startDonobuServer({ port, controlPanelHost, environ, }?: {
82
83
  port?: number | undefined;
83
84
  controlPanelHost?: import("./models/ControlPanel").ControlPanelFactory | undefined;
85
+ environ?: import("env-struct").Env<{
86
+ BASE64_GPT_CONFIG: z.ZodOptional<z.ZodString>;
87
+ BROWSERBASE_API_KEY: z.ZodOptional<z.ZodString>;
88
+ BROWSERBASE_PROJECT_ID: z.ZodOptional<z.ZodString>;
89
+ DONOBU_DEPLOYMENT_ENVIRONMENT: z.ZodOptional<z.ZodEnum<{
90
+ LOCAL: "LOCAL";
91
+ DONOBU_HOSTED_MULTI_TENANT: "DONOBU_HOSTED_MULTI_TENANT";
92
+ DONOBU_HOSTED_SINGLE_TENANT: "DONOBU_HOSTED_SINGLE_TENANT";
93
+ }>>;
94
+ DONOBU_API_BASE_URL: z.ZodDefault<z.ZodString>;
95
+ ANTHROPIC_API_KEY: z.ZodOptional<z.ZodString>;
96
+ ANTHROPIC_MODEL_NAME: z.ZodOptional<z.ZodString>;
97
+ GOOGLE_GENERATIVE_AI_API_KEY: z.ZodOptional<z.ZodString>;
98
+ GOOGLE_GENERATIVE_AI_MODEL_NAME: z.ZodOptional<z.ZodString>;
99
+ OLLAMA_MODEL_NAME: z.ZodOptional<z.ZodString>;
100
+ OLLAMA_API_URL: z.ZodOptional<z.ZodString>;
101
+ OPENAI_API_KEY: z.ZodOptional<z.ZodString>;
102
+ OPENAI_API_MODEL_NAME: z.ZodOptional<z.ZodString>;
103
+ PERSISTENCE_PRIORITY: z.ZodDefault<z.ZodArray<z.ZodString>>;
104
+ AWS_BEDROCK_MODEL_NAME: z.ZodOptional<z.ZodString>;
105
+ AWS_ACCESS_KEY_ID: z.ZodOptional<z.ZodString>;
106
+ AWS_SECRET_ACCESS_KEY: z.ZodOptional<z.ZodString>;
107
+ DONOBU_API_KEY: z.ZodOptional<z.ZodString>;
108
+ }, {
109
+ BASE64_GPT_CONFIG?: string | undefined;
110
+ BROWSERBASE_API_KEY?: string | undefined;
111
+ BROWSERBASE_PROJECT_ID?: string | undefined;
112
+ DONOBU_DEPLOYMENT_ENVIRONMENT?: "LOCAL" | "DONOBU_HOSTED_MULTI_TENANT" | "DONOBU_HOSTED_SINGLE_TENANT" | undefined;
113
+ DONOBU_API_BASE_URL: string;
114
+ ANTHROPIC_API_KEY?: string | undefined;
115
+ ANTHROPIC_MODEL_NAME?: string | undefined;
116
+ GOOGLE_GENERATIVE_AI_API_KEY?: string | undefined;
117
+ GOOGLE_GENERATIVE_AI_MODEL_NAME?: string | undefined;
118
+ OLLAMA_MODEL_NAME?: string | undefined;
119
+ OLLAMA_API_URL?: string | undefined;
120
+ OPENAI_API_KEY?: string | undefined;
121
+ OPENAI_API_MODEL_NAME?: string | undefined;
122
+ PERSISTENCE_PRIORITY: string[];
123
+ AWS_BEDROCK_MODEL_NAME?: string | undefined;
124
+ AWS_ACCESS_KEY_ID?: string | undefined;
125
+ AWS_SECRET_ACCESS_KEY?: string | undefined;
126
+ DONOBU_API_KEY?: string | undefined;
127
+ }> | undefined;
84
128
  }): Promise<void>;
85
129
  //# sourceMappingURL=main.d.ts.map
package/dist/main.js CHANGED
@@ -113,10 +113,10 @@ const DEFAULT_PORT = 31000;
113
113
  * Starts a Donobu API server at the given port. The server assumes that the
114
114
  * Playwright browsers have been installed.
115
115
  */
116
- async function startDonobuServer({ port = DEFAULT_PORT, controlPanelHost = ControlPanel_1.NoOpControlPanelFactory, } = {}) {
116
+ async function startDonobuServer({ port = DEFAULT_PORT, controlPanelHost = ControlPanel_1.NoOpControlPanelFactory, environ = envVars_1.env.pick('ANTHROPIC_API_KEY', 'ANTHROPIC_MODEL_NAME', 'AWS_ACCESS_KEY_ID', 'AWS_BEDROCK_MODEL_NAME', 'AWS_SECRET_ACCESS_KEY', 'BASE64_GPT_CONFIG', 'BROWSERBASE_API_KEY', 'BROWSERBASE_PROJECT_ID', 'DONOBU_DEPLOYMENT_ENVIRONMENT', 'DONOBU_API_BASE_URL', 'DONOBU_API_KEY', 'GOOGLE_GENERATIVE_AI_API_KEY', 'GOOGLE_GENERATIVE_AI_MODEL_NAME', 'OLLAMA_API_URL', 'OLLAMA_MODEL_NAME', 'OPENAI_API_KEY', 'OPENAI_API_MODEL_NAME', 'PERSISTENCE_PRIORITY'), } = {}) {
117
117
  try {
118
- const adminController = await AdminApiController_1.AdminApiController.create(envVars_1.env.data.DONOBU_DEPLOYMENT_ENVIRONMENT ?? 'LOCAL', controlPanelHost, envVars_1.env);
119
- adminController.start(port);
118
+ const adminController = await AdminApiController_1.AdminApiController.create(environ.data.DONOBU_DEPLOYMENT_ENVIRONMENT ?? 'LOCAL', controlPanelHost, environ);
119
+ await adminController.start(port);
120
120
  Logger_1.appLogger.info(`Donobu API server available on http://localhost:${port}`);
121
121
  // Keep the process running until a process signal is detected.
122
122
  await new Promise((resolve) => {
@@ -132,8 +132,7 @@ async function startDonobuServer({ port = DEFAULT_PORT, controlPanelHost = Contr
132
132
  ['SIGTERM', 'SIGINT', 'SIGHUP'].forEach((signal) => {
133
133
  process.on(signal, () => {
134
134
  Logger_1.appLogger.info(`Received ${signal}, shutting down...`);
135
- adminController.stop();
136
- resolve();
135
+ void adminController.stop().finally(resolve);
137
136
  });
138
137
  });
139
138
  });
@@ -62,14 +62,20 @@ export declare class AdminApiController {
62
62
  static create(donobuDeploymentEnvironment: DonobuDeploymentEnvironment, controlPanelFactory: ControlPanelFactory, environ: EnvPick<typeof env, 'ANTHROPIC_API_KEY' | 'ANTHROPIC_MODEL_NAME' | 'AWS_ACCESS_KEY_ID' | 'AWS_BEDROCK_MODEL_NAME' | 'AWS_SECRET_ACCESS_KEY' | 'BASE64_GPT_CONFIG' | 'BROWSERBASE_API_KEY' | 'BROWSERBASE_PROJECT_ID' | 'DONOBU_API_BASE_URL' | 'DONOBU_API_KEY' | 'GOOGLE_GENERATIVE_AI_API_KEY' | 'GOOGLE_GENERATIVE_AI_MODEL_NAME' | 'OLLAMA_API_URL' | 'OLLAMA_MODEL_NAME' | 'OPENAI_API_KEY' | 'OPENAI_API_MODEL_NAME' | 'PERSISTENCE_PRIORITY'>): Promise<AdminApiController>;
63
63
  private constructor();
64
64
  /**
65
- * Serves the API and web assets; this blocks until stop() is called.
66
- * If the given port is 0, a random port is assigned.
65
+ * Binds the API/web-asset server to `port` and resolves once the socket is
66
+ * listening. If the given port is 0, a random port is assigned. Rejects on
67
+ * bind errors (e.g. EADDRINUSE) so callers — particularly those doing a
68
+ * stop/start bounce — can recover instead of crashing on an uncaught
69
+ * 'error' event.
67
70
  */
68
- start(port: number): void;
71
+ start(port: number): Promise<void>;
69
72
  /**
70
- * Stops the server.
73
+ * Stops accepting new connections and forcibly tears down any in-flight
74
+ * ones, then resolves. Forceful close keeps bounces predictable — a slow
75
+ * or stuck client request can't hold the port open. Callers that want to
76
+ * let in-flight work drain should do so before invoking stop().
71
77
  */
72
- stop(): void;
78
+ stop(): Promise<void>;
73
79
  private static setupExpressFramework;
74
80
  /**
75
81
  * Sets up URL error handler middleware to catch URL parsing/decoding errors.
@@ -87,22 +87,35 @@ class AdminApiController {
87
87
  this.app = app;
88
88
  }
89
89
  /**
90
- * Serves the API and web assets; this blocks until stop() is called.
91
- * If the given port is 0, a random port is assigned.
90
+ * Binds the API/web-asset server to `port` and resolves once the socket is
91
+ * listening. If the given port is 0, a random port is assigned. Rejects on
92
+ * bind errors (e.g. EADDRINUSE) so callers — particularly those doing a
93
+ * stop/start bounce — can recover instead of crashing on an uncaught
94
+ * 'error' event.
92
95
  */
93
- start(port) {
96
+ async start(port) {
94
97
  Logger_1.appLogger.debug(`Starting AdminController on port ${port}`);
95
- this.server = this.app.listen(port);
98
+ await new Promise((resolve, reject) => {
99
+ this.server = this.app.listen(port, () => resolve());
100
+ this.server.once('error', reject);
101
+ });
96
102
  }
97
103
  /**
98
- * Stops the server.
104
+ * Stops accepting new connections and forcibly tears down any in-flight
105
+ * ones, then resolves. Forceful close keeps bounces predictable — a slow
106
+ * or stuck client request can't hold the port open. Callers that want to
107
+ * let in-flight work drain should do so before invoking stop().
99
108
  */
100
- stop() {
109
+ async stop() {
101
110
  if (this.server) {
102
111
  const address = this.server.address();
103
112
  const port = typeof address === 'string' ? address : address?.port;
104
113
  Logger_1.appLogger.debug(`Stopping AdminController on port ${port}`);
105
- this.server.close();
114
+ const server = this.server;
115
+ await new Promise((resolve, reject) => {
116
+ server.close((err) => (err ? reject(err) : resolve()));
117
+ server.closeAllConnections();
118
+ });
106
119
  }
107
120
  }
108
121
  static async setupExpressFramework(donobuDeploymentEnvironment, controlPanelFactory, environ) {
@@ -7,20 +7,21 @@ const FlowMetadata_1 = require("./FlowMetadata");
7
7
  const ProposedToolCall_1 = require("./ProposedToolCall");
8
8
  const RunMode_1 = require("./RunMode");
9
9
  exports.CreateDonobuFlowSchema = v4_1.z
10
- .object({
10
+ .looseObject({
11
11
  id: v4_1.z
12
12
  .string()
13
- .uuid()
13
+ .min(1)
14
+ .max(128)
15
+ .regex(/^[a-zA-Z0-9._:-]+$/)
14
16
  .optional()
15
- .describe('⚠️ ADVANCED — DO NOT USE unless you have a specific reason. ' +
16
- 'Pre-assigned flow ID (UUID). Useful only when the caller must know ' +
17
- 'the ID before flow creation completes (e.g. orchestrators that ' +
18
- 'pre-allocate IDs to track an in-flight execution). The SDK does a ' +
19
- 'best-effort collision check against the persistence layer and ' +
20
- 'throws FlowIdCollisionException if the ID already exists, but ' +
21
- 'concurrent calls with the same ID are RACY: there is no locking, ' +
22
- 'so two callers can both pass the check and create dueling rows. ' +
23
- 'If you do not need this, omit it and let the SDK mint a UUID.'),
17
+ .describe(`⚠️ ADVANCED — DO NOT USE unless you have a specific reason.
18
+ Pre-assigned flow ID. Useful only when the caller must know the ID before
19
+ flow creation completes (e.g. orchestrators that pre-allocate IDs to track
20
+ an in-flight execution). The SDK does a best-effort collision check against
21
+ the persistence layer and throws FlowIdCollisionException if the ID already
22
+ exists, but concurrent calls with the same ID are RACY: there is no locking,
23
+ so two callers can both pass the check and create dueling rows. If you do
24
+ not need this, omit it and let the SDK mint an ID.`),
24
25
  target: v4_1.z
25
26
  .string()
26
27
  .describe('The target type: "web", "mobile", or a plugin-provided target.'),
@@ -82,6 +83,5 @@ is not defined or unresolvable, the default flow agent configuration will be use
82
83
  .optional()
83
84
  .describe('The ID of the test that this flow is associated with. Only optional to support legacy flow creation scenarios.'),
84
85
  })
85
- .passthrough()
86
86
  .describe('This is the expected payload for a request to create a new Donobu flow');
87
87
  //# sourceMappingURL=CreateDonobuFlow.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "donobu",
3
- "version": "5.38.0",
3
+ "version": "5.39.0",
4
4
  "description": "Create browser automations with an LLM agent and replay them as Playwright scripts.",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/esm/main.js",