@akanjs/devkit 3.3.0-rc.69 → 3.3.0-rc.70

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 (101) hide show
  1. package/README.ko.md +2 -1
  2. package/README.md +2 -1
  3. package/akanApp/akanApp.host.ts +15 -2
  4. package/akanApp/akanApp.host.wiring.test.ts +111 -0
  5. package/akanApp/devHostPolicy.ts +5 -0
  6. package/akanApp/devMetadataRestart.ts +93 -0
  7. package/akanApp/devRecycler.test.ts +2 -0
  8. package/akanApp/devRecycler.ts +9 -0
  9. package/codeAgent/index.ts +1 -34
  10. package/codeAgent/skills/akan-page/SKILL.md +9 -4
  11. package/codeAgent/skills/akan-service/SKILL.md +11 -9
  12. package/csrE2e/ssrRegistry.e2e.test.ts +108 -22
  13. package/executors/executors.test.ts +15 -0
  14. package/executors/pkgExecutor.ts +2 -1
  15. package/frontendBuild/csrDevPatcher.test.ts +3 -4
  16. package/frontendBuild/csrDevPatcher.ts +4 -4
  17. package/frontendBuild/devChangePlanner.ts +0 -1
  18. package/frontendBuild/frontendBuild.test.ts +5 -3
  19. package/frontendBuild/ssrBaseArtifactBuilder.ts +12 -7
  20. package/frontendBuild/vendorNarrowing.test.ts +47 -3
  21. package/frontendBuild/vendorNarrowing.ts +10 -2
  22. package/incrementalBuilder/buildBatch.proc.ts +27 -1
  23. package/incrementalBuilder/buildBatchProtocol.ts +1 -0
  24. package/incrementalBuilder/builderWatch.ts +11 -1
  25. package/incrementalBuilder/incrementalBuilder.proc.test.ts +80 -0
  26. package/incrementalBuilder/incrementalBuilder.proc.ts +11 -2
  27. package/incrementalBuilder/pendingMetadata.test.ts +27 -0
  28. package/incrementalBuilder/pendingMetadata.ts +19 -0
  29. package/integration/devStability.integration.test.ts +46 -21
  30. package/package.json +5 -10
  31. package/packageExports.test.ts +3 -2
  32. package/test/fakeTerminal.ts +45 -0
  33. package/tunnel/ssh2Module.ts +2 -6
  34. package/util/devInstallCommand.ts +7 -0
  35. package/workspace/slicePlanner.ts +1 -0
  36. package/codeAgent/agent/AkanCodeCompaction.ts +0 -49
  37. package/codeAgent/agent/AkanCodeServices.ts +0 -122
  38. package/codeAgent/agent/AkanContextFiles.ts +0 -94
  39. package/codeAgent/agent/CodeAgent.ts +0 -626
  40. package/codeAgent/agent/CodeAgentAllowed.ts +0 -35
  41. package/codeAgent/agent/CodeAgentAsks.ts +0 -66
  42. package/codeAgent/agent/CodeAgentCommandLine.ts +0 -372
  43. package/codeAgent/agent/CodeAgentEventMapper.ts +0 -225
  44. package/codeAgent/agent/CodeAgentGate.ts +0 -258
  45. package/codeAgent/agent/CodeAgentProxy.ts +0 -83
  46. package/codeAgent/agent/CodeAgentRpcHost.ts +0 -109
  47. package/codeAgent/agent/CodeAgentRpcListener.ts +0 -195
  48. package/codeAgent/agent/CodeAgentStreamPrinter.ts +0 -86
  49. package/codeAgent/agent/CodeAgentSuspended.ts +0 -85
  50. package/codeAgent/agent/CodeAgentUi.ts +0 -47
  51. package/codeAgent/agent/CodeMailbox.ts +0 -148
  52. package/codeAgent/agent/CodeSessionFork.ts +0 -56
  53. package/codeAgent/agent/CodeSessionIndex.ts +0 -78
  54. package/codeAgent/agent/SubagentPool.ts +0 -219
  55. package/codeAgent/agent/WorkspaceTrust.ts +0 -200
  56. package/codeAgent/agent/akanCodeCompaction.test.ts +0 -36
  57. package/codeAgent/agent/akanCodeModel.ts +0 -47
  58. package/codeAgent/agent/akanCodeServices.test.ts +0 -54
  59. package/codeAgent/agent/akanContextFiles.test.ts +0 -116
  60. package/codeAgent/agent/akanSystemPrompt.ts +0 -50
  61. package/codeAgent/agent/codeAgent.test.ts +0 -337
  62. package/codeAgent/agent/codeAgentCommandLine.test.ts +0 -212
  63. package/codeAgent/agent/codeAgentContract.test.ts +0 -755
  64. package/codeAgent/agent/codeAgentHosts.ts +0 -30
  65. package/codeAgent/agent/codeAgentProxy.test.ts +0 -126
  66. package/codeAgent/agent/codeAgentRpcListener.test.ts +0 -215
  67. package/codeAgent/agent/codeAgentSuspended.test.ts +0 -47
  68. package/codeAgent/agent/codeMailbox.test.ts +0 -76
  69. package/codeAgent/agent/codeSessionFork.test.ts +0 -58
  70. package/codeAgent/agent/codeSessionIndex.test.ts +0 -77
  71. package/codeAgent/agent/consoleToStderr.ts +0 -8
  72. package/codeAgent/agent/jsonLines.ts +0 -29
  73. package/codeAgent/agent/stringArg.ts +0 -5
  74. package/codeAgent/feedback/DevLogFeedback.ts +0 -82
  75. package/codeAgent/feedback/PreviewFeedback.ts +0 -46
  76. package/codeAgent/feedback/TurnFeedback.ts +0 -98
  77. package/codeAgent/feedback/VerifyFeedback.ts +0 -39
  78. package/codeAgent/tools/AkanCli.ts +0 -51
  79. package/codeAgent/tools/AkanCodePlugins.ts +0 -142
  80. package/codeAgent/tools/AkanEditScope.ts +0 -53
  81. package/codeAgent/tools/AkanEnvKeys.ts +0 -50
  82. package/codeAgent/tools/AkanToolPack.ts +0 -86
  83. package/codeAgent/tools/AkanVerifier.ts +0 -30
  84. package/codeAgent/tools/AskToolPack.ts +0 -99
  85. package/codeAgent/tools/DeepSeekWeb.ts +0 -127
  86. package/codeAgent/tools/MailToolPack.ts +0 -76
  87. package/codeAgent/tools/McpClient.ts +0 -209
  88. package/codeAgent/tools/McpOAuth.ts +0 -233
  89. package/codeAgent/tools/McpOAuthLoopback.ts +0 -64
  90. package/codeAgent/tools/McpServerConfig.ts +0 -131
  91. package/codeAgent/tools/McpSignIn.ts +0 -158
  92. package/codeAgent/tools/McpTokenStore.ts +0 -128
  93. package/codeAgent/tools/McpToolPack.ts +0 -206
  94. package/codeAgent/tools/SessionToolPack.ts +0 -91
  95. package/codeAgent/tools/WebToolPack.ts +0 -315
  96. package/codeAgent/tools/akanCodePlugins.test.ts +0 -954
  97. package/codeAgent/tools/askToolPack.test.ts +0 -116
  98. package/codeAgent/tools/deepSeekWeb.test.ts +0 -113
  99. package/codeAgent/tools/mcpOAuth.test.ts +0 -648
  100. package/codeAgent/tools/mcpServerConfig.test.ts +0 -341
  101. package/piDependencyPins.test.ts +0 -45
@@ -1,94 +0,0 @@
1
- import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
2
- import path from "node:path";
3
-
4
- export interface AkanContextFile {
5
- path: string;
6
- content: string;
7
- }
8
-
9
- export interface AkanContextFilesOptions {
10
- workspaceRoot: string;
11
- cwd: string;
12
- }
13
-
14
- // The engine takes only the first of `AGENTS.override.md · AGENTS.md · CLAUDE.md` per directory and never reads
15
- // `.cursor/rules`; this appends what it drops, after the engine's own list.
16
- export class AkanContextFiles {
17
- /** Cursor's frontmatter block, which is metadata for its own rule picker and not instruction for a model. */
18
- static readonly #frontmatter = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
19
-
20
- static extend(base: AkanContextFile[], options: AkanContextFilesOptions): AkanContextFile[] {
21
- const seen = new Set(base.map((file) => file.path));
22
- // Keyed by content too: the usual way to carry both names is a symlink or a one-line pointer.
23
- const contents = new Set(base.map((file) => file.content.trim()));
24
- const added: AkanContextFile[] = [];
25
- for (const file of [...AkanContextFiles.#claude(base), ...AkanContextFiles.#cursor(options)]) {
26
- if (seen.has(file.path) || contents.has(file.content.trim()) || !file.content.trim()) continue;
27
- seen.add(file.path);
28
- contents.add(file.content.trim());
29
- added.push(file);
30
- }
31
- return [...base, ...added];
32
- }
33
-
34
- // Not beside an `AGENTS.override.md`: that file exists to displace the others in its directory.
35
- static #claude(base: AkanContextFile[]) {
36
- const files: AkanContextFile[] = [];
37
- for (const file of base) {
38
- if (!/^AGENTS\.(md|MD)$/.test(path.basename(file.path))) continue;
39
- for (const name of ["CLAUDE.md", "CLAUDE.MD"]) {
40
- const candidate = path.join(path.dirname(file.path), name);
41
- const content = AkanContextFiles.#read(candidate);
42
- if (content !== undefined) files.push({ path: candidate, content });
43
- }
44
- }
45
- return files;
46
- }
47
-
48
- // Only `alwaysApply: true` or frontmatter-less rules: Cursor's `globs`/`description`/manual kinds are scoped.
49
- static #cursor(options: AkanContextFilesOptions) {
50
- const files: AkanContextFile[] = [];
51
- const roots = [...new Set([options.workspaceRoot, options.cwd])];
52
- for (const root of roots) {
53
- const legacy = AkanContextFiles.#read(path.join(root, ".cursorrules"));
54
- if (legacy !== undefined) files.push({ path: path.join(root, ".cursorrules"), content: legacy });
55
- for (const file of AkanContextFiles.#mdcFiles(path.join(root, ".cursor", "rules"))) {
56
- const raw = AkanContextFiles.#read(file);
57
- if (raw === undefined) continue;
58
- const body = AkanContextFiles.#applied(raw);
59
- if (body !== undefined) files.push({ path: file, content: body });
60
- }
61
- }
62
- return files;
63
- }
64
-
65
- static #applied(raw: string) {
66
- const match = AkanContextFiles.#frontmatter.exec(raw);
67
- if (!match) return raw;
68
- if (!/^\s*alwaysApply\s*:\s*true\s*$/m.test(match[1] ?? "")) return undefined;
69
- return raw.slice(match[0].length);
70
- }
71
-
72
- /** Sorted, because the order rules reach the model in is otherwise the order a directory happens to list. */
73
- static #mdcFiles(dir: string) {
74
- if (!existsSync(dir)) return [];
75
- try {
76
- return readdirSync(dir, { recursive: true, withFileTypes: true })
77
- .filter((entry) => entry.isFile() && entry.name.endsWith(".mdc"))
78
- .map((entry) => path.join(entry.parentPath ?? dir, entry.name))
79
- .sort();
80
- } catch {
81
- return [];
82
- }
83
- }
84
-
85
- static #read(file: string) {
86
- try {
87
- if (!existsSync(file) || !statSync(file).isFile()) return undefined;
88
- return readFileSync(file, "utf8").replace(/^/, "");
89
- } catch {
90
- // A rule file that cannot be read costs its own rules. It must not cost the session its start.
91
- return undefined;
92
- }
93
- }
94
- }