@kybernesis/create 0.5.1 → 0.5.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/init.js CHANGED
@@ -131,7 +131,7 @@ export async function init(rawName, options = {}) {
131
131
  }
132
132
  }
133
133
  console.log(bold("\n5/6 Env template + hermetic eval script …"));
134
- writeFileSync(join(dir, ".env.example"), envExample(name, depts, issuer, plan.env));
134
+ writeFileSync(join(dir, ".env.example"), envExample(name, depts, issuer, plan.env, host, DEFAULT_MODEL));
135
135
  const pkgPath = join(dir, "package.json");
136
136
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
137
137
  pkg.scripts = { ...pkg.scripts, eval: evalScript(name, depts) };
@@ -7,7 +7,7 @@ export declare function subagentInstructionsMd(dept: string): string;
7
7
  export declare function subagentArcanaTs(dept: string): string;
8
8
  export declare function rootArcanaTs(): string;
9
9
  export declare function evalFileTs(displayName: string, depts: string[]): string;
10
- export declare function envExample(name: string, depts: string[], issuer: string, channelEnv?: string[]): string;
10
+ export declare function envExample(name: string, depts: string[], issuer: string, channelEnv?: string[], host?: "vercel" | "exe", model?: string): string;
11
11
  export declare function evalScript(name: string, depts: string[]): string;
12
12
  export type ChannelKind = "none" | "slack" | "imessage" | "telegram" | "discord" | "web";
13
13
  export declare const CHANNEL_KINDS: ChannelKind[];
package/dist/templates.js CHANGED
@@ -120,22 +120,46 @@ export default kybernesisBaseline({
120
120
  ${depts.length ? ` routing: [\n${routing}\n ],\n` : ""}});
121
121
  `;
122
122
  }
123
- export function envExample(name, depts, issuer, channelEnv = []) {
123
+ /**
124
+ * Env every self-hosted agent needs and cannot infer.
125
+ *
126
+ * Both of these have bitten a real deployment. EXE_MODEL must match the LLM
127
+ * integration actually attached — a ChatGPT subscription serves OpenAI models,
128
+ * so an Anthropic code default fails against it. EXE_VM_NAME has no default at
129
+ * all by design: guessing a host would hand a user a working link into another
130
+ * agent's machine.
131
+ */
132
+ function exeEnvBlock(name, model) {
133
+ return `# Self-hosted host + model (@kybernesis/exe)
134
+ # EXE_MODEL must match the LLM integration you attached to the VM. A ChatGPT
135
+ # subscription serves OpenAI models; the code default will fail against one.
136
+ # Set it explicitly rather than relying on ${model}.
137
+ EXE_MODEL="${model}"
138
+ # Preview URLs are built from this. There is no default on purpose.
139
+ EXE_VM_NAME="${name}"
140
+
141
+ `;
142
+ }
143
+ export function envExample(name, depts, issuer, channelEnv = [], host = "vercel", model = "") {
124
144
  const deptVars = depts
125
145
  .map((d) => {
126
146
  const upper = d.toUpperCase().replace(/[^A-Z0-9]+/g, "_");
127
147
  return `# ARCANA_${upper}_API_KEY="kb_..."\n# ARCANA_${upper}_WORKSPACE="${name}-${d}"`;
128
148
  })
129
149
  .join("\n");
150
+ const header = host === "exe"
151
+ ? `# Real values live in .env.local ON THE HOST. \`eve start\` does NOT read it the
152
+ # way \`eve dev\` does — scripts/eve-server.sh exports it into the process.`
153
+ : `# Real values belong in Vercel envs (prod/preview Sensitive); \`eve deploy\`
154
+ # overwrites .env.local from the development environment on every deploy.`;
130
155
  return `# ── Kybernesis agent environment ─────────────────────────────────────
131
- # Real values belong in Vercel envs (prod/preview Sensitive); \`eve deploy\`
132
- # overwrites .env.local from the development environment on every deploy.
156
+ ${header}
133
157
 
134
158
  # Control-plane governance (@kybernesis/enterprise)
135
159
  KYBERNESIS_ISSUER="${issuer}"
136
160
  KYBERNESIS_AGENT="${name}"
137
161
 
138
- ${channelEnv.length ? `# Channel\n${channelEnv.join("\n")}\n\n` : ""}# Arcana memory (@kybernesis/arcana) — one workspace + scoped kb_ key per brain
162
+ ${host === "exe" ? exeEnvBlock(name, model) : ""}${channelEnv.length ? `# Channel\n${channelEnv.join("\n")}\n\n` : ""}# Arcana memory (@kybernesis/arcana) — one workspace + scoped kb_ key per brain
139
163
  # ARCANA_API_KEY="kb_..."
140
164
  # ARCANA_COMPANY_WORKSPACE="${name}-company"
141
165
  # ARCANA_DM_WORKSPACE="${name}-company"
@@ -360,8 +384,11 @@ export default defineSandbox({
360
384
  revalidationKey: () => "kybernesis-workshop-v5-docker",
361
385
  async bootstrap({ use }) {
362
386
  const sandbox = await use();
387
+ // Base image is Debian-family; refresh indexes before installing browser deps.
363
388
  await sandbox.run({ command: "apt-get update" });
364
389
  await sandbox.run({ command: "npm install -g pnpm" });
390
+ // Explicit package.json rather than \`npm init -y\`: init derives the name from
391
+ // the directory, and npm rejects names starting with a dot (".shot").
365
392
  await sandbox.run({
366
393
  command:
367
394
  "mkdir -p /workspace/.shot && cd /workspace/.shot && echo '{\\"name\\":\\"kyb-shot\\",\\"private\\":true}' > package.json && npm install playwright",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kybernesis/create",
3
- "version": "0.5.1",
3
+ "version": "0.5.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",