@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.
@@ -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
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Target: es2022
9
+ ESM Build start
10
+ ESM dist/index.js 24.00 KB
11
+ ESM ⚡️ Build success in 194ms
12
+ DTS Build start
13
+ DTS ⚡️ Build success in 14068ms
14
+ DTS dist/index.d.ts 6.17 KB
@@ -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
+  RUN  v2.1.9 /home/runner/work/baseline/baseline/packages/studio
7
+
8
+ ✓ src/__tests__/workflow.test.ts (2 tests) 81ms
9
+ ✓ src/__tests__/manifest.test.ts (1 test) 47ms
10
+ ✓ src/__tests__/smoke.test.ts (2 tests) 20ms
11
+
12
+  Test Files  3 passed (3)
13
+  Tests  5 passed (5)
14
+  Start at  14:02:30
15
+  Duration  6.22s (transform 1.20s, setup 0ms, collect 1.49s, tests 148ms, environment 16ms, prepare 1.56s)
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`
@@ -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 };