@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
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors";
|
|
4
|
+
import { type DeleteResourceInput, 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 { McpServerSchema, type McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
8
|
+
import { McpServerCommandController } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/command_pb";
|
|
9
|
+
import { UpdateDiscoveredCapabilitiesInputSchema, type UpdateDiscoveredCapabilitiesInput } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
10
|
+
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";
|
|
12
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
13
|
+
import { ApiResourceIdSchema, ApiResourceReferenceSchema, ApiResourceDeleteInputSchema } 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 mcpserver resources. */
|
|
20
|
+
export class McpServerClient {
|
|
21
|
+
private readonly command: Client<typeof McpServerCommandController>;
|
|
22
|
+
private readonly query: Client<typeof McpServerQueryController>;
|
|
23
|
+
private readonly search: Client<typeof SearchService>;
|
|
24
|
+
|
|
25
|
+
constructor(transport: Transport) {
|
|
26
|
+
this.command = createClient(McpServerCommandController, transport);
|
|
27
|
+
this.query = createClient(McpServerQueryController, transport);
|
|
28
|
+
this.search = createClient(SearchService, transport);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async apply(input: McpServerInput): Promise<McpServer> {
|
|
32
|
+
try {
|
|
33
|
+
return await this.command.apply(buildMcpServerProto(input));
|
|
34
|
+
} catch (e) { throw wrapError(e); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async create(input: McpServerInput): Promise<McpServer> {
|
|
38
|
+
try {
|
|
39
|
+
return await this.command.create(buildMcpServerProto(input));
|
|
40
|
+
} catch (e) { throw wrapError(e); }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async update(input: McpServerInput): Promise<McpServer> {
|
|
44
|
+
try {
|
|
45
|
+
return await this.command.update(buildMcpServerProto(input));
|
|
46
|
+
} catch (e) { throw wrapError(e); }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async delete(input: DeleteResourceInput): Promise<McpServer> {
|
|
50
|
+
try {
|
|
51
|
+
return await this.command.delete(create(ApiResourceDeleteInputSchema, {
|
|
52
|
+
resourceId: input.resourceId,
|
|
53
|
+
versionMessage: input.versionMessage,
|
|
54
|
+
force: input.force,
|
|
55
|
+
}));
|
|
56
|
+
} catch (e) { throw wrapError(e); }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async updateDiscoveredCapabilities(input: UpdateDiscoveredCapabilitiesInput): Promise<McpServer> {
|
|
60
|
+
try {
|
|
61
|
+
return await this.command.updateDiscoveredCapabilities(input);
|
|
62
|
+
} catch (e) { throw wrapError(e); }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async get(id: string): Promise<McpServer> {
|
|
66
|
+
try {
|
|
67
|
+
return await this.query.get(create(ApiResourceIdSchema, { value: id }));
|
|
68
|
+
} catch (e) { throw wrapError(e); }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async getByReference(ref: ResourceRef): Promise<McpServer> {
|
|
72
|
+
try {
|
|
73
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
74
|
+
} catch (e) { throw wrapError(e); }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async list(params: ListParams): Promise<ListResult> {
|
|
78
|
+
try {
|
|
79
|
+
const resp = await this.search.search(create(SearchRequestSchema, {
|
|
80
|
+
kinds: [ApiResourceKind.mcp_server],
|
|
81
|
+
query: params.query,
|
|
82
|
+
org: params.org,
|
|
83
|
+
excludePublic: params.excludePublic ?? false,
|
|
84
|
+
page: params.page ? create(PageInfoSchema, params.page) : undefined,
|
|
85
|
+
}));
|
|
86
|
+
return {
|
|
87
|
+
entries: resp.entries,
|
|
88
|
+
totalCount: resp.totalCount,
|
|
89
|
+
totalPages: resp.totalPages,
|
|
90
|
+
};
|
|
91
|
+
} catch (e) { throw wrapError(e); }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Input for creating/updating a McpServer. */
|
|
96
|
+
export interface McpServerInput {
|
|
97
|
+
name: string;
|
|
98
|
+
org: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
iconUrl?: string;
|
|
101
|
+
stdio?: StdioServerConfigInput;
|
|
102
|
+
http?: HttpServerConfigInput;
|
|
103
|
+
defaultEnabledTools?: string[];
|
|
104
|
+
envSpec?: EnvSpecInput;
|
|
105
|
+
defaultToolApprovals?: ToolApprovalPolicyInput[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** SDK input type for StdioServerConfig. */
|
|
109
|
+
export interface StdioServerConfigInput {
|
|
110
|
+
command: string;
|
|
111
|
+
args?: string[];
|
|
112
|
+
workingDir?: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** SDK input type for HttpServerConfig. */
|
|
116
|
+
export interface HttpServerConfigInput {
|
|
117
|
+
url: string;
|
|
118
|
+
headers?: Record<string, string>;
|
|
119
|
+
queryParams?: Record<string, string>;
|
|
120
|
+
timeoutSeconds?: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** SDK input type for ToolApprovalPolicy. */
|
|
124
|
+
export interface ToolApprovalPolicyInput {
|
|
125
|
+
toolName?: string;
|
|
126
|
+
message?: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function buildMcpServerProto(input: McpServerInput): McpServer {
|
|
130
|
+
return Object.assign(create(McpServerSchema), {
|
|
131
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
132
|
+
kind: "McpServer",
|
|
133
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
134
|
+
name: input.name,
|
|
135
|
+
org: input.org,
|
|
136
|
+
}),
|
|
137
|
+
spec: Object.assign(create(McpServerSpecSchema), {
|
|
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
|
+
}),
|
|
146
|
+
}) as McpServer;
|
|
147
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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 { EmptySchema } from "@bufbuild/protobuf/wkt";
|
|
7
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
|
+
import { type FindApiResourcesRequest } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
9
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
10
|
+
import { OrganizationSchema, type Organization } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
11
|
+
import { OrganizationCommandController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/command_pb";
|
|
12
|
+
import { ManagementMode } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/enum_pb";
|
|
13
|
+
import { OrganizationIdSchema, OrganizationListSchema, OrganizationsSchema, OrganizationExternalLookupSchema, type OrganizationList, type Organizations, type OrganizationExternalLookup } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/io_pb";
|
|
14
|
+
import { OrganizationQueryController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/query_pb";
|
|
15
|
+
import { OrganizationSpecSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/spec_pb";
|
|
16
|
+
|
|
17
|
+
/** Provides operations on organization resources. */
|
|
18
|
+
export class OrganizationClient {
|
|
19
|
+
private readonly command: Client<typeof OrganizationCommandController>;
|
|
20
|
+
private readonly query: Client<typeof OrganizationQueryController>;
|
|
21
|
+
|
|
22
|
+
constructor(transport: Transport) {
|
|
23
|
+
this.command = createClient(OrganizationCommandController, transport);
|
|
24
|
+
this.query = createClient(OrganizationQueryController, transport);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async apply(input: OrganizationInput): Promise<Organization> {
|
|
28
|
+
try {
|
|
29
|
+
return await this.command.apply(buildOrganizationProto(input));
|
|
30
|
+
} catch (e) { throw wrapError(e); }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async create(input: OrganizationInput): Promise<Organization> {
|
|
34
|
+
try {
|
|
35
|
+
return await this.command.create(buildOrganizationProto(input));
|
|
36
|
+
} catch (e) { throw wrapError(e); }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async update(input: OrganizationInput): Promise<Organization> {
|
|
40
|
+
try {
|
|
41
|
+
return await this.command.update(buildOrganizationProto(input));
|
|
42
|
+
} catch (e) { throw wrapError(e); }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async delete(id: string): Promise<Organization> {
|
|
46
|
+
try {
|
|
47
|
+
return await this.command.delete(create(OrganizationIdSchema, { value: id }));
|
|
48
|
+
} catch (e) { throw wrapError(e); }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async get(id: string): Promise<Organization> {
|
|
52
|
+
try {
|
|
53
|
+
return await this.query.get(create(OrganizationIdSchema, { value: id }));
|
|
54
|
+
} catch (e) { throw wrapError(e); }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async find(input: FindApiResourcesRequest): Promise<OrganizationList> {
|
|
58
|
+
try {
|
|
59
|
+
return await this.query.find(input);
|
|
60
|
+
} catch (e) { throw wrapError(e); }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async findMyOrganizations(): Promise<Organizations> {
|
|
64
|
+
try {
|
|
65
|
+
return await this.query.findMyOrganizations(create(EmptySchema, {}));
|
|
66
|
+
} catch (e) { throw wrapError(e); }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async getByExternalOrgId(input: OrganizationExternalLookup): Promise<Organization> {
|
|
70
|
+
try {
|
|
71
|
+
return await this.query.getByExternalOrgId(input);
|
|
72
|
+
} catch (e) { throw wrapError(e); }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Input for creating/updating a Organization. */
|
|
77
|
+
export interface OrganizationInput {
|
|
78
|
+
name: string;
|
|
79
|
+
org: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
logoUrl?: string;
|
|
82
|
+
managementMode?: ManagementMode;
|
|
83
|
+
identityProviderRef?: ResourceRef;
|
|
84
|
+
externalOrgId?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function buildOrganizationProto(input: OrganizationInput): Organization {
|
|
88
|
+
return Object.assign(create(OrganizationSchema), {
|
|
89
|
+
apiVersion: "tenancy.stigmer.ai/v1",
|
|
90
|
+
kind: "Organization",
|
|
91
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
92
|
+
name: input.name,
|
|
93
|
+
org: input.org,
|
|
94
|
+
}),
|
|
95
|
+
spec: Object.assign(create(OrganizationSpecSchema), {
|
|
96
|
+
description: input.description,
|
|
97
|
+
logoUrl: input.logoUrl,
|
|
98
|
+
managementMode: input.managementMode,
|
|
99
|
+
identityProviderRef: input.identityProviderRef,
|
|
100
|
+
externalOrgId: input.externalOrgId,
|
|
101
|
+
}),
|
|
102
|
+
}) as Organization;
|
|
103
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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 { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
8
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
9
|
+
import { ProjectSchema, type Project } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/api_pb";
|
|
10
|
+
import { ProjectCommandController } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/command_pb";
|
|
11
|
+
import { ProjectIdSchema } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/io_pb";
|
|
12
|
+
import { ProjectQueryController } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/query_pb";
|
|
13
|
+
import { ProjectSpecSchema } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/spec_pb";
|
|
14
|
+
|
|
15
|
+
/** Provides operations on project resources. */
|
|
16
|
+
export class ProjectClient {
|
|
17
|
+
private readonly command: Client<typeof ProjectCommandController>;
|
|
18
|
+
private readonly query: Client<typeof ProjectQueryController>;
|
|
19
|
+
|
|
20
|
+
constructor(transport: Transport) {
|
|
21
|
+
this.command = createClient(ProjectCommandController, transport);
|
|
22
|
+
this.query = createClient(ProjectQueryController, transport);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async apply(input: ProjectInput): Promise<Project> {
|
|
26
|
+
try {
|
|
27
|
+
return await this.command.apply(buildProjectProto(input));
|
|
28
|
+
} catch (e) { throw wrapError(e); }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async create(input: ProjectInput): Promise<Project> {
|
|
32
|
+
try {
|
|
33
|
+
return await this.command.create(buildProjectProto(input));
|
|
34
|
+
} catch (e) { throw wrapError(e); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async update(input: ProjectInput): Promise<Project> {
|
|
38
|
+
try {
|
|
39
|
+
return await this.command.update(buildProjectProto(input));
|
|
40
|
+
} catch (e) { throw wrapError(e); }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async delete(id: string): Promise<Project> {
|
|
44
|
+
try {
|
|
45
|
+
return await this.command.delete(create(ProjectIdSchema, { value: id }));
|
|
46
|
+
} catch (e) { throw wrapError(e); }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async get(id: string): Promise<Project> {
|
|
50
|
+
try {
|
|
51
|
+
return await this.query.get(create(ProjectIdSchema, { value: id }));
|
|
52
|
+
} catch (e) { throw wrapError(e); }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async getByReference(ref: ResourceRef): Promise<Project> {
|
|
56
|
+
try {
|
|
57
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
58
|
+
} catch (e) { throw wrapError(e); }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Input for creating/updating a Project. */
|
|
63
|
+
export interface ProjectInput {
|
|
64
|
+
name: string;
|
|
65
|
+
org: string;
|
|
66
|
+
entryPoint?: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
members?: ResourceRef[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function buildProjectProto(input: ProjectInput): Project {
|
|
72
|
+
return Object.assign(create(ProjectSchema), {
|
|
73
|
+
apiVersion: "tenancy.stigmer.ai/v1",
|
|
74
|
+
kind: "Project",
|
|
75
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
76
|
+
name: input.name,
|
|
77
|
+
org: input.org,
|
|
78
|
+
}),
|
|
79
|
+
spec: Object.assign(create(ProjectSpecSchema), {
|
|
80
|
+
entryPoint: input.entryPoint,
|
|
81
|
+
description: input.description,
|
|
82
|
+
members: input.members,
|
|
83
|
+
}),
|
|
84
|
+
}) as Project;
|
|
85
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
6
|
+
import { SessionSchema, type Session } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
|
|
7
|
+
import { SessionCommandController } from "@stigmer/protos/ai/stigmer/agentic/session/v1/command_pb";
|
|
8
|
+
import { SessionIdSchema, ListSessionsRequestSchema, SessionListSchema, ListSessionsByAgentRequestSchema, type ListSessionsRequest, type SessionList, type ListSessionsByAgentRequest } from "@stigmer/protos/ai/stigmer/agentic/session/v1/io_pb";
|
|
9
|
+
import { SessionQueryController } from "@stigmer/protos/ai/stigmer/agentic/session/v1/query_pb";
|
|
10
|
+
import { SessionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/spec_pb";
|
|
11
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
12
|
+
|
|
13
|
+
/** Provides operations on session resources. */
|
|
14
|
+
export class SessionClient {
|
|
15
|
+
private readonly command: Client<typeof SessionCommandController>;
|
|
16
|
+
private readonly query: Client<typeof SessionQueryController>;
|
|
17
|
+
|
|
18
|
+
constructor(transport: Transport) {
|
|
19
|
+
this.command = createClient(SessionCommandController, transport);
|
|
20
|
+
this.query = createClient(SessionQueryController, transport);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async apply(input: SessionInput): Promise<Session> {
|
|
24
|
+
try {
|
|
25
|
+
return await this.command.apply(buildSessionProto(input));
|
|
26
|
+
} catch (e) { throw wrapError(e); }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async create(input: SessionInput): Promise<Session> {
|
|
30
|
+
try {
|
|
31
|
+
return await this.command.create(buildSessionProto(input));
|
|
32
|
+
} catch (e) { throw wrapError(e); }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async update(input: SessionInput): Promise<Session> {
|
|
36
|
+
try {
|
|
37
|
+
return await this.command.update(buildSessionProto(input));
|
|
38
|
+
} catch (e) { throw wrapError(e); }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async delete(id: string): Promise<Session> {
|
|
42
|
+
try {
|
|
43
|
+
return await this.command.delete(create(SessionIdSchema, { value: id }));
|
|
44
|
+
} catch (e) { throw wrapError(e); }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async get(id: string): Promise<Session> {
|
|
48
|
+
try {
|
|
49
|
+
return await this.query.get(create(SessionIdSchema, { value: id }));
|
|
50
|
+
} catch (e) { throw wrapError(e); }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async list(input: ListSessionsRequest): Promise<SessionList> {
|
|
54
|
+
try {
|
|
55
|
+
return await this.query.list(input);
|
|
56
|
+
} catch (e) { throw wrapError(e); }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async listByAgent(input: ListSessionsByAgentRequest): Promise<SessionList> {
|
|
60
|
+
try {
|
|
61
|
+
return await this.query.listByAgent(input);
|
|
62
|
+
} catch (e) { throw wrapError(e); }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Input for creating/updating a Session. */
|
|
67
|
+
export interface SessionInput {
|
|
68
|
+
name: string;
|
|
69
|
+
org: string;
|
|
70
|
+
agentInstanceId: string;
|
|
71
|
+
subject?: string;
|
|
72
|
+
threadId?: string;
|
|
73
|
+
sandboxId?: string;
|
|
74
|
+
metadata?: Record<string, string>;
|
|
75
|
+
workspaceEntries?: WorkspaceEntryInput[];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** SDK input type for WorkspaceEntry. */
|
|
79
|
+
export interface WorkspaceEntryInput {
|
|
80
|
+
name?: string;
|
|
81
|
+
source: WorkspaceSourceInput;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** SDK input type for WorkspaceSource. */
|
|
85
|
+
export interface WorkspaceSourceInput {
|
|
86
|
+
gitRepo?: GitRepoSourceInput;
|
|
87
|
+
localPath?: LocalPathSourceInput;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** SDK input type for GitRepoSource. */
|
|
91
|
+
export interface GitRepoSourceInput {
|
|
92
|
+
url: string;
|
|
93
|
+
branch?: string;
|
|
94
|
+
commit?: string;
|
|
95
|
+
depth?: number;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** SDK input type for LocalPathSource. */
|
|
99
|
+
export interface LocalPathSourceInput {
|
|
100
|
+
path?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function buildSessionProto(input: SessionInput): Session {
|
|
104
|
+
return Object.assign(create(SessionSchema), {
|
|
105
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
106
|
+
kind: "Session",
|
|
107
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
108
|
+
name: input.name,
|
|
109
|
+
org: input.org,
|
|
110
|
+
}),
|
|
111
|
+
spec: Object.assign(create(SessionSpecSchema), {
|
|
112
|
+
agentInstanceId: input.agentInstanceId,
|
|
113
|
+
subject: input.subject,
|
|
114
|
+
threadId: input.threadId,
|
|
115
|
+
sandboxId: input.sandboxId,
|
|
116
|
+
metadata: input.metadata,
|
|
117
|
+
workspaceEntries: input.workspaceEntries,
|
|
118
|
+
}),
|
|
119
|
+
}) as Session;
|
|
120
|
+
}
|
package/src/gen/skill.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors";
|
|
4
|
+
import { type ListParams, type ListResult, type ResourceRef } from "./types";
|
|
5
|
+
import { create } from "@bufbuild/protobuf";
|
|
6
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
|
+
import { SkillSchema, type Skill } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
|
|
8
|
+
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 { SkillQueryController } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/query_pb";
|
|
11
|
+
import { SkillSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/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 skill resources. */
|
|
20
|
+
export class SkillClient {
|
|
21
|
+
private readonly command: Client<typeof SkillCommandController>;
|
|
22
|
+
private readonly query: Client<typeof SkillQueryController>;
|
|
23
|
+
private readonly search: Client<typeof SearchService>;
|
|
24
|
+
|
|
25
|
+
constructor(transport: Transport) {
|
|
26
|
+
this.command = createClient(SkillCommandController, transport);
|
|
27
|
+
this.query = createClient(SkillQueryController, transport);
|
|
28
|
+
this.search = createClient(SearchService, transport);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async push(input: PushSkillRequest): Promise<Skill> {
|
|
32
|
+
try {
|
|
33
|
+
return await this.command.push(input);
|
|
34
|
+
} catch (e) { throw wrapError(e); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async delete(id: string): Promise<Skill> {
|
|
38
|
+
try {
|
|
39
|
+
return await this.command.delete(create(SkillIdSchema, { value: id }));
|
|
40
|
+
} catch (e) { throw wrapError(e); }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async get(id: string): Promise<Skill> {
|
|
44
|
+
try {
|
|
45
|
+
return await this.query.get(create(SkillIdSchema, { value: id }));
|
|
46
|
+
} catch (e) { throw wrapError(e); }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async getByReference(ref: ResourceRef): Promise<Skill> {
|
|
50
|
+
try {
|
|
51
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
52
|
+
} catch (e) { throw wrapError(e); }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async getArtifact(input: GetArtifactRequest): Promise<GetArtifactResponse> {
|
|
56
|
+
try {
|
|
57
|
+
return await this.query.getArtifact(input);
|
|
58
|
+
} catch (e) { throw wrapError(e); }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async list(params: ListParams): Promise<ListResult> {
|
|
62
|
+
try {
|
|
63
|
+
const resp = await this.search.search(create(SearchRequestSchema, {
|
|
64
|
+
kinds: [ApiResourceKind.skill],
|
|
65
|
+
query: params.query,
|
|
66
|
+
org: params.org,
|
|
67
|
+
excludePublic: params.excludePublic ?? false,
|
|
68
|
+
page: params.page ? create(PageInfoSchema, params.page) : undefined,
|
|
69
|
+
}));
|
|
70
|
+
return {
|
|
71
|
+
entries: resp.entries,
|
|
72
|
+
totalCount: resp.totalCount,
|
|
73
|
+
totalPages: resp.totalPages,
|
|
74
|
+
};
|
|
75
|
+
} catch (e) { throw wrapError(e); }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Input for creating/updating a Skill. */
|
|
80
|
+
export interface SkillInput {
|
|
81
|
+
name: string;
|
|
82
|
+
org: string;
|
|
83
|
+
skillMd?: string;
|
|
84
|
+
tag?: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function buildSkillProto(input: SkillInput): Skill {
|
|
89
|
+
return Object.assign(create(SkillSchema), {
|
|
90
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
91
|
+
kind: "Skill",
|
|
92
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
93
|
+
name: input.name,
|
|
94
|
+
org: input.org,
|
|
95
|
+
}),
|
|
96
|
+
spec: Object.assign(create(SkillSpecSchema), {
|
|
97
|
+
skillMd: input.skillMd,
|
|
98
|
+
tag: input.tag,
|
|
99
|
+
description: input.description,
|
|
100
|
+
}),
|
|
101
|
+
}) as Skill;
|
|
102
|
+
}
|
package/src/gen/types.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type { SearchResult } from "@stigmer/protos/ai/stigmer/search/v1/io_pb";
|
|
4
|
+
|
|
5
|
+
/** Arguments for deleting a resource. */
|
|
6
|
+
export interface DeleteResourceInput {
|
|
7
|
+
readonly resourceId: string;
|
|
8
|
+
readonly versionMessage?: string;
|
|
9
|
+
readonly force?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Identifies an API resource by org, slug, and optional version. */
|
|
13
|
+
export interface ResourceRef {
|
|
14
|
+
readonly org: string;
|
|
15
|
+
readonly slug: string;
|
|
16
|
+
readonly version?: string;
|
|
17
|
+
readonly kind?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Offset-based pagination parameters. */
|
|
21
|
+
export interface Page {
|
|
22
|
+
readonly num: number;
|
|
23
|
+
readonly size: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Parameters for SearchService-backed list queries. */
|
|
27
|
+
export interface ListParams {
|
|
28
|
+
readonly org: string;
|
|
29
|
+
readonly query?: string;
|
|
30
|
+
readonly excludePublic?: boolean;
|
|
31
|
+
readonly page?: Page;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Response from a SearchService-backed list query. */
|
|
35
|
+
export interface ListResult {
|
|
36
|
+
readonly entries: SearchResult[];
|
|
37
|
+
readonly totalCount: number;
|
|
38
|
+
readonly totalPages: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Environment variable configuration. */
|
|
42
|
+
export interface EnvSpecInput {
|
|
43
|
+
readonly variables: Record<string, EnvVarInput>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** A single environment variable. */
|
|
47
|
+
export interface EnvVarInput {
|
|
48
|
+
readonly value: string;
|
|
49
|
+
readonly isSecret?: boolean;
|
|
50
|
+
readonly description?: string;
|
|
51
|
+
}
|