@promptbook/documents 0.112.0-98 → 0.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +37 -21
  2. package/esm/index.es.js +10 -11
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/src/_packages/components.index.d.ts +4 -0
  5. package/esm/src/_packages/core.index.d.ts +0 -2
  6. package/esm/src/_packages/node.index.d.ts +40 -0
  7. package/esm/src/_packages/types.index.d.ts +18 -0
  8. package/esm/src/avatars/avatarAnimationScheduler.d.ts +4 -0
  9. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
  10. package/esm/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
  11. package/esm/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
  12. package/esm/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
  13. package/esm/src/book-3.0/CliAgent.d.ts +66 -0
  14. package/esm/src/book-3.0/CliAgent.test.d.ts +1 -0
  15. package/esm/src/book-3.0/LiteAgent.d.ts +68 -0
  16. package/esm/src/book-3.0/LiteAgent.test.d.ts +1 -0
  17. package/esm/src/book-3.0/agentFolderPaths.d.ts +30 -0
  18. package/esm/src/book-3.0/cliAgentEnv.d.ts +33 -0
  19. package/esm/src/book-components/BookEditor/BookEditor.d.ts +6 -5
  20. package/esm/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
  21. package/esm/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
  22. package/esm/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
  23. package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
  24. package/esm/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
  25. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
  26. package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
  27. package/esm/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
  28. package/esm/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
  29. package/esm/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
  30. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
  31. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
  32. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
  33. package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
  34. package/esm/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
  35. package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
  36. package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
  37. package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
  38. package/esm/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
  39. package/esm/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
  40. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
  41. package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  42. package/esm/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
  43. package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
  44. package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
  45. package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
  46. package/esm/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
  47. package/esm/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
  48. package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
  49. package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
  50. package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -1
  51. package/esm/src/book-components/icons/AboutIcon.d.ts +1 -1
  52. package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -1
  53. package/esm/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
  54. package/esm/src/book-components/icons/FullscreenIcon.d.ts +1 -1
  55. package/esm/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
  56. package/esm/src/cli/cli-commands/agent/chat.d.ts +10 -0
  57. package/esm/src/cli/cli-commands/agent/exec.d.ts +10 -0
  58. package/esm/src/cli/cli-commands/agent/run.test.d.ts +1 -0
  59. package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
  60. package/esm/src/cli/cli-commands/agent.d.ts +14 -0
  61. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +17 -1
  62. package/esm/src/cli/cli-commands/agents-server/run.d.ts +6 -0
  63. package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
  64. package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
  65. package/esm/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
  66. package/esm/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
  67. package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
  68. package/esm/src/cli/cli-commands/coder/server.d.ts +13 -0
  69. package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
  70. package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
  71. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
  72. package/esm/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
  73. package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  74. package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
  75. package/esm/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
  76. package/esm/src/utils/isTimingSafeEqualString.d.ts +25 -0
  77. package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
  78. package/esm/src/version.d.ts +1 -1
  79. package/package.json +2 -3
  80. package/umd/index.umd.js +14 -12
  81. package/umd/index.umd.js.map +1 -1
  82. package/umd/src/_packages/components.index.d.ts +4 -0
  83. package/umd/src/_packages/core.index.d.ts +0 -2
  84. package/umd/src/_packages/node.index.d.ts +40 -0
  85. package/umd/src/_packages/types.index.d.ts +18 -0
  86. package/umd/src/avatars/avatarAnimationScheduler.d.ts +4 -0
  87. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
  88. package/umd/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
  89. package/umd/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
  90. package/umd/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
  91. package/umd/src/book-3.0/CliAgent.d.ts +66 -0
  92. package/umd/src/book-3.0/CliAgent.test.d.ts +1 -0
  93. package/umd/src/book-3.0/LiteAgent.d.ts +68 -0
  94. package/umd/src/book-3.0/LiteAgent.test.d.ts +1 -0
  95. package/umd/src/book-3.0/agentFolderPaths.d.ts +30 -0
  96. package/umd/src/book-3.0/cliAgentEnv.d.ts +33 -0
  97. package/umd/src/book-components/BookEditor/BookEditor.d.ts +6 -5
  98. package/umd/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
  99. package/umd/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
  100. package/umd/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
  101. package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
  102. package/umd/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
  103. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
  104. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
  105. package/umd/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
  106. package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
  107. package/umd/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
  108. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
  109. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
  110. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
  111. package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
  112. package/umd/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
  113. package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
  114. package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
  115. package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
  116. package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
  117. package/umd/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
  118. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
  119. package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  120. package/umd/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
  121. package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
  122. package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
  123. package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
  124. package/umd/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
  125. package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
  126. package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
  127. package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
  128. package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -1
  129. package/umd/src/book-components/icons/AboutIcon.d.ts +1 -1
  130. package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -1
  131. package/umd/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
  132. package/umd/src/book-components/icons/FullscreenIcon.d.ts +1 -1
  133. package/umd/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
  134. package/umd/src/cli/cli-commands/agent/chat.d.ts +10 -0
  135. package/umd/src/cli/cli-commands/agent/exec.d.ts +10 -0
  136. package/umd/src/cli/cli-commands/agent/run.test.d.ts +1 -0
  137. package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
  138. package/umd/src/cli/cli-commands/agent.d.ts +14 -0
  139. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +17 -1
  140. package/umd/src/cli/cli-commands/agents-server/run.d.ts +6 -0
  141. package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
  142. package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
  143. package/umd/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
  144. package/umd/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
  145. package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
  146. package/umd/src/cli/cli-commands/coder/server.d.ts +13 -0
  147. package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
  148. package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
  149. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
  150. package/umd/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
  151. package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  152. package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
  153. package/umd/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
  154. package/umd/src/utils/isTimingSafeEqualString.d.ts +25 -0
  155. package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
  156. package/umd/src/version.d.ts +1 -1
@@ -60,6 +60,28 @@ export declare class AgentCollectionInSupabase {
60
60
  * Gets all agents in the collection
61
61
  */
62
62
  listAgents(): Promise<ReadonlyArray<AgentBasicInformation>>;
63
+ /**
64
+ * Finds one active agent profile by its human-readable name or permanent id.
65
+ *
66
+ * This keeps route-level lookups from loading the whole agent collection when only
67
+ * one canonical route identifier is needed.
68
+ *
69
+ * @param agentNameOrPermanentId - Agent name or stable permanent identifier.
70
+ * @returns Matching active agent profile or `null` when not found.
71
+ *
72
+ * @public exported from `@promptbook/core`
73
+ */
74
+ findAgentBasicInformation(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<AgentBasicInformation | null>;
75
+ /**
76
+ * Converts one database row into public agent information.
77
+ *
78
+ * @param row - Database row carrying the persisted profile snapshot.
79
+ * @param isVerbose - Whether profile-name mismatches should be logged.
80
+ * @returns Agent profile with canonical database name and permanent id.
81
+ *
82
+ * @private internal helper of `AgentCollectionInSupabase`
83
+ */
84
+ private mapAgentBasicInformationRow;
63
85
  /**
64
86
  * Retrieves the permanent ID of an agent by its name or permanent ID.
65
87
  */
@@ -26,7 +26,15 @@ export type TeamInternalAgentAccessHeadersOptions = {
26
26
  /**
27
27
  * Resolves the internal token used by same-server TEAM calls.
28
28
  *
29
- * @returns Hashed token, or `null` when the server does not have a private secret.
29
+ * `PROMPTBOOK_TEAM_AGENT_ACCESS_TOKEN` must be a dedicated secret falling
30
+ * back to `ADMIN_PASSWORD`, `SUPABASE_SERVICE_ROLE_KEY`, or any other shared
31
+ * credential would let a leak of one secret compromise both authentication
32
+ * boundaries (admin login and same-server teammate-agent access). When the
33
+ * dedicated variable is missing, this function returns `null` so the calling
34
+ * server fails closed — same-server TEAM access is disabled and no header is
35
+ * sent — instead of silently authorizing requests with the wrong secret.
36
+ *
37
+ * @returns Hashed token, or `null` when the dedicated secret is not configured.
30
38
  *
31
39
  * @private internal Agents Server access wiring
32
40
  */
@@ -6,7 +6,7 @@ import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
6
6
  *
7
7
  * It looks for environment variables:
8
8
  * - `process.env.OPENAI_API_KEY`
9
- * - `process.env.ANTHROPIC_CLAUDE_API_KEY`
9
+ * - `process.env.ANTHROPIC_API_KEY` (or the deprecated `process.env.ANTHROPIC_CLAUDE_API_KEY`)
10
10
  * - ...
11
11
  *
12
12
  * @see Environment variables documentation or .env file for required variables.
@@ -13,7 +13,7 @@ import type { CreateLlmToolsFromConfigurationOptions } from './createLlmToolsFro
13
13
  *
14
14
  * It looks for environment variables:
15
15
  * - `process.env.OPENAI_API_KEY`
16
- * - `process.env.ANTHROPIC_CLAUDE_API_KEY`
16
+ * - `process.env.ANTHROPIC_API_KEY` (or the deprecated `process.env.ANTHROPIC_CLAUDE_API_KEY`)
17
17
  * - ...
18
18
  *
19
19
  * @param options Configuration options for the LLM tools
@@ -1,7 +1,7 @@
1
- import { Converter as ShowdownConverter } from 'showdown';
1
+ import showdown from 'showdown';
2
2
  /**
3
3
  * Create a new showdown converter instance
4
4
  *
5
5
  * @private utility of `WebsiteScraper`
6
6
  */
7
- export declare function createShowdownConverter(): ShowdownConverter;
7
+ export declare function createShowdownConverter(): showdown.Converter;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Compares two strings in constant time to prevent timing attacks.
3
+ *
4
+ * Plain JavaScript `===` / `!==` string comparisons short-circuit on the first
5
+ * byte that differs, which lets a remote attacker who can measure response
6
+ * timing recover the expected value one byte at a time. This helper performs
7
+ * the comparison through Node's `timingSafeEqual`, which always inspects every
8
+ * byte of the equal-length buffers.
9
+ *
10
+ * Returning `false` early when the byte lengths differ does not expose
11
+ * character content — only length — which is an acceptable trade-off, since
12
+ * `timingSafeEqual` requires equal-length buffers and length is typically not
13
+ * secret.
14
+ *
15
+ * `null` and `undefined` inputs are treated as non-matching so callers can
16
+ * forward raw request values (for example `request.headers.get(name)`) without
17
+ * an extra guard.
18
+ *
19
+ * @param candidate - Value supplied by the caller (for example a request header or cookie).
20
+ * @param expected - Value to compare against (for example a configured secret).
21
+ * @returns `true` when both values are strings of equal length with identical bytes.
22
+ *
23
+ * @private internal helper function
24
+ */
25
+ export declare function isTimingSafeEqualString(candidate: string | null | undefined, expected: string | null | undefined): boolean;
@@ -8,6 +8,11 @@ import type { really_unknown } from '../../organization/really_unknown';
8
8
  * - `isValidAgentUrl` *(this one)* which tests just agent URL
9
9
  * - `isValidPipelineUrl` which tests just pipeline URL
10
10
  *
11
+ * Note: This is a pure structural validator and does not block private/internal network
12
+ * addresses. Callers that fetch the URL server-side from an untrusted network context must
13
+ * additionally apply the `assertSafeUrl` SSRF guard from the Agents Server before any
14
+ * outbound request.
15
+ *
11
16
  * @public exported from `@promptbook/utils`
12
17
  */
13
18
  export declare function isValidAgentUrl(url: really_unknown): url is string_agent_url;
@@ -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-97`).
18
+ * It follows semantic versioning (e.g., `0.112.0-140`).
19
19
  *
20
20
  * @generated
21
21
  */