@promptbook/types 0.114.0-13 → 0.114.0-18

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/src/book-3.0/AgentMessageRunReport.d.ts +18 -0
  2. package/esm/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +38 -5
  3. package/esm/src/book-3.0/describeAgentPlannedMessageSchedule.d.ts +31 -0
  4. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +1 -9
  5. package/esm/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.d.ts +28 -0
  6. package/esm/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.test.d.ts +1 -0
  7. package/esm/src/book-components/Chat/Chat/renderAgentProjectDiff.d.ts +13 -0
  8. package/esm/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.d.ts +16 -0
  9. package/esm/src/book-components/Chat/utils/agentProjectToolCall.d.ts +39 -0
  10. package/esm/src/book-components/Chat/utils/agentProjectToolCall.test.d.ts +1 -0
  11. package/esm/src/book-components/Chat/utils/externalSourceToolCall.d.ts +38 -0
  12. package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +6 -0
  13. package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
  14. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
  15. package/esm/src/utils/agent-message-runtime/AgentMessageProjectChange.d.ts +76 -0
  16. package/esm/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.d.ts +45 -0
  17. package/esm/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.d.ts +3 -0
  18. package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.d.ts +18 -0
  19. package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.test.d.ts +1 -0
  20. package/esm/src/utils/random/$generateBookBoilerplate.test.d.ts +1 -0
  21. package/esm/src/version.d.ts +1 -1
  22. package/package.json +2 -2
  23. package/umd/src/book-3.0/AgentMessageRunReport.d.ts +18 -0
  24. package/umd/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +38 -5
  25. package/umd/src/book-3.0/describeAgentPlannedMessageSchedule.d.ts +31 -0
  26. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +1 -9
  27. package/umd/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.d.ts +28 -0
  28. package/umd/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.test.d.ts +1 -0
  29. package/umd/src/book-components/Chat/Chat/renderAgentProjectDiff.d.ts +13 -0
  30. package/umd/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.d.ts +16 -0
  31. package/umd/src/book-components/Chat/utils/agentProjectToolCall.d.ts +39 -0
  32. package/umd/src/book-components/Chat/utils/agentProjectToolCall.test.d.ts +1 -0
  33. package/umd/src/book-components/Chat/utils/externalSourceToolCall.d.ts +38 -0
  34. package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +6 -0
  35. package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
  36. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
  37. package/umd/src/utils/agent-message-runtime/AgentMessageProjectChange.d.ts +76 -0
  38. package/umd/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.d.ts +45 -0
  39. package/umd/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.d.ts +3 -0
  40. package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.d.ts +18 -0
  41. package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.test.d.ts +1 -0
  42. package/umd/src/utils/random/$generateBookBoilerplate.test.d.ts +1 -0
  43. package/umd/src/version.d.ts +1 -1
@@ -1,4 +1,6 @@
1
1
  import type { Usage } from '../execution/Usage';
2
+ import type { AgentMessageProjectChange } from '../utils/agent-message-runtime/AgentMessageProjectChange';
3
+ import type { AgentMessageTouchedExternalSource } from '../utils/agent-message-runtime/AgentMessageTouchedExternalSource';
2
4
  import type { CodexLoginMethod } from './codexLoginMethod';
3
5
  /**
4
6
  * File suffix appended to one answered message book to store its run report sidecar.
@@ -72,6 +74,22 @@ export type AgentMessageRunReport = {
72
74
  * answered, so this is the only trace of the projects one answer viewed or edited.
73
75
  */
74
76
  readonly touchedProjectNames?: ReadonlyArray<string>;
77
+ /**
78
+ * Sources outside the agent — integrations, websites and web searches — the harness reached
79
+ * while answering the message.
80
+ *
81
+ * Reported from the same live runtime log as `touchedProjectNames`, so this is the only trace
82
+ * of what one answer touched beyond the agent itself.
83
+ */
84
+ readonly touchedExternalSources?: ReadonlyArray<AgentMessageTouchedExternalSource>;
85
+ /**
86
+ * Changes the harness made to the agent projects while answering the message.
87
+ *
88
+ * Every agent project is a git repository and the runner commits each answer into it, so one
89
+ * entry describes exactly what one message did to one project — including the diff of the
90
+ * commit it created.
91
+ */
92
+ readonly projectChanges?: ReadonlyArray<AgentMessageProjectChange>;
75
93
  };
76
94
  /**
77
95
  * Builds the run-report sidecar path for one message book path.
@@ -9,7 +9,7 @@ export declare const AGENT_PLANNED_MESSAGES_DIRECTORY_PATH: string;
9
9
  *
10
10
  * @private internal convention shared by the Agents Server and agent-folder runner
11
11
  */
12
- export declare const AGENT_PLANNED_MESSAGE_COMMAND_ACTIONS: readonly ["set", "cancel"];
12
+ export declare const AGENT_PLANNED_MESSAGE_COMMAND_ACTIONS: readonly ["set", "update", "cancel"];
13
13
  /**
14
14
  * One planned-message command action.
15
15
  *
@@ -19,8 +19,9 @@ export type AgentPlannedMessageCommandAction = (typeof AGENT_PLANNED_MESSAGE_COM
19
19
  /**
20
20
  * One planned message that is already waiting to wake the agent.
21
21
  *
22
- * A planned message repeats like `setInterval`, so `intervalMs` is what the agent compares with its
23
- * goal, while `dueAt` only says when the nearest repetition happens.
22
+ * A planned message can repeat like `setInterval`, run a bounded number of times, or wake the agent
23
+ * only once, so the whole schedule is what the agent compares with its goal, while `dueAt` only says
24
+ * when the nearest wake-up happens.
24
25
  *
25
26
  * @private internal convention shared by the Agents Server and agent-folder runner
26
27
  */
@@ -29,9 +30,34 @@ export type AgentPlannedMessageSnapshot = {
29
30
  readonly dueAt: string;
30
31
  readonly message: string | null;
31
32
  /**
32
- * Repeat interval in milliseconds, or `null` for a planned message that wakes the agent only once.
33
+ * Repeat interval in milliseconds, or `null` for a planned message that does not repeat at a fixed
34
+ * interval.
33
35
  */
34
36
  readonly intervalMs: number | null;
37
+ /**
38
+ * Five-field cron expression driving the repetitions, or `null` when the planned message does not
39
+ * follow a cron.
40
+ */
41
+ readonly cronExpression: string | null;
42
+ /**
43
+ * Moment before which the planned message never wakes the agent, or `null` when it has no starting
44
+ * date.
45
+ */
46
+ readonly startsAt: string | null;
47
+ /**
48
+ * Moment after which the planned message never wakes the agent again, or `null` when it has no
49
+ * ending date.
50
+ */
51
+ readonly endsAt: string | null;
52
+ /**
53
+ * Total number of wake-ups the planned message performs, or `null` when it repeats until it is
54
+ * cancelled.
55
+ */
56
+ readonly maxRunCount: number | null;
57
+ /**
58
+ * Number of times the planned message already woke the agent.
59
+ */
60
+ readonly runCount: number;
35
61
  };
36
62
  /**
37
63
  * One command written by the coding harness into its planned-message sidecar.
@@ -39,13 +65,20 @@ export type AgentPlannedMessageSnapshot = {
39
65
  * The payload stays untyped on purpose: it is untrusted harness output and is validated by the very
40
66
  * same shared planned-message actions that back the model tools and the internal runtime API.
41
67
  *
42
- * For a `set` command, `milliseconds` is the repeat interval of the planned message, not a one-shot delay.
68
+ * For a `set` command, `milliseconds` is the repeat interval of the planned message, not a one-shot
69
+ * delay, and `cronExpression`, `startsAt`, `endsAt`, and `maxRunCount` bound how it repeats. An
70
+ * `update` command changes the very same fields of the planned message named by `timeoutId`, where a
71
+ * field that is left out stays as it is and an explicit `null` removes the bound.
43
72
  *
44
73
  * @private internal convention shared by the Agents Server and agent-folder runner
45
74
  */
46
75
  export type AgentPlannedMessageCommand = {
47
76
  readonly action: AgentPlannedMessageCommandAction;
48
77
  readonly milliseconds?: unknown;
78
+ readonly cronExpression?: unknown;
79
+ readonly startsAt?: unknown;
80
+ readonly endsAt?: unknown;
81
+ readonly maxRunCount?: unknown;
49
82
  readonly message?: unknown;
50
83
  readonly timeoutId?: unknown;
51
84
  };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Schedule of one planned message as it is described to an agent.
3
+ *
4
+ * The fields match `AgentPlannedMessageSnapshot`, so one snapshot, one scheduling result, and one
5
+ * stored planned message are all described by the very same sentence.
6
+ *
7
+ * @private internal convention shared by the Agents Server and agent-folder runner
8
+ */
9
+ export type AgentPlannedMessageScheduleDescription = {
10
+ readonly intervalMs?: number | null;
11
+ readonly cronExpression?: string | null;
12
+ readonly startsAt?: string | null;
13
+ readonly endsAt?: string | null;
14
+ readonly maxRunCount?: number | null;
15
+ readonly runCount?: number | null;
16
+ readonly dueAt?: string | null;
17
+ };
18
+ /**
19
+ * Describes one planned-message schedule in a single sentence fragment.
20
+ *
21
+ * A planned message can repeat forever, repeat a bounded number of times, run inside a date window, or
22
+ * wake the agent only once. Every surface showing a planned message — the wake-up itself, the goal-chat
23
+ * notes, the planned-message prompt section, and the model tools — describes it with this one helper,
24
+ * so an agent never has to reconcile two different wordings of the same plan.
25
+ *
26
+ * @param schedule - Schedule of the planned message.
27
+ * @returns Fragment such as `repeats every 5 minutes (2 of 10 runs done)`.
28
+ *
29
+ * @private internal utility of the Agents Server planned messages
30
+ */
31
+ export declare function describeAgentPlannedMessageSchedule(schedule: AgentPlannedMessageScheduleDescription): string;
@@ -1,9 +1 @@
1
- /**
2
- * Browser-compatible stub for `createDeprecatedCommitmentDiagnostics`.
3
- *
4
- * In the browser build the full Node.js implementation is not available,
5
- * so this stub always returns an empty array to keep the editor functional.
6
- *
7
- * @private internal utility of `BookEditorMonaco`
8
- */
9
- export declare function createDeprecatedCommitmentDiagnostics(_agentSource?: string): [];
1
+ export { createDeprecatedCommitmentDiagnostics } from './createDeprecatedCommitmentDiagnostics';
@@ -0,0 +1,28 @@
1
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
2
+ /**
3
+ * Monaco diagnostic shown when a Book source declares its parent agent more than once.
4
+ *
5
+ * @private internal type of `BookEditorMonaco`
6
+ */
7
+ type DuplicateFromCommitmentDiagnostic = {
8
+ readonly startLineNumber: number;
9
+ readonly startColumn: number;
10
+ readonly endLineNumber: number;
11
+ readonly endColumn: number;
12
+ readonly message: string;
13
+ readonly source: string;
14
+ readonly severity: 'warning';
15
+ };
16
+ /**
17
+ * Creates Book editor diagnostics for a parent agent declared by more than one `FROM` commitment.
18
+ *
19
+ * Repeating `FROM` stays valid — the last one wins and overrides every earlier one — but an author who writes it
20
+ * twice usually means only one of them, so every `FROM` keyword is marked to show which one actually applies.
21
+ *
22
+ * @param agentSource - Current editor content.
23
+ * @returns Warning markers for every `FROM` keyword, empty when the book declares at most one parent.
24
+ *
25
+ * @private internal utility of `BookEditorMonaco`
26
+ */
27
+ export declare function createDuplicateFromCommitmentDiagnostics(agentSource?: string_book): ReadonlyArray<DuplicateFromCommitmentDiagnostic>;
28
+ export {};
@@ -0,0 +1,13 @@
1
+ import { type ReactElement } from 'react';
2
+ /**
3
+ * Renders one unified diff with added, removed and context lines told apart.
4
+ *
5
+ * @param options - Diff text and whether it holds only the beginning of the real diff.
6
+ * @returns Readable diff block.
7
+ *
8
+ * @private function of ChatToolCallModal
9
+ */
10
+ export declare function renderAgentProjectDiff(options: {
11
+ readonly diff: string;
12
+ readonly isDiffTruncated: boolean;
13
+ }): ReactElement;
@@ -0,0 +1,16 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { AgentProjectToolCallResult } from '../utils/agentProjectToolCall';
3
+ /**
4
+ * Renders the detail view of one project the answer worked with.
5
+ *
6
+ * The card answers the two questions a project chip raises: what this project is right now — its
7
+ * runtime state and where to open it — and what this very message did to it.
8
+ *
9
+ * @param options - Parsed project chip payload.
10
+ * @returns Project details section for the tool modal.
11
+ *
12
+ * @private function of ChatToolCallModal
13
+ */
14
+ export declare function renderAgentProjectToolCallDetails(options: {
15
+ readonly project: AgentProjectToolCallResult;
16
+ }): ReactElement;
@@ -1,3 +1,4 @@
1
+ import type { AgentMessageProjectChange } from '../../../utils/agent-message-runtime/AgentMessageProjectChange';
1
2
  /**
2
3
  * Synthetic tool name used for agent-project chips in chat UI.
3
4
  *
@@ -10,6 +11,9 @@ export declare const AGENT_PROJECT_TOOL_CALL_NAME = "agent_project_touched";
10
11
  /**
11
12
  * Safe, user-facing metadata shown in agent-project chips.
12
13
  *
14
+ * Everything besides the project name is optional, because a chip written by an older server — or
15
+ * one whose project has meanwhile been deleted — still has to render.
16
+ *
13
17
  * @private internal chat-ui type for touched agent projects
14
18
  */
15
19
  export type AgentProjectToolCallResult = {
@@ -21,10 +25,45 @@ export type AgentProjectToolCallResult = {
21
25
  * Human-readable project name shown in the chip.
22
26
  */
23
27
  readonly displayName?: string;
28
+ /**
29
+ * Short project description, resolved the same way as on the project page.
30
+ */
31
+ readonly description?: string;
24
32
  /**
25
33
  * Link to the project page, when the chat knows where the project lives.
26
34
  */
27
35
  readonly projectHref?: string;
36
+ /**
37
+ * Address the running project itself is served on, when it has one.
38
+ */
39
+ readonly projectUrl?: string;
40
+ /**
41
+ * Whether the project was running when the answer finished.
42
+ */
43
+ readonly isRunning?: boolean;
44
+ /**
45
+ * Runtime status label, the same one the project page shows.
46
+ */
47
+ readonly runtimeStatusLabel?: string;
48
+ /**
49
+ * Total size of the project, already formatted for display.
50
+ */
51
+ readonly sizeLabel?: string;
52
+ /**
53
+ * Count of files inside the project.
54
+ */
55
+ readonly fileCount?: number;
56
+ /**
57
+ * Whether the project folder is a git repository.
58
+ */
59
+ readonly isGitRepository?: boolean;
60
+ /**
61
+ * What this very message changed in the project, when it changed anything.
62
+ *
63
+ * Its `projectName` repeats the one above because the change is reported by the agent runner
64
+ * in exactly this shape, and reusing it keeps the two descriptions from drifting apart.
65
+ */
66
+ readonly change?: AgentMessageProjectChange;
28
67
  };
29
68
  /**
30
69
  * Parses the project-chip payload from one tool result.
@@ -0,0 +1,38 @@
1
+ import type { AgentMessageTouchedExternalSource } from '../../../utils/agent-message-runtime/AgentMessageTouchedExternalSource';
2
+ /**
3
+ * Synthetic tool name used for external-source chips in chat UI.
4
+ *
5
+ * The Agents Server emits one such tool call per source outside the agent an answer viewed or
6
+ * edited, so the chat shows which services, websites and searches the agent really reached below
7
+ * the message that touched them. Work the agent does inside itself emits nothing.
8
+ *
9
+ * @private internal chat-ui marker for touched external sources
10
+ */
11
+ export declare const EXTERNAL_SOURCE_TOOL_CALL_NAME = "external_source_touched";
12
+ /**
13
+ * Parses the external-source chip payload from one tool result.
14
+ *
15
+ * @param result - Raw tool result payload.
16
+ * @returns Parsed source metadata, or `null` when the result describes no external source.
17
+ *
18
+ * @private internal helper reused by chip and modal rendering
19
+ */
20
+ export declare function parseExternalSourceToolCallResult(result: unknown): AgentMessageTouchedExternalSource | null;
21
+ /**
22
+ * Resolves the chip label of one touched external source.
23
+ *
24
+ * @param externalSource - Parsed source metadata.
25
+ * @returns User-facing name of the source.
26
+ *
27
+ * @private internal helper reused by chip and modal rendering
28
+ */
29
+ export declare function resolveExternalSourceToolCallLabel(externalSource: AgentMessageTouchedExternalSource): string;
30
+ /**
31
+ * Resolves the chip emoji of one touched external source.
32
+ *
33
+ * @param externalSource - Parsed source metadata.
34
+ * @returns Emoji telling apart an integration, a website and a search.
35
+ *
36
+ * @private internal helper reused by chip and modal rendering
37
+ */
38
+ export declare function resolveExternalSourceToolCallEmoji(externalSource: AgentMessageTouchedExternalSource): string;
@@ -5,6 +5,12 @@ import type { TODO_any } from '../../../utils/organization/TODO_any';
5
5
  * @private internal timeout-chat constant
6
6
  */
7
7
  export declare const SET_TIMEOUT_TOOL_CALL_NAME = "set_timeout";
8
+ /**
9
+ * Tool name of one re-planned wake-up, used by every producer of timeout chips.
10
+ *
11
+ * @private internal timeout-chat constant
12
+ */
13
+ export declare const UPDATE_TIMEOUT_TOOL_CALL_NAME = "update_timeout";
8
14
  /**
9
15
  * Tool name of one cancelled wake-up, used by every producer of timeout chips.
10
16
  *
@@ -12,3 +12,15 @@ export declare const DEFAULT_WAIT_AFTER_ERROR_MS: number;
12
12
  * @private internal utility of `ptbk coder` wait handling
13
13
  */
14
14
  export declare function parseOptionalWaitDuration(value: string | undefined, defaultMs: number): number;
15
+ /**
16
+ * Parses an optional Commander period duration string and returns the resolved milliseconds.
17
+ *
18
+ * Returns `undefined` when the flag was not provided or was provided without a non-empty value,
19
+ * which means the command runs only once instead of repeating itself.
20
+ *
21
+ * @throws {NotAllowed} When the duration is not a positive one, because a non-positive period
22
+ * would repeat the command without ever pausing between two rounds
23
+ *
24
+ * @private internal utility of `ptbk coder` wait handling
25
+ */
26
+ export declare function parseOptionalPeriodDuration(optionName: string, value: string | undefined): number | undefined;
@@ -84,8 +84,23 @@ export declare class AgentCollectionInSupabase {
84
84
  private mapAgentBasicInformationRow;
85
85
  /**
86
86
  * Retrieves the permanent ID of an agent by its name or permanent ID.
87
+ *
88
+ * An agent that still exists always wins over a soft-deleted one, so a name that was deleted and
89
+ * later created again resolves to the agent that is live now instead of to the recycle-bin leftover.
90
+ * Soft-deleted agents stay resolvable as a fallback because the recycle bin restores them by name
91
+ * or permanent id.
87
92
  */
88
93
  getAgentPermanentId(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<string_agent_permanent_id>;
94
+ /**
95
+ * Looks up the permanent id of the oldest agent matching one name or permanent id.
96
+ *
97
+ * @param agentNameOrPermanentId - Agent name or stable permanent identifier to match.
98
+ * @param options - Whether soft-deleted agents may be matched as well.
99
+ * @returns Permanent id of the matched agent, or `null` when nothing matches.
100
+ *
101
+ * @private internal helper of `AgentCollectionInSupabase`
102
+ */
103
+ private findAgentPermanentId;
89
104
  /**
90
105
  * Retrieves the source code of an agent by its name or permanent ID.
91
106
  */
@@ -0,0 +1,76 @@
1
+ /**
2
+ * One file an answered agent message created, edited or deleted inside one project.
3
+ *
4
+ * Note: [🚉] This is fully serializable as JSON
5
+ *
6
+ * @private internal type of the agent-message runtime
7
+ */
8
+ export type AgentMessageProjectChangedFile = {
9
+ /**
10
+ * Path of the file relative to the project root, using `/` separators.
11
+ */
12
+ readonly path: string;
13
+ /**
14
+ * Count of lines added to the file.
15
+ */
16
+ readonly insertionCount: number;
17
+ /**
18
+ * Count of lines removed from the file.
19
+ */
20
+ readonly deletionCount: number;
21
+ };
22
+ /**
23
+ * Everything answering one single message changed inside one agent project.
24
+ *
25
+ * Each agent project is a git repository and every answer which modifies it is committed there
26
+ * automatically, so this describes exactly one such commit — the trace of what one message really
27
+ * did to one project, which a chat can show below the answer that did it.
28
+ *
29
+ * Note: [🚉] This is fully serializable as JSON
30
+ *
31
+ * @private internal type of the agent-message runtime
32
+ */
33
+ export type AgentMessageProjectChange = {
34
+ /**
35
+ * Directory name of the changed project inside the agent `projects/` folder.
36
+ */
37
+ readonly projectName: string;
38
+ /**
39
+ * Full hash of the commit holding the changes of this message.
40
+ */
41
+ readonly commitHash: string;
42
+ /**
43
+ * ISO 8601 timestamp when the changes were committed.
44
+ */
45
+ readonly committedAt: string;
46
+ /**
47
+ * Files the message changed, ordered as git reports them.
48
+ */
49
+ readonly changedFiles: ReadonlyArray<AgentMessageProjectChangedFile>;
50
+ /**
51
+ * Count of lines added across all changed files.
52
+ */
53
+ readonly insertionCount: number;
54
+ /**
55
+ * Count of lines removed across all changed files.
56
+ */
57
+ readonly deletionCount: number;
58
+ /**
59
+ * Unified diff of the commit, shortened when the change is too large to carry into a chat.
60
+ */
61
+ readonly diff: string;
62
+ /**
63
+ * Whether `diff` holds only the beginning of the real diff.
64
+ */
65
+ readonly isDiffTruncated: boolean;
66
+ };
67
+ /**
68
+ * Validates one already-parsed JSON value as a project change.
69
+ *
70
+ * @param value - Raw serialized project change.
71
+ * @returns The typed project change, or `null` when the value does not match the expected shape,
72
+ * so consumers can silently skip foreign or malformed entries.
73
+ *
74
+ * @private internal utility of the agent-message runtime
75
+ */
76
+ export declare function normalizeAgentMessageProjectChange(value: unknown): AgentMessageProjectChange | null;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Category of one external source an answered agent message touched.
3
+ *
4
+ * - `integration` is a third-party service reached through an integration, for example Gmail.
5
+ * - `website` is a concrete web address the agent fetched or browsed.
6
+ * - `search` is a lookup the agent ran against a web search engine.
7
+ *
8
+ * @private internal type of the agent-message runtime
9
+ */
10
+ export type AgentMessageTouchedExternalSourceKind = 'integration' | 'website' | 'search';
11
+ /**
12
+ * One source outside the agent itself which answering a single message viewed or edited.
13
+ *
14
+ * Everything the agent does inside its own folder stays internal and is never described here;
15
+ * this records only the reach beyond it, so a chat can tell which outside services and websites
16
+ * one answer really involved.
17
+ *
18
+ * Note: [🚉] This is fully serializable as JSON
19
+ *
20
+ * @private internal type of the agent-message runtime
21
+ */
22
+ export type AgentMessageTouchedExternalSource = {
23
+ /**
24
+ * Category of the touched source.
25
+ */
26
+ readonly kind: AgentMessageTouchedExternalSourceKind;
27
+ /**
28
+ * User-facing name of the source, for example `Gmail`, `example.com` or the search query.
29
+ */
30
+ readonly name: string;
31
+ /**
32
+ * Address of the source, when the touch names a concrete one.
33
+ */
34
+ readonly url?: string;
35
+ };
36
+ /**
37
+ * Validates one already-parsed JSON value as a touched external source.
38
+ *
39
+ * @param value - Raw serialized source.
40
+ * @returns The typed source, or `null` when the value does not match the expected shape, so
41
+ * consumers can silently skip foreign or malformed entries.
42
+ *
43
+ * @private internal utility of the agent-message runtime
44
+ */
45
+ export declare function normalizeAgentMessageTouchedExternalSource(value: unknown): AgentMessageTouchedExternalSource | null;
@@ -42,6 +42,9 @@ export type AgentMessageRuntimeLogEvent = {
42
42
  readonly command?: string;
43
43
  readonly exit_code?: number | null;
44
44
  readonly changes?: ReadonlyArray<AgentMessageRuntimeLogFileChange>;
45
+ readonly server?: string;
46
+ readonly tool?: string;
47
+ readonly query?: string;
45
48
  };
46
49
  };
47
50
  /**
@@ -0,0 +1,18 @@
1
+ import type { AgentMessageTouchedExternalSource } from './AgentMessageTouchedExternalSource';
2
+ /**
3
+ * Resolves which sources outside the agent one coding harness touched while answering a single message.
4
+ *
5
+ * The runtime log streams what the harness really did, so a source counts as touched when the
6
+ * harness reached it in a tool invocation — calling an integration, fetching a web address,
7
+ * searching the web, or running a network client in the shell. Only tool payloads are inspected:
8
+ * tool results and assistant narration are ignored so a service merely mentioned in the
9
+ * conversation is never reported, and addresses of the machine the agent runs on are dropped
10
+ * because they are internal.
11
+ *
12
+ * @param options - Raw runtime log content of one answered message.
13
+ * @returns Touched external sources without duplicates, ordered by first appearance.
14
+ * @private internal utility of the agent-message runtime
15
+ */
16
+ export declare function resolveAgentMessageTouchedExternalSources(options: {
17
+ readonly logText: string | null | undefined;
18
+ }): ReadonlyArray<AgentMessageTouchedExternalSource>;
@@ -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.114.0-12`).
18
+ * It follows semantic versioning (e.g., `0.114.0-17`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.114.0-13",
3
+ "version": "0.114.0-18",
4
4
  "description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -96,6 +96,6 @@
96
96
  "types": "./esm/src/_packages/types.index.d.ts",
97
97
  "typings": "./esm/src/_packages/types.index.d.ts",
98
98
  "peerDependencies": {
99
- "@promptbook/core": "0.114.0-13"
99
+ "@promptbook/core": "0.114.0-18"
100
100
  }
101
101
  }
@@ -1,4 +1,6 @@
1
1
  import type { Usage } from '../execution/Usage';
2
+ import type { AgentMessageProjectChange } from '../utils/agent-message-runtime/AgentMessageProjectChange';
3
+ import type { AgentMessageTouchedExternalSource } from '../utils/agent-message-runtime/AgentMessageTouchedExternalSource';
2
4
  import type { CodexLoginMethod } from './codexLoginMethod';
3
5
  /**
4
6
  * File suffix appended to one answered message book to store its run report sidecar.
@@ -72,6 +74,22 @@ export type AgentMessageRunReport = {
72
74
  * answered, so this is the only trace of the projects one answer viewed or edited.
73
75
  */
74
76
  readonly touchedProjectNames?: ReadonlyArray<string>;
77
+ /**
78
+ * Sources outside the agent — integrations, websites and web searches — the harness reached
79
+ * while answering the message.
80
+ *
81
+ * Reported from the same live runtime log as `touchedProjectNames`, so this is the only trace
82
+ * of what one answer touched beyond the agent itself.
83
+ */
84
+ readonly touchedExternalSources?: ReadonlyArray<AgentMessageTouchedExternalSource>;
85
+ /**
86
+ * Changes the harness made to the agent projects while answering the message.
87
+ *
88
+ * Every agent project is a git repository and the runner commits each answer into it, so one
89
+ * entry describes exactly what one message did to one project — including the diff of the
90
+ * commit it created.
91
+ */
92
+ readonly projectChanges?: ReadonlyArray<AgentMessageProjectChange>;
75
93
  };
76
94
  /**
77
95
  * Builds the run-report sidecar path for one message book path.
@@ -9,7 +9,7 @@ export declare const AGENT_PLANNED_MESSAGES_DIRECTORY_PATH: string;
9
9
  *
10
10
  * @private internal convention shared by the Agents Server and agent-folder runner
11
11
  */
12
- export declare const AGENT_PLANNED_MESSAGE_COMMAND_ACTIONS: readonly ["set", "cancel"];
12
+ export declare const AGENT_PLANNED_MESSAGE_COMMAND_ACTIONS: readonly ["set", "update", "cancel"];
13
13
  /**
14
14
  * One planned-message command action.
15
15
  *
@@ -19,8 +19,9 @@ export type AgentPlannedMessageCommandAction = (typeof AGENT_PLANNED_MESSAGE_COM
19
19
  /**
20
20
  * One planned message that is already waiting to wake the agent.
21
21
  *
22
- * A planned message repeats like `setInterval`, so `intervalMs` is what the agent compares with its
23
- * goal, while `dueAt` only says when the nearest repetition happens.
22
+ * A planned message can repeat like `setInterval`, run a bounded number of times, or wake the agent
23
+ * only once, so the whole schedule is what the agent compares with its goal, while `dueAt` only says
24
+ * when the nearest wake-up happens.
24
25
  *
25
26
  * @private internal convention shared by the Agents Server and agent-folder runner
26
27
  */
@@ -29,9 +30,34 @@ export type AgentPlannedMessageSnapshot = {
29
30
  readonly dueAt: string;
30
31
  readonly message: string | null;
31
32
  /**
32
- * Repeat interval in milliseconds, or `null` for a planned message that wakes the agent only once.
33
+ * Repeat interval in milliseconds, or `null` for a planned message that does not repeat at a fixed
34
+ * interval.
33
35
  */
34
36
  readonly intervalMs: number | null;
37
+ /**
38
+ * Five-field cron expression driving the repetitions, or `null` when the planned message does not
39
+ * follow a cron.
40
+ */
41
+ readonly cronExpression: string | null;
42
+ /**
43
+ * Moment before which the planned message never wakes the agent, or `null` when it has no starting
44
+ * date.
45
+ */
46
+ readonly startsAt: string | null;
47
+ /**
48
+ * Moment after which the planned message never wakes the agent again, or `null` when it has no
49
+ * ending date.
50
+ */
51
+ readonly endsAt: string | null;
52
+ /**
53
+ * Total number of wake-ups the planned message performs, or `null` when it repeats until it is
54
+ * cancelled.
55
+ */
56
+ readonly maxRunCount: number | null;
57
+ /**
58
+ * Number of times the planned message already woke the agent.
59
+ */
60
+ readonly runCount: number;
35
61
  };
36
62
  /**
37
63
  * One command written by the coding harness into its planned-message sidecar.
@@ -39,13 +65,20 @@ export type AgentPlannedMessageSnapshot = {
39
65
  * The payload stays untyped on purpose: it is untrusted harness output and is validated by the very
40
66
  * same shared planned-message actions that back the model tools and the internal runtime API.
41
67
  *
42
- * For a `set` command, `milliseconds` is the repeat interval of the planned message, not a one-shot delay.
68
+ * For a `set` command, `milliseconds` is the repeat interval of the planned message, not a one-shot
69
+ * delay, and `cronExpression`, `startsAt`, `endsAt`, and `maxRunCount` bound how it repeats. An
70
+ * `update` command changes the very same fields of the planned message named by `timeoutId`, where a
71
+ * field that is left out stays as it is and an explicit `null` removes the bound.
43
72
  *
44
73
  * @private internal convention shared by the Agents Server and agent-folder runner
45
74
  */
46
75
  export type AgentPlannedMessageCommand = {
47
76
  readonly action: AgentPlannedMessageCommandAction;
48
77
  readonly milliseconds?: unknown;
78
+ readonly cronExpression?: unknown;
79
+ readonly startsAt?: unknown;
80
+ readonly endsAt?: unknown;
81
+ readonly maxRunCount?: unknown;
49
82
  readonly message?: unknown;
50
83
  readonly timeoutId?: unknown;
51
84
  };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Schedule of one planned message as it is described to an agent.
3
+ *
4
+ * The fields match `AgentPlannedMessageSnapshot`, so one snapshot, one scheduling result, and one
5
+ * stored planned message are all described by the very same sentence.
6
+ *
7
+ * @private internal convention shared by the Agents Server and agent-folder runner
8
+ */
9
+ export type AgentPlannedMessageScheduleDescription = {
10
+ readonly intervalMs?: number | null;
11
+ readonly cronExpression?: string | null;
12
+ readonly startsAt?: string | null;
13
+ readonly endsAt?: string | null;
14
+ readonly maxRunCount?: number | null;
15
+ readonly runCount?: number | null;
16
+ readonly dueAt?: string | null;
17
+ };
18
+ /**
19
+ * Describes one planned-message schedule in a single sentence fragment.
20
+ *
21
+ * A planned message can repeat forever, repeat a bounded number of times, run inside a date window, or
22
+ * wake the agent only once. Every surface showing a planned message — the wake-up itself, the goal-chat
23
+ * notes, the planned-message prompt section, and the model tools — describes it with this one helper,
24
+ * so an agent never has to reconcile two different wordings of the same plan.
25
+ *
26
+ * @param schedule - Schedule of the planned message.
27
+ * @returns Fragment such as `repeats every 5 minutes (2 of 10 runs done)`.
28
+ *
29
+ * @private internal utility of the Agents Server planned messages
30
+ */
31
+ export declare function describeAgentPlannedMessageSchedule(schedule: AgentPlannedMessageScheduleDescription): string;
@@ -1,9 +1 @@
1
- /**
2
- * Browser-compatible stub for `createDeprecatedCommitmentDiagnostics`.
3
- *
4
- * In the browser build the full Node.js implementation is not available,
5
- * so this stub always returns an empty array to keep the editor functional.
6
- *
7
- * @private internal utility of `BookEditorMonaco`
8
- */
9
- export declare function createDeprecatedCommitmentDiagnostics(_agentSource?: string): [];
1
+ export { createDeprecatedCommitmentDiagnostics } from './createDeprecatedCommitmentDiagnostics';
@@ -0,0 +1,28 @@
1
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
2
+ /**
3
+ * Monaco diagnostic shown when a Book source declares its parent agent more than once.
4
+ *
5
+ * @private internal type of `BookEditorMonaco`
6
+ */
7
+ type DuplicateFromCommitmentDiagnostic = {
8
+ readonly startLineNumber: number;
9
+ readonly startColumn: number;
10
+ readonly endLineNumber: number;
11
+ readonly endColumn: number;
12
+ readonly message: string;
13
+ readonly source: string;
14
+ readonly severity: 'warning';
15
+ };
16
+ /**
17
+ * Creates Book editor diagnostics for a parent agent declared by more than one `FROM` commitment.
18
+ *
19
+ * Repeating `FROM` stays valid — the last one wins and overrides every earlier one — but an author who writes it
20
+ * twice usually means only one of them, so every `FROM` keyword is marked to show which one actually applies.
21
+ *
22
+ * @param agentSource - Current editor content.
23
+ * @returns Warning markers for every `FROM` keyword, empty when the book declares at most one parent.
24
+ *
25
+ * @private internal utility of `BookEditorMonaco`
26
+ */
27
+ export declare function createDuplicateFromCommitmentDiagnostics(agentSource?: string_book): ReadonlyArray<DuplicateFromCommitmentDiagnostic>;
28
+ export {};
@@ -0,0 +1,13 @@
1
+ import { type ReactElement } from 'react';
2
+ /**
3
+ * Renders one unified diff with added, removed and context lines told apart.
4
+ *
5
+ * @param options - Diff text and whether it holds only the beginning of the real diff.
6
+ * @returns Readable diff block.
7
+ *
8
+ * @private function of ChatToolCallModal
9
+ */
10
+ export declare function renderAgentProjectDiff(options: {
11
+ readonly diff: string;
12
+ readonly isDiffTruncated: boolean;
13
+ }): ReactElement;
@@ -0,0 +1,16 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { AgentProjectToolCallResult } from '../utils/agentProjectToolCall';
3
+ /**
4
+ * Renders the detail view of one project the answer worked with.
5
+ *
6
+ * The card answers the two questions a project chip raises: what this project is right now — its
7
+ * runtime state and where to open it — and what this very message did to it.
8
+ *
9
+ * @param options - Parsed project chip payload.
10
+ * @returns Project details section for the tool modal.
11
+ *
12
+ * @private function of ChatToolCallModal
13
+ */
14
+ export declare function renderAgentProjectToolCallDetails(options: {
15
+ readonly project: AgentProjectToolCallResult;
16
+ }): ReactElement;
@@ -1,3 +1,4 @@
1
+ import type { AgentMessageProjectChange } from '../../../utils/agent-message-runtime/AgentMessageProjectChange';
1
2
  /**
2
3
  * Synthetic tool name used for agent-project chips in chat UI.
3
4
  *
@@ -10,6 +11,9 @@ export declare const AGENT_PROJECT_TOOL_CALL_NAME = "agent_project_touched";
10
11
  /**
11
12
  * Safe, user-facing metadata shown in agent-project chips.
12
13
  *
14
+ * Everything besides the project name is optional, because a chip written by an older server — or
15
+ * one whose project has meanwhile been deleted — still has to render.
16
+ *
13
17
  * @private internal chat-ui type for touched agent projects
14
18
  */
15
19
  export type AgentProjectToolCallResult = {
@@ -21,10 +25,45 @@ export type AgentProjectToolCallResult = {
21
25
  * Human-readable project name shown in the chip.
22
26
  */
23
27
  readonly displayName?: string;
28
+ /**
29
+ * Short project description, resolved the same way as on the project page.
30
+ */
31
+ readonly description?: string;
24
32
  /**
25
33
  * Link to the project page, when the chat knows where the project lives.
26
34
  */
27
35
  readonly projectHref?: string;
36
+ /**
37
+ * Address the running project itself is served on, when it has one.
38
+ */
39
+ readonly projectUrl?: string;
40
+ /**
41
+ * Whether the project was running when the answer finished.
42
+ */
43
+ readonly isRunning?: boolean;
44
+ /**
45
+ * Runtime status label, the same one the project page shows.
46
+ */
47
+ readonly runtimeStatusLabel?: string;
48
+ /**
49
+ * Total size of the project, already formatted for display.
50
+ */
51
+ readonly sizeLabel?: string;
52
+ /**
53
+ * Count of files inside the project.
54
+ */
55
+ readonly fileCount?: number;
56
+ /**
57
+ * Whether the project folder is a git repository.
58
+ */
59
+ readonly isGitRepository?: boolean;
60
+ /**
61
+ * What this very message changed in the project, when it changed anything.
62
+ *
63
+ * Its `projectName` repeats the one above because the change is reported by the agent runner
64
+ * in exactly this shape, and reusing it keeps the two descriptions from drifting apart.
65
+ */
66
+ readonly change?: AgentMessageProjectChange;
28
67
  };
29
68
  /**
30
69
  * Parses the project-chip payload from one tool result.
@@ -0,0 +1,38 @@
1
+ import type { AgentMessageTouchedExternalSource } from '../../../utils/agent-message-runtime/AgentMessageTouchedExternalSource';
2
+ /**
3
+ * Synthetic tool name used for external-source chips in chat UI.
4
+ *
5
+ * The Agents Server emits one such tool call per source outside the agent an answer viewed or
6
+ * edited, so the chat shows which services, websites and searches the agent really reached below
7
+ * the message that touched them. Work the agent does inside itself emits nothing.
8
+ *
9
+ * @private internal chat-ui marker for touched external sources
10
+ */
11
+ export declare const EXTERNAL_SOURCE_TOOL_CALL_NAME = "external_source_touched";
12
+ /**
13
+ * Parses the external-source chip payload from one tool result.
14
+ *
15
+ * @param result - Raw tool result payload.
16
+ * @returns Parsed source metadata, or `null` when the result describes no external source.
17
+ *
18
+ * @private internal helper reused by chip and modal rendering
19
+ */
20
+ export declare function parseExternalSourceToolCallResult(result: unknown): AgentMessageTouchedExternalSource | null;
21
+ /**
22
+ * Resolves the chip label of one touched external source.
23
+ *
24
+ * @param externalSource - Parsed source metadata.
25
+ * @returns User-facing name of the source.
26
+ *
27
+ * @private internal helper reused by chip and modal rendering
28
+ */
29
+ export declare function resolveExternalSourceToolCallLabel(externalSource: AgentMessageTouchedExternalSource): string;
30
+ /**
31
+ * Resolves the chip emoji of one touched external source.
32
+ *
33
+ * @param externalSource - Parsed source metadata.
34
+ * @returns Emoji telling apart an integration, a website and a search.
35
+ *
36
+ * @private internal helper reused by chip and modal rendering
37
+ */
38
+ export declare function resolveExternalSourceToolCallEmoji(externalSource: AgentMessageTouchedExternalSource): string;
@@ -5,6 +5,12 @@ import type { TODO_any } from '../../../utils/organization/TODO_any';
5
5
  * @private internal timeout-chat constant
6
6
  */
7
7
  export declare const SET_TIMEOUT_TOOL_CALL_NAME = "set_timeout";
8
+ /**
9
+ * Tool name of one re-planned wake-up, used by every producer of timeout chips.
10
+ *
11
+ * @private internal timeout-chat constant
12
+ */
13
+ export declare const UPDATE_TIMEOUT_TOOL_CALL_NAME = "update_timeout";
8
14
  /**
9
15
  * Tool name of one cancelled wake-up, used by every producer of timeout chips.
10
16
  *
@@ -12,3 +12,15 @@ export declare const DEFAULT_WAIT_AFTER_ERROR_MS: number;
12
12
  * @private internal utility of `ptbk coder` wait handling
13
13
  */
14
14
  export declare function parseOptionalWaitDuration(value: string | undefined, defaultMs: number): number;
15
+ /**
16
+ * Parses an optional Commander period duration string and returns the resolved milliseconds.
17
+ *
18
+ * Returns `undefined` when the flag was not provided or was provided without a non-empty value,
19
+ * which means the command runs only once instead of repeating itself.
20
+ *
21
+ * @throws {NotAllowed} When the duration is not a positive one, because a non-positive period
22
+ * would repeat the command without ever pausing between two rounds
23
+ *
24
+ * @private internal utility of `ptbk coder` wait handling
25
+ */
26
+ export declare function parseOptionalPeriodDuration(optionName: string, value: string | undefined): number | undefined;
@@ -84,8 +84,23 @@ export declare class AgentCollectionInSupabase {
84
84
  private mapAgentBasicInformationRow;
85
85
  /**
86
86
  * Retrieves the permanent ID of an agent by its name or permanent ID.
87
+ *
88
+ * An agent that still exists always wins over a soft-deleted one, so a name that was deleted and
89
+ * later created again resolves to the agent that is live now instead of to the recycle-bin leftover.
90
+ * Soft-deleted agents stay resolvable as a fallback because the recycle bin restores them by name
91
+ * or permanent id.
87
92
  */
88
93
  getAgentPermanentId(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<string_agent_permanent_id>;
94
+ /**
95
+ * Looks up the permanent id of the oldest agent matching one name or permanent id.
96
+ *
97
+ * @param agentNameOrPermanentId - Agent name or stable permanent identifier to match.
98
+ * @param options - Whether soft-deleted agents may be matched as well.
99
+ * @returns Permanent id of the matched agent, or `null` when nothing matches.
100
+ *
101
+ * @private internal helper of `AgentCollectionInSupabase`
102
+ */
103
+ private findAgentPermanentId;
89
104
  /**
90
105
  * Retrieves the source code of an agent by its name or permanent ID.
91
106
  */
@@ -0,0 +1,76 @@
1
+ /**
2
+ * One file an answered agent message created, edited or deleted inside one project.
3
+ *
4
+ * Note: [🚉] This is fully serializable as JSON
5
+ *
6
+ * @private internal type of the agent-message runtime
7
+ */
8
+ export type AgentMessageProjectChangedFile = {
9
+ /**
10
+ * Path of the file relative to the project root, using `/` separators.
11
+ */
12
+ readonly path: string;
13
+ /**
14
+ * Count of lines added to the file.
15
+ */
16
+ readonly insertionCount: number;
17
+ /**
18
+ * Count of lines removed from the file.
19
+ */
20
+ readonly deletionCount: number;
21
+ };
22
+ /**
23
+ * Everything answering one single message changed inside one agent project.
24
+ *
25
+ * Each agent project is a git repository and every answer which modifies it is committed there
26
+ * automatically, so this describes exactly one such commit — the trace of what one message really
27
+ * did to one project, which a chat can show below the answer that did it.
28
+ *
29
+ * Note: [🚉] This is fully serializable as JSON
30
+ *
31
+ * @private internal type of the agent-message runtime
32
+ */
33
+ export type AgentMessageProjectChange = {
34
+ /**
35
+ * Directory name of the changed project inside the agent `projects/` folder.
36
+ */
37
+ readonly projectName: string;
38
+ /**
39
+ * Full hash of the commit holding the changes of this message.
40
+ */
41
+ readonly commitHash: string;
42
+ /**
43
+ * ISO 8601 timestamp when the changes were committed.
44
+ */
45
+ readonly committedAt: string;
46
+ /**
47
+ * Files the message changed, ordered as git reports them.
48
+ */
49
+ readonly changedFiles: ReadonlyArray<AgentMessageProjectChangedFile>;
50
+ /**
51
+ * Count of lines added across all changed files.
52
+ */
53
+ readonly insertionCount: number;
54
+ /**
55
+ * Count of lines removed across all changed files.
56
+ */
57
+ readonly deletionCount: number;
58
+ /**
59
+ * Unified diff of the commit, shortened when the change is too large to carry into a chat.
60
+ */
61
+ readonly diff: string;
62
+ /**
63
+ * Whether `diff` holds only the beginning of the real diff.
64
+ */
65
+ readonly isDiffTruncated: boolean;
66
+ };
67
+ /**
68
+ * Validates one already-parsed JSON value as a project change.
69
+ *
70
+ * @param value - Raw serialized project change.
71
+ * @returns The typed project change, or `null` when the value does not match the expected shape,
72
+ * so consumers can silently skip foreign or malformed entries.
73
+ *
74
+ * @private internal utility of the agent-message runtime
75
+ */
76
+ export declare function normalizeAgentMessageProjectChange(value: unknown): AgentMessageProjectChange | null;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Category of one external source an answered agent message touched.
3
+ *
4
+ * - `integration` is a third-party service reached through an integration, for example Gmail.
5
+ * - `website` is a concrete web address the agent fetched or browsed.
6
+ * - `search` is a lookup the agent ran against a web search engine.
7
+ *
8
+ * @private internal type of the agent-message runtime
9
+ */
10
+ export type AgentMessageTouchedExternalSourceKind = 'integration' | 'website' | 'search';
11
+ /**
12
+ * One source outside the agent itself which answering a single message viewed or edited.
13
+ *
14
+ * Everything the agent does inside its own folder stays internal and is never described here;
15
+ * this records only the reach beyond it, so a chat can tell which outside services and websites
16
+ * one answer really involved.
17
+ *
18
+ * Note: [🚉] This is fully serializable as JSON
19
+ *
20
+ * @private internal type of the agent-message runtime
21
+ */
22
+ export type AgentMessageTouchedExternalSource = {
23
+ /**
24
+ * Category of the touched source.
25
+ */
26
+ readonly kind: AgentMessageTouchedExternalSourceKind;
27
+ /**
28
+ * User-facing name of the source, for example `Gmail`, `example.com` or the search query.
29
+ */
30
+ readonly name: string;
31
+ /**
32
+ * Address of the source, when the touch names a concrete one.
33
+ */
34
+ readonly url?: string;
35
+ };
36
+ /**
37
+ * Validates one already-parsed JSON value as a touched external source.
38
+ *
39
+ * @param value - Raw serialized source.
40
+ * @returns The typed source, or `null` when the value does not match the expected shape, so
41
+ * consumers can silently skip foreign or malformed entries.
42
+ *
43
+ * @private internal utility of the agent-message runtime
44
+ */
45
+ export declare function normalizeAgentMessageTouchedExternalSource(value: unknown): AgentMessageTouchedExternalSource | null;
@@ -42,6 +42,9 @@ export type AgentMessageRuntimeLogEvent = {
42
42
  readonly command?: string;
43
43
  readonly exit_code?: number | null;
44
44
  readonly changes?: ReadonlyArray<AgentMessageRuntimeLogFileChange>;
45
+ readonly server?: string;
46
+ readonly tool?: string;
47
+ readonly query?: string;
45
48
  };
46
49
  };
47
50
  /**
@@ -0,0 +1,18 @@
1
+ import type { AgentMessageTouchedExternalSource } from './AgentMessageTouchedExternalSource';
2
+ /**
3
+ * Resolves which sources outside the agent one coding harness touched while answering a single message.
4
+ *
5
+ * The runtime log streams what the harness really did, so a source counts as touched when the
6
+ * harness reached it in a tool invocation — calling an integration, fetching a web address,
7
+ * searching the web, or running a network client in the shell. Only tool payloads are inspected:
8
+ * tool results and assistant narration are ignored so a service merely mentioned in the
9
+ * conversation is never reported, and addresses of the machine the agent runs on are dropped
10
+ * because they are internal.
11
+ *
12
+ * @param options - Raw runtime log content of one answered message.
13
+ * @returns Touched external sources without duplicates, ordered by first appearance.
14
+ * @private internal utility of the agent-message runtime
15
+ */
16
+ export declare function resolveAgentMessageTouchedExternalSources(options: {
17
+ readonly logText: string | null | undefined;
18
+ }): ReadonlyArray<AgentMessageTouchedExternalSource>;
@@ -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.114.0-12`).
18
+ * It follows semantic versioning (e.g., `0.114.0-17`).
19
19
  *
20
20
  * @generated
21
21
  */