@stigmer/sdk 3.1.17 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/errors.test.js +32 -1
- package/__tests__/errors.test.js.map +1 -1
- package/errors.d.ts +29 -0
- package/errors.d.ts.map +1 -1
- package/errors.js +32 -0
- package/errors.js.map +1 -1
- package/gen/agentchannel.d.ts +7 -0
- package/gen/agentchannel.d.ts.map +1 -1
- package/gen/agentchannel.js +13 -1
- package/gen/agentchannel.js.map +1 -1
- package/gen/authorization-config.d.ts.map +1 -1
- package/gen/authorization-config.js +1 -0
- package/gen/authorization-config.js.map +1 -1
- package/gen/channelapp.d.ts +43 -0
- package/gen/channelapp.d.ts.map +1 -0
- package/gen/channelapp.js +118 -0
- package/gen/channelapp.js.map +1 -0
- package/gen/client.d.ts +6 -2
- package/gen/client.d.ts.map +1 -1
- package/gen/client.js +6 -2
- package/gen/client.js.map +1 -1
- package/gen/errors.d.ts +1 -1
- package/gen/errors.d.ts.map +1 -1
- package/gen/errors.js +6 -4
- package/gen/errors.js.map +1 -1
- package/gen/session.d.ts +2 -1
- package/gen/session.d.ts.map +1 -1
- package/gen/session.js +8 -0
- package/gen/session.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/errors.test.ts +61 -0
- package/src/errors.ts +47 -0
- package/src/gen/agentchannel.ts +21 -1
- package/src/gen/authorization-config.ts +1 -0
- package/src/gen/channelapp.ts +138 -0
- package/src/gen/client.ts +8 -3
- package/src/gen/errors.ts +6 -4
- package/src/gen/session.ts +7 -1
- package/src/index.ts +12 -0
package/src/gen/client.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { AgentInstanceClient } from "./agentinstance.js";
|
|
|
8
8
|
import { AgentShareClient } from "./agentshare.js";
|
|
9
9
|
import { ApiKeyClient } from "./apikey.js";
|
|
10
10
|
import { ArtifactClient } from "./artifact.js";
|
|
11
|
+
import { ChannelAppClient } from "./channelapp.js";
|
|
11
12
|
import { EnvironmentClient } from "./environment.js";
|
|
12
13
|
import { ExecutionContextClient } from "./executioncontext.js";
|
|
13
14
|
import { IamPolicyClient } from "./iampolicy.js";
|
|
@@ -28,12 +29,13 @@ import { WorkflowInstanceClient } from "./workflowinstance.js";
|
|
|
28
29
|
/** Aggregate client with all resource-specific sub-clients. */
|
|
29
30
|
export class GeneratedClient {
|
|
30
31
|
readonly agent: AgentClient;
|
|
31
|
-
readonly
|
|
32
|
+
readonly agentChannel: AgentChannelClient;
|
|
32
33
|
readonly agentExecution: AgentExecutionClient;
|
|
33
34
|
readonly agentInstance: AgentInstanceClient;
|
|
34
35
|
readonly agentShare: AgentShareClient;
|
|
35
36
|
readonly apiKey: ApiKeyClient;
|
|
36
37
|
readonly artifact: ArtifactClient;
|
|
38
|
+
readonly channelapp: ChannelAppClient;
|
|
37
39
|
readonly environment: EnvironmentClient;
|
|
38
40
|
readonly executionContext: ExecutionContextClient;
|
|
39
41
|
readonly iamPolicy: IamPolicyClient;
|
|
@@ -53,12 +55,13 @@ export class GeneratedClient {
|
|
|
53
55
|
|
|
54
56
|
constructor(transport: Transport) {
|
|
55
57
|
this.agent = new AgentClient(transport);
|
|
56
|
-
this.
|
|
58
|
+
this.agentChannel = new AgentChannelClient(transport);
|
|
57
59
|
this.agentExecution = new AgentExecutionClient(transport);
|
|
58
60
|
this.agentInstance = new AgentInstanceClient(transport);
|
|
59
61
|
this.agentShare = new AgentShareClient(transport);
|
|
60
62
|
this.apiKey = new ApiKeyClient(transport);
|
|
61
63
|
this.artifact = new ArtifactClient(transport);
|
|
64
|
+
this.channelapp = new ChannelAppClient(transport);
|
|
62
65
|
this.environment = new EnvironmentClient(transport);
|
|
63
66
|
this.executionContext = new ExecutionContextClient(transport);
|
|
64
67
|
this.iamPolicy = new IamPolicyClient(transport);
|
|
@@ -82,7 +85,7 @@ export class GeneratedClient {
|
|
|
82
85
|
export { AgentClient } from "./agent.js";
|
|
83
86
|
export { type AgentInput, type McpServerUsageInput, type ToolApprovalOverrideInput, type SubAgentInput, type McpAccessInput, type EnvVarDeclarationInput } from "./agent.js";
|
|
84
87
|
export { AgentChannelClient } from "./agentchannel.js";
|
|
85
|
-
export { type AgentChannelInput, type SlackChannelConfigInput } from "./agentchannel.js";
|
|
88
|
+
export { type AgentChannelInput, type SlackChannelConfigInput, type WhatsAppChannelConfigInput } from "./agentchannel.js";
|
|
86
89
|
export { AgentExecutionClient } from "./agentexecution.js";
|
|
87
90
|
export { type AgentExecutionInput, type SessionSpecInput, type WorkspaceEntryInput, type WorkspaceSourceInput, type GitRepoSourceInput, type LocalPathSourceInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput } from "./agentexecution.js";
|
|
88
91
|
export { AgentInstanceClient } from "./agentinstance.js";
|
|
@@ -93,6 +96,8 @@ export { ApiKeyClient } from "./apikey.js";
|
|
|
93
96
|
export { type ApiKeyInput } from "./apikey.js";
|
|
94
97
|
export { ArtifactClient } from "./artifact.js";
|
|
95
98
|
export { type ArtifactInput, type ArtifactSourceInput, type RetentionPolicyInput } from "./artifact.js";
|
|
99
|
+
export { ChannelAppClient } from "./channelapp.js";
|
|
100
|
+
export { type ChannelAppInput, type SlackChannelAppConfigInput, type WhatsAppChannelAppConfigInput } from "./channelapp.js";
|
|
96
101
|
export { EnvironmentClient } from "./environment.js";
|
|
97
102
|
export { type EnvironmentInput } from "./environment.js";
|
|
98
103
|
export { ExecutionContextClient } from "./executioncontext.js";
|
package/src/gen/errors.ts
CHANGED
|
@@ -34,8 +34,8 @@ export class StigmerError extends Error {
|
|
|
34
34
|
readonly code: ErrorCode;
|
|
35
35
|
readonly connectCode: number;
|
|
36
36
|
|
|
37
|
-
constructor(code: ErrorCode, message: string, connectCode: number) {
|
|
38
|
-
super(message);
|
|
37
|
+
constructor(code: ErrorCode, message: string, connectCode: number, options?: ErrorOptions) {
|
|
38
|
+
super(message, options);
|
|
39
39
|
this.name = "StigmerError";
|
|
40
40
|
this.code = code;
|
|
41
41
|
this.connectCode = connectCode;
|
|
@@ -46,13 +46,15 @@ export class StigmerError extends Error {
|
|
|
46
46
|
export function wrapError(err: unknown): StigmerError {
|
|
47
47
|
if (err instanceof ConnectError) {
|
|
48
48
|
const code = CODE_MAP[err.code] ?? "unknown";
|
|
49
|
-
|
|
49
|
+
// Chain the ConnectError so structured error details
|
|
50
|
+
// (e.g. google.rpc.ErrorInfo) stay reachable via getErrorReason.
|
|
51
|
+
return new StigmerError(code, err.rawMessage || err.message, err.code, { cause: err });
|
|
50
52
|
}
|
|
51
53
|
if (err instanceof StigmerError) {
|
|
52
54
|
return err;
|
|
53
55
|
}
|
|
54
56
|
if (err instanceof Error) {
|
|
55
|
-
return new StigmerError("unknown", err.message, Code.Unknown);
|
|
57
|
+
return new StigmerError("unknown", err.message, Code.Unknown, { cause: err });
|
|
56
58
|
}
|
|
57
59
|
return new StigmerError("unknown", String(err), Code.Unknown);
|
|
58
60
|
}
|
package/src/gen/session.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { ToolApprovalOverrideSchema, McpServerUsageSchema } from "@stigmer/proto
|
|
|
9
9
|
import { SessionSchema, type Session } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
|
|
10
10
|
import { SessionCommandController } from "@stigmer/protos/ai/stigmer/agentic/session/v1/command_pb";
|
|
11
11
|
import { Harness, CursorMode, ExecutionTarget, GitWriteBackMode } from "@stigmer/protos/ai/stigmer/agentic/session/v1/enum_pb";
|
|
12
|
-
import { SessionIdSchema, UpdateSessionSubjectRequestSchema, ListSessionsRequestSchema, SessionListSchema, ListSessionsByAgentInstanceRequestSchema, type UpdateSessionSubjectRequest, type ListSessionsRequest, type SessionList, type ListSessionsByAgentInstanceRequest } from "@stigmer/protos/ai/stigmer/agentic/session/v1/io_pb";
|
|
12
|
+
import { SessionIdSchema, UpdateSessionSubjectRequestSchema, ListSessionsRequestSchema, SessionListSchema, ListSessionsByAgentInstanceRequestSchema, ListSessionsByChannelRequestSchema, type UpdateSessionSubjectRequest, type ListSessionsRequest, type SessionList, type ListSessionsByAgentInstanceRequest, type ListSessionsByChannelRequest } from "@stigmer/protos/ai/stigmer/agentic/session/v1/io_pb";
|
|
13
13
|
import { SessionQueryController } from "@stigmer/protos/ai/stigmer/agentic/session/v1/query_pb";
|
|
14
14
|
import { SessionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/spec_pb";
|
|
15
15
|
import { GitRepoSourceSchema, LocalPathSourceSchema, WorkspaceSourceSchema, WorkspaceEntrySchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
@@ -74,6 +74,12 @@ export class SessionClient {
|
|
|
74
74
|
return await this.query.listByAgentInstance(input);
|
|
75
75
|
} catch (e) { throw wrapError(e); }
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
async listByChannel(input: ListSessionsByChannelRequest): Promise<SessionList> {
|
|
79
|
+
try {
|
|
80
|
+
return await this.query.listByChannel(input);
|
|
81
|
+
} catch (e) { throw wrapError(e); }
|
|
82
|
+
}
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
/** Input for creating/updating a Session. */
|
package/src/index.ts
CHANGED
|
@@ -47,6 +47,8 @@ export {
|
|
|
47
47
|
isRetryableError,
|
|
48
48
|
isTransientStreamError,
|
|
49
49
|
getUserMessage,
|
|
50
|
+
type ErrorReason,
|
|
51
|
+
getErrorReason,
|
|
50
52
|
type RpcErrorMetadata,
|
|
51
53
|
annotateRpcError,
|
|
52
54
|
getRpcMetadata,
|
|
@@ -134,6 +136,11 @@ export {
|
|
|
134
136
|
type SubAgentInput,
|
|
135
137
|
type McpAccessInput,
|
|
136
138
|
} from "./gen/agent.js";
|
|
139
|
+
export {
|
|
140
|
+
AgentChannelClient,
|
|
141
|
+
type AgentChannelInput,
|
|
142
|
+
type SlackChannelConfigInput,
|
|
143
|
+
} from "./gen/agentchannel.js";
|
|
137
144
|
export {
|
|
138
145
|
AgentExecutionClient,
|
|
139
146
|
type AgentExecutionInput,
|
|
@@ -151,6 +158,11 @@ export {
|
|
|
151
158
|
type AgentShareMessagesInput,
|
|
152
159
|
} from "./gen/agentshare.js";
|
|
153
160
|
export { ApiKeyClient, type ApiKeyInput } from "./gen/apikey.js";
|
|
161
|
+
export {
|
|
162
|
+
ChannelAppClient,
|
|
163
|
+
type ChannelAppInput,
|
|
164
|
+
type SlackChannelAppConfigInput,
|
|
165
|
+
} from "./gen/channelapp.js";
|
|
154
166
|
export {
|
|
155
167
|
EnvironmentClient,
|
|
156
168
|
type EnvironmentInput,
|