@zenera/cli 1.1.24 → 1.1.25
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 +53 -0
- package/dist/ask.js +28 -5
- package/dist/banner.js +2 -2
- package/dist/batch.d.ts +6 -0
- package/dist/batch.js +76 -1
- package/dist/catalog.d.ts +11 -1
- package/dist/catalog.js +80 -7
- package/dist/commands/inspect.d.ts +47 -1
- package/dist/commands/inspect.js +167 -18
- package/dist/commands/memory.js +128 -29
- package/dist/commands/meta.js +311 -21
- package/dist/commands/models.js +96 -12
- package/dist/commands/open.js +4 -4
- package/dist/commands/run.js +38 -4
- package/dist/commands/sandbox.js +76 -14
- package/dist/engine.d.ts +5 -0
- package/dist/engine.js +1 -0
- package/dist/eventlog.d.ts +59 -0
- package/dist/eventlog.js +146 -0
- package/dist/liveness.d.ts +7 -0
- package/dist/liveness.js +15 -1
- package/dist/meta/editor.d.ts +9 -0
- package/dist/meta/editor.js +60 -0
- package/dist/meta/finetune/children.d.ts +8 -0
- package/dist/meta/finetune/children.js +76 -0
- package/dist/meta/finetune/command.d.ts +30 -0
- package/dist/meta/finetune/command.js +338 -0
- package/dist/meta/finetune/dataset/anchors.d.ts +41 -0
- package/dist/meta/finetune/dataset/anchors.js +239 -0
- package/dist/meta/finetune/dataset/changes.d.ts +36 -0
- package/dist/meta/finetune/dataset/changes.js +319 -0
- package/dist/meta/finetune/dataset/command.d.ts +17 -0
- package/dist/meta/finetune/dataset/command.js +1011 -0
- package/dist/meta/finetune/dataset/drift.d.ts +33 -0
- package/dist/meta/finetune/dataset/drift.js +71 -0
- package/dist/meta/finetune/dataset/export.d.ts +26 -0
- package/dist/meta/finetune/dataset/export.js +51 -0
- package/dist/meta/finetune/dataset/index.d.ts +2 -0
- package/dist/meta/finetune/dataset/index.js +2 -0
- package/dist/meta/finetune/dataset/sample.d.ts +50 -0
- package/dist/meta/finetune/dataset/sample.js +197 -0
- package/dist/meta/finetune/dataset/schema.d.ts +33 -0
- package/dist/meta/finetune/dataset/schema.js +216 -0
- package/dist/meta/finetune/dataset/store.d.ts +35 -0
- package/dist/meta/finetune/dataset/store.js +177 -0
- package/dist/meta/finetune/dataset/types.d.ts +125 -0
- package/dist/meta/finetune/dataset/types.js +39 -0
- package/dist/meta/finetune/failure.d.ts +15 -0
- package/dist/meta/finetune/failure.js +26 -0
- package/dist/meta/finetune/feedback.d.ts +45 -0
- package/dist/meta/finetune/feedback.js +85 -0
- package/dist/meta/finetune/improvements.d.ts +51 -0
- package/dist/meta/finetune/improvements.js +244 -0
- package/dist/meta/finetune/index.d.ts +2 -0
- package/dist/meta/finetune/index.js +2 -0
- package/dist/meta/finetune/journal.d.ts +35 -0
- package/dist/meta/finetune/journal.js +135 -0
- package/dist/meta/finetune/live.d.ts +74 -0
- package/dist/meta/finetune/live.js +226 -0
- package/dist/meta/finetune/loop.d.ts +3 -0
- package/dist/meta/finetune/loop.js +114 -0
- package/dist/meta/finetune/memories.d.ts +47 -0
- package/dist/meta/finetune/memories.js +154 -0
- package/dist/meta/finetune/report.d.ts +33 -0
- package/dist/meta/finetune/report.js +1284 -0
- package/dist/meta/finetune/retry.d.ts +24 -0
- package/dist/meta/finetune/retry.js +96 -0
- package/dist/meta/finetune/sampler.d.ts +18 -0
- package/dist/meta/finetune/sampler.js +41 -0
- package/dist/meta/finetune/system.d.ts +27 -0
- package/dist/meta/finetune/system.js +132 -0
- package/dist/meta/finetune/train.d.ts +39 -0
- package/dist/meta/finetune/train.js +391 -0
- package/dist/meta/finetune/tui.d.ts +16 -0
- package/dist/meta/finetune/tui.js +291 -0
- package/dist/meta/finetune/tuning.d.ts +167 -0
- package/dist/meta/finetune/tuning.js +289 -0
- package/dist/meta/finetune/usage.d.ts +62 -0
- package/dist/meta/finetune/usage.js +225 -0
- package/dist/meta/host.d.ts +14 -0
- package/dist/meta/host.js +20 -0
- package/dist/meta/index.d.ts +11 -0
- package/dist/meta/index.js +11 -0
- package/dist/meta/launch.d.ts +81 -0
- package/dist/meta/launch.js +286 -0
- package/dist/meta/model.d.ts +44 -0
- package/dist/meta/model.js +119 -0
- package/dist/meta/prompts.d.ts +18 -0
- package/dist/meta/prompts.js +61 -0
- package/dist/meta/relay.d.ts +20 -0
- package/dist/meta/relay.js +123 -0
- package/dist/meta/tokens.d.ts +52 -0
- package/dist/meta/tokens.js +226 -0
- package/dist/meta/window.d.ts +61 -0
- package/dist/meta/window.js +198 -0
- package/dist/meta/wire.d.ts +42 -0
- package/dist/meta/wire.js +129 -0
- package/dist/modelref.d.ts +16 -0
- package/dist/modelref.js +41 -0
- package/dist/narrate.js +5 -2
- package/dist/podman.d.ts +26 -0
- package/dist/podman.js +83 -3
- package/dist/projects.d.ts +0 -5
- package/dist/projects.js +2 -15
- package/dist/sandbox.d.ts +2 -0
- package/dist/sandbox.js +10 -3
- package/dist/scaffold.d.ts +15 -6
- package/dist/scaffold.js +5 -60
- package/dist/session.js +4 -29
- package/dist/term.d.ts +2 -0
- package/dist/term.js +11 -2
- package/dist/trace.js +53 -2
- package/dist/tui/models.d.ts +33 -0
- package/dist/tui/models.js +389 -0
- package/dist/tui/wrap.d.ts +5 -0
- package/dist/tui/wrap.js +12 -0
- package/dist/usage.d.ts +78 -0
- package/dist/usage.js +51 -0
- package/package.json +3 -2
- package/templates/editor/.github/copilot-instructions.md +31 -102
- package/templates/editor/.github/prompts/analyze.prompt.md +31 -0
- package/templates/editor/.github/prompts/dataset.prompt.md +108 -0
- package/templates/editor/.github/prompts/finetune-apply.prompt.md +91 -0
- package/templates/editor/.github/prompts/finetune.prompt.md +691 -198
- package/templates/editor/.github/prompts/new-agent.prompt.md +3 -1
- package/templates/editor/.github/prompts/new-skill.prompt.md +2 -0
- package/templates/editor/.github/prompts/project-review.prompt.md +4 -3
- package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +483 -0
- package/templates/editor/.github/skills/zen-cli/SKILL.md +9 -1
- package/templates/editor/.github/skills/zen-cli/references/dataset.md +34 -0
- package/templates/editor/.github/skills/zen-cli/references/finetune.md +77 -0
- package/templates/editor/.github/skills/zen-cli/references/inspect.md +47 -9
- package/templates/editor/.github/skills/zen-cli/references/memory.md +33 -10
- package/templates/editor/.github/skills/zen-cli/references/meta.md +61 -0
- package/templates/editor/.github/skills/zen-cli/references/models.md +5 -1
- package/templates/editor/.github/skills/zen-cli/references/rag.md +24 -6
- package/templates/editor/.github/skills/zen-cli/references/sandbox.md +10 -1
- package/templates/editor/.github/skills/zen-code-python/SKILL.md +123 -0
- package/templates/editor/.github/skills/zen-code-python/references/code_python.md +48 -0
- package/templates/editor/.github/skills/zen-dataset/SKILL.md +253 -0
- package/templates/editor/.github/skills/zen-finetune/SKILL.md +1449 -658
- package/templates/editor/.github/skills/zen-finetune/references/readme-template.md +268 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/batch.mjs +390 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/difficult.mjs +243 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/memory.mjs +280 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/next.mjs +398 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/report.mjs +797 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/select.mjs +354 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/usage.mjs +722 -0
- package/templates/editor/.github/skills/zen-inspect/SKILL.md +60 -25
- package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +270 -0
- package/templates/editor/.github/skills/zen-memory/SKILL.md +18 -14
- package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +20 -8
- package/templates/editor/.github/skills/zen-review/SKILL.md +5 -3
- package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +5 -4
- package/templates/editor/.github/skills/zen-sandbox/SKILL.md +7 -3
- package/templates/editor/.github/skills/zen-sandbox-capacity/SKILL.md +2 -2
- package/templates/editor/.github/skills/zen-topology/SKILL.md +283 -0
- package/templates/editor/.vscode/settings.json +1 -0
- package/templates/project/agents/files-instructions.md +29 -20
- package/templates/project/agents/memory-instructions.md +31 -32
- package/templates/project/agents/tools-instructions.md +7 -4
- package/templates/project/gitignore +2 -0
- package/dist/meta.d.ts +0 -221
- package/dist/meta.js +0 -684
- package/templates/editor/.github/skills/zen-finetune/scripts/collect.sh +0 -432
- package/templates/editor/.github/skills/zen-finetune/scripts/sample.sh +0 -199
package/dist/meta.d.ts
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { spawn as nodeSpawn } from 'node:child_process';
|
|
2
|
-
import { type KeyEntry, type KeyStore, type Provider } from './keys.ts';
|
|
3
|
-
export declare const PROMPT_DIR = ".github/prompts";
|
|
4
|
-
/** The variable a project's `.env` names it with — a zen ref, not a wire id. */
|
|
5
|
-
export declare const MODEL_ENV = "ZENERA_META_MODEL";
|
|
6
|
-
export type ModelSource = 'flag' | 'shell' | 'env' | 'store' | 'project' | 'default';
|
|
7
|
-
export interface ModelChoice {
|
|
8
|
-
/** a zen ref: `vertex/gemini-3.8-flash`, or a bare id for the default provider */
|
|
9
|
-
ref: string;
|
|
10
|
-
from: ModelSource;
|
|
11
|
-
}
|
|
12
|
-
export interface ModelSources {
|
|
13
|
-
flag?: string;
|
|
14
|
-
/** `ZENERA_META_MODEL` as it stood before the project's `.env` was folded in */
|
|
15
|
-
shell?: string;
|
|
16
|
-
/** the same variable after it was, which is the `.env` answer when they differ */
|
|
17
|
-
env?: string;
|
|
18
|
-
stored?: string;
|
|
19
|
-
/** the project's `agents.yaml` `model:` */
|
|
20
|
-
project?: string;
|
|
21
|
-
/** what a held key recommends, when nothing above answered */
|
|
22
|
-
fallback?: string;
|
|
23
|
-
}
|
|
24
|
-
/** Where the answer is looked for, best first. */
|
|
25
|
-
export declare const ORDER: readonly ModelSource[];
|
|
26
|
-
export declare function chooseModel(sources: ModelSources): ModelChoice | undefined;
|
|
27
|
-
export declare const SOURCE_LABELS: Record<ModelSource, string>;
|
|
28
|
-
/** First of each row is the default; the rest are what `--pick` offers beside it. */
|
|
29
|
-
export declare const RECOMMENDED: Partial<Record<Provider, readonly string[]>>;
|
|
30
|
-
/** The recommended ref for the first provider with a key, or for `only`. */
|
|
31
|
-
export declare function defaultRef(store: KeyStore, only?: Provider): string | undefined;
|
|
32
|
-
export interface MetaFile {
|
|
33
|
-
version: 1;
|
|
34
|
-
model?: string;
|
|
35
|
-
}
|
|
36
|
-
export declare const readMeta: () => Promise<MetaFile>;
|
|
37
|
-
export declare function writeMeta(file: MetaFile): void;
|
|
38
|
-
/**
|
|
39
|
-
* `vertex/gemini-3.8-flash` splits; `gpt-5.6-sol` does not. Only a known provider
|
|
40
|
-
* counts as a prefix, because `google/gemini-3.8-flash` is also a perfectly good
|
|
41
|
-
* bare id on an endpoint that speaks publisher names.
|
|
42
|
-
*
|
|
43
|
-
* The colon form is the library's own — `openai:gpt-5.6-sol`, and with an api
|
|
44
|
-
* selector `openai/responses:gpt-5.6-sol` — which is what arrives when the ref
|
|
45
|
-
* came from `agents.yaml`.
|
|
46
|
-
*/
|
|
47
|
-
export declare function splitRef(ref: string): {
|
|
48
|
-
provider?: Provider;
|
|
49
|
-
id: string;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* The provider a misspelt prefix was reaching for, if that is what it is.
|
|
53
|
-
*
|
|
54
|
-
* `vertes/gemini-3.8-flash` is shaped exactly like the OpenRouter id
|
|
55
|
-
* `meta-llama/llama-4`, so an unknown prefix cannot be an error on its own —
|
|
56
|
-
* only one close enough to a real provider name to be a slip of the hand.
|
|
57
|
-
*/
|
|
58
|
-
export declare function misspelledProvider(ref: string): Provider | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Copilot offers its tools as OpenAI *custom* tools, which the completions API
|
|
61
|
-
* rejects outright — `400 Invalid value: 'custom'`. Only the responses API
|
|
62
|
-
* takes them, and only the reasoning models serve it, so the wire API follows
|
|
63
|
-
* the model rather than being a flag nobody would know to set.
|
|
64
|
-
*/
|
|
65
|
-
export declare function wireApi(provider: Provider, id: string): string | undefined;
|
|
66
|
-
export interface Wiring {
|
|
67
|
-
provider: Provider;
|
|
68
|
-
/** what the model is called on the wire */
|
|
69
|
-
model: string;
|
|
70
|
-
/** every `COPILOT_*` name and value, ready to hand to the child */
|
|
71
|
-
env: Record<string, string>;
|
|
72
|
-
/** names whose values are secret, for `--secret-env-vars` and for masking */
|
|
73
|
-
secret: string[];
|
|
74
|
-
/** anything true but unwelcome: a location that will be slow, a stale default */
|
|
75
|
-
warnings: string[];
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Turns a zen key entry and a model id into copilot's environment.
|
|
79
|
-
*
|
|
80
|
-
* `COPILOT_PROVIDER_BASE_URL` is what activates BYOK at all, so every provider
|
|
81
|
-
* gets one — including OpenAI, whose url copilot would otherwise have reached
|
|
82
|
-
* through a GitHub account we are deliberately not using.
|
|
83
|
-
*/
|
|
84
|
-
export declare function wire(store: KeyStore, entry: KeyEntry, id: string): Wiring;
|
|
85
|
-
/** Values a `--dry-run` may print. A key is four characters and an apology. */
|
|
86
|
-
export declare function masked(env: Record<string, string>, secret: readonly string[]): string[];
|
|
87
|
-
/** `/project-review`, `project-review`, `project-review.prompt.md` or a path. */
|
|
88
|
-
export declare function promptPath(dir: string, name: string): string;
|
|
89
|
-
export interface StoredPrompt {
|
|
90
|
-
name: string;
|
|
91
|
-
path: string;
|
|
92
|
-
description?: string;
|
|
93
|
-
body: string;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Frontmatter is the editor's business — `mode`, `tools`, `description` — and
|
|
97
|
-
* none of it means anything to copilot, so only the body is sent. `description`
|
|
98
|
-
* is kept for the one line of narration that says which prompt is running.
|
|
99
|
-
*/
|
|
100
|
-
export declare function readPrompt(path: string, name: string, text: string): StoredPrompt;
|
|
101
|
-
export declare function loadPrompt(dir: string, name: string): Promise<StoredPrompt>;
|
|
102
|
-
export declare function listPrompts(dir: string): Promise<string[]>;
|
|
103
|
-
export interface Binary {
|
|
104
|
-
command: string;
|
|
105
|
-
args: string[];
|
|
106
|
-
from: 'path' | 'npx';
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* A `copilot` already installed is used as it is; otherwise `npx` fetches one.
|
|
110
|
-
* Note that finding the name on `PATH` is not the same as finding the CLI —
|
|
111
|
-
* an editor may have put a shim there that installs it on first run — so this
|
|
112
|
-
* only decides how to launch, never whether it will work.
|
|
113
|
-
*/
|
|
114
|
-
export declare function locate(has?: (cmd: string) => boolean): Binary;
|
|
115
|
-
interface Event {
|
|
116
|
-
type: string;
|
|
117
|
-
data?: Record<string, unknown>;
|
|
118
|
-
[key: string]: unknown;
|
|
119
|
-
}
|
|
120
|
-
export interface Outcome {
|
|
121
|
-
/** the last thing the agent said that was not a preamble to a tool call */
|
|
122
|
-
answer: string;
|
|
123
|
-
exitCode: number;
|
|
124
|
-
sessionId?: string;
|
|
125
|
-
usage?: Record<string, unknown>;
|
|
126
|
-
events: Event[];
|
|
127
|
-
}
|
|
128
|
-
export interface Sink {
|
|
129
|
-
answer(text: string): void;
|
|
130
|
-
narrate(line: string): void;
|
|
131
|
-
warn(line: string): void;
|
|
132
|
-
/** Kept by the log, never shown: the step-by-step nobody reads while it runs. */
|
|
133
|
-
detail?(line: string): void;
|
|
134
|
-
/** A transient last row, replaced each time and never kept. '' removes it. */
|
|
135
|
-
status?(line: string): void;
|
|
136
|
-
/** Called once when the run ends, so a repainting sink can clear itself. */
|
|
137
|
-
close?(): void;
|
|
138
|
-
}
|
|
139
|
-
export declare const terminalSink: Sink;
|
|
140
|
-
/** Rows of narration the window keeps on screen. */
|
|
141
|
-
export declare const WINDOW_ROWS = 8;
|
|
142
|
-
/** How often the border is redrawn — the wave's frame, not the clock's. */
|
|
143
|
-
export declare const FRAME_MS = 80;
|
|
144
|
-
/** Cells the crest travels per frame — a lap of a wide window in a few seconds. */
|
|
145
|
-
export declare const WAVE_STEP = 3;
|
|
146
|
-
/**
|
|
147
|
-
* How brightly one cell of the border is lit, given where the crest has got to.
|
|
148
|
-
*
|
|
149
|
-
* `position` counts clockwise from the top left corner, so one index walks the
|
|
150
|
-
* whole ring and the wave rounds the corners without a seam. Everything the
|
|
151
|
-
* tail has passed sits at the dimmest tone, which is the border's resting
|
|
152
|
-
* colour: the ring is always drawn, only the crest moves.
|
|
153
|
-
*/
|
|
154
|
-
export declare function toneAt(position: number, head: number, span: number): number;
|
|
155
|
-
/**
|
|
156
|
-
* The bottom rule as cells, with the status label set into it near the left.
|
|
157
|
-
*
|
|
158
|
-
* Waiting belongs to the frame rather than to the narration: a row of its own
|
|
159
|
-
* costs a step of what the agent is doing every time, and it settles just
|
|
160
|
-
* under the last line, which is where the eye already is. Near the left, where
|
|
161
|
-
* reading starts, and not so near that it displaces the corner.
|
|
162
|
-
*/
|
|
163
|
-
export declare function footerCells(label: string, width: number): string[];
|
|
164
|
-
/**
|
|
165
|
-
* Narration held to a fixed number of rows that rewrite themselves in place.
|
|
166
|
-
*
|
|
167
|
-
* A long run is hundreds of tool calls, and printing each as its own line
|
|
168
|
-
* scrolls the question, the model line and every warning off the top of the
|
|
169
|
-
* screen — by the end the terminal holds a transcript nobody asked for and the
|
|
170
|
-
* answer is somewhere in the middle of it. Only the last few steps say what it
|
|
171
|
-
* is doing now, which is the only thing narration is for; the rest is in the
|
|
172
|
-
* session copilot recorded.
|
|
173
|
-
*
|
|
174
|
-
* Warnings are not narration: they leave the window and stay on the screen.
|
|
175
|
-
*
|
|
176
|
-
* Without a terminal there is nothing to rewrite over, so every line is its
|
|
177
|
-
* own — which is what a CI log wants anyway.
|
|
178
|
-
*/
|
|
179
|
-
export declare function windowSink(rows?: number): Sink;
|
|
180
|
-
/**
|
|
181
|
-
* The answer in the same box `zen run` draws it in: bounded width, rounded
|
|
182
|
-
* rule, formatted with full markdown styling (bold, italics, code, lists, quotes, tables).
|
|
183
|
-
*
|
|
184
|
-
* Redirected output gets the text and nothing else — `zen meta run ... > out.md`
|
|
185
|
-
* is meant to produce a file you can read, not one with a border down its side.
|
|
186
|
-
*/
|
|
187
|
-
export declare function answerBox(text: string, columns?: number): string[];
|
|
188
|
-
export interface Log {
|
|
189
|
-
readonly path: string;
|
|
190
|
-
/** Where the answer alone goes, beside the log and openable on its own. */
|
|
191
|
-
readonly answerPath: string;
|
|
192
|
-
line(text: string): void;
|
|
193
|
-
saveAnswer(text: string): void;
|
|
194
|
-
close(): void;
|
|
195
|
-
}
|
|
196
|
-
/** `<project>/.tmp/logs/meta.<when>.log`, opened for append. */
|
|
197
|
-
export declare function openLog(dir: string, now?: Date): Log;
|
|
198
|
-
/**
|
|
199
|
-
* Folds one event into the outcome and says what, if anything, to show for it.
|
|
200
|
-
*
|
|
201
|
-
* `assistant.message` carries both the running commentary and the final word;
|
|
202
|
-
* what separates them is `toolRequests`, so the last message that asked for no
|
|
203
|
-
* tool is the answer and the rest are narration.
|
|
204
|
-
*/
|
|
205
|
-
export declare function absorb(event: Event, out: Outcome, sink: Sink, width: number): void;
|
|
206
|
-
export interface Launch {
|
|
207
|
-
binary: Binary;
|
|
208
|
-
args: string[];
|
|
209
|
-
env: Record<string, string>;
|
|
210
|
-
cwd: string;
|
|
211
|
-
sink?: Sink;
|
|
212
|
-
log?: Log;
|
|
213
|
-
width?: number;
|
|
214
|
-
/** injected by the tests, which have no copilot and want none */
|
|
215
|
-
spawn?: typeof nodeSpawn;
|
|
216
|
-
}
|
|
217
|
-
export declare function launch(opts: Launch): Promise<Outcome>;
|
|
218
|
-
/** Non-fatal, said once, because a competing file is a silent override. */
|
|
219
|
-
export declare function providersWarning(): string | undefined;
|
|
220
|
-
export {};
|
|
221
|
-
//# sourceMappingURL=meta.d.ts.map
|