@axonflow/sdk 2.2.0 → 3.3.0
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 +185 -8
- package/dist/cjs/client.d.ts +530 -8
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +1760 -45
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/errors.d.ts +22 -0
- package/dist/cjs/errors.d.ts.map +1 -1
- package/dist/cjs/errors.js +32 -1
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/index.d.ts +10 -14
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +11 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/connector.d.ts +82 -0
- package/dist/cjs/types/connector.d.ts.map +1 -1
- package/dist/cjs/types/connector.js +7 -0
- package/dist/cjs/types/connector.js.map +1 -1
- package/dist/cjs/types/execution.d.ts +227 -0
- package/dist/cjs/types/execution.d.ts.map +1 -0
- package/dist/cjs/types/execution.js +73 -0
- package/dist/cjs/types/execution.js.map +1 -0
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +3 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/masfeat.d.ts +238 -0
- package/dist/cjs/types/masfeat.d.ts.map +1 -0
- package/dist/cjs/types/masfeat.js +11 -0
- package/dist/cjs/types/masfeat.js.map +1 -0
- package/dist/cjs/types/planning.d.ts +126 -1
- package/dist/cjs/types/planning.d.ts.map +1 -1
- package/dist/cjs/types/policies.d.ts +19 -1
- package/dist/cjs/types/policies.d.ts.map +1 -1
- package/dist/cjs/types/proxy.d.ts +29 -3
- package/dist/cjs/types/proxy.d.ts.map +1 -1
- package/dist/cjs/types/workflows.d.ts +318 -0
- package/dist/cjs/types/workflows.d.ts.map +1 -0
- package/dist/cjs/types/workflows.js +61 -0
- package/dist/cjs/types/workflows.js.map +1 -0
- package/dist/esm/client.d.ts +530 -8
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +1761 -46
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/errors.d.ts +22 -0
- package/dist/esm/errors.d.ts.map +1 -1
- package/dist/esm/errors.js +30 -0
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/index.d.ts +10 -14
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +7 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/connector.d.ts +82 -0
- package/dist/esm/types/connector.d.ts.map +1 -1
- package/dist/esm/types/connector.js +6 -1
- package/dist/esm/types/connector.js.map +1 -1
- package/dist/esm/types/execution.d.ts +227 -0
- package/dist/esm/types/execution.d.ts.map +1 -0
- package/dist/esm/types/execution.js +70 -0
- package/dist/esm/types/execution.js.map +1 -0
- package/dist/esm/types/index.d.ts +3 -0
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +3 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/masfeat.d.ts +238 -0
- package/dist/esm/types/masfeat.d.ts.map +1 -0
- package/dist/esm/types/masfeat.js +10 -0
- package/dist/esm/types/masfeat.js.map +1 -0
- package/dist/esm/types/planning.d.ts +126 -1
- package/dist/esm/types/planning.d.ts.map +1 -1
- package/dist/esm/types/policies.d.ts +19 -1
- package/dist/esm/types/policies.d.ts.map +1 -1
- package/dist/esm/types/proxy.d.ts +29 -3
- package/dist/esm/types/proxy.d.ts.map +1 -1
- package/dist/esm/types/workflows.d.ts +318 -0
- package/dist/esm/types/workflows.d.ts.map +1 -0
- package/dist/esm/types/workflows.js +58 -0
- package/dist/esm/types/workflows.js.map +1 -0
- package/package.json +7 -2
- package/dist/cjs/interceptors/anthropic.d.ts +0 -40
- package/dist/cjs/interceptors/anthropic.d.ts.map +0 -1
- package/dist/cjs/interceptors/anthropic.js +0 -101
- package/dist/cjs/interceptors/anthropic.js.map +0 -1
- package/dist/cjs/interceptors/base.d.ts +0 -23
- package/dist/cjs/interceptors/base.d.ts.map +0 -1
- package/dist/cjs/interceptors/base.js +0 -10
- package/dist/cjs/interceptors/base.js.map +0 -1
- package/dist/cjs/interceptors/bedrock.d.ts +0 -142
- package/dist/cjs/interceptors/bedrock.d.ts.map +0 -1
- package/dist/cjs/interceptors/bedrock.js +0 -263
- package/dist/cjs/interceptors/bedrock.js.map +0 -1
- package/dist/cjs/interceptors/gemini.d.ts +0 -89
- package/dist/cjs/interceptors/gemini.d.ts.map +0 -1
- package/dist/cjs/interceptors/gemini.js +0 -121
- package/dist/cjs/interceptors/gemini.js.map +0 -1
- package/dist/cjs/interceptors/ollama.d.ts +0 -143
- package/dist/cjs/interceptors/ollama.d.ts.map +0 -1
- package/dist/cjs/interceptors/ollama.js +0 -153
- package/dist/cjs/interceptors/ollama.js.map +0 -1
- package/dist/cjs/interceptors/openai.d.ts +0 -40
- package/dist/cjs/interceptors/openai.d.ts.map +0 -1
- package/dist/cjs/interceptors/openai.js +0 -100
- package/dist/cjs/interceptors/openai.js.map +0 -1
- package/dist/esm/interceptors/anthropic.d.ts +0 -40
- package/dist/esm/interceptors/anthropic.d.ts.map +0 -1
- package/dist/esm/interceptors/anthropic.js +0 -96
- package/dist/esm/interceptors/anthropic.js.map +0 -1
- package/dist/esm/interceptors/base.d.ts +0 -23
- package/dist/esm/interceptors/base.d.ts.map +0 -1
- package/dist/esm/interceptors/base.js +0 -6
- package/dist/esm/interceptors/base.js.map +0 -1
- package/dist/esm/interceptors/bedrock.d.ts +0 -142
- package/dist/esm/interceptors/bedrock.d.ts.map +0 -1
- package/dist/esm/interceptors/bedrock.js +0 -224
- package/dist/esm/interceptors/bedrock.js.map +0 -1
- package/dist/esm/interceptors/gemini.d.ts +0 -89
- package/dist/esm/interceptors/gemini.d.ts.map +0 -1
- package/dist/esm/interceptors/gemini.js +0 -116
- package/dist/esm/interceptors/gemini.js.map +0 -1
- package/dist/esm/interceptors/ollama.d.ts +0 -143
- package/dist/esm/interceptors/ollama.d.ts.map +0 -1
- package/dist/esm/interceptors/ollama.js +0 -147
- package/dist/esm/interceptors/ollama.js.map +0 -1
- package/dist/esm/interceptors/openai.d.ts +0 -40
- package/dist/esm/interceptors/openai.d.ts.map +0 -1
- package/dist/esm/interceptors/openai.js +0 -95
- package/dist/esm/interceptors/openai.js.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
*
|
|
43
43
|
* @example Proxy Mode
|
|
44
44
|
* ```typescript
|
|
45
|
-
* const response = await axonflow.
|
|
45
|
+
* const response = await axonflow.proxyLLMCall({
|
|
46
46
|
* userToken: 'user-123',
|
|
47
47
|
* query: 'What is the capital of France?',
|
|
48
48
|
* requestType: 'chat'
|
|
@@ -50,26 +50,12 @@
|
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.VERSION = exports.
|
|
53
|
+
exports.VERSION = exports.ExecutionHelpers = exports.WorkflowHelpers = exports.APIError = exports.TimeoutError = exports.RateLimitError = exports.AuthenticationError = exports.PolicyViolationError = exports.VersionConflictError = exports.PlanExecutionError = exports.ConnectorError = exports.ConnectionError = exports.ConfigurationError = exports.AxonFlowError = exports.wasRedacted = exports.AxonFlow = void 0;
|
|
54
54
|
var client_1 = require("./client");
|
|
55
55
|
Object.defineProperty(exports, "AxonFlow", { enumerable: true, get: function () { return client_1.AxonFlow; } });
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var openai_1 = require("./interceptors/openai");
|
|
60
|
-
Object.defineProperty(exports, "wrapOpenAIClient", { enumerable: true, get: function () { return openai_1.wrapOpenAIClient; } });
|
|
61
|
-
/** @deprecated Use Gateway Mode or Proxy Mode instead */
|
|
62
|
-
var anthropic_1 = require("./interceptors/anthropic");
|
|
63
|
-
Object.defineProperty(exports, "wrapAnthropicClient", { enumerable: true, get: function () { return anthropic_1.wrapAnthropicClient; } });
|
|
64
|
-
/** @deprecated Use Gateway Mode or Proxy Mode instead */
|
|
65
|
-
var gemini_1 = require("./interceptors/gemini");
|
|
66
|
-
Object.defineProperty(exports, "wrapGeminiModel", { enumerable: true, get: function () { return gemini_1.wrapGeminiModel; } });
|
|
67
|
-
/** @deprecated Use Gateway Mode or Proxy Mode instead */
|
|
68
|
-
var ollama_1 = require("./interceptors/ollama");
|
|
69
|
-
Object.defineProperty(exports, "wrapOllamaClient", { enumerable: true, get: function () { return ollama_1.wrapOllamaClient; } });
|
|
70
|
-
/** @deprecated Use Gateway Mode or Proxy Mode instead */
|
|
71
|
-
var bedrock_1 = require("./interceptors/bedrock");
|
|
72
|
-
Object.defineProperty(exports, "wrapBedrockClient", { enumerable: true, get: function () { return bedrock_1.wrapBedrockClient; } });
|
|
56
|
+
// Export connector utilities
|
|
57
|
+
var connector_1 = require("./types/connector");
|
|
58
|
+
Object.defineProperty(exports, "wasRedacted", { enumerable: true, get: function () { return connector_1.wasRedacted; } });
|
|
73
59
|
// Export error classes for proper error handling
|
|
74
60
|
var errors_1 = require("./errors");
|
|
75
61
|
Object.defineProperty(exports, "AxonFlowError", { enumerable: true, get: function () { return errors_1.AxonFlowError; } });
|
|
@@ -77,13 +63,18 @@ Object.defineProperty(exports, "ConfigurationError", { enumerable: true, get: fu
|
|
|
77
63
|
Object.defineProperty(exports, "ConnectionError", { enumerable: true, get: function () { return errors_1.ConnectionError; } });
|
|
78
64
|
Object.defineProperty(exports, "ConnectorError", { enumerable: true, get: function () { return errors_1.ConnectorError; } });
|
|
79
65
|
Object.defineProperty(exports, "PlanExecutionError", { enumerable: true, get: function () { return errors_1.PlanExecutionError; } });
|
|
66
|
+
Object.defineProperty(exports, "VersionConflictError", { enumerable: true, get: function () { return errors_1.VersionConflictError; } });
|
|
80
67
|
Object.defineProperty(exports, "PolicyViolationError", { enumerable: true, get: function () { return errors_1.PolicyViolationError; } });
|
|
81
68
|
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return errors_1.AuthenticationError; } });
|
|
82
69
|
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return errors_1.RateLimitError; } });
|
|
83
70
|
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return errors_1.TimeoutError; } });
|
|
84
71
|
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return errors_1.APIError; } });
|
|
72
|
+
var workflows_1 = require("./types/workflows");
|
|
73
|
+
Object.defineProperty(exports, "WorkflowHelpers", { enumerable: true, get: function () { return workflows_1.WorkflowHelpers; } });
|
|
74
|
+
var execution_1 = require("./types/execution");
|
|
75
|
+
Object.defineProperty(exports, "ExecutionHelpers", { enumerable: true, get: function () { return execution_1.ExecutionHelpers; } });
|
|
85
76
|
// Export version
|
|
86
|
-
exports.VERSION = '3.
|
|
77
|
+
exports.VERSION = '3.2.0';
|
|
87
78
|
// Default export for convenience
|
|
88
79
|
const client_2 = require("./client");
|
|
89
80
|
exports.default = client_2.AxonFlow;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;;AAEH,mCAAoC;AAA3B,kGAAA,QAAQ,OAAA;AAEjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;;AAEH,mCAAoC;AAA3B,kGAAA,QAAQ,OAAA;AAEjB,6BAA6B;AAC7B,+CAAgD;AAAvC,wGAAA,WAAW,OAAA;AAEpB,iDAAiD;AACjD,mCAYkB;AAXhB,uGAAA,aAAa,OAAA;AACb,4GAAA,kBAAkB,OAAA;AAClB,yGAAA,eAAe,OAAA;AACf,wGAAA,cAAc,OAAA;AACd,4GAAA,kBAAkB,OAAA;AAClB,8GAAA,oBAAoB,OAAA;AACpB,8GAAA,oBAAoB,OAAA;AACpB,6GAAA,mBAAmB,OAAA;AACnB,wGAAA,cAAc,OAAA;AACd,sGAAA,YAAY,OAAA;AACZ,kGAAA,QAAQ,OAAA;AA2JV,+CAAoD;AAA3C,4GAAA,eAAe,OAAA;AAgBxB,+CAAqD;AAA5C,6GAAA,gBAAgB,OAAA;AAEzB,iBAAiB;AACJ,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,iCAAiC;AACjC,qCAAoC;AACpC,kBAAe,iBAAQ,CAAC"}
|
|
@@ -22,12 +22,94 @@ export interface ConnectorInstallRequest {
|
|
|
22
22
|
options: Record<string, any>;
|
|
23
23
|
credentials: Record<string, string>;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Information about a policy match during evaluation
|
|
27
|
+
*/
|
|
28
|
+
export interface PolicyMatchInfo {
|
|
29
|
+
policy_id: string;
|
|
30
|
+
policy_name: string;
|
|
31
|
+
category: string;
|
|
32
|
+
severity: string;
|
|
33
|
+
action: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Policy evaluation information included in MCP responses
|
|
37
|
+
* Provides transparency into policy enforcement decisions
|
|
38
|
+
*/
|
|
39
|
+
export interface MCPPolicyInfo {
|
|
40
|
+
policies_evaluated: number;
|
|
41
|
+
blocked: boolean;
|
|
42
|
+
block_reason?: string;
|
|
43
|
+
redactions_applied: number;
|
|
44
|
+
processing_time_ms: number;
|
|
45
|
+
matched_policies?: PolicyMatchInfo[];
|
|
46
|
+
/** Exfiltration check information (Issue #966) */
|
|
47
|
+
exfiltration_check?: ExfiltrationCheckInfo;
|
|
48
|
+
/** Dynamic policy evaluation results (Issue #968) */
|
|
49
|
+
dynamic_policy_info?: DynamicPolicyInfo;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Information about exfiltration limit checks (Issue #966)
|
|
53
|
+
* Helps prevent large-scale data extraction via MCP queries
|
|
54
|
+
*/
|
|
55
|
+
export interface ExfiltrationCheckInfo {
|
|
56
|
+
/** Number of rows in the response */
|
|
57
|
+
rows_returned: number;
|
|
58
|
+
/** Configured maximum rows per query */
|
|
59
|
+
row_limit: number;
|
|
60
|
+
/** Size of the response data in bytes */
|
|
61
|
+
bytes_returned: number;
|
|
62
|
+
/** Configured maximum bytes per response */
|
|
63
|
+
byte_limit: number;
|
|
64
|
+
/** Whether the response is within configured limits */
|
|
65
|
+
within_limits: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Information about dynamic policy evaluation (Issue #968)
|
|
69
|
+
* Dynamic policies are evaluated by the Orchestrator and can include
|
|
70
|
+
* rate limiting, budget controls, time-based access, and role-based access
|
|
71
|
+
*/
|
|
72
|
+
export interface DynamicPolicyInfo {
|
|
73
|
+
/** Number of dynamic policies checked */
|
|
74
|
+
policies_evaluated: number;
|
|
75
|
+
/** Details about policies that matched */
|
|
76
|
+
matched_policies?: DynamicPolicyMatch[];
|
|
77
|
+
/** Whether the Orchestrator was reachable */
|
|
78
|
+
orchestrator_reachable: boolean;
|
|
79
|
+
/** Time taken for dynamic policy evaluation */
|
|
80
|
+
processing_time_ms: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Details about a matched dynamic policy
|
|
84
|
+
*/
|
|
85
|
+
export interface DynamicPolicyMatch {
|
|
86
|
+
/** Unique identifier of the policy */
|
|
87
|
+
policy_id: string;
|
|
88
|
+
/** Human-readable name of the policy */
|
|
89
|
+
policy_name: string;
|
|
90
|
+
/** Type of policy (rate-limit, budget, time-access, role-access, mcp, connector) */
|
|
91
|
+
policy_type: string;
|
|
92
|
+
/** Action taken (allow, block, log, etc.) */
|
|
93
|
+
action: string;
|
|
94
|
+
/** Context for the policy match */
|
|
95
|
+
reason?: string;
|
|
96
|
+
}
|
|
25
97
|
export interface ConnectorResponse {
|
|
26
98
|
success: boolean;
|
|
27
99
|
data: any;
|
|
28
100
|
error?: string;
|
|
29
101
|
meta?: Record<string, any>;
|
|
102
|
+
/** Whether any fields in the response were redacted by policy enforcement */
|
|
103
|
+
redacted?: boolean;
|
|
104
|
+
/** JSON paths of fields that were redacted (e.g., "data.rows[0].ssn") */
|
|
105
|
+
redacted_fields?: string[];
|
|
106
|
+
/** Policy evaluation details for this request/response cycle */
|
|
107
|
+
policy_info?: MCPPolicyInfo;
|
|
30
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Returns true if the connector response had any fields redacted by policy evaluation.
|
|
111
|
+
*/
|
|
112
|
+
export declare function wasRedacted(response: ConnectorResponse): boolean;
|
|
31
113
|
/**
|
|
32
114
|
* Health status of an installed connector
|
|
33
115
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/types/connector.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC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CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gEAAgE;IAChE,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAEhE;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -3,4 +3,11 @@
|
|
|
3
3
|
* MCP Connector types for AxonFlow SDK
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.wasRedacted = wasRedacted;
|
|
7
|
+
/**
|
|
8
|
+
* Returns true if the connector response had any fields redacted by policy evaluation.
|
|
9
|
+
*/
|
|
10
|
+
function wasRedacted(response) {
|
|
11
|
+
return response.redacted === true;
|
|
12
|
+
}
|
|
6
13
|
//# sourceMappingURL=connector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../../../src/types/connector.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
1
|
+
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../../../src/types/connector.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAsHH,kCAEC;AALD;;GAEG;AACH,SAAgB,WAAW,CAAC,QAA2B;IACrD,OAAO,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Execution Tracking Types for AxonFlow SDK.
|
|
3
|
+
*
|
|
4
|
+
* These types provide a consistent interface for tracking both Multi-Agent Planning (MAP)
|
|
5
|
+
* and Workflow Control Plane (WCP) executions. The unified schema enables consistent
|
|
6
|
+
* status tracking, progress reporting, and cost tracking across execution types.
|
|
7
|
+
*
|
|
8
|
+
* Issue #1075 - EPIC #1074: Unified Workflow Infrastructure
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Execution type distinguishing between MAP plans and WCP workflows.
|
|
12
|
+
*/
|
|
13
|
+
export type ExecutionType = 'map_plan' | 'wcp_workflow';
|
|
14
|
+
/**
|
|
15
|
+
* Unified execution status values.
|
|
16
|
+
*/
|
|
17
|
+
export type ExecutionStatusValue = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'aborted' | 'expired';
|
|
18
|
+
/**
|
|
19
|
+
* Step status values.
|
|
20
|
+
*/
|
|
21
|
+
export type StepStatusValue = 'pending' | 'running' | 'completed' | 'failed' | 'skipped' | 'blocked' | 'approval';
|
|
22
|
+
/**
|
|
23
|
+
* Step type indicating what kind of operation the step performs.
|
|
24
|
+
*/
|
|
25
|
+
export type UnifiedStepType = 'llm_call' | 'tool_call' | 'connector_call' | 'human_task' | 'synthesis' | 'action' | 'gate';
|
|
26
|
+
/**
|
|
27
|
+
* Gate decision values (applicable to both MAP and WCP).
|
|
28
|
+
*/
|
|
29
|
+
export type UnifiedGateDecision = 'allow' | 'block' | 'require_approval';
|
|
30
|
+
/**
|
|
31
|
+
* Approval status for require_approval decisions.
|
|
32
|
+
*/
|
|
33
|
+
export type UnifiedApprovalStatus = 'pending' | 'approved' | 'rejected';
|
|
34
|
+
/**
|
|
35
|
+
* Detailed information about an individual execution step.
|
|
36
|
+
*/
|
|
37
|
+
export interface UnifiedStepStatus {
|
|
38
|
+
/** Unique step identifier */
|
|
39
|
+
step_id: string;
|
|
40
|
+
/** Step index in the execution (0-based) */
|
|
41
|
+
step_index: number;
|
|
42
|
+
/** Human-readable step name */
|
|
43
|
+
step_name: string;
|
|
44
|
+
/** Type of operation the step performs */
|
|
45
|
+
step_type: UnifiedStepType;
|
|
46
|
+
/** Current status of the step */
|
|
47
|
+
status: StepStatusValue;
|
|
48
|
+
/** When the step started executing */
|
|
49
|
+
started_at?: string;
|
|
50
|
+
/** When the step finished */
|
|
51
|
+
ended_at?: string;
|
|
52
|
+
/** Duration of step execution (human-readable, e.g., "2.5s") */
|
|
53
|
+
duration?: string;
|
|
54
|
+
/** Policy decision for this step (if applicable) */
|
|
55
|
+
decision?: UnifiedGateDecision;
|
|
56
|
+
/** Reason for the policy decision */
|
|
57
|
+
decision_reason?: string;
|
|
58
|
+
/** IDs of policies that matched during evaluation */
|
|
59
|
+
policies_matched?: string[];
|
|
60
|
+
/** Approval status (for require_approval decisions) */
|
|
61
|
+
approval_status?: UnifiedApprovalStatus;
|
|
62
|
+
/** Who approved the step (if approved) */
|
|
63
|
+
approved_by?: string;
|
|
64
|
+
/** When the step was approved */
|
|
65
|
+
approved_at?: string;
|
|
66
|
+
/** LLM model used (if applicable) */
|
|
67
|
+
model?: string;
|
|
68
|
+
/** LLM provider (if applicable) */
|
|
69
|
+
provider?: string;
|
|
70
|
+
/** Cost in USD for this step */
|
|
71
|
+
cost_usd?: number;
|
|
72
|
+
/** Step input data (may be large) */
|
|
73
|
+
input?: unknown;
|
|
74
|
+
/** Step output data (may be large) */
|
|
75
|
+
output?: unknown;
|
|
76
|
+
/** Human-readable result summary */
|
|
77
|
+
result_summary?: string;
|
|
78
|
+
/** Error message if step failed */
|
|
79
|
+
error?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Unified execution status for both MAP plans and WCP workflows.
|
|
83
|
+
*
|
|
84
|
+
* This type provides a consistent interface for tracking execution progress,
|
|
85
|
+
* steps, costs, and metadata regardless of the underlying execution type.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* // Get execution status
|
|
90
|
+
* const status = await client.getExecutionStatus('exec_123');
|
|
91
|
+
* console.log(`${status.execution_type}: ${status.name}`);
|
|
92
|
+
* console.log(`Progress: ${status.progress_percent}%`);
|
|
93
|
+
*
|
|
94
|
+
* // Check if complete
|
|
95
|
+
* if (status.status === 'completed') {
|
|
96
|
+
* console.log(`Completed in ${status.duration}`);
|
|
97
|
+
* }
|
|
98
|
+
*
|
|
99
|
+
* // Access steps
|
|
100
|
+
* for (const step of status.steps) {
|
|
101
|
+
* console.log(`Step ${step.step_index}: ${step.step_name} - ${step.status}`);
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export interface ExecutionStatus {
|
|
106
|
+
/** Unique execution identifier */
|
|
107
|
+
execution_id: string;
|
|
108
|
+
/** Type of execution (MAP plan or WCP workflow) */
|
|
109
|
+
execution_type: ExecutionType;
|
|
110
|
+
/** Human-readable name of the execution */
|
|
111
|
+
name: string;
|
|
112
|
+
/** Source orchestrator (WCP-specific: langchain, crewai, etc.) */
|
|
113
|
+
source?: string;
|
|
114
|
+
/** Current execution status */
|
|
115
|
+
status: ExecutionStatusValue;
|
|
116
|
+
/** Current step being executed (0-based index) */
|
|
117
|
+
current_step_index: number;
|
|
118
|
+
/** Total number of steps in the execution */
|
|
119
|
+
total_steps: number;
|
|
120
|
+
/** Progress as a percentage (0-100) */
|
|
121
|
+
progress_percent: number;
|
|
122
|
+
/** When execution started (ISO 8601 timestamp) */
|
|
123
|
+
started_at: string;
|
|
124
|
+
/** When execution completed (ISO 8601 timestamp) */
|
|
125
|
+
completed_at?: string;
|
|
126
|
+
/** Duration of execution (human-readable, e.g., "1m 30s") */
|
|
127
|
+
duration?: string;
|
|
128
|
+
/** Estimated cost in USD (pre-execution) */
|
|
129
|
+
estimated_cost_usd?: number;
|
|
130
|
+
/** Actual cost in USD (post-execution) */
|
|
131
|
+
actual_cost_usd?: number;
|
|
132
|
+
/** Detailed step information */
|
|
133
|
+
steps: UnifiedStepStatus[];
|
|
134
|
+
/** Error message if execution failed */
|
|
135
|
+
error?: string;
|
|
136
|
+
/** Tenant ID for multi-tenancy */
|
|
137
|
+
tenant_id?: string;
|
|
138
|
+
/** Organization ID */
|
|
139
|
+
org_id?: string;
|
|
140
|
+
/** User ID who initiated the execution */
|
|
141
|
+
user_id?: string;
|
|
142
|
+
/** Client/application ID */
|
|
143
|
+
client_id?: string;
|
|
144
|
+
/** Additional metadata */
|
|
145
|
+
metadata?: Record<string, unknown>;
|
|
146
|
+
/** When the execution record was created */
|
|
147
|
+
created_at: string;
|
|
148
|
+
/** When the execution record was last updated */
|
|
149
|
+
updated_at: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Request to list executions with optional filters.
|
|
153
|
+
*/
|
|
154
|
+
export interface UnifiedListExecutionsRequest {
|
|
155
|
+
/** Filter by execution type */
|
|
156
|
+
execution_type?: ExecutionType;
|
|
157
|
+
/** Filter by status */
|
|
158
|
+
status?: ExecutionStatusValue;
|
|
159
|
+
/** Filter by tenant ID */
|
|
160
|
+
tenant_id?: string;
|
|
161
|
+
/** Filter by organization ID */
|
|
162
|
+
org_id?: string;
|
|
163
|
+
/** Maximum number of results (default 50, max 100) */
|
|
164
|
+
limit?: number;
|
|
165
|
+
/** Offset for pagination */
|
|
166
|
+
offset?: number;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Paginated response for listing executions.
|
|
170
|
+
*/
|
|
171
|
+
export interface UnifiedListExecutionsResponse {
|
|
172
|
+
/** List of executions */
|
|
173
|
+
executions: ExecutionStatus[];
|
|
174
|
+
/** Total count of matching executions */
|
|
175
|
+
total: number;
|
|
176
|
+
/** Limit used in the request */
|
|
177
|
+
limit: number;
|
|
178
|
+
/** Offset used in the request */
|
|
179
|
+
offset: number;
|
|
180
|
+
/** Whether more results are available */
|
|
181
|
+
has_more: boolean;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Options for the streamExecutionStatus method.
|
|
185
|
+
*/
|
|
186
|
+
export interface StreamExecutionStatusOptions {
|
|
187
|
+
/** AbortSignal to cancel the SSE stream */
|
|
188
|
+
signal?: AbortSignal;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Helper functions for working with execution types.
|
|
192
|
+
*/
|
|
193
|
+
export declare const ExecutionHelpers: {
|
|
194
|
+
/**
|
|
195
|
+
* Check if an execution status is terminal (no more updates expected).
|
|
196
|
+
*/
|
|
197
|
+
isTerminal(status: ExecutionStatusValue): boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Check if a step status is terminal.
|
|
200
|
+
*/
|
|
201
|
+
isStepTerminal(status: StepStatusValue): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Check if a step is in a blocking state (blocked by policy or awaiting approval).
|
|
204
|
+
*/
|
|
205
|
+
isStepBlocking(status: StepStatusValue): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Calculate progress percentage from steps.
|
|
208
|
+
*/
|
|
209
|
+
calculateProgress(steps: UnifiedStepStatus[], totalSteps: number): number;
|
|
210
|
+
/**
|
|
211
|
+
* Get the currently running step, if any.
|
|
212
|
+
*/
|
|
213
|
+
getCurrentStep(execution: ExecutionStatus): UnifiedStepStatus | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Calculate total cost from all steps.
|
|
216
|
+
*/
|
|
217
|
+
calculateTotalCost(steps: UnifiedStepStatus[]): number;
|
|
218
|
+
/**
|
|
219
|
+
* Check if an execution is a MAP plan.
|
|
220
|
+
*/
|
|
221
|
+
isMapPlan(execution: ExecutionStatus): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Check if an execution is a WCP workflow.
|
|
224
|
+
*/
|
|
225
|
+
isWcpWorkflow(execution: ExecutionStatus): boolean;
|
|
226
|
+
};
|
|
227
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../../src/types/execution.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQ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BACgB,oBAAoB,GAAG,OAAO;IAUjD;;OAEG;2BACoB,eAAe,GAAG,OAAO;IAIhD;;OAEG;2BACoB,eAAe,GAAG,OAAO;IAIhD;;OAEG;6BACsB,iBAAiB,EAAE,cAAc,MAAM,GAAG,MAAM;IAMzE;;OAEG;8BACuB,eAAe,GAAG,iBAAiB,GAAG,SAAS;IAIzE;;OAEG;8BACuB,iBAAiB,EAAE,GAAG,MAAM;IAItD;;OAEG;yBACkB,eAAe,GAAG,OAAO;IAI9C;;OAEG;6BACsB,eAAe,GAAG,OAAO;CAGnD,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Unified Execution Tracking Types for AxonFlow SDK.
|
|
4
|
+
*
|
|
5
|
+
* These types provide a consistent interface for tracking both Multi-Agent Planning (MAP)
|
|
6
|
+
* and Workflow Control Plane (WCP) executions. The unified schema enables consistent
|
|
7
|
+
* status tracking, progress reporting, and cost tracking across execution types.
|
|
8
|
+
*
|
|
9
|
+
* Issue #1075 - EPIC #1074: Unified Workflow Infrastructure
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ExecutionHelpers = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Helper functions for working with execution types.
|
|
15
|
+
*/
|
|
16
|
+
exports.ExecutionHelpers = {
|
|
17
|
+
/**
|
|
18
|
+
* Check if an execution status is terminal (no more updates expected).
|
|
19
|
+
*/
|
|
20
|
+
isTerminal(status) {
|
|
21
|
+
return (status === 'completed' ||
|
|
22
|
+
status === 'failed' ||
|
|
23
|
+
status === 'cancelled' ||
|
|
24
|
+
status === 'aborted' ||
|
|
25
|
+
status === 'expired');
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Check if a step status is terminal.
|
|
29
|
+
*/
|
|
30
|
+
isStepTerminal(status) {
|
|
31
|
+
return status === 'completed' || status === 'failed' || status === 'skipped';
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Check if a step is in a blocking state (blocked by policy or awaiting approval).
|
|
35
|
+
*/
|
|
36
|
+
isStepBlocking(status) {
|
|
37
|
+
return status === 'blocked' || status === 'approval';
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Calculate progress percentage from steps.
|
|
41
|
+
*/
|
|
42
|
+
calculateProgress(steps, totalSteps) {
|
|
43
|
+
if (totalSteps === 0)
|
|
44
|
+
return 0;
|
|
45
|
+
const completedSteps = steps.filter(s => s.status === 'completed').length;
|
|
46
|
+
return (completedSteps / totalSteps) * 100;
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Get the currently running step, if any.
|
|
50
|
+
*/
|
|
51
|
+
getCurrentStep(execution) {
|
|
52
|
+
return execution.steps.find(s => s.status === 'running');
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Calculate total cost from all steps.
|
|
56
|
+
*/
|
|
57
|
+
calculateTotalCost(steps) {
|
|
58
|
+
return steps.reduce((total, step) => total + (step.cost_usd ?? 0), 0);
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Check if an execution is a MAP plan.
|
|
62
|
+
*/
|
|
63
|
+
isMapPlan(execution) {
|
|
64
|
+
return execution.execution_type === 'map_plan';
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Check if an execution is a WCP workflow.
|
|
68
|
+
*/
|
|
69
|
+
isWcpWorkflow(execution) {
|
|
70
|
+
return execution.execution_type === 'wcp_workflow';
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../src/types/execution.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAwQH;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B;;OAEG;IACH,UAAU,CAAC,MAA4B;QACrC,OAAO,CACL,M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cAAc,CAAC;IACrD,CAAC;CACF,CAAC"}
|
|
@@ -10,4 +10,7 @@ export * from './proxy';
|
|
|
10
10
|
export * from './code-governance';
|
|
11
11
|
export * from './execution-replay';
|
|
12
12
|
export * from './cost-controls';
|
|
13
|
+
export * from './workflows';
|
|
14
|
+
export * from './masfeat';
|
|
15
|
+
export * from './execution';
|
|
13
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -26,4 +26,7 @@ __exportStar(require("./proxy"), exports);
|
|
|
26
26
|
__exportStar(require("./code-governance"), exports);
|
|
27
27
|
__exportStar(require("./execution-replay"), exports);
|
|
28
28
|
__exportStar(require("./cost-controls"), exports);
|
|
29
|
+
__exportStar(require("./workflows"), exports);
|
|
30
|
+
__exportStar(require("./masfeat"), exports);
|
|
31
|
+
__exportStar(require("./execution"), exports);
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,6CAA2B;AAC3B,8CAA4B;AAC5B,6CAA2B;AAC3B,4CAA0B;AAC1B,0CAAwB;AACxB,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,6CAA2B;AAC3B,8CAA4B;AAC5B,6CAA2B;AAC3B,4CAA0B;AAC1B,0CAAwB;AACxB,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC;AAChC,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B"}
|