@promptbook/utils 0.112.0-12 → 0.112.0-15

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 (43) hide show
  1. package/esm/index.es.js +18 -18
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/src/cli/cli-commands/coder/{find-fresh-emoji-tag.d.ts → find-fresh-emoji-tags.d.ts} +1 -1
  4. package/esm/src/cli/cli-commands/coder.d.ts +1 -1
  5. package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +1 -1
  6. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +1 -0
  7. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +51 -2
  8. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +2 -2
  9. package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +2 -2
  10. package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +14 -1
  11. package/esm/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +1 -1
  12. package/esm/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  13. package/esm/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  14. package/esm/src/llm-providers/google/google-models.d.ts +1 -1
  15. package/esm/src/llm-providers/openai/openai-models.d.ts +1 -1
  16. package/esm/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -2
  17. package/esm/src/scrapers/document/DocumentScraper.d.ts +1 -2
  18. package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -2
  19. package/esm/src/scripting/javascript/postprocessing-functions.d.ts +1 -1
  20. package/esm/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -2
  21. package/esm/src/version.d.ts +1 -1
  22. package/package.json +1 -1
  23. package/umd/index.umd.js +28 -29
  24. package/umd/index.umd.js.map +1 -1
  25. package/umd/src/cli/cli-commands/coder/{find-fresh-emoji-tag.d.ts → find-fresh-emoji-tags.d.ts} +1 -1
  26. package/umd/src/cli/cli-commands/coder.d.ts +1 -1
  27. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +1 -1
  28. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +1 -0
  29. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +51 -2
  30. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +2 -2
  31. package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +2 -2
  32. package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +14 -1
  33. package/umd/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +1 -1
  34. package/umd/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  35. package/umd/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  36. package/umd/src/llm-providers/google/google-models.d.ts +1 -1
  37. package/umd/src/llm-providers/openai/openai-models.d.ts +1 -1
  38. package/umd/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -2
  39. package/umd/src/scrapers/document/DocumentScraper.d.ts +1 -2
  40. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -2
  41. package/umd/src/scripting/javascript/postprocessing-functions.d.ts +1 -1
  42. package/umd/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -2
  43. package/umd/src/version.d.ts +1 -1
@@ -18,6 +18,16 @@ export type CancelTimeoutToolArgs = {
18
18
  timeoutId?: string;
19
19
  [key: string]: TODO_any;
20
20
  };
21
+ /**
22
+ * Tool arguments for listing scoped timeouts.
23
+ *
24
+ * @private type of UseTimeoutCommitmentDefinition
25
+ */
26
+ export type ListTimeoutsToolArgs = {
27
+ includeFinished?: boolean;
28
+ limit?: number;
29
+ [key: string]: TODO_any;
30
+ };
21
31
  /**
22
32
  * Runtime context available to `USE TIMEOUT` tools.
23
33
  *
@@ -31,6 +41,26 @@ export type TimeoutToolRuntimeContext = {
31
41
  readonly agentName?: string;
32
42
  readonly promptParameters: Record<string, string>;
33
43
  };
44
+ /**
45
+ * Lifecycle status exposed by `list_timeouts`.
46
+ *
47
+ * @private type of UseTimeoutCommitmentDefinition
48
+ */
49
+ export type TimeoutToolListItemStatus = 'QUEUED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
50
+ /**
51
+ * One timeout row exposed by `list_timeouts`.
52
+ *
53
+ * @private type of UseTimeoutCommitmentDefinition
54
+ */
55
+ export type TimeoutToolListItem = {
56
+ timeoutId: string;
57
+ chatId: string;
58
+ status: TimeoutToolListItemStatus;
59
+ dueAt: string;
60
+ paused: boolean;
61
+ message?: string | null;
62
+ recurrenceIntervalMs?: number | null;
63
+ };
34
64
  /**
35
65
  * Result payload returned by `set_timeout`.
36
66
  *
@@ -55,18 +85,30 @@ export type CancelTimeoutToolResult = {
55
85
  dueAt?: string;
56
86
  message?: string;
57
87
  };
88
+ /**
89
+ * Result payload returned by `list_timeouts`.
90
+ *
91
+ * @private type of UseTimeoutCommitmentDefinition
92
+ */
93
+ export type ListTimeoutsToolResult = {
94
+ action: 'list';
95
+ status: 'listed' | 'disabled' | 'error';
96
+ items?: Array<TimeoutToolListItem>;
97
+ total?: number;
98
+ message?: string;
99
+ };
58
100
  /**
59
101
  * Union of all `USE TIMEOUT` tool actions.
60
102
  *
61
103
  * @private type of UseTimeoutCommitmentDefinition
62
104
  */
63
- export type TimeoutToolAction = SetTimeoutToolResult['action'] | CancelTimeoutToolResult['action'];
105
+ export type TimeoutToolAction = SetTimeoutToolResult['action'] | CancelTimeoutToolResult['action'] | ListTimeoutsToolResult['action'];
64
106
  /**
65
107
  * Union of all `USE TIMEOUT` tool results.
66
108
  *
67
109
  * @private type of UseTimeoutCommitmentDefinition
68
110
  */
69
- export type TimeoutToolResult = SetTimeoutToolResult | CancelTimeoutToolResult;
111
+ export type TimeoutToolResult = SetTimeoutToolResult | CancelTimeoutToolResult | ListTimeoutsToolResult;
70
112
  /**
71
113
  * Runtime adapter used by `USE TIMEOUT` tools.
72
114
  *
@@ -87,4 +129,11 @@ export type TimeoutToolRuntimeAdapter = {
87
129
  dueAt?: string;
88
130
  status: 'cancelled' | 'not_found';
89
131
  }>;
132
+ listTimeouts(args: {
133
+ includeFinished: boolean;
134
+ limit: number;
135
+ }, runtimeContext: TimeoutToolRuntimeContext): Promise<{
136
+ items: Array<TimeoutToolListItem>;
137
+ total: number;
138
+ }>;
90
139
  };
@@ -3,11 +3,11 @@ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentMo
3
3
  import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
4
4
  import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
5
  export { setTimeoutToolRuntimeAdapter } from './setTimeoutToolRuntimeAdapter';
6
- export type { CancelTimeoutToolResult, SetTimeoutToolResult, TimeoutToolRuntimeAdapter, TimeoutToolRuntimeContext, } from './TimeoutToolRuntimeAdapter';
6
+ export type { CancelTimeoutToolResult, ListTimeoutsToolResult, SetTimeoutToolResult, TimeoutToolListItem, TimeoutToolRuntimeAdapter, TimeoutToolRuntimeContext, } from './TimeoutToolRuntimeAdapter';
7
7
  /**
8
8
  * `USE TIMEOUT` commitment definition.
9
9
  *
10
- * The `USE TIMEOUT` commitment enables thread-scoped timers that wake the same chat later.
10
+ * The `USE TIMEOUT` commitment enables timeout wake-ups and scoped timeout management.
11
11
  *
12
12
  * @private [🪔] Maybe export the commitments through some package
13
13
  */
@@ -1,4 +1,4 @@
1
- import type { CancelTimeoutToolResult, SetTimeoutToolResult, TimeoutToolAction, TimeoutToolRuntimeAdapter, TimeoutToolRuntimeContext } from './TimeoutToolRuntimeAdapter';
1
+ import type { TimeoutToolAction, TimeoutToolResult, TimeoutToolRuntimeAdapter, TimeoutToolRuntimeContext } from './TimeoutToolRuntimeAdapter';
2
2
  /**
3
3
  * Return type of timeout adapter resolution helper.
4
4
  *
@@ -6,7 +6,7 @@ import type { CancelTimeoutToolResult, SetTimeoutToolResult, TimeoutToolAction,
6
6
  */
7
7
  type TimeoutToolRuntimeAdapterResolution = {
8
8
  adapter: TimeoutToolRuntimeAdapter | null;
9
- disabledResult: SetTimeoutToolResult | CancelTimeoutToolResult | null;
9
+ disabledResult: TimeoutToolResult | null;
10
10
  };
11
11
  /**
12
12
  * Resolves the runtime adapter for timeout tools or returns disabled payload when unavailable.
@@ -1,4 +1,4 @@
1
- import type { CancelTimeoutToolArgs, SetTimeoutToolArgs } from './TimeoutToolRuntimeAdapter';
1
+ import type { CancelTimeoutToolArgs, ListTimeoutsToolArgs, SetTimeoutToolArgs } from './TimeoutToolRuntimeAdapter';
2
2
  /**
3
3
  * Parsed arguments for `set_timeout`.
4
4
  *
@@ -16,6 +16,15 @@ type ParsedSetTimeoutToolArgs = {
16
16
  type ParsedCancelTimeoutToolArgs = {
17
17
  timeoutId: string;
18
18
  };
19
+ /**
20
+ * Parsed arguments for `list_timeouts`.
21
+ *
22
+ * @private type of UseTimeoutCommitmentDefinition
23
+ */
24
+ type ParsedListTimeoutsToolArgs = {
25
+ includeFinished: boolean;
26
+ limit: number;
27
+ };
19
28
  /**
20
29
  * Parses and validates `USE TIMEOUT` tool arguments.
21
30
  *
@@ -30,5 +39,9 @@ export declare const parseTimeoutToolArgs: {
30
39
  * Parses `cancel_timeout` input.
31
40
  */
32
41
  cancel(args: CancelTimeoutToolArgs): ParsedCancelTimeoutToolArgs;
42
+ /**
43
+ * Parses `list_timeouts` input.
44
+ */
45
+ list(args: ListTimeoutsToolArgs): ParsedListTimeoutsToolArgs;
33
46
  };
34
47
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { PartialDeep, Promisable } from 'type-fest';
2
- import type { TODO_any } from '../../utils/organization/TODO_any';
3
2
  import type { LlmCall } from '../../types/LlmCall';
3
+ import type { TODO_any } from '../../utils/organization/TODO_any';
4
4
  import type { PipelineExecutorResult } from '../PipelineExecutorResult';
5
5
  import type { ExecuteAttemptsOptions } from './40-executeAttempts';
6
6
  /**
@@ -3,7 +3,7 @@ import type { number_usd } from '../../types/typeAliases';
3
3
  /**
4
4
  * List of available Anthropic Claude models with pricing
5
5
  *
6
- * Note: Synced with official API docs at 2025-11-19
6
+ * Note: Synced with official API docs at 2026-03-22
7
7
  *
8
8
  * @see https://docs.anthropic.com/en/docs/models-overview
9
9
  * @public exported from `@promptbook/anthropic-claude`
@@ -3,7 +3,7 @@ import type { number_usd } from '../../types/typeAliases';
3
3
  /**
4
4
  * List of available Deepseek models with descriptions
5
5
  *
6
- * Note: Synced with official API docs at 2025-08-20
6
+ * Note: Synced with official API docs at 2026-03-22
7
7
  *
8
8
  * @see https://www.deepseek.com/models
9
9
  * @public exported from `@promptbook/deepseek`
@@ -3,7 +3,7 @@ import type { number_usd } from '../../types/typeAliases';
3
3
  /**
4
4
  * List of available Google models with descriptions
5
5
  *
6
- * Note: Synced with official API docs at 2025-11-19
6
+ * Note: Synced with official API docs at 2026-03-22
7
7
  *
8
8
  * @see https://ai.google.dev/models/gemini
9
9
  * @public exported from `@promptbook/google`
@@ -2,7 +2,7 @@ import type { AvailableModel } from '../../execution/AvailableModel';
2
2
  /**
3
3
  * List of available OpenAI models with pricing
4
4
  *
5
- * Note: Synced with official API docs at 2025-11-19
5
+ * Note: Synced with official API docs at 2026-03-22
6
6
  *
7
7
  * @see https://platform.openai.com/docs/models/
8
8
  * @see https://openai.com/api/pricing/
@@ -3,8 +3,7 @@ import type { KnowledgePiecePreparedJson } from '../../pipeline/PipelineJson/Kno
3
3
  import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
4
4
  import type { Converter } from '../_common/Converter';
5
5
  import type { ScraperAndConverterMetadata } from '../_common/register/ScraperAndConverterMetadata';
6
- import type { Scraper } from '../_common/Scraper';
7
- import type { ScraperSourceHandler } from '../_common/Scraper';
6
+ import type { Scraper, ScraperSourceHandler } from '../_common/Scraper';
8
7
  import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
9
8
  /**
10
9
  * Scraper of @@ files
@@ -3,8 +3,7 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';
3
3
  import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
4
4
  import type { Converter } from '../_common/Converter';
5
5
  import type { ScraperAndConverterMetadata } from '../_common/register/ScraperAndConverterMetadata';
6
- import type { Scraper } from '../_common/Scraper';
7
- import type { ScraperSourceHandler } from '../_common/Scraper';
6
+ import type { Scraper, ScraperSourceHandler } from '../_common/Scraper';
8
7
  import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
9
8
  /**
10
9
  * Scraper of .docx and .odt files
@@ -3,8 +3,7 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';
3
3
  import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
4
4
  import type { Converter } from '../_common/Converter';
5
5
  import type { ScraperAndConverterMetadata } from '../_common/register/ScraperAndConverterMetadata';
6
- import type { Scraper } from '../_common/Scraper';
7
- import type { ScraperSourceHandler } from '../_common/Scraper';
6
+ import type { Scraper, ScraperSourceHandler } from '../_common/Scraper';
8
7
  import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
9
8
  /**
10
9
  * Scraper for old document files (like .doc and .rtf)
@@ -1,4 +1,4 @@
1
- import spaceTrim from 'spacetrim';
1
+ import { spaceTrim } from 'spacetrim';
2
2
  import { extractBlock } from '../../postprocessing/utils/extractBlock';
3
3
  import { prettifyMarkdown } from '../../utils/markdown/prettifyMarkdown';
4
4
  import { trimCodeBlock } from '../../utils/markdown/trimCodeBlock';
@@ -1,5 +1,4 @@
1
- import type { string_parameter_name } from '../../types/typeAliases';
2
- import type { string_parameter_value } from '../../types/typeAliases';
1
+ import type { string_parameter_name, string_parameter_value } from '../../types/typeAliases';
3
2
  /**
4
3
  * Options for mapping available parameters to expected parameters in a pipeline task.
5
4
  */
@@ -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.112.0-11`).
18
+ * It follows semantic versioning (e.g., `0.112.0-14`).
19
19
  *
20
20
  * @generated
21
21
  */