@axiom-lattice/lattice-cli 0.2.31 → 0.2.32
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/.eslintrc.json +8 -1
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +15 -0
- package/dist/cli.js +5 -4
- package/dist/cli.js.map +1 -1
- package/package.json +4 -4
- package/src/server.ts +4 -4
package/.eslintrc.json
CHANGED
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
"semi": ["warn", "always"],
|
|
18
18
|
"no-unused-vars": "off",
|
|
19
19
|
"@typescript-eslint/no-unused-vars": ["warn"],
|
|
20
|
-
"@typescript-eslint/no-explicit-any": "off"
|
|
20
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
21
|
+
"no-restricted-syntax": [
|
|
22
|
+
"error",
|
|
23
|
+
{
|
|
24
|
+
"selector": "ImportExpression[source.value='@axiom-lattice/core']",
|
|
25
|
+
"message": "Do not dynamically import @axiom-lattice/core: under a CJS host it resolves the ESM build and creates a SECOND module instance (separate store/model registries). Use a static top-level import."
|
|
26
|
+
}
|
|
27
|
+
]
|
|
21
28
|
}
|
|
22
29
|
}
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/lattice-cli@0.2.
|
|
2
|
+
> @axiom-lattice/lattice-cli@0.2.32 build /home/runner/work/agentic/agentic/packages/lattice-cli
|
|
3
3
|
> tsup src/cli.ts --format esm --dts --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/cli.ts
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mESM[39m [1mdist/cli.js [22m[32m9.
|
|
11
|
-
[32mESM[39m [1mdist/cli.js.map [22m[
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
10
|
+
[32mESM[39m [1mdist/cli.js [22m[32m9.67 KB[39m
|
|
11
|
+
[32mESM[39m [1mdist/cli.js.map [22m[32m17.89 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 63ms
|
|
13
13
|
[34mDTS[39m Build start
|
|
14
|
-
[32mDTS[39m ⚡️ Build success in
|
|
14
|
+
[32mDTS[39m ⚡️ Build success in 8566ms
|
|
15
15
|
[32mDTS[39m [1mdist/cli.d.ts [22m[32m20.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @axiom-lattice/lattice-cli
|
|
2
2
|
|
|
3
|
+
## 0.2.32
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [cb75780]
|
|
8
|
+
- Updated dependencies [c0f75e2]
|
|
9
|
+
- Updated dependencies [48e3ce3]
|
|
10
|
+
- Updated dependencies [3e923d0]
|
|
11
|
+
- Updated dependencies [99bf609]
|
|
12
|
+
- Updated dependencies [92bffbb]
|
|
13
|
+
- Updated dependencies [a19e0aa]
|
|
14
|
+
- @axiom-lattice/core@6.4.1
|
|
15
|
+
- @axiom-lattice/gateway@4.9.1
|
|
16
|
+
- @axiom-lattice/local-stores@3.2.5
|
|
17
|
+
|
|
3
18
|
## 0.2.31
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,11 @@ import { LatticeGateway } from "@axiom-lattice/gateway";
|
|
|
5
5
|
import {
|
|
6
6
|
configureStores,
|
|
7
7
|
sandboxLatticeManager,
|
|
8
|
-
createSandboxProvider
|
|
8
|
+
createSandboxProvider,
|
|
9
|
+
registerScheduleLattice,
|
|
10
|
+
MemoryLatticeManager,
|
|
11
|
+
registerCheckpointSaver,
|
|
12
|
+
getStoreLattice
|
|
9
13
|
} from "@axiom-lattice/core";
|
|
10
14
|
import {
|
|
11
15
|
createLocalStoreConfig,
|
|
@@ -77,7 +81,6 @@ async function startServer(options) {
|
|
|
77
81
|
await configureStores(stores, { autoDisposeStores: true });
|
|
78
82
|
if (schedule) {
|
|
79
83
|
try {
|
|
80
|
-
const { registerScheduleLattice } = await import("@axiom-lattice/core");
|
|
81
84
|
registerScheduleLattice("default", {
|
|
82
85
|
name: "Default Scheduler",
|
|
83
86
|
description: "Local schedule storage",
|
|
@@ -89,7 +92,6 @@ async function startServer(options) {
|
|
|
89
92
|
}
|
|
90
93
|
if (checkpoint) {
|
|
91
94
|
try {
|
|
92
|
-
const { MemoryLatticeManager, registerCheckpointSaver } = await import("@axiom-lattice/core");
|
|
93
95
|
MemoryLatticeManager.getInstance().removeCheckpointSaver("default");
|
|
94
96
|
registerCheckpointSaver("default", checkpoint);
|
|
95
97
|
console.log("[store] Checkpoint saver registered");
|
|
@@ -99,7 +101,6 @@ async function startServer(options) {
|
|
|
99
101
|
}
|
|
100
102
|
console.log("[store] Local SQLite stores ready");
|
|
101
103
|
try {
|
|
102
|
-
const { getStoreLattice } = await import("@axiom-lattice/core");
|
|
103
104
|
const tenantId = "default";
|
|
104
105
|
const tenantStore = getStoreLattice("default", "tenant").store;
|
|
105
106
|
const existingTenant = await tenantStore.getTenantById(tenantId).catch(() => null);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts","../src/cli.ts"],"sourcesContent":["import { LatticeGateway } from \"@axiom-lattice/gateway\";\nimport {\n configureStores,\n sandboxLatticeManager,\n createSandboxProvider,\n} from \"@axiom-lattice/core\";\nimport {\n createLocalStoreConfig,\n closeDatabase,\n initDatabase,\n} from \"@axiom-lattice/local-stores\";\nimport { LoggerType } from \"@axiom-lattice/protocols\";\nimport type { LoggerConfig } from \"@axiom-lattice/protocols\";\nimport type { DatabaseWrapper } from \"@axiom-lattice/local-stores\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport interface LatticeCliOptions {\n port: number;\n dbPath: string;\n sandboxBasePath: string;\n serveWeb: boolean;\n}\n\nfunction resolveWebDir(): string | null {\n // Look for apps/cli-web/dist (Vite build output)\n const repoRoot = path.resolve(__dirname, \"..\", \"..\", \"..\", \"apps\", \"cli-web\", \"dist\");\n if (fs.existsSync(repoRoot)) return repoRoot;\n return null;\n}\n\n/**\n * Fallback: create all local stores manually without checkpoint saver.\n * Used when createLocalStoreConfig fails due to better-sqlite3 not being available.\n */\nasync function createStoresFallback(\n db: DatabaseWrapper\n): Promise<Record<string, unknown>> {\n const mod = await import(\"@axiom-lattice/local-stores\");\n return {\n thread: new mod.LocalThreadStore(db),\n assistant: new mod.LocalAssistantStore(db),\n workspace: new mod.LocalWorkspaceStore(db),\n project: new mod.LocalProjectStore(db),\n user: new mod.LocalUserStore(db),\n tenant: new mod.LocalTenantStore(db),\n userTenantLink: new mod.LocalUserTenantLinkStore(db),\n database: new mod.LocalDatabaseConfigStore(db),\n metrics: new mod.LocalMetricsServerConfigStore(db),\n mcp: new mod.LocalMcpServerConfigStore(db),\n workflowTracking: new mod.LocalWorkflowTrackingStore(db),\n eval: new mod.LocalEvalStore(db),\n channelBinding: new mod.LocalChannelBindingStore(db),\n channelInstallation: new mod.LocalChannelInstallationStore(db),\n a2aApiKey: new mod.LocalA2AApiKeyStore(db),\n threadMessageQueue: new mod.LocalThreadMessageQueueStore(db),\n skill: new mod.LocalSkillStore(db),\n schedule: new mod.LocalScheduleStorage(db),\n };\n}\n\nexport async function startServer(options: LatticeCliOptions): Promise<void> {\n console.log(`\n╔═══════════════════════════════════════════╗\n║ Lattice Local Server ║\n║ Version: 0.1.0 ║\n║ Sandbox: local ║\n║ Stores: sqlite (sql.js) ║\n╚═══════════════════════════════════════════╝\n`);\n\n // 1. Initialize local SQLite stores\n console.log(`[store] Initializing local stores at ${options.dbPath} ...`);\n\n let stores: Record<string, unknown>;\n let checkpoint: unknown = undefined;\n\n try {\n const result = await createLocalStoreConfig({ dbPath: options.dbPath });\n stores = result as unknown as Record<string, unknown>;\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : String(e);\n if (msg.includes(\"better_sqlite3\") || msg.includes(\"bindings\")) {\n console.log(\"[store] better-sqlite3 unavailable, skipping checkpoint saver\");\n const db = await initDatabase({ dbPath: options.dbPath });\n stores = await createStoresFallback(db);\n } else {\n throw e;\n }\n }\n\n // Extract special keys\n const schedule = stores.schedule;\n checkpoint = stores.checkpoint;\n delete stores.schedule;\n delete stores.checkpoint;\n\n await configureStores(stores as Parameters<typeof configureStores>[0], { autoDisposeStores: true });\n\n // Register schedule storage\n if (schedule) {\n try {\n const { registerScheduleLattice } = await import(\"@axiom-lattice/core\");\n registerScheduleLattice(\"default\", {\n name: \"Default Scheduler\",\n description: \"Local schedule storage\",\n type: \"postgres\" as never,\n storage: schedule as never,\n });\n } catch { /* non-critical */ }\n }\n\n // Register checkpoint saver\n if (checkpoint) {\n try {\n const { MemoryLatticeManager, registerCheckpointSaver } = await import(\"@axiom-lattice/core\");\n MemoryLatticeManager.getInstance().removeCheckpointSaver(\"default\");\n registerCheckpointSaver(\"default\", checkpoint as Parameters<typeof registerCheckpointSaver>[1]);\n console.log(\"[store] Checkpoint saver registered\");\n } catch (e) {\n console.log(\"[store] Checkpoint saver skipped:\", e instanceof Error ? e.message : e);\n }\n }\n\n console.log(\"[store] Local SQLite stores ready\");\n\n // Seed default tenant, workspace, and project so the UI works out of the box\n try {\n const { getStoreLattice } = await import(\"@axiom-lattice/core\");\n\n const tenantId = \"default\";\n\n // Ensure default tenant exists\n const tenantStore = getStoreLattice(\"default\", \"tenant\").store as {\n getTenantById(id: string): Promise<unknown>;\n createTenant(id: string, data: { name: string }): Promise<unknown>;\n };\n const existingTenant = await tenantStore.getTenantById(tenantId).catch(() => null);\n if (!existingTenant) {\n await tenantStore.createTenant(tenantId, { name: \"Default\" });\n }\n\n // Ensure default user exists (onboarding will update the name)\n const userId = \"local\";\n const userStore = getStoreLattice(\"default\", \"user\").store as {\n getUserById(id: string): Promise<unknown>;\n createUser(id: string, data: { name: string; email: string }): Promise<unknown>;\n };\n const existingUser = await userStore.getUserById(userId).catch(() => null);\n if (!existingUser) {\n await userStore.createUser(userId, { name: \"Local User\", email: \"local@local\" });\n }\n\n // Ensure default workspace + project exist\n const wsStore = getStoreLattice(\"default\", \"workspace\").store as {\n getAllWorkspaces(tenantId: string): Promise<{ id: string }[]>;\n createWorkspace(tenantId: string, id: string, data: { name: string; storageType: string }): Promise<unknown>;\n };\n const pjStore = getStoreLattice(\"default\", \"project\").store as {\n getProjectsByWorkspace(tenantId: string, workspaceId: string): Promise<{ id: string }[]>;\n createProject(tenantId: string, workspaceId: string, id: string, data: { name: string }): Promise<unknown>;\n };\n const wss = await wsStore.getAllWorkspaces(tenantId);\n if (wss.length === 0) {\n const wsId = crypto.randomUUID();\n await wsStore.createWorkspace(tenantId, wsId, { name: \"Default\", storageType: \"sandbox\" });\n await pjStore.createProject(tenantId, wsId, crypto.randomUUID(), { name: \"Default Project\" });\n }\n\n // Ensure default assistant exists (model must be registered first via onboarding)\n const asStore = getStoreLattice(\"default\", \"assistant\").store as {\n getAssistantById(tenantId: string, id: string): Promise<unknown>;\n createAssistant(tenantId: string, id: string, data: { name: string; graphDefinition: unknown }): Promise<unknown>;\n };\n const existingAssistant = await asStore.getAssistantById(tenantId, \"default-assistant\").catch(() => null);\n if (!existingAssistant) {\n await asStore.createAssistant(tenantId, \"default-assistant\", {\n name: \"Default Assistant\",\n graphDefinition: {\n key: \"default-assistant\",\n type: \"react\",\n prompt: \"You are a helpful assistant.\",\n modelKey: \"default\",\n tools: [],\n },\n });\n }\n console.log(\"[store] Seeded tenant, user, workspace, project, and assistant\");\n } catch (e) {\n console.log(\"[store] Seed skipped:\", e instanceof Error ? e.message : e);\n }\n\n // 2. Register local sandbox provider\n console.log(`[sandbox] Initializing local sandbox at ${options.sandboxBasePath} ...`);\n const sandboxProvider = createSandboxProvider({\n type: \"local\",\n localSandboxBasePath: options.sandboxBasePath,\n });\n sandboxLatticeManager.registerLattice(\"default\", sandboxProvider);\n console.log(\"[sandbox] Local sandbox provider registered\");\n\n // 3. Swagger setup\n await LatticeGateway.configureSwagger(LatticeGateway.app);\n console.log(`[web] API docs: http://localhost:${options.port}/api-docs`);\n\n // 4. Serve web UI if requested\n if (options.serveWeb) {\n const webDir = resolveWebDir();\n if (webDir) {\n console.log(`[web] Serving chat UI from ${webDir}`);\n\n // SPA fallback: serve index.html for paths without an extension\n LatticeGateway.app.setNotFoundHandler((req, reply) => {\n if ((req.url || \"/\").startsWith(\"/api\")) {\n return reply.status(404).send({ success: false, error: \"Not found\" });\n }\n return reply.type(\"text/html\").send(fs.readFileSync(path.join(webDir, \"index.html\"), \"utf-8\"));\n });\n\n // Serve static assets\n LatticeGateway.app.get(\"/assets/*\", (req, reply) => {\n const p = (req.url || \"\").split(\"?\")[0].replace(/^\\/+/, \"\");\n const filePath = path.join(webDir, p);\n if (!fs.existsSync(filePath)) return reply.status(404).send(\"Not found\");\n const ext = path.extname(filePath);\n const ct: Record<string, string> = { \".js\": \"application/javascript\", \".css\": \"text/css\", \".svg\": \"image/svg+xml\", \".png\": \"image/png\", \".ico\": \"image/x-icon\", \".json\": \"application/json\" };\n return reply.type(ct[ext] || \"application/octet-stream\").send(fs.readFileSync(filePath));\n });\n\n console.log(`[web] Chat UI: http://localhost:${options.port}`);\n } else {\n console.log(\"[web] Web UI files not found (build apps/cli-web first: cd apps/cli-web && pnpm build)\");\n }\n }\n\n // 5. Start gateway\n const DEFAULT_LOGGER_CONFIG: LoggerConfig = {\n name: \"default\",\n description: \"Lattice CLI local server\",\n type: LoggerType.PINO,\n serviceName: \"lattice/cli\",\n loggerName: \"lattice/cli\",\n };\n\n LatticeGateway.startAsHttpEndpoint({\n port: options.port,\n queueServiceConfig: { type: \"memory\", defaultStartPollingQueue: true },\n loggerConfig: DEFAULT_LOGGER_CONFIG,\n });\n\n // Graceful shutdown\n const shutdown = async () => {\n console.log(\"\\n[shutdown] Closing database and stopping server...\");\n closeDatabase();\n await LatticeGateway.app.close();\n process.exit(0);\n };\n\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n}\n","#!/usr/bin/env node\nimport { startServer, type LatticeCliOptions } from \"./server.js\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\n\nfunction printHelp(): void {\n console.log(`\nlattice — Axiom Lattice local development server\n\nUsage:\n lattice [options]\n\nOptions:\n --port, -p <number> Server port (default: 4001)\n --db-path <path> SQLite database path (default: ~/.axiom/lattice.db)\n --sandbox-path <path> Sandbox base directory (default: ~/.axiom-local-sandbox)\n --web, -w Serve the chat web UI at /\n --help, -h Show this help\n\nExamples:\n lattice Start API-only on port 4001\n lattice --web Start with chat UI\n lattice -p 3000 --web Custom port with web UI\n lattice --db-path ./dev.db Custom database path\n`);\n}\n\nfunction parseArgs(): LatticeCliOptions | null {\n const args = process.argv.slice(2);\n\n if (args.includes(\"--help\") || args.includes(\"-h\")) {\n printHelp();\n return null;\n }\n\n const getArg = (flag: string): string | undefined => {\n const idx = args.findIndex((a) => a === flag);\n return idx !== -1 && args[idx + 1] ? args[idx + 1] : undefined;\n };\n\n const hasFlag = (flag: string): boolean => args.includes(flag);\n\n const portStr = getArg(\"--port\") ?? getArg(\"-p\");\n const port = portStr ? parseInt(portStr, 10) : 4001;\n\n return {\n port,\n dbPath: getArg(\"--db-path\") ?? path.join(os.homedir(), \".axiom\", \"lattice.db\"),\n sandboxBasePath: getArg(\"--sandbox-path\") ?? path.join(os.homedir(), \".axiom-local-sandbox\"),\n serveWeb: hasFlag(\"--web\") || hasFlag(\"-w\"),\n };\n}\n\nasync function main(): Promise<void> {\n const options = parseArgs();\n if (!options) return; // help printed\n\n try {\n await startServer(options);\n } catch (err) {\n console.error(\"Failed to start server:\", err);\n process.exit(1);\n }\n}\n\nmain();\n"],"mappings":";;;AAAA,SAAS,sBAAsB;AAC/B;AAAA,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M,KAAK,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI;AAAA,EACvD;AAEA,QAAM,UAAU,CAAC,SAA0B,KAAK,SAAS,IAAI;AAE7D,QAAM,UAAU,OAAO,QAAQ,KAAK,OAAO,IAAI;AAC/C,QAAM,OAAO,UAAU,SAAS,SAAS,EAAE,IAAI;AAE/C,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,OAAO,WAAW,KAAU,WAAQ,WAAQ,GAAG,UAAU,YAAY;AAAA,IAC7E,iBAAiB,OAAO,gBAAgB,KAAU,WAAQ,WAAQ,GAAG,sBAAsB;AAAA,IAC3F,UAAU,QAAQ,OAAO,KAAK,QAAQ,IAAI;AAAA,EAC5C;AACF;AAEA,eAAe,OAAsB;AACnC,QAAM,UAAU,UAAU;AAC1B,MAAI,CAAC,QAAS;AAEd,MAAI;AACF,UAAM,YAAY,OAAO;AAAA,EAC3B,SAAS,KAAK;AACZ,YAAQ,MAAM,2BAA2B,GAAG;AAC5C,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAEA,KAAK;","names":["path"]}
|
|
1
|
+
{"version":3,"sources":["../src/server.ts","../src/cli.ts"],"sourcesContent":["import { LatticeGateway } from \"@axiom-lattice/gateway\";\nimport {\n configureStores,\n sandboxLatticeManager,\n createSandboxProvider,\n registerScheduleLattice,\n MemoryLatticeManager,\n registerCheckpointSaver,\n getStoreLattice,\n} from \"@axiom-lattice/core\";\nimport {\n createLocalStoreConfig,\n closeDatabase,\n initDatabase,\n} from \"@axiom-lattice/local-stores\";\nimport { LoggerType } from \"@axiom-lattice/protocols\";\nimport type { LoggerConfig } from \"@axiom-lattice/protocols\";\nimport type { DatabaseWrapper } from \"@axiom-lattice/local-stores\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport interface LatticeCliOptions {\n port: number;\n dbPath: string;\n sandboxBasePath: string;\n serveWeb: boolean;\n}\n\nfunction resolveWebDir(): string | null {\n // Look for apps/cli-web/dist (Vite build output)\n const repoRoot = path.resolve(__dirname, \"..\", \"..\", \"..\", \"apps\", \"cli-web\", \"dist\");\n if (fs.existsSync(repoRoot)) return repoRoot;\n return null;\n}\n\n/**\n * Fallback: create all local stores manually without checkpoint saver.\n * Used when createLocalStoreConfig fails due to better-sqlite3 not being available.\n */\nasync function createStoresFallback(\n db: DatabaseWrapper\n): Promise<Record<string, unknown>> {\n const mod = await import(\"@axiom-lattice/local-stores\");\n return {\n thread: new mod.LocalThreadStore(db),\n assistant: new mod.LocalAssistantStore(db),\n workspace: new mod.LocalWorkspaceStore(db),\n project: new mod.LocalProjectStore(db),\n user: new mod.LocalUserStore(db),\n tenant: new mod.LocalTenantStore(db),\n userTenantLink: new mod.LocalUserTenantLinkStore(db),\n database: new mod.LocalDatabaseConfigStore(db),\n metrics: new mod.LocalMetricsServerConfigStore(db),\n mcp: new mod.LocalMcpServerConfigStore(db),\n workflowTracking: new mod.LocalWorkflowTrackingStore(db),\n eval: new mod.LocalEvalStore(db),\n channelBinding: new mod.LocalChannelBindingStore(db),\n channelInstallation: new mod.LocalChannelInstallationStore(db),\n a2aApiKey: new mod.LocalA2AApiKeyStore(db),\n threadMessageQueue: new mod.LocalThreadMessageQueueStore(db),\n skill: new mod.LocalSkillStore(db),\n schedule: new mod.LocalScheduleStorage(db),\n };\n}\n\nexport async function startServer(options: LatticeCliOptions): Promise<void> {\n console.log(`\n╔═══════════════════════════════════════════╗\n║ Lattice Local Server ║\n║ Version: 0.1.0 ║\n║ Sandbox: local ║\n║ Stores: sqlite (sql.js) ║\n╚═══════════════════════════════════════════╝\n`);\n\n // 1. Initialize local SQLite stores\n console.log(`[store] Initializing local stores at ${options.dbPath} ...`);\n\n let stores: Record<string, unknown>;\n let checkpoint: unknown = undefined;\n\n try {\n const result = await createLocalStoreConfig({ dbPath: options.dbPath });\n stores = result as unknown as Record<string, unknown>;\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : String(e);\n if (msg.includes(\"better_sqlite3\") || msg.includes(\"bindings\")) {\n console.log(\"[store] better-sqlite3 unavailable, skipping checkpoint saver\");\n const db = await initDatabase({ dbPath: options.dbPath });\n stores = await createStoresFallback(db);\n } else {\n throw e;\n }\n }\n\n // Extract special keys\n const schedule = stores.schedule;\n checkpoint = stores.checkpoint;\n delete stores.schedule;\n delete stores.checkpoint;\n\n await configureStores(stores as Parameters<typeof configureStores>[0], { autoDisposeStores: true });\n\n // Register schedule storage\n if (schedule) {\n try {\n registerScheduleLattice(\"default\", {\n name: \"Default Scheduler\",\n description: \"Local schedule storage\",\n type: \"postgres\" as never,\n storage: schedule as never,\n });\n } catch { /* non-critical */ }\n }\n\n // Register checkpoint saver\n if (checkpoint) {\n try {\n MemoryLatticeManager.getInstance().removeCheckpointSaver(\"default\");\n registerCheckpointSaver(\"default\", checkpoint as Parameters<typeof registerCheckpointSaver>[1]);\n console.log(\"[store] Checkpoint saver registered\");\n } catch (e) {\n console.log(\"[store] Checkpoint saver skipped:\", e instanceof Error ? e.message : e);\n }\n }\n\n console.log(\"[store] Local SQLite stores ready\");\n\n // Seed default tenant, workspace, and project so the UI works out of the box\n try {\n const tenantId = \"default\";\n\n // Ensure default tenant exists\n const tenantStore = getStoreLattice(\"default\", \"tenant\").store as {\n getTenantById(id: string): Promise<unknown>;\n createTenant(id: string, data: { name: string }): Promise<unknown>;\n };\n const existingTenant = await tenantStore.getTenantById(tenantId).catch(() => null);\n if (!existingTenant) {\n await tenantStore.createTenant(tenantId, { name: \"Default\" });\n }\n\n // Ensure default user exists (onboarding will update the name)\n const userId = \"local\";\n const userStore = getStoreLattice(\"default\", \"user\").store as {\n getUserById(id: string): Promise<unknown>;\n createUser(id: string, data: { name: string; email: string }): Promise<unknown>;\n };\n const existingUser = await userStore.getUserById(userId).catch(() => null);\n if (!existingUser) {\n await userStore.createUser(userId, { name: \"Local User\", email: \"local@local\" });\n }\n\n // Ensure default workspace + project exist\n const wsStore = getStoreLattice(\"default\", \"workspace\").store as {\n getAllWorkspaces(tenantId: string): Promise<{ id: string }[]>;\n createWorkspace(tenantId: string, id: string, data: { name: string; storageType: string }): Promise<unknown>;\n };\n const pjStore = getStoreLattice(\"default\", \"project\").store as {\n getProjectsByWorkspace(tenantId: string, workspaceId: string): Promise<{ id: string }[]>;\n createProject(tenantId: string, workspaceId: string, id: string, data: { name: string }): Promise<unknown>;\n };\n const wss = await wsStore.getAllWorkspaces(tenantId);\n if (wss.length === 0) {\n const wsId = crypto.randomUUID();\n await wsStore.createWorkspace(tenantId, wsId, { name: \"Default\", storageType: \"sandbox\" });\n await pjStore.createProject(tenantId, wsId, crypto.randomUUID(), { name: \"Default Project\" });\n }\n\n // Ensure default assistant exists (model must be registered first via onboarding)\n const asStore = getStoreLattice(\"default\", \"assistant\").store as {\n getAssistantById(tenantId: string, id: string): Promise<unknown>;\n createAssistant(tenantId: string, id: string, data: { name: string; graphDefinition: unknown }): Promise<unknown>;\n };\n const existingAssistant = await asStore.getAssistantById(tenantId, \"default-assistant\").catch(() => null);\n if (!existingAssistant) {\n await asStore.createAssistant(tenantId, \"default-assistant\", {\n name: \"Default Assistant\",\n graphDefinition: {\n key: \"default-assistant\",\n type: \"react\",\n prompt: \"You are a helpful assistant.\",\n modelKey: \"default\",\n tools: [],\n },\n });\n }\n console.log(\"[store] Seeded tenant, user, workspace, project, and assistant\");\n } catch (e) {\n console.log(\"[store] Seed skipped:\", e instanceof Error ? e.message : e);\n }\n\n // 2. Register local sandbox provider\n console.log(`[sandbox] Initializing local sandbox at ${options.sandboxBasePath} ...`);\n const sandboxProvider = createSandboxProvider({\n type: \"local\",\n localSandboxBasePath: options.sandboxBasePath,\n });\n sandboxLatticeManager.registerLattice(\"default\", sandboxProvider);\n console.log(\"[sandbox] Local sandbox provider registered\");\n\n // 3. Swagger setup\n await LatticeGateway.configureSwagger(LatticeGateway.app);\n console.log(`[web] API docs: http://localhost:${options.port}/api-docs`);\n\n // 4. Serve web UI if requested\n if (options.serveWeb) {\n const webDir = resolveWebDir();\n if (webDir) {\n console.log(`[web] Serving chat UI from ${webDir}`);\n\n // SPA fallback: serve index.html for paths without an extension\n LatticeGateway.app.setNotFoundHandler((req, reply) => {\n if ((req.url || \"/\").startsWith(\"/api\")) {\n return reply.status(404).send({ success: false, error: \"Not found\" });\n }\n return reply.type(\"text/html\").send(fs.readFileSync(path.join(webDir, \"index.html\"), \"utf-8\"));\n });\n\n // Serve static assets\n LatticeGateway.app.get(\"/assets/*\", (req, reply) => {\n const p = (req.url || \"\").split(\"?\")[0].replace(/^\\/+/, \"\");\n const filePath = path.join(webDir, p);\n if (!fs.existsSync(filePath)) return reply.status(404).send(\"Not found\");\n const ext = path.extname(filePath);\n const ct: Record<string, string> = { \".js\": \"application/javascript\", \".css\": \"text/css\", \".svg\": \"image/svg+xml\", \".png\": \"image/png\", \".ico\": \"image/x-icon\", \".json\": \"application/json\" };\n return reply.type(ct[ext] || \"application/octet-stream\").send(fs.readFileSync(filePath));\n });\n\n console.log(`[web] Chat UI: http://localhost:${options.port}`);\n } else {\n console.log(\"[web] Web UI files not found (build apps/cli-web first: cd apps/cli-web && pnpm build)\");\n }\n }\n\n // 5. Start gateway\n const DEFAULT_LOGGER_CONFIG: LoggerConfig = {\n name: \"default\",\n description: \"Lattice CLI local server\",\n type: LoggerType.PINO,\n serviceName: \"lattice/cli\",\n loggerName: \"lattice/cli\",\n };\n\n LatticeGateway.startAsHttpEndpoint({\n port: options.port,\n queueServiceConfig: { type: \"memory\", defaultStartPollingQueue: true },\n loggerConfig: DEFAULT_LOGGER_CONFIG,\n });\n\n // Graceful shutdown\n const shutdown = async () => {\n console.log(\"\\n[shutdown] Closing database and stopping server...\");\n closeDatabase();\n await LatticeGateway.app.close();\n process.exit(0);\n };\n\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n}\n","#!/usr/bin/env node\nimport { startServer, type LatticeCliOptions } from \"./server.js\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\n\nfunction printHelp(): void {\n console.log(`\nlattice — Axiom Lattice local development server\n\nUsage:\n lattice [options]\n\nOptions:\n --port, -p <number> Server port (default: 4001)\n --db-path <path> SQLite database path (default: ~/.axiom/lattice.db)\n --sandbox-path <path> Sandbox base directory (default: ~/.axiom-local-sandbox)\n --web, -w Serve the chat web UI at /\n --help, -h Show this help\n\nExamples:\n lattice Start API-only on port 4001\n lattice --web Start with chat UI\n lattice -p 3000 --web Custom port with web UI\n lattice --db-path ./dev.db Custom database path\n`);\n}\n\nfunction parseArgs(): LatticeCliOptions | null {\n const args = process.argv.slice(2);\n\n if (args.includes(\"--help\") || args.includes(\"-h\")) {\n printHelp();\n return null;\n }\n\n const getArg = (flag: string): string | undefined => {\n const idx = args.findIndex((a) => a === flag);\n return idx !== -1 && args[idx + 1] ? args[idx + 1] : undefined;\n };\n\n const hasFlag = (flag: string): boolean => args.includes(flag);\n\n const portStr = getArg(\"--port\") ?? getArg(\"-p\");\n const port = portStr ? parseInt(portStr, 10) : 4001;\n\n return {\n port,\n dbPath: getArg(\"--db-path\") ?? path.join(os.homedir(), \".axiom\", \"lattice.db\"),\n sandboxBasePath: getArg(\"--sandbox-path\") ?? path.join(os.homedir(), \".axiom-local-sandbox\"),\n serveWeb: hasFlag(\"--web\") || hasFlag(\"-w\"),\n };\n}\n\nasync function main(): Promise<void> {\n const options = parseArgs();\n if (!options) return; // help printed\n\n try {\n await startServer(options);\n } catch (err) {\n console.error(\"Failed to start server:\", err);\n process.exit(1);\n }\n}\n\nmain();\n"],"mappings":";;;AAAA,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAG3B,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,qBAAqB;AAE9B,IAAM,YAA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Q,WAAQ,GAAG,sBAAsB;AAAA,IAC3F,UAAU,QAAQ,OAAO,KAAK,QAAQ,IAAI;AAAA,EAC5C;AACF;AAEA,eAAe,OAAsB;AACnC,QAAM,UAAU,UAAU;AAC1B,MAAI,CAAC,QAAS;AAEd,MAAI;AACF,UAAM,YAAY,OAAO;AAAA,EAC3B,SAAS,KAAK;AACZ,YAAQ,MAAM,2BAA2B,GAAG;AAC5C,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAEA,KAAK;","names":["path"]}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axiom-lattice/lattice-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.32",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"lattice": "./dist/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@axiom-lattice/core": "6.4.
|
|
11
|
-
"@axiom-lattice/gateway": "4.9.
|
|
12
|
-
"@axiom-lattice/local-stores": "3.2.
|
|
10
|
+
"@axiom-lattice/core": "6.4.1",
|
|
11
|
+
"@axiom-lattice/gateway": "4.9.1",
|
|
12
|
+
"@axiom-lattice/local-stores": "3.2.5",
|
|
13
13
|
"@axiom-lattice/protocols": "4.8.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
package/src/server.ts
CHANGED
|
@@ -3,6 +3,10 @@ import {
|
|
|
3
3
|
configureStores,
|
|
4
4
|
sandboxLatticeManager,
|
|
5
5
|
createSandboxProvider,
|
|
6
|
+
registerScheduleLattice,
|
|
7
|
+
MemoryLatticeManager,
|
|
8
|
+
registerCheckpointSaver,
|
|
9
|
+
getStoreLattice,
|
|
6
10
|
} from "@axiom-lattice/core";
|
|
7
11
|
import {
|
|
8
12
|
createLocalStoreConfig,
|
|
@@ -103,7 +107,6 @@ export async function startServer(options: LatticeCliOptions): Promise<void> {
|
|
|
103
107
|
// Register schedule storage
|
|
104
108
|
if (schedule) {
|
|
105
109
|
try {
|
|
106
|
-
const { registerScheduleLattice } = await import("@axiom-lattice/core");
|
|
107
110
|
registerScheduleLattice("default", {
|
|
108
111
|
name: "Default Scheduler",
|
|
109
112
|
description: "Local schedule storage",
|
|
@@ -116,7 +119,6 @@ export async function startServer(options: LatticeCliOptions): Promise<void> {
|
|
|
116
119
|
// Register checkpoint saver
|
|
117
120
|
if (checkpoint) {
|
|
118
121
|
try {
|
|
119
|
-
const { MemoryLatticeManager, registerCheckpointSaver } = await import("@axiom-lattice/core");
|
|
120
122
|
MemoryLatticeManager.getInstance().removeCheckpointSaver("default");
|
|
121
123
|
registerCheckpointSaver("default", checkpoint as Parameters<typeof registerCheckpointSaver>[1]);
|
|
122
124
|
console.log("[store] Checkpoint saver registered");
|
|
@@ -129,8 +131,6 @@ export async function startServer(options: LatticeCliOptions): Promise<void> {
|
|
|
129
131
|
|
|
130
132
|
// Seed default tenant, workspace, and project so the UI works out of the box
|
|
131
133
|
try {
|
|
132
|
-
const { getStoreLattice } = await import("@axiom-lattice/core");
|
|
133
|
-
|
|
134
134
|
const tenantId = "default";
|
|
135
135
|
|
|
136
136
|
// Ensure default tenant exists
|