@lumenflow/cli 5.5.0 → 5.7.12
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/README.md +42 -40
- package/dist/db-journal-recover.js +400 -0
- package/dist/db-journal-recover.js.map +1 -0
- package/dist/docs-sync.js +8 -3
- package/dist/docs-sync.js.map +1 -1
- package/dist/gate-defaults.js +37 -0
- package/dist/gate-defaults.js.map +1 -1
- package/dist/gates/monolithic-file-contention-guard.js +167 -0
- package/dist/gates/monolithic-file-contention-guard.js.map +1 -0
- package/dist/gates/prod-migration-drift.js +207 -0
- package/dist/gates/prod-migration-drift.js.map +1 -0
- package/dist/gates/test-over-deletion-guard.js +255 -0
- package/dist/gates/test-over-deletion-guard.js.map +1 -0
- package/dist/gates-runners.js +44 -3
- package/dist/gates-runners.js.map +1 -1
- package/dist/gates.js +3 -2
- package/dist/gates.js.map +1 -1
- package/dist/lumenflow-setup.js +144 -0
- package/dist/lumenflow-setup.js.map +1 -0
- package/dist/lumenflow-upgrade.js +2 -1
- package/dist/lumenflow-upgrade.js.map +1 -1
- package/dist/mem-create.js +10 -1
- package/dist/mem-create.js.map +1 -1
- package/dist/mem-signal.js +21 -4
- package/dist/mem-signal.js.map +1 -1
- package/dist/orchestrate-initiative.js +28 -3
- package/dist/orchestrate-initiative.js.map +1 -1
- package/dist/public-manifest.js +17 -0
- package/dist/public-manifest.js.map +1 -1
- package/dist/release.js +53 -18
- package/dist/release.js.map +1 -1
- package/dist/wu-done-gates.js +13 -9
- package/dist/wu-done-gates.js.map +1 -1
- package/dist/wu-edit-operations.js +74 -0
- package/dist/wu-edit-operations.js.map +1 -1
- package/dist/wu-edit-validators.js +58 -0
- package/dist/wu-edit-validators.js.map +1 -1
- package/dist/wu-edit.js +106 -4
- package/dist/wu-edit.js.map +1 -1
- package/dist/wu-prep.js +41 -7
- package/dist/wu-prep.js.map +1 -1
- package/dist/wu-recover.js +6 -0
- package/dist/wu-recover.js.map +1 -1
- package/dist/wu-release.js +120 -2
- package/dist/wu-release.js.map +1 -1
- package/dist/wu-sizing-validation.js +47 -17
- package/dist/wu-sizing-validation.js.map +1 -1
- package/dist/wu-status.js +33 -0
- package/dist/wu-status.js.map +1 -1
- package/package.json +13 -11
- package/packs/agent-runtime/package.json +1 -1
- package/packs/sidekick/package.json +1 -1
- package/packs/software-delivery/package.json +1 -1
- package/templates/core/AGENTS.md.template +67 -3
- package/templates/core/LUMENFLOW.md.template +197 -47
- package/packs/agent-runtime/agent-heartbeat.ts +0 -163
- package/packs/agent-runtime/auto-session-integration.ts +0 -888
- package/packs/agent-runtime/capability-factory.ts +0 -104
- package/packs/agent-runtime/constants.ts +0 -21
- package/packs/agent-runtime/delegation-registry-schema.ts +0 -220
- package/packs/agent-runtime/delegation-registry-store.ts +0 -269
- package/packs/agent-runtime/delegation-tree.ts +0 -328
- package/packs/agent-runtime/index.ts +0 -20
- package/packs/agent-runtime/manifest.ts +0 -348
- package/packs/agent-runtime/memory-coordination-contract.ts +0 -86
- package/packs/agent-runtime/orchestration.ts +0 -2027
- package/packs/agent-runtime/pack-registration.ts +0 -110
- package/packs/agent-runtime/policy-factory.ts +0 -165
- package/packs/agent-runtime/remote-controls/index.ts +0 -7
- package/packs/agent-runtime/remote-controls/operations.ts +0 -405
- package/packs/agent-runtime/remote-controls/port.ts +0 -48
- package/packs/agent-runtime/remote-controls/state-store.ts +0 -258
- package/packs/agent-runtime/remote-controls/types.ts +0 -105
- package/packs/agent-runtime/session-schema.ts +0 -467
- package/packs/agent-runtime/tool-impl/agent-turn-tools.ts +0 -793
- package/packs/agent-runtime/tool-impl/index.ts +0 -6
- package/packs/agent-runtime/tool-impl/provider-adapters.ts +0 -1245
- package/packs/agent-runtime/tool-impl/remote-controls.mock.ts +0 -256
- package/packs/agent-runtime/tool-impl/remote-controls.ts +0 -273
- package/packs/agent-runtime/tools/index.ts +0 -4
- package/packs/agent-runtime/tools/types.ts +0 -47
- package/packs/agent-runtime/turn-lifecycle-events.ts +0 -590
- package/packs/agent-runtime/types.ts +0 -128
- package/packs/agent-runtime/vitest.config.ts +0 -11
- package/packs/sidekick/channel-ingress.ts +0 -137
- package/packs/sidekick/constants.ts +0 -10
- package/packs/sidekick/index.ts +0 -8
- package/packs/sidekick/manifest-schema.ts +0 -49
- package/packs/sidekick/manifest.ts +0 -512
- package/packs/sidekick/pack-registration.ts +0 -110
- package/packs/sidekick/policy-factory.ts +0 -38
- package/packs/sidekick/sidekick-events.ts +0 -694
- package/packs/sidekick/src/adapters/cloud-queue.ts +0 -101
- package/packs/sidekick/src/adapters/control-plane-bridge.adapter.ts +0 -386
- package/packs/sidekick/src/adapters/filesystem-bridge.adapter.ts +0 -228
- package/packs/sidekick/src/domain/channel.types.ts +0 -64
- package/packs/sidekick/src/ports/channel-bridge.port.ts +0 -92
- package/packs/sidekick/src/routines/commit.ts +0 -74
- package/packs/sidekick/tool-impl/channel-tools.ts +0 -577
- package/packs/sidekick/tool-impl/channel-transports.ts +0 -75
- package/packs/sidekick/tool-impl/index.ts +0 -29
- package/packs/sidekick/tool-impl/memory-tools.ts +0 -290
- package/packs/sidekick/tool-impl/routine-commit.ts +0 -102
- package/packs/sidekick/tool-impl/routine-tools.ts +0 -440
- package/packs/sidekick/tool-impl/runtime-context.ts +0 -28
- package/packs/sidekick/tool-impl/shared.ts +0 -125
- package/packs/sidekick/tool-impl/storage.ts +0 -325
- package/packs/sidekick/tool-impl/system-tools.ts +0 -160
- package/packs/sidekick/tool-impl/task-tools.ts +0 -506
- package/packs/sidekick/tools/channel-tools.ts +0 -53
- package/packs/sidekick/tools/index.ts +0 -9
- package/packs/sidekick/tools/memory-tools.ts +0 -53
- package/packs/sidekick/tools/routine-tools.ts +0 -53
- package/packs/sidekick/tools/system-tools.ts +0 -47
- package/packs/sidekick/tools/task-tools.ts +0 -61
- package/packs/sidekick/tools/types.ts +0 -57
- package/packs/sidekick/vitest.config.ts +0 -11
- package/packs/software-delivery/constants.ts +0 -10
- package/packs/software-delivery/extensions.ts +0 -140
- package/packs/software-delivery/gate-policies.ts +0 -134
- package/packs/software-delivery/index.ts +0 -8
- package/packs/software-delivery/manifest-schema.ts +0 -268
- package/packs/software-delivery/manifest.ts +0 -657
- package/packs/software-delivery/pack-registration.ts +0 -113
- package/packs/software-delivery/src/commands/index.ts +0 -5
- package/packs/software-delivery/src/config/delivery-review-contract.ts +0 -256
- package/packs/software-delivery/src/config/env-accessors.ts +0 -66
- package/packs/software-delivery/src/config/index.ts +0 -8
- package/packs/software-delivery/src/config/normalize-config-keys.ts +0 -9
- package/packs/software-delivery/src/config/schemas/lumenflow-config-schema-types.ts +0 -460
- package/packs/software-delivery/src/config/workspace-reader.ts +0 -375
- package/packs/software-delivery/src/constants/backlog-patterns.ts +0 -31
- package/packs/software-delivery/src/constants/client-ids.ts +0 -19
- package/packs/software-delivery/src/constants/config-contract.ts +0 -7
- package/packs/software-delivery/src/constants/docs-layout-presets.ts +0 -50
- package/packs/software-delivery/src/constants/duration-constants.ts +0 -20
- package/packs/software-delivery/src/constants/gate-constants.ts +0 -32
- package/packs/software-delivery/src/constants/index.ts +0 -29
- package/packs/software-delivery/src/constants/lock-constants.ts +0 -35
- package/packs/software-delivery/src/constants/object-guards.ts +0 -12
- package/packs/software-delivery/src/constants/section-headings.ts +0 -107
- package/packs/software-delivery/src/constants/wu-cli-constants.ts +0 -500
- package/packs/software-delivery/src/constants/wu-domain-constants.ts +0 -466
- package/packs/software-delivery/src/constants/wu-git-constants.ts +0 -7
- package/packs/software-delivery/src/constants/wu-id-format.ts +0 -327
- package/packs/software-delivery/src/constants/wu-paths-constants.ts +0 -384
- package/packs/software-delivery/src/constants/wu-statuses.ts +0 -287
- package/packs/software-delivery/src/constants/wu-type-helpers.ts +0 -67
- package/packs/software-delivery/src/constants/wu-ui-constants.ts +0 -267
- package/packs/software-delivery/src/constants/wu-validation-constants.ts +0 -73
- package/packs/software-delivery/src/domain/index.ts +0 -5
- package/packs/software-delivery/src/domain/orchestration.constants.ts +0 -166
- package/packs/software-delivery/src/domain/orchestration.schemas.ts +0 -238
- package/packs/software-delivery/src/domain/orchestration.types.ts +0 -176
- package/packs/software-delivery/src/methodology/incremental-test.ts +0 -122
- package/packs/software-delivery/src/methodology/index.ts +0 -6
- package/packs/software-delivery/src/methodology/manual-test-validator.ts +0 -292
- package/packs/software-delivery/src/policy/coverage-gate.ts +0 -270
- package/packs/software-delivery/src/policy/gates-agent-mode.ts +0 -223
- package/packs/software-delivery/src/policy/gates-config-internal.ts +0 -121
- package/packs/software-delivery/src/policy/gates-config.ts +0 -300
- package/packs/software-delivery/src/policy/gates-coverage.ts +0 -356
- package/packs/software-delivery/src/policy/gates-presets.ts +0 -134
- package/packs/software-delivery/src/policy/gates-schemas.ts +0 -173
- package/packs/software-delivery/src/policy/index.ts +0 -22
- package/packs/software-delivery/src/policy/package-manager-resolver.ts +0 -319
- package/packs/software-delivery/src/policy/resolve-policy.ts +0 -601
- package/packs/software-delivery/src/ports/config.ports.ts +0 -90
- package/packs/software-delivery/src/ports/dashboard-renderer.port.ts +0 -125
- package/packs/software-delivery/src/ports/index.ts +0 -10
- package/packs/software-delivery/src/ports/sync-validator.ports.ts +0 -59
- package/packs/software-delivery/src/ports/wu-helpers.ports.ts +0 -168
- package/packs/software-delivery/src/ports/wu-state.ports.ts +0 -241
- package/packs/software-delivery/src/primitives/index.ts +0 -5
- package/packs/software-delivery/src/runtime/index.ts +0 -6
- package/packs/software-delivery/src/runtime/work-classifier.ts +0 -561
- package/packs/software-delivery/src/sandbox/index.ts +0 -10
- package/packs/software-delivery/src/sandbox/sandbox-allowlist.ts +0 -118
- package/packs/software-delivery/src/sandbox/sandbox-backend-linux.ts +0 -88
- package/packs/software-delivery/src/sandbox/sandbox-backend-macos.ts +0 -154
- package/packs/software-delivery/src/sandbox/sandbox-backend-windows.ts +0 -47
- package/packs/software-delivery/src/sandbox/sandbox-profile.ts +0 -153
- package/packs/software-delivery/src/schemas/index.ts +0 -5
- package/packs/software-delivery/src/state/date-utils.ts +0 -158
- package/packs/software-delivery/src/state/index.ts +0 -15
- package/packs/software-delivery/src/state/state-machine.ts +0 -119
- package/packs/software-delivery/src/state/wu-doc-types.ts +0 -51
- package/packs/software-delivery/src/state/wu-paths.ts +0 -381
- package/packs/software-delivery/src/state/wu-schema.ts +0 -1139
- package/packs/software-delivery/src/state/wu-state-schema.ts +0 -255
- package/packs/software-delivery/src/state/wu-yaml.ts +0 -338
- package/packs/software-delivery/tool-impl/agent-tools.ts +0 -263
- package/packs/software-delivery/tool-impl/delegation-tools.ts +0 -66
- package/packs/software-delivery/tool-impl/flow-metrics-tools.ts +0 -219
- package/packs/software-delivery/tool-impl/git-runner.ts +0 -113
- package/packs/software-delivery/tool-impl/git-tools.ts +0 -316
- package/packs/software-delivery/tool-impl/index.ts +0 -15
- package/packs/software-delivery/tool-impl/initiative-orchestration-tools.ts +0 -720
- package/packs/software-delivery/tool-impl/lane-lock.ts +0 -246
- package/packs/software-delivery/tool-impl/memory-tools.ts +0 -470
- package/packs/software-delivery/tool-impl/pending-runtime-tools.ts +0 -21
- package/packs/software-delivery/tool-impl/runtime-cli-adapter.ts +0 -329
- package/packs/software-delivery/tool-impl/runtime-native-tools.ts +0 -687
- package/packs/software-delivery/tool-impl/worker-loader.ts +0 -52
- package/packs/software-delivery/tool-impl/worktree-tools.ts +0 -46
- package/packs/software-delivery/tool-impl/wu-lifecycle-tools.ts +0 -807
- package/packs/software-delivery/tools/delegation-tools.ts +0 -23
- package/packs/software-delivery/tools/git-tools.ts +0 -55
- package/packs/software-delivery/tools/index.ts +0 -8
- package/packs/software-delivery/tools/lane-lock-tool.ts +0 -37
- package/packs/software-delivery/tools/types.ts +0 -71
- package/packs/software-delivery/tools/worktree-tools.ts +0 -49
- package/packs/software-delivery/vitest.config.ts +0 -11
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
import { GIT_BINARY, runGit } from './git-runner.js';
|
|
5
|
-
|
|
6
|
-
export type GitToolName = 'git:add' | 'git:status' | 'git:commit';
|
|
7
|
-
|
|
8
|
-
export interface GitToolContext {
|
|
9
|
-
run_id: string;
|
|
10
|
-
task_id: string;
|
|
11
|
-
session_id: string;
|
|
12
|
-
cwd: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface GitToolOutput {
|
|
16
|
-
success: boolean;
|
|
17
|
-
data?: Record<string, unknown>;
|
|
18
|
-
error?: {
|
|
19
|
-
code: string;
|
|
20
|
-
message: string;
|
|
21
|
-
};
|
|
22
|
-
metadata?: {
|
|
23
|
-
artifacts_written?: string[];
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface ToolCallStartedReceipt {
|
|
28
|
-
schema_version: 1;
|
|
29
|
-
kind: 'tool_call_started';
|
|
30
|
-
run_id: string;
|
|
31
|
-
task_id: string;
|
|
32
|
-
session_id: string;
|
|
33
|
-
tool_name: GitToolName;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface ToolCallFinishedReceipt {
|
|
37
|
-
schema_version: 1;
|
|
38
|
-
kind: 'tool_call_finished';
|
|
39
|
-
result: 'success' | 'failure';
|
|
40
|
-
artifacts_written: string[];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface GitToolHostReceipt {
|
|
44
|
-
started: ToolCallStartedReceipt;
|
|
45
|
-
finished: ToolCallFinishedReceipt;
|
|
46
|
-
output: GitToolOutput;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
interface CommandExecutionResult {
|
|
50
|
-
command: string;
|
|
51
|
-
args: string[];
|
|
52
|
-
stdout: string;
|
|
53
|
-
stderr: string;
|
|
54
|
-
status: number;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function isGitBinaryCommand(command: unknown): boolean {
|
|
58
|
-
const normalized = String(command);
|
|
59
|
-
return normalized === 'git' || normalized === GIT_BINARY;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function trySimpleGitStatus(cwd: string): Promise<string | null> {
|
|
63
|
-
try {
|
|
64
|
-
const simpleGitModule = (await import('simple-git')) as {
|
|
65
|
-
simpleGit?: (root: string) => { status: () => Promise<{ files: Array<{ path: string }> }> };
|
|
66
|
-
};
|
|
67
|
-
if (!simpleGitModule.simpleGit) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
const git = simpleGitModule.simpleGit(cwd);
|
|
71
|
-
const status = await git.status();
|
|
72
|
-
return status.files.map((file) => file.path).join('\n');
|
|
73
|
-
} catch {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function ensureRepository(cwd: string): void {
|
|
79
|
-
const existing = runGit(['rev-parse', '--is-inside-work-tree'], { cwd });
|
|
80
|
-
if (existing.ok) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const init = runGit(['init'], { cwd });
|
|
84
|
-
if (!init.ok) {
|
|
85
|
-
throw new Error(`Failed to initialize git repository: ${init.stderr || init.stdout}`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export async function gitStatusTool(
|
|
90
|
-
input: Record<string, unknown>,
|
|
91
|
-
cwd: string,
|
|
92
|
-
): Promise<GitToolOutput> {
|
|
93
|
-
ensureRepository(cwd);
|
|
94
|
-
|
|
95
|
-
if (input.init === true) {
|
|
96
|
-
return {
|
|
97
|
-
success: true,
|
|
98
|
-
data: { initialized: true },
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const commands = Array.isArray(input.commands) ? input.commands : null;
|
|
103
|
-
if (commands) {
|
|
104
|
-
const commandResults: CommandExecutionResult[] = [];
|
|
105
|
-
|
|
106
|
-
for (const commandEntry of commands) {
|
|
107
|
-
if (!Array.isArray(commandEntry) || commandEntry.length === 0) {
|
|
108
|
-
return {
|
|
109
|
-
success: false,
|
|
110
|
-
error: {
|
|
111
|
-
code: 'invalid_command',
|
|
112
|
-
message: 'commands must contain non-empty command arrays.',
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const command = commandEntry[0];
|
|
118
|
-
if (!isGitBinaryCommand(command)) {
|
|
119
|
-
return {
|
|
120
|
-
success: false,
|
|
121
|
-
error: {
|
|
122
|
-
code: 'invalid_command',
|
|
123
|
-
message: 'git:status commands only allow the git binary.',
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const args = commandEntry.slice(1).map((arg) => String(arg));
|
|
129
|
-
const result = runGit(args, { cwd });
|
|
130
|
-
if (!result.ok) {
|
|
131
|
-
return {
|
|
132
|
-
success: false,
|
|
133
|
-
error: {
|
|
134
|
-
code: 'command_failed',
|
|
135
|
-
message: result.stderr || result.stdout || 'Command execution failed.',
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
commandResults.push({
|
|
141
|
-
command: String(command),
|
|
142
|
-
args,
|
|
143
|
-
stdout: result.stdout,
|
|
144
|
-
stderr: result.stderr,
|
|
145
|
-
status: result.status,
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return {
|
|
150
|
-
success: true,
|
|
151
|
-
data: {
|
|
152
|
-
commands_executed: commands.length,
|
|
153
|
-
command_results: commandResults,
|
|
154
|
-
output: commandResults[commandResults.length - 1]?.stdout.trim() ?? '',
|
|
155
|
-
},
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const simpleGitStatus = await trySimpleGitStatus(cwd);
|
|
160
|
-
if (simpleGitStatus !== null) {
|
|
161
|
-
return {
|
|
162
|
-
success: true,
|
|
163
|
-
data: {
|
|
164
|
-
status: simpleGitStatus,
|
|
165
|
-
source: 'simple-git',
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const status = runGit(['status', '--short'], { cwd });
|
|
171
|
-
if (!status.ok) {
|
|
172
|
-
return {
|
|
173
|
-
success: false,
|
|
174
|
-
error: {
|
|
175
|
-
code: 'git_status_failed',
|
|
176
|
-
message: status.stderr || status.stdout || 'git status failed.',
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return {
|
|
182
|
-
success: true,
|
|
183
|
-
data: {
|
|
184
|
-
status: status.stdout.trim(),
|
|
185
|
-
source: 'child_process',
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export async function gitAddTool(
|
|
191
|
-
input: Record<string, unknown>,
|
|
192
|
-
cwd: string,
|
|
193
|
-
): Promise<GitToolOutput> {
|
|
194
|
-
ensureRepository(cwd);
|
|
195
|
-
const files = Array.isArray(input.files) ? input.files.map((file) => String(file)) : [];
|
|
196
|
-
const args = ['add', ...(files.length > 0 ? files : ['-A'])];
|
|
197
|
-
const result = runGit(args, { cwd });
|
|
198
|
-
if (!result.ok) {
|
|
199
|
-
return {
|
|
200
|
-
success: false,
|
|
201
|
-
error: {
|
|
202
|
-
code: 'git_add_failed',
|
|
203
|
-
message: result.stderr || result.stdout || 'git add failed.',
|
|
204
|
-
},
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return {
|
|
209
|
-
success: true,
|
|
210
|
-
data: {
|
|
211
|
-
staged: files,
|
|
212
|
-
},
|
|
213
|
-
metadata: {
|
|
214
|
-
artifacts_written: files,
|
|
215
|
-
},
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export async function gitCommitTool(
|
|
220
|
-
input: Record<string, unknown>,
|
|
221
|
-
cwd: string,
|
|
222
|
-
): Promise<GitToolOutput> {
|
|
223
|
-
ensureRepository(cwd);
|
|
224
|
-
|
|
225
|
-
const message =
|
|
226
|
-
typeof input.message === 'string' && input.message.length > 0 ? input.message : null;
|
|
227
|
-
if (!message) {
|
|
228
|
-
return {
|
|
229
|
-
success: false,
|
|
230
|
-
error: {
|
|
231
|
-
code: 'invalid_message',
|
|
232
|
-
message: 'Commit message is required.',
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
const files = Array.isArray(input.files) ? input.files.map((file) => String(file)) : [];
|
|
238
|
-
if (files.length > 0) {
|
|
239
|
-
const stage = runGit(['add', ...files], { cwd });
|
|
240
|
-
if (!stage.ok) {
|
|
241
|
-
return {
|
|
242
|
-
success: false,
|
|
243
|
-
error: {
|
|
244
|
-
code: 'git_add_failed',
|
|
245
|
-
message: stage.stderr || stage.stdout || 'git add failed before commit.',
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
const commit = runGit(['commit', '--no-gpg-sign', '-m', message], { cwd });
|
|
252
|
-
if (!commit.ok) {
|
|
253
|
-
return {
|
|
254
|
-
success: false,
|
|
255
|
-
error: {
|
|
256
|
-
code: 'git_commit_failed',
|
|
257
|
-
message: commit.stderr || commit.stdout || 'git commit failed.',
|
|
258
|
-
},
|
|
259
|
-
metadata: {
|
|
260
|
-
artifacts_written: files,
|
|
261
|
-
},
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const hash = runGit(['rev-parse', 'HEAD'], { cwd });
|
|
266
|
-
return {
|
|
267
|
-
success: true,
|
|
268
|
-
data: {
|
|
269
|
-
commit: hash.ok ? hash.stdout.trim() : null,
|
|
270
|
-
output: commit.stdout.trim(),
|
|
271
|
-
},
|
|
272
|
-
metadata: {
|
|
273
|
-
artifacts_written: files,
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export async function runGitToolThroughToolHost(input: {
|
|
279
|
-
toolName: GitToolName;
|
|
280
|
-
input: Record<string, unknown>;
|
|
281
|
-
context: GitToolContext;
|
|
282
|
-
}): Promise<GitToolHostReceipt> {
|
|
283
|
-
const started: ToolCallStartedReceipt = {
|
|
284
|
-
schema_version: 1,
|
|
285
|
-
kind: 'tool_call_started',
|
|
286
|
-
run_id: input.context.run_id,
|
|
287
|
-
task_id: input.context.task_id,
|
|
288
|
-
session_id: input.context.session_id,
|
|
289
|
-
tool_name: input.toolName,
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
let output: GitToolOutput;
|
|
293
|
-
if (input.toolName === 'git:add') {
|
|
294
|
-
output = await gitAddTool(input.input, input.context.cwd);
|
|
295
|
-
} else if (input.toolName === 'git:status') {
|
|
296
|
-
output = await gitStatusTool(input.input, input.context.cwd);
|
|
297
|
-
} else {
|
|
298
|
-
output = await gitCommitTool(input.input, input.context.cwd);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
const finished: ToolCallFinishedReceipt = {
|
|
302
|
-
schema_version: 1,
|
|
303
|
-
kind: 'tool_call_finished',
|
|
304
|
-
result: output.success ? 'success' : 'failure',
|
|
305
|
-
artifacts_written:
|
|
306
|
-
output.metadata?.artifacts_written && output.metadata.artifacts_written.length > 0
|
|
307
|
-
? output.metadata.artifacts_written
|
|
308
|
-
: [],
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
return {
|
|
312
|
-
started,
|
|
313
|
-
finished,
|
|
314
|
-
output,
|
|
315
|
-
};
|
|
316
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
export * from './delegation-tools.js';
|
|
5
|
-
export * from './agent-tools.js';
|
|
6
|
-
export * from './flow-metrics-tools.js';
|
|
7
|
-
export * from './git-runner.js';
|
|
8
|
-
export * from './git-tools.js';
|
|
9
|
-
export * from './initiative-orchestration-tools.js';
|
|
10
|
-
export * from './lane-lock.js';
|
|
11
|
-
export * from './memory-tools.js';
|
|
12
|
-
export * from './runtime-native-tools.js';
|
|
13
|
-
export * from './wu-lifecycle-tools.js';
|
|
14
|
-
export * from './worker-loader.js';
|
|
15
|
-
export * from './worktree-tools.js';
|