@baselineos/studio 0.1.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/.turbo/turbo-build.log +14 -0
- package/.turbo/turbo-test.log +16 -0
- package/LICENSE +17 -0
- package/README.md +19 -0
- package/dist/index.d.ts +210 -0
- package/dist/index.js +846 -0
- package/package.json +34 -0
- package/src/__tests__/manifest.test.ts +14 -0
- package/src/__tests__/smoke.test.ts +16 -0
- package/src/__tests__/workflow.test.ts +26 -0
- package/src/config/studio-system-config.json +224 -0
- package/src/index.ts +21 -0
- package/src/system.ts +885 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
> @baselineos/studio@0.1.0 build /home/runner/work/baseline/baseline/packages/studio
|
|
3
|
+
> tsup src/index.ts --format esm --dts
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Target: es2022
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m24.00 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 194ms
|
|
12
|
+
[34mDTS[39m Build start
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 14068ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m6.17 KB[39m
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
> @baselineos/studio@0.1.0 test /home/runner/work/baseline/baseline/packages/studio
|
|
3
|
+
> vitest run
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[7m[36m RUN [39m[27m[22m [36mv2.1.9 [39m[90m/home/runner/work/baseline/baseline/packages/studio[39m
|
|
7
|
+
|
|
8
|
+
[32m✓[39m src/__tests__/workflow.test.ts [2m([22m[2m2 tests[22m[2m)[22m[90m 81[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/__tests__/manifest.test.ts [2m([22m[2m1 test[22m[2m)[22m[90m 47[2mms[22m[39m
|
|
10
|
+
[32m✓[39m src/__tests__/smoke.test.ts [2m([22m[2m2 tests[22m[2m)[22m[90m 20[2mms[22m[39m
|
|
11
|
+
|
|
12
|
+
[2m Test Files [22m [1m[32m3 passed[39m[22m[90m (3)[39m
|
|
13
|
+
[2m Tests [22m [1m[32m5 passed[39m[22m[90m (5)[39m
|
|
14
|
+
[2m Start at [22m 14:02:30
|
|
15
|
+
[2m Duration [22m 6.22s[2m (transform 1.20s, setup 0ms, collect 1.49s, tests 148ms, environment 16ms, prepare 1.56s)[22m
|
|
16
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Baseline Protocol Foundation
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @baselineos/studio
|
|
2
|
+
|
|
3
|
+
Studio layer package for Baseline.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Implements execution/output orchestration contracts for Baseline runs and layer result shaping.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm --filter @baselineos/studio build
|
|
13
|
+
pnpm --filter @baselineos/studio test
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Integration
|
|
17
|
+
|
|
18
|
+
- Depends on: `@baselineos/protocol-core`
|
|
19
|
+
- Consumed by: `@baselineos/cli`, `baselineos`
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Baseline Studio System
|
|
3
|
+
*
|
|
4
|
+
* The execution and output generation layer of the Baseline Protocol that
|
|
5
|
+
* orchestrates command execution, manages workflows, and generates
|
|
6
|
+
* structured output in multiple formats.
|
|
7
|
+
*
|
|
8
|
+
* @license Apache-2.0
|
|
9
|
+
*/
|
|
10
|
+
interface StudioSystemConfig {
|
|
11
|
+
system: {
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
execution: ExecutionConfig;
|
|
17
|
+
output: OutputConfig;
|
|
18
|
+
workflows: WorkflowConfig;
|
|
19
|
+
performance: PerformanceConfig;
|
|
20
|
+
}
|
|
21
|
+
interface ExecutionConfig {
|
|
22
|
+
maxConcurrent: number;
|
|
23
|
+
timeout: number;
|
|
24
|
+
retryAttempts: number;
|
|
25
|
+
retryDelay: number;
|
|
26
|
+
}
|
|
27
|
+
interface OutputConfig {
|
|
28
|
+
formats: string[];
|
|
29
|
+
defaultFormat: string;
|
|
30
|
+
prettyPrint: boolean;
|
|
31
|
+
includeMetadata: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface WorkflowConfig {
|
|
34
|
+
maxSteps: number;
|
|
35
|
+
maxDepth: number;
|
|
36
|
+
enableRollback: boolean;
|
|
37
|
+
enableCheckpoints: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface PerformanceConfig {
|
|
40
|
+
enableCaching: boolean;
|
|
41
|
+
cacheSize: number;
|
|
42
|
+
cacheTTL: number;
|
|
43
|
+
enableProfiling: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface StudioCommandResult {
|
|
46
|
+
success: boolean;
|
|
47
|
+
command?: string;
|
|
48
|
+
result?: unknown;
|
|
49
|
+
output?: string;
|
|
50
|
+
artifacts?: ArtifactEntry[];
|
|
51
|
+
manifest?: ArtifactManifest;
|
|
52
|
+
performance?: unknown;
|
|
53
|
+
error?: string;
|
|
54
|
+
details?: string | string[];
|
|
55
|
+
timestamp?: string;
|
|
56
|
+
}
|
|
57
|
+
interface WorkflowDefinition {
|
|
58
|
+
name: string;
|
|
59
|
+
steps: string[];
|
|
60
|
+
}
|
|
61
|
+
interface WorkflowResult {
|
|
62
|
+
success: boolean;
|
|
63
|
+
workflow?: string;
|
|
64
|
+
result?: unknown;
|
|
65
|
+
steps?: unknown[];
|
|
66
|
+
artifacts?: ArtifactEntry[];
|
|
67
|
+
manifest?: ArtifactManifest;
|
|
68
|
+
performance?: unknown;
|
|
69
|
+
error?: string;
|
|
70
|
+
details?: string;
|
|
71
|
+
timestamp?: string;
|
|
72
|
+
}
|
|
73
|
+
interface ExecutionStats {
|
|
74
|
+
totalExecuted: number;
|
|
75
|
+
successful: number;
|
|
76
|
+
failed: number;
|
|
77
|
+
averageExecutionTime: number;
|
|
78
|
+
}
|
|
79
|
+
interface CacheEntry {
|
|
80
|
+
result: unknown;
|
|
81
|
+
timestamp: number;
|
|
82
|
+
ttl: number;
|
|
83
|
+
}
|
|
84
|
+
interface TemplateDefinition {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
format: 'text' | 'html' | 'json';
|
|
88
|
+
template: string;
|
|
89
|
+
variables?: string[];
|
|
90
|
+
}
|
|
91
|
+
interface ArtifactProvenance {
|
|
92
|
+
command?: string;
|
|
93
|
+
workflow?: string;
|
|
94
|
+
step?: string;
|
|
95
|
+
context?: Record<string, unknown>;
|
|
96
|
+
templateId?: string;
|
|
97
|
+
generatedAt: string;
|
|
98
|
+
}
|
|
99
|
+
interface ArtifactEntry {
|
|
100
|
+
id: string;
|
|
101
|
+
type: 'output' | 'manifest' | 'template' | 'artifact';
|
|
102
|
+
format: string;
|
|
103
|
+
content: string;
|
|
104
|
+
hash: string;
|
|
105
|
+
provenance: ArtifactProvenance;
|
|
106
|
+
}
|
|
107
|
+
interface ArtifactManifest {
|
|
108
|
+
id: string;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
artifacts: ArtifactEntry[];
|
|
111
|
+
hash: string;
|
|
112
|
+
}
|
|
113
|
+
declare class ExecutionEngine {
|
|
114
|
+
private activeCommands;
|
|
115
|
+
private config;
|
|
116
|
+
private stats;
|
|
117
|
+
initialize(config: ExecutionConfig): void;
|
|
118
|
+
execute(command: string, options: Record<string, unknown>, context: Record<string, unknown>): Promise<{
|
|
119
|
+
success: boolean;
|
|
120
|
+
commandId: string;
|
|
121
|
+
result: unknown;
|
|
122
|
+
performance: unknown;
|
|
123
|
+
timestamp: string;
|
|
124
|
+
}>;
|
|
125
|
+
private simulateExecution;
|
|
126
|
+
private calculatePerformance;
|
|
127
|
+
getStatus(): Record<string, unknown>;
|
|
128
|
+
}
|
|
129
|
+
declare class OutputGenerator {
|
|
130
|
+
private formatters;
|
|
131
|
+
private config;
|
|
132
|
+
initialize(config: OutputConfig): void;
|
|
133
|
+
private setupFormatters;
|
|
134
|
+
generate(result: Record<string, unknown>, format?: string | null): string;
|
|
135
|
+
private formatJSON;
|
|
136
|
+
private formatYAML;
|
|
137
|
+
private formatText;
|
|
138
|
+
private formatTable;
|
|
139
|
+
private formatCSV;
|
|
140
|
+
private formatHTML;
|
|
141
|
+
getStatus(): Record<string, unknown>;
|
|
142
|
+
}
|
|
143
|
+
declare class WorkflowManager {
|
|
144
|
+
private activeWorkflows;
|
|
145
|
+
private config;
|
|
146
|
+
initialize(config: WorkflowConfig): void;
|
|
147
|
+
execute(workflow: WorkflowDefinition, _options: Record<string, unknown>): Promise<{
|
|
148
|
+
success: boolean;
|
|
149
|
+
workflowId: string;
|
|
150
|
+
steps: unknown[];
|
|
151
|
+
performance: unknown;
|
|
152
|
+
timestamp: string;
|
|
153
|
+
}>;
|
|
154
|
+
private executeWorkflowSteps;
|
|
155
|
+
getStatus(): Record<string, unknown>;
|
|
156
|
+
}
|
|
157
|
+
declare class TemplateRegistry {
|
|
158
|
+
private templates;
|
|
159
|
+
register(template: TemplateDefinition): void;
|
|
160
|
+
get(id: string): TemplateDefinition | undefined;
|
|
161
|
+
list(): TemplateDefinition[];
|
|
162
|
+
render(id: string, data: Record<string, unknown>): string;
|
|
163
|
+
private renderTemplate;
|
|
164
|
+
}
|
|
165
|
+
declare class ResultProcessor {
|
|
166
|
+
initialize(): void;
|
|
167
|
+
process(result: Record<string, unknown>): Record<string, unknown>;
|
|
168
|
+
private validateResult;
|
|
169
|
+
private transformResult;
|
|
170
|
+
private enrichResult;
|
|
171
|
+
}
|
|
172
|
+
declare class PerformanceOptimizer {
|
|
173
|
+
private cache;
|
|
174
|
+
private config;
|
|
175
|
+
private stats;
|
|
176
|
+
initialize(config: PerformanceConfig): void;
|
|
177
|
+
optimize(result: Record<string, unknown>): Record<string, unknown>;
|
|
178
|
+
private cacheResult;
|
|
179
|
+
private generateCacheKey;
|
|
180
|
+
getCachedResult(command: string, options: Record<string, unknown>): unknown | null;
|
|
181
|
+
getStatus(): Record<string, unknown>;
|
|
182
|
+
}
|
|
183
|
+
declare class BaselineStudioSystem {
|
|
184
|
+
private config;
|
|
185
|
+
private executionEngine;
|
|
186
|
+
private outputGenerator;
|
|
187
|
+
private workflowManager;
|
|
188
|
+
private resultProcessor;
|
|
189
|
+
private performanceOptimizer;
|
|
190
|
+
private templateRegistry;
|
|
191
|
+
private manifestBuilder;
|
|
192
|
+
constructor();
|
|
193
|
+
private loadConfiguration;
|
|
194
|
+
private initializeSystem;
|
|
195
|
+
executeCommand(command: string, options?: Record<string, unknown>, context?: Record<string, unknown>): Promise<StudioCommandResult>;
|
|
196
|
+
executeWorkflow(workflow: WorkflowDefinition, options?: Record<string, unknown>): Promise<WorkflowResult>;
|
|
197
|
+
private validateInput;
|
|
198
|
+
getStatus(): Record<string, unknown>;
|
|
199
|
+
registerTemplate(template: TemplateDefinition): void;
|
|
200
|
+
renderTemplate(templateId: string, data: Record<string, unknown>): string;
|
|
201
|
+
preview(templateId: string, data: Record<string, unknown>, format?: 'text' | 'html' | 'json'): string;
|
|
202
|
+
getExecutionEngine(): ExecutionEngine;
|
|
203
|
+
getOutputGenerator(): OutputGenerator;
|
|
204
|
+
getWorkflowManager(): WorkflowManager;
|
|
205
|
+
getPerformanceOptimizer(): PerformanceOptimizer;
|
|
206
|
+
getTemplateRegistry(): TemplateRegistry;
|
|
207
|
+
private buildArtifacts;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export { BaselineStudioSystem, type CacheEntry, type ExecutionConfig, ExecutionEngine, type ExecutionStats, type OutputConfig, OutputGenerator, type PerformanceConfig, PerformanceOptimizer, ResultProcessor, type StudioCommandResult, type StudioSystemConfig, type WorkflowConfig, type WorkflowDefinition, WorkflowManager, type WorkflowResult };
|