@akanjs/cli 3.1.1-rc.1 → 3.1.1-rc.11
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 +1 -1
- package/{CodeAgent-4pnxwptq.js → CodeAgent-5t8m16w8.js} +2 -2
- package/{CodeTui-hhndze8h.js → CodeTui-drgacyvs.js} +1 -1
- package/TunnelShare-26ty9skr.js +14 -0
- package/{agent.command-p02330r6.js → agent.command-h82gepwn.js} +5 -5
- package/akanCode.js +2 -2
- package/{application.command-1117fgq9.js → application.command-j1reb9p1.js} +11 -11
- package/{applicationBuildRunner-9cnnsdm5.js → applicationBuildRunner-w20x63mz.js} +74 -26
- package/buildBatch.proc.js +5 -5
- package/{cloud.command-ttb2s2x6.js → cloud.command-zd2mfkm0.js} +22 -17
- package/cloud.script-vdj8ymch.js +24 -0
- package/{code.command-16pm1p2v.js → code.command-w1rt357h.js} +6 -6
- package/{context.command-6ys86sqf.js → context.command-d35ppstw.js} +16 -16
- package/context.runner-azvkkzdr.js +25 -0
- package/{guideline.command-3zay3d8g.js → guideline.command-xwkskvky.js} +2 -2
- package/guidelines/agentRule/agentRule.instruction.md +21 -4
- package/guidelines/conventions/conventions.instruction.md +10 -7
- package/guidelines/pageRule/pageRule.instruction.md +9 -0
- package/guidelines/queryRule/queryRule.instruction.md +13 -1
- package/guidelines/runtimeRule/runtimeRule.instruction.md +12 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +2 -1
- package/incrementalBuilder.proc.js +3 -3
- package/{index-rr7jk14m.js → index-1e2955yd.js} +23 -10
- package/{index-z9xepn8t.js → index-2qzzp0c9.js} +557 -142
- package/{index-e9e9cebg.js → index-4rwfh2de.js} +3 -3
- package/{index-fmder14z.js → index-553xyb55.js} +1 -1
- package/{index-9hbhm6cs.js → index-657908e5.js} +1 -1
- package/{index-1mfyyxh5.js → index-6pzt55w3.js} +3 -3
- package/{index-4w3skd33.js → index-6y1991s6.js} +3 -3
- package/{index-zn6bn1s2.js → index-7abjzny1.js} +4 -4
- package/{index-2ar6tffh.js → index-7ktk2hnz.js} +67 -19
- package/{index-bb4hj03s.js → index-7yzcaymm.js} +10 -10
- package/{index-ngpn9hzy.js → index-8jb5ep2e.js} +2 -2
- package/{index-ekpp5tax.js → index-8rvwgd1r.js} +4 -97
- package/{index-sww1x1mv.js → index-brpk7gd8.js} +56 -9
- package/{index-7f0edwsj.js → index-ch1sv7ke.js} +57 -12
- package/{index-jgs8z8xb.js → index-cz9g85xh.js} +1 -1
- package/{index-tk3jg2bm.js → index-hdzjaq7s.js} +4 -3
- package/{index-sng3vt0p.js → index-kbbyzs6j.js} +2 -2
- package/{index-z6v7k9sb.js → index-kr62ph5a.js} +24 -2
- package/{index-b5vptvnt.js → index-nmy1rana.js} +4 -4
- package/{index-ynqxpwx6.js → index-pqdz7rat.js} +1 -1
- package/{index-p4dnj2wc.js → index-qmeh0s05.js} +63 -8
- package/{index-qkcwsg6r.js → index-rshwdv9w.js} +2 -2
- package/{index-jaa81e9r.js → index-trvk51ht.js} +4 -4
- package/{index-1cq1hq12.js → index-tzzs52h0.js} +26 -15
- package/{index-qfzfaq96.js → index-wvvwdzfw.js} +3 -3
- package/{index-vcpbrrf2.js → index-xeh7m2j5.js} +1 -1
- package/{index-sh9mmp5v.js → index-y5m4j2w6.js} +7 -7
- package/{index-g2s33373.js → index-ygy8c12j.js} +1 -1
- package/{index-q8age5az.js → index-yknrmkmt.js} +2 -2
- package/index.js +22 -22
- package/{library.command-a8n9h8j4.js → library.command-td8t85kb.js} +3 -3
- package/{localRegistry.command-c2mxqf4h.js → localRegistry.command-jx9zkmxf.js} +12 -12
- package/{module.command-b6f1p1xa.js → module.command-j70mqgpp.js} +5 -5
- package/{package.command-tc27ftmy.js → package.command-1b1v6k5v.js} +3 -3
- package/package.json +2 -2
- package/{page.command-m5wyqfkd.js → page.command-m31w2tsz.js} +3 -3
- package/{pipeline.command-4qxyafpz.js → pipeline.command-q7b8wy55.js} +2 -2
- package/{primitive.command-9yaatk0d.js → primitive.command-4zrbhkb9.js} +6 -6
- package/{projectTypecheck-87k6z6ab.js → projectTypecheck-synx6qff.js} +1 -1
- package/{quality.command-fxn07zwp.js → quality.command-cy0pgqjz.js} +3 -3
- package/{repair.command-evg9g911.js → repair.command-98n6zxg7.js} +5 -5
- package/{scalar.command-xsejjeq1.js → scalar.command-rak5pjk3.js} +4 -4
- package/{subspace.command-4mjjxgmf.js → subspace.command-ej0rk116.js} +8 -8
- package/templates/app/tsconfig.json.template +2 -7
- package/templates/env/_env.server.type.ts +10 -5
- package/templates/facetIndex/index.ts +2 -2
- package/templates/workspaceRoot/bunfig.toml.template +0 -4
- package/{tunnel.command-7f41pm7y.js → tunnel.command-kdx3amrc.js} +7 -7
- package/{workflow.command-qpyq0ya5.js → workflow.command-gffk9nj9.js} +10 -10
- package/{workspace.command-qvwdqmnd.js → workspace.command-j1680trm.js} +33 -32
- package/TunnelShare-8qtffcex.js +0 -14
- package/cloud.script-fqp3zh02.js +0 -24
- package/context.runner-3jrypwe3.js +0 -25
|
@@ -31,7 +31,10 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
31
31
|
**refuses every call until the app names a guard of its own** — the same answer `None` gives, with no boot
|
|
32
32
|
warning. A product with accounts names it in its `option.ts`, `option.setAgentAccess(SignedIn)`, taking the same
|
|
33
33
|
guard classes every endpoint takes (an array is ANDed, `null` clears what a library set); without one the chat
|
|
34
|
-
cannot spend the LLM key.
|
|
34
|
+
cannot spend the LLM key. **The guard decides who, not what** — the browser writes the instructions, tools and
|
|
35
|
+
transcript — so `option.setAgentRequestPolicy((request, { account, ip }) => request)` sees each turn after the
|
|
36
|
+
guard, before the quota and the model (tool names as the page published them), and returns what is sent, or
|
|
37
|
+
throws an `Err` (`agent.error.requestRefused`) to refuse it.
|
|
35
38
|
`persist` keeps the transcript across reloads (sessionStorage; `{ storage: "local" }` to outlive the tab),
|
|
36
39
|
default off, and `shortcut={false}` gives the browser back the Cmd/Ctrl+L the launcher otherwise captures.
|
|
37
40
|
**`persist` also takes a `SessionHistory` of the app's own** — `{ load, save, clear }` — which is how a
|
|
@@ -104,7 +107,10 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
104
107
|
parts, so that is what it answers with no `host` set. A `host` the app named is a gateway the class knows
|
|
105
108
|
nothing about, and it stays text-only until `option.setLlm({ accepts })` says otherwise — handing bytes to a
|
|
106
109
|
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.
|
|
110
|
+
can repeat back. A `host` naming OpenAI's own endpoint is the default host by hostname, not a gateway, and an
|
|
111
|
+
app's own chat-completions adaptor claims through `OpenaiLlm.acceptsOf(llmOption)` instead of copying the rule —
|
|
112
|
+
a copy that read "any host is a gateway" kept a vision model text-only for an app that spelled out
|
|
113
|
+
`https://api.openai.com/v1`.
|
|
108
114
|
- **A refusal is `agent.error.llmRequestFailed`, and it names the host** — unless the prompt did not fit. The
|
|
109
115
|
provider's own sentence rides in `reason` and the hostname in `provider`. `LlmOverflow.refusal(host, status,
|
|
110
116
|
reason)` builds it, and reads the one refusal a chat can undo — a prompt past the window, recognized from each
|
|
@@ -627,7 +633,7 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
627
633
|
|
|
628
634
|
## Built-In Tools
|
|
629
635
|
- The framework publishes six built-ins on every store surface: `navigate` (internal paths only, the same router
|
|
630
|
-
`Link` rides), `goBack` (this session's history — global, because history is not a control a page owns and a page
|
|
636
|
+
`Link` rides, so the app's navigation guards are asked and a refusal is reported as a kept page), `goBack` (this session's history — global, because history is not a control a page owns and a page
|
|
631
637
|
that draws no back link is not one you may not leave — a screen that must not be left withholds them with `builtins`,
|
|
632
638
|
not with prose), `readScreen` (the rendered DOM as compact text — headings, links, control values, and `(disabled)`
|
|
633
639
|
on a control or button that has it; the chat's own UI is skipped via `data-agent-ui`, and a password value is never
|
|
@@ -648,7 +654,18 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
648
654
|
page the user left. The reading built-ins (`readScreen`, `readState`, `highlight`, `viewImage`) declare it,
|
|
649
655
|
because a wait costs 120ms of quiet at the very least and they change nothing a resource holds.
|
|
650
656
|
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.
|
|
657
|
+
when the turn starts. **So a navigation ends the model's turn, and a name nobody listed is answered with the names
|
|
658
|
+
that exist.** A call is looked up when it runs, so one batched behind `navigate` already reaches the new screen —
|
|
659
|
+
but the model wrote it against the old catalogue, and a screen-scoped name it never saw is one it composed
|
|
660
|
+
(`addBacklogTicketInProject` for `addBacklogTicket`), and refused with a bare `Unknown tool` it composes the next.
|
|
661
|
+
`AgentService.preamble` therefore says that a navigation ends the turn and that names are never guessed, and the
|
|
662
|
+
session answers an unknown name with the tools listed now — saying, when the catalogue moved since the turn's
|
|
663
|
+
list was written, that the call was written against the screen it left and the new one's tools arrive with their
|
|
664
|
+
arguments next turn. `navigate`'s own answer says the same, reports the path the page actually landed on when a
|
|
665
|
+
redirect or the not-found page moved it elsewhere, and a path with no route is refused with the internal links on
|
|
666
|
+
screen (`ScreenTarget.linkedRoutes`) rather than an invitation to compose another. Layout-level tools — a channel
|
|
667
|
+
post, a new wiki page — stay listed across routes, which is why the cross-screen requests that use only them never
|
|
668
|
+
hit this.
|
|
652
669
|
- **A tool that waits for its own work costs no model turns; one that returns early costs one round trip per
|
|
653
670
|
look.** The session awaits `run`, so a `.exec` that awaits the store action finishing the job simply makes the
|
|
654
671
|
turn take that long — and the change report that follows carries whatever landed, so the model needs no second
|
|
@@ -253,7 +253,8 @@ Declared in `akan.config.ts`, narrowed — never widened — by an env at boot;
|
|
|
253
253
|
`ca-certificates` and `tzdata`.
|
|
254
254
|
- **Native apps are the `native` section** (iOS, Android, desktop). A desktop app's carried server listens on a
|
|
255
255
|
loopback port any local program can call — guard it as a network server — and ships `private/` and its env
|
|
256
|
-
readable on the user's computer; read runtime files from `AKAN_APP_DIR
|
|
256
|
+
readable on the user's computer; read runtime files from `AKAN_APP_DIR`, and keep a secret the user gives it with
|
|
257
|
+
`NativeSecret` (the OS credential store), never in a file.
|
|
257
258
|
- **`database: { modes: [...] }`** (`single`, `multiple`, `cluster`), chosen by `AKAN_DATABASE_MODE`; an app running
|
|
258
259
|
in two modes avoids `q.raw`.
|
|
259
260
|
|
|
@@ -334,8 +335,9 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
|
|
|
334
335
|
`remove<Model>(id)`, and `pickAndWrite` writes through the save hooks (`queryRule`).
|
|
335
336
|
- **`<model>.service.ts`** — a few lines: load → chain → `return await ….save()` (keep the `return await`). Side
|
|
336
337
|
effects go in `override async _preUpdate` / `_postCreate`; fire-and-forget is `void`-ed. Load every referenced
|
|
337
|
-
document, then save, then notify
|
|
338
|
-
|
|
338
|
+
document, then save, then notify; writes that must land together go in `this.transaction(async () => …)` and
|
|
339
|
+
their notification in `this.afterCommit(…)` (`queryRule`). Return `null` / `false` for not allowed or not found;
|
|
340
|
+
the signal decides whether that is an error.
|
|
339
341
|
- **`<model>.signal.ts`** — `XInternal` → `XSlice` → `XEndpoint`, all three even when empty; `exec` is a one-liner
|
|
340
342
|
calling the service.
|
|
341
343
|
- **`<model>.store.ts`** — custom actions only for a toast, an optimistic update, or a multi-field write:
|
|
@@ -395,9 +397,9 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
|
|
|
395
397
|
wrong JSON type, a value outside its enum or a missing required field answers 400 with `data.name` naming the
|
|
396
398
|
path (`data.items.2.price`); a defaulted field may be left out, an undeclared key is dropped, and a stored model's
|
|
397
399
|
input keeps an absent field absent.
|
|
398
|
-
- **Reserved names**: generated CRUD (`create<Model>`, `update<Model>`, `remove<Model>`, …) exists for every model
|
|
399
|
-
|
|
400
|
-
|
|
400
|
+
- **Reserved names**: generated CRUD (`create<Model>`, `update<Model>`, `remove<Model>`, …) exists for every model
|
|
401
|
+
whose slice mounts the verb. `fetch.*` is one namespace across modules and a pubsub or message is routed by its bare
|
|
402
|
+
name, so the server refuses to boot on two claims of one name (`[DI:fetch]`, `[DI:socket]`), naming both.
|
|
401
403
|
- **Queries (`queryRule`)**: the root slice takes `queryKey` + `args`, never a raw query. A slice `exec` returns a
|
|
402
404
|
`query<Filter>(…)` descriptor (never a `list<Filter>` array) and is paged through `initX(…, { sort, page, limit })`.
|
|
403
405
|
A projection is bare on the facade (`pickById(id, { secret: true })`), under `select` on a filter accessor — the
|
|
@@ -415,7 +417,8 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
|
|
|
415
417
|
screen with `page().prompt(name, description)`, and publish one component a host draws with
|
|
416
418
|
`page().app(name, description, load)` — a read-only tool whose `load` may only query.
|
|
417
419
|
- **In-page agent (`agentRule`)**: mount `<Agent.Chat />` once in a layout; it never executes tools and refuses
|
|
418
|
-
every call until `option.setAgentAccess(<guard>)
|
|
420
|
+
every call until `option.setAgentAccess(<guard>)`, which decides who — what a turn may ask is
|
|
421
|
+
`option.setAgentRequestPolicy`; the LLM is `option.setLlm({ apiKey, model, host })`, never env.
|
|
419
422
|
The surface is what components declare — `st.tool(…).exec(fn)` beside its control, `st.use` / `st.sel` /
|
|
420
423
|
`st.ref` keys — never a store class. `st.use.x({ agent: false })` hides a key; its model's `hidden` / `secret` /
|
|
421
424
|
`visual` fields are stripped at read. A tool value is capped at 20,000 characters. Route guidance is
|
|
@@ -78,6 +78,15 @@ body shape — this is the full contract behind them. Before changing route beha
|
|
|
78
78
|
- **A route guard is not authorization for data.** It keeps a person off a screen and redirects early; every query
|
|
79
79
|
the screen makes is still judged by that endpoint's own `guards`. Write both: the signal guard is the gate, the
|
|
80
80
|
route guard is the courtesy that answers before the screen draws.
|
|
81
|
+
- **Keeping a person on a page is `router.addNavigationGuard(guard)`, not `.guard()`.** `guard({ kind, from, to })`
|
|
82
|
+
is asked before every in-app move — `push`, `replace`, `back`, a `Link`, the browser's back and forward (`pop`), a
|
|
83
|
+
native back or swipe, the agent's `navigate` and `goBack` — with routes free of locale and basePath and `to: null`
|
|
84
|
+
for a `back`. `false`, a throw or a rejection keeps the page, `router.navigation()` rejects with
|
|
85
|
+
`NavigationRefused`, and a refused browser back is undone before the page redraws. Guards answer one at a time; a
|
|
86
|
+
move started while one decides is refused. In a component, register it with `useNavigationGuard(() => !isDirty)`
|
|
87
|
+
(`akanjs/webkit`), held only while its page is current: a page kept under the next for a swipe back stays mounted,
|
|
88
|
+
and a guard it kept would hold that page too. Redirects, `notFound()`, `setLang` and moves off the origin are not
|
|
89
|
+
asked; a closing tab is `beforeunload`'s.
|
|
81
90
|
|
|
82
91
|
## MCP Apps — `.app()`
|
|
83
92
|
|
|
@@ -72,6 +72,9 @@ this is the full contract behind them.
|
|
|
72
72
|
"there is at most one of these", not for claiming the next item off a queue. Pass a query that matches one row.
|
|
73
73
|
The query is a compare-and-set in every mode: of two concurrent `updateOne({ id, balance: { $gte: n } }, …)` that
|
|
74
74
|
both read the row as matching, only one applies, so `modifiedCount` is the verdict.
|
|
75
|
+
- **`{ touch: false }` leaves `updatedAt` as stored** on a query-level write: in the options of `updateOne` /
|
|
76
|
+
`updateMany` / `updateById`, or `.set(update, { touch: false })` on a filter chain. Bookkeeping that is no edit — a
|
|
77
|
+
lease heartbeat, a mirrored snapshot — otherwise moves the row in every `updatedAt` period and sort.
|
|
75
78
|
- **A filter may not be keyed after its own model.** Filter methods are assigned after CRUD, so a filter `chat` on
|
|
76
79
|
model `chat` would silently swap the single-document `removeChat`/`updateChat` for a hookless query-level one. It
|
|
77
80
|
throws at boot instead (`assertFilterFitsCrud`).
|
|
@@ -112,9 +115,18 @@ this is the full contract behind them.
|
|
|
112
115
|
document path**: they fire no hooks, so a model whose removal cascades or carries a `_postRemove` still goes
|
|
113
116
|
through `remove<Model>(id)`.
|
|
114
117
|
- The write-through pair is `pickAndWrite(id, data)` / `pickOneAndWrite(query, data)` — pick the document, write
|
|
115
|
-
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.
|
|
116
121
|
- `upsertById(data, { preserveTimestamps })` writes a record whole under its own id, new or in place, with no
|
|
117
122
|
hook: the write a sync or a backfill repeats safely, keeping the record's `createdAt`/`updatedAt` when asked.
|
|
123
|
+
- **Writes that must land together go in `this.transaction(async () => …)`**, which every service has: it commits
|
|
124
|
+
when the body resolves, returns its value, and rolls back when it throws, rethrowing that error unchanged. A
|
|
125
|
+
server has one database, so it covers every model, hooks and query-level writes included; a nested call joins the
|
|
126
|
+
outer one, with no savepoint. Cache, `memory` and outside calls are not in it — hand them to
|
|
127
|
+
`this.afterCommit(fn)`, run once the commit lands, never after a rollback, at once outside one; one that throws is
|
|
128
|
+
logged, never thrown, and the rest still run. On SQLite it holds the only write turn: keep it short.
|
|
129
|
+
`@Transaction()` is deprecated.
|
|
118
130
|
|
|
119
131
|
## Text Search In A Filter — `q.search()`
|
|
120
132
|
|
|
@@ -239,6 +239,10 @@ const config: AppConfig = { docker: "FROM oven/bun:1.4.4-slim\n…" }; // verbat
|
|
|
239
239
|
`RUN if [ "$TARGETARCH" = "<arch>" ]` guard, so a multi-arch build runs it on one leg only. `preRuns` land
|
|
240
240
|
before `bun install --production` (where a native dependency's build tools have to be), `postRuns` after it
|
|
241
241
|
and before the app files are copied.
|
|
242
|
+
- **The image installs the versions the workspace locked.** `akan build` writes a `bun.lock` beside the image's
|
|
243
|
+
`package.json`, cut down from the workspace's to what the server needs, and the image installs it
|
|
244
|
+
`--frozen-lockfile`. A workspace without a root `bun.lock` gets a warning and an unlocked install; a Dockerfile
|
|
245
|
+
written whole copies `bun.lock` itself.
|
|
242
246
|
- **A lib declares the steps its own runtime needs**, and every app that mounts it inherits them:
|
|
243
247
|
`libs/<lib>/akan.config.ts` takes `docker: { preRuns, postRuns }` and nothing else — the base image and the
|
|
244
248
|
command belong to the app. Lib steps are emitted before the app's own, and an identical step declared twice
|
|
@@ -513,6 +517,14 @@ The carried server asks the shell that showed the dialog over its IPC channel, s
|
|
|
513
517
|
and nothing else, and no page ever holds a path. Behind a dev build `akan start` checks the grant's signature
|
|
514
518
|
against a key in `~/.akan/native` instead, in `operationMode` local only; every other server refuses a grant.
|
|
515
519
|
|
|
520
|
+
**A secret the user gives the server is kept by the OS, never in a file.** `NativeSecret.set(key, value)`,
|
|
521
|
+
`get(key)` (null when none is kept) and `remove(key)` from `akanjs/server` reach the OS credential store through the
|
|
522
|
+
shell that carries the server — the macOS Keychain, the Windows Credential Manager, the Secret Service on Linux — in a
|
|
523
|
+
store of the server's own, apart from the page's `secretStorage`, so no page script reads it. Anywhere but a carried
|
|
524
|
+
server `NativeSecret.available` is false and every call rejects: keep secrets in the env there. On macOS without a
|
|
525
|
+
Team ID signature, any program of the same user can read the store's key through `security`, as with
|
|
526
|
+
`secretStorage`.
|
|
527
|
+
|
|
516
528
|
**Devices belong to the shell, not the server.** Displays and their changes (`screen`), windows placed on them
|
|
517
529
|
(`window`), the system volume and mute (`volume`), global shortcuts (`global-shortcut`), keep-awake (`keep-awake`)
|
|
518
530
|
and launch at login (`autostart`) are native runtime plugins, each added to `native.plugins`. Every builtin plugin's
|
|
@@ -250,7 +250,8 @@ query-level writes are in `queryRule`; these are the shapes that build green and
|
|
|
250
250
|
a `list<Filter>(...)` / `listBy...(...)` array. Returning an array type-checks but fails at runtime with
|
|
251
251
|
`Unknown document field path: 0`. (See Recipe 3.)
|
|
252
252
|
- **Custom endpoint names must not collide with generated CRUD.** `create/update/remove/view/edit/merge<Model>`
|
|
253
|
-
already exist. A collision
|
|
253
|
+
already exist wherever the slice mounts the verb. A collision builds green and the server refuses to boot
|
|
254
|
+
(`[DI:fetch]`) — pick a distinct verb.
|
|
254
255
|
- **Numbers are `Int` or `Float`, never `Number`.** `field(Number)` / `.body("x", Number)` fail to typecheck.
|
|
255
256
|
- **Array fields use `field([T])`** — `tags: field([String])`, `images: field([File])`.
|
|
256
257
|
- **Reading a secret field needs an explicit select, and the two call sites spell it differently.**
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
CodegenLock,
|
|
9
9
|
WorkspaceExecutor,
|
|
10
10
|
AppExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-1e2955yd.js";
|
|
12
12
|
import"./index-52w0fvh8.js";
|
|
13
13
|
import {
|
|
14
14
|
GraphClientEntryDiscovery,
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
DevChangePlanner,
|
|
20
20
|
DevGeneratedIndexSync,
|
|
21
21
|
SsrDevBundler
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-8jb5ep2e.js";
|
|
23
23
|
import {
|
|
24
24
|
ServerGraphFile
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-cz9g85xh.js";
|
|
26
26
|
import {
|
|
27
27
|
prepareDevWatchBatch
|
|
28
28
|
} from "./index-a5vmm6x4.js";
|
|
@@ -997,10 +997,10 @@ class AkanAppConfig {
|
|
|
997
997
|
...this.web.csr ? {} : { AKAN_CSR: "false" }
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
|
-
dockerfileFor(environment) {
|
|
1001
|
-
return this.#makeDockerfile(environment);
|
|
1000
|
+
dockerfileFor(environment, { lockfile = true } = {}) {
|
|
1001
|
+
return this.#makeDockerfile(environment, lockfile);
|
|
1002
1002
|
}
|
|
1003
|
-
#makeDockerfile(environment) {
|
|
1003
|
+
#makeDockerfile(environment, lockfile = true) {
|
|
1004
1004
|
if (typeof this.docker === "string")
|
|
1005
1005
|
return this.docker;
|
|
1006
1006
|
const { image, preRuns, postRuns, command } = this.docker;
|
|
@@ -1016,8 +1016,8 @@ ${preRunScripts.join(`
|
|
|
1016
1016
|
`)}
|
|
1017
1017
|
RUN mkdir -p /workspace
|
|
1018
1018
|
WORKDIR /workspace
|
|
1019
|
-
COPY ./package.json ./package.json
|
|
1020
|
-
RUN bun install --production
|
|
1019
|
+
${lockfile ? "COPY ./package.json ./bun.lock ./" : "COPY ./package.json ./package.json"}
|
|
1020
|
+
RUN bun install --production${lockfile ? " --frozen-lockfile" : ""}
|
|
1021
1021
|
${postRunScripts.join(`
|
|
1022
1022
|
`)}
|
|
1023
1023
|
COPY . .
|
|
@@ -1115,7 +1115,15 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
|
|
|
1115
1115
|
static get akanVersion() {
|
|
1116
1116
|
return getAkanPackageJson().version;
|
|
1117
1117
|
}
|
|
1118
|
+
static #registryPins(pins) {
|
|
1119
|
+
if (!pins)
|
|
1120
|
+
return;
|
|
1121
|
+
const kept = Object.entries(pins).filter(([, spec]) => !/^(?:file:|link:|workspace:|portal:|[./~])/.test(spec));
|
|
1122
|
+
return kept.length ? Object.fromEntries(kept) : undefined;
|
|
1123
|
+
}
|
|
1118
1124
|
getProductionPackageJson(data = {}) {
|
|
1125
|
+
const overrides = AkanAppConfig.#registryPins(this.rootPackageJson.overrides);
|
|
1126
|
+
const resolutions = AkanAppConfig.#registryPins(this.rootPackageJson.resolutions);
|
|
1119
1127
|
return {
|
|
1120
1128
|
name: this.app.name,
|
|
1121
1129
|
description: this.app.name,
|
|
@@ -1126,6 +1134,8 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
|
|
|
1126
1134
|
this.#resolveProductionDependencyVersion(lib)
|
|
1127
1135
|
])),
|
|
1128
1136
|
...this.trustedDependencies.length ? { trustedDependencies: this.trustedDependencies } : {},
|
|
1137
|
+
...overrides ? { overrides } : {},
|
|
1138
|
+
...resolutions ? { resolutions } : {},
|
|
1129
1139
|
...data
|
|
1130
1140
|
};
|
|
1131
1141
|
}
|
|
@@ -1853,15 +1863,17 @@ var emptyResult = (filePath) => ({
|
|
|
1853
1863
|
});
|
|
1854
1864
|
|
|
1855
1865
|
class Linter {
|
|
1856
|
-
static
|
|
1866
|
+
static biomeCommand(root) {
|
|
1867
|
+
const wrapper = path9.join(root, "node_modules", "@biomejs", "biome", "bin", "biome");
|
|
1868
|
+
return existsSync2(wrapper) ? [process.execPath, wrapper] : ["biome"];
|
|
1869
|
+
}
|
|
1857
1870
|
lintRoot;
|
|
1858
1871
|
configPath;
|
|
1859
|
-
#
|
|
1872
|
+
#biomeCommand;
|
|
1860
1873
|
constructor(cwdPath) {
|
|
1861
1874
|
this.lintRoot = this.#findBiomeRootPath(cwdPath);
|
|
1862
1875
|
this.configPath = Linter.#configPathIn(this.lintRoot) ?? path9.join(this.lintRoot, "biome.json");
|
|
1863
|
-
|
|
1864
|
-
this.#biomeBin = existsSync2(localBiomeBin) ? localBiomeBin : "biome";
|
|
1876
|
+
this.#biomeCommand = Linter.biomeCommand(this.lintRoot);
|
|
1865
1877
|
}
|
|
1866
1878
|
static #configPathIn(dir) {
|
|
1867
1879
|
for (const fileName of BIOME_CONFIG_FILES) {
|
|
@@ -1890,7 +1902,8 @@ class Linter {
|
|
|
1890
1902
|
}
|
|
1891
1903
|
async#runBiome(args, input) {
|
|
1892
1904
|
return await new Promise((resolve, reject) => {
|
|
1893
|
-
const
|
|
1905
|
+
const [command, ...prefixArgs] = this.#biomeCommand;
|
|
1906
|
+
const proc = spawn(command, [...prefixArgs, ...args], {
|
|
1894
1907
|
cwd: this.lintRoot,
|
|
1895
1908
|
stdio: ["pipe", "pipe", "pipe"]
|
|
1896
1909
|
});
|