@metabob/minibob 0.1.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/ARCHITECTURE.md +255 -0
- package/CHANGELOG.md +112 -0
- package/README.md +380 -0
- package/bin/minibob.js +36 -0
- package/dist/acp-gossip.d.ts +72 -0
- package/dist/acp-gossip.d.ts.map +1 -0
- package/dist/acp-gossip.js +156 -0
- package/dist/acp-gossip.js.map +1 -0
- package/dist/acp.d.ts +62 -0
- package/dist/acp.d.ts.map +1 -0
- package/dist/acp.js +292 -0
- package/dist/acp.js.map +1 -0
- package/dist/activity.d.ts +157 -0
- package/dist/activity.d.ts.map +1 -0
- package/dist/activity.js +518 -0
- package/dist/activity.js.map +1 -0
- package/dist/agent-runtime.d.ts +104 -0
- package/dist/agent-runtime.d.ts.map +1 -0
- package/dist/boredom.d.ts +125 -0
- package/dist/boredom.d.ts.map +1 -0
- package/dist/boredom.js +244 -0
- package/dist/boredom.js.map +1 -0
- package/dist/cli/acp-server.d.ts +23 -0
- package/dist/cli/acp-server.d.ts.map +1 -0
- package/dist/cli/burrow.d.ts +26 -0
- package/dist/cli/burrow.d.ts.map +1 -0
- package/dist/cli/doctor.d.ts +22 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/goal.d.ts +22 -0
- package/dist/cli/goal.d.ts.map +1 -0
- package/dist/cli/index.d.ts +47 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/instance-registry.d.ts +78 -0
- package/dist/cli/instance-registry.d.ts.map +1 -0
- package/dist/cli/observe.d.ts +35 -0
- package/dist/cli/observe.d.ts.map +1 -0
- package/dist/cli/vessel.d.ts +14 -0
- package/dist/cli/vessel.d.ts.map +1 -0
- package/dist/composition-observer.d.ts +96 -0
- package/dist/composition-observer.d.ts.map +1 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +128 -0
- package/dist/config.js.map +1 -0
- package/dist/docker/Dockerfile +35 -0
- package/dist/environment.d.ts +72 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +142 -0
- package/dist/environment.js.map +1 -0
- package/dist/goal-processor.d.ts +165 -0
- package/dist/goal-processor.d.ts.map +1 -0
- package/dist/helm/minibob-cluster/Chart.yaml +13 -0
- package/dist/helm/minibob-cluster/templates/_helpers.tpl +60 -0
- package/dist/helm/minibob-cluster/templates/configmap.yaml +11 -0
- package/dist/helm/minibob-cluster/templates/deployment.yaml +108 -0
- package/dist/helm/minibob-cluster/templates/secret.yaml +10 -0
- package/dist/helm/minibob-cluster/templates/service.yaml +37 -0
- package/dist/helm/minibob-cluster/values-local.yaml +41 -0
- package/dist/helm/minibob-cluster/values-production.yaml +57 -0
- package/dist/helm/minibob-cluster/values-testing-cluster.yaml +43 -0
- package/dist/helm/minibob-cluster/values.yaml +127 -0
- package/dist/improviser.d.ts +74 -0
- package/dist/improviser.d.ts.map +1 -0
- package/dist/impulse-filter.d.ts +74 -0
- package/dist/impulse-filter.d.ts.map +1 -0
- package/dist/impulse.d.ts +92 -0
- package/dist/impulse.d.ts.map +1 -0
- package/dist/impulse.js +234 -0
- package/dist/impulse.js.map +1 -0
- package/dist/lib.d.ts +29 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +18561 -0
- package/dist/lib.js.map +98 -0
- package/dist/lifecycle-hooks.d.ts +99 -0
- package/dist/lifecycle-hooks.d.ts.map +1 -0
- package/dist/lifecycle-hooks.js +135 -0
- package/dist/lifecycle-hooks.js.map +1 -0
- package/dist/llm.d.ts +31 -0
- package/dist/llm.d.ts.map +1 -0
- package/dist/llm.js +349 -0
- package/dist/llm.js.map +1 -0
- package/dist/mcp-activity-bridge.d.ts +66 -0
- package/dist/mcp-activity-bridge.d.ts.map +1 -0
- package/dist/mcp-activity-bridge.js +126 -0
- package/dist/mcp-activity-bridge.js.map +1 -0
- package/dist/mcp.d.ts +216 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +292 -0
- package/dist/mcp.js.map +1 -0
- package/dist/memory-agent.d.ts +92 -0
- package/dist/memory-agent.d.ts.map +1 -0
- package/dist/memory-agent.js +277 -0
- package/dist/memory-agent.js.map +1 -0
- package/dist/runtime-mapping.d.ts +97 -0
- package/dist/runtime-mapping.d.ts.map +1 -0
- package/dist/search-first-executor.d.ts +113 -0
- package/dist/search-first-executor.d.ts.map +1 -0
- package/dist/session.d.ts +48 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/template-extractor.d.ts +9 -0
- package/dist/template-extractor.d.ts.map +1 -0
- package/dist/template-generator.d.ts +12 -0
- package/dist/template-generator.d.ts.map +1 -0
- package/dist/tools.d.ts +58 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +771 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +503 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/understanding/analyzer.d.ts +55 -0
- package/dist/understanding/analyzer.d.ts.map +1 -0
- package/dist/understanding/explorer.d.ts +73 -0
- package/dist/understanding/explorer.d.ts.map +1 -0
- package/dist/understanding/index.d.ts +7 -0
- package/dist/understanding/index.d.ts.map +1 -0
- package/dist/understanding/types.d.ts +136 -0
- package/dist/understanding/types.d.ts.map +1 -0
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +106 -0
- package/dist/validation.js.map +1 -0
- package/dist/vessel-bootstrap.d.ts +190 -0
- package/dist/vessel-bootstrap.d.ts.map +1 -0
- package/dist/vessel-registry.d.ts +229 -0
- package/dist/vessel-registry.d.ts.map +1 -0
- package/index.ts +1329 -0
- package/package.json +54 -0
- package/src/acp-gossip.ts +193 -0
- package/src/acp.ts +362 -0
- package/src/activity.ts +1464 -0
- package/src/agent-runtime.ts +365 -0
- package/src/boredom.ts +423 -0
- package/src/cli/acp-server.ts +377 -0
- package/src/cli/burrow.ts +896 -0
- package/src/cli/doctor.ts +526 -0
- package/src/cli/goal.ts +224 -0
- package/src/cli/index.ts +147 -0
- package/src/cli/instance-registry.ts +271 -0
- package/src/cli/observe.ts +682 -0
- package/src/cli/vessel.ts +287 -0
- package/src/components/SystemOverview.tsx +331 -0
- package/src/composition-observer.ts +449 -0
- package/src/config.ts +172 -0
- package/src/environment.ts +167 -0
- package/src/goal-processor.ts +654 -0
- package/src/improviser.ts +591 -0
- package/src/impulse-filter.ts +273 -0
- package/src/impulse.ts +311 -0
- package/src/lib.ts +147 -0
- package/src/lifecycle-hooks.ts +181 -0
- package/src/llm.ts +434 -0
- package/src/mcp-activity-bridge.ts +158 -0
- package/src/mcp.ts +747 -0
- package/src/memory-agent.ts +316 -0
- package/src/runtime-mapping.ts +527 -0
- package/src/search-first-executor.ts +666 -0
- package/src/session.ts +141 -0
- package/src/template-extractor.ts +256 -0
- package/src/template-generator.ts +130 -0
- package/src/tools.ts +924 -0
- package/src/types.ts +497 -0
- package/src/understanding/analyzer.ts +354 -0
- package/src/understanding/explorer.ts +488 -0
- package/src/understanding/index.ts +27 -0
- package/src/understanding/types.ts +153 -0
- package/src/validation.ts +125 -0
- package/src/vessel-bootstrap.ts +440 -0
- package/src/vessel-registry.ts +621 -0
- package/templates/core/edit-file.json +85 -0
- package/templates/understanding/diagnose-problem.json +32 -0
- package/templates/understanding/explore-codebase-v2.json +57 -0
- package/templates/understanding/explore-codebase.json +37 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeExplorer - Fast static analysis of codebase structure
|
|
3
|
+
*
|
|
4
|
+
* Uses Bun file APIs to analyze code without LLM calls.
|
|
5
|
+
* Provides foundation for semantic understanding.
|
|
6
|
+
*/
|
|
7
|
+
import type { CodeStructure, FileAnalysis } from './types';
|
|
8
|
+
export declare class CodeExplorer {
|
|
9
|
+
private workingDir;
|
|
10
|
+
private ignorePatterns;
|
|
11
|
+
constructor(workingDir?: string, additionalIgnore?: string[]);
|
|
12
|
+
/**
|
|
13
|
+
* Safe wrapper for Bun.file() with better error handling
|
|
14
|
+
*/
|
|
15
|
+
private safeReadFile;
|
|
16
|
+
/**
|
|
17
|
+
* Explore codebase and return comprehensive structure
|
|
18
|
+
*/
|
|
19
|
+
explore(rootPath: string): Promise<CodeStructure>;
|
|
20
|
+
/**
|
|
21
|
+
* Analyze specific file in detail
|
|
22
|
+
*/
|
|
23
|
+
analyzeFile(filePath: string): Promise<FileAnalysis>;
|
|
24
|
+
/**
|
|
25
|
+
* List all files in directory (non-ignored)
|
|
26
|
+
*/
|
|
27
|
+
private listAllFiles;
|
|
28
|
+
/**
|
|
29
|
+
* Check if file should be ignored
|
|
30
|
+
*/
|
|
31
|
+
private shouldIgnore;
|
|
32
|
+
/**
|
|
33
|
+
* Group files by extension
|
|
34
|
+
*/
|
|
35
|
+
private groupByExtension;
|
|
36
|
+
/**
|
|
37
|
+
* Extract dependencies from package.json files
|
|
38
|
+
*/
|
|
39
|
+
private extractDependencies;
|
|
40
|
+
/**
|
|
41
|
+
* Find application entry points
|
|
42
|
+
*/
|
|
43
|
+
private findEntryPoints;
|
|
44
|
+
/**
|
|
45
|
+
* Calculate total size and lines of code
|
|
46
|
+
*/
|
|
47
|
+
private calculateCodebaseSize;
|
|
48
|
+
/**
|
|
49
|
+
* Build directory structure tree
|
|
50
|
+
*/
|
|
51
|
+
private analyzeDirectoryStructure;
|
|
52
|
+
/**
|
|
53
|
+
* Extract imports from file content
|
|
54
|
+
*/
|
|
55
|
+
private extractImports;
|
|
56
|
+
/**
|
|
57
|
+
* Extract exports from file content
|
|
58
|
+
*/
|
|
59
|
+
private extractExports;
|
|
60
|
+
/**
|
|
61
|
+
* Extract function declarations
|
|
62
|
+
*/
|
|
63
|
+
private extractFunctions;
|
|
64
|
+
/**
|
|
65
|
+
* Extract React components
|
|
66
|
+
*/
|
|
67
|
+
private extractReactComponents;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve path relative to working directory
|
|
70
|
+
*/
|
|
71
|
+
private resolvePath;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=explorer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explorer.d.ts","sourceRoot":"","sources":["../../src/understanding/explorer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,aAAa,EAGb,YAAY,EAKb,MAAM,SAAS,CAAA;AAEhB,qBAAa,YAAY;IAmBrB,OAAO,CAAC,UAAU;IAlBpB,OAAO,CAAC,cAAc,CAerB;gBAGS,UAAU,GAAE,MAAsB,EAC1C,gBAAgB,CAAC,EAAE,MAAM,EAAE;IAO7B;;OAEG;IACH,OAAO,CAAC,YAAY;IAWpB;;OAEG;IACG,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAqBvD;;OAEG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAiB1D;;OAEG;YACW,YAAY;IAa1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAWpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;OAEG;YACW,mBAAmB;IAiDjC;;OAEG;YACW,eAAe;IAuD7B;;OAEG;YACW,qBAAqB;IA2BnC;;OAEG;YACW,yBAAyB;IA8CvC;;OAEG;IACH,OAAO,CAAC,cAAc;IA6BtB;;OAEG;IACH,OAAO,CAAC,cAAc;IA6CtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA6BxB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA2B9B;;OAEG;IACH,OAAO,CAAC,WAAW;CAMpB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Understanding module exports
|
|
3
|
+
*/
|
|
4
|
+
export { CodeExplorer } from './explorer';
|
|
5
|
+
export { ApplicationAnalyzer } from './analyzer';
|
|
6
|
+
export type { CodeStructure, DirectoryNode, Dependencies, FileAnalysis, Import, Export, FunctionDeclaration, Component, AnalyzeOptions, Analysis, ArchitectureAnalysis, ComponentAnalysis, DataFlowAnalysis, EntryPointAnalysis, DependencyAnalysis, TechStackAnalysis, Diagnosis, Pattern } from './types';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/understanding/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEhD,YAAY,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,OAAO,EACR,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for understanding capabilities
|
|
3
|
+
*/
|
|
4
|
+
export interface CodeStructure {
|
|
5
|
+
totalFiles: number;
|
|
6
|
+
filesByType: Record<string, number>;
|
|
7
|
+
directoryStructure: DirectoryNode;
|
|
8
|
+
dependencies: Dependencies;
|
|
9
|
+
entryPoints: string[];
|
|
10
|
+
totalSize: number;
|
|
11
|
+
totalLoc: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DirectoryNode {
|
|
14
|
+
name: string;
|
|
15
|
+
path: string;
|
|
16
|
+
type: 'file' | 'directory';
|
|
17
|
+
children?: DirectoryNode[];
|
|
18
|
+
size?: number;
|
|
19
|
+
extension?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Dependencies {
|
|
22
|
+
runtime: Record<string, string>;
|
|
23
|
+
dev: Record<string, string>;
|
|
24
|
+
frameworks: string[];
|
|
25
|
+
internal: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface FileAnalysis {
|
|
28
|
+
path: string;
|
|
29
|
+
imports: Import[];
|
|
30
|
+
exports: Export[];
|
|
31
|
+
functions: FunctionDeclaration[];
|
|
32
|
+
components: Component[];
|
|
33
|
+
loc: number;
|
|
34
|
+
size: number;
|
|
35
|
+
}
|
|
36
|
+
export interface Import {
|
|
37
|
+
named: string[];
|
|
38
|
+
default?: string;
|
|
39
|
+
source: string;
|
|
40
|
+
line?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface Export {
|
|
43
|
+
name: string;
|
|
44
|
+
type: 'function' | 'class' | 'const' | 'default';
|
|
45
|
+
line?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface FunctionDeclaration {
|
|
48
|
+
name: string;
|
|
49
|
+
isAsync: boolean;
|
|
50
|
+
parameters: string[];
|
|
51
|
+
line?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface Component {
|
|
54
|
+
name: string;
|
|
55
|
+
type: 'functional' | 'class';
|
|
56
|
+
props?: string[];
|
|
57
|
+
line?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface AnalyzeOptions {
|
|
60
|
+
rootPath: string;
|
|
61
|
+
focus?: 'architecture' | 'dependencies' | 'components' | 'all';
|
|
62
|
+
depth?: 'shallow' | 'medium' | 'deep';
|
|
63
|
+
ignorePatterns?: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface Analysis {
|
|
66
|
+
architecture: ArchitectureAnalysis;
|
|
67
|
+
components: ComponentAnalysis;
|
|
68
|
+
dataFlow: DataFlowAnalysis;
|
|
69
|
+
entryPoints: EntryPointAnalysis;
|
|
70
|
+
dependencies: DependencyAnalysis;
|
|
71
|
+
techStack: TechStackAnalysis;
|
|
72
|
+
}
|
|
73
|
+
export interface ArchitectureAnalysis {
|
|
74
|
+
pattern: string;
|
|
75
|
+
description: string;
|
|
76
|
+
layers: string[];
|
|
77
|
+
}
|
|
78
|
+
export interface ComponentAnalysis {
|
|
79
|
+
summary: string;
|
|
80
|
+
keyModules: Array<{
|
|
81
|
+
name: string;
|
|
82
|
+
purpose: string;
|
|
83
|
+
files: string[];
|
|
84
|
+
}>;
|
|
85
|
+
}
|
|
86
|
+
export interface DataFlowAnalysis {
|
|
87
|
+
description: string;
|
|
88
|
+
flows: Array<{
|
|
89
|
+
source: string;
|
|
90
|
+
destination: string;
|
|
91
|
+
dataType: string;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
export interface EntryPointAnalysis {
|
|
95
|
+
main: string[];
|
|
96
|
+
server?: string;
|
|
97
|
+
client?: string;
|
|
98
|
+
cli?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface DependencyAnalysis {
|
|
101
|
+
external: Array<{
|
|
102
|
+
name: string;
|
|
103
|
+
version: string;
|
|
104
|
+
purpose: string;
|
|
105
|
+
}>;
|
|
106
|
+
internal: Array<{
|
|
107
|
+
module: string;
|
|
108
|
+
dependsOn: string[];
|
|
109
|
+
}>;
|
|
110
|
+
}
|
|
111
|
+
export interface TechStackAnalysis {
|
|
112
|
+
runtime: string;
|
|
113
|
+
framework: string[];
|
|
114
|
+
language: string[];
|
|
115
|
+
tools: string[];
|
|
116
|
+
}
|
|
117
|
+
export interface Diagnosis {
|
|
118
|
+
symptoms: string[];
|
|
119
|
+
rootCause: string;
|
|
120
|
+
affectedFiles: string[];
|
|
121
|
+
recommendedFix: string;
|
|
122
|
+
validationSteps: string[];
|
|
123
|
+
confidence: 'low' | 'medium' | 'high';
|
|
124
|
+
}
|
|
125
|
+
export interface Pattern {
|
|
126
|
+
type: 'architecture' | 'design' | 'security' | 'performance';
|
|
127
|
+
name: string;
|
|
128
|
+
description: string;
|
|
129
|
+
instances: Array<{
|
|
130
|
+
file: string;
|
|
131
|
+
line?: number;
|
|
132
|
+
context?: string;
|
|
133
|
+
}>;
|
|
134
|
+
recommendation?: string;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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GAAG,UAAU,GAAG,aAAa,CAAA;IAC5D,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAC,CAAA;IACF,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input validation utilities
|
|
3
|
+
*
|
|
4
|
+
* Lightweight validation without external dependencies.
|
|
5
|
+
* Prevents crashes from malformed input and provides clear error messages.
|
|
6
|
+
*/
|
|
7
|
+
export interface ValidationError {
|
|
8
|
+
field: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class ValidationException extends Error {
|
|
12
|
+
errors: ValidationError[];
|
|
13
|
+
constructor(errors: ValidationError[]);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Validate /run activity request body
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateRunActivityRequest(body: unknown): {
|
|
19
|
+
template: string;
|
|
20
|
+
variables: Record<string, unknown>;
|
|
21
|
+
reason?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Validate request body size (prevent DoS)
|
|
25
|
+
* @param contentLength Content-Length header value
|
|
26
|
+
* @param maxSizeBytes Maximum allowed size in bytes (default: 10MB)
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateRequestSize(contentLength: string | null, maxSizeBytes?: number): void;
|
|
29
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IACzB,MAAM,EAAE,eAAe,EAAE;gBAAzB,MAAM,EAAE,eAAe,EAAE;CAI7C;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG;IACzD,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAmEA;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,YAAY,GAAE,MAAyB,GACtC,IAAI,CAqBN"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input validation utilities
|
|
3
|
+
*
|
|
4
|
+
* Lightweight validation without external dependencies.
|
|
5
|
+
* Prevents crashes from malformed input and provides clear error messages.
|
|
6
|
+
*/
|
|
7
|
+
export class ValidationException extends Error {
|
|
8
|
+
errors;
|
|
9
|
+
constructor(errors) {
|
|
10
|
+
super(`Validation failed: ${errors.map((e) => `${e.field}: ${e.message}`).join(", ")}`);
|
|
11
|
+
this.errors = errors;
|
|
12
|
+
this.name = "ValidationException";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Validate /run activity request body
|
|
17
|
+
*/
|
|
18
|
+
export function validateRunActivityRequest(body) {
|
|
19
|
+
const errors = [];
|
|
20
|
+
if (!body || typeof body !== "object") {
|
|
21
|
+
throw new ValidationException([
|
|
22
|
+
{ field: "body", message: "Request body must be a JSON object" },
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
const data = body;
|
|
26
|
+
// Validate template (required)
|
|
27
|
+
const template = data.template ?? data.templatePath;
|
|
28
|
+
if (!template || typeof template !== "string") {
|
|
29
|
+
errors.push({
|
|
30
|
+
field: "template",
|
|
31
|
+
message: "Missing required field (string expected)",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (template && typeof template === "string" && template.length > 1000) {
|
|
35
|
+
errors.push({
|
|
36
|
+
field: "template",
|
|
37
|
+
message: "Template path too long (max 1000 characters)",
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
// Validate variables (optional, default to empty object)
|
|
41
|
+
let variables = {};
|
|
42
|
+
if (data.variables !== undefined) {
|
|
43
|
+
if (typeof data.variables !== "object" || data.variables === null) {
|
|
44
|
+
errors.push({
|
|
45
|
+
field: "variables",
|
|
46
|
+
message: "Must be an object",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
variables = data.variables;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Validate reason (optional)
|
|
54
|
+
let reason;
|
|
55
|
+
if (data.reason !== undefined) {
|
|
56
|
+
if (typeof data.reason !== "string") {
|
|
57
|
+
errors.push({
|
|
58
|
+
field: "reason",
|
|
59
|
+
message: "Must be a string",
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
else if (data.reason.length > 5000) {
|
|
63
|
+
errors.push({
|
|
64
|
+
field: "reason",
|
|
65
|
+
message: "Reason too long (max 5000 characters)",
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
reason = data.reason;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (errors.length > 0) {
|
|
73
|
+
throw new ValidationException(errors);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
template: template,
|
|
77
|
+
variables,
|
|
78
|
+
reason,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Validate request body size (prevent DoS)
|
|
83
|
+
* @param contentLength Content-Length header value
|
|
84
|
+
* @param maxSizeBytes Maximum allowed size in bytes (default: 10MB)
|
|
85
|
+
*/
|
|
86
|
+
export function validateRequestSize(contentLength, maxSizeBytes = 10 * 1024 * 1024) {
|
|
87
|
+
if (!contentLength) {
|
|
88
|
+
// No Content-Length header - will be checked during parsing
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const size = parseInt(contentLength, 10);
|
|
92
|
+
if (isNaN(size)) {
|
|
93
|
+
throw new ValidationException([
|
|
94
|
+
{ field: "Content-Length", message: "Invalid header value" },
|
|
95
|
+
]);
|
|
96
|
+
}
|
|
97
|
+
if (size > maxSizeBytes) {
|
|
98
|
+
throw new ValidationException([
|
|
99
|
+
{
|
|
100
|
+
field: "Content-Length",
|
|
101
|
+
message: `Request too large: ${size} bytes (max ${maxSizeBytes} bytes)`,
|
|
102
|
+
},
|
|
103
|
+
]);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACzB;IAAnB,YAAmB,MAAyB;QAC1C,KAAK,CAAC,sBAAsB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QADtE,WAAM,GAAN,MAAM,CAAmB;QAE1C,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;IACnC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAa;IAKtD,MAAM,MAAM,GAAsB,EAAE,CAAA;IAEpC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,IAAI,mBAAmB,CAAC;YAC5B,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,oCAAoC,EAAE;SACjE,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,IAA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,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,QAAQ;gBACf,OAAO,EAAE,uCAAuC;aACjD,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACtB,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAA;IACvC,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,QAAkB;QAC5B,SAAS;QACT,MAAM;KACP,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,aAA4B,EAC5B,eAAuB,EAAE,GAAG,IAAI,GAAG,IAAI;IAEvC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,4DAA4D;QAC5D,OAAM;IACR,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IACxC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,MAAM,IAAI,mBAAmB,CAAC;YAC5B,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,sBAAsB,EAAE;SAC7D,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,IAAI,GAAG,YAAY,EAAE,CAAC;QACxB,MAAM,IAAI,mBAAmB,CAAC;YAC5B;gBACE,KAAK,EAAE,gBAAgB;gBACvB,OAAO,EAAE,sBAAsB,IAAI,eAAe,YAAY,SAAS;aACxE;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vessel Bootstrap
|
|
3
|
+
*
|
|
4
|
+
* Universal vessel conversion module.
|
|
5
|
+
* Import this into any application to make it self-aware and activity-controlled.
|
|
6
|
+
*
|
|
7
|
+
* Core Concept: Continuous Learning
|
|
8
|
+
* ---------------------------------
|
|
9
|
+
* The vessel doesn't have a separate "observation mode" - it continuously learns
|
|
10
|
+
* during normal operation. When activities execute:
|
|
11
|
+
*
|
|
12
|
+
* Intent → Code (instructional → functional, choosing what to execute)
|
|
13
|
+
* Code → Outcome (instructional → functional, execution results)
|
|
14
|
+
*
|
|
15
|
+
* Both transformations are mediated by activities. The existing infrastructure
|
|
16
|
+
* handles this automatically:
|
|
17
|
+
*
|
|
18
|
+
* 1. ActivityExecutor captures execution traces
|
|
19
|
+
* 2. Backend stores traces and applies Thompson Sampling
|
|
20
|
+
* 3. runtime-mapping maps traces to source and infers intent
|
|
21
|
+
*
|
|
22
|
+
* The burrow command lays the groundwork (injects bootstrap, creates config).
|
|
23
|
+
* Normal operation continuously builds understanding through execution traces.
|
|
24
|
+
*
|
|
25
|
+
* Usage:
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { initializeVessel } from '@metabob/minibob/vessel-bootstrap'
|
|
28
|
+
*
|
|
29
|
+
* const vessel = await initializeVessel({
|
|
30
|
+
* workingDirectory: __dirname,
|
|
31
|
+
* provider: 'anthropic',
|
|
32
|
+
* apiKey: process.env.ANTHROPIC_API_KEY!,
|
|
33
|
+
* model: 'claude-sonnet-4-20250514',
|
|
34
|
+
* vesselType: 'my-app',
|
|
35
|
+
* })
|
|
36
|
+
*
|
|
37
|
+
* // Register components for runtime access
|
|
38
|
+
* vessel.state.register('myComponent', myComponentInstance)
|
|
39
|
+
*
|
|
40
|
+
* // Run activities - learning happens automatically via execution traces
|
|
41
|
+
* await vessel.runGoal('Optimize database query performance')
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
import { type ExecutorConfig } from './activity';
|
|
45
|
+
import type { ActivityTemplate } from './types';
|
|
46
|
+
export interface VesselConfig extends ExecutorConfig {
|
|
47
|
+
/**
|
|
48
|
+
* Vessel type identifier (for telemetry)
|
|
49
|
+
*/
|
|
50
|
+
vesselType?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Enable self-improvement loop
|
|
53
|
+
* Vessel will periodically run optimization activities on itself
|
|
54
|
+
*/
|
|
55
|
+
enableSelfImprovement?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Self-improvement interval (ms)
|
|
58
|
+
* Default: 5 minutes
|
|
59
|
+
*/
|
|
60
|
+
selfImprovementInterval?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface VesselState {
|
|
63
|
+
/**
|
|
64
|
+
* Components registered for runtime access
|
|
65
|
+
*/
|
|
66
|
+
registry: Map<string, any>;
|
|
67
|
+
/**
|
|
68
|
+
* Vessel metadata
|
|
69
|
+
*/
|
|
70
|
+
metadata: {
|
|
71
|
+
type: string;
|
|
72
|
+
startTime: number;
|
|
73
|
+
workingDirectory: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Performance metrics
|
|
77
|
+
*/
|
|
78
|
+
metrics: {
|
|
79
|
+
activitiesExecuted: number;
|
|
80
|
+
goalsExecuted: number;
|
|
81
|
+
totalCost: number;
|
|
82
|
+
avgDuration: number;
|
|
83
|
+
uptime: number;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Vessel Bootstrap
|
|
88
|
+
*
|
|
89
|
+
* Converts any application into a self-aware, activity-controlled vessel.
|
|
90
|
+
* Continuous learning happens automatically through execution traces.
|
|
91
|
+
*/
|
|
92
|
+
export declare class VesselBootstrap {
|
|
93
|
+
private executor;
|
|
94
|
+
private goalProcessor;
|
|
95
|
+
state: VesselStateManager;
|
|
96
|
+
private selfImprovementInterval?;
|
|
97
|
+
private config;
|
|
98
|
+
constructor(config: VesselConfig);
|
|
99
|
+
/**
|
|
100
|
+
* Run activity on this vessel
|
|
101
|
+
*
|
|
102
|
+
* @param template Activity template or template ID
|
|
103
|
+
* @param variables Variables for the activity
|
|
104
|
+
* @returns Activity execution result
|
|
105
|
+
*/
|
|
106
|
+
runActivity(template: ActivityTemplate | string, variables?: any): Promise<import("./types").ActivityExecution>;
|
|
107
|
+
/**
|
|
108
|
+
* Run goal on this vessel
|
|
109
|
+
*
|
|
110
|
+
* Execution traces are automatically captured and sent to the backend
|
|
111
|
+
* where Thompson Sampling learns which activities work best.
|
|
112
|
+
*
|
|
113
|
+
* @param goal Natural language goal description
|
|
114
|
+
* @param context Additional context for the goal
|
|
115
|
+
* @param options Goal execution options
|
|
116
|
+
* @returns Goal execution result
|
|
117
|
+
*/
|
|
118
|
+
runGoal(goal: string, context?: any, options?: any): Promise<import("./goal-processor").GoalResult>;
|
|
119
|
+
/**
|
|
120
|
+
* Start self-improvement loop
|
|
121
|
+
* Vessel periodically analyzes and optimizes itself
|
|
122
|
+
*/
|
|
123
|
+
private startSelfImprovementLoop;
|
|
124
|
+
/**
|
|
125
|
+
* Shutdown vessel
|
|
126
|
+
*/
|
|
127
|
+
shutdown(): void;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Vessel State Manager
|
|
131
|
+
*
|
|
132
|
+
* Manages observable state for the vessel
|
|
133
|
+
* Components register themselves for runtime access
|
|
134
|
+
*/
|
|
135
|
+
export declare class VesselStateManager {
|
|
136
|
+
private registry;
|
|
137
|
+
private metadata;
|
|
138
|
+
private metrics;
|
|
139
|
+
constructor(config: {
|
|
140
|
+
type: string;
|
|
141
|
+
workingDirectory: string;
|
|
142
|
+
});
|
|
143
|
+
/**
|
|
144
|
+
* Register component for runtime access
|
|
145
|
+
*
|
|
146
|
+
* @param name Component identifier
|
|
147
|
+
* @param component Any object to make accessible
|
|
148
|
+
*/
|
|
149
|
+
register(name: string, component: any): void;
|
|
150
|
+
/**
|
|
151
|
+
* Get registered component
|
|
152
|
+
*/
|
|
153
|
+
get(name: string): any;
|
|
154
|
+
/**
|
|
155
|
+
* List all registered components
|
|
156
|
+
*/
|
|
157
|
+
list(): string[];
|
|
158
|
+
/**
|
|
159
|
+
* Get full state snapshot
|
|
160
|
+
*/
|
|
161
|
+
snapshot(): VesselState;
|
|
162
|
+
/**
|
|
163
|
+
* Increment metric
|
|
164
|
+
*/
|
|
165
|
+
incrementMetric(metric: keyof VesselState['metrics']): void;
|
|
166
|
+
/**
|
|
167
|
+
* Update metrics
|
|
168
|
+
*/
|
|
169
|
+
updateMetrics(updates: Partial<VesselState['metrics']>): void;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Global vessel instance
|
|
173
|
+
* Applications can access via globalThis.__vessel
|
|
174
|
+
*/
|
|
175
|
+
declare global {
|
|
176
|
+
var __vessel: VesselBootstrap | undefined;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Initialize vessel globally
|
|
180
|
+
* Convenience function for applications
|
|
181
|
+
*
|
|
182
|
+
* @param config Vessel configuration
|
|
183
|
+
* @returns Vessel instance
|
|
184
|
+
*/
|
|
185
|
+
export declare function initializeVessel(config: VesselConfig): Promise<VesselBootstrap>;
|
|
186
|
+
/**
|
|
187
|
+
* Get global vessel instance
|
|
188
|
+
*/
|
|
189
|
+
export declare function getVessel(): VesselBootstrap | undefined;
|
|
190
|
+
//# sourceMappingURL=vessel-bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vessel-bootstrap.d.ts","sourceRoot":"","sources":["../src/vessel-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,YAAY,CAAA;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAU/C,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAE/B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAE1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