trellis 2.1.7 → 3.0.2
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 +65 -706
- package/dist/cli/index.d.ts +16 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +3188 -232
- package/dist/client/config.d.ts +56 -0
- package/dist/client/config.d.ts.map +1 -0
- package/dist/client/index.d.ts +15 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +32 -0
- package/dist/client/sdk.d.ts +152 -0
- package/dist/client/sdk.d.ts.map +1 -0
- package/dist/config-8hczw0rs.js +20 -0
- package/dist/context/heat-map-manager.d.ts +100 -0
- package/dist/context/heat-map-manager.d.ts.map +1 -0
- package/dist/context/manager.d.ts +16 -0
- package/dist/context/manager.d.ts.map +1 -0
- package/dist/context/types.d.ts +20 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/core/agents/harness.d.ts +58 -0
- package/dist/core/agents/harness.d.ts.map +1 -0
- package/dist/core/agents/index.d.ts +8 -0
- package/dist/core/agents/index.d.ts.map +1 -0
- package/dist/core/agents/types.d.ts +79 -0
- package/dist/core/agents/types.d.ts.map +1 -0
- package/dist/core/computation/expr-evaluator.d.ts +52 -0
- package/dist/core/computation/expr-evaluator.d.ts.map +1 -0
- package/dist/core/index.d.ts +25 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +105 -11
- package/dist/core/kernel/logic-middleware.d.ts +19 -0
- package/dist/core/kernel/logic-middleware.d.ts.map +1 -0
- package/dist/core/kernel/middleware.d.ts +28 -0
- package/dist/core/kernel/middleware.d.ts.map +1 -0
- package/dist/core/kernel/schema-middleware.d.ts +15 -0
- package/dist/core/kernel/schema-middleware.d.ts.map +1 -0
- package/dist/core/kernel/security-middleware.d.ts +24 -0
- package/dist/core/kernel/security-middleware.d.ts.map +1 -0
- package/dist/core/kernel/sync-provider.d.ts +59 -0
- package/dist/core/kernel/sync-provider.d.ts.map +1 -0
- package/dist/core/kernel/trellis-kernel.d.ts +217 -0
- package/dist/core/kernel/trellis-kernel.d.ts.map +1 -0
- package/dist/core/ontology/builtins.d.ts +16 -0
- package/dist/core/ontology/builtins.d.ts.map +1 -0
- package/dist/core/ontology/core-ontology.d.ts +20 -0
- package/dist/core/ontology/core-ontology.d.ts.map +1 -0
- package/dist/core/ontology/index.d.ts +12 -0
- package/dist/core/ontology/index.d.ts.map +1 -0
- package/dist/core/ontology/registry.d.ts +70 -0
- package/dist/core/ontology/registry.d.ts.map +1 -0
- package/dist/core/ontology/types.d.ts +201 -0
- package/dist/core/ontology/types.d.ts.map +1 -0
- package/dist/core/ontology/validator.d.ts +34 -0
- package/dist/core/ontology/validator.d.ts.map +1 -0
- package/dist/core/persist/backend.d.ts +62 -0
- package/dist/core/persist/backend.d.ts.map +1 -0
- package/dist/core/persist/better-sqlite-backend.d.ts +33 -0
- package/dist/core/persist/better-sqlite-backend.d.ts.map +1 -0
- package/dist/core/persist/sqlite-backend.d.ts +43 -0
- package/dist/core/persist/sqlite-backend.d.ts.map +1 -0
- package/dist/core/plugins/index.d.ts +8 -0
- package/dist/core/plugins/index.d.ts.map +1 -0
- package/dist/core/plugins/registry.d.ts +69 -0
- package/dist/core/plugins/registry.d.ts.map +1 -0
- package/dist/core/plugins/types.d.ts +87 -0
- package/dist/core/plugins/types.d.ts.map +1 -0
- package/dist/core/query/datalog.d.ts +52 -0
- package/dist/core/query/datalog.d.ts.map +1 -0
- package/dist/core/query/engine.d.ts +42 -0
- package/dist/core/query/engine.d.ts.map +1 -0
- package/dist/core/query/index.d.ts +12 -0
- package/dist/core/query/index.d.ts.map +1 -0
- package/dist/core/query/parser.d.ts +37 -0
- package/dist/core/query/parser.d.ts.map +1 -0
- package/dist/core/query/types.d.ts +135 -0
- package/dist/core/query/types.d.ts.map +1 -0
- package/dist/core/store/eav-store.d.ts +111 -0
- package/dist/core/store/eav-store.d.ts.map +1 -0
- package/dist/db/index.d.ts +18 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +85 -0
- package/dist/db/inspector.js +28 -0
- package/dist/db/trellis.css +1 -0
- package/dist/decisions/auto-capture.d.ts +31 -0
- package/dist/decisions/auto-capture.d.ts.map +1 -0
- package/dist/decisions/hooks.d.ts +48 -0
- package/dist/decisions/hooks.d.ts.map +1 -0
- package/dist/decisions/index.d.ts +36 -0
- package/dist/decisions/index.d.ts.map +1 -0
- package/dist/decisions/types.d.ts +73 -0
- package/dist/decisions/types.d.ts.map +1 -0
- package/dist/deploy-999q207z.js +10 -0
- package/dist/embeddings/auto-embed.d.ts +52 -0
- package/dist/embeddings/auto-embed.d.ts.map +1 -0
- package/dist/embeddings/chunker.d.ts +73 -0
- package/dist/embeddings/chunker.d.ts.map +1 -0
- package/dist/embeddings/index.d.ts +18 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/model.d.ts +30 -0
- package/dist/embeddings/model.d.ts.map +1 -0
- package/dist/embeddings/search.d.ts +87 -0
- package/dist/embeddings/search.d.ts.map +1 -0
- package/dist/embeddings/store.d.ts +66 -0
- package/dist/embeddings/store.d.ts.map +1 -0
- package/dist/embeddings/types.d.ts +54 -0
- package/dist/embeddings/types.d.ts.map +1 -0
- package/dist/engine-y0724kjq.js +8 -0
- package/dist/engine.d.ts +218 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/evals/types.d.ts +29 -0
- package/dist/evals/types.d.ts.map +1 -0
- package/dist/garden/cluster.d.ts +57 -0
- package/dist/garden/cluster.d.ts.map +1 -0
- package/dist/garden/garden.d.ts +104 -0
- package/dist/garden/garden.d.ts.map +1 -0
- package/dist/garden/index.d.ts +15 -0
- package/dist/garden/index.d.ts.map +1 -0
- package/dist/git/git-exporter.d.ts +37 -0
- package/dist/git/git-exporter.d.ts.map +1 -0
- package/dist/git/git-importer.d.ts +36 -0
- package/dist/git/git-importer.d.ts.map +1 -0
- package/dist/git/git-reader.d.ts +63 -0
- package/dist/git/git-reader.d.ts.map +1 -0
- package/dist/git/index.d.ts +10 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/identity/governance.d.ts +54 -0
- package/dist/identity/governance.d.ts.map +1 -0
- package/dist/identity/identity.d.ts +63 -0
- package/dist/identity/identity.d.ts.map +1 -0
- package/dist/identity/index.d.ts +10 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/signing-middleware.d.ts +38 -0
- package/dist/identity/signing-middleware.d.ts.map +1 -0
- package/dist/import-s2b8e0ft.js +11 -0
- package/dist/{index-3ejh8k6v.js → index-0q7wbasy.js} +18 -4
- package/dist/index-0zk3fx2s.js +1004 -0
- package/dist/index-2r4jxwnb.js +32 -0
- package/dist/index-6n5dcebj.js +847 -0
- package/dist/index-7e27kvvj.js +292 -0
- package/dist/index-bmyt7k8n.js +90 -0
- package/dist/index-c9h37r6h.js +1 -0
- package/dist/{index-k5kf7sd0.js → index-hmdbnd4n.js} +1 -1
- package/dist/index-k5b0xskw.js +1 -0
- package/dist/index-n9f2qyh5.js +495 -0
- package/dist/{index-22jx9qsz.js → index-q31hfjja.js} +861 -51
- package/dist/index-skhn0agf.js +155 -0
- package/dist/{index-5m0g9r0y.js → index-w7ng765c.js} +4 -497
- package/dist/index-wt8rz4gn.js +132 -0
- package/dist/index-xzym9w0m.js +43 -0
- package/dist/index-y3d71wzd.js +77 -0
- package/dist/index-y6a4kj0p.js +43 -0
- package/dist/index-yhwjgfvj.js +342 -0
- package/dist/index-yp88he8n.js +316 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -9
- package/dist/links/index.d.ts +16 -0
- package/dist/links/index.d.ts.map +1 -0
- package/dist/links/lifecycle.d.ts +112 -0
- package/dist/links/lifecycle.d.ts.map +1 -0
- package/dist/links/parser.d.ts +56 -0
- package/dist/links/parser.d.ts.map +1 -0
- package/dist/links/ref-index.d.ts +55 -0
- package/dist/links/ref-index.d.ts.map +1 -0
- package/dist/links/resolver.d.ts +90 -0
- package/dist/links/resolver.d.ts.map +1 -0
- package/dist/links/types.d.ts +70 -0
- package/dist/links/types.d.ts.map +1 -0
- package/dist/llm/provider.d.ts +11 -0
- package/dist/llm/provider.d.ts.map +1 -0
- package/dist/llm/types.d.ts +74 -0
- package/dist/llm/types.d.ts.map +1 -0
- package/dist/mcp/docs.d.ts +18 -0
- package/dist/mcp/docs.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +15 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +26 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/orchestration/types.d.ts +22 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/plugins/agent-memory/graph-context-manager.d.ts +75 -0
- package/dist/plugins/agent-memory/graph-context-manager.d.ts.map +1 -0
- package/dist/plugins/agent-memory/index.d.ts +30 -0
- package/dist/plugins/agent-memory/index.d.ts.map +1 -0
- package/dist/plugins/agent-memory/ontology.d.ts +13 -0
- package/dist/plugins/agent-memory/ontology.d.ts.map +1 -0
- package/dist/plugins/agent-memory/plugin.d.ts +17 -0
- package/dist/plugins/agent-memory/plugin.d.ts.map +1 -0
- package/dist/plugins/brand/cache.d.ts +18 -0
- package/dist/plugins/brand/cache.d.ts.map +1 -0
- package/dist/plugins/brand/catalog-generator.d.ts +89 -0
- package/dist/plugins/brand/catalog-generator.d.ts.map +1 -0
- package/dist/plugins/brand/constraints.d.ts +55 -0
- package/dist/plugins/brand/constraints.d.ts.map +1 -0
- package/dist/plugins/brand/index.d.ts +44 -0
- package/dist/plugins/brand/index.d.ts.map +1 -0
- package/dist/plugins/brand/mcp-tools.d.ts +101 -0
- package/dist/plugins/brand/mcp-tools.d.ts.map +1 -0
- package/dist/plugins/brand/ontology.d.ts +13 -0
- package/dist/plugins/brand/ontology.d.ts.map +1 -0
- package/dist/plugins/brand/plugin.d.ts +21 -0
- package/dist/plugins/brand/plugin.d.ts.map +1 -0
- package/dist/plugins/brand/voice-tone.d.ts +24 -0
- package/dist/plugins/brand/voice-tone.d.ts.map +1 -0
- package/dist/plugins/idea-garden/api.d.ts +26 -0
- package/dist/plugins/idea-garden/api.d.ts.map +1 -0
- package/dist/plugins/idea-garden/index.d.ts +12 -0
- package/dist/plugins/idea-garden/index.d.ts.map +1 -0
- package/dist/plugins/idea-garden/plugin.d.ts +16 -0
- package/dist/plugins/idea-garden/plugin.d.ts.map +1 -0
- package/dist/plugins/idea-garden/types.d.ts +22 -0
- package/dist/plugins/idea-garden/types.d.ts.map +1 -0
- package/dist/plugins/plan-approval/index.d.ts +36 -0
- package/dist/plugins/plan-approval/index.d.ts.map +1 -0
- package/dist/plugins/plan-approval/ontology.d.ts +11 -0
- package/dist/plugins/plan-approval/ontology.d.ts.map +1 -0
- package/dist/plugins/plan-approval/plan-manager.d.ts +104 -0
- package/dist/plugins/plan-approval/plan-manager.d.ts.map +1 -0
- package/dist/plugins/plan-approval/plugin.d.ts +110 -0
- package/dist/plugins/plan-approval/plugin.d.ts.map +1 -0
- package/dist/plugins/proactive-watcher/index.d.ts +28 -0
- package/dist/plugins/proactive-watcher/index.d.ts.map +1 -0
- package/dist/plugins/proactive-watcher/ontology.d.ts +8 -0
- package/dist/plugins/proactive-watcher/ontology.d.ts.map +1 -0
- package/dist/plugins/proactive-watcher/plugin.d.ts +20 -0
- package/dist/plugins/proactive-watcher/plugin.d.ts.map +1 -0
- package/dist/plugins/proactive-watcher/watcher-manager.d.ts +36 -0
- package/dist/plugins/proactive-watcher/watcher-manager.d.ts.map +1 -0
- package/dist/plugins/sprite-tools/checkpoint-middleware.d.ts +43 -0
- package/dist/plugins/sprite-tools/checkpoint-middleware.d.ts.map +1 -0
- package/dist/plugins/sprite-tools/index.d.ts +40 -0
- package/dist/plugins/sprite-tools/index.d.ts.map +1 -0
- package/dist/plugins/sprite-tools/plugin.d.ts +69 -0
- package/dist/plugins/sprite-tools/plugin.d.ts.map +1 -0
- package/dist/react/index.js +189 -0
- package/dist/scaffold/index.d.ts +13 -0
- package/dist/scaffold/index.d.ts.map +1 -0
- package/dist/scaffold/infer.d.ts +42 -0
- package/dist/scaffold/infer.d.ts.map +1 -0
- package/dist/scaffold/profile.d.ts +51 -0
- package/dist/scaffold/profile.d.ts.map +1 -0
- package/dist/scaffold/seed.d.ts +27 -0
- package/dist/scaffold/seed.d.ts.map +1 -0
- package/dist/scaffold/write.d.ts +53 -0
- package/dist/scaffold/write.d.ts.map +1 -0
- package/dist/sdk-snn5gad3.js +15 -0
- package/dist/semantic/csharp-parser.d.ts +12 -0
- package/dist/semantic/csharp-parser.d.ts.map +1 -0
- package/dist/semantic/go-parser.d.ts +12 -0
- package/dist/semantic/go-parser.d.ts.map +1 -0
- package/dist/semantic/index.d.ts +22 -0
- package/dist/semantic/index.d.ts.map +1 -0
- package/dist/semantic/java-parser.d.ts +12 -0
- package/dist/semantic/java-parser.d.ts.map +1 -0
- package/dist/semantic/python-parser.d.ts +12 -0
- package/dist/semantic/python-parser.d.ts.map +1 -0
- package/dist/semantic/ruby-parser.d.ts +12 -0
- package/dist/semantic/ruby-parser.d.ts.map +1 -0
- package/dist/semantic/rust-parser.d.ts +12 -0
- package/dist/semantic/rust-parser.d.ts.map +1 -0
- package/dist/semantic/semantic-merge.d.ts +20 -0
- package/dist/semantic/semantic-merge.d.ts.map +1 -0
- package/dist/semantic/ts-parser.d.ts +13 -0
- package/dist/semantic/ts-parser.d.ts.map +1 -0
- package/dist/semantic/types.d.ts +130 -0
- package/dist/semantic/types.d.ts.map +1 -0
- package/dist/server/auth.d.ts +72 -0
- package/dist/server/auth.d.ts.map +1 -0
- package/dist/server/deploy.d.ts +44 -0
- package/dist/server/deploy.d.ts.map +1 -0
- package/dist/server/import.d.ts +40 -0
- package/dist/server/import.d.ts.map +1 -0
- package/dist/server/index.d.ts +26 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +90 -0
- package/dist/server/permissions.d.ts +84 -0
- package/dist/server/permissions.d.ts.map +1 -0
- package/dist/server/realtime.d.ts +78 -0
- package/dist/server/realtime.d.ts.map +1 -0
- package/dist/server/server.d.ts +43 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/sprites.d.ts +26 -0
- package/dist/server/sprites.d.ts.map +1 -0
- package/dist/server/tenancy.d.ts +53 -0
- package/dist/server/tenancy.d.ts.map +1 -0
- package/dist/server/vm-config.d.ts +60 -0
- package/dist/server/vm-config.d.ts.map +1 -0
- package/dist/server-mrctdwzr.js +11 -0
- package/dist/sprites-vc4qbrp1.js +16 -0
- package/dist/streaming/types.d.ts +43 -0
- package/dist/streaming/types.d.ts.map +1 -0
- package/dist/sync/http-transport.d.ts +47 -0
- package/dist/sync/http-transport.d.ts.map +1 -0
- package/dist/sync/index.d.ts +22 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/memory-transport.d.ts +27 -0
- package/dist/sync/memory-transport.d.ts.map +1 -0
- package/dist/sync/multi-repo.d.ts +82 -0
- package/dist/sync/multi-repo.d.ts.map +1 -0
- package/dist/sync/reconciler.d.ts +48 -0
- package/dist/sync/reconciler.d.ts.map +1 -0
- package/dist/sync/sync-engine.d.ts +65 -0
- package/dist/sync/sync-engine.d.ts.map +1 -0
- package/dist/sync/types.d.ts +71 -0
- package/dist/sync/types.d.ts.map +1 -0
- package/dist/sync/ws-transport.d.ts +41 -0
- package/dist/sync/ws-transport.d.ts.map +1 -0
- package/dist/tenancy-7d1g4ayp.js +13 -0
- package/dist/ui/client.html +460 -664
- package/dist/ui/server.d.ts +42 -0
- package/dist/ui/server.d.ts.map +1 -0
- package/dist/vcs/blob-store.d.ts +49 -0
- package/dist/vcs/blob-store.d.ts.map +1 -0
- package/dist/vcs/branch.d.ts +35 -0
- package/dist/vcs/branch.d.ts.map +1 -0
- package/dist/vcs/checkpoint.d.ts +24 -0
- package/dist/vcs/checkpoint.d.ts.map +1 -0
- package/dist/vcs/decompose.d.ts +19 -0
- package/dist/vcs/decompose.d.ts.map +1 -0
- package/dist/vcs/diff.d.ts +65 -0
- package/dist/vcs/diff.d.ts.map +1 -0
- package/dist/vcs/engine-context.d.ts +21 -0
- package/dist/vcs/engine-context.d.ts.map +1 -0
- package/dist/vcs/index.d.ts +23 -0
- package/dist/vcs/index.d.ts.map +1 -0
- package/dist/vcs/index.js +2 -2
- package/dist/vcs/issue.d.ts +159 -0
- package/dist/vcs/issue.d.ts.map +1 -0
- package/dist/vcs/merge.d.ts +55 -0
- package/dist/vcs/merge.d.ts.map +1 -0
- package/dist/vcs/milestone.d.ts +30 -0
- package/dist/vcs/milestone.d.ts.map +1 -0
- package/dist/vcs/ops.d.ts +27 -0
- package/dist/vcs/ops.d.ts.map +1 -0
- package/dist/vcs/types.d.ts +95 -0
- package/dist/vcs/types.d.ts.map +1 -0
- package/dist/vcs/vcs-middleware.d.ts +14 -0
- package/dist/vcs/vcs-middleware.d.ts.map +1 -0
- package/dist/vm-config-6xhsj6b3.js +22 -0
- package/dist/watcher/fs-watcher.d.ts +51 -0
- package/dist/watcher/fs-watcher.d.ts.map +1 -0
- package/dist/watcher/index.d.ts +9 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/ingestion.d.ts +28 -0
- package/dist/watcher/ingestion.d.ts.map +1 -0
- package/package.json +57 -7
- package/dist/index-hybgxe40.js +0 -1174
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global User Profile
|
|
3
|
+
*
|
|
4
|
+
* Manages a persistent user profile stored at ~/.trellis/profile.json.
|
|
5
|
+
* This profile is captured once on first-ever Trellis use and injected
|
|
6
|
+
* into every repo's agent scaffold to provide personal context to AI tools.
|
|
7
|
+
*
|
|
8
|
+
* The profile is a *soft metadata* layer distinct from the cryptographic
|
|
9
|
+
* identity in `src/identity/`. If an identity already exists for the repo,
|
|
10
|
+
* the profile prompt pre-fills the name from `identity.displayName`.
|
|
11
|
+
*
|
|
12
|
+
* @module trellis/scaffold/profile
|
|
13
|
+
*/
|
|
14
|
+
export interface UserProfile {
|
|
15
|
+
name: string;
|
|
16
|
+
bio: string;
|
|
17
|
+
skills: string[];
|
|
18
|
+
style: string;
|
|
19
|
+
preferences: {
|
|
20
|
+
verbosity: 'concise' | 'detailed' | 'balanced';
|
|
21
|
+
tone: 'peer' | 'mentor' | 'formal';
|
|
22
|
+
};
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Load the global user profile, or null if not yet created.
|
|
28
|
+
*/
|
|
29
|
+
export declare function loadProfile(): UserProfile | null;
|
|
30
|
+
/**
|
|
31
|
+
* Save (or overwrite) the global user profile.
|
|
32
|
+
*/
|
|
33
|
+
export declare function saveProfile(profile: UserProfile): void;
|
|
34
|
+
/**
|
|
35
|
+
* Returns true if a global profile exists.
|
|
36
|
+
*/
|
|
37
|
+
export declare function hasProfile(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Interactive terminal prompt to collect user profile.
|
|
40
|
+
* Called only from the CLI layer, never from programmatic API consumers.
|
|
41
|
+
*
|
|
42
|
+
* @param hints Optional pre-fill hints (e.g. from an existing identity)
|
|
43
|
+
*/
|
|
44
|
+
export declare function promptForProfile(hints?: {
|
|
45
|
+
name?: string;
|
|
46
|
+
}): Promise<UserProfile>;
|
|
47
|
+
/**
|
|
48
|
+
* Update specific fields of the existing profile without full re-prompting.
|
|
49
|
+
*/
|
|
50
|
+
export declare function updateProfile(updates: Partial<Omit<UserProfile, 'createdAt'>>): UserProfile;
|
|
51
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/scaffold/profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAWH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE;QACX,SAAS,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;QAC/C,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;KACpC,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAkBD;;GAEG;AACH,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAShD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAMtD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAeD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,WAAW,CAAC,CAiEvB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,GAC/C,WAAW,CAqBb"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Seeding
|
|
3
|
+
*
|
|
4
|
+
* Rewrites agent context files based on current repository state.
|
|
5
|
+
* Provides the `trellis seed` command to refresh context without re-running init.
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/scaffold/seed
|
|
8
|
+
*/
|
|
9
|
+
import type { IdeType } from './write.js';
|
|
10
|
+
export interface SeedOptions {
|
|
11
|
+
rootPath: string;
|
|
12
|
+
ide?: IdeType;
|
|
13
|
+
force?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface SeedResult {
|
|
16
|
+
success: boolean;
|
|
17
|
+
filesUpdated: string[];
|
|
18
|
+
timestamp: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Refresh the agent context files by re-inferring project context.
|
|
22
|
+
*
|
|
23
|
+
* @param opts - Options including rootPath and IDE target
|
|
24
|
+
* @returns SeedResult with success status and list of updated files
|
|
25
|
+
*/
|
|
26
|
+
export declare function seedContext(opts: SeedOptions): Promise<SeedResult>;
|
|
27
|
+
//# sourceMappingURL=seed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../src/scaffold/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA6ExE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Scaffold Writer
|
|
3
|
+
*
|
|
4
|
+
* Writes the agent context directory (.trellis/agents/) during `trellis init`.
|
|
5
|
+
* Produces AGENTS.md (human + AI readable), agent-context.json (machine
|
|
6
|
+
* readable), and stub directories for skills and workflows.
|
|
7
|
+
*
|
|
8
|
+
* The agent config is named `agent-context.json` (not `config.json`) to avoid
|
|
9
|
+
* collision with `.trellis/config.json` which stores engine configuration.
|
|
10
|
+
*
|
|
11
|
+
* @module trellis/scaffold/write
|
|
12
|
+
*/
|
|
13
|
+
import type { ProjectContext } from './infer.js';
|
|
14
|
+
import type { UserProfile } from './profile.js';
|
|
15
|
+
export interface AgentScaffoldConfig {
|
|
16
|
+
domain: string | null;
|
|
17
|
+
ecosystem: string | null;
|
|
18
|
+
tools: string[];
|
|
19
|
+
ontologies: string[];
|
|
20
|
+
generatedAt: string;
|
|
21
|
+
confidence: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ScaffoldInput {
|
|
24
|
+
profile: UserProfile | null;
|
|
25
|
+
context: ProjectContext;
|
|
26
|
+
}
|
|
27
|
+
export type IdeType = 'cursor' | 'windsurf' | 'claude' | 'copilot' | 'codex' | 'gemini' | 'none';
|
|
28
|
+
export type WorkspaceFootprint = 'minimal' | 'standard' | 'full';
|
|
29
|
+
export type FrameworkType = 'react' | 'vue' | 'svelte' | 'next' | 'nuxt' | 'remotion' | 'expo' | 'bun' | 'node' | 'cli' | 'library' | 'animation' | 'games' | 'none';
|
|
30
|
+
export interface IdeScaffoldInput {
|
|
31
|
+
ide: IdeType;
|
|
32
|
+
footprint: WorkspaceFootprint;
|
|
33
|
+
framework: FrameworkType;
|
|
34
|
+
plugins: string[];
|
|
35
|
+
rootPath: string;
|
|
36
|
+
context: ProjectContext;
|
|
37
|
+
profile: UserProfile | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Write the full agent scaffold into .trellis/agents/.
|
|
41
|
+
*
|
|
42
|
+
* @param rootPath - Absolute path to the repository root
|
|
43
|
+
* @param input - Profile and inferred project context
|
|
44
|
+
*/
|
|
45
|
+
export declare function writeAgentScaffold(rootPath: string, input: ScaffoldInput): void;
|
|
46
|
+
/**
|
|
47
|
+
* Write IDE-specific dotfolder scaffolds.
|
|
48
|
+
*
|
|
49
|
+
* @param rootPath - Absolute path to the repository root
|
|
50
|
+
* @param input - IDE type, footprint, plugins, context, and profile
|
|
51
|
+
*/
|
|
52
|
+
export declare function writeIdeScaffold(rootPath: string, input: IdeScaffoldInput): void;
|
|
53
|
+
//# sourceMappingURL=write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/scaffold/write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAMhD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AACjG,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAErK,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,kBAAkB,CAAC;IAC9B,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;AAmJD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,aAAa,GACnB,IAAI,CAoCN;AAwKD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,gBAAgB,GACtB,IAAI,CAmHN"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
FetchError,
|
|
4
|
+
TrellisDb
|
|
5
|
+
} from "./index-7e27kvvj.js";
|
|
6
|
+
import"./index-xzym9w0m.js";
|
|
7
|
+
import"./index-y3d71wzd.js";
|
|
8
|
+
import"./index-0zk3fx2s.js";
|
|
9
|
+
import"./index-yhwjgfvj.js";
|
|
10
|
+
import"./index-yp88he8n.js";
|
|
11
|
+
import"./index-a76rekgs.js";
|
|
12
|
+
export {
|
|
13
|
+
TrellisDb,
|
|
14
|
+
FetchError
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C# Parser Adapter
|
|
3
|
+
*
|
|
4
|
+
* Tier 1 regex-based parser for C# source files.
|
|
5
|
+
* Extracts classes, interfaces, structs, enums, records,
|
|
6
|
+
* methods, properties, fields, using directives, and namespace exports.
|
|
7
|
+
*
|
|
8
|
+
* @see TRL-10
|
|
9
|
+
*/
|
|
10
|
+
import type { ParserAdapter } from './types.js';
|
|
11
|
+
export declare const csharpParser: ParserAdapter;
|
|
12
|
+
//# sourceMappingURL=csharp-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csharp-parser.d.ts","sourceRoot":"","sources":["../../src/semantic/csharp-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,aAAa,EAOd,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,YAAY,EAAE,aAmB1B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Go Parser Adapter
|
|
3
|
+
*
|
|
4
|
+
* Tier 1 regex-based parser for Go source files.
|
|
5
|
+
* Extracts structs, interfaces, functions, methods, type aliases,
|
|
6
|
+
* constants, variables, and imports.
|
|
7
|
+
*
|
|
8
|
+
* @see TRL-6
|
|
9
|
+
*/
|
|
10
|
+
import type { ParserAdapter } from './types.js';
|
|
11
|
+
export declare const goParser: ParserAdapter;
|
|
12
|
+
//# sourceMappingURL=go-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"go-parser.d.ts","sourceRoot":"","sources":["../../src/semantic/go-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,aAAa,EAOd,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,QAAQ,EAAE,aAmBtB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic Patching — Public Surface
|
|
3
|
+
*
|
|
4
|
+
* @module semantic
|
|
5
|
+
*
|
|
6
|
+
* Re-exports the {@link ParserAdapter} interface, the built-in
|
|
7
|
+
* {@link typescriptParser} (Tier 1 regex-based TS/JS parser), and the
|
|
8
|
+
* {@link semanticMerge} engine that merges patch sets with commutativity
|
|
9
|
+
* analysis.
|
|
10
|
+
*
|
|
11
|
+
* @see DESIGN.md §4 for the full semantic patching specification.
|
|
12
|
+
*/
|
|
13
|
+
export type { ASTEntity, ASTEntityKind, ImportRelation, ExportRelation, ParseResult, ParserAdapter, SemanticPatch, SemanticMergeConflict, SemanticMergeResult, } from './types.js';
|
|
14
|
+
export { typescriptParser } from './ts-parser.js';
|
|
15
|
+
export { pythonParser } from './python-parser.js';
|
|
16
|
+
export { goParser } from './go-parser.js';
|
|
17
|
+
export { rustParser } from './rust-parser.js';
|
|
18
|
+
export { rubyParser } from './ruby-parser.js';
|
|
19
|
+
export { javaParser } from './java-parser.js';
|
|
20
|
+
export { csharpParser } from './csharp-parser.js';
|
|
21
|
+
export { patchesCommute, semanticMerge } from './semantic-merge.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/semantic/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java Parser Adapter
|
|
3
|
+
*
|
|
4
|
+
* Tier 1 regex-based parser for Java source files.
|
|
5
|
+
* Extracts classes, interfaces, enums, methods, fields,
|
|
6
|
+
* annotations, imports, and package declarations.
|
|
7
|
+
*
|
|
8
|
+
* @see TRL-9
|
|
9
|
+
*/
|
|
10
|
+
import type { ParserAdapter } from './types.js';
|
|
11
|
+
export declare const javaParser: ParserAdapter;
|
|
12
|
+
//# sourceMappingURL=java-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-parser.d.ts","sourceRoot":"","sources":["../../src/semantic/java-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,aAAa,EAOd,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,UAAU,EAAE,aAmBxB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python Parser Adapter
|
|
3
|
+
*
|
|
4
|
+
* Tier 1 regex-based parser for Python source files.
|
|
5
|
+
* Extracts classes, functions, decorators, async functions,
|
|
6
|
+
* type hints, imports, and module-level variables.
|
|
7
|
+
*
|
|
8
|
+
* @see TRL-5
|
|
9
|
+
*/
|
|
10
|
+
import type { ParserAdapter } from './types.js';
|
|
11
|
+
export declare const pythonParser: ParserAdapter;
|
|
12
|
+
//# sourceMappingURL=python-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python-parser.d.ts","sourceRoot":"","sources":["../../src/semantic/python-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,aAAa,EAOd,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,YAAY,EAAE,aAmB1B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ruby Parser Adapter
|
|
3
|
+
*
|
|
4
|
+
* Tier 1 regex-based parser for Ruby source files.
|
|
5
|
+
* Extracts classes, modules, methods, constants, attributes,
|
|
6
|
+
* require/include statements, and module_function exports.
|
|
7
|
+
*
|
|
8
|
+
* @see TRL-8
|
|
9
|
+
*/
|
|
10
|
+
import type { ParserAdapter } from './types.js';
|
|
11
|
+
export declare const rubyParser: ParserAdapter;
|
|
12
|
+
//# sourceMappingURL=ruby-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruby-parser.d.ts","sourceRoot":"","sources":["../../src/semantic/ruby-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,aAAa,EAOd,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,UAAU,EAAE,aAmBxB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rust Parser Adapter
|
|
3
|
+
*
|
|
4
|
+
* Tier 1 regex-based parser for Rust source files.
|
|
5
|
+
* Extracts structs, enums, traits, impl blocks, functions,
|
|
6
|
+
* methods, type aliases, constants, macros, and use statements.
|
|
7
|
+
*
|
|
8
|
+
* @see TRL-7
|
|
9
|
+
*/
|
|
10
|
+
import type { ParserAdapter } from './types.js';
|
|
11
|
+
export declare const rustParser: ParserAdapter;
|
|
12
|
+
//# sourceMappingURL=rust-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rust-parser.d.ts","sourceRoot":"","sources":["../../src/semantic/rust-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,aAAa,EAOd,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,UAAU,EAAE,aAmBxB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic Merge Engine
|
|
3
|
+
*
|
|
4
|
+
* DESIGN.md §4.4 — Patch Commutativity and Conflict Detection.
|
|
5
|
+
* Two patches commute when they operate on disjoint entities.
|
|
6
|
+
* Two patches conflict when they both modify the same entity
|
|
7
|
+
* in incompatible ways.
|
|
8
|
+
*/
|
|
9
|
+
import type { SemanticPatch, SemanticMergeResult } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Check if two patches commute (can be applied in either order).
|
|
12
|
+
* Returns true if they operate on disjoint entities or are identical.
|
|
13
|
+
*/
|
|
14
|
+
export declare function patchesCommute(a: SemanticPatch, b: SemanticPatch): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Merge two sets of semantic patches (ours and theirs) against a common base.
|
|
17
|
+
* Produces a merged patch list or structured conflicts.
|
|
18
|
+
*/
|
|
19
|
+
export declare function semanticMerge(oursPatches: SemanticPatch[], theirsPatches: SemanticPatch[], filePath?: string): SemanticMergeResult;
|
|
20
|
+
//# sourceMappingURL=semantic-merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-merge.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EAEb,mBAAmB,EACpB,MAAM,YAAY,CAAC;AA0EpB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAwB1E;AAMD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,aAAa,EAAE,EAC5B,aAAa,EAAE,aAAa,EAAE,EAC9B,QAAQ,GAAE,MAAW,GACpB,mBAAmB,CAgFrB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript/JavaScript Parser Adapter
|
|
3
|
+
*
|
|
4
|
+
* DESIGN.md §4.2 — Structural extraction of top-level declarations
|
|
5
|
+
* using regex-based parsing. This is a Tier 1 implementation that
|
|
6
|
+
* extracts functions, classes, interfaces, type aliases, enums,
|
|
7
|
+
* variables, imports, and exports without requiring tree-sitter.
|
|
8
|
+
*
|
|
9
|
+
* Tree-sitter can be swapped in later for full Tier 2 AST fidelity.
|
|
10
|
+
*/
|
|
11
|
+
import type { ParserAdapter } from './types.js';
|
|
12
|
+
export declare const typescriptParser: ParserAdapter;
|
|
13
|
+
//# sourceMappingURL=ts-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ts-parser.d.ts","sourceRoot":"","sources":["../../src/semantic/ts-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,aAAa,EAOd,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,gBAAgB,EAAE,aAoB9B,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic Patching — Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* DESIGN.md §4.1–4.4 — Pillar 2: Semantic Patching.
|
|
5
|
+
* Types for parser adapters, AST entities, parse results,
|
|
6
|
+
* semantic patches, and structured merge conflicts.
|
|
7
|
+
*/
|
|
8
|
+
export interface ASTEntity {
|
|
9
|
+
/** Stable ID derived from structural signature (name + kind + scope path). */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Entity type. */
|
|
12
|
+
kind: ASTEntityKind;
|
|
13
|
+
/** Human-readable name. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Scope path for disambiguation (e.g. 'MyClass.myMethod'). */
|
|
16
|
+
scopePath: string;
|
|
17
|
+
/** Byte range in source for roundtrip (start, end). */
|
|
18
|
+
span: [number, number];
|
|
19
|
+
/** Raw source text of this declaration. */
|
|
20
|
+
rawText: string;
|
|
21
|
+
/** Structural signature for identity matching (excludes whitespace/comments). */
|
|
22
|
+
signature: string;
|
|
23
|
+
/** Child entities (nested functions, inner classes, etc.). */
|
|
24
|
+
children: ASTEntity[];
|
|
25
|
+
}
|
|
26
|
+
export type ASTEntityKind = 'FunctionDef' | 'ClassDef' | 'InterfaceDef' | 'TypeAlias' | 'EnumDef' | 'VariableDecl' | 'MethodDef' | 'PropertyDef' | 'Constructor' | 'Unknown';
|
|
27
|
+
export interface ImportRelation {
|
|
28
|
+
source: string;
|
|
29
|
+
specifiers: string[];
|
|
30
|
+
isDefault: boolean;
|
|
31
|
+
isNamespace: boolean;
|
|
32
|
+
rawText: string;
|
|
33
|
+
span: [number, number];
|
|
34
|
+
}
|
|
35
|
+
export interface ExportRelation {
|
|
36
|
+
name: string;
|
|
37
|
+
isDefault: boolean;
|
|
38
|
+
source?: string;
|
|
39
|
+
rawText: string;
|
|
40
|
+
span: [number, number];
|
|
41
|
+
}
|
|
42
|
+
export interface ParseResult {
|
|
43
|
+
/** The file entity this parse belongs to. */
|
|
44
|
+
fileEntityId: string;
|
|
45
|
+
/** File path. */
|
|
46
|
+
filePath: string;
|
|
47
|
+
/** Language identifier. */
|
|
48
|
+
language: string;
|
|
49
|
+
/** Top-level declarations found in the file. */
|
|
50
|
+
declarations: ASTEntity[];
|
|
51
|
+
/** Import relationships. */
|
|
52
|
+
imports: ImportRelation[];
|
|
53
|
+
/** Export relationships. */
|
|
54
|
+
exports: ExportRelation[];
|
|
55
|
+
}
|
|
56
|
+
export interface ParserAdapter {
|
|
57
|
+
/** Languages this adapter supports. */
|
|
58
|
+
languages: string[];
|
|
59
|
+
/** Parse a source file into AST-level entities. */
|
|
60
|
+
parse(content: string, filePath: string): ParseResult;
|
|
61
|
+
/** Compute semantic patches between two parse results. */
|
|
62
|
+
diff(oldResult: ParseResult, newResult: ParseResult): SemanticPatch[];
|
|
63
|
+
}
|
|
64
|
+
export type SemanticPatch = {
|
|
65
|
+
kind: 'symbolAdd';
|
|
66
|
+
entity: ASTEntity;
|
|
67
|
+
} | {
|
|
68
|
+
kind: 'symbolRemove';
|
|
69
|
+
entityId: string;
|
|
70
|
+
entityName: string;
|
|
71
|
+
} | {
|
|
72
|
+
kind: 'symbolModify';
|
|
73
|
+
entityId: string;
|
|
74
|
+
entityName: string;
|
|
75
|
+
oldSignature: string;
|
|
76
|
+
newSignature: string;
|
|
77
|
+
oldRawText: string;
|
|
78
|
+
newRawText: string;
|
|
79
|
+
} | {
|
|
80
|
+
kind: 'symbolRename';
|
|
81
|
+
entityId: string;
|
|
82
|
+
oldName: string;
|
|
83
|
+
newName: string;
|
|
84
|
+
} | {
|
|
85
|
+
kind: 'symbolMove';
|
|
86
|
+
entityId: string;
|
|
87
|
+
entityName: string;
|
|
88
|
+
oldFile: string;
|
|
89
|
+
newFile: string;
|
|
90
|
+
} | {
|
|
91
|
+
kind: 'importAdd';
|
|
92
|
+
fileId: string;
|
|
93
|
+
source: string;
|
|
94
|
+
specifiers: string[];
|
|
95
|
+
rawText: string;
|
|
96
|
+
} | {
|
|
97
|
+
kind: 'importRemove';
|
|
98
|
+
fileId: string;
|
|
99
|
+
source: string;
|
|
100
|
+
} | {
|
|
101
|
+
kind: 'importModify';
|
|
102
|
+
fileId: string;
|
|
103
|
+
source: string;
|
|
104
|
+
oldSpecifiers: string[];
|
|
105
|
+
newSpecifiers: string[];
|
|
106
|
+
} | {
|
|
107
|
+
kind: 'exportAdd';
|
|
108
|
+
fileId: string;
|
|
109
|
+
name: string;
|
|
110
|
+
rawText: string;
|
|
111
|
+
} | {
|
|
112
|
+
kind: 'exportRemove';
|
|
113
|
+
fileId: string;
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
116
|
+
export interface SemanticMergeConflict {
|
|
117
|
+
entityId: string;
|
|
118
|
+
entityName: string;
|
|
119
|
+
entityKind: string;
|
|
120
|
+
filePath: string;
|
|
121
|
+
ours: SemanticPatch;
|
|
122
|
+
theirs: SemanticPatch;
|
|
123
|
+
suggestion?: 'accept-ours' | 'accept-theirs' | 'combine';
|
|
124
|
+
}
|
|
125
|
+
export interface SemanticMergeResult {
|
|
126
|
+
clean: boolean;
|
|
127
|
+
patches: SemanticPatch[];
|
|
128
|
+
conflicts: SemanticMergeConflict[];
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/semantic/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trellis Server — Auth
|
|
3
|
+
*
|
|
4
|
+
* Produces an `AuthContext` from a request using one of:
|
|
5
|
+
* - Bearer JWT (signed with jwtSecret)
|
|
6
|
+
* - API key (compared against configured key)
|
|
7
|
+
* - Unauthenticated (public access)
|
|
8
|
+
*
|
|
9
|
+
* OAuth provider flows (Google, GitHub) are handled separately and ultimately
|
|
10
|
+
* issue a JWT, so this module just needs to verify tokens.
|
|
11
|
+
*
|
|
12
|
+
* @module trellis/server
|
|
13
|
+
*/
|
|
14
|
+
export interface AuthContext {
|
|
15
|
+
/** User entity ID (null = unauthenticated). */
|
|
16
|
+
userId: string | null;
|
|
17
|
+
/** Tenant ID (null = default tenant). */
|
|
18
|
+
tenantId: string | null;
|
|
19
|
+
/** Roles assigned to this user. */
|
|
20
|
+
roles: string[];
|
|
21
|
+
/** Raw JWT claims (if authenticated via JWT). */
|
|
22
|
+
claims: Record<string, unknown>;
|
|
23
|
+
/** Whether this request passed authentication. */
|
|
24
|
+
authenticated: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const ANONYMOUS: AuthContext;
|
|
27
|
+
/**
|
|
28
|
+
* Sign a JWT payload with HS256.
|
|
29
|
+
*/
|
|
30
|
+
export declare function signJwt(payload: Record<string, unknown>, secret: string, expiresInSeconds?: number): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Verify and decode a JWT. Returns null if invalid or expired.
|
|
33
|
+
*/
|
|
34
|
+
export declare function verifyJwt(token: string, secret: string): Promise<Record<string, unknown> | null>;
|
|
35
|
+
export interface AuthConfig {
|
|
36
|
+
/** Secret for JWT verification. Required for JWT auth. */
|
|
37
|
+
jwtSecret?: string;
|
|
38
|
+
/** Static API key. If set, `Authorization: Bearer <key>` is also accepted. */
|
|
39
|
+
apiKey?: string;
|
|
40
|
+
/** Allow unauthenticated (public) access. Default: true. */
|
|
41
|
+
allowPublic?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolve an `AuthContext` from an HTTP request's Authorization header.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveAuth(authHeader: string | null | undefined, config: AuthConfig): Promise<AuthContext>;
|
|
47
|
+
export interface OAuthProvider {
|
|
48
|
+
name: string;
|
|
49
|
+
clientId: string;
|
|
50
|
+
clientSecret: string;
|
|
51
|
+
authUrl: string;
|
|
52
|
+
tokenUrl: string;
|
|
53
|
+
userInfoUrl: string;
|
|
54
|
+
scopes: string[];
|
|
55
|
+
}
|
|
56
|
+
export declare const GOOGLE_PROVIDER: Omit<OAuthProvider, 'clientId' | 'clientSecret'>;
|
|
57
|
+
export declare const GITHUB_PROVIDER: Omit<OAuthProvider, 'clientId' | 'clientSecret'>;
|
|
58
|
+
/**
|
|
59
|
+
* Build an OAuth authorization redirect URL.
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildOAuthUrl(provider: OAuthProvider, redirectUri: string, state: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Exchange an OAuth code for an access token + user info.
|
|
64
|
+
* Returns normalized user profile.
|
|
65
|
+
*/
|
|
66
|
+
export declare function exchangeOAuthCode(provider: OAuthProvider, code: string, redirectUri: string): Promise<{
|
|
67
|
+
id: string;
|
|
68
|
+
email: string;
|
|
69
|
+
name: string;
|
|
70
|
+
avatarUrl?: string;
|
|
71
|
+
}>;
|
|
72
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/server/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mCAAmC;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,kDAAkD;IAClD,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,SAAS,EAAE,WAMvB,CAAC;AA+BF;;GAEG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,MAAM,EAAE,MAAM,EACd,gBAAgB,SAAQ,GACvB,OAAO,CAAC,MAAM,CAAC,CAejB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAkCzC;AAMD,MAAM,WAAW,UAAU;IACzB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,WAAW,CAAC,CAyCtB;AAMD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,cAAc,CAO1E,CAAC;AAEJ,eAAO,MAAM,eAAe,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,cAAc,CAO1E,CAAC;AAEJ;;GAEG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,GACZ,MAAM,CASR;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA2C1E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trellis DB — Sprites Deployment
|
|
3
|
+
*
|
|
4
|
+
* Deploys a Trellis DB server to a Sprites cloud environment.
|
|
5
|
+
*
|
|
6
|
+
* Sprites is a cloud VM platform. Each Sprite gets a persistent URL:
|
|
7
|
+
* https://<name>.sprites.app
|
|
8
|
+
*
|
|
9
|
+
* Deployment steps:
|
|
10
|
+
* 1. Bundle the server entrypoint with Bun
|
|
11
|
+
* 2. Create or wake the target Sprite via `sprite exec`
|
|
12
|
+
* 3. Upload the bundle + SQLite file (if seeding)
|
|
13
|
+
* 4. Install dependencies and start the server as a detached session
|
|
14
|
+
* 5. Write the resulting URL + API key back to .trellis-db.json
|
|
15
|
+
*
|
|
16
|
+
* Prerequisites:
|
|
17
|
+
* - `sprite` CLI installed and authenticated (https://docs.sprites.dev)
|
|
18
|
+
* - SPRITES_API_KEY env var (or passed directly)
|
|
19
|
+
*
|
|
20
|
+
* @module trellis/server
|
|
21
|
+
*/
|
|
22
|
+
export interface DeployOptions {
|
|
23
|
+
/** Sprite name (becomes the subdomain: <name>.sprites.app). */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Path to the local .trellis-db directory to deploy. */
|
|
26
|
+
dbPath?: string;
|
|
27
|
+
/** API key for the deployed server. Auto-generated if not provided. */
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
/** JWT secret for the deployed server. Auto-generated if not provided. */
|
|
30
|
+
jwtSecret?: string;
|
|
31
|
+
/** Port to run on inside the Sprite (default: 3000). */
|
|
32
|
+
port?: number;
|
|
33
|
+
/** Directory where .trellis-db.json lives. Default: cwd. */
|
|
34
|
+
configDir?: string;
|
|
35
|
+
/** Progress callback. */
|
|
36
|
+
onProgress?: (msg: string) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface DeployResult {
|
|
39
|
+
url: string;
|
|
40
|
+
name: string;
|
|
41
|
+
apiKey: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function deploy(opts: DeployOptions): Promise<DeployResult>;
|
|
44
|
+
//# sourceMappingURL=deploy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/server/deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAWH,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD,wBAAsB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAuGvE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trellis Server — Data Import
|
|
3
|
+
*
|
|
4
|
+
* Ingest records from CSV, JSON, NDJSON, and Parquet files into the kernel.
|
|
5
|
+
* Each row becomes a Trellis entity of the given type.
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/server
|
|
8
|
+
*/
|
|
9
|
+
import type { TrellisKernel } from '../core/kernel/trellis-kernel.js';
|
|
10
|
+
export interface ImportOptions {
|
|
11
|
+
/** Entity type to assign to every imported record. */
|
|
12
|
+
type: string;
|
|
13
|
+
/** Optional: field to use as entity ID. Defaults to auto-generated UUIDs. */
|
|
14
|
+
idField?: string;
|
|
15
|
+
/** Optional: prefix for generated entity IDs. Default: `import:` */
|
|
16
|
+
idPrefix?: string;
|
|
17
|
+
/** Skip rows where this field is falsy. */
|
|
18
|
+
skipEmpty?: boolean;
|
|
19
|
+
/** Max rows to import (useful for testing). */
|
|
20
|
+
limit?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ImportResult {
|
|
23
|
+
imported: number;
|
|
24
|
+
skipped: number;
|
|
25
|
+
errors: Array<{
|
|
26
|
+
row: number;
|
|
27
|
+
message: string;
|
|
28
|
+
}>;
|
|
29
|
+
entityIds: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Import data from a file into the kernel.
|
|
33
|
+
* Format is inferred from the file extension.
|
|
34
|
+
*/
|
|
35
|
+
export declare function importFile(kernel: TrellisKernel, filePath: string, opts: ImportOptions): Promise<ImportResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Import from an array of plain objects directly (useful for programmatic use).
|
|
38
|
+
*/
|
|
39
|
+
export declare function importRecords(kernel: TrellisKernel, records: Record<string, unknown>[], opts: ImportOptions): Promise<ImportResult>;
|
|
40
|
+
//# sourceMappingURL=import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/server/import.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAOtE,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAMD;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,YAAY,CAAC,CAmBvB;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAClC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,YAAY,CAAC,CAEvB"}
|