@stigmer/sdk 3.6.0 → 3.8.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/src/gen/client.ts CHANGED
@@ -91,9 +91,9 @@ export class GeneratedClient {
91
91
  export { AgentClient } from "./agent.js";
92
92
  export { type AgentInput, type McpServerUsageInput, type ToolApprovalOverrideInput, type SubAgentInput, type McpAccessInput, type EnvVarDeclarationInput, type DatastoreUsageInput } from "./agent.js";
93
93
  export { AgentChannelClient } from "./agentchannel.js";
94
- export { type AgentChannelInput, type SlackChannelConfigInput, type WhatsAppChannelConfigInput } from "./agentchannel.js";
94
+ export { type AgentChannelInput, type SlackChannelConfigInput, type WhatsAppChannelConfigInput, type RunConfigInput } from "./agentchannel.js";
95
95
  export { AgentExecutionClient } from "./agentexecution.js";
96
- export { type AgentExecutionInput, type SessionSpecInput, type WorkspaceEntryInput, type WorkspaceSourceInput, type GitRepoSourceInput, type LocalPathSourceInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput } from "./agentexecution.js";
96
+ export { type AgentExecutionInput, type SessionSpecInput, type WorkspaceEntryInput, type WorkspaceSourceInput, type GitRepoSourceInput, type LocalPathSourceInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput, type ConversationCatchupInput } from "./agentexecution.js";
97
97
  export { AgentInstanceClient } from "./agentinstance.js";
98
98
  export { type AgentInstanceInput } from "./agentinstance.js";
99
99
  export { AgentShareClient } from "./agentshare.js";
@@ -129,7 +129,7 @@ export { type PlatformClientInput } from "./platformclient.js";
129
129
  export { ProjectClient } from "./project.js";
130
130
  export { type ProjectInput } from "./project.js";
131
131
  export { ScheduleClient } from "./schedule.js";
132
- export { type ScheduleInput, type AgentTargetInput } from "./schedule.js";
132
+ export { type ScheduleInput, type AgentInvocationInput } from "./schedule.js";
133
133
  export { SessionClient } from "./session.js";
134
134
  export { type SessionInput } from "./session.js";
135
135
  export { SkillClient } from "./skill.js";
@@ -5,11 +5,15 @@ import { stripUndefined } from "./proto-utils.js";
5
5
  import { type ResourceRef } from "./types.js";
6
6
  import { create } from "@bufbuild/protobuf";
7
7
  import { createClient, type Client, type Transport } from "@connectrpc/connect";
8
+ import { ServiceTier } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
9
+ import { RunConfigSchema, AgentInvocationSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/invocation_pb";
8
10
  import { ScheduleSchema, type Schedule } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/api_pb";
9
11
  import { ScheduleCommandController } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/command_pb";
10
- import { ScheduleIdSchema, GetSchedulesByAgentRequestSchema, ScheduleListSchema, ListSchedulesRequestSchema, type GetSchedulesByAgentRequest, type ScheduleList, type ListSchedulesRequest } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/io_pb";
12
+ import { ScheduleIdSchema, ScheduleTriggerResultSchema, GetSchedulesByAgentRequestSchema, ScheduleListSchema, ListSchedulesRequestSchema, ListScheduleRunsRequestSchema, ScheduleRunListSchema, type ScheduleTriggerResult, type GetSchedulesByAgentRequest, type ScheduleList, type ListSchedulesRequest, type ListScheduleRunsRequest, type ScheduleRunList } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/io_pb";
11
13
  import { ScheduleQueryController } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/query_pb";
12
- import { ScheduleSpecSchema, AgentTargetSchema } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/spec_pb";
14
+ import { ScheduleSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/spec_pb";
15
+ import { Harness, GitWriteBackMode } from "@stigmer/protos/ai/stigmer/agentic/session/v1/enum_pb";
16
+ import { GitRepoSourceSchema, LocalPathSourceSchema, WorkspaceSourceSchema, WorkspaceEntrySchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
13
17
  import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
14
18
  import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
15
19
  import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
@@ -55,7 +59,7 @@ export class ScheduleClient {
55
59
  } catch (e) { throw wrapError(e); }
56
60
  }
57
61
 
58
- async trigger(id: string): Promise<Schedule> {
62
+ async trigger(id: string): Promise<ScheduleTriggerResult> {
59
63
  try {
60
64
  return await this.command.trigger(create(ScheduleIdSchema, { value: id }));
61
65
  } catch (e) { throw wrapError(e); }
@@ -84,6 +88,12 @@ export class ScheduleClient {
84
88
  return await this.query.list(input);
85
89
  } catch (e) { throw wrapError(e); }
86
90
  }
91
+
92
+ async listRuns(input: ListScheduleRunsRequest): Promise<ScheduleRunList> {
93
+ try {
94
+ return await this.query.listRuns(input);
95
+ } catch (e) { throw wrapError(e); }
96
+ }
87
97
  }
88
98
 
89
99
  /** Input for creating/updating a Schedule. */
@@ -96,19 +106,103 @@ export interface ScheduleInput {
96
106
  cron?: string;
97
107
  timeZone?: string;
98
108
  enabled?: boolean;
99
- agent?: AgentTargetInput;
109
+ agent?: AgentInvocationInput;
100
110
  }
101
111
 
102
- /** SDK input type for AgentTarget. */
103
- export interface AgentTargetInput {
112
+ /** SDK input type for AgentInvocation. */
113
+ export interface AgentInvocationInput {
104
114
  agentRef: ResourceRef;
105
115
  message?: string;
116
+ harness?: Harness;
117
+ workspaceEntries?: WorkspaceEntryInput[];
118
+ environmentRefs?: ResourceRef[];
119
+ runConfig?: RunConfigInput;
120
+ }
121
+
122
+ /** SDK input type for WorkspaceEntry. */
123
+ export interface WorkspaceEntryInput {
124
+ name?: string;
125
+ source: WorkspaceSourceInput;
126
+ }
127
+
128
+ /** SDK input type for WorkspaceSource. */
129
+ export interface WorkspaceSourceInput {
130
+ gitRepo?: GitRepoSourceInput;
131
+ localPath?: LocalPathSourceInput;
132
+ }
133
+
134
+ /** SDK input type for GitRepoSource. */
135
+ export interface GitRepoSourceInput {
136
+ url: string;
137
+ branch?: string;
138
+ commit?: string;
139
+ depth?: number;
140
+ writeBackMode?: GitWriteBackMode;
141
+ }
142
+
143
+ /** SDK input type for LocalPathSource. */
144
+ export interface LocalPathSourceInput {
145
+ path?: string;
146
+ }
147
+
148
+ /** SDK input type for RunConfig. */
149
+ export interface RunConfigInput {
150
+ modelName?: string;
151
+ maxCostUsd?: number;
152
+ maxToolRounds?: number;
153
+ serviceTier?: ServiceTier;
154
+ }
155
+
156
+ function buildGitRepoSourceProto(input: GitRepoSourceInput) {
157
+ return Object.assign(create(GitRepoSourceSchema), stripUndefined({
158
+ url: input.url,
159
+ branch: input.branch,
160
+ commit: input.commit,
161
+ depth: input.depth,
162
+ writeBackMode: input.writeBackMode,
163
+ }));
164
+ }
165
+
166
+ function buildLocalPathSourceProto(input: LocalPathSourceInput) {
167
+ return Object.assign(create(LocalPathSourceSchema), stripUndefined({
168
+ path: input.path,
169
+ }));
170
+ }
171
+
172
+ function buildWorkspaceSourceProto(input: WorkspaceSourceInput) {
173
+ const msg = create(WorkspaceSourceSchema);
174
+ if (input.gitRepo) {
175
+ msg.source = { case: "gitRepo", value: buildGitRepoSourceProto(input.gitRepo) };
176
+ } else if (input.localPath) {
177
+ msg.source = { case: "localPath", value: buildLocalPathSourceProto(input.localPath) };
178
+ }
179
+ return msg;
180
+ }
181
+
182
+ function buildWorkspaceEntryProto(input: WorkspaceEntryInput) {
183
+ const msg = create(WorkspaceEntrySchema);
184
+ if (input.name !== undefined) msg.name = input.name;
185
+ if (input.source) msg.source = buildWorkspaceSourceProto(input.source);
186
+ return msg;
187
+ }
188
+
189
+ function buildRunConfigProto(input: RunConfigInput) {
190
+ return Object.assign(create(RunConfigSchema), stripUndefined({
191
+ modelName: input.modelName,
192
+ maxCostUsd: input.maxCostUsd,
193
+ maxToolRounds: input.maxToolRounds,
194
+ serviceTier: input.serviceTier,
195
+ }));
106
196
  }
107
197
 
108
- function buildAgentTargetProto(input: AgentTargetInput) {
109
- const msg = create(AgentTargetSchema);
198
+ function buildAgentInvocationProto(input: AgentInvocationInput) {
199
+ const msg = create(AgentInvocationSchema);
110
200
  if (input.agentRef?.slug || input.agentRef?.org) msg.agentRef = create(ApiResourceReferenceSchema, { ...input.agentRef, kind: 40 });
111
201
  if (input.message !== undefined) msg.message = input.message;
202
+ if (input.harness !== undefined) msg.harness = input.harness;
203
+ if (input.workspaceEntries) msg.workspaceEntries = input.workspaceEntries.map(buildWorkspaceEntryProto);
204
+ if (input.environmentRefs) msg.environmentRefs = input.environmentRefs.map(r => create(ApiResourceReferenceSchema, { ...r, kind: 53 }));
205
+ if (input.runConfig) msg.runConfig = buildRunConfigProto(input.runConfig);
112
206
  return msg;
113
207
  }
114
208
 
@@ -119,7 +213,7 @@ export function buildScheduleProto(input: ScheduleInput): Schedule {
119
213
  enabled: input.enabled,
120
214
  }));
121
215
  if (input.agent) {
122
- spec.target = { case: "agent", value: buildAgentTargetProto(input.agent) };
216
+ spec.target = { case: "agent", value: buildAgentInvocationProto(input.agent) };
123
217
  }
124
218
  return Object.assign(create(ScheduleSchema), {
125
219
  apiVersion: "agentic.stigmer.ai/v1",
package/src/iam-role.ts CHANGED
@@ -6,6 +6,7 @@ const ROLE_STRINGS: Record<IamRole, string> = {
6
6
  [IamRole.admin]: "admin",
7
7
  [IamRole.member]: "member",
8
8
  [IamRole.viewer]: "viewer",
9
+ [IamRole.participant]: "participant",
9
10
  };
10
11
 
11
12
  const STRING_TO_ROLE: Record<string, IamRole> = {
@@ -13,6 +14,7 @@ const STRING_TO_ROLE: Record<string, IamRole> = {
13
14
  admin: IamRole.admin,
14
15
  member: IamRole.member,
15
16
  viewer: IamRole.viewer,
17
+ participant: IamRole.participant,
16
18
  };
17
19
 
18
20
  const ROLE_DISPLAY_NAMES: Record<IamRole, string> = {
@@ -21,6 +23,7 @@ const ROLE_DISPLAY_NAMES: Record<IamRole, string> = {
21
23
  [IamRole.admin]: "Admin",
22
24
  [IamRole.member]: "Member",
23
25
  [IamRole.viewer]: "Viewer",
26
+ [IamRole.participant]: "Participant",
24
27
  };
25
28
 
26
29
  const ROLE_DESCRIPTIONS: Record<IamRole, string> = {
@@ -29,6 +32,7 @@ const ROLE_DESCRIPTIONS: Record<IamRole, string> = {
29
32
  [IamRole.admin]: "Edit access and member management",
30
33
  [IamRole.member]: "Standard access to organization resources",
31
34
  [IamRole.viewer]: "Read-only access",
35
+ [IamRole.participant]: "Reply to customers and manage conversation takeover",
32
36
  };
33
37
 
34
38
  /**
package/src/index.ts CHANGED
@@ -245,7 +245,8 @@ export {
245
245
  ScheduleClient,
246
246
  buildScheduleProto,
247
247
  type ScheduleInput,
248
- type AgentTargetInput,
248
+ type AgentInvocationInput,
249
+ type RunConfigInput,
249
250
  } from "./gen/schedule.js";
250
251
  export {
251
252
  SessionClient,