spine-framework 0.2.1 → 1.0.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/LICENSE.md +213 -8
- package/README.md +327 -0
- package/package.json +107 -217
- package/src/cli/commands/init.ts +192 -0
- package/src/cli/commands/install.ts +25 -0
- package/src/cli/commands/list.ts +33 -0
- package/src/cli/commands/migrate.ts +24 -0
- package/src/cli/index.ts +46 -0
- package/src/components/AppLayout.tsx +21 -0
- package/src/components/AuthGuard.tsx +21 -0
- package/src/components/RoleGuard.tsx +23 -0
- package/src/components/index.ts +3 -0
- package/src/contexts/AppContext.tsx +122 -0
- package/src/contexts/AuthContext.tsx +87 -0
- package/src/contexts/SpineContext.tsx +46 -0
- package/src/contexts/index.ts +3 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useItems.ts +78 -0
- package/src/hooks/useThreads.ts +73 -0
- package/src/hooks/useWebSocket.ts +97 -0
- package/src/index.ts +22 -0
- package/src/types/index.ts +163 -0
- package/src/utils/api.ts +88 -0
- package/src/utils/client.ts +146 -0
- package/src/utils/config.ts +20 -0
- package/src/utils/index.ts +3 -0
- package/.framework/README.md +0 -129
- package/.framework/cli/bin.cjs +0 -14
- package/.framework/cli/commands/agents.ts +0 -153
- package/.framework/cli/commands/auth.ts +0 -94
- package/.framework/cli/commands/create-app.ts +0 -185
- package/.framework/cli/commands/dev.ts +0 -113
- package/.framework/cli/commands/doctor.ts +0 -442
- package/.framework/cli/commands/generate.ts +0 -332
- package/.framework/cli/commands/init.ts +0 -186
- package/.framework/cli/commands/install-app.ts +0 -565
- package/.framework/cli/commands/items.ts +0 -253
- package/.framework/cli/commands/migrate.ts +0 -139
- package/.framework/cli/commands/migrations.ts +0 -141
- package/.framework/cli/commands/pipelines.ts +0 -166
- package/.framework/cli/commands/status.ts +0 -197
- package/.framework/cli/commands/system.ts +0 -184
- package/.framework/cli/commands/test.ts +0 -227
- package/.framework/cli/commands/uninstall-app.ts +0 -166
- package/.framework/cli/context.ts +0 -268
- package/.framework/cli/env-loader.ts +0 -36
- package/.framework/cli/index.ts +0 -116
- package/.framework/cli/welcome.cjs +0 -45
- package/.framework/docs/API.md +0 -384
- package/.framework/docs/STABILITY.md +0 -52
- package/.framework/docs/admin-routes.md +0 -76
- package/.framework/docs/api-docs-progress.md +0 -38
- package/.framework/docs/api-governance.md +0 -146
- package/.framework/docs/api-testing-results.md +0 -212
- package/.framework/docs/apis/admin-configs.md +0 -567
- package/.framework/docs/apis/admin-data.md +0 -272
- package/.framework/docs/apis/index.md +0 -231
- package/.framework/docs/apis/internal.md +0 -295
- package/.framework/docs/apis/runtime.md +0 -537
- package/.framework/docs/assembly-launch-guide.md +0 -138
- package/.framework/docs/audit-results.md +0 -590
- package/.framework/docs/authorization-model.md +0 -170
- package/.framework/docs/db-api-inventory.md +0 -95
- package/.framework/docs/examples/custom-app/README.md +0 -77
- package/.framework/docs/examples/custom-function/README.md +0 -27
- package/.framework/docs/examples/custom-function/handler.ts +0 -48
- package/.framework/docs/examples/custom-webhook/README.md +0 -68
- package/.framework/docs/gap-remediation-backlog.md +0 -103
- package/.framework/docs/guides/cli-guide.md +0 -224
- package/.framework/docs/guides/getting-started.md +0 -103
- package/.framework/docs/guides/import-guide.md +0 -193
- package/.framework/docs/guides/testing-guide.md +0 -229
- package/.framework/docs/permission-examples.md +0 -326
- package/.framework/docs/ui-adoption-verification.md +0 -111
- package/.framework/docs/ui-api-coverage.md +0 -84
- package/.framework/docs/v2-compatibility-audit.md +0 -228
- package/.framework/functions/.gitkeep +0 -1
- package/.framework/functions/_shared/agent-runner.ts +0 -1097
- package/.framework/functions/_shared/app-manifest.ts +0 -184
- package/.framework/functions/_shared/audit.ts +0 -150
- package/.framework/functions/_shared/db.ts +0 -178
- package/.framework/functions/_shared/index.ts +0 -391
- package/.framework/functions/_shared/middleware.ts +0 -490
- package/.framework/functions/_shared/permissions.ts +0 -1325
- package/.framework/functions/_shared/pipeline-runner.ts +0 -731
- package/.framework/functions/_shared/principal.ts +0 -818
- package/.framework/functions/_shared/resolve-ids.ts +0 -106
- package/.framework/functions/_shared/schema-utils.ts +0 -967
- package/.framework/functions/_shared/testing.ts +0 -258
- package/.framework/functions/_shared/trigger-engine.ts +0 -425
- package/.framework/functions/_shared/webhook-registration.ts +0 -168
- package/.framework/functions/_shared/webhook-registry.ts +0 -129
- package/.framework/functions/account-nodes.ts +0 -111
- package/.framework/functions/admin-data.ts +0 -606
- package/.framework/functions/ai-agents.ts +0 -323
- package/.framework/functions/api-keys.ts +0 -376
- package/.framework/functions/apps.ts +0 -483
- package/.framework/functions/auth.ts +0 -196
- package/.framework/functions/debug-auth.ts +0 -107
- package/.framework/functions/embeddings.ts +0 -556
- package/.framework/functions/integration-routes.ts +0 -523
- package/.framework/functions/integrations.ts +0 -319
- package/.framework/functions/item-progress.ts +0 -272
- package/.framework/functions/logs.ts +0 -438
- package/.framework/functions/observability.ts +0 -275
- package/.framework/functions/pipeline-executions.ts +0 -494
- package/.framework/functions/pipelines.ts +0 -485
- package/.framework/functions/prompt-configs.ts +0 -339
- package/.framework/functions/roles.ts +0 -387
- package/.framework/functions/system-cron.ts +0 -742
- package/.framework/functions/system.ts +0 -323
- package/.framework/functions/tests.ts +0 -119
- package/.framework/functions/timers.ts +0 -357
- package/.framework/functions/triggers.ts +0 -563
- package/.framework/functions/types.ts +0 -604
- package/.framework/index.html +0 -16
- package/.framework/migrations/000_foundation.sql +0 -1266
- package/.framework/migrations/001_seed.sql +0 -163
- package/.framework/migrations/002_seed_constraints.sql +0 -19
- package/.framework/migrations/003_auth_user_trigger.sql +0 -67
- package/.framework/src/App.tsx +0 -133
- package/.framework/src/apps/admin/index.tsx +0 -173
- package/.framework/src/components/AppWrapper.tsx +0 -56
- package/.framework/src/components/CustomAppLoader.tsx +0 -116
- package/.framework/src/components/admin/AdminListPage.tsx +0 -151
- package/.framework/src/components/admin/AdminSidebar.tsx +0 -166
- package/.framework/src/components/admin/AdminStatsCard.tsx +0 -62
- package/.framework/src/components/admin/SortableTableHeader.tsx +0 -42
- package/.framework/src/components/app-shell/GenericAppShell.tsx +0 -181
- package/.framework/src/components/app-shell/GenericDetailPage.tsx +0 -200
- package/.framework/src/components/app-shell/GenericListPage.tsx +0 -116
- package/.framework/src/components/app-sidebar.tsx +0 -228
- package/.framework/src/components/auth/ProtectedRoute.tsx +0 -88
- package/.framework/src/components/layout/AppShell.tsx +0 -91
- package/.framework/src/components/layout/Header.tsx +0 -88
- package/.framework/src/components/layout/Layout.tsx +0 -95
- package/.framework/src/components/layout/Sidebar.tsx +0 -329
- package/.framework/src/components/runtime/DataDetailHeader.tsx +0 -77
- package/.framework/src/components/runtime/DataDetailPage.tsx +0 -171
- package/.framework/src/components/runtime/DataFilters.tsx +0 -91
- package/.framework/src/components/runtime/DataHeader.tsx +0 -68
- package/.framework/src/components/runtime/DataListPage.tsx +0 -124
- package/.framework/src/components/runtime/DataStats.tsx +0 -70
- package/.framework/src/components/runtime/DataTable.tsx +0 -174
- package/.framework/src/components/runtime/SchemaDetailForm.tsx +0 -134
- package/.framework/src/components/runtime/index.ts +0 -18
- package/.framework/src/components/search-form.tsx +0 -29
- package/.framework/src/components/shared/AgentView.tsx +0 -213
- package/.framework/src/components/shared/FieldRenderer.tsx +0 -478
- package/.framework/src/components/shared/SchemaFields.tsx +0 -226
- package/.framework/src/components/ui/DataTable.tsx +0 -343
- package/.framework/src/components/ui/Form.tsx +0 -281
- package/.framework/src/components/ui/ItemCard.tsx +0 -296
- package/.framework/src/components/ui/ItemListView.tsx +0 -308
- package/.framework/src/components/ui/LoadingSpinner.tsx +0 -52
- package/.framework/src/components/ui/Modal.tsx +0 -61
- package/.framework/src/components/ui/RichTextEditor.tsx +0 -210
- package/.framework/src/components/ui/accordion.tsx +0 -82
- package/.framework/src/components/ui/alert-dialog.tsx +0 -197
- package/.framework/src/components/ui/alert.tsx +0 -76
- package/.framework/src/components/ui/aspect-ratio.tsx +0 -11
- package/.framework/src/components/ui/avatar.tsx +0 -110
- package/.framework/src/components/ui/badge.tsx +0 -49
- package/.framework/src/components/ui/breadcrumb.tsx +0 -122
- package/.framework/src/components/ui/button-group.tsx +0 -83
- package/.framework/src/components/ui/button.tsx +0 -65
- package/.framework/src/components/ui/calendar.tsx +0 -222
- package/.framework/src/components/ui/card.tsx +0 -100
- package/.framework/src/components/ui/carousel.tsx +0 -240
- package/.framework/src/components/ui/chart.tsx +0 -368
- package/.framework/src/components/ui/checkbox.tsx +0 -31
- package/.framework/src/components/ui/collapsible.tsx +0 -33
- package/.framework/src/components/ui/combobox.tsx +0 -299
- package/.framework/src/components/ui/command.tsx +0 -193
- package/.framework/src/components/ui/context-menu.tsx +0 -261
- package/.framework/src/components/ui/dialog.tsx +0 -165
- package/.framework/src/components/ui/direction.tsx +0 -6
- package/.framework/src/components/ui/drawer.tsx +0 -132
- package/.framework/src/components/ui/dropdown-menu.tsx +0 -269
- package/.framework/src/components/ui/empty.tsx +0 -104
- package/.framework/src/components/ui/field.tsx +0 -238
- package/.framework/src/components/ui/hover-card.tsx +0 -42
- package/.framework/src/components/ui/input-group.tsx +0 -153
- package/.framework/src/components/ui/input-otp.tsx +0 -87
- package/.framework/src/components/ui/input.tsx +0 -19
- package/.framework/src/components/ui/item.tsx +0 -196
- package/.framework/src/components/ui/kbd.tsx +0 -26
- package/.framework/src/components/ui/label.tsx +0 -22
- package/.framework/src/components/ui/menubar.tsx +0 -277
- package/.framework/src/components/ui/native-select.tsx +0 -61
- package/.framework/src/components/ui/navigation-menu.tsx +0 -164
- package/.framework/src/components/ui/pagination.tsx +0 -129
- package/.framework/src/components/ui/popover.tsx +0 -87
- package/.framework/src/components/ui/progress.tsx +0 -31
- package/.framework/src/components/ui/radio-group.tsx +0 -42
- package/.framework/src/components/ui/resizable.tsx +0 -50
- package/.framework/src/components/ui/scroll-area.tsx +0 -53
- package/.framework/src/components/ui/select.tsx +0 -195
- package/.framework/src/components/ui/separator.tsx +0 -26
- package/.framework/src/components/ui/sheet.tsx +0 -145
- package/.framework/src/components/ui/sidebar.tsx +0 -706
- package/.framework/src/components/ui/skeleton.tsx +0 -13
- package/.framework/src/components/ui/slider.tsx +0 -59
- package/.framework/src/components/ui/sonner.tsx +0 -47
- package/.framework/src/components/ui/spinner.tsx +0 -10
- package/.framework/src/components/ui/switch.tsx +0 -33
- package/.framework/src/components/ui/table-primitives.tsx +0 -141
- package/.framework/src/components/ui/table.tsx +0 -114
- package/.framework/src/components/ui/tabs.tsx +0 -90
- package/.framework/src/components/ui/textarea.tsx +0 -18
- package/.framework/src/components/ui/toggle-group.tsx +0 -89
- package/.framework/src/components/ui/toggle.tsx +0 -45
- package/.framework/src/components/ui/tooltip.tsx +0 -57
- package/.framework/src/contexts/AppContext.tsx +0 -133
- package/.framework/src/contexts/AuthContext.tsx +0 -371
- package/.framework/src/hooks/use-mobile.ts +0 -19
- package/.framework/src/hooks/useApi.ts +0 -526
- package/.framework/src/hooks/useApps.ts +0 -114
- package/.framework/src/hooks/useEntityList.ts +0 -190
- package/.framework/src/hooks/useEntityRecord.ts +0 -308
- package/.framework/src/hooks/useForm.ts +0 -307
- package/.framework/src/hooks/useListSchema.ts +0 -264
- package/.framework/src/hooks/useSchemaRecord.ts +0 -223
- package/.framework/src/index.css +0 -128
- package/.framework/src/lib/api.ts +0 -156
- package/.framework/src/lib/supabase.ts +0 -94
- package/.framework/src/lib/utils.ts +0 -317
- package/.framework/src/main.tsx +0 -27
- package/.framework/src/pages/DashboardPage.tsx +0 -181
- package/.framework/src/pages/NotFoundPage.tsx +0 -39
- package/.framework/src/pages/admin/AIAgentDetailPage.tsx +0 -161
- package/.framework/src/pages/admin/AIAgentsPage.tsx +0 -318
- package/.framework/src/pages/admin/APIKeyDetailPage.tsx +0 -199
- package/.framework/src/pages/admin/APIKeysPage.tsx +0 -303
- package/.framework/src/pages/admin/AlertsConfigPage.tsx +0 -523
- package/.framework/src/pages/admin/AppDetailPage.tsx +0 -493
- package/.framework/src/pages/admin/AppsPage.tsx +0 -355
- package/.framework/src/pages/admin/DesignedPage.tsx +0 -491
- package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +0 -534
- package/.framework/src/pages/admin/EmbeddingsPage.tsx +0 -424
- package/.framework/src/pages/admin/ExtendedShadcnTestPage.tsx +0 -176
- package/.framework/src/pages/admin/IncrementalShadcnTestPage.tsx +0 -109
- package/.framework/src/pages/admin/IntegratedDashboard.tsx +0 -402
- package/.framework/src/pages/admin/IntegrationDetailPage.tsx +0 -187
- package/.framework/src/pages/admin/IntegrationsPage.tsx +0 -301
- package/.framework/src/pages/admin/LogsPage.tsx +0 -283
- package/.framework/src/pages/admin/MinimalShadcnTestPage.tsx +0 -85
- package/.framework/src/pages/admin/ObservabilityDashboard.tsx +0 -470
- package/.framework/src/pages/admin/PipelineDetailPage.tsx +0 -183
- package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +0 -279
- package/.framework/src/pages/admin/PipelinesPage.tsx +0 -390
- package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +0 -299
- package/.framework/src/pages/admin/PromptConfigsPage.tsx +0 -292
- package/.framework/src/pages/admin/ProperlyDesignedPage.tsx +0 -434
- package/.framework/src/pages/admin/RoleDetailPage.tsx +0 -273
- package/.framework/src/pages/admin/RolesPage.tsx +0 -292
- package/.framework/src/pages/admin/SelectTestPage.tsx +0 -61
- package/.framework/src/pages/admin/ShadcnTestPage.tsx +0 -588
- package/.framework/src/pages/admin/SimpleDashboard.tsx +0 -387
- package/.framework/src/pages/admin/TestRunDetailPage.tsx +0 -172
- package/.framework/src/pages/admin/TestingDashboard.tsx +0 -257
- package/.framework/src/pages/admin/TimerDetailPage.tsx +0 -151
- package/.framework/src/pages/admin/TimersPage.tsx +0 -376
- package/.framework/src/pages/admin/TriggerDetailPage.tsx +0 -149
- package/.framework/src/pages/admin/TriggersPage.tsx +0 -381
- package/.framework/src/pages/admin/TypeDetailPage.tsx +0 -694
- package/.framework/src/pages/admin/TypesPage.tsx +0 -295
- package/.framework/src/pages/auth/LoginPage.tsx +0 -187
- package/.framework/src/pages/auth/RegisterPage.tsx +0 -163
- package/.framework/src/pages/spine-framework/APIPage.tsx +0 -17
- package/.framework/src/pages/spine-framework/CLIPage.tsx +0 -25
- package/.framework/src/types/auth.ts +0 -125
- package/.framework/src/types/types.ts +0 -407
- package/STRUCTURE.md +0 -150
- package/bin/spine-framework.cjs +0 -62
- package/bin/welcome.cjs +0 -45
- package/bin/ws-shim.cjs +0 -8
- package/bin/ws-shim.ts +0 -10
- package/config/components.json +0 -25
- package/config/deno.lock +0 -108
- package/config/package-lock.json +0 -17183
- package/config/postcss.config.cjs +0 -10
- package/config/tailwind.config.cjs +0 -78
- package/config/tsconfig.build.json +0 -32
- package/config/tsconfig.cli.json +0 -18
- package/config/tsconfig.json +0 -41
- package/config/tsconfig.node.json +0 -17
- package/config/tsconfig.node.tsbuildinfo +0 -1
- package/config/tsconfig.tsbuildinfo +0 -1
- package/config/typedoc.json +0 -16
- package/config/vite.config.d.ts +0 -2
- package/config/vite.config.ts +0 -71
- package/dist/cli/commands/agents.d.ts +0 -39
- package/dist/cli/commands/agents.d.ts.map +0 -1
- package/dist/cli/commands/auth.d.ts +0 -36
- package/dist/cli/commands/auth.d.ts.map +0 -1
- package/dist/cli/commands/create-app.d.ts +0 -23
- package/dist/cli/commands/create-app.d.ts.map +0 -1
- package/dist/cli/commands/dev.d.ts +0 -24
- package/dist/cli/commands/dev.d.ts.map +0 -1
- package/dist/cli/commands/doctor.d.ts +0 -42
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/generate.d.ts +0 -36
- package/dist/cli/commands/generate.d.ts.map +0 -1
- package/dist/cli/commands/init.d.ts +0 -20
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/install-app.d.ts +0 -30
- package/dist/cli/commands/install-app.d.ts.map +0 -1
- package/dist/cli/commands/items.d.ts +0 -45
- package/dist/cli/commands/items.d.ts.map +0 -1
- package/dist/cli/commands/migrate.d.ts +0 -21
- package/dist/cli/commands/migrate.d.ts.map +0 -1
- package/dist/cli/commands/migrations.d.ts +0 -41
- package/dist/cli/commands/migrations.d.ts.map +0 -1
- package/dist/cli/commands/pipelines.d.ts +0 -40
- package/dist/cli/commands/pipelines.d.ts.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -23
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/system.d.ts +0 -29
- package/dist/cli/commands/system.d.ts.map +0 -1
- package/dist/cli/commands/test.d.ts +0 -46
- package/dist/cli/commands/test.d.ts.map +0 -1
- package/dist/cli/commands/uninstall-app.d.ts +0 -23
- package/dist/cli/commands/uninstall-app.d.ts.map +0 -1
- package/dist/cli/context.d.ts +0 -88
- package/dist/cli/context.d.ts.map +0 -1
- package/dist/cli/env-loader.d.ts +0 -14
- package/dist/cli/env-loader.d.ts.map +0 -1
- package/dist/cli/index.d.ts +0 -41
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/functions/_shared/agent-runner.d.ts +0 -156
- package/dist/functions/_shared/agent-runner.d.ts.map +0 -1
- package/dist/functions/_shared/app-manifest.d.ts +0 -68
- package/dist/functions/_shared/app-manifest.d.ts.map +0 -1
- package/dist/functions/_shared/audit.d.ts +0 -91
- package/dist/functions/_shared/audit.d.ts.map +0 -1
- package/dist/functions/_shared/db.d.ts +0 -125
- package/dist/functions/_shared/db.d.ts.map +0 -1
- package/dist/functions/_shared/index.d.ts +0 -299
- package/dist/functions/_shared/index.d.ts.map +0 -1
- package/dist/functions/_shared/middleware.d.ts +0 -315
- package/dist/functions/_shared/middleware.d.ts.map +0 -1
- package/dist/functions/_shared/permissions.d.ts +0 -626
- package/dist/functions/_shared/permissions.d.ts.map +0 -1
- package/dist/functions/_shared/pipeline-runner.d.ts +0 -124
- package/dist/functions/_shared/pipeline-runner.d.ts.map +0 -1
- package/dist/functions/_shared/principal.d.ts +0 -284
- package/dist/functions/_shared/principal.d.ts.map +0 -1
- package/dist/functions/_shared/resolve-ids.d.ts +0 -10
- package/dist/functions/_shared/resolve-ids.d.ts.map +0 -1
- package/dist/functions/_shared/schema-utils.d.ts +0 -181
- package/dist/functions/_shared/schema-utils.d.ts.map +0 -1
- package/dist/functions/_shared/testing.d.ts +0 -172
- package/dist/functions/_shared/testing.d.ts.map +0 -1
- package/dist/functions/_shared/trigger-engine.d.ts +0 -140
- package/dist/functions/_shared/trigger-engine.d.ts.map +0 -1
- package/dist/functions/_shared/webhook-registration.d.ts +0 -81
- package/dist/functions/_shared/webhook-registration.d.ts.map +0 -1
- package/dist/functions/_shared/webhook-registry.d.ts +0 -57
- package/dist/functions/_shared/webhook-registry.d.ts.map +0 -1
- package/dist/functions/account-nodes.d.ts +0 -48
- package/dist/functions/account-nodes.d.ts.map +0 -1
- package/dist/functions/admin-data.d.ts +0 -178
- package/dist/functions/admin-data.d.ts.map +0 -1
- package/dist/functions/ai-agents.d.ts +0 -125
- package/dist/functions/ai-agents.d.ts.map +0 -1
- package/dist/functions/api-keys.d.ts +0 -140
- package/dist/functions/api-keys.d.ts.map +0 -1
- package/dist/functions/apps.d.ts +0 -163
- package/dist/functions/apps.d.ts.map +0 -1
- package/dist/functions/auth.d.ts +0 -74
- package/dist/functions/auth.d.ts.map +0 -1
- package/dist/functions/debug-auth.d.ts +0 -33
- package/dist/functions/debug-auth.d.ts.map +0 -1
- package/dist/functions/embeddings.d.ts +0 -205
- package/dist/functions/embeddings.d.ts.map +0 -1
- package/dist/functions/integration-routes.d.ts +0 -45
- package/dist/functions/integration-routes.d.ts.map +0 -1
- package/dist/functions/integrations.d.ts +0 -124
- package/dist/functions/integrations.d.ts.map +0 -1
- package/dist/functions/item-progress.d.ts +0 -41
- package/dist/functions/item-progress.d.ts.map +0 -1
- package/dist/functions/logs.d.ts +0 -162
- package/dist/functions/logs.d.ts.map +0 -1
- package/dist/functions/observability.d.ts +0 -123
- package/dist/functions/observability.d.ts.map +0 -1
- package/dist/functions/pipeline-executions.d.ts +0 -190
- package/dist/functions/pipeline-executions.d.ts.map +0 -1
- package/dist/functions/pipelines.d.ts +0 -171
- package/dist/functions/pipelines.d.ts.map +0 -1
- package/dist/functions/prompt-configs.d.ts +0 -125
- package/dist/functions/prompt-configs.d.ts.map +0 -1
- package/dist/functions/roles.d.ts +0 -118
- package/dist/functions/roles.d.ts.map +0 -1
- package/dist/functions/system-cron.d.ts +0 -65
- package/dist/functions/system-cron.d.ts.map +0 -1
- package/dist/functions/system.d.ts +0 -29
- package/dist/functions/system.d.ts.map +0 -1
- package/dist/functions/tests.d.ts +0 -28
- package/dist/functions/tests.d.ts.map +0 -1
- package/dist/functions/timers.d.ts +0 -139
- package/dist/functions/timers.d.ts.map +0 -1
- package/dist/functions/triggers.d.ts +0 -203
- package/dist/functions/triggers.d.ts.map +0 -1
- package/dist/functions/types.d.ts +0 -151
- package/dist/functions/types.d.ts.map +0 -1
- package/dist/src/types/types.d.ts +0 -364
- package/dist/src/types/types.d.ts.map +0 -1
- package/index.html +0 -13
- package/netlify.toml +0 -36
- package/package-project.json +0 -71
- package/scripts/app-install-cli.ts +0 -286
- package/scripts/assemble-frontend.sh +0 -76
- package/scripts/assemble-functions.sh +0 -62
- package/scripts/assemble.sh +0 -41
- package/scripts/boundary-check.sh +0 -106
- package/scripts/build-manifest.sh +0 -80
- package/scripts/check-core-integrity.sh +0 -82
- package/scripts/ingest-chunks.cjs +0 -202
- package/scripts/kb-chunk-parser.cjs +0 -312
- package/scripts/kb-chunk-parser.ts +0 -330
- package/scripts/load-test-app-install.ts +0 -484
- package/scripts/netlify-dev-wrapper.sh +0 -22
- package/scripts/verify-integrity.sh +0 -69
- package/vitest.config.ts +0 -45
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @module cli/commands/agents
|
|
4
|
-
* @audience installer
|
|
5
|
-
* @layer cli
|
|
6
|
-
* @stability stable
|
|
7
|
-
*
|
|
8
|
-
* `spine agents` command group. Sends messages to AI agent threads and
|
|
9
|
-
* inspects thread state from the terminal or an agentic IDE. `agents run`
|
|
10
|
-
* calls `runAgent` — the same function used by API handlers — so responses
|
|
11
|
-
* are recorded in the `messages` table like any other agent turn.
|
|
12
|
-
*
|
|
13
|
-
* **Commands:**
|
|
14
|
-
* | Subcommand | Description |
|
|
15
|
-
* |--------------------------------------------------|---------------------------------------|
|
|
16
|
-
* | `agents run <threadId> --message <text>` | Send a message and print the response |
|
|
17
|
-
* | `agents threads list [--account <id>]` | List agent threads |
|
|
18
|
-
* | `agents threads get <id> [--limit <n>]` | Show thread + recent messages |
|
|
19
|
-
*
|
|
20
|
-
* **Usage:**
|
|
21
|
-
* ```bash
|
|
22
|
-
* spine agents run <uuid> --message "Summarize the last 10 tickets" --json
|
|
23
|
-
* spine agents threads list --account <id> --limit 10
|
|
24
|
-
* spine agents threads get <uuid>
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @seeAlso cli/context.ts (buildCliContext)
|
|
28
|
-
* @seeAlso functions/_shared/agent-runner.ts (runAgent)
|
|
29
|
-
* @seeAlso functions/ai-agents.ts (agent configuration CRUD)
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
import type { Command } from 'commander'
|
|
33
|
-
import { buildCliContext, printResult, handleError } from '../context.ts'
|
|
34
|
-
import { runAgent, adminDb } from '../../functions/_shared/index.ts'
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Registers the `agents` subcommand group on the root Commander program.
|
|
38
|
-
*
|
|
39
|
-
* @param program - The root `spine` Commander instance
|
|
40
|
-
* @sideEffects Adds `agents run`, `agents threads list/get` subcommands to `program`
|
|
41
|
-
* @calledBy cli/index.ts
|
|
42
|
-
*/
|
|
43
|
-
export function registerAgentCommands(program: Command) {
|
|
44
|
-
const agents = program
|
|
45
|
-
.command('agents')
|
|
46
|
-
.description('AI agent interaction')
|
|
47
|
-
|
|
48
|
-
agents
|
|
49
|
-
.command('run <threadId>')
|
|
50
|
-
.description('Send a message to an agent thread and get a response')
|
|
51
|
-
.requiredOption('--message <text>', 'The message to send')
|
|
52
|
-
.option('--account <id>', 'Account scope')
|
|
53
|
-
.option('--json', 'Output as JSON')
|
|
54
|
-
.action(async (threadId, opts) => {
|
|
55
|
-
try {
|
|
56
|
-
const ctx = await buildCliContext({ account: opts.account })
|
|
57
|
-
|
|
58
|
-
console.log(`Sending message to thread ${threadId}...`)
|
|
59
|
-
const response = await runAgent(threadId, opts.message, ctx)
|
|
60
|
-
|
|
61
|
-
if (opts.json) {
|
|
62
|
-
console.log(JSON.stringify(response, null, 2))
|
|
63
|
-
} else {
|
|
64
|
-
console.log('\n─── Agent Response ───')
|
|
65
|
-
console.log(response.content || JSON.stringify(response))
|
|
66
|
-
console.log('─────────────────────')
|
|
67
|
-
if (response.data?.confidence !== undefined) {
|
|
68
|
-
console.log(`Confidence: ${(response.data.confidence * 100).toFixed(0)}%`)
|
|
69
|
-
}
|
|
70
|
-
console.log()
|
|
71
|
-
}
|
|
72
|
-
} catch (err: any) {
|
|
73
|
-
handleError(err)
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
const threads = agents
|
|
78
|
-
.command('threads')
|
|
79
|
-
.description('Agent thread management')
|
|
80
|
-
|
|
81
|
-
threads
|
|
82
|
-
.command('list')
|
|
83
|
-
.description('List agent threads')
|
|
84
|
-
.option('--account <id>', 'Account scope')
|
|
85
|
-
.option('--limit <n>', 'Max results', '20')
|
|
86
|
-
.option('--json', 'Output as JSON')
|
|
87
|
-
.action(async (opts) => {
|
|
88
|
-
try {
|
|
89
|
-
const ctx = await buildCliContext({ account: opts.account })
|
|
90
|
-
|
|
91
|
-
let query = adminDb
|
|
92
|
-
.from('threads')
|
|
93
|
-
.select('id, title, status, created_at')
|
|
94
|
-
.order('created_at', { ascending: false })
|
|
95
|
-
.limit(parseInt(opts.limit))
|
|
96
|
-
|
|
97
|
-
if (ctx.accountId) {
|
|
98
|
-
query = query.eq('account_id', ctx.accountId)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const { data, error } = await query
|
|
102
|
-
if (error) throw new Error(error.message)
|
|
103
|
-
printResult(data || [], { json: opts.json })
|
|
104
|
-
} catch (err: any) {
|
|
105
|
-
handleError(err)
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
threads
|
|
110
|
-
.command('get <id>')
|
|
111
|
-
.description('Get thread details and recent messages')
|
|
112
|
-
.option('--limit <n>', 'Number of messages to show', '20')
|
|
113
|
-
.option('--json', 'Output as JSON')
|
|
114
|
-
.action(async (id, opts) => {
|
|
115
|
-
try {
|
|
116
|
-
await buildCliContext()
|
|
117
|
-
|
|
118
|
-
const { data: thread, error: threadError } = await adminDb
|
|
119
|
-
.from('threads')
|
|
120
|
-
.select('*')
|
|
121
|
-
.eq('id', id)
|
|
122
|
-
.single()
|
|
123
|
-
|
|
124
|
-
if (threadError || !thread) throw new Error(`Thread not found: ${id}`)
|
|
125
|
-
|
|
126
|
-
const { data: messages, error: msgError } = await adminDb
|
|
127
|
-
.from('messages')
|
|
128
|
-
.select('id, content, data, created_at')
|
|
129
|
-
.eq('thread_id', id)
|
|
130
|
-
.order('created_at', { ascending: true })
|
|
131
|
-
.limit(parseInt(opts.limit))
|
|
132
|
-
|
|
133
|
-
if (msgError) throw new Error(msgError.message)
|
|
134
|
-
|
|
135
|
-
if (opts.json) {
|
|
136
|
-
console.log(JSON.stringify({ thread, messages }, null, 2))
|
|
137
|
-
} else {
|
|
138
|
-
console.log(`\nThread: ${thread.title || thread.id}`)
|
|
139
|
-
console.log(`Status: ${thread.status || 'open'}`)
|
|
140
|
-
console.log('─'.repeat(50))
|
|
141
|
-
for (const msg of messages || []) {
|
|
142
|
-
const msgType = msg.data?.message_type || 'message'
|
|
143
|
-
const prefix = msgType === 'human' ? 'You' : msgType === 'agent' ? 'Agent' : msgType
|
|
144
|
-
console.log(`\n[${prefix}] ${msg.created_at}`)
|
|
145
|
-
console.log(msg.content)
|
|
146
|
-
}
|
|
147
|
-
console.log()
|
|
148
|
-
}
|
|
149
|
-
} catch (err: any) {
|
|
150
|
-
handleError(err)
|
|
151
|
-
}
|
|
152
|
-
})
|
|
153
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module cli/commands/auth
|
|
3
|
-
* @audience installer
|
|
4
|
-
* @layer cli
|
|
5
|
-
* @stability stable
|
|
6
|
-
*
|
|
7
|
-
* `spine auth` command group. Exposes two subcommands for verifying and
|
|
8
|
-
* inspecting the currently configured CLI credentials without performing
|
|
9
|
-
* any data operations.
|
|
10
|
-
*
|
|
11
|
-
* **Commands:**
|
|
12
|
-
* | Subcommand | Description |
|
|
13
|
-
* |-------------------|-------------------------------------------------------|
|
|
14
|
-
* | `auth whoami` | Print the resolved principal for the current env |
|
|
15
|
-
* | `auth check` | Validate credentials; exit 0 on success, 1 on failure |
|
|
16
|
-
*
|
|
17
|
-
* **Usage:**
|
|
18
|
-
* ```bash
|
|
19
|
-
* spine auth whoami
|
|
20
|
-
* spine auth whoami --json
|
|
21
|
-
* spine auth check
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @seeAlso cli/context.ts (buildCliContext — principal resolution)
|
|
25
|
-
* @seeAlso functions/auth.ts (API equivalent)
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
import type { Command } from 'commander'
|
|
29
|
-
import { buildCliContext, handleError } from '../context.js'
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Registers the `auth` subcommand group on the root Commander program.
|
|
33
|
-
*
|
|
34
|
-
* @param program - The root `spine` Commander instance
|
|
35
|
-
* @sideEffects Adds `auth whoami` and `auth check` subcommands to `program`
|
|
36
|
-
* @calledBy cli/index.ts
|
|
37
|
-
*/
|
|
38
|
-
export function registerAuthCommands(program: Command) {
|
|
39
|
-
const auth = program
|
|
40
|
-
.command('auth')
|
|
41
|
-
.description('Authentication and identity commands')
|
|
42
|
-
|
|
43
|
-
auth
|
|
44
|
-
.command('whoami')
|
|
45
|
-
.description('Show the resolved principal for the current environment config')
|
|
46
|
-
.option('--json', 'Output as JSON')
|
|
47
|
-
.action(async (opts) => {
|
|
48
|
-
try {
|
|
49
|
-
const ctx = await buildCliContext()
|
|
50
|
-
const output = {
|
|
51
|
-
principal_id: ctx.principal.id,
|
|
52
|
-
principal_type: ctx.principal.type,
|
|
53
|
-
account_id: ctx.accountId,
|
|
54
|
-
display_name: ctx.principal.displayName,
|
|
55
|
-
email: ctx.principal.email,
|
|
56
|
-
roles: ctx.principal.roles,
|
|
57
|
-
scopes: ctx.principal.scopes,
|
|
58
|
-
request_id: ctx.requestId
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (opts.json) {
|
|
62
|
-
console.log(JSON.stringify(output, null, 2))
|
|
63
|
-
} else {
|
|
64
|
-
console.log('\nSpine CLI — Current Identity')
|
|
65
|
-
console.log('─'.repeat(40))
|
|
66
|
-
console.log(`Principal ID: ${output.principal_id}`)
|
|
67
|
-
console.log(`Type: ${output.principal_type}`)
|
|
68
|
-
console.log(`Account: ${output.account_id || '(none)'}`)
|
|
69
|
-
if (output.display_name) console.log(`Name: ${output.display_name}`)
|
|
70
|
-
if (output.email) console.log(`Email: ${output.email}`)
|
|
71
|
-
if (output.roles?.length) console.log(`Roles: ${output.roles.join(', ')}`)
|
|
72
|
-
if (output.scopes?.length) console.log(`Scopes: ${output.scopes.join(', ')}`)
|
|
73
|
-
console.log(`Request ID: ${output.request_id}`)
|
|
74
|
-
console.log()
|
|
75
|
-
}
|
|
76
|
-
} catch (err: any) {
|
|
77
|
-
handleError(err)
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
auth
|
|
82
|
-
.command('check')
|
|
83
|
-
.description('Validate credentials — exits 0 if valid, 1 if not')
|
|
84
|
-
.action(async () => {
|
|
85
|
-
try {
|
|
86
|
-
await buildCliContext()
|
|
87
|
-
console.log('✓ Credentials valid')
|
|
88
|
-
process.exit(0)
|
|
89
|
-
} catch (err: any) {
|
|
90
|
-
console.error(`✗ ${err.message}`)
|
|
91
|
-
process.exit(1)
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @module cli/commands/create-app
|
|
4
|
-
* @audience installer
|
|
5
|
-
* @layer cli
|
|
6
|
-
* @stability stable
|
|
7
|
-
*
|
|
8
|
-
* `spine-framework create-app <slug>` — scaffold a new custom app.
|
|
9
|
-
*
|
|
10
|
-
* Creates the full directory structure under `custom/apps/{slug}/`:
|
|
11
|
-
* - manifest.json (app metadata, roles, routes, nav_items)
|
|
12
|
-
* - index.tsx (React entry point)
|
|
13
|
-
* - components/ (empty dir with .gitkeep)
|
|
14
|
-
*
|
|
15
|
-
* **Usage:**
|
|
16
|
-
* ```bash
|
|
17
|
-
* npm run spine-framework create-app my-app
|
|
18
|
-
* npm run spine-framework create-app my-app --name "My App" --role member
|
|
19
|
-
* npm run spine-framework create-app my-app --force
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import type { Command } from 'commander'
|
|
24
|
-
import { existsSync, mkdirSync, writeFileSync } from 'fs'
|
|
25
|
-
import { resolve, dirname } from 'path'
|
|
26
|
-
import { fileURLToPath } from 'url'
|
|
27
|
-
import { adminDb } from '../../functions/_shared/index.ts'
|
|
28
|
-
|
|
29
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
30
|
-
const __dirname = dirname(__filename)
|
|
31
|
-
const PROJECT_ROOT = process.cwd()
|
|
32
|
-
|
|
33
|
-
function toTitleCase(slug: string): string {
|
|
34
|
-
return slug.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join(' ')
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function generateManifest(slug: string, name: string, role: string): string {
|
|
38
|
-
return JSON.stringify({
|
|
39
|
-
name,
|
|
40
|
-
slug,
|
|
41
|
-
description: `${name} app`,
|
|
42
|
-
version: "1.0.0",
|
|
43
|
-
required_roles: [role],
|
|
44
|
-
routes: [
|
|
45
|
-
`/${slug}`,
|
|
46
|
-
`/${slug}/dashboard`
|
|
47
|
-
],
|
|
48
|
-
nav_items: [
|
|
49
|
-
{
|
|
50
|
-
title: "Dashboard",
|
|
51
|
-
path: `/${slug}/dashboard`,
|
|
52
|
-
icon: "LayoutDashboard",
|
|
53
|
-
order: 1
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
features: [],
|
|
57
|
-
dependencies: [],
|
|
58
|
-
entry_point: "./index.tsx"
|
|
59
|
-
}, null, 2) + '\n'
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function generateIndexTsx(slug: string, name: string): string {
|
|
63
|
-
const componentName = slug.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('')
|
|
64
|
-
return `/**
|
|
65
|
-
* @module custom/apps/${slug}
|
|
66
|
-
* @audience custom
|
|
67
|
-
* @layer frontend-app
|
|
68
|
-
* @stability experimental
|
|
69
|
-
*
|
|
70
|
-
* Entry point for the ${name} app.
|
|
71
|
-
* Generated by spine-framework CLI on ${new Date().toISOString().split('T')[0]}.
|
|
72
|
-
*/
|
|
73
|
-
|
|
74
|
-
import * as React from 'react'
|
|
75
|
-
import { Routes, Route, Navigate } from 'react-router-dom'
|
|
76
|
-
|
|
77
|
-
function ${componentName}Dashboard() {
|
|
78
|
-
return (
|
|
79
|
-
<div className="p-6">
|
|
80
|
-
<h1 className="text-2xl font-bold mb-2">${name}</h1>
|
|
81
|
-
<p className="text-slate-500">Welcome to ${name}. Edit custom/apps/${slug}/index.tsx to get started.</p>
|
|
82
|
-
</div>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export default function ${componentName}App() {
|
|
87
|
-
return (
|
|
88
|
-
<Routes>
|
|
89
|
-
<Route path="/" element={<Navigate to="dashboard" replace />} />
|
|
90
|
-
<Route path="dashboard" element={<${componentName}Dashboard />} />
|
|
91
|
-
</Routes>
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
`
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async function createApp(slug: string, options: { name?: string; role: string; force: boolean }): Promise<void> {
|
|
98
|
-
const name = options.name || toTitleCase(slug)
|
|
99
|
-
const appDir = resolve(PROJECT_ROOT, `custom/apps/${slug}`)
|
|
100
|
-
|
|
101
|
-
console.log(`\n🔧 Creating app '${slug}'...`)
|
|
102
|
-
|
|
103
|
-
if (existsSync(appDir) && !options.force) {
|
|
104
|
-
console.error(` ❌ App directory already exists: custom/apps/${slug}`)
|
|
105
|
-
console.error(` Use --force to overwrite`)
|
|
106
|
-
process.exit(1)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// 1. Create directories
|
|
110
|
-
mkdirSync(resolve(appDir, 'components'), { recursive: true })
|
|
111
|
-
console.log(` ✓ Created custom/apps/${slug}/`)
|
|
112
|
-
console.log(` ✓ Created custom/apps/${slug}/components/`)
|
|
113
|
-
|
|
114
|
-
// 2. manifest.json
|
|
115
|
-
writeFileSync(
|
|
116
|
-
resolve(appDir, 'manifest.json'),
|
|
117
|
-
generateManifest(slug, name, options.role)
|
|
118
|
-
)
|
|
119
|
-
console.log(` ✓ Created custom/apps/${slug}/manifest.json`)
|
|
120
|
-
|
|
121
|
-
// 3. index.tsx
|
|
122
|
-
writeFileSync(
|
|
123
|
-
resolve(appDir, 'index.tsx'),
|
|
124
|
-
generateIndexTsx(slug, name)
|
|
125
|
-
)
|
|
126
|
-
console.log(` ✓ Created custom/apps/${slug}/index.tsx`)
|
|
127
|
-
|
|
128
|
-
// 4. components/.gitkeep
|
|
129
|
-
writeFileSync(resolve(appDir, 'components', '.gitkeep'), '')
|
|
130
|
-
|
|
131
|
-
// 5. Insert app record into database
|
|
132
|
-
console.log(` Registering app in database...`)
|
|
133
|
-
const { data: existing } = await adminDb
|
|
134
|
-
.from('apps')
|
|
135
|
-
.select('id')
|
|
136
|
-
.eq('slug', slug)
|
|
137
|
-
.single()
|
|
138
|
-
|
|
139
|
-
if (existing) {
|
|
140
|
-
console.log(` ⚠️ App '${slug}' already exists in database (skipping insert)`)
|
|
141
|
-
} else {
|
|
142
|
-
const { error: insertErr } = await adminDb
|
|
143
|
-
.from('apps')
|
|
144
|
-
.insert({
|
|
145
|
-
slug,
|
|
146
|
-
name,
|
|
147
|
-
route_prefix: `/${slug}`,
|
|
148
|
-
renderer: 'custom',
|
|
149
|
-
is_active: true,
|
|
150
|
-
is_system: false,
|
|
151
|
-
min_role: options.role,
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
if (insertErr) {
|
|
155
|
-
console.error(` ❌ Database insert failed: ${insertErr.message}`)
|
|
156
|
-
console.error(` Run manually: INSERT INTO apps (slug, name, route_prefix, renderer, is_active)`)
|
|
157
|
-
console.error(` VALUES ('${slug}', '${name}', '/${slug}', 'custom', true);`)
|
|
158
|
-
} else {
|
|
159
|
-
console.log(` ✓ App registered in database`)
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
console.log(`\n✅ App '${name}' ready at custom/apps/${slug}/`)
|
|
164
|
-
console.log(`\n Next steps:`)
|
|
165
|
-
console.log(` 1. Edit custom/apps/${slug}/manifest.json to configure routes and nav`)
|
|
166
|
-
console.log(` 2. Edit custom/apps/${slug}/index.tsx to build your app`)
|
|
167
|
-
console.log(` 3. npm run assemble && netlify dev`)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export function registerCreateAppCommands(program: Command) {
|
|
171
|
-
program
|
|
172
|
-
.command('create-app <slug>')
|
|
173
|
-
.description('Scaffold a new custom app in custom/apps/{slug}/')
|
|
174
|
-
.option('--name <name>', 'Display name for the app (defaults to title-cased slug)')
|
|
175
|
-
.option('--role <role>', 'Required role to access this app', 'member')
|
|
176
|
-
.option('--force', 'Overwrite existing files', false)
|
|
177
|
-
.action(async (slug, opts) => {
|
|
178
|
-
try {
|
|
179
|
-
await createApp(slug, opts)
|
|
180
|
-
} catch (err: any) {
|
|
181
|
-
console.error('Error:', err.message)
|
|
182
|
-
process.exit(1)
|
|
183
|
-
}
|
|
184
|
-
})
|
|
185
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @module cli/commands/dev
|
|
4
|
-
* @audience installer
|
|
5
|
-
* @layer cli
|
|
6
|
-
* @stability stable
|
|
7
|
-
*
|
|
8
|
-
* `spine-framework dev` command — assemble and start the Netlify dev server.
|
|
9
|
-
*
|
|
10
|
-
* **What happens:**
|
|
11
|
-
* 1. Runs `npm run assemble` to merge framework + custom apps
|
|
12
|
-
* 2. Starts `netlify dev` (which runs Vite + Netlify Functions)
|
|
13
|
-
*
|
|
14
|
-
* **Usage:**
|
|
15
|
-
* ```bash
|
|
16
|
-
* spine-framework dev
|
|
17
|
-
* spine-framework dev --no-assemble # skip assembly step
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @seeAlso scripts/assemble.sh (assembly script)
|
|
21
|
-
* @seeAlso netlify.toml (Netlify dev configuration)
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
import type { Command } from 'commander'
|
|
25
|
-
import { spawn } from 'child_process'
|
|
26
|
-
import { resolve, dirname } from 'path'
|
|
27
|
-
import { fileURLToPath } from 'url'
|
|
28
|
-
import { existsSync } from 'fs'
|
|
29
|
-
|
|
30
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
31
|
-
const __dirname = dirname(__filename)
|
|
32
|
-
const PROJECT_ROOT = process.cwd()
|
|
33
|
-
|
|
34
|
-
// ─── COMMAND REGISTRATION ──────────────────────────────────────────────────
|
|
35
|
-
|
|
36
|
-
export function registerDevCommands(program: Command) {
|
|
37
|
-
program
|
|
38
|
-
.command('dev')
|
|
39
|
-
.description('Assemble and start the Netlify dev server')
|
|
40
|
-
.option('--no-assemble', 'Skip the assembly step')
|
|
41
|
-
.action(async (opts) => {
|
|
42
|
-
console.log('\n🚀 Starting Spine dev server...\n')
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
// Step 1: Assembly
|
|
46
|
-
if (opts.assemble !== false) {
|
|
47
|
-
console.log('📦 Step 1: Assembling...')
|
|
48
|
-
const assemblyExitCode = await runCommand('npm', ['run', 'assemble'], PROJECT_ROOT)
|
|
49
|
-
|
|
50
|
-
if (assemblyExitCode !== 0) {
|
|
51
|
-
console.error('\n❌ Assembly failed. Please check the errors above.')
|
|
52
|
-
process.exit(1)
|
|
53
|
-
}
|
|
54
|
-
console.log('✓ Assembly complete\n')
|
|
55
|
-
} else {
|
|
56
|
-
console.log('⏭️ Step 1: Skipping assembly (--no-assemble)\n')
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Step 2: Start netlify dev
|
|
60
|
-
console.log('🌐 Step 2: Starting netlify dev...')
|
|
61
|
-
console.log(' (Press Ctrl+C to stop)\n')
|
|
62
|
-
|
|
63
|
-
const netlifyBin = resolve(PROJECT_ROOT, 'node_modules/.bin/netlify')
|
|
64
|
-
const cmd = existsSync(netlifyBin) ? netlifyBin : 'netlify'
|
|
65
|
-
|
|
66
|
-
const netlify = spawn(cmd, ['dev'], {
|
|
67
|
-
cwd: PROJECT_ROOT,
|
|
68
|
-
stdio: 'inherit',
|
|
69
|
-
env: { ...process.env }
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
netlify.on('exit', (code) => {
|
|
73
|
-
process.exit(code || 0)
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
process.on('SIGINT', () => {
|
|
77
|
-
console.log('\n\n🛑 Shutting down...')
|
|
78
|
-
netlify.kill('SIGTERM')
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
process.on('SIGTERM', () => {
|
|
82
|
-
netlify.kill('SIGTERM')
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
} catch (err: any) {
|
|
86
|
-
console.error('\n❌ Error:', err.message)
|
|
87
|
-
if (process.env.SPINE_CLI_DEBUG) {
|
|
88
|
-
console.error(err.stack)
|
|
89
|
-
}
|
|
90
|
-
process.exit(1)
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// ─── HELPER ────────────────────────────────────────────────────────────────
|
|
96
|
-
|
|
97
|
-
function runCommand(command: string, args: string[], cwd: string): Promise<number> {
|
|
98
|
-
return new Promise((resolve, reject) => {
|
|
99
|
-
const proc = spawn(command, args, {
|
|
100
|
-
cwd,
|
|
101
|
-
stdio: 'inherit',
|
|
102
|
-
env: process.env
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
proc.on('exit', (code) => {
|
|
106
|
-
resolve(code || 0)
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
proc.on('error', (err) => {
|
|
110
|
-
reject(err)
|
|
111
|
-
})
|
|
112
|
-
})
|
|
113
|
-
}
|