@galaxy-stack/ai-coder-core 0.1.0

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 (197) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +131 -0
  3. package/dist/approval/approval-policy.d.ts +31 -0
  4. package/dist/approval/approval-policy.d.ts.map +1 -0
  5. package/dist/approval/approval-policy.js +179 -0
  6. package/dist/approval/approval-policy.js.map +1 -0
  7. package/dist/approval/index.d.ts +2 -0
  8. package/dist/approval/index.d.ts.map +1 -0
  9. package/dist/approval/index.js +2 -0
  10. package/dist/approval/index.js.map +1 -0
  11. package/dist/context/attachment-types.d.ts +35 -0
  12. package/dist/context/attachment-types.d.ts.map +1 -0
  13. package/dist/context/attachment-types.js +9 -0
  14. package/dist/context/attachment-types.js.map +1 -0
  15. package/dist/context/checkpoint.d.ts +194 -0
  16. package/dist/context/checkpoint.d.ts.map +1 -0
  17. package/dist/context/checkpoint.js +921 -0
  18. package/dist/context/checkpoint.js.map +1 -0
  19. package/dist/context/context-manager.d.ts +153 -0
  20. package/dist/context/context-manager.d.ts.map +1 -0
  21. package/dist/context/context-manager.js +541 -0
  22. package/dist/context/context-manager.js.map +1 -0
  23. package/dist/context/context-profile.d.ts +42 -0
  24. package/dist/context/context-profile.d.ts.map +1 -0
  25. package/dist/context/context-profile.js +102 -0
  26. package/dist/context/context-profile.js.map +1 -0
  27. package/dist/context/index.d.ts +7 -0
  28. package/dist/context/index.d.ts.map +1 -0
  29. package/dist/context/index.js +7 -0
  30. package/dist/context/index.js.map +1 -0
  31. package/dist/context/token-ledger.d.ts +102 -0
  32. package/dist/context/token-ledger.d.ts.map +1 -0
  33. package/dist/context/token-ledger.js +205 -0
  34. package/dist/context/token-ledger.js.map +1 -0
  35. package/dist/context/tool-output.d.ts +46 -0
  36. package/dist/context/tool-output.d.ts.map +1 -0
  37. package/dist/context/tool-output.js +82 -0
  38. package/dist/context/tool-output.js.map +1 -0
  39. package/dist/deterministic-order.d.ts +3 -0
  40. package/dist/deterministic-order.d.ts.map +1 -0
  41. package/dist/deterministic-order.js +5 -0
  42. package/dist/deterministic-order.js.map +1 -0
  43. package/dist/index.d.ts +19 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +19 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/ports/approval-port.d.ts +29 -0
  48. package/dist/ports/approval-port.d.ts.map +1 -0
  49. package/dist/ports/approval-port.js +9 -0
  50. package/dist/ports/approval-port.js.map +1 -0
  51. package/dist/ports/artifact-port.d.ts +66 -0
  52. package/dist/ports/artifact-port.d.ts.map +1 -0
  53. package/dist/ports/artifact-port.js +9 -0
  54. package/dist/ports/artifact-port.js.map +1 -0
  55. package/dist/ports/capability-port.d.ts +62 -0
  56. package/dist/ports/capability-port.d.ts.map +1 -0
  57. package/dist/ports/capability-port.js +9 -0
  58. package/dist/ports/capability-port.js.map +1 -0
  59. package/dist/ports/coding-model-port.d.ts +12 -0
  60. package/dist/ports/coding-model-port.d.ts.map +1 -0
  61. package/dist/ports/coding-model-port.js +9 -0
  62. package/dist/ports/coding-model-port.js.map +1 -0
  63. package/dist/ports/command-port.d.ts +94 -0
  64. package/dist/ports/command-port.d.ts.map +1 -0
  65. package/dist/ports/command-port.js +9 -0
  66. package/dist/ports/command-port.js.map +1 -0
  67. package/dist/ports/execution-context.d.ts +30 -0
  68. package/dist/ports/execution-context.d.ts.map +1 -0
  69. package/dist/ports/execution-context.js +11 -0
  70. package/dist/ports/execution-context.js.map +1 -0
  71. package/dist/ports/git-port.d.ts +27 -0
  72. package/dist/ports/git-port.d.ts.map +1 -0
  73. package/dist/ports/git-port.js +9 -0
  74. package/dist/ports/git-port.js.map +1 -0
  75. package/dist/ports/host-adapter.d.ts +36 -0
  76. package/dist/ports/host-adapter.d.ts.map +1 -0
  77. package/dist/ports/host-adapter.js +9 -0
  78. package/dist/ports/host-adapter.js.map +1 -0
  79. package/dist/ports/index.d.ts +16 -0
  80. package/dist/ports/index.d.ts.map +1 -0
  81. package/dist/ports/index.js +16 -0
  82. package/dist/ports/index.js.map +1 -0
  83. package/dist/ports/pagination.d.ts +17 -0
  84. package/dist/ports/pagination.d.ts.map +1 -0
  85. package/dist/ports/pagination.js +9 -0
  86. package/dist/ports/pagination.js.map +1 -0
  87. package/dist/ports/persistence-port.d.ts +59 -0
  88. package/dist/ports/persistence-port.d.ts.map +1 -0
  89. package/dist/ports/persistence-port.js +9 -0
  90. package/dist/ports/persistence-port.js.map +1 -0
  91. package/dist/ports/port-result.d.ts +29 -0
  92. package/dist/ports/port-result.d.ts.map +1 -0
  93. package/dist/ports/port-result.js +20 -0
  94. package/dist/ports/port-result.js.map +1 -0
  95. package/dist/ports/preview-port.d.ts +27 -0
  96. package/dist/ports/preview-port.d.ts.map +1 -0
  97. package/dist/ports/preview-port.js +9 -0
  98. package/dist/ports/preview-port.js.map +1 -0
  99. package/dist/ports/research-port.d.ts +40 -0
  100. package/dist/ports/research-port.d.ts.map +1 -0
  101. package/dist/ports/research-port.js +9 -0
  102. package/dist/ports/research-port.js.map +1 -0
  103. package/dist/ports/trace-port.d.ts +26 -0
  104. package/dist/ports/trace-port.d.ts.map +1 -0
  105. package/dist/ports/trace-port.js +9 -0
  106. package/dist/ports/trace-port.js.map +1 -0
  107. package/dist/ports/workspace-port.d.ts +126 -0
  108. package/dist/ports/workspace-port.d.ts.map +1 -0
  109. package/dist/ports/workspace-port.js +9 -0
  110. package/dist/ports/workspace-port.js.map +1 -0
  111. package/dist/prompt/index.d.ts +2 -0
  112. package/dist/prompt/index.d.ts.map +1 -0
  113. package/dist/prompt/index.js +2 -0
  114. package/dist/prompt/index.js.map +1 -0
  115. package/dist/prompt/prompt-assembler.d.ts +114 -0
  116. package/dist/prompt/prompt-assembler.d.ts.map +1 -0
  117. package/dist/prompt/prompt-assembler.js +363 -0
  118. package/dist/prompt/prompt-assembler.js.map +1 -0
  119. package/dist/retrieval/evidence.d.ts +41 -0
  120. package/dist/retrieval/evidence.d.ts.map +1 -0
  121. package/dist/retrieval/evidence.js +48 -0
  122. package/dist/retrieval/evidence.js.map +1 -0
  123. package/dist/retrieval/index.d.ts +4 -0
  124. package/dist/retrieval/index.d.ts.map +1 -0
  125. package/dist/retrieval/index.js +4 -0
  126. package/dist/retrieval/index.js.map +1 -0
  127. package/dist/retrieval/lexical-retriever.d.ts +56 -0
  128. package/dist/retrieval/lexical-retriever.d.ts.map +1 -0
  129. package/dist/retrieval/lexical-retriever.js +128 -0
  130. package/dist/retrieval/lexical-retriever.js.map +1 -0
  131. package/dist/retrieval/retrieval-policy.d.ts +25 -0
  132. package/dist/retrieval/retrieval-policy.d.ts.map +1 -0
  133. package/dist/retrieval/retrieval-policy.js +71 -0
  134. package/dist/retrieval/retrieval-policy.js.map +1 -0
  135. package/dist/runtime/completion-gate.d.ts +75 -0
  136. package/dist/runtime/completion-gate.d.ts.map +1 -0
  137. package/dist/runtime/completion-gate.js +114 -0
  138. package/dist/runtime/completion-gate.js.map +1 -0
  139. package/dist/runtime/index.d.ts +7 -0
  140. package/dist/runtime/index.d.ts.map +1 -0
  141. package/dist/runtime/index.js +7 -0
  142. package/dist/runtime/index.js.map +1 -0
  143. package/dist/runtime/run-controller.d.ts +55 -0
  144. package/dist/runtime/run-controller.d.ts.map +1 -0
  145. package/dist/runtime/run-controller.js +2673 -0
  146. package/dist/runtime/run-controller.js.map +1 -0
  147. package/dist/runtime/runtime-error.d.ts +7 -0
  148. package/dist/runtime/runtime-error.d.ts.map +1 -0
  149. package/dist/runtime/runtime-error.js +11 -0
  150. package/dist/runtime/runtime-error.js.map +1 -0
  151. package/dist/runtime/runtime-types.d.ts +303 -0
  152. package/dist/runtime/runtime-types.d.ts.map +1 -0
  153. package/dist/runtime/runtime-types.js +2 -0
  154. package/dist/runtime/runtime-types.js.map +1 -0
  155. package/dist/runtime/state-machine.d.ts +27 -0
  156. package/dist/runtime/state-machine.d.ts.map +1 -0
  157. package/dist/runtime/state-machine.js +68 -0
  158. package/dist/runtime/state-machine.js.map +1 -0
  159. package/dist/runtime/trace-emitter.d.ts +17 -0
  160. package/dist/runtime/trace-emitter.d.ts.map +1 -0
  161. package/dist/runtime/trace-emitter.js +91 -0
  162. package/dist/runtime/trace-emitter.js.map +1 -0
  163. package/dist/tools/coding-messages.d.ts +112 -0
  164. package/dist/tools/coding-messages.d.ts.map +1 -0
  165. package/dist/tools/coding-messages.js +20 -0
  166. package/dist/tools/coding-messages.js.map +1 -0
  167. package/dist/tools/index.d.ts +7 -0
  168. package/dist/tools/index.d.ts.map +1 -0
  169. package/dist/tools/index.js +7 -0
  170. package/dist/tools/index.js.map +1 -0
  171. package/dist/tools/json-schema.d.ts +18 -0
  172. package/dist/tools/json-schema.d.ts.map +1 -0
  173. package/dist/tools/json-schema.js +299 -0
  174. package/dist/tools/json-schema.js.map +1 -0
  175. package/dist/tools/settings-types.d.ts +41 -0
  176. package/dist/tools/settings-types.d.ts.map +1 -0
  177. package/dist/tools/settings-types.js +88 -0
  178. package/dist/tools/settings-types.js.map +1 -0
  179. package/dist/tools/tool-effect-profile.d.ts +44 -0
  180. package/dist/tools/tool-effect-profile.d.ts.map +1 -0
  181. package/dist/tools/tool-effect-profile.js +157 -0
  182. package/dist/tools/tool-effect-profile.js.map +1 -0
  183. package/dist/tools/tool-registry-types.d.ts +72 -0
  184. package/dist/tools/tool-registry-types.d.ts.map +1 -0
  185. package/dist/tools/tool-registry-types.js +9 -0
  186. package/dist/tools/tool-registry-types.js.map +1 -0
  187. package/dist/tools/tool-registry.d.ts +155 -0
  188. package/dist/tools/tool-registry.d.ts.map +1 -0
  189. package/dist/tools/tool-registry.js +599 -0
  190. package/dist/tools/tool-registry.js.map +1 -0
  191. package/dist/tools/tool-registry.schema.json +144 -0
  192. package/docs/ARCHITECTURE.md +259 -0
  193. package/docs/HOST_CONFORMANCE.md +210 -0
  194. package/docs/PROMPT_CONTRACT.md +123 -0
  195. package/docs/TOOL_EFFECT_PROFILE.md +77 -0
  196. package/docs/TOOL_REGISTRY_COMPARISON.md +358 -0
  197. package/package.json +76 -0
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Canonical host-effect policy for the built-in AI Coder tool catalog.
3
+ *
4
+ * Hosts must consume this profile instead of maintaining a local copy. The
5
+ * runtime treats these entries as a maximum authority boundary: a tool may
6
+ * omit an allowed effect, but it must never emit an effect absent here.
7
+ */
8
+ import { compareAiCoderText } from "../deterministic-order.js";
9
+ import { AI_CODER_CORE_TOOL_CATALOG } from "./tool-registry.js";
10
+ const EFFECT_CAPABILITY_NAMES = [
11
+ "approval",
12
+ "criterion_satisfy",
13
+ "criterion_waive",
14
+ "diff_review",
15
+ "inspect",
16
+ "plan",
17
+ "research",
18
+ "state_version",
19
+ "validate",
20
+ "write",
21
+ ];
22
+ export const AI_CODER_TOOL_EFFECT_CAPABILITIES = Object.freeze([...EFFECT_CAPABILITY_NAMES]);
23
+ export const AI_CODER_CORE_TOOL_EFFECT_PROFILE_VERSION = "1.1.0";
24
+ function effectCapabilities(...values) {
25
+ return Object.freeze([...values].sort(compareAiCoderText));
26
+ }
27
+ /**
28
+ * Exact effect capabilities for all 21 built-in tools. An empty or omitted
29
+ * effect is always valid; these arrays only describe effects a host may attest.
30
+ * Acceptance-criterion effects intentionally remain unavailable to built-in
31
+ * tools until a dedicated evidence-bearing contract is introduced.
32
+ */
33
+ export const AI_CODER_CORE_TOOL_EFFECT_PROFILE = Object.freeze({
34
+ "artifact.create": effectCapabilities("approval", "state_version"),
35
+ "artifact.list": effectCapabilities("approval"),
36
+ "artifact.read": effectCapabilities("approval"),
37
+ "catalog.search": effectCapabilities("approval", "state_version"),
38
+ "command.run": effectCapabilities("approval", "state_version", "write"),
39
+ "command.session": effectCapabilities("approval", "state_version", "write"),
40
+ "git.exec": effectCapabilities("approval", "diff_review", "inspect"),
41
+ "perception.analyze": effectCapabilities("approval"),
42
+ "preview.manage": effectCapabilities("approval", "state_version"),
43
+ "project.detect": effectCapabilities("approval", "inspect"),
44
+ "project.validate": effectCapabilities("approval", "state_version", "validate", "write"),
45
+ "research.fetch": effectCapabilities("approval", "research"),
46
+ "research.search": effectCapabilities("approval", "research"),
47
+ "task.checkpoint": effectCapabilities("approval", "plan", "state_version"),
48
+ "user.ask": effectCapabilities("approval"),
49
+ "workspace.edit": effectCapabilities("approval", "state_version", "write"),
50
+ "workspace.glob": effectCapabilities("approval", "inspect"),
51
+ "workspace.grep": effectCapabilities("approval", "inspect"),
52
+ "workspace.list": effectCapabilities("approval", "inspect"),
53
+ "workspace.read": effectCapabilities("approval", "inspect"),
54
+ "workspace.write": effectCapabilities("approval", "state_version", "write"),
55
+ });
56
+ function ownEntry(value, key) {
57
+ return Object.prototype.hasOwnProperty.call(value, key);
58
+ }
59
+ /** Return every catalog/profile drift issue without throwing at the first one. */
60
+ export function validateAiCoderCoreToolEffectProfile(input = {}) {
61
+ const descriptors = input.descriptors ?? AI_CODER_CORE_TOOL_CATALOG;
62
+ const profile = input.effectCapabilities ?? AI_CODER_CORE_TOOL_EFFECT_PROFILE;
63
+ const errors = [];
64
+ const allowed = new Set(AI_CODER_TOOL_EFFECT_CAPABILITIES);
65
+ const catalogIds = new Set();
66
+ const modelNames = new Set();
67
+ for (const descriptor of descriptors) {
68
+ if (!descriptor.id.trim())
69
+ errors.push("Catalog contains an empty canonical tool ID.");
70
+ else if (catalogIds.has(descriptor.id))
71
+ errors.push(`Duplicate canonical tool ID: ${descriptor.id}.`);
72
+ else
73
+ catalogIds.add(descriptor.id);
74
+ if (!descriptor.modelName.trim())
75
+ errors.push(`Tool ${descriptor.id || "<empty>"} has an empty model name.`);
76
+ else if (modelNames.has(descriptor.modelName))
77
+ errors.push(`Duplicate model-facing tool name: ${descriptor.modelName}.`);
78
+ else
79
+ modelNames.add(descriptor.modelName);
80
+ }
81
+ for (const id of [...catalogIds].sort(compareAiCoderText)) {
82
+ if (!ownEntry(profile, id))
83
+ errors.push(`Effect profile is missing core tool ${id}.`);
84
+ }
85
+ for (const id of Object.keys(profile).sort(compareAiCoderText)) {
86
+ if (!catalogIds.has(id))
87
+ errors.push(`Effect profile contains unknown core tool ${id}.`);
88
+ const values = profile[id];
89
+ if (!Array.isArray(values)) {
90
+ errors.push(`Effect profile for ${id} must be an array.`);
91
+ continue;
92
+ }
93
+ const normalized = [...new Set(values)].sort(compareAiCoderText);
94
+ if (normalized.length !== values.length)
95
+ errors.push(`Effect profile for ${id} contains duplicates.`);
96
+ if (normalized.some((value, index) => value !== values[index])) {
97
+ errors.push(`Effect profile for ${id} must use canonical deterministic order.`);
98
+ }
99
+ for (const value of values) {
100
+ if (!allowed.has(value))
101
+ errors.push(`Effect profile for ${id} contains unknown capability ${value}.`);
102
+ }
103
+ }
104
+ return Object.freeze(errors);
105
+ }
106
+ export function assertAiCoderCoreToolEffectProfile(input = {}) {
107
+ const errors = validateAiCoderCoreToolEffectProfile(input);
108
+ if (errors.length > 0)
109
+ throw new Error(`Invalid AI Coder core tool effect profile: ${errors.join(" ")}`);
110
+ }
111
+ /**
112
+ * Fail closed when a host changes the authority of a built-in tool. Unknown
113
+ * canonical IDs are extension/MCP tools and remain governed by the host's
114
+ * explicitly declared profile.
115
+ */
116
+ export function assertAiCoderCoreToolEffectCapabilities(canonicalToolId, actual) {
117
+ const expected = AI_CODER_CORE_TOOL_EFFECT_PROFILE[canonicalToolId];
118
+ if (expected === undefined)
119
+ return;
120
+ const normalized = [...new Set(actual)].sort(compareAiCoderText);
121
+ if (normalized.length !== actual.length
122
+ || normalized.some((value, index) => value !== expected[index])
123
+ || normalized.length !== expected.length) {
124
+ throw new Error(`Core tool ${canonicalToolId} effect capabilities drifted; expected [${expected.join(", ")}], received [${actual.join(", ")}].`);
125
+ }
126
+ }
127
+ /**
128
+ * Build the exact active model-name mapping plus the complete stable effect
129
+ * policy expected by `AiCoderRuntimeToolSet`. Hosts should call this for the
130
+ * registry's active descriptors on every tool-set snapshot.
131
+ */
132
+ export function createAiCoderCoreToolEffectMetadata(descriptors) {
133
+ const canonicalToolIds = {};
134
+ const seenIds = new Set();
135
+ for (const descriptor of [...descriptors].sort((left, right) => compareAiCoderText(left.id, right.id))) {
136
+ const capabilities = AI_CODER_CORE_TOOL_EFFECT_PROFILE[descriptor.id];
137
+ if (capabilities === undefined)
138
+ throw new Error(`No core effect profile exists for ${descriptor.id}.`);
139
+ if (seenIds.has(descriptor.id))
140
+ throw new Error(`Duplicate active canonical tool ID: ${descriptor.id}.`);
141
+ if (ownEntry(canonicalToolIds, descriptor.modelName)) {
142
+ throw new Error(`Duplicate active model-facing tool name: ${descriptor.modelName}.`);
143
+ }
144
+ seenIds.add(descriptor.id);
145
+ canonicalToolIds[descriptor.modelName] = descriptor.id;
146
+ }
147
+ return Object.freeze({
148
+ canonicalToolIds: Object.freeze(canonicalToolIds),
149
+ // Keep the complete profile stable across lazy tool activation. The
150
+ // runtime still limits invocation/result identity to canonicalToolIds.
151
+ effectCapabilities: AI_CODER_CORE_TOOL_EFFECT_PROFILE,
152
+ });
153
+ }
154
+ // A catalog/profile mismatch is a package construction error, not a condition
155
+ // a host is allowed to recover from with a locally invented policy.
156
+ assertAiCoderCoreToolEffectProfile();
157
+ //# sourceMappingURL=tool-effect-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-effect-profile.js","sourceRoot":"","sources":["../../src/tools/tool-effect-profile.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,MAAM,uBAAuB,GAAG;IAC9B,UAAU;IACV,mBAAmB;IACnB,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,MAAM;IACN,UAAU;IACV,eAAe;IACf,UAAU;IACV,OAAO;CACC,CAAC;AAIX,MAAM,CAAC,MAAM,iCAAiC,GAA2C,MAAM,CAAC,MAAM,CACpG,CAAC,GAAG,uBAAuB,CAAC,CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,yCAAyC,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QACjD,oEAAoE;QACpE,uEAAuE;QACvE,kBAAkB,EAAE,iCAAiC;KACtD,CAAC,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,oEAAoE;AACpE,kCAAkC,EAAE,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @author Bùi Trọng Hiếu
3
+ * @email kevinbui210191@gmail.com
4
+ * @create date 2026-08-21
5
+ * @modify date 2026-08-21
6
+ * @desc Tool descriptor shape used by the registry, router, and approval policy.
7
+ */
8
+ import type { AiCoderTaskMode } from "../ports/execution-context.js";
9
+ import type { AiCoderJsonSchema } from "./json-schema.js";
10
+ export type AiCoderToolCategory = "artifact" | "bootstrap" | "command" | "communication" | "git" | "perception" | "preview" | "project" | "research" | "workspace";
11
+ export type AiCoderToolModality = "text" | "image" | "video" | "audio" | "structured_data" | "artifact";
12
+ export type AiCoderToolRisk = "low" | "medium" | "high" | "critical";
13
+ export type AiCoderToolMutability = "read" | "write" | "execute" | "external_side_effect";
14
+ export type AiCoderToolTransport = "native" | "core" | "extension" | "mcp";
15
+ export type AiCoderToolIdempotency = "safe" | "with_key" | "unsafe";
16
+ export type AiCoderToolRunMode = AiCoderTaskMode;
17
+ export type AiCoderToolDescriptor = Readonly<{
18
+ category: AiCoderToolCategory;
19
+ description: string;
20
+ enabledByDefault: boolean;
21
+ id: string;
22
+ idempotency: AiCoderToolIdempotency;
23
+ inputSchema: AiCoderJsonSchema;
24
+ maxOutputBytes: number;
25
+ maxOutputTokens: number;
26
+ modalities: Readonly<{
27
+ accepts: readonly AiCoderToolModality[];
28
+ produces: readonly AiCoderToolModality[];
29
+ requiredModelCapabilities?: readonly string[];
30
+ }>;
31
+ modelName: string;
32
+ mutability: AiCoderToolMutability;
33
+ outputSchema: AiCoderJsonSchema;
34
+ permissions: readonly string[];
35
+ risk: AiCoderToolRisk;
36
+ source: Readonly<{
37
+ extensionId?: string;
38
+ owner: "base" | "core" | "extension" | "mcp";
39
+ serverId?: string;
40
+ }>;
41
+ supportsCancellation: boolean;
42
+ supportsPagination: boolean;
43
+ timeoutMs: number;
44
+ title: string;
45
+ transport: AiCoderToolTransport;
46
+ version: string;
47
+ }>;
48
+ export type AiCoderToolDiagnostic = Readonly<{
49
+ included: boolean;
50
+ reason: string;
51
+ toolId: string;
52
+ viaFallback?: string;
53
+ }>;
54
+ export type AiCoderToolRegistrySnapshot = Readonly<{
55
+ /** Hash of every descriptor visible after host capability, permission, and mode filtering. */
56
+ catalogHash: string;
57
+ descriptors: readonly AiCoderToolDescriptor[];
58
+ diagnostics: readonly AiCoderToolDiagnostic[];
59
+ /** @deprecated Use catalogHash. Kept for trace compatibility during the v2 migration. */
60
+ hash: string;
61
+ mode: AiCoderToolRunMode;
62
+ schemaVersion: string;
63
+ }>;
64
+ export type AiCoderActiveToolSnapshot = Readonly<{
65
+ /** Hash of the parent filtered catalog. */
66
+ catalogHash: string;
67
+ descriptors: readonly AiCoderToolDescriptor[];
68
+ /** Hash of the exact, canonically ordered tool definitions sent in one model turn. */
69
+ hash: string;
70
+ schemaVersion: string;
71
+ }>;
72
+ //# sourceMappingURL=tool-registry-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-registry-types.d.ts","sourceRoot":"","sources":["../../src/tools/tool-registry-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,WAAW,GACX,SAAS,GACT,eAAe,GACf,KAAK,GACL,YAAY,GACZ,SAAS,GACT,SAAS,GACT,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,iBAAiB,GAAG,UAAU,CAAC;AACxG,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ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B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,oBAAoB,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,8FAA8F;IAC9F,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC9C,WAAW,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC9C,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,kBAAkB,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC/C,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC9C,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author Bùi Trọng Hiếu
3
+ * @email kevinbui210191@gmail.com
4
+ * @create date 2026-08-21
5
+ * @modify date 2026-08-21
6
+ * @desc Tool descriptor shape used by the registry, router, and approval policy.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=tool-registry-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-registry-types.js","sourceRoot":"","sources":["../../src/tools/tool-registry-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * @author Bùi Trọng Hiếu
3
+ * @email kevinbui210191@gmail.com
4
+ * @create date 2026-08-21
5
+ * @modify date 2026-08-28
6
+ * @desc Canonical, immutable single-agent tool catalog and turn-scoped registry.
7
+ */
8
+ import type { ModelCapabilities } from "../ports/capability-port.js";
9
+ import type { CodingToolDefinition } from "./coding-messages.js";
10
+ import { type AiCoderJsonSchema } from "./json-schema.js";
11
+ import type { AiCoderActiveToolSnapshot, AiCoderToolDescriptor, AiCoderToolModality, AiCoderToolRegistrySnapshot, AiCoderToolRunMode } from "./tool-registry-types.js";
12
+ export declare const AI_CODER_TOOL_REGISTRY_SCHEMA_VERSION = "2.0.0";
13
+ export declare const AI_CODER_TOOL_DEFINITION_BUDGET = 10000;
14
+ export type LegacyToolTarget = Readonly<{
15
+ kind: "galaxy-core" | "native";
16
+ name: string;
17
+ }>;
18
+ export declare const AI_CODER_CORE_TOOL_CATALOG: readonly AiCoderToolDescriptor[];
19
+ export declare const AI_CODER_LEGACY_TOOL_TARGETS: Readonly<Record<string, LegacyToolTarget>>;
20
+ export declare function isAiCoderToolAllowedInMode(tool: AiCoderToolDescriptor, mode: AiCoderToolRunMode): boolean;
21
+ export declare function createAiCoderToolRegistrySnapshot(options: Readonly<{
22
+ availableToolIds: ReadonlySet<string>;
23
+ capabilities: ModelCapabilities;
24
+ descriptors?: readonly AiCoderToolDescriptor[];
25
+ grantedPermissions: ReadonlySet<string>;
26
+ mode?: AiCoderToolRunMode;
27
+ }>): AiCoderToolRegistrySnapshot;
28
+ export declare function descriptorToModelDefinition(tool: AiCoderToolDescriptor): CodingToolDefinition;
29
+ export declare function estimateToolDefinitionTokens(definitions: readonly CodingToolDefinition[]): number;
30
+ export declare class AiCoderToolRegistry {
31
+ readonly snapshot: AiCoderToolRegistrySnapshot;
32
+ private readonly activeIds;
33
+ private readonly byId;
34
+ private readonly byModelName;
35
+ constructor(snapshot: AiCoderToolRegistrySnapshot);
36
+ get activeDescriptors(): readonly Readonly<{
37
+ category: import("./tool-registry-types.js").AiCoderToolCategory;
38
+ description: string;
39
+ enabledByDefault: boolean;
40
+ id: string;
41
+ idempotency: import("./tool-registry-types.js").AiCoderToolIdempotency;
42
+ inputSchema: AiCoderJsonSchema;
43
+ maxOutputBytes: number;
44
+ maxOutputTokens: number;
45
+ modalities: Readonly<{
46
+ accepts: readonly AiCoderToolModality[];
47
+ produces: readonly AiCoderToolModality[];
48
+ requiredModelCapabilities?: readonly string[];
49
+ }>;
50
+ modelName: string;
51
+ mutability: import("./tool-registry-types.js").AiCoderToolMutability;
52
+ outputSchema: AiCoderJsonSchema;
53
+ permissions: readonly string[];
54
+ risk: import("./tool-registry-types.js").AiCoderToolRisk;
55
+ source: Readonly<{
56
+ extensionId?: string;
57
+ owner: "base" | "core" | "extension" | "mcp";
58
+ serverId?: string;
59
+ }>;
60
+ supportsCancellation: boolean;
61
+ supportsPagination: boolean;
62
+ timeoutMs: number;
63
+ title: string;
64
+ transport: import("./tool-registry-types.js").AiCoderToolTransport;
65
+ version: string;
66
+ }>[];
67
+ get definitions(): readonly Readonly<{
68
+ function: Readonly<{
69
+ description: string;
70
+ name: string;
71
+ parameters: Readonly<Record<string, unknown>>;
72
+ }>;
73
+ type: "function";
74
+ }>[];
75
+ get activeHash(): string;
76
+ get activeSnapshot(): AiCoderActiveToolSnapshot;
77
+ resolveModelName(modelName: string): Readonly<{
78
+ category: import("./tool-registry-types.js").AiCoderToolCategory;
79
+ description: string;
80
+ enabledByDefault: boolean;
81
+ id: string;
82
+ idempotency: import("./tool-registry-types.js").AiCoderToolIdempotency;
83
+ inputSchema: AiCoderJsonSchema;
84
+ maxOutputBytes: number;
85
+ maxOutputTokens: number;
86
+ modalities: Readonly<{
87
+ accepts: readonly AiCoderToolModality[];
88
+ produces: readonly AiCoderToolModality[];
89
+ requiredModelCapabilities?: readonly string[];
90
+ }>;
91
+ modelName: string;
92
+ mutability: import("./tool-registry-types.js").AiCoderToolMutability;
93
+ outputSchema: AiCoderJsonSchema;
94
+ permissions: readonly string[];
95
+ risk: import("./tool-registry-types.js").AiCoderToolRisk;
96
+ source: Readonly<{
97
+ extensionId?: string;
98
+ owner: "base" | "core" | "extension" | "mcp";
99
+ serverId?: string;
100
+ }>;
101
+ supportsCancellation: boolean;
102
+ supportsPagination: boolean;
103
+ timeoutMs: number;
104
+ title: string;
105
+ transport: import("./tool-registry-types.js").AiCoderToolTransport;
106
+ version: string;
107
+ }> | null;
108
+ resolveCanonicalId(toolId: string): Readonly<{
109
+ category: import("./tool-registry-types.js").AiCoderToolCategory;
110
+ description: string;
111
+ enabledByDefault: boolean;
112
+ id: string;
113
+ idempotency: import("./tool-registry-types.js").AiCoderToolIdempotency;
114
+ inputSchema: AiCoderJsonSchema;
115
+ maxOutputBytes: number;
116
+ maxOutputTokens: number;
117
+ modalities: Readonly<{
118
+ accepts: readonly AiCoderToolModality[];
119
+ produces: readonly AiCoderToolModality[];
120
+ requiredModelCapabilities?: readonly string[];
121
+ }>;
122
+ modelName: string;
123
+ mutability: import("./tool-registry-types.js").AiCoderToolMutability;
124
+ outputSchema: AiCoderJsonSchema;
125
+ permissions: readonly string[];
126
+ risk: import("./tool-registry-types.js").AiCoderToolRisk;
127
+ source: Readonly<{
128
+ extensionId?: string;
129
+ owner: "base" | "core" | "extension" | "mcp";
130
+ serverId?: string;
131
+ }>;
132
+ supportsCancellation: boolean;
133
+ supportsPagination: boolean;
134
+ timeoutMs: number;
135
+ title: string;
136
+ transport: import("./tool-registry-types.js").AiCoderToolTransport;
137
+ version: string;
138
+ }> | null;
139
+ activate(toolId: string): boolean;
140
+ search(query: string, category?: string, limit?: number, cursor?: string): {
141
+ catalogHash: string;
142
+ activeHash: string;
143
+ nextCursor?: string;
144
+ matches: {
145
+ id: string;
146
+ modelName: string;
147
+ title: string;
148
+ category: import("./tool-registry-types.js").AiCoderToolCategory;
149
+ active: boolean;
150
+ }[];
151
+ activated: string[];
152
+ };
153
+ private assertDefinitionBudget;
154
+ }
155
+ //# sourceMappingURL=tool-registry.d.ts.map
@@ -0,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