@polymorphism-tech/morph-spec 11.1.1 → 11.3.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/README.md +3 -2
- package/bin/morph-spec.js +13 -23
- package/docs/CHEATSHEET.md +3 -3
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +3 -1
- package/framework/MORPH.md +8 -3
- package/framework/agents.json +4 -4
- package/framework/docs/CLI.md +28 -18
- package/framework/evals/review-checklist.md +35 -18
- package/framework/hooks/README.md +18 -11
- package/framework/hooks/claude-code/core/README.md +2 -2
- package/framework/hooks/claude-code/core/chain.js +9 -25
- package/framework/hooks/claude-code/core/comment-guard.js +3 -9
- package/framework/hooks/claude-code/core/conventional-commit.js +3 -3
- package/framework/hooks/claude-code/core/graph-refresh-kick.js +6 -6
- package/framework/hooks/claude-code/core/masked-exit.js +4 -3
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +2 -2
- package/framework/hooks/claude-code/core/protect-spec-files.js +2 -4
- package/framework/hooks/claude-code/core/stack-changed.js +5 -4
- package/framework/hooks/claude-code/core/validate-completion.js +15 -12
- package/framework/hooks/shared/contract.js +22 -1
- package/framework/hooks/shared/git-paths.js +6 -0
- package/framework/hooks/shared/graph-freshness.js +3 -3
- package/framework/hooks/shared/graph-refresh.js +5 -10
- package/framework/hooks/shared/hook-response.js +1 -18
- package/framework/hooks/shared/payload-utils.js +12 -1
- package/framework/hooks/shared/phase-utils.js +4 -52
- package/framework/hooks/shared/report-progress.js +1 -1
- package/framework/mcp/registry.json +16 -32
- package/framework/rules/ai-agents-standards.md +9 -1
- package/framework/rules/dotnet-templates.md +32 -33
- package/framework/rules/gsap-standards.md +8 -0
- package/framework/rules/infrastructure-standards.md +9 -9
- package/framework/rules/mcp-standards.md +10 -0
- package/framework/rules/neon-standards.md +4 -4
- package/framework/rules/nextjs-templates.md +10 -11
- package/framework/rules/ui-design.md +2 -2
- package/framework/schemas/config.schema.json +11 -0
- package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
- package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
- package/framework/skills/core/morph-apply/SKILL.md +6 -4
- package/framework/skills/core/morph-plan/SKILL.md +1 -1
- package/framework/skills/core/morph-uiux/SKILL.md +5 -5
- package/framework/standards/STANDARDS.json +8 -4
- package/framework/standards/STANDARDS.meta.json +1 -1
- package/framework/standards/ai-agents/agent-archetypes.md +1 -1
- package/framework/standards/ai-agents/middleware-patterns.md +0 -2
- package/framework/standards/ai-agents/prompt-sources.md +2 -2
- package/framework/standards/ai-agents/providers/model-registry.md +9 -12
- package/framework/standards/ai-agents/rag-custom-pgvector.md +2 -9
- package/framework/standards/frontend/design-system/ai-image-generation.md +1 -1
- package/framework/standards/infrastructure/docker/local-compose-isolation.md +2 -2
- package/framework/standards/integration/mcp/mcp-tools.md +125 -267
- package/framework/templates/README.md +52 -82
- package/framework/templates/REGISTRY.json +1 -281
- package/framework/templates/code/sql/ai-agents/agent-prompts-migration.sql.template +3 -4
- package/framework/templates/context/design-system.md +1 -1
- package/framework/templates/docs/plan.md +2 -2
- package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Providers/model-registry.v2.json +1 -1
- package/framework/templates/dotnet/ai-kit/tests/Morph.AiKit.Tests/MediaDisclosureTests.cs +1 -1
- package/framework/templates/dotnet/ai-kit/tests/Morph.AiKit.Tests/Morph.AiKit.Tests.csproj +3 -5
- package/framework/templates/frontend/nextjs/gsap-scroll-section.tsx.hbs +13 -17
- package/framework/templates/infrastructure/docker/docker-compose.template.yml +15 -16
- package/framework/templates/infrastructure/github/README.md +10 -13
- package/package.json +7 -16
- package/src/commands/graph/build.js +2 -2
- package/src/commands/mcp/manual-setup.js +95 -0
- package/src/commands/mcp/mcp-setup.js +26 -192
- package/src/commands/project/doctor.js +48 -142
- package/src/commands/project/env.js +2 -1
- package/src/commands/project/init-contract.js +2 -2
- package/src/commands/project/init.js +34 -294
- package/src/commands/project/stack-scan.js +6 -14
- package/src/commands/project/stack-set.js +3 -1
- package/src/commands/project/standards.js +1 -2
- package/src/commands/project/update.js +87 -205
- package/src/commands/scaffold/scaffold.js +43 -5
- package/src/commands/validation/check.js +12 -10
- package/src/commands/validation/prove-red.js +61 -22
- package/src/core/paths/output-schema.js +8 -27
- package/src/core/templates/template-registry.js +8 -43
- package/src/core/templates/template-renderer.js +3 -200
- package/src/lib/ai/ai-checks.js +1 -1
- package/src/lib/ai/ai-project-scan.js +2 -5
- package/src/lib/ai/code-audit.js +3 -8
- package/src/lib/ai/registry-audit.js +2 -1
- package/src/lib/check/signals.js +25 -7
- package/src/lib/config/project-config.js +3 -2
- package/src/lib/contract/apply.js +2 -1
- package/src/lib/contract/defaults.js +2 -2
- package/src/lib/contract/merge.js +1 -0
- package/src/lib/contract/scan.js +5 -5
- package/src/lib/detectors/claude-config-detector.js +44 -98
- package/src/lib/detectors/mcp-config.js +2 -1
- package/src/lib/diff/diff-lines.js +4 -9
- package/src/lib/generators/scaffold-generator.js +5 -17
- package/src/lib/git/default-branch.js +5 -13
- package/src/lib/graph/graph-health.js +1 -1
- package/src/lib/graph/graph-loader.js +2 -1
- package/src/lib/graph/graphifyignore.js +5 -5
- package/src/lib/graph/sanitize.js +2 -2
- package/src/lib/installers/effects.js +0 -13
- package/src/lib/installers/install-manifest.js +56 -0
- package/src/lib/installers/mcp-installer.js +16 -19
- package/src/lib/installers/memory-installer.js +5 -8
- package/src/lib/installers/rules-installer.js +9 -15
- package/src/lib/installers/stack-assets.js +54 -7
- package/src/lib/installers/stack-sync.js +16 -16
- package/src/lib/installers/stack-tooling.js +4 -3
- package/src/lib/json-file.js +9 -0
- package/src/lib/plan/artifact-vocabulary.js +1 -1
- package/src/lib/plan/checks.js +4 -3
- package/src/lib/plan/media.js +6 -6
- package/src/lib/plan/plan-parser.js +6 -11
- package/src/lib/review-reports.js +13 -18
- package/src/lib/scan/worktree-dirs.js +1 -3
- package/src/lib/specs/adr-index.js +4 -4
- package/src/lib/specs/revocations.js +3 -3
- package/src/lib/stack/stack-scan.js +4 -4
- package/src/lib/standards/registry.js +1 -1
- package/src/lib/standards/verified-against.js +3 -3
- package/src/lib/tests-audit/audit.js +3 -3
- package/src/lib/text.js +5 -0
- package/src/scripts/global-install.js +41 -19
- package/src/scripts/setup-infra.js +68 -187
- package/src/utils/agents-installer.js +21 -60
- package/src/utils/claude-md-injector.js +16 -50
- package/src/utils/claude-settings-manager.js +29 -27
- package/src/utils/file-copier.js +3 -4
- package/src/utils/hooks-installer.js +83 -62
- package/src/utils/skills-installer.js +18 -78
- package/src/utils/version-checker.js +2 -31
- package/CLAUDE.md +0 -118
- package/framework/commands/create-umbraco-lp.md +0 -37
- package/framework/commands/migrate-lp-to-umbraco.md +0 -35
- package/framework/commands/morph-apply.md +0 -14
- package/framework/hooks/shared/spawn-command.js +0 -23
- package/framework/templates/CLAUDE.md.core.guide.md +0 -29
- package/framework/templates/CLAUDE.md.core.template +0 -22
- package/framework/templates/IDE-SNIPPETS.md +0 -262
- package/framework/templates/code/dotnet/ai-agents/AgentBootstrap.cs.template +0 -26
- package/framework/templates/code/dotnet/ai-agents/EmbeddingService.cs.template +0 -28
- package/framework/templates/code/dotnet/ai-agents/ModelRegistry.cs.template +0 -99
- package/framework/templates/code/dotnet/ai-agents/ResilientToolMiddleware.cs.template +0 -40
- package/framework/templates/code/dotnet/ai-agents/VectorSearchTool.cs.template +0 -54
- package/framework/templates/code/dotnet/ai-agents/model-registry.json.template +0 -53
- package/framework/templates/code/dotnet/contracts/README.md +0 -74
- package/framework/templates/code/dotnet/database/vector-entity.cs +0 -49
- package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +0 -91
- package/framework/templates/code/sql/postgresql-migration.template.sql +0 -108
- package/framework/templates/code/typescript/contracts.ts +0 -140
- package/framework/templates/context/ARCHITECTURE.md +0 -106
- package/framework/templates/examples/design-system-examples.md +0 -354
- package/framework/templates/infrastructure/docker/Dockerfile.template +0 -58
- package/framework/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +0 -45
- package/framework/templates/infrastructure/github/actions/health-check/action.yml.hbs +0 -27
- package/framework/templates/integrations/asaas-client.cs +0 -332
- package/framework/templates/integrations/asaas-webhook.cs +0 -290
- package/framework/templates/integrations/neon-auth-config.cs +0 -170
- package/framework/templates/ui/design-system.css +0 -226
- package/src/commands/context/context-refresh.js +0 -63
- package/src/lib/detectors/index.js +0 -178
- package/src/lib/generators/architecture-scanner.js +0 -543
- package/src/lib/generators/settings-generator.js +0 -97
- package/src/lib/graph/god-nodes.js +0 -65
- package/src/lib/installers/templates-reconcile.js +0 -26
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
-- TEMPLATE: pgvector-embeddings-migration.sql
|
|
2
|
-
-- PURPOSE: Creates the kb_embeddings table for custom RAG — chunk storage with pgvector.
|
|
3
|
-
-- READS STANDARD: ai-agents-rag-custom-pgvector
|
|
4
|
-
-- PLACEHOLDERS:
|
|
5
|
-
-- {{SCHEMA}} — target schema (default: public)
|
|
6
|
-
-- LAST-VERIFIED: 2026-05-19
|
|
7
|
-
--
|
|
8
|
-
-- PREREQUISITES:
|
|
9
|
-
-- - pgvector extension enabled in Neon (see infrastructure-neon-pgvector).
|
|
10
|
-
-- - NpgsqlDataSourceBuilder.UseVector() called in the project's DB setup.
|
|
11
|
-
--
|
|
12
|
-
-- DIMENSION NOTE:
|
|
13
|
-
-- embedding vector(1536) matches text-embedding-3-small (default 1536 dimensions).
|
|
14
|
-
-- If the project uses a different embedding model, adjust the dimension to match.
|
|
15
|
-
-- NEVER mix embedding models on a single column — vectors live in different spaces.
|
|
16
|
-
|
|
17
|
-
-- ============================================================
|
|
18
|
-
-- 1. EXTENSION
|
|
19
|
-
-- ============================================================
|
|
20
|
-
|
|
21
|
-
CREATE EXTENSION IF NOT EXISTS vector;
|
|
22
|
-
|
|
23
|
-
-- ============================================================
|
|
24
|
-
-- 2. TABLE
|
|
25
|
-
-- ============================================================
|
|
26
|
-
|
|
27
|
-
CREATE TABLE {{SCHEMA}}.kb_embeddings (
|
|
28
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
29
|
-
tenant_id uuid NOT NULL,
|
|
30
|
-
source text NOT NULL, -- document identifier or source URL
|
|
31
|
-
chunk_index int NOT NULL, -- position of this chunk within the source document
|
|
32
|
-
content text NOT NULL, -- chunk text returned to the agent as context
|
|
33
|
-
embedding vector(1536) NOT NULL, -- vector dimension must match embedding model
|
|
34
|
-
metadata jsonb NOT NULL DEFAULT '{}',
|
|
35
|
-
created_at timestamptz NOT NULL DEFAULT now()
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
COMMENT ON TABLE {{SCHEMA}}.kb_embeddings IS 'RAG knowledge base — chunk text and pgvector embeddings for semantic search.';
|
|
39
|
-
COMMENT ON COLUMN {{SCHEMA}}.kb_embeddings.tenant_id IS 'Tenant partition. Every query MUST filter on this column. Never query across tenants.';
|
|
40
|
-
COMMENT ON COLUMN {{SCHEMA}}.kb_embeddings.source IS 'Document identifier or URL. Used for citation and re-indexing detection.';
|
|
41
|
-
COMMENT ON COLUMN {{SCHEMA}}.kb_embeddings.chunk_index IS 'Zero-based position of this chunk within the source document.';
|
|
42
|
-
COMMENT ON COLUMN {{SCHEMA}}.kb_embeddings.content IS 'Chunk text returned to the agent. Plain text, no markup.';
|
|
43
|
-
COMMENT ON COLUMN {{SCHEMA}}.kb_embeddings.embedding IS 'Float vector. Dimension MUST match the embedding model declared in model-registry.json.';
|
|
44
|
-
COMMENT ON COLUMN {{SCHEMA}}.kb_embeddings.metadata IS 'Arbitrary JSON metadata (section headers, page numbers, doc type, etc.). Used for filtering.';
|
|
45
|
-
|
|
46
|
-
-- ============================================================
|
|
47
|
-
-- 3. INDEXES
|
|
48
|
-
-- ============================================================
|
|
49
|
-
|
|
50
|
-
-- HNSW index for cosine similarity — production-grade recall, no training data required.
|
|
51
|
-
-- vector_cosine_ops: use <=> operator (cosine distance, ascending = most similar first).
|
|
52
|
-
-- m=16, ef_construction=64 are pgvector defaults. Tune per infrastructure-neon-pgvector §HNSW Parameters.
|
|
53
|
-
CREATE INDEX ix_kb_embeddings_hnsw
|
|
54
|
-
ON {{SCHEMA}}.kb_embeddings
|
|
55
|
-
USING hnsw (embedding vector_cosine_ops)
|
|
56
|
-
WITH (m = 16, ef_construction = 64);
|
|
57
|
-
|
|
58
|
-
-- Index for the mandatory tenant_id filter (applied in every search query).
|
|
59
|
-
CREATE INDEX ix_kb_embeddings_tenant
|
|
60
|
-
ON {{SCHEMA}}.kb_embeddings (tenant_id);
|
|
61
|
-
|
|
62
|
-
-- Composite index for source-level operations (re-indexing, deletion by document).
|
|
63
|
-
CREATE INDEX ix_kb_embeddings_source
|
|
64
|
-
ON {{SCHEMA}}.kb_embeddings (tenant_id, source);
|
|
65
|
-
|
|
66
|
-
-- ============================================================
|
|
67
|
-
-- 4. ROW-LEVEL SECURITY (multi-tenant)
|
|
68
|
-
-- ============================================================
|
|
69
|
-
|
|
70
|
-
-- RLS enforces tenant isolation at the database level as a second line of defence.
|
|
71
|
-
-- The application already filters on tenant_id in every query; RLS is the backstop.
|
|
72
|
-
--
|
|
73
|
-
-- See templates/code/sql/postgresql-rls-policy.sql for the policy pattern that
|
|
74
|
-
-- binds app.current_tenant_id (a session-level setting) to the RLS policy.
|
|
75
|
-
--
|
|
76
|
-
-- Uncomment and adapt once RLS is wired in the project:
|
|
77
|
-
--
|
|
78
|
-
-- ALTER TABLE {{SCHEMA}}.kb_embeddings ENABLE ROW LEVEL SECURITY;
|
|
79
|
-
--
|
|
80
|
-
-- CREATE POLICY kb_embeddings_tenant_isolation
|
|
81
|
-
-- ON {{SCHEMA}}.kb_embeddings
|
|
82
|
-
-- USING (tenant_id = current_setting('app.current_tenant_id')::uuid);
|
|
83
|
-
|
|
84
|
-
-- ============================================================
|
|
85
|
-
-- ROLLBACK
|
|
86
|
-
-- ============================================================
|
|
87
|
-
|
|
88
|
-
-- DROP INDEX IF EXISTS {{SCHEMA}}.ix_kb_embeddings_hnsw;
|
|
89
|
-
-- DROP INDEX IF EXISTS {{SCHEMA}}.ix_kb_embeddings_tenant;
|
|
90
|
-
-- DROP INDEX IF EXISTS {{SCHEMA}}.ix_kb_embeddings_source;
|
|
91
|
-
-- DROP TABLE IF EXISTS {{SCHEMA}}.kb_embeddings CASCADE;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
-- Migration: {{FEATURE_NAME_HUMAN}}
|
|
2
|
-
-- Created: {{DATE}}
|
|
3
|
-
-- Description: {{DESCRIPTION}}
|
|
4
|
-
|
|
5
|
-
-- Enable necessary extensions
|
|
6
|
-
create extension if not exists "uuid-ossp";
|
|
7
|
-
|
|
8
|
-
-- ========================================
|
|
9
|
-
-- Create Tables
|
|
10
|
-
-- ========================================
|
|
11
|
-
|
|
12
|
-
create table if not exists public.{{TABLE_NAME}} (
|
|
13
|
-
-- Primary key
|
|
14
|
-
id uuid primary key default gen_random_uuid(),
|
|
15
|
-
|
|
16
|
-
-- Columns
|
|
17
|
-
name text not null,
|
|
18
|
-
description text,
|
|
19
|
-
is_active boolean default true not null,
|
|
20
|
-
|
|
21
|
-
-- Foreign keys (example)
|
|
22
|
-
-- user_id text not null,
|
|
23
|
-
|
|
24
|
-
-- Timestamps
|
|
25
|
-
created_at timestamptz default now() not null,
|
|
26
|
-
updated_at timestamptz default now() not null
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
-- ========================================
|
|
30
|
-
-- Create Indexes
|
|
31
|
-
-- ========================================
|
|
32
|
-
|
|
33
|
-
-- Index on frequently queried columns
|
|
34
|
-
create index if not exists idx_{{TABLE_NAME}}_name
|
|
35
|
-
on public.{{TABLE_NAME}} (name);
|
|
36
|
-
|
|
37
|
-
-- Index on foreign keys (if any)
|
|
38
|
-
-- create index if not exists idx_{{TABLE_NAME}}_user_id
|
|
39
|
-
-- on public.{{TABLE_NAME}} (user_id);
|
|
40
|
-
|
|
41
|
-
-- Composite index for common queries
|
|
42
|
-
-- create index if not exists idx_{{TABLE_NAME}}_user_created
|
|
43
|
-
-- on public.{{TABLE_NAME}} (user_id, created_at desc);
|
|
44
|
-
|
|
45
|
-
-- ========================================
|
|
46
|
-
-- Create Triggers
|
|
47
|
-
-- ========================================
|
|
48
|
-
|
|
49
|
-
-- Auto-update timestamp trigger
|
|
50
|
-
create or replace function public.handle_updated_at()
|
|
51
|
-
returns trigger as $$
|
|
52
|
-
begin
|
|
53
|
-
new.updated_at = now();
|
|
54
|
-
return new;
|
|
55
|
-
end;
|
|
56
|
-
$$ language plpgsql;
|
|
57
|
-
|
|
58
|
-
create trigger {{TABLE_NAME}}_updated_at
|
|
59
|
-
before update on public.{{TABLE_NAME}}
|
|
60
|
-
for each row execute function public.handle_updated_at();
|
|
61
|
-
|
|
62
|
-
-- ========================================
|
|
63
|
-
-- Enable Row Level Security (RLS)
|
|
64
|
-
-- ========================================
|
|
65
|
-
|
|
66
|
-
alter table public.{{TABLE_NAME}} enable row level security;
|
|
67
|
-
|
|
68
|
-
-- Policy: Users can view all records (example)
|
|
69
|
-
create policy "{{TABLE_NAME}}_select_policy"
|
|
70
|
-
on public.{{TABLE_NAME}} for select
|
|
71
|
-
using (true);
|
|
72
|
-
|
|
73
|
-
-- Policy: Users can only insert their own records (Neon Auth + pg_session_jwt)
|
|
74
|
-
-- create policy "{{TABLE_NAME}}_insert_policy"
|
|
75
|
-
-- on public.{{TABLE_NAME}} for insert to authenticated
|
|
76
|
-
-- with check (auth.user_id() = user_id);
|
|
77
|
-
|
|
78
|
-
-- Policy: Users can only update their own records (Neon Auth + pg_session_jwt)
|
|
79
|
-
-- create policy "{{TABLE_NAME}}_update_policy"
|
|
80
|
-
-- on public.{{TABLE_NAME}} for update to authenticated
|
|
81
|
-
-- using (auth.user_id() = user_id)
|
|
82
|
-
-- with check (auth.user_id() = user_id);
|
|
83
|
-
|
|
84
|
-
-- Policy: Users can only delete their own records (Neon Auth + pg_session_jwt)
|
|
85
|
-
-- create policy "{{TABLE_NAME}}_delete_policy"
|
|
86
|
-
-- on public.{{TABLE_NAME}} for delete to authenticated
|
|
87
|
-
-- using (auth.user_id() = user_id);
|
|
88
|
-
|
|
89
|
-
-- Policy: Admins have full access (Neon Auth + pg_session_jwt)
|
|
90
|
-
-- create policy "{{TABLE_NAME}}_admin_policy"
|
|
91
|
-
-- on public.{{TABLE_NAME}} for all
|
|
92
|
-
-- using (auth.jwt()->>'role' = 'admin');
|
|
93
|
-
|
|
94
|
-
-- ========================================
|
|
95
|
-
-- Seed Data (Optional)
|
|
96
|
-
-- ========================================
|
|
97
|
-
|
|
98
|
-
-- insert into public.{{TABLE_NAME}} (name, description) values
|
|
99
|
-
-- ('Example 1', 'First example record'),
|
|
100
|
-
-- ('Example 2', 'Second example record');
|
|
101
|
-
|
|
102
|
-
-- ========================================
|
|
103
|
-
-- Rollback Instructions
|
|
104
|
-
-- ========================================
|
|
105
|
-
|
|
106
|
-
-- Uncomment to rollback this migration:
|
|
107
|
-
-- drop table if exists public.{{TABLE_NAME}} cascade;
|
|
108
|
-
-- drop function if exists public.handle_updated_at() cascade;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
// {{titleCase FEATURE_NAME}} contracts, generated {{DATE}}
|
|
2
|
-
|
|
3
|
-
export interface NeonConfig {
|
|
4
|
-
connectionString: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface ApiClientConfig {
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
getAccessToken: () => Promise<string | null>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ApiError {
|
|
13
|
-
message: string;
|
|
14
|
-
code: string;
|
|
15
|
-
statusCode: number;
|
|
16
|
-
details?: Record<string, string[]>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type ApiResult<T> =
|
|
20
|
-
| { success: true; data: T }
|
|
21
|
-
| { success: false; error: ApiError };
|
|
22
|
-
|
|
23
|
-
export interface PaginationQuery {
|
|
24
|
-
page?: number;
|
|
25
|
-
pageSize?: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface PagedResult<T> {
|
|
29
|
-
items: T[];
|
|
30
|
-
totalCount: number;
|
|
31
|
-
page: number;
|
|
32
|
-
pageSize: number;
|
|
33
|
-
totalPages: number;
|
|
34
|
-
hasNext: boolean;
|
|
35
|
-
hasPrevious: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type Tables<T extends keyof Database["public"]["Tables"]> =
|
|
39
|
-
Database["public"]["Tables"][T]["Row"];
|
|
40
|
-
|
|
41
|
-
export type Insertable<T extends keyof Database["public"]["Tables"]> =
|
|
42
|
-
Database["public"]["Tables"][T]["Insert"];
|
|
43
|
-
|
|
44
|
-
export type Updatable<T extends keyof Database["public"]["Tables"]> =
|
|
45
|
-
Database["public"]["Tables"][T]["Update"];
|
|
46
|
-
|
|
47
|
-
// Placeholder: replace with the types your ORM (Drizzle or Prisma) generates from the Neon schema.
|
|
48
|
-
export interface Database {
|
|
49
|
-
public: {
|
|
50
|
-
Tables: {
|
|
51
|
-
{{FEATURE_NAME}}: {
|
|
52
|
-
Row: {
|
|
53
|
-
id: string;
|
|
54
|
-
name: string;
|
|
55
|
-
user_id: string;
|
|
56
|
-
status: {{pascalCase FEATURE_NAME}}Status;
|
|
57
|
-
created_at: string;
|
|
58
|
-
updated_at: string | null;
|
|
59
|
-
};
|
|
60
|
-
Insert: {
|
|
61
|
-
id?: string;
|
|
62
|
-
name: string;
|
|
63
|
-
user_id?: string;
|
|
64
|
-
status?: {{pascalCase FEATURE_NAME}}Status;
|
|
65
|
-
created_at?: string;
|
|
66
|
-
updated_at?: string | null;
|
|
67
|
-
};
|
|
68
|
-
Update: {
|
|
69
|
-
id?: string;
|
|
70
|
-
name?: string;
|
|
71
|
-
user_id?: string;
|
|
72
|
-
status?: {{pascalCase FEATURE_NAME}}Status;
|
|
73
|
-
created_at?: string;
|
|
74
|
-
updated_at?: string | null;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
Views: Record<string, never>;
|
|
79
|
-
Functions: Record<string, never>;
|
|
80
|
-
Enums: {
|
|
81
|
-
{{FEATURE_NAME}}_status: {{pascalCase FEATURE_NAME}}Status;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export type {{pascalCase FEATURE_NAME}}Status =
|
|
87
|
-
| "draft"
|
|
88
|
-
| "active"
|
|
89
|
-
| "completed"
|
|
90
|
-
| "archived"
|
|
91
|
-
| "failed"
|
|
92
|
-
| "cancelled";
|
|
93
|
-
|
|
94
|
-
export interface {{pascalCase FEATURE_NAME}} {
|
|
95
|
-
id: string;
|
|
96
|
-
name: string;
|
|
97
|
-
userId: string;
|
|
98
|
-
status: {{pascalCase FEATURE_NAME}}Status;
|
|
99
|
-
createdAt: string;
|
|
100
|
-
updatedAt: string | null;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface Create{{pascalCase FEATURE_NAME}}Input {
|
|
104
|
-
name: string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface Update{{pascalCase FEATURE_NAME}}Input {
|
|
108
|
-
name?: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface StorageUpload {
|
|
112
|
-
bucket: string;
|
|
113
|
-
path: string;
|
|
114
|
-
file: File;
|
|
115
|
-
contentType?: string;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export interface StorageFile {
|
|
119
|
-
id: string;
|
|
120
|
-
name: string;
|
|
121
|
-
bucket: string;
|
|
122
|
-
path: string;
|
|
123
|
-
publicUrl: string;
|
|
124
|
-
size: number;
|
|
125
|
-
contentType: string;
|
|
126
|
-
createdAt: string;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface AuthUser {
|
|
130
|
-
id: string;
|
|
131
|
-
email: string;
|
|
132
|
-
displayName: string | null;
|
|
133
|
-
avatarUrl: string | null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface AuthSession {
|
|
137
|
-
user: AuthUser;
|
|
138
|
-
accessToken: string;
|
|
139
|
-
expiresAt: number;
|
|
140
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# {{projectName}} — Architecture Context
|
|
2
|
-
|
|
3
|
-
> Auto-generated by `morph-spec context refresh`
|
|
4
|
-
|
|
5
|
-
{{#if hasDotnet}}
|
|
6
|
-
## .NET Entities ({{entityCount}})
|
|
7
|
-
|
|
8
|
-
| Entity | Type | Path |
|
|
9
|
-
|--------|------|------|
|
|
10
|
-
{{#each entities}}
|
|
11
|
-
| `{{name}}` | {{type}} | `{{path}}` |
|
|
12
|
-
{{/each}}
|
|
13
|
-
|
|
14
|
-
## API Endpoints ({{endpointCount}})
|
|
15
|
-
|
|
16
|
-
| Endpoint | Method | Route | Path |
|
|
17
|
-
|----------|--------|-------|------|
|
|
18
|
-
{{#each endpoints}}
|
|
19
|
-
| `{{name}}` | {{method}} | `{{route}}` | `{{path}}` |
|
|
20
|
-
{{/each}}
|
|
21
|
-
{{/if}}
|
|
22
|
-
|
|
23
|
-
{{#if hasNextjs}}
|
|
24
|
-
## Next.js Pages ({{pageCount}})
|
|
25
|
-
|
|
26
|
-
| Route | Path |
|
|
27
|
-
|-------|------|
|
|
28
|
-
{{#each pages}}
|
|
29
|
-
| `{{route}}` | `{{path}}` |
|
|
30
|
-
{{/each}}
|
|
31
|
-
|
|
32
|
-
{{#if layouts.length}}
|
|
33
|
-
### Layouts
|
|
34
|
-
|
|
35
|
-
{{#each layouts}}
|
|
36
|
-
- `{{path}}`
|
|
37
|
-
{{/each}}
|
|
38
|
-
{{/if}}
|
|
39
|
-
|
|
40
|
-
{{#if componentCount}}
|
|
41
|
-
## Components ({{componentCount}})
|
|
42
|
-
|
|
43
|
-
| Component | Path |
|
|
44
|
-
|-----------|------|
|
|
45
|
-
{{#each components}}
|
|
46
|
-
| `{{name}}` | `{{path}}` |
|
|
47
|
-
{{/each}}
|
|
48
|
-
{{/if}}
|
|
49
|
-
{{/if}}
|
|
50
|
-
|
|
51
|
-
{{#if hasIntegrations}}
|
|
52
|
-
## Integrations
|
|
53
|
-
|
|
54
|
-
| Service | Type | Configured |
|
|
55
|
-
|---------|------|------------|
|
|
56
|
-
{{#each integrations}}
|
|
57
|
-
| {{name}} | {{type}} | {{#if configured}}Yes{{else}}No{{/if}} |
|
|
58
|
-
{{/each}}
|
|
59
|
-
{{/if}}
|
|
60
|
-
|
|
61
|
-
{{#if hasTables}}
|
|
62
|
-
## Database Tables ({{tableCount}})
|
|
63
|
-
|
|
64
|
-
| Table | Source Migration |
|
|
65
|
-
|-------|----------------|
|
|
66
|
-
{{#each tables}}
|
|
67
|
-
| `{{table}}` | `{{migration}}` |
|
|
68
|
-
{{/each}}
|
|
69
|
-
{{/if}}
|
|
70
|
-
|
|
71
|
-
{{#if hasDotnetPackages}}
|
|
72
|
-
## .NET Packages
|
|
73
|
-
|
|
74
|
-
{{#each dotnetPackages}}
|
|
75
|
-
- `{{name}}` {{version}}
|
|
76
|
-
{{/each}}
|
|
77
|
-
{{/if}}
|
|
78
|
-
|
|
79
|
-
{{#if hasNpmPackages}}
|
|
80
|
-
## NPM Packages
|
|
81
|
-
|
|
82
|
-
{{#each npmPackages}}
|
|
83
|
-
- `{{name}}` {{version}}
|
|
84
|
-
{{/each}}
|
|
85
|
-
{{/if}}
|
|
86
|
-
{{#if hasGraph}}
|
|
87
|
-
## Centralidade (grafo de codebase)
|
|
88
|
-
|
|
89
|
-
Símbolos com mais conexões depois do saneamento — o que quebra mais se mudar.
|
|
90
|
-
Detalhe de um símbolo: `morph-spec graph explain <nome>` (sem grafo, símbolo ausente ou ambíguo: `grep -rn <nome>`).
|
|
91
|
-
|
|
92
|
-
| Símbolo | Arquivo | Grau |
|
|
93
|
-
|---------|---------|------|
|
|
94
|
-
{{#each godNodes}}
|
|
95
|
-
| `{{label}}` | `{{source_file}}` | {{degree}} |
|
|
96
|
-
{{/each}}
|
|
97
|
-
{{#if hasLabeledCommunities}}
|
|
98
|
-
|
|
99
|
-
### Comunidades
|
|
100
|
-
|
|
101
|
-
{{#each communities}}
|
|
102
|
-
- **{{label}}** ({{size}} nós)
|
|
103
|
-
{{/each}}
|
|
104
|
-
{{/if}}
|
|
105
|
-
{{/if}}
|
|
106
|
-
|