@cimplify/cli 0.15.3 → 0.17.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.
Files changed (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -2
  3. package/dist/add-C3DPTVH3.mjs +140 -0
  4. package/dist/{add-KRIIKAS4.mjs → add-JX2GXWXU.mjs} +4 -4
  5. package/dist/ai-HUZTVJIQ.mjs +17 -0
  6. package/dist/{assets-CWB72PZG.mjs → assets-MPESJSUV.mjs} +12 -7
  7. package/dist/{auth-step-up-Z6KOTTV7.mjs → auth-step-up-VJAFGSW6.mjs} +5 -5
  8. package/dist/build-E7RRQWVF.mjs +616 -0
  9. package/dist/{cancel-ZHVVILOU.mjs → cancel-UMKR274A.mjs} +4 -4
  10. package/dist/capture-TK4NIUYM.mjs +69 -0
  11. package/dist/chunk-25ZPFHLF.mjs +51 -0
  12. package/dist/{chunk-OLZKNUMK.mjs → chunk-3LJG22FS.mjs} +6 -6
  13. package/dist/chunk-454RQ6NR.mjs +10614 -0
  14. package/dist/{chunk-O2TO2J4I.mjs → chunk-6CQMRZ2W.mjs} +2 -2
  15. package/dist/chunk-6KKLF5KG.mjs +32 -0
  16. package/dist/chunk-74QZQSCL.mjs +84 -0
  17. package/dist/chunk-BGM7CH5G.mjs +81 -0
  18. package/dist/chunk-BTNVYAC4.mjs +5557 -0
  19. package/dist/{chunk-I2UP7YTG.mjs → chunk-ECGDRU56.mjs} +1 -1
  20. package/dist/{chunk-UTD34C2H.mjs → chunk-EOOOXVHR.mjs} +2 -4
  21. package/dist/chunk-EYEMPIMP.mjs +74 -0
  22. package/dist/{chunk-3RPR33MO.mjs → chunk-FV273ECI.mjs} +11 -7
  23. package/dist/{chunk-MLE4MVYC.mjs → chunk-GGPN4QYQ.mjs} +2 -2
  24. package/dist/chunk-HQPZQIWW.mjs +1456 -0
  25. package/dist/{chunk-3QUK5BPY.mjs → chunk-I7GEHLDD.mjs} +16 -1
  26. package/dist/chunk-ITDAICBY.mjs +363 -0
  27. package/dist/chunk-JKECUAAV.mjs +2169 -0
  28. package/dist/chunk-JNCEKW2Y.mjs +41 -0
  29. package/dist/chunk-JTYVGORV.mjs +101 -0
  30. package/dist/chunk-KQNZKV6E.mjs +535 -0
  31. package/dist/chunk-LJDIQ4PF.mjs +6463 -0
  32. package/dist/{chunk-2MKZKUVH.mjs → chunk-LLRUOIMU.mjs} +1 -2
  33. package/dist/chunk-MJMRIMR7.mjs +86 -0
  34. package/dist/chunk-N2WZJX5P.mjs +1989 -0
  35. package/dist/chunk-NEB372WD.mjs +1152 -0
  36. package/dist/chunk-OPX7KPOU.mjs +68 -0
  37. package/dist/chunk-PHUBMRAS.mjs +623 -0
  38. package/dist/chunk-PQBALZUH.mjs +1941 -0
  39. package/dist/chunk-PVW5D5AW.mjs +42 -0
  40. package/dist/{chunk-LZEG3FEY.mjs → chunk-QQWYQ2HS.mjs} +7 -7
  41. package/dist/chunk-QVR6V6QP.mjs +46 -0
  42. package/dist/chunk-SGT5IJVW.mjs +28 -0
  43. package/dist/chunk-SZXO6YSX.mjs +502 -0
  44. package/dist/chunk-THATLMEX.mjs +1227 -0
  45. package/dist/chunk-TYR4Q37L.mjs +391 -0
  46. package/dist/{chunk-DMLQBAGC.mjs → chunk-V3R2NYQR.mjs} +1 -1
  47. package/dist/chunk-VHK7WBO3.mjs +189 -0
  48. package/dist/{chunk-TH4XENKH.mjs → chunk-XASDB7YS.mjs} +1 -1
  49. package/dist/{chunk-NYXA6X56.mjs → chunk-XBQ4LO2N.mjs} +31 -11
  50. package/dist/chunk-XF3MGADK.mjs +2946 -0
  51. package/dist/{chunk-5KYR6WJB.mjs → chunk-XQAHREKO.mjs} +17 -1
  52. package/dist/chunk-XZG3DTXV.mjs +696 -0
  53. package/dist/chunk-Y4YGR2NY.mjs +52 -0
  54. package/dist/{chunk-LJEKKFC7.mjs → chunk-YS2JUNSQ.mjs} +19 -11
  55. package/dist/chunk-ZG7NJLXN.mjs +104 -0
  56. package/dist/create-3TGG7B3X.mjs +10 -0
  57. package/dist/credits-MEG7V5DI.mjs +33 -0
  58. package/dist/{deploy-STWZ3OSM.mjs → deploy-CNRORHJ7.mjs} +11 -11
  59. package/dist/dev-RXSBY7U4.mjs +8 -0
  60. package/dist/dev-YLYC6B7R.mjs +401 -0
  61. package/dist/dispatcher.mjs +131 -30
  62. package/dist/{doctor-3RW3OGZJ.mjs → doctor-XRTNG2IT.mjs} +13 -21
  63. package/dist/{domains-FTNK4IKY.mjs → domains-JIHFKDWR.mjs} +6 -6
  64. package/dist/engine-runtime-fetch-QVKJVC3W.mjs +10 -0
  65. package/dist/{env-TNCYUAMT.mjs → env-LJ3DCAA5.mjs} +7 -7
  66. package/dist/env-R72AHBT2.mjs +19 -0
  67. package/dist/explain-32RSXEXC.mjs +251 -0
  68. package/dist/inspect-PYLYN45K.mjs +86 -0
  69. package/dist/{inspect-X3M7WSTL.mjs → inspect-ZOLZHNSZ.mjs} +28 -13
  70. package/dist/introspect-27MMTACH.mjs +9 -0
  71. package/dist/kernel-IC4ZC54Z.mjs +662 -0
  72. package/dist/kernel-plugin.js +6862 -0
  73. package/dist/keys-WKOQ4KQE.mjs +71 -0
  74. package/dist/lines-I6ZB2IOU.mjs +56 -0
  75. package/dist/{link-76Z6V6CJ.mjs → link-TE2FUX74.mjs} +6 -6
  76. package/dist/{lint-DDZ7HUQN.mjs → lint-735IPMC6.mjs} +2 -2
  77. package/dist/{list-2MFOQKKQ.mjs → list-CHYY2P4T.mjs} +7 -11
  78. package/dist/lock-XVR3RRZ6.mjs +57 -0
  79. package/dist/{login-RLMDEWAL.mjs → login-LW7CHZDZ.mjs} +10 -8
  80. package/dist/{logout-Z57X6HPE.mjs → logout-6U6OP5DM.mjs} +2 -2
  81. package/dist/{logs-TNDM4RFE.mjs → logs-HKH4H6PT.mjs} +5 -5
  82. package/dist/logs-SCQC5HNO.mjs +44 -0
  83. package/dist/mcp-VRHQOEGG.mjs +1077 -0
  84. package/dist/{mock-EVER34IX.mjs → mock-5H3CVPHC.mjs} +2 -2
  85. package/dist/outdated-T7QW6F3Z.mjs +58 -0
  86. package/dist/port-24R7ZNP4.mjs +2408 -0
  87. package/dist/{projects-YL4T24VV.mjs → projects-HYITVEXS.mjs} +6 -6
  88. package/dist/publish-DZRR5A5X.mjs +20 -0
  89. package/dist/remix-4HVXRIEB.mjs +125 -0
  90. package/dist/repo-FG3CMZQS.mjs +9 -0
  91. package/dist/report-M7F4ZYP7.mjs +2 -0
  92. package/dist/rollback-H7Q4XYGX.mjs +43 -0
  93. package/dist/{rollback-47VQ4HJK.mjs → rollback-OM64O67F.mjs} +6 -6
  94. package/dist/scene-QTHT3ZPL.mjs +324 -0
  95. package/dist/{status-TWPOMWNA.mjs → status-5D4RR3MM.mjs} +5 -5
  96. package/dist/status-AKI6E3JK.mjs +18 -0
  97. package/dist/test-W6MURUGZ.mjs +233 -0
  98. package/dist/testers-EI32JB5F.mjs +49 -0
  99. package/dist/{unlink-H3BO3DOQ.mjs → unlink-BND47IWW.mjs} +2 -2
  100. package/dist/{update-FLY46XI3.mjs → update-XKKFREKH.mjs} +4 -4
  101. package/dist/{whoami-CQPPARRS.mjs → whoami-WHLGCVRC.mjs} +3 -3
  102. package/dist/workshop-F2T4IDOU.mjs +1703 -0
  103. package/package.json +11 -7
  104. package/templates/storefront-auto/app/products/[slug]/page.tsx +1 -1
  105. package/templates/storefront-auto/package.json +1 -1
  106. package/templates/storefront-bakery/package.json +1 -1
  107. package/templates/storefront-fashion/app/products/[slug]/page.tsx +1 -1
  108. package/templates/storefront-fashion/package.json +1 -1
  109. package/templates/storefront-grocery/package.json +1 -1
  110. package/templates/storefront-pharmacy/app/products/[slug]/page.tsx +1 -1
  111. package/templates/storefront-pharmacy/package.json +1 -1
  112. package/templates/storefront-restaurant/package.json +1 -1
  113. package/templates/storefront-retail/app/products/[slug]/page.tsx +1 -1
  114. package/templates/storefront-retail/package.json +1 -1
  115. package/templates/storefront-services/package.json +1 -1
  116. package/dist/chunk-ARIDYKLO.mjs +0 -6463
  117. package/dist/dev-7O65HY6C.mjs +0 -8
  118. package/dist/explain-DLRUUCNS.mjs +0 -251
  119. package/dist/introspect-RC265ACF.mjs +0 -9
  120. package/dist/repo-UUT3AZ3L.mjs +0 -9
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { TERMINAL_DEPLOYMENT_STATUSES, DEPLOYMENT_STATUS } from './chunk-2MKZKUVH.mjs';
3
- import { dim, CliError, CLI_ERROR_CODE, failure, success, isJsonMode } from './chunk-3QUK5BPY.mjs';
2
+ import { TERMINAL_DEPLOYMENT_STATUSES, DEPLOYMENT_STATUS } from './chunk-LLRUOIMU.mjs';
3
+ import { dim, CliError, CLI_ERROR_CODE, failure, success, isJsonMode } from './chunk-I7GEHLDD.mjs';
4
4
 
5
5
  // src/progress.ts
6
6
  var POLL_INTERVAL_MS = 1e3;
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ import { remoteFromEnv } from './chunk-XZG3DTXV.mjs';
3
+ import { readInteractiveId, remoteCall } from './chunk-JNCEKW2Y.mjs';
4
+ import { requireInteractiveProject } from './chunk-BTNVYAC4.mjs';
5
+ import { bold, dim, info, result } from './chunk-I7GEHLDD.mjs';
6
+
7
+ // src/interactives/commands/status.ts
8
+ var RECENT_REVISIONS = 5;
9
+ async function interactiveStatus(root, remote) {
10
+ const id = await readInteractiveId(root);
11
+ return remoteCall(() => remote.status(id));
12
+ }
13
+ function renderStatus(status) {
14
+ const lines = [
15
+ `${bold(status.name)} ${dim(status.interactiveId)}`,
16
+ ` live: ${status.live ?? dim("none")}`,
17
+ ` test: ${status.test ?? dim("none")}`
18
+ ];
19
+ for (const r of status.revisions.slice(0, RECENT_REVISIONS)) {
20
+ lines.push(` ${r.revision} ${r.state} ${r.channel} ${dim(r.createdAt)} ${dim(r.packageDigest ?? r.sourceDigest)}`);
21
+ }
22
+ return lines;
23
+ }
24
+ async function run() {
25
+ const root = process.cwd();
26
+ requireInteractiveProject(root, "status");
27
+ const status = await interactiveStatus(root, await remoteFromEnv());
28
+ for (const line of renderStatus(status)) info(line);
29
+ result(status);
30
+ }
31
+
32
+ export { interactiveStatus, renderStatus, run };
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ import { collectSourcePaths, listSourcePaths, buildLocal } from './chunk-BTNVYAC4.mjs';
3
+ import { CliError, CLI_ERROR_CODE } from './chunk-I7GEHLDD.mjs';
4
+ import { existsSync, promises } from 'fs';
5
+ import path from 'path';
6
+ import { writablePath, readablePath, anthropicAuthoringModel, runAuthoringTurn } from '@cimplify/sdk/interactives/authoring';
7
+
8
+ var API_KEY_ENV = "ANTHROPIC_API_KEY";
9
+ var MODEL_ENV = "CIMPLIFY_AI_MODEL";
10
+ var MAX_HISTORY_MESSAGES = 80;
11
+ function inside(root, rel) {
12
+ const abs = path.resolve(root, ...rel.split("/"));
13
+ const base = path.resolve(root);
14
+ if (abs !== base && !abs.startsWith(base + path.sep)) throw new Error(`${rel} is outside the project`);
15
+ return abs;
16
+ }
17
+ function fileProject(root) {
18
+ return {
19
+ async list() {
20
+ const tracked = await collectSourcePaths(root);
21
+ const paths = tracked ?? (await listSourcePaths(root)).paths;
22
+ return [...paths].sort();
23
+ },
24
+ async read(rel) {
25
+ if (readablePath(rel) === null) return null;
26
+ try {
27
+ return await promises.readFile(inside(root, rel), "utf8");
28
+ } catch (err) {
29
+ if (err.code === "ENOENT" || err.code === "EISDIR") return null;
30
+ throw err;
31
+ }
32
+ },
33
+ async write(rel, content) {
34
+ if (writablePath(rel) === null) throw new Error(`${rel} is not writable`);
35
+ const target = inside(root, rel);
36
+ await promises.mkdir(path.dirname(target), { recursive: true });
37
+ await promises.writeFile(target, content);
38
+ },
39
+ async remove(rel) {
40
+ if (writablePath(rel) === null) throw new Error(`${rel} is not writable`);
41
+ const target = inside(root, rel);
42
+ if (!existsSync(target)) return false;
43
+ await promises.rm(target);
44
+ return true;
45
+ }
46
+ };
47
+ }
48
+ function authoringDiagnostics(diagnostics) {
49
+ return diagnostics.map((d) => ({ severity: d.severity, code: d.code, message: d.message, file: d.file, line: d.line }));
50
+ }
51
+ function buildCheck(build) {
52
+ return async () => authoringDiagnostics((await build()).result.diagnostics);
53
+ }
54
+ function modelFromEnv(env = process.env) {
55
+ const apiKey = env[API_KEY_ENV];
56
+ if (apiKey === void 0 || apiKey.trim().length === 0) {
57
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `asking the AI to change an Interactive needs ${API_KEY_ENV}`, {
58
+ remediation: `Export ${API_KEY_ENV}=<your Anthropic API key> in the shell that runs cimplify, then try again. Set ${MODEL_ENV} to use a different model.`
59
+ });
60
+ }
61
+ const model = env[MODEL_ENV]?.trim();
62
+ return anthropicAuthoringModel({ apiKey: apiKey.trim(), ...model ? { model } : {} });
63
+ }
64
+ function trimHistory(messages, limit = MAX_HISTORY_MESSAGES) {
65
+ if (messages.length <= limit) return [...messages];
66
+ for (let start = messages.length - limit; start < messages.length; start++) {
67
+ if (messages[start].role === "user") return messages.slice(start);
68
+ }
69
+ return [];
70
+ }
71
+ async function askAuthoring(root, request, options) {
72
+ const text = request.trim();
73
+ if (text.length === 0) throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, 'say what to change, for example: cimplify ai "add traffic to the loop"');
74
+ return runAuthoringTurn({
75
+ model: options.model,
76
+ project: fileProject(root),
77
+ check: options.check ?? buildCheck(() => buildLocal(root)),
78
+ request: text,
79
+ history: options.history,
80
+ onEvent: options.onEvent
81
+ });
82
+ }
83
+
84
+ export { askAuthoring, buildCheck, fileProject, modelFromEnv, trimHistory };
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env node
2
+ // src/interactives/allowlist.ts
3
+ var SDK_PACKAGE = "@cimplify/sdk";
4
+ var PINNED_SDK_VERSION = "0.110.2";
5
+ var PINNED_TYPESCRIPT_VERSION = "6.0.3";
6
+ var BOTH = ["native", "canvas"];
7
+ var CANVAS = ["canvas"];
8
+ var LIBRARY_ALLOWLIST = [
9
+ {
10
+ name: SDK_PACKAGE,
11
+ version: PINNED_SDK_VERSION,
12
+ entries: [
13
+ { specifier: "@cimplify/sdk/interactives", prefix: false, profiles: BOTH },
14
+ { specifier: "@cimplify/sdk/game", prefix: false, profiles: BOTH },
15
+ { specifier: "@cimplify/sdk/game/kit", prefix: false, profiles: BOTH },
16
+ { specifier: "@cimplify/sdk/game/kit/canvas", prefix: false, profiles: CANVAS },
17
+ { specifier: "@cimplify/sdk/game/kit/slots", prefix: false, profiles: BOTH },
18
+ { specifier: "@cimplify/sdk/game/kit/engine", prefix: false, profiles: BOTH },
19
+ { specifier: "@cimplify/sdk/game/kit/shootout", prefix: false, profiles: BOTH },
20
+ { specifier: "@cimplify/sdk/game/kit/runner", prefix: false, profiles: BOTH },
21
+ { specifier: "@cimplify/sdk/game/kit/five-a-side", prefix: false, profiles: BOTH },
22
+ { specifier: "@cimplify/sdk/game/kit/ludo", prefix: false, profiles: BOTH },
23
+ { specifier: "@cimplify/sdk/game/kit/word", prefix: false, profiles: BOTH },
24
+ { specifier: "@cimplify/sdk/game/kit/tycoon", prefix: false, profiles: BOTH },
25
+ { specifier: "@cimplify/sdk/game/kit/danfo", prefix: false, profiles: BOTH },
26
+ { specifier: "@cimplify/sdk/game/kit/courier", prefix: false, profiles: BOTH },
27
+ { specifier: "@cimplify/sdk/game/kit/worlds", prefix: false, profiles: BOTH },
28
+ { specifier: "@cimplify/sdk/game/kit/frontier", prefix: false, profiles: BOTH },
29
+ { specifier: "@cimplify/sdk/game/kit/genesis", prefix: false, profiles: BOTH },
30
+ { specifier: "@cimplify/sdk/game/prepared", prefix: false, profiles: CANVAS },
31
+ { specifier: "@cimplify/sdk/engines/wasm", prefix: false, profiles: CANVAS },
32
+ { specifier: "@cimplify/sdk/engines/godot", prefix: false, profiles: CANVAS }
33
+ ]
34
+ },
35
+ {
36
+ name: "three",
37
+ version: "0.186.1",
38
+ entries: [
39
+ { specifier: "three", prefix: false, profiles: CANVAS },
40
+ { specifier: "three/addons/", prefix: true, profiles: CANVAS }
41
+ ]
42
+ },
43
+ { name: "phaser", version: "4.2.1", entries: [{ specifier: "phaser", prefix: false, profiles: CANVAS }] },
44
+ {
45
+ name: "@dimforge/rapier3d-compat",
46
+ version: "0.21.0",
47
+ entries: [{ specifier: "@dimforge/rapier3d-compat", prefix: false, profiles: CANVAS }]
48
+ }
49
+ ];
50
+ function matchLibrary(specifier, profile) {
51
+ for (let i = 0; i < LIBRARY_ALLOWLIST.length; i++) {
52
+ const library = LIBRARY_ALLOWLIST[i];
53
+ for (let j = 0; j < library.entries.length; j++) {
54
+ const entry = library.entries[j];
55
+ const hit = entry.prefix ? specifier.startsWith(entry.specifier) : specifier === entry.specifier;
56
+ if (!hit) continue;
57
+ if (entry.profiles.indexOf(profile) >= 0) return { kind: "allowed", library };
58
+ return { kind: "wrong_profile", library, profiles: entry.profiles };
59
+ }
60
+ }
61
+ return { kind: "unknown" };
62
+ }
63
+ function findLibrary(name) {
64
+ for (let i = 0; i < LIBRARY_ALLOWLIST.length; i++) if (LIBRARY_ALLOWLIST[i].name === name) return LIBRARY_ALLOWLIST[i];
65
+ return null;
66
+ }
67
+ var EMPTY_WASM_REGISTRY = {
68
+ approved() {
69
+ return false;
70
+ }
71
+ };
72
+ function approvedWasm(digests) {
73
+ const set = new Set(digests);
74
+ return {
75
+ approved(digest) {
76
+ return set.has(digest);
77
+ }
78
+ };
79
+ }
80
+
81
+ export { EMPTY_WASM_REGISTRY, LIBRARY_ALLOWLIST, PINNED_SDK_VERSION, PINNED_TYPESCRIPT_VERSION, SDK_PACKAGE, approvedWasm, findLibrary, matchLibrary };