@promptbook/markdown-utils 0.112.0-54 → 0.112.0-57

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 (177) hide show
  1. package/esm/index.es.js +3 -3
  2. package/esm/src/_packages/cli.index.d.ts +10 -0
  3. package/esm/src/_packages/core.index.d.ts +12 -0
  4. package/esm/src/_packages/types.index.d.ts +8 -0
  5. package/esm/src/_packages/wizard.index.d.ts +10 -0
  6. package/esm/src/avatars/index.d.ts +1 -1
  7. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
  8. package/esm/src/avatars/visuals/avatarVisualRegistry.d.ts +12 -0
  9. package/esm/src/avatars/visuals/orbAvatarVisual.d.ts +48 -0
  10. package/esm/src/avatars/visuals/orbAvatarVisual.test.d.ts +1 -0
  11. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
  12. package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/ParsedAgentSourceWithCommitments.d.ts +7 -0
  13. package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/applyCommitmentsToAgentModelRequirements.d.ts +14 -0
  14. package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/augmentAgentModelRequirementsFromSource.d.ts +14 -0
  15. package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/filterCommitmentsForAgentModelRequirements.d.ts +10 -0
  16. package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/materializeInlineKnowledgeSources.d.ts +12 -0
  17. package/esm/src/book-2.0/agent-source/parseAgentSource/ParseAgentSourceState.d.ts +10 -0
  18. package/esm/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.d.ts +7 -0
  19. package/esm/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.d.ts +8 -0
  20. package/esm/src/book-2.0/agent-source/parseAgentSource/consumeConversationSampleCommitment.d.ts +8 -0
  21. package/esm/src/book-2.0/agent-source/parseAgentSource/createCapabilitiesFromCommitment.d.ts +9 -0
  22. package/esm/src/book-2.0/agent-source/parseAgentSource/ensureMetaFullname.d.ts +7 -0
  23. package/esm/src/book-2.0/agent-source/parseAgentSource/extractAgentProfileText.d.ts +8 -0
  24. package/esm/src/book-2.0/agent-source/parseAgentSource/extractInitialMessage.d.ts +7 -0
  25. package/esm/src/book-2.0/agent-source/parseAgentSource/extractParsedAgentProfile.d.ts +8 -0
  26. package/esm/src/book-2.0/agent-source/parseAgentSourceWithCommitments.use.test.d.ts +1 -0
  27. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +9 -8
  28. package/esm/src/commitments/ACTION/ACTION.d.ts +8 -2
  29. package/esm/src/commitments/ACTION/ACTION.test.d.ts +1 -0
  30. package/esm/src/commitments/DELETE/DELETE.d.ts +7 -3
  31. package/esm/src/commitments/DELETE/DELETE.test.d.ts +1 -0
  32. package/esm/src/commitments/FORMAT/FORMAT.d.ts +10 -4
  33. package/esm/src/commitments/FORMAT/FORMAT.test.d.ts +1 -0
  34. package/esm/src/commitments/GOAL/GOAL.d.ts +4 -0
  35. package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +4 -0
  36. package/esm/src/commitments/META/META.d.ts +2 -0
  37. package/esm/src/commitments/META_AVATAR/META_AVATAR.d.ts +26 -0
  38. package/esm/src/commitments/MODEL/MODEL.d.ts +4 -0
  39. package/esm/src/commitments/MODEL/MODEL.test.d.ts +1 -0
  40. package/esm/src/commitments/RULE/RULE.d.ts +4 -0
  41. package/esm/src/commitments/TEAM/TEAM.d.ts +4 -0
  42. package/esm/src/commitments/TEMPLATE/TEMPLATE.d.ts +10 -4
  43. package/esm/src/commitments/_base/BaseCommitmentDefinition.d.ts +12 -0
  44. package/esm/src/commitments/_base/CommitmentDefinition.d.ts +21 -1
  45. package/esm/src/commitments/_common/getAllCommitmentDefinitions.test.d.ts +1 -0
  46. package/esm/src/commitments/_common/getCommitmentNoticeMetadata.d.ts +51 -0
  47. package/esm/src/commitments/_common/getCommitmentNoticeMetadata.test.d.ts +1 -0
  48. package/esm/src/commitments/_common/getGroupedCommitmentDefinitions.openClosed.test.d.ts +1 -0
  49. package/esm/src/commitments/_common/getGroupedCommitmentDefinitions.order.test.d.ts +1 -0
  50. package/esm/src/commitments/_common/getGroupedCommitmentDefinitions.use.test.d.ts +1 -0
  51. package/esm/src/commitments/_common/sortCommitmentDefinitions.d.ts +31 -0
  52. package/esm/src/commitments/_common/teamInternalAgentAccess.d.ts +51 -0
  53. package/esm/src/commitments/_common/toolRuntimeContext.d.ts +4 -0
  54. package/esm/src/commitments/index.d.ts +2 -2
  55. package/esm/src/commitments/index.test.d.ts +1 -0
  56. package/esm/src/llm-providers/agent/Agent.d.ts +2 -0
  57. package/esm/src/llm-providers/agent/RemoteAgent.d.ts +1 -0
  58. package/esm/src/llm-providers/agent/RemoteAgentOptions.d.ts +4 -0
  59. package/esm/src/playground/playground.d.ts +1 -0
  60. package/esm/src/transpilers/_common/BookTranspilerOptions.d.ts +20 -0
  61. package/esm/src/transpilers/_common/TranspiledTeamExport.d.ts +80 -0
  62. package/esm/src/transpilers/_common/createTranspiledTeamRuntimeSection.d.ts +55 -0
  63. package/esm/src/transpilers/_common/createZodSchemaSource.d.ts +40 -0
  64. package/esm/src/transpilers/_common/formatUsedToolFunctions.d.ts +18 -0
  65. package/esm/src/transpilers/_common/formatUsedToolFunctions.test.d.ts +1 -0
  66. package/esm/src/transpilers/_common/prepareSdkTranspilerContext.d.ts +48 -0
  67. package/esm/src/transpilers/_common/resolveClaudeModelName.d.ts +12 -0
  68. package/esm/src/transpilers/_common/transpiledTeamTranspilers.test.d.ts +1 -0
  69. package/esm/src/transpilers/agent-os/AgentOsTranspiler.d.ts +16 -0
  70. package/esm/src/transpilers/agent-os/AgentOsTranspiler.test.d.ts +1 -0
  71. package/esm/src/transpilers/agent-os/register.d.ts +12 -0
  72. package/esm/src/transpilers/anthropic-claude-managed/AnthropicClaudeManagedTranspiler.d.ts +16 -0
  73. package/esm/src/transpilers/anthropic-claude-managed/AnthropicClaudeManagedTranspiler.test.d.ts +1 -0
  74. package/esm/src/transpilers/anthropic-claude-managed/register.d.ts +12 -0
  75. package/esm/src/transpilers/anthropic-claude-sdk/AnthropicClaudeSdkTranspiler.d.ts +16 -0
  76. package/esm/src/transpilers/anthropic-claude-sdk/AnthropicClaudeSdkTranspiler.test.d.ts +1 -0
  77. package/esm/src/transpilers/anthropic-claude-sdk/register.d.ts +12 -0
  78. package/esm/src/transpilers/e2b/E2BTranspiler.d.ts +16 -0
  79. package/esm/src/transpilers/e2b/E2BTranspiler.test.d.ts +1 -0
  80. package/esm/src/transpilers/e2b/register.d.ts +12 -0
  81. package/esm/src/transpilers/openai-agents/OpenAiAgentsTranspiler.d.ts +16 -0
  82. package/esm/src/transpilers/openai-agents/OpenAiAgentsTranspiler.test.d.ts +1 -0
  83. package/esm/src/transpilers/openai-agents/register.d.ts +12 -0
  84. package/esm/src/types/LlmToolDefinition.d.ts +17 -7
  85. package/esm/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +15 -0
  86. package/esm/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
  87. package/esm/src/version.d.ts +1 -1
  88. package/package.json +1 -1
  89. package/umd/index.umd.js +3 -3
  90. package/umd/src/_packages/cli.index.d.ts +10 -0
  91. package/umd/src/_packages/core.index.d.ts +12 -0
  92. package/umd/src/_packages/types.index.d.ts +8 -0
  93. package/umd/src/_packages/wizard.index.d.ts +10 -0
  94. package/umd/src/avatars/index.d.ts +1 -1
  95. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
  96. package/umd/src/avatars/visuals/avatarVisualRegistry.d.ts +12 -0
  97. package/umd/src/avatars/visuals/orbAvatarVisual.d.ts +48 -0
  98. package/umd/src/avatars/visuals/orbAvatarVisual.test.d.ts +1 -0
  99. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
  100. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/ParsedAgentSourceWithCommitments.d.ts +7 -0
  101. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/applyCommitmentsToAgentModelRequirements.d.ts +14 -0
  102. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/augmentAgentModelRequirementsFromSource.d.ts +14 -0
  103. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/filterCommitmentsForAgentModelRequirements.d.ts +10 -0
  104. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/materializeInlineKnowledgeSources.d.ts +12 -0
  105. package/umd/src/book-2.0/agent-source/parseAgentSource/ParseAgentSourceState.d.ts +10 -0
  106. package/umd/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.d.ts +7 -0
  107. package/umd/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.d.ts +8 -0
  108. package/umd/src/book-2.0/agent-source/parseAgentSource/consumeConversationSampleCommitment.d.ts +8 -0
  109. package/umd/src/book-2.0/agent-source/parseAgentSource/createCapabilitiesFromCommitment.d.ts +9 -0
  110. package/umd/src/book-2.0/agent-source/parseAgentSource/ensureMetaFullname.d.ts +7 -0
  111. package/umd/src/book-2.0/agent-source/parseAgentSource/extractAgentProfileText.d.ts +8 -0
  112. package/umd/src/book-2.0/agent-source/parseAgentSource/extractInitialMessage.d.ts +7 -0
  113. package/umd/src/book-2.0/agent-source/parseAgentSource/extractParsedAgentProfile.d.ts +8 -0
  114. package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.use.test.d.ts +1 -0
  115. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +9 -8
  116. package/umd/src/commitments/ACTION/ACTION.d.ts +8 -2
  117. package/umd/src/commitments/ACTION/ACTION.test.d.ts +1 -0
  118. package/umd/src/commitments/DELETE/DELETE.d.ts +7 -3
  119. package/umd/src/commitments/DELETE/DELETE.test.d.ts +1 -0
  120. package/umd/src/commitments/FORMAT/FORMAT.d.ts +10 -4
  121. package/umd/src/commitments/FORMAT/FORMAT.test.d.ts +1 -0
  122. package/umd/src/commitments/GOAL/GOAL.d.ts +4 -0
  123. package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +4 -0
  124. package/umd/src/commitments/META/META.d.ts +2 -0
  125. package/umd/src/commitments/META_AVATAR/META_AVATAR.d.ts +26 -0
  126. package/umd/src/commitments/MODEL/MODEL.d.ts +4 -0
  127. package/umd/src/commitments/MODEL/MODEL.test.d.ts +1 -0
  128. package/umd/src/commitments/RULE/RULE.d.ts +4 -0
  129. package/umd/src/commitments/TEAM/TEAM.d.ts +4 -0
  130. package/umd/src/commitments/TEMPLATE/TEMPLATE.d.ts +10 -4
  131. package/umd/src/commitments/_base/BaseCommitmentDefinition.d.ts +12 -0
  132. package/umd/src/commitments/_base/CommitmentDefinition.d.ts +21 -1
  133. package/umd/src/commitments/_common/getAllCommitmentDefinitions.test.d.ts +1 -0
  134. package/umd/src/commitments/_common/getCommitmentNoticeMetadata.d.ts +51 -0
  135. package/umd/src/commitments/_common/getCommitmentNoticeMetadata.test.d.ts +1 -0
  136. package/umd/src/commitments/_common/getGroupedCommitmentDefinitions.openClosed.test.d.ts +1 -0
  137. package/umd/src/commitments/_common/getGroupedCommitmentDefinitions.order.test.d.ts +1 -0
  138. package/umd/src/commitments/_common/getGroupedCommitmentDefinitions.use.test.d.ts +1 -0
  139. package/umd/src/commitments/_common/sortCommitmentDefinitions.d.ts +31 -0
  140. package/umd/src/commitments/_common/teamInternalAgentAccess.d.ts +51 -0
  141. package/umd/src/commitments/_common/toolRuntimeContext.d.ts +4 -0
  142. package/umd/src/commitments/index.d.ts +2 -2
  143. package/umd/src/commitments/index.test.d.ts +1 -0
  144. package/umd/src/llm-providers/agent/Agent.d.ts +2 -0
  145. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +1 -0
  146. package/umd/src/llm-providers/agent/RemoteAgentOptions.d.ts +4 -0
  147. package/umd/src/playground/playground.d.ts +1 -0
  148. package/umd/src/transpilers/_common/BookTranspilerOptions.d.ts +20 -0
  149. package/umd/src/transpilers/_common/TranspiledTeamExport.d.ts +80 -0
  150. package/umd/src/transpilers/_common/createTranspiledTeamRuntimeSection.d.ts +55 -0
  151. package/umd/src/transpilers/_common/createZodSchemaSource.d.ts +40 -0
  152. package/umd/src/transpilers/_common/formatUsedToolFunctions.d.ts +18 -0
  153. package/umd/src/transpilers/_common/formatUsedToolFunctions.test.d.ts +1 -0
  154. package/umd/src/transpilers/_common/prepareSdkTranspilerContext.d.ts +48 -0
  155. package/umd/src/transpilers/_common/resolveClaudeModelName.d.ts +12 -0
  156. package/umd/src/transpilers/_common/transpiledTeamTranspilers.test.d.ts +1 -0
  157. package/umd/src/transpilers/agent-os/AgentOsTranspiler.d.ts +16 -0
  158. package/umd/src/transpilers/agent-os/AgentOsTranspiler.test.d.ts +1 -0
  159. package/umd/src/transpilers/agent-os/register.d.ts +12 -0
  160. package/umd/src/transpilers/anthropic-claude-managed/AnthropicClaudeManagedTranspiler.d.ts +16 -0
  161. package/umd/src/transpilers/anthropic-claude-managed/AnthropicClaudeManagedTranspiler.test.d.ts +1 -0
  162. package/umd/src/transpilers/anthropic-claude-managed/register.d.ts +12 -0
  163. package/umd/src/transpilers/anthropic-claude-sdk/AnthropicClaudeSdkTranspiler.d.ts +16 -0
  164. package/umd/src/transpilers/anthropic-claude-sdk/AnthropicClaudeSdkTranspiler.test.d.ts +1 -0
  165. package/umd/src/transpilers/anthropic-claude-sdk/register.d.ts +12 -0
  166. package/umd/src/transpilers/e2b/E2BTranspiler.d.ts +16 -0
  167. package/umd/src/transpilers/e2b/E2BTranspiler.test.d.ts +1 -0
  168. package/umd/src/transpilers/e2b/register.d.ts +12 -0
  169. package/umd/src/transpilers/openai-agents/OpenAiAgentsTranspiler.d.ts +16 -0
  170. package/umd/src/transpilers/openai-agents/OpenAiAgentsTranspiler.test.d.ts +1 -0
  171. package/umd/src/transpilers/openai-agents/register.d.ts +12 -0
  172. package/umd/src/types/LlmToolDefinition.d.ts +17 -7
  173. package/umd/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +15 -0
  174. package/umd/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
  175. package/umd/src/version.d.ts +1 -1
  176. package/esm/src/commitments/USE/USE.d.ts +0 -51
  177. package/umd/src/commitments/USE/USE.d.ts +0 -51
@@ -0,0 +1,80 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
3
+ import type { PseudoAgentKind } from '../../book-2.0/agent-source/pseudoAgentReferences';
4
+ import type { LlmToolDefinition } from '../../types/LlmToolDefinition';
5
+ /**
6
+ * Model-requirement fields embedded for one built-in teammate in transpiled code.
7
+ */
8
+ export type TranspiledTeamAgentModelRequirements = Pick<AgentModelRequirements, 'systemMessage' | 'promptSuffix' | 'modelName' | 'temperature' | 'topP' | 'topK' | 'knowledgeSources' | 'samples'> & {
9
+ /**
10
+ * Tool definitions visible to this built-in teammate.
11
+ */
12
+ readonly tools: ReadonlyArray<LlmToolDefinition>;
13
+ };
14
+ /**
15
+ * One TEAM edge embedded into transpiled code.
16
+ */
17
+ export type TranspiledTeamTeammate = {
18
+ /**
19
+ * Canonical teammate URL.
20
+ */
21
+ readonly url: string;
22
+ /**
23
+ * Human-readable teammate label.
24
+ */
25
+ readonly label: string;
26
+ /**
27
+ * Tool name used by the owning agent to consult this teammate.
28
+ */
29
+ readonly toolName: string;
30
+ /**
31
+ * Optional instructions from the TEAM commitment.
32
+ */
33
+ readonly instructions?: string;
34
+ /**
35
+ * Pseudo-agent kind for `{User}` and `{Void}` teammates.
36
+ */
37
+ readonly pseudoAgentKind?: PseudoAgentKind;
38
+ };
39
+ /**
40
+ * One agent node embedded into a transpiled TEAM hierarchy.
41
+ */
42
+ export type TranspiledTeamAgent = {
43
+ /**
44
+ * Canonical URL used as the stable team-member identifier.
45
+ */
46
+ readonly url: string;
47
+ /**
48
+ * Human-readable agent name.
49
+ */
50
+ readonly agentName: string;
51
+ /**
52
+ * Resolved Book source for this agent.
53
+ */
54
+ readonly agentSource: string_book;
55
+ /**
56
+ * Compiled model requirements used by the exported harness.
57
+ */
58
+ readonly modelRequirements: TranspiledTeamAgentModelRequirements;
59
+ /**
60
+ * Teammates directly available to this agent.
61
+ */
62
+ readonly teammates: ReadonlyArray<TranspiledTeamTeammate>;
63
+ /**
64
+ * Marks the root exported agent in the hierarchy.
65
+ */
66
+ readonly isRootAgent?: boolean;
67
+ };
68
+ /**
69
+ * Full built-in TEAM hierarchy embedded into transpiled code.
70
+ */
71
+ export type TranspiledTeamExport = {
72
+ /**
73
+ * Canonical URL of the root exported agent.
74
+ */
75
+ readonly rootAgentUrl: string;
76
+ /**
77
+ * Root agent and all reachable teammates.
78
+ */
79
+ readonly agents: ReadonlyArray<TranspiledTeamAgent>;
80
+ };
@@ -0,0 +1,55 @@
1
+ import type { string_javascript_name } from '../../_packages/types.index';
2
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
3
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
4
+ import type { TranspiledTeamAgentModelRequirements, TranspiledTeamExport, TranspiledTeamTeammate } from './TranspiledTeamExport';
5
+ /**
6
+ * Creates the full transpiled TEAM export used by generated harnesses.
7
+ *
8
+ * @param options - Root source, compiled requirements, and optional server-resolved hierarchy.
9
+ * @returns Normalized team export, or `null` when no TEAM tools are present.
10
+ *
11
+ * @private shared between transpilers
12
+ */
13
+ export declare function createTranspiledTeamExportForContext(options: {
14
+ readonly agentName: string;
15
+ readonly agentSource: string_book;
16
+ readonly modelRequirements: AgentModelRequirements;
17
+ readonly transpiledTeam?: TranspiledTeamExport;
18
+ }): TranspiledTeamExport | null;
19
+ /**
20
+ * Extracts serializable TEAM teammate metadata from model requirements.
21
+ *
22
+ * @param modelRequirements - Compiled agent requirements with TEAM metadata.
23
+ * @returns Teammates safe to embed in transpiled code.
24
+ *
25
+ * @private shared between transpilers
26
+ */
27
+ export declare function extractTranspiledTeamTeammates(modelRequirements: AgentModelRequirements): ReadonlyArray<TranspiledTeamTeammate>;
28
+ /**
29
+ * Creates the serializable model-requirement subset embedded for each built-in teammate.
30
+ *
31
+ * @param modelRequirements - Full compiled model requirements.
32
+ * @returns Minimal model requirements needed by transpiled TEAM helpers.
33
+ *
34
+ * @private shared between transpilers
35
+ */
36
+ export declare function createTranspiledTeamAgentModelRequirements(modelRequirements: AgentModelRequirements): TranspiledTeamAgentModelRequirements;
37
+ /**
38
+ * Replaces TEAM tool closures with self-contained transpiled TEAM tool functions.
39
+ *
40
+ * @param usedToolFunctions - Tool implementation sources collected from commitment definitions.
41
+ * @param transpiledTeam - Built-in team hierarchy prepared for the generated harness.
42
+ * @returns Tool implementations with TEAM tools pointing to the reusable runtime helper.
43
+ *
44
+ * @private shared between transpilers
45
+ */
46
+ export declare function createTranspiledTeamAwareToolFunctions(usedToolFunctions: Record<string_javascript_name, string>, transpiledTeam: TranspiledTeamExport | null): Record<string_javascript_name, string>;
47
+ /**
48
+ * Creates the reusable JavaScript TEAM runtime block embedded into generated harnesses.
49
+ *
50
+ * @param transpiledTeam - Built-in team hierarchy prepared for the generated harness.
51
+ * @returns JavaScript source, or an empty string when there is no TEAM hierarchy.
52
+ *
53
+ * @private shared between transpilers
54
+ */
55
+ export declare function createTranspiledTeamRuntimeSection(transpiledTeam: TranspiledTeamExport | null): string;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Formats a JSON-schema fragment into a Zod expression for generated transpiled code.
3
+ *
4
+ * The Claude Code and AgentOS transpilers both need the same JSON-schema-to-Zod conversion,
5
+ * but Claude Code needs raw Zod shapes while AgentOS needs wrapped `z.object(...)` schemas.
6
+ *
7
+ * @param schema - JSON-schema fragment used for one tool input definition.
8
+ * @returns Zod expression source ready to embed in generated JavaScript.
9
+ *
10
+ * @private shared between Claude and AgentOS transpilers
11
+ */
12
+ export declare function createZodSchemaSource(schema: JsonSchemaLike): string;
13
+ /**
14
+ * Formats a JSON-schema fragment into a raw Zod shape object literal.
15
+ *
16
+ * Claude Code SDK custom tools expect a Zod raw shape instead of a wrapped `z.object(...)`
17
+ * expression, so this helper reuses the same conversion logic but returns only the object literal
18
+ * body.
19
+ *
20
+ * @param schema - JSON-schema fragment used for one tool input definition.
21
+ * @returns Raw Zod shape source ready to embed in `tool(...)`.
22
+ *
23
+ * @private shared between Claude and AgentOS transpilers
24
+ */
25
+ export declare function createZodShapeSource(schema: JsonSchemaLike): string;
26
+ /**
27
+ * Minimal JSON-schema shape used by the transpiled Claude and AgentOS harness generators.
28
+ *
29
+ * @private shared between Claude and AgentOS transpilers
30
+ */
31
+ type JsonSchemaLike = {
32
+ readonly type?: string;
33
+ readonly description?: string;
34
+ readonly properties?: Record<string, JsonSchemaLike>;
35
+ readonly required?: ReadonlyArray<string>;
36
+ readonly items?: JsonSchemaLike;
37
+ readonly enum?: ReadonlyArray<string | number | boolean | null>;
38
+ readonly additionalProperties?: boolean;
39
+ };
40
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { string_javascript_name } from '../../_packages/types.index';
2
+ /**
3
+ * Formats used tool functions into object-literal method syntax for generated SDK harnesses.
4
+ *
5
+ * Tool implementations are authored in several shapes across the repository:
6
+ * - object-literal methods
7
+ * - function declarations
8
+ * - arrow functions
9
+ *
10
+ * This helper normalizes all supported shapes into valid object members so the
11
+ * transpiled `tools` block stays syntactically correct.
12
+ *
13
+ * @param usedToolFunctions - Tool function sources indexed by tool name.
14
+ * @returns Object-member definitions ready to embed inside a transpiled `const tools = { ... }` block.
15
+ *
16
+ * @private shared between SDK transpilers
17
+ */
18
+ export declare function formatUsedToolFunctions(usedToolFunctions: Record<string_javascript_name, string>): string;
@@ -0,0 +1,48 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
3
+ import type { BookTranspilerOptions } from './BookTranspilerOptions';
4
+ import type { TranspiledTeamExport } from './TranspiledTeamExport';
5
+ /**
6
+ * Parsed data shared by SDK-oriented transpilers.
7
+ *
8
+ * @private shared between SDK transpilers
9
+ */
10
+ export type PreparedSdkTranspilerContext = {
11
+ /**
12
+ * Parsed agent name used in the generated CLI harness.
13
+ */
14
+ readonly agentName: string;
15
+ /**
16
+ * Fully compiled model requirements generated from the Book source.
17
+ */
18
+ readonly modelRequirements: AgentModelRequirements;
19
+ /**
20
+ * Inline knowledge snippets embedded directly into the generated harness.
21
+ */
22
+ readonly directKnowledge: Array<string>;
23
+ /**
24
+ * Remote or file-based knowledge sources loaded by the generated harness at runtime.
25
+ */
26
+ readonly knowledgeSources: Array<string>;
27
+ /**
28
+ * Tool implementations extracted from commitment definitions and embedded into the harness.
29
+ */
30
+ readonly usedToolFunctions: Record<string, string>;
31
+ /**
32
+ * Whether the transpiler should emit the retrieval-augmented scaffold.
33
+ */
34
+ readonly isKnowledgeHandledWithRetrieval: boolean;
35
+ /**
36
+ * Built-in TEAM hierarchy embedded into the generated harness.
37
+ */
38
+ readonly transpiledTeam: TranspiledTeamExport | null;
39
+ };
40
+ /**
41
+ * Prepares the common parsed context reused by JavaScript SDK transpilers.
42
+ *
43
+ * @param book - Agent Book source being transpiled.
44
+ * @param options - Optional transpiler hooks such as reference resolvers and built-in TEAM data.
45
+ * @returns Shared transpiler context derived from the Book.
46
+ * @private shared between SDK transpilers
47
+ */
48
+ export declare function prepareSdkTranspilerContext(book: string_book, options?: BookTranspilerOptions): Promise<PreparedSdkTranspilerContext>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Resolves a Claude model name compatible with generated Claude-based harnesses.
3
+ *
4
+ * The Promptbook Book can still specify a non-Claude model, but Claude-based transpilers
5
+ * need a Claude-compatible default so the generated harness remains runnable.
6
+ *
7
+ * @param modelName - Model requested by the Book source.
8
+ * @returns Claude-compatible model name for the generated export.
9
+ *
10
+ * @private shared between Claude transpilers
11
+ */
12
+ export declare function resolveClaudeModelName(modelName?: string): string;
@@ -0,0 +1,16 @@
1
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
2
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
3
+ import type { string_script } from '../../types/typeAliases';
4
+ import type { BookTranspilerOptions } from '../_common/BookTranspilerOptions';
5
+ /**
6
+ * Transpiler to JavaScript code using AgentOS.
7
+ *
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare const AgentOsTranspiler: {
11
+ readonly name: "agent-os";
12
+ readonly title: "AgentOS";
13
+ readonly packageName: "@promptbook/core";
14
+ readonly className: "AgentOsTranspiler";
15
+ readonly transpileBook: (book: string_book, tools: ExecutionTools, options?: BookTranspilerOptions) => Promise<string_script>;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { Registration } from '../../utils/misc/$Register';
2
+ /**
3
+ * Registration of transpiler.
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools.
6
+ *
7
+ * TODO: [🧠] Which package should export this?
8
+ *
9
+ * @public exported from `@promptbook/wizard`
10
+ * @public exported from `@promptbook/cli`
11
+ */
12
+ export declare const _AgentOsTranspilerRegistration: Registration;
@@ -0,0 +1,16 @@
1
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
2
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
3
+ import type { string_script } from '../../types/typeAliases';
4
+ import type { BookTranspilerOptions } from '../_common/BookTranspilerOptions';
5
+ /**
6
+ * Transpiler to JavaScript code using Anthropic Claude Agent SDK managed sessions.
7
+ *
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare const AnthropicClaudeManagedTranspiler: {
11
+ readonly name: "anthropic-claude-managed";
12
+ readonly title: "Anthropic Claude Managed";
13
+ readonly packageName: "@promptbook/core";
14
+ readonly className: "AnthropicClaudeManagedTranspiler";
15
+ readonly transpileBook: (book: string_book, tools: ExecutionTools, options?: BookTranspilerOptions) => Promise<string_script>;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { Registration } from '../../utils/misc/$Register';
2
+ /**
3
+ * Registration of transpiler.
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools.
6
+ *
7
+ * TODO: [🧠] Which package should export this?
8
+ *
9
+ * @public exported from `@promptbook/wizard`
10
+ * @public exported from `@promptbook/cli`
11
+ */
12
+ export declare const _AnthropicClaudeManagedTranspilerRegistration: Registration;
@@ -0,0 +1,16 @@
1
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
2
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
3
+ import type { string_script } from '../../types/typeAliases';
4
+ import type { BookTranspilerOptions } from '../_common/BookTranspilerOptions';
5
+ /**
6
+ * Transpiler to JavaScript code using Anthropic's Claude SDK.
7
+ *
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare const AnthropicClaudeSdkTranspiler: {
11
+ readonly name: "anthropic-claude-sdk";
12
+ readonly title: "Anthropic Claude SDK";
13
+ readonly packageName: "@promptbook/core";
14
+ readonly className: "AnthropicClaudeSdkTranspiler";
15
+ readonly transpileBook: (book: string_book, tools: ExecutionTools, options?: BookTranspilerOptions) => Promise<string_script>;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { Registration } from '../../utils/misc/$Register';
2
+ /**
3
+ * Registration of transpiler
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
+ *
7
+ * TODO: [🧠] Which package should export this?
8
+ *
9
+ * @public exported from `@promptbook/wizard`
10
+ * @public exported from `@promptbook/cli`
11
+ */
12
+ export declare const _AnthropicClaudeSdkTranspilerRegistration: Registration;
@@ -0,0 +1,16 @@
1
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
2
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
3
+ import type { string_script } from '../../types/typeAliases';
4
+ import type { BookTranspilerOptions } from '../_common/BookTranspilerOptions';
5
+ /**
6
+ * Transpiler to a JavaScript launcher that runs the exported agent inside an E2B sandbox.
7
+ *
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare const E2BTranspiler: {
11
+ readonly name: "e2b";
12
+ readonly title: "E2B";
13
+ readonly packageName: "@promptbook/core";
14
+ readonly className: "E2BTranspiler";
15
+ readonly transpileBook: (book: string_book, tools: ExecutionTools, options?: BookTranspilerOptions) => Promise<string_script>;
16
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { Registration } from '../../utils/misc/$Register';
2
+ /**
3
+ * Registration of transpiler.
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools.
6
+ *
7
+ * TODO: [🧠] Which package should export this?
8
+ *
9
+ * @public exported from `@promptbook/wizard`
10
+ * @public exported from `@promptbook/cli`
11
+ */
12
+ export declare const _E2BTranspilerRegistration: Registration;
@@ -0,0 +1,16 @@
1
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
2
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
3
+ import type { string_script } from '../../types/typeAliases';
4
+ import type { BookTranspilerOptions } from '../_common/BookTranspilerOptions';
5
+ /**
6
+ * Transpiler to JavaScript code using the OpenAI Agents SDK.
7
+ *
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare const OpenAiAgentsTranspiler: {
11
+ readonly name: "openai-agents";
12
+ readonly title: "OpenAI Agents SDK";
13
+ readonly packageName: "@promptbook/core";
14
+ readonly className: "OpenAiAgentsTranspiler";
15
+ readonly transpileBook: (book: string_book, tools: ExecutionTools, options?: BookTranspilerOptions) => Promise<string_script>;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { Registration } from '../../utils/misc/$Register';
2
+ /**
3
+ * Registration of transpiler.
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools.
6
+ *
7
+ * TODO: [🧠] Which package should export this?
8
+ *
9
+ * @public exported from `@promptbook/wizard`
10
+ * @public exported from `@promptbook/cli`
11
+ */
12
+ export declare const _OpenAiAgentsTranspilerRegistration: Registration;
@@ -1,4 +1,18 @@
1
1
  import type { string_markdown_text, string_name } from './typeAliases';
2
+ /**
3
+ * Minimal recursive JSON Schema entry used by tool definitions.
4
+ *
5
+ * Note: [🚉] This is fully serializable as JSON
6
+ */
7
+ type LlmToolJsonSchema = {
8
+ type?: string;
9
+ description?: string;
10
+ properties?: Record<string, LlmToolJsonSchema>;
11
+ required?: string[];
12
+ items?: LlmToolJsonSchema;
13
+ enum?: Array<string | number | boolean | null>;
14
+ additionalProperties?: boolean;
15
+ };
2
16
  /**
3
17
  * Definition of a tool that can be used by the model
4
18
  *
@@ -16,13 +30,9 @@ export type LlmToolDefinition = {
16
30
  /**
17
31
  * Parameters of the tool in JSON Schema format
18
32
  */
19
- readonly parameters: {
33
+ readonly parameters: LlmToolJsonSchema & {
20
34
  readonly type: 'object';
21
- readonly properties: Record<string, {
22
- type: string;
23
- description?: string;
24
- }>;
25
- readonly required?: string[];
26
- readonly additionalProperties?: boolean;
35
+ readonly properties: Record<string, LlmToolJsonSchema>;
27
36
  };
28
37
  };
38
+ export {};
@@ -21,6 +21,10 @@ export type ResolveAgentAvatarOptions = {
21
21
  * Optional preferred avatar visual id coming from remote profile payloads.
22
22
  */
23
23
  readonly avatarVisualId?: AvatarVisualId;
24
+ /**
25
+ * Optional server-wide fallback visual id forwarded by federated server payloads.
26
+ */
27
+ readonly defaultAgentAvatarVisualId?: AvatarVisualId;
24
28
  };
25
29
  /**
26
30
  * Optional base URL used to resolve relative meta images and placeholders.
@@ -52,6 +56,17 @@ export type ResolvedAgentAvatar = {
52
56
  readonly avatarDefinition: AvatarDefinition;
53
57
  readonly visualId: AvatarVisualId;
54
58
  };
59
+ /**
60
+ * Resolves the avatar visual preferred by an agent, then falls back to a federated server default
61
+ * and finally to the caller/server default.
62
+ *
63
+ * @param agent Agent metadata and optional remote-profile visual id.
64
+ * @param defaultAvatarVisualId Optional metadata-resolved server default.
65
+ * @returns Supported avatar visual id.
66
+ *
67
+ * @private shared avatar contract
68
+ */
69
+ export declare function resolveAgentAvatarVisualId(agent: ResolveAgentAvatarOptions['agent'], defaultAvatarVisualId?: AvatarVisualId): AvatarVisualId;
55
70
  /**
56
71
  * Resolve the fallback avatar URL for an agent.
57
72
  *
@@ -1,6 +1,6 @@
1
1
  import type { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
- * Change dash-like characters to regular dashes `—` -> `-` and remove soft hyphens
3
+ * Change dash-like characters to regular dashes `-` -> `-` and remove soft hyphens
4
4
  *
5
5
  * Note: [🔂] This function is idempotent.
6
6
  * Tip: If you want to do the full cleanup, look for `humanizeAiText` exported `@promptbook/markdown-utils`
@@ -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-53`).
18
+ * It follows semantic versioning (e.g., `0.112.0-56`).
19
19
  *
20
20
  * @generated
21
21
  */
@@ -1,51 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
- /**
4
- * USE commitment definition
5
- *
6
- * The USE commitment indicates that the agent should utilize specific tools or capabilities
7
- * to access and interact with external systems when necessary.
8
- *
9
- * Supported USE types:
10
- * - USE BROWSER: Enables the agent to use a web browser tool
11
- * - USE SEARCH ENGINE (future): Enables search engine access
12
- * - USE DEEPSEARCH: Enables deeper research-oriented search access
13
- * - USE FILE SYSTEM (future): Enables file system operations
14
- * - USE MCP (future): Enables MCP server connections
15
- *
16
- * The content following the USE commitment is ignored (similar to NOTE).
17
- *
18
- * Example usage in agent source:
19
- *
20
- * ```book
21
- * USE BROWSER
22
- * USE SEARCH ENGINE
23
- * ```
24
- *
25
- * @private [🪔] Maybe export the commitments through some package
26
- */
27
- export declare class UseCommitmentDefinition extends BaseCommitmentDefinition<`USE${string}`> {
28
- constructor();
29
- /**
30
- * Short one-line description of USE commitments.
31
- */
32
- get description(): string;
33
- /**
34
- * Icon for this commitment.
35
- */
36
- get icon(): string;
37
- /**
38
- * Markdown documentation for USE commitment.
39
- */
40
- get documentation(): string;
41
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
42
- /**
43
- * Extracts the tool type from the USE commitment
44
- * This is used by the parsing logic
45
- */
46
- extractToolType(content: string): string | null;
47
- /**
48
- * Checks if this is a known USE type
49
- */
50
- isKnownUseType(useType: string): boolean;
51
- }
@@ -1,51 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
- /**
4
- * USE commitment definition
5
- *
6
- * The USE commitment indicates that the agent should utilize specific tools or capabilities
7
- * to access and interact with external systems when necessary.
8
- *
9
- * Supported USE types:
10
- * - USE BROWSER: Enables the agent to use a web browser tool
11
- * - USE SEARCH ENGINE (future): Enables search engine access
12
- * - USE DEEPSEARCH: Enables deeper research-oriented search access
13
- * - USE FILE SYSTEM (future): Enables file system operations
14
- * - USE MCP (future): Enables MCP server connections
15
- *
16
- * The content following the USE commitment is ignored (similar to NOTE).
17
- *
18
- * Example usage in agent source:
19
- *
20
- * ```book
21
- * USE BROWSER
22
- * USE SEARCH ENGINE
23
- * ```
24
- *
25
- * @private [🪔] Maybe export the commitments through some package
26
- */
27
- export declare class UseCommitmentDefinition extends BaseCommitmentDefinition<`USE${string}`> {
28
- constructor();
29
- /**
30
- * Short one-line description of USE commitments.
31
- */
32
- get description(): string;
33
- /**
34
- * Icon for this commitment.
35
- */
36
- get icon(): string;
37
- /**
38
- * Markdown documentation for USE commitment.
39
- */
40
- get documentation(): string;
41
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
42
- /**
43
- * Extracts the tool type from the USE commitment
44
- * This is used by the parsing logic
45
- */
46
- extractToolType(content: string): string | null;
47
- /**
48
- * Checks if this is a known USE type
49
- */
50
- isKnownUseType(useType: string): boolean;
51
- }