@intelligo-dev/cli 1.0.0-beta.2 → 1.0.0-beta.5
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/README.md +38 -0
- package/dist/bin.js +11 -2
- package/dist/bin.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +62 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +10 -3
- package/templates/app-scaffold/auth-route.ts.tpl +11 -0
- package/templates/app-scaffold/globals.css.tpl +1 -16
- package/templates/app-scaffold/intelligo.ts.tpl +20 -1
- package/templates/app-scaffold/next.config.mjs.tpl +2 -0
- package/templates/app-scaffold/package.json.tpl +2 -0
- package/templates/app-scaffold/proxy.ts.tpl +21 -0
- package/templates/manifest.json +7 -3
- package/templates/registry-requires.json +1 -1
- package/templates/app-scaffold/middleware.ts.tpl +0 -11
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @intelligo-dev/cli
|
|
2
|
+
|
|
3
|
+
intelligo — create, add, doctor, migrate.
|
|
4
|
+
|
|
5
|
+
Part of [Intelligo](https://github.com/intelligo-mn/framework), an application
|
|
6
|
+
framework and operational platform for vertical AI SaaS products. This package
|
|
7
|
+
is published from that repository and is not meant to be used on its own.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @intelligo-dev/cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @intelligo-dev/cli create my-app # a registry-ready Next.js app
|
|
19
|
+
intelligo add <item> # install a registry page
|
|
20
|
+
intelligo doctor # what is misconfigured, and why it matters
|
|
21
|
+
intelligo migrate [--check] # apply the framework chain
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Why `migrate` is not `drizzle-kit migrate`
|
|
25
|
+
|
|
26
|
+
Drizzle applies migrations in journal-timestamp order and skips anything
|
|
27
|
+
numbered out of sequence. This chain has one such entry, so a migration
|
|
28
|
+
published after it would never run and nothing would say so. `intelligo
|
|
29
|
+
migrate` selects pending work by content hash, applies it in one transaction,
|
|
30
|
+
and records it in the same table drizzle uses so both tools agree afterwards.
|
|
31
|
+
|
|
32
|
+
It also **refuses** a database that has the schema but no records — the state
|
|
33
|
+
`drizzle-kit push` leaves behind. Applying 44 migrations to tables that already
|
|
34
|
+
exist fails part-way; `--check` reports `baseline` instead.
|
|
35
|
+
|
|
36
|
+
## Licence
|
|
37
|
+
|
|
38
|
+
Apache-2.0
|
package/dist/bin.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { createRequire } from "node:module";
|
|
14
14
|
import path from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
15
16
|
import { addFeature, formatAddResult, readCatalogue } from "./commands/add.js";
|
|
16
17
|
import { createApp, formatCreateResult } from "./commands/create.js";
|
|
17
18
|
import { exitCodeFor, formatResults, runChecks } from "./commands/doctor.js";
|
|
@@ -19,8 +20,16 @@ import { formatMigrateCheck, migrateCheck, migrateCheckExitCode, } from "./comma
|
|
|
19
20
|
import { MIGRATIONS_TABLE_SQL, applyExitCode, applyMigrations, formatApplyResult, } from "./commands/migrate.js";
|
|
20
21
|
import { formatUpgradeReport, upgradeCheck, upgradeCheckExitCode, } from "./commands/upgrade-check.js";
|
|
21
22
|
import { MIGRATION_LOCATIONS, resolveMigrationsDir } from "./migrations-dir.js";
|
|
22
|
-
/**
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Templates ship with the CLI package.
|
|
25
|
+
*
|
|
26
|
+
* `fileURLToPath`, not `new URL(...).pathname`: on Windows the latter
|
|
27
|
+
* yields `/C:/Users/...`, which every path operation after it treats as
|
|
28
|
+
* a root-relative path that does not exist. The CLI is the first thing
|
|
29
|
+
* a new user runs, so it is the worst place to be silently
|
|
30
|
+
* platform-specific.
|
|
31
|
+
*/
|
|
32
|
+
const TEMPLATES_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "templates");
|
|
24
33
|
/**
|
|
25
34
|
* Recorded in the manifest so an upgrade knows what wrote a file, and
|
|
26
35
|
* emitted as the dependency range of a scaffolded app. Read from this
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAq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Root":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACrC,CAAC;AAqCF,MAAM,MAAM,aAAa,GAAG;IAC1B,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnC,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,CAAC;AASF,wBAAgB,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,WAAW,EAAE,CA8NpE;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAK5D;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAE1D"}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* actually went wrong that way, not because they sounded thorough.
|
|
7
7
|
*/
|
|
8
8
|
import path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
9
10
|
import { existsSync, readFileSync } from "node:fs";
|
|
10
11
|
import { inspectMigrationChain, readMigrationChain } from "../migrations.js";
|
|
11
12
|
import { readManifest } from "../manifest.js";
|
|
@@ -16,8 +17,25 @@ import { MIGRATION_LOCATIONS, resolveMigrationsDir, } from "../migrations-dir.js
|
|
|
16
17
|
* without a registry checkout. `../../templates` resolves from src/
|
|
17
18
|
* and from dist/commands/ alike.
|
|
18
19
|
*/
|
|
20
|
+
/**
|
|
21
|
+
* Block and line comments removed, so a check cannot be satisfied — or
|
|
22
|
+
* defeated — by prose. The composition root's own doc comment names
|
|
23
|
+
* `registerModels` in several of the templates.
|
|
24
|
+
*/
|
|
25
|
+
function stripComments(text) {
|
|
26
|
+
return text
|
|
27
|
+
.replace(/\/\*[\s\S]*?\*\//g, "")
|
|
28
|
+
.replace(/(^|[^:])\/\/.*$/gm, "$1");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* templates/registry-requires.json is a build-time copy of
|
|
32
|
+
* packages/registry/requires.json (scripts/sync-registry-requires.mjs),
|
|
33
|
+
* committed so that running from source works too.
|
|
34
|
+
*/
|
|
19
35
|
function bundledRequires() {
|
|
20
|
-
const file = path.resolve(
|
|
36
|
+
const file = path.resolve(
|
|
37
|
+
// fileURLToPath, not `.pathname` — see the note in bin.ts.
|
|
38
|
+
path.dirname(fileURLToPath(import.meta.url)), "..", "..", "templates", "registry-requires.json");
|
|
21
39
|
if (!existsSync(file))
|
|
22
40
|
return null;
|
|
23
41
|
return JSON.parse(readFileSync(file, "utf8"));
|
|
@@ -75,8 +93,8 @@ export function runChecks(options = {}) {
|
|
|
75
93
|
status: "error",
|
|
76
94
|
detail: `Missing: ${missing.join(", ")}`,
|
|
77
95
|
});
|
|
78
|
-
// 3. Billing product. The engine has no built-in default
|
|
79
|
-
//
|
|
96
|
+
// 3. Billing product. The engine has no built-in default catalogue;
|
|
97
|
+
// an unset product means every plan
|
|
80
98
|
// lookup returns nothing and quotas silently read as zero.
|
|
81
99
|
results.push(env.INTELLIGO_BILLING_PRODUCT
|
|
82
100
|
? {
|
|
@@ -157,6 +175,47 @@ export function runChecks(options = {}) {
|
|
|
157
175
|
" — the route answers 403 until it is",
|
|
158
176
|
});
|
|
159
177
|
}
|
|
178
|
+
// 4c. Better-Auth's HTTP mount. Every auth item's form posts to
|
|
179
|
+
// `/api/auth/*` on this origin; without the catch-all route
|
|
180
|
+
// those requests 404 and the pages look broken for no visible
|
|
181
|
+
// reason.
|
|
182
|
+
if (existsSync(path.join(root, "app/[locale]/(auth)/layout.tsx"))) {
|
|
183
|
+
results.push(existsSync(path.join(root, "app/api/auth/[...all]/route.ts"))
|
|
184
|
+
? { name: "auth-mount", status: "ok", detail: "/api/auth mounted" }
|
|
185
|
+
: {
|
|
186
|
+
name: "auth-mount",
|
|
187
|
+
status: "error",
|
|
188
|
+
detail: "auth pages are installed but app/api/auth/[...all]/route.ts " +
|
|
189
|
+
"is missing — add `export { GET, POST } from " +
|
|
190
|
+
'"@intelligo-dev/next/auth";` there or every sign-in answers 404',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
// 4d. Model prices. The registry is open and nothing self-registers,
|
|
194
|
+
// so a composition root that never calls `registerModels` leaves
|
|
195
|
+
// admission with no price to estimate against: every request is
|
|
196
|
+
// refused with `unknown_model`, at runtime, on a deployment whose
|
|
197
|
+
// only mistake was omitting one line.
|
|
198
|
+
const compositionRoot = ["lib/intelligo.ts", "lib/intelligo.tsx"]
|
|
199
|
+
.map((rel) => path.join(root, rel))
|
|
200
|
+
.find((file) => existsSync(file));
|
|
201
|
+
if (compositionRoot) {
|
|
202
|
+
const source = readFileSync(compositionRoot, "utf8");
|
|
203
|
+
const registers = /\bregisterModels?\s*\(/.test(stripComments(source));
|
|
204
|
+
results.push(registers
|
|
205
|
+
? {
|
|
206
|
+
name: "models",
|
|
207
|
+
status: "ok",
|
|
208
|
+
detail: "the composition root registers model prices",
|
|
209
|
+
}
|
|
210
|
+
: {
|
|
211
|
+
name: "models",
|
|
212
|
+
status: "error",
|
|
213
|
+
detail: "no registerModels() in the composition root — admission cannot " +
|
|
214
|
+
"price any model and refuses every request with `unknown_model`. " +
|
|
215
|
+
"Add `registerModels(DEFAULT_MODELS)` from @intelligo-dev/executions, " +
|
|
216
|
+
"or your own catalogue",
|
|
217
|
+
});
|
|
218
|
+
}
|
|
160
219
|
// 5. Generated source. A conflict — template and consumer both
|
|
161
220
|
// moved — is the one state an upgrade cannot resolve on its own.
|
|
162
221
|
const manifest = readManifest(root);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAqB9B;;;;;GAKG;AACH,SAAS,eAAe;IACtB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,sBAAsB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AAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,4 +7,13 @@
|
|
|
7
7
|
export { runChecks, formatResults, exitCodeFor, type CheckResult, type DoctorOptions, } from "./commands/doctor.js";
|
|
8
8
|
export { migrateCheck, hashMigration, formatMigrateCheck, migrateCheckExitCode, type MigrateCheckResult, } from "./commands/migrate-check.js";
|
|
9
9
|
export { readMigrationChain, inspectMigrationChain, type MigrationChain, type ChainProblem, } from "./migrations.js";
|
|
10
|
+
/**
|
|
11
|
+
* Where the framework's chain lives. Exported because a consumer's own
|
|
12
|
+
* operational scripts — baselining a push-provisioned database, a
|
|
13
|
+
* one-off audit — otherwise hardcode
|
|
14
|
+
* `node_modules/@intelligo-dev/core/src/db/migrations`, which is right
|
|
15
|
+
* in an application and wrong in the framework repository, and which
|
|
16
|
+
* silently stops being either if the package layout ever changes.
|
|
17
|
+
*/
|
|
18
|
+
export { resolveMigrationsDir, MIGRATION_LOCATIONS } from "./migrations-dir.js";
|
|
10
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,kBAAkB,GACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,kBAAkB,GACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,4 +7,13 @@
|
|
|
7
7
|
export { runChecks, formatResults, exitCodeFor, } from "./commands/doctor.js";
|
|
8
8
|
export { migrateCheck, hashMigration, formatMigrateCheck, migrateCheckExitCode, } from "./commands/migrate-check.js";
|
|
9
9
|
export { readMigrationChain, inspectMigrationChain, } from "./migrations.js";
|
|
10
|
+
/**
|
|
11
|
+
* Where the framework's chain lives. Exported because a consumer's own
|
|
12
|
+
* operational scripts — baselining a push-provisioned database, a
|
|
13
|
+
* one-off audit — otherwise hardcode
|
|
14
|
+
* `node_modules/@intelligo-dev/core/src/db/migrations`, which is right
|
|
15
|
+
* in an application and wrong in the framework repository, and which
|
|
16
|
+
* silently stops being either if the package layout ever changes.
|
|
17
|
+
*/
|
|
18
|
+
export { resolveMigrationsDir, MIGRATION_LOCATIONS } from "./migrations-dir.js";
|
|
10
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,GAGZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GAGtB,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,GAGZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GAGtB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intelligo-dev/cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,14 +31,21 @@
|
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|
|
34
|
-
"templates"
|
|
34
|
+
"templates",
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"README.md",
|
|
37
|
+
"!dist/**/*.tsbuildinfo"
|
|
35
38
|
],
|
|
36
39
|
"publishConfig": {
|
|
37
40
|
"access": "public"
|
|
38
41
|
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=22"
|
|
44
|
+
},
|
|
45
|
+
"sideEffects": false,
|
|
39
46
|
"scripts": {
|
|
40
47
|
"type-check": "tsc --noEmit",
|
|
41
48
|
"lint": "eslint .",
|
|
42
|
-
"build": "tsc -p tsconfig.build.json"
|
|
49
|
+
"build": "node scripts/sync-registry-requires.mjs && tsc -p tsconfig.build.json && node ../../scripts/fix-esm-extensions.mjs dist"
|
|
43
50
|
}
|
|
44
51
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Better-Auth's HTTP mount.
|
|
3
|
+
*
|
|
4
|
+
* Every call the auth client makes is a request to `/api/auth/*` on
|
|
5
|
+
* this app's own origin; without this file none of those routes exist
|
|
6
|
+
* and every sign-in POST answers 404. The handlers come from
|
|
7
|
+
* `@intelligo-dev/next`, the framework's one Next.js adapter, so the
|
|
8
|
+
* consumer never has to depend on `better-auth` directly.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export { GET, POST } from "@intelligo-dev/next/auth";
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
edit them freely. Registry items you install with `shadcn add`
|
|
13
13
|
assume the shadcn new-york theme below; the ones under "Design
|
|
14
14
|
tokens" are optional extras used by some Intelligo-authored
|
|
15
|
-
registry items (status colors
|
|
16
|
-
what you don't use.
|
|
15
|
+
registry items (status colors) — delete what you don't use.
|
|
17
16
|
============================================================ */
|
|
18
17
|
|
|
19
18
|
/* ---- Light mode tokens ---- */
|
|
@@ -83,14 +82,6 @@
|
|
|
83
82
|
--letter-spacing-normal: 0em;
|
|
84
83
|
--letter-spacing-wide: 0.025em;
|
|
85
84
|
|
|
86
|
-
/* Agent identity colors */
|
|
87
|
-
--agent-career: #7c3aed;
|
|
88
|
-
--agent-university: #2563eb;
|
|
89
|
-
--agent-scholarship: #d97706;
|
|
90
|
-
--agent-student-life: #059669;
|
|
91
|
-
--agent-ai-futures: #e11d48;
|
|
92
|
-
--agent-parent: #92400e;
|
|
93
|
-
|
|
94
85
|
/* Weather (decorative/thematic) */
|
|
95
86
|
--weather-day-start: hsl(200 95% 65%); /* sky-400 equivalent */
|
|
96
87
|
--weather-day-mid: hsl(217 91% 60%); /* blue-500 equivalent */
|
|
@@ -280,12 +271,6 @@
|
|
|
280
271
|
--color-brand-accent: var(--brand-accent);
|
|
281
272
|
|
|
282
273
|
/* Agent color mappings */
|
|
283
|
-
--color-agent-career: var(--agent-career);
|
|
284
|
-
--color-agent-university: var(--agent-university);
|
|
285
|
-
--color-agent-scholarship: var(--agent-scholarship);
|
|
286
|
-
--color-agent-student-life: var(--agent-student-life);
|
|
287
|
-
--color-agent-ai-futures: var(--agent-ai-futures);
|
|
288
|
-
--color-agent-parent: var(--agent-parent);
|
|
289
274
|
|
|
290
275
|
/* Typography token mappings */
|
|
291
276
|
--font-size-xs: var(--font-size-xs);
|
|
@@ -25,7 +25,13 @@ import {
|
|
|
25
25
|
setDefaultProductSlug,
|
|
26
26
|
} from "@intelligo-dev/billing/plans";
|
|
27
27
|
import { assertEnv } from "@intelligo-dev/core/env";
|
|
28
|
-
import {
|
|
28
|
+
import { setRequestContextSource } from "@intelligo-dev/core/request-context";
|
|
29
|
+
import {
|
|
30
|
+
DEFAULT_MODELS,
|
|
31
|
+
createExecutions,
|
|
32
|
+
registerModels,
|
|
33
|
+
} from "@intelligo-dev/executions";
|
|
34
|
+
import { nextRequestContext } from "@intelligo-dev/next";
|
|
29
35
|
|
|
30
36
|
import { PLANS, FEATURES } from "./plans";
|
|
31
37
|
|
|
@@ -51,9 +57,22 @@ export function composeIntelligo(): void {
|
|
|
51
57
|
// something to discover deep inside a handler.
|
|
52
58
|
assertEnv();
|
|
53
59
|
|
|
60
|
+
// Where the framework reads the incoming request's headers from.
|
|
61
|
+
// Only this line knows the app is a Next.js one; `@intelligo-dev/auth`
|
|
62
|
+
// asks `@intelligo-dev/core/request-context` and stays usable from a
|
|
63
|
+
// worker or a test.
|
|
64
|
+
setRequestContextSource(nextRequestContext);
|
|
65
|
+
|
|
54
66
|
setDefaultProductSlug(PRODUCT_SLUG);
|
|
55
67
|
registerProductPlans(PRODUCT_SLUG, PLANS);
|
|
56
68
|
registerProductFeatures(PRODUCT_SLUG, FEATURES);
|
|
69
|
+
|
|
70
|
+
// What each model costs. The framework ships a catalogue as data and
|
|
71
|
+
// registers none of it: an id with no registered price throws where
|
|
72
|
+
// the price is needed, rather than being guessed. Swap in your own
|
|
73
|
+
// contracted rates, or add a model the framework has never heard of,
|
|
74
|
+
// by passing your own array here.
|
|
75
|
+
registerModels(DEFAULT_MODELS);
|
|
57
76
|
}
|
|
58
77
|
|
|
59
78
|
export const executions = createExecutions({
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
"@intelligo-dev/audit": "__INTELLIGO_DEP__",
|
|
18
18
|
"@intelligo-dev/auth": "__INTELLIGO_DEP__",
|
|
19
19
|
"@intelligo-dev/billing": "__INTELLIGO_DEP__",
|
|
20
|
+
"@intelligo-dev/chat": "__INTELLIGO_DEP__",
|
|
20
21
|
"@intelligo-dev/core": "__INTELLIGO_DEP__",
|
|
21
22
|
"@intelligo-dev/executions": "__INTELLIGO_DEP__",
|
|
22
23
|
"@intelligo-dev/jobs": "__INTELLIGO_DEP__",
|
|
24
|
+
"@intelligo-dev/next": "__INTELLIGO_DEP__",
|
|
23
25
|
"@intelligo-dev/ui": "__INTELLIGO_DEP__",
|
|
24
26
|
"@radix-ui/react-slot": "^1.2.4",
|
|
25
27
|
"class-variance-authority": "^0.7.1",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next 16 calls this file `proxy.ts`; `middleware.ts` is the Next 15
|
|
3
|
+
* name and still resolves, which is why a scaffold can be wrong here
|
|
4
|
+
* without anything failing. Using the current name keeps a generated
|
|
5
|
+
* app on the path the framework documents rather than the one it is
|
|
6
|
+
* migrating away from.
|
|
7
|
+
*
|
|
8
|
+
* Optimistic only: it redirects, and never touches the database. Every
|
|
9
|
+
* real check is server-side.
|
|
10
|
+
*/
|
|
11
|
+
import createIntlMiddleware from "next-intl/middleware";
|
|
12
|
+
|
|
13
|
+
import { routing } from "./i18n/routing";
|
|
14
|
+
|
|
15
|
+
export default createIntlMiddleware(routing);
|
|
16
|
+
|
|
17
|
+
export const config = {
|
|
18
|
+
// Run on everything except API routes, Next internals and static
|
|
19
|
+
// assets.
|
|
20
|
+
matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"],
|
|
21
|
+
};
|
package/templates/manifest.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"deprecated": "Superseded by the `usage` registry item — install it with the shadcn CLI from the Intelligo registry instead; it ships a full page, components and thin actions as consumer-owned source."
|
|
12
12
|
},
|
|
13
13
|
"app-scaffold": {
|
|
14
|
-
"templateVersion": "1.
|
|
14
|
+
"templateVersion": "1.9.0",
|
|
15
15
|
"description": "A new application: composition root, plans, an assistant route, a Stripe webhook endpoint, config, a drizzle config for the tables you own, next-intl i18n plumbing, and a registry-consuming shadcn/Tailwind setup",
|
|
16
16
|
"files": [
|
|
17
17
|
{
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"template": "app-scaffold/plans.ts.tpl",
|
|
39
39
|
"target": "lib/plans.ts"
|
|
40
40
|
},
|
|
41
|
+
{
|
|
42
|
+
"template": "app-scaffold/auth-route.ts.tpl",
|
|
43
|
+
"target": "app/api/auth/[...all]/route.ts"
|
|
44
|
+
},
|
|
41
45
|
{
|
|
42
46
|
"template": "app-scaffold/assistant-route.ts.tpl",
|
|
43
47
|
"target": "app/api/assistant/route.ts"
|
|
@@ -83,8 +87,8 @@
|
|
|
83
87
|
"target": "i18n/request.ts"
|
|
84
88
|
},
|
|
85
89
|
{
|
|
86
|
-
"template": "app-scaffold/
|
|
87
|
-
"target": "
|
|
90
|
+
"template": "app-scaffold/proxy.ts.tpl",
|
|
91
|
+
"target": "proxy.ts"
|
|
88
92
|
},
|
|
89
93
|
{
|
|
90
94
|
"template": "app-scaffold/messages-en-app.json.tpl",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "Machine-readable requirements of every registry item — what shadcn's schema cannot express. `scaffold`: consumer files `intelligo create` provides that items may import. Per item: `marker` (the file whose presence means the item is installed), `items` (sibling items that ship files this one imports — install them first), `files` (scaffold files it imports), `exports` (names a scaffold file must export), `features` (feature keys the item gates on; register them in lib/plans.ts). tests/architecture/registry.test.ts asserts this file matches the code; CI derives the install order from it; `intelligo doctor` checks an app against it (packages/cli/templates/registry-requires.json is a
|
|
2
|
+
"$comment": "Machine-readable requirements of every registry item — what shadcn's schema cannot express. `scaffold`: consumer files `intelligo create` provides that items may import. Per item: `marker` (the file whose presence means the item is installed), `items` (sibling items that ship files this one imports — install them first), `files` (scaffold files it imports), `exports` (names a scaffold file must export), `features` (feature keys the item gates on; register them in lib/plans.ts). tests/architecture/registry.test.ts asserts this file matches the code; CI derives the install order from it; `intelligo doctor` checks an app against it (packages/cli/templates/registry-requires.json is a copy the CLI build regenerates; the suite fails if it is stale).",
|
|
3
3
|
"scaffold": [
|
|
4
4
|
"lib/intelligo",
|
|
5
5
|
"lib/plans",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import createIntlMiddleware from "next-intl/middleware";
|
|
2
|
-
|
|
3
|
-
import { routing } from "./i18n/routing";
|
|
4
|
-
|
|
5
|
-
export default createIntlMiddleware(routing);
|
|
6
|
-
|
|
7
|
-
export const config = {
|
|
8
|
-
// Run on everything except API routes, Next internals and static
|
|
9
|
-
// assets.
|
|
10
|
-
matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"],
|
|
11
|
-
};
|