@korajs/cli 1.0.0-beta.1 → 1.0.0-beta.4

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/index.d.cts CHANGED
@@ -59,6 +59,63 @@ declare class DevServerError extends KoraError {
59
59
  constructor(binary: string, searchPath: string);
60
60
  }
61
61
 
62
+ /**
63
+ * Writes an AGENTS.md into an existing project so AI coding agents follow Kora
64
+ * conventions. Refuses to overwrite an existing file unless `--force` is passed.
65
+ */
66
+ declare const agentsCommand: citty.CommandDef<{
67
+ force: {
68
+ type: "boolean";
69
+ description: string;
70
+ default: false;
71
+ };
72
+ framework: {
73
+ type: "string";
74
+ description: string;
75
+ };
76
+ }>;
77
+
78
+ /**
79
+ * Canonical AGENTS.md generator.
80
+ *
81
+ * `kora agents-md` writes this file into an existing project so AI coding agents
82
+ * (and humans) build Kora apps correctly instead of drifting to fetch calls,
83
+ * hand-written types, and loading spinners. New projects scaffolded with
84
+ * `create-kora-app` already ship an AGENTS.md; this command covers the manual
85
+ * setup path and lets existing projects regenerate the guidance on demand.
86
+ */
87
+ /** UI framework whose bindings section the generated AGENTS.md documents. */
88
+ type AgentsFramework = 'react' | 'vue' | 'svelte';
89
+ /** All supported frameworks, for validation and help text. */
90
+ declare const AGENTS_FRAMEWORKS: readonly AgentsFramework[];
91
+ /**
92
+ * Narrows an arbitrary string to a supported {@link AgentsFramework}.
93
+ *
94
+ * @param value - Candidate framework identifier
95
+ * @returns `true` when `value` is one of the supported frameworks
96
+ */
97
+ declare function isAgentsFramework(value: string): value is AgentsFramework;
98
+ /**
99
+ * Detects the UI framework from a project's package manifest by looking for the
100
+ * matching `@korajs/*` binding package in dependencies or devDependencies.
101
+ *
102
+ * @param manifest - Parsed `package.json` contents
103
+ * @returns The detected framework, or `null` when no binding package is present
104
+ */
105
+ declare function detectFrameworkFromManifest(manifest: unknown): AgentsFramework | null;
106
+ /**
107
+ * Renders the full AGENTS.md document for the given framework.
108
+ *
109
+ * The body (golden rules, data API cheat sheet, conflict handling, sync notes,
110
+ * commands) is framework-agnostic; only the bindings section changes. File paths
111
+ * are described as conventions so the guidance is correct for both scaffolded and
112
+ * manually configured projects.
113
+ *
114
+ * @param framework - UI framework whose bindings to document
115
+ * @returns The complete AGENTS.md file contents, terminated with a trailing newline
116
+ */
117
+ declare function generateAgentsMd(framework: AgentsFramework): string;
118
+
62
119
  /**
63
120
  * Generates TypeScript interfaces from a SchemaDefinition.
64
121
  * For each collection, produces three interfaces:
@@ -692,4 +749,4 @@ interface SyncProviderPresetOptions {
692
749
  */
693
750
  declare function applySyncProviderPreset(options: SyncProviderPresetOptions): Promise<void>;
694
751
 
695
- export { type AuthOption, type BuildArtifacts, ClackPromptClient, CliError, type ClientBuildOptions, type ClientBuildResult, type ContextAwareDeployAdapter, type CreateFlags, type CreatePreferences, DEPLOY_PLATFORMS, type DatabaseOption, type DatabaseProviderOption, type DeployAdapter, type DeployPlatform, type DeployResult, type DeployState, type DeployStateCreateInput, type DeployStatePatch, type DeploymentStatus, DevServerError, type DockerfileOptions, FlyAdapter, type FlyAdapterContext, type FlyAdapterOptions, type FlyCommandResult, type FlyCommandRunner, type FlyTomlOptions, type FrameworkOption, InvalidProjectError, type LogLine, type LogOptions, NodeFlyCommandRunner, NodeRailwayCommandRunner, PACKAGE_MANAGERS, type PackageManager, type PreferenceResolutionResult, PreferenceStore, type ProjectConfig, ProjectExistsError, type ProjectNameValidationResult, PromptCancelledError, type PromptClient, type ProvisionResult, RailwayAdapter, type RailwayAdapterContext, type RailwayAdapterOptions, type RailwayCommandResult, type RailwayCommandRunner, type RailwayJsonOptions, ReadlinePromptClient, SchemaNotFoundError, type SelectOption, type ServerBundleOptions, type ServerBundleResult, StubDeployAdapter, TEMPLATES, TEMPLATE_INFO, type TemplateContext, type TemplateInfo, type TemplateName, type TemplateSelectionInput, applySyncProviderPreset, buildClient, bundleServer, createDeployAdapter, createPromptClient, deployCommand, determineTemplateFromSelections, generateDeployPackageJson, generateDockerIgnore, generateDockerfile, generateFlyToml, generateRailwayJson, generateTypes, getCreatePreferencesOrDefault, getDefaultCreatePreferences, isAuthValue, isDatabaseProviderValue, isDatabaseValue, isDeployPlatform, isFrameworkValue, readDeployState, resetDeployState, resolveCreatePreferencesFlow, resolveDeployDirectory, resolveDeployStatePath, saveResolvedPreferences, shouldSavePreferences, updateDeployState, validateProjectName, writeDeployState, writeDockerIgnoreArtifact, writeDockerfileArtifact, writeFlyTomlArtifact, writeRailwayJsonArtifact };
752
+ export { AGENTS_FRAMEWORKS, type AgentsFramework, type AuthOption, type BuildArtifacts, ClackPromptClient, CliError, type ClientBuildOptions, type ClientBuildResult, type ContextAwareDeployAdapter, type CreateFlags, type CreatePreferences, DEPLOY_PLATFORMS, type DatabaseOption, type DatabaseProviderOption, type DeployAdapter, type DeployPlatform, type DeployResult, type DeployState, type DeployStateCreateInput, type DeployStatePatch, type DeploymentStatus, DevServerError, type DockerfileOptions, FlyAdapter, type FlyAdapterContext, type FlyAdapterOptions, type FlyCommandResult, type FlyCommandRunner, type FlyTomlOptions, type FrameworkOption, InvalidProjectError, type LogLine, type LogOptions, NodeFlyCommandRunner, NodeRailwayCommandRunner, PACKAGE_MANAGERS, type PackageManager, type PreferenceResolutionResult, PreferenceStore, type ProjectConfig, ProjectExistsError, type ProjectNameValidationResult, PromptCancelledError, type PromptClient, type ProvisionResult, RailwayAdapter, type RailwayAdapterContext, type RailwayAdapterOptions, type RailwayCommandResult, type RailwayCommandRunner, type RailwayJsonOptions, ReadlinePromptClient, SchemaNotFoundError, type SelectOption, type ServerBundleOptions, type ServerBundleResult, StubDeployAdapter, TEMPLATES, TEMPLATE_INFO, type TemplateContext, type TemplateInfo, type TemplateName, type TemplateSelectionInput, agentsCommand, applySyncProviderPreset, buildClient, bundleServer, createDeployAdapter, createPromptClient, deployCommand, detectFrameworkFromManifest, determineTemplateFromSelections, generateAgentsMd, generateDeployPackageJson, generateDockerIgnore, generateDockerfile, generateFlyToml, generateRailwayJson, generateTypes, getCreatePreferencesOrDefault, getDefaultCreatePreferences, isAgentsFramework, isAuthValue, isDatabaseProviderValue, isDatabaseValue, isDeployPlatform, isFrameworkValue, readDeployState, resetDeployState, resolveCreatePreferencesFlow, resolveDeployDirectory, resolveDeployStatePath, saveResolvedPreferences, shouldSavePreferences, updateDeployState, validateProjectName, writeDeployState, writeDockerIgnoreArtifact, writeDockerfileArtifact, writeFlyTomlArtifact, writeRailwayJsonArtifact };
package/dist/index.d.ts CHANGED
@@ -59,6 +59,63 @@ declare class DevServerError extends KoraError {
59
59
  constructor(binary: string, searchPath: string);
60
60
  }
61
61
 
62
+ /**
63
+ * Writes an AGENTS.md into an existing project so AI coding agents follow Kora
64
+ * conventions. Refuses to overwrite an existing file unless `--force` is passed.
65
+ */
66
+ declare const agentsCommand: citty.CommandDef<{
67
+ force: {
68
+ type: "boolean";
69
+ description: string;
70
+ default: false;
71
+ };
72
+ framework: {
73
+ type: "string";
74
+ description: string;
75
+ };
76
+ }>;
77
+
78
+ /**
79
+ * Canonical AGENTS.md generator.
80
+ *
81
+ * `kora agents-md` writes this file into an existing project so AI coding agents
82
+ * (and humans) build Kora apps correctly instead of drifting to fetch calls,
83
+ * hand-written types, and loading spinners. New projects scaffolded with
84
+ * `create-kora-app` already ship an AGENTS.md; this command covers the manual
85
+ * setup path and lets existing projects regenerate the guidance on demand.
86
+ */
87
+ /** UI framework whose bindings section the generated AGENTS.md documents. */
88
+ type AgentsFramework = 'react' | 'vue' | 'svelte';
89
+ /** All supported frameworks, for validation and help text. */
90
+ declare const AGENTS_FRAMEWORKS: readonly AgentsFramework[];
91
+ /**
92
+ * Narrows an arbitrary string to a supported {@link AgentsFramework}.
93
+ *
94
+ * @param value - Candidate framework identifier
95
+ * @returns `true` when `value` is one of the supported frameworks
96
+ */
97
+ declare function isAgentsFramework(value: string): value is AgentsFramework;
98
+ /**
99
+ * Detects the UI framework from a project's package manifest by looking for the
100
+ * matching `@korajs/*` binding package in dependencies or devDependencies.
101
+ *
102
+ * @param manifest - Parsed `package.json` contents
103
+ * @returns The detected framework, or `null` when no binding package is present
104
+ */
105
+ declare function detectFrameworkFromManifest(manifest: unknown): AgentsFramework | null;
106
+ /**
107
+ * Renders the full AGENTS.md document for the given framework.
108
+ *
109
+ * The body (golden rules, data API cheat sheet, conflict handling, sync notes,
110
+ * commands) is framework-agnostic; only the bindings section changes. File paths
111
+ * are described as conventions so the guidance is correct for both scaffolded and
112
+ * manually configured projects.
113
+ *
114
+ * @param framework - UI framework whose bindings to document
115
+ * @returns The complete AGENTS.md file contents, terminated with a trailing newline
116
+ */
117
+ declare function generateAgentsMd(framework: AgentsFramework): string;
118
+
62
119
  /**
63
120
  * Generates TypeScript interfaces from a SchemaDefinition.
64
121
  * For each collection, produces three interfaces:
@@ -692,4 +749,4 @@ interface SyncProviderPresetOptions {
692
749
  */
693
750
  declare function applySyncProviderPreset(options: SyncProviderPresetOptions): Promise<void>;
694
751
 
695
- export { type AuthOption, type BuildArtifacts, ClackPromptClient, CliError, type ClientBuildOptions, type ClientBuildResult, type ContextAwareDeployAdapter, type CreateFlags, type CreatePreferences, DEPLOY_PLATFORMS, type DatabaseOption, type DatabaseProviderOption, type DeployAdapter, type DeployPlatform, type DeployResult, type DeployState, type DeployStateCreateInput, type DeployStatePatch, type DeploymentStatus, DevServerError, type DockerfileOptions, FlyAdapter, type FlyAdapterContext, type FlyAdapterOptions, type FlyCommandResult, type FlyCommandRunner, type FlyTomlOptions, type FrameworkOption, InvalidProjectError, type LogLine, type LogOptions, NodeFlyCommandRunner, NodeRailwayCommandRunner, PACKAGE_MANAGERS, type PackageManager, type PreferenceResolutionResult, PreferenceStore, type ProjectConfig, ProjectExistsError, type ProjectNameValidationResult, PromptCancelledError, type PromptClient, type ProvisionResult, RailwayAdapter, type RailwayAdapterContext, type RailwayAdapterOptions, type RailwayCommandResult, type RailwayCommandRunner, type RailwayJsonOptions, ReadlinePromptClient, SchemaNotFoundError, type SelectOption, type ServerBundleOptions, type ServerBundleResult, StubDeployAdapter, TEMPLATES, TEMPLATE_INFO, type TemplateContext, type TemplateInfo, type TemplateName, type TemplateSelectionInput, applySyncProviderPreset, buildClient, bundleServer, createDeployAdapter, createPromptClient, deployCommand, determineTemplateFromSelections, generateDeployPackageJson, generateDockerIgnore, generateDockerfile, generateFlyToml, generateRailwayJson, generateTypes, getCreatePreferencesOrDefault, getDefaultCreatePreferences, isAuthValue, isDatabaseProviderValue, isDatabaseValue, isDeployPlatform, isFrameworkValue, readDeployState, resetDeployState, resolveCreatePreferencesFlow, resolveDeployDirectory, resolveDeployStatePath, saveResolvedPreferences, shouldSavePreferences, updateDeployState, validateProjectName, writeDeployState, writeDockerIgnoreArtifact, writeDockerfileArtifact, writeFlyTomlArtifact, writeRailwayJsonArtifact };
752
+ export { AGENTS_FRAMEWORKS, type AgentsFramework, type AuthOption, type BuildArtifacts, ClackPromptClient, CliError, type ClientBuildOptions, type ClientBuildResult, type ContextAwareDeployAdapter, type CreateFlags, type CreatePreferences, DEPLOY_PLATFORMS, type DatabaseOption, type DatabaseProviderOption, type DeployAdapter, type DeployPlatform, type DeployResult, type DeployState, type DeployStateCreateInput, type DeployStatePatch, type DeploymentStatus, DevServerError, type DockerfileOptions, FlyAdapter, type FlyAdapterContext, type FlyAdapterOptions, type FlyCommandResult, type FlyCommandRunner, type FlyTomlOptions, type FrameworkOption, InvalidProjectError, type LogLine, type LogOptions, NodeFlyCommandRunner, NodeRailwayCommandRunner, PACKAGE_MANAGERS, type PackageManager, type PreferenceResolutionResult, PreferenceStore, type ProjectConfig, ProjectExistsError, type ProjectNameValidationResult, PromptCancelledError, type PromptClient, type ProvisionResult, RailwayAdapter, type RailwayAdapterContext, type RailwayAdapterOptions, type RailwayCommandResult, type RailwayCommandRunner, type RailwayJsonOptions, ReadlinePromptClient, SchemaNotFoundError, type SelectOption, type ServerBundleOptions, type ServerBundleResult, StubDeployAdapter, TEMPLATES, TEMPLATE_INFO, type TemplateContext, type TemplateInfo, type TemplateName, type TemplateSelectionInput, agentsCommand, applySyncProviderPreset, buildClient, bundleServer, createDeployAdapter, createPromptClient, deployCommand, detectFrameworkFromManifest, determineTemplateFromSelections, generateAgentsMd, generateDeployPackageJson, generateDockerIgnore, generateDockerfile, generateFlyToml, generateRailwayJson, generateTypes, getCreatePreferencesOrDefault, getDefaultCreatePreferences, isAgentsFramework, isAuthValue, isDatabaseProviderValue, isDatabaseValue, isDeployPlatform, isFrameworkValue, readDeployState, resetDeployState, resolveCreatePreferencesFlow, resolveDeployDirectory, resolveDeployStatePath, saveResolvedPreferences, shouldSavePreferences, updateDeployState, validateProjectName, writeDeployState, writeDockerIgnoreArtifact, writeDockerfileArtifact, writeFlyTomlArtifact, writeRailwayJsonArtifact };
package/dist/index.js CHANGED
@@ -1,21 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ AGENTS_FRAMEWORKS,
3
4
  DEPLOY_PLATFORMS,
4
5
  FlyAdapter,
5
6
  NodeFlyCommandRunner,
6
7
  NodeRailwayCommandRunner,
7
8
  RailwayAdapter,
8
9
  StubDeployAdapter,
10
+ agentsCommand,
9
11
  buildClient,
10
12
  bundleServer,
11
13
  createDeployAdapter,
12
14
  deployCommand,
15
+ detectFrameworkFromManifest,
16
+ generateAgentsMd,
13
17
  generateDeployPackageJson,
14
18
  generateDockerIgnore,
15
19
  generateDockerfile,
16
20
  generateFlyToml,
17
21
  generateRailwayJson,
18
22
  generateTypes,
23
+ isAgentsFramework,
19
24
  isDeployPlatform,
20
25
  readDeployState,
21
26
  resetDeployState,
@@ -27,7 +32,7 @@ import {
27
32
  writeDockerfileArtifact,
28
33
  writeFlyTomlArtifact,
29
34
  writeRailwayJsonArtifact
30
- } from "./chunk-EOWLAAIV.js";
35
+ } from "./chunk-4IKCHRJ6.js";
31
36
  import {
32
37
  ClackPromptClient,
33
38
  CliError,
@@ -54,9 +59,10 @@ import {
54
59
  saveResolvedPreferences,
55
60
  shouldSavePreferences,
56
61
  validateProjectName
57
- } from "./chunk-B5YS4STN.js";
62
+ } from "./chunk-G2PBYMMA.js";
58
63
  import "./chunk-5NI2FEQL.js";
59
64
  export {
65
+ AGENTS_FRAMEWORKS,
60
66
  ClackPromptClient,
61
67
  CliError,
62
68
  DEPLOY_PLATFORMS,
@@ -75,13 +81,16 @@ export {
75
81
  StubDeployAdapter,
76
82
  TEMPLATES,
77
83
  TEMPLATE_INFO,
84
+ agentsCommand,
78
85
  applySyncProviderPreset,
79
86
  buildClient,
80
87
  bundleServer,
81
88
  createDeployAdapter,
82
89
  createPromptClient,
83
90
  deployCommand,
91
+ detectFrameworkFromManifest,
84
92
  determineTemplateFromSelections,
93
+ generateAgentsMd,
85
94
  generateDeployPackageJson,
86
95
  generateDockerIgnore,
87
96
  generateDockerfile,
@@ -90,6 +99,7 @@ export {
90
99
  generateTypes,
91
100
  getCreatePreferencesOrDefault,
92
101
  getDefaultCreatePreferences,
102
+ isAgentsFramework,
93
103
  isAuthValue,
94
104
  isDatabaseProviderValue,
95
105
  isDatabaseValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korajs/cli",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "Kora.js CLI tooling and project scaffolding",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -37,7 +37,7 @@
37
37
  "conf": "^15.1.0",
38
38
  "esbuild": "^0.28.0",
39
39
  "validate-npm-package-name": "^7.0.2",
40
- "@korajs/core": "1.0.0-beta.1"
40
+ "@korajs/core": "1.0.0-beta.4"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/better-sqlite3": "^7.6.13",
@@ -47,12 +47,12 @@
47
47
  "tsup": "^8.3.6",
48
48
  "typescript": "^5.7.3",
49
49
  "vitest": "^3.0.4",
50
- "@korajs/store": "1.0.0-beta.1",
51
- "@korajs/server": "1.0.0-beta.1",
52
- "@korajs/merge": "1.0.0-beta.1",
53
- "korajs": "1.0.0-beta.1",
54
- "@korajs/sync": "1.0.0-beta.1",
55
- "@korajs/test": "1.0.0-beta.1"
50
+ "@korajs/server": "1.0.0-beta.4",
51
+ "@korajs/store": "1.0.0-beta.4",
52
+ "@korajs/sync": "1.0.0-beta.4",
53
+ "@korajs/merge": "1.0.0-beta.4",
54
+ "korajs": "1.0.0-beta.4",
55
+ "@korajs/test": "1.0.0-beta.4"
56
56
  },
57
57
  "license": "MIT",
58
58
  "scripts": {