@toolproof-core/lib 1.0.29 → 1.0.30
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/artifacts/artifacts.d.ts +175 -0
- package/dist/integrations/firebase/createRunnableStrategy.d.ts +3 -0
- package/dist/integrations/firebase/createStep.d.ts +11 -0
- package/dist/integrations/firebase/firebaseAdminInit.d.ts +4 -0
- package/dist/integrations/firebase/firebaseAdminInit.d.ts.map +1 -0
- package/dist/integrations/firebase/firebaseAdminInit.js +33 -0
- package/dist/integrations/firebase/firebaseAdminInit.js.map +1 -0
- package/dist/types/types.d.ts +18 -0
- package/dist/utils/bindInputRoleToResource.d.ts +5 -0
- package/dist/utils/creation/runnableStrategyCreation.d.ts +4 -0
- package/dist/utils/creation/stepCreation.d.ts +34 -0
- package/dist/utils/parallelizeSteps.d.ts +3 -0
- package/dist/utils/resolveResourceChain.d.ts +23 -0
- package/package.json +1 -1
- package/toolproof-core-lib-1.0.27.tgz +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
export declare const CONSTANTS: {
|
|
2
|
+
readonly Persistence: {
|
|
3
|
+
readonly Buckets: {
|
|
4
|
+
readonly tp_resources: "tp-resources";
|
|
5
|
+
readonly tp_strategies: "tp-strategies";
|
|
6
|
+
};
|
|
7
|
+
readonly Collections: {
|
|
8
|
+
readonly resources: "resources";
|
|
9
|
+
readonly members: "members";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly Engine: {
|
|
13
|
+
readonly Graphs: {
|
|
14
|
+
readonly GraphRunStrategy: "GraphRunStrategy";
|
|
15
|
+
readonly GraphBuildStrategy: "GraphBuildStrategy";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly Cosmos: {
|
|
19
|
+
readonly TYPE_Boolean: "TYPE-Boolean";
|
|
20
|
+
readonly TYPE_Natural: "TYPE-Natural";
|
|
21
|
+
readonly TYPE_ResourceType: "TYPE-ResourceType";
|
|
22
|
+
readonly TYPE_Tool: "TYPE-Tool";
|
|
23
|
+
readonly TYPE_Error: "TYPE-Error";
|
|
24
|
+
readonly TYPE_RawStrategy: "TYPE-RawStrategy";
|
|
25
|
+
readonly TYPE_RunnableStrategy: "TYPE-RunnableStrategy";
|
|
26
|
+
readonly TYPE_StrategyRun: "TYPE-StrategyRun";
|
|
27
|
+
readonly ROLE_Manual: "ROLE-Manual";
|
|
28
|
+
readonly ROLE_ErrorOutput: "ROLE-ErrorOutput";
|
|
29
|
+
readonly ROLE_BooleanBoomerangIn: "ROLE-BooleanBoomerangIn";
|
|
30
|
+
readonly ROLE_BooleanBoomerangOut: "ROLE-BooleanBoomerangOut";
|
|
31
|
+
readonly ROLE_LessThanSource: "ROLE-LessThanSource";
|
|
32
|
+
readonly ROLE_LessThanTarget: "ROLE-LessThanTarget";
|
|
33
|
+
readonly ROLE_LessThanDecision: "ROLE-LessThanDecision";
|
|
34
|
+
readonly TOOL_BooleanBoomerang: "TOOL-BooleanBoomerang";
|
|
35
|
+
readonly TOOL_LessThan: "TOOL-LessThan";
|
|
36
|
+
readonly TOOL_BuilderCreateToolStep: "TOOL-BuilderCreateToolStep";
|
|
37
|
+
readonly TOOL_BuilderCreateCase: "TOOL-BuilderCreateCase";
|
|
38
|
+
readonly TOOL_BuilderCreateBranchStep: "TOOL-BuilderCreateBranchStep";
|
|
39
|
+
readonly TOOL_BuilderCreateForStep: "TOOL-BuilderCreateForStep";
|
|
40
|
+
readonly TOOL_BuilderCreateWhileStep: "TOOL-BuilderCreateWhileStep";
|
|
41
|
+
};
|
|
42
|
+
readonly Names: {
|
|
43
|
+
readonly Boolean: "Boolean";
|
|
44
|
+
readonly BranchStep: "BranchStep";
|
|
45
|
+
readonly BranchStepId: "BranchStepId";
|
|
46
|
+
readonly Case: "Case";
|
|
47
|
+
readonly CreationContext: "CreationContext";
|
|
48
|
+
readonly CreationContextFacet: "CreationContextFacet";
|
|
49
|
+
readonly Description: "Description";
|
|
50
|
+
readonly DescriptionFacet: "DescriptionFacet";
|
|
51
|
+
readonly DocumentationSpec: "DocumentationSpec";
|
|
52
|
+
readonly Error: "Error";
|
|
53
|
+
readonly ExternalInputPotentialShell: "ExternalInputPotentialShell";
|
|
54
|
+
readonly ForStep: "ForStep";
|
|
55
|
+
readonly ForStepId: "ForStepId";
|
|
56
|
+
readonly Goal: "Goal";
|
|
57
|
+
readonly GoalId: "GoalId";
|
|
58
|
+
readonly GraphEndRunEvent: "GraphEndRunEvent";
|
|
59
|
+
readonly GraphStartRunEvent: "GraphStartRunEvent";
|
|
60
|
+
readonly InternalInputPotentialShell: "InternalInputPotentialShell";
|
|
61
|
+
readonly InterruptRunEvent: "InterruptRunEvent";
|
|
62
|
+
readonly MaterializedShell: "MaterializedShell";
|
|
63
|
+
readonly MaterializedShellBase: "MaterializedShellBase";
|
|
64
|
+
readonly Name: "Name";
|
|
65
|
+
readonly NameFacet: "NameFacet";
|
|
66
|
+
readonly Natural: "Natural";
|
|
67
|
+
readonly Nucleus: "Nucleus";
|
|
68
|
+
readonly NucleusFacet: "NucleusFacet";
|
|
69
|
+
readonly OutputPotentialShell: "OutputPotentialShell";
|
|
70
|
+
readonly Path: "Path";
|
|
71
|
+
readonly PathFacet: "PathFacet";
|
|
72
|
+
readonly RawStrategy: "RawStrategy";
|
|
73
|
+
readonly Recognizer: "Recognizer";
|
|
74
|
+
readonly RecognizerId: "RecognizerId";
|
|
75
|
+
readonly Resource: "Resource";
|
|
76
|
+
readonly ResourceId: "ResourceId";
|
|
77
|
+
readonly ResourceLikeByRole: "ResourceLikeByRole";
|
|
78
|
+
readonly ResourcePotential: "ResourcePotential";
|
|
79
|
+
readonly ResourceRole: "ResourceRole";
|
|
80
|
+
readonly ResourceRoleId: "ResourceRoleId";
|
|
81
|
+
readonly ResourceRoleValue: "ResourceRoleValue";
|
|
82
|
+
readonly ResourceShellBase: "ResourceShellBase";
|
|
83
|
+
readonly ResourceShellKind: "ResourceShellKind";
|
|
84
|
+
readonly ResourceShellKindFacet: "ResourceShellKindFacet";
|
|
85
|
+
readonly ResourceType: "ResourceType";
|
|
86
|
+
readonly ResourceTypeId: "ResourceTypeId";
|
|
87
|
+
readonly RoleBindingArray: "RoleBindingArray";
|
|
88
|
+
readonly RoleBindingSpec: "RoleBindingSpec";
|
|
89
|
+
readonly RoleBindingSpecFacet: "RoleBindingSpecFacet";
|
|
90
|
+
readonly RoleSpec: "RoleSpec";
|
|
91
|
+
readonly RoleSpecFacet: "RoleSpecFacet";
|
|
92
|
+
readonly RoleValueById: "RoleValueById";
|
|
93
|
+
readonly RunEvent: "RunEvent";
|
|
94
|
+
readonly RunEventBase: "RunEventBase";
|
|
95
|
+
readonly RunEventCounterSnapshot: "RunEventCounterSnapshot";
|
|
96
|
+
readonly RunEventDelta: "RunEventDelta";
|
|
97
|
+
readonly RunEventKind: "RunEventKind";
|
|
98
|
+
readonly RunEventStepMetadata: "RunEventStepMetadata";
|
|
99
|
+
readonly RunnableStrategy: "RunnableStrategy";
|
|
100
|
+
readonly RunnableStrategyFacet: "RunnableStrategyFacet";
|
|
101
|
+
readonly RunnableStrategyId: "RunnableStrategyId";
|
|
102
|
+
readonly Step: "Step";
|
|
103
|
+
readonly StepArray: "StepArray";
|
|
104
|
+
readonly StepArrayByStrategyThread: "StepArrayByStrategyThread";
|
|
105
|
+
readonly StepId: "StepId";
|
|
106
|
+
readonly StepKind: "StepKind";
|
|
107
|
+
readonly StepKindFacet: "StepKindFacet";
|
|
108
|
+
readonly StepsByStrategyThreadFacet: "StepsByStrategyThreadFacet";
|
|
109
|
+
readonly StepsFacet: "StepsFacet";
|
|
110
|
+
readonly StrategyRun: "StrategyRun";
|
|
111
|
+
readonly StrategyRunId: "StrategyRunId";
|
|
112
|
+
readonly StrategyState: "StrategyState";
|
|
113
|
+
readonly StrategyStateFacet: "StrategyStateFacet";
|
|
114
|
+
readonly StrategyThreadId: "StrategyThreadId";
|
|
115
|
+
readonly TickRunEvent: "TickRunEvent";
|
|
116
|
+
readonly Timestamp: "Timestamp";
|
|
117
|
+
readonly TimestampFacet: "TimestampFacet";
|
|
118
|
+
readonly Tool: "Tool";
|
|
119
|
+
readonly ToolId: "ToolId";
|
|
120
|
+
readonly ToolKind: "ToolKind";
|
|
121
|
+
readonly ToolStep: "ToolStep";
|
|
122
|
+
readonly ToolStepId: "ToolStepId";
|
|
123
|
+
readonly Uri: "Uri";
|
|
124
|
+
readonly WhileStep: "WhileStep";
|
|
125
|
+
readonly WhileStepId: "WhileStepId";
|
|
126
|
+
};
|
|
127
|
+
readonly Enums: {
|
|
128
|
+
readonly ResourceShellKind: {
|
|
129
|
+
readonly externalInputPotential: "externalInputPotential";
|
|
130
|
+
readonly internalInputPotential: "internalInputPotential";
|
|
131
|
+
readonly outputPotential: "outputPotential";
|
|
132
|
+
readonly materialized: "materialized";
|
|
133
|
+
};
|
|
134
|
+
readonly RunEventKind: {
|
|
135
|
+
readonly graph_start: "graph_start";
|
|
136
|
+
readonly tick: "tick";
|
|
137
|
+
readonly interrupt: "interrupt";
|
|
138
|
+
readonly graph_end: "graph_end";
|
|
139
|
+
};
|
|
140
|
+
readonly StepKind: {
|
|
141
|
+
readonly tool: "tool";
|
|
142
|
+
readonly branch: "branch";
|
|
143
|
+
readonly while: "while";
|
|
144
|
+
readonly for: "for";
|
|
145
|
+
};
|
|
146
|
+
readonly ToolKind: {
|
|
147
|
+
readonly runtime: "runtime";
|
|
148
|
+
readonly buildtime: "buildtime";
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
export declare const MAPPINGS: {
|
|
153
|
+
readonly IdNameToIdPrefix: {
|
|
154
|
+
readonly BranchStepId: "BRANCH_STEP-";
|
|
155
|
+
readonly ForStepId: "FOR_STEP-";
|
|
156
|
+
readonly GoalId: "GOAL-";
|
|
157
|
+
readonly RecognizerId: "RECOGNIZER-";
|
|
158
|
+
readonly ResourceId: "RESOURCE-";
|
|
159
|
+
readonly ResourceRoleId: "ROLE-";
|
|
160
|
+
readonly ResourceTypeId: "TYPE-";
|
|
161
|
+
readonly RunnableStrategyId: "RUNNABLE_STRATEGY-";
|
|
162
|
+
readonly StrategyRunId: "STRATEGY_RUN-";
|
|
163
|
+
readonly StrategyThreadId: "STRATEGY_THREAD-";
|
|
164
|
+
readonly ToolId: "TOOL-";
|
|
165
|
+
readonly ToolStepId: "TOOL_STEP-";
|
|
166
|
+
readonly WhileStepId: "WHILE_STEP-";
|
|
167
|
+
};
|
|
168
|
+
readonly StepKindToStepIdPrefix: {
|
|
169
|
+
readonly branch: "BRANCH_STEP-";
|
|
170
|
+
readonly for: "FOR_STEP-";
|
|
171
|
+
readonly tool: "TOOL_STEP-";
|
|
172
|
+
readonly while: "WHILE_STEP-";
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BranchStepJson, ForStepJson, ToolJson, ToolStepJson, WhileStepJson } from '@toolproof-core/schema';
|
|
2
|
+
import { CONSTANTS } from '../../artifacts/artifacts.js';
|
|
3
|
+
export declare function createToolStepFromTool(tool: ToolJson): ToolStepJson;
|
|
4
|
+
export declare function createLoopStepFromToolPair(whatTool: ToolJson, whenTool: ToolJson, stepKind: typeof CONSTANTS.Enums.StepKind.for | typeof CONSTANTS.Enums.StepKind.while): ForStepJson | WhileStepJson;
|
|
5
|
+
export declare function createBranchStepFromToolPairs(cases: Array<{
|
|
6
|
+
whatTool: ToolJson;
|
|
7
|
+
whenTool: ToolJson;
|
|
8
|
+
}>): BranchStepJson;
|
|
9
|
+
export declare function cloneForStep(forStep: ForStepJson): ForStepJson;
|
|
10
|
+
export declare function cloneWhileStep(whileStep: WhileStepJson): WhileStepJson;
|
|
11
|
+
//# sourceMappingURL=createStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebaseAdminInit.d.ts","sourceRoot":"","sources":["../../../src/integrations/firebase/firebaseAdminInit.ts"],"names":[],"mappings":"AAmCA,QAAA,MAAM,OAAO,6BAAoB,CAAC;AAClC,QAAA,MAAM,YAAY,0CAAkB,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getApp, getApps, initializeApp, applicationDefault, cert } from 'firebase-admin/app';
|
|
2
|
+
import { getFirestore } from 'firebase-admin/firestore';
|
|
3
|
+
import { getStorage } from 'firebase-admin/storage';
|
|
4
|
+
import { existsSync, readFileSync } from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
function resolveCredential() {
|
|
7
|
+
const jsonString = process.env.GOOGLE_APPLICATION_CREDENTIALS_JSON;
|
|
8
|
+
const envPath = process.env.GOOGLE_APPLICATION_CREDENTIALS;
|
|
9
|
+
const localKeyPath = path.join(process.cwd(), 'gcp-key.json');
|
|
10
|
+
try {
|
|
11
|
+
if (jsonString) {
|
|
12
|
+
return cert(JSON.parse(jsonString));
|
|
13
|
+
}
|
|
14
|
+
if (envPath && existsSync(envPath)) {
|
|
15
|
+
return cert(JSON.parse(readFileSync(envPath, 'utf8')));
|
|
16
|
+
}
|
|
17
|
+
if (existsSync(localKeyPath)) {
|
|
18
|
+
return cert(JSON.parse(readFileSync(localKeyPath, 'utf8')));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return applicationDefault();
|
|
23
|
+
}
|
|
24
|
+
return applicationDefault();
|
|
25
|
+
}
|
|
26
|
+
const app = getApps().length ? getApp() : initializeApp({
|
|
27
|
+
credential: resolveCredential(),
|
|
28
|
+
projectId: 'toolproof-563fe',
|
|
29
|
+
});
|
|
30
|
+
const dbAdmin = getFirestore(app);
|
|
31
|
+
const storageAdmin = getStorage(app);
|
|
32
|
+
export { dbAdmin, storageAdmin };
|
|
33
|
+
//# sourceMappingURL=firebaseAdminInit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebaseAdminInit.js","sourceRoot":"","sources":["../../../src/integrations/firebase/firebaseAdminInit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,SAAS,iBAAiB;IACtB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC;IACnE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;IAC3D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;IAE9D,IAAI,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACxC,CAAC;QAED,IAAI,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,kBAAkB,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,kBAAkB,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;IACpD,UAAU,EAAE,iBAAiB,EAAE;IAC/B,SAAS,EAAE,iBAAiB;CAC/B,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;AAClC,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StepKindJson, ResourceJson, ResourceTypeIdJson } from '@toolproof-core/schema';
|
|
2
|
+
import { CONSTANTS } from '../artifacts/artifacts.js';
|
|
3
|
+
import { MAPPINGS } from '../artifacts/artifacts.js';
|
|
4
|
+
export type Bucket = typeof CONSTANTS.Persistence.Buckets.tp_resources;
|
|
5
|
+
export type Collection = keyof typeof CONSTANTS.Persistence.Collections;
|
|
6
|
+
export type SchemaLike = Record<string, unknown>;
|
|
7
|
+
export type ResourcesByType = Record<ResourceTypeIdJson, ResourceJson[]>;
|
|
8
|
+
export type IdName = keyof typeof MAPPINGS.IdNameToIdPrefix;
|
|
9
|
+
export type IdStringByIdName<K extends IdName> = `${(typeof MAPPINGS.IdNameToIdPrefix)[K]}${string}`;
|
|
10
|
+
export type StepIdStringByStepKind<K extends StepKindJson> = `${(typeof MAPPINGS.StepKindToStepIdPrefix)[K]}${string}`;
|
|
11
|
+
export interface NucleusBaseSmall<T extends string = string> {
|
|
12
|
+
id: T;
|
|
13
|
+
}
|
|
14
|
+
export interface NucleusBaseLarge<T extends string = string> extends NucleusBaseSmall<T> {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CreationContextJson, ResourceJson, StrategyStateJson } from '@toolproof-core/schema';
|
|
2
|
+
export declare function bindInputResInStrategyState(strategyState: StrategyStateJson, target: CreationContextJson, resource: ResourceJson): StrategyStateJson;
|
|
3
|
+
export declare function bindInputRefInStrategyState(strategyState: StrategyStateJson, target: CreationContextJson, source: CreationContextJson): StrategyStateJson;
|
|
4
|
+
export declare function clearInputBindingInStrategyState(strategyState: StrategyStateJson, target: CreationContextJson): StrategyStateJson;
|
|
5
|
+
//# sourceMappingURL=bindInputRoleToResource.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RawStrategyJson, RunnableStrategyIdJson, RunnableStrategyJson, StepJson, StrategyThreadIdJson } from '@toolproof-core/schema';
|
|
2
|
+
export declare function getRunnableStrategyThreadGroups(rawStrategy: RawStrategyJson): StepJson[][];
|
|
3
|
+
export declare function buildRunnableStrategy(rawStrategy: RawStrategyJson, runnableStrategyId: RunnableStrategyIdJson, threadStepGroups: StepJson[][], threadIdentities: StrategyThreadIdJson[]): RunnableStrategyJson;
|
|
4
|
+
//# sourceMappingURL=runnableStrategyCreation.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { BranchStepIdJson, BranchStepJson, ForStepIdJson, ForStepJson, ToolJson, ToolStepIdJson, ToolStepJson, WhileStepIdJson, WhileStepJson } from '@toolproof-core/schema';
|
|
2
|
+
import { CONSTANTS } from '../../artifacts/artifacts.js';
|
|
3
|
+
export type LoopStepBuildIdentities = {
|
|
4
|
+
stepKind: typeof CONSTANTS.Enums.StepKind.for;
|
|
5
|
+
stepId: ForStepIdJson;
|
|
6
|
+
whatId: ToolStepIdJson;
|
|
7
|
+
whenId: ToolStepIdJson;
|
|
8
|
+
} | {
|
|
9
|
+
stepKind: typeof CONSTANTS.Enums.StepKind.while;
|
|
10
|
+
stepId: WhileStepIdJson;
|
|
11
|
+
whatId: ToolStepIdJson;
|
|
12
|
+
whenId: ToolStepIdJson;
|
|
13
|
+
};
|
|
14
|
+
export type BranchCaseBuildIdentities = {
|
|
15
|
+
whatId: ToolStepIdJson;
|
|
16
|
+
whenId: ToolStepIdJson;
|
|
17
|
+
};
|
|
18
|
+
export declare function buildToolStepFromTool(tool: ToolJson, id: ToolStepIdJson): ToolStepJson;
|
|
19
|
+
export declare function buildLoopStepFromToolPair(whatTool: ToolJson, whenTool: ToolJson, identities: LoopStepBuildIdentities): ForStepJson | WhileStepJson;
|
|
20
|
+
export declare function buildBranchStepFromToolPairs(cases: Array<{
|
|
21
|
+
whatTool: ToolJson;
|
|
22
|
+
whenTool: ToolJson;
|
|
23
|
+
}>, branchId: BranchStepIdJson, caseIdentities: BranchCaseBuildIdentities[]): BranchStepJson;
|
|
24
|
+
export declare function cloneForStepWithIdentities(forStep: ForStepJson, identities: {
|
|
25
|
+
stepId: ForStepIdJson;
|
|
26
|
+
whatId: ToolStepIdJson;
|
|
27
|
+
whenId: ToolStepIdJson;
|
|
28
|
+
}): ForStepJson;
|
|
29
|
+
export declare function cloneWhileStepWithIdentities(whileStep: WhileStepJson, identities: {
|
|
30
|
+
stepId: WhileStepIdJson;
|
|
31
|
+
whatId: ToolStepIdJson;
|
|
32
|
+
whenId: ToolStepIdJson;
|
|
33
|
+
}): WhileStepJson;
|
|
34
|
+
//# sourceMappingURL=stepCreation.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CreationContextJson, ExternalInputPotentialShellJson, OutputPotentialShellJson, ResourceJson, StrategyStateJson } from '@toolproof-core/schema';
|
|
2
|
+
import { CONSTANTS } from '../artifacts/artifacts.js';
|
|
3
|
+
export type ResolveResult = {
|
|
4
|
+
status: typeof CONSTANTS.Enums.ResourceShellKind.materialized;
|
|
5
|
+
entry: ResourceJson;
|
|
6
|
+
path: CreationContextJson[];
|
|
7
|
+
} | {
|
|
8
|
+
status: typeof CONSTANTS.Enums.ResourceShellKind.externalInputPotential;
|
|
9
|
+
entry: ExternalInputPotentialShellJson;
|
|
10
|
+
path: CreationContextJson[];
|
|
11
|
+
} | {
|
|
12
|
+
status: typeof CONSTANTS.Enums.ResourceShellKind.outputPotential;
|
|
13
|
+
entry: OutputPotentialShellJson;
|
|
14
|
+
path: CreationContextJson[];
|
|
15
|
+
} | {
|
|
16
|
+
status: 'unresolved';
|
|
17
|
+
reason: 'not-found' | 'cycle' | 'depth-exceeded';
|
|
18
|
+
path: CreationContextJson[];
|
|
19
|
+
};
|
|
20
|
+
export declare function resolveResourceChain(strategyState: StrategyStateJson, start: CreationContextJson, opts?: {
|
|
21
|
+
maxDepth?: number;
|
|
22
|
+
}): ResolveResult;
|
|
23
|
+
//# sourceMappingURL=resolveResourceChain.d.ts.map
|
package/package.json
CHANGED
|
Binary file
|