@contentful/experience-design-system-cli 2.37.1-dev-build-200af99b.0 → 2.37.1-dev-build-6df388e4.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/app.js CHANGED
@@ -1,3 +1,884 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __esm = (fn, res) => function __init() {
3
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ };
5
+
6
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/constants/vocabularies.js
7
+ var CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES;
8
+ var init_vocabularies = __esm({
9
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/constants/vocabularies.js"() {
10
+ "use strict";
11
+ CDF_PROPERTY_TYPES = [
12
+ "string",
13
+ "richtext",
14
+ "number",
15
+ "media",
16
+ "link",
17
+ "enum",
18
+ "token",
19
+ "boolean"
20
+ ];
21
+ CDF_PROPERTY_CATEGORIES = ["content", "design", "state", "unattached"];
22
+ }
23
+ });
24
+
25
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/constants/token-types.js
26
+ var DESIGN_TOKEN_TYPES;
27
+ var init_token_types = __esm({
28
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/constants/token-types.js"() {
29
+ "use strict";
30
+ DESIGN_TOKEN_TYPES = [
31
+ "color",
32
+ "dimension",
33
+ "fontFamily",
34
+ "fontWeight",
35
+ "duration",
36
+ "cubicBezier",
37
+ "number",
38
+ "strokeStyle",
39
+ "border",
40
+ "transition",
41
+ "shadow",
42
+ "gradient",
43
+ "typography"
44
+ ];
45
+ }
46
+ });
47
+
48
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/constants/schema.js
49
+ var CDF_SCHEMA_URL, cdfJsonSchema;
50
+ var init_schema = __esm({
51
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/constants/schema.js"() {
52
+ "use strict";
53
+ init_vocabularies();
54
+ init_token_types();
55
+ CDF_SCHEMA_URL = "https://contentful.com/schemas/cdf";
56
+ cdfJsonSchema = {
57
+ $schema: "http://json-schema.org/draft-07/schema#",
58
+ $id: CDF_SCHEMA_URL,
59
+ title: "CDF Component + Design Token Definition Format",
60
+ type: "object",
61
+ required: ["$schema"],
62
+ properties: {
63
+ $schema: { type: "string", const: CDF_SCHEMA_URL }
64
+ },
65
+ additionalProperties: { $ref: "#/definitions/groupOrEntry" },
66
+ definitions: {
67
+ groupOrEntry: {
68
+ oneOf: [{ $ref: "#/definitions/component" }, { $ref: "#/definitions/token" }, { $ref: "#/definitions/group" }]
69
+ },
70
+ component: {
71
+ type: "object",
72
+ required: ["$type", "$properties"],
73
+ properties: {
74
+ $type: { type: "string", const: "component" },
75
+ $description: { type: "string" },
76
+ $properties: {
77
+ type: "object",
78
+ additionalProperties: { $ref: "#/definitions/property" }
79
+ },
80
+ $slots: {
81
+ type: "object",
82
+ additionalProperties: { $ref: "#/definitions/slot" }
83
+ }
84
+ },
85
+ additionalProperties: false
86
+ },
87
+ property: {
88
+ type: "object",
89
+ required: ["$type", "$category"],
90
+ properties: {
91
+ $type: { type: "string", enum: [...CDF_PROPERTY_TYPES] },
92
+ $category: { type: "string", enum: [...CDF_PROPERTY_CATEGORIES] },
93
+ $description: { type: "string" },
94
+ $required: { type: "boolean" },
95
+ $default: {},
96
+ $values: { type: "array", items: { type: "string" } },
97
+ "$token.kind": { type: "string" },
98
+ "$token.allowed": { type: "array", items: { type: "string" } }
99
+ },
100
+ additionalProperties: false
101
+ },
102
+ slot: {
103
+ type: "object",
104
+ properties: {
105
+ $description: { type: "string" },
106
+ $required: { type: "boolean" },
107
+ $allowedComponents: { type: "array", items: { type: "string" } }
108
+ },
109
+ additionalProperties: false
110
+ },
111
+ token: {
112
+ type: "object",
113
+ required: ["$type", "$value"],
114
+ properties: {
115
+ $type: { type: "string", enum: [...DESIGN_TOKEN_TYPES] },
116
+ $value: {},
117
+ $description: { type: "string" }
118
+ },
119
+ additionalProperties: false
120
+ },
121
+ group: {
122
+ type: "object",
123
+ properties: { $description: { type: "string" } },
124
+ additionalProperties: { $ref: "#/definitions/groupOrEntry" }
125
+ }
126
+ }
127
+ };
128
+ }
129
+ });
130
+
131
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/helpers/validate.js
132
+ import { Ajv } from "ajv";
133
+ var ajv, validate, TOKEN_TYPE_SET;
134
+ var init_validate = __esm({
135
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/helpers/validate.js"() {
136
+ "use strict";
137
+ init_schema();
138
+ init_token_types();
139
+ ajv = new Ajv({ allErrors: true });
140
+ validate = ajv.compile(cdfJsonSchema);
141
+ TOKEN_TYPE_SET = new Set(DESIGN_TOKEN_TYPES);
142
+ }
143
+ });
144
+
145
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/types/agent-name.js
146
+ var init_agent_name = __esm({
147
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/types/agent-name.js"() {
148
+ "use strict";
149
+ }
150
+ });
151
+
152
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/types/agent-run.js
153
+ var init_agent_run = __esm({
154
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/types/agent-run.js"() {
155
+ "use strict";
156
+ }
157
+ });
158
+
159
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/types/invoker.js
160
+ var init_invoker = __esm({
161
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/types/invoker.js"() {
162
+ "use strict";
163
+ }
164
+ });
165
+
166
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/types/prompts.js
167
+ var init_prompts = __esm({
168
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/types/prompts.js"() {
169
+ "use strict";
170
+ }
171
+ });
172
+
173
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/types/tool-calls.js
174
+ var init_tool_calls = __esm({
175
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/types/tool-calls.js"() {
176
+ "use strict";
177
+ }
178
+ });
179
+
180
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/types/index.js
181
+ var init_types = __esm({
182
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/types/index.js"() {
183
+ "use strict";
184
+ init_agent_name();
185
+ init_agent_run();
186
+ init_invoker();
187
+ init_prompts();
188
+ init_tool_calls();
189
+ }
190
+ });
191
+
192
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/constants/models.js
193
+ var init_models = __esm({
194
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/constants/models.js"() {
195
+ "use strict";
196
+ }
197
+ });
198
+
199
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/is-agent-name.js
200
+ var init_is_agent_name = __esm({
201
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/is-agent-name.js"() {
202
+ "use strict";
203
+ init_agent_name();
204
+ }
205
+ });
206
+
207
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/constants/binaries.js
208
+ var init_binaries = __esm({
209
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/constants/binaries.js"() {
210
+ "use strict";
211
+ }
212
+ });
213
+
214
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/resolve-binary.js
215
+ var init_resolve_binary = __esm({
216
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/resolve-binary.js"() {
217
+ "use strict";
218
+ init_binaries();
219
+ }
220
+ });
221
+
222
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/constants/bedrock.js
223
+ var init_bedrock = __esm({
224
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/constants/bedrock.js"() {
225
+ "use strict";
226
+ }
227
+ });
228
+
229
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/bedrock/with-bedrock-provider-prefix.js
230
+ var init_with_bedrock_provider_prefix = __esm({
231
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/bedrock/with-bedrock-provider-prefix.js"() {
232
+ "use strict";
233
+ }
234
+ });
235
+
236
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/resolve-agent-model.js
237
+ var init_resolve_agent_model = __esm({
238
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/resolve-agent-model.js"() {
239
+ "use strict";
240
+ init_bedrock();
241
+ init_models();
242
+ init_with_bedrock_provider_prefix();
243
+ }
244
+ });
245
+
246
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/bedrock/agent-supports-bedrock.js
247
+ var init_agent_supports_bedrock = __esm({
248
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/bedrock/agent-supports-bedrock.js"() {
249
+ "use strict";
250
+ init_bedrock();
251
+ }
252
+ });
253
+
254
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-claude-args.js
255
+ var init_build_claude_args = __esm({
256
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-claude-args.js"() {
257
+ "use strict";
258
+ }
259
+ });
260
+
261
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/bedrock/codex-bedrock-config-args.js
262
+ var init_codex_bedrock_config_args = __esm({
263
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/bedrock/codex-bedrock-config-args.js"() {
264
+ "use strict";
265
+ init_bedrock();
266
+ }
267
+ });
268
+
269
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-codex-args.js
270
+ var init_build_codex_args = __esm({
271
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-codex-args.js"() {
272
+ "use strict";
273
+ init_codex_bedrock_config_args();
274
+ }
275
+ });
276
+
277
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-copilot-args.js
278
+ var init_build_copilot_args = __esm({
279
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-copilot-args.js"() {
280
+ "use strict";
281
+ init_resolve_agent_model();
282
+ }
283
+ });
284
+
285
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-cursor-args.js
286
+ var init_build_cursor_args = __esm({
287
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-cursor-args.js"() {
288
+ "use strict";
289
+ }
290
+ });
291
+
292
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-opencode-args.js
293
+ var init_build_opencode_args = __esm({
294
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-args/build-opencode-args.js"() {
295
+ "use strict";
296
+ }
297
+ });
298
+
299
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-agent-args.js
300
+ var init_build_agent_args = __esm({
301
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/build-agent-args.js"() {
302
+ "use strict";
303
+ init_build_claude_args();
304
+ init_build_codex_args();
305
+ init_build_copilot_args();
306
+ init_build_cursor_args();
307
+ init_build_opencode_args();
308
+ init_resolve_agent_model();
309
+ }
310
+ });
311
+
312
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/describe-agent-failure.js
313
+ var init_describe_agent_failure = __esm({
314
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/describe-agent-failure.js"() {
315
+ "use strict";
316
+ }
317
+ });
318
+
319
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/extract-sentinel-output.js
320
+ var init_extract_sentinel_output = __esm({
321
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/extract-sentinel-output.js"() {
322
+ "use strict";
323
+ }
324
+ });
325
+
326
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/format-generate-progress-line.js
327
+ var init_format_generate_progress_line = __esm({
328
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/format-generate-progress-line.js"() {
329
+ "use strict";
330
+ }
331
+ });
332
+
333
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/parse-agent-model.js
334
+ var init_parse_agent_model = __esm({
335
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/parse-agent-model.js"() {
336
+ "use strict";
337
+ }
338
+ });
339
+
340
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/resolve-agent.js
341
+ var init_resolve_agent = __esm({
342
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/resolve-agent.js"() {
343
+ "use strict";
344
+ }
345
+ });
346
+
347
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/resolve-model.js
348
+ var init_resolve_model = __esm({
349
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/resolve-model.js"() {
350
+ "use strict";
351
+ }
352
+ });
353
+
354
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/prompt-overrides/looks-like-path.js
355
+ var init_looks_like_path = __esm({
356
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/prompt-overrides/looks-like-path.js"() {
357
+ "use strict";
358
+ }
359
+ });
360
+
361
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/prompt-overrides/parse-prompt-overrides.js
362
+ var init_parse_prompt_overrides = __esm({
363
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/prompt-overrides/parse-prompt-overrides.js"() {
364
+ "use strict";
365
+ init_looks_like_path();
366
+ }
367
+ });
368
+
369
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/prompt-overrides/resolve-prompt-override.js
370
+ var init_resolve_prompt_override = __esm({
371
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/prompt-overrides/resolve-prompt-override.js"() {
372
+ "use strict";
373
+ }
374
+ });
375
+
376
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/build-user-agent.js
377
+ var init_build_user_agent = __esm({
378
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/build-user-agent.js"() {
379
+ "use strict";
380
+ }
381
+ });
382
+
383
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/constants/tool-names.js
384
+ var init_tool_names = __esm({
385
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/constants/tool-names.js"() {
386
+ "use strict";
387
+ }
388
+ });
389
+
390
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/helpers/find-json-object-end.js
391
+ var init_find_json_object_end = __esm({
392
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/helpers/find-json-object-end.js"() {
393
+ "use strict";
394
+ }
395
+ });
396
+
397
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/helpers/read-tool-call-objects.js
398
+ var init_read_tool_call_objects = __esm({
399
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/helpers/read-tool-call-objects.js"() {
400
+ "use strict";
401
+ init_find_json_object_end();
402
+ }
403
+ });
404
+
405
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/parse-select-tool-calls.js
406
+ var init_parse_select_tool_calls = __esm({
407
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/parse-select-tool-calls.js"() {
408
+ "use strict";
409
+ init_tool_names();
410
+ init_read_tool_call_objects();
411
+ }
412
+ });
413
+
414
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/parse-tool-calls.js
415
+ var init_parse_tool_calls = __esm({
416
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/parse-tool-calls.js"() {
417
+ "use strict";
418
+ init_tool_names();
419
+ init_read_tool_call_objects();
420
+ }
421
+ });
422
+
423
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/parse-token-tool-calls.js
424
+ var init_parse_token_tool_calls = __esm({
425
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/parse-token-tool-calls.js"() {
426
+ "use strict";
427
+ init_tool_names();
428
+ init_read_tool_call_objects();
429
+ }
430
+ });
431
+
432
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/helpers/is-string-array.js
433
+ var init_is_string_array = __esm({
434
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/helpers/is-string-array.js"() {
435
+ "use strict";
436
+ }
437
+ });
438
+
439
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/parse-map-token-prop-tool-calls.js
440
+ var init_parse_map_token_prop_tool_calls = __esm({
441
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/parsers/parse-map-token-prop-tool-calls.js"() {
442
+ "use strict";
443
+ init_is_string_array();
444
+ init_read_tool_call_objects();
445
+ }
446
+ });
447
+
448
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/services/run-agent.js
449
+ var init_run_agent = __esm({
450
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/services/run-agent.js"() {
451
+ "use strict";
452
+ init_bedrock();
453
+ init_build_agent_args();
454
+ init_resolve_binary();
455
+ }
456
+ });
457
+
458
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/services/check-agent-auth.js
459
+ var init_check_agent_auth = __esm({
460
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/services/check-agent-auth.js"() {
461
+ "use strict";
462
+ init_resolve_binary();
463
+ }
464
+ });
465
+
466
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/output-formatter/colors.js
467
+ function detectColorSupport() {
468
+ if (process.env["NO_COLOR"] !== void 0)
469
+ return false;
470
+ if (process.env["FORCE_COLOR"] !== void 0)
471
+ return true;
472
+ return process.stderr.isTTY === true;
473
+ }
474
+ var colorsEnabled, wrap, ansi;
475
+ var init_colors = __esm({
476
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/output-formatter/colors.js"() {
477
+ "use strict";
478
+ colorsEnabled = detectColorSupport();
479
+ wrap = (code) => (text) => colorsEnabled ? `\x1B[${code}m${text}\x1B[0m` : text;
480
+ ansi = {
481
+ green: wrap(32),
482
+ red: wrap(31),
483
+ cyan: wrap(36),
484
+ yellow: wrap(33),
485
+ dim: wrap(2),
486
+ bold: wrap(1)
487
+ };
488
+ }
489
+ });
490
+
491
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/output-formatter/format-tool-call.js
492
+ var init_format_tool_call = __esm({
493
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/output-formatter/format-tool-call.js"() {
494
+ "use strict";
495
+ init_colors();
496
+ }
497
+ });
498
+
499
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/output-formatter/output-formatter.js
500
+ var init_output_formatter = __esm({
501
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/output-formatter/output-formatter.js"() {
502
+ "use strict";
503
+ init_colors();
504
+ init_format_tool_call();
505
+ }
506
+ });
507
+
508
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/output-formatter/index.js
509
+ var init_output_formatter2 = __esm({
510
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/output-formatter/index.js"() {
511
+ "use strict";
512
+ init_output_formatter();
513
+ init_colors();
514
+ init_format_tool_call();
515
+ }
516
+ });
517
+
518
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/services/invoke-agent-with-output.js
519
+ var init_invoke_agent_with_output = __esm({
520
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/services/invoke-agent-with-output.js"() {
521
+ "use strict";
522
+ init_output_formatter2();
523
+ }
524
+ });
525
+
526
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/invoker/create-local-cli-agent-invoker.js
527
+ var init_create_local_cli_agent_invoker = __esm({
528
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/invoker/create-local-cli-agent-invoker.js"() {
529
+ "use strict";
530
+ init_check_agent_auth();
531
+ init_run_agent();
532
+ }
533
+ });
534
+
535
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/candidate-file.js
536
+ var init_candidate_file = __esm({
537
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/candidate-file.js"() {
538
+ "use strict";
539
+ }
540
+ });
541
+
542
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/types/types.js
543
+ import * as z from "zod/mini";
544
+ var CDFPropertySchema, CDFSlotSchema, CDFComponentSchema, CDFTokenSchema;
545
+ var init_types2 = __esm({
546
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/types/types.js"() {
547
+ "use strict";
548
+ init_vocabularies();
549
+ init_token_types();
550
+ CDFPropertySchema = z.strictObject({
551
+ $type: z.enum(CDF_PROPERTY_TYPES),
552
+ $category: z.enum(CDF_PROPERTY_CATEGORIES),
553
+ $description: z.optional(z.string()),
554
+ $required: z.optional(z.boolean()),
555
+ $default: z.optional(z.any()),
556
+ $values: z.optional(z.array(z.string())),
557
+ "$token.kind": z.optional(z.string()),
558
+ "$token.allowed": z.optional(z.array(z.string()))
559
+ });
560
+ CDFSlotSchema = z.strictObject({
561
+ $description: z.optional(z.string()),
562
+ $allowedComponents: z.optional(z.array(z.string())),
563
+ $required: z.optional(z.boolean())
564
+ });
565
+ CDFComponentSchema = z.strictObject({
566
+ $type: z.literal("component"),
567
+ $description: z.optional(z.string()),
568
+ $properties: z.record(z.string(), CDFPropertySchema),
569
+ $slots: z.optional(z.record(z.string(), CDFSlotSchema))
570
+ });
571
+ CDFTokenSchema = z.strictObject({
572
+ $type: z.enum(DESIGN_TOKEN_TYPES),
573
+ $value: z.unknown(),
574
+ $description: z.optional(z.string())
575
+ });
576
+ }
577
+ });
578
+
579
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/types/index.js
580
+ var init_types3 = __esm({
581
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/types/index.js"() {
582
+ "use strict";
583
+ init_types2();
584
+ }
585
+ });
586
+
587
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/constants/index.js
588
+ var init_constants = __esm({
589
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/constants/index.js"() {
590
+ "use strict";
591
+ init_schema();
592
+ init_vocabularies();
593
+ }
594
+ });
595
+
596
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/helpers/build.js
597
+ var init_build = __esm({
598
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/helpers/build.js"() {
599
+ "use strict";
600
+ init_schema();
601
+ }
602
+ });
603
+
604
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/helpers/index.js
605
+ var init_helpers = __esm({
606
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/helpers/index.js"() {
607
+ "use strict";
608
+ init_build();
609
+ init_validate();
610
+ }
611
+ });
612
+
613
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/index.js
614
+ var init_cdf = __esm({
615
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/index.js"() {
616
+ "use strict";
617
+ init_types3();
618
+ init_constants();
619
+ init_helpers();
620
+ }
621
+ });
622
+
623
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/types/types.js
624
+ import * as z2 from "zod/mini";
625
+ var DTCGTokenSchema;
626
+ var init_types4 = __esm({
627
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/types/types.js"() {
628
+ "use strict";
629
+ init_token_types();
630
+ DTCGTokenSchema = z2.strictObject({
631
+ path: z2.string(),
632
+ $type: z2.enum(DESIGN_TOKEN_TYPES),
633
+ $value: z2.unknown(),
634
+ $description: z2.optional(z2.string())
635
+ });
636
+ }
637
+ });
638
+
639
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/types/index.js
640
+ var init_types5 = __esm({
641
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/types/index.js"() {
642
+ "use strict";
643
+ init_types4();
644
+ }
645
+ });
646
+
647
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/constants/index.js
648
+ var init_constants2 = __esm({
649
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/constants/index.js"() {
650
+ "use strict";
651
+ init_token_types();
652
+ }
653
+ });
654
+
655
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/helpers/flatten.js
656
+ var init_flatten = __esm({
657
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/helpers/flatten.js"() {
658
+ "use strict";
659
+ }
660
+ });
661
+
662
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/helpers/validate.js
663
+ var TOKEN_TYPE_SET2;
664
+ var init_validate2 = __esm({
665
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/helpers/validate.js"() {
666
+ "use strict";
667
+ init_token_types();
668
+ init_flatten();
669
+ TOKEN_TYPE_SET2 = new Set(DESIGN_TOKEN_TYPES);
670
+ }
671
+ });
672
+
673
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/helpers/index.js
674
+ var init_helpers2 = __esm({
675
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/helpers/index.js"() {
676
+ "use strict";
677
+ init_flatten();
678
+ init_validate2();
679
+ }
680
+ });
681
+
682
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/index.js
683
+ var init_dtcg = __esm({
684
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/index.js"() {
685
+ "use strict";
686
+ init_types5();
687
+ init_constants2();
688
+ init_helpers2();
689
+ }
690
+ });
691
+
692
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/sources-api/types/apply.js
693
+ var init_apply = __esm({
694
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/sources-api/types/apply.js"() {
695
+ "use strict";
696
+ }
697
+ });
698
+
699
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/sources-api/types/preview.js
700
+ var init_preview = __esm({
701
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/sources-api/types/preview.js"() {
702
+ "use strict";
703
+ }
704
+ });
705
+
706
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/sources-api/types/index.js
707
+ var init_types6 = __esm({
708
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/sources-api/types/index.js"() {
709
+ "use strict";
710
+ init_apply();
711
+ init_preview();
712
+ }
713
+ });
714
+
715
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/sources-api/index.js
716
+ var init_sources_api = __esm({
717
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/sources-api/index.js"() {
718
+ "use strict";
719
+ init_types6();
720
+ }
721
+ });
722
+
723
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/index.js
724
+ var init_shared = __esm({
725
+ "packages/experience-design-system-backend-pipeline/dist/src/steps/shared/index.js"() {
726
+ "use strict";
727
+ init_candidate_file();
728
+ init_cdf();
729
+ init_dtcg();
730
+ init_sources_api();
731
+ }
732
+ });
733
+
734
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/filter-design-token-props.js
735
+ var init_filter_design_token_props = __esm({
736
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/filter-design-token-props.js"() {
737
+ "use strict";
738
+ }
739
+ });
740
+
741
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/format-token-candidates.js
742
+ var init_format_token_candidates = __esm({
743
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/format-token-candidates.js"() {
744
+ "use strict";
745
+ }
746
+ });
747
+
748
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/infer-fence-lang.js
749
+ var init_infer_fence_lang = __esm({
750
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/infer-fence-lang.js"() {
751
+ "use strict";
752
+ }
753
+ });
754
+
755
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/build-input-sections.js
756
+ var init_build_input_sections = __esm({
757
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/build-input-sections.js"() {
758
+ "use strict";
759
+ init_shared();
760
+ init_filter_design_token_props();
761
+ init_format_token_candidates();
762
+ init_infer_fence_lang();
763
+ }
764
+ });
765
+
766
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/constants/skill-files.js
767
+ var init_skill_files = __esm({
768
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/constants/skill-files.js"() {
769
+ "use strict";
770
+ }
771
+ });
772
+
773
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/resolve-skill-path.js
774
+ var init_resolve_skill_path = __esm({
775
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/resolve-skill-path.js"() {
776
+ "use strict";
777
+ init_skill_files();
778
+ }
779
+ });
780
+
781
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/read-skill-file.js
782
+ var init_read_skill_file = __esm({
783
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/helpers/read-skill-file.js"() {
784
+ "use strict";
785
+ init_resolve_skill_path();
786
+ }
787
+ });
788
+
789
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/preambles/build-components-preamble.js
790
+ var init_build_components_preamble = __esm({
791
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/preambles/build-components-preamble.js"() {
792
+ "use strict";
793
+ }
794
+ });
795
+
796
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/preambles/build-map-tokens-preamble.js
797
+ var init_build_map_tokens_preamble = __esm({
798
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/preambles/build-map-tokens-preamble.js"() {
799
+ "use strict";
800
+ }
801
+ });
802
+
803
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/preambles/build-select-preamble.js
804
+ var init_build_select_preamble = __esm({
805
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/preambles/build-select-preamble.js"() {
806
+ "use strict";
807
+ }
808
+ });
809
+
810
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/preambles/build-tokens-preamble.js
811
+ var init_build_tokens_preamble = __esm({
812
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/preambles/build-tokens-preamble.js"() {
813
+ "use strict";
814
+ }
815
+ });
816
+
817
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/build-prompt.js
818
+ var init_build_prompt = __esm({
819
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/build-prompt.js"() {
820
+ "use strict";
821
+ init_build_input_sections();
822
+ init_read_skill_file();
823
+ init_build_components_preamble();
824
+ init_build_map_tokens_preamble();
825
+ init_build_select_preamble();
826
+ init_build_tokens_preamble();
827
+ }
828
+ });
829
+
830
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/format-custom-prompt-banner.js
831
+ var init_format_custom_prompt_banner = __esm({
832
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/format-custom-prompt-banner.js"() {
833
+ "use strict";
834
+ }
835
+ });
836
+
837
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/index.js
838
+ var init_agents = __esm({
839
+ "packages/experience-design-system-backend-pipeline/dist/src/agents/index.js"() {
840
+ "use strict";
841
+ init_types();
842
+ init_models();
843
+ init_is_agent_name();
844
+ init_resolve_binary();
845
+ init_resolve_agent_model();
846
+ init_agent_supports_bedrock();
847
+ init_build_agent_args();
848
+ init_describe_agent_failure();
849
+ init_extract_sentinel_output();
850
+ init_format_generate_progress_line();
851
+ init_parse_agent_model();
852
+ init_resolve_agent();
853
+ init_resolve_model();
854
+ init_looks_like_path();
855
+ init_parse_prompt_overrides();
856
+ init_resolve_prompt_override();
857
+ init_build_user_agent();
858
+ init_parse_select_tool_calls();
859
+ init_parse_tool_calls();
860
+ init_parse_token_tool_calls();
861
+ init_parse_map_token_prop_tool_calls();
862
+ init_parse_map_token_prop_tool_calls();
863
+ init_run_agent();
864
+ init_check_agent_auth();
865
+ init_invoke_agent_with_output();
866
+ init_output_formatter2();
867
+ init_create_local_cli_agent_invoker();
868
+ init_build_prompt();
869
+ init_resolve_skill_path();
870
+ init_format_custom_prompt_banner();
871
+ }
872
+ });
873
+
874
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/cache-keys.js
875
+ var init_cache_keys = __esm({
876
+ "packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/cache-keys.js"() {
877
+ "use strict";
878
+ init_agents();
879
+ }
880
+ });
881
+
1
882
  // packages/experience-design-system-cli/app.tsx
2
883
  import { useEffect as useEffect9, useState as useState13 } from "react";
3
884
 
@@ -283,8 +1164,8 @@ function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
283
1164
  const [projectPath, setProjectPath] = useState3(initialPath);
284
1165
  useWelcomeControls(onQuit);
285
1166
  const submit = (value) => {
286
- const path = toProjectPath(value);
287
- if (path) onContinue(path);
1167
+ const path5 = toProjectPath(value);
1168
+ if (path5) onContinue(path5);
288
1169
  };
289
1170
  return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
290
1171
  /* @__PURE__ */ jsx4(Text4, { bold: true, color: PALETTE.success, children: "\u{1F44B} Hey! Let's import your design system into Contentful." }),
@@ -361,24 +1242,24 @@ function resolveUserPath(raw) {
361
1242
 
362
1243
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/validate-path.ts
363
1244
  function validateTokenPath(rawPath) {
364
- const path = resolveUserPath(rawPath);
1245
+ const path5 = resolveUserPath(rawPath);
365
1246
  let stats;
366
1247
  try {
367
- stats = statSync(path);
1248
+ stats = statSync(path5);
368
1249
  } catch {
369
- return { ok: false, error: `Path not found: ${path}`, resolvedPath: path };
1250
+ return { ok: false, error: `Path not found: ${path5}`, resolvedPath: path5 };
370
1251
  }
371
1252
  if (stats.isDirectory()) {
372
1253
  return {
373
1254
  ok: false,
374
1255
  error: "That's a directory \u2014 provide a path to a token file (e.g. tokens.json), not a folder.",
375
- resolvedPath: path
1256
+ resolvedPath: path5
376
1257
  };
377
1258
  }
378
1259
  if (!stats.isFile()) {
379
- return { ok: false, error: `Not a regular file: ${path}`, resolvedPath: path };
1260
+ return { ok: false, error: `Not a regular file: ${path5}`, resolvedPath: path5 };
380
1261
  }
381
- return { ok: true, path };
1262
+ return { ok: true, path: path5 };
382
1263
  }
383
1264
 
384
1265
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
@@ -438,26 +1319,6 @@ import { Box as Box5, Text as Text6 } from "ink";
438
1319
  import { useInput as useInput5 } from "ink";
439
1320
 
440
1321
  // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/logic.ts
441
- var IGNORED_DIRECTORIES = /* @__PURE__ */ new Set([
442
- "node_modules",
443
- "dist",
444
- "build",
445
- ".next",
446
- ".nuxt",
447
- "coverage",
448
- "storybook-static",
449
- "out",
450
- ".git"
451
- ]);
452
- var CATEGORY_BY_EXTENSION = /* @__PURE__ */ new Map([
453
- ["tsx", "tsx"],
454
- ["ts", "ts"],
455
- ["vue", "vue"],
456
- ["astro", "astro"],
457
- ["jsx", "jsx"],
458
- ["js", "js"],
459
- ["json", "json"]
460
- ]);
461
1322
  var COMPONENT_CATEGORIES = ["tsx", "ts", "vue", "astro", "jsx", "js"];
462
1323
  var ROW_LABELS = {
463
1324
  tsx: ".tsx files",
@@ -470,38 +1331,7 @@ var ROW_LABELS = {
470
1331
  other: "other (ignored)"
471
1332
  };
472
1333
  var ROW_ORDER = ["tsx", "ts", "vue", "astro", "jsx", "js", "json", "other"];
473
- function categorize(fileName) {
474
- if (fileName.endsWith(".d.ts")) return "other";
475
- const dot = fileName.lastIndexOf(".");
476
- const extension = dot === -1 ? "" : fileName.slice(dot + 1);
477
- return CATEGORY_BY_EXTENSION.get(extension) ?? "other";
478
- }
479
- function emptyCounts() {
480
- return { tsx: 0, ts: 0, vue: 0, astro: 0, jsx: 0, js: 0, json: 0, other: 0, total: 0 };
481
- }
482
- function addFile(counts, fileName) {
483
- const category = categorize(fileName);
484
- return { ...counts, [category]: counts[category] + 1, total: counts.total + 1 };
485
- }
486
- function mergeCounts(a, b) {
487
- return {
488
- tsx: a.tsx + b.tsx,
489
- ts: a.ts + b.ts,
490
- vue: a.vue + b.vue,
491
- astro: a.astro + b.astro,
492
- jsx: a.jsx + b.jsx,
493
- js: a.js + b.js,
494
- json: a.json + b.json,
495
- other: a.other + b.other,
496
- total: a.total + b.total
497
- };
498
- }
499
- function failureFromErrorCode(code) {
500
- if (code === "ENOENT") return "not-found";
501
- if (code === "EACCES") return "permission-denied";
502
- return "unreadable";
503
- }
504
- function describeFailure(failure, path) {
1334
+ function describeFailure(failure, path5) {
505
1335
  switch (failure) {
506
1336
  case "is-file":
507
1337
  return {
@@ -513,18 +1343,18 @@ function describeFailure(failure, path) {
513
1343
  };
514
1344
  case "not-found":
515
1345
  return {
516
- headline: `Directory not found: ${path}`,
1346
+ headline: `Directory not found: ${path5}`,
517
1347
  hints: ["Double-check the path and try again. Tip: you can use ~, relative, or absolute paths."]
518
1348
  };
519
1349
  case "permission-denied":
520
1350
  return {
521
- headline: `Permission denied: ${path}`,
1351
+ headline: `Permission denied: ${path5}`,
522
1352
  hints: ["You don't have read access to this directory."]
523
1353
  };
524
1354
  case "not-directory":
525
- return { headline: `Not a directory: ${path}`, hints: [] };
1355
+ return { headline: `Not a directory: ${path5}`, hints: [] };
526
1356
  case "unreadable":
527
- return { headline: `Cannot access: ${path}`, hints: [] };
1357
+ return { headline: `Cannot access: ${path5}`, hints: [] };
528
1358
  }
529
1359
  }
530
1360
  function summarize(counts) {
@@ -582,43 +1412,1052 @@ function usePathValidationControls(phase, handlers) {
582
1412
  });
583
1413
  }
584
1414
 
585
- // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/loader.ts
586
- import { readdir, stat } from "node:fs/promises";
587
- import { join as join3 } from "node:path";
588
- async function isFile(path) {
1415
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/repositories/db.js
1416
+ import { DatabaseSync } from "node:sqlite";
1417
+
1418
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/controller/export/export-cdf-document.js
1419
+ init_schema();
1420
+
1421
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/cdf/validators/validate-cdf-file.js
1422
+ init_validate();
1423
+
1424
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/shared/dtcg/validators/helpers/walk-dtcg.js
1425
+ init_token_types();
1426
+
1427
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/stencil/extract-stencil-components.js
1428
+ import { Project as Project2, Node as Node2, SyntaxKind as SyntaxKind2 } from "ts-morph";
1429
+
1430
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/shared/extract-tsx-components.js
1431
+ import { Node, Project, SyntaxKind } from "ts-morph";
1432
+ import ts from "typescript";
1433
+
1434
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/react/extract-react-components.js
1435
+ import { Node as Node4, SyntaxKind as SyntaxKind4 } from "ts-morph";
1436
+
1437
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/helpers/evidence/structural-slot-evidence.js
1438
+ import { Node as Node3, SyntaxKind as SyntaxKind3 } from "ts-morph";
1439
+
1440
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/react/extract-react-components.js
1441
+ function createTextControlSurface(onChangeType, specificProps) {
1442
+ return [
1443
+ { name: "autoComplete", type: "string", required: false },
1444
+ ...specificProps,
1445
+ { name: "disabled", type: "boolean", required: false },
1446
+ { name: "name", type: "string", required: false },
1447
+ { name: "onChange", type: onChangeType, required: false },
1448
+ { name: "placeholder", type: "string", required: false },
1449
+ { name: "readOnly", type: "boolean", required: false },
1450
+ { name: "required", type: "boolean", required: false },
1451
+ {
1452
+ name: "value",
1453
+ type: "string | number | readonly string[]",
1454
+ required: false
1455
+ }
1456
+ ];
1457
+ }
1458
+ var DOM_ATTRIBUTE_PROP_SURFACES = {
1459
+ HTMLProps: [],
1460
+ HTMLAttributes: [
1461
+ { name: "className", type: "string", required: false },
1462
+ { name: "hidden", type: "boolean", required: false },
1463
+ { name: "id", type: "string", required: false },
1464
+ {
1465
+ name: "onClick",
1466
+ type: "MouseEventHandler<HTMLElement>",
1467
+ required: false
1468
+ },
1469
+ { name: "style", type: "CSSProperties", required: false },
1470
+ { name: "tabIndex", type: "number", required: false },
1471
+ { name: "title", type: "string", required: false }
1472
+ ],
1473
+ ImgHTMLAttributes: [
1474
+ { name: "alt", type: "string", required: false },
1475
+ { name: "crossOrigin", type: "string", required: false },
1476
+ { name: "height", type: "number | string", required: false },
1477
+ {
1478
+ name: "loading",
1479
+ type: "string",
1480
+ required: false,
1481
+ allowedValues: ["eager", "lazy"]
1482
+ },
1483
+ { name: "sizes", type: "string", required: false },
1484
+ { name: "src", type: "string", required: false },
1485
+ { name: "srcSet", type: "string", required: false },
1486
+ { name: "width", type: "number | string", required: false }
1487
+ ],
1488
+ LiHTMLAttributes: [],
1489
+ AnchorHTMLAttributes: [
1490
+ { name: "download", type: "boolean | string", required: false },
1491
+ { name: "href", type: "string", required: false },
1492
+ { name: "hrefLang", type: "string", required: false },
1493
+ { name: "referrerPolicy", type: "string", required: false },
1494
+ { name: "rel", type: "string", required: false },
1495
+ {
1496
+ name: "target",
1497
+ type: "string",
1498
+ required: false,
1499
+ allowedValues: ["_blank", "_parent", "_self", "_top"]
1500
+ }
1501
+ ],
1502
+ ButtonHTMLAttributes: [
1503
+ { name: "autoFocus", type: "boolean", required: false },
1504
+ { name: "disabled", type: "boolean", required: false },
1505
+ { name: "form", type: "string", required: false },
1506
+ { name: "formAction", type: "string", required: false },
1507
+ { name: "formMethod", type: "string", required: false },
1508
+ { name: "formNoValidate", type: "boolean", required: false },
1509
+ { name: "formTarget", type: "string", required: false },
1510
+ { name: "name", type: "string", required: false },
1511
+ {
1512
+ name: "type",
1513
+ type: "string",
1514
+ required: false,
1515
+ allowedValues: ["button", "reset", "submit"]
1516
+ },
1517
+ {
1518
+ name: "value",
1519
+ type: "string | number | readonly string[]",
1520
+ required: false
1521
+ }
1522
+ ],
1523
+ InputHTMLAttributes: createTextControlSurface("ChangeEventHandler<HTMLInputElement>", [
1524
+ { name: "checked", type: "boolean", required: false },
1525
+ { name: "max", type: "number | string", required: false },
1526
+ { name: "maxLength", type: "number", required: false },
1527
+ { name: "min", type: "number | string", required: false },
1528
+ { name: "minLength", type: "number", required: false },
1529
+ { name: "type", type: "string", required: false }
1530
+ ]),
1531
+ FieldsetHTMLAttributes: [
1532
+ { name: "disabled", type: "boolean", required: false },
1533
+ { name: "form", type: "string", required: false },
1534
+ { name: "name", type: "string", required: false }
1535
+ ],
1536
+ LabelHTMLAttributes: [
1537
+ { name: "form", type: "string", required: false },
1538
+ { name: "htmlFor", type: "string", required: false }
1539
+ ],
1540
+ SelectHTMLAttributes: [
1541
+ { name: "autoComplete", type: "string", required: false },
1542
+ { name: "disabled", type: "boolean", required: false },
1543
+ { name: "form", type: "string", required: false },
1544
+ { name: "multiple", type: "boolean", required: false },
1545
+ { name: "name", type: "string", required: false },
1546
+ {
1547
+ name: "onChange",
1548
+ type: "ChangeEventHandler<HTMLSelectElement>",
1549
+ required: false
1550
+ },
1551
+ { name: "required", type: "boolean", required: false },
1552
+ { name: "size", type: "number", required: false },
1553
+ {
1554
+ name: "value",
1555
+ type: "string | number | readonly string[]",
1556
+ required: false
1557
+ }
1558
+ ],
1559
+ SVGAttributes: [
1560
+ {
1561
+ name: "focusable",
1562
+ type: 'boolean | "auto"',
1563
+ required: false,
1564
+ allowedValues: ["auto"]
1565
+ },
1566
+ { name: "height", type: "number | string", required: false },
1567
+ { name: "viewBox", type: "string", required: false },
1568
+ { name: "width", type: "number | string", required: false }
1569
+ ],
1570
+ SVGProps: [],
1571
+ TextareaHTMLAttributes: createTextControlSurface("ChangeEventHandler<HTMLTextAreaElement>", [
1572
+ { name: "cols", type: "number", required: false },
1573
+ { name: "rows", type: "number", required: false },
1574
+ { name: "wrap", type: "string", required: false }
1575
+ ]),
1576
+ TdHTMLAttributes: [
1577
+ {
1578
+ name: "align",
1579
+ type: "string",
1580
+ required: false,
1581
+ allowedValues: ["center", "char", "justify", "left", "right"]
1582
+ },
1583
+ { name: "colSpan", type: "number", required: false },
1584
+ { name: "headers", type: "string", required: false },
1585
+ { name: "rowSpan", type: "number", required: false },
1586
+ { name: "scope", type: "string", required: false }
1587
+ ]
1588
+ };
1589
+
1590
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/vue-tsx/extract-vue-tsx-components.js
1591
+ import { Node as Node5, SyntaxKind as SyntaxKind5 } from "ts-morph";
1592
+
1593
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/vue/extract-vue-components.js
1594
+ import { parse as parseSFC } from "@vue/compiler-sfc";
1595
+ import { Project as Project3, Node as Node6 } from "ts-morph";
1596
+
1597
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/astro/extract-astro-components.js
1598
+ import { Project as Project4, Node as Node7 } from "ts-morph";
1599
+
1600
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/web-components/extract-web-components.js
1601
+ import { Project as Project5, Node as Node8, SyntaxKind as SyntaxKind6 } from "ts-morph";
1602
+
1603
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/svelte/extract-svelte-components.js
1604
+ import { parse as parseSvelte } from "svelte/compiler";
1605
+ import { Project as Project6, Node as Node9, ScriptTarget, ModuleKind, ts as ts2 } from "ts-morph";
1606
+
1607
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/controller/endpoint/compose-components-endpoint.js
1608
+ init_agents();
1609
+
1610
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/services/run-composition-service.js
1611
+ init_agents();
1612
+
1613
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/selection/src/controller/select-components-endpoint.js
1614
+ init_agents();
1615
+
1616
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/selection/src/services/run-selection-service.js
1617
+ init_agents();
1618
+ var DEFAULT_TIMEOUT_MS = Number(process.env.EDS_AGENT_TIMEOUT_MS ?? 5 * 60 * 1e3);
1619
+
1620
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/collect-files.js
1621
+ import { statSync as statSync2 } from "node:fs";
1622
+ import path4 from "node:path";
1623
+
1624
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/build-scan-warnings.js
1625
+ function buildScanWarnings(counts) {
1626
+ const warnings = [];
1627
+ if (counts.total === 0) {
1628
+ warnings.push("No source files found. Double-check the path points at your component code.");
1629
+ return warnings;
1630
+ }
1631
+ const frameworkFiles = counts.tsx + counts.ts + counts.jsx + counts.js + counts.vue + counts.astro + counts.svelte;
1632
+ if (frameworkFiles === 0) {
1633
+ warnings.push("No framework source files found (.tsx, .ts, .vue, .svelte, .astro, .jsx, .js).");
1634
+ }
1635
+ return warnings;
1636
+ }
1637
+
1638
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/classify-stat-error.js
1639
+ function classifyStatError(code) {
1640
+ switch (code) {
1641
+ case "ENOENT":
1642
+ return "not-found";
1643
+ case "EACCES":
1644
+ case "EPERM":
1645
+ return "permission-denied";
1646
+ default:
1647
+ return "unreadable";
1648
+ }
1649
+ }
1650
+
1651
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/empty-file-counts.js
1652
+ function emptyFileCounts() {
1653
+ return { tsx: 0, ts: 0, vue: 0, astro: 0, svelte: 0, jsx: 0, js: 0, json: 0, md: 0, other: 0, total: 0 };
1654
+ }
1655
+
1656
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/walk-project-tree.js
1657
+ import { readFileSync as readFileSync3 } from "node:fs";
1658
+ import path3 from "node:path";
1659
+
1660
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/constants/file-patterns.js
1661
+ var INCLUDED_EXTENSIONS = /* @__PURE__ */ new Set([".astro", ".js", ".jsx", ".svelte", ".ts", ".tsx", ".vue"]);
1662
+ var DENYLIST_GATED_EXTENSIONS = /* @__PURE__ */ new Set([".json", ".md"]);
1663
+ var EXCLUDED_SUFFIXES = [
1664
+ ".d.ts",
1665
+ ".stories.ts",
1666
+ ".stories.tsx",
1667
+ ".stories.js",
1668
+ ".stories.jsx",
1669
+ ".story.ts",
1670
+ ".story.tsx",
1671
+ ".story.js",
1672
+ ".story.jsx",
1673
+ ".spec.ts",
1674
+ ".spec.tsx",
1675
+ ".test.ts",
1676
+ ".test.tsx"
1677
+ ];
1678
+ var IGNORED_DIRS = /* @__PURE__ */ new Set([
1679
+ ".changeset",
1680
+ ".git",
1681
+ ".github",
1682
+ ".idea",
1683
+ ".next",
1684
+ ".nuxt",
1685
+ ".nx",
1686
+ ".vscode",
1687
+ "build",
1688
+ "coverage",
1689
+ "demo",
1690
+ "demos",
1691
+ "dist",
1692
+ "example",
1693
+ "examples",
1694
+ "node_modules",
1695
+ "out",
1696
+ "storybook-static"
1697
+ ]);
1698
+ var DENYLISTED_EXACT_FILE_NAMES = /* @__PURE__ */ new Set([
1699
+ "package.json",
1700
+ "package-lock.json",
1701
+ "npm-shrinkwrap.json",
1702
+ "nx.json",
1703
+ "project.json",
1704
+ "turbo.json",
1705
+ "lerna.json",
1706
+ "jsconfig.json"
1707
+ ]);
1708
+ var DENYLISTED_FILE_NAME_PATTERNS = [
1709
+ /^tsconfig(\..+)?\.json$/,
1710
+ /^\.?eslintrc(\..+)?\.json$/,
1711
+ /^\.?prettierrc(\..+)?\.json$/,
1712
+ /^(readme|changelog|contributing|code_of_conduct|license|security)(\..+)?\.md$/i
1713
+ ];
1714
+
1715
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/categorize-file.js
1716
+ import path from "node:path";
1717
+
1718
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/constants/file-categories.js
1719
+ var CATEGORY_BY_EXTENSION = {
1720
+ ".tsx": "tsx",
1721
+ ".ts": "ts",
1722
+ ".vue": "vue",
1723
+ ".astro": "astro",
1724
+ ".svelte": "svelte",
1725
+ ".jsx": "jsx",
1726
+ ".js": "js",
1727
+ ".json": "json",
1728
+ ".md": "md"
1729
+ };
1730
+
1731
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/categorize-file.js
1732
+ function categorizeFile(name) {
1733
+ if (name.endsWith(".d.ts"))
1734
+ return "other";
1735
+ const ext = path.extname(name);
1736
+ return CATEGORY_BY_EXTENSION[ext] ?? "other";
1737
+ }
1738
+
1739
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-source-file.js
1740
+ import path2 from "node:path";
1741
+
1742
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-noise-config-file.js
1743
+ function isNoiseConfigFile(name) {
1744
+ return DENYLISTED_EXACT_FILE_NAMES.has(name) || DENYLISTED_FILE_NAME_PATTERNS.some((pattern) => pattern.test(name));
1745
+ }
1746
+
1747
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-source-file.js
1748
+ function isSourceFile(name) {
1749
+ if (name.endsWith(".d.ts"))
1750
+ return false;
1751
+ if (EXCLUDED_SUFFIXES.some((suffix) => name.endsWith(suffix)))
1752
+ return false;
1753
+ const ext = path2.extname(name);
1754
+ if (INCLUDED_EXTENSIONS.has(ext))
1755
+ return true;
1756
+ if (DENYLIST_GATED_EXTENSIONS.has(ext) && !isNoiseConfigFile(name))
1757
+ return true;
1758
+ return false;
1759
+ }
1760
+
1761
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/read-dir-safely.js
1762
+ import { readdirSync } from "node:fs";
1763
+ function readDirSafely(dir) {
589
1764
  try {
590
- return (await stat(path)).isFile();
1765
+ return readdirSync(dir, { withFileTypes: true });
591
1766
  } catch {
592
- return false;
1767
+ return "unreadable";
593
1768
  }
594
1769
  }
595
- async function countEntry(directory, entry) {
596
- const path = join3(directory, entry.name);
597
- if (entry.isDirectory()) return countFiles(path);
598
- if (entry.isFile() || entry.isSymbolicLink() && await isFile(path)) return addFile(emptyCounts(), entry.name);
599
- return emptyCounts();
1770
+
1771
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/walk-project-tree.js
1772
+ function walkProjectTree(dir, result, includeContent) {
1773
+ const entries = readDirSafely(dir);
1774
+ if (entries === "unreadable") {
1775
+ result.warnings.push(`Could not read directory: ${dir}`);
1776
+ return;
1777
+ }
1778
+ for (const entry of entries) {
1779
+ const full = path3.join(dir, entry.name);
1780
+ if (entry.isDirectory()) {
1781
+ if (!IGNORED_DIRS.has(entry.name))
1782
+ walkProjectTree(full, result, includeContent);
1783
+ continue;
1784
+ }
1785
+ if (!entry.isFile())
1786
+ continue;
1787
+ if (!isSourceFile(entry.name))
1788
+ continue;
1789
+ const category = categorizeFile(entry.name);
1790
+ result.counts[category] += 1;
1791
+ result.counts.total += 1;
1792
+ result.filePaths.push(full);
1793
+ if (includeContent) {
1794
+ try {
1795
+ const content = readFileSync3(full, "utf8");
1796
+ (result.candidateFiles ??= []).push({ path: full, content });
1797
+ } catch {
1798
+ }
1799
+ }
1800
+ }
600
1801
  }
601
- async function countFiles(directory) {
602
- let entries;
1802
+
1803
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/collect-files.js
1804
+ function collectFiles(root, options = {}) {
1805
+ const resolved = path4.resolve(root);
1806
+ let stat;
603
1807
  try {
604
- entries = await readdir(directory, { withFileTypes: true });
605
- } catch {
606
- return emptyCounts();
1808
+ stat = statSync2(resolved);
1809
+ } catch (err) {
1810
+ return { ok: false, failure: classifyStatError(err.code), rootPath: resolved };
607
1811
  }
608
- const counts = await Promise.all(
609
- entries.filter((entry) => !IGNORED_DIRECTORIES.has(entry.name)).map((entry) => countEntry(directory, entry))
610
- );
611
- return counts.reduce(mergeCounts, emptyCounts());
1812
+ if (stat.isFile())
1813
+ return { ok: false, failure: "is-file", rootPath: resolved };
1814
+ if (!stat.isDirectory())
1815
+ return { ok: false, failure: "not-directory", rootPath: resolved };
1816
+ const result = {
1817
+ filePaths: [],
1818
+ counts: emptyFileCounts(),
1819
+ warnings: [],
1820
+ rootPath: resolved
1821
+ };
1822
+ if (options.includeContent)
1823
+ result.candidateFiles = [];
1824
+ walkProjectTree(resolved, result, options.includeContent === true);
1825
+ result.filePaths.sort();
1826
+ if (result.candidateFiles)
1827
+ result.candidateFiles.sort((a, b) => a.path.localeCompare(b.path));
1828
+ result.warnings.push(...buildScanWarnings(result.counts));
1829
+ return { ok: true, result };
1830
+ }
1831
+
1832
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/index.js
1833
+ import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
1834
+
1835
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/repositories/migration.js
1836
+ import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
1837
+
1838
+ // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/index.js
1839
+ init_cache_keys();
1840
+
1841
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/controller/generate-cdf-components-endpoint.js
1842
+ init_agents();
1843
+
1844
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/services/run-cdf-generation-service.js
1845
+ init_agents();
1846
+
1847
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/services/run-apply-service.js
1848
+ init_shared();
1849
+
1850
+ // packages/experience-design-system-client/dist/src/generated/core/bodySerializer.gen.js
1851
+ var jsonBodySerializer = {
1852
+ bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
1853
+ };
1854
+
1855
+ // packages/experience-design-system-client/dist/src/generated/core/params.gen.js
1856
+ var extraPrefixesMap = {
1857
+ $body_: "body",
1858
+ $headers_: "headers",
1859
+ $path_: "path",
1860
+ $query_: "query"
1861
+ };
1862
+ var extraPrefixes = Object.entries(extraPrefixesMap);
1863
+
1864
+ // packages/experience-design-system-client/dist/src/generated/core/auth.gen.js
1865
+ var getAuthToken = async (auth, callback) => {
1866
+ const token = typeof callback === "function" ? await callback(auth) : callback;
1867
+ if (!token) {
1868
+ return;
1869
+ }
1870
+ if (auth.scheme === "bearer") {
1871
+ return `Bearer ${token}`;
1872
+ }
1873
+ if (auth.scheme === "basic") {
1874
+ return `Basic ${btoa(token)}`;
1875
+ }
1876
+ return token;
1877
+ };
1878
+
1879
+ // packages/experience-design-system-client/dist/src/generated/core/pathSerializer.gen.js
1880
+ var separatorArrayExplode = (style) => {
1881
+ switch (style) {
1882
+ case "label":
1883
+ return ".";
1884
+ case "matrix":
1885
+ return ";";
1886
+ case "simple":
1887
+ return ",";
1888
+ default:
1889
+ return "&";
1890
+ }
1891
+ };
1892
+ var separatorArrayNoExplode = (style) => {
1893
+ switch (style) {
1894
+ case "form":
1895
+ return ",";
1896
+ case "pipeDelimited":
1897
+ return "|";
1898
+ case "spaceDelimited":
1899
+ return "%20";
1900
+ default:
1901
+ return ",";
1902
+ }
1903
+ };
1904
+ var separatorObjectExplode = (style) => {
1905
+ switch (style) {
1906
+ case "label":
1907
+ return ".";
1908
+ case "matrix":
1909
+ return ";";
1910
+ case "simple":
1911
+ return ",";
1912
+ default:
1913
+ return "&";
1914
+ }
1915
+ };
1916
+ var serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
1917
+ if (!explode) {
1918
+ const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
1919
+ switch (style) {
1920
+ case "label":
1921
+ return `.${joinedValues2}`;
1922
+ case "matrix":
1923
+ return `;${name}=${joinedValues2}`;
1924
+ case "simple":
1925
+ return joinedValues2;
1926
+ default:
1927
+ return `${name}=${joinedValues2}`;
1928
+ }
1929
+ }
1930
+ const separator = separatorArrayExplode(style);
1931
+ const joinedValues = value.map((v) => {
1932
+ if (style === "label" || style === "simple") {
1933
+ return allowReserved ? v : encodeURIComponent(v);
1934
+ }
1935
+ return serializePrimitiveParam({
1936
+ allowReserved,
1937
+ name,
1938
+ value: v
1939
+ });
1940
+ }).join(separator);
1941
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
1942
+ };
1943
+ var serializePrimitiveParam = ({ allowReserved, name, value }) => {
1944
+ if (value === void 0 || value === null) {
1945
+ return "";
1946
+ }
1947
+ if (typeof value === "object") {
1948
+ throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
1949
+ }
1950
+ return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
1951
+ };
1952
+ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly }) => {
1953
+ if (value instanceof Date) {
1954
+ return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
1955
+ }
1956
+ if (style !== "deepObject" && !explode) {
1957
+ let values = [];
1958
+ Object.entries(value).forEach(([key, v]) => {
1959
+ values = [
1960
+ ...values,
1961
+ key,
1962
+ allowReserved ? v : encodeURIComponent(v)
1963
+ ];
1964
+ });
1965
+ const joinedValues2 = values.join(",");
1966
+ switch (style) {
1967
+ case "form":
1968
+ return `${name}=${joinedValues2}`;
1969
+ case "label":
1970
+ return `.${joinedValues2}`;
1971
+ case "matrix":
1972
+ return `;${name}=${joinedValues2}`;
1973
+ default:
1974
+ return joinedValues2;
1975
+ }
1976
+ }
1977
+ const separator = separatorObjectExplode(style);
1978
+ const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
1979
+ allowReserved,
1980
+ name: style === "deepObject" ? `${name}[${key}]` : key,
1981
+ value: v
1982
+ })).join(separator);
1983
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
1984
+ };
1985
+
1986
+ // packages/experience-design-system-client/dist/src/generated/client/utils.gen.js
1987
+ var PATH_PARAM_RE = /\{[^{}]+\}/g;
1988
+ var defaultPathSerializer = ({ path: path5, url: _url }) => {
1989
+ let url = _url;
1990
+ const matches = _url.match(PATH_PARAM_RE);
1991
+ if (matches) {
1992
+ for (const match of matches) {
1993
+ let explode = false;
1994
+ let name = match.substring(1, match.length - 1);
1995
+ let style = "simple";
1996
+ if (name.endsWith("*")) {
1997
+ explode = true;
1998
+ name = name.substring(0, name.length - 1);
1999
+ }
2000
+ if (name.startsWith(".")) {
2001
+ name = name.substring(1);
2002
+ style = "label";
2003
+ } else if (name.startsWith(";")) {
2004
+ name = name.substring(1);
2005
+ style = "matrix";
2006
+ }
2007
+ const value = path5[name];
2008
+ if (value === void 0 || value === null) {
2009
+ continue;
2010
+ }
2011
+ if (Array.isArray(value)) {
2012
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
2013
+ continue;
2014
+ }
2015
+ if (typeof value === "object") {
2016
+ url = url.replace(match, serializeObjectParam({
2017
+ explode,
2018
+ name,
2019
+ style,
2020
+ value,
2021
+ valueOnly: true
2022
+ }));
2023
+ continue;
2024
+ }
2025
+ if (style === "matrix") {
2026
+ url = url.replace(match, `;${serializePrimitiveParam({
2027
+ name,
2028
+ value
2029
+ })}`);
2030
+ continue;
2031
+ }
2032
+ const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
2033
+ url = url.replace(match, replaceValue);
2034
+ }
2035
+ }
2036
+ return url;
2037
+ };
2038
+ var createQuerySerializer = ({ allowReserved, array: array2, object } = {}) => {
2039
+ const querySerializer = (queryParams) => {
2040
+ const search = [];
2041
+ if (queryParams && typeof queryParams === "object") {
2042
+ for (const name in queryParams) {
2043
+ const value = queryParams[name];
2044
+ if (value === void 0 || value === null) {
2045
+ continue;
2046
+ }
2047
+ if (Array.isArray(value)) {
2048
+ const serializedArray = serializeArrayParam({
2049
+ allowReserved,
2050
+ explode: true,
2051
+ name,
2052
+ style: "form",
2053
+ value,
2054
+ ...array2
2055
+ });
2056
+ if (serializedArray)
2057
+ search.push(serializedArray);
2058
+ } else if (typeof value === "object") {
2059
+ const serializedObject = serializeObjectParam({
2060
+ allowReserved,
2061
+ explode: true,
2062
+ name,
2063
+ style: "deepObject",
2064
+ value,
2065
+ ...object
2066
+ });
2067
+ if (serializedObject)
2068
+ search.push(serializedObject);
2069
+ } else {
2070
+ const serializedPrimitive = serializePrimitiveParam({
2071
+ allowReserved,
2072
+ name,
2073
+ value
2074
+ });
2075
+ if (serializedPrimitive)
2076
+ search.push(serializedPrimitive);
2077
+ }
2078
+ }
2079
+ }
2080
+ return search.join("&");
2081
+ };
2082
+ return querySerializer;
2083
+ };
2084
+ var getParseAs = (contentType) => {
2085
+ if (!contentType) {
2086
+ return "stream";
2087
+ }
2088
+ const cleanContent = contentType.split(";")[0]?.trim();
2089
+ if (!cleanContent) {
2090
+ return;
2091
+ }
2092
+ if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
2093
+ return "json";
2094
+ }
2095
+ if (cleanContent === "multipart/form-data") {
2096
+ return "formData";
2097
+ }
2098
+ if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
2099
+ return "blob";
2100
+ }
2101
+ if (cleanContent.startsWith("text/")) {
2102
+ return "text";
2103
+ }
2104
+ return;
2105
+ };
2106
+ var checkForExistence = (options, name) => {
2107
+ if (!name) {
2108
+ return false;
2109
+ }
2110
+ if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
2111
+ return true;
2112
+ }
2113
+ return false;
2114
+ };
2115
+ var setAuthParams = async ({ security, ...options }) => {
2116
+ for (const auth of security) {
2117
+ if (checkForExistence(options, auth.name)) {
2118
+ continue;
2119
+ }
2120
+ const token = await getAuthToken(auth, options.auth);
2121
+ if (!token) {
2122
+ continue;
2123
+ }
2124
+ const name = auth.name ?? "Authorization";
2125
+ switch (auth.in) {
2126
+ case "query":
2127
+ if (!options.query) {
2128
+ options.query = {};
2129
+ }
2130
+ options.query[name] = token;
2131
+ break;
2132
+ case "cookie":
2133
+ options.headers.append("Cookie", `${name}=${token}`);
2134
+ break;
2135
+ case "header":
2136
+ default:
2137
+ options.headers.set(name, token);
2138
+ break;
2139
+ }
2140
+ }
2141
+ };
2142
+ var buildUrl = (options) => {
2143
+ const url = getUrl({
2144
+ baseUrl: options.baseUrl,
2145
+ path: options.path,
2146
+ query: options.query,
2147
+ querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
2148
+ url: options.url
2149
+ });
2150
+ return url;
2151
+ };
2152
+ var getUrl = ({ baseUrl, path: path5, query, querySerializer, url: _url }) => {
2153
+ const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
2154
+ let url = (baseUrl ?? "") + pathUrl;
2155
+ if (path5) {
2156
+ url = defaultPathSerializer({ path: path5, url });
2157
+ }
2158
+ let search = query ? querySerializer(query) : "";
2159
+ if (search.startsWith("?")) {
2160
+ search = search.substring(1);
2161
+ }
2162
+ if (search) {
2163
+ url += `?${search}`;
2164
+ }
2165
+ return url;
2166
+ };
2167
+ var mergeConfigs = (a, b) => {
2168
+ const config = { ...a, ...b };
2169
+ if (config.baseUrl?.endsWith("/")) {
2170
+ config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
2171
+ }
2172
+ config.headers = mergeHeaders(a.headers, b.headers);
2173
+ return config;
2174
+ };
2175
+ var mergeHeaders = (...headers2) => {
2176
+ const mergedHeaders = new Headers();
2177
+ for (const header of headers2) {
2178
+ if (!header || typeof header !== "object") {
2179
+ continue;
2180
+ }
2181
+ const iterator = header instanceof Headers ? header.entries() : Object.entries(header);
2182
+ for (const [key, value] of iterator) {
2183
+ if (value === null) {
2184
+ mergedHeaders.delete(key);
2185
+ } else if (Array.isArray(value)) {
2186
+ for (const v of value) {
2187
+ mergedHeaders.append(key, v);
2188
+ }
2189
+ } else if (value !== void 0) {
2190
+ mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : value);
2191
+ }
2192
+ }
2193
+ }
2194
+ return mergedHeaders;
2195
+ };
2196
+ var Interceptors = class {
2197
+ _fns;
2198
+ constructor() {
2199
+ this._fns = [];
2200
+ }
2201
+ clear() {
2202
+ this._fns = [];
2203
+ }
2204
+ getInterceptorIndex(id) {
2205
+ if (typeof id === "number") {
2206
+ return this._fns[id] ? id : -1;
2207
+ } else {
2208
+ return this._fns.indexOf(id);
2209
+ }
2210
+ }
2211
+ exists(id) {
2212
+ const index = this.getInterceptorIndex(id);
2213
+ return !!this._fns[index];
2214
+ }
2215
+ eject(id) {
2216
+ const index = this.getInterceptorIndex(id);
2217
+ if (this._fns[index]) {
2218
+ this._fns[index] = null;
2219
+ }
2220
+ }
2221
+ update(id, fn) {
2222
+ const index = this.getInterceptorIndex(id);
2223
+ if (this._fns[index]) {
2224
+ this._fns[index] = fn;
2225
+ return id;
2226
+ } else {
2227
+ return false;
2228
+ }
2229
+ }
2230
+ use(fn) {
2231
+ this._fns = [...this._fns, fn];
2232
+ return this._fns.length - 1;
2233
+ }
2234
+ };
2235
+ var createInterceptors = () => ({
2236
+ error: new Interceptors(),
2237
+ request: new Interceptors(),
2238
+ response: new Interceptors()
2239
+ });
2240
+ var defaultQuerySerializer = createQuerySerializer({
2241
+ allowReserved: false,
2242
+ array: {
2243
+ explode: true,
2244
+ style: "form"
2245
+ },
2246
+ object: {
2247
+ explode: true,
2248
+ style: "deepObject"
2249
+ }
2250
+ });
2251
+ var defaultHeaders = {
2252
+ "Content-Type": "application/json"
2253
+ };
2254
+ var createConfig = (override = {}) => ({
2255
+ ...jsonBodySerializer,
2256
+ headers: defaultHeaders,
2257
+ parseAs: "auto",
2258
+ querySerializer: defaultQuerySerializer,
2259
+ ...override
2260
+ });
2261
+
2262
+ // packages/experience-design-system-client/dist/src/generated/client/client.gen.js
2263
+ var createClient = (config = {}) => {
2264
+ let _config = mergeConfigs(createConfig(), config);
2265
+ const getConfig = () => ({ ..._config });
2266
+ const setConfig = (config2) => {
2267
+ _config = mergeConfigs(_config, config2);
2268
+ return getConfig();
2269
+ };
2270
+ const interceptors = createInterceptors();
2271
+ const request = async (options) => {
2272
+ const opts = {
2273
+ ..._config,
2274
+ ...options,
2275
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
2276
+ headers: mergeHeaders(_config.headers, options.headers),
2277
+ serializedBody: void 0
2278
+ };
2279
+ if (opts.security) {
2280
+ await setAuthParams({
2281
+ ...opts,
2282
+ security: opts.security
2283
+ });
2284
+ }
2285
+ if (opts.requestValidator) {
2286
+ await opts.requestValidator(opts);
2287
+ }
2288
+ if (opts.body && opts.bodySerializer) {
2289
+ opts.serializedBody = opts.bodySerializer(opts.body);
2290
+ }
2291
+ if (opts.serializedBody === void 0 || opts.serializedBody === "") {
2292
+ opts.headers.delete("Content-Type");
2293
+ }
2294
+ const url = buildUrl(opts);
2295
+ const requestInit = {
2296
+ redirect: "follow",
2297
+ ...opts,
2298
+ body: opts.serializedBody
2299
+ };
2300
+ let request2 = new Request(url, requestInit);
2301
+ for (const fn of interceptors.request._fns) {
2302
+ if (fn) {
2303
+ request2 = await fn(request2, opts);
2304
+ }
2305
+ }
2306
+ const _fetch = opts.fetch;
2307
+ let response = await _fetch(request2);
2308
+ for (const fn of interceptors.response._fns) {
2309
+ if (fn) {
2310
+ response = await fn(response, request2, opts);
2311
+ }
2312
+ }
2313
+ const result = {
2314
+ request: request2,
2315
+ response
2316
+ };
2317
+ if (response.ok) {
2318
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
2319
+ return opts.responseStyle === "data" ? {} : {
2320
+ data: {},
2321
+ ...result
2322
+ };
2323
+ }
2324
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
2325
+ let data;
2326
+ switch (parseAs) {
2327
+ case "arrayBuffer":
2328
+ case "blob":
2329
+ case "formData":
2330
+ case "json":
2331
+ case "text":
2332
+ data = await response[parseAs]();
2333
+ break;
2334
+ case "stream":
2335
+ return opts.responseStyle === "data" ? response.body : {
2336
+ data: response.body,
2337
+ ...result
2338
+ };
2339
+ }
2340
+ if (parseAs === "json") {
2341
+ if (opts.responseValidator) {
2342
+ await opts.responseValidator(data);
2343
+ }
2344
+ if (opts.responseTransformer) {
2345
+ data = await opts.responseTransformer(data);
2346
+ }
2347
+ }
2348
+ return opts.responseStyle === "data" ? data : {
2349
+ data,
2350
+ ...result
2351
+ };
2352
+ }
2353
+ const textError = await response.text();
2354
+ let jsonError;
2355
+ try {
2356
+ jsonError = JSON.parse(textError);
2357
+ } catch {
2358
+ }
2359
+ const error = jsonError ?? textError;
2360
+ let finalError = error;
2361
+ for (const fn of interceptors.error._fns) {
2362
+ if (fn) {
2363
+ finalError = await fn(error, response, request2, opts);
2364
+ }
2365
+ }
2366
+ finalError = finalError || {};
2367
+ if (opts.throwOnError) {
2368
+ throw finalError;
2369
+ }
2370
+ return opts.responseStyle === "data" ? void 0 : {
2371
+ error: finalError,
2372
+ ...result
2373
+ };
2374
+ };
2375
+ return {
2376
+ buildUrl,
2377
+ connect: (options) => request({ ...options, method: "CONNECT" }),
2378
+ delete: (options) => request({ ...options, method: "DELETE" }),
2379
+ get: (options) => request({ ...options, method: "GET" }),
2380
+ getConfig,
2381
+ head: (options) => request({ ...options, method: "HEAD" }),
2382
+ interceptors,
2383
+ options: (options) => request({ ...options, method: "OPTIONS" }),
2384
+ patch: (options) => request({ ...options, method: "PATCH" }),
2385
+ post: (options) => request({ ...options, method: "POST" }),
2386
+ put: (options) => request({ ...options, method: "PUT" }),
2387
+ request,
2388
+ setConfig,
2389
+ trace: (options) => request({ ...options, method: "TRACE" })
2390
+ };
2391
+ };
2392
+
2393
+ // packages/experience-design-system-client/dist/src/generated/client.gen.js
2394
+ var client = createClient(createConfig());
2395
+
2396
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/controller/validation/assert-no-unresolved-slot-references.js
2397
+ init_shared();
2398
+
2399
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/tokens/read-tokens-from-path.js
2400
+ init_shared();
2401
+
2402
+ // packages/experience-design-system-backend-pipeline/dist/src/index.js
2403
+ init_agents();
2404
+
2405
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/controller/client/build-contentful-management-client.js
2406
+ import { createClient as createClient2 } from "contentful-management";
2407
+
2408
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/helpers/existing-entities/fetch-from-contentful.js
2409
+ import { fetchAll } from "contentful-management";
2410
+
2411
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/controller/endpoint/resolve-shared-inputs.js
2412
+ init_validate();
2413
+
2414
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/controller/map-tokens/run-map-tokens.js
2415
+ init_build_prompt();
2416
+ init_create_local_cli_agent_invoker();
2417
+ init_describe_agent_failure();
2418
+ init_resolve_binary();
2419
+ init_resolve_skill_path();
2420
+ init_parse_map_token_prop_tool_calls();
2421
+ init_cache_keys();
2422
+
2423
+ // packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/binary-exists.js
2424
+ import { execFile } from "node:child_process";
2425
+ import { promisify } from "node:util";
2426
+ var execFileAsync = promisify(execFile);
2427
+
2428
+ // packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/controller/map-tokens/run-map-tokens.js
2429
+ var DEFAULT_TIMEOUT_MS2 = 5 * 60 * 1e3;
2430
+
2431
+ // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/helpers/fold-svelte-and-md-into-other.ts
2432
+ function foldSvelteAndMdIntoOther(counts) {
2433
+ return {
2434
+ tsx: counts.tsx,
2435
+ ts: counts.ts,
2436
+ vue: counts.vue,
2437
+ astro: counts.astro,
2438
+ jsx: counts.jsx,
2439
+ js: counts.js,
2440
+ json: counts.json,
2441
+ other: counts.other + counts.svelte + counts.md,
2442
+ total: counts.total
2443
+ };
612
2444
  }
2445
+
2446
+ // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/loader.ts
613
2447
  async function scanProject(directory) {
614
- try {
615
- const stats = await stat(directory);
616
- if (stats.isFile()) return { ok: false, failure: "is-file" };
617
- if (!stats.isDirectory()) return { ok: false, failure: "not-directory" };
618
- } catch (error) {
619
- return { ok: false, failure: failureFromErrorCode(error.code) };
2448
+ const outcome = collectFiles(directory);
2449
+ return toScanResult(outcome);
2450
+ }
2451
+ function toScanResult(outcome) {
2452
+ if (!outcome.ok) {
2453
+ return { ok: false, failure: outcome.failure };
620
2454
  }
621
- return { ok: true, counts: await countFiles(directory) };
2455
+ return {
2456
+ ok: true,
2457
+ counts: foldSvelteAndMdIntoOther(outcome.result.counts),
2458
+ filePaths: outcome.result.filePaths,
2459
+ warnings: outcome.result.warnings
2460
+ };
622
2461
  }
623
2462
 
624
2463
  // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
@@ -631,8 +2470,8 @@ function Row({ row }) {
631
2470
  row.label
632
2471
  ] });
633
2472
  }
634
- function Failure({ scan, path }) {
635
- const { headline, hints } = describeFailure(scan.failure, path);
2473
+ function Failure({ scan, path: path5 }) {
2474
+ const { headline, hints } = describeFailure(scan.failure, path5);
636
2475
  return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
637
2476
  /* @__PURE__ */ jsxs5(Text6, { color: PALETTE.error, children: [
638
2477
  "\u2717 ",
@@ -641,12 +2480,12 @@ function Failure({ scan, path }) {
641
2480
  hints.map((hint) => /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: hint }, hint))
642
2481
  ] });
643
2482
  }
644
- function Summary({ scan, path }) {
2483
+ function Summary({ scan, path: path5 }) {
645
2484
  const { total, rows, warning } = summarize(scan.counts);
646
2485
  return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", gap: 1, children: [
647
2486
  /* @__PURE__ */ jsxs5(Text6, { children: [
648
2487
  "Scanned ",
649
- /* @__PURE__ */ jsx6(Text6, { bold: true, children: path })
2488
+ /* @__PURE__ */ jsx6(Text6, { bold: true, children: path5 })
650
2489
  ] }),
651
2490
  /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
652
2491
  /* @__PURE__ */ jsxs5(Text6, { color: PALETTE.success, children: [
@@ -682,7 +2521,13 @@ function PathValidationScreen({
682
2521
  };
683
2522
  }, [resolvedPath]);
684
2523
  const phase = phaseOf(scan);
685
- usePathValidationControls(phase, { onConfirm: () => onConfirm(resolvedPath), onChangePath, onBack });
2524
+ usePathValidationControls(phase, {
2525
+ onConfirm: () => {
2526
+ if (scan?.ok) onConfirm({ projectPath: resolvedPath, filePaths: scan.filePaths });
2527
+ },
2528
+ onChangePath,
2529
+ onBack
2530
+ });
686
2531
  return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
687
2532
  scan === void 0 && /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
688
2533
  "Scanning ",
@@ -720,11 +2565,11 @@ function keyAction2(input, key) {
720
2565
  function nextField(field) {
721
2566
  return FIELDS[(FIELDS.indexOf(field) + 1) % FIELDS.length];
722
2567
  }
723
- function toConfiguredHost(host) {
2568
+ function toConfiguredHost3(host) {
724
2569
  const value = (host ?? "").trim().replace(/\/+$/, "");
725
2570
  return value === "" ? DEFAULT_HOST : value.replace(/^https:\/\//i, "");
726
2571
  }
727
- function toApiHost(host) {
2572
+ function toApiHost3(host) {
728
2573
  const value = host.trim().replace(/\/+$/, "");
729
2574
  if (value === "") return `https://${DEFAULT_HOST}`;
730
2575
  return /^[a-z][a-z\d+\-.]*:\/\//i.test(value) ? value : `https://${value}`;
@@ -734,7 +2579,7 @@ function normalize(values) {
734
2579
  spaceId: values.spaceId.trim(),
735
2580
  environmentId: values.environmentId.trim(),
736
2581
  cmaToken: values.cmaToken.trim(),
737
- host: toConfiguredHost(values.host)
2582
+ host: toConfiguredHost3(values.host)
738
2583
  };
739
2584
  }
740
2585
  function missingField(values) {
@@ -762,9 +2607,9 @@ function useCredentialsControls(handlers) {
762
2607
  }
763
2608
 
764
2609
  // packages/experience-design-system-cli/src/tui/import/steps/04-credentials/validate.ts
765
- var USER_AGENT = "app contentful.experience-design-system-cli";
2610
+ var USER_AGENT2 = "app contentful.experience-design-system-cli";
766
2611
  function headers(token) {
767
- return { Authorization: `Bearer ${token}`, "X-Contentful-User-Agent": USER_AGENT };
2612
+ return { Authorization: `Bearer ${token}`, "X-Contentful-User-Agent": USER_AGENT2 };
768
2613
  }
769
2614
  function isApsDenial(body) {
770
2615
  try {
@@ -783,7 +2628,7 @@ function messageFrom(body) {
783
2628
  }
784
2629
  }
785
2630
  async function validateCredentials(values) {
786
- const base = toApiHost(values.host);
2631
+ const base = toApiHost3(values.host);
787
2632
  let me;
788
2633
  try {
789
2634
  me = await fetch(`${base}/users/me`, { headers: headers(values.cmaToken) });
@@ -829,7 +2674,7 @@ function CredentialsScreen({
829
2674
  onDone,
830
2675
  onBack,
831
2676
  initial = {},
832
- validate = validateCredentials
2677
+ validate: validate2 = validateCredentials
833
2678
  }) {
834
2679
  const initialValues = useRef(
835
2680
  normalize({
@@ -865,7 +2710,7 @@ function CredentialsScreen({
865
2710
  return;
866
2711
  }
867
2712
  setValidating(true);
868
- const result = await validate(credentials);
2713
+ const result = await validate2(credentials);
869
2714
  setValidating(false);
870
2715
  if (result.ok) onDone({ skipped: false, credentials });
871
2716
  else setError(result.error);
@@ -918,13 +2763,13 @@ import { spawn } from "node:child_process";
918
2763
 
919
2764
  // packages/experience-design-system-cli/src/legacy/legacy-cli-path.ts
920
2765
  import { existsSync as existsSync2 } from "node:fs";
921
- import { join as join4 } from "node:path";
2766
+ import { join as join3 } from "node:path";
922
2767
  var PACKAGE_NAME2 = "@contentful/experience-design-system-cli";
923
2768
  function findLegacyCliPath() {
924
2769
  const root = findPackageRoot(import.meta.url, PACKAGE_NAME2);
925
2770
  const candidates = [
926
- join4(root, "legacy", "bin", "cli.js"),
927
- join4(root, "..", "experience-design-system-cli-legacy", "bin", "cli.js")
2771
+ join3(root, "legacy", "bin", "cli.js"),
2772
+ join3(root, "..", "experience-design-system-cli-legacy", "bin", "cli.js")
928
2773
  ];
929
2774
  const found = candidates.find((candidate) => existsSync2(candidate));
930
2775
  if (!found) {
@@ -935,10 +2780,10 @@ ${candidates.join("\n")}`);
935
2780
  }
936
2781
 
937
2782
  // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
938
- function buildArgs(options) {
2783
+ function buildArgs2(options) {
939
2784
  const args = ["import"];
940
- if (options.project) {
941
- args.push("--project", options.project);
2785
+ if (options.projectPath) {
2786
+ args.push("--project", options.projectPath);
942
2787
  }
943
2788
  if (options.tokens) {
944
2789
  args.push("--tokens", options.tokens);
@@ -947,7 +2792,7 @@ function buildArgs(options) {
947
2792
  }
948
2793
  async function spawnV1Import(options = {}) {
949
2794
  const cliPath = findLegacyCliPath();
950
- const args = buildArgs(options);
2795
+ const args = buildArgs2(options);
951
2796
  return new Promise((resolvePromise) => {
952
2797
  const child = spawn("node", [cliPath, ...args], {
953
2798
  stdio: "inherit",
@@ -986,36 +2831,36 @@ import { Box as Box7, Text as Text8, useInput as useInput7 } from "ink";
986
2831
 
987
2832
  // packages/experience-design-system-cli/src/tui/debug-store.ts
988
2833
  import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
989
- import { existsSync as existsSync3, readdirSync } from "node:fs";
990
- import { join as join6 } from "node:path";
2834
+ import { existsSync as existsSync3, readdirSync as readdirSync2 } from "node:fs";
2835
+ import { join as join5 } from "node:path";
991
2836
 
992
2837
  // packages/experience-design-system-types/dist/src/config/index.js
993
2838
  import { randomBytes } from "node:crypto";
994
2839
  import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
995
2840
  import { homedir as homedir2 } from "node:os";
996
- import { dirname as dirname2, join as join5 } from "node:path";
997
- function configRoot() {
998
- return process.env["EDS_HOME"] || join5(homedir2(), ".contentful", "experience-design-system-cli");
2841
+ import { dirname as dirname2, join as join4 } from "node:path";
2842
+ function configRoot2() {
2843
+ return process.env["EDS_HOME"] || join4(homedir2(), ".contentful", "experience-design-system-cli");
999
2844
  }
1000
- var configFilePath = () => join5(configRoot(), "config.json");
1001
- var debugSessionsDir = () => join5(configRoot(), "debug", "sessions");
1002
- async function readSettings() {
2845
+ var configFilePath2 = () => join4(configRoot2(), "config.json");
2846
+ var debugSessionsDir2 = () => join4(configRoot2(), "debug", "sessions");
2847
+ async function readSettings2() {
1003
2848
  try {
1004
- return JSON.parse(await readFile(configFilePath(), "utf8"));
2849
+ return JSON.parse(await readFile(configFilePath2(), "utf8"));
1005
2850
  } catch {
1006
2851
  return {};
1007
2852
  }
1008
2853
  }
1009
- async function writeSettings(settings) {
1010
- const path = configFilePath();
1011
- await mkdir(dirname2(path), { recursive: true });
1012
- const tmp = `${path}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;
2854
+ async function writeSettings2(settings) {
2855
+ const path5 = configFilePath2();
2856
+ await mkdir(dirname2(path5), { recursive: true });
2857
+ const tmp = `${path5}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;
1013
2858
  await writeFile(tmp, `${JSON.stringify(settings, null, 2)}
1014
2859
  `, { mode: 384 });
1015
- await rename(tmp, path);
2860
+ await rename(tmp, path5);
1016
2861
  }
1017
- async function updateSettings(patch) {
1018
- await writeSettings({ ...await readSettings(), ...patch });
2862
+ async function updateSettings2(patch) {
2863
+ await writeSettings2({ ...await readSettings2(), ...patch });
1019
2864
  }
1020
2865
 
1021
2866
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/debug-mode-store.ts
@@ -1023,11 +2868,11 @@ var DEFAULT_DEBUG_MODE_SETTING = {
1023
2868
  enabled: true
1024
2869
  };
1025
2870
  async function readDebugModeSetting() {
1026
- const { debugMode } = await readSettings();
2871
+ const { debugMode } = await readSettings2();
1027
2872
  return { ...DEFAULT_DEBUG_MODE_SETTING, ...debugMode };
1028
2873
  }
1029
2874
  async function writeDebugModeSetting(setting) {
1030
- await updateSettings({ debugMode: setting });
2875
+ await updateSettings2({ debugMode: setting });
1031
2876
  }
1032
2877
 
1033
2878
  // packages/experience-design-system-cli/src/tui/debug-store.ts
@@ -1044,10 +2889,10 @@ function datePrefix(now = /* @__PURE__ */ new Date()) {
1044
2889
  function slugify(value) {
1045
2890
  return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
1046
2891
  }
1047
- function generateSessionId() {
2892
+ function generateSessionId3() {
1048
2893
  const today = datePrefix();
1049
- const root = debugSessionsDir();
1050
- const existing = existsSync3(root) ? readdirSync(root) : [];
2894
+ const root = debugSessionsDir2();
2895
+ const existing = existsSync3(root) ? readdirSync2(root) : [];
1051
2896
  const seqPattern = new RegExp(`^${today}-session-(\\d+)$`);
1052
2897
  const maxSeq = existing.reduce((max, entry) => {
1053
2898
  const match = seqPattern.exec(entry);
@@ -1055,9 +2900,9 @@ function generateSessionId() {
1055
2900
  }, 0);
1056
2901
  return `${today}-session-${maxSeq + 1}`;
1057
2902
  }
1058
- var SESSION_ID = generateSessionId();
2903
+ var SESSION_ID = generateSessionId3();
1059
2904
  function sessionDebugDir() {
1060
- return join6(debugSessionsDir(), SESSION_ID);
2905
+ return join5(debugSessionsDir2(), SESSION_ID);
1061
2906
  }
1062
2907
  function currentDebugSessionDir() {
1063
2908
  return sessionDebugDir();
@@ -1106,15 +2951,15 @@ async function finishDebugRun({
1106
2951
  const durationMs = Date.now() - run.startedAt;
1107
2952
  const content = renderMarkdown(run, { outputs: redact(outputs), status, exitMethod, durationMs });
1108
2953
  const flowSegments = run.flow.split("/");
1109
- const dir = join6(sessionDebugDir(), ...flowSegments);
2954
+ const dir = join5(sessionDebugDir(), ...flowSegments);
1110
2955
  await mkdir2(dir, { recursive: true });
1111
2956
  const filename = nextAttemptFilename(dir, run.menuOption);
1112
- await writeFile2(join6(dir, filename), content, { mode: 384 });
2957
+ await writeFile2(join5(dir, filename), content, { mode: 384 });
1113
2958
  }
1114
2959
  function nextAttemptFilename(dir, menuOption) {
1115
2960
  const today = datePrefix();
1116
2961
  const optionSlug = slugify(menuOption);
1117
- const existing = existsSync3(dir) ? readdirSync(dir) : [];
2962
+ const existing = existsSync3(dir) ? readdirSync2(dir) : [];
1118
2963
  const attemptPattern = new RegExp(`^${today}-${optionSlug}-attempt-(\\d+)\\.md$`);
1119
2964
  const maxAttempt = existing.reduce((max, entry) => {
1120
2965
  const match = attemptPattern.exec(entry);
@@ -1174,9 +3019,9 @@ async function readHelpInfo() {
1174
3019
  const debugMode = await readDebugModeSetting();
1175
3020
  return {
1176
3021
  storage: [
1177
- { label: "Config folder", value: configRoot() },
1178
- { label: "Settings file", value: configFilePath() },
1179
- { label: "Debug logs", value: debugSessionsDir() }
3022
+ { label: "Config folder", value: configRoot2() },
3023
+ { label: "Settings file", value: configFilePath2() },
3024
+ { label: "Debug logs", value: debugSessionsDir2() }
1180
3025
  ],
1181
3026
  troubleshooting: [
1182
3027
  { label: "CLI version", value: readPackageVersion() },
@@ -1302,8 +3147,8 @@ import { Box as Box9, Text as Text10, useInput as useInput9 } from "ink";
1302
3147
  import TextInput4 from "ink-text-input";
1303
3148
 
1304
3149
  // packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
1305
- var readV1Store = readSettings;
1306
- var writeV1Store = writeSettings;
3150
+ var readV1Store = readSettings2;
3151
+ var writeV1Store = writeSettings2;
1307
3152
 
1308
3153
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
1309
3154
  async function readCredentials() {
@@ -1712,7 +3557,7 @@ function App({ onLaunchImport, importExitCode }) {
1712
3557
  const [showImportResult, setShowImportResult] = useState13(returnedFromImport);
1713
3558
  const [projectPath, setProjectPath] = useState13();
1714
3559
  const [tokensPath, setTokensPath] = useState13();
1715
- const [pathConfirmed, setPathConfirmed] = useState13(false);
3560
+ const [scannedFiles, setScannedFiles] = useState13();
1716
3561
  const [importDefaults, setImportDefaults] = useState13();
1717
3562
  useEffect9(() => {
1718
3563
  if (screen !== "import") {
@@ -1727,16 +3572,16 @@ function App({ onLaunchImport, importExitCode }) {
1727
3572
  })
1728
3573
  );
1729
3574
  }, [screen]);
1730
- const finishCredentials = async (result, project, tokens) => {
3575
+ const finishCredentials = async (result, projectPath2, tokens, filePaths) => {
1731
3576
  if (!result.skipped) await writeCredentials({ ...result.credentials });
1732
- onLaunchImport?.({ project, tokens, skipCredentials: result.skipped });
3577
+ onLaunchImport?.({ projectPath: projectPath2, tokens, filePaths, skipCredentials: result.skipped });
1733
3578
  };
1734
3579
  const goToStart = () => setScreen("start");
1735
3580
  const goToSettings = () => setScreen("settings");
1736
3581
  const resetImport = () => {
1737
3582
  setProjectPath(void 0);
1738
3583
  setTokensPath(void 0);
1739
- setPathConfirmed(false);
3584
+ setScannedFiles(void 0);
1740
3585
  };
1741
3586
  const finishImportResult = () => {
1742
3587
  setShowImportResult(false);
@@ -1764,12 +3609,12 @@ function App({ onLaunchImport, importExitCode }) {
1764
3609
  }
1765
3610
  );
1766
3611
  }
1767
- if (!pathConfirmed) {
3612
+ if (scannedFiles === void 0) {
1768
3613
  return /* @__PURE__ */ jsx14(
1769
3614
  PathValidationScreen,
1770
3615
  {
1771
3616
  projectPath,
1772
- onConfirm: () => setPathConfirmed(true),
3617
+ onConfirm: ({ filePaths }) => setScannedFiles(filePaths),
1773
3618
  onChangePath: resetImport,
1774
3619
  onBack: () => setTokensPath(void 0)
1775
3620
  }
@@ -1779,8 +3624,8 @@ function App({ onLaunchImport, importExitCode }) {
1779
3624
  CredentialsScreen,
1780
3625
  {
1781
3626
  initial: importDefaults.credentials,
1782
- onBack: () => setPathConfirmed(false),
1783
- onDone: (result) => void finishCredentials(result, projectPath, tokensPath)
3627
+ onBack: () => setScannedFiles(void 0),
3628
+ onDone: (result) => void finishCredentials(result, projectPath, tokensPath, scannedFiles)
1784
3629
  }
1785
3630
  );
1786
3631
  case "help":