@akanjs/cli 3.1.1-rc.3 → 3.1.1-rc.5

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/.build-stamp CHANGED
@@ -1 +1 @@
1
- 5bce9c432681dbffde300f2d620f927c20721e6f64af5b6e6f672b5f8618531a
1
+ c2f52a581f7d932f25f8fc698ca2c44a156a0dd43cbbcc395b17ff6051065e5a
@@ -9,7 +9,7 @@ import"./index-trjhp735.js";
9
9
  import"./index-hrc7q2e6.js";
10
10
  import {
11
11
  PlatformTestRun
12
- } from "./index-rqcmr940.js";
12
+ } from "./index-b2hkbyf0.js";
13
13
  import"./index-xhnw8n74.js";
14
14
  import"./index-m9jj544v.js";
15
15
  import"./index-s28awecf.js";
@@ -23,7 +23,7 @@ import"./index-tvehn2sp.js";
23
23
  import"./index-mtf0cx8t.js";
24
24
  import {
25
25
  CloudScript2
26
- } from "./index-x6c29k5m.js";
26
+ } from "./index-rvqk63qp.js";
27
27
  import {
28
28
  writeOption,
29
29
  oneNativeTargetOption,
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript2
4
- } from "./index-x6c29k5m.js";
5
- import"./index-rqcmr940.js";
4
+ } from "./index-rvqk63qp.js";
5
+ import"./index-b2hkbyf0.js";
6
6
  import"./index-jn8gfj2b.js";
7
7
  import"./index-yaz7yks8.js";
8
8
  import"./index-sxqjxb4j.js";
@@ -104,7 +104,10 @@ pages declaring one name never clash, and a registry kept outside the surface re
104
104
  parts, so that is what it answers with no `host` set. A `host` the app named is a gateway the class knows
105
105
  nothing about, and it stays text-only until `option.setLlm({ accepts })` says otherwise — handing bytes to a
106
106
  model that cannot decode them kills the whole turn on a 400, where text-only degrades them to a note the model
107
- can repeat back.
107
+ can repeat back. A `host` naming OpenAI's own endpoint is the default host by hostname, not a gateway, and an
108
+ app's own chat-completions adaptor claims through `OpenaiLlm.acceptsOf(llmOption)` instead of copying the rule —
109
+ a copy that read "any host is a gateway" kept a vision model text-only for an app that spelled out
110
+ `https://api.openai.com/v1`.
108
111
  - **A refusal is `agent.error.llmRequestFailed`, and it names the host** — unless the prompt did not fit. The
109
112
  provider's own sentence rides in `reason` and the hostname in `provider`. `LlmOverflow.refusal(host, status,
110
113
  reason)` builds it, and reads the one refusal a chat can undo — a prompt past the window, recognized from each
@@ -648,7 +651,18 @@ pages declaring one name never clash, and a registry kept outside the surface re
648
651
  page the user left. The reading built-ins (`readScreen`, `readState`, `highlight`, `viewImage`) declare it,
649
652
  because a wait costs 120ms of quiet at the very least and they change nothing a resource holds.
650
653
  New tools and state from a fresh route are still only listed from the next turn: the catalogue is snapshotted
651
- when the turn starts.
654
+ when the turn starts. **So a navigation ends the model's turn, and a name nobody listed is answered with the names
655
+ that exist.** A call is looked up when it runs, so one batched behind `navigate` already reaches the new screen —
656
+ but the model wrote it against the old catalogue, and a screen-scoped name it never saw is one it composed
657
+ (`addBacklogTicketInProject` for `addBacklogTicket`), and refused with a bare `Unknown tool` it composes the next.
658
+ `AgentService.preamble` therefore says that a navigation ends the turn and that names are never guessed, and the
659
+ session answers an unknown name with the tools listed now — saying, when the catalogue moved since the turn's
660
+ list was written, that the call was written against the screen it left and the new one's tools arrive with their
661
+ arguments next turn. `navigate`'s own answer says the same, reports the path the page actually landed on when a
662
+ redirect or the not-found page moved it elsewhere, and a path with no route is refused with the internal links on
663
+ screen (`ScreenTarget.linkedRoutes`) rather than an invitation to compose another. Layout-level tools — a channel
664
+ post, a new wiki page — stay listed across routes, which is why the cross-screen requests that use only them never
665
+ hit this.
652
666
  - **A tool that waits for its own work costs no model turns; one that returns early costs one round trip per
653
667
  look.** The session awaits `run`, so a `.exec` that awaits the store action finishing the job simply makes the
654
668
  turn take that long — and the change report that follows carries whatever landed, so the model needs no second
@@ -115,7 +115,9 @@ this is the full contract behind them.
115
115
  document path**: they fire no hooks, so a model whose removal cascades or carries a `_postRemove` still goes
116
116
  through `remove<Model>(id)`.
117
117
  - The write-through pair is `pickAndWrite(id, data)` / `pickOneAndWrite(query, data)` — pick the document, write
118
- into it and save it, so the save hooks do run; reach for those when the write has to be seen by them.
118
+ into it and save it, so the save hooks do run; reach for those when the write has to be seen by them. A third
119
+ argument `{ touch: false }`, like `doc.save({ touch: false })`, keeps `updatedAt` while the hooks and live sync
120
+ still run — a nudge that re-sends a row its rooms must re-read, with no edit to stamp.
119
121
  - `upsertById(data, { preserveTimestamps })` writes a record whole under its own id, new or in place, with no
120
122
  hook: the write a sync or a backfill repeats safely, keeping the record's `createdAt`/`updatedAt` when asked.
121
123
 
@@ -1098,7 +1098,7 @@ ${run.format(results)}
1098
1098
  const rootPackageJson = await workspace.getPackageJson();
1099
1099
  if (!rootPackageJson.dependencies)
1100
1100
  throw new Error("No dependencies found in package.json");
1101
- for (const name of ["akanjs", "@akanjs/devkit"]) {
1101
+ for (const name of ["akanjs", "@akanjs/devkit", "@akanjs/cli"]) {
1102
1102
  if (rootPackageJson.dependencies[name])
1103
1103
  rootPackageJson.dependencies[name] = latestPublishedVersion;
1104
1104
  if (rootPackageJson.devDependencies?.[name])
@@ -23,7 +23,7 @@ import {
23
23
  } from "./index-mtf0cx8t.js";
24
24
  import {
25
25
  CloudRunner
26
- } from "./index-rqcmr940.js";
26
+ } from "./index-b2hkbyf0.js";
27
27
 
28
28
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
29
29
  import { Logger } from "akanjs/common";
package/index.js CHANGED
@@ -22,18 +22,18 @@ import path from "path";
22
22
 
23
23
  // pkgs/@akanjs/cli/commandModules.ts
24
24
  var commandModules = {
25
- workspace: async () => (await import("./workspace.command-rq7mgq6f.js")).WorkspaceCommand,
25
+ workspace: async () => (await import("./workspace.command-mkqtxg1x.js")).WorkspaceCommand,
26
26
  agent: async () => (await import("./agent.command-2gay26y4.js")).AgentCommand,
27
27
  code: async () => (await import("./code.command-184jfjtk.js")).CodeCommand,
28
28
  application: async () => (await import("./application.command-a3aepayy.js")).ApplicationCommand,
29
29
  library: async () => (await import("./library.command-tnxw0yb4.js")).LibraryCommand,
30
- localRegistry: async () => (await import("./localRegistry.command-dy0byd6z.js")).LocalRegistryCommand,
30
+ localRegistry: async () => (await import("./localRegistry.command-xw0c03g4.js")).LocalRegistryCommand,
31
31
  package: async () => (await import("./package.command-b831nx2n.js")).PackageCommand,
32
32
  module: async () => (await import("./module.command-8pjk6vmm.js")).ModuleCommand,
33
33
  page: async () => (await import("./page.command-earjccmn.js")).PageCommand,
34
34
  context: async () => (await import("./context.command-kx0kzz3t.js")).ContextCommand,
35
- cloud: async () => (await import("./cloud.command-t2zdcw87.js")).CloudCommand,
36
- subspace: async () => (await import("./subspace.command-xjw4tc0p.js")).SubspaceCommand,
35
+ cloud: async () => (await import("./cloud.command-10j4z1cy.js")).CloudCommand,
36
+ subspace: async () => (await import("./subspace.command-fwzrs526.js")).SubspaceCommand,
37
37
  guideline: async () => (await import("./guideline.command-72psmnpx.js")).GuidelineCommand,
38
38
  scalar: async () => (await import("./scalar.command-vwjk94zr.js")).ScalarCommand,
39
39
  primitive: async () => (await import("./primitive.command-8dw8ra1x.js")).PrimitiveCommand,
@@ -24,7 +24,7 @@ import"./index-hrc7q2e6.js";
24
24
  import {
25
25
  getNpmRegistryUrl,
26
26
  CloudRunner
27
- } from "./index-rqcmr940.js";
27
+ } from "./index-b2hkbyf0.js";
28
28
  import"./index-tvehn2sp.js";
29
29
  import {
30
30
  PackageScript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.1.1-rc.3",
3
+ "version": "3.1.1-rc.5",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "1.3.0",
40
40
  "@inquirer/prompts": "^8.7.3",
41
41
  "@tailwindcss/node": "^4.3.3",
42
- "akanjs": "3.1.1-rc.3",
42
+ "akanjs": "3.1.1-rc.5",
43
43
  "chalk": "^6.0.1",
44
44
  "commander": "^15.0.0",
45
45
  "dayjs": "^1.11.23",
@@ -816,7 +816,7 @@ class SubspaceRunner extends runner("subspace") {
816
816
  if (!asked)
817
817
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
818
818
  const { libs } = await subspace.slice();
819
- const { CloudScript } = await import("./cloud.script-mm636g83.js");
819
+ const { CloudScript } = await import("./cloud.script-qb9jfncf.js");
820
820
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
821
821
  host,
822
822
  workspaceId,
@@ -56,10 +56,10 @@ import {
56
56
  import {
57
57
  getNpmRegistryUrl,
58
58
  getLatestPackageVersion
59
- } from "./index-rqcmr940.js";
59
+ } from "./index-b2hkbyf0.js";
60
60
  import {
61
61
  CloudScript2
62
- } from "./index-x6c29k5m.js";
62
+ } from "./index-rvqk63qp.js";
63
63
  import"./index-hqaa4y3y.js";
64
64
  import"./index-zz5731qs.js";
65
65
  import"./index-q0e6604h.js";
@@ -134,10 +134,10 @@ class WorkspaceRunner extends runner("workspace") {
134
134
  owner = ""
135
135
  }) {
136
136
  const cwdPath = process.cwd();
137
- const workspaceRoot = path.join(cwdPath, dirname, repoName);
137
+ const workspaceRoot = path.resolve(cwdPath, dirname, repoName);
138
138
  const normalizedRegistryUrl = registryUrl ? getNpmRegistryUrl(registryUrl) : undefined;
139
139
  const workspace = WorkspaceExecutor.fromRoot({ workspaceRoot, repoName });
140
- const templateSpinner = workspace.spinning(`Creating workspace template files in ${dirname}/${repoName}...`);
140
+ const templateSpinner = workspace.spinning(`Creating workspace template files in ${workspaceRoot}...`);
141
141
  const latestTypesBunVersion = await getLatestPackageVersion("@types/bun", "latest", normalizedRegistryUrl);
142
142
  await workspace.applyTemplate({
143
143
  basePath: ".",
@@ -147,7 +147,7 @@ class WorkspaceRunner extends runner("workspace") {
147
147
  if (normalizedRegistryUrl)
148
148
  await workspace.writeFile(".npmrc", `registry=${normalizedRegistryUrl}/
149
149
  `);
150
- templateSpinner.succeed(`Workspace files created in ${dirname}/${repoName}`);
150
+ templateSpinner.succeed(`Workspace files created in ${workspaceRoot}`);
151
151
  const [rootPackageJson, peerDependencies] = await Promise.all([
152
152
  workspace.getPackageJson(),
153
153
  this.#getAkanPeerDependencies()
@@ -166,6 +166,7 @@ class WorkspaceRunner extends runner("workspace") {
166
166
  "@types/bun": latestTypesBunVersion,
167
167
  ...defaultWorkspaceTypeDependencies,
168
168
  "@akanjs/devkit": akanVersion,
169
+ "@akanjs/cli": akanVersion,
169
170
  ...typescript ? { typescript } : {}
170
171
  }
171
172
  };
@@ -319,7 +320,6 @@ AKAN_PUBLIC_LOG_LEVEL=debug
319
320
  }
320
321
 
321
322
  // pkgs/@akanjs/cli/workspace/workspace.script.ts
322
- import path2 from "path";
323
323
  import { Logger } from "akanjs/common";
324
324
  class WorkspaceScript extends script("workspace", [
325
325
  WorkspaceRunner,
@@ -372,10 +372,9 @@ class WorkspaceScript extends script("workspace", [
372
372
  } catch (_) {
373
373
  gitSpinner.fail("Git repository initialization failed. It's not fatal, you can commit manually");
374
374
  }
375
- const workspacePath = path2.join(dirname, repoName);
376
375
  Logger.rawLog(`
377
- \uD83C\uDF89 Welcome aboard! Workspace created in ${dirname}/${repoName}`);
378
- Logger.rawLog(`\uD83D\uDE80 Run \`cd ${workspacePath} && akan start ${appName}\` to start the development server.`);
376
+ \uD83C\uDF89 Welcome aboard! Workspace created in ${workspace.workspaceRoot}`);
377
+ Logger.rawLog(`\uD83D\uDE80 Run \`cd ${workspace.workspaceRoot} && akan start ${appName}\` to start the development server.`);
379
378
  Logger.rawLog(`
380
379
  \uD83D\uDC4B Happy coding!`);
381
380
  }