@stigmer/sdk 0.5.1 → 1.0.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/gen/agentexecution.d.ts +2 -1
- package/gen/agentexecution.d.ts.map +1 -1
- package/gen/agentexecution.js +8 -0
- package/gen/agentexecution.js.map +1 -1
- package/gen/artifact.d.ts +36 -0
- package/gen/artifact.d.ts.map +1 -0
- package/gen/artifact.js +94 -0
- package/gen/artifact.js.map +1 -0
- package/gen/authorization-config.d.ts.map +1 -1
- package/gen/authorization-config.js +1 -0
- package/gen/authorization-config.js.map +1 -1
- package/gen/client.d.ts +5 -1
- package/gen/client.d.ts.map +1 -1
- package/gen/client.js +4 -0
- package/gen/client.js.map +1 -1
- package/gen/workflow.d.ts +17 -2
- package/gen/workflow.d.ts.map +1 -1
- package/gen/workflow.js +55 -1
- package/gen/workflow.js.map +1 -1
- package/gen/workflowexecution.d.ts +7 -1
- package/gen/workflowexecution.d.ts.map +1 -1
- package/gen/workflowexecution.js +42 -0
- package/gen/workflowexecution.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/platform.d.ts +33 -0
- package/platform.d.ts.map +1 -0
- package/platform.js +39 -0
- package/platform.js.map +1 -0
- package/src/gen/agentexecution.ts +7 -1
- package/src/gen/artifact.ts +113 -0
- package/src/gen/authorization-config.ts +1 -0
- package/src/gen/client.ts +6 -1
- package/src/gen/workflow.ts +63 -3
- package/src/gen/workflowexecution.ts +34 -1
- package/src/index.ts +6 -0
- package/src/platform.ts +58 -0
- package/src/stigmer.ts +3 -0
- package/stigmer.d.ts +2 -0
- package/stigmer.d.ts.map +1 -1
- package/stigmer.js +3 -0
- package/stigmer.js.map +1 -1
package/gen/workflowexecution.js
CHANGED
|
@@ -51,6 +51,14 @@ export class WorkflowExecutionClient {
|
|
|
51
51
|
throw wrapError(e);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
async submitWorkflowTaskApproval(input) {
|
|
55
|
+
try {
|
|
56
|
+
return await this.command.submitWorkflowTaskApproval(input);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
throw wrapError(e);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
54
62
|
async delete(id) {
|
|
55
63
|
try {
|
|
56
64
|
return await this.command.delete(create(ApiResourceIdSchema, { value: id }));
|
|
@@ -141,6 +149,40 @@ export class WorkflowExecutionClient {
|
|
|
141
149
|
throw wrapError(e);
|
|
142
150
|
}
|
|
143
151
|
}
|
|
152
|
+
async getEventLog(input) {
|
|
153
|
+
try {
|
|
154
|
+
return await this.query.getEventLog(input);
|
|
155
|
+
}
|
|
156
|
+
catch (e) {
|
|
157
|
+
throw wrapError(e);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async *subscribeEvents(input, signal) {
|
|
161
|
+
try {
|
|
162
|
+
for await (const msg of this.query.subscribeEvents(input, { signal })) {
|
|
163
|
+
yield msg;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
catch (e) {
|
|
167
|
+
throw wrapError(e);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
async getExecutionSummary(input) {
|
|
171
|
+
try {
|
|
172
|
+
return await this.query.getExecutionSummary(input);
|
|
173
|
+
}
|
|
174
|
+
catch (e) {
|
|
175
|
+
throw wrapError(e);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async listPendingApprovals(input) {
|
|
179
|
+
try {
|
|
180
|
+
return await this.query.listPendingApprovals(input);
|
|
181
|
+
}
|
|
182
|
+
catch (e) {
|
|
183
|
+
throw wrapError(e);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
144
186
|
}
|
|
145
187
|
function buildWorkflowExecutionProto(input) {
|
|
146
188
|
let runtimeEnv;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflowexecution.js","sourceRoot":"","sources":["../../src/gen/workflowexecution.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAA0B,MAAM,gEAAgE,CAAC;AACjI,OAAO,EAAE,kCAAkC,EAAE,MAAM,oEAAoE,CAAC;
|
|
1
|
+
{"version":3,"file":"workflowexecution.js","sourceRoot":"","sources":["../../src/gen/workflowexecution.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAA0B,MAAM,gEAAgE,CAAC;AACjI,OAAO,EAAE,kCAAkC,EAAE,MAAM,oEAAoE,CAAC;AAExH,OAAO,EAAE,yBAAyB,EAA8zC,MAAM,+DAA+D,CAAC;AACt6C,OAAO,EAAE,gCAAgC,EAAE,MAAM,kEAAkE,CAAC;AACpH,OAAO,EAAE,2BAA2B,EAAE,MAAM,iEAAiE,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAEvG,0DAA0D;AAC1D,MAAM,OAAO,uBAAuB;IACjB,OAAO,CAAoD;IAC3D,KAAK,CAAkD;IAExE,YAAY,S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CAAC,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,EAAE,cAAc,CAAC;YACtE,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,UAAU;YACV,aAAa,EAAE,KAAK,CAAC,aAAa;SACnC,CAAC,CAAC;KACJ,CAAsB,CAAC;AAC1B,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
|
8
8
|
export { BillingClient, type CreateCheckoutSessionParams, type CreateBillingPortalSessionParams, type SetAutoRechargeConfigParams, type GetCreditLedgerParams, type GetBillingUsageReportParams, type GetCustomerModelPricingParams, } from "./billing";
|
|
9
9
|
export { SearchClient, type SearchParams, type SearchResponse, ApiResourceKind, } from "./search";
|
|
10
10
|
export { GitHubClient, type GetOAuthAuthorizeUrlParams, type OAuthAuthorizeUrlResponse, type ExchangeOAuthCodeParams, type OAuthTokenResponse, } from "./github";
|
|
11
|
+
export { PlatformClient, type ServerInfo, } from "./platform";
|
|
11
12
|
export { type DeleteResourceInput, type ResourceRef, type Page, type ListParams, type ListResult, type EnvSpecInput, type EnvVarInput, } from "./gen/types";
|
|
12
13
|
export { AgentClient, type AgentInput, type McpServerUsageInput, type ToolApprovalOverrideInput, type SubAgentInput, type McpAccessInput, } from "./gen/agent";
|
|
13
14
|
export { AgentExecutionClient, type AgentExecutionInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput, } from "./gen/agentexecution";
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,KAAK,aAAa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
package/index.js
CHANGED
|
@@ -15,6 +15,8 @@ export { BillingClient, } from "./billing";
|
|
|
15
15
|
export { SearchClient, ApiResourceKind, } from "./search";
|
|
16
16
|
// GitHub OAuth client
|
|
17
17
|
export { GitHubClient, } from "./github";
|
|
18
|
+
// Platform client (server info / edition detection)
|
|
19
|
+
export { PlatformClient, } from "./platform";
|
|
18
20
|
// Re-export all resource client classes and input types
|
|
19
21
|
export { AgentClient, } from "./gen/agent";
|
|
20
22
|
export { AgentExecutionClient, } from "./gen/agentexecution";
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,mBAAmB;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,iBAAiB;AACjB,OAAO,EACL,YAAY,EAEZ,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EAEX,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EAEd,gBAAgB,EAChB,cAAc,GACf,MAAM,UAAU,CAAC;AAElB,wBAAwB;AACxB,OAAO,EAEL,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,8CAA8C;AAC9C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AAEpE,iBAAiB;AACjB,OAAO,EACL,aAAa,GAOd,MAAM,WAAW,CAAC;AAEnB,gBAAgB;AAChB,OAAO,EACL,YAAY,EAGZ,eAAe,GAChB,MAAM,UAAU,CAAC;AAElB,sBAAsB;AACtB,OAAO,EACL,YAAY,GAKb,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js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M,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,gBAAgB,GAEjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,GAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,GAKhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,GAErB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAqB,MAAM,eAAe,CAAC;AACjE,OAAO,EACL,aAAa,GAMd,MAAM,eAAe,CAAC;AAEvB,mCAAmC;AACnC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,cAAc,GAMf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,uBAAuB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Stigmer TypeScript SDK — typed API client for all Stigmer platform resources",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@bufbuild/protobuf": "^2.0.0",
|
|
42
42
|
"@connectrpc/connect-node": "^2.0.0",
|
|
43
|
-
"@stigmer/protos": "0.
|
|
43
|
+
"@stigmer/protos": "1.0.1"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/platform.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Transport } from "@connectrpc/connect";
|
|
2
|
+
import { ServerEdition } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
3
|
+
import type { DeploymentMode } from "./resource-availability";
|
|
4
|
+
/** Server identity information returned by {@link PlatformClient.getServerInfo}. */
|
|
5
|
+
export interface ServerInfo {
|
|
6
|
+
/** Server edition mapped to a {@link DeploymentMode}. */
|
|
7
|
+
readonly deploymentMode: DeploymentMode;
|
|
8
|
+
/** Raw server edition enum value. */
|
|
9
|
+
readonly edition: ServerEdition;
|
|
10
|
+
/** Semantic version of the server binary. */
|
|
11
|
+
readonly version: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Client for platform-level queries (server info, capabilities).
|
|
15
|
+
*
|
|
16
|
+
* The {@link getServerInfo} method is the authoritative source for
|
|
17
|
+
* deployment mode detection. It replaces URL-based hostname guessing
|
|
18
|
+
* with a server-reported value.
|
|
19
|
+
*/
|
|
20
|
+
export declare class PlatformClient {
|
|
21
|
+
private readonly platform;
|
|
22
|
+
constructor(transport: Transport);
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve the connected server's edition and version.
|
|
25
|
+
*
|
|
26
|
+
* Maps the proto {@link ServerEdition} to a {@link DeploymentMode}:
|
|
27
|
+
* - `oss` -> `"local"`
|
|
28
|
+
* - `cloud` -> `"cloud"`
|
|
29
|
+
* - unspecified/unknown -> `"cloud"` (safe default)
|
|
30
|
+
*/
|
|
31
|
+
getServerInfo(): Promise<ServerInfo>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAGL,aAAa,EACd,MAAM,uDAAuD,CAAC;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,oFAAoF;AACpF,MAAM,WAAW,UAAU;IACzB,yDAAyD;IACzD,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;gBAEtD,SAAS,EAAE,SAAS;IAIhC;;;;;;;OAOG;IACG,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC;CAc3C"}
|
package/platform.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createClient } from "@connectrpc/connect";
|
|
2
|
+
import { create } from "@bufbuild/protobuf";
|
|
3
|
+
import { GetServerInfoInputSchema, PlatformQueryController, ServerEdition, } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
4
|
+
import { wrapError } from "./gen/errors";
|
|
5
|
+
/**
|
|
6
|
+
* Client for platform-level queries (server info, capabilities).
|
|
7
|
+
*
|
|
8
|
+
* The {@link getServerInfo} method is the authoritative source for
|
|
9
|
+
* deployment mode detection. It replaces URL-based hostname guessing
|
|
10
|
+
* with a server-reported value.
|
|
11
|
+
*/
|
|
12
|
+
export class PlatformClient {
|
|
13
|
+
platform;
|
|
14
|
+
constructor(transport) {
|
|
15
|
+
this.platform = createClient(PlatformQueryController, transport);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve the connected server's edition and version.
|
|
19
|
+
*
|
|
20
|
+
* Maps the proto {@link ServerEdition} to a {@link DeploymentMode}:
|
|
21
|
+
* - `oss` -> `"local"`
|
|
22
|
+
* - `cloud` -> `"cloud"`
|
|
23
|
+
* - unspecified/unknown -> `"cloud"` (safe default)
|
|
24
|
+
*/
|
|
25
|
+
async getServerInfo() {
|
|
26
|
+
try {
|
|
27
|
+
const resp = await this.platform.getServerInfo(create(GetServerInfoInputSchema, {}));
|
|
28
|
+
return {
|
|
29
|
+
deploymentMode: resp.edition === ServerEdition.oss ? "local" : "cloud",
|
|
30
|
+
edition: resp.edition,
|
|
31
|
+
version: resp.version,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
throw wrapError(e);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=platform.js.map
|
package/platform.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,GACd,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAazC;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IACR,QAAQ,CAAyC;IAElE,YAAY,SAAoB;QAC9B,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,aAAa;QACjB,IAAI,CAAC;YACH,MAAM,IAAI,GAAwB,MAAM,IAAI,CAAC,QAAQ,CAAC,aAAa,CACjE,MAAM,CAAC,wBAAwB,EAAE,EAAE,CAAC,CACrC,CAAC;YACF,OAAO;gBACL,cAAc,EAAE,IAAI,CAAC,OAAO,KAAK,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;gBACtE,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -7,7 +7,7 @@ import { create } from "@bufbuild/protobuf";
|
|
|
7
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
8
|
import { AgentExecutionSchema, type AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
9
9
|
import { AgentExecutionCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/command_pb";
|
|
10
|
-
import { AgentExecutionIdSchema, AgentExecutionUpdateStatusInputSchema, UpdateStatusResponseSchema, SubmitApprovalInputSchema, CancelAgentExecutionInputSchema, TerminateAgentExecutionInputSchema, RecoverAgentExecutionInputSchema, PauseAgentExecutionInputSchema, ResumeAgentExecutionInputSchema, UploadAttachmentRequestSchema, UploadAttachmentResponseSchema, ListAgentExecutionsRequestSchema, AgentExecutionListSchema, ListAgentExecutionsBySessionRequestSchema, GetArtifactDownloadUrlRequestSchema, GetArtifactDownloadUrlResponseSchema, GetArtifactContentRequestSchema, GetArtifactContentResponseSchema, GetExecutionUsageReportInputSchema, GetExecutionUsageReportOutputSchema, GetSessionUsageReportInputSchema, GetSessionUsageReportOutputSchema, GetAgentUsageReportInputSchema, GetAgentUsageReportOutputSchema, GetOrgUsageReportInputSchema, GetOrgUsageReportOutputSchema, type AgentExecutionUpdateStatusInput, type UpdateStatusResponse, type SubmitApprovalInput, type CancelAgentExecutionInput, type TerminateAgentExecutionInput, type RecoverAgentExecutionInput, type PauseAgentExecutionInput, type ResumeAgentExecutionInput, type UploadAttachmentRequest, type UploadAttachmentResponse, type ListAgentExecutionsRequest, type AgentExecutionList, type ListAgentExecutionsBySessionRequest, type GetArtifactDownloadUrlRequest, type GetArtifactDownloadUrlResponse, type GetArtifactContentRequest, type GetArtifactContentResponse, type GetExecutionUsageReportInput, type GetExecutionUsageReportOutput, type GetSessionUsageReportInput, type GetSessionUsageReportOutput, type GetAgentUsageReportInput, type GetAgentUsageReportOutput, type GetOrgUsageReportInput, type GetOrgUsageReportOutput } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
|
|
10
|
+
import { AgentExecutionIdSchema, AgentExecutionUpdateStatusInputSchema, UpdateStatusResponseSchema, SubmitApprovalInputSchema, CancelAgentExecutionInputSchema, TerminateAgentExecutionInputSchema, RecoverAgentExecutionInputSchema, PauseAgentExecutionInputSchema, ResumeAgentExecutionInputSchema, UploadAttachmentRequestSchema, UploadAttachmentResponseSchema, ListAgentExecutionsRequestSchema, AgentExecutionListSchema, ListAgentExecutionsBySessionRequestSchema, GetArtifactDownloadUrlRequestSchema, GetArtifactDownloadUrlResponseSchema, GetArtifactContentRequestSchema, GetArtifactContentResponseSchema, GetExecutionUsageReportInputSchema, GetExecutionUsageReportOutputSchema, GetSessionUsageReportInputSchema, GetSessionUsageReportOutputSchema, GetAgentUsageReportInputSchema, GetAgentUsageReportOutputSchema, GetOrgUsageReportInputSchema, GetOrgUsageReportOutputSchema, GetAgentExecutionSummaryRequestSchema, AgentExecutionSummarySchema, type AgentExecutionUpdateStatusInput, type UpdateStatusResponse, type SubmitApprovalInput, type CancelAgentExecutionInput, type TerminateAgentExecutionInput, type RecoverAgentExecutionInput, type PauseAgentExecutionInput, type ResumeAgentExecutionInput, type UploadAttachmentRequest, type UploadAttachmentResponse, type ListAgentExecutionsRequest, type AgentExecutionList, type ListAgentExecutionsBySessionRequest, type GetArtifactDownloadUrlRequest, type GetArtifactDownloadUrlResponse, type GetArtifactContentRequest, type GetArtifactContentResponse, type GetExecutionUsageReportInput, type GetExecutionUsageReportOutput, type GetSessionUsageReportInput, type GetSessionUsageReportOutput, type GetAgentUsageReportInput, type GetAgentUsageReportOutput, type GetOrgUsageReportInput, type GetOrgUsageReportOutput, type GetAgentExecutionSummaryRequest, type AgentExecutionSummary } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
|
|
11
11
|
import { AgentExecutionQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/query_pb";
|
|
12
12
|
import { AgentExecutionSpecSchema, ContextManagementConfigSchema, ExecutionConfigSchema, AttachmentSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
|
|
13
13
|
import { ExecutionValueSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/spec_pb";
|
|
@@ -151,6 +151,12 @@ export class AgentExecutionClient {
|
|
|
151
151
|
return await this.query.getOrgUsageReport(input);
|
|
152
152
|
} catch (e) { throw wrapError(e); }
|
|
153
153
|
}
|
|
154
|
+
|
|
155
|
+
async getExecutionSummary(input: GetAgentExecutionSummaryRequest): Promise<AgentExecutionSummary> {
|
|
156
|
+
try {
|
|
157
|
+
return await this.query.getExecutionSummary(input);
|
|
158
|
+
} catch (e) { throw wrapError(e); }
|
|
159
|
+
}
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
/** Input for creating/updating a AgentExecution. */
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
5
|
+
import { create } from "@bufbuild/protobuf";
|
|
6
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
|
+
import { ArtifactSchema, type Artifact } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/api_pb";
|
|
8
|
+
import { ArtifactCommandController } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/command_pb";
|
|
9
|
+
import { ArtifactIdSchema, CreateArtifactInputSchema, ListArtifactsByExecutionRequestSchema, ArtifactListSchema, ArtifactDownloadUrlSchema, type CreateArtifactInput, type ListArtifactsByExecutionRequest, type ArtifactList, type ArtifactDownloadUrl } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/io_pb";
|
|
10
|
+
import { ArtifactQueryController } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/query_pb";
|
|
11
|
+
import { ArtifactSpecSchema, ArtifactSourceSchema, RetentionPolicySchema } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/spec_pb";
|
|
12
|
+
import { ApiResourceIdSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
13
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
14
|
+
|
|
15
|
+
/** Provides operations on artifact resources. */
|
|
16
|
+
export class ArtifactClient {
|
|
17
|
+
private readonly command: Client<typeof ArtifactCommandController>;
|
|
18
|
+
private readonly query: Client<typeof ArtifactQueryController>;
|
|
19
|
+
|
|
20
|
+
constructor(transport: Transport) {
|
|
21
|
+
this.command = createClient(ArtifactCommandController, transport);
|
|
22
|
+
this.query = createClient(ArtifactQueryController, transport);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async create(input: CreateArtifactInput): Promise<Artifact> {
|
|
26
|
+
try {
|
|
27
|
+
return await this.command.create(input);
|
|
28
|
+
} catch (e) { throw wrapError(e); }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async delete(id: string): Promise<Artifact> {
|
|
32
|
+
try {
|
|
33
|
+
return await this.command.delete(create(ApiResourceIdSchema, { value: id }));
|
|
34
|
+
} catch (e) { throw wrapError(e); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async get(id: string): Promise<Artifact> {
|
|
38
|
+
try {
|
|
39
|
+
return await this.query.get(create(ArtifactIdSchema, { value: id }));
|
|
40
|
+
} catch (e) { throw wrapError(e); }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async listByExecution(input: ListArtifactsByExecutionRequest): Promise<ArtifactList> {
|
|
44
|
+
try {
|
|
45
|
+
return await this.query.listByExecution(input);
|
|
46
|
+
} catch (e) { throw wrapError(e); }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async getDownloadUrl(id: string): Promise<ArtifactDownloadUrl> {
|
|
50
|
+
try {
|
|
51
|
+
return await this.query.getDownloadUrl(create(ArtifactIdSchema, { value: id }));
|
|
52
|
+
} catch (e) { throw wrapError(e); }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Input for creating/updating a Artifact. */
|
|
57
|
+
export interface ArtifactInput {
|
|
58
|
+
name: string;
|
|
59
|
+
slug?: string;
|
|
60
|
+
org: string;
|
|
61
|
+
labels?: Record<string, string>;
|
|
62
|
+
contentType: string;
|
|
63
|
+
displayName: string;
|
|
64
|
+
source: ArtifactSourceInput;
|
|
65
|
+
retention?: RetentionPolicyInput;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** SDK input type for ArtifactSource. */
|
|
69
|
+
export interface ArtifactSourceInput {
|
|
70
|
+
workflowExecutionId?: string;
|
|
71
|
+
agentExecutionId?: string;
|
|
72
|
+
taskName?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** SDK input type for RetentionPolicy. */
|
|
76
|
+
export interface RetentionPolicyInput {
|
|
77
|
+
ttlDays?: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function buildArtifactSourceProto(input: ArtifactSourceInput) {
|
|
81
|
+
return Object.assign(create(ArtifactSourceSchema), stripUndefined({
|
|
82
|
+
workflowExecutionId: input.workflowExecutionId,
|
|
83
|
+
agentExecutionId: input.agentExecutionId,
|
|
84
|
+
taskName: input.taskName,
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function buildRetentionPolicyProto(input: RetentionPolicyInput) {
|
|
89
|
+
return Object.assign(create(RetentionPolicySchema), stripUndefined({
|
|
90
|
+
ttlDays: input.ttlDays,
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function buildArtifactProto(input: ArtifactInput): Artifact {
|
|
95
|
+
const source = input.source ? buildArtifactSourceProto(input.source) : undefined;
|
|
96
|
+
const retention = input.retention ? buildRetentionPolicyProto(input.retention) : undefined;
|
|
97
|
+
return Object.assign(create(ArtifactSchema), {
|
|
98
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
99
|
+
kind: "Artifact",
|
|
100
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
101
|
+
name: input.name,
|
|
102
|
+
org: input.org,
|
|
103
|
+
...(input.slug && { slug: input.slug }),
|
|
104
|
+
...(input.labels && { labels: input.labels }),
|
|
105
|
+
}),
|
|
106
|
+
spec: Object.assign(create(ArtifactSpecSchema), stripUndefined({
|
|
107
|
+
contentType: input.contentType,
|
|
108
|
+
displayName: input.displayName,
|
|
109
|
+
source,
|
|
110
|
+
retention,
|
|
111
|
+
})),
|
|
112
|
+
}) as Artifact;
|
|
113
|
+
}
|
|
@@ -28,5 +28,6 @@ export const GRANTABLE_ROLES: ReadonlyMap<ApiResourceKind, readonly IamRole[]> =
|
|
|
28
28
|
[ApiResourceKind.workflow_instance, [IamRole.owner, IamRole.viewer]],
|
|
29
29
|
[ApiResourceKind.workflow_execution, [IamRole.owner, IamRole.viewer]],
|
|
30
30
|
[ApiResourceKind.environment, [IamRole.owner, IamRole.viewer]],
|
|
31
|
+
[ApiResourceKind.artifact, [IamRole.owner, IamRole.viewer]],
|
|
31
32
|
[ApiResourceKind.project, [IamRole.owner, IamRole.viewer]],
|
|
32
33
|
]);
|
package/src/gen/client.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { AgentClient } from "./agent";
|
|
|
5
5
|
import { AgentExecutionClient } from "./agentexecution";
|
|
6
6
|
import { AgentInstanceClient } from "./agentinstance";
|
|
7
7
|
import { ApiKeyClient } from "./apikey";
|
|
8
|
+
import { ArtifactClient } from "./artifact";
|
|
8
9
|
import { EnvironmentClient } from "./environment";
|
|
9
10
|
import { ExecutionContextClient } from "./executioncontext";
|
|
10
11
|
import { IamPolicyClient } from "./iampolicy";
|
|
@@ -29,6 +30,7 @@ export class GeneratedClient {
|
|
|
29
30
|
readonly agentExecution: AgentExecutionClient;
|
|
30
31
|
readonly agentInstance: AgentInstanceClient;
|
|
31
32
|
readonly apiKey: ApiKeyClient;
|
|
33
|
+
readonly artifact: ArtifactClient;
|
|
32
34
|
readonly environment: EnvironmentClient;
|
|
33
35
|
readonly executionContext: ExecutionContextClient;
|
|
34
36
|
readonly iamPolicy: IamPolicyClient;
|
|
@@ -52,6 +54,7 @@ export class GeneratedClient {
|
|
|
52
54
|
this.agentExecution = new AgentExecutionClient(transport);
|
|
53
55
|
this.agentInstance = new AgentInstanceClient(transport);
|
|
54
56
|
this.apiKey = new ApiKeyClient(transport);
|
|
57
|
+
this.artifact = new ArtifactClient(transport);
|
|
55
58
|
this.environment = new EnvironmentClient(transport);
|
|
56
59
|
this.executionContext = new ExecutionContextClient(transport);
|
|
57
60
|
this.iamPolicy = new IamPolicyClient(transport);
|
|
@@ -81,6 +84,8 @@ export { AgentInstanceClient } from "./agentinstance";
|
|
|
81
84
|
export { type AgentInstanceInput } from "./agentinstance";
|
|
82
85
|
export { ApiKeyClient } from "./apikey";
|
|
83
86
|
export { type ApiKeyInput } from "./apikey";
|
|
87
|
+
export { ArtifactClient } from "./artifact";
|
|
88
|
+
export { type ArtifactInput, type ArtifactSourceInput, type RetentionPolicyInput } from "./artifact";
|
|
84
89
|
export { EnvironmentClient } from "./environment";
|
|
85
90
|
export { type EnvironmentInput } from "./environment";
|
|
86
91
|
export { ExecutionContextClient } from "./executioncontext";
|
|
@@ -110,7 +115,7 @@ export { type SessionInput, type WorkspaceEntryInput, type WorkspaceSourceInput,
|
|
|
110
115
|
export { SkillClient } from "./skill";
|
|
111
116
|
export { type SkillInput } from "./skill";
|
|
112
117
|
export { WorkflowClient } from "./workflow";
|
|
113
|
-
export { type WorkflowInput, type WorkflowDocumentInput, type WorkflowTaskInput, type ExportInput, type FlowControlInput } from "./workflow";
|
|
118
|
+
export { type WorkflowInput, type WorkflowDocumentInput, type WorkflowTaskInput, type ExportInput, type FlowControlInput, type WorkflowBudgetInput } from "./workflow";
|
|
114
119
|
export { WorkflowExecutionClient } from "./workflowexecution";
|
|
115
120
|
export { type WorkflowExecutionInput } from "./workflowexecution";
|
|
116
121
|
export { WorkflowInstanceClient } from "./workflowinstance";
|
package/src/gen/workflow.ts
CHANGED
|
@@ -2,28 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
4
|
import { stripUndefined } from "./proto-utils";
|
|
5
|
-
import { type ResourceRef } from "./types";
|
|
5
|
+
import { type ListParams, type ListResult, type ResourceRef } from "./types";
|
|
6
6
|
import { create, type JsonObject } from "@bufbuild/protobuf";
|
|
7
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
8
|
import { EnvVarDeclarationSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
9
9
|
import { WorkflowSchema, type Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
10
10
|
import { WorkflowCommandController } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/command_pb";
|
|
11
|
-
import { WorkflowTaskKind } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/enum_pb";
|
|
11
|
+
import { WorkflowTaskKind, BudgetExceededPolicy } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/enum_pb";
|
|
12
12
|
import { WorkflowIdSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/io_pb";
|
|
13
13
|
import { WorkflowQueryController } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/query_pb";
|
|
14
|
-
import {
|
|
14
|
+
import { type ServerlessWorkflowValidation } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/serverless/validation_pb";
|
|
15
|
+
import { WorkflowSpecSchema, WorkflowDocumentSchema, ExportSchema, FlowControlSchema, WorkflowTaskSchema, WorkflowBudgetSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/spec_pb";
|
|
16
|
+
import { GetTaskKindRegistryRequestSchema, GetTaskKindRegistryResponseSchema, type GetTaskKindRegistryRequest, type GetTaskKindRegistryResponse } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/task_kind_descriptor_pb";
|
|
17
|
+
import { TaskKindRegistryQueryController } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/task_kind_registry_query_pb";
|
|
15
18
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
16
19
|
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
17
20
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
21
|
+
import { PageInfoSchema } from "@stigmer/protos/ai/stigmer/commons/rpc/pagination_pb";
|
|
22
|
+
import { SearchRequestSchema } from "@stigmer/protos/ai/stigmer/search/v1/io_pb";
|
|
23
|
+
import { SearchService } from "@stigmer/protos/ai/stigmer/search/v1/query_pb";
|
|
18
24
|
|
|
19
25
|
/** Provides operations on workflow resources. */
|
|
20
26
|
export class WorkflowClient {
|
|
21
27
|
private readonly command: Client<typeof WorkflowCommandController>;
|
|
22
28
|
private readonly query: Client<typeof WorkflowQueryController>;
|
|
29
|
+
private readonly taskKindRegistryQuery: Client<typeof TaskKindRegistryQueryController>;
|
|
30
|
+
private readonly search: Client<typeof SearchService>;
|
|
23
31
|
|
|
24
32
|
constructor(transport: Transport) {
|
|
25
33
|
this.command = createClient(WorkflowCommandController, transport);
|
|
26
34
|
this.query = createClient(WorkflowQueryController, transport);
|
|
35
|
+
this.taskKindRegistryQuery = createClient(TaskKindRegistryQueryController, transport);
|
|
36
|
+
this.search = createClient(SearchService, transport);
|
|
27
37
|
}
|
|
28
38
|
|
|
29
39
|
async apply(input: WorkflowInput): Promise<Workflow> {
|
|
@@ -50,6 +60,12 @@ export class WorkflowClient {
|
|
|
50
60
|
} catch (e) { throw wrapError(e); }
|
|
51
61
|
}
|
|
52
62
|
|
|
63
|
+
async validateSpec(input: WorkflowInput): Promise<ServerlessWorkflowValidation> {
|
|
64
|
+
try {
|
|
65
|
+
return await this.command.validateSpec(buildWorkflowProto(input));
|
|
66
|
+
} catch (e) { throw wrapError(e); }
|
|
67
|
+
}
|
|
68
|
+
|
|
53
69
|
async get(id: string): Promise<Workflow> {
|
|
54
70
|
try {
|
|
55
71
|
return await this.query.get(create(WorkflowIdSchema, { value: id }));
|
|
@@ -61,6 +77,30 @@ export class WorkflowClient {
|
|
|
61
77
|
return await this.query.getByReference(create(ApiResourceReferenceSchema, { ...ref, kind: ApiResourceKind.workflow }));
|
|
62
78
|
} catch (e) { throw wrapError(e); }
|
|
63
79
|
}
|
|
80
|
+
|
|
81
|
+
async getTaskKindRegistry(input: GetTaskKindRegistryRequest): Promise<GetTaskKindRegistryResponse> {
|
|
82
|
+
try {
|
|
83
|
+
return await this.taskKindRegistryQuery.getTaskKindRegistry(input);
|
|
84
|
+
} catch (e) { throw wrapError(e); }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async list(params: ListParams): Promise<ListResult> {
|
|
88
|
+
try {
|
|
89
|
+
const resp = await this.search.search(create(SearchRequestSchema, {
|
|
90
|
+
kinds: [ApiResourceKind.workflow],
|
|
91
|
+
query: params.query,
|
|
92
|
+
org: params.org,
|
|
93
|
+
excludePublic: params.excludePublic ?? false,
|
|
94
|
+
crossOrgPublic: params.crossOrgPublic ?? false,
|
|
95
|
+
page: params.page ? create(PageInfoSchema, params.page) : undefined,
|
|
96
|
+
}));
|
|
97
|
+
return {
|
|
98
|
+
entries: resp.entries,
|
|
99
|
+
totalCount: resp.totalCount,
|
|
100
|
+
totalPages: resp.totalPages,
|
|
101
|
+
};
|
|
102
|
+
} catch (e) { throw wrapError(e); }
|
|
103
|
+
}
|
|
64
104
|
}
|
|
65
105
|
|
|
66
106
|
/** Input for creating/updating a Workflow. */
|
|
@@ -73,6 +113,7 @@ export interface WorkflowInput {
|
|
|
73
113
|
document: WorkflowDocumentInput;
|
|
74
114
|
tasks?: WorkflowTaskInput[];
|
|
75
115
|
env?: Record<string, EnvVarDeclarationInput>;
|
|
116
|
+
budget?: WorkflowBudgetInput;
|
|
76
117
|
}
|
|
77
118
|
|
|
78
119
|
/** SDK input type for WorkflowDocument. */
|
|
@@ -110,6 +151,14 @@ export interface EnvVarDeclarationInput {
|
|
|
110
151
|
optional?: boolean;
|
|
111
152
|
}
|
|
112
153
|
|
|
154
|
+
/** SDK input type for WorkflowBudget. */
|
|
155
|
+
export interface WorkflowBudgetInput {
|
|
156
|
+
maxCostMicros?: bigint;
|
|
157
|
+
maxTotalTokens?: bigint;
|
|
158
|
+
maxDurationSeconds?: number;
|
|
159
|
+
onExceeded?: BudgetExceededPolicy;
|
|
160
|
+
}
|
|
161
|
+
|
|
113
162
|
function buildWorkflowDocumentProto(input: WorkflowDocumentInput) {
|
|
114
163
|
return Object.assign(create(WorkflowDocumentSchema), stripUndefined({
|
|
115
164
|
dsl: input.dsl,
|
|
@@ -150,6 +199,15 @@ function buildEnvVarDeclarationProto(input: EnvVarDeclarationInput) {
|
|
|
150
199
|
}));
|
|
151
200
|
}
|
|
152
201
|
|
|
202
|
+
function buildWorkflowBudgetProto(input: WorkflowBudgetInput) {
|
|
203
|
+
return Object.assign(create(WorkflowBudgetSchema), stripUndefined({
|
|
204
|
+
maxCostMicros: input.maxCostMicros,
|
|
205
|
+
maxTotalTokens: input.maxTotalTokens,
|
|
206
|
+
maxDurationSeconds: input.maxDurationSeconds,
|
|
207
|
+
onExceeded: input.onExceeded,
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
|
|
153
211
|
function buildWorkflowProto(input: WorkflowInput): Workflow {
|
|
154
212
|
const document = input.document ? buildWorkflowDocumentProto(input.document) : undefined;
|
|
155
213
|
const tasks = input.tasks?.map(buildWorkflowTaskProto);
|
|
@@ -157,6 +215,7 @@ function buildWorkflowProto(input: WorkflowInput): Workflow {
|
|
|
157
215
|
if (input.env) {
|
|
158
216
|
env = Object.fromEntries(Object.entries(input.env).map(([k, v]) => [k, buildEnvVarDeclarationProto(v)]));
|
|
159
217
|
}
|
|
218
|
+
const budget = input.budget ? buildWorkflowBudgetProto(input.budget) : undefined;
|
|
160
219
|
return Object.assign(create(WorkflowSchema), {
|
|
161
220
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
162
221
|
kind: "Workflow",
|
|
@@ -171,6 +230,7 @@ function buildWorkflowProto(input: WorkflowInput): Workflow {
|
|
|
171
230
|
document,
|
|
172
231
|
tasks,
|
|
173
232
|
env,
|
|
233
|
+
budget,
|
|
174
234
|
})),
|
|
175
235
|
}) as Workflow;
|
|
176
236
|
}
|
|
@@ -8,7 +8,8 @@ import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
|
8
8
|
import { ExecutionValueSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/spec_pb";
|
|
9
9
|
import { WorkflowExecutionSchema, type WorkflowExecution } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/api_pb";
|
|
10
10
|
import { WorkflowExecutionCommandController } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/command_pb";
|
|
11
|
-
import {
|
|
11
|
+
import { WorkflowExecutionEventSchema, type WorkflowExecutionEvent } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/event_pb";
|
|
12
|
+
import { WorkflowExecutionIdSchema, WorkflowExecutionUpdateStatusInputSchema, SubmitWorkflowApprovalInputSchema, SubmitWorkflowTaskApprovalInputSchema, SendSignalInputSchema, CancelWorkflowExecutionInputSchema, TerminateWorkflowExecutionInputSchema, RecoverWorkflowExecutionInputSchema, PauseWorkflowExecutionInputSchema, ResumeWorkflowExecutionInputSchema, ListWorkflowExecutionsRequestSchema, WorkflowExecutionListSchema, ListWorkflowExecutionsByWorkflowRequestSchema, SubscribeWorkflowExecutionRequestSchema, GetEventLogRequestSchema, GetEventLogResponseSchema, SubscribeEventsRequestSchema, GetExecutionSummaryRequestSchema, ExecutionSummarySchema, ListPendingApprovalsRequestSchema, PendingApprovalsListSchema, type WorkflowExecutionUpdateStatusInput, type SubmitWorkflowApprovalInput, type SubmitWorkflowTaskApprovalInput, type SendSignalInput, type CancelWorkflowExecutionInput, type TerminateWorkflowExecutionInput, type RecoverWorkflowExecutionInput, type PauseWorkflowExecutionInput, type ResumeWorkflowExecutionInput, type ListWorkflowExecutionsRequest, type WorkflowExecutionList, type ListWorkflowExecutionsByWorkflowRequest, type SubscribeWorkflowExecutionRequest, type GetEventLogRequest, type GetEventLogResponse, type SubscribeEventsRequest, type GetExecutionSummaryRequest, type ExecutionSummary, type ListPendingApprovalsRequest, type PendingApprovalsList } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/io_pb";
|
|
12
13
|
import { WorkflowExecutionQueryController } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/query_pb";
|
|
13
14
|
import { WorkflowExecutionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/spec_pb";
|
|
14
15
|
import { ApiResourceIdSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
@@ -48,6 +49,12 @@ export class WorkflowExecutionClient {
|
|
|
48
49
|
} catch (e) { throw wrapError(e); }
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
async submitWorkflowTaskApproval(input: SubmitWorkflowTaskApprovalInput): Promise<WorkflowExecution> {
|
|
53
|
+
try {
|
|
54
|
+
return await this.command.submitWorkflowTaskApproval(input);
|
|
55
|
+
} catch (e) { throw wrapError(e); }
|
|
56
|
+
}
|
|
57
|
+
|
|
51
58
|
async delete(id: string): Promise<WorkflowExecution> {
|
|
52
59
|
try {
|
|
53
60
|
return await this.command.delete(create(ApiResourceIdSchema, { value: id }));
|
|
@@ -115,6 +122,32 @@ export class WorkflowExecutionClient {
|
|
|
115
122
|
}
|
|
116
123
|
} catch (e) { throw wrapError(e); }
|
|
117
124
|
}
|
|
125
|
+
|
|
126
|
+
async getEventLog(input: GetEventLogRequest): Promise<GetEventLogResponse> {
|
|
127
|
+
try {
|
|
128
|
+
return await this.query.getEventLog(input);
|
|
129
|
+
} catch (e) { throw wrapError(e); }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async *subscribeEvents(input: SubscribeEventsRequest, signal?: AbortSignal): AsyncGenerator<WorkflowExecutionEvent> {
|
|
133
|
+
try {
|
|
134
|
+
for await (const msg of this.query.subscribeEvents(input, { signal })) {
|
|
135
|
+
yield msg;
|
|
136
|
+
}
|
|
137
|
+
} catch (e) { throw wrapError(e); }
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async getExecutionSummary(input: GetExecutionSummaryRequest): Promise<ExecutionSummary> {
|
|
141
|
+
try {
|
|
142
|
+
return await this.query.getExecutionSummary(input);
|
|
143
|
+
} catch (e) { throw wrapError(e); }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async listPendingApprovals(input: ListPendingApprovalsRequest): Promise<PendingApprovalsList> {
|
|
147
|
+
try {
|
|
148
|
+
return await this.query.listPendingApprovals(input);
|
|
149
|
+
} catch (e) { throw wrapError(e); }
|
|
150
|
+
}
|
|
118
151
|
}
|
|
119
152
|
|
|
120
153
|
/** Input for creating/updating a WorkflowExecution. */
|
package/src/index.ts
CHANGED
|
@@ -72,6 +72,12 @@ export {
|
|
|
72
72
|
type OAuthTokenResponse,
|
|
73
73
|
} from "./github";
|
|
74
74
|
|
|
75
|
+
// Platform client (server info / edition detection)
|
|
76
|
+
export {
|
|
77
|
+
PlatformClient,
|
|
78
|
+
type ServerInfo,
|
|
79
|
+
} from "./platform";
|
|
80
|
+
|
|
75
81
|
// Shared types (from generated code)
|
|
76
82
|
export {
|
|
77
83
|
type DeleteResourceInput,
|