sovkora 0.0.0-stage → 1.1.0

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 (98) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +9 -0
  3. package/README.md +67 -2
  4. package/dist/commands/agent.command.js +267 -0
  5. package/dist/commands/chat.command.js +214 -0
  6. package/dist/commands/chat.handlers.js +150 -0
  7. package/dist/commands/chat.types.js +44 -0
  8. package/dist/commands/cinema.command.js +643 -0
  9. package/dist/commands/config.command.js +228 -0
  10. package/dist/commands/db.command.js +114 -0
  11. package/dist/commands/demo.command.js +55 -0
  12. package/dist/commands/dev.command.js +462 -0
  13. package/dist/commands/docs.command.js +135 -0
  14. package/dist/commands/doctor.command.js +119 -0
  15. package/dist/commands/forgot.command.js +57 -0
  16. package/dist/commands/generate.command.js +376 -0
  17. package/dist/commands/graph.command.js +54 -0
  18. package/dist/commands/init.command.js +380 -0
  19. package/dist/commands/init.steps.js +115 -0
  20. package/dist/commands/install.command.js +459 -0
  21. package/dist/commands/login.command.js +110 -0
  22. package/dist/commands/logs.command.js +215 -0
  23. package/dist/commands/logs.steps.js +130 -0
  24. package/dist/commands/mcp.command.js +104 -0
  25. package/dist/commands/models.command.js +164 -0
  26. package/dist/commands/onboard.command.js +236 -0
  27. package/dist/commands/pack.command.js +255 -0
  28. package/dist/commands/profile.command.js +51 -0
  29. package/dist/commands/recover.command.js +489 -0
  30. package/dist/commands/register.command.js +94 -0
  31. package/dist/commands/release.command.js +99 -0
  32. package/dist/commands/reset.command.js +79 -0
  33. package/dist/commands/runs.command.js +201 -0
  34. package/dist/commands/settings.command.js +85 -0
  35. package/dist/commands/start.command.js +590 -0
  36. package/dist/commands/status.command.js +167 -0
  37. package/dist/commands/stop.command.js +313 -0
  38. package/dist/commands/studio.command.js +266 -0
  39. package/dist/commands/test.command.js +134 -0
  40. package/dist/commands/verify.command.js +52 -0
  41. package/dist/commands/video.command.js +73 -0
  42. package/dist/commands/workspace-guard.js +72 -0
  43. package/dist/index.js +207 -0
  44. package/dist/renderers.js +250 -0
  45. package/dist/services/api-client.js +150 -0
  46. package/dist/services/auth.api.js +87 -0
  47. package/dist/services/chat.api.js +117 -0
  48. package/dist/services/cinema-estimate.json +42 -0
  49. package/dist/services/cinema.childsafe.js +52 -0
  50. package/dist/services/cinema.director.js +285 -0
  51. package/dist/services/cinema.production.js +417 -0
  52. package/dist/services/cinema.staging.js +323 -0
  53. package/dist/services/cinema.story.js +758 -0
  54. package/dist/services/cinema.treatment.js +393 -0
  55. package/dist/services/composer.run.js +94 -0
  56. package/dist/services/demo/demo.documents.js +108 -0
  57. package/dist/services/demo/demo.guard.js +49 -0
  58. package/dist/services/demo/demo.persona.js +114 -0
  59. package/dist/services/demo/demo.seed.js +281 -0
  60. package/dist/services/diagnostics.js +327 -0
  61. package/dist/services/image-model-recipes.json +93 -0
  62. package/dist/services/image-models.js +152 -0
  63. package/dist/services/local-store.js +145 -0
  64. package/dist/services/mcp.api.js +38 -0
  65. package/dist/services/model-catalog.js +70 -0
  66. package/dist/services/notify.js +55 -0
  67. package/dist/services/pack.api.js +23 -0
  68. package/dist/services/pack.bundle.js +241 -0
  69. package/dist/services/pack.sources.js +101 -0
  70. package/dist/services/release-manifest.js +266 -0
  71. package/dist/services/runs.view.js +80 -0
  72. package/dist/services/runs.wait.js +38 -0
  73. package/dist/services/semver.js +55 -0
  74. package/dist/services/settings.api.js +108 -0
  75. package/dist/services/string-utils.js +70 -0
  76. package/dist/services/studio.api.js +120 -0
  77. package/dist/services/templates.js +893 -0
  78. package/dist/services/tool-installer.js +353 -0
  79. package/dist/services/tool-path.js +72 -0
  80. package/dist/services/version-manager.js +253 -0
  81. package/dist/services/workspace-bootstrap.js +68 -0
  82. package/dist/threads.js +202 -0
  83. package/dist/types/api.types.js +6 -0
  84. package/dist/types/local.types.js +6 -0
  85. package/dist/ui/box.js +46 -0
  86. package/dist/ui/logger.js +28 -0
  87. package/dist/ui/platform.js +32 -0
  88. package/dist/ui/prompts.js +130 -0
  89. package/dist/ui/table.js +33 -0
  90. package/dist/utils/config.js +150 -0
  91. package/dist/utils/development-status.js +22 -0
  92. package/dist/utils/endpoints.js +41 -0
  93. package/dist/utils/health.js +94 -0
  94. package/dist/utils/pid.js +83 -0
  95. package/dist/utils/platform.js +358 -0
  96. package/dist/utils/process.js +139 -0
  97. package/dist/utils/state-dir.js +105 -0
  98. package/package.json +95 -4
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ /**
3
+ * @file config.command.ts
4
+ * @description Interactive configuration wizard for managing .env variables.
5
+ * Presents a guided, user-friendly interface for reviewing and updating
6
+ * environment configuration without manual file editing.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21
+ }) : function(o, v) {
22
+ o["default"] = v;
23
+ });
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __importDefault = (this && this.__importDefault) || function (mod) {
42
+ return (mod && mod.__esModule) ? mod : { "default": mod };
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.configCommand = void 0;
46
+ const commander_1 = require("commander");
47
+ const fs = __importStar(require("node:fs"));
48
+ const chalk_1 = __importDefault(require("chalk"));
49
+ const prompts_1 = require("../ui/prompts");
50
+ const platform_1 = require("../ui/platform");
51
+ const CONFIG_CATEGORIES = [
52
+ {
53
+ label: "🌐 Server & Network",
54
+ hint: "Router port, CORS origins, UI URL",
55
+ keys: [
56
+ { key: "PORT", label: "Router Port", defaultValue: "8080", hint: "HTTP port for the Spring Boot Router" },
57
+ {
58
+ key: "GATEWAY_CORS_ALLOWED_ORIGINS",
59
+ label: "CORS Origins",
60
+ defaultValue: "http://localhost:3000",
61
+ hint: "Comma-separated allowed origins",
62
+ },
63
+ { key: "UI_URL", label: "Frontend URL", defaultValue: "http://localhost:3000", hint: "Next.js UI base URL" },
64
+ ],
65
+ },
66
+ {
67
+ label: "🐘 PostgreSQL Database",
68
+ hint: "Connection URL, credentials",
69
+ keys: [
70
+ { key: "SPRING_DATASOURCE_URL", label: "JDBC URL", defaultValue: "jdbc:postgresql://localhost:5432/orazaka_db" },
71
+ { key: "SPRING_DATASOURCE_USERNAME", label: "DB Username", defaultValue: "orazaka_admin" },
72
+ { key: "SPRING_DATASOURCE_PASSWORD", label: "DB Password", defaultValue: "", sensitive: true },
73
+ ],
74
+ },
75
+ {
76
+ label: "🐰 RabbitMQ",
77
+ hint: "AMQP broker host, port, credentials",
78
+ keys: [
79
+ { key: "RABBITMQ_HOST", label: "Host", defaultValue: "localhost" },
80
+ { key: "RABBITMQ_PORT", label: "Port", defaultValue: "5672" },
81
+ { key: "RABBITMQ_USER", label: "Username", defaultValue: "guest" },
82
+ { key: "RABBITMQ_PASS", label: "Password", defaultValue: "guest", sensitive: true },
83
+ ],
84
+ },
85
+ {
86
+ label: "🔴 Redis",
87
+ hint: "Cache connection URL",
88
+ keys: [{ key: "REDIS_URL", label: "Redis URL", defaultValue: "redis://localhost:6379" }],
89
+ },
90
+ {
91
+ label: "🤖 AI Provider",
92
+ hint: "Ollama settings, default models",
93
+ keys: [
94
+ {
95
+ key: "DEFAULT_PROVIDER",
96
+ label: "Default Provider",
97
+ defaultValue: "ollama",
98
+ hint: "ollama | openai | anthropic",
99
+ },
100
+ { key: "OLLAMA_BASE_URL", label: "Ollama Base URL", defaultValue: "http://localhost:11434" },
101
+ { key: "OLLAMA_MODEL", label: "Chat Model", defaultValue: "phi3:mini" },
102
+ { key: "OLLAMA_EMBEDDING_MODEL", label: "Embedding Model", defaultValue: "nomic-embed-text:latest" },
103
+ { key: "ROUTER_PROVIDER", label: "Router Provider", defaultValue: "ollama" },
104
+ { key: "ROUTER_MODEL", label: "Router Model", defaultValue: "phi3:mini" },
105
+ { key: "OLLAMA_NUM_PARALLEL", label: "Parallel Requests", defaultValue: "1" },
106
+ { key: "OLLAMA_KEEP_ALIVE", label: "Keep Alive Duration", defaultValue: "24h" },
107
+ ],
108
+ },
109
+ {
110
+ label: "🎨 Workers",
111
+ hint: "Media, Image, Automation worker ports",
112
+ keys: [
113
+ { key: "VIDEO_WORKER_PORT", label: "Media Worker Port", defaultValue: "8188" },
114
+ { key: "IMAGE_WORKER_PORT", label: "Image Worker Port", defaultValue: "8085" },
115
+ ],
116
+ },
117
+ {
118
+ label: "🔐 Security",
119
+ hint: "Encryption keys and salt",
120
+ keys: [
121
+ {
122
+ key: "CRYPTO_KEY",
123
+ label: "Encryption Key",
124
+ defaultValue: "",
125
+ sensitive: true,
126
+ hint: "Auto-generated during init",
127
+ },
128
+ {
129
+ key: "CRYPTO_SALT",
130
+ label: "Encryption Salt",
131
+ defaultValue: "",
132
+ sensitive: true,
133
+ hint: "Auto-generated during init",
134
+ },
135
+ ],
136
+ },
137
+ ];
138
+ exports.configCommand = new commander_1.Command("config")
139
+ .description("Interactive configuration wizard — review and update .env variables")
140
+ .option("-l, --list", "List all current configuration values")
141
+ .option("-c, --category <name>", "Jump directly to a specific category")
142
+ .action(async (options) => {
143
+ const envPath = (0, platform_1.resolveEnvFile)();
144
+ const envExists = fs.existsSync(envPath);
145
+ await (0, prompts_1.intro)(chalk_1.default.cyan.bold("🥷 Sovkora Configuration Wizard"));
146
+ if (!envExists) {
147
+ await (0, prompts_1.logWarning)("No .env file found in the current directory.\n" +
148
+ " Run " +
149
+ chalk_1.default.cyan("npx sovkora init") +
150
+ " first to generate a secure environment configuration.");
151
+ await (0, prompts_1.outro)("Configuration wizard aborted.");
152
+ return;
153
+ }
154
+ const currentEnv = (0, platform_1.parseEnvFile)(envPath);
155
+ // ─── List mode ─────────────────────────────────────────────
156
+ if (options.list) {
157
+ for (const category of CONFIG_CATEGORIES) {
158
+ const lines = [];
159
+ for (const k of category.keys) {
160
+ const value = currentEnv[k.key] ?? chalk_1.default.gray("(not set)");
161
+ const displayValue = k.sensitive && currentEnv[k.key] ? chalk_1.default.gray("●".repeat(Math.min(value.length, 16))) : chalk_1.default.white(value);
162
+ lines.push(`${chalk_1.default.yellow(k.key.padEnd(35))} ${displayValue}`);
163
+ }
164
+ await (0, prompts_1.note)(lines.join("\n"), category.label);
165
+ }
166
+ await (0, prompts_1.outro)("Use " + chalk_1.default.cyan("npx sovkora config") + " (without --list) to edit values interactively.");
167
+ return;
168
+ }
169
+ // ─── Interactive editing loop ──────────────────────────────
170
+ while (true) {
171
+ const categoryChoice = await (0, prompts_1.select)({
172
+ message: "Which configuration category would you like to edit?",
173
+ options: [
174
+ ...CONFIG_CATEGORIES.map((cat, idx) => ({
175
+ value: idx,
176
+ label: cat.label,
177
+ hint: cat.hint,
178
+ })),
179
+ { value: -1, label: "💾 Save & Exit", hint: "Write changes and quit" },
180
+ ],
181
+ });
182
+ (0, prompts_1.handleCancel)(categoryChoice);
183
+ if (categoryChoice === -1) {
184
+ break;
185
+ }
186
+ const category = CONFIG_CATEGORIES[categoryChoice];
187
+ if (!category)
188
+ continue;
189
+ await (0, prompts_1.logStep)(`Editing: ${category.label}`);
190
+ const updates = {};
191
+ for (const k of category.keys) {
192
+ const currentValue = currentEnv[k.key] ?? k.defaultValue;
193
+ const newValue = await (0, prompts_1.text)({
194
+ message: `${k.label}${k.hint ? chalk_1.default.gray(" (" + k.hint + ")") : ""}`,
195
+ placeholder: k.defaultValue,
196
+ defaultValue: currentValue,
197
+ validate: (val) => {
198
+ if (k.key === "PORT" ||
199
+ k.key === "RABBITMQ_PORT" ||
200
+ k.key === "VIDEO_WORKER_PORT" ||
201
+ k.key === "IMAGE_WORKER_PORT") {
202
+ const num = Number.parseInt(val, 10);
203
+ if (Number.isNaN(num) || num < 1 || num > 65535) {
204
+ return "Port must be a number between 1 and 65535";
205
+ }
206
+ }
207
+ return undefined;
208
+ },
209
+ });
210
+ if ((0, prompts_1.isCancel)(newValue)) {
211
+ await (0, prompts_1.logWarning)("Skipped remaining fields in this category.");
212
+ break;
213
+ }
214
+ if (newValue !== currentValue) {
215
+ updates[k.key] = newValue;
216
+ currentEnv[k.key] = newValue;
217
+ }
218
+ }
219
+ if (Object.keys(updates).length > 0) {
220
+ (0, platform_1.writeEnvFile)(envPath, updates);
221
+ await (0, prompts_1.logSuccess)(`Updated ${String(Object.keys(updates).length)} value(s) in .env`);
222
+ }
223
+ else {
224
+ await (0, prompts_1.logStep)("No changes made in this category.");
225
+ }
226
+ }
227
+ await (0, prompts_1.outro)(chalk_1.default.green("✨ Configuration saved. Your .env is up to date."));
228
+ });
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ /**
3
+ * @file db.command.ts
4
+ * @description Database maintenance commands. `infra/initdb/` is the seed source
5
+ * (one file per bounded context / future service owner, applied in alphabetical
6
+ * order) and is fully replayable — `00-reset.sql` begins by
7
+ * `DROP TABLE IF EXISTS … CASCADE` for every table. It only runs automatically on
8
+ * a *fresh* Postgres volume, so after editing a seed (e.g. adding `${prompt}` to
9
+ * a capability payload template) a running stack keeps the stale rows.
10
+ * `sovkora db reseed` re-applies the whole directory on demand.
11
+ */
12
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
19
+ }) : (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ o[k2] = m[k];
22
+ }));
23
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
25
+ }) : function(o, v) {
26
+ o["default"] = v;
27
+ });
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
45
+ var __importDefault = (this && this.__importDefault) || function (mod) {
46
+ return (mod && mod.__esModule) ? mod : { "default": mod };
47
+ };
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.dbCommand = void 0;
50
+ const commander_1 = require("commander");
51
+ const node_child_process_1 = require("node:child_process");
52
+ const fs = __importStar(require("node:fs"));
53
+ const path = __importStar(require("node:path"));
54
+ const chalk_1 = __importDefault(require("chalk"));
55
+ const prompts_1 = require("../ui/prompts");
56
+ const config_1 = require("../utils/config");
57
+ const platform_1 = require("../utils/platform");
58
+ const tool_path_1 = require("../services/tool-path");
59
+ /** Compose `container_name` of the pgvector Postgres service (infra/docker-compose.yml). */
60
+ const DB_CONTAINER = "orazaka-db-vector";
61
+ /** Reads infra/initdb/*.sql concatenated in execution (alphabetical) order. */
62
+ function readInitDb(root) {
63
+ const dir = path.join(root, "infra", "initdb");
64
+ if (!fs.existsSync(dir)) {
65
+ return null;
66
+ }
67
+ const files = fs
68
+ .readdirSync(dir)
69
+ .filter((n) => n.endsWith(".sql"))
70
+ .sort();
71
+ if (files.length === 0) {
72
+ return null;
73
+ }
74
+ const sql = files.map((n) => fs.readFileSync(path.join(dir, n), "utf8")).join("\n");
75
+ return { files, sql };
76
+ }
77
+ /** Re-applies infra/initdb/*.sql inside the running Postgres container via psql. */
78
+ async function reseed(opts) {
79
+ const root = (0, platform_1.resolveWorkspaceRootSmart)();
80
+ const dbName = (0, config_1.strEnv)("DB_NAME", "orazaka_db");
81
+ const dbUser = (0, config_1.strEnv)("DB_USERNAME", "orazaka_app");
82
+ await (0, prompts_1.intro)(chalk_1.default.cyan("Sovkora DB Reseed"));
83
+ const initDb = readInitDb(root);
84
+ if (!initDb) {
85
+ await (0, prompts_1.logError)(`Seed directory not found or empty: ${path.join(root, "infra", "initdb")}`);
86
+ process.exit(1);
87
+ }
88
+ await (0, prompts_1.logWarning)("This DROPs every table and replays infra/initdb/*.sql — all local data (users, chats, jobs) is wiped.");
89
+ if (!opts.yes) {
90
+ const ok = await (0, prompts_1.confirm)({ message: `Reseed database "${dbName}" now?`, initialValue: false });
91
+ if ((0, prompts_1.isCancel)(ok) || !ok) {
92
+ await (0, prompts_1.outro)(chalk_1.default.red("Cancelled."));
93
+ return;
94
+ }
95
+ }
96
+ const s = await (0, prompts_1.createSpinner)();
97
+ s.start(`Applying ${initDb.files.length} initdb files…`);
98
+ const res = (0, node_child_process_1.spawnSync)((0, tool_path_1.toolPath)("docker"), ["exec", "-i", DB_CONTAINER, "psql", "-U", dbUser, "-d", dbName, "-v", "ON_ERROR_STOP=1", "-q", "-f", "-"], { input: initDb.sql });
99
+ if (res.status !== 0) {
100
+ s.stop("Reseed failed");
101
+ const detail = (res.stderr?.toString() || res.error?.message || "unknown error").trim();
102
+ await (0, prompts_1.logError)(detail.split("\n").slice(-5).join("\n"));
103
+ await (0, prompts_1.logInfo)(`Is the database container running? Start it with: sovkora start --mode dev`);
104
+ process.exit(1);
105
+ }
106
+ s.stop("Database reseeded");
107
+ await (0, prompts_1.outro)(chalk_1.default.green("✓ Schema + seed re-applied. Reload the playground — the prompt fields will appear."));
108
+ }
109
+ exports.dbCommand = new commander_1.Command("db").description("Database maintenance operations");
110
+ exports.dbCommand
111
+ .command("reseed")
112
+ .description("Drop & re-apply infra/initdb/*.sql (schema + seed). Destroys all local dev data.")
113
+ .option("-y, --yes", "Skip the destructive-action confirmation prompt")
114
+ .action(reseed);
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * @file demo.command.ts
4
+ * @description `sovkora demo seed` — the demo persona (Eric) on the local stack, replayable.
5
+ *
6
+ * Refuses anything but a local, non-deployed target (services/demo/demo.guard.ts). The password is
7
+ * DEMO_PASSWORD, or the persona's local default; the plan is set by the development administrator
8
+ * (ADMIN_EMAIL / ADMIN_PASSWORD from .env).
9
+ */
10
+ var __importDefault = (this && this.__importDefault) || function (mod) {
11
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.demoCommand = void 0;
15
+ const commander_1 = require("commander");
16
+ const chalk_1 = __importDefault(require("chalk"));
17
+ const prompts_1 = require("../ui/prompts");
18
+ const config_1 = require("../utils/config");
19
+ const demo_seed_1 = require("../services/demo/demo.seed");
20
+ const demo_persona_1 = require("../services/demo/demo.persona");
21
+ async function seed(opts) {
22
+ await (0, prompts_1.intro)(chalk_1.default.cyan("Sovkora demo persona"));
23
+ const password = (0, config_1.strEnv)("DEMO_PASSWORD", demo_persona_1.DEMO_PERSONA.publicSignIn);
24
+ try {
25
+ const result = await new demo_seed_1.DemoSeeder({
26
+ baseUrl: config_1.ROUTER_URL,
27
+ mailUrl: (0, config_1.strEnv)("MAILPIT_URL", "http://localhost:8025"),
28
+ password,
29
+ admin: { email: (0, config_1.strEnv)("ADMIN_EMAIL", "admin@orazaka.com"), password: (0, config_1.strEnv)("ADMIN_PASSWORD", "Admin123!") },
30
+ env: process.env,
31
+ fetch: (url, init) => fetch(url, init),
32
+ onStep: (line) => void (0, prompts_1.logSuccess)(`✔ ${line}`),
33
+ fresh: opts.fresh,
34
+ runs: opts.runs || opts.withVideo,
35
+ withVideo: opts.withVideo,
36
+ }).run();
37
+ await (0, prompts_1.logInfo)(`Sign in as ${chalk_1.default.bold(result.email)} / ${chalk_1.default.bold(password)} — ${result.studios.length} Studios, ` +
38
+ `${result.packs.length} packs, plan ${result.plan}` +
39
+ (result.runs.length ? `, ${result.runs.length} runs started (they finish in the background)` : "") +
40
+ `. Conversations: orazaka-web-client \`npm run record:tour -- prepare\`.`);
41
+ await (0, prompts_1.outro)(chalk_1.default.green(`Good evening, ${demo_persona_1.DEMO_PERSONA.username}.`));
42
+ }
43
+ catch (err) {
44
+ await (0, prompts_1.logError)(err instanceof Error ? err.message : String(err));
45
+ process.exit(1);
46
+ }
47
+ }
48
+ exports.demoCommand = new commander_1.Command("demo").description("Demonstration persona on the local stack (never on a deployed one)");
49
+ exports.demoCommand
50
+ .command("seed")
51
+ .description("Create or refresh Eric, the demo persona: account, onboarding, plan, packs and Studios (replayable)")
52
+ .option("--fresh", "Delete Eric's conversations first, for a demo that starts from a clean history")
53
+ .option("--runs", "Also run Eric's demo work on this stack: a product photo, a voice-over, a prospect dossier, a lease check, an invoice check")
54
+ .option("--with-video", "With --runs, also generate a few seconds of video (loads a video model: one heavy job, never by default)")
55
+ .action(seed);