@kybernesis/create 0.13.1 → 0.13.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.
package/dist/cli.js CHANGED
@@ -57,6 +57,7 @@ function initOptions(rest) {
57
57
  studio: rest.includes('--studio'),
58
58
  channel: flag(rest, "channel"),
59
59
  host: flag(rest, "host"),
60
+ model: flag(rest, "model"),
60
61
  subagents: subs === undefined ? undefined : subs.split(',').map((s) => s.trim()).filter(Boolean),
61
62
  yes: rest.includes('--yes') || rest.includes('-y'),
62
63
  };
@@ -182,6 +183,7 @@ ${dim(" npm i -g @kybernesis/create@latest")}
182
183
  --channel=<kind> ${dim("none|slack|imessage|telegram|discord|web (default: none)")}
183
184
  --host=<kind> ${dim("vercel|exe (default: vercel)")}
184
185
  --subagents=a,b ${dim("department subagents (default: none)")}
186
+ --model=<id> ${dim("provider/model-id (default: sonnet 5)")}
185
187
  --engineer ${dim("add the engineer layer: workshop sandbox + vision dev loop")}
186
188
  --studio ${dim("wire for KYBER Studio: local execution + management routes")}
187
189
  --yes ${dim("no prompts; take flags and defaults")}
package/dist/init.d.ts CHANGED
@@ -14,6 +14,18 @@ export interface InitOptions {
14
14
  channel?: ChannelKind;
15
15
  /** Where the agent runs. Default "vercel". */
16
16
  host?: HostKind;
17
+ /**
18
+ * The model, as provider/model-id.
19
+ *
20
+ * @remarks
21
+ * Passed straight through to `eve init`, and that is why it exists: without
22
+ * it eve ends its scaffold by opening its interactive model picker, which
23
+ * needs a terminal UI. On a laptop that is a prompt; on a headless machine
24
+ * it is `--input requires the interactive UI` and a scaffold that stops
25
+ * after step one having already written the project — so `--yes` was never
26
+ * actually non-interactive.
27
+ */
28
+ model?: string;
17
29
  /** Department subagents. Default NONE. */
18
30
  subagents?: string[];
19
31
  /** Skip prompts and take the flags/defaults as given. */
package/dist/init.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { chmodSync, copyFileSync, cpSync, existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
2
2
  import { join, resolve } from "node:path";
3
- import { DEFAULT_ISSUER, EVE_VERSION, REGISTRY_URL, ask, bold, closePrompts, dim, green, run, slug, yellow, } from "./util.js";
3
+ import { DEFAULT_ISSUER, EVE_VERSION, REGISTRY_URL, ask, bold, closePrompts, dim, green, run, slug, red, yellow, } from "./util.js";
4
4
  import { CHANNEL_KINDS, channelPlan, engineerPlan, envExample, evalFileTs, exeEvalConfigTs, evalScript, hostAgentTs, hostSteps, identityMd, rootArcanaTs, subagentAgentTs, subagentArcanaTs, subagentInstructionsMd, } from "./templates.js";
5
5
  import { suiteDir } from "./skills.js";
6
6
  import { configureArcana } from "./arcana.js";
@@ -58,8 +58,26 @@ export async function init(rawName, options = {}) {
58
58
  process.exit(1);
59
59
  }
60
60
  const plan = channelPlan(channel, name, host);
61
+ const model = options.model ?? DEFAULT_MODEL;
61
62
  console.log(bold(`\n1/6 Scaffolding eve agent (eve@${EVE_VERSION}) …`));
62
- run("npx", [`eve@${EVE_VERSION}`, "init", name]);
63
+ // eve's scaffold ends by opening its interactive model picker
64
+ // (`eve dev --input /model`), which exits non-zero wherever there is no
65
+ // terminal UI — AFTER the project is fully created and its dependencies
66
+ // installed. Treating that as a failure makes headless scaffolding
67
+ // impossible, which is what a machine building itself has to do.
68
+ //
69
+ // Nothing is lost by ignoring it: agent.ts is overwritten below with our own
70
+ // template carrying the chosen model, so eve's pick would not have survived
71
+ // this function either. `--model` is deliberately NOT passed through — eve
72
+ // refuses an id it cannot find in the AI Gateway catalog and then creates
73
+ // nothing at all, and an exe-hosted agent takes its model from EXE_MODEL,
74
+ // not from the gateway.
75
+ run("npx", [`eve@${EVE_VERSION}`, "init", name], { allowFail: true });
76
+ // The real test of that step, since its exit code cannot be trusted.
77
+ if (!existsSync(join(dir, "package.json"))) {
78
+ console.error(red(`\n eve did not create a project in ${dir}. Nothing else can run.`));
79
+ process.exit(1);
80
+ }
63
81
  console.log(bold("\n2/6 Adding the Kybernesis registry + core packages …"));
64
82
  run("npx", ["eve", "registry", "add", `@kybernesis=${REGISTRY_URL}`], { cwd: dir });
65
83
  for (const item of CORE_ITEMS) {
@@ -108,7 +126,7 @@ export async function init(rawName, options = {}) {
108
126
  ` This agent cannot be connected to a desktop until they install.`));
109
127
  }
110
128
  }
111
- const engPlan = engineer ? engineerPlan(host, DEFAULT_MODEL) : null;
129
+ const engPlan = engineer ? engineerPlan(host, model) : null;
112
130
  if (engPlan) {
113
131
  console.log(bold("\n2c Engineer subagent: workshop sandbox + vision dev loop …"));
114
132
  run("npm", ["install", ...engPlan.deps, "--no-audit", "--no-fund"], { cwd: dir, allowFail: true });
@@ -133,7 +151,7 @@ export async function init(rawName, options = {}) {
133
151
  unlinkSync(join(dir, "agent/instructions.md"));
134
152
  }
135
153
  catch { }
136
- writeFileSync(join(dir, "agent/agent.ts"), hostAgentTs(host, DEFAULT_MODEL));
154
+ writeFileSync(join(dir, "agent/agent.ts"), hostAgentTs(host, model));
137
155
  writeFileSync(join(dir, "agent/extensions/arcana.ts"), rootArcanaTs());
138
156
  writeFileSync(join(dir, "evals/kybernesis.eval.ts"), evalFileTs(displayName, depts));
139
157
  // A self-hosted agent judges through its own integration; the default
@@ -287,7 +305,7 @@ export async function init(rawName, options = {}) {
287
305
  }
288
306
  }
289
307
  console.log(bold("\n5/6 Env template + hermetic eval script …"));
290
- writeFileSync(join(dir, ".env.example"), envExample(name, depts, issuer, plan.env, host, DEFAULT_MODEL));
308
+ writeFileSync(join(dir, ".env.example"), envExample(name, depts, issuer, plan.env, host, model));
291
309
  const pkgPath = join(dir, "package.json");
292
310
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
293
311
  pkg.scripts = { ...pkg.scripts, eval: evalScript(name, depts) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kybernesis/create",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "The Kybernesis agent scaffolder and FDE toolkit: one command to a governed, remembering, multiplayer, self-testing eve agent — plus doctor and upgrade.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",