@promptbook/wizard 0.100.0-35 → 0.100.0-36

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.
@@ -46,6 +46,7 @@ import { DEFAULT_CSV_SETTINGS } from '../config';
46
46
  import { DEFAULT_IS_VERBOSE } from '../config';
47
47
  import { SET_IS_VERBOSE } from '../config';
48
48
  import { DEFAULT_IS_AUTO_INSTALLED } from '../config';
49
+ import { DEFAULT_TASK_SIMULATED_DURATION_MS } from '../config';
49
50
  import { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME } from '../config';
50
51
  import { DEFAULT_MAX_REQUESTS_PER_MINUTE } from '../config';
51
52
  import { MODEL_TRUST_LEVELS } from '../constants';
@@ -207,6 +208,7 @@ export { DEFAULT_CSV_SETTINGS };
207
208
  export { DEFAULT_IS_VERBOSE };
208
209
  export { SET_IS_VERBOSE };
209
210
  export { DEFAULT_IS_AUTO_INSTALLED };
211
+ export { DEFAULT_TASK_SIMULATED_DURATION_MS };
210
212
  export { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME };
211
213
  export { DEFAULT_MAX_REQUESTS_PER_MINUTE };
212
214
  export { MODEL_TRUST_LEVELS };
@@ -281,6 +281,12 @@ export declare function SET_IS_VERBOSE(isVerbose: boolean): void;
281
281
  * @public exported from `@promptbook/core`
282
282
  */
283
283
  export declare const DEFAULT_IS_AUTO_INSTALLED = false;
284
+ /**
285
+ * Default simulated duration for a task in milliseconds (used for progress reporting)
286
+ *
287
+ * @public exported from `@promptbook/core`
288
+ */
289
+ export declare const DEFAULT_TASK_SIMULATED_DURATION_MS: number;
284
290
  /**
285
291
  * Function name for generated function via `ptbk make` to get the pipeline collection
286
292
  *
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.100.0-34`).
18
+ * It follows semantic versioning (e.g., `0.100.0-35`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/wizard",
3
- "version": "0.100.0-35",
3
+ "version": "0.100.0-36",
4
4
  "description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -95,7 +95,7 @@
95
95
  "module": "./esm/index.es.js",
96
96
  "typings": "./esm/typings/src/_packages/wizard.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.100.0-35"
98
+ "@promptbook/core": "0.100.0-36"
99
99
  },
100
100
  "dependencies": {
101
101
  "@ai-sdk/deepseek": "0.1.6",
package/umd/index.umd.js CHANGED
@@ -49,7 +49,7 @@
49
49
  * @generated
50
50
  * @see https://github.com/webgptorg/promptbook
51
51
  */
52
- const PROMPTBOOK_ENGINE_VERSION = '0.100.0-35';
52
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-36';
53
53
  /**
54
54
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
55
55
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -323,6 +323,12 @@
323
323
  * @public exported from `@promptbook/core`
324
324
  */
325
325
  const DEFAULT_IS_AUTO_INSTALLED = false;
326
+ /**
327
+ * Default simulated duration for a task in milliseconds (used for progress reporting)
328
+ *
329
+ * @public exported from `@promptbook/core`
330
+ */
331
+ const DEFAULT_TASK_SIMULATED_DURATION_MS = 5 * 60 * 1000; // 5 minutes
326
332
  /**
327
333
  * Default rate limits (requests per minute)
328
334
  *
@@ -7251,21 +7257,31 @@
7251
7257
  },
7252
7258
  get tldr() {
7253
7259
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
7254
- // Derive a short progress summary from currentValue, status and any errors/warnings.
7260
+ // Simulate progress based on elapsed time and subtasks
7255
7261
  const cv = currentValue;
7256
- // Try several common places where a percent might be stored on the partial result
7262
+ // If explicit percent is provided, use it
7257
7263
  let percentRaw = (_f = (_d = (_b = (_a = cv === null || cv === void 0 ? void 0 : cv.tldr) === null || _a === void 0 ? void 0 : _a.percent) !== null && _b !== void 0 ? _b : (_c = cv === null || cv === void 0 ? void 0 : cv.usage) === null || _c === void 0 ? void 0 : _c.percent) !== null && _d !== void 0 ? _d : (_e = cv === null || cv === void 0 ? void 0 : cv.progress) === null || _e === void 0 ? void 0 : _e.percent) !== null && _f !== void 0 ? _f : cv === null || cv === void 0 ? void 0 : cv.percent;
7258
- // If we didn't find a numeric percent, infer from status
7264
+ // Simulate progress if not provided
7259
7265
  if (typeof percentRaw !== 'number') {
7260
- if (status === 'FINISHED') {
7266
+ // Simulate progress: evenly split across subtasks, based on elapsed time
7267
+ const now = new Date();
7268
+ const elapsedMs = now.getTime() - createdAt.getTime();
7269
+ const totalMs = DEFAULT_TASK_SIMULATED_DURATION_MS;
7270
+ // If subtasks are defined, split progress evenly
7271
+ const subtaskCount = Array.isArray(cv === null || cv === void 0 ? void 0 : cv.subtasks) ? cv.subtasks.length : 1;
7272
+ const completedSubtasks = Array.isArray(cv === null || cv === void 0 ? void 0 : cv.subtasks)
7273
+ ? cv.subtasks.filter((s) => s.done || s.completed).length
7274
+ : 0;
7275
+ // Progress from completed subtasks
7276
+ const subtaskProgress = subtaskCount > 0 ? completedSubtasks / subtaskCount : 0;
7277
+ // Progress from elapsed time for current subtask
7278
+ const timeProgress = Math.min(elapsedMs / totalMs, 1);
7279
+ // Combine: completed subtasks + time progress for current subtask
7280
+ percentRaw = Math.min(subtaskProgress + (1 / subtaskCount) * timeProgress, 1);
7281
+ if (status === 'FINISHED')
7261
7282
  percentRaw = 1;
7262
- }
7263
- else if (status === 'ERROR') {
7283
+ if (status === 'ERROR')
7264
7284
  percentRaw = 0;
7265
- }
7266
- else {
7267
- percentRaw = 0;
7268
- }
7269
7285
  }
7270
7286
  // Clamp to [0,1]
7271
7287
  let percent = Number(percentRaw) || 0;
@@ -7277,20 +7293,29 @@
7277
7293
  const messageFromResult = (_k = (_j = (_h = (_g = cv === null || cv === void 0 ? void 0 : cv.tldr) === null || _g === void 0 ? void 0 : _g.message) !== null && _h !== void 0 ? _h : cv === null || cv === void 0 ? void 0 : cv.message) !== null && _j !== void 0 ? _j : cv === null || cv === void 0 ? void 0 : cv.summary) !== null && _k !== void 0 ? _k : cv === null || cv === void 0 ? void 0 : cv.statusMessage;
7278
7294
  let message = messageFromResult;
7279
7295
  if (!message) {
7280
- if (errors.length) {
7281
- message = errors[errors.length - 1].message || 'Error';
7282
- }
7283
- else if (warnings.length) {
7284
- message = warnings[warnings.length - 1].message || 'Warning';
7285
- }
7286
- else if (status === 'FINISHED') {
7287
- message = 'Finished';
7288
- }
7289
- else if (status === 'ERROR') {
7290
- message = 'Error';
7296
+ // If subtasks, show current subtask
7297
+ if (Array.isArray(cv === null || cv === void 0 ? void 0 : cv.subtasks) && cv.subtasks.length > 0) {
7298
+ const current = cv.subtasks.find((s) => !s.done && !s.completed);
7299
+ if (current && current.title) {
7300
+ message = `Working on ${current.title}`;
7301
+ }
7291
7302
  }
7292
- else {
7293
- message = 'Running';
7303
+ if (!message) {
7304
+ if (errors.length) {
7305
+ message = errors[errors.length - 1].message || 'Error';
7306
+ }
7307
+ else if (warnings.length) {
7308
+ message = warnings[warnings.length - 1].message || 'Warning';
7309
+ }
7310
+ else if (status === 'FINISHED') {
7311
+ message = 'Finished';
7312
+ }
7313
+ else if (status === 'ERROR') {
7314
+ message = 'Error';
7315
+ }
7316
+ else {
7317
+ message = 'Running';
7318
+ }
7294
7319
  }
7295
7320
  }
7296
7321
  return {