@contentful/experience-design-system-generation 2.35.1-dev-build-f520d7cb.0 → 2.35.1-dev-build-459d7e23.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 +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/progress.d.ts +2 -2
- package/dist/src/progress.js +2 -2
- package/dist/src/services/prompts/helpers/build-preamble.js +4 -2
- package/dist/src/services/prompts/helpers/build-skill-preambles.d.ts +2 -0
- package/dist/src/services/prompts/helpers/build-skill-preambles.js +31 -0
- package/dist/src/services/prompts/helpers/resolve-skill-file.js +1 -0
- package/dist/src/types/prompt.d.ts +6 -1
- package/package.json +2 -2
- package/skills/debate-select.md +23 -0
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-generation",
|
|
3
|
-
"version": "2.35.1-dev-build-
|
|
3
|
+
"version": "2.35.1-dev-build-459d7e23.0",
|
|
4
4
|
"description": "Agent-invocation and skill-prompt engine for the Contentful Experience Design System SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { AGENT_NAMES, AGENT_BINARIES, DEFAULT_AGENT_NAME, isAgentName } from './
|
|
|
2
2
|
export type { AgentName } from './agent-names.js';
|
|
3
3
|
export type { AgentAuthStatus, AgentDebugEvent, AgentRunResult } from './types/agent.js';
|
|
4
4
|
export type { ClassifyComponentCall, ClassifyPropCall, ClassifySlotCall, ExcludePropCall, MapTokenPropCall, ParsedMapTokenPropToolCalls, ParsedSelectToolCalls, ParsedTokenToolCalls, ParsedToolCalls, RejectComponentCall, SelectComponentCall, SelectToolCall, SelectionSlotEvidence, SelectionSlotEvidenceCitation, SetGroupCall, SetTokenCall, ToolCall, TokenToolCall, } from './types/tool-calls.js';
|
|
5
|
-
export type { ComponentSourceRef, GeneratedCdf, Mode, PromptOptions, Skill } from './types/prompt.js';
|
|
5
|
+
export type { ComponentSourceRef, DebateRole, GeneratedCdf, Mode, PromptOptions, Skill } from './types/prompt.js';
|
|
6
6
|
export { createGenerationEndpoint } from './controller/create-generation-endpoint.js';
|
|
7
7
|
export type { GenerationEndpoint, GenerationEndpointOptions, GenerationEndpointRequest, GenerationEndpointResponse, } from './controller/create-generation-endpoint.js';
|
|
8
8
|
export { executeGenerationOrchestrator } from './orchestrator/execute-generation-orchestrator.js';
|
package/dist/src/progress.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Formats a structured generation-progress line for the wizard parser.
|
|
3
3
|
*
|
|
4
|
-
* Emitted at terminal completion of each component (success
|
|
5
|
-
*
|
|
4
|
+
* Emitted at terminal completion of each component (success or final
|
|
5
|
+
* failure). `done` represents the count of completed
|
|
6
6
|
* components, which is monotonically non-decreasing — unlike the legacy
|
|
7
7
|
* `[index+1/total]` line, which reports input position.
|
|
8
8
|
*/
|
package/dist/src/progress.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Formats a structured generation-progress line for the wizard parser.
|
|
3
3
|
*
|
|
4
|
-
* Emitted at terminal completion of each component (success
|
|
5
|
-
*
|
|
4
|
+
* Emitted at terminal completion of each component (success or final
|
|
5
|
+
* failure). `done` represents the count of completed
|
|
6
6
|
* components, which is monotonically non-decreasing — unlike the legacy
|
|
7
7
|
* `[index+1/total]` line, which reports input position.
|
|
8
8
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { inferFenceLang, filterDesignTokenProps, buildTokenCandidateSections } from './format-token-candidates.js';
|
|
2
2
|
import { formatSourceRefsSection } from './format-source-refs.js';
|
|
3
|
-
import { buildComponentsAutonomousPreamble, buildSelectAutonomousPreamble, buildMapTokensAutonomousPreamble, buildTokensAutonomousPreamble, } from './build-skill-preambles.js';
|
|
3
|
+
import { buildComponentsAutonomousPreamble, buildDebateSelectAutonomousPreamble, buildSelectAutonomousPreamble, buildMapTokensAutonomousPreamble, buildTokensAutonomousPreamble, } from './build-skill-preambles.js';
|
|
4
4
|
export function buildPreamble(options) {
|
|
5
|
-
const { skill, rawComponentsInline, propBucketsInline, rawTokensInline, rawTokensFilename, tokensInline, tokenMapInline, generatedCdf, tokenTree, componentSourceRefs, existingComponentsInline, existingTokensInline, componentAllowlistInline, } = options;
|
|
5
|
+
const { skill, rawComponentsInline, propBucketsInline, rawTokensInline, rawTokensFilename, tokensInline, tokenMapInline, generatedCdf, tokenTree, componentSourceRefs, existingComponentsInline, existingTokensInline, componentAllowlistInline, debateRole, disagreementInline, } = options;
|
|
6
6
|
const sections = [];
|
|
7
7
|
if (existingComponentsInline) {
|
|
8
8
|
sections.push(`Existing components in the target Contentful space (JSON) — use for alignment, not as a hard filter:\n\`\`\`json\n${existingComponentsInline}\n\`\`\``);
|
|
@@ -45,6 +45,8 @@ export function buildPreamble(options) {
|
|
|
45
45
|
return buildComponentsAutonomousPreamble(inputBlock);
|
|
46
46
|
if (skill === 'select')
|
|
47
47
|
return buildSelectAutonomousPreamble(inputBlock);
|
|
48
|
+
if (skill === 'debate-select')
|
|
49
|
+
return buildDebateSelectAutonomousPreamble(inputBlock, debateRole, disagreementInline);
|
|
48
50
|
if (skill === 'map-tokens')
|
|
49
51
|
return buildMapTokensAutonomousPreamble(inputBlock);
|
|
50
52
|
return buildTokensAutonomousPreamble(inputBlock);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { DebateRole } from '../../../types/prompt.js';
|
|
1
2
|
export declare function buildComponentsAutonomousPreamble(inputBlock: string): string;
|
|
2
3
|
export declare function buildSelectAutonomousPreamble(inputBlock: string): string;
|
|
3
4
|
export declare function buildMapTokensAutonomousPreamble(inputBlock: string): string;
|
|
4
5
|
export declare function buildTokensAutonomousPreamble(inputBlock: string): string;
|
|
6
|
+
export declare function buildDebateSelectAutonomousPreamble(inputBlock: string, debateRole: DebateRole | undefined, disagreementInline: string | undefined): string;
|
|
@@ -124,3 +124,34 @@ Rules:
|
|
|
124
124
|
- Emit set_group calls before the set_token calls that fall under them.
|
|
125
125
|
- You may emit prose lines (not starting with {) anywhere — they are ignored by the parser and serve as your reasoning log.`;
|
|
126
126
|
}
|
|
127
|
+
export function buildDebateSelectAutonomousPreamble(inputBlock, debateRole, disagreementInline) {
|
|
128
|
+
const role = debateRole ?? 'for';
|
|
129
|
+
return [
|
|
130
|
+
'You are the ' +
|
|
131
|
+
role.toUpperCase() +
|
|
132
|
+
' participant in an adversarial review of one component-selection disagreement. This is an automatic escalation stage; do not ask the developer for confirmation.',
|
|
133
|
+
'',
|
|
134
|
+
'Your role is to argue the ' +
|
|
135
|
+
role.toUpperCase() +
|
|
136
|
+
' position on the exact disagreement below. Address the claim literally, cite the supplied component evidence, and do not substitute a nearby component or field. The opposing participant is evaluating the same evidence independently.',
|
|
137
|
+
'',
|
|
138
|
+
'Component and source data:' + inputBlock,
|
|
139
|
+
'',
|
|
140
|
+
'Disagreement under review (JSON):',
|
|
141
|
+
'~~~json',
|
|
142
|
+
disagreementInline ?? '{}',
|
|
143
|
+
'~~~',
|
|
144
|
+
'',
|
|
145
|
+
'## Output protocol',
|
|
146
|
+
'',
|
|
147
|
+
'Emit exactly one JSON object on one line and do not write files:',
|
|
148
|
+
'',
|
|
149
|
+
'~~~json',
|
|
150
|
+
'{"role":"' +
|
|
151
|
+
role +
|
|
152
|
+
'","disagreement_id":"<id>","argument":"<position and reasoning>","evidence":[{"source":"<path>","line":"<line-or-range>","quote":"<verbatim evidence>"}]}',
|
|
153
|
+
'~~~',
|
|
154
|
+
'',
|
|
155
|
+
'The role and disagreement_id must match the values in this prompt. Use an empty evidence array only when the supplied context contains no citable source evidence.',
|
|
156
|
+
].join('\n');
|
|
157
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
2
|
-
export type Skill = 'components' | 'tokens' | 'select' | 'map-tokens';
|
|
2
|
+
export type Skill = 'components' | 'tokens' | 'select' | 'debate-select' | 'map-tokens';
|
|
3
|
+
export type DebateRole = 'for' | 'against';
|
|
3
4
|
export type Mode = 'autonomous';
|
|
4
5
|
export interface ComponentSourceRef {
|
|
5
6
|
component: string;
|
|
@@ -23,6 +24,10 @@ export interface PromptOptions {
|
|
|
23
24
|
skill: Skill;
|
|
24
25
|
mode: Mode;
|
|
25
26
|
rawComponentsInline?: string;
|
|
27
|
+
/** For the debate-select skill: which side of the disagreement this agent argues. */
|
|
28
|
+
debateRole?: DebateRole;
|
|
29
|
+
/** For the debate-select skill: JSON-serialized disagreement under review. */
|
|
30
|
+
disagreementInline?: string;
|
|
26
31
|
propBucketsInline?: string;
|
|
27
32
|
rawTokensInline?: string;
|
|
28
33
|
/** Original filename for raw tokens — used to set the correct code fence language. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-generation",
|
|
3
|
-
"version": "2.35.1-dev-build-
|
|
3
|
+
"version": "2.35.1-dev-build-459d7e23.0",
|
|
4
4
|
"description": "Agent-invocation and skill-prompt engine for the Contentful Experience Design System SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"skills/"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@contentful/experience-design-system-types": "2.35.1-dev-build-
|
|
25
|
+
"@contentful/experience-design-system-types": "2.35.1-dev-build-459d7e23.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Debate component selection
|
|
2
|
+
|
|
3
|
+
This skill is used after independent component-selection agents disagree about an interpretive question. The caller supplies one component, its source evidence, the disagreement record, and your role (for or against).
|
|
4
|
+
|
|
5
|
+
The caller dispatches a blind FOR/AGAINST pair; argue only the side named in your prompt and do not assume or describe the other participant's response.
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
- Argue only the exact disagreement in the prompt.
|
|
10
|
+
- Use the supplied component data and citations as the evidence base.
|
|
11
|
+
- For slot-realness or allowed-component questions, reason from concrete caller evidence rather than from a ReactNode-shaped prop alone.
|
|
12
|
+
- Keep the argument specific enough for an orchestrator to make an independent determination.
|
|
13
|
+
- Do not write files, call tools, or invent evidence that is not present in the prompt.
|
|
14
|
+
|
|
15
|
+
## Output protocol
|
|
16
|
+
|
|
17
|
+
Emit exactly one JSON object on one line:
|
|
18
|
+
|
|
19
|
+
~~~json
|
|
20
|
+
{"role":"for","disagreement_id":"d1","argument":"...","evidence":[{"source":"src/Panel.tsx","line":"42","quote":"<Card><Badge /></Card>"}]}
|
|
21
|
+
~~~
|
|
22
|
+
|
|
23
|
+
Use the role and disagreement ID supplied by the caller. evidence must be an array of objects with source, line, and quote strings; use an empty array when no citable source evidence is supplied.
|