@baselineos/protocol-core 1.0.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/CHANGELOG.md +49 -0
- package/LICENSE +17 -0
- package/README.md +18 -0
- package/dist/index.d.ts +1322 -0
- package/dist/index.js +2653 -0
- package/package.json +31 -0
- package/src/__tests__/functional.test.ts +269 -0
- package/src/__tests__/smoke.test.ts +23 -0
- package/src/chromadb.d.ts +9 -0
- package/src/index.ts +117 -0
- package/src/knowledge/knowledge-graph.ts +1441 -0
- package/src/knowledge/vector-store.ts +722 -0
- package/src/lang/lang.ts +278 -0
- package/src/lexicon/lexicon.ts +414 -0
- package/src/parser/grammar.ts +240 -0
- package/src/parser/parser.ts +420 -0
- package/src/types/index.ts +799 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Baseline Protocol™ — Core Type Definitions
|
|
3
|
+
* The foundation for the Baseline prompt engineering language
|
|
4
|
+
*
|
|
5
|
+
* These types define the complete structure of Baseline Language programs
|
|
6
|
+
* across all three layers: Lang, Frame, and Core (Studio).
|
|
7
|
+
*
|
|
8
|
+
* @license Apache-2.0
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ─── Program Structure ──────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
export interface BaselineProgram {
|
|
14
|
+
blocks: (LangBlock | FrameBlock | CoreBlock)[];
|
|
15
|
+
metadata: ProgramMetadata;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ProgramMetadata {
|
|
19
|
+
version: string;
|
|
20
|
+
created: Date;
|
|
21
|
+
author: string;
|
|
22
|
+
description: string;
|
|
23
|
+
tags: string[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface BlockMetadata {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
version: string;
|
|
31
|
+
created: Date;
|
|
32
|
+
modified: Date;
|
|
33
|
+
tags: string[];
|
|
34
|
+
priority: Priority;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ─── Layer 1: Lang (Language & Expression) ───────────────────────────
|
|
38
|
+
|
|
39
|
+
export interface LangBlock {
|
|
40
|
+
type: 'lang';
|
|
41
|
+
content: LexiconBlock | SyntaxBlock | CommandsBlock;
|
|
42
|
+
metadata: BlockMetadata;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface LexiconBlock {
|
|
46
|
+
type: 'lexicon';
|
|
47
|
+
domain: Domain;
|
|
48
|
+
vocabulary: VocabularySet;
|
|
49
|
+
templates: Template[];
|
|
50
|
+
patterns: Pattern[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface SyntaxBlock {
|
|
54
|
+
type: 'syntax';
|
|
55
|
+
rules: GrammarRule[];
|
|
56
|
+
operators: Operator[];
|
|
57
|
+
precedence: PrecedenceRule[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface CommandsBlock {
|
|
61
|
+
type: 'commands';
|
|
62
|
+
actions: Action[];
|
|
63
|
+
directives: Directive[];
|
|
64
|
+
operations: Operation[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ─── Layer 2: Frame (Context & Control) ──────────────────────────────
|
|
68
|
+
|
|
69
|
+
export interface FrameBlock {
|
|
70
|
+
type: 'frame';
|
|
71
|
+
content: IntentBlock | ModeBlock | EnvironmentBlock | ScopeBlock | AuthorityBlock | BasisBlock;
|
|
72
|
+
metadata: BlockMetadata;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface IntentBlock {
|
|
76
|
+
type: 'intent';
|
|
77
|
+
goals: Goal[];
|
|
78
|
+
deliverables: Deliverable[];
|
|
79
|
+
successCriteria: SuccessCriterion[];
|
|
80
|
+
constraints: Constraint[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ModeBlock {
|
|
84
|
+
type: 'mode';
|
|
85
|
+
executionPattern: ExecutionPattern;
|
|
86
|
+
reasoning: ReasoningMode;
|
|
87
|
+
checkpoints: Checkpoint[];
|
|
88
|
+
iterations: IterationRule[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface EnvironmentBlock {
|
|
92
|
+
type: 'environment';
|
|
93
|
+
models: Model[];
|
|
94
|
+
tools: Tool[];
|
|
95
|
+
runtime: Runtime;
|
|
96
|
+
policies: Policy[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface ScopeBlock {
|
|
100
|
+
type: 'scope';
|
|
101
|
+
boundaries: Boundary[];
|
|
102
|
+
limits: Limit[];
|
|
103
|
+
exclusions: Exclusion[];
|
|
104
|
+
inclusions: Inclusion[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface AuthorityBlock {
|
|
108
|
+
type: 'authority';
|
|
109
|
+
roles: Role[];
|
|
110
|
+
permissions: Permission[];
|
|
111
|
+
access: AccessControl[];
|
|
112
|
+
delegation: DelegationRule[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface BasisBlock {
|
|
116
|
+
type: 'basis';
|
|
117
|
+
organization: Organization;
|
|
118
|
+
kpis: KPI[];
|
|
119
|
+
metrics: Metric[];
|
|
120
|
+
context: Context[];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// ─── Layer 3: Core / Studio (Execution & Output) ─────────────────────
|
|
124
|
+
|
|
125
|
+
export interface CoreBlock {
|
|
126
|
+
type: 'core';
|
|
127
|
+
content: FidelityBlock | SpecBlock | ArtifactBlock | ProductBlock | PlanBlock | PromptBlock;
|
|
128
|
+
metadata: BlockMetadata;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface FidelityBlock {
|
|
132
|
+
type: 'fidelity';
|
|
133
|
+
precision: PrecisionLevel;
|
|
134
|
+
verification: VerificationLevel;
|
|
135
|
+
quality: QualityStandard[];
|
|
136
|
+
constraints: Constraint[];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface SpecBlock {
|
|
140
|
+
type: 'spec';
|
|
141
|
+
requirements: Requirement[];
|
|
142
|
+
contracts: Contract[];
|
|
143
|
+
interfaces: Interface[];
|
|
144
|
+
validations: Validation[];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface ArtifactBlock {
|
|
148
|
+
type: 'artifact';
|
|
149
|
+
outputs: Output[];
|
|
150
|
+
receipts: Receipt[];
|
|
151
|
+
signatures: Signature[];
|
|
152
|
+
retention: RetentionPolicy[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface ProductBlock {
|
|
156
|
+
type: 'product';
|
|
157
|
+
deliverables: Deliverable[];
|
|
158
|
+
documents: Document[];
|
|
159
|
+
results: Result[];
|
|
160
|
+
outcomes: Outcome[];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface PlanBlock {
|
|
164
|
+
type: 'plan';
|
|
165
|
+
roadmap: Roadmap;
|
|
166
|
+
timeline: Timeline;
|
|
167
|
+
milestones: Milestone[];
|
|
168
|
+
dependencies: Dependency[];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface PromptBlock {
|
|
172
|
+
type: 'prompt';
|
|
173
|
+
ir: IntermediateRepresentation;
|
|
174
|
+
instructions: Instruction[];
|
|
175
|
+
context: Context[];
|
|
176
|
+
constraints: Constraint[];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ─── Intermediate Representation ─────────────────────────────────────
|
|
180
|
+
|
|
181
|
+
export interface IntermediateRepresentation {
|
|
182
|
+
version: string;
|
|
183
|
+
blocks: (LangBlock | FrameBlock | CoreBlock)[];
|
|
184
|
+
metadata: ProgramMetadata;
|
|
185
|
+
optimizations: Optimization[];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ─── Lexicon Types ───────────────────────────────────────────────────
|
|
189
|
+
|
|
190
|
+
export interface Domain {
|
|
191
|
+
name: string;
|
|
192
|
+
description: string;
|
|
193
|
+
vocabulary: string[];
|
|
194
|
+
patterns: string[];
|
|
195
|
+
examples: string[];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface VocabularySet {
|
|
199
|
+
terms: Term[];
|
|
200
|
+
synonyms: Synonym[];
|
|
201
|
+
antonyms: Antonym[];
|
|
202
|
+
definitions: Definition[];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface Template {
|
|
206
|
+
name: string;
|
|
207
|
+
description: string;
|
|
208
|
+
pattern: string;
|
|
209
|
+
variables: Variable[];
|
|
210
|
+
examples: string[];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface Pattern {
|
|
214
|
+
name: string;
|
|
215
|
+
description: string;
|
|
216
|
+
regex: string;
|
|
217
|
+
examples: string[];
|
|
218
|
+
usage: string[];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface Term {
|
|
222
|
+
name: string;
|
|
223
|
+
definition: string;
|
|
224
|
+
synonyms: string[];
|
|
225
|
+
antonyms: string[];
|
|
226
|
+
examples: string[];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface Synonym {
|
|
230
|
+
term: string;
|
|
231
|
+
alternatives: string[];
|
|
232
|
+
context: string[];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export interface Antonym {
|
|
236
|
+
term: string;
|
|
237
|
+
opposites: string[];
|
|
238
|
+
context: string[];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface Definition {
|
|
242
|
+
term: string;
|
|
243
|
+
meaning: string;
|
|
244
|
+
context: string[];
|
|
245
|
+
examples: string[];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface Variable {
|
|
249
|
+
name: string;
|
|
250
|
+
type: string;
|
|
251
|
+
description: string;
|
|
252
|
+
required: boolean;
|
|
253
|
+
default?: unknown;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// ─── Grammar Types ───────────────────────────────────────────────────
|
|
257
|
+
|
|
258
|
+
export interface GrammarRule {
|
|
259
|
+
name: string;
|
|
260
|
+
pattern: string;
|
|
261
|
+
precedence: number;
|
|
262
|
+
associativity: 'left' | 'right' | 'none';
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export interface Operator {
|
|
266
|
+
symbol: string;
|
|
267
|
+
precedence: number;
|
|
268
|
+
associativity: 'left' | 'right' | 'none';
|
|
269
|
+
description: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface PrecedenceRule {
|
|
273
|
+
level: number;
|
|
274
|
+
operators: string[];
|
|
275
|
+
description: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// ─── Command Types ───────────────────────────────────────────────────
|
|
279
|
+
|
|
280
|
+
export interface Action {
|
|
281
|
+
name: string;
|
|
282
|
+
description: string;
|
|
283
|
+
parameters: Parameter[];
|
|
284
|
+
examples: string[];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface Directive {
|
|
288
|
+
name: string;
|
|
289
|
+
description: string;
|
|
290
|
+
parameters: Parameter[];
|
|
291
|
+
examples: string[];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface Operation {
|
|
295
|
+
name: string;
|
|
296
|
+
description: string;
|
|
297
|
+
parameters: Parameter[];
|
|
298
|
+
examples: string[];
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface Parameter {
|
|
302
|
+
name: string;
|
|
303
|
+
type: string;
|
|
304
|
+
description: string;
|
|
305
|
+
required: boolean;
|
|
306
|
+
default?: unknown;
|
|
307
|
+
validation?: Validation[];
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// ─── Intent Types ────────────────────────────────────────────────────
|
|
311
|
+
|
|
312
|
+
export interface Goal {
|
|
313
|
+
name: string;
|
|
314
|
+
description: string;
|
|
315
|
+
priority: Priority;
|
|
316
|
+
deadline: Date;
|
|
317
|
+
successCriteria: string[];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface Deliverable {
|
|
321
|
+
name: string;
|
|
322
|
+
description: string;
|
|
323
|
+
type: DeliverableType;
|
|
324
|
+
format: string;
|
|
325
|
+
quality: QualityStandard[];
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface SuccessCriterion {
|
|
329
|
+
name: string;
|
|
330
|
+
description: string;
|
|
331
|
+
metric: string;
|
|
332
|
+
target: number;
|
|
333
|
+
unit: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface Constraint {
|
|
337
|
+
name: string;
|
|
338
|
+
description: string;
|
|
339
|
+
type: ConstraintType;
|
|
340
|
+
value: unknown;
|
|
341
|
+
enforcement: EnforcementLevel;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// ─── Execution Types ─────────────────────────────────────────────────
|
|
345
|
+
|
|
346
|
+
export interface ExecutionPattern {
|
|
347
|
+
name: string;
|
|
348
|
+
description: string;
|
|
349
|
+
steps: Step[];
|
|
350
|
+
checkpoints: Checkpoint[];
|
|
351
|
+
iterations: IterationRule[];
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface ReasoningMode {
|
|
355
|
+
type: 'chain-of-thought' | 'react' | 'tree-of-thoughts' | 'systematic';
|
|
356
|
+
description: string;
|
|
357
|
+
parameters: Parameter[];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface Checkpoint {
|
|
361
|
+
name: string;
|
|
362
|
+
description: string;
|
|
363
|
+
validation: Validation[];
|
|
364
|
+
actions: Action[];
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface IterationRule {
|
|
368
|
+
name: string;
|
|
369
|
+
condition: string;
|
|
370
|
+
maxIterations: number;
|
|
371
|
+
convergence: ConvergenceCriteria;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface Step {
|
|
375
|
+
name: string;
|
|
376
|
+
description: string;
|
|
377
|
+
action: Action;
|
|
378
|
+
validation: Validation[];
|
|
379
|
+
next: string[];
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export interface ConvergenceCriteria {
|
|
383
|
+
metric: string;
|
|
384
|
+
threshold: number;
|
|
385
|
+
tolerance: number;
|
|
386
|
+
maxIterations: number;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// ─── Environment Types ───────────────────────────────────────────────
|
|
390
|
+
|
|
391
|
+
export interface Model {
|
|
392
|
+
name: string;
|
|
393
|
+
type: ModelType;
|
|
394
|
+
version: string;
|
|
395
|
+
capabilities: Capability[];
|
|
396
|
+
constraints: Constraint[];
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export interface Tool {
|
|
400
|
+
name: string;
|
|
401
|
+
description: string;
|
|
402
|
+
type: ToolType;
|
|
403
|
+
parameters: Parameter[];
|
|
404
|
+
examples: string[];
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface Runtime {
|
|
408
|
+
environment: string;
|
|
409
|
+
version: string;
|
|
410
|
+
resources: Resource[];
|
|
411
|
+
policies: Policy[];
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export interface Policy {
|
|
415
|
+
name: string;
|
|
416
|
+
description: string;
|
|
417
|
+
type: PolicyType;
|
|
418
|
+
rules: Rule[];
|
|
419
|
+
enforcement: EnforcementLevel;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export interface Capability {
|
|
423
|
+
name: string;
|
|
424
|
+
description: string;
|
|
425
|
+
parameters: Parameter[];
|
|
426
|
+
examples: string[];
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export interface Resource {
|
|
430
|
+
type: string;
|
|
431
|
+
name: string;
|
|
432
|
+
capacity: number;
|
|
433
|
+
unit: string;
|
|
434
|
+
available: number;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export interface Rule {
|
|
438
|
+
name: string;
|
|
439
|
+
description: string;
|
|
440
|
+
condition: string;
|
|
441
|
+
action: string;
|
|
442
|
+
priority: number;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export interface Condition {
|
|
446
|
+
name: string;
|
|
447
|
+
description: string;
|
|
448
|
+
expression: string;
|
|
449
|
+
parameters: Parameter[];
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// ─── Scope Types ─────────────────────────────────────────────────────
|
|
453
|
+
|
|
454
|
+
export interface Boundary {
|
|
455
|
+
name: string;
|
|
456
|
+
description: string;
|
|
457
|
+
type: BoundaryType;
|
|
458
|
+
value: unknown;
|
|
459
|
+
enforcement: EnforcementLevel;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface Limit {
|
|
463
|
+
name: string;
|
|
464
|
+
description: string;
|
|
465
|
+
type: LimitType;
|
|
466
|
+
value: number;
|
|
467
|
+
unit: string;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export interface Exclusion {
|
|
471
|
+
name: string;
|
|
472
|
+
description: string;
|
|
473
|
+
reason: string;
|
|
474
|
+
alternatives: string[];
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export interface Inclusion {
|
|
478
|
+
name: string;
|
|
479
|
+
description: string;
|
|
480
|
+
reason: string;
|
|
481
|
+
requirements: string[];
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// ─── Authority Types ─────────────────────────────────────────────────
|
|
485
|
+
|
|
486
|
+
export interface Role {
|
|
487
|
+
name: string;
|
|
488
|
+
description: string;
|
|
489
|
+
permissions: Permission[];
|
|
490
|
+
responsibilities: string[];
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export interface Permission {
|
|
494
|
+
name: string;
|
|
495
|
+
description: string;
|
|
496
|
+
scope: string;
|
|
497
|
+
level: PermissionLevel;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export interface AccessControl {
|
|
501
|
+
resource: string;
|
|
502
|
+
permissions: Permission[];
|
|
503
|
+
roles: string[];
|
|
504
|
+
conditions: Condition[];
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
export interface DelegationRule {
|
|
508
|
+
name: string;
|
|
509
|
+
description: string;
|
|
510
|
+
fromRole: string;
|
|
511
|
+
toRole: string;
|
|
512
|
+
conditions: Condition[];
|
|
513
|
+
expiration: Date;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// ─── Organization Types ──────────────────────────────────────────────
|
|
517
|
+
|
|
518
|
+
export interface Organization {
|
|
519
|
+
name: string;
|
|
520
|
+
description: string;
|
|
521
|
+
structure: Structure;
|
|
522
|
+
culture: Culture;
|
|
523
|
+
values: Value[];
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export interface Structure {
|
|
527
|
+
type: string;
|
|
528
|
+
levels: number;
|
|
529
|
+
departments: string[];
|
|
530
|
+
reporting: string[];
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export interface Culture {
|
|
534
|
+
values: string[];
|
|
535
|
+
principles: string[];
|
|
536
|
+
practices: string[];
|
|
537
|
+
norms: string[];
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export interface Value {
|
|
541
|
+
name: string;
|
|
542
|
+
description: string;
|
|
543
|
+
importance: number;
|
|
544
|
+
examples: string[];
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export interface KPI {
|
|
548
|
+
name: string;
|
|
549
|
+
description: string;
|
|
550
|
+
metric: string;
|
|
551
|
+
target: number;
|
|
552
|
+
unit: string;
|
|
553
|
+
frequency: string;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export interface Metric {
|
|
557
|
+
name: string;
|
|
558
|
+
description: string;
|
|
559
|
+
type: MetricType;
|
|
560
|
+
calculation: string;
|
|
561
|
+
unit: string;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
export interface Context {
|
|
565
|
+
name: string;
|
|
566
|
+
description: string;
|
|
567
|
+
type: ContextType;
|
|
568
|
+
value: unknown;
|
|
569
|
+
source: string;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// ─── Quality & Verification Types ────────────────────────────────────
|
|
573
|
+
|
|
574
|
+
export interface PrecisionLevel {
|
|
575
|
+
level: 'low' | 'medium' | 'high' | 'exact';
|
|
576
|
+
description: string;
|
|
577
|
+
requirements: string[];
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export interface VerificationLevel {
|
|
581
|
+
level: 'basic' | 'standard' | 'comprehensive' | 'exhaustive';
|
|
582
|
+
description: string;
|
|
583
|
+
methods: string[];
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export interface QualityStandard {
|
|
587
|
+
name: string;
|
|
588
|
+
description: string;
|
|
589
|
+
criteria: string[];
|
|
590
|
+
measurement: string;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export interface Validation {
|
|
594
|
+
name: string;
|
|
595
|
+
description: string;
|
|
596
|
+
type: ValidationType;
|
|
597
|
+
rules: Rule[];
|
|
598
|
+
errorHandling: ErrorHandling;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export interface ErrorHandling {
|
|
602
|
+
strategy: string;
|
|
603
|
+
fallback: string;
|
|
604
|
+
logging: string;
|
|
605
|
+
userNotification: string;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
export interface AcceptanceCriteria {
|
|
609
|
+
name: string;
|
|
610
|
+
description: string;
|
|
611
|
+
test: string;
|
|
612
|
+
passCondition: string;
|
|
613
|
+
priority: Priority;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// ─── Spec Types ──────────────────────────────────────────────────────
|
|
617
|
+
|
|
618
|
+
export interface Requirement {
|
|
619
|
+
name: string;
|
|
620
|
+
description: string;
|
|
621
|
+
type: RequirementType;
|
|
622
|
+
priority: Priority;
|
|
623
|
+
acceptance: AcceptanceCriteria[];
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export interface Contract {
|
|
627
|
+
name: string;
|
|
628
|
+
description: string;
|
|
629
|
+
parties: string[];
|
|
630
|
+
terms: Term[];
|
|
631
|
+
enforcement: EnforcementLevel;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
export interface Interface {
|
|
635
|
+
name: string;
|
|
636
|
+
description: string;
|
|
637
|
+
type: InterfaceType;
|
|
638
|
+
methods: Method[];
|
|
639
|
+
properties: Property[];
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export interface Method {
|
|
643
|
+
name: string;
|
|
644
|
+
description: string;
|
|
645
|
+
parameters: Parameter[];
|
|
646
|
+
returnType: string;
|
|
647
|
+
examples: string[];
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
export interface Property {
|
|
651
|
+
name: string;
|
|
652
|
+
description: string;
|
|
653
|
+
type: string;
|
|
654
|
+
required: boolean;
|
|
655
|
+
default?: unknown;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// ─── Artifact Types ──────────────────────────────────────────────────
|
|
659
|
+
|
|
660
|
+
export interface Output {
|
|
661
|
+
name: string;
|
|
662
|
+
description: string;
|
|
663
|
+
type: OutputType;
|
|
664
|
+
format: string;
|
|
665
|
+
quality: QualityStandard[];
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
export interface Receipt {
|
|
669
|
+
name: string;
|
|
670
|
+
description: string;
|
|
671
|
+
timestamp: Date;
|
|
672
|
+
hash: string;
|
|
673
|
+
signature: Signature;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export interface Signature {
|
|
677
|
+
algorithm: string;
|
|
678
|
+
value: string;
|
|
679
|
+
timestamp: Date;
|
|
680
|
+
key: string;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
export interface RetentionPolicy {
|
|
684
|
+
name: string;
|
|
685
|
+
description: string;
|
|
686
|
+
duration: string;
|
|
687
|
+
conditions: Condition[];
|
|
688
|
+
disposal: DisposalMethod;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// ─── Product Types ───────────────────────────────────────────────────
|
|
692
|
+
|
|
693
|
+
export interface Document {
|
|
694
|
+
name: string;
|
|
695
|
+
description: string;
|
|
696
|
+
type: DocumentType;
|
|
697
|
+
format: string;
|
|
698
|
+
content: string;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
export interface Result {
|
|
702
|
+
name: string;
|
|
703
|
+
description: string;
|
|
704
|
+
type: ResultType;
|
|
705
|
+
value: unknown;
|
|
706
|
+
quality: QualityStandard[];
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
export interface Outcome {
|
|
710
|
+
name: string;
|
|
711
|
+
description: string;
|
|
712
|
+
type: OutcomeType;
|
|
713
|
+
success: boolean;
|
|
714
|
+
metrics: Metric[];
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// ─── Plan Types ──────────────────────────────────────────────────────
|
|
718
|
+
|
|
719
|
+
export interface Roadmap {
|
|
720
|
+
name: string;
|
|
721
|
+
description: string;
|
|
722
|
+
phases: Phase[];
|
|
723
|
+
timeline: Timeline;
|
|
724
|
+
milestones: Milestone[];
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
export interface Timeline {
|
|
728
|
+
start: Date;
|
|
729
|
+
end: Date;
|
|
730
|
+
phases: Phase[];
|
|
731
|
+
dependencies: Dependency[];
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
export interface Milestone {
|
|
735
|
+
name: string;
|
|
736
|
+
description: string;
|
|
737
|
+
date: Date;
|
|
738
|
+
deliverables: Deliverable[];
|
|
739
|
+
successCriteria: SuccessCriterion[];
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export interface Dependency {
|
|
743
|
+
name: string;
|
|
744
|
+
description: string;
|
|
745
|
+
from: string;
|
|
746
|
+
to: string;
|
|
747
|
+
type: DependencyType;
|
|
748
|
+
critical: boolean;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
export interface Phase {
|
|
752
|
+
name: string;
|
|
753
|
+
description: string;
|
|
754
|
+
start: Date;
|
|
755
|
+
end: Date;
|
|
756
|
+
deliverables: Deliverable[];
|
|
757
|
+
milestones: Milestone[];
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
export interface Optimization {
|
|
761
|
+
name: string;
|
|
762
|
+
description: string;
|
|
763
|
+
type: string;
|
|
764
|
+
impact: string;
|
|
765
|
+
implementation: string[];
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
export interface Instruction {
|
|
769
|
+
name: string;
|
|
770
|
+
description: string;
|
|
771
|
+
type: InstructionType;
|
|
772
|
+
parameters: Parameter[];
|
|
773
|
+
examples: string[];
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
// ─── Union Types ─────────────────────────────────────────────────────
|
|
777
|
+
|
|
778
|
+
export type Priority = 'low' | 'medium' | 'high' | 'critical';
|
|
779
|
+
export type DeliverableType = 'document' | 'code' | 'data' | 'model' | 'service';
|
|
780
|
+
export type ConstraintType = 'time' | 'cost' | 'quality' | 'security' | 'compliance';
|
|
781
|
+
export type EnforcementLevel = 'suggested' | 'recommended' | 'required' | 'mandatory';
|
|
782
|
+
export type ModelType = 'llm' | 'ml' | 'nlp' | 'vision' | 'audio';
|
|
783
|
+
export type ToolType = 'api' | 'library' | 'service' | 'utility' | 'integration';
|
|
784
|
+
export type PolicyType = 'security' | 'privacy' | 'compliance' | 'performance' | 'quality';
|
|
785
|
+
export type BoundaryType = 'inclusive' | 'exclusive' | 'range' | 'pattern' | 'custom';
|
|
786
|
+
export type LimitType = 'count' | 'size' | 'time' | 'memory' | 'cpu';
|
|
787
|
+
export type PermissionLevel = 'read' | 'write' | 'execute' | 'admin' | 'owner';
|
|
788
|
+
export type ContextType = 'environment' | 'user' | 'system' | 'business' | 'technical';
|
|
789
|
+
export type RequirementType = 'functional' | 'non-functional' | 'business' | 'technical' | 'compliance';
|
|
790
|
+
export type InterfaceType = 'api' | 'ui' | 'database' | 'service' | 'protocol';
|
|
791
|
+
export type ValidationType = 'format' | 'range' | 'presence' | 'uniqueness' | 'custom';
|
|
792
|
+
export type OutputType = 'text' | 'data' | 'file' | 'stream' | 'response';
|
|
793
|
+
export type DocumentType = 'specification' | 'manual' | 'report' | 'contract' | 'policy';
|
|
794
|
+
export type ResultType = 'success' | 'failure' | 'partial' | 'error' | 'warning';
|
|
795
|
+
export type OutcomeType = 'achieved' | 'partially-achieved' | 'failed' | 'cancelled' | 'deferred';
|
|
796
|
+
export type DependencyType = 'finish-to-start' | 'start-to-start' | 'finish-to-finish' | 'start-to-finish';
|
|
797
|
+
export type InstructionType = 'command' | 'query' | 'action' | 'validation' | 'transformation';
|
|
798
|
+
export type MetricType = 'count' | 'percentage' | 'duration' | 'currency' | 'custom';
|
|
799
|
+
export type DisposalMethod = 'delete' | 'archive' | 'retain' | 'anonymize' | 'encrypt';
|