@baselineos/frame 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 +15 -0
- package/LICENSE +17 -0
- package/README.md +19 -0
- package/dist/index.d.ts +168 -0
- package/dist/index.js +800 -0
- package/package.json +34 -0
- package/src/__tests__/smoke.test.ts +15 -0
- package/src/__tests__/workflow.test.ts +46 -0
- package/src/config/frame-system-config.json +313 -0
- package/src/index.ts +20 -0
- package/src/system.ts +677 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
> @baselineos/frame@0.1.0 build /home/runner/work/baseline/baseline/packages/frame
|
|
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[32m23.73 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 192ms
|
|
12
|
+
[34mDTS[39m Build start
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 13865ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m5.17 KB[39m
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
> @baselineos/frame@0.1.0 test /home/runner/work/baseline/baseline/packages/frame
|
|
3
|
+
> vitest run
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[7m[36m RUN [39m[27m[22m [36mv2.1.9 [39m[90m/home/runner/work/baseline/baseline/packages/frame[39m
|
|
7
|
+
|
|
8
|
+
[32m✓[39m src/__tests__/workflow.test.ts [2m([22m[2m3 tests[22m[2m)[22m[90m 79[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/__tests__/smoke.test.ts [2m([22m[2m2 tests[22m[2m)[22m[90m 32[2mms[22m[39m
|
|
10
|
+
|
|
11
|
+
[2m Test Files [22m [1m[32m2 passed[39m[22m[90m (2)[39m
|
|
12
|
+
[2m Tests [22m [1m[32m5 passed[39m[22m[90m (5)[39m
|
|
13
|
+
[2m Start at [22m 14:02:30
|
|
14
|
+
[2m Duration [22m 4.74s[2m (transform 1.11s, setup 0ms, collect 1.24s, tests 111ms, environment 0ms, prepare 1.22s)[22m
|
|
15
|
+
|
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/frame
|
|
2
|
+
|
|
3
|
+
Frame layer package for Baseline.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Implements context and control modeling (scope, authority, run mode framing) for deterministic workflow execution.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm --filter @baselineos/frame build
|
|
13
|
+
pnpm --filter @baselineos/frame 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,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Baseline Frame System
|
|
3
|
+
*
|
|
4
|
+
* The context and control layer of the Baseline Protocol that manages
|
|
5
|
+
* intent recognition, mode switching, environment context, and authority
|
|
6
|
+
* management.
|
|
7
|
+
*
|
|
8
|
+
* @license Apache-2.0
|
|
9
|
+
*/
|
|
10
|
+
interface FrameSystemConfig {
|
|
11
|
+
system: {
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
modes: Record<string, ModeConfig>;
|
|
17
|
+
contexts: Record<string, ContextConfig>;
|
|
18
|
+
authorities: Record<string, AuthorityConfig>;
|
|
19
|
+
environments?: Record<string, EnvironmentEntry>;
|
|
20
|
+
}
|
|
21
|
+
interface ModeConfig {
|
|
22
|
+
description: string;
|
|
23
|
+
permissions: string[];
|
|
24
|
+
environment: string;
|
|
25
|
+
features: string[];
|
|
26
|
+
}
|
|
27
|
+
interface ContextConfig {
|
|
28
|
+
description: string;
|
|
29
|
+
mode: string;
|
|
30
|
+
environment: string;
|
|
31
|
+
permissions: string[];
|
|
32
|
+
authority?: string;
|
|
33
|
+
}
|
|
34
|
+
interface AuthorityConfig {
|
|
35
|
+
level: number;
|
|
36
|
+
permissions: string[];
|
|
37
|
+
description: string;
|
|
38
|
+
}
|
|
39
|
+
interface ContextEntry {
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
mode: string;
|
|
43
|
+
environment: string;
|
|
44
|
+
permissions: string[];
|
|
45
|
+
authority: string;
|
|
46
|
+
status: 'active' | 'inactive' | 'archived';
|
|
47
|
+
createdAt: number;
|
|
48
|
+
updatedAt: number;
|
|
49
|
+
lastActivatedAt?: number;
|
|
50
|
+
archivedAt?: number;
|
|
51
|
+
}
|
|
52
|
+
interface ModeEntry {
|
|
53
|
+
name: string;
|
|
54
|
+
description: string;
|
|
55
|
+
permissions: string[];
|
|
56
|
+
environment: string;
|
|
57
|
+
features: string[];
|
|
58
|
+
}
|
|
59
|
+
interface AuthorityEntry {
|
|
60
|
+
name: string;
|
|
61
|
+
level: number;
|
|
62
|
+
permissions: string[];
|
|
63
|
+
description: string;
|
|
64
|
+
}
|
|
65
|
+
interface EnvironmentEntry {
|
|
66
|
+
name: string;
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
variables: Record<string, string>;
|
|
70
|
+
features?: string[];
|
|
71
|
+
}
|
|
72
|
+
interface FrameCommandResult {
|
|
73
|
+
success: boolean;
|
|
74
|
+
command?: string;
|
|
75
|
+
context?: string;
|
|
76
|
+
mode?: string | ModeEntry | null;
|
|
77
|
+
authority?: string;
|
|
78
|
+
environment?: string;
|
|
79
|
+
result?: unknown;
|
|
80
|
+
error?: string;
|
|
81
|
+
details?: string;
|
|
82
|
+
required?: string[];
|
|
83
|
+
current?: string;
|
|
84
|
+
available?: string[];
|
|
85
|
+
description?: string;
|
|
86
|
+
permissions?: string[] | {
|
|
87
|
+
context: string[];
|
|
88
|
+
mode: string[];
|
|
89
|
+
};
|
|
90
|
+
timestamp?: string;
|
|
91
|
+
}
|
|
92
|
+
interface FrameStatus {
|
|
93
|
+
initialized: boolean;
|
|
94
|
+
contextHistory: number;
|
|
95
|
+
currentMode: ModeEntry | null;
|
|
96
|
+
currentEnvironment: string | undefined;
|
|
97
|
+
activeContexts: number;
|
|
98
|
+
systemName: string;
|
|
99
|
+
version: string;
|
|
100
|
+
currentAuthority?: string | null;
|
|
101
|
+
}
|
|
102
|
+
declare class ContextManager {
|
|
103
|
+
private contexts;
|
|
104
|
+
private currentContext;
|
|
105
|
+
private history;
|
|
106
|
+
initialize(contextConfig: Record<string, ContextConfig>): void;
|
|
107
|
+
createContext(name: string, config: ContextConfig): boolean;
|
|
108
|
+
setContext(contextName: string): boolean;
|
|
109
|
+
activateContext(contextName: string): boolean;
|
|
110
|
+
archiveContext(contextName: string): boolean;
|
|
111
|
+
getCurrentContext(): ContextEntry | null;
|
|
112
|
+
getContext(contextName: string): ContextEntry | undefined;
|
|
113
|
+
listContexts(): string[];
|
|
114
|
+
getContextHistory(): string[];
|
|
115
|
+
getActiveContexts(): ContextEntry[];
|
|
116
|
+
getContextTimeline(): Array<{
|
|
117
|
+
name: string;
|
|
118
|
+
action: 'create' | 'activate' | 'archive';
|
|
119
|
+
timestamp: number;
|
|
120
|
+
}>;
|
|
121
|
+
}
|
|
122
|
+
declare class ModeManager {
|
|
123
|
+
private modes;
|
|
124
|
+
private currentMode;
|
|
125
|
+
initialize(modeConfig: Record<string, ModeConfig>): void;
|
|
126
|
+
setMode(modeName: string): boolean;
|
|
127
|
+
getCurrentMode(): ModeEntry | null;
|
|
128
|
+
getMode(modeName: string): ModeEntry | undefined;
|
|
129
|
+
processInMode(modeName: string, command: string, options: Record<string, unknown>, args: string[]): Record<string, unknown>;
|
|
130
|
+
}
|
|
131
|
+
declare class AuthorityManager {
|
|
132
|
+
private authorities;
|
|
133
|
+
private currentAuthority;
|
|
134
|
+
initialize(authorityConfig: Record<string, AuthorityConfig>): void;
|
|
135
|
+
getCurrentAuthority(): AuthorityEntry | null;
|
|
136
|
+
setAuthority(authorityName: string): boolean;
|
|
137
|
+
checkPermission(authorityName: string, command: string, options: Record<string, unknown>): boolean;
|
|
138
|
+
getRequiredPermissions(command: string, options?: Record<string, unknown>): string[];
|
|
139
|
+
}
|
|
140
|
+
declare class EnvironmentManager {
|
|
141
|
+
private environments;
|
|
142
|
+
private currentEnvironment;
|
|
143
|
+
initialize(envConfig?: Record<string, EnvironmentEntry>): void;
|
|
144
|
+
getCurrentEnvironment(): EnvironmentEntry | null;
|
|
145
|
+
setEnvironment(envName: string): boolean;
|
|
146
|
+
getEnvironmentVariable(name: string): string | undefined;
|
|
147
|
+
}
|
|
148
|
+
declare class BaselineFrameSystem {
|
|
149
|
+
private config;
|
|
150
|
+
private context;
|
|
151
|
+
private modeManager;
|
|
152
|
+
private authorityManager;
|
|
153
|
+
private environmentManager;
|
|
154
|
+
private initialized;
|
|
155
|
+
constructor();
|
|
156
|
+
private loadConfiguration;
|
|
157
|
+
private initializeSystem;
|
|
158
|
+
processCommand(command: string, options?: Record<string, unknown>, args?: string[]): FrameCommandResult;
|
|
159
|
+
switchContext(contextName: string): FrameCommandResult;
|
|
160
|
+
switchMode(modeName: string): FrameCommandResult;
|
|
161
|
+
getStatus(): FrameStatus;
|
|
162
|
+
getContextManager(): ContextManager;
|
|
163
|
+
getModeManager(): ModeManager;
|
|
164
|
+
getAuthorityManager(): AuthorityManager;
|
|
165
|
+
getEnvironmentManager(): EnvironmentManager;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export { type AuthorityConfig, type AuthorityEntry, AuthorityManager, BaselineFrameSystem, type ContextConfig, type ContextEntry, ContextManager, type EnvironmentEntry, EnvironmentManager, type FrameCommandResult, type FrameStatus, type FrameSystemConfig, type ModeConfig, type ModeEntry, ModeManager };
|