@zenera/cli 1.1.35 → 1.1.37
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/dist/archive.js +1 -1
- package/dist/batch.js +2 -3
- package/dist/cache.js +1 -1
- package/dist/candidates.js +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +1 -1
- package/dist/commands/cache.js +1 -1
- package/dist/commands/check.js +1 -3
- package/dist/commands/export.js +1 -3
- package/dist/commands/import.js +1 -2
- package/dist/commands/init.js +1 -4
- package/dist/commands/inspect.d.ts +1 -1
- package/dist/commands/inspect.js +1 -4
- package/dist/commands/key.js +1 -2
- package/dist/commands/list.js +4 -5
- package/dist/commands/memory.js +1 -2
- package/dist/commands/meta.js +2 -4
- package/dist/commands/models.d.ts +1 -1
- package/dist/commands/models.js +1 -2
- package/dist/commands/run.js +2 -2
- package/dist/commands/sandbox.js +1 -2
- package/dist/engine.d.ts +3 -90
- package/dist/engine.js +16 -302
- package/dist/history.js +1 -1
- package/dist/lib.d.ts +1 -2
- package/dist/lib.js +1 -2
- package/dist/liveness.d.ts +1 -1
- package/dist/liveness.js +1 -1
- package/dist/meta/host.d.ts +1 -2
- package/dist/meta/host.js +1 -2
- package/dist/meta/launch.js +3 -1
- package/dist/modelref.d.ts +1 -1
- package/dist/podman.d.ts +1 -1
- package/dist/podman.js +1 -1
- package/dist/resolve.d.ts +2 -2
- package/dist/resolve.js +2 -3
- package/dist/resources.js +1 -1
- package/dist/sandbox.d.ts +2 -60
- package/dist/sandbox.js +1 -200
- package/dist/term.d.ts +1 -22
- package/dist/term.js +3 -26
- package/dist/tui/app.js +1 -1
- package/dist/tui/models.d.ts +1 -1
- package/dist/validate.d.ts +1 -2
- package/dist/validate.js +1 -3
- package/package.json +4 -3
- package/dist/audit.d.ts +0 -58
- package/dist/audit.js +0 -148
- package/dist/env.d.ts +0 -20
- package/dist/env.js +0 -65
- package/dist/home.d.ts +0 -35
- package/dist/home.js +0 -112
- package/dist/ids.d.ts +0 -12
- package/dist/ids.js +0 -44
- package/dist/image.d.ts +0 -16
- package/dist/image.js +0 -85
- package/dist/keys.d.ts +0 -269
- package/dist/keys.js +0 -624
- package/dist/projects.d.ts +0 -91
- package/dist/projects.js +0 -303
- package/dist/session.d.ts +0 -112
- package/dist/session.js +0 -188
package/dist/archive.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ENV_FILE } from '@zenera/engine';
|
|
1
2
|
import { createWriteStream, lstatSync, mkdirSync, readdirSync, statSync } from 'node:fs';
|
|
2
3
|
import { mkdir } from 'node:fs/promises';
|
|
3
4
|
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
4
5
|
import { pipeline } from 'node:stream/promises';
|
|
5
6
|
import * as yauzl from 'yauzl';
|
|
6
7
|
import * as yazl from 'yazl';
|
|
7
|
-
import { ENV_FILE } from "./env.js";
|
|
8
8
|
import { invalidError, usageError } from "./term.js";
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
10
|
// Archives
|
package/dist/batch.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import { display, stamp } from '@zenera/engine';
|
|
1
2
|
import { addUsage, lockHolder, MANIFEST_FILE as MEMORY_MANIFEST, memoryDir, MemoryStore, mergeModelUsage, readProjectConfig, SANDBOX_GROUP, selectTools, usageByModel, zeroUsage, } from '@zenera/neo';
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import { cp, mkdir, rm, writeFile } from 'node:fs/promises';
|
|
4
5
|
import { basename, join, resolve } from 'node:path';
|
|
5
6
|
import * as Engine from "./engine.js";
|
|
6
|
-
import { stamp } from "./ids.js";
|
|
7
7
|
import { duration } from "./narrate.js";
|
|
8
|
-
import { BatchProgress } from "./progress.js";
|
|
9
8
|
import { assertLocks } from "./podman.js";
|
|
9
|
+
import { BatchProgress } from "./progress.js";
|
|
10
10
|
import { project as resolveProject, target } from "./resolve.js";
|
|
11
|
-
import { display } from "./session.js";
|
|
12
11
|
import { CliError, count, cyan, dim, EXIT, invalidError, json, jsonText, note, usageError, write, } from "./term.js";
|
|
13
12
|
import { appendUsage } from "./usage.js";
|
|
14
13
|
import { availableTools } from "./validate.js";
|
package/dist/cache.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { paths, writeJson } from '@zenera/engine';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { readdirSync, readFileSync, rmdirSync, rmSync, statSync, utimesSync } from 'node:fs';
|
|
3
4
|
import { join } from 'node:path';
|
|
4
|
-
import { paths, writeJson } from "./home.js";
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
6
6
|
// One place for work already done
|
|
7
7
|
//
|
package/dist/candidates.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as Projects from '@zenera/engine';
|
|
1
2
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import * as Projects from "./projects.js";
|
|
3
3
|
/** Candidates the word being typed is a prefix of. */
|
|
4
4
|
export const matching = (found, prefix) => found.filter((c) => c.value.startsWith(prefix));
|
|
5
5
|
/** Registered projects whose directory is still there. */
|
package/dist/catalog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Gateway } from '@zenera/neo';
|
|
2
|
-
import { type KeyCheck, type Provider } from '
|
|
2
|
+
import { type KeyCheck, type Provider } from '@zenera/engine';
|
|
3
3
|
/**
|
|
4
4
|
* What a model is *for*. A model can hold more than one — Gemini's embedding
|
|
5
5
|
* endpoint and its chat endpoint are the same catalog row on some providers —
|
package/dist/catalog.js
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
// the vendor's own word.
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
import { GATEWAY_KEY_HEADER, GATEWAY_NAME, GATEWAY_UPSTREAMS, gatewayOf, ModelRegistry, vertexEndpoint, } from '@zenera/neo';
|
|
20
|
+
import { PROVIDERS } from '@zenera/engine';
|
|
20
21
|
import { Cache, cacheKey } from "./cache.js";
|
|
21
|
-
import { PROVIDERS } from "./keys.js";
|
|
22
22
|
import { classify } from "./liveness.js";
|
|
23
23
|
import { compareModels } from "./rank.js";
|
|
24
24
|
/** A day. Model lists change on the scale of weeks; a stale row costs a retry. */
|
package/dist/commands/cache.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { paths } from '@zenera/engine';
|
|
1
2
|
import { parse } from "../args.js";
|
|
2
3
|
import { clear, items, kinds, sweep } from "../cache.js";
|
|
3
|
-
import { paths } from "../home.js";
|
|
4
4
|
import { ago, bold, bytes, confirm, count, cyan, dim, green, isInteractive, json, note, table, usageError, writeAll, } from "../term.js";
|
|
5
5
|
const USAGE = 'zen cache [ls|prune|clear] [options]';
|
|
6
6
|
/** Enough to see what is in there; the rest is a number. */
|
package/dist/commands/check.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import { KeyStore, loadProjectEnv, Registry } from '@zenera/engine';
|
|
1
2
|
import { existsSync, statSync } from 'node:fs';
|
|
2
3
|
import { basename, dirname, resolve } from 'node:path';
|
|
3
4
|
import { one, parse } from "../args.js";
|
|
4
|
-
import { loadProjectEnv } from "../env.js";
|
|
5
|
-
import { KeyStore } from "../keys.js";
|
|
6
5
|
import { duration } from "../narrate.js";
|
|
7
|
-
import { Registry } from "../projects.js";
|
|
8
6
|
import { project as resolveProject } from "../resolve.js";
|
|
9
7
|
import { refreshShared } from "../scaffold.js";
|
|
10
8
|
import { bold, count, cyan, dim, green, invalidError, json, progress, red, table, usageError, write, writeAll, yellow, } from "../term.js";
|
package/dist/commands/export.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { ENV_FILE, isBusy, Registry, sessionIds, sessionsDir, stamp } from '@zenera/engine';
|
|
1
2
|
import { lockHolder, memoryDir, readProjectConfig } from '@zenera/neo';
|
|
2
3
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
4
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
4
5
|
import { ARCHIVE_FORMAT, collect, ENV_EXAMPLE, envExample, MANIFEST_FILE, safeName, writeArchive, } from "../archive.js";
|
|
5
6
|
import { one, parse } from "../args.js";
|
|
6
|
-
import { ENV_FILE } from "../env.js";
|
|
7
|
-
import { stamp } from "../ids.js";
|
|
8
|
-
import { isBusy, Registry, sessionIds, sessionsDir } from "../projects.js";
|
|
9
7
|
import { project as resolveProject } from "../resolve.js";
|
|
10
8
|
import { ownVersion } from "../scaffold.js";
|
|
11
9
|
import { bold, count, cyan, dim, green, bytes as human, invalidError, json, note, progress, table, usageError, warn, writeAll, } from "../term.js";
|
package/dist/commands/import.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { ENV_FILE, isProjectDir, Registry } from '@zenera/engine';
|
|
1
2
|
import { existsSync, readdirSync } from 'node:fs';
|
|
2
3
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
3
4
|
import { ENV_EXAMPLE, extractArchive, readManifest, safeName, } from "../archive.js";
|
|
4
5
|
import { parse } from "../args.js";
|
|
5
|
-
import { ENV_FILE } from "../env.js";
|
|
6
|
-
import { isProjectDir, Registry } from "../projects.js";
|
|
7
6
|
import { bold, count, cyan, dim, green, bytes as human, invalidError, json, note, progress, usageError, warn, } from "../term.js";
|
|
8
7
|
const USAGE = 'zen import <file.zip> [dir] [--name <name>] [--force] [--no-register]';
|
|
9
8
|
// ---------------------------------------------------------------------------
|
package/dist/commands/init.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
+
import { ensureHome, envNames, isProjectDir, isProvider, keyId, KeyStore, PROVIDERS, Registry, resolveBuild, } from '@zenera/engine';
|
|
1
2
|
import { readProjectConfig } from '@zenera/neo';
|
|
2
3
|
import { existsSync, readdirSync } from 'node:fs';
|
|
3
4
|
import { basename, resolve } from 'node:path';
|
|
4
5
|
import { one, parse } from "../args.js";
|
|
5
6
|
import { PREFERRED } from "../catalog.js";
|
|
6
|
-
import { ensureHome } from "../home.js";
|
|
7
|
-
import { resolveBuild } from "../image.js";
|
|
8
|
-
import { envNames, isProvider, keyId, KeyStore, PROVIDERS } from "../keys.js";
|
|
9
7
|
import { probeAll } from "../liveness.js";
|
|
10
8
|
import { ensurePodmanReady } from "../podman.js";
|
|
11
|
-
import { isProjectDir, Registry } from "../projects.js";
|
|
12
9
|
import { scaffold } from "../scaffold.js";
|
|
13
10
|
import { bold, cyan, dim, green, json, note, progress, usageError, write, yellow, } from "../term.js";
|
|
14
11
|
const USAGE = 'zen init [dir] [--name <name>] [--model <ref>] [--force]';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type RunPaths, type SessionPaths } from '@zenera/engine';
|
|
1
2
|
import type { Command } from '../command.ts';
|
|
2
|
-
import { type RunPaths, type SessionPaths } from '../session.ts';
|
|
3
3
|
import { type NodeDetail, type Trace, type TraceEntry } from '../trace.ts';
|
|
4
4
|
interface Flags {
|
|
5
5
|
project?: string;
|
package/dist/commands/inspect.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { display, KeyStore, listRuns, listSessions, loadProjectEnv, newestRun, readRunMeta, requireSession, runPaths, runPathsAt, sessionIds, sessionPaths, } from '@zenera/engine';
|
|
1
2
|
import { assertState, buildRunReport, FilePayloadStore, memoryDir, MemoryStore, PayloadResolver, projectRegistry, readProjectConfig, renderReportHtml, SANDBOX_MOUNT, text, } from '@zenera/neo';
|
|
2
3
|
import { spawn } from 'node:child_process';
|
|
3
4
|
import { existsSync } from 'node:fs';
|
|
@@ -6,11 +7,7 @@ import { join, resolve } from 'node:path';
|
|
|
6
7
|
import { pathToFileURL } from 'node:url';
|
|
7
8
|
import { parse } from "../args.js";
|
|
8
9
|
import { buildDiagnostic, parseRecordedRequest, pickModel } from "../ask.js";
|
|
9
|
-
import { loadProjectEnv } from "../env.js";
|
|
10
|
-
import { KeyStore } from "../keys.js";
|
|
11
|
-
import { sessionIds } from "../projects.js";
|
|
12
10
|
import { project as resolveProject } from "../resolve.js";
|
|
13
|
-
import { display, listRuns, listSessions, newestRun, readRunMeta, requireSession, runPaths, runPathsAt, sessionPaths, } from "../session.js";
|
|
14
11
|
import { nodeDetail, parseNodeIds, traceIndex, traceMermaid, traceOf, } from "../trace.js";
|
|
15
12
|
import { formatMarkdown } from "../tui/markdown.js";
|
|
16
13
|
import { boxWidth } from "../tui/wrap.js";
|
package/dist/commands/key.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { ambient, ambientId, assertNotEmpty, checkRegion, describe, ensureHome, envNames, envOf, formOf, GATEWAYS, isGateway, keyId, KeyStore, mask, MODES, OWNERS, parseRef, SHAPES, } from '@zenera/engine';
|
|
1
2
|
import { GATEWAY_URL_ENV } from '@zenera/neo';
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import { parse } from "../args.js";
|
|
4
|
-
import { ensureHome } from "../home.js";
|
|
5
|
-
import { ambient, ambientId, assertNotEmpty, checkRegion, describe, envNames, envOf, formOf, GATEWAYS, isGateway, keyId, KeyStore, mask, MODES, OWNERS, parseRef, SHAPES, } from "../keys.js";
|
|
6
5
|
import { probe, probeAll } from "../liveness.js";
|
|
7
6
|
import { ago, ask, askSecret, badge, bold, confirm, credentialError, cyan, dim, green, isInteractive, json, note, progress, readStdin, red, table, usageError, warn, write, writeAll, yellow, } from "../term.js";
|
|
8
7
|
const USAGE = 'zen key <ls|add|use|mode|check|rm|show|env> [ref] [options]';
|
package/dist/commands/list.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { parse } from "../args.js";
|
|
1
|
+
import { listSessions, openDir, readRunMeta, Registry, runIds, runPaths, sessionIds, sessionPaths, sessionsDir,
|
|
3
2
|
// Run ids are timestamps by construction, so the newest id *is* the last-run
|
|
4
3
|
// time — no file has to be opened to learn it.
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
stampInstant, summarize, } from '@zenera/engine';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { parse } from "../args.js";
|
|
8
7
|
import { ago, bold, count, cyan, dim, json, note, red, table, usageError, write, writeAll, yellow, } from "../term.js";
|
|
9
8
|
const USAGE = 'zen list [--sessions] [--runs] [--limit <n>] [--prune]';
|
|
10
9
|
/** Recent runs shown before `--limit` is asked for. */
|
package/dist/commands/memory.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { KeyStore, loadProjectEnv } from '@zenera/engine';
|
|
1
2
|
import { ALL_AGENTS, buildMemoryReport, createEmbedder, diffMemories, GREP_FIELDS, grepMemory, hostPath, memoryDir, MemoryError, MemoryIndex, MemoryStore, MergeConflicts, mergeMemories, readProjectConfig, renderMemoryHtml, renderRecollection, } from '@zenera/neo';
|
|
2
3
|
import { spawn } from 'node:child_process';
|
|
3
4
|
import { existsSync, readFileSync } from 'node:fs';
|
|
4
5
|
import { writeFile } from 'node:fs/promises';
|
|
5
6
|
import { basename, isAbsolute, join, resolve } from 'node:path';
|
|
6
7
|
import { parse } from "../args.js";
|
|
7
|
-
import { loadProjectEnv } from "../env.js";
|
|
8
|
-
import { KeyStore } from "../keys.js";
|
|
9
8
|
import { project as resolveProject } from "../resolve.js";
|
|
10
9
|
import { ago, bold, bytes, CliError, confirm, count, cyan, dim, EXIT, green, isInteractive, json, note, plain, table, usageError, write, writeAll, yellow, } from "../term.js";
|
|
11
10
|
const USAGE = 'zen memory [stats|ls|search|grep|show|diff|export|merge|forget] [args] [options]';
|
package/dist/commands/meta.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as Projects from '@zenera/engine';
|
|
2
|
+
import { assertOwner, ensureHome, isProvider, KeyStore, loadProjectEnv, PROVIDERS, } from '@zenera/engine';
|
|
1
3
|
import { gatewayOf, readProjectConfig } from '@zenera/neo';
|
|
2
4
|
import { spawn } from 'node:child_process';
|
|
3
5
|
import { randomUUID } from 'node:crypto';
|
|
@@ -6,15 +8,11 @@ import { join, resolve } from 'node:path';
|
|
|
6
8
|
import { setTimeout as sleep } from 'node:timers/promises';
|
|
7
9
|
import { parse } from "../args.js";
|
|
8
10
|
import { matching, projectNames } from "../candidates.js";
|
|
9
|
-
import { loadProjectEnv } from "../env.js";
|
|
10
11
|
import { copilotEventLog } from "../eventlog.js";
|
|
11
|
-
import { ensureHome } from "../home.js";
|
|
12
|
-
import { assertOwner, isProvider, KeyStore, PROVIDERS } from "../keys.js";
|
|
13
12
|
import { probeChat, probeModel } from "../liveness.js";
|
|
14
13
|
import { answerBox, chooseModel, DATASET_DETAILS, DATASET_SUMMARY, DATASET_USAGE, datasetProjectFlag, DEFAULT_RESUMES, editorFiles, fallbackRef, FINETUNE_DETAILS, FINETUNE_SUMMARY, FINETUNE_USAGE, finetuneProjectFlag, lastSession, launch, listPrompts, loadPrompt, locate, masked, metaCompatible, misspelledProvider, MODEL_ENV, openLog, ORDER, PROMPT_DIR, providersWarning, readMeta, recordSession, RESUME_PROMPT, resumeDelayMs, runDataset, runFinetune, sameModel, sessionModel, sessionTotals, SOURCE_LABELS, startVertexRelay, tailSpans, Tally, terminalSink, transient, wire, wireGateway, writeMeta, } from "../meta/index.js";
|
|
15
14
|
import { splitRef } from "../modelref.js";
|
|
16
15
|
import { duration } from "../narrate.js";
|
|
17
|
-
import * as Projects from "../projects.js";
|
|
18
16
|
import { project as resolveProject } from "../resolve.js";
|
|
19
17
|
import { TEMPLATES } from "../scaffold.js";
|
|
20
18
|
import { bold, choose, CliError, credentialError, cyan, dim, EXIT, green, isInteractive, json, note, pad, progress, readStdin, table, usageError, warn, write, writeAll, } from "../term.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type Provider } from '@zenera/engine';
|
|
1
2
|
import { type CatalogEntry, type Role } from '../catalog.ts';
|
|
2
3
|
import type { Command } from '../command.ts';
|
|
3
|
-
import { type Provider } from '../keys.ts';
|
|
4
4
|
export interface BrowseRequest {
|
|
5
5
|
/** opens straight into this provider's listing */
|
|
6
6
|
initial?: Provider;
|
package/dist/commands/models.js
CHANGED
|
@@ -12,10 +12,9 @@
|
|
|
12
12
|
// agents.yaml.
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
14
|
import { createEmbedder, GATEWAY_NAME, gatewayOf, ModelRegistry } from '@zenera/neo';
|
|
15
|
+
import { ensureHome, envNames, form, isProvider, KeyStore, PROVIDERS, } from '@zenera/engine';
|
|
15
16
|
import { parse } from "../args.js";
|
|
16
17
|
import { byGroup, groupOf, isPartner, loadCatalog, loadCatalogs, matches, routerBalance, sampleByProvider, } from "../catalog.js";
|
|
17
|
-
import { ensureHome } from "../home.js";
|
|
18
|
-
import { envNames, form, isProvider, KeyStore, PROVIDERS } from "../keys.js";
|
|
19
18
|
import { probeChat, probeModel } from "../liveness.js";
|
|
20
19
|
import { compareModels } from "../rank.js";
|
|
21
20
|
import { ago, bold, CliError, credentialError, cut, cyan, dim, EXIT, green, isInteractive, json, note, plain, progress, red, table, usageError, write, writeAll, yellow, } from "../term.js";
|
package/dist/commands/run.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as Projects from '@zenera/engine';
|
|
2
|
+
import { display } from '@zenera/engine';
|
|
1
3
|
import { usageByModel } from '@zenera/neo';
|
|
2
4
|
import { writeFile } from 'node:fs/promises';
|
|
3
5
|
import { resolve } from 'node:path';
|
|
@@ -6,10 +8,8 @@ import { concurrency, runBatch } from "../batch.js";
|
|
|
6
8
|
import * as Engine from "../engine.js";
|
|
7
9
|
import { agentEventLog } from "../eventlog.js";
|
|
8
10
|
import { duration, Narrator, stopMark, summary } from "../narrate.js";
|
|
9
|
-
import * as Projects from "../projects.js";
|
|
10
11
|
import { readBatch, readRequest } from "../request.js";
|
|
11
12
|
import { target } from "../resolve.js";
|
|
12
|
-
import { display } from "../session.js";
|
|
13
13
|
import { bold, cyan, dim, drivenByAgent, json, jsonText, note, readStdin, usageError, write, } from "../term.js";
|
|
14
14
|
import { parseChoice } from "../tui/theme.js";
|
|
15
15
|
import { appendUsage } from "../usage.js";
|
package/dist/commands/sandbox.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { current as currentProject, dirSize, isProjectDir, open as openProject, Registry, resolveBuild, sessionIds, } from '@zenera/engine';
|
|
1
2
|
import { readProjectConfig, sandboxLimits, } from '@zenera/neo';
|
|
2
3
|
import { parse } from "../args.js";
|
|
3
|
-
import { resolveBuild } from "../image.js";
|
|
4
4
|
import { engineDisk, ensurePodmanReady, idleContainers, ownedContainers, podmanStatus, removeContainers, sessionOwners, } from "../podman.js";
|
|
5
|
-
import { current as currentProject, dirSize, isProjectDir, open as openProject, Registry, sessionIds, } from "../projects.js";
|
|
6
5
|
import { layout, ResourceSampler } from "../resources.js";
|
|
7
6
|
import { ago, bold, bytes, count, cyan, dim, green, json, note, red, table, usageError, write, writeAll, yellow, } from "../term.js";
|
|
8
7
|
const USAGE = 'zen sandbox [status|top|up|pull|clean|disk] [options]';
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,92 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { type SandboxSetup } from './sandbox.ts';
|
|
4
|
-
import { type Held, type RunPaths, type SessionPaths } from './session.ts';
|
|
5
|
-
export interface EngineOptions {
|
|
6
|
-
project: Project;
|
|
7
|
-
session: SessionPaths;
|
|
8
|
-
readOnly?: boolean;
|
|
9
|
-
/** default model override — `--model` */
|
|
10
|
-
model?: string;
|
|
11
|
-
/** sandbox image override — `--image` */
|
|
12
|
-
image?: string;
|
|
13
|
-
/** another directory to remember into — `--memory` */
|
|
14
|
-
memoryDir?: string;
|
|
15
|
-
/** recall only: nothing is written and several runs may share one graph */
|
|
16
|
-
memoryReadOnly?: boolean;
|
|
17
|
-
/** whether credentials reach the sandbox — `--no-keys` sets this false */
|
|
18
|
-
keys?: boolean;
|
|
19
|
-
/** answer the sandbox's install question without asking — `--yes` */
|
|
20
|
-
yes?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Hold back the warnings about the project rather than the run. A batch
|
|
23
|
-
* opens one project a hundred times, and a hundred copies of the same
|
|
24
|
-
* complaint is a worse report than one.
|
|
25
|
-
*/
|
|
26
|
-
quiet?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* The session will never be resumed, so its containers are removed on close
|
|
29
|
-
* whatever `persist:` says. A stopped one would only hold an engine lock.
|
|
30
|
-
*/
|
|
31
|
-
disposable?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export interface Engine {
|
|
34
|
-
project: AgentProject;
|
|
35
|
-
runner: AgentRunner;
|
|
36
|
-
name: string;
|
|
37
|
-
workspace: string;
|
|
38
|
-
/** where the workspace appears inside the container */
|
|
39
|
-
workspaceMount: string;
|
|
40
|
-
/** every tree the file tools reach, and the names they reach them by */
|
|
41
|
-
files: Workspace;
|
|
42
|
-
/** whether the agent was denied every writing tool */
|
|
43
|
-
readOnly: boolean;
|
|
44
|
-
session: SessionPaths;
|
|
45
|
-
/** the graph this session remembers into, when any agent has one */
|
|
46
|
-
memory?: string;
|
|
47
|
-
/** the session's accumulated state, when it has one */
|
|
48
|
-
state?: AgentState;
|
|
49
|
-
/** the containers this session may start; present whether or not it does */
|
|
50
|
-
sandbox: SandboxSetup;
|
|
51
|
-
lock: Held;
|
|
52
|
-
close(): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Wires the library to a session directory. Every store is file-backed and
|
|
56
|
-
* rooted inside `.data/`, so a session is self-contained: copy the directory
|
|
57
|
-
* and the whole conversation, its memory and its blobs travel with it.
|
|
58
|
-
*/
|
|
1
|
+
import { runEngine, type Engine, type EngineOptions } from '@zenera/engine';
|
|
2
|
+
export { envelope, mounts, type Engine, type EngineOptions, type Mount, type RunOutcome, } from '@zenera/engine';
|
|
59
3
|
export declare function open(opts: EngineOptions): Promise<Engine>;
|
|
60
|
-
export
|
|
61
|
-
/** the directory on this machine */
|
|
62
|
-
host: string;
|
|
63
|
-
/** where it appears to the agent */
|
|
64
|
-
at: string;
|
|
65
|
-
readOnly: boolean;
|
|
66
|
-
}
|
|
67
|
-
/** Every tree the agent can see, the workspace first. */
|
|
68
|
-
export declare function mounts(engine: Engine): Mount[];
|
|
69
|
-
export interface RunOutcome {
|
|
70
|
-
run: RunPaths;
|
|
71
|
-
result: RunResult<string>;
|
|
72
|
-
text: string;
|
|
73
|
-
durationMs: number;
|
|
74
|
-
/** where the report landed, when one could be rendered */
|
|
75
|
-
report?: string;
|
|
76
|
-
/** where the Mermaid graph landed, when one could be emitted */
|
|
77
|
-
graph?: string;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* What one finished run looks like to a program: `zen run --json` prints it,
|
|
81
|
-
* and a batch writes one beside every item. The same function on purpose — a
|
|
82
|
-
* batch whose items were shaped differently would make every consumer of a
|
|
83
|
-
* single run a special case.
|
|
84
|
-
*/
|
|
85
|
-
export declare function envelope(engine: Engine, outcome: RunOutcome): Record<string, unknown>;
|
|
86
|
-
/**
|
|
87
|
-
* One turn. The session's state decides whether this starts a run or continues
|
|
88
|
-
* one — which is the whole of what `resume` used to be, and why it is not a
|
|
89
|
-
* command.
|
|
90
|
-
*/
|
|
91
|
-
export declare function run(engine: Engine, input: Input, onEvent?: (event: AgentEvent) => void, signal?: AbortSignal): Promise<RunOutcome>;
|
|
4
|
+
export declare const run: typeof runEngine;
|
|
92
5
|
//# sourceMappingURL=engine.d.ts.map
|