@stigmer/sdk 0.0.36 → 0.0.39
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/__tests__/config.test.d.ts +2 -0
- package/__tests__/config.test.d.ts.map +1 -0
- package/__tests__/config.test.js +35 -0
- package/__tests__/config.test.js.map +1 -0
- package/__tests__/errors.test.d.ts +2 -0
- package/__tests__/errors.test.d.ts.map +1 -0
- package/__tests__/errors.test.js +125 -0
- package/__tests__/errors.test.js.map +1 -0
- package/__tests__/gen/errors.test.d.ts +2 -0
- package/__tests__/gen/errors.test.d.ts.map +1 -0
- package/__tests__/gen/errors.test.js +97 -0
- package/__tests__/gen/errors.test.js.map +1 -0
- package/__tests__/gen/proto-utils.test.d.ts +2 -0
- package/__tests__/gen/proto-utils.test.d.ts.map +1 -0
- package/__tests__/gen/proto-utils.test.js +45 -0
- package/__tests__/gen/proto-utils.test.js.map +1 -0
- package/__tests__/gen/session-client.test.d.ts +2 -0
- package/__tests__/gen/session-client.test.d.ts.map +1 -0
- package/__tests__/gen/session-client.test.js +148 -0
- package/__tests__/gen/session-client.test.js.map +1 -0
- package/gen/agent.d.ts +4 -0
- package/gen/agent.d.ts.map +1 -1
- package/gen/agent.js +69 -7
- package/gen/agent.js.map +1 -1
- package/gen/agentexecution.d.ts +4 -1
- package/gen/agentexecution.d.ts.map +1 -1
- package/gen/agentexecution.js +55 -6
- package/gen/agentexecution.js.map +1 -1
- package/gen/agentinstance.d.ts +4 -1
- package/gen/agentinstance.d.ts.map +1 -1
- package/gen/agentinstance.js +15 -3
- package/gen/agentinstance.js.map +1 -1
- package/gen/apikey.d.ts +2 -0
- package/gen/apikey.d.ts.map +1 -1
- package/gen/apikey.js +5 -2
- package/gen/apikey.js.map +1 -1
- package/gen/environment.d.ts +8 -0
- package/gen/environment.d.ts.map +1 -1
- package/gen/environment.js +43 -4
- package/gen/environment.js.map +1 -1
- package/gen/executioncontext.d.ts +2 -0
- package/gen/executioncontext.d.ts.map +1 -1
- package/gen/executioncontext.js +11 -4
- package/gen/executioncontext.js.map +1 -1
- package/gen/iampolicy.d.ts +2 -0
- package/gen/iampolicy.d.ts.map +1 -1
- package/gen/iampolicy.js +17 -5
- package/gen/iampolicy.js.map +1 -1
- package/gen/identityaccount.d.ts +2 -0
- package/gen/identityaccount.d.ts.map +1 -1
- package/gen/identityaccount.js +8 -3
- package/gen/identityaccount.js.map +1 -1
- package/gen/identityprovider.d.ts +2 -0
- package/gen/identityprovider.d.ts.map +1 -1
- package/gen/identityprovider.js +5 -2
- package/gen/identityprovider.js.map +1 -1
- package/gen/mcpserver.d.ts +2 -0
- package/gen/mcpserver.d.ts.map +1 -1
- package/gen/mcpserver.js +49 -10
- package/gen/mcpserver.js.map +1 -1
- package/gen/organization.d.ts +2 -0
- package/gen/organization.d.ts.map +1 -1
- package/gen/organization.js +8 -3
- package/gen/organization.js.map +1 -1
- package/gen/project.d.ts +2 -0
- package/gen/project.d.ts.map +1 -1
- package/gen/project.js +7 -3
- package/gen/project.js.map +1 -1
- package/gen/proto-utils.d.ts +6 -0
- package/gen/proto-utils.d.ts.map +1 -0
- package/gen/proto-utils.js +15 -0
- package/gen/proto-utils.js.map +1 -0
- package/gen/session.d.ts +18 -1
- package/gen/session.d.ts.map +1 -1
- package/gen/session.js +62 -3
- package/gen/session.js.map +1 -1
- package/gen/skill.d.ts +4 -1
- package/gen/skill.d.ts.map +1 -1
- package/gen/skill.js +13 -2
- package/gen/skill.js.map +1 -1
- package/gen/workflow.d.ts +2 -0
- package/gen/workflow.d.ts.map +1 -1
- package/gen/workflow.js +53 -6
- package/gen/workflow.js.map +1 -1
- package/gen/workflowexecution.d.ts +2 -0
- package/gen/workflowexecution.d.ts.map +1 -1
- package/gen/workflowexecution.js +11 -3
- package/gen/workflowexecution.js.map +1 -1
- package/gen/workflowinstance.d.ts +3 -1
- package/gen/workflowinstance.d.ts.map +1 -1
- package/gen/workflowinstance.js +7 -3
- package/gen/workflowinstance.js.map +1 -1
- package/github.d.ts +38 -0
- package/github.d.ts.map +1 -0
- package/github.js +51 -0
- package/github.js.map +1 -0
- 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/src/__tests__/config.test.ts +52 -0
- package/src/__tests__/errors.test.ts +188 -0
- package/src/__tests__/gen/errors.test.ts +138 -0
- package/src/__tests__/gen/proto-utils.test.ts +53 -0
- package/src/__tests__/gen/session-client.test.ts +202 -0
- package/src/gen/agent.ts +65 -8
- package/src/gen/agentexecution.ts +55 -7
- package/src/gen/agentinstance.ts +16 -4
- package/src/gen/apikey.ts +7 -2
- package/src/gen/environment.ts +39 -4
- package/src/gen/executioncontext.ts +14 -4
- package/src/gen/iampolicy.ts +19 -4
- package/src/gen/identityaccount.ts +10 -3
- package/src/gen/identityprovider.ts +7 -2
- package/src/gen/mcpserver.ts +53 -10
- package/src/gen/organization.ts +10 -4
- package/src/gen/project.ts +9 -3
- package/src/gen/proto-utils.ts +15 -0
- package/src/gen/session.ts +82 -4
- package/src/gen/skill.ts +14 -3
- package/src/gen/workflow.ts +54 -6
- package/src/gen/workflowexecution.ts +14 -3
- package/src/gen/workflowinstance.ts +10 -4
- package/src/github.ts +89 -0
- package/src/index.ts +9 -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/src/gen/iampolicy.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { create } from "@bufbuild/protobuf";
|
|
5
6
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
6
7
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
@@ -78,7 +79,9 @@ export class IamPolicyClient {
|
|
|
78
79
|
/** Input for creating/updating a IamPolicy. */
|
|
79
80
|
export interface IamPolicyInput {
|
|
80
81
|
name: string;
|
|
82
|
+
slug?: string;
|
|
81
83
|
org: string;
|
|
84
|
+
labels?: Record<string, string>;
|
|
82
85
|
principal: ApiResourceRefInput;
|
|
83
86
|
resource: ApiResourceRefInput;
|
|
84
87
|
relation: string;
|
|
@@ -91,18 +94,30 @@ export interface ApiResourceRefInput {
|
|
|
91
94
|
relation?: string;
|
|
92
95
|
}
|
|
93
96
|
|
|
97
|
+
function buildApiResourceRefProto(input: ApiResourceRefInput) {
|
|
98
|
+
return Object.assign(create(ApiResourceRefSchema), stripUndefined({
|
|
99
|
+
kind: input.kind,
|
|
100
|
+
id: input.id,
|
|
101
|
+
relation: input.relation,
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
|
|
94
105
|
function buildIamPolicyProto(input: IamPolicyInput): IamPolicy {
|
|
106
|
+
const principal = input.principal ? buildApiResourceRefProto(input.principal) : undefined;
|
|
107
|
+
const resource = input.resource ? buildApiResourceRefProto(input.resource) : undefined;
|
|
95
108
|
return Object.assign(create(IamPolicySchema), {
|
|
96
109
|
apiVersion: "iam.stigmer.ai/v1",
|
|
97
110
|
kind: "IamPolicy",
|
|
98
111
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
99
112
|
name: input.name,
|
|
100
113
|
org: input.org,
|
|
114
|
+
...(input.slug && { slug: input.slug }),
|
|
115
|
+
...(input.labels && { labels: input.labels }),
|
|
101
116
|
}),
|
|
102
|
-
spec: Object.assign(create(IamPolicySpecSchema), {
|
|
103
|
-
principal
|
|
104
|
-
resource
|
|
117
|
+
spec: Object.assign(create(IamPolicySpecSchema), stripUndefined({
|
|
118
|
+
principal,
|
|
119
|
+
resource,
|
|
105
120
|
relation: input.relation,
|
|
106
|
-
}),
|
|
121
|
+
})),
|
|
107
122
|
}) as IamPolicy;
|
|
108
123
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { EmptySchema } from "@bufbuild/protobuf/wkt";
|
|
7
8
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
9
|
+
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
8
10
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
9
11
|
import { type ApiResourceAuditActor } from "@stigmer/protos/ai/stigmer/commons/apiresource/status_pb";
|
|
10
12
|
import { IdentityAccountSchema, type IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
@@ -82,7 +84,9 @@ export class IdentityAccountClient {
|
|
|
82
84
|
/** Input for creating/updating a IdentityAccount. */
|
|
83
85
|
export interface IdentityAccountInput {
|
|
84
86
|
name: string;
|
|
87
|
+
slug?: string;
|
|
85
88
|
org: string;
|
|
89
|
+
labels?: Record<string, string>;
|
|
86
90
|
idpId: string;
|
|
87
91
|
email?: string;
|
|
88
92
|
firstName?: string;
|
|
@@ -94,14 +98,17 @@ export interface IdentityAccountInput {
|
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
function buildIdentityAccountProto(input: IdentityAccountInput): IdentityAccount {
|
|
101
|
+
const identityProviderRef = input.identityProviderRef ? create(ApiResourceReferenceSchema, input.identityProviderRef) : undefined;
|
|
97
102
|
return Object.assign(create(IdentityAccountSchema), {
|
|
98
103
|
apiVersion: "iam.stigmer.ai/v1",
|
|
99
104
|
kind: "IdentityAccount",
|
|
100
105
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
101
106
|
name: input.name,
|
|
102
107
|
org: input.org,
|
|
108
|
+
...(input.slug && { slug: input.slug }),
|
|
109
|
+
...(input.labels && { labels: input.labels }),
|
|
103
110
|
}),
|
|
104
|
-
spec: Object.assign(create(IdentityAccountSpecSchema), {
|
|
111
|
+
spec: Object.assign(create(IdentityAccountSpecSchema), stripUndefined({
|
|
105
112
|
idpId: input.idpId,
|
|
106
113
|
email: input.email,
|
|
107
114
|
firstName: input.firstName,
|
|
@@ -109,7 +116,7 @@ function buildIdentityAccountProto(input: IdentityAccountInput): IdentityAccount
|
|
|
109
116
|
pictureUrl: input.pictureUrl,
|
|
110
117
|
isMachineAccount: input.isMachineAccount,
|
|
111
118
|
provisioningMode: input.provisioningMode,
|
|
112
|
-
identityProviderRef
|
|
113
|
-
}),
|
|
119
|
+
identityProviderRef,
|
|
120
|
+
})),
|
|
114
121
|
}) as IdentityAccount;
|
|
115
122
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type DeleteResourceInput, type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
@@ -65,7 +66,9 @@ export class IdentityProviderClient {
|
|
|
65
66
|
/** Input for creating/updating a IdentityProvider. */
|
|
66
67
|
export interface IdentityProviderInput {
|
|
67
68
|
name: string;
|
|
69
|
+
slug?: string;
|
|
68
70
|
org: string;
|
|
71
|
+
labels?: Record<string, string>;
|
|
69
72
|
displayName?: string;
|
|
70
73
|
jwksUri?: string;
|
|
71
74
|
allowedIssuers?: string[];
|
|
@@ -81,14 +84,16 @@ function buildIdentityProviderProto(input: IdentityProviderInput): IdentityProvi
|
|
|
81
84
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
82
85
|
name: input.name,
|
|
83
86
|
org: input.org,
|
|
87
|
+
...(input.slug && { slug: input.slug }),
|
|
88
|
+
...(input.labels && { labels: input.labels }),
|
|
84
89
|
}),
|
|
85
|
-
spec: Object.assign(create(IdentityProviderSpecSchema), {
|
|
90
|
+
spec: Object.assign(create(IdentityProviderSpecSchema), stripUndefined({
|
|
86
91
|
displayName: input.displayName,
|
|
87
92
|
jwksUri: input.jwksUri,
|
|
88
93
|
allowedIssuers: input.allowedIssuers,
|
|
89
94
|
expectedAudience: input.expectedAudience,
|
|
90
95
|
rateLimitBudget: input.rateLimitBudget,
|
|
91
96
|
userinfoEndpoint: input.userinfoEndpoint,
|
|
92
|
-
}),
|
|
97
|
+
})),
|
|
93
98
|
}) as IdentityProvider;
|
|
94
99
|
}
|
package/src/gen/mcpserver.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type DeleteResourceInput, type ListParams, type ListResult, type EnvSpecInput, type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
|
+
import { EnvironmentSpecSchema, EnvironmentValueSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
7
9
|
import { McpServerSchema, type McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
8
10
|
import { McpServerCommandController } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/command_pb";
|
|
9
11
|
import { UpdateDiscoveredCapabilitiesInputSchema, type UpdateDiscoveredCapabilitiesInput } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
10
12
|
import { McpServerQueryController } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/query_pb";
|
|
11
|
-
import { McpServerSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/spec_pb";
|
|
13
|
+
import { McpServerSpecSchema, StdioServerConfigSchema, HttpServerConfigSchema, ToolApprovalPolicySchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/spec_pb";
|
|
12
14
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
13
15
|
import { ApiResourceIdSchema, ApiResourceReferenceSchema, ApiResourceDeleteInputSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
14
16
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
@@ -95,7 +97,9 @@ export class McpServerClient {
|
|
|
95
97
|
/** Input for creating/updating a McpServer. */
|
|
96
98
|
export interface McpServerInput {
|
|
97
99
|
name: string;
|
|
100
|
+
slug?: string;
|
|
98
101
|
org: string;
|
|
102
|
+
labels?: Record<string, string>;
|
|
99
103
|
description?: string;
|
|
100
104
|
iconUrl?: string;
|
|
101
105
|
stdio?: StdioServerConfigInput;
|
|
@@ -126,22 +130,61 @@ export interface ToolApprovalPolicyInput {
|
|
|
126
130
|
message?: string;
|
|
127
131
|
}
|
|
128
132
|
|
|
133
|
+
function buildStdioServerConfigProto(input: StdioServerConfigInput) {
|
|
134
|
+
return Object.assign(create(StdioServerConfigSchema), stripUndefined({
|
|
135
|
+
command: input.command,
|
|
136
|
+
args: input.args,
|
|
137
|
+
workingDir: input.workingDir,
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function buildHttpServerConfigProto(input: HttpServerConfigInput) {
|
|
142
|
+
return Object.assign(create(HttpServerConfigSchema), stripUndefined({
|
|
143
|
+
url: input.url,
|
|
144
|
+
headers: input.headers,
|
|
145
|
+
queryParams: input.queryParams,
|
|
146
|
+
timeoutSeconds: input.timeoutSeconds,
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function buildToolApprovalPolicyProto(input: ToolApprovalPolicyInput) {
|
|
151
|
+
return Object.assign(create(ToolApprovalPolicySchema), stripUndefined({
|
|
152
|
+
toolName: input.toolName,
|
|
153
|
+
message: input.message,
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
|
|
129
157
|
function buildMcpServerProto(input: McpServerInput): McpServer {
|
|
158
|
+
let envSpec;
|
|
159
|
+
if (input.envSpec) {
|
|
160
|
+
const es = create(EnvironmentSpecSchema);
|
|
161
|
+
for (const [k, v] of Object.entries(input.envSpec.variables)) {
|
|
162
|
+
es.data[k] = create(EnvironmentValueSchema, { value: v.value, isSecret: v.isSecret, description: v.description });
|
|
163
|
+
}
|
|
164
|
+
envSpec = es;
|
|
165
|
+
}
|
|
166
|
+
const defaultToolApprovals = input.defaultToolApprovals?.map(buildToolApprovalPolicyProto);
|
|
167
|
+
const spec = Object.assign(create(McpServerSpecSchema), stripUndefined({
|
|
168
|
+
description: input.description,
|
|
169
|
+
iconUrl: input.iconUrl,
|
|
170
|
+
defaultEnabledTools: input.defaultEnabledTools,
|
|
171
|
+
envSpec,
|
|
172
|
+
defaultToolApprovals,
|
|
173
|
+
}));
|
|
174
|
+
if (input.stdio) {
|
|
175
|
+
spec.serverType = { case: "stdio", value: buildStdioServerConfigProto(input.stdio) };
|
|
176
|
+
} else if (input.http) {
|
|
177
|
+
spec.serverType = { case: "http", value: buildHttpServerConfigProto(input.http) };
|
|
178
|
+
}
|
|
130
179
|
return Object.assign(create(McpServerSchema), {
|
|
131
180
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
132
181
|
kind: "McpServer",
|
|
133
182
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
134
183
|
name: input.name,
|
|
135
184
|
org: input.org,
|
|
185
|
+
...(input.slug && { slug: input.slug }),
|
|
186
|
+
...(input.labels && { labels: input.labels }),
|
|
136
187
|
}),
|
|
137
|
-
spec
|
|
138
|
-
description: input.description,
|
|
139
|
-
iconUrl: input.iconUrl,
|
|
140
|
-
stdio: input.stdio,
|
|
141
|
-
http: input.http,
|
|
142
|
-
defaultEnabledTools: input.defaultEnabledTools,
|
|
143
|
-
envSpec: input.envSpec,
|
|
144
|
-
defaultToolApprovals: input.defaultToolApprovals,
|
|
145
|
-
}),
|
|
188
|
+
spec,
|
|
146
189
|
}) as McpServer;
|
|
147
190
|
}
|
package/src/gen/organization.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { EmptySchema } from "@bufbuild/protobuf/wkt";
|
|
7
8
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
|
-
import { type FindApiResourcesRequest } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
9
|
+
import { ApiResourceReferenceSchema, type FindApiResourcesRequest } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
9
10
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
10
11
|
import { OrganizationSchema, type Organization } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
11
12
|
import { OrganizationCommandController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/command_pb";
|
|
@@ -76,7 +77,9 @@ export class OrganizationClient {
|
|
|
76
77
|
/** Input for creating/updating a Organization. */
|
|
77
78
|
export interface OrganizationInput {
|
|
78
79
|
name: string;
|
|
80
|
+
slug?: string;
|
|
79
81
|
org: string;
|
|
82
|
+
labels?: Record<string, string>;
|
|
80
83
|
description?: string;
|
|
81
84
|
logoUrl?: string;
|
|
82
85
|
managementMode?: ManagementMode;
|
|
@@ -85,19 +88,22 @@ export interface OrganizationInput {
|
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
function buildOrganizationProto(input: OrganizationInput): Organization {
|
|
91
|
+
const identityProviderRef = input.identityProviderRef ? create(ApiResourceReferenceSchema, input.identityProviderRef) : undefined;
|
|
88
92
|
return Object.assign(create(OrganizationSchema), {
|
|
89
93
|
apiVersion: "tenancy.stigmer.ai/v1",
|
|
90
94
|
kind: "Organization",
|
|
91
95
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
92
96
|
name: input.name,
|
|
93
97
|
org: input.org,
|
|
98
|
+
...(input.slug && { slug: input.slug }),
|
|
99
|
+
...(input.labels && { labels: input.labels }),
|
|
94
100
|
}),
|
|
95
|
-
spec: Object.assign(create(OrganizationSpecSchema), {
|
|
101
|
+
spec: Object.assign(create(OrganizationSpecSchema), stripUndefined({
|
|
96
102
|
description: input.description,
|
|
97
103
|
logoUrl: input.logoUrl,
|
|
98
104
|
managementMode: input.managementMode,
|
|
99
|
-
identityProviderRef
|
|
105
|
+
identityProviderRef,
|
|
100
106
|
externalOrgId: input.externalOrgId,
|
|
101
|
-
}),
|
|
107
|
+
})),
|
|
102
108
|
}) as Organization;
|
|
103
109
|
}
|
package/src/gen/project.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
@@ -62,24 +63,29 @@ export class ProjectClient {
|
|
|
62
63
|
/** Input for creating/updating a Project. */
|
|
63
64
|
export interface ProjectInput {
|
|
64
65
|
name: string;
|
|
66
|
+
slug?: string;
|
|
65
67
|
org: string;
|
|
68
|
+
labels?: Record<string, string>;
|
|
66
69
|
entryPoint?: string;
|
|
67
70
|
description?: string;
|
|
68
71
|
members?: ResourceRef[];
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
function buildProjectProto(input: ProjectInput): Project {
|
|
75
|
+
const members = input.members?.map(r => create(ApiResourceReferenceSchema, r));
|
|
72
76
|
return Object.assign(create(ProjectSchema), {
|
|
73
77
|
apiVersion: "tenancy.stigmer.ai/v1",
|
|
74
78
|
kind: "Project",
|
|
75
79
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
76
80
|
name: input.name,
|
|
77
81
|
org: input.org,
|
|
82
|
+
...(input.slug && { slug: input.slug }),
|
|
83
|
+
...(input.labels && { labels: input.labels }),
|
|
78
84
|
}),
|
|
79
|
-
spec: Object.assign(create(ProjectSpecSchema), {
|
|
85
|
+
spec: Object.assign(create(ProjectSpecSchema), stripUndefined({
|
|
80
86
|
entryPoint: input.entryPoint,
|
|
81
87
|
description: input.description,
|
|
82
|
-
members
|
|
83
|
-
}),
|
|
88
|
+
members,
|
|
89
|
+
})),
|
|
84
90
|
}) as Project;
|
|
85
91
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Remove keys whose values are `undefined` so that `Object.assign`
|
|
5
|
+
* does not overwrite protobuf default values (empty maps, empty arrays).
|
|
6
|
+
*/
|
|
7
|
+
export function stripUndefined<T extends Record<string, unknown>>(obj: T): Partial<T> {
|
|
8
|
+
const result: Record<string, unknown> = {};
|
|
9
|
+
for (const key of Object.keys(obj)) {
|
|
10
|
+
if (obj[key] !== undefined) {
|
|
11
|
+
result[key] = obj[key];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return result as Partial<T>;
|
|
15
|
+
}
|
package/src/gen/session.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
5
|
+
import { type ResourceRef } from "./types";
|
|
4
6
|
import { create } from "@bufbuild/protobuf";
|
|
5
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
|
+
import { ToolApprovalOverrideSchema, McpServerUsageSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
6
9
|
import { SessionSchema, type Session } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
|
|
7
10
|
import { SessionCommandController } from "@stigmer/protos/ai/stigmer/agentic/session/v1/command_pb";
|
|
8
11
|
import { SessionIdSchema, ListSessionsRequestSchema, SessionListSchema, ListSessionsByAgentRequestSchema, type ListSessionsRequest, type SessionList, type ListSessionsByAgentRequest } from "@stigmer/protos/ai/stigmer/agentic/session/v1/io_pb";
|
|
9
12
|
import { SessionQueryController } from "@stigmer/protos/ai/stigmer/agentic/session/v1/query_pb";
|
|
10
13
|
import { SessionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/spec_pb";
|
|
14
|
+
import { GitRepoSourceSchema, LocalPathSourceSchema, WorkspaceSourceSchema, WorkspaceEntrySchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
15
|
+
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
11
16
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
12
17
|
|
|
13
18
|
/** Provides operations on session resources. */
|
|
@@ -66,13 +71,17 @@ export class SessionClient {
|
|
|
66
71
|
/** Input for creating/updating a Session. */
|
|
67
72
|
export interface SessionInput {
|
|
68
73
|
name: string;
|
|
74
|
+
slug?: string;
|
|
69
75
|
org: string;
|
|
70
|
-
|
|
76
|
+
labels?: Record<string, string>;
|
|
77
|
+
agentInstanceId?: string;
|
|
71
78
|
subject?: string;
|
|
72
79
|
threadId?: string;
|
|
73
80
|
sandboxId?: string;
|
|
74
81
|
metadata?: Record<string, string>;
|
|
75
82
|
workspaceEntries?: WorkspaceEntryInput[];
|
|
83
|
+
mcpServerUsages?: McpServerUsageInput[];
|
|
84
|
+
skillRefs?: ResourceRef[];
|
|
76
85
|
}
|
|
77
86
|
|
|
78
87
|
/** SDK input type for WorkspaceEntry. */
|
|
@@ -100,21 +109,90 @@ export interface LocalPathSourceInput {
|
|
|
100
109
|
path?: string;
|
|
101
110
|
}
|
|
102
111
|
|
|
112
|
+
/** SDK input type for McpServerUsage. */
|
|
113
|
+
export interface McpServerUsageInput {
|
|
114
|
+
mcpServerRef: ResourceRef;
|
|
115
|
+
enabledTools?: string[];
|
|
116
|
+
toolApprovalOverrides?: ToolApprovalOverrideInput[];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** SDK input type for ToolApprovalOverride. */
|
|
120
|
+
export interface ToolApprovalOverrideInput {
|
|
121
|
+
toolName?: string;
|
|
122
|
+
requiresApproval?: boolean;
|
|
123
|
+
message?: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function buildGitRepoSourceProto(input: GitRepoSourceInput) {
|
|
127
|
+
return Object.assign(create(GitRepoSourceSchema), stripUndefined({
|
|
128
|
+
url: input.url,
|
|
129
|
+
branch: input.branch,
|
|
130
|
+
commit: input.commit,
|
|
131
|
+
depth: input.depth,
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function buildLocalPathSourceProto(input: LocalPathSourceInput) {
|
|
136
|
+
return Object.assign(create(LocalPathSourceSchema), stripUndefined({
|
|
137
|
+
path: input.path,
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function buildWorkspaceSourceProto(input: WorkspaceSourceInput) {
|
|
142
|
+
const msg = create(WorkspaceSourceSchema);
|
|
143
|
+
if (input.gitRepo) {
|
|
144
|
+
msg.source = { case: "gitRepo", value: buildGitRepoSourceProto(input.gitRepo) };
|
|
145
|
+
} else if (input.localPath) {
|
|
146
|
+
msg.source = { case: "localPath", value: buildLocalPathSourceProto(input.localPath) };
|
|
147
|
+
}
|
|
148
|
+
return msg;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function buildWorkspaceEntryProto(input: WorkspaceEntryInput) {
|
|
152
|
+
const msg = create(WorkspaceEntrySchema);
|
|
153
|
+
if (input.name !== undefined) msg.name = input.name;
|
|
154
|
+
if (input.source) msg.source = buildWorkspaceSourceProto(input.source);
|
|
155
|
+
return msg;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function buildToolApprovalOverrideProto(input: ToolApprovalOverrideInput) {
|
|
159
|
+
return Object.assign(create(ToolApprovalOverrideSchema), stripUndefined({
|
|
160
|
+
toolName: input.toolName,
|
|
161
|
+
requiresApproval: input.requiresApproval,
|
|
162
|
+
message: input.message,
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function buildMcpServerUsageProto(input: McpServerUsageInput) {
|
|
167
|
+
const msg = create(McpServerUsageSchema);
|
|
168
|
+
if (input.mcpServerRef) msg.mcpServerRef = create(ApiResourceReferenceSchema, input.mcpServerRef);
|
|
169
|
+
if (input.enabledTools) msg.enabledTools = input.enabledTools;
|
|
170
|
+
if (input.toolApprovalOverrides) msg.toolApprovalOverrides = input.toolApprovalOverrides.map(buildToolApprovalOverrideProto);
|
|
171
|
+
return msg;
|
|
172
|
+
}
|
|
173
|
+
|
|
103
174
|
function buildSessionProto(input: SessionInput): Session {
|
|
175
|
+
const workspaceEntries = input.workspaceEntries?.map(buildWorkspaceEntryProto);
|
|
176
|
+
const mcpServerUsages = input.mcpServerUsages?.map(buildMcpServerUsageProto);
|
|
177
|
+
const skillRefs = input.skillRefs?.map(r => create(ApiResourceReferenceSchema, r));
|
|
104
178
|
return Object.assign(create(SessionSchema), {
|
|
105
179
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
106
180
|
kind: "Session",
|
|
107
181
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
108
182
|
name: input.name,
|
|
109
183
|
org: input.org,
|
|
184
|
+
...(input.slug && { slug: input.slug }),
|
|
185
|
+
...(input.labels && { labels: input.labels }),
|
|
110
186
|
}),
|
|
111
|
-
spec: Object.assign(create(SessionSpecSchema), {
|
|
187
|
+
spec: Object.assign(create(SessionSpecSchema), stripUndefined({
|
|
112
188
|
agentInstanceId: input.agentInstanceId,
|
|
113
189
|
subject: input.subject,
|
|
114
190
|
threadId: input.threadId,
|
|
115
191
|
sandboxId: input.sandboxId,
|
|
116
192
|
metadata: input.metadata,
|
|
117
|
-
workspaceEntries
|
|
118
|
-
|
|
193
|
+
workspaceEntries,
|
|
194
|
+
mcpServerUsages,
|
|
195
|
+
skillRefs,
|
|
196
|
+
})),
|
|
119
197
|
}) as Session;
|
|
120
198
|
}
|
package/src/gen/skill.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type ListParams, type ListResult, type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
8
|
import { SkillSchema, type Skill } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
|
|
8
9
|
import { SkillCommandController } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/command_pb";
|
|
9
|
-
import { SkillIdSchema, PushSkillRequestSchema, GetArtifactRequestSchema, GetArtifactResponseSchema, type PushSkillRequest, type GetArtifactRequest, type GetArtifactResponse } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/io_pb";
|
|
10
|
+
import { SkillIdSchema, PushSkillRequestSchema, PushSkillFromExecutionArtifactRequestSchema, GetArtifactRequestSchema, GetArtifactResponseSchema, type PushSkillRequest, type PushSkillFromExecutionArtifactRequest, type GetArtifactRequest, type GetArtifactResponse } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/io_pb";
|
|
10
11
|
import { SkillQueryController } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/query_pb";
|
|
11
12
|
import { SkillSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/spec_pb";
|
|
12
13
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
@@ -34,6 +35,12 @@ export class SkillClient {
|
|
|
34
35
|
} catch (e) { throw wrapError(e); }
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
async pushFromExecutionArtifact(input: PushSkillFromExecutionArtifactRequest): Promise<Skill> {
|
|
39
|
+
try {
|
|
40
|
+
return await this.command.pushFromExecutionArtifact(input);
|
|
41
|
+
} catch (e) { throw wrapError(e); }
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
async delete(id: string): Promise<Skill> {
|
|
38
45
|
try {
|
|
39
46
|
return await this.command.delete(create(SkillIdSchema, { value: id }));
|
|
@@ -79,7 +86,9 @@ export class SkillClient {
|
|
|
79
86
|
/** Input for creating/updating a Skill. */
|
|
80
87
|
export interface SkillInput {
|
|
81
88
|
name: string;
|
|
89
|
+
slug?: string;
|
|
82
90
|
org: string;
|
|
91
|
+
labels?: Record<string, string>;
|
|
83
92
|
skillMd?: string;
|
|
84
93
|
tag?: string;
|
|
85
94
|
description?: string;
|
|
@@ -92,11 +101,13 @@ function buildSkillProto(input: SkillInput): Skill {
|
|
|
92
101
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
93
102
|
name: input.name,
|
|
94
103
|
org: input.org,
|
|
104
|
+
...(input.slug && { slug: input.slug }),
|
|
105
|
+
...(input.labels && { labels: input.labels }),
|
|
95
106
|
}),
|
|
96
|
-
spec: Object.assign(create(SkillSpecSchema), {
|
|
107
|
+
spec: Object.assign(create(SkillSpecSchema), stripUndefined({
|
|
97
108
|
skillMd: input.skillMd,
|
|
98
109
|
tag: input.tag,
|
|
99
110
|
description: input.description,
|
|
100
|
-
}),
|
|
111
|
+
})),
|
|
101
112
|
}) as Skill;
|
|
102
113
|
}
|
package/src/gen/workflow.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type EnvSpecInput, type ResourceRef } from "./types";
|
|
5
6
|
import { create, type JsonObject } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
|
+
import { EnvironmentSpecSchema, EnvironmentValueSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
7
9
|
import { WorkflowSchema, type Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
8
10
|
import { WorkflowCommandController } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/command_pb";
|
|
9
11
|
import { WorkflowTaskKind } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/enum_pb";
|
|
10
12
|
import { WorkflowIdSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/io_pb";
|
|
11
13
|
import { WorkflowQueryController } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/query_pb";
|
|
12
|
-
import { WorkflowSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/spec_pb";
|
|
14
|
+
import { WorkflowSpecSchema, WorkflowDocumentSchema, ExportSchema, FlowControlSchema, WorkflowTaskSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/spec_pb";
|
|
13
15
|
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
14
16
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
15
17
|
|
|
@@ -63,7 +65,9 @@ export class WorkflowClient {
|
|
|
63
65
|
/** Input for creating/updating a Workflow. */
|
|
64
66
|
export interface WorkflowInput {
|
|
65
67
|
name: string;
|
|
68
|
+
slug?: string;
|
|
66
69
|
org: string;
|
|
70
|
+
labels?: Record<string, string>;
|
|
67
71
|
description?: string;
|
|
68
72
|
document: WorkflowDocumentInput;
|
|
69
73
|
tasks?: WorkflowTaskInput[];
|
|
@@ -98,19 +102,63 @@ export interface FlowControlInput {
|
|
|
98
102
|
then?: string;
|
|
99
103
|
}
|
|
100
104
|
|
|
105
|
+
function buildWorkflowDocumentProto(input: WorkflowDocumentInput) {
|
|
106
|
+
return Object.assign(create(WorkflowDocumentSchema), stripUndefined({
|
|
107
|
+
dsl: input.dsl,
|
|
108
|
+
namespace: input.namespace,
|
|
109
|
+
name: input.name,
|
|
110
|
+
version: input.version,
|
|
111
|
+
description: input.description,
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function buildExportProto(input: ExportInput) {
|
|
116
|
+
return Object.assign(create(ExportSchema), stripUndefined({
|
|
117
|
+
as: input.as,
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function buildFlowControlProto(input: FlowControlInput) {
|
|
122
|
+
return Object.assign(create(FlowControlSchema), stripUndefined({
|
|
123
|
+
then: input.then,
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function buildWorkflowTaskProto(input: WorkflowTaskInput) {
|
|
128
|
+
const msg = create(WorkflowTaskSchema);
|
|
129
|
+
if (input.name !== undefined) msg.name = input.name;
|
|
130
|
+
if (input.kind !== undefined) msg.kind = input.kind;
|
|
131
|
+
if (input.taskConfig !== undefined) msg.taskConfig = input.taskConfig;
|
|
132
|
+
if (input.export) msg.export = buildExportProto(input.export);
|
|
133
|
+
if (input.flow) msg.flow = buildFlowControlProto(input.flow);
|
|
134
|
+
return msg;
|
|
135
|
+
}
|
|
136
|
+
|
|
101
137
|
function buildWorkflowProto(input: WorkflowInput): Workflow {
|
|
138
|
+
const document = input.document ? buildWorkflowDocumentProto(input.document) : undefined;
|
|
139
|
+
const tasks = input.tasks?.map(buildWorkflowTaskProto);
|
|
140
|
+
let envSpec;
|
|
141
|
+
if (input.envSpec) {
|
|
142
|
+
const es = create(EnvironmentSpecSchema);
|
|
143
|
+
for (const [k, v] of Object.entries(input.envSpec.variables)) {
|
|
144
|
+
es.data[k] = create(EnvironmentValueSchema, { value: v.value, isSecret: v.isSecret, description: v.description });
|
|
145
|
+
}
|
|
146
|
+
envSpec = es;
|
|
147
|
+
}
|
|
102
148
|
return Object.assign(create(WorkflowSchema), {
|
|
103
149
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
104
150
|
kind: "Workflow",
|
|
105
151
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
106
152
|
name: input.name,
|
|
107
153
|
org: input.org,
|
|
154
|
+
...(input.slug && { slug: input.slug }),
|
|
155
|
+
...(input.labels && { labels: input.labels }),
|
|
108
156
|
}),
|
|
109
|
-
spec: Object.assign(create(WorkflowSpecSchema), {
|
|
157
|
+
spec: Object.assign(create(WorkflowSpecSchema), stripUndefined({
|
|
110
158
|
description: input.description,
|
|
111
|
-
document
|
|
112
|
-
tasks
|
|
113
|
-
envSpec
|
|
114
|
-
}),
|
|
159
|
+
document,
|
|
160
|
+
tasks,
|
|
161
|
+
envSpec,
|
|
162
|
+
})),
|
|
115
163
|
}) as Workflow;
|
|
116
164
|
}
|