@zenera/meta 0.0.0-stage → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -2
  3. package/dist/command.d.ts +5 -0
  4. package/dist/command.js +1086 -0
  5. package/dist/dataset/anchors.d.ts +41 -0
  6. package/dist/dataset/anchors.js +239 -0
  7. package/dist/dataset/changes.d.ts +36 -0
  8. package/dist/dataset/changes.js +319 -0
  9. package/dist/dataset/command.d.ts +17 -0
  10. package/dist/dataset/command.js +1011 -0
  11. package/dist/dataset/drift.d.ts +33 -0
  12. package/dist/dataset/drift.js +71 -0
  13. package/dist/dataset/export.d.ts +26 -0
  14. package/dist/dataset/export.js +51 -0
  15. package/dist/dataset/index.d.ts +2 -0
  16. package/dist/dataset/index.js +2 -0
  17. package/dist/dataset/sample.d.ts +50 -0
  18. package/dist/dataset/sample.js +197 -0
  19. package/dist/dataset/schema.d.ts +33 -0
  20. package/dist/dataset/schema.js +216 -0
  21. package/dist/dataset/store.d.ts +35 -0
  22. package/dist/dataset/store.js +177 -0
  23. package/dist/dataset/types.d.ts +127 -0
  24. package/dist/dataset/types.js +39 -0
  25. package/dist/finetune/analyze-brief.d.ts +26 -0
  26. package/dist/finetune/analyze-brief.js +131 -0
  27. package/dist/finetune/apply-brief.d.ts +23 -0
  28. package/dist/finetune/apply-brief.js +247 -0
  29. package/dist/finetune/brief.d.ts +45 -0
  30. package/dist/finetune/brief.js +158 -0
  31. package/dist/finetune/children.d.ts +8 -0
  32. package/dist/finetune/children.js +76 -0
  33. package/dist/finetune/command.d.ts +30 -0
  34. package/dist/finetune/command.js +520 -0
  35. package/dist/finetune/cost.d.ts +46 -0
  36. package/dist/finetune/cost.js +105 -0
  37. package/dist/finetune/failure.d.ts +15 -0
  38. package/dist/finetune/failure.js +26 -0
  39. package/dist/finetune/feedback.d.ts +57 -0
  40. package/dist/finetune/feedback.js +104 -0
  41. package/dist/finetune/improvements.d.ts +98 -0
  42. package/dist/finetune/improvements.js +501 -0
  43. package/dist/finetune/index.d.ts +2 -0
  44. package/dist/finetune/index.js +2 -0
  45. package/dist/finetune/journal.d.ts +35 -0
  46. package/dist/finetune/journal.js +135 -0
  47. package/dist/finetune/live.d.ts +84 -0
  48. package/dist/finetune/live.js +272 -0
  49. package/dist/finetune/loop.d.ts +3 -0
  50. package/dist/finetune/loop.js +163 -0
  51. package/dist/finetune/memories.d.ts +47 -0
  52. package/dist/finetune/memories.js +171 -0
  53. package/dist/finetune/next-case.d.ts +18 -0
  54. package/dist/finetune/next-case.js +47 -0
  55. package/dist/finetune/recheck.d.ts +58 -0
  56. package/dist/finetune/recheck.js +311 -0
  57. package/dist/finetune/report.d.ts +40 -0
  58. package/dist/finetune/report.js +1397 -0
  59. package/dist/finetune/retry.d.ts +24 -0
  60. package/dist/finetune/retry.js +96 -0
  61. package/dist/finetune/system.d.ts +27 -0
  62. package/dist/finetune/system.js +132 -0
  63. package/dist/finetune/train.d.ts +43 -0
  64. package/dist/finetune/train.js +425 -0
  65. package/dist/finetune/tui.d.ts +16 -0
  66. package/dist/finetune/tui.js +316 -0
  67. package/dist/finetune/tuning.d.ts +193 -0
  68. package/dist/finetune/tuning.js +308 -0
  69. package/dist/finetune/usage.d.ts +66 -0
  70. package/dist/finetune/usage.js +260 -0
  71. package/dist/finetune/view.d.ts +9 -0
  72. package/dist/finetune/view.js +27 -0
  73. package/dist/host.d.ts +2 -0
  74. package/dist/host.js +14 -0
  75. package/dist/index.d.ts +10 -0
  76. package/dist/index.js +15 -0
  77. package/dist/launch.d.ts +90 -0
  78. package/dist/launch.js +310 -0
  79. package/dist/model.d.ts +61 -0
  80. package/dist/model.js +146 -0
  81. package/dist/prompts.d.ts +23 -0
  82. package/dist/prompts.js +84 -0
  83. package/dist/relay.d.ts +20 -0
  84. package/dist/relay.js +123 -0
  85. package/dist/sink.d.ts +61 -0
  86. package/dist/sink.js +198 -0
  87. package/dist/tokens.d.ts +52 -0
  88. package/dist/tokens.js +226 -0
  89. package/dist/wire.d.ts +51 -0
  90. package/dist/wire.js +159 -0
  91. package/package.json +54 -5
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andrey Ryabov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,157 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
+ <img
3
+ src="https://raw.githubusercontent.com/zenera-ai/ZeneraNeo/main/docs/imgs/zenera-logo-with-media-queries.svg"
4
+ alt="Zenera Logo"
5
+ width="20"
6
+ />
7
+ <div>Powered By Zenera</div>
8
+ </div>
9
+ <br>
2
10
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
11
+ <div align="center">
12
+ <img src="https://raw.githubusercontent.com/zenera-ai/ZeneraNeo/main/docs/imgs/banner-meta-with-media-queries.svg" alt="ZENERA META" width="801">
13
+
14
+ [![npm](https://img.shields.io/npm/v/@zenera/meta.svg)](https://www.npmjs.com/package/@zenera/meta)
15
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/zenera-ai/ZeneraNeo/blob/main/LICENSE)
16
+ [![Node](https://img.shields.io/badge/node-%E2%89%A524-brightgreen.svg)](https://nodejs.org)
17
+ [![CI](https://github.com/zenera-ai/ZeneraNeo/actions/workflows/ci.yml/badge.svg)](https://github.com/zenera-ai/ZeneraNeo/actions/workflows/ci.yml)
18
+
19
+ [Install](#install) · [Use](#use) · [Commands](#commands) · [Models](#models) · [Credentials](#credentials) · [Family](#the-rest-of-the-family) · [License](#license)
20
+
21
+ </div>
22
+
23
+ # @zenera/meta
24
+
25
+ **The meta-agent: a coding agent pointed _at_ a zen project, on your own keys.
26
+ `zen run` runs the agents a project describes; `zen meta` runs an agent over
27
+ the project to change it - generate it from its specification, review it,
28
+ build its evaluation dataset and fine-tune its prompts against that dataset.**
29
+
30
+ It drives [GitHub Copilot CLI](https://github.com/github/copilot-cli) with your
31
+ provider keys, never a Copilot subscription.
32
+
33
+ > Part of [ZeneraNeo](https://github.com/zenera-ai/ZeneraNeo). It ships no
34
+ > binary of its own: installing it adds a `meta` **subcommand** to
35
+ > [`zen`](https://github.com/zenera-ai/ZeneraNeo/blob/main/packages/cli/README.md),
36
+ > which is also where the credentials already are.
37
+
38
+ ## What you get
39
+
40
+ - **Specification-driven builds** - `/spec-sync-project` reads
41
+ `SPECIFICATION.md` and writes the agents, prompts, tools and skills, then asks
42
+ what it could not decide in `SPECIFICATION-FEEDBACK.md`.
43
+ - **Commands from the project** - every `.github/skills/<name>/SKILL.md` the
44
+ project carries is a `/<name>` you can run from the terminal, the same ones
45
+ the editor offers.
46
+ - **Runs that survive** - a rate limit or provider outage is waited out and the
47
+ session resumed; `zen meta resume` picks up one that stopped for any other
48
+ reason.
49
+ - **A dataset and a tuning loop** - `zen meta dataset` keeps the cases a project
50
+ is evaluated on; `zen meta finetune` runs them, analyzes each run and edits
51
+ the project's prose until the cases pass. No model weights are touched.
52
+ - **Accounting** - tokens are counted per call as it runs; in a project being
53
+ tuned every call lands in `finetune/usage/ledger.jsonl`.
54
+
55
+ ## Install
56
+
57
+ Node.js 24+. Install it alongside the CLI:
58
+
59
+ ```sh
60
+ npm i -g @zenera/cli @zenera/meta
61
+ zen key add openai # the keyring `zen` already uses
62
+ ```
63
+
64
+ Copilot CLI is used from `PATH` when it is there (`npm i -g @github/copilot`)
65
+ and fetched with `npx` otherwise. `zen version` shows which, and every
66
+ `@zenera/*` package version beside it.
67
+
68
+ ## Use
69
+
70
+ ```sh
71
+ zen meta model --pick # choose the model once
72
+ zen meta run "what does this project do?" # ask it something
73
+ zen meta run acme /spec-sync-project # run one of the project's commands
74
+ git diff | zen meta run "what broke?" --allow-tool read
75
+ zen meta resume acme # carry on the last session
76
+ ```
77
+
78
+ The answer goes to stdout and the progress to stderr, so `> out.md` keeps the
79
+ answer alone. The whole run - prompt, every step, the answer - is logged under
80
+ `<project>/.tmp/logs/`, and the answer is saved beside it as markdown.
81
+
82
+ It may use every tool without asking: a prompt written for an editor expects
83
+ to read, write and run things, and a terminal has nobody watching to answer.
84
+ Narrow it with `--allow-tool`, or restore the asking with `--ask`.
85
+
86
+ The editor files `zen init` writes (`.vscode/` and the `.github/` tree) are
87
+ refreshed in the project before each run, because they are the brief the agent
88
+ works from and they describe this version of `zen`.
89
+
90
+ ## Commands
91
+
92
+ ```
93
+ zen meta run [project] "<question>" Ask it something.
94
+ zen meta run [project] /<name> [words] Run .github/skills/<name>/SKILL.md.
95
+ zen meta run [project] Pick one of those commands.
96
+ zen meta prompts [project] List those commands.
97
+ zen meta resume [project] [session] Carry on a session that stopped.
98
+ zen meta model [ref] Show or set the model it uses.
99
+ zen meta dataset <verb> The cases a project is evaluated on.
100
+ zen meta finetune <verb> Tune the project on those cases.
101
+ ```
102
+
103
+ Useful options: `--project`, `--model`, `--provider`, `--prompt-file`,
104
+ `--agent`, `--effort`, `--allow-tool`, `--ask`, `--add-dir`, `--retries`,
105
+ `--share`, `--events`, `--dry-run` (print the command, secrets masked),
106
+ `--json`. `zen meta --help`, `zen meta run --help`, `zen meta dataset --help`
107
+ and `zen meta finetune --help` print the full tables. The tuning loop is
108
+ described in [docs/finetuning.md](https://github.com/zenera-ai/ZeneraNeo/blob/main/docs/finetuning.md).
109
+
110
+ ## Models
111
+
112
+ The model is looked for in this order: `--model`, `ZENERA_META_MODEL` in the
113
+ shell, `ZENERA_META_MODEL` in the project's `.env`, what `zen meta model`
114
+ stored, then the project's `agents.yaml`. With none set it uses the best model
115
+ it knows of for a provider you hold a key for - through a gateway, the best one
116
+ the gateway serves - and says which on stderr.
117
+
118
+ `zen meta model <provider>/<id>` asks the provider a one-word question before
119
+ storing it, so a model that will not answer is never kept; one whose API
120
+ rejects Copilot's tools (gpt-4o and older) is refused. `--force` skips both.
121
+
122
+ ## Credentials
123
+
124
+ The keyring is `zen`'s, so there is nothing new to configure:
125
+
126
+ ```sh
127
+ zen key add openai
128
+ zen key ls --check
129
+ ```
130
+
131
+ Every credential reaches Copilot through its environment, never on a command
132
+ line, where other processes could read it. Vertex Claude goes through a local
133
+ relay that signs each request with your service account.
134
+
135
+ ## Design
136
+
137
+ It reaches `zen` only through [src/host.ts](src/host.ts), which imports
138
+ `@zenera/cli/lib` and nothing else; [test/meta-boundary.test.ts](test/meta-boundary.test.ts)
139
+ holds that line. The CLI keeps what `zen init` and `zen open` also need - the
140
+ `.github/` editor tree and its templates, and the usage ledger. See §7.6 of the
141
+ [CLI design notes](https://github.com/zenera-ai/ZeneraNeo/blob/main/packages/cli/DESIGN.md).
142
+
143
+ ## The rest of the family
144
+
145
+ | Package | What it is |
146
+ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
147
+ | [`@zenera/cli`](https://github.com/zenera-ai/ZeneraNeo/blob/main/packages/cli/README.md) | `zen` - agent projects on the command line |
148
+ | [`@zenera/neo`](https://github.com/zenera-ai/ZeneraNeo/blob/main/packages/neo/README.md) | the runtime - agents, models, tools, skills, memory |
149
+ | **`@zenera/meta`** | `zen meta` - the meta-agent that builds and tunes a project |
150
+ | [`@zenera/gym`](https://github.com/zenera-ai/ZeneraNeo/blob/main/packages/gym/README.md) | `zen gym` - a mock API from an openapi/swagger document |
151
+ | [`@zenera/rag`](https://github.com/zenera-ai/ZeneraNeo/blob/main/packages/rag/README.md) | `zen rag` - indexing and search for documents and API schemas |
152
+ | [`@zenera/view`](https://github.com/zenera-ai/ZeneraNeo/blob/main/packages/view/README.md) | `zen view` - a live local viewer for a folder |
153
+
154
+ ## License
155
+
156
+ Early days and moving fast - issues, questions and pull requests are welcome.
157
+ [MIT](LICENSE).
@@ -0,0 +1,5 @@
1
+ import { type Candidate, type Command } from './host.ts';
2
+ export declare const command: Command;
3
+ /** `args` is what came after `meta`, without the word being completed. */
4
+ export declare function completeMeta(args: readonly string[], cur: string, cwd: string): Promise<Candidate[]>;
5
+ //# sourceMappingURL=command.d.ts.map