create-cogenta 0.0.3 → 0.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.
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +17 -0
- package/dist/bin.js.map +1 -0
- package/dist/blueprints/association.d.ts +73 -0
- package/dist/blueprints/association.d.ts.map +1 -0
- package/dist/blueprints/association.js +176 -0
- package/dist/blueprints/association.js.map +1 -0
- package/dist/blueprints/blog.d.ts +211 -0
- package/dist/blueprints/blog.d.ts.map +1 -0
- package/dist/blueprints/blog.js +297 -0
- package/dist/blueprints/blog.js.map +1 -0
- package/dist/blueprints/content-pack.d.ts +54 -0
- package/dist/blueprints/content-pack.d.ts.map +1 -0
- package/dist/blueprints/content-pack.js +40 -0
- package/dist/blueprints/content-pack.js.map +1 -0
- package/dist/blueprints/content-packs.d.ts +10 -0
- package/dist/blueprints/content-packs.d.ts.map +1 -0
- package/dist/blueprints/content-packs.js +26 -0
- package/dist/blueprints/content-packs.js.map +1 -0
- package/dist/blueprints/documentation.d.ts +71 -0
- package/dist/blueprints/documentation.d.ts.map +1 -0
- package/dist/blueprints/documentation.js +153 -0
- package/dist/blueprints/documentation.js.map +1 -0
- package/dist/blueprints/magazine.d.ts +79 -0
- package/dist/blueprints/magazine.d.ts.map +1 -0
- package/dist/blueprints/magazine.js +163 -0
- package/dist/blueprints/magazine.js.map +1 -0
- package/dist/blueprints/portfolio.d.ts +73 -0
- package/dist/blueprints/portfolio.d.ts.map +1 -0
- package/dist/blueprints/portfolio.js +171 -0
- package/dist/blueprints/portfolio.js.map +1 -0
- package/dist/blueprints/registry.d.ts +23 -0
- package/dist/blueprints/registry.d.ts.map +1 -0
- package/dist/blueprints/registry.js +42 -0
- package/dist/blueprints/registry.js.map +1 -0
- package/dist/blueprints/restaurant.d.ts +79 -0
- package/dist/blueprints/restaurant.d.ts.map +1 -0
- package/dist/blueprints/restaurant.js +175 -0
- package/dist/blueprints/restaurant.js.map +1 -0
- package/dist/blueprints/saas.d.ts +66 -0
- package/dist/blueprints/saas.d.ts.map +1 -0
- package/dist/blueprints/saas.js +165 -0
- package/dist/blueprints/saas.js.map +1 -0
- package/dist/blueprints/vitrine.d.ts +100 -0
- package/dist/blueprints/vitrine.d.ts.map +1 -0
- package/dist/blueprints/vitrine.js +214 -0
- package/dist/blueprints/vitrine.js.map +1 -0
- package/dist/config-file.d.ts +13 -0
- package/dist/config-file.d.ts.map +1 -0
- package/dist/config-file.js +93 -0
- package/dist/config-file.js.map +1 -0
- package/dist/environment.d.ts +27 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +91 -0
- package/dist/environment.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/llm-setup.d.ts +39 -0
- package/dist/llm-setup.d.ts.map +1 -0
- package/dist/llm-setup.js +47 -0
- package/dist/llm-setup.js.map +1 -0
- package/dist/playground-reset.d.ts +27 -0
- package/dist/playground-reset.d.ts.map +1 -0
- package/dist/playground-reset.js +40 -0
- package/dist/playground-reset.js.map +1 -0
- package/dist/prompts.d.ts +30 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +63 -0
- package/dist/prompts.js.map +1 -0
- package/dist/recap.d.ts +19 -0
- package/dist/recap.d.ts.map +1 -0
- package/dist/recap.js +74 -0
- package/dist/recap.js.map +1 -0
- package/dist/scaffold.d.ts +49 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +170 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/skin-flow.d.ts +35 -0
- package/dist/skin-flow.d.ts.map +1 -0
- package/dist/skin-flow.js +56 -0
- package/dist/skin-flow.js.map +1 -0
- package/dist/skin-preview.d.ts +8 -0
- package/dist/skin-preview.d.ts.map +1 -0
- package/dist/skin-preview.js +130 -0
- package/dist/skin-preview.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/dist/wizard.d.ts +17 -0
- package/dist/wizard.d.ts.map +1 -0
- package/dist/wizard.js +157 -0
- package/dist/wizard.js.map +1 -0
- package/package.json +45 -6
- package/README.md +0 -39
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { VocabularyBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type CollectionDefinition } from '@cogenta/schema';
|
|
3
|
+
import { type BlueprintContentPack, type RecommendedAgentHint } from './content-pack.js';
|
|
4
|
+
/**
|
|
5
|
+
* The `vitrine` blueprint's content model (L9 task 8, batch A): the classic
|
|
6
|
+
* one-pager showcase site for a small business or independent — a list of
|
|
7
|
+
* services and a few testimonials, both real, editable collections rather
|
|
8
|
+
* than data baked into the page itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare const service: {
|
|
11
|
+
readonly name: "service";
|
|
12
|
+
readonly labels: {
|
|
13
|
+
readonly singular: "Service";
|
|
14
|
+
readonly plural: "Services";
|
|
15
|
+
};
|
|
16
|
+
readonly routing: {
|
|
17
|
+
readonly pattern: "/services/:slug";
|
|
18
|
+
};
|
|
19
|
+
readonly fields: {
|
|
20
|
+
name: import("@cogenta/schema").FieldDefinition & {
|
|
21
|
+
readonly kind: "text";
|
|
22
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
23
|
+
};
|
|
24
|
+
slug: import("@cogenta/schema").FieldDefinition & {
|
|
25
|
+
readonly kind: "slug";
|
|
26
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
27
|
+
};
|
|
28
|
+
description: import("@cogenta/schema").FieldDefinition & {
|
|
29
|
+
readonly kind: "text";
|
|
30
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly indexes: readonly [readonly ["slug"]];
|
|
34
|
+
readonly permissions: {
|
|
35
|
+
readonly read: readonly ["public"];
|
|
36
|
+
readonly create: readonly ["editor", "admin"];
|
|
37
|
+
readonly update: readonly ["editor", "admin"];
|
|
38
|
+
readonly delete: readonly ["admin"];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const testimonial: {
|
|
42
|
+
readonly name: "testimonial";
|
|
43
|
+
readonly labels: {
|
|
44
|
+
readonly singular: "Testimonial";
|
|
45
|
+
readonly plural: "Testimonials";
|
|
46
|
+
};
|
|
47
|
+
readonly fields: {
|
|
48
|
+
authorName: import("@cogenta/schema").FieldDefinition & {
|
|
49
|
+
readonly kind: "text";
|
|
50
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
51
|
+
};
|
|
52
|
+
authorRole: import("@cogenta/schema").FieldDefinition & {
|
|
53
|
+
readonly kind: "text";
|
|
54
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
55
|
+
};
|
|
56
|
+
quote: import("@cogenta/schema").FieldDefinition & {
|
|
57
|
+
readonly kind: "text";
|
|
58
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
readonly permissions: {
|
|
62
|
+
readonly read: readonly ["public"];
|
|
63
|
+
readonly create: readonly ["editor", "admin"];
|
|
64
|
+
readonly update: readonly ["editor", "admin"];
|
|
65
|
+
readonly delete: readonly ["admin"];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export declare const page: CollectionDefinition;
|
|
69
|
+
export declare const VITRINE_COLLECTIONS: readonly CollectionDefinition[];
|
|
70
|
+
export interface VitrineDemoService {
|
|
71
|
+
readonly name: string;
|
|
72
|
+
readonly slug: string;
|
|
73
|
+
readonly description: string;
|
|
74
|
+
}
|
|
75
|
+
export interface VitrineDemoTestimonial {
|
|
76
|
+
readonly authorName: string;
|
|
77
|
+
readonly authorRole: string;
|
|
78
|
+
readonly quote: string;
|
|
79
|
+
}
|
|
80
|
+
export declare const VITRINE_DEMO_SERVICES: readonly VitrineDemoService[];
|
|
81
|
+
export declare const VITRINE_DEMO_TESTIMONIALS: readonly VitrineDemoTestimonial[];
|
|
82
|
+
export interface VitrineDemoPage {
|
|
83
|
+
readonly title: string;
|
|
84
|
+
readonly slug: string;
|
|
85
|
+
readonly blocks: readonly VocabularyBlock[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* `home` (hero + a live list of services + a closing call to action) and
|
|
89
|
+
* `about` (a short prose intro plus the same live list of testimonials) —
|
|
90
|
+
* both compositions of blocks already in the frozen vocabulary (contract B),
|
|
91
|
+
* rendered generically by `@cogenta/theme-canonical`. Services and
|
|
92
|
+
* testimonials are read through `collectionList`, the same block `blog`
|
|
93
|
+
* uses for its recent-posts list, rather than duplicating their text as
|
|
94
|
+
* static block content: editing a service in the admin then genuinely
|
|
95
|
+
* changes what the home page shows.
|
|
96
|
+
*/
|
|
97
|
+
export declare const VITRINE_DEMO_PAGES: readonly VitrineDemoPage[];
|
|
98
|
+
export declare const VITRINE_RECOMMENDED_AGENTS: readonly RecommendedAgentHint[];
|
|
99
|
+
export declare const vitrineContentPack: BlueprintContentPack;
|
|
100
|
+
//# sourceMappingURL=vitrine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitrine.d.ts","sourceRoot":"","sources":["../../src/blueprints/vitrine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EACL,KAAK,oBAAoB,EAK1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAA;AAE1B;;;;;GAKG;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;QAShB,IAAI;;;;QACJ,IAAI;;;;QACJ,WAAW;;;;;;;;;;;;CASb,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;QAIpB,UAAU;;;;QACV,UAAU;;;;QACV,KAAK;;;;;;;;;;;CAQP,CAAA;AAEF,eAAO,MAAM,IAAI,sBAAiC,CAAA;AAElD,eAAO,MAAM,mBAAmB,EAAE,SAAS,oBAAoB,EAAiC,CAAA;AAIhG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAmB9D,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,SAAS,sBAAsB,EAYtE,CAAA;AAID,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAC5C;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAgFxD,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,SAAS,oBAAoB,EAYrE,CAAA;AAyCD,eAAO,MAAM,kBAAkB,EAAE,oBAIhC,CAAA"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { createContentStore, defineCollection, f, validateCollectionSet, } from '@cogenta/schema';
|
|
2
|
+
import { definePageCollection, toBlockZoneEntry, } from './content-pack.js';
|
|
3
|
+
/**
|
|
4
|
+
* The `vitrine` blueprint's content model (L9 task 8, batch A): the classic
|
|
5
|
+
* one-pager showcase site for a small business or independent — a list of
|
|
6
|
+
* services and a few testimonials, both real, editable collections rather
|
|
7
|
+
* than data baked into the page itself.
|
|
8
|
+
*/
|
|
9
|
+
export const service = defineCollection({
|
|
10
|
+
name: 'service',
|
|
11
|
+
labels: { singular: 'Service', plural: 'Services' },
|
|
12
|
+
// Routed, not just listed: `collectionList` (used on the home page below)
|
|
13
|
+
// always builds a link for every entry it renders (`entryHref`,
|
|
14
|
+
// `@cogenta/theme-canonical`), so a collection it targets must have a
|
|
15
|
+
// route or that render call throws.
|
|
16
|
+
routing: { pattern: '/services/:slug' },
|
|
17
|
+
fields: {
|
|
18
|
+
name: f.text({ required: true, max: 120 }),
|
|
19
|
+
slug: f.slug({ from: 'name', unique: true }),
|
|
20
|
+
description: f.text({ max: 400, multiline: true }),
|
|
21
|
+
},
|
|
22
|
+
indexes: [['slug']],
|
|
23
|
+
permissions: {
|
|
24
|
+
read: ['public'],
|
|
25
|
+
create: ['editor', 'admin'],
|
|
26
|
+
update: ['editor', 'admin'],
|
|
27
|
+
delete: ['admin'],
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export const testimonial = defineCollection({
|
|
31
|
+
name: 'testimonial',
|
|
32
|
+
labels: { singular: 'Testimonial', plural: 'Testimonials' },
|
|
33
|
+
fields: {
|
|
34
|
+
authorName: f.text({ required: true, max: 120 }),
|
|
35
|
+
authorRole: f.text({ max: 120 }),
|
|
36
|
+
quote: f.text({ required: true, max: 500, multiline: true }),
|
|
37
|
+
},
|
|
38
|
+
permissions: {
|
|
39
|
+
read: ['public'],
|
|
40
|
+
create: ['editor', 'admin'],
|
|
41
|
+
update: ['editor', 'admin'],
|
|
42
|
+
delete: ['admin'],
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
export const page = definePageCollection('/:slug');
|
|
46
|
+
export const VITRINE_COLLECTIONS = [service, testimonial, page];
|
|
47
|
+
validateCollectionSet(VITRINE_COLLECTIONS);
|
|
48
|
+
export const VITRINE_DEMO_SERVICES = [
|
|
49
|
+
{
|
|
50
|
+
name: 'Brand strategy',
|
|
51
|
+
slug: 'brand-strategy',
|
|
52
|
+
description: 'Positioning, messaging and visual identity worked out before a single page is built.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'Web design',
|
|
56
|
+
slug: 'web-design',
|
|
57
|
+
description: 'A site that says what the business does in the first five seconds, on every screen size.',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Ongoing support',
|
|
61
|
+
slug: 'ongoing-support',
|
|
62
|
+
description: 'Small, steady changes after launch — content updates, fixes, the occasional new page.',
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
export const VITRINE_DEMO_TESTIMONIALS = [
|
|
66
|
+
{
|
|
67
|
+
authorName: 'Amina Diallo',
|
|
68
|
+
authorRole: 'Founder, Atelier Diallo',
|
|
69
|
+
quote: 'The new site paid for itself in the first month — people finally understood what we do before they called.',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
authorName: 'Marco Bellini',
|
|
73
|
+
authorRole: 'Owner, Bellini Consulting',
|
|
74
|
+
quote: 'Fast, clear, no surprises. Exactly what a small business needs from a web project.',
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
const BLOCK_VERSION = '1.0.0';
|
|
78
|
+
/**
|
|
79
|
+
* `home` (hero + a live list of services + a closing call to action) and
|
|
80
|
+
* `about` (a short prose intro plus the same live list of testimonials) —
|
|
81
|
+
* both compositions of blocks already in the frozen vocabulary (contract B),
|
|
82
|
+
* rendered generically by `@cogenta/theme-canonical`. Services and
|
|
83
|
+
* testimonials are read through `collectionList`, the same block `blog`
|
|
84
|
+
* uses for its recent-posts list, rather than duplicating their text as
|
|
85
|
+
* static block content: editing a service in the admin then genuinely
|
|
86
|
+
* changes what the home page shows.
|
|
87
|
+
*/
|
|
88
|
+
export const VITRINE_DEMO_PAGES = [
|
|
89
|
+
{
|
|
90
|
+
title: 'Home',
|
|
91
|
+
slug: 'home',
|
|
92
|
+
blocks: [
|
|
93
|
+
{
|
|
94
|
+
_key: 'demo-home-hero',
|
|
95
|
+
_type: 'hero',
|
|
96
|
+
_version: BLOCK_VERSION,
|
|
97
|
+
eyebrow: 'Vitrine',
|
|
98
|
+
title: 'A showcase site that says what you do',
|
|
99
|
+
subtitle: 'Scaffolded by create-cogenta from the "vitrine" blueprint, with real services and testimonials already in place.',
|
|
100
|
+
actions: [
|
|
101
|
+
{ label: 'See our services', target: { href: '#services' }, emphasis: 'primary' },
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
_key: 'demo-home-services',
|
|
106
|
+
_type: 'collectionList',
|
|
107
|
+
_version: BLOCK_VERSION,
|
|
108
|
+
title: 'Services',
|
|
109
|
+
collection: 'service',
|
|
110
|
+
sort: { field: 'createdAt', direction: 'asc' },
|
|
111
|
+
limit: 10,
|
|
112
|
+
layout: 'grid',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
_key: 'demo-home-cta',
|
|
116
|
+
_type: 'cta',
|
|
117
|
+
_version: BLOCK_VERSION,
|
|
118
|
+
title: 'Ready to get started?',
|
|
119
|
+
text: 'Every part of this page — the services, the testimonials, this call to action — is normal editable content.',
|
|
120
|
+
actions: [{ label: 'Get in touch', target: { href: '/about' }, emphasis: 'primary' }],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
title: 'About',
|
|
126
|
+
slug: 'about',
|
|
127
|
+
blocks: [
|
|
128
|
+
{
|
|
129
|
+
_key: 'demo-about-prose',
|
|
130
|
+
_type: 'prose',
|
|
131
|
+
_version: BLOCK_VERSION,
|
|
132
|
+
body: [
|
|
133
|
+
{
|
|
134
|
+
_key: 'demo-about-p1',
|
|
135
|
+
_type: 'block',
|
|
136
|
+
style: 'normal',
|
|
137
|
+
children: [
|
|
138
|
+
{
|
|
139
|
+
_key: 'demo-about-p1-span',
|
|
140
|
+
_type: 'span',
|
|
141
|
+
text: 'This is a demo showcase site, scaffolded by create-cogenta from the "vitrine" blueprint. Its services and testimonials were seeded by the installer so there is real content to look at from the first run.',
|
|
142
|
+
marks: [],
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
markDefs: [],
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
// Testimonials are static `quote` blocks here, not a `collectionList`:
|
|
150
|
+
// unlike `service` (routed above, so a link can point at it), a
|
|
151
|
+
// testimonial has no page of its own worth linking to, and `quote`
|
|
152
|
+
// — text/author/role, contract B's vocabulary block for exactly this
|
|
153
|
+
// — is the honest fit. The `testimonial` collection stays real and
|
|
154
|
+
// editable in the admin; these two mirror its demo rows.
|
|
155
|
+
...VITRINE_DEMO_TESTIMONIALS.map((demo, index) => ({
|
|
156
|
+
_key: `demo-about-quote-${index + 1}`,
|
|
157
|
+
_type: 'quote',
|
|
158
|
+
_version: BLOCK_VERSION,
|
|
159
|
+
text: demo.quote,
|
|
160
|
+
author: demo.authorName,
|
|
161
|
+
role: demo.authorRole,
|
|
162
|
+
})),
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
export const VITRINE_RECOMMENDED_AGENTS = [
|
|
167
|
+
{
|
|
168
|
+
name: 'seoAgent',
|
|
169
|
+
package: '@cogenta/agents-builtin',
|
|
170
|
+
reason: 'Audits the one-pager for on-page SEO issues before it goes live.',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: 'performanceAgent',
|
|
174
|
+
package: '@cogenta/agents-builtin',
|
|
175
|
+
reason: 'Catches oversized hero media and third-party scripts that would slow the landing page down.',
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
/**
|
|
179
|
+
* Inserts the `vitrine` blueprint's demo content through the real
|
|
180
|
+
* `ContentStore` — never mocked (house rule).
|
|
181
|
+
*/
|
|
182
|
+
async function seedVitrineDemoContent(db, defaultLocale, adminId) {
|
|
183
|
+
const serviceStore = createContentStore({ db, collection: service, defaultLocale });
|
|
184
|
+
const testimonialStore = createContentStore({ db, collection: testimonial, defaultLocale });
|
|
185
|
+
const pageStore = createContentStore({ db, collection: page, defaultLocale });
|
|
186
|
+
for (const demo of VITRINE_DEMO_SERVICES) {
|
|
187
|
+
await serviceStore.create({
|
|
188
|
+
status: 'published',
|
|
189
|
+
createdBy: adminId,
|
|
190
|
+
values: { name: demo.name, slug: demo.slug, description: demo.description },
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
for (const demo of VITRINE_DEMO_TESTIMONIALS) {
|
|
194
|
+
await testimonialStore.create({
|
|
195
|
+
status: 'published',
|
|
196
|
+
createdBy: adminId,
|
|
197
|
+
values: { authorName: demo.authorName, authorRole: demo.authorRole, quote: demo.quote },
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
for (const demo of VITRINE_DEMO_PAGES) {
|
|
201
|
+
await pageStore.create({
|
|
202
|
+
status: 'published',
|
|
203
|
+
createdBy: adminId,
|
|
204
|
+
values: { title: demo.title, slug: demo.slug },
|
|
205
|
+
blocks: { blocks: demo.blocks.map(toBlockZoneEntry) },
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
export const vitrineContentPack = {
|
|
210
|
+
collections: VITRINE_COLLECTIONS,
|
|
211
|
+
recommendedAgents: VITRINE_RECOMMENDED_AGENTS,
|
|
212
|
+
seedDemoContent: seedVitrineDemoContent,
|
|
213
|
+
};
|
|
214
|
+
//# sourceMappingURL=vitrine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitrine.js","sourceRoot":"","sources":["../../src/blueprints/vitrine.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,kBAAkB,EAClB,gBAAgB,EAChB,CAAC,EACD,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAEL,oBAAoB,EAEpB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAE1B;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;IACtC,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,E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;SAC5E,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,yBAAyB,EAAE,CAAC;QAC7C,MAAM,gBAAgB,CAAC,MAAM,CAAC;YAC5B,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;SACxF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;QACtC,MAAM,SAAS,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;YAC9C,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;SACtD,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAyB;IACtD,WAAW,EAAE,mBAAmB;IAChC,iBAAiB,EAAE,0BAA0B;IAC7C,eAAe,EAAE,sBAAsB;CACxC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type WizardAnswers } from './types.js';
|
|
2
|
+
export declare class ConfigFileError extends Error {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* "`--config fichier` pour une installation non interactive." A plain JSON
|
|
6
|
+
* file, hand-validated (this package intentionally carries no schema
|
|
7
|
+
* dependency — a handful of required strings does not need one). Every
|
|
8
|
+
* field left out falls back to the same default the interactive wizard's
|
|
9
|
+
* own Enter key would have produced, so `--yes` and a minimal `--config`
|
|
10
|
+
* file describe the same site.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadConfigFile(path: string, targetDir: string): Promise<WizardAnswers>;
|
|
13
|
+
//# sourceMappingURL=config-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../src/config-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/D,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAkC7C;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA0D5F"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { defaultAnswers } from './types.js';
|
|
3
|
+
export class ConfigFileError extends Error {
|
|
4
|
+
}
|
|
5
|
+
function requireString(value, field) {
|
|
6
|
+
if (typeof value !== 'string' || value.trim() === '') {
|
|
7
|
+
throw new ConfigFileError(`"${field}" must be a non-empty string.`);
|
|
8
|
+
}
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
function optionalString(value, field) {
|
|
12
|
+
if (value === undefined)
|
|
13
|
+
return undefined;
|
|
14
|
+
return requireString(value, field);
|
|
15
|
+
}
|
|
16
|
+
const LLM_PROVIDER_IDS = ['none', 'anthropic', 'openai', 'google'];
|
|
17
|
+
function llmProvider(value) {
|
|
18
|
+
if (value === undefined)
|
|
19
|
+
return 'none';
|
|
20
|
+
if (typeof value === 'string' && LLM_PROVIDER_IDS.includes(value)) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
throw new ConfigFileError(`"llm.provider" must be one of ${LLM_PROVIDER_IDS.join(', ')}, not "${String(value)}".`);
|
|
24
|
+
}
|
|
25
|
+
function databaseDriver(value) {
|
|
26
|
+
if (value === undefined)
|
|
27
|
+
return 'sqlite';
|
|
28
|
+
if (value === 'sqlite' || value === 'postgres' || value === 'mysql')
|
|
29
|
+
return value;
|
|
30
|
+
throw new ConfigFileError(`"database.driver" must be one of sqlite, postgres, mysql, not "${String(value)}".`);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* "`--config fichier` pour une installation non interactive." A plain JSON
|
|
34
|
+
* file, hand-validated (this package intentionally carries no schema
|
|
35
|
+
* dependency — a handful of required strings does not need one). Every
|
|
36
|
+
* field left out falls back to the same default the interactive wizard's
|
|
37
|
+
* own Enter key would have produced, so `--yes` and a minimal `--config`
|
|
38
|
+
* file describe the same site.
|
|
39
|
+
*/
|
|
40
|
+
export async function loadConfigFile(path, targetDir) {
|
|
41
|
+
let raw;
|
|
42
|
+
try {
|
|
43
|
+
raw = await readFile(path, 'utf8');
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw new ConfigFileError(`Could not read ${path}: ${error instanceof Error ? error.message : String(error)}`);
|
|
47
|
+
}
|
|
48
|
+
let parsed;
|
|
49
|
+
try {
|
|
50
|
+
parsed = JSON.parse(raw);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
throw new ConfigFileError(`${path} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
54
|
+
}
|
|
55
|
+
if (typeof parsed !== 'object' || parsed === null) {
|
|
56
|
+
throw new ConfigFileError(`${path} must contain a JSON object.`);
|
|
57
|
+
}
|
|
58
|
+
const root = parsed;
|
|
59
|
+
const site = (root.site ?? {});
|
|
60
|
+
const database = (root.database ?? {});
|
|
61
|
+
const llm = (root.llm ?? {});
|
|
62
|
+
const base = defaultAnswers(targetDir, requireString(site.name, 'site.name'));
|
|
63
|
+
return {
|
|
64
|
+
...base,
|
|
65
|
+
siteUrl: requireString(site.url, 'site.url'),
|
|
66
|
+
...(optionalString(site.defaultLocale, 'site.defaultLocale') === undefined
|
|
67
|
+
? {}
|
|
68
|
+
: { defaultLocale: optionalString(site.defaultLocale, 'site.defaultLocale') }),
|
|
69
|
+
...(optionalString(root.blueprint, 'blueprint') === undefined
|
|
70
|
+
? {}
|
|
71
|
+
: { blueprintId: optionalString(root.blueprint, 'blueprint') }),
|
|
72
|
+
databaseDriver: databaseDriver(database.driver),
|
|
73
|
+
...(optionalString(database.url, 'database.url') === undefined
|
|
74
|
+
? {}
|
|
75
|
+
: { databaseUrl: optionalString(database.url, 'database.url') }),
|
|
76
|
+
llmProvider: llmProvider(llm.provider),
|
|
77
|
+
...(optionalString(llm.model, 'llm.model') === undefined
|
|
78
|
+
? {}
|
|
79
|
+
: { llmModel: optionalString(llm.model, 'llm.model') }),
|
|
80
|
+
...(optionalString(llm.apiKey, 'llm.apiKey') === undefined
|
|
81
|
+
? {}
|
|
82
|
+
: { llmApiKey: optionalString(llm.apiKey, 'llm.apiKey') }),
|
|
83
|
+
...(optionalString(llm.siteDescription, 'llm.siteDescription') === undefined
|
|
84
|
+
? {}
|
|
85
|
+
: {
|
|
86
|
+
siteDescription: optionalString(llm.siteDescription, 'llm.siteDescription'),
|
|
87
|
+
}),
|
|
88
|
+
...(optionalString(root.adminEmail, 'adminEmail') === undefined
|
|
89
|
+
? {}
|
|
90
|
+
: { adminEmail: optionalString(root.adminEmail, 'adminEmail') }),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=config-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-file.js","sourceRoot":"","sources":["../src/config-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,cAAc,EAAsB,MAAM,YAAY,CAAA;AAE/D,MAAM,OAAO,eAAgB,SAAQ,KAAK;CAAG;AAE7C,SAAS,aAAa,CAAC,KAAc,EAAE,KAAa;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrD,MAAM,IAAI,eAAe,CAAC,IAAI,KAAK,+BAA+B,CAAC,CAAA;IACrE,CAAC;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E,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAW,EAAE,CAAC;KAC7E,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type CheckStatus = 'ok' | 'warn' | 'fail';
|
|
2
|
+
export interface EnvironmentCheck {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly status: CheckStatus;
|
|
5
|
+
/** Cause and remedy together — "a broken environment error says what to do, not just what failed." */
|
|
6
|
+
readonly message: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EnvironmentReport {
|
|
9
|
+
readonly node: string;
|
|
10
|
+
readonly packageManager: string;
|
|
11
|
+
readonly checks: readonly EnvironmentCheck[];
|
|
12
|
+
readonly detectedDatabases: readonly ('postgres' | 'mysql')[];
|
|
13
|
+
/** `false` when any check is `fail` — a `warn` alone (e.g. no built-in SQLite, but Postgres/MySQL still work) does not block installation. */
|
|
14
|
+
readonly ok: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface CheckEnvironmentOptions {
|
|
17
|
+
readonly targetDir: string;
|
|
18
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Step 1 of the wizard: "Vérification de l'environnement — version de Node,
|
|
22
|
+
* gestionnaire de paquets, droits d'écriture, services détectés." Every
|
|
23
|
+
* `fail` message names both the cause and the remedy — never just what
|
|
24
|
+
* broke, matching `cogenta doctor`'s own convention (`packages/cli/src/commands/doctor.ts`).
|
|
25
|
+
*/
|
|
26
|
+
export declare function checkEnvironment(options: CheckEnvironmentOptions): Promise<EnvironmentReport>;
|
|
27
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,sGAAsG;IACtG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC5C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,CAAC,UAAU,GAAG,OAAO,CAAC,EAAE,CAAA;IAC7D,8IAA8I;IAC9I,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CACjC;AAgED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAqB5B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { access, constants as fsConstants, mkdir, rm, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { connect } from 'node:net';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
/** Node's own SQLite module needs 22.13 — the same threshold `cogenta doctor` already checks. */
|
|
5
|
+
function checkNodeVersion() {
|
|
6
|
+
const version = process.versions.node;
|
|
7
|
+
const [major, minor] = version.split('.').map(Number);
|
|
8
|
+
if (major === undefined || major < 22) {
|
|
9
|
+
return {
|
|
10
|
+
name: 'node',
|
|
11
|
+
status: 'fail',
|
|
12
|
+
message: `Node ${version} is too old. Cogenta needs Node 22.11 or later — install a current LTS from nodejs.org.`,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
if (major === 22 && minor !== undefined && minor < 13) {
|
|
16
|
+
return {
|
|
17
|
+
name: 'node',
|
|
18
|
+
status: 'warn',
|
|
19
|
+
message: `Node ${version} has no built-in SQLite. Upgrade to 22.13 or later, or choose Postgres or MySQL in the next step.`,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return { name: 'node', status: 'ok', message: `Node ${version}.` };
|
|
23
|
+
}
|
|
24
|
+
/** `npm_config_user_agent` is the one signal every package manager sets consistently — parsed the same way `pnpm`/`corepack` themselves rely on it being. */
|
|
25
|
+
function detectPackageManager(env) {
|
|
26
|
+
const userAgent = env.npm_config_user_agent;
|
|
27
|
+
if (userAgent === undefined)
|
|
28
|
+
return 'npm';
|
|
29
|
+
const name = userAgent.split('/')[0];
|
|
30
|
+
return name === undefined || name === '' ? 'npm' : name;
|
|
31
|
+
}
|
|
32
|
+
async function checkWritePermission(targetDir) {
|
|
33
|
+
try {
|
|
34
|
+
await mkdir(targetDir, { recursive: true });
|
|
35
|
+
await access(targetDir, fsConstants.W_OK);
|
|
36
|
+
const probe = join(targetDir, '.cogenta-write-probe');
|
|
37
|
+
await writeFile(probe, '', 'utf8');
|
|
38
|
+
await rm(probe, { force: true });
|
|
39
|
+
return { name: 'write-permission', status: 'ok', message: `${targetDir} is writable.` };
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return {
|
|
43
|
+
name: 'write-permission',
|
|
44
|
+
status: 'fail',
|
|
45
|
+
message: `Cannot write to ${targetDir} (${error instanceof Error ? error.message : String(error)}). Choose a different directory, or fix its permissions.`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** A short-timeout TCP connect — best-effort, never a `fail`: a database that is not running locally is completely normal, this only feeds "Postgres/MySQL proposed if detected". */
|
|
50
|
+
function probePort(port, timeoutMs = 300) {
|
|
51
|
+
return new Promise((resolve) => {
|
|
52
|
+
const socket = connect({ port, host: '127.0.0.1' });
|
|
53
|
+
const finish = (result) => {
|
|
54
|
+
socket.removeAllListeners();
|
|
55
|
+
socket.destroy();
|
|
56
|
+
resolve(result);
|
|
57
|
+
};
|
|
58
|
+
socket.setTimeout(timeoutMs);
|
|
59
|
+
socket.once('connect', () => finish(true));
|
|
60
|
+
socket.once('timeout', () => finish(false));
|
|
61
|
+
socket.once('error', () => finish(false));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Step 1 of the wizard: "Vérification de l'environnement — version de Node,
|
|
66
|
+
* gestionnaire de paquets, droits d'écriture, services détectés." Every
|
|
67
|
+
* `fail` message names both the cause and the remedy — never just what
|
|
68
|
+
* broke, matching `cogenta doctor`'s own convention (`packages/cli/src/commands/doctor.ts`).
|
|
69
|
+
*/
|
|
70
|
+
export async function checkEnvironment(options) {
|
|
71
|
+
const env = options.env ?? process.env;
|
|
72
|
+
const [writeCheck, hasPostgres, hasMysql] = await Promise.all([
|
|
73
|
+
checkWritePermission(options.targetDir),
|
|
74
|
+
probePort(5432),
|
|
75
|
+
probePort(3306),
|
|
76
|
+
]);
|
|
77
|
+
const checks = [checkNodeVersion(), writeCheck];
|
|
78
|
+
const detectedDatabases = [];
|
|
79
|
+
if (hasPostgres)
|
|
80
|
+
detectedDatabases.push('postgres');
|
|
81
|
+
if (hasMysql)
|
|
82
|
+
detectedDatabases.push('mysql');
|
|
83
|
+
return {
|
|
84
|
+
node: process.versions.node,
|
|
85
|
+
packageManager: detectPackageManager(env),
|
|
86
|
+
checks,
|
|
87
|
+
detectedDatabases,
|
|
88
|
+
ok: checks.every((check) => check.status !== 'fail'),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,IAAI,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA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type Writer } from '@cogenta/cli';
|
|
2
|
+
export type { BlueprintContentPack, RecommendedAgentHint, SeedDemoContent, } from './blueprints/content-pack.js';
|
|
3
|
+
export { BLUEPRINT_CONTENT_PACKS } from './blueprints/content-packs.js';
|
|
4
|
+
export type { Blueprint, ResolvedBlueprint } from './blueprints/registry.js';
|
|
5
|
+
export { BLUEPRINTS, DEFAULT_BLUEPRINT_ID, resolveBlueprint } from './blueprints/registry.js';
|
|
6
|
+
export { ConfigFileError, loadConfigFile } from './config-file.js';
|
|
7
|
+
export type { CheckStatus, EnvironmentCheck, EnvironmentReport } from './environment.js';
|
|
8
|
+
export { checkEnvironment } from './environment.js';
|
|
9
|
+
export type { CreateProviderClientOptions, LlmProviderId, LlmProviderOption, ValidateKeyOptions, ValidateKeyResult, } from './llm-setup.js';
|
|
10
|
+
export { createProviderClient, LLM_PROVIDERS, validateApiKey } from './llm-setup.js';
|
|
11
|
+
export type { ResetPlaygroundDataOptions } from './playground-reset.js';
|
|
12
|
+
export { resetPlaygroundData } from './playground-reset.js';
|
|
13
|
+
export type { Choice, Prompter, PromptIO } from './prompts.js';
|
|
14
|
+
export { createDefaultsPrompter, createInteractivePrompter } from './prompts.js';
|
|
15
|
+
export { printRecap } from './recap.js';
|
|
16
|
+
export type { ScaffoldAnswers, ScaffoldResult } from './scaffold.js';
|
|
17
|
+
export { scaffoldSite } from './scaffold.js';
|
|
18
|
+
export type { ChooseSkinOptions, SkinOutcome } from './skin-flow.js';
|
|
19
|
+
export { chooseSkin } from './skin-flow.js';
|
|
20
|
+
export type { SkinPreviewPage } from './skin-preview.js';
|
|
21
|
+
export { renderSkinPreview } from './skin-preview.js';
|
|
22
|
+
export type { WizardAnswers } from './types.js';
|
|
23
|
+
export { defaultAnswers } from './types.js';
|
|
24
|
+
export type { RunWizardOptions } from './wizard.js';
|
|
25
|
+
export { runWizard } from './wizard.js';
|
|
26
|
+
export interface RunOptions {
|
|
27
|
+
readonly argv: readonly string[];
|
|
28
|
+
readonly cwd?: string;
|
|
29
|
+
readonly stdout?: Writer;
|
|
30
|
+
readonly stderr?: Writer;
|
|
31
|
+
readonly stdin?: NodeJS.ReadableStream;
|
|
32
|
+
readonly env?: Record<string, string | undefined>;
|
|
33
|
+
readonly isTty?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Mirrors `@cogenta/cli`'s own `run()`: nothing here calls `process.exit` or writes to a stream directly, so the whole wizard is testable without spawning a process. */
|
|
36
|
+
export declare function run(options: RunOptions): Promise<number>;
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiC,KAAK,MAAM,EAAE,MAAM,cAAc,CAAA;AAIzE,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,GAChB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AACvE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAClE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,YAAY,EACV,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpF,YAAY,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,EAAE,mBAAmB,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