@cimplify/cli 0.15.3 → 0.16.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-SXC6RUPQ.mjs +140 -0
  4. package/dist/{add-KRIIKAS4.mjs → add-XQVQLD3F.mjs} +4 -4
  5. package/dist/ai-NQH5L4I6.mjs +17 -0
  6. package/dist/{assets-CWB72PZG.mjs → assets-FZGVOQXH.mjs} +12 -7
  7. package/dist/{auth-step-up-Z6KOTTV7.mjs → auth-step-up-67LCPDNL.mjs} +5 -5
  8. package/dist/build-J4ZUIOPX.mjs +625 -0
  9. package/dist/{cancel-ZHVVILOU.mjs → cancel-VGJHZJ4J.mjs} +4 -4
  10. package/dist/capture-RAJ2B3BH.mjs +69 -0
  11. package/dist/chunk-25ZPFHLF.mjs +51 -0
  12. package/dist/chunk-47ZXSY47.mjs +52 -0
  13. package/dist/{chunk-O2TO2J4I.mjs → chunk-54J3XR4T.mjs} +2 -2
  14. package/dist/chunk-5HP2INMY.mjs +10631 -0
  15. package/dist/chunk-7JR6JCFF.mjs +32 -0
  16. package/dist/chunk-7PQL7E7K.mjs +68 -0
  17. package/dist/chunk-AKACUJ3W.mjs +81 -0
  18. package/dist/chunk-BYNE553A.mjs +2945 -0
  19. package/dist/{chunk-NYXA6X56.mjs → chunk-CLQYPTJ2.mjs} +31 -11
  20. package/dist/chunk-CNZAOVSK.mjs +104 -0
  21. package/dist/chunk-CPBESPWK.mjs +5576 -0
  22. package/dist/{chunk-3RPR33MO.mjs → chunk-DYWUPHV3.mjs} +11 -7
  23. package/dist/chunk-EAV2P4N3.mjs +1941 -0
  24. package/dist/{chunk-UTD34C2H.mjs → chunk-EDZSOL5O.mjs} +2 -4
  25. package/dist/chunk-EGQIPYUN.mjs +696 -0
  26. package/dist/{chunk-DMLQBAGC.mjs → chunk-EOO4UOQD.mjs} +1 -1
  27. package/dist/chunk-EYEMPIMP.mjs +74 -0
  28. package/dist/chunk-G2ZEFSQJ.mjs +46 -0
  29. package/dist/{chunk-TH4XENKH.mjs → chunk-I4HNHPEM.mjs} +1 -1
  30. package/dist/chunk-JEVSFNPT.mjs +363 -0
  31. package/dist/chunk-JKECUAAV.mjs +2169 -0
  32. package/dist/chunk-KMHORI4Y.mjs +638 -0
  33. package/dist/chunk-KNPYBZ6B.mjs +502 -0
  34. package/dist/{chunk-3QUK5BPY.mjs → chunk-KOD4GBQ5.mjs} +8 -1
  35. package/dist/chunk-KQNZKV6E.mjs +535 -0
  36. package/dist/{chunk-2MKZKUVH.mjs → chunk-LLRUOIMU.mjs} +1 -2
  37. package/dist/{chunk-OLZKNUMK.mjs → chunk-LNMITJ4Z.mjs} +6 -6
  38. package/dist/chunk-MEM3MDV4.mjs +6463 -0
  39. package/dist/chunk-NY4YT7O6.mjs +84 -0
  40. package/dist/{chunk-LZEG3FEY.mjs → chunk-Q6CF4C3E.mjs} +7 -7
  41. package/dist/chunk-RP66A52P.mjs +86 -0
  42. package/dist/{chunk-I2UP7YTG.mjs → chunk-SAXGWS2K.mjs} +1 -1
  43. package/dist/chunk-SCKQ4XSD.mjs +41 -0
  44. package/dist/chunk-SF44L2OD.mjs +1152 -0
  45. package/dist/chunk-SGT5IJVW.mjs +28 -0
  46. package/dist/{chunk-LJEKKFC7.mjs → chunk-SS4JTMIV.mjs} +8 -8
  47. package/dist/chunk-T4MW3PD4.mjs +1456 -0
  48. package/dist/chunk-THATLMEX.mjs +1227 -0
  49. package/dist/{chunk-MLE4MVYC.mjs → chunk-TT4YI33G.mjs} +2 -2
  50. package/dist/chunk-TYV2SVFN.mjs +101 -0
  51. package/dist/chunk-VHK7WBO3.mjs +189 -0
  52. package/dist/chunk-VSA44UKR.mjs +391 -0
  53. package/dist/chunk-XL54SQJ3.mjs +42 -0
  54. package/dist/{chunk-5KYR6WJB.mjs → chunk-XQAHREKO.mjs} +17 -1
  55. package/dist/chunk-ZUCDXRFI.mjs +2011 -0
  56. package/dist/create-4S2EAUR3.mjs +10 -0
  57. package/dist/credits-NJOAOPPW.mjs +33 -0
  58. package/dist/{deploy-STWZ3OSM.mjs → deploy-26Y4UGZZ.mjs} +11 -11
  59. package/dist/dev-MOYURRWQ.mjs +401 -0
  60. package/dist/dev-WL43Q7VD.mjs +8 -0
  61. package/dist/dispatcher.mjs +131 -30
  62. package/dist/{doctor-3RW3OGZJ.mjs → doctor-E6ETD2GJ.mjs} +12 -20
  63. package/dist/{domains-FTNK4IKY.mjs → domains-LOTQMVOR.mjs} +6 -6
  64. package/dist/engine-runtime-fetch-CIE7S7PB.mjs +10 -0
  65. package/dist/{env-TNCYUAMT.mjs → env-3PDFC5XF.mjs} +7 -7
  66. package/dist/env-MOTYOPM5.mjs +19 -0
  67. package/dist/explain-K5QEVWCD.mjs +251 -0
  68. package/dist/{inspect-X3M7WSTL.mjs → inspect-Q3E2DHYY.mjs} +3 -3
  69. package/dist/inspect-SJ4WBAXO.mjs +86 -0
  70. package/dist/introspect-7F34YN5V.mjs +9 -0
  71. package/dist/kernel-DEGWMHFL.mjs +662 -0
  72. package/dist/kernel-plugin.js +6862 -0
  73. package/dist/keys-W5SN3DPK.mjs +71 -0
  74. package/dist/lines-XGJYTQ7P.mjs +56 -0
  75. package/dist/{link-76Z6V6CJ.mjs → link-NKUAVNM2.mjs} +6 -6
  76. package/dist/{lint-DDZ7HUQN.mjs → lint-G4YPQSSO.mjs} +2 -2
  77. package/dist/{list-2MFOQKKQ.mjs → list-TDR7K2JB.mjs} +3 -3
  78. package/dist/lock-EJPW2LM3.mjs +57 -0
  79. package/dist/{login-RLMDEWAL.mjs → login-AYLU7JU7.mjs} +10 -8
  80. package/dist/{logout-Z57X6HPE.mjs → logout-3M6VMHLH.mjs} +2 -2
  81. package/dist/{logs-TNDM4RFE.mjs → logs-4EL5SOXN.mjs} +5 -5
  82. package/dist/logs-4QQGG2XY.mjs +44 -0
  83. package/dist/mcp-4R2R6E5M.mjs +1077 -0
  84. package/dist/{mock-EVER34IX.mjs → mock-AK24GSP2.mjs} +2 -2
  85. package/dist/outdated-JEKCVLTG.mjs +58 -0
  86. package/dist/port-SBZ7X3EH.mjs +2408 -0
  87. package/dist/{projects-YL4T24VV.mjs → projects-7JKTC5WJ.mjs} +6 -6
  88. package/dist/publish-QQCX47HK.mjs +20 -0
  89. package/dist/remix-NLLYD3BI.mjs +125 -0
  90. package/dist/repo-Z4G4EW3N.mjs +9 -0
  91. package/dist/report-M7F4ZYP7.mjs +2 -0
  92. package/dist/rollback-2WQ2CW7T.mjs +43 -0
  93. package/dist/{rollback-47VQ4HJK.mjs → rollback-ZGU32HGT.mjs} +6 -6
  94. package/dist/scene-HXARHUM7.mjs +324 -0
  95. package/dist/{status-TWPOMWNA.mjs → status-C3ZSLZ7Q.mjs} +5 -5
  96. package/dist/status-WEQOC25K.mjs +18 -0
  97. package/dist/test-ZPBWV4VX.mjs +233 -0
  98. package/dist/testers-A3LMXOJJ.mjs +49 -0
  99. package/dist/{unlink-H3BO3DOQ.mjs → unlink-4G4FE4RJ.mjs} +2 -2
  100. package/dist/{update-FLY46XI3.mjs → update-GHKKM5FS.mjs} +4 -4
  101. package/dist/{whoami-CQPPARRS.mjs → whoami-3QQN6G2A.mjs} +3 -3
  102. package/dist/workshop-CD74D2LK.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
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ import { remoteFromEnv } from './chunk-EGQIPYUN.mjs';
3
+ import { readInteractiveId, remoteCall } from './chunk-SCKQ4XSD.mjs';
4
+ import { requireInteractiveProject } from './chunk-CPBESPWK.mjs';
5
+ import { bold, dim, info, result } from './chunk-KOD4GBQ5.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,68 @@
1
+ #!/usr/bin/env node
2
+ import { modelFromEnv, askAuthoring } from './chunk-NY4YT7O6.mjs';
3
+ import { requireInteractiveProject } from './chunk-CPBESPWK.mjs';
4
+ import { parseArgs } from './chunk-XQAHREKO.mjs';
5
+ import { info, dim, warn, failure, success, CliError, CLI_ERROR_CODE, step, result } from './chunk-KOD4GBQ5.mjs';
6
+ import { formatDiagnostics } from '@cimplify/sdk/interactives/authoring';
7
+
8
+ function describeEvent(event) {
9
+ switch (event.kind) {
10
+ case "tool":
11
+ if (event.name === "write_file") return `editing ${event.path}`;
12
+ if (event.name === "delete_file") return `deleting ${event.path}`;
13
+ if (event.name === "read_file") return `reading ${event.path}`;
14
+ if (event.name === "read_guide") return "reading the Interactives guide";
15
+ if (event.name === "check") return "building";
16
+ return null;
17
+ case "check":
18
+ return event.errors === 0 ? "build passed" : `build found ${event.errors} error${event.errors === 1 ? "" : "s"}, repairing`;
19
+ case "text":
20
+ return null;
21
+ }
22
+ }
23
+ function describeTurnLines(outcome) {
24
+ const delta = outcome.lineDelta;
25
+ const change = delta === 0 ? "unchanged" : `${delta > 0 ? "+" : ""}${delta} this turn`;
26
+ return `game code: ${outcome.lines.total} line${outcome.lines.total === 1 ? "" : "s"} in ${outcome.lines.files.length} file${outcome.lines.files.length === 1 ? "" : "s"} (${change})`;
27
+ }
28
+ function reportOutcome(outcome) {
29
+ for (const change of outcome.changed) info(` ${change.kind === "delete" ? "deleted" : "changed"} ${change.path}`);
30
+ if (outcome.summary.length > 0) info(outcome.summary);
31
+ info(dim(describeTurnLines(outcome)));
32
+ if (outcome.end === "refused") warn("The model declined this request.");
33
+ if (outcome.end === "steps") warn("The AI ran out of steps before finishing; ask again to continue.");
34
+ if (outcome.end === "truncated") warn("The AI's reply was cut off; ask again to continue.");
35
+ if (outcome.diagnostics.length > 0) failure(formatDiagnostics(outcome.diagnostics));
36
+ else if (outcome.changed.length > 0) success("The project builds");
37
+ }
38
+ async function run(argv) {
39
+ const args = parseArgs(argv);
40
+ const request = args.positional.join(" ").trim();
41
+ if (request.length === 0) throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, 'usage: cimplify ai "<what to change>"');
42
+ const root = process.cwd();
43
+ requireInteractiveProject(root, "ai");
44
+ const model = modelFromEnv();
45
+ step(`Asking the AI: ${request}`);
46
+ const outcome = await askAuthoring(root, request, {
47
+ model,
48
+ onEvent: (event) => {
49
+ const line = describeEvent(event);
50
+ if (line !== null) info(dim(` ${line}`));
51
+ }
52
+ });
53
+ reportOutcome(outcome);
54
+ result({
55
+ changed: outcome.changed,
56
+ summary: outcome.summary,
57
+ diagnostics: outcome.diagnostics,
58
+ repairs: outcome.repairs,
59
+ end: outcome.end,
60
+ lines: outcome.lines,
61
+ line_delta: outcome.lineDelta
62
+ });
63
+ if (outcome.diagnostics.length > 0) {
64
+ throw new CliError(CLI_ERROR_CODE.BUILD_FAILED, "the AI's changes still have build errors; ask it again or fix them by hand");
65
+ }
66
+ }
67
+
68
+ export { describeEvent, describeTurnLines, reportOutcome, run };
@@ -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.109.0";
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 };