gencow 0.1.145 → 0.1.147

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 (44) hide show
  1. package/bin/gencow.mjs +17 -1
  2. package/core/index.js +22 -5
  3. package/dashboard/assets/{index-DX9dDxtT.js → index-7pP-gCcL.js} +3 -3
  4. package/dashboard/index.html +1 -1
  5. package/lib/add-command.mjs +9 -3
  6. package/lib/backup-command.mjs +27 -12
  7. package/lib/cli-artifact-guard.mjs +69 -0
  8. package/lib/cli-dev-runtime.mjs +76 -4
  9. package/lib/cli-project-runtime.mjs +37 -30
  10. package/lib/cli-version-check.mjs +146 -0
  11. package/lib/codegen/index.mjs +10110 -217
  12. package/lib/codegen-command.mjs +29 -4
  13. package/lib/coding-guardrails.mjs +9 -2
  14. package/lib/config-command.mjs +5 -2
  15. package/lib/cors-command.mjs +6 -2
  16. package/lib/db-command.mjs +8 -9
  17. package/lib/deploy-auditor.mjs +229 -9
  18. package/lib/deploy-command.mjs +1 -7
  19. package/lib/deploy-package-runtime.mjs +30 -17
  20. package/lib/deploy-runtime.mjs +7 -4
  21. package/lib/deploy-static-fullstack-runtime.mjs +3 -1
  22. package/lib/dev-cloud-bundle.mjs +128 -0
  23. package/lib/dev-cloud-command.mjs +18 -12
  24. package/lib/env-command.mjs +10 -3
  25. package/lib/files-command.mjs +6 -7
  26. package/lib/init-command.mjs +53 -22
  27. package/lib/jobs-command.mjs +12 -0
  28. package/lib/readme-codegen.mjs +2 -0
  29. package/lib/static-command.mjs +14 -4
  30. package/lib/static-deploy-command.mjs +33 -11
  31. package/package.json +3 -2
  32. package/scripts/pre-publish-check.mjs +37 -13
  33. package/server/index.js +6714 -48306
  34. package/server/index.js.map +4 -4
  35. package/templates/SECURITY.md +8 -1
  36. package/templates/ai-chat/ai.ts +6 -5
  37. package/templates/ai-chat/chat.ts +19 -5
  38. package/templates/ai.ts +6 -5
  39. package/templates/auth-schema.ts +2 -2
  40. package/templates/auth.ts +20 -1
  41. package/templates/fullstack/ai.ts +6 -5
  42. package/templates/rag.ts +6 -16
  43. package/templates/reranker.ts +3 -1
  44. package/templates/search.ts +9 -12
package/bin/gencow.mjs CHANGED
@@ -39,6 +39,7 @@ import {
39
39
  updateEnvLocalUrl,
40
40
  } from "../lib/cli-project-runtime.mjs";
41
41
  import { createCodegenCommand } from "../lib/codegen-command.mjs";
42
+ import { maybeCheckCliVersion } from "../lib/cli-version-check.mjs";
42
43
  import { updateComponentReadme } from "../lib/component-readme.mjs";
43
44
  import { createConfigCommand } from "../lib/config-command.mjs";
44
45
  import { createCorsCommand } from "../lib/cors-command.mjs";
@@ -81,6 +82,8 @@ import {
81
82
  import { platformFetch, requireCreds, rpcMutation, rpcQuery } from "../lib/platform-client.mjs";
82
83
 
83
84
  const __dirname = dirname(fileURLToPath(import.meta.url));
85
+ const CLI_PACKAGE_JSON = JSON.parse(readFileSync(resolve(__dirname, "..", "package.json"), "utf8"));
86
+ const CLI_VERSION = CLI_PACKAGE_JSON.version || "0.0.0";
84
87
  const _drizzleKitCmd = (subcmd, options = {}) => buildDrizzleKitCommand(subcmd, options);
85
88
  const generateApiTs = createApiCodegenRuntime({});
86
89
  const runAddCommand = createAddCommand({
@@ -282,6 +285,7 @@ const commands = {
282
285
  help() {
283
286
  log(`
284
287
  ${BOLD}${CYAN}Gencow CLI${RESET} ${DIM}— AI Backend Engine${RESET}
288
+ ${DIM}Version: ${CLI_VERSION}${RESET}
285
289
 
286
290
  ${BOLD}Usage:${RESET}
287
291
  gencow <command>
@@ -382,6 +386,10 @@ ${BOLD}Examples:${RESET}
382
386
  `);
383
387
  },
384
388
 
389
+ version() {
390
+ log(CLI_VERSION);
391
+ },
392
+
385
393
  // ── login/logout/whoami ───────────────────────────────
386
394
  login: runLoginCommand,
387
395
  logout: runLogoutCommand,
@@ -455,7 +463,15 @@ ${BOLD}Examples:${RESET}
455
463
 
456
464
  // ─── updateReadme: gencow/ 폴더 스캔 → README에 컴포넌트 문서 자동 추가 ────
457
465
 
458
- const [, , cmd = "help", ...args] = process.argv;
466
+ const [, , rawCmd = "help", ...args] = process.argv;
467
+ const cmd = rawCmd === "--help" || rawCmd === "-h" ? "help" : rawCmd === "--version" || rawCmd === "-v" ? "version" : rawCmd;
468
+ maybeCheckCliVersion({
469
+ command: cmd,
470
+ currentVersion: CLI_VERSION,
471
+ errorImpl: error,
472
+ processEnv: process.env,
473
+ warnImpl: warn,
474
+ });
459
475
 
460
476
  if (commands[cmd]) {
461
477
  Promise.resolve(commands[cmd](...args)).catch((e) => {
package/core/index.js CHANGED
@@ -1502,7 +1502,17 @@ var DEFAULT_GROUNDING_BUDGET = {
1502
1502
  };
1503
1503
 
1504
1504
  // ../core/src/rag-schema.ts
1505
- import { bigint, boolean, doublePrecision, integer, jsonb, pgTable, text, timestamp, vector } from "drizzle-orm/pg-core";
1505
+ import {
1506
+ bigint,
1507
+ boolean,
1508
+ doublePrecision,
1509
+ integer,
1510
+ jsonb,
1511
+ pgTable,
1512
+ text,
1513
+ timestamp,
1514
+ vector
1515
+ } from "drizzle-orm/pg-core";
1506
1516
  function buildScopeColumns() {
1507
1517
  return {
1508
1518
  id: text("id").primaryKey(),
@@ -2105,7 +2115,7 @@ function createScheduler(options) {
2105
2115
  }
2106
2116
  return {
2107
2117
  runAfter(ms, action, args, scheduleOpts) {
2108
- const id = generateId();
2118
+ const id = scheduleOpts?.id ?? generateId();
2109
2119
  const jobEntry = {
2110
2120
  id,
2111
2121
  action,
@@ -2931,7 +2941,7 @@ function workflow(name, options) {
2931
2941
  lifecycleTimeoutMs,
2932
2942
  maxRetries
2933
2943
  });
2934
- const scheduledJobId = ctx.scheduler.runAfter(0, resumeAction, { workflowId });
2944
+ const scheduledJobId = insertedWorkflowV2 ? `start:${workflowId}` : ctx.scheduler.runAfter(0, resumeAction, { workflowId });
2935
2945
  return {
2936
2946
  id: workflowId,
2937
2947
  name,
@@ -3025,12 +3035,19 @@ var RESERVED_TENANT_RUNTIME_ENV_KEYS = /* @__PURE__ */ new Set([
3025
3035
  "GENCOW_SHUTDOWN_MARKER_PATH",
3026
3036
  "GENCOW_SKIP_MIGRATION",
3027
3037
  "GENCOW_DB_MAX_CONNECTIONS",
3038
+ "GENCOW_DB_IDLE_TIMEOUT_SECONDS",
3039
+ "GENCOW_DB_CONNECTION_TIMEOUT_SECONDS",
3028
3040
  "GENCOW_MEMORY_MB",
3029
3041
  "BUN_JSC_forceRAMSize",
3030
3042
  "MIMALLOC_PURGE_DELAY",
3031
3043
  "NODE_PATH"
3032
3044
  ]);
3033
- var RESERVED_TENANT_RUNTIME_ENV_PREFIXES = ["__GENCOW_", "GENCOW_DOCUMENT_", "GENCOW_TEMPLATE_", "GENCOW_WARM_"];
3045
+ var RESERVED_TENANT_RUNTIME_ENV_PREFIXES = [
3046
+ "__GENCOW_",
3047
+ "GENCOW_DOCUMENT_",
3048
+ "GENCOW_TEMPLATE_",
3049
+ "GENCOW_WARM_"
3050
+ ];
3034
3051
  function isReservedTenantRuntimeEnvKey(key) {
3035
3052
  const normalized = key.trim();
3036
3053
  return RESERVED_TENANT_RUNTIME_ENV_KEYS.has(normalized) || RESERVED_TENANT_RUNTIME_ENV_PREFIXES.some((prefix) => normalized.startsWith(prefix));
@@ -3094,7 +3111,7 @@ function intervalToPattern(options) {
3094
3111
 
3095
3112
  // ../core/src/auth-config.ts
3096
3113
  function defineAuth(config) {
3097
- return config;
3114
+ return { ...config, provider: config.provider ?? "better-auth" };
3098
3115
  }
3099
3116
 
3100
3117
  // ../core/src/config.ts