@happyvertical/smrt-cli 0.55.9 → 0.55.11

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 (67) hide show
  1. package/AGENTS.md +11 -19
  2. package/README.md +4 -0
  3. package/agents/cookbook-apply.md +65 -0
  4. package/agents/kitchen.md +111 -0
  5. package/agents/process-fixture-isolation.md +29 -0
  6. package/cookbooks/bakery.cookbook.json +187 -0
  7. package/cookbooks/mechanic.cookbook.json +191 -0
  8. package/cookbooks/welder.cookbook.json +177 -0
  9. package/cookbooks/yoga-studio.cookbook.json +173 -0
  10. package/dist/{AuditLogCollection-WDHL-_AF-HQQINXuT.js → AuditLogCollection-WDHL-_AF-ClQNu_VR.js} +1 -1
  11. package/dist/{OidcIdentity-BUblgQLs-B3dRU6nj.js → OidcIdentity-BUblgQLs-br8RyLkA.js} +2 -2
  12. package/dist/{OidcIdentityCollection-ClOyaHeF-C7-jxx9o.js → OidcIdentityCollection-ClOyaHeF-BpQXB3mz.js} +1 -1
  13. package/dist/{ProfileAssetCollection-CRMcjLJ--CQ4QjtjK.js → ProfileAssetCollection-CRMcjLJ--C5ytBKfF.js} +3 -3
  14. package/dist/{ProfileCollection-C4INKh7Y-C22q_JqL.js → ProfileCollection-C4INKh7Y-CfkyJilm.js} +17 -17
  15. package/dist/{ProfileLinkCollection-DFfZRsgv-BsRRI9lh.js → ProfileLinkCollection-DFfZRsgv-MQ2zhD9z.js} +2 -2
  16. package/dist/{ProfileMetadataCollection-BIYKy4Y3-C6hpFkOa.js → ProfileMetadataCollection-BIYKy4Y3-DXu5L2yx.js} +1 -1
  17. package/dist/{ProfileMetafieldCollection-Buz7gzag-BLXQjqBG.js → ProfileMetafieldCollection-Buz7gzag-C2tZc1PF.js} +1 -1
  18. package/dist/{ProfileRelationshipCollection-C4g_QLI4-DNywujKX.js → ProfileRelationshipCollection-C4g_QLI4-vTnkAIAh.js} +1 -1
  19. package/dist/{ProfileTypeCollection-B7kwi1mU-DPXH67Rh.js → ProfileTypeCollection-B7kwi1mU-KwPGcUkI.js} +2 -2
  20. package/dist/apply-BNDIdixP.js +947 -0
  21. package/dist/cli-generator.d.ts.map +1 -1
  22. package/dist/commands/cookbook/apply.d.ts +102 -0
  23. package/dist/commands/cookbook/apply.d.ts.map +1 -0
  24. package/dist/commands/cookbook/recipe-index.d.ts +108 -0
  25. package/dist/commands/cookbook/recipe-index.d.ts.map +1 -0
  26. package/dist/commands/cookbook/registry.d.ts +69 -0
  27. package/dist/commands/cookbook/registry.d.ts.map +1 -0
  28. package/dist/commands/cookbook/shared.d.ts +23 -0
  29. package/dist/commands/cookbook/shared.d.ts.map +1 -0
  30. package/dist/commands/cookbook/validate.d.ts +25 -0
  31. package/dist/commands/cookbook/validate.d.ts.map +1 -0
  32. package/dist/commands/cookbook.d.ts +6 -0
  33. package/dist/commands/cookbook.d.ts.map +1 -0
  34. package/dist/commands/index.d.ts +2 -0
  35. package/dist/commands/index.d.ts.map +1 -1
  36. package/dist/commands/kitchen/ai.d.ts +34 -0
  37. package/dist/commands/kitchen/ai.d.ts.map +1 -0
  38. package/dist/commands/kitchen/apply.d.ts +52 -0
  39. package/dist/commands/kitchen/apply.d.ts.map +1 -0
  40. package/dist/commands/kitchen/mcp/catalog.d.ts +39 -0
  41. package/dist/commands/kitchen/mcp/catalog.d.ts.map +1 -0
  42. package/dist/commands/kitchen/mcp/server.d.ts +15 -0
  43. package/dist/commands/kitchen/mcp/server.d.ts.map +1 -0
  44. package/dist/commands/kitchen/mcp/tools.d.ts +68 -0
  45. package/dist/commands/kitchen/mcp/tools.d.ts.map +1 -0
  46. package/dist/commands/kitchen/planner.d.ts +71 -0
  47. package/dist/commands/kitchen/planner.d.ts.map +1 -0
  48. package/dist/commands/kitchen/run.d.ts +40 -0
  49. package/dist/commands/kitchen/run.d.ts.map +1 -0
  50. package/dist/commands/kitchen/server.d.ts +39 -0
  51. package/dist/commands/kitchen/server.d.ts.map +1 -0
  52. package/dist/commands/kitchen.d.ts +7 -0
  53. package/dist/commands/kitchen.d.ts.map +1 -0
  54. package/dist/{commands-NBDTnB3h.js → commands-pbRVQvix.js} +759 -9
  55. package/dist/dist-BsRSQ_hE.js +4117 -0
  56. package/dist/{dist-DuVZ0o9F.js → dist-CYVIKmvy.js} +4 -4
  57. package/dist/dist-D_WqjwkC.js +21 -0
  58. package/dist/{dist-FZLsgj__.js → dist-DxkSjKQQ.js} +2 -2
  59. package/dist/dist-ffh0LeC4.js +1788 -0
  60. package/dist/index.js +44 -16
  61. package/dist/{oidcProvisioningPrimitives-DNP9EZlU-CbUV0zfC.js → oidcProvisioningPrimitives-DNP9EZlU-CBYwksp0.js} +3 -3
  62. package/dist/{resolveIdentity-CkyqvctR-qw-nqxJ3.js → resolveIdentity-CkyqvctR-B5btFsQd.js} +14 -14
  63. package/dist/server-Dp096tZj.js +898 -0
  64. package/package.json +13 -10
  65. package/dist/dist-B-kbXFDM.js +0 -4113
  66. package/dist/dist-BKuPI8_N.js +0 -1788
  67. package/dist/dist-DqmJkgkG.js +0 -21
@@ -1 +1 @@
1
- {"version":3,"file":"cli-generator.d.ts","sourceRoot":"","sources":["../src/cli-generator.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAiBH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,sBAAsB,CAAC;AA2G9B,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;;;OAIG;IACH,EAAE,CAAC,EAAE,OAAO,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,OAAO,CAAC,eAAe;IAiBvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAiCrB;;OAEG;YACW,MAAM;IAcpB;;OAEG;YACW,OAAO;IAKrB;;OAEG;YACW,UAAU;IA4CxB;;OAEG;YACW,SAAS;IAiCvB;;OAEG;YACW,YAAY;IA8C1B;;OAEG;YACW,YAAY;IA6D1B;;OAEG;YACW,YAAY;IAyC1B;;OAEG;YACW,kBAAkB;IA8HhC;;;OAGG;YACW,qBAAqB;IAyOnC;;;OAGG;YACW,aAAa;IA+D3B;;OAEG;YACW,eAAe;IAiC7B;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,YAAY;IAuBpB;;OAEG;IACH,OAAO,CAAC,YAAY;CAqBrB;AAGD,wBAAsB,IAAI,kBAuGzB"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * `smrt cookbook apply` engine (#3748): create or update a project from a
3
+ * validated cookbook. Writes configuration only (package.json dependencies,
4
+ * `smrt.cookbook.json`, and the project name for a new project); never sample
5
+ * data and never anything else in the project.
6
+ */
7
+ import type { Cookbook } from '@happyvertical/smrt-types';
8
+ export declare const COOKBOOK_CONFIG_FILE = "smrt.cookbook.json";
9
+ export declare const DEFAULT_TEMPLATE = "github:happyvertical/smrt-start";
10
+ interface PackageJson {
11
+ name?: string;
12
+ [key: string]: unknown;
13
+ }
14
+ export interface ApplyOptions {
15
+ cookbook: Cookbook;
16
+ /** Packages the cookbook's recipes, features and policies need. */
17
+ packages: string[];
18
+ /** Target directory (new project) or project directory (`into`). */
19
+ dir?: string;
20
+ into?: boolean;
21
+ /** Local path, `github:owner/repo[#ref]`, or a git URL. */
22
+ template?: string;
23
+ dryRun?: boolean;
24
+ install?: boolean;
25
+ /**
26
+ * Where the package manager's output goes. `inherit` (default) uses this
27
+ * process's stdout; `stderr` keeps stdout free for a protocol (the MCP
28
+ * stdio server). Stdin is never shared with the install in `stderr` mode.
29
+ */
30
+ installOutput?: 'inherit' | 'stderr';
31
+ /** Version of the CLI, the last-resort dependency range. */
32
+ cliVersion: string;
33
+ cwd?: string;
34
+ }
35
+ export interface ApplyPlan {
36
+ mode: 'new' | 'update';
37
+ targetDir: string;
38
+ template?: {
39
+ spec: string;
40
+ revision?: string;
41
+ };
42
+ projectName?: string;
43
+ /** Dependencies added to package.json. */
44
+ addDependencies: Record<string, string>;
45
+ /** Needed packages already declared (left exactly as they are). */
46
+ keptDependencies: Record<string, string>;
47
+ config: 'create' | 'update' | 'unchanged';
48
+ }
49
+ export interface ApplyResult {
50
+ plan: ApplyPlan;
51
+ dryRun: boolean;
52
+ written: string[];
53
+ installed: boolean;
54
+ nextSteps: string[];
55
+ }
56
+ export declare class ApplyError extends Error {
57
+ }
58
+ /**
59
+ * Range for packages the project does not declare yet: the framework line the
60
+ * project already uses (smrt packages release as one fixed group), else this
61
+ * CLI's own release line.
62
+ */
63
+ export declare function chooseRange(json: PackageJson, cliVersion: string): string;
64
+ /** A valid unscoped npm package name from free text, or undefined when nothing usable remains. */
65
+ export declare function npmNameFromText(value: string): string | undefined;
66
+ /** Parse `github:owner/repo#ref`, a git URL, or a local path. */
67
+ export declare function parseTemplateSpec(spec: string): {
68
+ kind: 'local';
69
+ path: string;
70
+ } | {
71
+ kind: 'git';
72
+ url: string;
73
+ ref?: string;
74
+ };
75
+ interface AcquiredTemplate {
76
+ root: string;
77
+ revision?: string;
78
+ /**
79
+ * Paths (relative to `root`) to copy, when the template is a local git
80
+ * checkout: tracked plus untracked-but-not-ignored files. Undefined means
81
+ * copy everything except `.git` and `node_modules`.
82
+ */
83
+ files?: string[];
84
+ cleanup(): void;
85
+ }
86
+ /**
87
+ * Files a local git checkout contributes to a new project: everything tracked
88
+ * plus untracked files that are not git-ignored (`git ls-files -co
89
+ * --exclude-standard`). A working checkout carries git-ignored generated
90
+ * output (build products, a stale `src/routes/api/notes`) that must not leak
91
+ * into a new project, while uncommitted edits to the template still apply, so
92
+ * `git archive HEAD` (which would drop them) is not used. Returns undefined
93
+ * when `dir` is not inside a git work tree or git is unavailable.
94
+ */
95
+ export declare function listLocalTemplateFiles(dir: string): string[] | undefined;
96
+ /** Resolve a template to a directory: a local path as-is, a git source shallow-fetched. */
97
+ export declare function acquireTemplate(spec: string): AcquiredTemplate;
98
+ export declare function nextSteps(dir: string, json: PackageJson, installed: boolean, cwd: string): string[];
99
+ /** Plan and (unless dry-run) perform the apply. */
100
+ export declare function applyCookbook(options: ApplyOptions): ApplyResult;
101
+ export {};
102
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/apply.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AACzD,eAAO,MAAM,gBAAgB,oCAAoC,CAAC;AAWlE,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACrC,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,KAAK,GAAG,QAAQ,CAAC;IACvB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ACjB;AAaD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAgBxE;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAsC9D;AAgBD,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAgBV;AAkCD,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CA+JhE"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Recipe index for `smrt cookbook validate|apply` (#3748).
3
+ *
4
+ * Source of truth: each package's published manifest (its
5
+ * `./manifest` export; `dist/manifest.json` or `dist/lib/manifest.json`), which carries `recipes[]` and the `objects` the
6
+ * cookbook's policies and features point at. Manifests are read from, in
7
+ * order: explicit `--manifests` paths, the SMRT workspace around the working
8
+ * directory, the project's `node_modules`, and finally (opt-out with
9
+ * `--no-registry`) the npm registry for packages that are not installed yet.
10
+ */
11
+ import { type RegistryOptions } from './registry.js';
12
+ export { type FetchLike, type RegistryOptions, registryForPackage, } from './registry.js';
13
+ export declare const SMRT_SCOPE = "@happyvertical";
14
+ /** One recipe, with the facts validation and apply need. */
15
+ export interface RecipeIndexEntry {
16
+ id: string;
17
+ packageName: string;
18
+ packageVersion?: string;
19
+ requires: string[];
20
+ requiresAny: string[][];
21
+ models: string[];
22
+ /** The recipe declares model/field curation options. */
23
+ hasOptions: boolean;
24
+ /** The recipe carries demo seed data (never applied by cookbook apply). */
25
+ hasDemoSeed: boolean;
26
+ }
27
+ /** One package's manifest facts. */
28
+ export interface PackageIndexEntry {
29
+ packageName: string;
30
+ packageVersion?: string;
31
+ /** Where it was read from, for diagnostics. */
32
+ source: string;
33
+ /** Qualified object name to its field names. */
34
+ objects: Map<string, Set<string>>;
35
+ /** The manifest as read, for callers that need more than the index keeps. */
36
+ manifest: ManifestLike;
37
+ }
38
+ export interface RecipeIndex {
39
+ recipes: Map<string, RecipeIndexEntry>;
40
+ packages: Map<string, PackageIndexEntry>;
41
+ /** Packages a registry or manifest lookup was tried for and not found. */
42
+ missing: Set<string>;
43
+ }
44
+ export declare function createRecipeIndex(): RecipeIndex;
45
+ export interface ManifestLike {
46
+ packageName?: string;
47
+ packageVersion?: string;
48
+ objects?: Record<string, {
49
+ fields?: Record<string, unknown> | unknown[];
50
+ }>;
51
+ recipes?: Array<{
52
+ id?: string;
53
+ requires?: string[];
54
+ requiresAny?: string[][];
55
+ models?: string[];
56
+ options?: Record<string, unknown>;
57
+ demoSeed?: unknown;
58
+ }>;
59
+ }
60
+ /** Add one parsed manifest to the index. Returns false when it names no package. */
61
+ export declare function addManifest(index: RecipeIndex, manifest: ManifestLike, source: string): boolean;
62
+ /**
63
+ * A package directory's manifest file: its `exports['./manifest']` (or
64
+ * `./manifest.json`) target, else the known locations. SvelteKit-library
65
+ * packages publish at `dist/lib/manifest.json`, not `dist/manifest.json`.
66
+ */
67
+ export declare function manifestPathForPackageDir(dir: string): string | null;
68
+ /**
69
+ * Read manifests from a path: a manifest file, a directory of `*.json`
70
+ * manifests, or a directory of package directories (`<pkg>/dist/manifest.json`
71
+ * or `<pkg>/manifest.json`).
72
+ */
73
+ export declare function loadManifestPath(index: RecipeIndex, path: string, warn?: (message: string) => void): void;
74
+ /** Walk up from `start` for the SMRT monorepo root (`packages/*` + workspace file). */
75
+ export declare function findSmrtWorkspace(start: string): string | null;
76
+ /** Load workspace and installed manifests visible from `dir`. */
77
+ export declare function loadLocalManifests(index: RecipeIndex, dir: string, warn?: (message: string) => void): void;
78
+ /** The package that conventionally owns a recipe id (`commerce.sales` -> smrt-commerce). */
79
+ export declare function candidatePackageForRecipe(id: string): string;
80
+ /** The package a qualified object (`@scope/pkg:Class`) belongs to, if qualified. */
81
+ export declare function packageOfQualifiedName(ref: string): string | null;
82
+ /**
83
+ * Fetch a package's manifest from the registry that owns its scope, without
84
+ * installing it. Returns false when the package or its manifest is missing.
85
+ */
86
+ export declare function loadRegistryManifest(index: RecipeIndex, packageName: string, options?: RegistryOptions): Promise<boolean>;
87
+ /** What a cookbook needs resolved, for the registry-fill loop. */
88
+ export declare function neededPackages(index: RecipeIndex, cookbook: {
89
+ recipes?: string[];
90
+ features?: string[];
91
+ policies?: Array<{
92
+ objectRef?: string;
93
+ }>;
94
+ }): string[];
95
+ export interface ResolveOptions {
96
+ /** Project (or working) directory to look for installed manifests from. */
97
+ dir: string;
98
+ manifests?: string[];
99
+ registry?: boolean;
100
+ registryOptions?: RegistryOptions;
101
+ warn?: (message: string) => void;
102
+ }
103
+ /**
104
+ * Build the index a cookbook needs: local sources first, then the registry
105
+ * for packages still unresolved, repeating until no new package appears.
106
+ */
107
+ export declare function resolveRecipeIndex(cookbook: Parameters<typeof neededPackages>[1], options: ResolveOptions): Promise<RecipeIndex>;
108
+ //# sourceMappingURL=recipe-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipe-index.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/recipe-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAG3C,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,wDAAwD;IACxD,UAAU,EA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AC7B,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,EAC9C,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,WAAW,CAAC,CAoBtB"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * npm registry access shared by the cookbook recipe index (#3748) and
3
+ * `smrt kitchen` (#3750): which registry owns a package's scope (the way npm
4
+ * and pnpm pick it, auth token included), and fetching and extracting a
5
+ * package tarball without installing it.
6
+ */
7
+ export type FetchLike = (url: string, init?: {
8
+ headers?: Record<string, string>;
9
+ }) => Promise<{
10
+ ok: boolean;
11
+ status: number;
12
+ json(): Promise<unknown>;
13
+ arrayBuffer(): Promise<ArrayBuffer>;
14
+ }>;
15
+ export interface RegistryOptions {
16
+ /** Force one registry for every package (tests, mirrors). */
17
+ registryUrl?: string;
18
+ /** Directory whose `.npmrc` chain is consulted. */
19
+ dir?: string;
20
+ /** Exact version to try first (the framework line); falls back to latest. */
21
+ versionHint?: string;
22
+ fetchImpl?: FetchLike;
23
+ }
24
+ /**
25
+ * The registry for a package, the way npm and pnpm pick it: the scope's
26
+ * `@scope:registry` (`.npmrc` chain, then `npm config`), then
27
+ * `npm_config_registry`, then an unscoped `registry=`, then npmjs.
28
+ * Also returns an auth token configured for that registry's host.
29
+ */
30
+ export declare function registryForPackage(packageName: string, dir?: string): {
31
+ url: string;
32
+ token?: string;
33
+ };
34
+ /** A package this CLI may fetch from a registry without installing it. */
35
+ export declare const SMRT_PACKAGE_NAME: RegExp;
36
+ /** The most a package tarball may weigh (the planner is about 70 MB). */
37
+ export declare const MAX_TARBALL_BYTES: number;
38
+ export interface PackageLookup {
39
+ /** The version the registry resolved. */
40
+ version?: string;
41
+ /** Registry the package came from. */
42
+ registry: string;
43
+ tarballUrl: string;
44
+ /** Sent with the tarball request: empty unless it is on the registry's origin. */
45
+ headers: Record<string, string>;
46
+ /** The registry's `dist.integrity` (`sha512-<base64>`), checked on download. */
47
+ integrity?: string;
48
+ }
49
+ export interface PackageTarball {
50
+ version?: string;
51
+ registry: string;
52
+ data: ArrayBuffer;
53
+ }
54
+ /**
55
+ * Ask the registry that owns a package's scope which version to use, without
56
+ * downloading anything. Tries `versionHint` first (when given), then `latest`.
57
+ * Returns null when the package or version is unavailable.
58
+ */
59
+ export declare function lookupPackage(packageName: string, options?: RegistryOptions): Promise<PackageLookup | null>;
60
+ /** Download the tarball a {@link lookupPackage} found. Null when unavailable. */
61
+ export declare function downloadPackage(found: PackageLookup, fetchImpl?: FetchLike): Promise<PackageTarball | null>;
62
+ /** Look a package up and download its tarball. Null when unavailable. */
63
+ export declare function fetchPackageTarball(packageName: string, options?: RegistryOptions): Promise<PackageTarball | null>;
64
+ /**
65
+ * Extract a tarball into `cwd` (entries keep their `package/` prefix). A
66
+ * `filter` limits which entries are written.
67
+ */
68
+ export declare function extractTarball(data: ArrayBuffer, cwd: string, filter?: (path: string) => boolean): Promise<void>;
69
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,MAAM,SAAS,GAAG,CACtB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,KACxC,OAAO,CAAC;IACX,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,IAAI,OAAO,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OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAkBhC;AAED,yEAAyE;AACzE,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAGhC;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Pieces of `smrt cookbook` that `smrt kitchen` (#3750) reuses: reading a
3
+ * cookbook source, validating it against the recipe index, and printing an
4
+ * apply result.
5
+ */
6
+ import { type ApplyResult } from './apply.js';
7
+ import { type CookbookReport } from './validate.js';
8
+ /** Version of this CLI: the last-resort range for packages a cookbook adds. */
9
+ export declare function cliVersion(): string;
10
+ /** Cookbook text from a file path or an http(s) URL. */
11
+ export declare function readCookbookSource(source: string): Promise<string>;
12
+ export declare const asList: (value: string[] | string | undefined) => string[];
13
+ export interface ValidateSourceOptions {
14
+ /** Project directory manifests are looked up from. */
15
+ dir: string;
16
+ manifests?: string[];
17
+ registry?: boolean;
18
+ }
19
+ /** Validate cookbook text structurally and against the resolved recipe index. */
20
+ export declare function validateCookbookSource(text: string, options: ValidateSourceOptions): Promise<CookbookReport>;
21
+ /** Print what an apply did (or, for a dry run, would do) and the next steps. */
22
+ export declare function printApplyResult(result: ApplyResult, warnings: string[], log?: (line: string) => void, warn?: (line: string) => void): void;
23
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,eAAe,CAAC;AAEvB,+EAA+E;AAC/E,wBAAgB,UAAU,IAAI,MAAM,CAiBnC;AAKD,wDAAwD;AACxD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBxE;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,KAAG,MAAM,EACD,CAAC;AAEpE,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,iFAAiF;AACjF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,cAAc,CAAC,CAWzB;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,EAAE,EAClB,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAkB,EACzC,IAAI,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAmB,GAC1C,IAAI,CAqBN"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Cookbook validation against the recipe index (#3748): the structural check
3
+ * lives in core (`validateCookbook`); this adds what needs manifests.
4
+ */
5
+ import type { Cookbook } from '@happyvertical/smrt-types';
6
+ import { type RecipeIndex } from './recipe-index.js';
7
+ export interface CookbookReport {
8
+ ok: boolean;
9
+ errors: string[];
10
+ warnings: string[];
11
+ cookbook?: Cookbook;
12
+ /** Packages the cookbook's recipes, features and policies need. */
13
+ packages: string[];
14
+ }
15
+ /** Validate cookbook text structurally and against the recipe index. */
16
+ export declare function validateCookbookText(text: string, index: RecipeIndex): CookbookReport;
17
+ /** Cookbook shape needed to plan resolution before validation. */
18
+ export declare function parseForResolution(text: string): {
19
+ recipes: string[];
20
+ features: string[];
21
+ policies: Array<{
22
+ objectRef?: string;
23
+ }>;
24
+ };
25
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/validate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAOD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,WAAW,GACjB,cAAc,CAkFhB;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG;IAChD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzC,CAoBA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `smrt cookbook validate|apply` (#3748). See `agents/cookbook.md`.
3
+ */
4
+ import type { CLICommand } from '../cli-generator.js';
5
+ export declare const cookbookCommands: Record<string, CLICommand>;
6
+ //# sourceMappingURL=cookbook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookbook.d.ts","sourceRoot":"","sources":["../../src/commands/cookbook.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAiFtD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAiGvD,CAAC"}
@@ -2,6 +2,7 @@
2
2
  * CLI Commands - Export all command modules
3
3
  */
4
4
  export { configExportCommand } from './config-export.js';
5
+ export { cookbookCommands } from './cookbook.js';
5
6
  export { dbDiffCommand } from './db-diff.js';
6
7
  export { dbGenerateCommand } from './db-generate.js';
7
8
  export { dbHistoryCommand } from './db-history.js';
@@ -17,6 +18,7 @@ export { generateCommands } from './generate.js';
17
18
  export { gitCommands } from './git.js';
18
19
  export { gnodeCommands } from './gnode.js';
19
20
  export { initCommands } from './init.js';
21
+ export { kitchenCommands } from './kitchen.js';
20
22
  export { mcpAppsCommands } from './mcp-apps-packaging.js';
21
23
  export { playgroundCommands } from './playground.js';
22
24
  export { utilityCommands } from './utilities.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,a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AAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The language model behind `smrt kitchen`'s chat endpoint (#3750): the
3
+ * user's configured `@happyvertical/ai` provider, resolved the way the rest of
4
+ * s-m-r-t resolves it (the `ai` block of `smrt.config.ts`, then `SMRT_AI_*`,
5
+ * then the provider's own key variable such as `OPENAI_API_KEY`).
6
+ */
7
+ import { type ResolveAIProviderOptions, toAIClientOptions } from '@happyvertical/smrt-config';
8
+ export interface ChatMessage {
9
+ role: 'system' | 'user' | 'assistant';
10
+ content: string;
11
+ }
12
+ /** What the chat endpoint needs from a model. */
13
+ export interface KitchenAI {
14
+ /** For the terminal: provider and model, never a key. */
15
+ label: string;
16
+ chat(messages: ChatMessage[]): Promise<string>;
17
+ }
18
+ export interface ResolveAIOptions {
19
+ /** Where to look for `smrt.config.*` (default: the target dir, else the cwd). */
20
+ dir?: string;
21
+ env?: ResolveAIProviderOptions['env'];
22
+ /** Build the client; tests pass a stub, the default is `getAI`. */
23
+ createClient?: (options: ReturnType<typeof toAIClientOptions>) => Promise<{
24
+ chat(messages: ChatMessage[], options?: Record<string, unknown>): Promise<{
25
+ content: string;
26
+ }>;
27
+ }>;
28
+ }
29
+ /**
30
+ * The configured model, or null when no provider is configured (the kitchen
31
+ * then runs the planner's in-browser model instead).
32
+ */
33
+ export declare function resolveKitchenAI(options?: ResolveAIOptions): Promise<KitchenAI | null>;
34
+ //# sourceMappingURL=ai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../../src/commands/kitchen/ai.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAEL,KAAK,wBAAwB,EAC7B,iBAAiB,EAElB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,iDAAiD;AACjD,MAAM,WAAW,SAAS;IACxB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACtC,mEAAmE;IACnE,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,KAAK,OAAO,CAAC;QACxE,IAAI,CACF,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACjC,CAAC,CAAC;CACJ;AAWD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAsB3B"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Applying a cookbook the page sent to `smrt kitchen` (#3750): the same
3
+ * validation and apply engine as `smrt cookbook apply`, wrapped as one call
4
+ * that returns the HTTP-shaped outcome the planner shows to the visitor.
5
+ */
6
+ import { type ApplyResult } from '../cookbook/apply.js';
7
+ import type { RecipeIndex } from '../cookbook/recipe-index.js';
8
+ export interface ApplierOptions {
9
+ /** The project directory (`smrt kitchen [dir]`). */
10
+ dir: string;
11
+ /** Project template (local path, `github:owner/repo[#ref]`, git URL). */
12
+ template?: string;
13
+ /** Run the package manager's install after writing. */
14
+ install: boolean;
15
+ /** Where the install's output goes (`stderr` keeps stdout for a protocol). */
16
+ installOutput?: 'inherit' | 'stderr';
17
+ /** Plan only: write nothing (a remote template is still fetched to a temp dir). */
18
+ dryRun?: boolean;
19
+ manifests?: string[];
20
+ /**
21
+ * Validate against this already-resolved index instead of looking manifests
22
+ * up again from `dir` (a new project has none there). `manifests` and
23
+ * `registry` are then unused.
24
+ */
25
+ index?: RecipeIndex;
26
+ /** Allow fetching manifests of uninstalled packages from the registry. */
27
+ registry: boolean;
28
+ /** Where progress goes (the terminal). */
29
+ log?: (line: string) => void;
30
+ }
31
+ /** Body of a successful `POST /api/kitchen/cookbook`. */
32
+ export interface AppliedBody {
33
+ ok: true;
34
+ dir: string;
35
+ mode: 'new' | 'update';
36
+ installed: boolean;
37
+ added: string[];
38
+ nextSteps: string[];
39
+ }
40
+ export type ApplyOutcome = {
41
+ ok: true;
42
+ status: 200;
43
+ body: AppliedBody;
44
+ result: ApplyResult;
45
+ } | {
46
+ ok: false;
47
+ status: number;
48
+ errors: string[];
49
+ };
50
+ export type CookbookApplier = (text: string) => Promise<ApplyOutcome>;
51
+ export declare function createCookbookApplier(options: ApplierOptions): CookbookApplier;
52
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/commands/kitchen/apply.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D,MAAM,WAAW,cAAc;IAC7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* each package declares, the models its objects declare, and the library of
4
+ * ready-made cookbooks. Nothing here is invented; a package that cannot be
5
+ * found contributes nothing and is reported.
6
+ */
7
+ import type { EngineCatalog, EngineLibraryCookbook } from '@happyvertical/smrt-core/cookbook/engine';
8
+ import { type RecipeIndex } from '../../cookbook/recipe-index.js';
9
+ /** `@happyvertical/smrt-commerce` -> `commerce`, as item ids spell it. */
10
+ export declare function packageIdOf(packageName: string): string;
11
+ /** Build the engine catalog from every manifest in the index. */
12
+ export declare function catalogFromIndex(index: RecipeIndex, cookbooks?: readonly EngineLibraryCookbook[]): EngineCatalog;
13
+ /**
14
+ * Ready-made cookbooks from `<dir>/<id>.cookbook.json` files. A file that is
15
+ * not a valid cookbook is skipped and named in `warnings`.
16
+ */
17
+ export declare function readLibraryDir(dir: string, warnings: string[]): EngineLibraryCookbook[];
18
+ /** The library this CLI ships plus any extra directories (later ids win). */
19
+ export declare function loadLibrary(extraDirs: readonly string[], warnings: string[]): EngineLibraryCookbook[];
20
+ export interface CatalogOptions {
21
+ /** Directory manifests are looked up from (the server's working directory). */
22
+ dir: string;
23
+ manifests?: string[];
24
+ registry?: boolean;
25
+ /** Extra smrt packages to read recipes from, beyond what the library names. */
26
+ packages?: string[];
27
+ library?: string[];
28
+ }
29
+ export interface LoadedCatalog {
30
+ catalog: EngineCatalog;
31
+ index: RecipeIndex;
32
+ warnings: string[];
33
+ }
34
+ /**
35
+ * Resolve the manifests behind the library's recipes (local sources first,
36
+ * then the scope registry, as `cookbook validate` does) and build the catalog.
37
+ */
38
+ export declare function loadCatalog(options: CatalogOptions): Promise<LoadedCatalog>;
39
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../src/commands/kitchen/mcp/catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EACV,aAAa,EAEb,qBAAqB,EAGtB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAEL,KAAK,WAAW,EAGjB,MAAM,gCAAgC,CAAC;AA2BxC,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEvD;AA2DD,iEAAiE;AACjE,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,GAAE,SAAS,qBAAqB,EAAO,GAC/C,aAAa,CAWf;AAwBD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAAE,GACjB,qBAAqB,EAAE,CA6BzB;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CACzB,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,QAAQ,EAAE,MAAM,EAAE,GACjB,qBAAqB,EAAE,CAUzB;AAED,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAkCxB"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `smrt kitchen mcp` (#3752): the Kitchen tools served over stdio. stdout
3
+ * carries the protocol only; everything else goes to stderr.
4
+ */
5
+ import { Server } from '@modelcontextprotocol/server';
6
+ import { KitchenSession, type KitchenToolsOptions } from './tools.js';
7
+ export declare const SERVER_NAME = "smrt-kitchen";
8
+ /** Build the MCP server; one {@link KitchenSession} (plans, catalog) per server. */
9
+ export declare function createKitchenMcpServer(options: KitchenToolsOptions): {
10
+ server: Server;
11
+ session: KitchenSession;
12
+ };
13
+ /** Serve on this process's stdio until the host closes it or the process is stopped. */
14
+ export declare function runKitchenMcp(options: KitchenToolsOptions): Promise<void>;
15
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/commands/kitchen/mcp/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD,OAAO,EAEL,cAAc,EACd,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAQ1C,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,GAAG;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB,CAgCA;AAED,wFAAwF;AACxF,wBAAsB,aAAa,CACjC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAaf"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The tools of `smrt kitchen mcp` (#3752): a local, stdio Model Context
3
+ * Protocol server that lets a host's own model (ChatGPT, Codex, Claude)
4
+ * plan a SMRT app with the cookbook command engine, then create the project
5
+ * with `cookbook apply`. The host reasons; nothing here calls a model or
6
+ * holds a credential.
7
+ *
8
+ * Plans live in this process, one engine per plan id. Nothing is stored
9
+ * remotely; `apply_plan` writes `smrt.cookbook.json` into the project.
10
+ */
11
+ import { type JsonSchema, type PlanSnapshot } from '@happyvertical/smrt-core/cookbook/engine';
12
+ import { type CatalogOptions, type LoadedCatalog } from './catalog.js';
13
+ /** The most plans one server process holds; the oldest is dropped past it. */
14
+ export declare const MAX_PLANS = 20;
15
+ export interface KitchenToolsOptions extends CatalogOptions {
16
+ /** Default project template for `apply_plan` (default: smrt-start). */
17
+ template?: string;
18
+ /** Replaces the catalog loader (tests). */
19
+ catalogLoader?: () => Promise<LoadedCatalog>;
20
+ }
21
+ /** Tool annotations as MCP defines them. */
22
+ export interface KitchenToolAnnotations {
23
+ title: string;
24
+ readOnlyHint: boolean;
25
+ destructiveHint: boolean;
26
+ idempotentHint: boolean;
27
+ openWorldHint: boolean;
28
+ }
29
+ export interface KitchenToolDefinition {
30
+ name: string;
31
+ title: string;
32
+ description: string;
33
+ inputSchema: JsonSchema;
34
+ outputSchema: JsonSchema;
35
+ annotations: KitchenToolAnnotations;
36
+ }
37
+ /** What a handler returns: structured data plus the compact text for the model. */
38
+ export interface KitchenToolResult {
39
+ data: Record<string, unknown> & {
40
+ ok: boolean;
41
+ };
42
+ text: string;
43
+ }
44
+ export declare const KITCHEN_TOOLS: readonly KitchenToolDefinition[];
45
+ /** One line of a snapshot, for the model's text. */
46
+ export declare function describeSnapshot(snapshot: PlanSnapshot): string;
47
+ /** The server's state: the lazily loaded catalog and the plans. */
48
+ export declare class KitchenSession {
49
+ private readonly options;
50
+ private loaded?;
51
+ private readonly plans;
52
+ constructor(options: KitchenToolsOptions);
53
+ /** Load the catalog once; a failed load is retried on the next call. */
54
+ catalog(): Promise<LoadedCatalog>;
55
+ private plan;
56
+ /** Validate arguments against a tool's published schema. */
57
+ private static check;
58
+ call(name: string, args?: Record<string, unknown>): Promise<KitchenToolResult>;
59
+ private dispatch;
60
+ private listCookbooks;
61
+ private searchRecipes;
62
+ private startPlan;
63
+ private runCommands;
64
+ private validatePlan;
65
+ private exportPlan;
66
+ private applyPlan;
67
+ }
68
+ //# sourceMappingURL=tools.d.ts.map