@cogito.ai/cli 0.3.3 → 0.3.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/dist/index.js +58 -6
- package/dist/templates/web-nextjs/apps/web/middleware.ts +6 -13
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/layout.tsx +7 -1
- package/dist/templates/web-nextjs/package.json +0 -1
- package/dist/templates/web-nextjs/packages/openspec-docs-sync/package.json +1 -0
- package/package.json +1 -1
- /package/dist/templates/web-nextjs/{.env.example → apps/web/.env.example} +0 -0
package/dist/index.js
CHANGED
|
@@ -863,6 +863,55 @@ function checkVersion(cliVersion, minCliVersion, templateId) {
|
|
|
863
863
|
}
|
|
864
864
|
}
|
|
865
865
|
|
|
866
|
+
// package.json
|
|
867
|
+
var package_default;
|
|
868
|
+
var init_package = __esm(() => {
|
|
869
|
+
package_default = {
|
|
870
|
+
name: "@cogito.ai/cli",
|
|
871
|
+
version: "0.3.5",
|
|
872
|
+
type: "module",
|
|
873
|
+
description: "AgentDock CLI – scaffold projects for humans and AI agents",
|
|
874
|
+
publishConfig: {
|
|
875
|
+
access: "public"
|
|
876
|
+
},
|
|
877
|
+
bin: {
|
|
878
|
+
agentdock: "./dist/index.js"
|
|
879
|
+
},
|
|
880
|
+
main: "./dist/index.js",
|
|
881
|
+
files: [
|
|
882
|
+
"dist/"
|
|
883
|
+
],
|
|
884
|
+
engines: {
|
|
885
|
+
node: ">=18"
|
|
886
|
+
},
|
|
887
|
+
scripts: {
|
|
888
|
+
build: "pnpm run generate-registry && bun build bin/agentdock.ts --outfile dist/index.js --target node && cp src/registry.json dist/registry.json && rm -rf dist/templates && mkdir -p dist/templates && rsync -a --exclude='node_modules/' --exclude='.next/' --exclude='.turbo/' ../../templates/ dist/templates/",
|
|
889
|
+
"generate-registry": "tsx ../../scripts/generate-registry/index.ts",
|
|
890
|
+
"check-types": "tsc --noEmit",
|
|
891
|
+
test: "vitest run"
|
|
892
|
+
},
|
|
893
|
+
dependencies: {
|
|
894
|
+
citty: "^0.1.6",
|
|
895
|
+
"@clack/prompts": "^0.9.1",
|
|
896
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
897
|
+
giget: "^1.2.4"
|
|
898
|
+
},
|
|
899
|
+
devDependencies: {
|
|
900
|
+
"@cogito.ai/tsconfig": "workspace:*",
|
|
901
|
+
"@types/node": "^20.0.0",
|
|
902
|
+
bun: "latest",
|
|
903
|
+
vitest: "^4.1.8"
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
// src/version.ts
|
|
909
|
+
var VERSION;
|
|
910
|
+
var init_version = __esm(() => {
|
|
911
|
+
init_package();
|
|
912
|
+
VERSION = package_default.version;
|
|
913
|
+
});
|
|
914
|
+
|
|
866
915
|
// src/core/scaffold.ts
|
|
867
916
|
import {
|
|
868
917
|
cpSync,
|
|
@@ -894,6 +943,7 @@ function rewritePackageJson(pkgJsonPath, name, resolvedDependencies) {
|
|
|
894
943
|
pkg["version"] = "0.1.0";
|
|
895
944
|
delete pkg["private"];
|
|
896
945
|
delete pkg["agentdock"];
|
|
946
|
+
delete pkg["packageManager"];
|
|
897
947
|
for (const key of ["dependencies", "devDependencies", "peerDependencies"]) {
|
|
898
948
|
const deps = pkg[key];
|
|
899
949
|
if (!deps)
|
|
@@ -910,7 +960,7 @@ function rewritePackageJson(pkgJsonPath, name, resolvedDependencies) {
|
|
|
910
960
|
function scaffoldProject(options) {
|
|
911
961
|
const { targetDir, name, template, packageManager: _pm } = options;
|
|
912
962
|
try {
|
|
913
|
-
checkVersion(
|
|
963
|
+
checkVersion(VERSION, template.minCliVersion, template.id);
|
|
914
964
|
} catch (err) {
|
|
915
965
|
return {
|
|
916
966
|
ok: false,
|
|
@@ -947,8 +997,9 @@ function scaffoldProject(options) {
|
|
|
947
997
|
};
|
|
948
998
|
}
|
|
949
999
|
}
|
|
950
|
-
var
|
|
951
|
-
|
|
1000
|
+
var init_scaffold = __esm(() => {
|
|
1001
|
+
init_version();
|
|
1002
|
+
});
|
|
952
1003
|
|
|
953
1004
|
// src/adapters/agent.ts
|
|
954
1005
|
var exports_agent = {};
|
|
@@ -16316,7 +16367,7 @@ __export(exports_server, {
|
|
|
16316
16367
|
startMcpServer: () => startMcpServer
|
|
16317
16368
|
});
|
|
16318
16369
|
async function startMcpServer() {
|
|
16319
|
-
const server = new Server({ name: "agentdock", version:
|
|
16370
|
+
const server = new Server({ name: "agentdock", version: VERSION }, {
|
|
16320
16371
|
capabilities: {
|
|
16321
16372
|
tools: {}
|
|
16322
16373
|
}
|
|
@@ -16380,12 +16431,12 @@ async function startMcpServer() {
|
|
|
16380
16431
|
process.exit(0);
|
|
16381
16432
|
});
|
|
16382
16433
|
}
|
|
16383
|
-
var PKG_VERSION = "0.1.0";
|
|
16384
16434
|
var init_server3 = __esm(() => {
|
|
16385
16435
|
init_server2();
|
|
16386
16436
|
init_stdio2();
|
|
16387
16437
|
init_types();
|
|
16388
16438
|
init_tools();
|
|
16439
|
+
init_version();
|
|
16389
16440
|
});
|
|
16390
16441
|
|
|
16391
16442
|
// ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
@@ -17854,11 +17905,12 @@ var mcpCommand = defineCommand({
|
|
|
17854
17905
|
});
|
|
17855
17906
|
|
|
17856
17907
|
// src/main.ts
|
|
17908
|
+
init_version();
|
|
17857
17909
|
var main = defineCommand({
|
|
17858
17910
|
meta: {
|
|
17859
17911
|
name: "agentdock",
|
|
17860
17912
|
description: "AgentDock CLI – scaffold projects for humans and AI agents",
|
|
17861
|
-
version:
|
|
17913
|
+
version: VERSION
|
|
17862
17914
|
},
|
|
17863
17915
|
subCommands: {
|
|
17864
17916
|
init: initCommand,
|
|
@@ -20,20 +20,13 @@ function copyCookies(from: NextResponse, to: NextResponse) {
|
|
|
20
20
|
export default async function middleware(request: NextRequest) {
|
|
21
21
|
const pathname = request.nextUrl.pathname
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const url = request.nextUrl.clone()
|
|
25
|
-
url.pathname = `/${defaultLocale}`
|
|
26
|
-
return NextResponse.redirect(url)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Skip Supabase session refresh for the auth callback route
|
|
30
|
-
// (it's handled by the route handler itself)
|
|
23
|
+
// Auth callback is handled by its own route handler — skip all middleware processing
|
|
31
24
|
if (pathname.startsWith('/auth/')) {
|
|
32
25
|
return NextResponse.next()
|
|
33
26
|
}
|
|
34
27
|
|
|
35
|
-
// 1. Let next-intl
|
|
36
|
-
//
|
|
28
|
+
// 1. Let next-intl handle locale routing.
|
|
29
|
+
// With localePrefix: 'always' (default), this also redirects / → /${defaultLocale}.
|
|
37
30
|
const response = handleI18nRouting(request)
|
|
38
31
|
|
|
39
32
|
// 2. Refresh the Supabase session (keeps token alive, writes updated cookie)
|
|
@@ -54,7 +47,7 @@ export default async function middleware(request: NextRequest) {
|
|
|
54
47
|
return redirectResponse
|
|
55
48
|
}
|
|
56
49
|
|
|
57
|
-
// 4. Normalize unknown locale-like prefixes: /fr/hello
|
|
50
|
+
// 4. Normalize unknown locale-like prefixes: /fr/hello → /zh/hello
|
|
58
51
|
const segments = pathname.split('/').filter(Boolean)
|
|
59
52
|
const firstSegment = segments[0]
|
|
60
53
|
|
|
@@ -74,6 +67,6 @@ export default async function middleware(request: NextRequest) {
|
|
|
74
67
|
|
|
75
68
|
export const config = {
|
|
76
69
|
// Match all pathnames except Next.js internals, static files, and auth callback.
|
|
77
|
-
// The
|
|
78
|
-
matcher: ['/
|
|
70
|
+
// The regex also matches '/' so next-intl handles the root → /${defaultLocale} redirect.
|
|
71
|
+
matcher: ['/((?!_next|_vercel|auth/callback|.*\\..*).*)'],
|
|
79
72
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Metadata } from 'next'
|
|
2
|
+
import { Inter } from 'next/font/google'
|
|
2
3
|
import { NextIntlClientProvider } from 'next-intl'
|
|
3
4
|
import { getMessages } from 'next-intl/server'
|
|
4
5
|
import { ThemeProvider } from 'next-themes'
|
|
@@ -7,6 +8,11 @@ import { Toaster } from '@/components/ui/sonner'
|
|
|
7
8
|
import { isLocale } from '@/i18n/config'
|
|
8
9
|
import './globals.css'
|
|
9
10
|
|
|
11
|
+
const inter = Inter({
|
|
12
|
+
subsets: ['latin'],
|
|
13
|
+
variable: '--font-sans',
|
|
14
|
+
})
|
|
15
|
+
|
|
10
16
|
export const metadata: Metadata = {
|
|
11
17
|
title: 'AgentDock Web Template',
|
|
12
18
|
description: 'Generated by AgentDock scaffold platform',
|
|
@@ -29,7 +35,7 @@ export default async function LocaleLayout({
|
|
|
29
35
|
|
|
30
36
|
return (
|
|
31
37
|
<html lang={locale} suppressHydrationWarning>
|
|
32
|
-
<body className=
|
|
38
|
+
<body className={`${inter.variable} min-h-screen bg-background font-sans antialiased`}>
|
|
33
39
|
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
|
|
34
40
|
<NextIntlClientProvider messages={messages}>
|
|
35
41
|
{children}
|
package/package.json
CHANGED
|
File without changes
|