@use-lattice/litmus 0.121.3
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/LICENSE +19 -0
- package/dist/src/accounts-Bt1oJb1Z.cjs +219 -0
- package/dist/src/accounts-DjOU8Rm3.js +178 -0
- package/dist/src/agentic-utils-D03IiXQc.js +153 -0
- package/dist/src/agentic-utils-Dh7xaMQM.cjs +180 -0
- package/dist/src/agents-C6BIMlZa.js +231 -0
- package/dist/src/agents-DvIpNX1L.cjs +666 -0
- package/dist/src/agents-ZP0RP9vV.cjs +231 -0
- package/dist/src/agents-maJXdjbR.js +665 -0
- package/dist/src/aimlapi-BTbQjG2E.cjs +30 -0
- package/dist/src/aimlapi-CwMxqfXP.js +30 -0
- package/dist/src/audio-BBUdvsde.cjs +97 -0
- package/dist/src/audio-D5DPZ7I-.js +97 -0
- package/dist/src/base-BEysXrkq.cjs +222 -0
- package/dist/src/base-C451JQfq.js +193 -0
- package/dist/src/blobs-BY8MDmpo.js +230 -0
- package/dist/src/blobs-BgcNn97m.cjs +256 -0
- package/dist/src/cache-BBE_lsTA.cjs +4 -0
- package/dist/src/cache-BkrqU5Ba.js +237 -0
- package/dist/src/cache-DsCxFlsZ.cjs +297 -0
- package/dist/src/chat-CPJWDP6a.cjs +289 -0
- package/dist/src/chat-CXX3xzkk.cjs +811 -0
- package/dist/src/chat-CcDgZFJ4.js +787 -0
- package/dist/src/chat-Dz5ZeGO2.js +289 -0
- package/dist/src/chatkit-Dw0mKkML.cjs +1158 -0
- package/dist/src/chatkit-swAIVuea.js +1157 -0
- package/dist/src/chunk-DEq-mXcV.js +15 -0
- package/dist/src/claude-agent-sdk-BXZJtOg6.js +379 -0
- package/dist/src/claude-agent-sdk-CkfyjDoG.cjs +383 -0
- package/dist/src/cloudflare-ai-BzpJcqUH.js +161 -0
- package/dist/src/cloudflare-ai-Cmy_R1y2.cjs +161 -0
- package/dist/src/cloudflare-gateway-B9tVQKok.cjs +272 -0
- package/dist/src/cloudflare-gateway-DrD3ew3H.js +272 -0
- package/dist/src/codex-sdk-Dezj9Nwm.js +1056 -0
- package/dist/src/codex-sdk-Dl9D4k5B.cjs +1060 -0
- package/dist/src/cometapi-C-9YvCHC.js +54 -0
- package/dist/src/cometapi-DHgDKoO2.cjs +54 -0
- package/dist/src/completion-B8Ctyxpr.js +120 -0
- package/dist/src/completion-Cxrt08sj.cjs +131 -0
- package/dist/src/createHash-BwgE13yv.cjs +27 -0
- package/dist/src/createHash-DmPQkvBh.js +15 -0
- package/dist/src/docker-BiqcTwLv.js +80 -0
- package/dist/src/docker-C7tEJnP-.cjs +80 -0
- package/dist/src/esm-C62Zofr1.cjs +409 -0
- package/dist/src/esm-DMVc93eh.js +379 -0
- package/dist/src/evalResult-C3NJPQOo.cjs +301 -0
- package/dist/src/evalResult-C7JJAPBb.js +295 -0
- package/dist/src/evalResult-DoVTZZWI.cjs +2 -0
- package/dist/src/extractor-DnMD3fwt.cjs +391 -0
- package/dist/src/extractor-DtlL28vL.js +374 -0
- package/dist/src/fetch-BTxakTSg.cjs +1133 -0
- package/dist/src/fetch-DQckpUFz.js +928 -0
- package/dist/src/fileExtensions-DnqA1y9x.js +85 -0
- package/dist/src/fileExtensions-bYh77CN8.cjs +114 -0
- package/dist/src/genaiTracer-CyZrmaK0.cjs +268 -0
- package/dist/src/genaiTracer-D3fD9dNV.js +256 -0
- package/dist/src/graders-BNscxFrU.js +13644 -0
- package/dist/src/graders-D2oE9Msq.js +2 -0
- package/dist/src/graders-c0Ez_w-9.cjs +2 -0
- package/dist/src/graders-d0F2M3e9.cjs +14056 -0
- package/dist/src/image-0ZhE0VlR.cjs +280 -0
- package/dist/src/image-CWE1pdNv.js +257 -0
- package/dist/src/image-D9ZK6hwL.js +163 -0
- package/dist/src/image-DKZgZITg.cjs +163 -0
- package/dist/src/index.cjs +11366 -0
- package/dist/src/index.d.cts +19640 -0
- package/dist/src/index.d.ts +19641 -0
- package/dist/src/index.js +11306 -0
- package/dist/src/invariant-Ddh24eXh.js +25 -0
- package/dist/src/invariant-kfQ8Bu82.cjs +30 -0
- package/dist/src/knowledgeBase-BgPyGFUd.cjs +122 -0
- package/dist/src/knowledgeBase-DyHilYaP.js +122 -0
- package/dist/src/litellm-CyMeneHS.js +135 -0
- package/dist/src/litellm-DWDF73yF.cjs +135 -0
- package/dist/src/logger-C40ZGil9.js +717 -0
- package/dist/src/logger-DyfK9PBt.cjs +917 -0
- package/dist/src/luma-ray-BAU9X_ep.cjs +315 -0
- package/dist/src/luma-ray-nwVseBbv.js +313 -0
- package/dist/src/messages-B5ADWTTv.js +245 -0
- package/dist/src/messages-BCnZfqrS.cjs +257 -0
- package/dist/src/meteor-DLZZ3osF.cjs +134 -0
- package/dist/src/meteor-DUiCJRC-.js +134 -0
- package/dist/src/modelslab-00cveB8L.cjs +163 -0
- package/dist/src/modelslab-D9sCU_L7.js +163 -0
- package/dist/src/nova-reel-CTapvqYH.js +276 -0
- package/dist/src/nova-reel-DlWuuroF.cjs +278 -0
- package/dist/src/nova-sonic-5UPWfeMv.cjs +363 -0
- package/dist/src/nova-sonic-BhSwQNym.js +363 -0
- package/dist/src/openai-BWrJK9d8.cjs +52 -0
- package/dist/src/openai-DumO8WQn.js +47 -0
- package/dist/src/openclaw-B8brrjC_.cjs +577 -0
- package/dist/src/openclaw-Bkayww9q.js +571 -0
- package/dist/src/opencode-sdk-7xjoDNiM.cjs +562 -0
- package/dist/src/opencode-sdk-SGwAPxht.js +558 -0
- package/dist/src/otlpReceiver-CoAHfAN9.cjs +15 -0
- package/dist/src/otlpReceiver-oO3EQwI9.js +14 -0
- package/dist/src/providerRegistry-4yjhaEM8.js +45 -0
- package/dist/src/providerRegistry-DhV4rJIc.cjs +50 -0
- package/dist/src/providers-B5RJVG-7.cjs +33609 -0
- package/dist/src/providers-BdmZCLzV.js +33262 -0
- package/dist/src/providers-CxtRxn8e.js +2 -0
- package/dist/src/providers-DnQLNbx1.cjs +3 -0
- package/dist/src/pythonUtils-BD0druiM.cjs +275 -0
- package/dist/src/pythonUtils-IBhn5YGR.js +249 -0
- package/dist/src/quiverai-BDOwZBsM.cjs +213 -0
- package/dist/src/quiverai-D3JTF5lD.js +213 -0
- package/dist/src/responses-B2LCDCXZ.js +667 -0
- package/dist/src/responses-BvNm4Xv9.cjs +685 -0
- package/dist/src/rubyUtils-B0NwnfpY.cjs +245 -0
- package/dist/src/rubyUtils-BroxzZ7c.cjs +2 -0
- package/dist/src/rubyUtils-hqVw5UvJ.js +222 -0
- package/dist/src/sagemaker-Cno2V-Sx.js +689 -0
- package/dist/src/sagemaker-fV_KUgs5.cjs +691 -0
- package/dist/src/server-BOuAXb06.cjs +238 -0
- package/dist/src/server-CtI-EWzm.cjs +2 -0
- package/dist/src/server-Cy3DZymt.js +189 -0
- package/dist/src/slack-CP8xBePa.js +135 -0
- package/dist/src/slack-DSQ1yXVb.cjs +135 -0
- package/dist/src/store-BwDDaBjb.cjs +246 -0
- package/dist/src/store-DcbLC593.cjs +2 -0
- package/dist/src/store-IGpqMIkv.js +240 -0
- package/dist/src/tables-3Q2cL7So.cjs +373 -0
- package/dist/src/tables-Bi2fjr4W.js +288 -0
- package/dist/src/telemetry-Bg2WqF79.js +161 -0
- package/dist/src/telemetry-D0x6u5kX.cjs +166 -0
- package/dist/src/telemetry-DXNimrI0.cjs +2 -0
- package/dist/src/text-B_UCRPp2.js +22 -0
- package/dist/src/text-CW1cyrwj.cjs +33 -0
- package/dist/src/tokenUsageUtils-NYT-WKS6.js +138 -0
- package/dist/src/tokenUsageUtils-bVa1ga6f.cjs +173 -0
- package/dist/src/transcription-Cl_W16Pr.js +122 -0
- package/dist/src/transcription-yt1EecY8.cjs +124 -0
- package/dist/src/transform-BCtGrl_W.cjs +228 -0
- package/dist/src/transform-Bv6gG2MJ.cjs +1688 -0
- package/dist/src/transform-CY1wbpRy.js +1507 -0
- package/dist/src/transform-DU8rUL9P.cjs +2 -0
- package/dist/src/transform-yWaShiKr.js +216 -0
- package/dist/src/transformersAvailability-BGkzavwb.js +35 -0
- package/dist/src/transformersAvailability-DKoRtQLy.cjs +35 -0
- package/dist/src/types-5aqHpBwE.cjs +3769 -0
- package/dist/src/types-Bn6D9c4U.js +3300 -0
- package/dist/src/util-BkKlTkI2.js +293 -0
- package/dist/src/util-CTh0bfOm.cjs +1119 -0
- package/dist/src/util-D17oBwo7.cjs +328 -0
- package/dist/src/util-DsS_-v4p.js +613 -0
- package/dist/src/util-DuntT1Ga.js +951 -0
- package/dist/src/util-aWjdCYMI.cjs +667 -0
- package/dist/src/utils-CisQwpjA.js +94 -0
- package/dist/src/utils-yWamDvmz.cjs +123 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/drizzle/0000_lush_hellion.sql +36 -0
- package/drizzle/0001_wide_calypso.sql +3 -0
- package/drizzle/0002_tidy_juggernaut.sql +1 -0
- package/drizzle/0003_lively_naoko.sql +8 -0
- package/drizzle/0004_minor_peter_quill.sql +19 -0
- package/drizzle/0005_silky_millenium_guard.sql +2 -0
- package/drizzle/0006_harsh_caretaker.sql +42 -0
- package/drizzle/0007_cloudy_wong.sql +1 -0
- package/drizzle/0008_broad_boomer.sql +2 -0
- package/drizzle/0009_strong_marten_broadcloak.sql +19 -0
- package/drizzle/0010_needy_bishop.sql +11 -0
- package/drizzle/0011_moaning_millenium_guard.sql +1 -0
- package/drizzle/0012_late_marten_broadcloak.sql +2 -0
- package/drizzle/0013_previous_dormammu.sql +9 -0
- package/drizzle/0014_lazy_captain_universe.sql +2 -0
- package/drizzle/0015_zippy_wallop.sql +29 -0
- package/drizzle/0016_jazzy_zemo.sql +2 -0
- package/drizzle/0017_reflective_praxagora.sql +4 -0
- package/drizzle/0018_fat_vanisher.sql +22 -0
- package/drizzle/0019_new_clint_barton.sql +8 -0
- package/drizzle/0020_skinny_maverick.sql +1 -0
- package/drizzle/0021_mysterious_madelyne_pryor.sql +13 -0
- package/drizzle/0022_sleepy_ultimo.sql +25 -0
- package/drizzle/0023_wooden_mandrill.sql +2 -0
- package/drizzle/AGENTS.md +68 -0
- package/drizzle/CLAUDE.md +1 -0
- package/drizzle/meta/0000_snapshot.json +221 -0
- package/drizzle/meta/0001_snapshot.json +214 -0
- package/drizzle/meta/0002_snapshot.json +221 -0
- package/drizzle/meta/0005_snapshot.json +369 -0
- package/drizzle/meta/0006_snapshot.json +638 -0
- package/drizzle/meta/0007_snapshot.json +640 -0
- package/drizzle/meta/0008_snapshot.json +649 -0
- package/drizzle/meta/0009_snapshot.json +554 -0
- package/drizzle/meta/0010_snapshot.json +619 -0
- package/drizzle/meta/0011_snapshot.json +627 -0
- package/drizzle/meta/0012_snapshot.json +639 -0
- package/drizzle/meta/0013_snapshot.json +717 -0
- package/drizzle/meta/0014_snapshot.json +717 -0
- package/drizzle/meta/0015_snapshot.json +897 -0
- package/drizzle/meta/0016_snapshot.json +1031 -0
- package/drizzle/meta/0018_snapshot.json +1210 -0
- package/drizzle/meta/0019_snapshot.json +1165 -0
- package/drizzle/meta/0020_snapshot.json +1232 -0
- package/drizzle/meta/0021_snapshot.json +1311 -0
- package/drizzle/meta/0022_snapshot.json +1481 -0
- package/drizzle/meta/0023_snapshot.json +1496 -0
- package/drizzle/meta/_journal.json +174 -0
- package/package.json +240 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { x as getEnvString } from "./logger-C40ZGil9.js";
|
|
2
|
+
import { n as sha256 } from "./createHash-DmPQkvBh.js";
|
|
3
|
+
//#region src/prompts/constants.ts
|
|
4
|
+
const PROMPT_DELIMITER = getEnvString("PROMPTFOO_PROMPT_SEPARATOR") || "---";
|
|
5
|
+
const VALID_FILE_EXTENSIONS = [
|
|
6
|
+
".cjs",
|
|
7
|
+
".cts",
|
|
8
|
+
".j2",
|
|
9
|
+
".js",
|
|
10
|
+
".json",
|
|
11
|
+
".jsonl",
|
|
12
|
+
".md",
|
|
13
|
+
".mjs",
|
|
14
|
+
".mts",
|
|
15
|
+
".py",
|
|
16
|
+
".ts",
|
|
17
|
+
".txt",
|
|
18
|
+
".yml",
|
|
19
|
+
".yaml"
|
|
20
|
+
];
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/models/prompt.ts
|
|
23
|
+
/**
|
|
24
|
+
* Generates a unique identifier for a prompt based on its properties.
|
|
25
|
+
*
|
|
26
|
+
* Priority order:
|
|
27
|
+
* 1. If label is truthy, hash the label
|
|
28
|
+
* 2. If id is truthy, hash the id
|
|
29
|
+
* 3. Otherwise, hash the raw content (stringified if object)
|
|
30
|
+
*
|
|
31
|
+
* @param prompt - The prompt object to generate an ID for
|
|
32
|
+
* @returns A SHA-256 hash string
|
|
33
|
+
*/
|
|
34
|
+
function generateIdFromPrompt(prompt) {
|
|
35
|
+
if (prompt.label) return sha256(prompt.label);
|
|
36
|
+
if (prompt.id) return sha256(prompt.id);
|
|
37
|
+
return sha256(typeof prompt.raw === "object" ? JSON.stringify(prompt.raw) : prompt.raw);
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/prompts/utils.ts
|
|
41
|
+
/**
|
|
42
|
+
* Determines if a string is a valid file path.
|
|
43
|
+
* @param str - The string to check.
|
|
44
|
+
* @returns True if the string is a valid file path, false otherwise.
|
|
45
|
+
*/
|
|
46
|
+
function maybeFilePath(str) {
|
|
47
|
+
if (typeof str !== "string") throw new Error(`Invalid input: ${JSON.stringify(str)}`);
|
|
48
|
+
if ([
|
|
49
|
+
"\n",
|
|
50
|
+
"portkey://",
|
|
51
|
+
"langfuse://",
|
|
52
|
+
"helicone://"
|
|
53
|
+
].some((substring) => str.includes(substring))) return false;
|
|
54
|
+
return str.startsWith("file://") || VALID_FILE_EXTENSIONS.some((ext) => {
|
|
55
|
+
const tokens = str.split(":");
|
|
56
|
+
return tokens.pop()?.endsWith(ext) || tokens.pop()?.endsWith(ext);
|
|
57
|
+
}) || str.charAt(str.length - 3) === "." || str.charAt(str.length - 4) === "." || str.includes("*") || str.includes("/") || str.includes("\\");
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Normalizes the input prompt to an array of prompts, rejecting invalid and empty inputs.
|
|
61
|
+
* @param promptPathOrGlobs - The input prompt.
|
|
62
|
+
* @returns The normalized prompts.
|
|
63
|
+
* @throws If the input is invalid or empty.
|
|
64
|
+
*/
|
|
65
|
+
function normalizeInput(promptPathOrGlobs) {
|
|
66
|
+
if (!promptPathOrGlobs || (typeof promptPathOrGlobs === "string" || Array.isArray(promptPathOrGlobs)) && promptPathOrGlobs.length === 0) throw new Error(`Invalid input prompt: ${JSON.stringify(promptPathOrGlobs)}`);
|
|
67
|
+
if (typeof promptPathOrGlobs === "string") return [{ raw: promptPathOrGlobs }];
|
|
68
|
+
if (Array.isArray(promptPathOrGlobs)) return promptPathOrGlobs.map((promptPathOrGlob, _index) => {
|
|
69
|
+
if (typeof promptPathOrGlob === "string") return { raw: promptPathOrGlob };
|
|
70
|
+
return {
|
|
71
|
+
raw: promptPathOrGlob.raw || promptPathOrGlob.id,
|
|
72
|
+
...promptPathOrGlob
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
if (typeof promptPathOrGlobs === "object" && Object.keys(promptPathOrGlobs).length) return Object.entries(promptPathOrGlobs).map(([raw, key]) => ({
|
|
76
|
+
label: key,
|
|
77
|
+
raw
|
|
78
|
+
}));
|
|
79
|
+
throw new Error(`Invalid input prompt: ${JSON.stringify(promptPathOrGlobs)}`);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generates a hash identifier for a prompt.
|
|
83
|
+
* This is an alias for generateIdFromPrompt for backward compatibility.
|
|
84
|
+
*
|
|
85
|
+
* @param prompt - The prompt to hash
|
|
86
|
+
* @returns A SHA-256 hash string
|
|
87
|
+
*/
|
|
88
|
+
function hashPrompt(prompt) {
|
|
89
|
+
return generateIdFromPrompt(prompt);
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { PROMPT_DELIMITER as a, generateIdFromPrompt as i, maybeFilePath as n, normalizeInput as r, hashPrompt as t };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=utils-CisQwpjA.js.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
const require_logger = require("./logger-DyfK9PBt.cjs");
|
|
2
|
+
const require_createHash = require("./createHash-BwgE13yv.cjs");
|
|
3
|
+
//#region src/prompts/constants.ts
|
|
4
|
+
const PROMPT_DELIMITER = require_logger.getEnvString("PROMPTFOO_PROMPT_SEPARATOR") || "---";
|
|
5
|
+
const VALID_FILE_EXTENSIONS = [
|
|
6
|
+
".cjs",
|
|
7
|
+
".cts",
|
|
8
|
+
".j2",
|
|
9
|
+
".js",
|
|
10
|
+
".json",
|
|
11
|
+
".jsonl",
|
|
12
|
+
".md",
|
|
13
|
+
".mjs",
|
|
14
|
+
".mts",
|
|
15
|
+
".py",
|
|
16
|
+
".ts",
|
|
17
|
+
".txt",
|
|
18
|
+
".yml",
|
|
19
|
+
".yaml"
|
|
20
|
+
];
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/models/prompt.ts
|
|
23
|
+
/**
|
|
24
|
+
* Generates a unique identifier for a prompt based on its properties.
|
|
25
|
+
*
|
|
26
|
+
* Priority order:
|
|
27
|
+
* 1. If label is truthy, hash the label
|
|
28
|
+
* 2. If id is truthy, hash the id
|
|
29
|
+
* 3. Otherwise, hash the raw content (stringified if object)
|
|
30
|
+
*
|
|
31
|
+
* @param prompt - The prompt object to generate an ID for
|
|
32
|
+
* @returns A SHA-256 hash string
|
|
33
|
+
*/
|
|
34
|
+
function generateIdFromPrompt(prompt) {
|
|
35
|
+
if (prompt.label) return require_createHash.sha256(prompt.label);
|
|
36
|
+
if (prompt.id) return require_createHash.sha256(prompt.id);
|
|
37
|
+
return require_createHash.sha256(typeof prompt.raw === "object" ? JSON.stringify(prompt.raw) : prompt.raw);
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/prompts/utils.ts
|
|
41
|
+
/**
|
|
42
|
+
* Determines if a string is a valid file path.
|
|
43
|
+
* @param str - The string to check.
|
|
44
|
+
* @returns True if the string is a valid file path, false otherwise.
|
|
45
|
+
*/
|
|
46
|
+
function maybeFilePath(str) {
|
|
47
|
+
if (typeof str !== "string") throw new Error(`Invalid input: ${JSON.stringify(str)}`);
|
|
48
|
+
if ([
|
|
49
|
+
"\n",
|
|
50
|
+
"portkey://",
|
|
51
|
+
"langfuse://",
|
|
52
|
+
"helicone://"
|
|
53
|
+
].some((substring) => str.includes(substring))) return false;
|
|
54
|
+
return str.startsWith("file://") || VALID_FILE_EXTENSIONS.some((ext) => {
|
|
55
|
+
const tokens = str.split(":");
|
|
56
|
+
return tokens.pop()?.endsWith(ext) || tokens.pop()?.endsWith(ext);
|
|
57
|
+
}) || str.charAt(str.length - 3) === "." || str.charAt(str.length - 4) === "." || str.includes("*") || str.includes("/") || str.includes("\\");
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Normalizes the input prompt to an array of prompts, rejecting invalid and empty inputs.
|
|
61
|
+
* @param promptPathOrGlobs - The input prompt.
|
|
62
|
+
* @returns The normalized prompts.
|
|
63
|
+
* @throws If the input is invalid or empty.
|
|
64
|
+
*/
|
|
65
|
+
function normalizeInput(promptPathOrGlobs) {
|
|
66
|
+
if (!promptPathOrGlobs || (typeof promptPathOrGlobs === "string" || Array.isArray(promptPathOrGlobs)) && promptPathOrGlobs.length === 0) throw new Error(`Invalid input prompt: ${JSON.stringify(promptPathOrGlobs)}`);
|
|
67
|
+
if (typeof promptPathOrGlobs === "string") return [{ raw: promptPathOrGlobs }];
|
|
68
|
+
if (Array.isArray(promptPathOrGlobs)) return promptPathOrGlobs.map((promptPathOrGlob, _index) => {
|
|
69
|
+
if (typeof promptPathOrGlob === "string") return { raw: promptPathOrGlob };
|
|
70
|
+
return {
|
|
71
|
+
raw: promptPathOrGlob.raw || promptPathOrGlob.id,
|
|
72
|
+
...promptPathOrGlob
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
if (typeof promptPathOrGlobs === "object" && Object.keys(promptPathOrGlobs).length) return Object.entries(promptPathOrGlobs).map(([raw, key]) => ({
|
|
76
|
+
label: key,
|
|
77
|
+
raw
|
|
78
|
+
}));
|
|
79
|
+
throw new Error(`Invalid input prompt: ${JSON.stringify(promptPathOrGlobs)}`);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generates a hash identifier for a prompt.
|
|
83
|
+
* This is an alias for generateIdFromPrompt for backward compatibility.
|
|
84
|
+
*
|
|
85
|
+
* @param prompt - The prompt to hash
|
|
86
|
+
* @returns A SHA-256 hash string
|
|
87
|
+
*/
|
|
88
|
+
function hashPrompt(prompt) {
|
|
89
|
+
return generateIdFromPrompt(prompt);
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
Object.defineProperty(exports, "PROMPT_DELIMITER", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function() {
|
|
95
|
+
return PROMPT_DELIMITER;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, "generateIdFromPrompt", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function() {
|
|
101
|
+
return generateIdFromPrompt;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(exports, "hashPrompt", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function() {
|
|
107
|
+
return hashPrompt;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(exports, "maybeFilePath", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function() {
|
|
113
|
+
return maybeFilePath;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(exports, "normalizeInput", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function() {
|
|
119
|
+
return normalizeInput;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=utils-yWamDvmz.cjs.map
|