@akanjs/cli 3.0.0-beta.2 → 3.0.0-beta.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 +1 -1
- package/CodeAgent-awv258wb.js +9 -0
- package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
- package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
- package/CodeTui-1nqh35ez.js +1457 -0
- package/README.md +3 -0
- package/TunnelShare-scf4e4pd.js +9 -0
- package/{agent.command-d2gfxfck.js → agent.command-1s9ag7sb.js} +8 -9
- package/akanCode.js +102 -0
- package/{application.command-pj2m7584.js → application.command-49hwy6va.js} +51 -78
- package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-ybyp97pv.js} +63 -64
- package/{applicationReleasePackager-4yasxwv9.js → applicationReleasePackager-esnrphw8.js} +40 -60
- package/buildBatch.proc.js +19 -24
- package/{capacitorApp-36rbr858.js → capacitorApp-1synz4en.js} +3 -4
- package/cloud.command-d7rqtzt9.js +94 -0
- package/cloud.script-bkbpcr96.js +19 -0
- package/code.command-nn48xzej.js +154 -0
- package/commandManifest.json +1 -1
- package/consoleToStderr-h5bryj94.js +7 -0
- package/context.command-s3mcmvpa.js +48 -0
- package/context.runner-k99nb5pk.js +21 -0
- package/{dependencyScanner-shs82ynp.js → dependencyScanner-ye2e6pdz.js} +2 -2
- package/{devTui-40ggmd99.js → devTui-q7k7bakd.js} +122 -40
- package/fileSys-5ngz93ga.js +9 -0
- package/guideline.command-sct4qnt5.js +42 -0
- package/guidelines/agentRule/agentRule.instruction.md +206 -25
- package/guidelines/conventions/conventions.instruction.md +79 -24
- package/guidelines/fieldRule/fieldRule.instruction.md +1 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
- package/guidelines/queryRule/queryRule.instruction.md +17 -7
- package/guidelines/runtimeRule/runtimeRule.instruction.md +74 -0
- package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
- package/guidelines/transportRule/transportRule.instruction.md +51 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +66 -3
- package/incrementalBuilder.proc.js +31 -48
- package/{index-h7yw2z9n.js → index-0bq14vr1.js} +8 -14
- package/index-13ffe9wp.js +69 -0
- package/index-22d57v4c.js +266 -0
- package/{index-fz5q3gd7.js → index-31yr441d.js} +10 -17
- package/index-3hx1z96c.js +87 -0
- package/index-3sq321ak.js +53 -0
- package/{index-kcxmv48c.js → index-3t7g9e4r.js} +45 -79
- package/{index-q0y2jq9j.js → index-5b6tavv3.js} +6 -3
- package/{index-47pj3aee.js → index-5e0n4hqx.js} +11 -12
- package/{index-259dsnz3.js → index-5pc1qrbv.js} +5 -8
- package/index-7md2g9vw.js +6 -0
- package/index-8mna0947.js +187 -0
- package/{index-zry5nz81.js → index-8sf7wmdr.js} +51 -30
- package/{index-2tv3fdx4.js → index-9d9bgcx4.js} +342 -765
- package/index-9dp031by.js +12 -0
- package/{index-ne2qy0nk.js → index-ahemdr5n.js} +12 -12
- package/{index-ws5e0j51.js → index-as7xmyz8.js} +40 -24
- package/index-axzjaqve.js +1118 -0
- package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
- package/index-c6eggbee.js +123 -0
- package/index-d2242ksy.js +99 -0
- package/{index-a64esmtb.js → index-ddxvdd1p.js} +169 -305
- package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
- package/{index-pnqbkf5p.js → index-dzf3r49a.js} +6 -2
- package/{index-w8kmx1b6.js → index-fgq75haa.js} +198 -290
- package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
- package/{index-hwkygn9s.js → index-khpfpcsd.js} +302 -33
- package/{index-wt7qrtd4.js → index-mxav6j3c.js} +93 -232
- package/{index-gyd220p2.js → index-myhc3c1j.js} +554 -577
- package/{index-600zhnve.js → index-nv5976x3.js} +56 -197
- package/index-p6pbz9n5.js +25 -0
- package/{index-4edzf1gr.js → index-przybvy5.js} +77 -150
- package/index-smme4r47.js +49 -0
- package/{index-mak3cd28.js → index-w2zdcw3k.js} +137 -255
- package/index-wa5jbxj1.js +760 -0
- package/{index-v0qh106m.js → index-ww4z397j.js} +527 -723
- package/{index-j9yhg404.js → index-xqjwd384.js} +4 -7
- package/{index-7737gxcp.js → index-xqpzbab5.js} +107 -241
- package/index-xsjh6nzh.js +2729 -0
- package/{index-ktb5njgy.js → index-ygn77a5w.js} +47 -99
- package/index-ztp3e73t.js +700 -0
- package/index.js +23 -22
- package/{library.command-nbsky672.js → library.command-1gx04jgn.js} +4 -5
- package/{localRegistry.command-yeq57wjr.js → localRegistry.command-zndxj1q6.js} +22 -42
- package/{module.command-29vqzrh8.js → module.command-3waddk95.js} +8 -11
- package/{package.command-axv0abmn.js → package.command-zrc7br1y.js} +6 -7
- package/package.json +14 -5
- package/{page.command-vs9s3zrh.js → page.command-vpjgardh.js} +4 -5
- package/{primitive.command-cbxmqbtc.js → primitive.command-sz84tk4t.js} +9 -22
- package/prompter-ptaa3nk0.js +8 -0
- package/{quality.command-gmbs7nws.js → quality.command-g869hafs.js} +203 -376
- package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
- package/{repair.command-bqsjptsj.js → repair.command-chsnjvvv.js} +11 -35
- package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
- package/{scalar.command-6k1vhe9s.js → scalar.command-2v21newx.js} +7 -10
- package/skills/akan-code/SKILL.md +130 -0
- package/skills/akan-debug/SKILL.md +42 -0
- package/skills/akan-deps/SKILL.md +50 -0
- package/skills/akan-err/SKILL.md +39 -0
- package/skills/akan-module/SKILL.md +45 -0
- package/skills/akan-scaffold/SKILL.md +76 -0
- package/skills/akan-scalar/SKILL.md +52 -0
- package/skills/akan-service/SKILL.md +34 -0
- package/skills/akan-store/SKILL.md +67 -0
- package/skills/akan-ui/SKILL.md +63 -0
- package/skills/akan-validate/SKILL.md +44 -0
- package/{subspace.command-fwjfcts7.js → subspace.command-ckcbwfp1.js} +138 -67
- package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
- package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
- package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
- package/templates/appSample/lib/task/task.abstract.ts +12 -32
- package/templates/appSample/lib/task/task.signal.spec.ts +15 -18
- package/templates/appSample/lib/task/task.signal.test.ts +15 -1
- package/templates/appSample/lib/task/task.signal.ts +1 -1
- package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +7 -4
- package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +6 -4
- package/templates/client.ts +7 -30
- package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
- package/templates/crudPages/[__model__Id]/page.tsx +2 -1
- package/templates/crudPages/new/page.tsx +2 -1
- package/templates/crudPages/page.tsx +2 -1
- package/templates/crudSinglePage/page.tsx +2 -1
- package/templates/lib/__lib/lib.dictionary.ts +0 -2
- package/templates/lib/__lib/lib.document.ts +0 -2
- package/templates/lib/sig.ts +8 -30
- package/templates/localDev/docker-compose.yaml.template +3 -14
- package/templates/module/__model__.signal.ts +12 -4
- package/templates/pkgRoot/tsconfig.json.template +2 -7
- package/templates/server.ts +0 -2
- package/templates/service/__model__.abstract.md.template +8 -0
- package/tunnel.command-kd2yr4fx.js +129 -0
- package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/workflow.command-44252cqv.js +79 -0
- package/{workspace.command-8s050m0h.js → workspace.command-fqcztt5p.js} +77 -109
- package/abstractCompactor-mjh5ppsq.js +0 -101
- package/cloud.command-jshwdq22.js +0 -93
- package/context.command-ez8a0zyz.js +0 -80
- package/devTuiView-c08ccbat.js +0 -9
- package/getDirname-dr3jz1xg.js +0 -7
- package/guideline.command-xmqwx8zm.js +0 -359
- package/guidelines/agentRule/agentRule.generate.json +0 -31
- package/guidelines/componentRule/componentRule.generate.json +0 -31
- package/guidelines/conventions/conventions.generate.json +0 -25
- package/guidelines/cssRule/cssRule.generate.json +0 -31
- package/guidelines/docPageRule/docPageRule.generate.json +0 -31
- package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
- package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
- package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
- package/guidelines/enumConstant/enumConstant.generate.json +0 -31
- package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
- package/guidelines/fieldRule/fieldRule.generate.json +0 -31
- package/guidelines/framework/framework.generate.json +0 -32
- package/guidelines/mcpRule/mcpRule.generate.json +0 -35
- package/guidelines/modelConstant/modelConstant.generate.json +0 -32
- package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
- package/guidelines/modelDocument/modelDocument.generate.json +0 -31
- package/guidelines/modelService/modelService.generate.json +0 -31
- package/guidelines/modelSignal/modelSignal.generate.json +0 -31
- package/guidelines/modelStore/modelStore.generate.json +0 -31
- package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
- package/guidelines/modelUnit/modelUnit.generate.json +0 -31
- package/guidelines/modelUtil/modelUtil.generate.json +0 -31
- package/guidelines/modelView/modelView.generate.json +0 -31
- package/guidelines/modelZone/modelZone.generate.json +0 -31
- package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
- package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
- package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
- package/guidelines/queryRule/queryRule.generate.json +0 -31
- package/guidelines/recipeRule/recipeRule.generate.json +0 -31
- package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
- package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
- package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
- package/guidelines/scalarModule/scalarModule.generate.json +0 -31
- package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
- package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
- package/guidelines/ssrRule/ssrRule.generate.json +0 -31
- package/guidelines/transportRule/transportRule.generate.json +0 -31
- package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
- package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
- package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -33
- package/index-2hq52jq3.js +0 -465
- package/index-6wwzs1bc.js +0 -7
- package/index-8pm30m73.js +0 -841
- package/index-kn1h7p1x.js +0 -560
- package/index-meh558jy.js +0 -65
- package/index-rwg2aa4f.js +0 -229
- package/templates/__scalar/__model__/__model__.abstract.md +0 -28
- package/templates/module/__model__.abstract.md +0 -28
- package/templates/service/__model__.abstract.md +0 -28
- package/workflow.command-nwpcdc8p.js +0 -107
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ContextRunner2
|
|
4
|
+
} from "./index-nv5976x3.js";
|
|
5
|
+
import"./index-xqpzbab5.js";
|
|
6
|
+
import"./index-3sq321ak.js";
|
|
7
|
+
import"./index-przybvy5.js";
|
|
8
|
+
import"./index-31yr441d.js";
|
|
9
|
+
import"./index-8mna0947.js";
|
|
10
|
+
import"./index-dzf3r49a.js";
|
|
11
|
+
import"./index-ygn77a5w.js";
|
|
12
|
+
import"./index-myhc3c1j.js";
|
|
13
|
+
import"./index-0bq14vr1.js";
|
|
14
|
+
import"./index-mxav6j3c.js";
|
|
15
|
+
import"./index-w2zdcw3k.js";
|
|
16
|
+
import"./index-9d9bgcx4.js";
|
|
17
|
+
import"./index-hj6w4ka1.js";
|
|
18
|
+
import"./index-5b6tavv3.js";
|
|
19
|
+
export {
|
|
20
|
+
ContextRunner2 as ContextRunner
|
|
21
|
+
};
|
|
@@ -1,37 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "./index-
|
|
3
|
+
stripAnsi
|
|
4
|
+
} from "./index-7md2g9vw.js";
|
|
5
|
+
import {
|
|
6
|
+
writeClipboard
|
|
7
|
+
} from "./index-p6pbz9n5.js";
|
|
8
|
+
import {
|
|
9
|
+
openBrowser
|
|
10
|
+
} from "./index-9dp031by.js";
|
|
8
11
|
|
|
9
12
|
// pkgs/@akanjs/cli/application/devTui.tsx
|
|
10
13
|
import { render } from "ink";
|
|
11
14
|
|
|
12
|
-
// pkgs/@akanjs/cli/clipboard.ts
|
|
13
|
-
var clipboardCommands = () => {
|
|
14
|
-
if (process.platform === "darwin")
|
|
15
|
-
return [["pbcopy"]];
|
|
16
|
-
if (process.platform === "win32")
|
|
17
|
-
return [["clip"]];
|
|
18
|
-
return [["wl-copy"], ["xclip", "-selection", "clipboard"], ["xsel", "--clipboard", "--input"]];
|
|
19
|
-
};
|
|
20
|
-
var writeClipboard = async (text) => {
|
|
21
|
-
for (const command of clipboardCommands()) {
|
|
22
|
-
try {
|
|
23
|
-
const proc = Bun.spawn(command, {
|
|
24
|
-
stdin: new TextEncoder().encode(text),
|
|
25
|
-
stdout: "ignore",
|
|
26
|
-
stderr: "ignore"
|
|
27
|
-
});
|
|
28
|
-
if (await proc.exited === 0)
|
|
29
|
-
return true;
|
|
30
|
-
} catch {}
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
15
|
// pkgs/@akanjs/cli/ui/DevTuiApp.tsx
|
|
36
16
|
import { Box, Text, useInput } from "ink";
|
|
37
17
|
import { useEffect, useState } from "react";
|
|
@@ -176,6 +156,8 @@ var DevTuiApp = ({ actions }) => {
|
|
|
176
156
|
actions.copyLines();
|
|
177
157
|
else if (input === "Y")
|
|
178
158
|
actions.copyPath();
|
|
159
|
+
else if (input === "s")
|
|
160
|
+
actions.copyShareUrl();
|
|
179
161
|
else if (input === "o")
|
|
180
162
|
actions.openSelected();
|
|
181
163
|
else if (input === "r")
|
|
@@ -236,12 +218,95 @@ var DevTuiApp = ({ actions }) => {
|
|
|
236
218
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV(Text, {
|
|
237
219
|
dimColor: true,
|
|
238
220
|
wrap: "truncate",
|
|
239
|
-
children:
|
|
221
|
+
children: `${snapshot.hasShare ? "s share \xB7 " : ""}Tab next \xB7 1-9 app \xB7 \u2191\u2193 scroll (shift page) \xB7 G follow${snapshot.following ? "" : " (paused)"} \xB7 / grep${snapshot.grep ? ` (${snapshot.grep})` : ""} \xB7 e errors${snapshot.errorsOnly ? " on" : ""} \xB7 c clear \xB7 y copy \xB7 Y path \xB7 o open \xB7 r restart \xB7 q quit`
|
|
240
222
|
}, undefined, false, undefined, this)
|
|
241
223
|
]
|
|
242
224
|
}, undefined, true, undefined, this);
|
|
243
225
|
};
|
|
244
226
|
|
|
227
|
+
// pkgs/@akanjs/cli/application/devLogBuffer.ts
|
|
228
|
+
var plainTextOf = (lines, { withApp = false } = {}) => {
|
|
229
|
+
const width = withApp ? lines.reduce((max, line) => Math.max(max, line.app.length), 0) : 0;
|
|
230
|
+
return lines.map((line) => `${withApp ? `${line.app.padEnd(width)} \u2502 ` : ""}${stripAnsi(line.text)}`).join(`
|
|
231
|
+
`);
|
|
232
|
+
};
|
|
233
|
+
var HOST_SOURCE = "host";
|
|
234
|
+
var childPrefix = /^\[child:(\d+) ([a-z-]+)\] \[(?:stdout|stderr)\] /;
|
|
235
|
+
var sourceOf = (text) => {
|
|
236
|
+
const match = childPrefix.exec(text);
|
|
237
|
+
return match ? `#${match[1]} ${match[2]}` : HOST_SOURCE;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
class DevLogBuffer {
|
|
241
|
+
static defaultLimit = 5000;
|
|
242
|
+
#limit;
|
|
243
|
+
#lines = [];
|
|
244
|
+
#partial = new Map;
|
|
245
|
+
#sources = new Map;
|
|
246
|
+
#seq = 0;
|
|
247
|
+
constructor({ limit = DevLogBuffer.defaultLimit } = {}) {
|
|
248
|
+
this.#limit = Math.max(1, limit);
|
|
249
|
+
}
|
|
250
|
+
get size() {
|
|
251
|
+
return this.#lines.length;
|
|
252
|
+
}
|
|
253
|
+
sourcesOf(app) {
|
|
254
|
+
return [...this.#sources.get(app) ?? []];
|
|
255
|
+
}
|
|
256
|
+
push(app, kind, chunk) {
|
|
257
|
+
const key = `${app}:${kind}`;
|
|
258
|
+
const parts = `${this.#partial.get(key) ?? ""}${chunk}`.split(`
|
|
259
|
+
`);
|
|
260
|
+
this.#partial.set(key, parts.pop() ?? "");
|
|
261
|
+
return this.#append(app, kind, parts);
|
|
262
|
+
}
|
|
263
|
+
flushPartials() {
|
|
264
|
+
const flushed = [];
|
|
265
|
+
for (const [key, remainder] of [...this.#partial]) {
|
|
266
|
+
this.#partial.set(key, "");
|
|
267
|
+
if (!remainder)
|
|
268
|
+
continue;
|
|
269
|
+
const split = key.lastIndexOf(":");
|
|
270
|
+
const app = key.slice(0, split);
|
|
271
|
+
const kind = key.slice(split + 1) === "stderr" ? "stderr" : "stdout";
|
|
272
|
+
flushed.push(...this.#append(app, kind, [remainder]));
|
|
273
|
+
}
|
|
274
|
+
return flushed;
|
|
275
|
+
}
|
|
276
|
+
select({ app = null, source = null, grep, errorsOnly = false } = {}) {
|
|
277
|
+
const needle = grep?.trim().toLowerCase();
|
|
278
|
+
return this.#lines.filter((line) => {
|
|
279
|
+
if (app !== null && line.app !== app)
|
|
280
|
+
return false;
|
|
281
|
+
if (source !== null && line.source !== source)
|
|
282
|
+
return false;
|
|
283
|
+
if (errorsOnly && line.kind !== "stderr")
|
|
284
|
+
return false;
|
|
285
|
+
if (needle && !stripAnsi(line.text).toLowerCase().includes(needle))
|
|
286
|
+
return false;
|
|
287
|
+
return true;
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
clear(app = null) {
|
|
291
|
+
const kept = app === null ? [] : this.#lines.filter((line) => line.app !== app);
|
|
292
|
+
this.#lines.length = 0;
|
|
293
|
+
this.#lines.push(...kept);
|
|
294
|
+
}
|
|
295
|
+
#append(app, kind, texts) {
|
|
296
|
+
const known = this.#sources.get(app) ?? new Set;
|
|
297
|
+
this.#sources.set(app, known);
|
|
298
|
+
const added = texts.map((text) => {
|
|
299
|
+
const source = sourceOf(text);
|
|
300
|
+
known.add(source);
|
|
301
|
+
return { seq: ++this.#seq, app, source, kind, text };
|
|
302
|
+
});
|
|
303
|
+
this.#lines.push(...added);
|
|
304
|
+
if (this.#lines.length > this.#limit)
|
|
305
|
+
this.#lines.splice(0, this.#lines.length - this.#limit);
|
|
306
|
+
return added;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
245
310
|
// pkgs/@akanjs/cli/application/devLogWindow.ts
|
|
246
311
|
var windowOf = (lines, rows, anchor) => {
|
|
247
312
|
const height = Math.max(1, Math.trunc(rows));
|
|
@@ -313,6 +378,7 @@ class DevTui {
|
|
|
313
378
|
clear: this.#clear,
|
|
314
379
|
copyLines: this.#copyLines,
|
|
315
380
|
copyPath: this.#copyPath,
|
|
381
|
+
copyShareUrl: this.#copyShareUrl,
|
|
316
382
|
openSelected: this.#openSelected,
|
|
317
383
|
restartSelected: this.#restartSelected,
|
|
318
384
|
quit: this.#quit
|
|
@@ -348,7 +414,7 @@ class DevTui {
|
|
|
348
414
|
process.stdout.write(`${line.app} \u2502 ${line.text}
|
|
349
415
|
`);
|
|
350
416
|
for (const status of this.#statuses)
|
|
351
|
-
process.stdout.write(`${status.name} ${status.url} \u2014 ${status.state}
|
|
417
|
+
process.stdout.write(`${status.name} ${status.url}${status.shareUrl ? ` \xB7 ${status.shareUrl}` : ""} \u2014 ${status.state}
|
|
352
418
|
`);
|
|
353
419
|
const log = this.#supervisor.sessionLog;
|
|
354
420
|
for (const name of log.appNames)
|
|
@@ -403,12 +469,12 @@ class DevTui {
|
|
|
403
469
|
const logRows = Math.max(1, bodyHeight - DevTui.paneChromeRows);
|
|
404
470
|
const rows = this.#railRows();
|
|
405
471
|
const view = windowOf(this.#filtered(this.#target), logRows, this.#anchor);
|
|
406
|
-
const status = this.#
|
|
472
|
+
const status = this.#selectedStatus();
|
|
407
473
|
const railLabelWidth = rows.reduce((max, row) => Math.max(max, row.label.length + row.depth * 2), 0);
|
|
408
474
|
this.#cachedSnapshot = {
|
|
409
475
|
rows,
|
|
410
476
|
selected: this.#indexOfTarget(rows),
|
|
411
|
-
title: status ? `${status.name}${this.#target.source ? ` \xB7 ${this.#target.source}` : ""} \xB7 ${status.url} \xB7 ${status.state}${status.detail ? ` (${status.detail})` : ""}` :
|
|
477
|
+
title: status ? `${status.name}${this.#target.source ? ` \xB7 ${this.#target.source}` : ""}${status.shareUrl ? ` \xB7 \u25C8 ${status.shareUrl}` : ""} \xB7 ${status.url} \xB7 ${status.state}${status.detail ? ` (${status.detail})` : ""}` : this.#mergedTitle(),
|
|
412
478
|
lines: view.lines,
|
|
413
479
|
above: view.above,
|
|
414
480
|
below: view.below,
|
|
@@ -419,6 +485,7 @@ class DevTui {
|
|
|
419
485
|
errorsOnly: this.#errorsOnly,
|
|
420
486
|
editingGrep: this.#editingGrep,
|
|
421
487
|
notice: this.#notice,
|
|
488
|
+
hasShare: this.#statuses.some((candidate) => !!candidate.shareUrl),
|
|
422
489
|
readyCount: this.#statuses.filter((candidate) => candidate.state === "ready").length,
|
|
423
490
|
appCount: this.#statuses.length,
|
|
424
491
|
logRows,
|
|
@@ -467,8 +534,7 @@ class DevTui {
|
|
|
467
534
|
};
|
|
468
535
|
#setTarget(target) {
|
|
469
536
|
this.#target = { app: target.app ?? null, source: target.source ?? null };
|
|
470
|
-
this.#
|
|
471
|
-
this.#renderNow();
|
|
537
|
+
this.#follow();
|
|
472
538
|
}
|
|
473
539
|
#scroll = (delta) => {
|
|
474
540
|
this.#anchor = scrollAnchor(this.#filtered(this.#target), this.#snapshot().logRows, this.#anchor, delta);
|
|
@@ -480,8 +546,7 @@ class DevTui {
|
|
|
480
546
|
};
|
|
481
547
|
#setGrep = (grep) => {
|
|
482
548
|
this.#grep = grep;
|
|
483
|
-
this.#
|
|
484
|
-
this.#renderNow();
|
|
549
|
+
this.#follow();
|
|
485
550
|
};
|
|
486
551
|
#setEditingGrep = (editing) => {
|
|
487
552
|
this.#editingGrep = editing;
|
|
@@ -489,13 +554,11 @@ class DevTui {
|
|
|
489
554
|
};
|
|
490
555
|
#toggleErrorsOnly = () => {
|
|
491
556
|
this.#errorsOnly = !this.#errorsOnly;
|
|
492
|
-
this.#
|
|
493
|
-
this.#renderNow();
|
|
557
|
+
this.#follow();
|
|
494
558
|
};
|
|
495
559
|
#clear = () => {
|
|
496
560
|
this.#buffer.clear(this.#target.app ?? null);
|
|
497
|
-
this.#
|
|
498
|
-
this.#renderNow();
|
|
561
|
+
this.#follow();
|
|
499
562
|
};
|
|
500
563
|
#copyLines = () => {
|
|
501
564
|
const lines = this.#filtered(this.#target);
|
|
@@ -520,6 +583,25 @@ class DevTui {
|
|
|
520
583
|
const app = this.#target.app;
|
|
521
584
|
return (app ? [app] : log.appNames).map((name) => log.relativePathOf(name));
|
|
522
585
|
}
|
|
586
|
+
#copyShareUrl = () => {
|
|
587
|
+
const urls = this.#shareUrls();
|
|
588
|
+
if (urls.length === 0) {
|
|
589
|
+
this.#setNotice("no public share \u2014 start with --share");
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
writeClipboard(urls.join(`
|
|
593
|
+
`)).then((copied) => {
|
|
594
|
+
this.#setNotice(copied ? `copied ${urls.join(" \xB7 ")}` : urls.join(" \xB7 "));
|
|
595
|
+
});
|
|
596
|
+
};
|
|
597
|
+
#shareUrls() {
|
|
598
|
+
const app = this.#target.app;
|
|
599
|
+
return this.#statuses.filter((status) => app === null || status.name === app).map((status) => status.shareUrl).filter((url) => !!url);
|
|
600
|
+
}
|
|
601
|
+
#mergedTitle() {
|
|
602
|
+
const urls = this.#shareUrls();
|
|
603
|
+
return urls.length === 0 ? "all apps" : `all apps \xB7 \u25C8 ${urls.join(" \xB7 ")}`;
|
|
604
|
+
}
|
|
523
605
|
#setNotice(text) {
|
|
524
606
|
this.#notice = text;
|
|
525
607
|
if (this.#noticeTimer)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
script,
|
|
4
|
+
command
|
|
5
|
+
} from "./index-w2zdcw3k.js";
|
|
6
|
+
import"./index-5b6tavv3.js";
|
|
7
|
+
import"./index-9d9bgcx4.js";
|
|
8
|
+
import {
|
|
9
|
+
Prompter2
|
|
10
|
+
} from "./index-0bq14vr1.js";
|
|
11
|
+
|
|
12
|
+
// pkgs/@akanjs/cli/guideline/guideline.script.ts
|
|
13
|
+
import { Logger } from "akanjs/common";
|
|
14
|
+
|
|
15
|
+
class GuidelineScript extends script("guideline") {
|
|
16
|
+
async guideline(action, name = null) {
|
|
17
|
+
if (action === "list") {
|
|
18
|
+
const guidelines = await Prompter2.listGuidelines();
|
|
19
|
+
Logger.rawLog(guidelines.join(`
|
|
20
|
+
`));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (action === "show") {
|
|
24
|
+
if (!name)
|
|
25
|
+
throw new Error("Guideline name is required. Example: akan guideline show framework");
|
|
26
|
+
Logger.rawLog(await Prompter2.getInstruction(name));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Unknown guideline action: ${action}. Use "list" or "show".`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// pkgs/@akanjs/cli/guideline/guideline.command.ts
|
|
34
|
+
class GuidelineCommand extends command("guideline", [GuidelineScript], ({ public: target }) => ({
|
|
35
|
+
guideline: target({ desc: "List or show Akan AI guideline instructions" }).arg("action", String, { desc: "list or show" }).arg("name", String, { desc: "guideline name for show", nullable: true }).exec(async function(action, name) {
|
|
36
|
+
await this.guidelineScript.guideline(action, name);
|
|
37
|
+
})
|
|
38
|
+
})) {
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
GuidelineCommand
|
|
42
|
+
};
|