@akanjs/cli 3.0.0-beta.15 → 3.0.0-beta.17

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.
Files changed (61) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-d3wvbq8q.js → CodeAgent-gjqnc2mg.js} +2 -2
  3. package/{CodeTui-6c9a2wtk.js → CodeTui-nd9hqvrw.js} +196 -11
  4. package/{agent.command-9cg8m87z.js → agent.command-n664dtcv.js} +5 -5
  5. package/akanCode.js +9 -9
  6. package/{application.command-x75men32.js → application.command-t5542jte.js} +5 -5
  7. package/{applicationBuildRunner-d3702f1w.js → applicationBuildRunner-x4gbfn7y.js} +2 -2
  8. package/{applicationReleasePackager-2kdyj3te.js → applicationReleasePackager-z61ep017.js} +1 -1
  9. package/buildBatch.proc.js +2 -2
  10. package/{capacitorApp-qk975zyz.js → capacitorApp-shv3ajh5.js} +2 -2
  11. package/{cloud.command-a09wggfq.js → cloud.command-dk5tj39k.js} +8 -8
  12. package/{cloud.script-qd3hpybf.js → cloud.script-ch3xrw3s.js} +8 -8
  13. package/{code.command-ca7rpmez.js → code.command-88sebgnn.js} +7 -7
  14. package/{context.command-9kbm0527.js → context.command-pqsm5jrk.js} +13 -13
  15. package/context.runner-bys6ykcp.js +22 -0
  16. package/{devTui-v19fbnpk.js → devTui-gy6mendg.js} +1 -1
  17. package/{devTuiView-pa63jrjq.js → devTuiView-y1548wy6.js} +1 -1
  18. package/{guideline.command-qvrh5pnx.js → guideline.command-rpc2emw8.js} +2 -2
  19. package/incrementalBuilder.proc.js +1 -1
  20. package/{index-658xafm1.js → index-2pm1j01n.js} +3 -3
  21. package/{index-erzcytap.js → index-2sq06vv0.js} +171 -201
  22. package/{index-1sggq0m8.js → index-3cymrzsb.js} +1 -1
  23. package/{index-ea1smknd.js → index-3mg4h788.js} +2 -2
  24. package/{index-bchkysja.js → index-4cvpzkq6.js} +3 -3
  25. package/{index-egt4vfgb.js → index-4n4821gp.js} +4 -4
  26. package/{index-0qvq9aeb.js → index-57p9p179.js} +3 -3
  27. package/{index-gca9y01h.js → index-6na0sd2b.js} +1 -1
  28. package/{index-sxg87a8f.js → index-bzakk0c2.js} +160 -96
  29. package/{index-bzjnp9ap.js → index-g9zghs4h.js} +10 -10
  30. package/{index-wfwknnje.js → index-jwrpsrg3.js} +8 -6
  31. package/{index-5hy11qaq.js → index-kvzjda3v.js} +3 -3
  32. package/{index-91brpnzb.js → index-n8kt2wh6.js} +5 -5
  33. package/{index-chp5gqmm.js → index-ns128c4q.js} +8 -8
  34. package/{index-va2je2qm.js → index-p0tew3fq.js} +15 -4
  35. package/{index-p1j0cyvd.js → index-p4p9t45x.js} +3 -0
  36. package/{index-f4gpcp98.js → index-qh7brn20.js} +1 -1
  37. package/{index-1p146w4s.js → index-qhtj9y6j.js} +1 -1
  38. package/index-qt8dqgnf.js +250 -0
  39. package/{index-84b080zh.js → index-sn7dnzq4.js} +1 -1
  40. package/{index-d35a8vc0.js → index-te0y1c0m.js} +4 -4
  41. package/{index-3dmebxnk.js → index-v17gj504.js} +2 -2
  42. package/{index-v1y3cx0k.js → index-vpx68e4x.js} +2 -2
  43. package/{index-v156f836.js → index-xjc7gg65.js} +4 -4
  44. package/{index-3hr7cpy1.js → index-zn8qgeqx.js} +1 -1
  45. package/index.js +21 -21
  46. package/{library.command-n89re6cx.js → library.command-m8p2r1dh.js} +3 -3
  47. package/{localRegistry.command-1mmnegph.js → localRegistry.command-yppdqrxv.js} +7 -7
  48. package/{module.command-4m82zgfp.js → module.command-mfzvqt0n.js} +5 -5
  49. package/{package.command-9dv0p6zq.js → package.command-cgp2p2v5.js} +3 -3
  50. package/package.json +8 -3
  51. package/{page.command-q86b0m0z.js → page.command-taenb02b.js} +3 -3
  52. package/{primitive.command-kaneasq6.js → primitive.command-7kpncmkk.js} +6 -6
  53. package/{quality.command-sgapx315.js → quality.command-1ar94hrw.js} +2 -2
  54. package/{repair.command-efc5gdbq.js → repair.command-n08t6j8p.js} +5 -5
  55. package/{scalar.command-e2rpkhqy.js → scalar.command-mq8qfp4t.js} +4 -4
  56. package/{subspace.command-005rz1x6.js → subspace.command-jqv5n79w.js} +4 -4
  57. package/{tunnel.command-66j9estx.js → tunnel.command-ht2es78c.js} +2 -2
  58. package/{workflow.command-z1xcm4c7.js → workflow.command-tvz4nm9n.js} +9 -9
  59. package/{workspace.command-4ahrhp3k.js → workspace.command-txv1yv5e.js} +20 -20
  60. package/context.runner-wtqpw7mh.js +0 -22
  61. package/index-x7g1qzpt.js +0 -121
@@ -11,16 +11,16 @@ import {
11
11
  runner,
12
12
  script,
13
13
  command
14
- } from "./index-gca9y01h.js";
14
+ } from "./index-6na0sd2b.js";
15
15
  import {
16
16
  Executor,
17
17
  WorkspaceExecutor,
18
18
  AppExecutor
19
- } from "./index-p1j0cyvd.js";
19
+ } from "./index-p4p9t45x.js";
20
20
  import"./index-6wwzs1bc.js";
21
21
  import {
22
22
  SlicePlanner
23
- } from "./index-84b080zh.js";
23
+ } from "./index-sn7dnzq4.js";
24
24
  import {
25
25
  LibSource
26
26
  } from "./index-3d9y066c.js";
@@ -725,7 +725,7 @@ class SubspaceRunner extends runner("subspace") {
725
725
  if (!asked)
726
726
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
727
727
  const { libs } = await subspace.slice();
728
- const { CloudScript } = await import("./cloud.script-qd3hpybf.js");
728
+ const { CloudScript } = await import("./cloud.script-ch3xrw3s.js");
729
729
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
730
730
  host,
731
731
  workspaceId,
@@ -9,10 +9,10 @@ import {
9
9
  runner,
10
10
  script,
11
11
  command
12
- } from "./index-gca9y01h.js";
12
+ } from "./index-6na0sd2b.js";
13
13
  import {
14
14
  AppExecutor
15
- } from "./index-p1j0cyvd.js";
15
+ } from "./index-p4p9t45x.js";
16
16
  import"./index-6wwzs1bc.js";
17
17
  import {
18
18
  TunnelShare2
@@ -3,28 +3,28 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-gca9y01h.js";
6
+ } from "./index-6na0sd2b.js";
7
7
  import"./index-q0y2jq9j.js";
8
- import"./index-p1j0cyvd.js";
8
+ import"./index-p4p9t45x.js";
9
9
  import"./index-6wwzs1bc.js";
10
10
  import {
11
11
  createWorkflowStepRegistry
12
- } from "./index-1p146w4s.js";
13
- import"./index-f4gpcp98.js";
12
+ } from "./index-qhtj9y6j.js";
13
+ import"./index-qh7brn20.js";
14
14
  import {
15
15
  ModuleScript
16
- } from "./index-v156f836.js";
16
+ } from "./index-xjc7gg65.js";
17
17
  import {
18
18
  PrimitiveScript
19
- } from "./index-d35a8vc0.js";
19
+ } from "./index-te0y1c0m.js";
20
20
  import {
21
21
  ScalarScript
22
- } from "./index-v1y3cx0k.js";
22
+ } from "./index-vpx68e4x.js";
23
23
  import"./index-by5gpp8x.js";
24
- import"./index-3dmebxnk.js";
24
+ import"./index-v17gj504.js";
25
25
  import {
26
26
  WorkflowRunner
27
- } from "./index-658xafm1.js";
27
+ } from "./index-2pm1j01n.js";
28
28
 
29
29
  // pkgs/@akanjs/cli/workflow/workflow.script.ts
30
30
  import { Logger } from "akanjs/common";
@@ -11,7 +11,7 @@ import {
11
11
  runner,
12
12
  script,
13
13
  command
14
- } from "./index-gca9y01h.js";
14
+ } from "./index-6na0sd2b.js";
15
15
  import {
16
16
  extractAgentBlock,
17
17
  collectScopeRecipeSources,
@@ -21,7 +21,7 @@ import {
21
21
  AppExecutor,
22
22
  LibExecutor,
23
23
  PkgExecutor
24
- } from "./index-p1j0cyvd.js";
24
+ } from "./index-p4p9t45x.js";
25
25
  import"./index-6wwzs1bc.js";
26
26
  import {
27
27
  countBlocking,
@@ -32,43 +32,43 @@ import {
32
32
  collectRecipeSources2,
33
33
  scanRecipes2
34
34
  } from "./index-by5gpp8x.js";
35
- import"./index-1p146w4s.js";
36
- import"./index-3dmebxnk.js";
35
+ import"./index-qhtj9y6j.js";
36
+ import"./index-v17gj504.js";
37
37
  import"./index-twq9p2sp.js";
38
38
  import {
39
39
  AgentScript
40
- } from "./index-5hy11qaq.js";
40
+ } from "./index-kvzjda3v.js";
41
41
  import {
42
42
  ApplicationScript
43
- } from "./index-chp5gqmm.js";
43
+ } from "./index-ns128c4q.js";
44
44
  import {
45
45
  LibraryScript
46
- } from "./index-ea1smknd.js";
46
+ } from "./index-3mg4h788.js";
47
47
  import"./index-hwkygn9s.js";
48
48
  import"./index-7md2g9vw.js";
49
49
  import"./index-kcxmv48c.js";
50
50
  import {
51
51
  PackageScript
52
- } from "./index-va2je2qm.js";
52
+ } from "./index-p0tew3fq.js";
53
53
  import {
54
54
  getNpmRegistryUrl,
55
55
  getLatestPackageVersion
56
- } from "./index-0qvq9aeb.js";
56
+ } from "./index-57p9p179.js";
57
57
  import {
58
58
  CloudScript2
59
- } from "./index-91brpnzb.js";
60
- import"./index-bzjnp9ap.js";
61
- import"./index-1sggq0m8.js";
62
- import"./index-bchkysja.js";
63
- import"./index-658xafm1.js";
64
- import"./index-f4gpcp98.js";
65
- import"./index-v156f836.js";
66
- import"./index-d35a8vc0.js";
67
- import"./index-v1y3cx0k.js";
59
+ } from "./index-n8kt2wh6.js";
60
+ import"./index-g9zghs4h.js";
61
+ import"./index-3cymrzsb.js";
62
+ import"./index-4cvpzkq6.js";
63
+ import"./index-2pm1j01n.js";
64
+ import"./index-qh7brn20.js";
65
+ import"./index-xjc7gg65.js";
66
+ import"./index-te0y1c0m.js";
67
+ import"./index-vpx68e4x.js";
68
68
  import {
69
69
  ContextScript
70
- } from "./index-egt4vfgb.js";
71
- import"./index-84b080zh.js";
70
+ } from "./index-4n4821gp.js";
71
+ import"./index-sn7dnzq4.js";
72
72
 
73
73
  // pkgs/@akanjs/cli/workspace/workspace.runner.ts
74
74
  import path from "path";
@@ -1,22 +0,0 @@
1
- // @bun
2
- import {
3
- ContextRunner2
4
- } from "./index-bzjnp9ap.js";
5
- import"./index-658xafm1.js";
6
- import"./index-v1y3cx0k.js";
7
- import"./index-d35a8vc0.js";
8
- import"./index-bchkysja.js";
9
- import"./index-v156f836.js";
10
- import"./index-f4gpcp98.js";
11
- import"./index-3dmebxnk.js";
12
- import"./index-1p146w4s.js";
13
- import"./index-twq9p2sp.js";
14
- import"./index-1sggq0m8.js";
15
- import"./index-gca9y01h.js";
16
- import"./index-p1j0cyvd.js";
17
- import"./index-by5gpp8x.js";
18
- import"./index-6wwzs1bc.js";
19
- import"./index-q0y2jq9j.js";
20
- export {
21
- ContextRunner2 as ContextRunner
22
- };
package/index-x7g1qzpt.js DELETED
@@ -1,121 +0,0 @@
1
- // @bun
2
- // pkgs/@akanjs/devkit/codeAgent/agent/SubagentPool.ts
3
- import { codeAgentReadOnlyBuiltins } from "akanjs/common";
4
- import { Type } from "typebox";
5
- var maxResultChars = 8000;
6
-
7
- class SubagentPool2 {
8
- static kinds = {
9
- explore: {
10
- readOnly: true,
11
- desc: "reads, searches and reports back. It cannot write a file or run a command."
12
- },
13
- code: {
14
- readOnly: false,
15
- desc: "makes the change itself, with the same tools as this session."
16
- }
17
- };
18
- static defaultKind = "explore";
19
- #options;
20
- #running = 0;
21
- #spent = 0;
22
- constructor(options) {
23
- this.#options = options;
24
- }
25
- static extensionFor(options) {
26
- if (!options.parent.tools.subagent)
27
- return;
28
- if (options.depth >= options.parent.tools.subagent.maxDepth)
29
- return;
30
- const pool = new SubagentPool2(options);
31
- return { name: "akan-subagent", factory: (pi) => pool.#register(pi) };
32
- }
33
- static toolName = "task";
34
- #register(pi) {
35
- pi.registerTool({
36
- name: SubagentPool2.toolName,
37
- label: "Task",
38
- description: "Run a focused sub-agent on one self-contained question and get back its answer. Use it for searching and reading that would otherwise fill this conversation \u2014 the sub-agent's own reading does not come back, only its answer. Give it everything it needs: it cannot see this conversation.",
39
- promptSnippet: "task: run a sub-agent on one self-contained question and get back only its answer",
40
- parameters: Type.Object({
41
- description: Type.String({ description: "Three to five words naming the task, for the activity log." }),
42
- prompt: Type.String({
43
- description: "The complete instruction. The sub-agent sees nothing of this conversation."
44
- }),
45
- type: Type.Optional(Type.Union(Object.entries(SubagentPool2.kinds).map(([kind, spec]) => Type.Literal(kind, { description: spec.desc })), { description: `What the sub-agent may do. Defaults to ${SubagentPool2.defaultKind}.` }))
46
- }),
47
- execute: async (_id, params, signal) => {
48
- const kind = params.type ?? SubagentPool2.defaultKind;
49
- const refusal = this.#refuse();
50
- if (refusal)
51
- return { content: [{ type: "text", text: refusal }], details: undefined, isError: true };
52
- this.#running += 1;
53
- this.#options.onNotice?.(`${kind} sub-agent \xB7 ${params.description}`);
54
- try {
55
- const text = await this.#run(kind, params.prompt, signal);
56
- return { content: [{ type: "text", text }], details: undefined };
57
- } finally {
58
- this.#running -= 1;
59
- }
60
- }
61
- });
62
- }
63
- #refuse() {
64
- const budget = this.#options.parent.tools.subagent;
65
- if (!budget)
66
- return "Sub-agents are disabled by this profile.";
67
- if (this.#running >= budget.maxConcurrent)
68
- return `Too many sub-agents are already running (limit ${budget.maxConcurrent}). Wait for one to finish.`;
69
- if (this.#spent >= budget.budget)
70
- return `The sub-agent token budget (${budget.budget}) is spent. Do the rest of this work yourself.`;
71
- return;
72
- }
73
- static childOf(parent, kind) {
74
- const budget = parent.tools.subagent;
75
- return {
76
- ...parent,
77
- name: `${parent.name}:${kind}`,
78
- tools: {
79
- ...parent.tools,
80
- builtin: SubagentPool2.kinds[kind].readOnly ? parent.tools.builtin.filter((tool) => codeAgentReadOnlyBuiltins.includes(tool)) : parent.tools.builtin,
81
- subagent: budget ? { ...budget, maxDepth: budget.maxDepth } : false
82
- },
83
- session: { store: "memory", crossSession: false },
84
- ui: { canPrompt: false },
85
- context: { projectFiles: false, skills: parent.context.skills }
86
- };
87
- }
88
- async#run(kind, prompt, signal) {
89
- const { CodeAgent } = await import("./CodeAgent-d3wvbq8q.js");
90
- const budget = this.#options.parent.tools.subagent;
91
- const child = SubagentPool2.childOf(this.#options.parent, kind);
92
- const agent = await CodeAgent.create({
93
- workspace: this.#options.workspace,
94
- cwd: this.#options.cwd,
95
- profile: child,
96
- apps: [],
97
- depth: this.#options.depth + 1
98
- });
99
- const abort = () => void agent.abort();
100
- signal?.addEventListener("abort", abort, { once: true });
101
- try {
102
- let answer = "";
103
- agent.on((event) => {
104
- if (event.type === "message" && event.role === "assistant")
105
- answer = event.text;
106
- });
107
- await agent.prompt(prompt);
108
- await agent.waitForIdle();
109
- this.#spent += agent.tokensUsed;
110
- const ceiling = budget ? budget.budget : 0;
111
- this.#options.onNotice?.(`${kind} sub-agent finished, ${agent.tokensUsed} tokens (${this.#spent} of ${ceiling} spent)`);
112
- return answer.length > maxResultChars ? `${answer.slice(0, maxResultChars)}
113
- \u2026(truncated)` : answer || "(no answer)";
114
- } finally {
115
- signal?.removeEventListener("abort", abort);
116
- agent.dispose();
117
- }
118
- }
119
- }
120
-
121
- export { SubagentPool2 };