dev-flow-deepseek 0.1.0 → 0.5.2

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.
@@ -0,0 +1,305 @@
1
+ # current Core contract Node Payload Construction
2
+
3
+ This reference helps the Host Adapter construct the one closed payload branch returned by the
4
+ current Core Action. It is not a process definition, transition table, cursor, or authority. The
5
+ fresh Action, the live `dev_flow_apply_action` `inputSchema`, and Core validation remain authoritative.
6
+
7
+ ## Construction rules
8
+
9
+ Before every ordinary apply:
10
+
11
+ 1. Bind one complete fresh Action and read `action_kind`, `current_node`, `payload_contract`,
12
+ `method_steps`, and every `available_transition`.
13
+ 2. Select only a transition returned by that Action. Never submit `destination`, `next_node`,
14
+ `next_cursor`, resume node, guard result, or caller classification.
15
+ 3. Select the matching `dev_flow_apply_action` `inputSchema` branch and use exactly the six common
16
+ payload members: `transition_id`, `summary`, `reason`, `artifacts`, `method_evidence`, and
17
+ `node_result`.
18
+ 4. `required_evidence` and `artifacts` are different concepts. `repository_observation` is a Core evidence requirement, not an ArtifactReference role. When no real repository-relative process
19
+ artifact exists, submit `"artifacts": []`.
20
+ 5. Allowed ArtifactReference roles are only `requirements`, `design`, `task_plan`,
21
+ `implementation`, `test`, `comprehension`, `refactor`, `delivery`, and `other_process`.
22
+ 6. Preserve the complete `node_result` branch wrapper. Never flatten baseline fields or encode an
23
+ array as prose.
24
+ 7. Submit exactly one MethodEvidence item for every current Action method step, in Action order.
25
+ For completed `plain` work use `"status": "plain_fallback"` and `"capability": ""`.
26
+ 8. Replace every value beginning `placeholder-` and every exemplar revision/ID with the current
27
+ normalized value read from the current Task/Action. Delivery acceptance, record IDs, and exact
28
+ evidence sets always come from the latest Task projection and are never guessed.
29
+ 9. Do not include repository facts, payload digests, raw command/output/environment data, or
30
+ unknown members.
31
+ 10. `INVALID_ARGUMENT` is a completed Core domain rejection: stop, report a payload-contract error,
32
+ and do not probe with another payload or treat it as transport uncertainty.
33
+
34
+ <!-- node-payload-template:requirements:start -->
35
+ ```json
36
+ {
37
+ "transition_id": "requirements_ready",
38
+ "summary": "placeholder-normalized-summary",
39
+ "reason": "",
40
+ "artifacts": [],
41
+ "method_evidence": [
42
+ {"step_id": "requirements.capture", "status": "plain_fallback", "capability": "", "summary": "placeholder-capture-summary"},
43
+ {"step_id": "requirements.clarify", "status": "plain_fallback", "capability": "", "summary": "placeholder-clarify-summary"},
44
+ {"step_id": "requirements.validate", "status": "plain_fallback", "capability": "", "summary": "placeholder-validation-summary"}
45
+ ],
46
+ "node_result": {
47
+ "problem_class": "none",
48
+ "baseline": {
49
+ "goal": "placeholder-goal",
50
+ "scope": ["placeholder-scope"],
51
+ "out_of_scope": ["placeholder-exclusion"],
52
+ "acceptance_criteria": ["placeholder-acceptance-criterion"],
53
+ "constraints": ["placeholder-constraint"],
54
+ "assumptions": []
55
+ },
56
+ "unresolved_questions": []
57
+ }
58
+ }
59
+ ```
60
+ <!-- node-payload-template:requirements:end -->
61
+
62
+ Never use `repository_observation` as an artifact role, place goal/scope beside `node_result`, or
63
+ omit `problem_class`, `baseline`, or `unresolved_questions`.
64
+
65
+ <!-- node-payload-template:design:start -->
66
+ ```json
67
+ {
68
+ "transition_id": "design_ready",
69
+ "summary": "placeholder-normalized-summary",
70
+ "reason": "",
71
+ "artifacts": [],
72
+ "method_evidence": [
73
+ {"step_id": "design.choose_approach", "status": "plain_fallback", "capability": "", "summary": "placeholder-approach-summary"},
74
+ {"step_id": "design.review_complexity", "status": "plain_fallback", "capability": "", "summary": "placeholder-complexity-summary"},
75
+ {"step_id": "design.record_decisions", "status": "plain_fallback", "capability": "", "summary": "placeholder-decision-summary"}
76
+ ],
77
+ "node_result": {
78
+ "problem_class": "none",
79
+ "baseline": {
80
+ "requirements_revision": 1,
81
+ "approach": "placeholder-approach",
82
+ "components": ["placeholder-component"],
83
+ "decisions": ["placeholder-decision"],
84
+ "rejected_alternatives": ["placeholder-rejected-alternative"],
85
+ "complexity_justification": [],
86
+ "risks": []
87
+ },
88
+ "findings": []
89
+ }
90
+ }
91
+ ```
92
+ <!-- node-payload-template:design:end -->
93
+
94
+ Use the current requirements revision. The field `complexity` is forbidden; the required field is
95
+ `complexity_justification`, even when its value is an empty array.
96
+
97
+ <!-- node-payload-template:tasks:start -->
98
+ ```json
99
+ {
100
+ "transition_id": "tasks_ready",
101
+ "summary": "placeholder-normalized-summary",
102
+ "reason": "",
103
+ "artifacts": [],
104
+ "method_evidence": [
105
+ {"step_id": "tasks.decompose", "status": "plain_fallback", "capability": "", "summary": "placeholder-decomposition-summary"},
106
+ {"step_id": "tasks.map_acceptance", "status": "plain_fallback", "capability": "", "summary": "placeholder-acceptance-map-summary"},
107
+ {"step_id": "tasks.analyze_consistency", "status": "plain_fallback", "capability": "", "summary": "placeholder-consistency-summary"}
108
+ ],
109
+ "node_result": {
110
+ "problem_class": "none",
111
+ "baseline": {
112
+ "design_revision": 1,
113
+ "work_items": [
114
+ {
115
+ "work_item_id": "placeholder-work-item-id",
116
+ "summary": "placeholder-work-item-summary",
117
+ "expected_paths": ["src/placeholder.mjs"],
118
+ "acceptance_indexes": [0],
119
+ "verification_steps": ["placeholder-targeted-verification"],
120
+ "dependencies": []
121
+ }
122
+ ]
123
+ },
124
+ "findings": []
125
+ }
126
+ }
127
+ ```
128
+ <!-- node-payload-template:tasks:end -->
129
+
130
+ <!-- node-payload-template:implement:start -->
131
+ ```json
132
+ {
133
+ "transition_id": "implementation_ready_for_test",
134
+ "summary": "placeholder-normalized-summary",
135
+ "reason": "",
136
+ "artifacts": [],
137
+ "method_evidence": [
138
+ {"step_id": "implementation.execute_plan", "status": "plain_fallback", "capability": "", "summary": "placeholder-execution-summary"},
139
+ {"step_id": "implementation.record_surface", "status": "plain_fallback", "capability": "", "summary": "placeholder-surface-summary"},
140
+ {"step_id": "implementation.classify_deviations", "status": "plain_fallback", "capability": "", "summary": "placeholder-deviation-summary"}
141
+ ],
142
+ "node_result": {
143
+ "problem_class": "none",
144
+ "task_plan_revision": 1,
145
+ "completed_work_item_ids": ["placeholder-work-item-id"],
146
+ "changed_paths": ["src/placeholder.mjs"],
147
+ "no_file_changes": false,
148
+ "deviations": [],
149
+ "findings": []
150
+ }
151
+ }
152
+ ```
153
+ <!-- node-payload-template:implement:end -->
154
+
155
+ Exactly one of a nonempty `changed_paths` list or `no_file_changes=true` describes the current
156
+ implementation result.
157
+
158
+ <!-- node-payload-template:test:start -->
159
+ ```json
160
+ {
161
+ "transition_id": "tests_passed",
162
+ "summary": "placeholder-normalized-summary",
163
+ "reason": "",
164
+ "artifacts": [],
165
+ "method_evidence": [
166
+ {"step_id": "test.run_budgeted_checks", "status": "plain_fallback", "capability": "", "summary": "placeholder-check-summary"},
167
+ {"step_id": "test.record_evidence", "status": "plain_fallback", "capability": "", "summary": "placeholder-evidence-summary"},
168
+ {"step_id": "test.classify_failure", "status": "plain_fallback", "capability": "", "summary": "placeholder-classification-summary"}
169
+ ],
170
+ "node_result": {
171
+ "problem_class": "none",
172
+ "checks": [
173
+ {"source": "automated", "name": "placeholder-check-name", "status": "passed", "summary": "placeholder-check-result", "command_count": 1, "full_suite": false}
174
+ ],
175
+ "failed_items": [],
176
+ "unverified_items": [],
177
+ "manual_handoff_items": [],
178
+ "findings": []
179
+ }
180
+ }
181
+ ```
182
+ <!-- node-payload-template:test:end -->
183
+
184
+ <!-- node-payload-template:comprehension-complexity:start -->
185
+ ```json
186
+ {
187
+ "transition_id": "code_too_complex",
188
+ "summary": "placeholder-normalized-summary",
189
+ "reason": "placeholder-required-complexity-reason",
190
+ "artifacts": [],
191
+ "method_evidence": [
192
+ {"step_id": "comprehension.explain", "status": "plain_fallback", "capability": "", "summary": "placeholder-explanation-summary"},
193
+ {"step_id": "comprehension.identify_complexity", "status": "plain_fallback", "capability": "", "summary": "placeholder-complexity-summary"},
194
+ {"step_id": "comprehension.obtain_user_verdict", "status": "plain_fallback", "capability": "", "summary": "placeholder-user-verdict-summary"}
195
+ ],
196
+ "node_result": {
197
+ "problem_class": "code_complexity",
198
+ "explained_components": ["placeholder-component"],
199
+ "unresolved_questions": [],
200
+ "unnecessary_abstractions": ["placeholder-unnecessary-abstraction"],
201
+ "maintenance_risks": [],
202
+ "user_confirmation": null,
203
+ "findings": ["placeholder-matching-complexity-fact"]
204
+ }
205
+ }
206
+ ```
207
+ <!-- node-payload-template:comprehension-complexity:end -->
208
+
209
+ <!-- node-payload-template:comprehension-passed:start -->
210
+ ```json
211
+ {
212
+ "transition_id": "comprehension_passed",
213
+ "summary": "placeholder-normalized-summary",
214
+ "reason": "",
215
+ "artifacts": [],
216
+ "method_evidence": [
217
+ {"step_id": "comprehension.explain", "status": "plain_fallback", "capability": "", "summary": "placeholder-explanation-summary"},
218
+ {"step_id": "comprehension.identify_complexity", "status": "plain_fallback", "capability": "", "summary": "placeholder-complexity-summary"},
219
+ {"step_id": "comprehension.obtain_user_verdict", "status": "plain_fallback", "capability": "", "summary": "placeholder-user-verdict-summary"}
220
+ ],
221
+ "node_result": {
222
+ "problem_class": "none",
223
+ "explained_components": ["placeholder-component"],
224
+ "unresolved_questions": [],
225
+ "unnecessary_abstractions": [],
226
+ "maintenance_risks": [],
227
+ "user_confirmation": {"source": "user", "status": "passed", "summary": "placeholder-explicit-user-verdict-summary"},
228
+ "findings": []
229
+ }
230
+ }
231
+ ```
232
+ <!-- node-payload-template:comprehension-passed:end -->
233
+
234
+ No AI or method capability may create the passing user confirmation.
235
+
236
+ <!-- node-payload-template:refactor:start -->
237
+ ```json
238
+ {
239
+ "transition_id": "refactor_ready_for_test",
240
+ "summary": "placeholder-normalized-summary",
241
+ "reason": "",
242
+ "artifacts": [],
243
+ "method_evidence": [
244
+ {"step_id": "refactor.simplify", "status": "plain_fallback", "capability": "", "summary": "placeholder-simplification-summary"},
245
+ {"step_id": "refactor.reconcile_artifacts", "status": "plain_fallback", "capability": "", "summary": "placeholder-reconciliation-summary"},
246
+ {"step_id": "refactor.record_surface", "status": "plain_fallback", "capability": "", "summary": "placeholder-surface-summary"}
247
+ ],
248
+ "node_result": {
249
+ "problem_class": "none",
250
+ "changed_paths": ["src/placeholder.mjs"],
251
+ "no_file_changes": false,
252
+ "simplifications": ["placeholder-simplification"],
253
+ "behavior_change_intended": false,
254
+ "findings": []
255
+ }
256
+ }
257
+ ```
258
+ <!-- node-payload-template:refactor:end -->
259
+
260
+ <!-- node-payload-template:delivery:start -->
261
+ ```json
262
+ {
263
+ "transition_id": "delivery_complete",
264
+ "summary": "placeholder-normalized-summary",
265
+ "reason": "",
266
+ "artifacts": [],
267
+ "method_evidence": [
268
+ {"step_id": "delivery.reconcile_acceptance", "status": "plain_fallback", "capability": "", "summary": "placeholder-acceptance-summary"},
269
+ {"step_id": "delivery.reconcile_method_artifacts", "status": "plain_fallback", "capability": "", "summary": "placeholder-artifact-summary"},
270
+ {"step_id": "delivery.prepare_summary", "status": "plain_fallback", "capability": "", "summary": "placeholder-delivery-summary"}
271
+ ],
272
+ "node_result": {
273
+ "problem_class": "none",
274
+ "acceptance": [{"criterion": "placeholder-current-criterion", "status": "satisfied"}],
275
+ "automated_evidence_ids": ["placeholder-current-automated-evidence-id"],
276
+ "manual_evidence_ids": ["placeholder-current-comprehension-evidence-id"],
277
+ "test_record_id": "placeholder-current-test-record-id",
278
+ "comprehension_record_id": "placeholder-current-comprehension-record-id",
279
+ "unverified_items": [],
280
+ "risks": [],
281
+ "findings": []
282
+ }
283
+ }
284
+ ```
285
+ <!-- node-payload-template:delivery:end -->
286
+
287
+ Acceptance order/text and the automated/manual evidence lists must exactly equal the latest Core
288
+ projection. Use only current TestRecord and ComprehensionAssessment IDs; stale or guessed IDs are
289
+ forbidden.
290
+
291
+ <!-- node-payload-template:blocked:start -->
292
+ ```json
293
+ {
294
+ "blocker_id": "placeholder-current-blocker-id",
295
+ "condition": {
296
+ "kind": "restore_issuance_binding",
297
+ "expected_binding_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
298
+ },
299
+ "observed_binding_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
300
+ }
301
+ ```
302
+ <!-- node-payload-template:blocked:end -->
303
+
304
+ For `RESOLVE_BLOCKER`, use the exact current blocker ID, stored condition, and freshly observed
305
+ binding digest required by Core. Never submit a resume node or destination.
@@ -1,139 +0,0 @@
1
- import { ADAPTER_ERROR_CODES, APPROVED_RAW_TOOLS, PACKAGE_NAME, PACKAGE_VERSION, SHUTDOWN_TIMEOUT_MS } from "./compatibility.js";
2
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
3
- import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
4
-
5
- //#region src/backend-client.ts
6
- const BACKEND_CALL_TIMEOUT_MS = 12e4;
7
- var BackendStartupError = class extends Error {
8
- code;
9
- constructor(code) {
10
- if (!ADAPTER_ERROR_CODES.includes(code)) throw new TypeError("Backend startup error code is not approved.");
11
- super("The Dev Flow projection proxy could not start its backend.");
12
- this.name = "BackendStartupError";
13
- this.code = code;
14
- }
15
- };
16
- var OwnedStdioClientTransport = class extends StdioClientTransport {
17
- #child;
18
- #resolveClosed;
19
- #closed = new Promise((resolve) => {
20
- this.#resolveClosed = resolve;
21
- });
22
- spawned = false;
23
- get closed() {
24
- return this.#closed;
25
- }
26
- async start() {
27
- await super.start();
28
- this.spawned = true;
29
- const child = this._process;
30
- if (child === void 0) throw new BackendStartupError("BACKEND_START_FAILED");
31
- this.#child = child;
32
- child.once("close", (code, signal) => {
33
- this.#resolveClosed?.({
34
- code,
35
- signal
36
- });
37
- this.#resolveClosed = void 0;
38
- });
39
- }
40
- async close() {
41
- const child = this.#child;
42
- await super.close();
43
- if (child === void 0 || child.exitCode !== null || child.signalCode !== null) return;
44
- let timer;
45
- const exited = await Promise.race([this.#closed.then(() => true), new Promise((resolve) => {
46
- timer = setTimeout(() => resolve(false), SHUTDOWN_TIMEOUT_MS);
47
- timer.unref();
48
- })]);
49
- if (timer !== void 0) clearTimeout(timer);
50
- if (!exited && child.exitCode === null && child.signalCode === null) child.kill("SIGKILL");
51
- }
52
- };
53
- function isApprovedTool(name) {
54
- return APPROVED_RAW_TOOLS.includes(name);
55
- }
56
- function filterCatalog(tools) {
57
- const discovered = /* @__PURE__ */ new Map();
58
- for (const tool of APPROVED_RAW_TOOLS) discovered.set(tool, []);
59
- for (const tool of tools) if (isApprovedTool(tool.name)) discovered.get(tool.name)?.push(tool);
60
- const filtered = [];
61
- for (const name of APPROVED_RAW_TOOLS) {
62
- const matches = discovered.get(name);
63
- if (matches === void 0 || matches.length !== 1) throw new BackendStartupError("BACKEND_CATALOG_INVALID");
64
- const definition = matches[0];
65
- if (definition === void 0) throw new BackendStartupError("BACKEND_CATALOG_INVALID");
66
- filtered.push(definition);
67
- }
68
- return Object.freeze(filtered);
69
- }
70
- async function discoverTools(client) {
71
- const tools = [];
72
- const seenCursors = /* @__PURE__ */ new Set();
73
- let cursor;
74
- do {
75
- const page = await client.listTools(cursor === void 0 ? void 0 : { cursor });
76
- tools.push(...page.tools);
77
- cursor = page.nextCursor;
78
- if (cursor !== void 0) {
79
- if (seenCursors.has(cursor)) throw new BackendStartupError("BACKEND_CATALOG_INVALID");
80
- seenCursors.add(cursor);
81
- }
82
- } while (cursor !== void 0);
83
- return filterCatalog(tools);
84
- }
85
- var BackendClient = class BackendClient {
86
- #client;
87
- #transport;
88
- tools;
89
- constructor(client, transport, tools) {
90
- this.#client = client;
91
- this.#transport = transport;
92
- this.tools = tools;
93
- }
94
- static async connect(config) {
95
- const transport = new OwnedStdioClientTransport({
96
- command: config.command,
97
- args: [...config.args],
98
- env: config.env,
99
- cwd: config.cwd,
100
- stderr: "ignore"
101
- });
102
- const client = new Client({
103
- name: `${PACKAGE_NAME}-backend-client`,
104
- version: PACKAGE_VERSION
105
- }, { capabilities: {} });
106
- try {
107
- await client.connect(transport);
108
- } catch {
109
- await transport.close().catch(() => void 0);
110
- throw new BackendStartupError(transport.spawned ? "BACKEND_INITIALIZE_FAILED" : "BACKEND_START_FAILED");
111
- }
112
- try {
113
- const tools = await discoverTools(client);
114
- return new BackendClient(client, transport, tools);
115
- } catch {
116
- await client.close().catch(() => void 0);
117
- throw new BackendStartupError("BACKEND_CATALOG_INVALID");
118
- }
119
- }
120
- get closed() {
121
- return this.#transport.closed;
122
- }
123
- async call(tool, args, signal) {
124
- return await this.#client.callTool({
125
- name: tool,
126
- arguments: args
127
- }, void 0, {
128
- signal,
129
- timeout: BACKEND_CALL_TIMEOUT_MS,
130
- maxTotalTimeout: BACKEND_CALL_TIMEOUT_MS
131
- });
132
- }
133
- async close() {
134
- await this.#client.close();
135
- }
136
- };
137
-
138
- //#endregion
139
- export { BackendClient, BackendStartupError };
@@ -1,61 +0,0 @@
1
- import { MAX_CANONICAL_JSON_BYTES, MAX_CANONICAL_JSON_DEPTH } from "./compatibility.js";
2
-
3
- //#region src/canonical-json.ts
4
- var CanonicalJsonError = class extends Error {
5
- constructor(message) {
6
- super(message);
7
- this.name = "CanonicalJsonError";
8
- }
9
- };
10
- function reject(reason) {
11
- throw new CanonicalJsonError(`Value is not lossless JSON: ${reason}.`);
12
- }
13
- function normalize(value, depth, ancestors) {
14
- if (depth > 128) reject(`nesting exceeds depth ${128}`);
15
- if (value === null || typeof value === "string" || typeof value === "boolean") return value;
16
- if (typeof value === "number") {
17
- if (!Number.isFinite(value)) reject("number is not finite");
18
- return value;
19
- }
20
- if (typeof value !== "object") reject(`unsupported ${typeof value} value`);
21
- if (ancestors.has(value)) reject("cycle detected");
22
- ancestors.add(value);
23
- try {
24
- if (Array.isArray(value)) {
25
- const result = [];
26
- for (let index = 0; index < value.length; index += 1) {
27
- if (!Object.hasOwn(value, index)) reject("sparse array hole detected");
28
- result.push(normalize(value[index], depth + 1, ancestors));
29
- }
30
- if (Reflect.ownKeys(value).some((key) => {
31
- if (key === "length") return false;
32
- return typeof key !== "string" || !/^(0|[1-9]\d*)$/.test(key) || Number(key) >= value.length;
33
- })) reject("array has non-index properties");
34
- return result;
35
- }
36
- const prototype = Object.getPrototypeOf(value);
37
- if (prototype !== Object.prototype && prototype !== null) reject("object is not plain");
38
- const keys = Object.keys(value).sort();
39
- const ownKeys = Reflect.ownKeys(value);
40
- if (ownKeys.length !== keys.length || ownKeys.some((key) => typeof key !== "string")) reject("object has non-JSON properties");
41
- const result = {};
42
- const record = value;
43
- for (const key of keys) {
44
- const descriptor = Object.getOwnPropertyDescriptor(value, key);
45
- if (descriptor === void 0 || descriptor.enumerable !== true || !("value" in descriptor)) reject("object has an accessor or non-enumerable property");
46
- result[key] = normalize(record[key], depth + 1, ancestors);
47
- }
48
- return result;
49
- } finally {
50
- ancestors.delete(value);
51
- }
52
- }
53
- function canonicalJson(value) {
54
- const normalized = normalize(value, 0, /* @__PURE__ */ new WeakSet());
55
- const text = JSON.stringify(normalized);
56
- if (Buffer.byteLength(text, "utf8") > 524288) throw new CanonicalJsonError(`Canonical JSON exceeds ${MAX_CANONICAL_JSON_BYTES} UTF-8 bytes.`);
57
- return text;
58
- }
59
-
60
- //#endregion
61
- export { CanonicalJsonError, canonicalJson };
@@ -1,47 +0,0 @@
1
- //#region src/compatibility.ts
2
- const PACKAGE_NAME = "dev-flow-deepseek";
3
- const PACKAGE_VERSION = "0.1.0";
4
- const NODE_ENGINE = "^22.19.0 || >=24.0.0";
5
- const OPENSPEC_VERSION = "1.7.0";
6
- const MCP_SDK_VERSION = "1.12.0";
7
- const DSH_VERSION = "0.1.0-rc.6";
8
- const DSH_COMMIT = "47f943859bef60e4160492346772ded9b24f765a";
9
- const DEV_FLOW_RELEASE = "0.6.12";
10
- const DEV_FLOW_COMMIT = "7edd4fa12fe6787aac57f16246cbab00b8d79272";
11
- const DEV_FLOW_MCP_INTERFACE = "dev-flow-mcp/1.0.0";
12
- const DEV_FLOW_RESULT_SCHEMA = "dev-flow-mcp-result/1.0.0";
13
- const DEV_FLOW_MODEL_NAMESPACE = "0.4.0";
14
- const APPROVED_RAW_TOOLS = Object.freeze([
15
- "dev_flow_server_info",
16
- "dev_flow_find_tasks_for_path",
17
- "dev_flow_get_task",
18
- "dev_flow_get_next_action",
19
- "dev_flow_start_task",
20
- "dev_flow_apply_action"
21
- ]);
22
- const APPROVED_MODEL_TOOLS = Object.freeze([
23
- "mcp__dev-flow__dev_flow_server_info",
24
- "mcp__dev-flow__dev_flow_find_tasks_for_path",
25
- "mcp__dev-flow__dev_flow_get_task",
26
- "mcp__dev-flow__dev_flow_get_next_action",
27
- "mcp__dev-flow__dev_flow_start_task",
28
- "mcp__dev-flow__dev_flow_apply_action"
29
- ]);
30
- const MUTATION_TOOLS = Object.freeze(["dev_flow_start_task", "dev_flow_apply_action"]);
31
- const ADAPTER_ERROR_SCHEMA = "dsh-dev-flow-proxy-error/1.0.0";
32
- const ADAPTER_ERROR_CODES = Object.freeze([
33
- "BACKEND_START_FAILED",
34
- "BACKEND_INITIALIZE_FAILED",
35
- "BACKEND_CATALOG_INVALID",
36
- "UPSTREAM_CALL_FAILED",
37
- "UPSTREAM_RESULT_INVALID",
38
- "REQUEST_CANCELLED"
39
- ]);
40
- const MAX_CANONICAL_JSON_DEPTH = 128;
41
- const MAX_CANONICAL_JSON_BYTES = 524288;
42
- const MAX_ADAPTER_DIAGNOSTIC_BYTES = 4096;
43
- const SHUTDOWN_TIMEOUT_MS = 5e3;
44
- const STARTUP_EXIT_CODE = 2;
45
-
46
- //#endregion
47
- export { ADAPTER_ERROR_CODES, ADAPTER_ERROR_SCHEMA, APPROVED_MODEL_TOOLS, APPROVED_RAW_TOOLS, DEV_FLOW_COMMIT, DEV_FLOW_MCP_INTERFACE, DEV_FLOW_MODEL_NAMESPACE, DEV_FLOW_RELEASE, DEV_FLOW_RESULT_SCHEMA, DSH_COMMIT, DSH_VERSION, MAX_ADAPTER_DIAGNOSTIC_BYTES, MAX_CANONICAL_JSON_BYTES, MAX_CANONICAL_JSON_DEPTH, MCP_SDK_VERSION, MUTATION_TOOLS, NODE_ENGINE, OPENSPEC_VERSION, PACKAGE_NAME, PACKAGE_VERSION, SHUTDOWN_TIMEOUT_MS, STARTUP_EXIT_CODE };
@@ -1,50 +0,0 @@
1
- import path from "node:path";
2
-
3
- //#region src/environment.ts
4
- const CHILD_ENVIRONMENT_KEYS = Object.freeze([
5
- "PATH",
6
- "HOME",
7
- "USERPROFILE",
8
- "LOCALAPPDATA",
9
- "SYSTEMROOT",
10
- "COMSPEC",
11
- "TEMP",
12
- "TMP",
13
- "TMPDIR",
14
- "LANG",
15
- "LC_ALL",
16
- "LC_CTYPE"
17
- ]);
18
- function validateCommand(command) {
19
- if (command.length === 0 || command.trim() !== command || command.includes("\0") || command.includes("\n") || command.includes("\r")) throw new TypeError("DEV_FLOW_MCP_COMMAND must identify one direct executable.");
20
- if (path.isAbsolute(command)) return command;
21
- if (!/^[A-Za-z0-9._-]+$/.test(command)) throw new TypeError("DEV_FLOW_MCP_COMMAND must be an absolute path or a PATH-resolved executable name.");
22
- return command;
23
- }
24
- function validateDataDirectory(value) {
25
- if (value === void 0 || value.length === 0 || value.trim() !== value || value.includes("\0") || !path.isAbsolute(value)) throw new TypeError("DEV_FLOW_DATA_DIR must be a non-empty absolute path.");
26
- return value;
27
- }
28
- function buildChildEnvironment(parent, dataDirectory) {
29
- const env = {};
30
- for (const key of CHILD_ENVIRONMENT_KEYS) {
31
- const value = parent[key];
32
- if (typeof value === "string" && value.length > 0) env[key] = value;
33
- }
34
- env.DEV_FLOW_DATA_DIR = dataDirectory;
35
- return env;
36
- }
37
- function readBackendConfiguration(source = process.env, cwd = process.cwd()) {
38
- const command = validateCommand(source.DEV_FLOW_MCP_COMMAND ?? "dev-flow-mcp");
39
- const dataDirectory = validateDataDirectory(source.DEV_FLOW_DATA_DIR);
40
- if (!path.isAbsolute(cwd)) throw new TypeError("The proxy working directory must be absolute.");
41
- return Object.freeze({
42
- command,
43
- args: Object.freeze(["--stdio"]),
44
- env: Object.freeze(buildChildEnvironment(source, dataDirectory)),
45
- cwd
46
- });
47
- }
48
-
49
- //#endregion
50
- export { buildChildEnvironment, readBackendConfiguration };