repositories / pi-ext
pi-ext
bugabingas pi extensions
owned by bugabinga
extensions/ultra/dynamic-contract.ts
RawFile outline
- VALIDATOR_CONTRACT_VERSION line 1
- VALIDATOR_WARNING_TARGET_MS line 2
- VALIDATOR_WATCHDOG_MS line 3
- MARGINAL_LOAD_BUDGET_MS line 4
- BUILTIN_TOOL_NAMES line 6
- ULTRA_RESERVED_TOOL_NAMES line 17
- DynamicManifest line 26
- schemaVersion line 27
- name line 28
- description line 29
- topic line 30
- scope line 31
- nonGoals line 32
- tags line 33
- capabilities line 34
- requiredExecutables line 35
- optionalExecutables line 36
- overrides line 37
- benchmarkBudgets line 38
- ValidationDiagnostic line 41
- gate line 42
- code line 43
- status line 44
- path line 45
- line line 46
- expected line 47
- actual line 48
- output line 49
- limitMs line 50
- elapsedMs line 51
- remediation line 52
- draftPath line 53
- ValidationAttestation line 56
- schemaVersion line 57
- validatorContractVersion line 58
- sourceHash line 59
- validatedAt line 60
- platform line 61
- testedPlatforms line 62
- nodeVersion line 63
- warningTargetMs line 64
- gates line 65
- WorkerValidationResult line 68
- ok line 69
- diagnostics line 70
- manifest line 71
- hash line 72
- attestation line 73
- durationMs line 74
export const VALIDATOR_CONTRACT_VERSION = 2;
export const VALIDATOR_WARNING_TARGET_MS = 5_000;
export const VALIDATOR_WATCHDOG_MS = 15_000;
export const MARGINAL_LOAD_BUDGET_MS = 50;
export const BUILTIN_TOOL_NAMES: ReadonlySet<string> = new Set([
"bash",
"edit",
"find",
"grep",
"ls",
"powershell",
"read",
"write",
]);
export const ULTRA_RESERVED_TOOL_NAMES: ReadonlySet<string> = new Set([
"run_workflow",
"structured_output",
"search_dynamic_extensions",
"create_dynamic_extension",
"checkout_dynamic_extension",
"validate_dynamic_extension",
]);
export interface DynamicManifest {
schemaVersion: 1;
name: string;
description: string;
topic: string;
scope: string;
nonGoals: string[];
tags: string[];
capabilities: string[];
requiredExecutables: string[];
optionalExecutables: string[];
overrides: string[];
benchmarkBudgets: Record<string, { hotPathMs: number }>;
}
export interface ValidationDiagnostic {
gate: string;
code: string;
status: "error" | "warning" | "blocked";
path?: string;
line?: number;
expected?: unknown;
actual?: unknown;
output?: string;
limitMs?: number;
elapsedMs?: number;
remediation: string;
draftPath: string;
}
export interface ValidationAttestation {
schemaVersion: 1;
validatorContractVersion: number;
sourceHash: string;
validatedAt: string;
platform: NodeJS.Platform;
testedPlatforms: NodeJS.Platform[];
nodeVersion: string;
warningTargetMs: number;
gates: string[];
}
export interface WorkerValidationResult {
ok: boolean;
diagnostics: ValidationDiagnostic[];
manifest?: DynamicManifest;
hash?: string;
attestation?: ValidationAttestation;
durationMs: number;
}