@akanjs/cli 3.2.0-rc.2 → 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.
- package/.build-stamp +2 -1
- package/CodeAgent-faqv7t4g.js +11 -0
- package/{CodeTui-zyc7zaq6.js → CodeTui-vqck9tet.js} +822 -666
- package/README.ko.md +26 -1
- package/README.md +26 -1
- package/TunnelShare-bwe3ddv7.js +18 -0
- package/agent.command-p75jvgrd.js +56 -0
- package/akanCode.js +12 -12
- package/appExecutor-020cyesq.js +11 -0
- package/{application.command-vb278qnq.js → application.command-ta2knqxm.js} +72 -34
- package/{applicationBuildRunner-bqbyeg84.js → applicationBuildRunner-gkh82j2b.js} +18 -13
- package/buildBatch.proc.js +26 -11
- package/{cloud.command-ca777ee2.js → cloud.command-v3jhfvm5.js} +31 -28
- package/cloud.script-be9s1432.js +35 -0
- package/{code.command-j08txqcd.js → code.command-mh7dh1st.js} +14 -9
- package/{context.command-2fa6egp9.js → context.command-1ycfjkdd.js} +28 -23
- package/context.runner-333jkz86.js +34 -0
- package/{dependencyScanner-78sq8m4q.js → dependencyScanner-ge10gb52.js} +2 -2
- package/{devTui-w38ch13a.js → devTui-rf374y2w.js} +1 -1
- package/{fileSys-zpvt5gtf.js → fileSys-q22646yc.js} +1 -1
- package/{guideline.command-w6yqpdec.js → guideline.command-w1grfwh7.js} +9 -4
- package/guidelines/agentRule/agentRule.instruction.md +17 -5
- package/guidelines/akanApi/akanApi.instruction.md +3 -1
- package/guidelines/conventions/core.md +23 -5
- package/guidelines/conventions/rules/app.md +4 -1
- package/guidelines/conventions/rules/page.md +5 -0
- package/guidelines/errorCodes/errorCodes.instruction.md +158 -0
- package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
- package/guidelines/mcpRule/mcpRule.instruction.md +74 -2
- package/guidelines/pageRule/pageRule.instruction.md +11 -1
- package/guidelines/runtimeRule/runtimeRule.instruction.md +7 -2
- package/guidelines/transportRule/transportRule.instruction.md +8 -1
- package/incrementalBuilder.proc.js +574 -410
- package/{index-c5ymqb05.js → index-013n6z7m.js} +12 -12
- package/{index-w15mg3km.js → index-0dm25wvf.js} +1 -1
- package/{index-8nbx607g.js → index-0hj82f9w.js} +136 -48
- package/{index-ebwkh7bt.js → index-1c0mjc2b.js} +25 -7
- package/{index-6h775rv3.js → index-1jk52ffq.js} +53 -12
- package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
- package/{index-ygrdw6jw.js → index-1pjwsh2g.js} +65 -8
- package/{index-cbcwxp5v.js → index-22g3jq43.js} +9 -7
- package/{index-466z5931.js → index-2d9nm03s.js} +580 -364
- package/{index-0fj9ra3q.js → index-2k6mve6a.js} +18 -11
- package/{index-qd7xn2bk.js → index-2ny1e95c.js} +2 -2
- package/{index-j7p0jgaq.js → index-52w4jb87.js} +6 -6
- package/{index-e22zedc2.js → index-5h888r6j.js} +3 -3
- package/{index-7kmbqp0b.js → index-6pxmcaq8.js} +1 -1
- package/{index-xa0289eg.js → index-6zb17wcm.js} +16 -9
- package/{index-qgazn58x.js → index-7a07tdap.js} +50 -38
- package/{index-m5sg5spm.js → index-7ehdht84.js} +565 -187
- package/{index-y725zb1a.js → index-7v7tvgt7.js} +196 -168
- package/{index-pq5rjkch.js → index-88s746ns.js} +7 -2
- package/{index-r0a604h4.js → index-99kjwyma.js} +1 -1
- package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
- package/{index-386canwe.js → index-9rv2zt48.js} +186 -121
- package/{index-wr9magsr.js → index-9zswcze5.js} +3 -3
- package/{index-xq97me1h.js → index-a41vv4cy.js} +811 -697
- package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
- package/{index-bdmgqzb5.js → index-bket1068.js} +58 -29
- package/{index-bns3wcpc.js → index-by2tvsq6.js} +1 -1
- package/{index-1cb9apzn.js → index-czf94w8c.js} +2 -2
- package/{index-65b6ms4c.js → index-d3178asw.js} +15 -11
- package/index-dss3ds74.js +127 -0
- package/{index-annxfpgz.js → index-eyfty8kk.js} +9 -9
- package/{index-ny2k80mv.js → index-ffa52fwf.js} +1 -1
- package/{index-8jpc5fqv.js → index-g7jgd4xs.js} +2 -2
- package/{index-abfbf01s.js → index-gwsesvqc.js} +2 -2
- package/{index-kcpk2d20.js → index-h1w4wqgd.js} +1474 -1139
- package/{index-j1hjb477.js → index-hp2c7xc2.js} +1 -1
- package/index-j4yvgfhr.js +70 -0
- package/{index-84c2pgak.js → index-jx2jcw1r.js} +89 -78
- package/{index-j6eeh5d7.js → index-knpm8sdm.js} +5 -5
- package/{index-2gees180.js → index-mpp4aas6.js} +62 -33
- package/index-na8r4a27.js +30 -0
- package/{index-0mqga3h9.js → index-nmxszh6x.js} +525 -440
- package/{index-35j83zkd.js → index-p5zh7pmc.js} +2 -2
- package/{index-20wvskt8.js → index-pt0agdck.js} +1 -1
- package/{index-htxck0pn.js → index-q444k260.js} +15 -10
- package/{index-wfmpxke3.js → index-qssq2d41.js} +2775 -3677
- package/{index-23860fej.js → index-rwgqba9p.js} +24 -9
- package/{index-v50xjbbe.js → index-t4d0ckde.js} +1 -1
- package/index-va90m8nd.js +25 -0
- package/index-vjbne22r.js +80 -0
- package/{index-djc5nxpy.js → index-w23tf30e.js} +6 -6
- package/{index-mvwvxgtd.js → index-wa01phm9.js} +289 -210
- package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
- package/{index-vbhx60x5.js → index-xwe7y0gf.js} +2140 -2165
- package/index-ze48c0vd.js +788 -0
- package/{index-dk4g0x0d.js → index-zttyg7tg.js} +27 -16
- package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
- package/index.js +29 -24
- package/libExecutor-tq994592.js +10 -0
- package/{library.command-8d03a0pq.js → library.command-x219mhcx.js} +9 -4
- package/{localRegistry.command-vyv5k6t0.js → localRegistry.command-4p17wa9t.js} +30 -24
- package/{module.command-vy3kg965.js → module.command-tjthnvvr.js} +17 -8
- package/{package.command-qjh13rs9.js → package.command-c6df2hxx.js} +13 -8
- package/package.json +2 -2
- package/{page.command-t0nx1jat.js → page.command-gf06paq2.js} +9 -4
- package/{pipeline.command-2yjeas7m.js → pipeline.command-y07dgj9b.js} +14 -8
- package/pkgExecutor-stde3yc3.js +10 -0
- package/{primitive.command-8vm49279.js → primitive.command-0enfygxn.js} +13 -8
- package/{projectTypecheck-s9hhe5sa.js → projectTypecheck-mk8wefvd.js} +2 -1
- package/{prompter-qrwx1p17.js → prompter-qyggfhqd.js} +2 -2
- package/{quality.command-v76fev72.js → quality.command-dkbdztad.js} +23 -16
- package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
- package/{repair.command-fp4m3w03.js → repair.command-g5vd95ax.js} +13 -8
- package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
- package/{scalar.command-hxe6try8.js → scalar.command-7909pg0d.js} +11 -6
- package/skills/akan-debug/SKILL.md +10 -3
- package/skills/akan-err/SKILL.md +7 -0
- package/skills/akan-mcp/SKILL.md +10 -1
- package/skills/akan-scaffold/SKILL.md +2 -2
- package/skills/akan-transport/SKILL.md +2 -0
- package/skills/akan-validate/SKILL.md +1 -0
- package/{subspace.command-q42n1844.js → subspace.command-at4jt1fb.js} +29 -23
- package/templates/biomeForm.ts +1 -1
- package/templates/env/_env.server.type.ts +1 -1
- package/templates/facetIndex/index.ts +2 -37
- package/templates/lib/sig.ts +0 -4
- package/templates/lib/useClient.ts +1 -1
- package/templates/workspaceRoot/AGENTS.md.template +2 -1
- package/{tunnel.command-22g11n0x.js → tunnel.command-91h92dwr.js} +17 -12
- package/{typeChecker-s640r6c0.js → typeChecker-bfrd1n9n.js} +1 -1
- package/typecheck.proc.js +6 -3
- package/{verify.command-rx43bha1.js → verify.command-pzky05ts.js} +26 -20
- package/{workflow.command-yg0d8mmq.js → workflow.command-mqqe4n12.js} +37 -19
- package/{workspace.command-fcfztvn5.js → workspace.command-y4rznvhx.js} +64 -53
- package/CodeAgent-6cpjtj25.js +0 -11
- package/TunnelShare-zkfkrw8w.js +0 -14
- package/agent.command-kf1g3nh4.js +0 -51
- package/cloud.script-agpxzq6j.js +0 -30
- package/context.runner-ftv8373t.js +0 -29
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Sys,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
5
|
+
} from "./index-9rv2zt48.js";
|
|
6
|
+
import"./index-j4yvgfhr.js";
|
|
7
|
+
import"./index-qssq2d41.js";
|
|
8
|
+
import"./index-by2tvsq6.js";
|
|
9
|
+
import"./index-ze48c0vd.js";
|
|
10
|
+
import"./index-na8r4a27.js";
|
|
11
|
+
import"./index-dss3ds74.js";
|
|
8
12
|
import {
|
|
9
13
|
renderPrimitiveReport
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
14
|
+
} from "./index-a41vv4cy.js";
|
|
15
|
+
import"./index-7ehdht84.js";
|
|
12
16
|
import {
|
|
13
17
|
ScalarScript
|
|
14
|
-
} from "./index-
|
|
18
|
+
} from "./index-88s746ns.js";
|
|
19
|
+
import"./index-vjbne22r.js";
|
|
15
20
|
|
|
16
21
|
// pkgs/@akanjs/cli/scalar/scalar.command.ts
|
|
17
22
|
import { Logger, lowerlize } from "akanjs/common";
|
|
@@ -9,14 +9,21 @@ description: "Check and debug a running Akan app: akan preview for what a page s
|
|
|
9
9
|
|
|
10
10
|
`akan preview <app> [paths]` opens pages of the app's dev server in a headless browser and prints, per page,
|
|
11
11
|
the HTTP status, the title, a slice of the visible text, the uncaught errors and rejections the page reported,
|
|
12
|
-
the server errors logged meanwhile, console errors and warnings, and layout smells. It exits
|
|
12
|
+
the server errors logged meanwhile, console errors and warnings, and layout smells. It exits 3 when a page failed.
|
|
13
13
|
|
|
14
14
|
- It uses the dev server that answers for this app and checkout. With none, it starts one for the run and
|
|
15
15
|
stops it after; `--keep` leaves it up for the next preview. It never starts a second server beside a
|
|
16
16
|
running one.
|
|
17
17
|
- Paths are comma-separated (`akan preview <app> /board,/board/new`) and get the default locale when they lack
|
|
18
|
-
one, unless the app sets `localePrefix: "as-needed"` and `--csr` is off.
|
|
19
|
-
|
|
18
|
+
one, unless the app sets `localePrefix: "as-needed"` and `--csr` is off. What the server answers outside a
|
|
19
|
+
locale opens as written, with no locale and no CSR boot query: a `/_akan` route such as Studio
|
|
20
|
+
(`/_akan/studio?view=runtime`), a route under the API prefix, `/__csr`, `/__rsc`, `/.well-known`,
|
|
21
|
+
`/openapi.json`, `/mcp`, `/favicon.ico`, `/robots.txt`, `/sitemap.xml`, `manifest.webmanifest` and a file in
|
|
22
|
+
the app's `public/`; `--csr` prints a note naming them. `/mcp` answers only `POST`, so preview cannot check it
|
|
23
|
+
(it fails with 405); the `akan-mcp` exposure test does. A full URL (`http://localhost:<port>/oauth/token`)
|
|
24
|
+
opens its path and query the same way, always on the app's dev server, with a note when it names another
|
|
25
|
+
server: use it for an endpoint mounted outside the API prefix. A page `--changed` finds opens as a page even at
|
|
26
|
+
a server route's path, under the same locale rule, and `/en` and `/en/` open once.
|
|
20
27
|
`--changed` adds the pages your uncommitted page and layout edits reach. A dynamic route needs a concrete
|
|
21
28
|
path (`/memo/1`); `akan context --app <app>` lists every route with its params and search names.
|
|
22
29
|
- The viewport is a 390x844 phone; `--desktop` is 1280x800. `--csr` loads each page in the CSR boot the native
|
package/skills/akan-err/SKILL.md
CHANGED
|
@@ -15,6 +15,8 @@ This is the common failure. Import `Err` from the source matching the **runtime
|
|
|
15
15
|
- server code: `import { Err } from "../dict"`
|
|
16
16
|
- UI: `from "@libs/<lib>/client"` or `from "@apps/<app>/client"`
|
|
17
17
|
|
|
18
|
+
Never `from "akanjs/common"` (`no-import-common-err.grit`): that `Err` takes any string, so a mistyped key compiles.
|
|
19
|
+
|
|
18
20
|
## Where the rule does not apply
|
|
19
21
|
|
|
20
22
|
The lint rule exempts tests, `*.constant.ts`, `common/**`, and `env/**`. The last two have **no legal `Err`
|
|
@@ -38,3 +40,8 @@ discards what the endpoint chose to say, and a bare `Error` is generalized to "I
|
|
|
38
40
|
way out.
|
|
39
41
|
|
|
40
42
|
Korean `.error()` messages end in `다.`.
|
|
43
|
+
|
|
44
|
+
**The framework's own failures carry a code.** A `NoDocumentError`, an `Exception` status class or another
|
|
45
|
+
`AkanError` names its kind in `code`; branch on that with `AkanError.is(error, "<code>")`, never on its message.
|
|
46
|
+
|
|
47
|
+
Every code, its status and whether the caller's JSON carries it: `get_guideline` with `errorCodes`.
|
package/skills/akan-mcp/SKILL.md
CHANGED
|
@@ -23,7 +23,8 @@ an endpoint with a real guard is published, one with none is refused, and so is
|
|
|
23
23
|
- `option.setMcp({ … })` in the app's `lib/option.ts`, never `main.ts`; `AKAN_MCP=false` takes the surface off.
|
|
24
24
|
- `JWT_SECRET` is required outside `local`.
|
|
25
25
|
- Every published entry needs a `.desc()`; model-facing text is English.
|
|
26
|
-
- Never make a refusal message more helpful.
|
|
26
|
+
- Never make a refusal message more helpful. A client branches on the code a failure carries
|
|
27
|
+
(`_meta["akanjs/failure"]`, or a JSON-RPC error's `data.code`), never on its text.
|
|
27
28
|
|
|
28
29
|
## Pages for the host
|
|
29
30
|
|
|
@@ -31,6 +32,14 @@ an endpoint with a real guard is published, one with none is refused, and so is
|
|
|
31
32
|
- `page().app(name, description, load)` publishes one component a host draws in the chat, as a read-only tool
|
|
32
33
|
whose `load` may only query.
|
|
33
34
|
|
|
35
|
+
## Calling it from the server
|
|
36
|
+
|
|
37
|
+
- `plug(AgentToolsRole)` gives a service `listAs(account, { allow })` / `callAs(account, call)`: the same catalogue
|
|
38
|
+
and refusals in-process, batch servers included. Pass only an account the server resolved, never client input.
|
|
39
|
+
- `this.agentService.loop({ account | principal, allow, messages, approve, untrusted, onMessage, meta, budget })`
|
|
40
|
+
runs a model over those tools until it answers; `option.setAgentAccountResolver` resolves a stored `principal`
|
|
41
|
+
before every round. Each round is metered as its own turn with `turn.loop` and `turn.meta`.
|
|
42
|
+
|
|
34
43
|
## Verify
|
|
35
44
|
|
|
36
45
|
- One exposure test per app in `srvkit/mcpExposure.signal.test.ts`: list the tools with a user token, pin the names
|
|
@@ -16,7 +16,7 @@ Everything else is pages, sections, and props.
|
|
|
16
16
|
- A page or section whose content you can write as static JSX or props is not an entity. "A self-intro page
|
|
17
17
|
with two detail pages" is pages only — no `profile` module.
|
|
18
18
|
- Never invent a supporting entity (profile, category, tag, author, like) to round out a design. If one looks
|
|
19
|
-
genuinely necessary, say
|
|
19
|
+
genuinely necessary, build the request without it and say in your reply why it may be needed; the user decides.
|
|
20
20
|
- "… plus a comment zone that saves to a database" is exactly one new module: `comment`.
|
|
21
21
|
- Check what exists first (`list_modules`) and extend it when it already fits — `add-field` / `add-slice` /
|
|
22
22
|
`create-ui` beat a whole new module.
|
|
@@ -44,7 +44,7 @@ an apply that failed, names none: do what the diagnostic says, then plan again.
|
|
|
44
44
|
Returns `planPath` and `next.tool=apply_workflow`. (`list_workflows` / `explain_workflow` give the names
|
|
45
45
|
and each workflow's inputs.)
|
|
46
46
|
2. `apply_workflow({ planPath })` — writes the scaffold and syncs the generated barrels. Returns
|
|
47
|
-
`validationTarget`.
|
|
47
|
+
`validationTarget`. With `dryRun: true` it writes nothing and names this apply next.
|
|
48
48
|
3. `run_validation({ runIdOrPlan: <validationTarget> })`, or run `akan verify` (`akan_verify` in akan code);
|
|
49
49
|
both are the whole chain in one process.
|
|
50
50
|
4. **Read each scaffolded file before editing it.** They are a few lines each and they extend base classes
|
|
@@ -27,6 +27,8 @@ description: "Guard and tune endpoints on the wire: writing a Can<Verb><Model> g
|
|
|
27
27
|
- `{ rateLimit: { calls, windowMs?, by? } }` per endpoint, `option.setRateLimit` per app, `plug(RateLimit)` for a
|
|
28
28
|
business key.
|
|
29
29
|
- A mutation repeated under one `Idempotency-Key` header runs once and replays its first answer.
|
|
30
|
+
- A browser send that changes nothing read back (typing status, a cursor move) passes `{ keepsReads: true }`, so it
|
|
31
|
+
neither ends in-flight query sharing nor drops prefetched pages.
|
|
30
32
|
- `{ method: "PATCH" | "PUT" | "DELETE" }` moves a mutation off `POST` — only when a foreign protocol forces it.
|
|
31
33
|
- `errors: { 409: ["ticket.error.locked"] }` names the errors an endpoint throws on purpose.
|
|
32
34
|
|
|
@@ -20,6 +20,7 @@ three times the output. Narrow the one command instead:
|
|
|
20
20
|
- `akan verify --no-build` — leave the app build out.
|
|
21
21
|
- `akan verify --max 0` — every line, when the report ends in `+N more`.
|
|
22
22
|
- `fixed N files` in the header means lint rewrote them on disk: re-read before editing them again.
|
|
23
|
+
- It exits 3 when it found problems, 2 for a target the workspace does not have, 1 when the run itself broke.
|
|
23
24
|
|
|
24
25
|
Raw `tsc` misses the generated barrels and reports false errors. Do not reach for it.
|
|
25
26
|
|
|
@@ -5,36 +5,42 @@ import {
|
|
|
5
5
|
runner,
|
|
6
6
|
script,
|
|
7
7
|
command
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-9rv2zt48.js";
|
|
9
|
+
import"./index-j4yvgfhr.js";
|
|
10
|
+
import {
|
|
11
|
+
Executor,
|
|
12
|
+
LibSource,
|
|
13
|
+
WorkspaceExecutor
|
|
14
|
+
} from "./index-qssq2d41.js";
|
|
9
15
|
import {
|
|
10
16
|
FileSys2
|
|
11
|
-
} from "./index-
|
|
17
|
+
} from "./index-by2tvsq6.js";
|
|
12
18
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./index-wfmpxke3.js";
|
|
19
|
+
AppExecutor2
|
|
20
|
+
} from "./index-ze48c0vd.js";
|
|
21
|
+
import"./index-na8r4a27.js";
|
|
22
|
+
import"./index-dss3ds74.js";
|
|
18
23
|
import {
|
|
19
24
|
GlobalConfig
|
|
20
|
-
} from "./index-
|
|
25
|
+
} from "./index-5h888r6j.js";
|
|
21
26
|
import"./index-m9jj544v.js";
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
27
|
+
import"./index-w23tf30e.js";
|
|
28
|
+
import"./index-jx2jcw1r.js";
|
|
29
|
+
import"./index-9zswcze5.js";
|
|
25
30
|
import {
|
|
26
31
|
SubspaceConfig
|
|
27
|
-
} from "./index-
|
|
32
|
+
} from "./index-xczjdng6.js";
|
|
28
33
|
import {
|
|
29
34
|
SlicePlanner
|
|
30
|
-
} from "./index-
|
|
35
|
+
} from "./index-g7jgd4xs.js";
|
|
36
|
+
import"./index-vjbne22r.js";
|
|
31
37
|
|
|
32
|
-
// pkgs/@akanjs/devkit/subspace.ts
|
|
38
|
+
// pkgs/@akanjs/devkit/subspace/subspace.ts
|
|
33
39
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
34
40
|
import path2 from "path";
|
|
35
41
|
import { toError as toError2 } from "akanjs/common";
|
|
36
42
|
|
|
37
|
-
// pkgs/@akanjs/devkit/subspaceClone.ts
|
|
43
|
+
// pkgs/@akanjs/devkit/subspace/subspaceClone.ts
|
|
38
44
|
import { mkdir, readdir, rename, rm } from "fs/promises";
|
|
39
45
|
import path from "path";
|
|
40
46
|
import { toError } from "akanjs/common";
|
|
@@ -73,9 +79,9 @@ class SubspaceClone {
|
|
|
73
79
|
if (!await FileSys2.dirExists(path.join(this.#clonePath, ".git"))) {
|
|
74
80
|
await rm(this.#clonePath, { recursive: true, force: true });
|
|
75
81
|
await mkdir(path.dirname(this.#clonePath), { recursive: true });
|
|
76
|
-
await this.#workspace.spawn("git", ["clone", "--quiet", this.#declaration.repo, this.#clonePath]);
|
|
82
|
+
await this.#workspace.spawn("git", ["clone", "--quiet", "--", this.#declaration.repo, this.#clonePath]);
|
|
77
83
|
}
|
|
78
|
-
await this.#clone.spawn("git", ["fetch", "--quiet", "origin", branch]);
|
|
84
|
+
await this.#clone.spawn("git", ["fetch", "--quiet", "--", "origin", branch]);
|
|
79
85
|
await this.#clone.spawn("git", ["checkout", "--quiet", "-f", "-B", branch, `origin/${branch}`]);
|
|
80
86
|
await this.#clone.spawn("git", ["clean", "-qfd"]);
|
|
81
87
|
}
|
|
@@ -124,7 +130,7 @@ class SubspaceClone {
|
|
|
124
130
|
await this.#clone.spawn("git", ["add", "-A"]);
|
|
125
131
|
const message = `${SubspaceClone.syncSubjectPrefix}${this.#workspace.repoName}@${sha}`;
|
|
126
132
|
await this.#clone.spawn("git", ["commit", "--quiet", "-m", message]);
|
|
127
|
-
await this.#clone.spawn("git", ["push", "--quiet", "origin", branch]);
|
|
133
|
+
await this.#clone.spawn("git", ["push", "--quiet", "--", "origin", branch]);
|
|
128
134
|
return (await this.#clone.spawn("git", ["rev-parse", "--short", "HEAD"])).trim();
|
|
129
135
|
}
|
|
130
136
|
async#writeAnchorFile(branch, sha) {
|
|
@@ -329,7 +335,7 @@ class SubspaceClone {
|
|
|
329
335
|
}
|
|
330
336
|
}
|
|
331
337
|
|
|
332
|
-
// pkgs/@akanjs/devkit/subspace.ts
|
|
338
|
+
// pkgs/@akanjs/devkit/subspace/subspace.ts
|
|
333
339
|
class Subspace {
|
|
334
340
|
static retiredConfigFile = "akan.subspace.ts";
|
|
335
341
|
static #retiredConfigRefusal = `${Subspace.retiredConfigFile} is no longer read: move it under \`subspace\` in akan.config.ts and delete it`;
|
|
@@ -371,7 +377,7 @@ class Subspace {
|
|
|
371
377
|
else
|
|
372
378
|
await this.#git(["remote", "add", this.#remote, this.#declaration.repo]);
|
|
373
379
|
try {
|
|
374
|
-
await this.#git(["fetch", "--quiet", this.#remote, branch]);
|
|
380
|
+
await this.#git(["fetch", "--quiet", "--", this.#remote, branch]);
|
|
375
381
|
return true;
|
|
376
382
|
} catch {
|
|
377
383
|
return false;
|
|
@@ -391,7 +397,7 @@ class Subspace {
|
|
|
391
397
|
return { commit, incoming };
|
|
392
398
|
}
|
|
393
399
|
async slice() {
|
|
394
|
-
const plans = await Promise.all(this.#declaration.apps.map(async (appName) => await new SlicePlanner(
|
|
400
|
+
const plans = await Promise.all(this.#declaration.apps.map(async (appName) => await new SlicePlanner(AppExecutor2.from(this.#workspace, appName)).plan()));
|
|
395
401
|
const libs = [...new Set(plans.flatMap((plan) => plan.libs))].sort();
|
|
396
402
|
const paths = [...this.#declaration.apps.map((app) => `apps/${app}`), ...libs.map((lib) => `libs/${lib}`)];
|
|
397
403
|
return { plans, libs, paths };
|
|
@@ -584,7 +590,7 @@ class Subspace {
|
|
|
584
590
|
}
|
|
585
591
|
}
|
|
586
592
|
|
|
587
|
-
// pkgs/@akanjs/devkit/subspaceReport.ts
|
|
593
|
+
// pkgs/@akanjs/devkit/subspace/subspaceReport.ts
|
|
588
594
|
class SubspaceReport {
|
|
589
595
|
static statuses(statuses) {
|
|
590
596
|
const sections = [
|
|
@@ -818,7 +824,7 @@ class SubspaceRunner extends runner("subspace") {
|
|
|
818
824
|
if (!asked)
|
|
819
825
|
return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
|
|
820
826
|
const { libs } = await subspace.slice();
|
|
821
|
-
const { CloudScript } = await import("./cloud.script-
|
|
827
|
+
const { CloudScript } = await import("./cloud.script-be9s1432.js");
|
|
822
828
|
const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
|
|
823
829
|
host,
|
|
824
830
|
workspaceId,
|
package/templates/biomeForm.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
|
-
import { compareExportNames } from "
|
|
2
|
+
import { compareExportNames } from "akanjs/common";
|
|
3
3
|
|
|
4
4
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [key: string]: string } = {}) {
|
|
5
5
|
if (!scanInfo) return null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SysExecutor } from "@akanjs/devkit/executors";
|
|
2
2
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
3
|
+
import { facetBarrelOf } from "akanjs/common";
|
|
3
4
|
|
|
4
5
|
interface Dict {
|
|
5
6
|
[key: string]: string;
|
|
@@ -10,47 +11,11 @@ interface Options {
|
|
|
10
11
|
facet?: string;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
const sourceFilePattern = /\.(ts|tsx)$/;
|
|
14
|
-
const excludedFilePattern = /(^index\.tsx?$|\.d\.ts$|\.(test|spec)\.(ts|tsx)$|\.css$|\.scss$|\.sass$)/;
|
|
15
|
-
// `ui` exports PascalCase names only; `common`/`srvkit`/`webkit` export camelCase names only. Names with
|
|
16
|
-
// dots, underscores, or hyphens (e.g. `foo.helper`, `Globe_Dynamic`, `kebab-case`) match neither and are skipped.
|
|
17
|
-
const pascalCasePattern = /^[A-Z][A-Za-z0-9]*$/;
|
|
18
|
-
const camelCasePattern = /^[a-z][A-Za-z0-9]*$/;
|
|
19
|
-
const nameCasePatternForFacet = (facet: string) => (facet === "ui" ? pascalCasePattern : camelCasePattern);
|
|
20
|
-
//? Biome's organizeImports order, or `akan lint` reorders the barrel: A < a < B < b, a digit before a letter, and a
|
|
21
|
-
//? run of digits compared by its length first. DevGeneratedIndexSync sorts the same way; the env template imports it.
|
|
22
|
-
const letterRankOf = (char: string) => char.toLowerCase().charCodeAt(0) * 2 + (char === char.toLowerCase() ? 1 : 0);
|
|
23
|
-
const digitRunAt = (name: string, idx: number) => /^\d+/.exec(name.slice(idx))?.[0] ?? "";
|
|
24
|
-
export const compareExportNames = (a: string, b: string) => {
|
|
25
|
-
for (let idx = 0; idx < a.length && idx < b.length; ) {
|
|
26
|
-
const [runA, runB] = [digitRunAt(a, idx), digitRunAt(b, idx)];
|
|
27
|
-
if (runA && runB && runA !== runB) return runA.length - runB.length || (runA < runB ? -1 : 1);
|
|
28
|
-
if (runA && runB) idx += runA.length;
|
|
29
|
-
else if (runA || runB) return runA ? -1 : 1;
|
|
30
|
-
else if (a.charAt(idx) !== b.charAt(idx)) return letterRankOf(a.charAt(idx)) - letterRankOf(b.charAt(idx));
|
|
31
|
-
else idx++;
|
|
32
|
-
}
|
|
33
|
-
return a.length - b.length;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
14
|
export default async function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}, options: Options = {}) {
|
|
37
15
|
const { exec, facet } = options;
|
|
38
16
|
if (!exec || !facet || !(await exec.exists(facet))) return null;
|
|
39
17
|
|
|
40
|
-
const nameCasePattern = nameCasePatternForFacet(facet);
|
|
41
18
|
const { files, dirs } = await exec.getFilesAndDirs(facet);
|
|
42
|
-
const
|
|
43
|
-
...files
|
|
44
|
-
.filter((filename) => sourceFilePattern.test(filename) && !excludedFilePattern.test(filename))
|
|
45
|
-
.map((filename) => filename.replace(sourceFilePattern, "")),
|
|
46
|
-
...dirs.filter((dirname) => !dirname.startsWith(".")),
|
|
47
|
-
]
|
|
48
|
-
.filter((name) => nameCasePattern.test(name))
|
|
49
|
-
.sort(compareExportNames);
|
|
50
|
-
|
|
51
|
-
//? Not null: a null result writes nothing, so a barrel still exporting a deleted file would outlive the file.
|
|
52
|
-
const content = exportNames.length
|
|
53
|
-
? `${exportNames.map((name) => `export * from "./${name}";`).join("\n")}\n`
|
|
54
|
-
: "export {};\n";
|
|
19
|
+
const content = facetBarrelOf(facet, files, dirs);
|
|
55
20
|
return { filename: "index.ts", content };
|
|
56
21
|
}
|
package/templates/lib/sig.ts
CHANGED
|
@@ -19,7 +19,6 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
|
|
|
19
19
|
return `
|
|
20
20
|
import { FetchClient, type FetchClientType } from "akanjs/fetch";
|
|
21
21
|
import { SignalRegistry, serverSignal${libs.length === 0 ? ", fetch as base" : ""} } from "akanjs/signal";
|
|
22
|
-
import { Err } from "./dict";
|
|
23
22
|
${libs.map((lib) => `import { fetch as ${lib} } from "@libs/${lib}/lib/sig";`).join("\n")}
|
|
24
23
|
|
|
25
24
|
${databaseModules.map((module) => `import * as ${module}Sig from "./${module}/${module}.signal";`).join("\n")}
|
|
@@ -37,9 +36,6 @@ ${serviceModules.map((module) => `export const ${module} = SignalRegistry.regist
|
|
|
37
36
|
export const fetchSignals = [${signalNames.join(", ")}] as const;
|
|
38
37
|
export type Fetch = FetchClientType<typeof fetchSignals>;
|
|
39
38
|
export const fetch = FetchClient.from(...fetchSignals) as unknown as Fetch;
|
|
40
|
-
// A failure restored from another process is this scope's own Err, so a server hop that rethrows one keeps its
|
|
41
|
-
// dictionary key and data instead of answering the original caller with Internal Server Error.
|
|
42
|
-
fetch.setErrorConstructor(Err);
|
|
43
39
|
|
|
44
40
|
export const getSerializedSignal = () => fetch.ownSerializedSignal
|
|
45
41
|
`;
|
|
@@ -18,7 +18,7 @@ ${
|
|
|
18
18
|
const dictionary = {};`
|
|
19
19
|
}
|
|
20
20
|
const pageProto = makePageProto<typeof dict>(dictionary);
|
|
21
|
-
const fetchProto = FetchClient.build<typeof signal>(cnst, getSerializedSignal()
|
|
21
|
+
const fetchProto = FetchClient.build<typeof signal>(cnst, getSerializedSignal());
|
|
22
22
|
export const runtime = registerClientRuntime({ ...pageProto, ...fetchProto }, { scope: ${JSON.stringify(scanInfo?.type ?? "lib")} });
|
|
23
23
|
|
|
24
24
|
export const { msg, Err, usePage, sig, fetch } = runtime;
|
|
@@ -7,7 +7,8 @@ the framework generate the repeated surfaces.
|
|
|
7
7
|
|
|
8
8
|
If you hit an Akan.js bug, or a fix that one framework change would solve more easily than app-level workarounds,
|
|
9
9
|
draft a GitHub issue for <https://github.com/akan-team/akanjs/issues> (version, repro, expected vs actual) and ask
|
|
10
|
-
the user before filing it.
|
|
10
|
+
the user before filing it, since an issue is public. Meanwhile finish the task with a small interim workaround marked
|
|
11
|
+
`// TODO: <issue url>`.
|
|
11
12
|
|
|
12
13
|
## Generated Context
|
|
13
14
|
|
|
@@ -4,25 +4,30 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-9rv2zt48.js";
|
|
8
|
+
import"./index-j4yvgfhr.js";
|
|
9
|
+
import"./index-qssq2d41.js";
|
|
10
|
+
import"./index-by2tvsq6.js";
|
|
9
11
|
import {
|
|
10
|
-
|
|
11
|
-
} from "./index-
|
|
12
|
+
AppExecutor2
|
|
13
|
+
} from "./index-ze48c0vd.js";
|
|
14
|
+
import"./index-na8r4a27.js";
|
|
15
|
+
import"./index-dss3ds74.js";
|
|
12
16
|
import {
|
|
13
17
|
GlobalConfig,
|
|
14
18
|
CloudApi
|
|
15
|
-
} from "./index-
|
|
19
|
+
} from "./index-5h888r6j.js";
|
|
16
20
|
import"./index-m9jj544v.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
21
|
+
import"./index-w23tf30e.js";
|
|
22
|
+
import"./index-jx2jcw1r.js";
|
|
23
|
+
import"./index-9zswcze5.js";
|
|
20
24
|
import {
|
|
21
25
|
TunnelShare2
|
|
22
|
-
} from "./index-
|
|
26
|
+
} from "./index-hp2c7xc2.js";
|
|
23
27
|
import {
|
|
24
28
|
writeClipboard
|
|
25
29
|
} from "./index-p6pbz9n5.js";
|
|
30
|
+
import"./index-vjbne22r.js";
|
|
26
31
|
|
|
27
32
|
// pkgs/@akanjs/cli/tunnel/tunnel.script.ts
|
|
28
33
|
import { select } from "@inquirer/prompts";
|
|
@@ -95,11 +100,11 @@ class TunnelScript extends script("tunnel", [TunnelRunner]) {
|
|
|
95
100
|
if (name && !appNames.includes(name))
|
|
96
101
|
throw new Error(`Unknown app: ${name}. Available: ${appNames.join(", ")}`);
|
|
97
102
|
if (name)
|
|
98
|
-
return
|
|
103
|
+
return AppExecutor2.from(workspace, name);
|
|
99
104
|
const only = appNames.length === 1 ? appNames[0] : null;
|
|
100
105
|
if (only)
|
|
101
|
-
return
|
|
102
|
-
return
|
|
106
|
+
return AppExecutor2.from(workspace, only);
|
|
107
|
+
return AppExecutor2.from(workspace, await select({ message: "Select the app to share", choices: appNames }));
|
|
103
108
|
}
|
|
104
109
|
async share(name, { workspace, host, port, ttl, devRoutes }) {
|
|
105
110
|
const app = await TunnelScript.resolveApp(workspace, name);
|
package/typecheck.proc.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
TypeChecker2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-99kjwyma.js";
|
|
5
|
+
import {
|
|
6
|
+
TypecheckFailure
|
|
7
|
+
} from "./index-j4yvgfhr.js";
|
|
5
8
|
|
|
6
9
|
// pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts
|
|
7
10
|
import { Logger } from "akanjs/common";
|
|
@@ -29,11 +32,11 @@ try {
|
|
|
29
32
|
if (process.env.AKAN_TYPECHECK_FORMAT === "json") {
|
|
30
33
|
const root = process.env.AKAN_TYPECHECK_ROOT ?? process.cwd();
|
|
31
34
|
process.stdout.write(JSON.stringify(TypeChecker2.toRecords(result.errors, root)));
|
|
32
|
-
process.exit(result.errors.length > 0 ?
|
|
35
|
+
process.exit(result.errors.length > 0 ? TypecheckFailure.workerExitCode : 0);
|
|
33
36
|
}
|
|
34
37
|
if (result.errors.length > 0) {
|
|
35
38
|
console.error(result.message);
|
|
36
|
-
process.exit(
|
|
39
|
+
process.exit(TypecheckFailure.workerExitCode);
|
|
37
40
|
}
|
|
38
41
|
} catch (error) {
|
|
39
42
|
console.error(error instanceof Error ? error.message : String(error));
|
|
@@ -2,37 +2,43 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
script,
|
|
5
|
-
ExitCodeError,
|
|
6
5
|
markCliErrorPrinted,
|
|
7
6
|
command
|
|
8
|
-
} from "./index-
|
|
9
|
-
import
|
|
10
|
-
|
|
7
|
+
} from "./index-9rv2zt48.js";
|
|
8
|
+
import {
|
|
9
|
+
CliError
|
|
10
|
+
} from "./index-j4yvgfhr.js";
|
|
11
|
+
import"./index-qssq2d41.js";
|
|
12
|
+
import"./index-by2tvsq6.js";
|
|
13
|
+
import"./index-ze48c0vd.js";
|
|
14
|
+
import"./index-na8r4a27.js";
|
|
15
|
+
import"./index-dss3ds74.js";
|
|
11
16
|
import {
|
|
12
17
|
ApplicationRunner,
|
|
13
18
|
VerifyScope
|
|
14
|
-
} from "./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
19
|
+
} from "./index-h1w4wqgd.js";
|
|
20
|
+
import"./index-7v7tvgt7.js";
|
|
21
|
+
import"./index-w23tf30e.js";
|
|
22
|
+
import"./index-pt0agdck.js";
|
|
18
23
|
import"./index-m9jj544v.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
24
|
+
import"./index-jx2jcw1r.js";
|
|
25
|
+
import"./index-9zswcze5.js";
|
|
26
|
+
import"./index-1p81ecbz.js";
|
|
21
27
|
import"./index-62md4dwy.js";
|
|
28
|
+
import"./index-zyb0ebm4.js";
|
|
22
29
|
import {
|
|
23
30
|
WorkspaceRunner
|
|
24
|
-
} from "./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-ny2k80mv.js";
|
|
30
|
-
import"./index-v50xjbbe.js";
|
|
31
|
+
} from "./index-2d9nm03s.js";
|
|
32
|
+
import"./index-1pjwsh2g.js";
|
|
33
|
+
import"./index-7ehdht84.js";
|
|
34
|
+
import"./index-ffa52fwf.js";
|
|
35
|
+
import"./index-t4d0ckde.js";
|
|
31
36
|
import {
|
|
32
37
|
VerifyPipeline,
|
|
33
38
|
VerifyReport
|
|
34
|
-
} from "./index-
|
|
35
|
-
import"./index-
|
|
39
|
+
} from "./index-zttyg7tg.js";
|
|
40
|
+
import"./index-g7jgd4xs.js";
|
|
41
|
+
import"./index-vjbne22r.js";
|
|
36
42
|
|
|
37
43
|
// pkgs/@akanjs/cli/verify/verify.script.ts
|
|
38
44
|
import path from "path";
|
|
@@ -51,7 +57,7 @@ class VerifyScript extends script("verify", [WorkspaceRunner, ApplicationRunner]
|
|
|
51
57
|
Logger.rawLog(options.format === "json" ? VerifyReport.json(result) : VerifyReport.text(result, { max: options.max }));
|
|
52
58
|
if (result.ok)
|
|
53
59
|
return;
|
|
54
|
-
const failure = new
|
|
60
|
+
const failure = new CliError("checkFailed", "verify failed");
|
|
55
61
|
markCliErrorPrinted(failure);
|
|
56
62
|
throw failure;
|
|
57
63
|
}
|
|
@@ -3,28 +3,33 @@ import {
|
|
|
3
3
|
Workspace,
|
|
4
4
|
script,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
6
|
+
} from "./index-9rv2zt48.js";
|
|
7
|
+
import"./index-j4yvgfhr.js";
|
|
8
|
+
import"./index-qssq2d41.js";
|
|
9
|
+
import"./index-by2tvsq6.js";
|
|
10
|
+
import"./index-ze48c0vd.js";
|
|
11
|
+
import"./index-na8r4a27.js";
|
|
12
|
+
import"./index-dss3ds74.js";
|
|
9
13
|
import {
|
|
10
14
|
jsonText,
|
|
11
15
|
workflowStatus,
|
|
12
16
|
renderWorkflowPlan,
|
|
13
17
|
renderWorkflowApply,
|
|
14
18
|
renderWorkflowValidation
|
|
15
|
-
} from "./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
19
|
+
} from "./index-a41vv4cy.js";
|
|
20
|
+
import"./index-7ehdht84.js";
|
|
21
|
+
import"./index-nmxszh6x.js";
|
|
22
|
+
import"./index-1p81ecbz.js";
|
|
23
|
+
import"./index-6pxmcaq8.js";
|
|
24
|
+
import"./index-q444k260.js";
|
|
25
|
+
import"./index-7a07tdap.js";
|
|
26
|
+
import"./index-22g3jq43.js";
|
|
27
|
+
import"./index-88s746ns.js";
|
|
28
|
+
import"./index-t4d0ckde.js";
|
|
25
29
|
import {
|
|
26
30
|
WorkflowRunner
|
|
27
|
-
} from "./index-
|
|
31
|
+
} from "./index-013n6z7m.js";
|
|
32
|
+
import"./index-vjbne22r.js";
|
|
28
33
|
|
|
29
34
|
// pkgs/@akanjs/cli/workflow/workflow.script.ts
|
|
30
35
|
import { Logger } from "akanjs/common";
|
|
@@ -46,7 +51,7 @@ class WorkflowScript extends script("workflow", [WorkflowRunner]) {
|
|
|
46
51
|
return;
|
|
47
52
|
}
|
|
48
53
|
if (action === "plan") {
|
|
49
|
-
const plan = await this.workflowRunner.planReport(workflow, inputs, { out, workspace });
|
|
54
|
+
const plan = await WorkflowScript.#reportOnly(format, () => this.workflowRunner.planReport(workflow, inputs, { out, workspace }));
|
|
50
55
|
Logger.rawLog(format === "json" ? jsonText(plan) : renderWorkflowPlan(plan));
|
|
51
56
|
if (workflowStatus(plan.diagnostics) === "failed")
|
|
52
57
|
process.exitCode = 1;
|
|
@@ -56,7 +61,7 @@ class WorkflowScript extends script("workflow", [WorkflowRunner]) {
|
|
|
56
61
|
if (!workspace)
|
|
57
62
|
throw new Error("Workspace is required for workflow apply.");
|
|
58
63
|
const registry = WorkflowRunner.stepRegistry(workspace);
|
|
59
|
-
const report = await this.workflowRunner.applyReport(workflow, { dryRun, workspace, registry });
|
|
64
|
+
const report = await WorkflowScript.#reportOnly(format, () => this.workflowRunner.applyReport(workflow, { dryRun, workspace, registry }));
|
|
60
65
|
Logger.rawLog(renderWorkflowApply(report, format));
|
|
61
66
|
if (report.status === "failed")
|
|
62
67
|
process.exitCode = 1;
|
|
@@ -65,20 +70,33 @@ class WorkflowScript extends script("workflow", [WorkflowRunner]) {
|
|
|
65
70
|
if (action === "validate") {
|
|
66
71
|
if (!workspace)
|
|
67
72
|
throw new Error("Workspace is required for workflow validate.");
|
|
68
|
-
const report = await this.workflowRunner.validateReport(workflow, { workspace });
|
|
73
|
+
const report = await WorkflowScript.#reportOnly(format, () => this.workflowRunner.validateReport(workflow, { workspace }));
|
|
69
74
|
Logger.rawLog(renderWorkflowValidation(report, format));
|
|
70
|
-
if (report.status === "failed")
|
|
75
|
+
if (report.status === "failed" && report.overallStatus !== "passed-with-baseline-blockers")
|
|
71
76
|
process.exitCode = 1;
|
|
72
77
|
return;
|
|
73
78
|
}
|
|
74
79
|
if (action === "report") {
|
|
75
80
|
if (!workspace)
|
|
76
81
|
throw new Error("Workspace is required for workflow report.");
|
|
77
|
-
Logger.rawLog(await this.workflowRunner.report(workflow, { format, workspace }));
|
|
82
|
+
Logger.rawLog(await WorkflowScript.#reportOnly(format, () => this.workflowRunner.report(workflow, { format, workspace })));
|
|
78
83
|
return;
|
|
79
84
|
}
|
|
80
85
|
throw new Error(`Unknown workflow action: ${action}. Use list, explain, plan, apply, validate, or report.`);
|
|
81
86
|
}
|
|
87
|
+
static async#reportOnly(format, run) {
|
|
88
|
+
if (format !== "json")
|
|
89
|
+
return await run();
|
|
90
|
+
const consoleOutput = Logger.consoleOutput;
|
|
91
|
+
Logger.consoleOutput = false;
|
|
92
|
+
const removeSink = Logger.addSink((entry) => void process.stderr.write(entry.message), { minLevel: Logger.level });
|
|
93
|
+
try {
|
|
94
|
+
return await run();
|
|
95
|
+
} finally {
|
|
96
|
+
removeSink();
|
|
97
|
+
Logger.consoleOutput = consoleOutput;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
82
100
|
}
|
|
83
101
|
|
|
84
102
|
// pkgs/@akanjs/cli/workflow/workflow.command.ts
|