@things-factory/figure-service 10.1.282 → 10.1.285

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.
@@ -0,0 +1,63 @@
1
+ import type { FigureAsset, FigureProposalFinding } from '@hatiolab/figure-model';
2
+ import { type ToolAccessCheck } from '@things-factory/ai-client-base';
3
+ import type { ProposeFigureResult } from './figure-propose-steps.js';
4
+ /**
5
+ * On by FIGURE_BUILD=mcp-agent, or figure/build in the server's config -- a development server's own choice -- and only
6
+ * where Claude Code may answer at all: NODE_ENV development with the CLI logged in (claudeCodeAvailable). A production
7
+ * server never runs it, whatever its config says.
8
+ */
9
+ export declare const figureMcpAgentOn: () => boolean;
10
+ export declare function figureAgentEnv(from?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
11
+ /**
12
+ * The tools that reach the application, each with the GraphQL door it goes through (2026-11-14, the person: pass the
13
+ * user's token and give the agent the tools by the user's privileges). The kernel tools touch only the agent's folder;
14
+ * these read what the person's domain holds, as the person. Read only: the agent hands over a card, and the person
15
+ * saves it.
16
+ */
17
+ export declare const FIGURE_APP_TOOL_DOORS: {
18
+ readonly find_figures: "Query.figures";
19
+ readonly open_figure: "Query.figure";
20
+ };
21
+ export type FigureAppTool = keyof typeof FIGURE_APP_TOOL_DOORS;
22
+ /** The figure tools by their short names, as the agent's events name them (mcp__figure__<name>). */
23
+ export type FigureMcpTool = 'get_guide' | 'apply_steps' | 'read_figure' | 'try_pose' | 'render' | 'start_over' | 'finish' | FigureAppTool;
24
+ /**
25
+ * The application tools this caller may be given: those whose door they pass. The check is the conversation's own tool
26
+ * gate (the tool's `access`), the one that chose this turn's tools -- never a copy of it.
27
+ */
28
+ export declare function figureAppToolsFor(passes: ToolAccessCheck): Promise<FigureAppTool[]>;
29
+ /**
30
+ * Who asked, for the tools that reach the application: a token of that user's, short-lived, and the tools their
31
+ * privileges open. The MCP server calls the application's GraphQL with it, so every call is checked again at the door,
32
+ * as the person's own call would be: the list only keeps the agent from trying what it would be refused.
33
+ */
34
+ export interface McpAgentCaller {
35
+ /** The application's GraphQL endpoint as this server reaches itself. */
36
+ url: string;
37
+ token: string;
38
+ /** The caller's domain (its subdomain), sent as x-things-factory-domain. */
39
+ domain: string;
40
+ tools: FigureAppTool[];
41
+ }
42
+ export interface McpAgentInput {
43
+ prompt: string;
44
+ /** The open figure the request changes; absent, a new figure. */
45
+ base?: FigureAsset;
46
+ name?: string;
47
+ /** A Claude Code model alias or name. */
48
+ model?: string;
49
+ /** Milliseconds after which the agent is stopped with what it has. */
50
+ budgetMs?: number;
51
+ /** Each tool call as the agent makes it, with how many of that tool so far. */
52
+ onTool?: (tool: FigureMcpTool, count: number) => void;
53
+ /** The person who asked; absent, the agent has the kernel tools only. */
54
+ caller?: McpAgentCaller;
55
+ }
56
+ export interface McpAgentResult extends ProposeFigureResult {
57
+ /** What is still off by measure, against the figure the request started from. */
58
+ findings?: FigureProposalFinding[];
59
+ finished: boolean;
60
+ summary?: string;
61
+ calls: number;
62
+ }
63
+ export declare function buildByMcpAgent(input: McpAgentInput): Promise<McpAgentResult>;
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FIGURE_APP_TOOL_DOORS = exports.figureMcpAgentOn = void 0;
4
+ exports.figureAgentEnv = figureAgentEnv;
5
+ exports.figureAppToolsFor = figureAppToolsFor;
6
+ exports.buildByMcpAgent = buildByMcpAgent;
7
+ /**
8
+ * A figure built by an agent with the figure MCP tools (development, 2026-11-14, the person: put MCP on the dock).
9
+ *
10
+ * The way that made good figures when an outside agent was handed the kernel (2026-11-13: six of six, against three of
11
+ * six for the planned path): the whole figure written as commands, read back, measured, looked at, fixed until right.
12
+ * Here the agent is Claude Code run headless on this server (`claude -p`), with no tool but the figure MCP server
13
+ * (mcp/figure-mcp-server.mjs) -- no files, no shell, no source: what it knows of the modeller is the guide and what the
14
+ * tools answer. Development only, as the claude-code provider is: it needs the `claude` CLI logged in here.
15
+ *
16
+ * Behind FIGURE_BUILD=mcp-agent, and only where the claude-code provider is offered: a development server whose machine
17
+ * has the CLI logged in. Anywhere else the dock builds as before.
18
+ */
19
+ const fs_1 = require("fs");
20
+ const os_1 = require("os");
21
+ const path_1 = require("path");
22
+ const readline_1 = require("readline");
23
+ const figure_model_1 = require("@hatiolab/figure-model");
24
+ const ai_client_base_1 = require("@things-factory/ai-client-base");
25
+ const env_1 = require("@things-factory/env");
26
+ /**
27
+ * On by FIGURE_BUILD=mcp-agent, or figure/build in the server's config -- a development server's own choice -- and only
28
+ * where Claude Code may answer at all: NODE_ENV development with the CLI logged in (claudeCodeAvailable). A production
29
+ * server never runs it, whatever its config says.
30
+ */
31
+ const figureMcpAgentOn = () => (process.env.FIGURE_BUILD || env_1.config.get('figure/build', '')) === 'mcp-agent' && (0, ai_client_base_1.claudeCodeAvailable)();
32
+ exports.figureMcpAgentOn = figureMcpAgentOn;
33
+ /** How many turns and how many dollars (at API prices) one build may take: a request answered in 9-27 turns and $0.64-1.68 (2026-11-14). */
34
+ const MAX_TURNS = () => Number(process.env.FIGURE_MCP_MAX_TURNS) || 60;
35
+ const MAX_USD = () => Number(process.env.FIGURE_MCP_MAX_USD) || 5;
36
+ /**
37
+ * What the CLI and the figure MCP server it starts may read of this server's environment: what a logged-in CLI needs
38
+ * to run, and nothing of the application's -- no database password, no key. The application is reached only by the
39
+ * caller's token, handed to the MCP server in its own config.
40
+ */
41
+ const PASSED_ENV = /^(PATH|HOME|USER|LOGNAME|SHELL|TMPDIR|TMP|TEMP|LANG|LC_[A-Z]+|TERM|XDG_[A-Z_]+|NODE_EXTRA_CA_CERTS|CLAUDE_CONFIG_DIR|AI_CLAUDE_CODE_BIN|HTTPS?_PROXY|NO_PROXY|https?_proxy|no_proxy|PLAYWRIGHT_BROWSERS_PATH)$/;
42
+ function figureAgentEnv(from = process.env) {
43
+ return Object.fromEntries(Object.entries(from).filter(([key]) => PASSED_ENV.test(key)));
44
+ }
45
+ /** A development checkout of figure-ui, for pictures. */
46
+ const figureUiDir = () => process.env.FIGURE_UI_DIR || env_1.config.get('figure/uiDir', '') || undefined;
47
+ /** What the agent is told: how to work. What the modeller is and how a thing is said in it comes from get_guide. */
48
+ const MCP_AGENT_SYSTEM = [
49
+ 'You build 3D figures in the Operato Figure modeller with the figure tools. What the thing is, what it looks like and how it moves is your own knowledge; how it is said in this modeller is in get_guide.',
50
+ '',
51
+ 'HOW TO WORK',
52
+ '- First call get_guide and read it.',
53
+ '- Decide the design: the parts, their sizes in mm, how they hang together and how they move.',
54
+ '- Write the figure as commands and apply_steps. Read what it answers: a refusal says which step and why; findings marked WRONG must be fixed.',
55
+ '- render the figure and look at it as the person who asked would, at rest and with each control moved. Check joints with try_pose.',
56
+ '- Fix what is off with more steps, or start_over when the design itself is wrong. Repeat until it is a convincing, recognisable version of the request with the motion asked for (controls, and a clip that shows the motion).',
57
+ '- When the request changes an existing figure, change only what it asks; the figure is there already (read_figure).',
58
+ '- Then call finish with one or two sentences for the person, in the language of the request. The work is handed over only by finish: end every build with it, never with words alone.',
59
+ 'You have no other tools; do not ask the person anything.'
60
+ ].join('\n');
61
+ /**
62
+ * The tools that reach the application, each with the GraphQL door it goes through (2026-11-14, the person: pass the
63
+ * user's token and give the agent the tools by the user's privileges). The kernel tools touch only the agent's folder;
64
+ * these read what the person's domain holds, as the person. Read only: the agent hands over a card, and the person
65
+ * saves it.
66
+ */
67
+ exports.FIGURE_APP_TOOL_DOORS = {
68
+ find_figures: 'Query.figures',
69
+ open_figure: 'Query.figure'
70
+ };
71
+ /**
72
+ * The application tools this caller may be given: those whose door they pass. The check is the conversation's own tool
73
+ * gate (the tool's `access`), the one that chose this turn's tools -- never a copy of it.
74
+ */
75
+ async function figureAppToolsFor(passes) {
76
+ const tools = [];
77
+ for (const [tool, door] of Object.entries(exports.FIGURE_APP_TOOL_DOORS))
78
+ if (await passes(door))
79
+ tools.push(tool);
80
+ return tools;
81
+ }
82
+ const SERVER = (0, path_1.resolve)(__dirname, '..', '..', '..', 'mcp', 'figure-mcp-server.mjs');
83
+ async function buildByMcpAgent(input) {
84
+ const work = (0, fs_1.mkdtempSync)((0, path_1.join)((0, os_1.tmpdir)(), 'figure-mcp-'));
85
+ const started = Date.now();
86
+ try {
87
+ (0, fs_1.writeFileSync)((0, path_1.join)(work, 'meta.json'), JSON.stringify({ name: input.name ?? '' }));
88
+ if (input.base)
89
+ (0, fs_1.writeFileSync)((0, path_1.join)(work, 'base.json'), (0, figure_model_1.serializeFigureAsset)(input.base));
90
+ (0, fs_1.writeFileSync)((0, path_1.join)(work, 'system.txt'), MCP_AGENT_SYSTEM);
91
+ (0, fs_1.writeFileSync)((0, path_1.join)(work, 'mcp.json'), JSON.stringify({
92
+ mcpServers: {
93
+ figure: {
94
+ type: 'stdio',
95
+ command: process.execPath,
96
+ args: [process.env.FIGURE_MCP_SERVER || SERVER],
97
+ env: {
98
+ FIGURE_WORK_DIR: work,
99
+ ...(figureUiDir() ? { FIGURE_UI_DIR: figureUiDir() } : {}),
100
+ ...(input.caller?.tools.length
101
+ ? {
102
+ FIGURE_API_URL: input.caller.url,
103
+ FIGURE_API_TOKEN: input.caller.token,
104
+ FIGURE_API_DOMAIN: input.caller.domain,
105
+ FIGURE_APP_TOOLS: input.caller.tools.join(',')
106
+ }
107
+ : {})
108
+ }
109
+ }
110
+ }
111
+ }));
112
+ const args = [
113
+ '-p',
114
+ '--output-format',
115
+ 'stream-json',
116
+ '--verbose',
117
+ '--tools',
118
+ '',
119
+ '--strict-mcp-config',
120
+ '--mcp-config',
121
+ (0, path_1.join)(work, 'mcp.json'),
122
+ '--allowedTools',
123
+ 'mcp__figure',
124
+ '--setting-sources',
125
+ '',
126
+ '--no-session-persistence',
127
+ '--system-prompt-file',
128
+ (0, path_1.join)(work, 'system.txt'),
129
+ '--model',
130
+ input.model || process.env.FIGURE_MCP_MODEL || 'opus',
131
+ '--max-turns',
132
+ String(MAX_TURNS()),
133
+ '--max-budget-usd',
134
+ String(MAX_USD())
135
+ ];
136
+ const counts = new Map();
137
+ const appCalls = new Map();
138
+ let calls = 0;
139
+ let summary;
140
+ /* What the CLI said went wrong: kept for when nothing was made, which is how a failed start shows. */
141
+ let err = '';
142
+ await new Promise((done, fail) => {
143
+ const child = (0, ai_client_base_1.startClaudeCode)(args, work, figureAgentEnv());
144
+ const timer = setTimeout(() => child.kill('SIGTERM'), input.budgetMs ?? 1_200_000);
145
+ child.stderr.on('data', d => (err += d));
146
+ (0, readline_1.createInterface)({ input: child.stdout }).on('line', line => {
147
+ let event;
148
+ try {
149
+ event = JSON.parse(line);
150
+ }
151
+ catch {
152
+ return;
153
+ }
154
+ /* What the application answered the agent, as the person: a refusal at the door shows here. */
155
+ if (event?.type === 'user')
156
+ for (const part of event.message?.content ?? []) {
157
+ const tool = part?.type === 'tool_result' ? appCalls.get(part.tool_use_id) : undefined;
158
+ if (!tool)
159
+ continue;
160
+ const text = (Array.isArray(part.content) ? part.content.map((c) => c?.text ?? '').join(' ') : String(part.content ?? '')).replace(/\s+/g, ' ');
161
+ env_1.logger.info(`figure mcp agent: ${tool}${part.is_error ? ' refused' : ''}: ${text.slice(0, 300)}`);
162
+ }
163
+ if (event?.type === 'assistant')
164
+ for (const part of event.message?.content ?? []) {
165
+ if (part?.type !== 'tool_use' || typeof part.name !== 'string' || !part.name.startsWith('mcp__figure__'))
166
+ continue;
167
+ const tool = part.name.slice('mcp__figure__'.length);
168
+ if (tool in exports.FIGURE_APP_TOOL_DOORS)
169
+ appCalls.set(part.id, tool);
170
+ const n = (counts.get(tool) ?? 0) + 1;
171
+ counts.set(tool, n);
172
+ calls++;
173
+ if (tool === 'finish' && typeof part.input?.summary === 'string')
174
+ summary = part.input.summary;
175
+ input.onTool?.(tool, n);
176
+ }
177
+ if (event?.type === 'result' && event.is_error)
178
+ err += `\n${String(event.result ?? '')}`;
179
+ });
180
+ child.on('error', fail);
181
+ child.on('close', code => {
182
+ clearTimeout(timer);
183
+ env_1.logger.info(`figure mcp agent: ${calls} calls (${[...counts].map(([k, v]) => `${k} ${v}`).join(', ')}) in ${Math.round((Date.now() - started) / 1000)} s, exit ${code}`);
184
+ if (code && !(0, fs_1.existsSync)((0, path_1.join)(work, 'current.json')))
185
+ fail(new Error(`The agent stopped: ${err.slice(-500)}`));
186
+ else
187
+ done();
188
+ });
189
+ child.stdin.end(input.prompt);
190
+ });
191
+ const read = (name) => ((0, fs_1.existsSync)((0, path_1.join)(work, name)) ? (0, fs_1.readFileSync)((0, path_1.join)(work, name), 'utf-8') : undefined);
192
+ const steps = JSON.parse(read('steps.json') ?? '[]');
193
+ const text = read('current.json');
194
+ const made = steps.some(s => s.kind !== 'set-detail-level');
195
+ if (!text || !made) {
196
+ if (err.trim())
197
+ env_1.logger.warn(`figure mcp agent: made nothing; the agent said: ${err.trim().slice(-500)}`);
198
+ throw Object.assign(new Error('The figure could not be made.'), { reasons: ['The agent made nothing.'] });
199
+ }
200
+ const source = (0, figure_model_1.parseFigureAsset)(text);
201
+ const finished = (0, fs_1.existsSync)((0, path_1.join)(work, 'finished.json'));
202
+ if (!summary && finished)
203
+ summary = JSON.parse(read('finished.json')).summary;
204
+ const findings = (0, figure_model_1.figureProposalFindings)(input.base, source);
205
+ return {
206
+ steps,
207
+ source,
208
+ score: (0, figure_model_1.figureScoreOf)(source),
209
+ cost: (0, figure_model_1.figureCostOf)(source),
210
+ attempts: counts.get('apply_steps') ?? 0,
211
+ ...(findings.length ? { findings } : {}),
212
+ finished,
213
+ ...(summary ? { summary } : {}),
214
+ calls
215
+ };
216
+ }
217
+ finally {
218
+ (0, fs_1.rmSync)(work, { recursive: true, force: true });
219
+ }
220
+ }
221
+ //# sourceMappingURL=figure-mcp-agent.js.map
@@ -0,0 +1,13 @@
1
+ import type { FigureAsset, FigureProposalStep } from '@hatiolab/figure-model';
2
+ /**
3
+ * The figure a build starts from, and the steps that made it from nothing: the open figure as it is, or a new one made
4
+ * to show -- unlimited detail, as a planned one is (figure-plan.ts); left to itself the model set M or L and held
5
+ * itself to 8 or 20 parts (2026-11-13, held-out runs). Both agents start here.
6
+ */
7
+ export declare function startingFigure(base: FigureAsset | undefined, name?: string): {
8
+ asset: FigureAsset;
9
+ steps: FigureProposalStep[];
10
+ };
11
+ /** The figure as it stands, in the words a modeller checks it by. */
12
+ export declare function readFigure(asset: FigureAsset, parts?: string[]): string;
13
+ export declare function tryPose(asset: FigureAsset, values: Record<string, number>): string;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startingFigure = startingFigure;
4
+ exports.readFigure = readFigure;
5
+ exports.tryPose = tryPose;
6
+ /**
7
+ * The figure read back as a modeller checks it (2026-11-13, moved out of figure-agent-build 2026-11-14): where each part
8
+ * spans, which way it faces, what it hangs on, how it moves, what it touches -- at rest or with controls set -- and the
9
+ * figure a build starts from. Only figure-model, so a process outside the server (the figure MCP server) reads and
10
+ * starts a figure the same way.
11
+ */
12
+ const figure_model_1 = require("@hatiolab/figure-model");
13
+ /**
14
+ * The figure a build starts from, and the steps that made it from nothing: the open figure as it is, or a new one made
15
+ * to show -- unlimited detail, as a planned one is (figure-plan.ts); left to itself the model set M or L and held
16
+ * itself to 8 or 20 parts (2026-11-13, held-out runs). Both agents start here.
17
+ */
18
+ function startingFigure(base, name) {
19
+ if (base)
20
+ return { asset: base, steps: [] };
21
+ const unlimited = { kind: 'set-detail-level', level: 'UNLIMITED' };
22
+ return { asset: (0, figure_model_1.applyFigureProposal)((0, figure_model_1.createFigureAsset)(name || 'Figure'), [unlimited]), steps: [unlimited] };
23
+ }
24
+ const r = (v) => Math.round(v);
25
+ function wayOf(v) {
26
+ const names = [
27
+ [0, 'X'],
28
+ [1, 'Y'],
29
+ [2, 'Z']
30
+ ];
31
+ const [k, axis] = names.reduce((best, cur) => (Math.abs(v[cur[0]]) > Math.abs(v[best[0]]) ? cur : best));
32
+ if (Math.abs(Math.abs(v[k]) - 1) > 0.02)
33
+ return `(${v.map(x => x.toFixed(2)).join(', ')})`;
34
+ const plus = { X: 'right', Y: 'up', Z: 'front' }[axis];
35
+ const minus = { X: 'left', Y: 'down', Z: 'back' }[axis];
36
+ return `${v[k] > 0 ? '+' : '-'}${axis} (${v[k] > 0 ? plus : minus})`;
37
+ }
38
+ function boxesOf(asset, state = {}) {
39
+ const geometry = (0, figure_model_1.compileFigureAsset)(asset).evaluate({ ...(asset.stateDefaults ?? {}), ...state }).geometry;
40
+ return { boxes: new Map((0, figure_model_1.figureOccupiedBoxesOf)(geometry, (0, figure_model_1.figureWritersOf)(asset)).map(b => [b.part, b])), geometry };
41
+ }
42
+ const span = (b) => ['x', 'y', 'z'].map(a => `${a} ${r(b.centre[a] - b.extent[a] / 2)}..${r(b.centre[a] + b.extent[a] / 2)}`).join(', ');
43
+ /** Which way a part faces: a round part by its round axis, any other by where its own up and front point, when turned. */
44
+ function facingOf(g) {
45
+ const R = g?.pose?.r;
46
+ if (!R)
47
+ return '';
48
+ const col = (k) => [R[0][k], R[1][k], R[2][k]];
49
+ const e = g.shape?.extrusion;
50
+ if (e && (e.section?.kind === 'circle' || e.section?.kind === 'ellipse')) {
51
+ const k = { x: 0, y: 1, z: 2 }[e.axis] ?? 1;
52
+ return `round about ${wayOf(col(k)).replace(/^[+-]/, '')}`;
53
+ }
54
+ const turned = R.some((row, i) => row.some((v, j) => Math.abs(v - (i === j ? 1 : 0)) > 1e-6));
55
+ return turned ? `turned: its own up points ${wayOf(col(1))}, its front ${wayOf(col(2))}` : '';
56
+ }
57
+ function dimsOf(asset, part) {
58
+ const d = Object.entries((asset.designInputs ?? {})).filter(([k]) => k.startsWith(`${part}.dimension.`));
59
+ return d.map(([k, v]) => `${k.slice(part.length + 11)} ${r(v)}`).join(', ');
60
+ }
61
+ /** The figure as it stands, in the words a modeller checks it by. */
62
+ function readFigure(asset, parts) {
63
+ const { boxes, geometry } = boxesOf(asset);
64
+ const all = [...boxes.values()];
65
+ if (!all.length)
66
+ return 'The figure has no parts yet.';
67
+ const lo = (a) => Math.min(...all.map(b => b.centre[a] - b.extent[a] / 2));
68
+ const hi = (a) => Math.max(...all.map(b => b.centre[a] + b.extent[a] / 2));
69
+ const inputs = asset.document.model.inputs.filter(i => i.role === 'state');
70
+ const rest = (asset.stateDefaults ?? {});
71
+ const joints = (asset.joints ?? []);
72
+ const lines = [
73
+ `Figure: ${all.length} parts; spans ${['x', 'y', 'z'].map(a => `${a} ${r(lo(a))}..${r(hi(a))}`).join(', ')}.`,
74
+ inputs.length ? `Controls: ${inputs.map(i => `${i.id} ${i.min}..${i.max} at ${rest[i.id] ?? 0}`).join('; ')}.` : 'Controls: none.'
75
+ ];
76
+ const wanted = parts?.length ? new Set(parts) : undefined;
77
+ for (const b of all) {
78
+ if (wanted && !wanted.has(b.part))
79
+ continue;
80
+ const g = geometry.find(x => x.id === b.part);
81
+ const j = joints.find(x => x.body1?.part === b.part);
82
+ const on = j ? ('plane' in (j.body0 ?? {}) ? 'the mounting plane' : `${j.body0.part} ${j.body0.face ? `face ${j.body0.face}` : j.body0.surface ? `surface ${JSON.stringify(j.body0.surface)}` : ''}`.trim()) : 'nothing (not fastened)';
83
+ const how = j?.origin?.facing ? `, ${j.origin.facing}` : '';
84
+ const moves = (j?.motion ?? []).map((m) => `${m.type} about ${typeof m.axis === 'string' ? m.axis : JSON.stringify(m.axis)} ${m.lowerLimit ?? '-inf'}..${m.upperLimit ?? 'inf'} by ${m.state?.id ?? m.id ?? j.id}`).join('; ');
85
+ const touching = all
86
+ .filter(o => o !== b && o.part !== j?.body0?.part)
87
+ .filter(o => ['x', 'y', 'z'].every(a => Math.abs(o.centre[a] - b.centre[a]) <= (o.extent[a] + b.extent[a]) / 2 + 1))
88
+ .map(o => o.part);
89
+ const facing = facingOf(g);
90
+ lines.push(`- ${b.part}: ${dimsOf(asset, b.part)}; spans ${span(b)}${facing ? `; ${facing}` : ''}; on ${on}${how}${moves ? `; moves ${moves}` : ''}${touching.length ? `; touches ${touching.slice(0, 8).join(', ')}${touching.length > 8 ? ' ...' : ''}` : ''}`);
91
+ }
92
+ return lines.join('\n');
93
+ }
94
+ function tryPose(asset, values) {
95
+ const before = boxesOf(asset).boxes;
96
+ const { boxes, geometry } = boxesOf(asset, values);
97
+ const moved = [...boxes.values()].filter(b => {
98
+ const a = before.get(b.part);
99
+ return !a || ['x', 'y', 'z'].some(k => Math.abs(a.centre[k] - b.centre[k]) > 1 || Math.abs(a.extent[k] - b.extent[k]) > 1);
100
+ });
101
+ if (!moved.length)
102
+ return `With ${JSON.stringify(values)} nothing moved.`;
103
+ return [`With ${JSON.stringify(values)}:`, ...moved.map(b => `- ${b.part}: spans ${span(b)}${facingOf(geometry.find(x => x.id === b.part)) ? `; ${facingOf(geometry.find(x => x.id === b.part))}` : ''}`)].join('\n');
104
+ }
105
+ //# sourceMappingURL=figure-read.js.map
@@ -42,6 +42,39 @@ const crypto_1 = require("crypto");
42
42
  const typeorm_1 = require("typeorm");
43
43
  const ai_client_base_1 = require("@things-factory/ai-client-base");
44
44
  const figure_context_js_1 = require("./figure-context.js");
45
+ const figure_mcp_agent_js_1 = require("./figure-mcp-agent.js");
46
+ /**
47
+ * The person asking, for the agent's tools that reach the application: the tools their privileges open -- asked of the
48
+ * conversation's own tool gate -- and a token of theirs that lives as long as the agent may run. None when no tool
49
+ * opens, the conversation has no gate, or the request carries no user.
50
+ */
51
+ async function mcpAgentCallerOf(ctx) {
52
+ const user = ctx?.state?.user;
53
+ const domain = ctx?.state?.domain;
54
+ if (!user || !domain || typeof user.sign !== 'function' || typeof ctx?.access !== 'function')
55
+ return undefined;
56
+ const tools = await (0, figure_mcp_agent_js_1.figureAppToolsFor)(ctx.access);
57
+ if (!tools.length)
58
+ return undefined;
59
+ return {
60
+ url: `http://127.0.0.1:${process.env.PORT || 3000}/graphql`,
61
+ token: await user.sign({ expiresIn: 25 * 60 }),
62
+ domain: domain.subdomain,
63
+ tools
64
+ };
65
+ }
66
+ /** What the figure agent is doing, by the tool it calls: the English the translations default to. */
67
+ const AGENT_PROGRESS = {
68
+ get_guide: 'Reading how a figure is made…',
69
+ apply_steps: 'Building the figure (round {count})…',
70
+ read_figure: 'Reading where the parts are…',
71
+ try_pose: 'Checking how it moves…',
72
+ render: 'Looking at the figure…',
73
+ start_over: 'Starting the design again…',
74
+ find_figures: 'Looking through your figures…',
75
+ open_figure: 'Opening one of your figures…',
76
+ finish: 'Finishing…'
77
+ };
45
78
  /** How many figures a list without search names. */
46
79
  const LIST_LIMIT = 200;
47
80
  /*
@@ -479,23 +512,35 @@ function figureToolSpecs() {
479
512
  const { proposeFigureSteps } = getDeps();
480
513
  let result;
481
514
  try {
482
- result = await proposeFigureSteps({
483
- /* The agent of this conversation's turn - the one the person picked, or the domain default. */
484
- client: await (0, ai_client_base_1.aiClientFor)({
485
- domain: ctx?.state?.domain,
486
- user: ctx?.state?.user,
487
- agentId: ctx?.state?.aiAgentId,
488
- modeKind: ctx?.mode?.kind
489
- }),
490
- prompt,
491
- base,
492
- name: typeof args?.name === 'string' && args.name.trim() ? args.name.trim() : undefined,
493
- ...(images.length ? { images } : {}),
494
- ...(focus && Object.keys(focus).length ? { focus } : {}),
495
- ...(!create && (stringsOf(args?.parts).length || stringsOf(args?.sections).length)
496
- ? { read: { parts: stringsOf(args?.parts), sections: stringsOf(args?.sections) } }
497
- : {})
498
- });
515
+ if ((0, figure_mcp_agent_js_1.figureMcpAgentOn)()) {
516
+ /* The agent with the figure tools (figure-mcp-agent.ts): what it is doing is what the person sees while waiting. */
517
+ ctx?.progress?.(ctx.t('figure.progress.agent.start', { defaultValue: 'Reading how a figure is made…' }));
518
+ result = await (0, figure_mcp_agent_js_1.buildByMcpAgent)({
519
+ caller: await mcpAgentCallerOf(ctx),
520
+ prompt,
521
+ base: base,
522
+ name: typeof args?.name === 'string' && args.name.trim() ? args.name.trim() : undefined,
523
+ onTool: (tool, count) => ctx?.progress?.(ctx.t(`figure.progress.agent.${tool}`, { count, defaultValue: AGENT_PROGRESS[tool] ?? 'Working on the figure…' }))
524
+ });
525
+ }
526
+ else
527
+ result = await proposeFigureSteps({
528
+ /* The agent of this conversation's turn - the one the person picked, or the domain default. */
529
+ client: await (0, ai_client_base_1.aiClientFor)({
530
+ domain: ctx?.state?.domain,
531
+ user: ctx?.state?.user,
532
+ agentId: ctx?.state?.aiAgentId,
533
+ modeKind: ctx?.mode?.kind
534
+ }),
535
+ prompt,
536
+ base,
537
+ name: typeof args?.name === 'string' && args.name.trim() ? args.name.trim() : undefined,
538
+ ...(images.length ? { images } : {}),
539
+ ...(focus && Object.keys(focus).length ? { focus } : {}),
540
+ ...(!create && (stringsOf(args?.parts).length || stringsOf(args?.sections).length)
541
+ ? { read: { parts: stringsOf(args?.parts), sections: stringsOf(args?.sections) } }
542
+ : {})
543
+ });
499
544
  }
500
545
  catch (error) {
501
546
  /*
@@ -543,7 +588,15 @@ function figureToolSpecs() {
543
588
  steps: result.steps,
544
589
  score: result.score,
545
590
  cost: result.cost,
546
- attempts: result.attempts
591
+ attempts: result.attempts,
592
+ /*
593
+ What is still off by measure on the figure the agent made: what it did not fix, and notes. The person hears them
594
+ with the card, so nothing measured as wrong is presented as done.
595
+ */
596
+ ...(result.findings?.length ? { concerns: result.findings.map((f) => `${f.severity === 'fix' ? 'still wrong' : 'note'}: ${f.message}`) } : {}),
597
+ /* What the figure agent says it made, for the reply; and that it stopped before it said it was done. */
598
+ ...(typeof result.summary === 'string' ? { made: result.summary } : {}),
599
+ ...(result.finished === false ? { unfinished: 'The agent ended without saying the figure was done (it did not call finish). Check the card against the request before you say it is complete.' } : {})
547
600
  };
548
601
  }
549
602
  }
@@ -565,6 +618,7 @@ function registerFigureToolCategories() {
565
618
  ' Writing "I made a proposal" or "press apply" without the call is **false**: no card appears, and the person looks for a button that does not exist.',
566
619
  ' A proposal is a list of modeller commands. The modeller applies it as one step only when the person runs it from the dock card, and one undo takes it all back. Do not say the figure has changed before that.',
567
620
  ' A revision can be proposed only for the figure open in the modeller. Say what the result\'s `steps` do as they are; do not invent changes the commands do not make.',
621
+ ' When the result has `concerns`, say each in plain words before anything else about the card: "still wrong" ones are measured on the figure and were not fixed -- the person decides whether to run the card. `made` is what was built, in the builder\'s words.',
568
622
  '- Never save the source yourself. Propose; the author decides on the screen whether to take it.',
569
623
  '- In the prompt to `proposeFigureCandidate`, pass the person\'s words as they are: their sizes, counts and names. Do not turn them into axes; the writer knows the figure\'s axes. When you name an axis to the person, the figure\'s Y is up.',
570
624
  '- **For a request to change a figure, call `getFigureSource` first.** Revising without reading proposes against a guess, and a renamed part breaks the bindings of the boards it is already placed on.',
@@ -0,0 +1,259 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * The figure MCP server (development, 2026-11-14): the modeller's kernel as tools for an agent -- the way that made good
4
+ * figures when an outside agent was handed it (validation round 1 vs an outside agent, 2026-11-13). Write the whole
5
+ * figure as commands, read back what the kernel made and what it measures wrong, look at it, and fix until it is right.
6
+ *
7
+ * MCP over stdio: one JSON-RPC message per line, the few methods a client asks of a tools server.
8
+ *
9
+ * Its work lives in a folder (FIGURE_WORK_DIR):
10
+ * meta.json { name } the new figure's name
11
+ * base.json the figure the request changes absent: a new figure
12
+ * steps.json the commands applied so far, in order (what the card runs on the base)
13
+ * current.json the figure as it stands
14
+ * finished.json { summary } written by finish
15
+ *
16
+ * Pictures come from figure-ui's thumbnail page in a headless browser (FIGURE_UI_DIR, a development checkout); without
17
+ * it the render tool says so.
18
+ */
19
+ import { createRequire } from 'node:module'
20
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs'
21
+ import { dirname, join } from 'node:path'
22
+ import { createInterface } from 'node:readline'
23
+ import { fileURLToPath, pathToFileURL } from 'node:url'
24
+
25
+ const here = dirname(fileURLToPath(import.meta.url))
26
+ const require = createRequire(join(here, 'package.json'))
27
+ const fm = require('@hatiolab/figure-model')
28
+ const { readFigure, startingFigure, tryPose } = require(join(here, '..', 'dist-server', 'service', 'figure', 'figure-read.js'))
29
+
30
+ const WORK = process.env.FIGURE_WORK_DIR
31
+ if (!WORK) {
32
+ process.stderr.write('FIGURE_WORK_DIR is required\n')
33
+ process.exit(1)
34
+ }
35
+ const file = name => join(WORK, name)
36
+ const readJSON = (name, fallback) => (existsSync(file(name)) ? JSON.parse(readFileSync(file(name), 'utf-8')) : fallback)
37
+ const meta = readJSON('meta.json', {})
38
+
39
+ /* The figure the request changes, if any: what is measured wrong is what the agent's steps made wrong, never what it was given. */
40
+ const base = (() => {
41
+ const given = readJSON('base.json', undefined)
42
+ return given ? fm.parseFigureAsset(JSON.stringify(given)) : undefined
43
+ })()
44
+ const starting = () => startingFigure(base, meta.name)
45
+
46
+ let state = (() => {
47
+ const start = starting()
48
+ const steps = readJSON('steps.json', start.steps)
49
+ let asset = start.asset
50
+ if (steps.length > start.steps.length) asset = fm.applyFigureProposal(start.asset, steps.slice(start.steps.length))
51
+ return { asset, steps }
52
+ })()
53
+
54
+ function save() {
55
+ writeFileSync(file('steps.json'), JSON.stringify(state.steps))
56
+ writeFileSync(file('current.json'), fm.serializeFigureAsset(state.asset))
57
+ }
58
+ save()
59
+
60
+ const said = f => `${f.severity === 'fix' ? 'WRONG' : 'note'} ${f.code}: ${f.message}`
61
+
62
+ let browser
63
+ async function shoot(values) {
64
+ const ui = process.env.FIGURE_UI_DIR
65
+ if (!ui) return undefined
66
+ if (!browser) {
67
+ const { buildPage } = await import(pathToFileURL(join(ui, 'test/browser/build.mjs')).href)
68
+ const { openPage } = await import(pathToFileURL(join(ui, 'test/browser/serve.mjs')).href)
69
+ browser = await openPage(await buildPage('thumbnail-page.js'))
70
+ }
71
+ const url = await browser.page.evaluate((t, s) => window.shoot(t, s), fm.serializeFigureAsset(state.asset), values ?? {})
72
+ const m = /^data:([^;]+);base64,(.*)$/.exec(url ?? '')
73
+ return m ? { mimeType: m[1], data: m[2] } : undefined
74
+ }
75
+
76
+ /*
77
+ * The tools that reach the application, as the person who asked (2026-11-14). The agent's server is handed a token of
78
+ * that person's and the tools their privileges open (FIGURE_APP_TOOLS, chosen by the application at the doors these
79
+ * tools go through). Each call goes to the application's GraphQL with the token, so the door checks it again as it
80
+ * would the person's own call. Read only: nothing here saves.
81
+ */
82
+ const API = {
83
+ url: process.env.FIGURE_API_URL,
84
+ token: process.env.FIGURE_API_TOKEN,
85
+ domain: process.env.FIGURE_API_DOMAIN,
86
+ tools: new Set((process.env.FIGURE_APP_TOOLS || '').split(',').filter(Boolean))
87
+ }
88
+
89
+ async function graphql(query, variables) {
90
+ const response = await fetch(API.url, {
91
+ method: 'POST',
92
+ headers: {
93
+ 'Content-Type': 'application/json',
94
+ Authorization: `Bearer ${API.token}`,
95
+ ...(API.domain ? { 'x-things-factory-domain': API.domain } : {})
96
+ },
97
+ body: JSON.stringify({ query, variables })
98
+ })
99
+ const text = await response.text()
100
+ let body
101
+ try {
102
+ body = JSON.parse(text)
103
+ } catch {
104
+ throw new Error(`The application answered ${response.status}: ${text.slice(0, 300)}`)
105
+ }
106
+ if (body.errors?.length) throw new Error(`The application refused: ${body.errors.map(e => e.message).join('; ')}`)
107
+ return body.data
108
+ }
109
+
110
+ const APP_TOOLS = [
111
+ {
112
+ name: 'find_figures',
113
+ description:
114
+ "The figures saved in the person's domain: id, type, name, state. Search by part of a name or type. Use it when the request refers to a figure the person already has.",
115
+ inputSchema: { type: 'object', properties: { search: { type: 'string' } } },
116
+ run: async ({ search }) => {
117
+ const words = typeof search === 'string' ? search.trim() : ''
118
+ const filters = words ? ['name', 'type'].map(name => ({ name, operator: 'search', value: `%${words}%` })) : []
119
+ const data = await graphql(
120
+ 'query ($filters: [Filter!], $pagination: Pagination) { figures(filters: $filters, pagination: $pagination, sortings: [{ name: "updatedAt", desc: true }]) { total items { id type name state } } }',
121
+ { filters, pagination: { page: 1, limit: 30 } }
122
+ )
123
+ const { total, items } = data.figures
124
+ return [`${total} figure(s)${total > items.length ? `, the ${items.length} most recently changed` : ''}:`, ...items.map(f => `- ${f.id} ${f.type} "${f.name}" ${f.state ?? ''}`)].join('\n')
125
+ }
126
+ },
127
+ {
128
+ name: 'open_figure',
129
+ description:
130
+ 'One saved figure, by id (find_figures): its parts, sizes, how they hang and move, and its colours -- to match a figure the person has. It does not change the figure being built.',
131
+ inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] },
132
+ run: async ({ id }) => {
133
+ const data = await graphql('query ($id: String!) { figure(id: $id) { id type name source } }', { id: String(id ?? '') })
134
+ const figure = data.figure
135
+ if (!figure) return { error: `No figure ${id} in this domain.` }
136
+ if (!figure.source) return `"${figure.name}" (${figure.type}) has no source yet.`
137
+ const asset = fm.parseFigureAsset(typeof figure.source === 'string' ? figure.source : JSON.stringify(figure.source))
138
+ return [`"${figure.name}" (${figure.type}). Colours: ${JSON.stringify(asset.palette ?? {})}`, '', readFigure(asset)].join('\n')
139
+ }
140
+ }
141
+ ].filter(tool => API.url && API.token && API.tools.has(tool.name))
142
+
143
+ const TOOLS = [
144
+ ...APP_TOOLS,
145
+ {
146
+ name: 'get_guide',
147
+ description: 'How a figure is modelled in this modeller, and every command with its shape. Read it before writing commands.',
148
+ inputSchema: { type: 'object', properties: {} },
149
+ run: () => [fm.FIGURE_MODELLING_GUIDE, '', 'THE COMMANDS (shape, then what it means):', ...fm.FIGURE_PROPOSAL_GRAMMAR.map(w => `- ${w.shape}\n ${w.means}`)].join('\n')
150
+ },
151
+ {
152
+ name: 'apply_steps',
153
+ description:
154
+ 'Apply modeller commands to the figure, in order, as one step. Refused whole if any is refused: the reason says which and why, and nothing is applied. Applied, it answers what is measured wrong on the figure now, and the figure as it stands. Steps applied stay; to change them, apply more (attach again with replace, set-joint, remove-part) or start_over.',
155
+ inputSchema: { type: 'object', properties: { steps: { type: 'array', items: { type: 'object' } } }, required: ['steps'] },
156
+ run: ({ steps }) => {
157
+ if (!Array.isArray(steps) || !steps.length) return { error: 'steps must be a non-empty array of commands.' }
158
+ const before = state.asset
159
+ let after
160
+ try {
161
+ after = fm.applyFigureProposal(before, steps)
162
+ } catch (e) {
163
+ return { error: `Refused, nothing applied: ${String(e?.message ?? e)}` }
164
+ }
165
+ state = { asset: after, steps: [...state.steps, ...steps] }
166
+ save()
167
+ const found = fm.figureProposalFindings(base, after)
168
+ return [`Applied ${steps.length} steps (${state.steps.length} in all).`, found.length ? 'Measured on the figure now:' : 'Nothing measured wrong.', ...found.map(said), '', readFigure(after)].join('\n')
169
+ }
170
+ },
171
+ {
172
+ name: 'read_figure',
173
+ description: 'The figure as it stands at rest: its size, controls, and for each part its measures, where it spans on X, Y, Z (mm), which way it faces, what it hangs on, how it moves, what it touches. Give parts to read only those.',
174
+ inputSchema: { type: 'object', properties: { parts: { type: 'array', items: { type: 'string' } } } },
175
+ run: ({ parts }) => readFigure(state.asset, Array.isArray(parts) ? parts : undefined)
176
+ },
177
+ {
178
+ name: 'try_pose',
179
+ description: 'Where parts go with some controls set: to check that a joint moves the way it is meant to.',
180
+ inputSchema: { type: 'object', properties: { values: { type: 'object', description: '{ <control>: value }' } }, required: ['values'] },
181
+ run: ({ values }) => tryPose(state.asset, values ?? {})
182
+ },
183
+ {
184
+ name: 'render',
185
+ description: 'A picture of the figure, at rest or with controls set. Look at it as the person who asked would: is it the thing, does it look right, does it move right?',
186
+ inputSchema: { type: 'object', properties: { values: { type: 'object', description: 'Controls to set; none for the rest pose.' } } },
187
+ run: async ({ values }) => {
188
+ const image = await shoot(values)
189
+ if (!image) return { error: 'Pictures are not available here; read_figure and try_pose instead.' }
190
+ return { image }
191
+ }
192
+ },
193
+ {
194
+ name: 'start_over',
195
+ description: 'Throw away every step applied and start again from the figure the request began with.',
196
+ inputSchema: { type: 'object', properties: {} },
197
+ run: () => {
198
+ state = starting()
199
+ save()
200
+ return 'Started over.'
201
+ }
202
+ },
203
+ {
204
+ name: 'finish',
205
+ description: 'The figure is what was asked and looks right: end, with one or two sentences for the person on what was made.',
206
+ inputSchema: { type: 'object', properties: { summary: { type: 'string' } }, required: ['summary'] },
207
+ run: ({ summary }) => {
208
+ writeFileSync(file('finished.json'), JSON.stringify({ summary: String(summary ?? '') }))
209
+ return 'Done. Stop here.'
210
+ }
211
+ }
212
+ ]
213
+
214
+ function send(message) {
215
+ process.stdout.write(JSON.stringify(message) + '\n')
216
+ }
217
+
218
+ async function handle(request) {
219
+ const { id, method, params } = request
220
+ if (id === undefined) return /* a notification */
221
+ if (method === 'initialize')
222
+ return send({ jsonrpc: '2.0', id, result: { protocolVersion: params?.protocolVersion ?? '2025-06-18', capabilities: { tools: {} }, serverInfo: { name: 'operato-figure', version: '0.1.0' } } })
223
+ if (method === 'ping') return send({ jsonrpc: '2.0', id, result: {} })
224
+ if (method === 'tools/list') return send({ jsonrpc: '2.0', id, result: { tools: TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })) } })
225
+ if (method === 'tools/call') {
226
+ const tool = TOOLS.find(t => t.name === params?.name)
227
+ if (!tool) return send({ jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: `No tool named ${params?.name}.` }], isError: true } })
228
+ try {
229
+ const out = await tool.run(params?.arguments ?? {})
230
+ if (typeof out === 'string') return send({ jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: out }] } })
231
+ if (out?.image) return send({ jsonrpc: '2.0', id, result: { content: [{ type: 'image', data: out.image.data, mimeType: out.image.mimeType }] } })
232
+ return send({ jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: String(out?.error ?? '') }], isError: true } })
233
+ } catch (e) {
234
+ return send({ jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: `The tool failed: ${String(e?.message ?? e)}` }], isError: true } })
235
+ }
236
+ }
237
+ send({ jsonrpc: '2.0', id, error: { code: -32601, message: `Method not found: ${method}` } })
238
+ }
239
+
240
+ const pending = new Set()
241
+ const lines = createInterface({ input: process.stdin })
242
+ lines.on('line', line => {
243
+ if (!line.trim()) return
244
+ let request
245
+ try {
246
+ request = JSON.parse(line)
247
+ } catch {
248
+ return send({ jsonrpc: '2.0', id: null, error: { code: -32700, message: 'Parse error' } })
249
+ }
250
+ const done = handle(request).catch(e => process.stderr.write(String(e?.stack ?? e) + '\n'))
251
+ pending.add(done)
252
+ done.finally(() => pending.delete(done))
253
+ })
254
+ /* The client is gone: answer what is still in hand, then close the browser. */
255
+ lines.on('close', async () => {
256
+ await Promise.allSettled([...pending])
257
+ await browser?.close?.().catch(() => {})
258
+ process.exit(0)
259
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/figure-service",
3
- "version": "10.1.282",
3
+ "version": "10.1.285",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "@things-factory:registry": "https://registry.npmjs.org"
@@ -10,6 +10,7 @@
10
10
  "files": [
11
11
  "README.md",
12
12
  "dist-server",
13
+ "mcp",
13
14
  "recipes",
14
15
  "things-factory.config.js",
15
16
  "translations",
@@ -40,18 +41,18 @@
40
41
  "test:templates": "node --test scripts/templates.test.mts"
41
42
  },
42
43
  "dependencies": {
43
- "@hatiolab/figure-model": "^0.12.4",
44
+ "@hatiolab/figure-model": "^0.12.12",
44
45
  "@operato/typeorm-history": "^10.0.0",
45
- "@things-factory/ai-client-base": "^10.1.282",
46
- "@things-factory/attachment-base": "^10.1.282",
47
- "@things-factory/auth-base": "^10.1.282",
46
+ "@things-factory/ai-client-base": "^10.1.283",
47
+ "@things-factory/attachment-base": "^10.1.283",
48
+ "@things-factory/auth-base": "^10.1.283",
48
49
  "@things-factory/env": "^10.1.281",
49
- "@things-factory/setting-base": "^10.1.282",
50
- "@things-factory/shell": "^10.1.282",
50
+ "@things-factory/setting-base": "^10.1.283",
51
+ "@things-factory/shell": "^10.1.283",
51
52
  "graphql-scalars": "^1.22.4",
52
53
  "graphql-upload": "^15.0.2",
53
54
  "jszip": "^3.10.1",
54
55
  "koa-router": "^7.4.0"
55
56
  },
56
- "gitHead": "6a232e670bdb52e1420b1d33cdeeb37ceb0f26b8"
57
+ "gitHead": "4b795802d1fbfacf113eda3596d2891c77718708"
57
58
  }
@@ -191,6 +191,16 @@
191
191
  "figure.gate.contract.data-table-changed.why": "Where no legend is chosen, the same value may look different after this release.",
192
192
  "figure.gate.contract.data-table-role-changed.message": "The legend role of the table '{binding}' changed from '{before}' to '{after}'.",
193
193
  "figure.gate.contract.data-table-role-changed.why": "A legend a board chose for the old role is not used after this release. Choose one for the new role.",
194
+ "figure.progress.agent.start": "Reading how a figure is made…",
195
+ "figure.progress.agent.get_guide": "Reading how a figure is made…",
196
+ "figure.progress.agent.apply_steps": "Building the figure (round {count})…",
197
+ "figure.progress.agent.read_figure": "Reading where the parts are…",
198
+ "figure.progress.agent.try_pose": "Checking how it moves…",
199
+ "figure.progress.agent.render": "Looking at the figure…",
200
+ "figure.progress.agent.start_over": "Starting the design again…",
201
+ "figure.progress.agent.find_figures": "Looking through your figures…",
202
+ "figure.progress.agent.open_figure": "Opening one of your figures…",
203
+ "figure.progress.agent.finish": "Finishing…",
194
204
  "error.figure-install-key-name-missing": "Name the key - what board server it is for.",
195
205
  "error.figure-install-key-name-too-long": "A key name is at most {max} characters.",
196
206
  "error.figure-install-key-not-found": "There is no such install key.",
@@ -191,6 +191,16 @@
191
191
  "figure.gate.contract.data-table-changed.why": "Donde no se eligió leyenda, el mismo valor puede verse distinto tras esta publicación.",
192
192
  "figure.gate.contract.data-table-role-changed.message": "El rol de leyenda de la tabla '{binding}' cambió de '{before}' a '{after}'.",
193
193
  "figure.gate.contract.data-table-role-changed.why": "La leyenda elegida para el rol anterior no se usa tras esta publicación. Elija una para el rol nuevo.",
194
+ "figure.progress.agent.start": "Leyendo cómo se hace una figura…",
195
+ "figure.progress.agent.get_guide": "Leyendo cómo se hace una figura…",
196
+ "figure.progress.agent.apply_steps": "Construyendo la figura (ronda {count})…",
197
+ "figure.progress.agent.read_figure": "Revisando dónde están las piezas…",
198
+ "figure.progress.agent.try_pose": "Comprobando cómo se mueve…",
199
+ "figure.progress.agent.render": "Mirando la figura…",
200
+ "figure.progress.agent.start_over": "Empezando el diseño de nuevo…",
201
+ "figure.progress.agent.find_figures": "Buscando entre tus figuras…",
202
+ "figure.progress.agent.open_figure": "Abriendo una de tus figuras…",
203
+ "figure.progress.agent.finish": "Terminando…",
194
204
  "error.figure-install-key-name-missing": "Indique el nombre de la clave: el servidor de tableros que la usará.",
195
205
  "error.figure-install-key-name-too-long": "El nombre de la clave tiene como máximo {max} caracteres.",
196
206
  "error.figure-install-key-not-found": "No existe esa clave de instalación.",
@@ -191,6 +191,16 @@
191
191
  "figure.gate.contract.data-table-changed.why": "凡例を選んでいない所では、同じ値がこの発行から違って見えることがあります。",
192
192
  "figure.gate.contract.data-table-role-changed.message": "表 '{binding}' の凡例の役割が '{before}' から '{after}' に変わりました。",
193
193
  "figure.gate.contract.data-table-role-changed.why": "ボードが古い役割に選んだ凡例は、この発行から使われません。新しい役割に凡例を選びます。",
194
+ "figure.progress.agent.start": "フィギュアの作り方を読んでいます…",
195
+ "figure.progress.agent.get_guide": "フィギュアの作り方を読んでいます…",
196
+ "figure.progress.agent.apply_steps": "フィギュアを作っています({count}回目)…",
197
+ "figure.progress.agent.read_figure": "部品の位置を確認しています…",
198
+ "figure.progress.agent.try_pose": "動きを確認しています…",
199
+ "figure.progress.agent.render": "絵で確認しています…",
200
+ "figure.progress.agent.start_over": "設計を最初からやり直しています…",
201
+ "figure.progress.agent.find_figures": "保存されたフィギュアを探しています…",
202
+ "figure.progress.agent.open_figure": "保存されたフィギュアを開いています…",
203
+ "figure.progress.agent.finish": "仕上げています…",
194
204
  "error.figure-install-key-name-missing": "キー名を入力してください。このキーを使うボードサーバー名を入力します。",
195
205
  "error.figure-install-key-name-too-long": "キー名は {max} 文字以内で入力してください。",
196
206
  "error.figure-install-key-not-found": "該当するインストールキーがありません。",
@@ -191,6 +191,16 @@
191
191
  "figure.gate.contract.data-table-changed.why": "범례를 고르지 않은 곳에서는 같은 값이 이 발행부터 다르게 보일 수 있습니다.",
192
192
  "figure.gate.contract.data-table-role-changed.message": "'{binding}' 표 연결의 범례 역할이 '{before}' 이름에서 '{after}' 이름으로 바뀌었습니다.",
193
193
  "figure.gate.contract.data-table-role-changed.why": "보드가 옛 역할에 고른 범례는 이 발행부터 쓰이지 않습니다. 새 역할에 범례를 고릅니다.",
194
+ "figure.progress.agent.start": "피규어 만드는 법을 읽는 중…",
195
+ "figure.progress.agent.get_guide": "피규어 만드는 법을 읽는 중…",
196
+ "figure.progress.agent.apply_steps": "피규어를 만드는 중 ({count}번째)…",
197
+ "figure.progress.agent.read_figure": "부품 위치를 확인하는 중…",
198
+ "figure.progress.agent.try_pose": "움직임을 확인하는 중…",
199
+ "figure.progress.agent.render": "그림으로 확인하는 중…",
200
+ "figure.progress.agent.start_over": "설계를 처음부터 다시 하는 중…",
201
+ "figure.progress.agent.find_figures": "저장된 피규어를 찾아보는 중…",
202
+ "figure.progress.agent.open_figure": "저장된 피규어를 여는 중…",
203
+ "figure.progress.agent.finish": "마무리하는 중…",
194
204
  "error.figure-install-key-name-missing": "키 이름을 입력하세요. 이 키를 사용할 보드 서버를 적으면 됩니다.",
195
205
  "error.figure-install-key-name-too-long": "키 이름은 {max}자 이하로 입력하세요.",
196
206
  "error.figure-install-key-not-found": "해당 설치 키가 없습니다.",
@@ -191,6 +191,16 @@
191
191
  "figure.gate.contract.data-table-changed.why": "Di tempat tiada petunjuk dipilih, nilai yang sama mungkin kelihatan berbeza selepas keluaran ini.",
192
192
  "figure.gate.contract.data-table-role-changed.message": "Peranan petunjuk jadual '{binding}' berubah daripada '{before}' kepada '{after}'.",
193
193
  "figure.gate.contract.data-table-role-changed.why": "Petunjuk yang dipilih bagi peranan lama tidak digunakan selepas keluaran ini. Pilih satu bagi peranan baharu.",
194
+ "figure.progress.agent.start": "Membaca cara figura dibuat…",
195
+ "figure.progress.agent.get_guide": "Membaca cara figura dibuat…",
196
+ "figure.progress.agent.apply_steps": "Membina figura (pusingan {count})…",
197
+ "figure.progress.agent.read_figure": "Menyemak kedudukan bahagian…",
198
+ "figure.progress.agent.try_pose": "Menyemak cara ia bergerak…",
199
+ "figure.progress.agent.render": "Melihat figura…",
200
+ "figure.progress.agent.start_over": "Memulakan reka bentuk semula…",
201
+ "figure.progress.agent.find_figures": "Mencari dalam figura anda…",
202
+ "figure.progress.agent.open_figure": "Membuka salah satu figura anda…",
203
+ "figure.progress.agent.finish": "Menyiapkan…",
194
204
  "error.figure-install-key-name-missing": "Namakan kunci - pelayan papan yang akan menggunakannya.",
195
205
  "error.figure-install-key-name-too-long": "Nama kunci paling banyak {max} aksara.",
196
206
  "error.figure-install-key-not-found": "Tiada kunci pemasangan sedemikian.",
@@ -191,6 +191,16 @@
191
191
  "figure.gate.contract.data-table-changed.why": "未选择图例的地方,同一值从本次发布起可能显示不同。",
192
192
  "figure.gate.contract.data-table-role-changed.message": "表 '{binding}' 的图例角色由 '{before}' 改为 '{after}'。",
193
193
  "figure.gate.contract.data-table-role-changed.why": "看板为旧角色选择的图例从本次发布起不再使用。请为新角色选择图例。",
194
+ "figure.progress.agent.start": "正在阅读模型的制作方法…",
195
+ "figure.progress.agent.get_guide": "正在阅读模型的制作方法…",
196
+ "figure.progress.agent.apply_steps": "正在制作模型(第 {count} 轮)…",
197
+ "figure.progress.agent.read_figure": "正在确认部件位置…",
198
+ "figure.progress.agent.try_pose": "正在检查动作…",
199
+ "figure.progress.agent.render": "正在查看渲染图…",
200
+ "figure.progress.agent.start_over": "正在重新设计…",
201
+ "figure.progress.agent.find_figures": "正在查找已保存的模型…",
202
+ "figure.progress.agent.open_figure": "正在打开已保存的模型…",
203
+ "figure.progress.agent.finish": "正在收尾…",
194
204
  "error.figure-install-key-name-missing": "请输入密钥名称,即使用该密钥的看板服务器。",
195
205
  "error.figure-install-key-name-too-long": "密钥名称最多 {max} 个字符。",
196
206
  "error.figure-install-key-not-found": "没有该安装密钥。",