@toolproof-core/lib 1.0.27 → 1.0.28

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.
@@ -0,0 +1,3 @@
1
+ import type { RawStrategyJson, RunnableStrategyJson } from '@toolproof-core/schema';
2
+ export declare function createRunnableStrategy(rawStrategy: RawStrategyJson): RunnableStrategyJson;
3
+ //# sourceMappingURL=createRunnableStrategy.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,4 @@
1
+ declare const dbAdmin: FirebaseFirestore.Firestore;
2
+ declare const storageAdmin: import("firebase-admin/storage").Storage;
3
+ export { dbAdmin, storageAdmin };
4
+ //# sourceMappingURL=firebaseAdminInit.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,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,3 @@
1
+ import type { StepJson, StrategyStateJson } from '@toolproof-core/schema';
2
+ export declare function getIndependentThreads(steps: StepJson[], strategyState: StrategyStateJson): StepJson[][];
3
+ //# sourceMappingURL=parallelizeSteps.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolproof-core/lib",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "keywords": [],
Binary file