zelari-code 0.7.8 → 0.7.10
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 +95 -44
- package/bin/zelari-code.js +1 -1
- package/dist/agents/councilApi.js +7 -7
- package/dist/agents/councilApi.js.map +1 -1
- package/dist/agents/councilDirectives.js +3 -3
- package/dist/agents/promoteMember.js +2 -2
- package/dist/agents/roles.js +50 -32
- package/dist/agents/roles.js.map +1 -1
- package/dist/agents/skills/builtin/debugging.js +4 -4
- package/dist/agents/skills/builtin/debugging.js.map +1 -1
- package/dist/agents/skills/builtin/docs.js +23 -13
- package/dist/agents/skills/builtin/docs.js.map +1 -1
- package/dist/agents/skills/builtin/git-ops.js +3 -3
- package/dist/agents/skills/builtin/git-ops.js.map +1 -1
- package/dist/agents/skills/builtin/planning.js +4 -4
- package/dist/agents/skills/builtin/planning.js.map +1 -1
- package/dist/agents/skills/builtin/refactoring.js +3 -3
- package/dist/agents/skills/builtin/refactoring.js.map +1 -1
- package/dist/agents/skills/builtin/review.js +9 -9
- package/dist/agents/skills/builtin/review.js.map +1 -1
- package/dist/agents/skills/builtin/testing.js +3 -3
- package/dist/agents/skills/builtin/testing.js.map +1 -1
- package/dist/agents/tools.js +2 -9
- package/dist/agents/tools.js.map +1 -1
- package/dist/cli/app.js +79 -18
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/components/CollapsibleToolOutput.js +8 -26
- package/dist/cli/components/CollapsibleToolOutput.js.map +1 -1
- package/dist/cli/components/Header.js +6 -18
- package/dist/cli/components/Header.js.map +1 -1
- package/dist/cli/components/LiveRegion.js +7 -3
- package/dist/cli/components/LiveRegion.js.map +1 -1
- package/dist/cli/components/SelectList.js +67 -0
- package/dist/cli/components/SelectList.js.map +1 -0
- package/dist/cli/components/Sidebar.js +86 -37
- package/dist/cli/components/Sidebar.js.map +1 -1
- package/dist/cli/components/Spinner.js +51 -0
- package/dist/cli/components/Spinner.js.map +1 -0
- package/dist/cli/components/SplashScreen.js +117 -71
- package/dist/cli/components/SplashScreen.js.map +1 -1
- package/dist/cli/components/StatusBar.js +44 -32
- package/dist/cli/components/StatusBar.js.map +1 -1
- package/dist/cli/councilConfig.js +38 -0
- package/dist/cli/councilConfig.js.map +1 -0
- package/dist/cli/councilDispatcher.js +35 -49
- package/dist/cli/councilDispatcher.js.map +1 -1
- package/dist/cli/hooks/useChatTurn.js +80 -61
- package/dist/cli/hooks/useChatTurn.js.map +1 -1
- package/dist/cli/hooks/useExecutionTimer.js +25 -0
- package/dist/cli/hooks/useExecutionTimer.js.map +1 -0
- package/dist/cli/hooks/useGitChanges.js +142 -0
- package/dist/cli/hooks/useGitChanges.js.map +1 -0
- package/dist/cli/hooks/useSlashDispatch.js +20 -3
- package/dist/cli/hooks/useSlashDispatch.js.map +1 -1
- package/dist/cli/main.bundled.js +19776 -19052
- package/dist/cli/main.bundled.js.map +4 -4
- package/dist/cli/main.js +1 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/mcp/mcpClient.js +14 -6
- package/dist/cli/mcp/mcpClient.js.map +1 -1
- package/dist/cli/slashCommands.js +21 -4
- package/dist/cli/slashCommands.js.map +1 -1
- package/dist/cli/slashHandlers/provider.js +101 -4
- package/dist/cli/slashHandlers/provider.js.map +1 -1
- package/dist/cli/updater.js +8 -5
- package/dist/cli/updater.js.map +1 -1
- package/dist/cli/utils/cmdline.js +26 -0
- package/dist/cli/utils/cmdline.js.map +1 -0
- package/dist/cli/utils/paths.js +20 -0
- package/dist/cli/utils/paths.js.map +1 -0
- package/dist/cli/workspace/planDetect.js +17 -0
- package/dist/cli/workspace/planDetect.js.map +1 -0
- package/dist/cli/workspace/postCouncilHook.js +39 -28
- package/dist/cli/workspace/postCouncilHook.js.map +1 -1
- package/dist/cli/workspace/stubs.js +241 -196
- package/dist/cli/workspace/stubs.js.map +1 -1
- package/dist/main/core/AgentHarness.js +36 -7
- package/dist/main/core/AgentHarness.js.map +1 -1
- package/dist/main/core/tools/builtin/listFiles.js +43 -5
- package/dist/main/core/tools/builtin/listFiles.js.map +1 -1
- package/dist/main/core/tools/builtin/search.js +28 -120
- package/dist/main/core/tools/builtin/search.js.map +1 -1
- package/package.json +71 -71
- package/dist/cli/oauthCallbackServer.js +0 -207
- package/dist/cli/oauthCallbackServer.js.map +0 -1
- package/dist/main/core/tools/builtin/_walk.js +0 -129
- package/dist/main/core/tools/builtin/_walk.js.map +0 -1
- package/dist/main/core/tools/builtin/diff.js +0 -477
- package/dist/main/core/tools/builtin/diff.js.map +0 -1
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* ASCII art) centered in the terminal for ~2 seconds — or until any key is
|
|
6
6
|
* pressed — then unmounts and gives way to the normal App.
|
|
7
7
|
*
|
|
8
|
-
* Sizing:
|
|
9
|
-
* as constants; `pickSplashArt` chooses the largest one that fits
|
|
10
|
-
* current terminal
|
|
11
|
-
* (the splash is then
|
|
8
|
+
* Sizing: four pre-rendered variants (64/44/30/22 columns wide) are
|
|
9
|
+
* embedded as constants; `pickSplashArt` chooses the largest one that fits
|
|
10
|
+
* the current terminal (dropping the version/hint footer on short panes),
|
|
11
|
+
* or returns null when even the micro one doesn't fit (the splash is then
|
|
12
|
+
* skipped entirely).
|
|
12
13
|
*
|
|
13
14
|
* Skipped when stdout is not a TTY (pipes, CI) or `ZELARI_NO_SPLASH=1`.
|
|
14
15
|
*/
|
|
@@ -22,68 +23,99 @@ import { Box, Text, useInput, useStdin } from 'ink';
|
|
|
22
23
|
export const SPLASH_DURATION_MS = 2000;
|
|
23
24
|
// Downscaled from the source emblem (142×79) by block-averaging glyph
|
|
24
25
|
// density — see docs/plans/2026-07-03-cli-splash-screen.md.
|
|
25
|
-
const EMBLEM_LARGE = ` =%@*-
|
|
26
|
-
=%@@@@@#:
|
|
27
|
-
*%%%%%%@@%-
|
|
28
|
-
:#%%%%%%%%%@@*
|
|
29
|
-
:*%%%%%%%%%%%%%@%*.
|
|
30
|
-
=%%%%%%%%%%%%%%%%@@%.
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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*`;
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
const EMBLEM_TINY = ` -%%+
|
|
87
|
+
.*%%%@#:
|
|
88
|
+
=%%%%%%%@*
|
|
89
|
+
+%%%%%%%%%%#.
|
|
90
|
+
+%%%@@@@@@@%@#.
|
|
91
|
+
.*%@@@@@@@@@@@@@%-
|
|
92
|
+
.#%@@@@@@@@@@@@@@@@-
|
|
93
|
+
*%@@@@@@@@@@@@@@@@@%.
|
|
94
|
+
:@%%@@@@@@%:+%@@@@@%@=
|
|
95
|
+
=@%%@@@@@%.=-+%@%%@*
|
|
96
|
+
.=@@%@@@@%.*@*-+@@*.
|
|
97
|
+
-*%@@@@@@@@%.*@@@+:#@@#=.
|
|
98
|
+
*%%%%%%@@@@@@.*#%#=-:+@@@%
|
|
99
|
+
:@%%%%%%@@@@@@.:=.*:*@@@@@@=
|
|
100
|
+
*@%%@%%@@@@@@@*%@*:-:%@@@@@%.
|
|
101
|
+
:@@@%@@@@@@@@@@@@@@#%@@@@@@@@=
|
|
102
|
+
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%#`;
|
|
103
|
+
const EMBLEM_MICRO = ` -#%=
|
|
104
|
+
+%%%%#.
|
|
105
|
+
:#%%%%%%%-
|
|
106
|
+
:%%@@@@@@@@=
|
|
107
|
+
-%@@@@@@@@@@@+
|
|
108
|
+
:%@@@@@@%@@@@@@=
|
|
109
|
+
-%%@@@@@.+%@@%@+
|
|
110
|
+
-@@@@@@:%++%@=
|
|
111
|
+
=*%@@@@@@:@@%=*@#+.
|
|
112
|
+
=%%%%%@@@@:+++-*%@@*
|
|
113
|
+
.%%%%%@@@@@+%+=:%@@@@:
|
|
114
|
+
*@@@@@@@@@@@@@%@@@@@@*`;
|
|
115
|
+
/** Rows the FULL footer (margin + wordmark + version + hint) needs below the art. */
|
|
116
|
+
const FOOTER_ROWS_FULL = 5;
|
|
117
|
+
/** Rows the COMPACT footer (margin + wordmark only) needs — used on short terminals. */
|
|
118
|
+
const FOOTER_ROWS_COMPACT = 2;
|
|
87
119
|
function measure(art) {
|
|
88
120
|
const lines = art.split('\n');
|
|
89
121
|
return {
|
|
@@ -92,15 +124,29 @@ function measure(art) {
|
|
|
92
124
|
height: lines.length,
|
|
93
125
|
};
|
|
94
126
|
}
|
|
95
|
-
const VARIANTS = [
|
|
127
|
+
const VARIANTS = [
|
|
128
|
+
measure(EMBLEM_LARGE),
|
|
129
|
+
measure(EMBLEM_SMALL),
|
|
130
|
+
measure(EMBLEM_TINY),
|
|
131
|
+
measure(EMBLEM_MICRO),
|
|
132
|
+
];
|
|
96
133
|
/**
|
|
97
|
-
* Pure helper: pick the largest emblem variant that fits `columns`×`rows
|
|
98
|
-
*
|
|
134
|
+
* Pure helper: pick the largest emblem variant that fits `columns`×`rows`.
|
|
135
|
+
* Tries the full footer first (wordmark + version + hint); on short
|
|
136
|
+
* terminals falls back to the compact footer (wordmark only) so the
|
|
137
|
+
* splash still shows in low panes like VS Code's integrated terminal.
|
|
138
|
+
* Returns null only when even the micro variant doesn't fit.
|
|
99
139
|
*/
|
|
100
140
|
export function pickSplashArt(columns, rows) {
|
|
141
|
+
// Largest art wins: a bigger emblem with the compact footer beats a
|
|
142
|
+
// smaller emblem with the full footer.
|
|
101
143
|
for (const v of VARIANTS) {
|
|
102
|
-
if (v.width
|
|
103
|
-
|
|
144
|
+
if (v.width > columns - 2)
|
|
145
|
+
continue;
|
|
146
|
+
if (v.height + FOOTER_ROWS_FULL <= rows)
|
|
147
|
+
return { ...v, compact: false };
|
|
148
|
+
if (v.height + FOOTER_ROWS_COMPACT <= rows)
|
|
149
|
+
return { ...v, compact: true };
|
|
104
150
|
}
|
|
105
151
|
return null;
|
|
106
152
|
}
|
|
@@ -135,8 +181,8 @@ function Splash({ onDone, version }) {
|
|
|
135
181
|
React.createElement(Text, { color: "cyan" }, picked.art),
|
|
136
182
|
React.createElement(Box, { marginTop: 1 },
|
|
137
183
|
React.createElement(Text, { bold: true, color: "white" }, 'Z E L A R I C O D E')),
|
|
138
|
-
React.createElement(Text, { dimColor: true }, `${version ? `v${version} — ` : ''}N-THEM Studio`),
|
|
139
|
-
React.createElement(Text, { dimColor: true, italic: true }, "press any key to skip")));
|
|
184
|
+
!picked.compact && (React.createElement(Text, { dimColor: true }, `${version ? `v${version} — ` : ''}N-THEM Studio`)),
|
|
185
|
+
!picked.compact && (React.createElement(Text, { dimColor: true, italic: true }, "press any key to skip"))));
|
|
140
186
|
}
|
|
141
187
|
/**
|
|
142
188
|
* SplashGate — renders the splash first, then swaps in `children` (the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplashScreen.js","sourceRoot":"","sources":["../../../src/cli/components/SplashScreen.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SplashScreen.js","sourceRoot":"","sources":["../../../src/cli/components/SplashScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,wEAAwE;AACxE,sEAAsE;AACtE,0EAA0E;AAC1E,+BAA+B;AAC/B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEpD,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEvC,sEAAsE;AACtE,4DAA4D;AAC5D,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iEAmC4C,CAAC;AAElE,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;6CAuBwB,CAAC;AAE9C,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;+BAgBW,CAAC;AAEhC,MAAM,YAAY,GAAG;;;;;;;;;;;uBAWE,CAAC;AAExB,qFAAqF;AACrF,MAAM,gBAAgB,GAAG,CAAC,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B,oBAAC,IAAI,IAAC,QAAQ,UAAE,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,eAAe,CAAQ,CAC1E;QACA,CAAC,MAAM,CAAC,OAAO,IAAI,CAClB,oBAAC,IAAI,IAAC,QAAQ,QAAC,MAAM,kCAEd,CACR,CACG,CACP,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,OAAO,GAMR;IACC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CACpC,gBAAgB,CAAC;QACf,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI;QACpC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE;QACrC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;KAChC,CAAC,CACH,CAAC;IAEF,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,oBAAC,MAAM,IAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;IACpE,CAAC;IACD,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,CAAC"}
|
|
@@ -1,42 +1,54 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
-
import {
|
|
3
|
+
import { formatDuration } from '../utils/duration.js';
|
|
4
|
+
import { Spinner } from './Spinner.js';
|
|
4
5
|
/**
|
|
5
|
-
* StatusBar — single one-line status bar
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* StatusBar — single one-line status bar rendered below the input box.
|
|
7
|
+
*
|
|
8
|
+
* v0.7.10: extended to the full terminal width. Two groups justified with
|
|
9
|
+
* space-between: identity on the left (mode · provider · model · cwd) and
|
|
10
|
+
* run state on the right (spinner+timer / last, queue, session). Both groups
|
|
11
|
+
* truncate instead of wrapping, so the bar is always exactly one row — the
|
|
12
|
+
* old layout wrapped on narrow terminals, squashing the dynamic region.
|
|
8
13
|
*
|
|
9
14
|
* Why one line: the static-scrollback model (v0.7.0) needs the dynamic
|
|
10
15
|
* region as short as possible. A single status line + the input bar + the
|
|
11
16
|
* streaming tail is always well under a screen, so no full repaint.
|
|
12
17
|
*/
|
|
13
|
-
export function StatusBar({ model, provider, sessionId, sessionActive,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
React.createElement(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
18
|
+
export function StatusBar({ model, provider, sessionId, sessionActive, queueCount = 0, busy = false, mode = 'agent', cwd, elapsedMs = null, lastMs = null, }) {
|
|
19
|
+
return (React.createElement(Box, { paddingX: 1, width: "100%", justifyContent: "space-between", gap: 2 },
|
|
20
|
+
React.createElement(Box, { flexShrink: 2 },
|
|
21
|
+
React.createElement(Text, { wrap: "truncate" },
|
|
22
|
+
React.createElement(Text, { color: sessionActive ? 'green' : 'gray' }, sessionActive ? '●' : '○'),
|
|
23
|
+
React.createElement(Text, { dimColor: true }, " "),
|
|
24
|
+
React.createElement(Text, { bold: true, color: mode === 'council' ? 'magenta' : 'cyan' }, mode === 'council' ? '⛬ council' : '⏵ agent'),
|
|
25
|
+
React.createElement(Text, { dimColor: true }, " (shift+tab)"),
|
|
26
|
+
React.createElement(Text, { dimColor: true }, " \u00B7 "),
|
|
27
|
+
React.createElement(Text, { bold: true, color: "cyan" }, provider),
|
|
28
|
+
React.createElement(Text, { dimColor: true }, " \u00B7 "),
|
|
29
|
+
React.createElement(Text, null, model),
|
|
30
|
+
cwd ? (React.createElement(React.Fragment, null,
|
|
31
|
+
React.createElement(Text, { dimColor: true }, " \u00B7 "),
|
|
32
|
+
React.createElement(Text, { color: "blue" }, cwd))) : null)),
|
|
33
|
+
React.createElement(Box, { flexShrink: 1 },
|
|
34
|
+
React.createElement(Text, { wrap: "truncate" },
|
|
35
|
+
busy && elapsedMs !== null ? (React.createElement(React.Fragment, null,
|
|
36
|
+
React.createElement(Spinner, { color: "yellow" }),
|
|
37
|
+
React.createElement(Text, { color: "yellow" },
|
|
38
|
+
" ",
|
|
39
|
+
formatDuration(elapsedMs)),
|
|
40
|
+
React.createElement(Text, { dimColor: true }, " \u00B7 "))) : lastMs !== null ? (React.createElement(React.Fragment, null,
|
|
41
|
+
React.createElement(Text, { dimColor: true },
|
|
42
|
+
"last ",
|
|
43
|
+
formatDuration(lastMs)),
|
|
44
|
+
React.createElement(Text, { dimColor: true }, " \u00B7 "))) : null,
|
|
45
|
+
queueCount > 0 ? (React.createElement(React.Fragment, null,
|
|
46
|
+
React.createElement(Text, { color: "magenta" },
|
|
47
|
+
"queue ",
|
|
48
|
+
queueCount),
|
|
49
|
+
React.createElement(Text, { dimColor: true }, " \u00B7 "))) : null,
|
|
50
|
+
React.createElement(Text, { dimColor: true },
|
|
51
|
+
"session ",
|
|
52
|
+
sessionId)))));
|
|
41
53
|
}
|
|
42
54
|
//# sourceMappingURL=StatusBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.js","sourceRoot":"","sources":["../../../src/cli/components/StatusBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"StatusBar.js","sourceRoot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default for interactive `/council` is **full** (6 members) so Minosse and
|
|
5
|
+
* Lucifero always run. Opt into the lighter tier via `ZELARI_COUNCIL_TIER=lite`
|
|
6
|
+
* or an explicit `councilSize` below 6.
|
|
7
|
+
*/
|
|
8
|
+
export const COUNCIL_TIER_SIZES = {
|
|
9
|
+
lite: 3,
|
|
10
|
+
full: 6,
|
|
11
|
+
};
|
|
12
|
+
export function resolveCouncilTier(opts) {
|
|
13
|
+
const env = opts?.env ?? process.env;
|
|
14
|
+
if (opts?.explicitSize !== undefined) {
|
|
15
|
+
const size = clampCouncilSize(opts.explicitSize);
|
|
16
|
+
return { tier: size >= COUNCIL_TIER_SIZES.full ? 'full' : 'lite', councilSize: size };
|
|
17
|
+
}
|
|
18
|
+
const envSize = env['ZELARI_COUNCIL_SIZE'];
|
|
19
|
+
if (envSize) {
|
|
20
|
+
const parsed = Number.parseInt(envSize, 10);
|
|
21
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
22
|
+
const size = clampCouncilSize(parsed);
|
|
23
|
+
return { tier: size >= COUNCIL_TIER_SIZES.full ? 'full' : 'lite', councilSize: size };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const tierEnv = env['ZELARI_COUNCIL_TIER']?.toLowerCase();
|
|
27
|
+
if (tierEnv === 'lite') {
|
|
28
|
+
return { tier: 'lite', councilSize: COUNCIL_TIER_SIZES.lite };
|
|
29
|
+
}
|
|
30
|
+
if (tierEnv === 'full') {
|
|
31
|
+
return { tier: 'full', councilSize: COUNCIL_TIER_SIZES.full };
|
|
32
|
+
}
|
|
33
|
+
return { tier: 'full', councilSize: COUNCIL_TIER_SIZES.full };
|
|
34
|
+
}
|
|
35
|
+
function clampCouncilSize(n) {
|
|
36
|
+
return Math.min(COUNCIL_TIER_SIZES.full, Math.max(1, Math.floor(n)));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=councilConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"councilConfig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AAE,CAAC;IAChE,CAAC;IACD,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,CAAC,IAAI,EAAE,CAAC;IAChE,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,CAAC,IAAI,EAAE,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAS;IACjC,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1,82 +1,68 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* councilDispatcher — CLI-side bridge to runCouncilPure.
|
|
3
3
|
*
|
|
4
|
-
* Builds a
|
|
4
|
+
* Builds a {@link PureCouncilConfig} from CLI env (apiKey, model,
|
|
5
5
|
* provider), wires the openai-compatible provider stream, and yields the
|
|
6
|
-
* council run as an AsyncIterable<BrainEvent>.
|
|
7
|
-
* events to the chat and persists them via SessionJsonlWriter.
|
|
6
|
+
* council run as an AsyncIterable<BrainEvent>.
|
|
8
7
|
*
|
|
9
|
-
* Default config:
|
|
10
|
-
* - councilSize:
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
14
|
-
* Phase 14.7: multi-agent council invocation from the Ink CLI.
|
|
8
|
+
* Default config (v0.7.9):
|
|
9
|
+
* - councilSize: 6 (full council — Caronte through Lucifero)
|
|
10
|
+
* - runMode: auto-detected from user message + existing plan
|
|
11
|
+
* - debateMode: false (no multi-round debate loop)
|
|
15
12
|
*
|
|
16
13
|
* @see docs/plans/2026-06-28-zelari-code.md (Task 14.7)
|
|
17
14
|
*/
|
|
18
|
-
import { runCouncilPure, } from
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
15
|
+
import { runCouncilPure, resolveCouncilRunMode, } from "@zelari/core/council";
|
|
16
|
+
import { resolveCouncilTier } from "./councilConfig.js";
|
|
17
|
+
import { hasWorkspacePlan } from "./workspace/planDetect.js";
|
|
18
|
+
import { createWorkspaceContext } from "./workspace/stubs.js";
|
|
19
|
+
import { createWorkspaceToolRegistry } from "./workspace/toolRegistry.js";
|
|
21
20
|
export class CouncilDispatchError extends Error {
|
|
22
21
|
constructor(message) {
|
|
23
22
|
super(message);
|
|
24
|
-
this.name =
|
|
23
|
+
this.name = "CouncilDispatchError";
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Run a council on `userMessage` and yield the resulting BrainEvents.
|
|
29
|
-
*
|
|
30
|
-
* Throws CouncilDispatchError synchronously if apiKey is missing.
|
|
31
|
-
* The returned async iterable emits the full council lifecycle; consumers
|
|
32
|
-
* should iterate to completion or break early to cancel.
|
|
33
|
-
*/
|
|
34
26
|
export async function* dispatchCouncil(userMessage, options) {
|
|
35
27
|
if (!options.apiKey || options.apiKey.trim().length === 0) {
|
|
36
|
-
throw new CouncilDispatchError(
|
|
28
|
+
throw new CouncilDispatchError("Missing apiKey — set OPENAI_API_KEY (or pass it via env) before invoking /council.");
|
|
37
29
|
}
|
|
38
30
|
if (!userMessage || userMessage.trim().length === 0) {
|
|
39
|
-
throw new CouncilDispatchError(
|
|
31
|
+
throw new CouncilDispatchError("Empty userMessage — /council requires a non-empty input.");
|
|
40
32
|
}
|
|
33
|
+
const projectRoot = options.workspaceRoot ?? process.cwd();
|
|
34
|
+
const { councilSize } = resolveCouncilTier({
|
|
35
|
+
explicitSize: options.councilSize,
|
|
36
|
+
});
|
|
37
|
+
const runMode = options.runMode ??
|
|
38
|
+
resolveCouncilRunMode({
|
|
39
|
+
userMessage,
|
|
40
|
+
hasExistingPlan: hasWorkspacePlan(projectRoot),
|
|
41
|
+
env: process.env,
|
|
42
|
+
});
|
|
41
43
|
const config = {
|
|
42
44
|
apiKey: options.apiKey,
|
|
43
|
-
provider: options.provider ??
|
|
45
|
+
provider: options.provider ?? "openai-compatible",
|
|
44
46
|
model: options.model,
|
|
45
|
-
councilSize
|
|
47
|
+
councilSize,
|
|
46
48
|
debateMode: options.debateMode ?? false,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
runMode,
|
|
50
|
+
ragContext: options.ragContext ?? "",
|
|
51
|
+
workspaceContext: options.workspaceContext ?? "",
|
|
49
52
|
providerStream: options.providerStream,
|
|
50
53
|
eventBus: options.eventBus,
|
|
51
54
|
sessionId: options.sessionId,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// to skip workspace wiring (e.g. in tests).
|
|
55
|
-
tools: options.tools
|
|
56
|
-
?? (options.disableWorkspaceTools
|
|
55
|
+
tools: options.tools ??
|
|
56
|
+
(options.disableWorkspaceTools
|
|
57
57
|
? undefined
|
|
58
|
-
: createWorkspaceToolRegistry(createWorkspaceContext())),
|
|
58
|
+
: createWorkspaceToolRegistry(createWorkspaceContext(projectRoot))),
|
|
59
59
|
maxToolCallsPerTurn: options.maxToolCallsPerTurn,
|
|
60
60
|
feedbackStore: options.feedbackStore,
|
|
61
61
|
};
|
|
62
|
-
// Bug A fix (v0.7.5): also register workspace stubs in the global static
|
|
63
|
-
// (setWorkspaceStubs from @zelari/core/skills) so that getAllTools() —
|
|
64
|
-
// called by buildSystemPrompt when constructing the AVAILABLE TOOLS block —
|
|
65
|
-
// exposes them to the model. Without this, the per-call ToolRegistry can
|
|
66
|
-
// execute workspace tool calls, but the model never sees the names in its
|
|
67
|
-
// system prompt and either guesses them or skips them.
|
|
68
|
-
//
|
|
69
|
-
// Mirrors the pattern in src/cli/runHeadless.ts:141-152 and
|
|
70
|
-
// src/cli/hooks/useChatTurn.ts:572-586. Dynamic import avoids the load-
|
|
71
|
-
// order cycle that a static import would create (councilDispatcher is
|
|
72
|
-
// imported by hooks/runHeadless, and @zelari/core/skills is consumed by
|
|
73
|
-
// those same modules — see Gotcha #9 of zelari-code-headless-driver).
|
|
74
62
|
if (!options.disableWorkspaceTools) {
|
|
75
|
-
const { setWorkspaceStubs } = await import(
|
|
76
|
-
const { createWorkspaceContext: buildCtx, createWorkspaceStubs: buildStubs } = await import(
|
|
77
|
-
const wsCtx =
|
|
78
|
-
? buildCtx(options.workspaceRoot)
|
|
79
|
-
: buildCtx();
|
|
63
|
+
const { setWorkspaceStubs } = await import("@zelari/core/skills");
|
|
64
|
+
const { createWorkspaceContext: buildCtx, createWorkspaceStubs: buildStubs, } = await import("./workspace/stubs.js");
|
|
65
|
+
const wsCtx = buildCtx(projectRoot);
|
|
80
66
|
setWorkspaceStubs(buildStubs(wsCtx));
|
|
81
67
|
}
|
|
82
68
|
yield* runCouncilPure(userMessage, config, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"councilDispatcher.js","sourceRoot":"","sources":["../../src/cli/councilDispatcher.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"councilDispatcher.js","sourceRoot":"","sources":["../../src/cli/councilDispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,cAAc,EACd,qBAAqB,GAGtB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAiC1E,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,eAAe,CACpC,WAAmB,EACnB,OAA+B;IAE/B,IAAI,CAAC,OAAO,CAAC,MAAM,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