@promptbook/utils 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.
- package/README.md +37 -21
- package/esm/index.es.js +9 -11
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +4 -0
- package/esm/src/_packages/core.index.d.ts +0 -2
- package/esm/src/_packages/node.index.d.ts +40 -0
- package/esm/src/_packages/types.index.d.ts +18 -0
- package/esm/src/avatars/avatarAnimationScheduler.d.ts +4 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/esm/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
- package/esm/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
- package/esm/src/book-3.0/CliAgent.d.ts +66 -0
- package/esm/src/book-3.0/CliAgent.test.d.ts +1 -0
- package/esm/src/book-3.0/LiteAgent.d.ts +68 -0
- package/esm/src/book-3.0/LiteAgent.test.d.ts +1 -0
- package/esm/src/book-3.0/agentFolderPaths.d.ts +30 -0
- package/esm/src/book-3.0/cliAgentEnv.d.ts +33 -0
- package/esm/src/book-components/BookEditor/BookEditor.d.ts +6 -5
- package/esm/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
- package/esm/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
- package/esm/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
- package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
- package/esm/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
- package/esm/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
- package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
- package/esm/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
- package/esm/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
- package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/esm/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
- package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
- package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
- package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
- package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
- package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
- package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -1
- package/esm/src/book-components/icons/AboutIcon.d.ts +1 -1
- package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -1
- package/esm/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
- package/esm/src/book-components/icons/FullscreenIcon.d.ts +1 -1
- package/esm/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
- package/esm/src/cli/cli-commands/agent/chat.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent/exec.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent/run.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
- package/esm/src/cli/cli-commands/agent.d.ts +14 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +17 -1
- package/esm/src/cli/cli-commands/agents-server/run.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
- package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
- package/esm/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/server.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/esm/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
- package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
- package/esm/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
- package/esm/src/utils/isTimingSafeEqualString.d.ts +25 -0
- package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -2
- package/umd/index.umd.js +13 -13
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +4 -0
- package/umd/src/_packages/core.index.d.ts +0 -2
- package/umd/src/_packages/node.index.d.ts +40 -0
- package/umd/src/_packages/types.index.d.ts +18 -0
- package/umd/src/avatars/avatarAnimationScheduler.d.ts +4 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/umd/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
- package/umd/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
- package/umd/src/book-3.0/CliAgent.d.ts +66 -0
- package/umd/src/book-3.0/CliAgent.test.d.ts +1 -0
- package/umd/src/book-3.0/LiteAgent.d.ts +68 -0
- package/umd/src/book-3.0/LiteAgent.test.d.ts +1 -0
- package/umd/src/book-3.0/agentFolderPaths.d.ts +30 -0
- package/umd/src/book-3.0/cliAgentEnv.d.ts +33 -0
- package/umd/src/book-components/BookEditor/BookEditor.d.ts +6 -5
- package/umd/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
- package/umd/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
- package/umd/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
- package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
- package/umd/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
- package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
- package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
- package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
- package/umd/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
- package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/umd/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
- package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
- package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
- package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
- package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
- package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
- package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -1
- package/umd/src/book-components/icons/AboutIcon.d.ts +1 -1
- package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -1
- package/umd/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
- package/umd/src/book-components/icons/FullscreenIcon.d.ts +1 -1
- package/umd/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
- package/umd/src/cli/cli-commands/agent/chat.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent/exec.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent/run.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
- package/umd/src/cli/cli-commands/agent.d.ts +14 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +17 -1
- package/umd/src/cli/cli-commands/agents-server/run.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
- package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
- package/umd/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/server.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/umd/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
- package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
- package/umd/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
- package/umd/src/utils/isTimingSafeEqualString.d.ts +25 -0
- package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -26,7 +26,15 @@ export type TeamInternalAgentAccessHeadersOptions = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Resolves the internal token used by same-server TEAM calls.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
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
|
|
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():
|
|
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;
|
package/esm/src/version.d.ts
CHANGED
|
@@ -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-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-140`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/utils",
|
|
3
|
-
"version": "0.112.0
|
|
3
|
+
"version": "0.112.0",
|
|
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,
|
|
@@ -100,7 +100,6 @@
|
|
|
100
100
|
"types": "./esm/src/_packages/utils.index.d.ts",
|
|
101
101
|
"typings": "./esm/src/_packages/utils.index.d.ts",
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"crypto": "1.0.1",
|
|
104
103
|
"crypto-js": "4.2.0",
|
|
105
104
|
"spacetrim": "0.11.60",
|
|
106
105
|
"type-fest": "4.5.0"
|
package/umd/index.umd.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('spacetrim'), require('path'), require('crypto
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', 'path', 'crypto
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-utils"] = {}, global.spacetrim, global.path, global.
|
|
5
|
-
})(this, (function (exports, spacetrim, path,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('spacetrim'), require('path'), require('crypto-js'), require('crypto-js/enc-hex')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', 'path', 'crypto-js', 'crypto-js/enc-hex'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-utils"] = {}, global.spacetrim, global.path, global.CryptoJS, global.hexEncoder));
|
|
5
|
+
})(this, (function (exports, spacetrim, path, CryptoJS, hexEncoder) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
+
var CryptoJS__default = /*#__PURE__*/_interopDefaultLegacy(CryptoJS);
|
|
9
10
|
var hexEncoder__default = /*#__PURE__*/_interopDefaultLegacy(hexEncoder);
|
|
10
11
|
|
|
11
12
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
* @generated
|
|
23
24
|
* @see https://github.com/webgptorg/promptbook
|
|
24
25
|
*/
|
|
25
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0';
|
|
26
27
|
/**
|
|
27
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2453,7 +2454,7 @@
|
|
|
2453
2454
|
* @private internal helper function
|
|
2454
2455
|
*/
|
|
2455
2456
|
function $randomToken(randomness) {
|
|
2456
|
-
return
|
|
2457
|
+
return CryptoJS__default["default"].lib.WordArray.random(randomness).toString(CryptoJS__default["default"].enc.Hex);
|
|
2457
2458
|
}
|
|
2458
2459
|
// TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
2459
2460
|
// TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
@@ -3678,7 +3679,7 @@
|
|
|
3678
3679
|
* @public exported from `@promptbook/utils`
|
|
3679
3680
|
*/
|
|
3680
3681
|
function computeHash(value) {
|
|
3681
|
-
return
|
|
3682
|
+
return CryptoJS__default["default"].SHA256(hexEncoder__default["default"].parse(spacetrim.spaceTrim(valueToString(value)))).toString( /* hex */);
|
|
3682
3683
|
}
|
|
3683
3684
|
// TODO: [🥬][🥬] Use this ACRY
|
|
3684
3685
|
|
|
@@ -5983,6 +5984,11 @@
|
|
|
5983
5984
|
* - `isValidAgentUrl` *(this one)* which tests just agent URL
|
|
5984
5985
|
* - `isValidPipelineUrl` which tests just pipeline URL
|
|
5985
5986
|
*
|
|
5987
|
+
* Note: This is a pure structural validator and does not block private/internal network
|
|
5988
|
+
* addresses. Callers that fetch the URL server-side from an untrusted network context must
|
|
5989
|
+
* additionally apply the `assertSafeUrl` SSRF guard from the Agents Server before any
|
|
5990
|
+
* outbound request.
|
|
5991
|
+
*
|
|
5986
5992
|
* @public exported from `@promptbook/utils`
|
|
5987
5993
|
*/
|
|
5988
5994
|
function isValidAgentUrl(url) {
|
|
@@ -5996,12 +6002,6 @@
|
|
|
5996
6002
|
// TODO: [🐠]
|
|
5997
6003
|
return false;
|
|
5998
6004
|
}
|
|
5999
|
-
/*
|
|
6000
|
-
Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
|
|
6001
|
-
if (isUrlOnPrivateNetwork(url)) {
|
|
6002
|
-
return false;
|
|
6003
|
-
}
|
|
6004
|
-
*/
|
|
6005
6005
|
return true;
|
|
6006
6006
|
}
|
|
6007
6007
|
// TODO: [🐠] Maybe more info why the URL is invalid
|