@contentful/experience-design-system-generation 2.36.2-dev-build-7907fec3.0 → 2.36.2-dev-build-a6f80ae6.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/agent-invoker.d.ts +25 -0
- package/dist/src/{services/agent/local-cli-agent-invoker.js → agent-invoker.js} +2 -2
- package/dist/src/agent-names.d.ts +0 -1
- package/dist/src/agent-names.js +0 -7
- package/dist/src/agent-runner.d.ts +144 -0
- package/dist/src/agent-runner.js +564 -0
- package/dist/src/index.d.ts +7 -19
- package/dist/src/index.js +6 -18
- package/dist/src/prompt-builder.d.ts +81 -0
- package/dist/src/prompt-builder.js +344 -0
- package/package.json +2 -2
- package/dist/src/controller/create-generation-endpoint.d.ts +0 -3
- package/dist/src/controller/create-generation-endpoint.js +0 -15
- package/dist/src/controller/helpers/validate-generation-request.d.ts +0 -2
- package/dist/src/controller/helpers/validate-generation-request.js +0 -18
- package/dist/src/orchestrator/execute-generation-orchestrator.d.ts +0 -6
- package/dist/src/orchestrator/execute-generation-orchestrator.js +0 -12
- package/dist/src/services/agent/helpers/build-agent-args.d.ts +0 -6
- package/dist/src/services/agent/helpers/build-agent-args.js +0 -58
- package/dist/src/services/agent/helpers/check-agent-auth.d.ts +0 -3
- package/dist/src/services/agent/helpers/check-agent-auth.js +0 -19
- package/dist/src/services/agent/helpers/check-claude-auth.d.ts +0 -2
- package/dist/src/services/agent/helpers/check-claude-auth.js +0 -37
- package/dist/src/services/agent/helpers/describe-agent-failure.d.ts +0 -2
- package/dist/src/services/agent/helpers/describe-agent-failure.js +0 -5
- package/dist/src/services/agent/helpers/extract-sentinel-output.d.ts +0 -1
- package/dist/src/services/agent/helpers/extract-sentinel-output.js +0 -16
- package/dist/src/services/agent/helpers/resolve-agent-binary.d.ts +0 -2
- package/dist/src/services/agent/helpers/resolve-agent-binary.js +0 -8
- package/dist/src/services/agent/local-cli-agent-invoker.d.ts +0 -3
- package/dist/src/services/agent/run-agent.d.ts +0 -15
- package/dist/src/services/agent/run-agent.js +0 -70
- package/dist/src/services/parsing/helpers/read-tool-call-objects.d.ts +0 -4
- package/dist/src/services/parsing/helpers/read-tool-call-objects.js +0 -54
- package/dist/src/services/parsing/parse-map-token-tool-calls.d.ts +0 -2
- package/dist/src/services/parsing/parse-map-token-tool-calls.js +0 -39
- package/dist/src/services/parsing/parse-prop-tool-calls.d.ts +0 -2
- package/dist/src/services/parsing/parse-prop-tool-calls.js +0 -91
- package/dist/src/services/parsing/parse-select-tool-calls.d.ts +0 -2
- package/dist/src/services/parsing/parse-select-tool-calls.js +0 -27
- package/dist/src/services/parsing/parse-token-tool-calls.d.ts +0 -2
- package/dist/src/services/parsing/parse-token-tool-calls.js +0 -39
- package/dist/src/services/prompts/build-prompt.d.ts +0 -4
- package/dist/src/services/prompts/build-prompt.js +0 -8
- package/dist/src/services/prompts/helpers/build-preamble.d.ts +0 -2
- package/dist/src/services/prompts/helpers/build-preamble.js +0 -48
- package/dist/src/services/prompts/helpers/build-skill-preambles.d.ts +0 -4
- package/dist/src/services/prompts/helpers/build-skill-preambles.js +0 -126
- package/dist/src/services/prompts/helpers/format-source-refs.d.ts +0 -2
- package/dist/src/services/prompts/helpers/format-source-refs.js +0 -31
- package/dist/src/services/prompts/helpers/format-token-candidates.d.ts +0 -8
- package/dist/src/services/prompts/helpers/format-token-candidates.js +0 -80
- package/dist/src/services/prompts/helpers/resolve-skill-file.d.ts +0 -4
- package/dist/src/services/prompts/helpers/resolve-skill-file.js +0 -49
- package/dist/src/types/agent.d.ts +0 -10
- package/dist/src/types/agent.js +0 -1
- package/dist/src/types/contract.d.ts +0 -24
- package/dist/src/types/contract.js +0 -1
- package/dist/src/types/invoker.d.ts +0 -17
- package/dist/src/types/invoker.js +0 -1
- package/dist/src/types/prompt.d.ts +0 -53
- package/dist/src/types/prompt.js +0 -1
- package/dist/src/types/tool-calls.d.ts +0 -91
- package/dist/src/types/tool-calls.js +0 -1
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { inferFenceLang } from './format-token-candidates.js';
|
|
2
|
-
function formatSourceRefBlock(ref) {
|
|
3
|
-
const mainBlock = `#### ${ref.component} (\`${ref.sourcePath}\`)\n\`\`\`${inferFenceLang(ref.sourcePath)}\n${ref.content}\n\`\`\``;
|
|
4
|
-
const siblingBlocks = (ref.siblingFiles ?? []).map((sibling) => `##### ${ref.component} — imported file \`${sibling.path}\`\n\`\`\`${inferFenceLang(sibling.path)}\n${sibling.content}\n\`\`\``);
|
|
5
|
-
const truncationNote = ref.truncatedSiblingCount && ref.truncatedSiblingCount > 0
|
|
6
|
-
? [
|
|
7
|
-
`##### ${ref.component} — +${ref.truncatedSiblingCount} more imported file${ref.truncatedSiblingCount === 1 ? '' : 's'} not shown (evidence may be incomplete)`,
|
|
8
|
-
]
|
|
9
|
-
: [];
|
|
10
|
-
const notShownNote = ref.usesNotShown && ref.usesNotShown.length > 0
|
|
11
|
-
? [
|
|
12
|
-
`##### ${ref.component} — uses not shown: ${ref.usesNotShown.join(', ')}\n\nThe files above are excerpts, and each of these properties has at least one use that fell outside the excerpt budget. Treat their consumption as unknown, not absent: do not classify them \`token\` on what is shown, and do not conclude they are unread.`,
|
|
13
|
-
]
|
|
14
|
-
: [];
|
|
15
|
-
return [mainBlock, ...siblingBlocks, ...truncationNote, ...notShownNote].join('\n\n');
|
|
16
|
-
}
|
|
17
|
-
export function formatSourceRefsSection(refs, skill) {
|
|
18
|
-
const sections = [];
|
|
19
|
-
const withContent = refs.filter((ref) => ref.content != null);
|
|
20
|
-
const withoutContent = refs.filter((ref) => ref.content == null);
|
|
21
|
-
if (withContent.length > 0) {
|
|
22
|
-
sections.push(`### Component source references\n\n${withContent.map(formatSourceRefBlock).join('\n\n')}`);
|
|
23
|
-
}
|
|
24
|
-
if (withoutContent.length > 0) {
|
|
25
|
-
const guidance = skill === 'components'
|
|
26
|
-
? 'there is no consumption evidence for these, so `token` cannot be earned for any of their props — classify from the prop signature alone, and any prop that would otherwise be enum-versus-token is `enum` (or `string`)'
|
|
27
|
-
: 'there is no source evidence to narrow from — emit nothing for their props';
|
|
28
|
-
sections.push(`Component source unavailable for (JSON) — ${guidance}:\n\`\`\`json\n${JSON.stringify(withoutContent.map((ref) => ({ component: ref.component, sourcePath: ref.sourcePath })))}\n\`\`\``);
|
|
29
|
-
}
|
|
30
|
-
return sections;
|
|
31
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { GeneratedCdf } from '../../../types/prompt.js';
|
|
2
|
-
export declare function inferFenceLang(filename: string | undefined): string;
|
|
3
|
-
export declare function filterDesignTokenProps(cdf: GeneratedCdf): {
|
|
4
|
-
filtered: GeneratedCdf;
|
|
5
|
-
kinds: string[];
|
|
6
|
-
hasUnscoped: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function buildTokenCandidateSections(tokenTree: Record<string, unknown>, filteredTokenProps?: ReturnType<typeof filterDesignTokenProps>): string[];
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { flattenDTCG } from '@contentful/experience-design-system-types';
|
|
2
|
-
export function inferFenceLang(filename) {
|
|
3
|
-
if (!filename)
|
|
4
|
-
return 'json';
|
|
5
|
-
const ext = filename.split('.').pop()?.toLowerCase() ?? '';
|
|
6
|
-
const map = {
|
|
7
|
-
js: 'js',
|
|
8
|
-
mjs: 'js',
|
|
9
|
-
cjs: 'js',
|
|
10
|
-
ts: 'ts',
|
|
11
|
-
mts: 'ts',
|
|
12
|
-
cts: 'ts',
|
|
13
|
-
tsx: 'tsx',
|
|
14
|
-
jsx: 'jsx',
|
|
15
|
-
vue: 'vue',
|
|
16
|
-
svelte: 'svelte',
|
|
17
|
-
astro: 'astro',
|
|
18
|
-
scss: 'scss',
|
|
19
|
-
sass: 'scss',
|
|
20
|
-
css: 'css',
|
|
21
|
-
json: 'json',
|
|
22
|
-
json5: 'json',
|
|
23
|
-
};
|
|
24
|
-
return map[ext] ?? 'text';
|
|
25
|
-
}
|
|
26
|
-
export function filterDesignTokenProps(cdf) {
|
|
27
|
-
const result = {};
|
|
28
|
-
const kinds = new Set();
|
|
29
|
-
let hasUnscoped = false;
|
|
30
|
-
for (const [componentName, component] of Object.entries(cdf)) {
|
|
31
|
-
const properties = component.$properties;
|
|
32
|
-
if (!properties)
|
|
33
|
-
continue;
|
|
34
|
-
const filteredProps = {};
|
|
35
|
-
for (const [propName, prop] of Object.entries(properties)) {
|
|
36
|
-
if (prop.$type === 'token' && prop.$category === 'design') {
|
|
37
|
-
const { '$token.allowed': _tokenAllowed, ...rest } = prop;
|
|
38
|
-
filteredProps[propName] = rest;
|
|
39
|
-
const kind = prop['$token.kind'];
|
|
40
|
-
if (typeof kind === 'string' && kind.length > 0) {
|
|
41
|
-
kinds.add(kind);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
hasUnscoped = true;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (Object.keys(filteredProps).length > 0) {
|
|
49
|
-
result[componentName] = { ...component, $properties: filteredProps };
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return { filtered: result, kinds: [...kinds].sort(), hasUnscoped };
|
|
53
|
-
}
|
|
54
|
-
export function buildTokenCandidateSections(tokenTree, filteredTokenProps) {
|
|
55
|
-
const index = flattenDTCG(tokenTree, '').sort((a, b) => a.path.localeCompare(b.path));
|
|
56
|
-
if (index.length === 0)
|
|
57
|
-
return [];
|
|
58
|
-
const sections = [];
|
|
59
|
-
const renderSection = (kind, entries) => {
|
|
60
|
-
const label = kind
|
|
61
|
-
? `Token path index — ${kind} candidates only`
|
|
62
|
-
: 'Token path index — full tree (no $token.kind to scope by)';
|
|
63
|
-
const lines = entries.map((e) => `${e.path} · ${e.$type}`).join('\n');
|
|
64
|
-
return `${label}, one leaf token per line as \`path · type\`, no \`$value\`:\n${lines}`;
|
|
65
|
-
};
|
|
66
|
-
if (filteredTokenProps) {
|
|
67
|
-
const { kinds, hasUnscoped } = filteredTokenProps;
|
|
68
|
-
for (const kind of kinds) {
|
|
69
|
-
const scoped = index.filter((e) => e.$type === kind);
|
|
70
|
-
if (scoped.length > 0)
|
|
71
|
-
sections.push(renderSection(kind, scoped));
|
|
72
|
-
}
|
|
73
|
-
if (hasUnscoped)
|
|
74
|
-
sections.push(renderSection(null, index));
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
sections.push(renderSection(null, index));
|
|
78
|
-
}
|
|
79
|
-
return sections;
|
|
80
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Skill } from '../../../types/prompt.js';
|
|
2
|
-
export declare function resolveSkillPath(skill: Skill): string;
|
|
3
|
-
export declare function formatCustomPromptBanner(skill: 'components' | 'select', path: string): string;
|
|
4
|
-
export declare function readSkillFile(skill: Skill, override?: string): Promise<string>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
-
import { dirname, join, resolve } from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
const SKILL_FILES = {
|
|
6
|
-
components: 'generate-components.md',
|
|
7
|
-
tokens: 'generate-tokens.md',
|
|
8
|
-
select: 'select-components.md',
|
|
9
|
-
'map-tokens': 'map-tokens.md',
|
|
10
|
-
};
|
|
11
|
-
export function resolveSkillPath(skill) {
|
|
12
|
-
if (!(skill in SKILL_FILES))
|
|
13
|
-
throw new Error(`Invalid skill: ${skill}`);
|
|
14
|
-
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
15
|
-
let dir = thisDir;
|
|
16
|
-
for (;;) {
|
|
17
|
-
const candidate = join(dir, 'skills');
|
|
18
|
-
if (existsSync(candidate))
|
|
19
|
-
return join(candidate, SKILL_FILES[skill]);
|
|
20
|
-
const parent = resolve(dir, '..');
|
|
21
|
-
if (parent === dir) {
|
|
22
|
-
throw new Error(`skill file missing from CLI installation (could not locate skills/ directory from: ${thisDir})`);
|
|
23
|
-
}
|
|
24
|
-
dir = parent;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export function formatCustomPromptBanner(skill, path) {
|
|
28
|
-
return (`WARNING: Custom prompt active for ${skill}: ${path}\n` +
|
|
29
|
-
` Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply.\n` +
|
|
30
|
-
` You are responsible for the prompt's correctness.\n`);
|
|
31
|
-
}
|
|
32
|
-
export async function readSkillFile(skill, override) {
|
|
33
|
-
if (override) {
|
|
34
|
-
const skillPath = resolve(override);
|
|
35
|
-
try {
|
|
36
|
-
return await readFile(skillPath, 'utf8');
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
throw new Error(`custom prompt file not found (skill: ${skill}, path: ${skillPath})`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const skillPath = resolveSkillPath(skill);
|
|
43
|
-
try {
|
|
44
|
-
return await readFile(skillPath, 'utf8');
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
throw new Error(`skill file missing from CLI installation — try reinstalling the CLI (looked for: ${skillPath})`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AgentName } from '../agent-names.js';
|
|
2
|
-
export type { AgentName };
|
|
3
|
-
export interface AgentRunResult {
|
|
4
|
-
exitCode: number;
|
|
5
|
-
stdout: string;
|
|
6
|
-
stderr: string;
|
|
7
|
-
timedOut: boolean;
|
|
8
|
-
}
|
|
9
|
-
export type AgentAuthStatus = 'ok' | 'unauthenticated' | 'not-found';
|
|
10
|
-
export type AgentDebugEvent = (name: string, payload?: Record<string, unknown>) => void;
|
package/dist/src/types/agent.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { AgentName } from '../agent-names.js';
|
|
2
|
-
import type { AgentAuthStatus, AgentDebugEvent } from './agent.js';
|
|
3
|
-
import type { PromptOptions } from './prompt.js';
|
|
4
|
-
export interface GenerationEndpointRequest {
|
|
5
|
-
readonly agent: AgentName;
|
|
6
|
-
readonly model?: string;
|
|
7
|
-
readonly bedrock?: boolean;
|
|
8
|
-
readonly promptOptions: PromptOptions;
|
|
9
|
-
readonly timeoutMs: number;
|
|
10
|
-
readonly onOutput?: (chunk: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export interface GenerationEndpointResponse {
|
|
13
|
-
readonly exitCode: number;
|
|
14
|
-
readonly stdout: string;
|
|
15
|
-
readonly stderr: string;
|
|
16
|
-
readonly timedOut: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface GenerationEndpointOptions {
|
|
19
|
-
onDebugEvent?: AgentDebugEvent;
|
|
20
|
-
}
|
|
21
|
-
export interface GenerationEndpoint {
|
|
22
|
-
run(request: GenerationEndpointRequest): Promise<GenerationEndpointResponse>;
|
|
23
|
-
checkAuth(agent: AgentName): Promise<AgentAuthStatus>;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { AgentName } from '../agent-names.js';
|
|
2
|
-
import type { AgentAuthStatus, AgentDebugEvent, AgentRunResult } from './agent.js';
|
|
3
|
-
export interface InvokeAgentOptions {
|
|
4
|
-
agent: AgentName;
|
|
5
|
-
model?: string;
|
|
6
|
-
bedrock?: boolean;
|
|
7
|
-
prompt: string;
|
|
8
|
-
timeoutMs: number;
|
|
9
|
-
onOutput?: (chunk: string) => void;
|
|
10
|
-
}
|
|
11
|
-
export interface AgentInvoker {
|
|
12
|
-
invoke(options: InvokeAgentOptions): Promise<AgentRunResult>;
|
|
13
|
-
checkAuth(agent: AgentName): Promise<AgentAuthStatus>;
|
|
14
|
-
}
|
|
15
|
-
export interface LocalCliAgentInvokerOptions {
|
|
16
|
-
onDebugEvent?: AgentDebugEvent;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
2
|
-
export type Skill = 'components' | 'tokens' | 'select' | 'map-tokens';
|
|
3
|
-
export type Mode = 'autonomous';
|
|
4
|
-
export interface ComponentSourceRef {
|
|
5
|
-
component: string;
|
|
6
|
-
sourcePath: string;
|
|
7
|
-
content: string | null;
|
|
8
|
-
siblingFiles?: Array<{
|
|
9
|
-
path: string;
|
|
10
|
-
content: string;
|
|
11
|
-
}>;
|
|
12
|
-
truncatedSiblingCount?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Properties with at least one use that fell outside the excerpt budget of
|
|
15
|
-
* the file it sits in. The reader cannot see that use, so its absence is a
|
|
16
|
-
* gap in the evidence, not evidence of absence.
|
|
17
|
-
*/
|
|
18
|
-
usesNotShown?: string[];
|
|
19
|
-
}
|
|
20
|
-
/** Plain-data shape of the CDF generated so far — component name -> component entry. */
|
|
21
|
-
export type GeneratedCdf = Record<string, CDFComponentEntry>;
|
|
22
|
-
export interface PromptOptions {
|
|
23
|
-
skill: Skill;
|
|
24
|
-
mode: Mode;
|
|
25
|
-
rawComponentsInline?: string;
|
|
26
|
-
rawTokensInline?: string;
|
|
27
|
-
/** Original filename for raw tokens — used to set the correct code fence language. */
|
|
28
|
-
rawTokensFilename?: string;
|
|
29
|
-
tokensInline?: string;
|
|
30
|
-
tokenMapInline?: string;
|
|
31
|
-
outDir: string;
|
|
32
|
-
/** For components skill only: the single component's name (used in error messages). */
|
|
33
|
-
componentName?: string;
|
|
34
|
-
/** For map-tokens skill: the CDF generated so far. Filtered internally to design-category token-typed props only. */
|
|
35
|
-
generatedCdf?: GeneratedCdf;
|
|
36
|
-
/** For map-tokens skill: the full DTCG token tree. Flattened internally to a path+`$type` index, with `$value` stripped. */
|
|
37
|
-
tokenTree?: Record<string, unknown>;
|
|
38
|
-
/** Component source file references — consumption evidence for the components skill, explicit-restriction evidence for map-tokens. */
|
|
39
|
-
componentSourceRefs?: ComponentSourceRef[];
|
|
40
|
-
/**
|
|
41
|
-
* When set, this absolute or relative `.md` path is read in place of the
|
|
42
|
-
* bundled skill file. Bundled-prompt invariants do NOT apply.
|
|
43
|
-
*/
|
|
44
|
-
skillPathOverride?: string;
|
|
45
|
-
/** Inline prompt instructions, taking precedence over the bundled skill or path override. */
|
|
46
|
-
skillContentOverride?: string;
|
|
47
|
-
/** JSON-serialized summary of existing space Components. */
|
|
48
|
-
existingComponentsInline?: string;
|
|
49
|
-
/** JSON-serialized summary of existing space DesignTokens. */
|
|
50
|
-
existingTokensInline?: string;
|
|
51
|
-
/** JSON-serialized hard allowlist for generated slot allowed-components references. */
|
|
52
|
-
componentAllowlistInline?: string;
|
|
53
|
-
}
|
package/dist/src/types/prompt.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
export interface ClassifyPropCall {
|
|
2
|
-
tool: 'classify_prop';
|
|
3
|
-
prop: string;
|
|
4
|
-
cdf_type: string;
|
|
5
|
-
cdf_category: 'content' | 'design' | 'state';
|
|
6
|
-
values?: string[];
|
|
7
|
-
token_kind?: string;
|
|
8
|
-
required?: boolean;
|
|
9
|
-
description?: string;
|
|
10
|
-
default?: string | boolean;
|
|
11
|
-
/** Internal LLM rationale; not customer-facing. Persisted to raw_props.rationale. */
|
|
12
|
-
reason?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface ExcludePropCall {
|
|
15
|
-
tool: 'exclude_prop';
|
|
16
|
-
prop: string;
|
|
17
|
-
reason: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ClassifyComponentCall {
|
|
20
|
-
tool: 'classify_component';
|
|
21
|
-
description?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Component-level rationale strings. Surfaced by the `I` ComponentRationalePanel.
|
|
24
|
-
* Each field is optional; missing fields leave existing DB values untouched
|
|
25
|
-
* (sparse update semantics in applyToolCalls).
|
|
26
|
-
*/
|
|
27
|
-
rationale?: {
|
|
28
|
-
description?: string;
|
|
29
|
-
props?: string;
|
|
30
|
-
slots?: string;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface ClassifySlotCall {
|
|
34
|
-
tool: 'classify_slot';
|
|
35
|
-
slot: string;
|
|
36
|
-
required?: boolean;
|
|
37
|
-
allowed_components?: string[];
|
|
38
|
-
description?: string;
|
|
39
|
-
/** Per-slot rationale; persisted to raw_slots.rationale. */
|
|
40
|
-
rationale?: string;
|
|
41
|
-
}
|
|
42
|
-
export type ToolCall = ClassifyPropCall | ExcludePropCall | ClassifyComponentCall | ClassifySlotCall;
|
|
43
|
-
export interface ParsedToolCalls {
|
|
44
|
-
calls: ToolCall[];
|
|
45
|
-
warnings: string[];
|
|
46
|
-
}
|
|
47
|
-
export interface SelectComponentCall {
|
|
48
|
-
tool: 'select_component';
|
|
49
|
-
name: string;
|
|
50
|
-
reason?: string;
|
|
51
|
-
confidence?: number;
|
|
52
|
-
}
|
|
53
|
-
export interface RejectComponentCall {
|
|
54
|
-
tool: 'reject_component';
|
|
55
|
-
name: string;
|
|
56
|
-
reason?: string;
|
|
57
|
-
confidence?: number;
|
|
58
|
-
}
|
|
59
|
-
export type SelectToolCall = SelectComponentCall | RejectComponentCall;
|
|
60
|
-
export interface ParsedSelectToolCalls {
|
|
61
|
-
calls: SelectToolCall[];
|
|
62
|
-
warnings: string[];
|
|
63
|
-
}
|
|
64
|
-
export interface SetTokenCall {
|
|
65
|
-
tool: 'set_token';
|
|
66
|
-
path: string;
|
|
67
|
-
type: string;
|
|
68
|
-
value: unknown;
|
|
69
|
-
description?: string;
|
|
70
|
-
}
|
|
71
|
-
export interface SetGroupCall {
|
|
72
|
-
tool: 'set_group';
|
|
73
|
-
path: string;
|
|
74
|
-
description?: string;
|
|
75
|
-
}
|
|
76
|
-
export type TokenToolCall = SetTokenCall | SetGroupCall;
|
|
77
|
-
export interface ParsedTokenToolCalls {
|
|
78
|
-
calls: TokenToolCall[];
|
|
79
|
-
warnings: string[];
|
|
80
|
-
}
|
|
81
|
-
export interface MapTokenPropCall {
|
|
82
|
-
tool: 'map_token_prop';
|
|
83
|
-
component: string;
|
|
84
|
-
prop: string;
|
|
85
|
-
/** Narrowed subset of tokens the prop may draw from. Required and non-empty. */
|
|
86
|
-
token_allowed: string[];
|
|
87
|
-
}
|
|
88
|
-
export interface ParsedMapTokenPropToolCalls {
|
|
89
|
-
calls: MapTokenPropCall[];
|
|
90
|
-
warnings: string[];
|
|
91
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|