@stigmer/sdk 0.0.36
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/LICENSE +190 -0
- package/README.md +199 -0
- package/config.d.ts +40 -0
- package/config.d.ts.map +1 -0
- package/config.js +17 -0
- package/config.js.map +1 -0
- package/errors.d.ts +77 -0
- package/errors.d.ts.map +1 -0
- package/errors.js +163 -0
- package/errors.js.map +1 -0
- package/gen/agent.d.ts +56 -0
- package/gen/agent.d.ts.map +1 -0
- package/gen/agent.js +113 -0
- package/gen/agent.js.map +1 -0
- package/gen/agentexecution.d.ts +68 -0
- package/gen/agentexecution.d.ts.map +1 -0
- package/gen/agentexecution.js +197 -0
- package/gen/agentexecution.js.map +1 -0
- package/gen/agentinstance.d.ts +26 -0
- package/gen/agentinstance.d.ts.map +1 -0
- package/gen/agentinstance.js +92 -0
- package/gen/agentinstance.js.map +1 -0
- package/gen/apikey.d.ts +25 -0
- package/gen/apikey.d.ts.map +1 -0
- package/gen/apikey.js +85 -0
- package/gen/apikey.js.map +1 -0
- package/gen/client.d.ts +76 -0
- package/gen/client.d.ts.map +1 -0
- package/gen/client.js +77 -0
- package/gen/client.js.map +1 -0
- package/gen/environment.d.ts +23 -0
- package/gen/environment.d.ts.map +1 -0
- package/gen/environment.js +86 -0
- package/gen/environment.js.map +1 -0
- package/gen/errors.d.ts +15 -0
- package/gen/errors.d.ts.map +1 -0
- package/gen/errors.js +52 -0
- package/gen/errors.js.map +1 -0
- package/gen/executioncontext.d.ts +24 -0
- package/gen/executioncontext.d.ts.map +1 -0
- package/gen/executioncontext.js +87 -0
- package/gen/executioncontext.js.map +1 -0
- package/gen/iampolicy.d.ts +34 -0
- package/gen/iampolicy.d.ts.map +1 -0
- package/gen/iampolicy.js +107 -0
- package/gen/iampolicy.js.map +1 -0
- package/gen/identityaccount.d.ts +35 -0
- package/gen/identityaccount.d.ts.map +1 -0
- package/gen/identityaccount.js +113 -0
- package/gen/identityaccount.js.map +1 -0
- package/gen/identityprovider.d.ts +27 -0
- package/gen/identityprovider.d.ts.map +1 -0
- package/gen/identityprovider.js +90 -0
- package/gen/identityprovider.js.map +1 -0
- package/gen/mcpserver.d.ts +50 -0
- package/gen/mcpserver.d.ts.map +1 -0
- package/gen/mcpserver.js +124 -0
- package/gen/mcpserver.js.map +1 -0
- package/gen/organization.d.ts +31 -0
- package/gen/organization.d.ts.map +1 -0
- package/gen/organization.js +102 -0
- package/gen/organization.js.map +1 -0
- package/gen/project.d.ts +24 -0
- package/gen/project.d.ts.map +1 -0
- package/gen/project.js +84 -0
- package/gen/project.js.map +1 -0
- package/gen/session.d.ts +49 -0
- package/gen/session.d.ts.map +1 -0
- package/gen/session.js +94 -0
- package/gen/session.js.map +1 -0
- package/gen/skill.d.ts +26 -0
- package/gen/skill.d.ts.map +1 -0
- package/gen/skill.js +101 -0
- package/gen/skill.js.map +1 -0
- package/gen/types.d.ts +43 -0
- package/gen/types.d.ts.map +1 -0
- package/gen/types.js +3 -0
- package/gen/types.js.map +1 -0
- package/gen/workflow.d.ts +51 -0
- package/gen/workflow.d.ts.map +1 -0
- package/gen/workflow.js +85 -0
- package/gen/workflow.js.map +1 -0
- package/gen/workflowexecution.d.ts +37 -0
- package/gen/workflowexecution.d.ts.map +1 -0
- package/gen/workflowexecution.js +161 -0
- package/gen/workflowexecution.js.map +1 -0
- package/gen/workflowinstance.d.ts +26 -0
- package/gen/workflowinstance.d.ts.map +1 -0
- package/gen/workflowinstance.js +92 -0
- package/gen/workflowinstance.js.map +1 -0
- package/index.d.ts +23 -0
- package/index.d.ts.map +1 -0
- package/index.js +26 -0
- package/index.js.map +1 -0
- package/internal/interceptors.d.ts +25 -0
- package/internal/interceptors.d.ts.map +1 -0
- package/internal/interceptors.js +75 -0
- package/internal/interceptors.js.map +1 -0
- package/package.json +40 -0
- package/search.d.ts +41 -0
- package/search.d.ts.map +1 -0
- package/search.js +45 -0
- package/search.js.map +1 -0
- package/src/config.ts +64 -0
- package/src/errors.ts +219 -0
- package/src/gen/agent.ts +146 -0
- package/src/gen/agentexecution.ts +205 -0
- package/src/gen/agentinstance.ts +91 -0
- package/src/gen/apikey.ts +86 -0
- package/src/gen/client.ts +99 -0
- package/src/gen/environment.ts +86 -0
- package/src/gen/errors.ts +74 -0
- package/src/gen/executioncontext.ts +87 -0
- package/src/gen/iampolicy.ts +108 -0
- package/src/gen/identityaccount.ts +115 -0
- package/src/gen/identityprovider.ts +94 -0
- package/src/gen/mcpserver.ts +147 -0
- package/src/gen/organization.ts +103 -0
- package/src/gen/project.ts +85 -0
- package/src/gen/session.ts +120 -0
- package/src/gen/skill.ts +102 -0
- package/src/gen/types.ts +51 -0
- package/src/gen/workflow.ts +116 -0
- package/src/gen/workflowexecution.ts +147 -0
- package/src/gen/workflowinstance.ts +91 -0
- package/src/index.ts +124 -0
- package/src/internal/interceptors.ts +83 -0
- package/src/search.ts +71 -0
- package/src/stigmer.ts +83 -0
- package/src/transport.ts +46 -0
- package/stigmer.d.ts +57 -0
- package/stigmer.d.ts.map +1 -0
- package/stigmer.js +64 -0
- package/stigmer.js.map +1 -0
- package/transport.d.ts +13 -0
- package/transport.d.ts.map +1 -0
- package/transport.js +34 -0
- package/transport.js.map +1 -0
package/src/gen/agent.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors";
|
|
4
|
+
import { type ListParams, type ListResult, type EnvSpecInput, type ResourceRef } from "./types";
|
|
5
|
+
import { create } from "@bufbuild/protobuf";
|
|
6
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
|
+
import { AgentSchema, type Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
8
|
+
import { AgentCommandController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/command_pb";
|
|
9
|
+
import { AgentIdSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/io_pb";
|
|
10
|
+
import { AgentQueryController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/query_pb";
|
|
11
|
+
import { AgentSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
12
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
13
|
+
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
14
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
15
|
+
import { PageInfoSchema } from "@stigmer/protos/ai/stigmer/commons/rpc/pagination_pb";
|
|
16
|
+
import { SearchRequestSchema } from "@stigmer/protos/ai/stigmer/search/v1/io_pb";
|
|
17
|
+
import { SearchService } from "@stigmer/protos/ai/stigmer/search/v1/query_pb";
|
|
18
|
+
|
|
19
|
+
/** Provides operations on agent resources. */
|
|
20
|
+
export class AgentClient {
|
|
21
|
+
private readonly command: Client<typeof AgentCommandController>;
|
|
22
|
+
private readonly query: Client<typeof AgentQueryController>;
|
|
23
|
+
private readonly search: Client<typeof SearchService>;
|
|
24
|
+
|
|
25
|
+
constructor(transport: Transport) {
|
|
26
|
+
this.command = createClient(AgentCommandController, transport);
|
|
27
|
+
this.query = createClient(AgentQueryController, transport);
|
|
28
|
+
this.search = createClient(SearchService, transport);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async apply(input: AgentInput): Promise<Agent> {
|
|
32
|
+
try {
|
|
33
|
+
return await this.command.apply(buildAgentProto(input));
|
|
34
|
+
} catch (e) { throw wrapError(e); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async create(input: AgentInput): Promise<Agent> {
|
|
38
|
+
try {
|
|
39
|
+
return await this.command.create(buildAgentProto(input));
|
|
40
|
+
} catch (e) { throw wrapError(e); }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async update(input: AgentInput): Promise<Agent> {
|
|
44
|
+
try {
|
|
45
|
+
return await this.command.update(buildAgentProto(input));
|
|
46
|
+
} catch (e) { throw wrapError(e); }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async delete(id: string): Promise<Agent> {
|
|
50
|
+
try {
|
|
51
|
+
return await this.command.delete(create(AgentIdSchema, { value: id }));
|
|
52
|
+
} catch (e) { throw wrapError(e); }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async get(id: string): Promise<Agent> {
|
|
56
|
+
try {
|
|
57
|
+
return await this.query.get(create(AgentIdSchema, { value: id }));
|
|
58
|
+
} catch (e) { throw wrapError(e); }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async getByReference(ref: ResourceRef): Promise<Agent> {
|
|
62
|
+
try {
|
|
63
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
64
|
+
} catch (e) { throw wrapError(e); }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async list(params: ListParams): Promise<ListResult> {
|
|
68
|
+
try {
|
|
69
|
+
const resp = await this.search.search(create(SearchRequestSchema, {
|
|
70
|
+
kinds: [ApiResourceKind.agent],
|
|
71
|
+
query: params.query,
|
|
72
|
+
org: params.org,
|
|
73
|
+
excludePublic: params.excludePublic ?? false,
|
|
74
|
+
page: params.page ? create(PageInfoSchema, params.page) : undefined,
|
|
75
|
+
}));
|
|
76
|
+
return {
|
|
77
|
+
entries: resp.entries,
|
|
78
|
+
totalCount: resp.totalCount,
|
|
79
|
+
totalPages: resp.totalPages,
|
|
80
|
+
};
|
|
81
|
+
} catch (e) { throw wrapError(e); }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Input for creating/updating a Agent. */
|
|
86
|
+
export interface AgentInput {
|
|
87
|
+
name: string;
|
|
88
|
+
org: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
iconUrl?: string;
|
|
91
|
+
instructions?: string;
|
|
92
|
+
mcpServerUsages?: McpServerUsageInput[];
|
|
93
|
+
skillRefs?: ResourceRef[];
|
|
94
|
+
subAgents?: SubAgentInput[];
|
|
95
|
+
envSpec?: EnvSpecInput;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** SDK input type for McpServerUsage. */
|
|
99
|
+
export interface McpServerUsageInput {
|
|
100
|
+
mcpServerRef: ResourceRef;
|
|
101
|
+
enabledTools?: string[];
|
|
102
|
+
toolApprovalOverrides?: ToolApprovalOverrideInput[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** SDK input type for ToolApprovalOverride. */
|
|
106
|
+
export interface ToolApprovalOverrideInput {
|
|
107
|
+
toolName?: string;
|
|
108
|
+
requiresApproval?: boolean;
|
|
109
|
+
message?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** SDK input type for SubAgent. */
|
|
113
|
+
export interface SubAgentInput {
|
|
114
|
+
name: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
instructions?: string;
|
|
117
|
+
mcpAccess?: McpAccessInput[];
|
|
118
|
+
skillRefs?: ResourceRef[];
|
|
119
|
+
modelOverride?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** SDK input type for McpAccess. */
|
|
123
|
+
export interface McpAccessInput {
|
|
124
|
+
mcpServer: string;
|
|
125
|
+
enabledTools?: string[];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function buildAgentProto(input: AgentInput): Agent {
|
|
129
|
+
return Object.assign(create(AgentSchema), {
|
|
130
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
131
|
+
kind: "Agent",
|
|
132
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
133
|
+
name: input.name,
|
|
134
|
+
org: input.org,
|
|
135
|
+
}),
|
|
136
|
+
spec: Object.assign(create(AgentSpecSchema), {
|
|
137
|
+
description: input.description,
|
|
138
|
+
iconUrl: input.iconUrl,
|
|
139
|
+
instructions: input.instructions,
|
|
140
|
+
mcpServerUsages: input.mcpServerUsages,
|
|
141
|
+
skillRefs: input.skillRefs,
|
|
142
|
+
subAgents: input.subAgents,
|
|
143
|
+
envSpec: input.envSpec,
|
|
144
|
+
}),
|
|
145
|
+
}) as Agent;
|
|
146
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors";
|
|
4
|
+
import { type EnvVarInput } from "./types";
|
|
5
|
+
import { create } from "@bufbuild/protobuf";
|
|
6
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
|
+
import { AgentExecutionSchema, type AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
8
|
+
import { AgentExecutionCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/command_pb";
|
|
9
|
+
import { AgentExecutionIdSchema, AgentExecutionUpdateStatusInputSchema, SubmitApprovalInputSchema, CancelAgentExecutionInputSchema, TerminateAgentExecutionInputSchema, RecoverAgentExecutionInputSchema, PauseAgentExecutionInputSchema, ResumeAgentExecutionInputSchema, UploadAttachmentRequestSchema, UploadAttachmentResponseSchema, ListAgentExecutionsRequestSchema, AgentExecutionListSchema, ListAgentExecutionsBySessionRequestSchema, GetArtifactDownloadUrlRequestSchema, GetArtifactDownloadUrlResponseSchema, GetSessionUsageReportInputSchema, GetSessionUsageReportOutputSchema, GetAgentUsageReportInputSchema, GetAgentUsageReportOutputSchema, GetOrgUsageReportInputSchema, GetOrgUsageReportOutputSchema, type AgentExecutionUpdateStatusInput, 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 GetSessionUsageReportInput, type GetSessionUsageReportOutput, type GetAgentUsageReportInput, type GetAgentUsageReportOutput, type GetOrgUsageReportInput, type GetOrgUsageReportOutput } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
|
|
10
|
+
import { AgentExecutionQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/query_pb";
|
|
11
|
+
import { AgentExecutionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/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 agentexecution resources. */
|
|
16
|
+
export class AgentExecutionClient {
|
|
17
|
+
private readonly command: Client<typeof AgentExecutionCommandController>;
|
|
18
|
+
private readonly query: Client<typeof AgentExecutionQueryController>;
|
|
19
|
+
|
|
20
|
+
constructor(transport: Transport) {
|
|
21
|
+
this.command = createClient(AgentExecutionCommandController, transport);
|
|
22
|
+
this.query = createClient(AgentExecutionQueryController, transport);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async create(input: AgentExecutionInput): Promise<AgentExecution> {
|
|
26
|
+
try {
|
|
27
|
+
return await this.command.create(buildAgentExecutionProto(input));
|
|
28
|
+
} catch (e) { throw wrapError(e); }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async update(input: AgentExecutionInput): Promise<AgentExecution> {
|
|
32
|
+
try {
|
|
33
|
+
return await this.command.update(buildAgentExecutionProto(input));
|
|
34
|
+
} catch (e) { throw wrapError(e); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async updateStatus(input: AgentExecutionUpdateStatusInput): Promise<AgentExecution> {
|
|
38
|
+
try {
|
|
39
|
+
return await this.command.updateStatus(input);
|
|
40
|
+
} catch (e) { throw wrapError(e); }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async delete(id: string): Promise<AgentExecution> {
|
|
44
|
+
try {
|
|
45
|
+
return await this.command.delete(create(ApiResourceIdSchema, { value: id }));
|
|
46
|
+
} catch (e) { throw wrapError(e); }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async submitApproval(input: SubmitApprovalInput): Promise<AgentExecution> {
|
|
50
|
+
try {
|
|
51
|
+
return await this.command.submitApproval(input);
|
|
52
|
+
} catch (e) { throw wrapError(e); }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async cancel(input: CancelAgentExecutionInput): Promise<AgentExecution> {
|
|
56
|
+
try {
|
|
57
|
+
return await this.command.cancel(input);
|
|
58
|
+
} catch (e) { throw wrapError(e); }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async terminate(input: TerminateAgentExecutionInput): Promise<AgentExecution> {
|
|
62
|
+
try {
|
|
63
|
+
return await this.command.terminate(input);
|
|
64
|
+
} catch (e) { throw wrapError(e); }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async recover(input: RecoverAgentExecutionInput): Promise<AgentExecution> {
|
|
68
|
+
try {
|
|
69
|
+
return await this.command.recover(input);
|
|
70
|
+
} catch (e) { throw wrapError(e); }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async pause(input: PauseAgentExecutionInput): Promise<AgentExecution> {
|
|
74
|
+
try {
|
|
75
|
+
return await this.command.pause(input);
|
|
76
|
+
} catch (e) { throw wrapError(e); }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async resume(input: ResumeAgentExecutionInput): Promise<AgentExecution> {
|
|
80
|
+
try {
|
|
81
|
+
return await this.command.resume(input);
|
|
82
|
+
} catch (e) { throw wrapError(e); }
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async uploadAttachment(input: UploadAttachmentRequest): Promise<UploadAttachmentResponse> {
|
|
86
|
+
try {
|
|
87
|
+
return await this.command.uploadAttachment(input);
|
|
88
|
+
} catch (e) { throw wrapError(e); }
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async get(id: string): Promise<AgentExecution> {
|
|
92
|
+
try {
|
|
93
|
+
return await this.query.get(create(AgentExecutionIdSchema, { value: id }));
|
|
94
|
+
} catch (e) { throw wrapError(e); }
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async list(input: ListAgentExecutionsRequest): Promise<AgentExecutionList> {
|
|
98
|
+
try {
|
|
99
|
+
return await this.query.list(input);
|
|
100
|
+
} catch (e) { throw wrapError(e); }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async listBySession(input: ListAgentExecutionsBySessionRequest): Promise<AgentExecutionList> {
|
|
104
|
+
try {
|
|
105
|
+
return await this.query.listBySession(input);
|
|
106
|
+
} catch (e) { throw wrapError(e); }
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async *subscribe(id: string, signal?: AbortSignal): AsyncGenerator<AgentExecution> {
|
|
110
|
+
try {
|
|
111
|
+
for await (const msg of this.query.subscribe(create(AgentExecutionIdSchema, { value: id }), { signal })) {
|
|
112
|
+
yield msg;
|
|
113
|
+
}
|
|
114
|
+
} catch (e) { throw wrapError(e); }
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async getArtifactDownloadUrl(input: GetArtifactDownloadUrlRequest): Promise<GetArtifactDownloadUrlResponse> {
|
|
118
|
+
try {
|
|
119
|
+
return await this.query.getArtifactDownloadUrl(input);
|
|
120
|
+
} catch (e) { throw wrapError(e); }
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async getSessionUsageReport(input: GetSessionUsageReportInput): Promise<GetSessionUsageReportOutput> {
|
|
124
|
+
try {
|
|
125
|
+
return await this.query.getSessionUsageReport(input);
|
|
126
|
+
} catch (e) { throw wrapError(e); }
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async getAgentUsageReport(input: GetAgentUsageReportInput): Promise<GetAgentUsageReportOutput> {
|
|
130
|
+
try {
|
|
131
|
+
return await this.query.getAgentUsageReport(input);
|
|
132
|
+
} catch (e) { throw wrapError(e); }
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async getOrgUsageReport(input: GetOrgUsageReportInput): Promise<GetOrgUsageReportOutput> {
|
|
136
|
+
try {
|
|
137
|
+
return await this.query.getOrgUsageReport(input);
|
|
138
|
+
} catch (e) { throw wrapError(e); }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Input for creating/updating a AgentExecution. */
|
|
143
|
+
export interface AgentExecutionInput {
|
|
144
|
+
name: string;
|
|
145
|
+
org: string;
|
|
146
|
+
sessionId?: string;
|
|
147
|
+
agentId?: string;
|
|
148
|
+
message?: string;
|
|
149
|
+
executionConfig?: ExecutionConfigInput;
|
|
150
|
+
runtimeEnv?: Record<string, EnvVarInput>;
|
|
151
|
+
callbackToken?: Uint8Array;
|
|
152
|
+
autoApproveAll?: boolean;
|
|
153
|
+
parentWorkflowId?: string;
|
|
154
|
+
attachments?: AttachmentInput[];
|
|
155
|
+
workspaceFileRefs?: string[];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** SDK input type for ExecutionConfig. */
|
|
159
|
+
export interface ExecutionConfigInput {
|
|
160
|
+
modelName?: string;
|
|
161
|
+
contextManagement?: ContextManagementConfigInput;
|
|
162
|
+
maxToolRounds?: number;
|
|
163
|
+
maxToolResultChars?: number;
|
|
164
|
+
maxCostUsd?: number;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** SDK input type for ContextManagementConfig. */
|
|
168
|
+
export interface ContextManagementConfigInput {
|
|
169
|
+
disableSummarization?: boolean;
|
|
170
|
+
customTriggerThreshold?: number;
|
|
171
|
+
customTargetTokens?: number;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** SDK input type for Attachment. */
|
|
175
|
+
export interface AttachmentInput {
|
|
176
|
+
filename?: string;
|
|
177
|
+
storageKey?: string;
|
|
178
|
+
mountPath?: string;
|
|
179
|
+
contentType?: string;
|
|
180
|
+
extract?: boolean;
|
|
181
|
+
localPath?: string;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function buildAgentExecutionProto(input: AgentExecutionInput): AgentExecution {
|
|
185
|
+
return Object.assign(create(AgentExecutionSchema), {
|
|
186
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
187
|
+
kind: "AgentExecution",
|
|
188
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
189
|
+
name: input.name,
|
|
190
|
+
org: input.org,
|
|
191
|
+
}),
|
|
192
|
+
spec: Object.assign(create(AgentExecutionSpecSchema), {
|
|
193
|
+
sessionId: input.sessionId,
|
|
194
|
+
agentId: input.agentId,
|
|
195
|
+
message: input.message,
|
|
196
|
+
executionConfig: input.executionConfig,
|
|
197
|
+
runtimeEnv: input.runtimeEnv,
|
|
198
|
+
callbackToken: input.callbackToken,
|
|
199
|
+
autoApproveAll: input.autoApproveAll,
|
|
200
|
+
parentWorkflowId: input.parentWorkflowId,
|
|
201
|
+
attachments: input.attachments,
|
|
202
|
+
workspaceFileRefs: input.workspaceFileRefs,
|
|
203
|
+
}),
|
|
204
|
+
}) as AgentExecution;
|
|
205
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors";
|
|
4
|
+
import { type ResourceRef } from "./types";
|
|
5
|
+
import { create } from "@bufbuild/protobuf";
|
|
6
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
|
+
import { AgentInstanceSchema, type AgentInstance } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/api_pb";
|
|
8
|
+
import { AgentInstanceCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/command_pb";
|
|
9
|
+
import { AgentInstanceIdSchema, GetAgentInstancesByAgentRequestSchema, AgentInstanceListSchema, type GetAgentInstancesByAgentRequest, type AgentInstanceList } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/io_pb";
|
|
10
|
+
import { AgentInstanceQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/query_pb";
|
|
11
|
+
import { AgentInstanceSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/spec_pb";
|
|
12
|
+
import { ApiResourceReferenceSchema } 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 agentinstance resources. */
|
|
16
|
+
export class AgentInstanceClient {
|
|
17
|
+
private readonly command: Client<typeof AgentInstanceCommandController>;
|
|
18
|
+
private readonly query: Client<typeof AgentInstanceQueryController>;
|
|
19
|
+
|
|
20
|
+
constructor(transport: Transport) {
|
|
21
|
+
this.command = createClient(AgentInstanceCommandController, transport);
|
|
22
|
+
this.query = createClient(AgentInstanceQueryController, transport);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async apply(input: AgentInstanceInput): Promise<AgentInstance> {
|
|
26
|
+
try {
|
|
27
|
+
return await this.command.apply(buildAgentInstanceProto(input));
|
|
28
|
+
} catch (e) { throw wrapError(e); }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async create(input: AgentInstanceInput): Promise<AgentInstance> {
|
|
32
|
+
try {
|
|
33
|
+
return await this.command.create(buildAgentInstanceProto(input));
|
|
34
|
+
} catch (e) { throw wrapError(e); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async update(input: AgentInstanceInput): Promise<AgentInstance> {
|
|
38
|
+
try {
|
|
39
|
+
return await this.command.update(buildAgentInstanceProto(input));
|
|
40
|
+
} catch (e) { throw wrapError(e); }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async delete(id: string): Promise<AgentInstance> {
|
|
44
|
+
try {
|
|
45
|
+
return await this.command.delete(create(AgentInstanceIdSchema, { value: id }));
|
|
46
|
+
} catch (e) { throw wrapError(e); }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async get(id: string): Promise<AgentInstance> {
|
|
50
|
+
try {
|
|
51
|
+
return await this.query.get(create(AgentInstanceIdSchema, { value: id }));
|
|
52
|
+
} catch (e) { throw wrapError(e); }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async getByAgent(input: GetAgentInstancesByAgentRequest): Promise<AgentInstanceList> {
|
|
56
|
+
try {
|
|
57
|
+
return await this.query.getByAgent(input);
|
|
58
|
+
} catch (e) { throw wrapError(e); }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async getByReference(ref: ResourceRef): Promise<AgentInstance> {
|
|
62
|
+
try {
|
|
63
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
64
|
+
} catch (e) { throw wrapError(e); }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Input for creating/updating a AgentInstance. */
|
|
69
|
+
export interface AgentInstanceInput {
|
|
70
|
+
name: string;
|
|
71
|
+
org: string;
|
|
72
|
+
agentId?: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
environmentRefs?: ResourceRef[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function buildAgentInstanceProto(input: AgentInstanceInput): AgentInstance {
|
|
78
|
+
return Object.assign(create(AgentInstanceSchema), {
|
|
79
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
80
|
+
kind: "AgentInstance",
|
|
81
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
82
|
+
name: input.name,
|
|
83
|
+
org: input.org,
|
|
84
|
+
}),
|
|
85
|
+
spec: Object.assign(create(AgentInstanceSpecSchema), {
|
|
86
|
+
agentId: input.agentId,
|
|
87
|
+
description: input.description,
|
|
88
|
+
environmentRefs: input.environmentRefs,
|
|
89
|
+
}),
|
|
90
|
+
}) as AgentInstance;
|
|
91
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import { EmptySchema } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
8
|
+
import { ApiKeySchema, type ApiKey } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/api_pb";
|
|
9
|
+
import { ApiKeyCommandController } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/command_pb";
|
|
10
|
+
import { ApiKeyIdSchema, ApiKeyHashSchema, ApiKeysSchema, type ApiKeyHash, type ApiKeys } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/io_pb";
|
|
11
|
+
import { ApiKeyQueryController } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/query_pb";
|
|
12
|
+
import { ApiKeySpecSchema } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/spec_pb";
|
|
13
|
+
|
|
14
|
+
/** Provides operations on apikey resources. */
|
|
15
|
+
export class ApiKeyClient {
|
|
16
|
+
private readonly command: Client<typeof ApiKeyCommandController>;
|
|
17
|
+
private readonly query: Client<typeof ApiKeyQueryController>;
|
|
18
|
+
|
|
19
|
+
constructor(transport: Transport) {
|
|
20
|
+
this.command = createClient(ApiKeyCommandController, transport);
|
|
21
|
+
this.query = createClient(ApiKeyQueryController, transport);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async create(input: ApiKeyInput): Promise<ApiKey> {
|
|
25
|
+
try {
|
|
26
|
+
return await this.command.create(buildApiKeyProto(input));
|
|
27
|
+
} catch (e) { throw wrapError(e); }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async update(input: ApiKeyInput): Promise<ApiKey> {
|
|
31
|
+
try {
|
|
32
|
+
return await this.command.update(buildApiKeyProto(input));
|
|
33
|
+
} catch (e) { throw wrapError(e); }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async delete(id: string): Promise<ApiKey> {
|
|
37
|
+
try {
|
|
38
|
+
return await this.command.delete(create(ApiKeyIdSchema, { value: id }));
|
|
39
|
+
} catch (e) { throw wrapError(e); }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async get(id: string): Promise<ApiKey> {
|
|
43
|
+
try {
|
|
44
|
+
return await this.query.get(create(ApiKeyIdSchema, { value: id }));
|
|
45
|
+
} catch (e) { throw wrapError(e); }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async getByKeyHash(input: ApiKeyHash): Promise<ApiKey> {
|
|
49
|
+
try {
|
|
50
|
+
return await this.query.getByKeyHash(input);
|
|
51
|
+
} catch (e) { throw wrapError(e); }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async findAll(): Promise<ApiKeys> {
|
|
55
|
+
try {
|
|
56
|
+
return await this.query.findAll(create(EmptySchema, {}));
|
|
57
|
+
} catch (e) { throw wrapError(e); }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Input for creating/updating a ApiKey. */
|
|
62
|
+
export interface ApiKeyInput {
|
|
63
|
+
name: string;
|
|
64
|
+
org: string;
|
|
65
|
+
keyHash?: string;
|
|
66
|
+
fingerprint?: string;
|
|
67
|
+
expiresAt?: Date | string;
|
|
68
|
+
neverExpires?: boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function buildApiKeyProto(input: ApiKeyInput): ApiKey {
|
|
72
|
+
return Object.assign(create(ApiKeySchema), {
|
|
73
|
+
apiVersion: "iam.stigmer.ai/v1",
|
|
74
|
+
kind: "ApiKey",
|
|
75
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
76
|
+
name: input.name,
|
|
77
|
+
org: input.org,
|
|
78
|
+
}),
|
|
79
|
+
spec: Object.assign(create(ApiKeySpecSchema), {
|
|
80
|
+
keyHash: input.keyHash,
|
|
81
|
+
fingerprint: input.fingerprint,
|
|
82
|
+
expiresAt: input.expiresAt,
|
|
83
|
+
neverExpires: input.neverExpires,
|
|
84
|
+
}),
|
|
85
|
+
}) as ApiKey;
|
|
86
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type { Transport } from "@connectrpc/connect";
|
|
4
|
+
import { AgentClient } from "./agent";
|
|
5
|
+
import { AgentExecutionClient } from "./agentexecution";
|
|
6
|
+
import { AgentInstanceClient } from "./agentinstance";
|
|
7
|
+
import { ApiKeyClient } from "./apikey";
|
|
8
|
+
import { EnvironmentClient } from "./environment";
|
|
9
|
+
import { ExecutionContextClient } from "./executioncontext";
|
|
10
|
+
import { IamPolicyClient } from "./iampolicy";
|
|
11
|
+
import { IdentityAccountClient } from "./identityaccount";
|
|
12
|
+
import { IdentityProviderClient } from "./identityprovider";
|
|
13
|
+
import { McpServerClient } from "./mcpserver";
|
|
14
|
+
import { OrganizationClient } from "./organization";
|
|
15
|
+
import { ProjectClient } from "./project";
|
|
16
|
+
import { SessionClient } from "./session";
|
|
17
|
+
import { SkillClient } from "./skill";
|
|
18
|
+
import { WorkflowClient } from "./workflow";
|
|
19
|
+
import { WorkflowExecutionClient } from "./workflowexecution";
|
|
20
|
+
import { WorkflowInstanceClient } from "./workflowinstance";
|
|
21
|
+
|
|
22
|
+
/** Aggregate client with all resource-specific sub-clients. */
|
|
23
|
+
export class GeneratedClient {
|
|
24
|
+
readonly agent: AgentClient;
|
|
25
|
+
readonly agentExecution: AgentExecutionClient;
|
|
26
|
+
readonly agentInstance: AgentInstanceClient;
|
|
27
|
+
readonly apiKey: ApiKeyClient;
|
|
28
|
+
readonly environment: EnvironmentClient;
|
|
29
|
+
readonly executionContext: ExecutionContextClient;
|
|
30
|
+
readonly iamPolicy: IamPolicyClient;
|
|
31
|
+
readonly identityAccount: IdentityAccountClient;
|
|
32
|
+
readonly identityProvider: IdentityProviderClient;
|
|
33
|
+
readonly mcpServer: McpServerClient;
|
|
34
|
+
readonly organization: OrganizationClient;
|
|
35
|
+
readonly project: ProjectClient;
|
|
36
|
+
readonly session: SessionClient;
|
|
37
|
+
readonly skill: SkillClient;
|
|
38
|
+
readonly workflow: WorkflowClient;
|
|
39
|
+
readonly workflowExecution: WorkflowExecutionClient;
|
|
40
|
+
readonly workflowInstance: WorkflowInstanceClient;
|
|
41
|
+
|
|
42
|
+
constructor(transport: Transport) {
|
|
43
|
+
this.agent = new AgentClient(transport);
|
|
44
|
+
this.agentExecution = new AgentExecutionClient(transport);
|
|
45
|
+
this.agentInstance = new AgentInstanceClient(transport);
|
|
46
|
+
this.apiKey = new ApiKeyClient(transport);
|
|
47
|
+
this.environment = new EnvironmentClient(transport);
|
|
48
|
+
this.executionContext = new ExecutionContextClient(transport);
|
|
49
|
+
this.iamPolicy = new IamPolicyClient(transport);
|
|
50
|
+
this.identityAccount = new IdentityAccountClient(transport);
|
|
51
|
+
this.identityProvider = new IdentityProviderClient(transport);
|
|
52
|
+
this.mcpServer = new McpServerClient(transport);
|
|
53
|
+
this.organization = new OrganizationClient(transport);
|
|
54
|
+
this.project = new ProjectClient(transport);
|
|
55
|
+
this.session = new SessionClient(transport);
|
|
56
|
+
this.skill = new SkillClient(transport);
|
|
57
|
+
this.workflow = new WorkflowClient(transport);
|
|
58
|
+
this.workflowExecution = new WorkflowExecutionClient(transport);
|
|
59
|
+
this.workflowInstance = new WorkflowInstanceClient(transport);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Re-export all resource client types and input types.
|
|
64
|
+
export { AgentClient } from "./agent";
|
|
65
|
+
export { type AgentInput, type McpServerUsageInput, type ToolApprovalOverrideInput, type SubAgentInput, type McpAccessInput } from "./agent";
|
|
66
|
+
export { AgentExecutionClient } from "./agentexecution";
|
|
67
|
+
export { type AgentExecutionInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput } from "./agentexecution";
|
|
68
|
+
export { AgentInstanceClient } from "./agentinstance";
|
|
69
|
+
export { type AgentInstanceInput } from "./agentinstance";
|
|
70
|
+
export { ApiKeyClient } from "./apikey";
|
|
71
|
+
export { type ApiKeyInput } from "./apikey";
|
|
72
|
+
export { EnvironmentClient } from "./environment";
|
|
73
|
+
export { type EnvironmentInput } from "./environment";
|
|
74
|
+
export { ExecutionContextClient } from "./executioncontext";
|
|
75
|
+
export { type ExecutionContextInput } from "./executioncontext";
|
|
76
|
+
export { IamPolicyClient } from "./iampolicy";
|
|
77
|
+
export { type IamPolicyInput, type ApiResourceRefInput } from "./iampolicy";
|
|
78
|
+
export { IdentityAccountClient } from "./identityaccount";
|
|
79
|
+
export { type IdentityAccountInput } from "./identityaccount";
|
|
80
|
+
export { IdentityProviderClient } from "./identityprovider";
|
|
81
|
+
export { type IdentityProviderInput } from "./identityprovider";
|
|
82
|
+
export { McpServerClient } from "./mcpserver";
|
|
83
|
+
export { type McpServerInput, type StdioServerConfigInput, type HttpServerConfigInput, type ToolApprovalPolicyInput } from "./mcpserver";
|
|
84
|
+
export { OrganizationClient } from "./organization";
|
|
85
|
+
export { type OrganizationInput } from "./organization";
|
|
86
|
+
export { ProjectClient } from "./project";
|
|
87
|
+
export { type ProjectInput } from "./project";
|
|
88
|
+
export { SessionClient } from "./session";
|
|
89
|
+
export { type SessionInput, type WorkspaceEntryInput, type WorkspaceSourceInput, type GitRepoSourceInput, type LocalPathSourceInput } from "./session";
|
|
90
|
+
export { SkillClient } from "./skill";
|
|
91
|
+
export { type SkillInput } from "./skill";
|
|
92
|
+
export { WorkflowClient } from "./workflow";
|
|
93
|
+
export { type WorkflowInput, type WorkflowDocumentInput, type WorkflowTaskInput, type ExportInput, type FlowControlInput } from "./workflow";
|
|
94
|
+
export { WorkflowExecutionClient } from "./workflowexecution";
|
|
95
|
+
export { type WorkflowExecutionInput } from "./workflowexecution";
|
|
96
|
+
export { WorkflowInstanceClient } from "./workflowinstance";
|
|
97
|
+
export { type WorkflowInstanceInput } from "./workflowinstance";
|
|
98
|
+
export { type ListParams, type ListResult, type DeleteResourceInput, type ResourceRef, type EnvSpecInput, type EnvVarInput, type Page } from "./types";
|
|
99
|
+
export { StigmerError, type ErrorCode, isNotFound, isUnauthenticated, isPermissionDenied, isRetryable } from "./errors";
|