@akanjs/cli 3.0.0-beta.14 → 3.0.0-beta.16
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-zgccwajm.js +9 -0
- package/CodeAgentRpcHost-qvwfv0n9.js +7 -0
- package/CodeTui-993tx7gf.js +1103 -0
- package/README.md +3 -0
- package/{agent.command-bhwsc2aj.js → agent.command-n664dtcv.js} +6 -6
- package/akanCode.js +100 -0
- package/{application.command-436y543n.js → application.command-t5542jte.js} +6 -5
- package/{applicationBuildRunner-4f1wrba0.js → applicationBuildRunner-x4gbfn7y.js} +2 -2
- package/{applicationReleasePackager-jkjmy5ee.js → applicationReleasePackager-z61ep017.js} +1 -1
- package/buildBatch.proc.js +2 -2
- package/{capacitorApp-hqvsrec4.js → capacitorApp-shv3ajh5.js} +2 -2
- package/{cloud.command-3xn0xpz8.js → cloud.command-4x35k1z6.js} +9 -8
- package/cloud.script-3k8nbbpn.js +20 -0
- package/code.command-mrfb7a1g.js +147 -0
- package/commandManifest.json +1 -1
- package/consoleToStderr-h5bryj94.js +7 -0
- package/{context.command-hxh96cc3.js → context.command-pqsm5jrk.js} +14 -13
- package/context.runner-bys6ykcp.js +22 -0
- package/{devTui-4ted58a6.js → devTui-gy6mendg.js} +114 -8
- package/{devTuiView-1dj2yq7t.js → devTuiView-y1548wy6.js} +1 -1
- package/{guideline.command-cyw8c0m0.js → guideline.command-rpc2emw8.js} +6 -6
- package/guidelines/agentRule/agentRule.instruction.md +22 -2
- package/guidelines/conventions/conventions.instruction.md +3 -1
- package/incrementalBuilder.proc.js +1 -1
- package/{index-t8gvwcrx.js → index-018dszb3.js} +13 -4
- package/{index-8pkvrcv1.js → index-2pm1j01n.js} +3 -3
- package/{index-7f4dsf9v.js → index-3cymrzsb.js} +1 -1
- package/{index-1nwxbr2y.js → index-3mg4h788.js} +2 -2
- package/{index-em4swemt.js → index-4cvpzkq6.js} +3 -3
- package/index-4n4821gp.js +69 -0
- package/index-5405kc0x.js +2434 -0
- package/{index-tt6kzwj5.js → index-57p9p179.js} +3 -3
- package/{index-b3ae16mg.js → index-6na0sd2b.js} +1 -1
- package/index-7md2g9vw.js +6 -0
- package/index-8k16atqy.js +82 -0
- package/{index-fad0hhty.js → index-g9zghs4h.js} +22 -80
- package/index-jgrnpt6y.js +121 -0
- package/{index-31hmq4ys.js → index-kvzjda3v.js} +8 -8
- package/{index-sg1bgdhe.js → index-ns128c4q.js} +27 -105
- package/{index-5nyznra1.js → index-p4p9t45x.js} +3 -0
- package/{index-sh88vtye.js → index-qh7brn20.js} +1 -1
- package/{index-jwjaf9fy.js → index-qhtj9y6j.js} +44 -44
- package/{index-ys7dvdb3.js → index-sn7dnzq4.js} +1 -1
- package/index-sxg87a8f.js +727 -0
- package/{index-r73ha1rf.js → index-te0y1c0m.js} +4 -4
- package/{index-h7yw2z9n.js → index-twq9p2sp.js} +8 -8
- package/{index-15r9a10e.js → index-v17gj504.js} +2 -2
- package/{index-1mrmve4s.js → index-vpx68e4x.js} +2 -2
- package/index-wfwknnje.js +124 -0
- package/{index-9fbk3dbh.js → index-xjc7gg65.js} +4 -4
- package/{index-8tcj5wk8.js → index-zg0v1zte.js} +5 -5
- package/{index-vrwdx0zx.js → index-zn8qgeqx.js} +1 -1
- package/index.js +21 -20
- package/{library.command-1f9h2ex6.js → library.command-m8p2r1dh.js} +3 -3
- package/{localRegistry.command-4cbgz63s.js → localRegistry.command-tt00nwwg.js} +8 -7
- package/{module.command-ew0484va.js → module.command-mfzvqt0n.js} +5 -5
- package/{package.command-y2rh4np7.js → package.command-8sy6jjwy.js} +3 -3
- package/package.json +12 -2
- package/{page.command-e5h29fyt.js → page.command-taenb02b.js} +3 -3
- package/{primitive.command-50ecfzg4.js → primitive.command-7kpncmkk.js} +6 -6
- package/prompter-9mn3kp36.js +8 -0
- package/{quality.command-a2jytczs.js → quality.command-1ar94hrw.js} +2 -2
- package/{repair.command-c2amvt74.js → repair.command-n08t6j8p.js} +5 -5
- package/{scalar.command-bptz6aj6.js → scalar.command-mq8qfp4t.js} +4 -4
- 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 +63 -0
- package/skills/akan-ui/SKILL.md +63 -0
- package/skills/akan-validate/SKILL.md +44 -0
- package/{subspace.command-kmemx1vm.js → subspace.command-x9897gj4.js} +4 -4
- package/{tunnel.command-67q8vsg5.js → tunnel.command-ht2es78c.js} +2 -2
- package/{workflow.command-2ze5y2xp.js → workflow.command-tvz4nm9n.js} +9 -9
- package/{workspace.command-2n385jkt.js → workspace.command-ayqa1rgt.js} +22 -20
- package/cloud.script-0a76c2g8.js +0 -19
package/README.md
CHANGED
|
@@ -74,6 +74,9 @@ artifact is built last and is not overwritten by the root `akan` bootstrap scrip
|
|
|
74
74
|
- Use `@akanjs/cli` as the user-facing executable package.
|
|
75
75
|
- `@akanjs/devkit` is bundled into the CLI for published CLI usage; it is not required as a separate
|
|
76
76
|
runtime dependency for ordinary CLI users.
|
|
77
|
+
- The `akan code` agent follows that same split: its engine, tools and skills are a devkit facet
|
|
78
|
+
(`@akanjs/devkit/codeAgent`), and `@akanjs/cli/code` is the terminal host plus the SDK entry that
|
|
79
|
+
re-exports both.
|
|
77
80
|
|
|
78
81
|
## Requirements
|
|
79
82
|
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-6na0sd2b.js";
|
|
6
6
|
import"./index-q0y2jq9j.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-p4p9t45x.js";
|
|
8
8
|
import"./index-6wwzs1bc.js";
|
|
9
9
|
import"./index-by5gpp8x.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
10
|
+
import"./index-qhtj9y6j.js";
|
|
11
|
+
import"./index-v17gj504.js";
|
|
12
|
+
import"./index-twq9p2sp.js";
|
|
13
13
|
import {
|
|
14
14
|
AgentScript
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-kvzjda3v.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/cli/agent/agent.command.ts
|
|
18
18
|
class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
|
package/akanCode.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
AkanEditScope2,
|
|
4
|
+
DevLogFeedback2,
|
|
5
|
+
PreviewChrome2,
|
|
6
|
+
PreviewView2,
|
|
7
|
+
PreviewFeedback2,
|
|
8
|
+
TurnFeedback2,
|
|
9
|
+
AkanCli2,
|
|
10
|
+
AkanVerifier2,
|
|
11
|
+
VerifyFeedback2,
|
|
12
|
+
AkanToolPack2,
|
|
13
|
+
MailToolPack2,
|
|
14
|
+
akanCodePaths2,
|
|
15
|
+
McpClient2,
|
|
16
|
+
McpToolPack2,
|
|
17
|
+
SessionToolPack2,
|
|
18
|
+
WebToolPack2,
|
|
19
|
+
AkanCodePlugins2,
|
|
20
|
+
AkanEnvKeys2,
|
|
21
|
+
AkanAuthStorageBackend2,
|
|
22
|
+
akanSystemPrompt2,
|
|
23
|
+
CodeSessionIndex2,
|
|
24
|
+
AkanCodeServices2,
|
|
25
|
+
CodeAgentAsks2,
|
|
26
|
+
CodeAgentEventMapper2,
|
|
27
|
+
CodeAgentGate2,
|
|
28
|
+
CodeAgentUi2,
|
|
29
|
+
CodeMailbox2,
|
|
30
|
+
CodeSessionFork2,
|
|
31
|
+
CodeAgent2
|
|
32
|
+
} from "./index-5405kc0x.js";
|
|
33
|
+
import {
|
|
34
|
+
akanCodeDefaultModel2,
|
|
35
|
+
akanCodeModel2,
|
|
36
|
+
akanCodeModelSupportsImages2,
|
|
37
|
+
akanCodeModelWarnings2,
|
|
38
|
+
CodeAgentStreamPrinter2
|
|
39
|
+
} from "./index-wfwknnje.js";
|
|
40
|
+
import {
|
|
41
|
+
SubagentPool2
|
|
42
|
+
} from "./index-jgrnpt6y.js";
|
|
43
|
+
import"./index-7md2g9vw.js";
|
|
44
|
+
import {
|
|
45
|
+
CodeAgentRpcHost2
|
|
46
|
+
} from "./index-8k16atqy.js";
|
|
47
|
+
import {
|
|
48
|
+
CodeTuiClipboard2,
|
|
49
|
+
CodeTuiCommands2,
|
|
50
|
+
CodeTuiLines2,
|
|
51
|
+
CodeTuiEditor2,
|
|
52
|
+
CodeTuiFiles2,
|
|
53
|
+
CodeTuiMarkdown2,
|
|
54
|
+
CodeTuiParts2
|
|
55
|
+
} from "./index-sxg87a8f.js";
|
|
56
|
+
export {
|
|
57
|
+
AkanAuthStorageBackend2 as AkanAuthStorageBackend,
|
|
58
|
+
AkanCli2 as AkanCli,
|
|
59
|
+
AkanCodePlugins2 as AkanCodePlugins,
|
|
60
|
+
AkanCodeServices2 as AkanCodeServices,
|
|
61
|
+
AkanEditScope2 as AkanEditScope,
|
|
62
|
+
AkanEnvKeys2 as AkanEnvKeys,
|
|
63
|
+
AkanToolPack2 as AkanToolPack,
|
|
64
|
+
AkanVerifier2 as AkanVerifier,
|
|
65
|
+
CodeAgent2 as CodeAgent,
|
|
66
|
+
CodeAgentAsks2 as CodeAgentAsks,
|
|
67
|
+
CodeAgentEventMapper2 as CodeAgentEventMapper,
|
|
68
|
+
CodeAgentGate2 as CodeAgentGate,
|
|
69
|
+
CodeAgentRpcHost2 as CodeAgentRpcHost,
|
|
70
|
+
CodeAgentStreamPrinter2 as CodeAgentStreamPrinter,
|
|
71
|
+
CodeAgentUi2 as CodeAgentUi,
|
|
72
|
+
CodeMailbox2 as CodeMailbox,
|
|
73
|
+
CodeSessionFork2 as CodeSessionFork,
|
|
74
|
+
CodeSessionIndex2 as CodeSessionIndex,
|
|
75
|
+
CodeTuiClipboard2 as CodeTuiClipboard,
|
|
76
|
+
CodeTuiCommands2 as CodeTuiCommands,
|
|
77
|
+
CodeTuiEditor2 as CodeTuiEditor,
|
|
78
|
+
CodeTuiFiles2 as CodeTuiFiles,
|
|
79
|
+
CodeTuiLines2 as CodeTuiLines,
|
|
80
|
+
CodeTuiMarkdown2 as CodeTuiMarkdown,
|
|
81
|
+
CodeTuiParts2 as CodeTuiParts,
|
|
82
|
+
DevLogFeedback2 as DevLogFeedback,
|
|
83
|
+
MailToolPack2 as MailToolPack,
|
|
84
|
+
McpClient2 as McpClient,
|
|
85
|
+
McpToolPack2 as McpToolPack,
|
|
86
|
+
PreviewChrome2 as PreviewChrome,
|
|
87
|
+
PreviewFeedback2 as PreviewFeedback,
|
|
88
|
+
PreviewView2 as PreviewView,
|
|
89
|
+
SessionToolPack2 as SessionToolPack,
|
|
90
|
+
SubagentPool2 as SubagentPool,
|
|
91
|
+
TurnFeedback2 as TurnFeedback,
|
|
92
|
+
VerifyFeedback2 as VerifyFeedback,
|
|
93
|
+
WebToolPack2 as WebToolPack,
|
|
94
|
+
akanCodeDefaultModel2 as akanCodeDefaultModel,
|
|
95
|
+
akanCodeModel2 as akanCodeModel,
|
|
96
|
+
akanCodeModelSupportsImages2 as akanCodeModelSupportsImages,
|
|
97
|
+
akanCodeModelWarnings2 as akanCodeModelWarnings,
|
|
98
|
+
akanCodePaths2 as akanCodePaths,
|
|
99
|
+
akanSystemPrompt2 as akanSystemPrompt
|
|
100
|
+
};
|
|
@@ -6,16 +6,17 @@ import {
|
|
|
6
6
|
Exec,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-6na0sd2b.js";
|
|
10
10
|
import"./index-q0y2jq9j.js";
|
|
11
|
-
import"./index-
|
|
11
|
+
import"./index-p4p9t45x.js";
|
|
12
12
|
import"./index-6wwzs1bc.js";
|
|
13
13
|
import {
|
|
14
14
|
ApplicationScript
|
|
15
|
-
} from "./index-
|
|
16
|
-
import"./index-
|
|
15
|
+
} from "./index-ns128c4q.js";
|
|
16
|
+
import"./index-3mg4h788.js";
|
|
17
17
|
import"./index-hwkygn9s.js";
|
|
18
|
-
import"./index-
|
|
18
|
+
import"./index-7md2g9vw.js";
|
|
19
|
+
import"./index-sn7dnzq4.js";
|
|
19
20
|
import {
|
|
20
21
|
getMobileTargetChoices
|
|
21
22
|
} from "./index-47pj3aee.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
Spinner
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-p4p9t45x.js";
|
|
5
5
|
import {
|
|
6
6
|
AllRoutesBuilder,
|
|
7
7
|
CsrArtifactBuilder,
|
|
8
8
|
FontPruner,
|
|
9
9
|
precompressArtifacts,
|
|
10
10
|
SsrBaseArtifactBuilder
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-zn8qgeqx.js";
|
|
12
12
|
import"./index-w8kmx1b6.js";
|
|
13
13
|
import"./index-q0y2jq9j.js";
|
|
14
14
|
import"./index-hwkygn9s.js";
|
package/buildBatch.proc.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
WorkspaceExecutor,
|
|
4
4
|
AppExecutor
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-p4p9t45x.js";
|
|
6
6
|
import"./index-q0y2jq9j.js";
|
|
7
7
|
import"./index-6wwzs1bc.js";
|
|
8
8
|
import {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
CsrArtifactBuilder,
|
|
12
12
|
FontOptimizer,
|
|
13
13
|
SsrBaseArtifactBuilder
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-zn8qgeqx.js";
|
|
15
15
|
import"./index-w8kmx1b6.js";
|
|
16
16
|
import"./index-hwkygn9s.js";
|
|
17
17
|
import"./index-n68jx79w.js";
|
|
@@ -6,19 +6,20 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-6na0sd2b.js";
|
|
10
|
+
import"./index-p4p9t45x.js";
|
|
11
11
|
import"./index-6wwzs1bc.js";
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
12
|
+
import"./index-ns128c4q.js";
|
|
13
|
+
import"./index-3mg4h788.js";
|
|
14
14
|
import"./index-hwkygn9s.js";
|
|
15
|
+
import"./index-7md2g9vw.js";
|
|
15
16
|
import"./index-kcxmv48c.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-018dszb3.js";
|
|
18
|
+
import"./index-57p9p179.js";
|
|
18
19
|
import {
|
|
19
20
|
CloudScript2
|
|
20
|
-
} from "./index-
|
|
21
|
-
import"./index-
|
|
21
|
+
} from "./index-zg0v1zte.js";
|
|
22
|
+
import"./index-sn7dnzq4.js";
|
|
22
23
|
|
|
23
24
|
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
24
25
|
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CloudScript2
|
|
4
|
+
} from "./index-zg0v1zte.js";
|
|
5
|
+
import"./index-57p9p179.js";
|
|
6
|
+
import"./index-ns128c4q.js";
|
|
7
|
+
import"./index-sn7dnzq4.js";
|
|
8
|
+
import"./index-3mg4h788.js";
|
|
9
|
+
import"./index-018dszb3.js";
|
|
10
|
+
import"./index-myj01w9r.js";
|
|
11
|
+
import"./index-6na0sd2b.js";
|
|
12
|
+
import"./index-7md2g9vw.js";
|
|
13
|
+
import"./index-hwkygn9s.js";
|
|
14
|
+
import"./index-p4p9t45x.js";
|
|
15
|
+
import"./index-6wwzs1bc.js";
|
|
16
|
+
import"./index-kcxmv48c.js";
|
|
17
|
+
import"./index-q0y2jq9j.js";
|
|
18
|
+
export {
|
|
19
|
+
CloudScript2 as CloudScript
|
|
20
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Workspace,
|
|
4
|
+
runner,
|
|
5
|
+
script,
|
|
6
|
+
command
|
|
7
|
+
} from "./index-6na0sd2b.js";
|
|
8
|
+
import"./index-q0y2jq9j.js";
|
|
9
|
+
import"./index-p4p9t45x.js";
|
|
10
|
+
import"./index-6wwzs1bc.js";
|
|
11
|
+
import {
|
|
12
|
+
akanCodeDefaultModel2,
|
|
13
|
+
CodeAgentStreamPrinter2
|
|
14
|
+
} from "./index-wfwknnje.js";
|
|
15
|
+
|
|
16
|
+
// pkgs/@akanjs/cli/code/code.runner.ts
|
|
17
|
+
import { codeAgentPresets, isCodeAgentPresetName } from "akanjs/common";
|
|
18
|
+
|
|
19
|
+
class CodeRunner extends runner("code") {
|
|
20
|
+
async serve(options) {
|
|
21
|
+
await import("./consoleToStderr-h5bryj94.js");
|
|
22
|
+
const [{ CodeAgent }, { CodeAgentRpcHost }] = await Promise.all([
|
|
23
|
+
import("./CodeAgent-zgccwajm.js"),
|
|
24
|
+
import("./CodeAgentRpcHost-qvwfv0n9.js")
|
|
25
|
+
]);
|
|
26
|
+
const profile = CodeRunner.profileOf(options);
|
|
27
|
+
const agent = await CodeAgent.create({
|
|
28
|
+
workspace: options.workspace,
|
|
29
|
+
cwd: profile.paths.root,
|
|
30
|
+
profile,
|
|
31
|
+
apps: options.app ? [options.app] : await options.workspace.getApps(),
|
|
32
|
+
model: CodeRunner.modelOf(options.model),
|
|
33
|
+
mode: "rpc"
|
|
34
|
+
});
|
|
35
|
+
await new CodeAgentRpcHost(agent).serve();
|
|
36
|
+
}
|
|
37
|
+
async tui(options, seed) {
|
|
38
|
+
const [{ CodeAgent }, { CodeTui }] = await Promise.all([
|
|
39
|
+
import("./CodeAgent-zgccwajm.js"),
|
|
40
|
+
import("./CodeTui-993tx7gf.js")
|
|
41
|
+
]);
|
|
42
|
+
const profile = CodeRunner.profileOf(options);
|
|
43
|
+
const apps = options.app ? [options.app] : await options.workspace.getApps();
|
|
44
|
+
let resume = options.resume;
|
|
45
|
+
let prompt = seed;
|
|
46
|
+
let notice;
|
|
47
|
+
for (;; ) {
|
|
48
|
+
const agent = await CodeAgent.create({
|
|
49
|
+
workspace: options.workspace,
|
|
50
|
+
cwd: profile.paths.root,
|
|
51
|
+
profile,
|
|
52
|
+
apps,
|
|
53
|
+
model: CodeRunner.modelOf(options.model),
|
|
54
|
+
mode: "tui",
|
|
55
|
+
...resume ? { resume } : {}
|
|
56
|
+
});
|
|
57
|
+
let next;
|
|
58
|
+
try {
|
|
59
|
+
next = await new CodeTui(agent, {
|
|
60
|
+
thinking: options.thinking,
|
|
61
|
+
...notice ? { notice } : {}
|
|
62
|
+
}).run(prompt);
|
|
63
|
+
} finally {
|
|
64
|
+
agent.dispose();
|
|
65
|
+
}
|
|
66
|
+
if (!next)
|
|
67
|
+
return;
|
|
68
|
+
resume = next.id;
|
|
69
|
+
notice = next.notice;
|
|
70
|
+
prompt = "";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async run(prompt, options) {
|
|
74
|
+
const { CodeAgent } = await import("./CodeAgent-zgccwajm.js");
|
|
75
|
+
const profile = CodeRunner.profileOf(options);
|
|
76
|
+
const agent = await CodeAgent.create({
|
|
77
|
+
workspace: options.workspace,
|
|
78
|
+
cwd: profile.paths.root,
|
|
79
|
+
profile,
|
|
80
|
+
apps: options.app ? [options.app] : await options.workspace.getApps(),
|
|
81
|
+
model: CodeRunner.modelOf(options.model)
|
|
82
|
+
});
|
|
83
|
+
const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
|
|
84
|
+
agent.on((event) => printer.print(event));
|
|
85
|
+
agent.announce();
|
|
86
|
+
try {
|
|
87
|
+
await agent.prompt(prompt);
|
|
88
|
+
await agent.waitForIdle();
|
|
89
|
+
} finally {
|
|
90
|
+
printer.finish();
|
|
91
|
+
agent.dispose();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
static profileOf(options) {
|
|
95
|
+
if (!isCodeAgentPresetName(options.profile))
|
|
96
|
+
throw new Error(`Unknown profile: ${options.profile}. Use local, pod, review, or web.`);
|
|
97
|
+
const root = options.app ? `${options.workspace.workspaceRoot}/apps/${options.app}` : options.workspace.workspaceRoot;
|
|
98
|
+
return codeAgentPresets[options.profile](root);
|
|
99
|
+
}
|
|
100
|
+
static modelOf(model) {
|
|
101
|
+
if (!model)
|
|
102
|
+
return;
|
|
103
|
+
const [provider, ...rest] = model.split("/");
|
|
104
|
+
if (!provider || !rest.length)
|
|
105
|
+
throw new Error(`Model must be "<provider>/<id>", e.g. ${akanCodeDefaultModel2.provider}/${akanCodeDefaultModel2.id}`);
|
|
106
|
+
return { provider, id: rest.join("/") };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// pkgs/@akanjs/cli/code/code.script.ts
|
|
111
|
+
class CodeScript extends script("code", [CodeRunner]) {
|
|
112
|
+
async run(workspace, prompt, options) {
|
|
113
|
+
const run = {
|
|
114
|
+
workspace,
|
|
115
|
+
...options.app ? { app: options.app } : {},
|
|
116
|
+
profile: options.profile,
|
|
117
|
+
...options.model ? { model: options.model } : {},
|
|
118
|
+
json: options.json,
|
|
119
|
+
thinking: options.thinking,
|
|
120
|
+
...options.resume ? { resume: options.resume } : {}
|
|
121
|
+
};
|
|
122
|
+
if (options.rpc)
|
|
123
|
+
return await this.codeRunner.serve(run);
|
|
124
|
+
const interactive = options.interactive || !prompt.trim() && !options.json && !!process.stdout.isTTY;
|
|
125
|
+
if (interactive)
|
|
126
|
+
return await this.codeRunner.tui(run, prompt);
|
|
127
|
+
if (!prompt.trim())
|
|
128
|
+
throw new Error('akan code needs a prompt when it has no terminal: akan code "add a comment module"');
|
|
129
|
+
await this.codeRunner.run(prompt, run);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// pkgs/@akanjs/cli/code/code.command.ts
|
|
134
|
+
class CodeCommand extends command("code", [CodeScript], ({ public: target }) => ({
|
|
135
|
+
code: target({ desc: "Run the akan coding agent on a prompt" }).arg("prompt", String, { desc: "what the agent should do", nullable: true }).option("app", String, { desc: "narrow the agent to one app instead of the whole repo", nullable: true }).option("profile", String, { desc: "local, pod, review, or web", default: "local" }).option("model", String, { desc: "<provider>/<id>, e.g. deepseek/deepseek-v4-flash", nullable: true }).option("json", Boolean, { desc: "print one event per line as JSON", default: false }).option("thinking", Boolean, { desc: "print the model's reasoning", default: false }).option("rpc", Boolean, { desc: "serve the agent over stdio for another process to drive", default: false }).option("resume", String, { desc: "continue a stored session by id", flag: "R", nullable: true }).option("interactive", Boolean, {
|
|
136
|
+
desc: "open the full-screen session even when a prompt is given",
|
|
137
|
+
flag: "i",
|
|
138
|
+
default: false
|
|
139
|
+
}).with(Workspace).exec(async function(prompt, app, profile, model, json, thinking, rpc, resume, interactive, workspace) {
|
|
140
|
+
const options = { app, profile, model, json, thinking, rpc, interactive, resume };
|
|
141
|
+
await this.codeScript.run(workspace, prompt ?? "", options);
|
|
142
|
+
})
|
|
143
|
+
})) {
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
CodeCommand
|
|
147
|
+
};
|
package/commandManifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","release-ios":"application","release-android":"application","release-source":"application","codepush":"application","dbup":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","tunnel":"tunnel"}}
|
|
1
|
+
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","release-ios":"application","release-android":"application","release-source":"application","codepush":"application","dbup":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","tunnel":"tunnel"}}
|
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-6na0sd2b.js";
|
|
6
6
|
import"./index-q0y2jq9j.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-p4p9t45x.js";
|
|
8
8
|
import"./index-6wwzs1bc.js";
|
|
9
9
|
import"./index-by5gpp8x.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
import"./index-qhtj9y6j.js";
|
|
11
|
+
import"./index-v17gj504.js";
|
|
12
|
+
import"./index-g9zghs4h.js";
|
|
13
|
+
import"./index-3cymrzsb.js";
|
|
14
|
+
import"./index-twq9p2sp.js";
|
|
15
|
+
import"./index-4cvpzkq6.js";
|
|
16
|
+
import"./index-2pm1j01n.js";
|
|
17
|
+
import"./index-qh7brn20.js";
|
|
18
|
+
import"./index-xjc7gg65.js";
|
|
19
|
+
import"./index-te0y1c0m.js";
|
|
20
|
+
import"./index-vpx68e4x.js";
|
|
12
21
|
import {
|
|
13
22
|
ContextScript
|
|
14
|
-
} from "./index-
|
|
15
|
-
import"./index-7f4dsf9v.js";
|
|
16
|
-
import"./index-h7yw2z9n.js";
|
|
17
|
-
import"./index-em4swemt.js";
|
|
18
|
-
import"./index-8pkvrcv1.js";
|
|
19
|
-
import"./index-sh88vtye.js";
|
|
20
|
-
import"./index-9fbk3dbh.js";
|
|
21
|
-
import"./index-r73ha1rf.js";
|
|
22
|
-
import"./index-1mrmve4s.js";
|
|
23
|
+
} from "./index-4n4821gp.js";
|
|
23
24
|
|
|
24
25
|
// pkgs/@akanjs/cli/context/context.command.ts
|
|
25
26
|
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ContextRunner2
|
|
4
|
+
} from "./index-g9zghs4h.js";
|
|
5
|
+
import"./index-2pm1j01n.js";
|
|
6
|
+
import"./index-vpx68e4x.js";
|
|
7
|
+
import"./index-te0y1c0m.js";
|
|
8
|
+
import"./index-4cvpzkq6.js";
|
|
9
|
+
import"./index-xjc7gg65.js";
|
|
10
|
+
import"./index-qh7brn20.js";
|
|
11
|
+
import"./index-v17gj504.js";
|
|
12
|
+
import"./index-qhtj9y6j.js";
|
|
13
|
+
import"./index-twq9p2sp.js";
|
|
14
|
+
import"./index-3cymrzsb.js";
|
|
15
|
+
import"./index-6na0sd2b.js";
|
|
16
|
+
import"./index-p4p9t45x.js";
|
|
17
|
+
import"./index-by5gpp8x.js";
|
|
18
|
+
import"./index-6wwzs1bc.js";
|
|
19
|
+
import"./index-q0y2jq9j.js";
|
|
20
|
+
export {
|
|
21
|
+
ContextRunner2 as ContextRunner
|
|
22
|
+
};
|