@zenera/meta 1.3.1 → 1.3.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,46 @@
1
+ // packages/meta/src/reporter.ts
2
+ //
3
+ // Keeps `finetune/USAGE.md` current while a meta agent session runs in a project that is being tuned.
4
+ // Main: `usageReporter(dir)` - reruns the shipped usage script on a timer and once at the end, detached.
5
+ // Used by: `command.ts` (`go()`, for run and resume) and `chat/run.ts` (`zen meta chat`).
6
+ import { spawn } from 'node:child_process';
7
+ import { existsSync } from 'node:fs';
8
+ import { join } from 'node:path';
9
+ /** How often a running meta agent rewrites the fine-tuning's usage report. */
10
+ const REPORT_EVERY_MS = 5 * 60_000;
11
+ /**
12
+ * Rewrites `finetune/USAGE.md` on a timer and once more at the end, when the
13
+ * project is being tuned. Detached and silent: the report is a by-product, and
14
+ * neither its time nor its failure belongs to the run.
15
+ */
16
+ export function usageReporter(dir) {
17
+ const script = join(dir, '.github/skills/zen-finetune/scripts/usage.mjs');
18
+ if (!existsSync(join(dir, 'finetune')) || !existsSync(script)) {
19
+ return { stop: () => undefined };
20
+ }
21
+ let running = false;
22
+ const refresh = () => {
23
+ if (running) {
24
+ return;
25
+ }
26
+ running = true;
27
+ const child = spawn(process.execPath, [script, '-q'], {
28
+ cwd: dir,
29
+ stdio: 'ignore',
30
+ detached: true,
31
+ });
32
+ child.on('exit', () => (running = false));
33
+ child.on('error', () => (running = false));
34
+ child.unref();
35
+ };
36
+ const timer = setInterval(refresh, REPORT_EVERY_MS);
37
+ timer.unref();
38
+ return {
39
+ stop: () => {
40
+ clearInterval(timer);
41
+ running = false;
42
+ refresh();
43
+ },
44
+ };
45
+ }
46
+ //# sourceMappingURL=reporter.js.map
package/dist/wire.d.ts CHANGED
@@ -27,6 +27,8 @@ export interface Wiring {
27
27
  location: string;
28
28
  keyFile: string;
29
29
  };
30
+ /** a service account's key file, when the key command mints its token from one */
31
+ keyFile?: string;
30
32
  }
31
33
  /** Where the relay's url goes once it is listening. */
32
34
  export declare const RELAY_URL = "http://127.0.0.1:<relay>";
package/dist/wire.js CHANGED
@@ -115,7 +115,14 @@ export function wire(store, entry, id) {
115
115
  env.COPILOT_PROVIDER_API_KEY = store.reveal(entry);
116
116
  secret.push('COPILOT_PROVIDER_API_KEY');
117
117
  }
118
- return { provider, model: env.COPILOT_PROVIDER_WIRE_MODEL ?? id, env, secret, warnings };
118
+ return {
119
+ provider,
120
+ model: env.COPILOT_PROVIDER_WIRE_MODEL ?? id,
121
+ env,
122
+ secret,
123
+ warnings,
124
+ ...(entry.holds === 'file' ? { keyFile: store.fileOf(entry) } : {}),
125
+ };
119
126
  }
120
127
  /**
121
128
  * Through a gateway: one virtual key, and Bifrost's OpenAI or Anthropic drop-in,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenera/meta",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "The meta agent for zen: GitHub Copilot over a zen project on your own keys, plus the dataset and fine-tuning loop.",
5
5
  "keywords": [
6
6
  "agents",
@@ -43,10 +43,12 @@
43
43
  "prepack": "tsc -b"
44
44
  },
45
45
  "dependencies": {
46
- "@zenera/cli": "^1.3.1",
47
- "@zenera/engine": "^1.3.1",
48
- "@zenera/neo": "^1.3.1",
49
- "@zenera/view": "^1.3.1",
46
+ "@github/copilot-sdk": "^1.0.32",
47
+ "@inkjs/ui": "^2.0.0",
48
+ "@zenera/cli": "^1.3.2",
49
+ "@zenera/engine": "^1.3.2",
50
+ "@zenera/neo": "^1.3.2",
51
+ "@zenera/view": "^1.3.2",
50
52
  "google-auth-library": "^10.0.0",
51
53
  "ink": "^7.1.1",
52
54
  "react": "^19.2.8",