@almadar/agent 3.2.0 → 3.5.1
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/dist/agent/index.js +4 -2
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/skill-agent.d.ts +5 -0
- package/dist/evals/utils/orbital-validate.d.ts +33 -0
- package/dist/gates/_debug.d.ts +12 -0
- package/dist/gates/agent-single-pass.d.ts +1 -0
- package/dist/gates/agentic/run.d.ts +13 -0
- package/dist/gates/agentic/tools.d.ts +301 -0
- package/dist/gates/behavior-extract.d.ts +26 -0
- package/dist/gates/gate0-application.d.ts +13 -0
- package/dist/gates/gate05-behavior-match.d.ts +26 -0
- package/dist/gates/gate1-orbital.d.ts +17 -0
- package/dist/gates/gate2-trait.d.ts +17 -0
- package/dist/gates/gate3-transition.d.ts +16 -0
- package/dist/gates/gate4-render-ui.d.ts +17 -0
- package/dist/gates/index.d.ts +23 -0
- package/dist/gates/index.js +2034 -0
- package/dist/gates/index.js.map +1 -0
- package/dist/gates/merge.d.ts +26 -0
- package/dist/gates/orchestrator.d.ts +18 -0
- package/dist/gates/prompts.d.ts +33 -0
- package/dist/gates/scoring.d.ts +43 -0
- package/dist/gates/types.d.ts +147 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/tools/combine-schemas.d.ts +1 -1
- package/dist/tools/domain-orbital.d.ts +4 -4
- package/dist/tools/execute.d.ts +1 -1
- package/dist/tools/finish-task.d.ts +1 -1
- package/dist/tools/generate-schema.d.ts +1 -1
- package/dist/tools/github.d.ts +16 -16
- package/dist/tools/index.d.ts +12 -12
- package/dist/tools/orbital-batch-subagent.d.ts +1 -1
- package/dist/tools/orbital-subagent.d.ts +1 -1
- package/dist/tools/orchestrated-fixing.d.ts +2 -2
- package/dist/tools/orchestrated-generation.d.ts +2 -2
- package/dist/tools/schema-chunking.d.ts +6 -6
- package/dist/tools/trait-subagent.d.ts +1 -1
- package/dist/tools/validate-schema.d.ts +1 -1
- package/package.json +8 -3
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gated Construction Types
|
|
3
|
+
*
|
|
4
|
+
* Uses @almadar/core types directly. Each gate accepts an OrbitalSchema
|
|
5
|
+
* and returns an enriched OrbitalSchema (except Gate 0 which creates from prompt).
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { OrbitalSchema } from '@almadar/core/types';
|
|
10
|
+
/** Providers available for gated construction. Both route through OpenRouter. */
|
|
11
|
+
export type GateProvider = 'deepseek' | 'zhipu';
|
|
12
|
+
/** Whether the behavior source is injected into the user prompt. */
|
|
13
|
+
export type GateMode = 'guided' | 'pure';
|
|
14
|
+
/** Options passed to individual gate functions. */
|
|
15
|
+
export interface GateOpts {
|
|
16
|
+
/** Max tokens per gate call. Default 4096. */
|
|
17
|
+
maxTokens?: number;
|
|
18
|
+
/** Golden .orb schema for guided mode. */
|
|
19
|
+
goldenOrb?: OrbitalSchema;
|
|
20
|
+
/** Whether to validate after this gate. */
|
|
21
|
+
validateAfterGate?: boolean;
|
|
22
|
+
/** Working directory for orbital validate temp files. */
|
|
23
|
+
workDir?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface GatePipelineConfig {
|
|
26
|
+
provider: GateProvider;
|
|
27
|
+
mode: GateMode;
|
|
28
|
+
/** Override model for this run (otherwise uses provider default). */
|
|
29
|
+
model?: string;
|
|
30
|
+
/** Max tokens per gate call. Default 4096. */
|
|
31
|
+
maxTokens?: number;
|
|
32
|
+
/** Temperature. Default 0.3. */
|
|
33
|
+
temperature?: number;
|
|
34
|
+
/** Working directory for orbital validate temp files. */
|
|
35
|
+
workDir: string;
|
|
36
|
+
/** Validate after each gate (failures logged but don't abort). */
|
|
37
|
+
validateAfterEachGate?: boolean;
|
|
38
|
+
/** Run orbital-verify on the final .orb (compile + server + browser). */
|
|
39
|
+
verify?: boolean;
|
|
40
|
+
/** Show browser during verification. */
|
|
41
|
+
verifyHeaded?: boolean;
|
|
42
|
+
/** Capture screenshots during verification. */
|
|
43
|
+
verifyScreenshots?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface GateTimings {
|
|
46
|
+
gate0Ms: number;
|
|
47
|
+
gate1Ms: number[];
|
|
48
|
+
gate2Ms: number[];
|
|
49
|
+
gate3Ms: number[];
|
|
50
|
+
gate4Ms: number[];
|
|
51
|
+
totalMs: number;
|
|
52
|
+
}
|
|
53
|
+
export interface VerifyResult {
|
|
54
|
+
totalPassed: number;
|
|
55
|
+
totalFailed: number;
|
|
56
|
+
totalChecks: number;
|
|
57
|
+
coverage?: {
|
|
58
|
+
ratio: number;
|
|
59
|
+
coveredItems: number;
|
|
60
|
+
totalItems: number;
|
|
61
|
+
};
|
|
62
|
+
phases: Array<{
|
|
63
|
+
phase: number;
|
|
64
|
+
name: string;
|
|
65
|
+
passed: number;
|
|
66
|
+
failed: number;
|
|
67
|
+
checks: Array<{
|
|
68
|
+
label: string;
|
|
69
|
+
passed: boolean;
|
|
70
|
+
detail?: string;
|
|
71
|
+
}>;
|
|
72
|
+
}>;
|
|
73
|
+
}
|
|
74
|
+
export interface GatePipelineResult {
|
|
75
|
+
config: GatePipelineConfig;
|
|
76
|
+
orbAfterGate0: OrbitalSchema;
|
|
77
|
+
orbAfterGate1: OrbitalSchema;
|
|
78
|
+
orbAfterGate2: OrbitalSchema;
|
|
79
|
+
orbAfterGate3: OrbitalSchema;
|
|
80
|
+
orbFinal: OrbitalSchema;
|
|
81
|
+
validation: {
|
|
82
|
+
valid: boolean;
|
|
83
|
+
errors: Array<{
|
|
84
|
+
code: string;
|
|
85
|
+
path: string;
|
|
86
|
+
message: string;
|
|
87
|
+
}>;
|
|
88
|
+
};
|
|
89
|
+
verify?: VerifyResult;
|
|
90
|
+
timings: GateTimings;
|
|
91
|
+
}
|
|
92
|
+
export interface GateScore {
|
|
93
|
+
gate: number;
|
|
94
|
+
score: number;
|
|
95
|
+
details: Record<string, number>;
|
|
96
|
+
}
|
|
97
|
+
export interface PipelineScore {
|
|
98
|
+
overall: number;
|
|
99
|
+
gates: GateScore[];
|
|
100
|
+
provider: GateProvider;
|
|
101
|
+
mode: GateMode;
|
|
102
|
+
behaviorName: string;
|
|
103
|
+
}
|
|
104
|
+
export interface BehaviorGateData {
|
|
105
|
+
/** Gate 0 level: orbital count, entity names, trait names. */
|
|
106
|
+
appLevel: {
|
|
107
|
+
orbitalCount: number;
|
|
108
|
+
entityNames: string[];
|
|
109
|
+
traitNames: string[];
|
|
110
|
+
};
|
|
111
|
+
/** Gate 1 level per orbital. */
|
|
112
|
+
orbitalLevels: Array<{
|
|
113
|
+
orbitalName: string;
|
|
114
|
+
entity: Record<string, unknown>;
|
|
115
|
+
traitNames: string[];
|
|
116
|
+
pages: Record<string, unknown>[];
|
|
117
|
+
}>;
|
|
118
|
+
/** Gate 2 level per trait. */
|
|
119
|
+
traitLevels: Array<{
|
|
120
|
+
traitName: string;
|
|
121
|
+
states: string[];
|
|
122
|
+
events: string[];
|
|
123
|
+
transitionEdges: Array<{
|
|
124
|
+
from: string;
|
|
125
|
+
event: string;
|
|
126
|
+
to: string;
|
|
127
|
+
}>;
|
|
128
|
+
}>;
|
|
129
|
+
/** Gate 3 level per transition. */
|
|
130
|
+
transitionLevels: Array<{
|
|
131
|
+
from: string;
|
|
132
|
+
event: string;
|
|
133
|
+
to: string;
|
|
134
|
+
guard: unknown[] | null;
|
|
135
|
+
nonRenderEffects: unknown[];
|
|
136
|
+
}>;
|
|
137
|
+
/** Gate 4 level per transition with render-ui. */
|
|
138
|
+
renderUiLevels: Array<{
|
|
139
|
+
from: string;
|
|
140
|
+
event: string;
|
|
141
|
+
to: string;
|
|
142
|
+
renderEffects: Array<{
|
|
143
|
+
slot: string;
|
|
144
|
+
tree: Record<string, unknown>;
|
|
145
|
+
}>;
|
|
146
|
+
}>;
|
|
147
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -6802,7 +6802,7 @@ IMPORTANT:
|
|
|
6802
6802
|
if (githubTools && verbose) {
|
|
6803
6803
|
console.log(`[SkillAgent] GitHub tools enabled`);
|
|
6804
6804
|
}
|
|
6805
|
-
let tools = [
|
|
6805
|
+
let tools = options.extraToolsOnly ? [...options.extraTools || [], finishTaskTool] : [
|
|
6806
6806
|
executeTool,
|
|
6807
6807
|
finishTaskTool,
|
|
6808
6808
|
validateSchemaTool,
|
|
@@ -6820,7 +6820,9 @@ IMPORTANT:
|
|
|
6820
6820
|
...githubTools || [],
|
|
6821
6821
|
// Add orchestrated tools when enabled
|
|
6822
6822
|
...orchestratedGenerationTool ? [orchestratedGenerationTool] : [],
|
|
6823
|
-
...orchestratedFixingTool ? [orchestratedFixingTool] : []
|
|
6823
|
+
...orchestratedFixingTool ? [orchestratedFixingTool] : [],
|
|
6824
|
+
// Add extra tools if provided
|
|
6825
|
+
...options.extraTools || []
|
|
6824
6826
|
];
|
|
6825
6827
|
if (options.toolWrapper) {
|
|
6826
6828
|
tools = tools.map(options.toolWrapper);
|