@sequenceholdings/managed-functions 0.4.5 → 0.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/README.md +147 -12
- package/dist/abrigo-contract.d.ts +2 -92
- package/dist/abrigo-contract.js +12 -53
- package/dist/abrigo-response.d.ts +1 -6
- package/dist/abrigo-response.js +3 -25
- package/dist/abrigo.d.ts +5 -5
- package/dist/abrigo.js +66 -92
- package/dist/agent-evidence.d.ts +5 -5
- package/dist/agent-evidence.js +58 -48
- package/dist/agent-source-evidence-contract.d.ts +2 -1197
- package/dist/agent-source-evidence-contract.js +24 -94
- package/dist/agents-contract.d.ts +2 -99
- package/dist/agents-contract.js +13 -67
- package/dist/agents.d.ts +5 -5
- package/dist/agents.js +79 -44
- package/dist/capabilities.d.ts +1 -1
- package/dist/capabilities.js +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +4 -1
- package/dist/directory-config.d.ts +1 -23
- package/dist/directory-config.js +8 -20
- package/dist/directory-contract.d.ts +2 -68
- package/dist/directory-contract.js +13 -55
- package/dist/directory-roster-contract.d.ts +2 -22
- package/dist/directory-roster-contract.js +7 -22
- package/dist/directory.d.ts +4 -8
- package/dist/directory.js +15 -33
- package/dist/group-roster-access.d.ts +7 -0
- package/dist/group-roster-access.js +8 -0
- package/dist/index.d.ts +49 -46
- package/dist/index.js +8 -1
- package/dist/invocation-client.d.ts +4 -4
- package/dist/invocation-client.js +32 -60
- package/dist/invocation-contract.d.ts +2 -59
- package/dist/invocation-contract.js +10 -61
- package/dist/invocation.d.ts +4 -4
- package/dist/invocation.js +42 -63
- package/dist/lattice-provenance-contract.d.ts +2 -607
- package/dist/lattice-provenance-contract.js +14 -154
- package/dist/lattice-provenance.d.ts +3 -3
- package/dist/lattice-provenance.js +46 -97
- package/dist/monitoring-annotations.d.ts +2 -53
- package/dist/monitoring-annotations.js +2 -51
- package/dist/monitoring-contract.d.ts +5 -460
- package/dist/monitoring-contract.js +37 -77
- package/dist/monitoring-events.d.ts +2 -252
- package/dist/monitoring-events.js +15 -125
- package/dist/monitoring.d.ts +3 -3
- package/dist/monitoring.js +41 -41
- package/dist/orm.d.ts +10 -1
- package/dist/orm.js +27 -7
- package/dist/platform-client.d.ts +27 -0
- package/dist/platform-client.js +79 -0
- package/dist/platform-domains.d.ts +1671 -0
- package/dist/platform-domains.js +77 -0
- package/dist/processes-contract.d.ts +2 -149
- package/dist/processes-contract.js +17 -100
- package/dist/processes.d.ts +3 -3
- package/dist/processes.js +64 -49
- package/dist/runtime.cjs +4251 -1666
- package/dist/service-directory-roster.d.ts +12 -3
- package/dist/service-directory-roster.js +11 -17
- package/dist/service-directory.d.ts +4 -8
- package/dist/service-directory.js +16 -67
- package/dist/storage.d.ts +36 -35
- package/dist/storage.js +12 -5
- package/dist/workflow-source-contract.d.ts +2 -524
- package/dist/workflow-source-contract.js +16 -56
- package/dist/workflow-source.d.ts +3 -3
- package/dist/workflow-source.js +106 -43
- package/package.json +4 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type FunctionPlatformDomains } from "./platform-domains";
|
|
2
|
+
import { type FunctionServiceDirectoryClient } from "./service-directory";
|
|
3
|
+
import { type FunctionServiceProcessesClient } from "./processes";
|
|
4
|
+
import { type FunctionLatticeClient } from "./lattice-provenance";
|
|
5
|
+
import { type FunctionInvocationClient } from "./invocation";
|
|
6
|
+
import type { FunctionInvocationClientOptions } from "./invocation-client";
|
|
7
|
+
export type FunctionPlatformClientOptions = FunctionInvocationClientOptions;
|
|
8
|
+
export interface FunctionPlatformClient extends Omit<FunctionPlatformDomains, "callerDirectory"> {
|
|
9
|
+
directory: FunctionServiceDirectoryClient & {
|
|
10
|
+
caller: FunctionPlatformDomains["callerDirectory"];
|
|
11
|
+
};
|
|
12
|
+
lattice: {
|
|
13
|
+
runs: {
|
|
14
|
+
get: FunctionServiceProcessesClient["getRun"];
|
|
15
|
+
listPage: FunctionServiceProcessesClient["listRunsPage"];
|
|
16
|
+
};
|
|
17
|
+
completedNodes: {
|
|
18
|
+
get: FunctionServiceProcessesClient["getCompletedNode"];
|
|
19
|
+
};
|
|
20
|
+
getCompletedAgentReference: FunctionServiceProcessesClient["getCompletedAgentReference"];
|
|
21
|
+
execution: Omit<FunctionLatticeClient, "getExecutionContext"> & {
|
|
22
|
+
getContext: FunctionLatticeClient["getExecutionContext"];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
invocation: FunctionInvocationClient;
|
|
26
|
+
}
|
|
27
|
+
export declare function createFunctionPlatformClient(options: FunctionPlatformClientOptions): FunctionPlatformClient;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFunctionPlatformClient = createFunctionPlatformClient;
|
|
4
|
+
const platform_domains_1 = require("./platform-domains");
|
|
5
|
+
const browser_1 = require("@sequenceholdings/platform/browser");
|
|
6
|
+
const service_directory_1 = require("./service-directory");
|
|
7
|
+
const directory_contract_1 = require("./directory-contract");
|
|
8
|
+
const processes_1 = require("./processes");
|
|
9
|
+
const agents_contract_1 = require("./agents-contract");
|
|
10
|
+
const lattice_provenance_1 = require("./lattice-provenance");
|
|
11
|
+
const invocation_1 = require("./invocation");
|
|
12
|
+
function lazy(create) {
|
|
13
|
+
let value;
|
|
14
|
+
return () => (value ??= create());
|
|
15
|
+
}
|
|
16
|
+
function createFunctionPlatformClient(options) {
|
|
17
|
+
const baseUrl = (0, browser_1.trustedPlatformOrigin)({ baseUrl: options.baseUrl });
|
|
18
|
+
const allowed = new Set([
|
|
19
|
+
directory_contract_1.FUNCTION_DIRECTORY_TOKEN_HEADER,
|
|
20
|
+
processes_1.FUNCTION_PROCESS_TOKEN_HEADER,
|
|
21
|
+
agents_contract_1.FUNCTION_AGENT_TOKEN_HEADER,
|
|
22
|
+
lattice_provenance_1.FUNCTION_LATTICE_EXECUTION_TOKEN_HEADER,
|
|
23
|
+
invocation_1.FUNCTION_INVOCATION_IDENTITY_TOKEN_HEADER,
|
|
24
|
+
...platform_domains_1.FUNCTION_PLATFORM_DOMAIN_HEADERS,
|
|
25
|
+
]);
|
|
26
|
+
const source = options.request.headers;
|
|
27
|
+
const headers = {};
|
|
28
|
+
if (typeof source.get === "function") {
|
|
29
|
+
for (const name of allowed) {
|
|
30
|
+
const value = source.get(name);
|
|
31
|
+
if (value !== null)
|
|
32
|
+
headers[name] = value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
for (const [name, value] of Object.entries(source))
|
|
37
|
+
if (allowed.has(name.toLowerCase()))
|
|
38
|
+
headers[name] = Array.isArray(value) ? [...value] : value;
|
|
39
|
+
}
|
|
40
|
+
const context = {
|
|
41
|
+
request: { headers },
|
|
42
|
+
baseUrl,
|
|
43
|
+
fetchImpl: options.fetchImpl,
|
|
44
|
+
};
|
|
45
|
+
const directory = lazy(() => (0, service_directory_1.createFunctionServiceDirectoryClient)(context));
|
|
46
|
+
const processes = lazy(() => (0, processes_1.createFunctionServiceProcessesClient)(context));
|
|
47
|
+
const execution = lazy(() => (0, lattice_provenance_1.createFunctionLatticeClient)(context));
|
|
48
|
+
const invocation = lazy(() => (0, invocation_1.createFunctionInvocationClient)(context));
|
|
49
|
+
const { callerDirectory, ...domains } = (0, platform_domains_1.createFunctionPlatformDomains)(context);
|
|
50
|
+
return {
|
|
51
|
+
...domains,
|
|
52
|
+
directory: {
|
|
53
|
+
caller: callerDirectory,
|
|
54
|
+
resolve: async (query) => directory().resolve(query),
|
|
55
|
+
listGroupMembers: async (query) => directory().listGroupMembers(query),
|
|
56
|
+
},
|
|
57
|
+
lattice: {
|
|
58
|
+
runs: {
|
|
59
|
+
get: async (query) => processes().getRun(query),
|
|
60
|
+
listPage: async (query) => processes().listRunsPage(query),
|
|
61
|
+
},
|
|
62
|
+
completedNodes: {
|
|
63
|
+
get: async (query) => processes().getCompletedNode(query),
|
|
64
|
+
},
|
|
65
|
+
getCompletedAgentReference: async (query) => processes().getCompletedAgentReference(query),
|
|
66
|
+
execution: {
|
|
67
|
+
getContext: async () => execution().getExecutionContext(),
|
|
68
|
+
getRunCreatorAccess: async () => execution().getRunCreatorAccess(),
|
|
69
|
+
getHumanCompletion: async (query) => execution().getHumanCompletion(query),
|
|
70
|
+
getHumanCompletions: async (query) => execution().getHumanCompletions(query),
|
|
71
|
+
getParallelSnapshot: async (query) => execution().getParallelSnapshot(query),
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
invocation: {
|
|
75
|
+
getInvocationContext: async () => invocation().getInvocationContext(),
|
|
76
|
+
getCallerCapabilities: async () => invocation().getCallerCapabilities(),
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|