@akanjs/cli 3.2.0-rc.19 → 3.2.0-rc.20

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 (86) hide show
  1. package/.build-stamp +2 -2
  2. package/{CodeAgent-q0xkt4at.js → CodeAgent-faqv7t4g.js} +2 -2
  3. package/{CodeTui-n56kpaca.js → CodeTui-vqck9tet.js} +1 -1
  4. package/TunnelShare-bwe3ddv7.js +18 -0
  5. package/{agent.command-k07raqft.js → agent.command-p75jvgrd.js} +21 -21
  6. package/akanCode.js +2 -2
  7. package/{appExecutor-xav1zemr.js → appExecutor-020cyesq.js} +3 -3
  8. package/{application.command-dv8y8r12.js → application.command-ta2knqxm.js} +15 -15
  9. package/{applicationBuildRunner-vhx7zq97.js → applicationBuildRunner-gkh82j2b.js} +9 -9
  10. package/buildBatch.proc.js +10 -10
  11. package/{cloud.command-0vjy3x96.js → cloud.command-v3jhfvm5.js} +22 -22
  12. package/cloud.script-be9s1432.js +35 -0
  13. package/{code.command-xc5exq4b.js → code.command-mh7dh1st.js} +10 -10
  14. package/{context.command-etsat8yk.js → context.command-1ycfjkdd.js} +23 -23
  15. package/context.runner-333jkz86.js +34 -0
  16. package/{guideline.command-zqkntk7b.js → guideline.command-w1grfwh7.js} +7 -7
  17. package/guidelines/conventions/core.md +4 -4
  18. package/guidelines/errorCodes/errorCodes.instruction.md +9 -0
  19. package/incrementalBuilder.proc.js +20 -12
  20. package/{index-gh741qft.js → index-013n6z7m.js} +8 -8
  21. package/{index-6rrh0ffr.js → index-0hj82f9w.js} +11 -11
  22. package/{index-81qt1jyj.js → index-1c0mjc2b.js} +1 -1
  23. package/{index-pkgha3rt.js → index-1jk52ffq.js} +6 -6
  24. package/{index-syn4vm3y.js → index-1pjwsh2g.js} +1 -1
  25. package/{index-g541mhzw.js → index-22g3jq43.js} +3 -3
  26. package/{index-fgp04fh7.js → index-2d9nm03s.js} +17 -8
  27. package/{index-c9hd79py.js → index-2k6mve6a.js} +4 -4
  28. package/{index-6pzncry1.js → index-52w4jb87.js} +4 -4
  29. package/{index-c1vym3gx.js → index-5h888r6j.js} +2 -2
  30. package/{index-a05ewnnp.js → index-6pxmcaq8.js} +1 -1
  31. package/{index-nxcmgqk3.js → index-6zb17wcm.js} +3 -3
  32. package/{index-dz7z9n9t.js → index-7a07tdap.js} +6 -6
  33. package/{index-7jr9mfp2.js → index-7ehdht84.js} +20 -10
  34. package/{index-s5gvwvkb.js → index-7v7tvgt7.js} +20 -3
  35. package/{index-m6r3pvf5.js → index-88s746ns.js} +2 -2
  36. package/{index-sh3yzse2.js → index-9rv2zt48.js} +5 -5
  37. package/{index-dasa0kbj.js → index-9zswcze5.js} +2 -2
  38. package/{index-ean2tff1.js → index-a41vv4cy.js} +4 -4
  39. package/{index-zk1gjk46.js → index-bket1068.js} +4 -4
  40. package/{index-q2t2w996.js → index-czf94w8c.js} +1 -1
  41. package/{index-e4vna9dn.js → index-d3178asw.js} +4 -4
  42. package/{index-cc9pevta.js → index-dss3ds74.js} +1 -1
  43. package/{index-my17308p.js → index-eyfty8kk.js} +7 -7
  44. package/{index-12js5pj4.js → index-g7jgd4xs.js} +1 -1
  45. package/{index-ddc2zjj5.js → index-gwsesvqc.js} +1 -1
  46. package/{index-c9mnfy9r.js → index-h1w4wqgd.js} +23 -15
  47. package/{index-y8mqkhcf.js → index-hp2c7xc2.js} +1 -1
  48. package/{index-rj2n5kfk.js → index-jx2jcw1r.js} +1 -1
  49. package/{index-89x8tp7z.js → index-knpm8sdm.js} +1 -1
  50. package/{index-wxr3941g.js → index-mpp4aas6.js} +27 -12
  51. package/{index-t00xrkey.js → index-na8r4a27.js} +1 -1
  52. package/{index-6bryy19d.js → index-nmxszh6x.js} +4 -4
  53. package/{index-12vv4g80.js → index-pt0agdck.js} +1 -1
  54. package/{index-bxevbjw7.js → index-q444k260.js} +4 -4
  55. package/{index-v72mh89f.js → index-qssq2d41.js} +5 -5
  56. package/{index-4zqebbqb.js → index-vjbne22r.js} +1 -1
  57. package/{index-wq8pnev4.js → index-w23tf30e.js} +3 -3
  58. package/{index-qtqhsb33.js → index-wa01phm9.js} +10 -10
  59. package/{index-t0g6jgrc.js → index-xczjdng6.js} +2 -0
  60. package/{index-k51718xz.js → index-xwe7y0gf.js} +3 -3
  61. package/{index-cet2s7xk.js → index-ze48c0vd.js} +2 -2
  62. package/{index-nd8bq17n.js → index-zttyg7tg.js} +9 -6
  63. package/index.js +27 -27
  64. package/{libExecutor-mr3vxtnr.js → libExecutor-tq994592.js} +2 -2
  65. package/{library.command-ps9q5t37.js → library.command-x219mhcx.js} +7 -7
  66. package/{localRegistry.command-rszxmvd0.js → localRegistry.command-4p17wa9t.js} +21 -21
  67. package/{module.command-fcybnn1a.js → module.command-tjthnvvr.js} +10 -10
  68. package/{package.command-zen3rhye.js → package.command-c6df2hxx.js} +10 -10
  69. package/package.json +2 -2
  70. package/{page.command-gwrxymms.js → page.command-gf06paq2.js} +7 -7
  71. package/{pipeline.command-m1brkqqw.js → pipeline.command-y07dgj9b.js} +6 -6
  72. package/{pkgExecutor-x51agavp.js → pkgExecutor-stde3yc3.js} +2 -2
  73. package/{primitive.command-5vkxvvmk.js → primitive.command-0enfygxn.js} +11 -11
  74. package/{projectTypecheck-9dzfah37.js → projectTypecheck-mk8wefvd.js} +1 -1
  75. package/{prompter-w58rvzb9.js → prompter-qyggfhqd.js} +1 -1
  76. package/{quality.command-gqry7eas.js → quality.command-dkbdztad.js} +9 -9
  77. package/{repair.command-qs4ejcrg.js → repair.command-g5vd95ax.js} +10 -10
  78. package/{scalar.command-ny0vchqq.js → scalar.command-7909pg0d.js} +9 -9
  79. package/{subspace.command-5pxqjgmw.js → subspace.command-at4jt1fb.js} +17 -17
  80. package/{tunnel.command-ndajt0xk.js → tunnel.command-91h92dwr.js} +11 -11
  81. package/{verify.command-m59ashc7.js → verify.command-pzky05ts.js} +17 -17
  82. package/{workflow.command-jchqey88.js → workflow.command-mqqe4n12.js} +15 -15
  83. package/{workspace.command-g0gzxkpd.js → workspace.command-y4rznvhx.js} +37 -37
  84. package/TunnelShare-844s9te4.js +0 -18
  85. package/cloud.script-jp48r0kw.js +0 -35
  86. package/context.runner-e52ak0cx.js +0 -34
@@ -3,21 +3,21 @@ import {
3
3
  HmrWatcher,
4
4
  WatchRootResolver,
5
5
  ApplicationBuildReporter
6
- } from "./index-s5gvwvkb.js";
6
+ } from "./index-7v7tvgt7.js";
7
7
  import {
8
8
  CodegenLock,
9
9
  WorkspaceExecutor
10
- } from "./index-v72mh89f.js";
10
+ } from "./index-qssq2d41.js";
11
11
  import"./index-by2tvsq6.js";
12
12
  import"./index-j4yvgfhr.js";
13
13
  import {
14
14
  AppExecutor2
15
- } from "./index-cet2s7xk.js";
16
- import"./index-t00xrkey.js";
17
- import"./index-cc9pevta.js";
15
+ } from "./index-ze48c0vd.js";
16
+ import"./index-na8r4a27.js";
17
+ import"./index-dss3ds74.js";
18
18
  import {
19
19
  ServerGraphFile
20
- } from "./index-rj2n5kfk.js";
20
+ } from "./index-jx2jcw1r.js";
21
21
  import {
22
22
  GraphClientEntryDiscovery,
23
23
  RouteClientBuilder,
@@ -27,21 +27,21 @@ import {
27
27
  DevChangePlanner,
28
28
  DevGeneratedIndexSync,
29
29
  SsrDevBundler
30
- } from "./index-k51718xz.js";
31
- import"./index-7jr9mfp2.js";
30
+ } from "./index-xwe7y0gf.js";
31
+ import"./index-7ehdht84.js";
32
32
  import {
33
33
  FrameworkGraph
34
- } from "./index-q2t2w996.js";
34
+ } from "./index-czf94w8c.js";
35
35
  import {
36
36
  GitRevision
37
37
  } from "./index-zyb0ebm4.js";
38
38
  import {
39
39
  WorkspaceGraph
40
- } from "./index-81qt1jyj.js";
40
+ } from "./index-1c0mjc2b.js";
41
41
  import {
42
42
  prepareDevWatchBatch
43
43
  } from "./index-a5vmm6x4.js";
44
- import"./index-4zqebbqb.js";
44
+ import"./index-vjbne22r.js";
45
45
 
46
46
  // pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts
47
47
  import path6 from "path";
@@ -52,6 +52,7 @@ import path from "path";
52
52
  import { Logger } from "akanjs/common";
53
53
 
54
54
  class BuildBatchRunner {
55
+ static #exitGraceMs = 500;
55
56
  #logger = new Logger("BuildBatchRunner");
56
57
  #entry = null;
57
58
  #workspaceRoot;
@@ -83,6 +84,7 @@ class BuildBatchRunner {
83
84
  const started = Date.now();
84
85
  const entry = await this.#resolveEntry();
85
86
  let result = null;
87
+ const resultArrived = Promise.withResolvers();
86
88
  const reported = new Map;
87
89
  const payload = request.trace ? { ...request, trace: { ...request.trace, spawnAt: Date.now() } } : request;
88
90
  const proc = Bun.spawn(["bun", entry, JSON.stringify(payload)], {
@@ -96,6 +98,12 @@ class BuildBatchRunner {
96
98
  if (message.type === "build-batch-result") {
97
99
  result = message.data;
98
100
  worker.disconnect();
101
+ const lingering = setTimeout(() => {
102
+ this.#logger.verbose(`[build-batch] worker still up ${BuildBatchRunner.#exitGraceMs}ms after its result`);
103
+ worker.kill("SIGKILL");
104
+ }, BuildBatchRunner.#exitGraceMs);
105
+ worker.exited.then(() => clearTimeout(lingering));
106
+ resultArrived.resolve(null);
99
107
  } else {
100
108
  if (message.type === "build-status")
101
109
  reported.set(message.data.phase, message.data.message);
@@ -103,7 +111,7 @@ class BuildBatchRunner {
103
111
  }
104
112
  }
105
113
  });
106
- const exitCode = await proc.exited;
114
+ const exitCode = await Promise.race([proc.exited, resultArrived.promise]);
107
115
  if (result) {
108
116
  this.#logger.verbose(`[build-batch] generation=${request.generation} needs=${request.needs.join(",")} done in ${Date.now() - started}ms`);
109
117
  return result;
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CommandContainer,
4
4
  runner
5
- } from "./index-sh3yzse2.js";
5
+ } from "./index-9rv2zt48.js";
6
6
  import {
7
7
  WorkspaceExecutor
8
- } from "./index-v72mh89f.js";
8
+ } from "./index-qssq2d41.js";
9
9
  import {
10
10
  jsonText,
11
11
  workflowPlanApproval,
@@ -31,23 +31,23 @@ import {
31
31
  renderWorkflowApply,
32
32
  renderWorkflowValidation,
33
33
  renderWorkflowRunArtifact
34
- } from "./index-ean2tff1.js";
34
+ } from "./index-a41vv4cy.js";
35
35
  import {
36
36
  AkanContextAnalyzer
37
- } from "./index-6bryy19d.js";
37
+ } from "./index-nmxszh6x.js";
38
38
  import {
39
39
  ModuleScript
40
- } from "./index-bxevbjw7.js";
40
+ } from "./index-q444k260.js";
41
41
  import {
42
42
  PrimitiveScript
43
- } from "./index-dz7z9n9t.js";
43
+ } from "./index-7a07tdap.js";
44
44
  import {
45
45
  spawnAkan,
46
46
  isWorkspaceTarget
47
- } from "./index-g541mhzw.js";
47
+ } from "./index-22g3jq43.js";
48
48
  import {
49
49
  ScalarScript
50
- } from "./index-m6r3pvf5.js";
50
+ } from "./index-88s746ns.js";
51
51
  import {
52
52
  workflowSpecs
53
53
  } from "./index-t4d0ckde.js";
@@ -1,37 +1,37 @@
1
1
  // @bun
2
2
  import {
3
3
  ApplicationBuildReporter
4
- } from "./index-s5gvwvkb.js";
4
+ } from "./index-7v7tvgt7.js";
5
5
  import {
6
6
  script,
7
7
  markCliErrorPrinted,
8
8
  assertPromptable
9
- } from "./index-sh3yzse2.js";
9
+ } from "./index-9rv2zt48.js";
10
10
  import {
11
11
  CliError
12
12
  } from "./index-j4yvgfhr.js";
13
13
  import {
14
14
  SysExecutor
15
- } from "./index-v72mh89f.js";
15
+ } from "./index-qssq2d41.js";
16
16
  import {
17
17
  AppExecutor2
18
- } from "./index-cet2s7xk.js";
18
+ } from "./index-ze48c0vd.js";
19
19
  import {
20
20
  LibExecutor2
21
- } from "./index-t00xrkey.js";
21
+ } from "./index-na8r4a27.js";
22
22
  import {
23
23
  PkgExecutor2
24
- } from "./index-cc9pevta.js";
24
+ } from "./index-dss3ds74.js";
25
25
  import {
26
26
  DesktopServerStage
27
- } from "./index-12vv4g80.js";
27
+ } from "./index-pt0agdck.js";
28
28
  import {
29
29
  LibraryScript
30
- } from "./index-nxcmgqk3.js";
30
+ } from "./index-6zb17wcm.js";
31
31
  import {
32
32
  ApplicationRunner,
33
33
  VerifyScope
34
- } from "./index-c9mnfy9r.js";
34
+ } from "./index-h1w4wqgd.js";
35
35
  import {
36
36
  PreviewChrome2,
37
37
  PreviewView2,
@@ -39,7 +39,7 @@ import {
39
39
  } from "./index-rwgqba9p.js";
40
40
  import {
41
41
  formatSlicePlan
42
- } from "./index-12js5pj4.js";
42
+ } from "./index-g7jgd4xs.js";
43
43
  import {
44
44
  assertPlainName
45
45
  } from "./index-va90m8nd.js";
@@ -1735,7 +1735,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
1735
1735
  await Promise.all(shares.map(async (share) => await share.close()));
1736
1736
  }, "Abandoning the tunnel release; the shares expire on their own.");
1737
1737
  await Promise.all(apps.map(async (app) => {
1738
- const { TunnelShare } = await import("./TunnelShare-844s9te4.js");
1738
+ const { TunnelShare } = await import("./TunnelShare-bwe3ddv7.js");
1739
1739
  const share = await TunnelShare.open(app, { workspace: app.workspace });
1740
1740
  shares.push(share);
1741
1741
  urls.set(app.name, share.url);
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AkanGraphDiff,
4
4
  AkanIndex
5
- } from "./index-7jr9mfp2.js";
5
+ } from "./index-7ehdht84.js";
6
6
  import {
7
7
  GitRevision
8
8
  } from "./index-zyb0ebm4.js";
@@ -6,23 +6,23 @@ import {
6
6
  CloudApi,
7
7
  CloudUpdates,
8
8
  PipelineSecrets
9
- } from "./index-c1vym3gx.js";
9
+ } from "./index-5h888r6j.js";
10
10
  import {
11
11
  resolveMobileTargets
12
12
  } from "./index-m9jj544v.js";
13
13
  import {
14
14
  WorkspaceExecutor
15
- } from "./index-v72mh89f.js";
15
+ } from "./index-qssq2d41.js";
16
16
  import {
17
17
  AppExecutor2
18
- } from "./index-cet2s7xk.js";
18
+ } from "./index-ze48c0vd.js";
19
19
  import {
20
20
  NativeApp
21
- } from "./index-wq8pnev4.js";
21
+ } from "./index-w23tf30e.js";
22
22
  import {
23
23
  runner,
24
24
  assertPromptable
25
- } from "./index-sh3yzse2.js";
25
+ } from "./index-9rv2zt48.js";
26
26
  import {
27
27
  getNpmRegistryUrl,
28
28
  getPublishedVersions,
@@ -30,7 +30,7 @@ import {
30
30
  } from "./index-ffa52fwf.js";
31
31
  import {
32
32
  SubspaceConfig
33
- } from "./index-t0g6jgrc.js";
33
+ } from "./index-xczjdng6.js";
34
34
  import {
35
35
  openBrowser
36
36
  } from "./index-9dp031by.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  JsonFormatter
4
- } from "./index-v72mh89f.js";
4
+ } from "./index-qssq2d41.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/quality/maintainabilityBaseline.ts
7
7
  class MaintainabilityBaseline {
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  runner
4
- } from "./index-sh3yzse2.js";
4
+ } from "./index-9rv2zt48.js";
5
5
  import {
6
6
  writeWorkflowRunArtifact,
7
7
  generatedFilePathsForTarget,
8
8
  writeGeneratedSyncState,
9
9
  createRepairReport,
10
10
  renderRepairReport
11
- } from "./index-ean2tff1.js";
11
+ } from "./index-a41vv4cy.js";
12
12
  import {
13
13
  AkanContextAnalyzer
14
- } from "./index-6bryy19d.js";
14
+ } from "./index-nmxszh6x.js";
15
15
  import {
16
16
  isWorkflowSysName,
17
17
  isWorkflowModuleName
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  camelToKebabCase,
4
4
  runner
5
- } from "./index-sh3yzse2.js";
5
+ } from "./index-9rv2zt48.js";
6
6
  import {
7
7
  rootAllowedFiles,
8
8
  rootAllowedDirs,
@@ -16,16 +16,16 @@ import {
16
16
  renderScopeAgentBlock,
17
17
  SysExecutor,
18
18
  WorkspaceExecutor
19
- } from "./index-v72mh89f.js";
19
+ } from "./index-qssq2d41.js";
20
20
  import {
21
21
  FileSys2
22
22
  } from "./index-by2tvsq6.js";
23
23
  import {
24
24
  LibExecutor2
25
- } from "./index-t00xrkey.js";
25
+ } from "./index-na8r4a27.js";
26
26
  import {
27
27
  PkgExecutor2
28
- } from "./index-cc9pevta.js";
28
+ } from "./index-dss3ds74.js";
29
29
  import {
30
30
  collectRecipeSources2,
31
31
  scanRecipes2
@@ -40,11 +40,11 @@ import {
40
40
  } from "./index-zyb0ebm4.js";
41
41
  import {
42
42
  MaintainabilityBaseline
43
- } from "./index-syn4vm3y.js";
43
+ } from "./index-1pjwsh2g.js";
44
44
  import {
45
45
  createFactReader,
46
46
  createAst
47
- } from "./index-7jr9mfp2.js";
47
+ } from "./index-7ehdht84.js";
48
48
  import {
49
49
  getNpmRegistryUrl,
50
50
  getLatestPackageVersion
@@ -196,8 +196,17 @@ import ts5 from "typescript";
196
196
 
197
197
  // pkgs/@akanjs/devkit/quality/storeAccessScanner.ts
198
198
  import ts3 from "typescript";
199
+ var formSetterPrefixes = ["set", "add", "sub", "addOrSub", "upload"];
200
+ var startsUpper = (text) => /^[A-Z]/.test(text);
201
+ var isFormSetterName = (name) => {
202
+ if (!/^\w+$/.test(name))
203
+ return false;
204
+ if (name.startsWith("writeOn"))
205
+ return startsUpper(name.slice("writeOn".length));
206
+ return formSetterPrefixes.some((prefix) => name.startsWith(prefix) && startsUpper(name.slice(prefix.length)) && /On[A-Z]/.test(name.slice(prefix.length + 1)));
207
+ };
208
+
199
209
  class StoreAccessScanner {
200
- static #formSetter = /^(?:(?:set|add|sub|addOrSub|upload)[A-Z]\w*On|writeOn)[A-Z]\w*$/;
201
210
  #index;
202
211
  constructor(index) {
203
212
  this.#index = index;
@@ -240,7 +249,7 @@ class StoreAccessScanner {
240
249
  }
241
250
  #isFormSetter(access) {
242
251
  const action = access.parent;
243
- return access.name.text === "do" && ts3.isPropertyAccessExpression(action) && action.expression === access && StoreAccessScanner.#formSetter.test(action.name.text) && !this.#index.isWritingAction(action.name.text);
252
+ return access.name.text === "do" && ts3.isPropertyAccessExpression(action) && action.expression === access && isFormSetterName(action.name.text) && !this.#index.isWritingAction(action.name.text);
244
253
  }
245
254
  }
246
255
 
@@ -19,7 +19,7 @@ import {
19
19
  SubagentPool2,
20
20
  McpSignIn,
21
21
  AkanCodeCompaction2
22
- } from "./index-ddc2zjj5.js";
22
+ } from "./index-gwsesvqc.js";
23
23
  import {
24
24
  codeAgentIsLoopback,
25
25
  codeAgentHostListed,
@@ -659,7 +659,7 @@ class AkanToolPack2 {
659
659
  return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
660
660
  }
661
661
  async names() {
662
- const { ContextRunner } = await import("./context.runner-e52ak0cx.js");
662
+ const { ContextRunner } = await import("./context.runner-333jkz86.js");
663
663
  return [
664
664
  ...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
665
665
  AkanToolPack2.verifyToolName
@@ -667,7 +667,7 @@ class AkanToolPack2 {
667
667
  }
668
668
  static verifyToolName = "akan_verify";
669
669
  async#register(pi) {
670
- const { ContextRunner } = await import("./context.runner-e52ak0cx.js");
670
+ const { ContextRunner } = await import("./context.runner-333jkz86.js");
671
671
  const runner = new ContextRunner;
672
672
  const guidelineNames = await AkanToolPack2.#guidelineNames();
673
673
  for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
@@ -705,7 +705,7 @@ class AkanToolPack2 {
705
705
  }
706
706
  static async#guidelineNames() {
707
707
  try {
708
- const { Prompter } = await import("./prompter-w58rvzb9.js");
708
+ const { Prompter } = await import("./prompter-qyggfhqd.js");
709
709
  return await Prompter.listGuidelines();
710
710
  } catch {
711
711
  return [];
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  script
4
- } from "./index-sh3yzse2.js";
4
+ } from "./index-9rv2zt48.js";
5
5
  import {
6
6
  jsonText
7
- } from "./index-ean2tff1.js";
7
+ } from "./index-a41vv4cy.js";
8
8
  import {
9
9
  akanMcpInstallTargets
10
- } from "./index-6bryy19d.js";
10
+ } from "./index-nmxszh6x.js";
11
11
  import {
12
12
  ContextRunner2
13
- } from "./index-qtqhsb33.js";
13
+ } from "./index-wa01phm9.js";
14
14
 
15
15
  // pkgs/@akanjs/cli/context/context.script.ts
16
16
  import { Logger } from "akanjs/common";
@@ -9,10 +9,10 @@ import {
9
9
  UpdatePackFolder,
10
10
  NativePublicEnv,
11
11
  NativeApp
12
- } from "./index-wq8pnev4.js";
12
+ } from "./index-w23tf30e.js";
13
13
  import {
14
14
  ExitCodeError
15
- } from "./index-sh3yzse2.js";
15
+ } from "./index-9rv2zt48.js";
16
16
  import {
17
17
  ConfigLock
18
18
  } from "./index-bqbf654f.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-sh3yzse2.js";
5
+ } from "./index-9rv2zt48.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-sh3yzse2.js";
5
+ } from "./index-9rv2zt48.js";
6
6
  import {
7
7
  CommandExecutionError,
8
8
  LibSource,
9
9
  formatLibStatuses
10
- } from "./index-v72mh89f.js";
10
+ } from "./index-qssq2d41.js";
11
11
  import {
12
12
  LibExecutor2
13
- } from "./index-t00xrkey.js";
13
+ } from "./index-na8r4a27.js";
14
14
  import {
15
15
  assertPlainName
16
16
  } from "./index-va90m8nd.js";
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  script
4
- } from "./index-sh3yzse2.js";
4
+ } from "./index-9rv2zt48.js";
5
5
  import {
6
6
  AppExecutor2
7
- } from "./index-cet2s7xk.js";
7
+ } from "./index-ze48c0vd.js";
8
8
  import {
9
9
  LibExecutor2
10
- } from "./index-t00xrkey.js";
10
+ } from "./index-na8r4a27.js";
11
11
  import {
12
12
  InteractionScaffold,
13
13
  workflowStatus,
@@ -46,16 +46,16 @@ import {
46
46
  nextActionsForTarget,
47
47
  createPrimitiveWriteReport,
48
48
  insertTemplateField
49
- } from "./index-ean2tff1.js";
49
+ } from "./index-a41vv4cy.js";
50
50
  import {
51
51
  ModuleScript
52
- } from "./index-bxevbjw7.js";
52
+ } from "./index-q444k260.js";
53
53
  import {
54
54
  plainNameProblem
55
55
  } from "./index-va90m8nd.js";
56
56
  import {
57
57
  ModuleExecutor
58
- } from "./index-4zqebbqb.js";
58
+ } from "./index-vjbne22r.js";
59
59
 
60
60
  // pkgs/@akanjs/cli/primitive/primitive.script.ts
61
61
  import { capitalize, lowerlize } from "akanjs/common";
@@ -823,7 +823,7 @@ var identifierPattern = /^[\p{ID_Start}$_][\p{ID_Continue}$\u200c\u200d]*$/u;
823
823
  var starExportPattern = /export\s*\*\s*from\s*["']([^"']+)["']/g;
824
824
  var facetEntryPattern = new RegExp(`^((?:apps|libs)/[^/]+/(${barrelFacetDirs.map(escapeRegExp).join("|")}))/([^/]+)(/)?`);
825
825
  var exportingPatternOf = (name) => new RegExp(`export\\s*\\{(?:[^}]*?[\\s,])?${escapeRegExp(name)}(?![\\w$])`);
826
- var exportMentioningPatternOf = (name) => new RegExp(`export\\s[^;]*?(?<![\\w$])${escapeRegExp(name)}(?![\\w$])`);
826
+ var exportMentioningPatternOf = (name) => new RegExp(`export(?![\\w$])[^;]*?(?<![\\w$])${escapeRegExp(name)}(?![\\w$])`);
827
827
  var declaringPatternOf = (name, isAnyBinding) => {
828
828
  const escaped = escapeRegExp(name);
829
829
  const braced = "\\{(?:[^}]*?[\\s,])?";
@@ -1048,7 +1048,7 @@ ${near ?? ""}`;
1048
1048
  this.#reexports.set(key, found);
1049
1049
  return found;
1050
1050
  }
1051
- #reexportIn(source, name) {
1051
+ #reexportIn(source, name, takesPackageDefault = false) {
1052
1052
  const { ts, reader } = this.#source;
1053
1053
  for (const statement of source.statements) {
1054
1054
  if (!ts.isExportDeclaration(statement) || statement.isTypeOnly)
@@ -1065,7 +1065,9 @@ ${near ?? ""}`;
1065
1065
  const imported = reader.importsIn(source).find((item) => item.name === original);
1066
1066
  if (!imported)
1067
1067
  return { name: original, from: null };
1068
- return imported.imported === "default" || imported.imported === "*" ? null : { name: imported.imported, from: imported.from };
1068
+ if (imported.imported === "default")
1069
+ return takesPackageDefault && this.pathOfSpecifier(source.fileName, imported.from) === null ? { name: "default", from: imported.from } : null;
1070
+ return imported.imported === "*" ? null : { name: imported.imported, from: imported.from };
1069
1071
  }
1070
1072
  return null;
1071
1073
  }
@@ -1211,7 +1213,7 @@ ${name}`;
1211
1213
  const text = this.#source.readText(fileName);
1212
1214
  if (text === undefined)
1213
1215
  continue;
1214
- const named = text.includes(name) && identifierPattern.test(name) && exportingPatternOf(name).test(text) ? this.#reexportIn(this.#source.parse(fileName, text), name) : null;
1216
+ const named = text.includes(name) && identifierPattern.test(name) && exportingPatternOf(name).test(text) ? this.#reexportIn(this.#source.parse(fileName, text), name, true) : null;
1215
1217
  if (named) {
1216
1218
  found.named = { ...named, fileName };
1217
1219
  break;
@@ -1232,8 +1234,14 @@ ${name}`;
1232
1234
  const { ts } = this.#source;
1233
1235
  const binds = (node) => ts.isIdentifier(node) ? node.text === name : node.elements.some((element) => !ts.isOmittedExpression(element) && binds(element.name));
1234
1236
  return source.statements.some((statement) => {
1235
- if (ts.isExportDeclaration(statement))
1236
- return !statement.moduleSpecifier && !statement.isTypeOnly && !!statement.exportClause && ts.isNamedExports(statement.exportClause) && statement.exportClause.elements.some((element) => !element.isTypeOnly && element.name.text === name);
1237
+ if (ts.isExportDeclaration(statement)) {
1238
+ const { exportClause, isTypeOnly, moduleSpecifier } = statement;
1239
+ if (isTypeOnly || !exportClause)
1240
+ return false;
1241
+ if (ts.isNamespaceExport(exportClause))
1242
+ return exportClause.name.text === name;
1243
+ return !moduleSpecifier && ts.isNamedExports(exportClause) && exportClause.elements.some((element) => !element.isTypeOnly && element.name.text === name);
1244
+ }
1237
1245
  const modifiers = ts.canHaveModifiers(statement) ? ts.getModifiers(statement) ?? [] : [];
1238
1246
  if (!modifiers.some(({ kind }) => kind === ts.SyntaxKind.ExportKeyword) || modifiers.some(({ kind }) => kind === ts.SyntaxKind.DefaultKeyword))
1239
1247
  return false;
@@ -1488,14 +1496,14 @@ ${wanted}`))
1488
1496
  continue;
1489
1497
  seen.add(`${at}
1490
1498
  ${wanted}`);
1491
- for (const item of this.#bindingAt(wanted, at, pending))
1499
+ for (const item of this.#bindingAt(wanted, at, pending, name))
1492
1500
  reached.set(exportedKeyOf(item), item);
1493
1501
  }
1494
1502
  const found = [...reached.values()];
1495
1503
  this.#exported.set(key, found);
1496
1504
  return found;
1497
1505
  }
1498
- #bindingAt(name, path, pending) {
1506
+ #bindingAt(name, path, pending, plugged) {
1499
1507
  const here = this.#declaredAt(name, path);
1500
1508
  if (here.length)
1501
1509
  return here;
@@ -1508,8 +1516,10 @@ ${wanted}`);
1508
1516
  }
1509
1517
  if (named) {
1510
1518
  const target = this.#resolver.pathOfSpecifier(named.fileName, named.from);
1511
- if (target === null)
1512
- return [{ name: named.name === "default" ? name : named.name, from: named.from }];
1519
+ if (target === null) {
1520
+ const exposed = named.name !== "default" ? named.name : name !== "default" ? name : plugged;
1521
+ return [{ name: exposed, from: named.from }];
1522
+ }
1513
1523
  pending.push([named.name, target]);
1514
1524
  return [];
1515
1525
  }
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  ErrorReport
4
- } from "./index-4zqebbqb.js";
4
+ } from "./index-vjbne22r.js";
5
5
  import {
6
6
  JsonFormatter
7
- } from "./index-v72mh89f.js";
7
+ } from "./index-qssq2d41.js";
8
8
 
9
9
  // pkgs/@akanjs/devkit/app/applicationBuildReporter.ts
10
10
  import { Logger } from "akanjs/common";
@@ -1414,6 +1414,7 @@ class HmrWatcher {
1414
1414
  #hinted = new Set;
1415
1415
  #classifier = new HmrChangeClassifier;
1416
1416
  #index;
1417
+ #scans = new Set;
1417
1418
  #timer = null;
1418
1419
  #verifyTimer = null;
1419
1420
  #windowStartedAt = null;
@@ -1474,6 +1475,17 @@ class HmrWatcher {
1474
1475
  } catch {}
1475
1476
  }
1476
1477
  }
1478
+ async close() {
1479
+ this.stop();
1480
+ await Promise.all(this.#scans);
1481
+ await this.#mergeDetectedChanges();
1482
+ if (this.#pending.size === 0)
1483
+ return null;
1484
+ const batch = { files: Array.from(this.#pending.keys()), kinds: new Set(this.#pending.values()) };
1485
+ this.#pending.clear();
1486
+ this.#hinted.clear();
1487
+ return batch;
1488
+ }
1477
1489
  async absorb(paths) {
1478
1490
  if (paths.length === 0)
1479
1491
  return;
@@ -1541,7 +1553,12 @@ class HmrWatcher {
1541
1553
  this.#scheduleVerify();
1542
1554
  }
1543
1555
  }
1544
- async#mergeDetectedChanges() {
1556
+ #mergeDetectedChanges() {
1557
+ const scan = this.#collectDetectedChanges().finally(() => this.#scans.delete(scan));
1558
+ this.#scans.add(scan);
1559
+ return scan;
1560
+ }
1561
+ async#collectDetectedChanges() {
1545
1562
  const detected = await this.#index.collectChanges().catch((err) => {
1546
1563
  this.#logger.error(`[hmr] mtime scan failed: ${err.message}`);
1547
1564
  return [];
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-sh3yzse2.js";
5
+ } from "./index-9rv2zt48.js";
6
6
  import {
7
7
  generatedFilesForSync,
8
8
  createPassedPrimitiveReport,
9
9
  scalarChangedFiles
10
- } from "./index-ean2tff1.js";
10
+ } from "./index-a41vv4cy.js";
11
11
  import {
12
12
  pluralizeName
13
13
  } from "./index-nz8prx9g.js";
@@ -5,24 +5,24 @@ import {
5
5
  import {
6
6
  Executor,
7
7
  WorkspaceExecutor
8
- } from "./index-v72mh89f.js";
8
+ } from "./index-qssq2d41.js";
9
9
  import {
10
10
  getDirname2,
11
11
  FileSys2
12
12
  } from "./index-by2tvsq6.js";
13
13
  import {
14
14
  AppExecutor2
15
- } from "./index-cet2s7xk.js";
15
+ } from "./index-ze48c0vd.js";
16
16
  import {
17
17
  LibExecutor2
18
- } from "./index-t00xrkey.js";
18
+ } from "./index-na8r4a27.js";
19
19
  import {
20
20
  PkgExecutor2
21
- } from "./index-cc9pevta.js";
21
+ } from "./index-dss3ds74.js";
22
22
  import {
23
23
  ModuleExecutor,
24
24
  ErrorReport
25
- } from "./index-4zqebbqb.js";
25
+ } from "./index-vjbne22r.js";
26
26
 
27
27
  // pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
28
28
  var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();