@contentful/experience-design-system-cli 2.25.2-dev-build-5281fd5.0 → 2.25.2-dev-build-2e44481.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.25.2-dev-build-5281fd5.0",
3
+ "version": "2.25.2-dev-build-2e44481.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -204,7 +204,7 @@ async function selectAllComponents(agent, model, components, verbose, skillPathO
204
204
  let cliVersion = '';
205
205
  if (!cacheConfig.noCache) {
206
206
  try {
207
- promptHash = await hashPromptForSkill('select', skillPathOverride);
207
+ promptHash = await hashPromptForSkill('select', agent, model, skillPathOverride);
208
208
  cliVersion = await getCliCacheVersion();
209
209
  const db = openPipelineDb(cacheConfig.dbPath);
210
210
  try {
@@ -415,7 +415,7 @@ async function runGenerateSkill(skill, opts, verbose = false) {
415
415
  const db = openPipelineDb();
416
416
  let componentResults;
417
417
  try {
418
- const promptHash = await hashPromptForSkill('components', generatePromptPath);
418
+ const promptHash = await hashPromptForSkill('components', agent, model, generatePromptPath);
419
419
  componentResults = await runAllComponents(agent, model, db, sessionId, allComponents, tokensInline, tokenMapInline, verbose, opts.cache === false || process.env.EDS_NO_CACHE === '1', generatePromptPath, promptHash);
420
420
  }
421
421
  finally {
@@ -477,7 +477,7 @@ async function runGenerateSkill(skill, opts, verbose = false) {
477
477
  }
478
478
  sessionId = resolvedSessionId;
479
479
  await bindAnalyticsSessionId(resolvedSessionId);
480
- const tokenPromptHash = await hashPromptForSkill('tokens');
480
+ const tokenPromptHash = await hashPromptForSkill('tokens', agent, model);
481
481
  // Check cache before invoking agent
482
482
  if (!noCache) {
483
483
  const tokenCached = lookupCache(db, tokenInputHash, 'token_set', '__tokens__', tokenPromptHash);
@@ -9,7 +9,14 @@ export declare function hashFile(filePath: string): Promise<string>;
9
9
  * generation_cache so cache entries invalidate when the prompt itself changes
10
10
  * (including bundled-skill updates across CLI versions).
11
11
  *
12
+ * Also folds in the resolved agent and model: a cache hit must not stand in
13
+ * for an agent run that was never made with the currently requested
14
+ * agent/model, or `--agent`/`--model` overrides would appear to be ignored
15
+ * whenever a prior cache entry already exists for the same input/prompt.
16
+ *
12
17
  * @param skill — which skill (matches resolveSkillPath in prompt-builder)
18
+ * @param agent — resolved agent name for this run
19
+ * @param model — resolved model for this run (undefined resolves to the agent's default)
13
20
  * @param skillPathOverride — optional absolute/relative path to a custom prompt
14
21
  */
15
- export declare function hashPromptForSkill(skill: Skill, skillPathOverride?: string): Promise<string>;
22
+ export declare function hashPromptForSkill(skill: Skill, agent: string, model: string | undefined, skillPathOverride?: string): Promise<string>;
@@ -26,13 +26,19 @@ export async function hashFile(filePath) {
26
26
  * generation_cache so cache entries invalidate when the prompt itself changes
27
27
  * (including bundled-skill updates across CLI versions).
28
28
  *
29
+ * Also folds in the resolved agent and model: a cache hit must not stand in
30
+ * for an agent run that was never made with the currently requested
31
+ * agent/model, or `--agent`/`--model` overrides would appear to be ignored
32
+ * whenever a prior cache entry already exists for the same input/prompt.
33
+ *
29
34
  * @param skill — which skill (matches resolveSkillPath in prompt-builder)
35
+ * @param agent — resolved agent name for this run
36
+ * @param model — resolved model for this run (undefined resolves to the agent's default)
30
37
  * @param skillPathOverride — optional absolute/relative path to a custom prompt
31
38
  */
32
- export async function hashPromptForSkill(skill, skillPathOverride) {
33
- if (skillPathOverride) {
34
- return hashFile(resolve(skillPathOverride));
35
- }
36
- const bundled = resolveSkillPath(skill);
37
- return hashFile(bundled);
39
+ export async function hashPromptForSkill(skill, agent, model, skillPathOverride) {
40
+ const promptHash = skillPathOverride
41
+ ? await hashFile(resolve(skillPathOverride))
42
+ : await hashFile(resolveSkillPath(skill));
43
+ return hashContent(`${promptHash}|${agent}|${model ?? ''}`);
38
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.25.2-dev-build-5281fd5.0",
3
+ "version": "2.25.2-dev-build-2e44481.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,10 +34,10 @@
34
34
  "react": "^18.3.1",
35
35
  "react-devtools-core": "^4.19.1",
36
36
  "react-dom": "^18.3.1",
37
- "@contentful/experience-design-system-client": "2.25.2-dev-build-5281fd5.0",
38
- "@contentful/experience-design-system-generation": "2.25.2-dev-build-5281fd5.0",
39
- "@contentful/experience-design-system-types": "2.25.2-dev-build-5281fd5.0",
40
- "@contentful/experience-design-system-extraction": "2.25.2-dev-build-5281fd5.0"
37
+ "@contentful/experience-design-system-client": "2.25.2-dev-build-2e44481.0",
38
+ "@contentful/experience-design-system-generation": "2.25.2-dev-build-2e44481.0",
39
+ "@contentful/experience-design-system-types": "2.25.2-dev-build-2e44481.0",
40
+ "@contentful/experience-design-system-extraction": "2.25.2-dev-build-2e44481.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@tsconfig/node24": "^24.0.4",