@toolproof-core/genesis 1.0.50 → 1.0.52
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/generated-src/implementations/tools.ts +214 -214
- package/generated-src/metadata/Core.json +78 -0
- package/package.json +11 -12
- package/src/declarations/booleans.json +3 -3
- package/src/declarations/naturals.json +12 -12
- package/src/declarations/resourceTypes/resourceTypeShells.json +52 -52
- package/src/declarations/resourceTypes/schemas.json +1838 -1838
- package/src/declarations/tools.json +704 -704
- package/src/implementations/tools.ts +214 -214
- package/src/index.ts +131 -131
- package/src/utils/constantsAndMappings.ts +194 -194
- package/src/utils/coreProjection.ts +52 -52
- package/src/utils/resourceTypes.ts +70 -70
- package/src/utils/schemaDependencies.ts +114 -114
- package/src/utils/schemaObjectNormalization.ts +70 -70
- package/src/utils/schemaRefNormalization.ts +82 -82
- package/src/utils/schemaShims.ts +16 -16
- package/src/utils/standaloneSchemas.ts +113 -113
- package/src/utils/standaloneTypes.ts +27 -27
- package/src/utils/standaloneZodSchemas.ts +71 -71
- package/src/utils/timestampedResources.ts +41 -41
- package/src/utils/typeGeneration.ts +30 -30
- package/src/utils/typeGenerationPostProcess.ts +245 -245
- package/src/utils/typeGenerationPreflight.ts +118 -118
- package/src/utils/zodCodegen.ts +548 -548
- package/toolproof.json +18 -18
|
@@ -1,214 +1,214 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Boolean,
|
|
3
|
-
Natural,
|
|
4
|
-
ResourceType,
|
|
5
|
-
Tool,
|
|
6
|
-
} from '../types/types.js';
|
|
7
|
-
|
|
8
|
-
type GenericAssignmentByRoleName<GenericRoleName extends string> = Record<GenericRoleName, ResourceType>;
|
|
9
|
-
|
|
10
|
-
type InstantiationToolHandleBySpecializationKey = Record<string, Tool>;
|
|
11
|
-
|
|
12
|
-
type TemplateInputs<GenericRoleName extends string> = {
|
|
13
|
-
GenericAssignmentByRoleName: GenericAssignmentByRoleName<GenericRoleName>;
|
|
14
|
-
InstantiationToolHandleBySpecializationKey: InstantiationToolHandleBySpecializationKey;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
type TemplateOutputs = {
|
|
18
|
-
InstantiationTool: Tool;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type OperandTemplateInputs = TemplateInputs<'OperandType'>;
|
|
22
|
-
|
|
23
|
-
const OPERAND_TYPE_ROLE_NAMES = ['OperandType'] as const;
|
|
24
|
-
|
|
25
|
-
function assertExactKeys(actualKeys: string[], expectedKeys: readonly string[], label: string): void {
|
|
26
|
-
const sortedActualKeys = [...actualKeys].sort();
|
|
27
|
-
const sortedExpectedKeys = [...expectedKeys].sort();
|
|
28
|
-
|
|
29
|
-
if (sortedActualKeys.length !== sortedExpectedKeys.length) {
|
|
30
|
-
throw new Error(
|
|
31
|
-
`${label} must contain exactly [${sortedExpectedKeys.join(', ')}], got [${sortedActualKeys.join(', ')}]`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
for (let index = 0; index < sortedExpectedKeys.length; index += 1) {
|
|
36
|
-
if (sortedActualKeys[index] !== sortedExpectedKeys[index]) {
|
|
37
|
-
throw new Error(
|
|
38
|
-
`${label} must contain exactly [${sortedExpectedKeys.join(', ')}], got [${sortedActualKeys.join(', ')}]`
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function asNatural(value: number, label: string): Natural {
|
|
45
|
-
if (!Number.isInteger(value) || value < 0) {
|
|
46
|
-
throw new Error(`${label} must be a non-negative integer, got ${value}`);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return value as Natural;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function createSpecializationKey(assignments: Record<string, ResourceType>): string {
|
|
53
|
-
return JSON.stringify(
|
|
54
|
-
Object.entries(assignments)
|
|
55
|
-
.sort(([leftRoleName], [rightRoleName]) => leftRoleName.localeCompare(rightRoleName))
|
|
56
|
-
.map(([roleName, resourceType]) => [roleName, resourceType.handle])
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function resolveTemplateInstantiation<GenericRoleName extends string>(
|
|
61
|
-
inputs: TemplateInputs<GenericRoleName>,
|
|
62
|
-
expectedGenericRoleNames: readonly GenericRoleName[]
|
|
63
|
-
): TemplateOutputs {
|
|
64
|
-
const { GenericAssignmentByRoleName, InstantiationToolHandleBySpecializationKey } = inputs;
|
|
65
|
-
|
|
66
|
-
assertExactKeys(
|
|
67
|
-
Object.keys(GenericAssignmentByRoleName),
|
|
68
|
-
expectedGenericRoleNames,
|
|
69
|
-
'GenericAssignmentByRoleName'
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
const specializationKey = createSpecializationKey(GenericAssignmentByRoleName);
|
|
73
|
-
const instantiationTool = InstantiationToolHandleBySpecializationKey[specializationKey];
|
|
74
|
-
|
|
75
|
-
if (!instantiationTool) {
|
|
76
|
-
throw new Error(`No instantiation tool registered for specializationKey ${specializationKey}`);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
InstantiationTool: instantiationTool,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function Identity(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
85
|
-
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function Add(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
89
|
-
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function Subtract(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
93
|
-
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function Multiply(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
97
|
-
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function Divide(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
101
|
-
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function Double(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
105
|
-
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function LessThan(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
109
|
-
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function BooleanIdentity(inputs: { In: Boolean }): { Out: Boolean } {
|
|
113
|
-
return {
|
|
114
|
-
Out: inputs.In,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export function NaturalIdentity(inputs: { In: Natural }): { Out: Natural } {
|
|
119
|
-
return {
|
|
120
|
-
Out: inputs.In,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function NaturalLessThan(inputs: {
|
|
125
|
-
LessThanSource: Natural;
|
|
126
|
-
LessThanTarget: Natural;
|
|
127
|
-
}): { LessThanDecision: Boolean } {
|
|
128
|
-
return {
|
|
129
|
-
LessThanDecision: inputs.LessThanSource < inputs.LessThanTarget,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export function NaturalAdd(inputs: {
|
|
134
|
-
AddendOne: Natural;
|
|
135
|
-
AddendTwo: Natural;
|
|
136
|
-
}): { Sum: Natural } {
|
|
137
|
-
return {
|
|
138
|
-
Sum: asNatural(inputs.AddendOne + inputs.AddendTwo, 'Sum'),
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export function NaturalSubtract(inputs: {
|
|
143
|
-
Minuend: Natural;
|
|
144
|
-
Subtrahend: Natural;
|
|
145
|
-
}): { Difference: Natural } {
|
|
146
|
-
return {
|
|
147
|
-
Difference: asNatural(inputs.Minuend - inputs.Subtrahend, 'Difference'),
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export function NaturalMultiply(inputs: {
|
|
152
|
-
Multiplicand: Natural;
|
|
153
|
-
Multiplier: Natural;
|
|
154
|
-
}): { Product: Natural } {
|
|
155
|
-
return {
|
|
156
|
-
Product: asNatural(inputs.Multiplicand * inputs.Multiplier, 'Product'),
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export function NaturalDivide(inputs: {
|
|
161
|
-
Dividend: Natural;
|
|
162
|
-
Divisor: Natural;
|
|
163
|
-
}): { Quotient: Natural; Remainder: Natural } {
|
|
164
|
-
if (inputs.Divisor === 0) {
|
|
165
|
-
throw new Error('Divisor must be non-zero');
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return {
|
|
169
|
-
Quotient: asNatural(Math.floor(inputs.Dividend / inputs.Divisor), 'Quotient'),
|
|
170
|
-
Remainder: asNatural(inputs.Dividend % inputs.Divisor, 'Remainder'),
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export function NaturalDouble(inputs: { N: Natural }): { Doubled: Natural } {
|
|
175
|
-
return {
|
|
176
|
-
Doubled: asNatural(inputs.N * 2, 'Doubled'),
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export const TOOL_IMPLEMENTATION_BY_NAME = {
|
|
181
|
-
Identity,
|
|
182
|
-
Add,
|
|
183
|
-
Subtract,
|
|
184
|
-
Multiply,
|
|
185
|
-
Divide,
|
|
186
|
-
Double,
|
|
187
|
-
LessThan,
|
|
188
|
-
BooleanIdentity,
|
|
189
|
-
NaturalIdentity,
|
|
190
|
-
NaturalLessThan,
|
|
191
|
-
NaturalAdd,
|
|
192
|
-
NaturalSubtract,
|
|
193
|
-
NaturalMultiply,
|
|
194
|
-
NaturalDivide,
|
|
195
|
-
NaturalDouble,
|
|
196
|
-
} as const;
|
|
197
|
-
|
|
198
|
-
export const TOOL_IMPLEMENTATION_BY_HANDLE = {
|
|
199
|
-
'TOOL-Identity': Identity,
|
|
200
|
-
'TOOL-Add': Add,
|
|
201
|
-
'TOOL-Subtract': Subtract,
|
|
202
|
-
'TOOL-Multiply': Multiply,
|
|
203
|
-
'TOOL-Divide': Divide,
|
|
204
|
-
'TOOL-Double': Double,
|
|
205
|
-
'TOOL-LessThan': LessThan,
|
|
206
|
-
'TOOL-BooleanIdentity': BooleanIdentity,
|
|
207
|
-
'TOOL-NaturalIdentity': NaturalIdentity,
|
|
208
|
-
'TOOL-NaturalLessThan': NaturalLessThan,
|
|
209
|
-
'TOOL-NaturalAdd': NaturalAdd,
|
|
210
|
-
'TOOL-NaturalSubtract': NaturalSubtract,
|
|
211
|
-
'TOOL-NaturalMultiply': NaturalMultiply,
|
|
212
|
-
'TOOL-NaturalDivide': NaturalDivide,
|
|
213
|
-
'TOOL-NaturalDouble': NaturalDouble,
|
|
214
|
-
} as const;
|
|
1
|
+
import type {
|
|
2
|
+
Boolean,
|
|
3
|
+
Natural,
|
|
4
|
+
ResourceType,
|
|
5
|
+
Tool,
|
|
6
|
+
} from '../types/types.js';
|
|
7
|
+
|
|
8
|
+
type GenericAssignmentByRoleName<GenericRoleName extends string> = Record<GenericRoleName, ResourceType>;
|
|
9
|
+
|
|
10
|
+
type InstantiationToolHandleBySpecializationKey = Record<string, Tool>;
|
|
11
|
+
|
|
12
|
+
type TemplateInputs<GenericRoleName extends string> = {
|
|
13
|
+
GenericAssignmentByRoleName: GenericAssignmentByRoleName<GenericRoleName>;
|
|
14
|
+
InstantiationToolHandleBySpecializationKey: InstantiationToolHandleBySpecializationKey;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type TemplateOutputs = {
|
|
18
|
+
InstantiationTool: Tool;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type OperandTemplateInputs = TemplateInputs<'OperandType'>;
|
|
22
|
+
|
|
23
|
+
const OPERAND_TYPE_ROLE_NAMES = ['OperandType'] as const;
|
|
24
|
+
|
|
25
|
+
function assertExactKeys(actualKeys: string[], expectedKeys: readonly string[], label: string): void {
|
|
26
|
+
const sortedActualKeys = [...actualKeys].sort();
|
|
27
|
+
const sortedExpectedKeys = [...expectedKeys].sort();
|
|
28
|
+
|
|
29
|
+
if (sortedActualKeys.length !== sortedExpectedKeys.length) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`${label} must contain exactly [${sortedExpectedKeys.join(', ')}], got [${sortedActualKeys.join(', ')}]`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
for (let index = 0; index < sortedExpectedKeys.length; index += 1) {
|
|
36
|
+
if (sortedActualKeys[index] !== sortedExpectedKeys[index]) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`${label} must contain exactly [${sortedExpectedKeys.join(', ')}], got [${sortedActualKeys.join(', ')}]`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function asNatural(value: number, label: string): Natural {
|
|
45
|
+
if (!Number.isInteger(value) || value < 0) {
|
|
46
|
+
throw new Error(`${label} must be a non-negative integer, got ${value}`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return value as Natural;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function createSpecializationKey(assignments: Record<string, ResourceType>): string {
|
|
53
|
+
return JSON.stringify(
|
|
54
|
+
Object.entries(assignments)
|
|
55
|
+
.sort(([leftRoleName], [rightRoleName]) => leftRoleName.localeCompare(rightRoleName))
|
|
56
|
+
.map(([roleName, resourceType]) => [roleName, resourceType.handle])
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function resolveTemplateInstantiation<GenericRoleName extends string>(
|
|
61
|
+
inputs: TemplateInputs<GenericRoleName>,
|
|
62
|
+
expectedGenericRoleNames: readonly GenericRoleName[]
|
|
63
|
+
): TemplateOutputs {
|
|
64
|
+
const { GenericAssignmentByRoleName, InstantiationToolHandleBySpecializationKey } = inputs;
|
|
65
|
+
|
|
66
|
+
assertExactKeys(
|
|
67
|
+
Object.keys(GenericAssignmentByRoleName),
|
|
68
|
+
expectedGenericRoleNames,
|
|
69
|
+
'GenericAssignmentByRoleName'
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const specializationKey = createSpecializationKey(GenericAssignmentByRoleName);
|
|
73
|
+
const instantiationTool = InstantiationToolHandleBySpecializationKey[specializationKey];
|
|
74
|
+
|
|
75
|
+
if (!instantiationTool) {
|
|
76
|
+
throw new Error(`No instantiation tool registered for specializationKey ${specializationKey}`);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
InstantiationTool: instantiationTool,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function Identity(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
85
|
+
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function Add(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
89
|
+
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function Subtract(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
93
|
+
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function Multiply(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
97
|
+
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function Divide(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
101
|
+
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function Double(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
105
|
+
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function LessThan(inputs: OperandTemplateInputs): TemplateOutputs {
|
|
109
|
+
return resolveTemplateInstantiation(inputs, OPERAND_TYPE_ROLE_NAMES);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function BooleanIdentity(inputs: { In: Boolean }): { Out: Boolean } {
|
|
113
|
+
return {
|
|
114
|
+
Out: inputs.In,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function NaturalIdentity(inputs: { In: Natural }): { Out: Natural } {
|
|
119
|
+
return {
|
|
120
|
+
Out: inputs.In,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function NaturalLessThan(inputs: {
|
|
125
|
+
LessThanSource: Natural;
|
|
126
|
+
LessThanTarget: Natural;
|
|
127
|
+
}): { LessThanDecision: Boolean } {
|
|
128
|
+
return {
|
|
129
|
+
LessThanDecision: inputs.LessThanSource < inputs.LessThanTarget,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function NaturalAdd(inputs: {
|
|
134
|
+
AddendOne: Natural;
|
|
135
|
+
AddendTwo: Natural;
|
|
136
|
+
}): { Sum: Natural } {
|
|
137
|
+
return {
|
|
138
|
+
Sum: asNatural(inputs.AddendOne + inputs.AddendTwo, 'Sum'),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function NaturalSubtract(inputs: {
|
|
143
|
+
Minuend: Natural;
|
|
144
|
+
Subtrahend: Natural;
|
|
145
|
+
}): { Difference: Natural } {
|
|
146
|
+
return {
|
|
147
|
+
Difference: asNatural(inputs.Minuend - inputs.Subtrahend, 'Difference'),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function NaturalMultiply(inputs: {
|
|
152
|
+
Multiplicand: Natural;
|
|
153
|
+
Multiplier: Natural;
|
|
154
|
+
}): { Product: Natural } {
|
|
155
|
+
return {
|
|
156
|
+
Product: asNatural(inputs.Multiplicand * inputs.Multiplier, 'Product'),
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function NaturalDivide(inputs: {
|
|
161
|
+
Dividend: Natural;
|
|
162
|
+
Divisor: Natural;
|
|
163
|
+
}): { Quotient: Natural; Remainder: Natural } {
|
|
164
|
+
if (inputs.Divisor === 0) {
|
|
165
|
+
throw new Error('Divisor must be non-zero');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
Quotient: asNatural(Math.floor(inputs.Dividend / inputs.Divisor), 'Quotient'),
|
|
170
|
+
Remainder: asNatural(inputs.Dividend % inputs.Divisor, 'Remainder'),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function NaturalDouble(inputs: { N: Natural }): { Doubled: Natural } {
|
|
175
|
+
return {
|
|
176
|
+
Doubled: asNatural(inputs.N * 2, 'Doubled'),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export const TOOL_IMPLEMENTATION_BY_NAME = {
|
|
181
|
+
Identity,
|
|
182
|
+
Add,
|
|
183
|
+
Subtract,
|
|
184
|
+
Multiply,
|
|
185
|
+
Divide,
|
|
186
|
+
Double,
|
|
187
|
+
LessThan,
|
|
188
|
+
BooleanIdentity,
|
|
189
|
+
NaturalIdentity,
|
|
190
|
+
NaturalLessThan,
|
|
191
|
+
NaturalAdd,
|
|
192
|
+
NaturalSubtract,
|
|
193
|
+
NaturalMultiply,
|
|
194
|
+
NaturalDivide,
|
|
195
|
+
NaturalDouble,
|
|
196
|
+
} as const;
|
|
197
|
+
|
|
198
|
+
export const TOOL_IMPLEMENTATION_BY_HANDLE = {
|
|
199
|
+
'TOOL-Identity': Identity,
|
|
200
|
+
'TOOL-Add': Add,
|
|
201
|
+
'TOOL-Subtract': Subtract,
|
|
202
|
+
'TOOL-Multiply': Multiply,
|
|
203
|
+
'TOOL-Divide': Divide,
|
|
204
|
+
'TOOL-Double': Double,
|
|
205
|
+
'TOOL-LessThan': LessThan,
|
|
206
|
+
'TOOL-BooleanIdentity': BooleanIdentity,
|
|
207
|
+
'TOOL-NaturalIdentity': NaturalIdentity,
|
|
208
|
+
'TOOL-NaturalLessThan': NaturalLessThan,
|
|
209
|
+
'TOOL-NaturalAdd': NaturalAdd,
|
|
210
|
+
'TOOL-NaturalSubtract': NaturalSubtract,
|
|
211
|
+
'TOOL-NaturalMultiply': NaturalMultiply,
|
|
212
|
+
'TOOL-NaturalDivide': NaturalDivide,
|
|
213
|
+
'TOOL-NaturalDouble': NaturalDouble,
|
|
214
|
+
} as const;
|
|
@@ -37,6 +37,11 @@
|
|
|
37
37
|
"name": "launch.json",
|
|
38
38
|
"path": ".vscode/launch.json"
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
"kind": "file",
|
|
42
|
+
"name": "settings.json",
|
|
43
|
+
"path": ".vscode/settings.json"
|
|
44
|
+
},
|
|
40
45
|
{
|
|
41
46
|
"kind": "file",
|
|
42
47
|
"name": "tasks.json",
|
|
@@ -221,6 +226,19 @@
|
|
|
221
226
|
}
|
|
222
227
|
]
|
|
223
228
|
},
|
|
229
|
+
{
|
|
230
|
+
"kind": "directory",
|
|
231
|
+
"name": "cosmos",
|
|
232
|
+
"path": "packages/cosmos/src/components/cosmos",
|
|
233
|
+
"children": [
|
|
234
|
+
{
|
|
235
|
+
"kind": "directory",
|
|
236
|
+
"name": "recordings",
|
|
237
|
+
"path": "packages/cosmos/src/components/cosmos/recordings",
|
|
238
|
+
"children": []
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
},
|
|
224
242
|
{
|
|
225
243
|
"kind": "directory",
|
|
226
244
|
"name": "dom",
|
|
@@ -688,6 +706,11 @@
|
|
|
688
706
|
}
|
|
689
707
|
]
|
|
690
708
|
},
|
|
709
|
+
{
|
|
710
|
+
"kind": "file",
|
|
711
|
+
"name": ".env.local",
|
|
712
|
+
"path": "packages/cosmos/.env.local"
|
|
713
|
+
},
|
|
691
714
|
{
|
|
692
715
|
"kind": "file",
|
|
693
716
|
"name": ".gitignore",
|
|
@@ -698,11 +721,21 @@
|
|
|
698
721
|
"name": "eslint.config.mjs",
|
|
699
722
|
"path": "packages/cosmos/eslint.config.mjs"
|
|
700
723
|
},
|
|
724
|
+
{
|
|
725
|
+
"kind": "file",
|
|
726
|
+
"name": "gcp-key.json",
|
|
727
|
+
"path": "packages/cosmos/gcp-key.json"
|
|
728
|
+
},
|
|
701
729
|
{
|
|
702
730
|
"kind": "file",
|
|
703
731
|
"name": "globals.d.ts",
|
|
704
732
|
"path": "packages/cosmos/globals.d.ts"
|
|
705
733
|
},
|
|
734
|
+
{
|
|
735
|
+
"kind": "file",
|
|
736
|
+
"name": "next-env.d.ts",
|
|
737
|
+
"path": "packages/cosmos/next-env.d.ts"
|
|
738
|
+
},
|
|
706
739
|
{
|
|
707
740
|
"kind": "file",
|
|
708
741
|
"name": "next.config.ts",
|
|
@@ -1042,11 +1075,21 @@
|
|
|
1042
1075
|
"name": ".dockerignore",
|
|
1043
1076
|
"path": "packages/engine/.dockerignore"
|
|
1044
1077
|
},
|
|
1078
|
+
{
|
|
1079
|
+
"kind": "file",
|
|
1080
|
+
"name": ".env",
|
|
1081
|
+
"path": "packages/engine/.env"
|
|
1082
|
+
},
|
|
1045
1083
|
{
|
|
1046
1084
|
"kind": "file",
|
|
1047
1085
|
"name": ".gitignore",
|
|
1048
1086
|
"path": "packages/engine/.gitignore"
|
|
1049
1087
|
},
|
|
1088
|
+
{
|
|
1089
|
+
"kind": "file",
|
|
1090
|
+
"name": "gcp-key.json",
|
|
1091
|
+
"path": "packages/engine/gcp-key.json"
|
|
1092
|
+
},
|
|
1050
1093
|
{
|
|
1051
1094
|
"kind": "file",
|
|
1052
1095
|
"name": "langgraph.json",
|
|
@@ -1061,6 +1104,11 @@
|
|
|
1061
1104
|
"kind": "file",
|
|
1062
1105
|
"name": "tsconfig.json",
|
|
1063
1106
|
"path": "packages/engine/tsconfig.json"
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
"kind": "file",
|
|
1110
|
+
"name": "tsconfig.tsbuildinfo",
|
|
1111
|
+
"path": "packages/engine/tsconfig.tsbuildinfo"
|
|
1064
1112
|
}
|
|
1065
1113
|
]
|
|
1066
1114
|
},
|
|
@@ -1356,6 +1404,11 @@
|
|
|
1356
1404
|
"kind": "file",
|
|
1357
1405
|
"name": "tsconfig.json",
|
|
1358
1406
|
"path": "packages/language-server/tsconfig.json"
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"kind": "file",
|
|
1410
|
+
"name": "tsconfig.tsbuildinfo",
|
|
1411
|
+
"path": "packages/language-server/tsconfig.tsbuildinfo"
|
|
1359
1412
|
}
|
|
1360
1413
|
]
|
|
1361
1414
|
},
|
|
@@ -1497,6 +1550,11 @@
|
|
|
1497
1550
|
"kind": "file",
|
|
1498
1551
|
"name": "tsconfig.json",
|
|
1499
1552
|
"path": "packages/lib/tsconfig.json"
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
"kind": "file",
|
|
1556
|
+
"name": "tsconfig.tsbuildinfo",
|
|
1557
|
+
"path": "packages/lib/tsconfig.tsbuildinfo"
|
|
1500
1558
|
}
|
|
1501
1559
|
]
|
|
1502
1560
|
},
|
|
@@ -1609,6 +1667,11 @@
|
|
|
1609
1667
|
"kind": "file",
|
|
1610
1668
|
"name": "tsconfig.json",
|
|
1611
1669
|
"path": "packages/persistence/tsconfig.json"
|
|
1670
|
+
},
|
|
1671
|
+
{
|
|
1672
|
+
"kind": "file",
|
|
1673
|
+
"name": "tsconfig.tsbuildinfo",
|
|
1674
|
+
"path": "packages/persistence/tsconfig.tsbuildinfo"
|
|
1612
1675
|
}
|
|
1613
1676
|
]
|
|
1614
1677
|
},
|
|
@@ -1686,6 +1749,11 @@
|
|
|
1686
1749
|
"kind": "file",
|
|
1687
1750
|
"name": "tsconfig.json",
|
|
1688
1751
|
"path": "packages/validation/tsconfig.json"
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
"kind": "file",
|
|
1755
|
+
"name": "tsconfig.tsbuildinfo",
|
|
1756
|
+
"path": "packages/validation/tsconfig.tsbuildinfo"
|
|
1689
1757
|
}
|
|
1690
1758
|
]
|
|
1691
1759
|
},
|
|
@@ -1756,6 +1824,11 @@
|
|
|
1756
1824
|
"kind": "file",
|
|
1757
1825
|
"name": "tsconfig.json",
|
|
1758
1826
|
"path": "packages/visualization/tsconfig.json"
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
"kind": "file",
|
|
1830
|
+
"name": "tsconfig.tsbuildinfo",
|
|
1831
|
+
"path": "packages/visualization/tsconfig.tsbuildinfo"
|
|
1759
1832
|
}
|
|
1760
1833
|
]
|
|
1761
1834
|
},
|
|
@@ -1817,6 +1890,11 @@
|
|
|
1817
1890
|
"kind": "file",
|
|
1818
1891
|
"name": "tsconfig.json",
|
|
1819
1892
|
"path": "packages/vscode-extension/tsconfig.json"
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
"kind": "file",
|
|
1896
|
+
"name": "tsconfig.tsbuildinfo",
|
|
1897
|
+
"path": "packages/vscode-extension/tsconfig.tsbuildinfo"
|
|
1820
1898
|
}
|
|
1821
1899
|
]
|
|
1822
1900
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolproof-core/genesis",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.52",
|
|
4
4
|
"description": "Core ToolProof ontology, schemas, declarations, implementations, and generated type artifacts.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -20,13 +20,21 @@
|
|
|
20
20
|
"keywords": [],
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "ISC",
|
|
23
|
-
"packageManager": "pnpm@10.15.0",
|
|
24
23
|
"publishConfig": {
|
|
25
24
|
"access": "public"
|
|
26
25
|
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"zod": "^4.3.6"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^20.8.1",
|
|
31
|
+
"json-schema-to-typescript": "^15.0.4",
|
|
32
|
+
"rimraf": "^5.0.0",
|
|
33
|
+
"typescript": "^5.9.3"
|
|
34
|
+
},
|
|
27
35
|
"scripts": {
|
|
28
36
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
29
|
-
"
|
|
37
|
+
"update-and-build": "pnpm run update && pnpm run build",
|
|
30
38
|
"build": "tsc -b",
|
|
31
39
|
"build:scripts": "tsc -p tsconfig.scripts.json",
|
|
32
40
|
"normalizeAnchorsToPointers": "node ./dist/scripts/normalizeAnchorsToPointers.js",
|
|
@@ -44,14 +52,5 @@
|
|
|
44
52
|
"generateTypes": "node ./dist/scripts/generateTypes.js",
|
|
45
53
|
"generateStandaloneTypes": "node ./dist/scripts/generateStandaloneTypes.js",
|
|
46
54
|
"update": "rimraf dist generated-src tsconfig.tsbuildinfo && pnpm run build:scripts && pnpm run normalizeAnchorsToPointers && pnpm run generateConstantsAndMappings && pnpm run generateStandaloneSchemas && pnpm run generateStandaloneZodSchemas && pnpm run generateDeclarations && pnpm run generateTimestampedResources && pnpm run generateSchemaShims && pnpm run generateTypes && pnpm run generateImplementations && pnpm run generateStandaloneTypes && pnpm run generateDependencies && pnpm run generateTerminals && pnpm run generateCoreProjection"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"zod": "^4.3.6"
|
|
50
|
-
},
|
|
51
|
-
"devDependencies": {
|
|
52
|
-
"@types/node": "^20.8.1",
|
|
53
|
-
"json-schema-to-typescript": "^15.0.4",
|
|
54
|
-
"rimraf": "^5.0.0",
|
|
55
|
-
"typescript": "^5.9.3"
|
|
56
55
|
}
|
|
57
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
2
|
-
false,
|
|
3
|
-
true
|
|
1
|
+
[
|
|
2
|
+
false,
|
|
3
|
+
true
|
|
4
4
|
]
|