@stigmer/sdk 3.12.5 → 3.12.6

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.
Files changed (149) hide show
  1. package/__tests__/update-input-roundtrip.test.d.ts +2 -0
  2. package/__tests__/update-input-roundtrip.test.d.ts.map +1 -0
  3. package/__tests__/update-input-roundtrip.test.js +791 -0
  4. package/__tests__/update-input-roundtrip.test.js.map +1 -0
  5. package/__tests__/update-input.test.js +22 -3
  6. package/__tests__/update-input.test.js.map +1 -1
  7. package/gen/agent.d.ts +21 -0
  8. package/gen/agent.d.ts.map +1 -1
  9. package/gen/agent.js +73 -1
  10. package/gen/agent.js.map +1 -1
  11. package/gen/agentchannel.d.ts +23 -1
  12. package/gen/agentchannel.d.ts.map +1 -1
  13. package/gen/agentchannel.js +55 -1
  14. package/gen/agentchannel.js.map +1 -1
  15. package/gen/agentexecution.d.ts +23 -1
  16. package/gen/agentexecution.d.ts.map +1 -1
  17. package/gen/agentexecution.js +146 -1
  18. package/gen/agentexecution.js.map +1 -1
  19. package/gen/agentinstance.d.ts +21 -0
  20. package/gen/agentinstance.d.ts.map +1 -1
  21. package/gen/agentinstance.js +32 -1
  22. package/gen/agentinstance.js.map +1 -1
  23. package/gen/agentshare.d.ts +23 -1
  24. package/gen/agentshare.d.ts.map +1 -1
  25. package/gen/agentshare.js +53 -1
  26. package/gen/agentshare.js.map +1 -1
  27. package/gen/apikey.d.ts +21 -0
  28. package/gen/apikey.d.ts.map +1 -1
  29. package/gen/apikey.js +33 -1
  30. package/gen/apikey.js.map +1 -1
  31. package/gen/artifact.d.ts +8 -0
  32. package/gen/artifact.d.ts.map +1 -1
  33. package/gen/artifact.js +1 -0
  34. package/gen/artifact.js.map +1 -1
  35. package/gen/channelapp.d.ts +21 -0
  36. package/gen/channelapp.d.ts.map +1 -1
  37. package/gen/channelapp.js +45 -0
  38. package/gen/channelapp.js.map +1 -1
  39. package/gen/environment.d.ts +21 -0
  40. package/gen/environment.d.ts.map +1 -1
  41. package/gen/environment.js +31 -1
  42. package/gen/environment.js.map +1 -1
  43. package/gen/executioncontext.d.ts +8 -0
  44. package/gen/executioncontext.d.ts.map +1 -1
  45. package/gen/executioncontext.js +1 -0
  46. package/gen/executioncontext.js.map +1 -1
  47. package/gen/iampolicy.d.ts +8 -0
  48. package/gen/iampolicy.d.ts.map +1 -1
  49. package/gen/iampolicy.js +1 -0
  50. package/gen/iampolicy.js.map +1 -1
  51. package/gen/identityaccount.d.ts +21 -0
  52. package/gen/identityaccount.d.ts.map +1 -1
  53. package/gen/identityaccount.js +46 -1
  54. package/gen/identityaccount.js.map +1 -1
  55. package/gen/identityprovider.d.ts +21 -0
  56. package/gen/identityprovider.d.ts.map +1 -1
  57. package/gen/identityprovider.js +40 -0
  58. package/gen/identityprovider.js.map +1 -1
  59. package/gen/invitation.d.ts +8 -0
  60. package/gen/invitation.d.ts.map +1 -1
  61. package/gen/invitation.js +1 -0
  62. package/gen/invitation.js.map +1 -1
  63. package/gen/mcpserver.d.ts +21 -0
  64. package/gen/mcpserver.d.ts.map +1 -1
  65. package/gen/mcpserver.js +79 -1
  66. package/gen/mcpserver.js.map +1 -1
  67. package/gen/oauthapp.d.ts +21 -0
  68. package/gen/oauthapp.d.ts.map +1 -1
  69. package/gen/oauthapp.js +39 -0
  70. package/gen/oauthapp.js.map +1 -1
  71. package/gen/organization.d.ts +21 -0
  72. package/gen/organization.d.ts.map +1 -1
  73. package/gen/organization.js +41 -1
  74. package/gen/organization.js.map +1 -1
  75. package/gen/platformclient.d.ts +21 -0
  76. package/gen/platformclient.d.ts.map +1 -1
  77. package/gen/platformclient.js +40 -1
  78. package/gen/platformclient.js.map +1 -1
  79. package/gen/project.d.ts +21 -0
  80. package/gen/project.d.ts.map +1 -1
  81. package/gen/project.js +32 -1
  82. package/gen/project.js.map +1 -1
  83. package/gen/proto-utils.d.ts +36 -0
  84. package/gen/proto-utils.d.ts.map +1 -1
  85. package/gen/proto-utils.js +58 -0
  86. package/gen/proto-utils.js.map +1 -1
  87. package/gen/schedule.d.ts +23 -1
  88. package/gen/schedule.d.ts.map +1 -1
  89. package/gen/schedule.js +79 -1
  90. package/gen/schedule.js.map +1 -1
  91. package/gen/session.d.ts +21 -0
  92. package/gen/session.d.ts.map +1 -1
  93. package/gen/session.js +80 -1
  94. package/gen/session.js.map +1 -1
  95. package/gen/skill.d.ts +8 -0
  96. package/gen/skill.d.ts.map +1 -1
  97. package/gen/skill.js +1 -0
  98. package/gen/skill.js.map +1 -1
  99. package/gen/workflow.d.ts +21 -0
  100. package/gen/workflow.d.ts.map +1 -1
  101. package/gen/workflow.js +79 -0
  102. package/gen/workflow.js.map +1 -1
  103. package/gen/workflowexecution.d.ts +21 -0
  104. package/gen/workflowexecution.d.ts.map +1 -1
  105. package/gen/workflowexecution.js +36 -1
  106. package/gen/workflowexecution.js.map +1 -1
  107. package/gen/workflowinstance.d.ts +21 -0
  108. package/gen/workflowinstance.d.ts.map +1 -1
  109. package/gen/workflowinstance.js +33 -1
  110. package/gen/workflowinstance.js.map +1 -1
  111. package/index.d.ts +20 -21
  112. package/index.d.ts.map +1 -1
  113. package/index.js +24 -23
  114. package/index.js.map +1 -1
  115. package/package.json +2 -2
  116. package/src/__tests__/update-input-roundtrip.test.ts +1031 -0
  117. package/src/__tests__/update-input.test.ts +34 -3
  118. package/src/gen/agent.ts +89 -3
  119. package/src/gen/agentchannel.ts +72 -4
  120. package/src/gen/agentexecution.ts +172 -6
  121. package/src/gen/agentinstance.ts +41 -1
  122. package/src/gen/agentshare.ts +68 -4
  123. package/src/gen/apikey.ts +42 -1
  124. package/src/gen/artifact.ts +9 -0
  125. package/src/gen/channelapp.ts +57 -1
  126. package/src/gen/environment.ts +40 -1
  127. package/src/gen/executioncontext.ts +9 -0
  128. package/src/gen/iampolicy.ts +9 -0
  129. package/src/gen/identityaccount.ts +57 -2
  130. package/src/gen/identityprovider.ts +49 -0
  131. package/src/gen/invitation.ts +9 -0
  132. package/src/gen/mcpserver.ts +95 -3
  133. package/src/gen/oauthapp.ts +48 -0
  134. package/src/gen/organization.ts +52 -2
  135. package/src/gen/platformclient.ts +49 -1
  136. package/src/gen/project.ts +41 -1
  137. package/src/gen/proto-utils.ts +64 -0
  138. package/src/gen/schedule.ts +98 -4
  139. package/src/gen/session.ts +97 -3
  140. package/src/gen/skill.ts +9 -0
  141. package/src/gen/workflow.ts +96 -2
  142. package/src/gen/workflowexecution.ts +45 -1
  143. package/src/gen/workflowinstance.ts +42 -1
  144. package/src/index.ts +24 -9
  145. package/src/update-input.ts +0 -168
  146. package/update-input.d.ts +0 -24
  147. package/update-input.d.ts.map +0 -1
  148. package/update-input.js +0 -126
  149. package/update-input.js.map +0 -1
@@ -1,17 +1,17 @@
1
1
  // Code generated by stigmer-codegen. DO NOT EDIT.
2
2
 
3
3
  import { wrapError } from "./errors.js";
4
- import { stripUndefined } from "./proto-utils.js";
4
+ import { stripUndefined, toResourceRefInput, toResourceRefInputs } 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 } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/invocation_pb";
8
+ import { ServiceTier, ThinkingMode } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
9
+ import { RunConfigSchema, type RunConfig } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/invocation_pb";
10
10
  import { AgentShareSchema, type AgentShare } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
11
11
  import { AgentShareCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/command_pb";
12
12
  import { AgentShareIdSchema, RotateShareLinkInputSchema, GetAgentSharesByAgentRequestSchema, AgentShareListSchema, ListAgentSharesRequestSchema, GetSharedProfileRequestSchema, SharedAgentProfileSchema, type RotateShareLinkInput, type GetAgentSharesByAgentRequest, type AgentShareList, type ListAgentSharesRequest, type GetSharedProfileRequest, type SharedAgentProfile } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/io_pb";
13
13
  import { AgentShareQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/query_pb";
14
- import { AgentShareSpecSchema, AgentShareAudience, AgentShareMessagesSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/spec_pb";
14
+ import { AgentShareSpecSchema, AgentShareAudience, AgentShareMessagesSchema, type AgentShareMessages } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/spec_pb";
15
15
  import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
16
16
  import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
17
17
  import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
@@ -96,6 +96,14 @@ export class AgentShareClient {
96
96
 
97
97
  /** Input for creating/updating a AgentShare. */
98
98
  export interface AgentShareInput {
99
+ /**
100
+ * The resource's `metadata.id`, for exact update addressing when set
101
+ * from a loaded resource. Required for updates to platform-scoped
102
+ * (org-less) kinds, where the org+slug fallback cannot match. On
103
+ * create, the cloud server stamps its own id regardless; the OSS
104
+ * server honors a caller-supplied id (existing apply semantics).
105
+ */
106
+ id?: string;
99
107
  name: string;
100
108
  slug?: string;
101
109
  org: string;
@@ -123,6 +131,7 @@ export interface RunConfigInput {
123
131
  maxCostUsd?: number;
124
132
  maxToolRounds?: number;
125
133
  serviceTier?: ServiceTier;
134
+ thinkingMode?: ThinkingMode;
126
135
  }
127
136
 
128
137
  function buildAgentShareMessagesProto(input: AgentShareMessagesInput) {
@@ -139,6 +148,7 @@ function buildRunConfigProto(input: RunConfigInput) {
139
148
  maxCostUsd: input.maxCostUsd,
140
149
  maxToolRounds: input.maxToolRounds,
141
150
  serviceTier: input.serviceTier,
151
+ thinkingMode: input.thinkingMode,
142
152
  }));
143
153
  }
144
154
 
@@ -151,6 +161,7 @@ export function buildAgentShareProto(input: AgentShareInput): AgentShare {
151
161
  apiVersion: "agentic.stigmer.ai/v1",
152
162
  kind: "AgentShare",
153
163
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
164
+ ...(input.id && { id: input.id }),
154
165
  name: input.name,
155
166
  org: input.org,
156
167
  ...(input.slug && { slug: input.slug }),
@@ -168,3 +179,56 @@ export function buildAgentShareProto(input: AgentShareInput): AgentShare {
168
179
  })),
169
180
  }) as AgentShare;
170
181
  }
182
+
183
+ function toAgentShareMessagesInput(msg: AgentShareMessages): AgentShareMessagesInput {
184
+ return {
185
+ rateLimited: msg.rateLimited || undefined,
186
+ unavailable: msg.unavailable || undefined,
187
+ conversationEnded: msg.conversationEnded || undefined,
188
+ };
189
+ }
190
+
191
+ function toRunConfigInput(msg: RunConfig): RunConfigInput {
192
+ return {
193
+ modelName: msg.modelName || undefined,
194
+ maxCostUsd: msg.maxCostUsd || undefined,
195
+ maxToolRounds: msg.maxToolRounds || undefined,
196
+ serviceTier: msg.serviceTier || undefined,
197
+ thinkingMode: msg.thinkingMode || undefined,
198
+ };
199
+ }
200
+
201
+ /**
202
+ * Maps a fetched {@link AgentShare} to a complete {@link AgentShareInput} for `update()`.
203
+ *
204
+ * The update RPC replaces the ENTIRE spec — spread this mapper's output
205
+ * and override only the fields you edit (spread nested objects the same
206
+ * way):
207
+ *
208
+ * await client.update({ ...toAgentShareUpdateInput(res), description: next });
209
+ *
210
+ * Proto3 defaults normalize to `undefined`; resource references keep
211
+ * `version` (pinned refs) and `kind`.
212
+ */
213
+ export function toAgentShareUpdateInput(resource: AgentShare): AgentShareInput {
214
+ const meta = resource.metadata;
215
+ const spec = resource.spec ?? create(AgentShareSpecSchema);
216
+ return {
217
+ // Exact update addressing (id-first in the update pipeline) — for
218
+ // platform-scoped (org-less) kinds the org+slug fallback cannot
219
+ // match, so the id is the ONLY working address.
220
+ id: meta?.id || undefined,
221
+ name: meta?.name ?? "",
222
+ slug: meta?.slug || undefined,
223
+ org: meta?.org ?? "",
224
+ labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
225
+ visibility: meta?.visibility || undefined,
226
+ agentRef: toResourceRefInput(spec.agentRef) ?? { org: "", slug: "" },
227
+ enabled: spec.enabled || undefined,
228
+ audience: spec.audience || undefined,
229
+ allowedOrigins: spec.allowedOrigins?.length ? [...spec.allowedOrigins] : undefined,
230
+ messages: spec.messages ? toAgentShareMessagesInput(spec.messages) : undefined,
231
+ environmentRefs: toResourceRefInputs(spec.environmentRefs),
232
+ runConfig: spec.runConfig ? toRunConfigInput(spec.runConfig) : undefined,
233
+ };
234
+ }
package/src/gen/apikey.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  import { wrapError } from "./errors.js";
4
4
  import { stripUndefined, toTimestamp } from "./proto-utils.js";
5
5
  import { create } from "@bufbuild/protobuf";
6
- import { EmptySchema } from "@bufbuild/protobuf/wkt";
6
+ import { EmptySchema, timestampDate } from "@bufbuild/protobuf/wkt";
7
7
  import { createClient, type Client, type Transport } from "@connectrpc/connect";
8
8
  import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
9
9
  import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
@@ -62,6 +62,14 @@ export class ApiKeyClient {
62
62
 
63
63
  /** Input for creating/updating a ApiKey. */
64
64
  export interface ApiKeyInput {
65
+ /**
66
+ * The resource's `metadata.id`, for exact update addressing when set
67
+ * from a loaded resource. Required for updates to platform-scoped
68
+ * (org-less) kinds, where the org+slug fallback cannot match. On
69
+ * create, the cloud server stamps its own id regardless; the OSS
70
+ * server honors a caller-supplied id (existing apply semantics).
71
+ */
72
+ id?: string;
65
73
  name: string;
66
74
  slug?: string;
67
75
  org: string;
@@ -79,6 +87,7 @@ export function buildApiKeyProto(input: ApiKeyInput): ApiKey {
79
87
  apiVersion: "iam.stigmer.ai/v1",
80
88
  kind: "ApiKey",
81
89
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
90
+ ...(input.id && { id: input.id }),
82
91
  name: input.name,
83
92
  org: input.org,
84
93
  ...(input.slug && { slug: input.slug }),
@@ -93,3 +102,35 @@ export function buildApiKeyProto(input: ApiKeyInput): ApiKey {
93
102
  })),
94
103
  }) as ApiKey;
95
104
  }
105
+
106
+ /**
107
+ * Maps a fetched {@link ApiKey} to a complete {@link ApiKeyInput} for `update()`.
108
+ *
109
+ * The update RPC replaces the ENTIRE spec — spread this mapper's output
110
+ * and override only the fields you edit (spread nested objects the same
111
+ * way):
112
+ *
113
+ * await client.update({ ...toApiKeyUpdateInput(res), description: next });
114
+ *
115
+ * Proto3 defaults normalize to `undefined`; resource references keep
116
+ * `version` (pinned refs) and `kind`.
117
+ */
118
+ export function toApiKeyUpdateInput(resource: ApiKey): ApiKeyInput {
119
+ const meta = resource.metadata;
120
+ const spec = resource.spec ?? create(ApiKeySpecSchema);
121
+ return {
122
+ // Exact update addressing (id-first in the update pipeline) — for
123
+ // platform-scoped (org-less) kinds the org+slug fallback cannot
124
+ // match, so the id is the ONLY working address.
125
+ id: meta?.id || undefined,
126
+ name: meta?.name ?? "",
127
+ slug: meta?.slug || undefined,
128
+ org: meta?.org ?? "",
129
+ labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
130
+ visibility: meta?.visibility || undefined,
131
+ keyHash: spec.keyHash || undefined,
132
+ fingerprint: spec.fingerprint || undefined,
133
+ expiresAt: spec.expiresAt ? timestampDate(spec.expiresAt) : undefined,
134
+ neverExpires: spec.neverExpires || undefined,
135
+ };
136
+ }
@@ -62,6 +62,14 @@ export class ArtifactClient {
62
62
 
63
63
  /** Input for creating/updating a Artifact. */
64
64
  export interface ArtifactInput {
65
+ /**
66
+ * The resource's `metadata.id`, for exact update addressing when set
67
+ * from a loaded resource. Required for updates to platform-scoped
68
+ * (org-less) kinds, where the org+slug fallback cannot match. On
69
+ * create, the cloud server stamps its own id regardless; the OSS
70
+ * server honors a caller-supplied id (existing apply semantics).
71
+ */
72
+ id?: string;
65
73
  name: string;
66
74
  slug?: string;
67
75
  org: string;
@@ -106,6 +114,7 @@ export function buildArtifactProto(input: ArtifactInput): Artifact {
106
114
  apiVersion: "agentic.stigmer.ai/v1",
107
115
  kind: "Artifact",
108
116
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
117
+ ...(input.id && { id: input.id }),
109
118
  name: input.name,
110
119
  org: input.org,
111
120
  ...(input.slug && { slug: input.slug }),
@@ -9,7 +9,7 @@ import { ChannelAppSchema, type ChannelApp } from "@stigmer/protos/ai/stigmer/ag
9
9
  import { ChannelAppCommandController } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/command_pb";
10
10
  import { ListChannelAppsByOrgInputSchema, ChannelAppsSchema, type ListChannelAppsByOrgInput, type ChannelApps } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/io_pb";
11
11
  import { ChannelAppQueryController } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/query_pb";
12
- import { ChannelAppSpecSchema, SlackChannelAppConfigSchema, WhatsAppChannelAppConfigSchema } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/spec_pb";
12
+ import { ChannelAppSpecSchema, SlackChannelAppConfigSchema, WhatsAppChannelAppConfigSchema, type SlackChannelAppConfig, type WhatsAppChannelAppConfig } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/spec_pb";
13
13
  import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
14
14
  import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
15
15
  import { ApiResourceIdSchema, ApiResourceReferenceSchema, ApiResourceDeleteInputSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
@@ -74,6 +74,14 @@ export class ChannelAppClient {
74
74
 
75
75
  /** Input for creating/updating a ChannelApp. */
76
76
  export interface ChannelAppInput {
77
+ /**
78
+ * The resource's `metadata.id`, for exact update addressing when set
79
+ * from a loaded resource. Required for updates to platform-scoped
80
+ * (org-less) kinds, where the org+slug fallback cannot match. On
81
+ * create, the cloud server stamps its own id regardless; the OSS
82
+ * server honors a caller-supplied id (existing apply semantics).
83
+ */
84
+ id?: string;
77
85
  name: string;
78
86
  slug?: string;
79
87
  org: string;
@@ -127,6 +135,7 @@ export function buildChannelAppProto(input: ChannelAppInput): ChannelApp {
127
135
  apiVersion: "agentic.stigmer.ai/v1",
128
136
  kind: "ChannelApp",
129
137
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
138
+ ...(input.id && { id: input.id }),
130
139
  name: input.name,
131
140
  org: input.org,
132
141
  ...(input.slug && { slug: input.slug }),
@@ -136,3 +145,50 @@ export function buildChannelAppProto(input: ChannelAppInput): ChannelApp {
136
145
  spec,
137
146
  }) as ChannelApp;
138
147
  }
148
+
149
+ function toSlackChannelAppConfigInput(msg: SlackChannelAppConfig): SlackChannelAppConfigInput {
150
+ return {
151
+ clientId: msg.clientId || undefined,
152
+ clientSecret: msg.clientSecret || undefined,
153
+ signingSecret: msg.signingSecret || undefined,
154
+ };
155
+ }
156
+
157
+ function toWhatsAppChannelAppConfigInput(msg: WhatsAppChannelAppConfig): WhatsAppChannelAppConfigInput {
158
+ return {
159
+ appId: msg.appId || undefined,
160
+ appSecret: msg.appSecret || undefined,
161
+ accessToken: msg.accessToken || undefined,
162
+ verifyToken: msg.verifyToken || undefined,
163
+ };
164
+ }
165
+
166
+ /**
167
+ * Maps a fetched {@link ChannelApp} to a complete {@link ChannelAppInput} for `update()`.
168
+ *
169
+ * The update RPC replaces the ENTIRE spec — spread this mapper's output
170
+ * and override only the fields you edit (spread nested objects the same
171
+ * way):
172
+ *
173
+ * await client.update({ ...toChannelAppUpdateInput(res), description: next });
174
+ *
175
+ * Proto3 defaults normalize to `undefined`; resource references keep
176
+ * `version` (pinned refs) and `kind`.
177
+ */
178
+ export function toChannelAppUpdateInput(resource: ChannelApp): ChannelAppInput {
179
+ const meta = resource.metadata;
180
+ const spec = resource.spec ?? create(ChannelAppSpecSchema);
181
+ return {
182
+ // Exact update addressing (id-first in the update pipeline) — for
183
+ // platform-scoped (org-less) kinds the org+slug fallback cannot
184
+ // match, so the id is the ONLY working address.
185
+ id: meta?.id || undefined,
186
+ name: meta?.name ?? "",
187
+ slug: meta?.slug || undefined,
188
+ org: meta?.org ?? "",
189
+ labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
190
+ visibility: meta?.visibility || undefined,
191
+ slack: spec.providerConfig?.case === "slack" ? toSlackChannelAppConfigInput(spec.providerConfig.value) : undefined,
192
+ whatsapp: spec.providerConfig?.case === "whatsapp" ? toWhatsAppChannelAppConfigInput(spec.providerConfig.value) : undefined,
193
+ };
194
+ }
@@ -1,7 +1,7 @@
1
1
  // Code generated by stigmer-codegen. DO NOT EDIT.
2
2
 
3
3
  import { wrapError } from "./errors.js";
4
- import { stripUndefined } from "./proto-utils.js";
4
+ import { stripUndefined, toEnvVarInputMap } from "./proto-utils.js";
5
5
  import { type DeleteResourceInput, type ResourceRef, type EnvVarInput } from "./types.js";
6
6
  import { create } from "@bufbuild/protobuf";
7
7
  import { createClient, type Client, type Transport } from "@connectrpc/connect";
@@ -98,6 +98,14 @@ export class EnvironmentClient {
98
98
 
99
99
  /** Input for creating/updating a Environment. */
100
100
  export interface EnvironmentInput {
101
+ /**
102
+ * The resource's `metadata.id`, for exact update addressing when set
103
+ * from a loaded resource. Required for updates to platform-scoped
104
+ * (org-less) kinds, where the org+slug fallback cannot match. On
105
+ * create, the cloud server stamps its own id regardless; the OSS
106
+ * server honors a caller-supplied id (existing apply semantics).
107
+ */
108
+ id?: string;
101
109
  name: string;
102
110
  slug?: string;
103
111
  org: string;
@@ -117,6 +125,7 @@ export function buildEnvironmentProto(input: EnvironmentInput): Environment {
117
125
  apiVersion: "agentic.stigmer.ai/v1",
118
126
  kind: "Environment",
119
127
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
128
+ ...(input.id && { id: input.id }),
120
129
  name: input.name,
121
130
  org: input.org,
122
131
  ...(input.slug && { slug: input.slug }),
@@ -129,3 +138,33 @@ export function buildEnvironmentProto(input: EnvironmentInput): Environment {
129
138
  })),
130
139
  }) as Environment;
131
140
  }
141
+
142
+ /**
143
+ * Maps a fetched {@link Environment} to a complete {@link EnvironmentInput} for `update()`.
144
+ *
145
+ * The update RPC replaces the ENTIRE spec — spread this mapper's output
146
+ * and override only the fields you edit (spread nested objects the same
147
+ * way):
148
+ *
149
+ * await client.update({ ...toEnvironmentUpdateInput(res), description: next });
150
+ *
151
+ * Proto3 defaults normalize to `undefined`; resource references keep
152
+ * `version` (pinned refs) and `kind`.
153
+ */
154
+ export function toEnvironmentUpdateInput(resource: Environment): EnvironmentInput {
155
+ const meta = resource.metadata;
156
+ const spec = resource.spec ?? create(EnvironmentSpecSchema);
157
+ return {
158
+ // Exact update addressing (id-first in the update pipeline) — for
159
+ // platform-scoped (org-less) kinds the org+slug fallback cannot
160
+ // match, so the id is the ONLY working address.
161
+ id: meta?.id || undefined,
162
+ name: meta?.name ?? "",
163
+ slug: meta?.slug || undefined,
164
+ org: meta?.org ?? "",
165
+ labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
166
+ visibility: meta?.visibility || undefined,
167
+ description: spec.description || undefined,
168
+ data: toEnvVarInputMap(spec.data),
169
+ };
170
+ }
@@ -68,6 +68,14 @@ export class ExecutionContextClient {
68
68
 
69
69
  /** Input for creating/updating a ExecutionContext. */
70
70
  export interface ExecutionContextInput {
71
+ /**
72
+ * The resource's `metadata.id`, for exact update addressing when set
73
+ * from a loaded resource. Required for updates to platform-scoped
74
+ * (org-less) kinds, where the org+slug fallback cannot match. On
75
+ * create, the cloud server stamps its own id regardless; the OSS
76
+ * server honors a caller-supplied id (existing apply semantics).
77
+ */
78
+ id?: string;
71
79
  name: string;
72
80
  slug?: string;
73
81
  org: string;
@@ -87,6 +95,7 @@ export function buildExecutionContextProto(input: ExecutionContextInput): Execut
87
95
  apiVersion: "agentic.stigmer.ai/v1",
88
96
  kind: "ExecutionContext",
89
97
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
98
+ ...(input.id && { id: input.id }),
90
99
  name: input.name,
91
100
  org: input.org,
92
101
  ...(input.slug && { slug: input.slug }),
@@ -109,6 +109,14 @@ export class IamPolicyClient {
109
109
 
110
110
  /** Input for creating/updating a IamPolicy. */
111
111
  export interface IamPolicyInput {
112
+ /**
113
+ * The resource's `metadata.id`, for exact update addressing when set
114
+ * from a loaded resource. Required for updates to platform-scoped
115
+ * (org-less) kinds, where the org+slug fallback cannot match. On
116
+ * create, the cloud server stamps its own id regardless; the OSS
117
+ * server honors a caller-supplied id (existing apply semantics).
118
+ */
119
+ id?: string;
112
120
  name: string;
113
121
  slug?: string;
114
122
  org: string;
@@ -141,6 +149,7 @@ export function buildIamPolicyProto(input: IamPolicyInput): IamPolicy {
141
149
  apiVersion: "iam.stigmer.ai/v1",
142
150
  kind: "IamPolicy",
143
151
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
152
+ ...(input.id && { id: input.id }),
144
153
  name: input.name,
145
154
  org: input.org,
146
155
  ...(input.slug && { slug: input.slug }),
@@ -1,7 +1,7 @@
1
1
  // Code generated by stigmer-codegen. DO NOT EDIT.
2
2
 
3
3
  import { wrapError } from "./errors.js";
4
- import { stripUndefined } from "./proto-utils.js";
4
+ import { stripUndefined, toResourceRefInput } from "./proto-utils.js";
5
5
  import { type ResourceRef } from "./types.js";
6
6
  import { create } from "@bufbuild/protobuf";
7
7
  import { EmptySchema } from "@bufbuild/protobuf/wkt";
@@ -15,7 +15,7 @@ import { IdentityAccountCommandController } from "@stigmer/protos/ai/stigmer/iam
15
15
  import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
16
16
  import { IdentityAccountIdSchema, CreateFederatedAccountInputSchema, UpdateFederatedAccountInputSchema, DeprovisionFederatedAccountInputSchema, IdentityAccountEmailSchema, IdpIdSchema, ExternalSubLookupSchema, type CreateFederatedAccountInput, type UpdateFederatedAccountInput, type DeprovisionFederatedAccountInput, type IdentityAccountEmail, type ExternalSubLookup } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/io_pb";
17
17
  import { IdentityAccountQueryController } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/query_pb";
18
- import { IdentityAccountSpecSchema, IdentityAccountPreferencesSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/spec_pb";
18
+ import { IdentityAccountSpecSchema, IdentityAccountPreferencesSchema, type IdentityAccountPreferences } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/spec_pb";
19
19
 
20
20
  /** Provides operations on identityaccount resources. */
21
21
  export class IdentityAccountClient {
@@ -108,6 +108,14 @@ export class IdentityAccountClient {
108
108
 
109
109
  /** Input for creating/updating a IdentityAccount. */
110
110
  export interface IdentityAccountInput {
111
+ /**
112
+ * The resource's `metadata.id`, for exact update addressing when set
113
+ * from a loaded resource. Required for updates to platform-scoped
114
+ * (org-less) kinds, where the org+slug fallback cannot match. On
115
+ * create, the cloud server stamps its own id regardless; the OSS
116
+ * server honors a caller-supplied id (existing apply semantics).
117
+ */
118
+ id?: string;
111
119
  name: string;
112
120
  slug?: string;
113
121
  org: string;
@@ -148,6 +156,7 @@ export function buildIdentityAccountProto(input: IdentityAccountInput): Identity
148
156
  apiVersion: "iam.stigmer.ai/v1",
149
157
  kind: "IdentityAccount",
150
158
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
159
+ ...(input.id && { id: input.id }),
151
160
  name: input.name,
152
161
  org: input.org,
153
162
  ...(input.slug && { slug: input.slug }),
@@ -167,3 +176,49 @@ export function buildIdentityAccountProto(input: IdentityAccountInput): Identity
167
176
  })),
168
177
  }) as IdentityAccount;
169
178
  }
179
+
180
+ function toIdentityAccountPreferencesInput(msg: IdentityAccountPreferences): IdentityAccountPreferencesInput {
181
+ return {
182
+ standingContext: msg.standingContext || undefined,
183
+ defaultHarness: msg.defaultHarness || undefined,
184
+ defaultNativeModel: msg.defaultNativeModel || undefined,
185
+ defaultCursorModel: msg.defaultCursorModel || undefined,
186
+ };
187
+ }
188
+
189
+ /**
190
+ * Maps a fetched {@link IdentityAccount} to a complete {@link IdentityAccountInput} for `update()`.
191
+ *
192
+ * The update RPC replaces the ENTIRE spec — spread this mapper's output
193
+ * and override only the fields you edit (spread nested objects the same
194
+ * way):
195
+ *
196
+ * await client.update({ ...toIdentityAccountUpdateInput(res), description: next });
197
+ *
198
+ * Proto3 defaults normalize to `undefined`; resource references keep
199
+ * `version` (pinned refs) and `kind`.
200
+ */
201
+ export function toIdentityAccountUpdateInput(resource: IdentityAccount): IdentityAccountInput {
202
+ const meta = resource.metadata;
203
+ const spec = resource.spec ?? create(IdentityAccountSpecSchema);
204
+ return {
205
+ // Exact update addressing (id-first in the update pipeline) — for
206
+ // platform-scoped (org-less) kinds the org+slug fallback cannot
207
+ // match, so the id is the ONLY working address.
208
+ id: meta?.id || undefined,
209
+ name: meta?.name ?? "",
210
+ slug: meta?.slug || undefined,
211
+ org: meta?.org ?? "",
212
+ labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
213
+ visibility: meta?.visibility || undefined,
214
+ idpId: spec.idpId ?? "",
215
+ email: spec.email || undefined,
216
+ firstName: spec.firstName || undefined,
217
+ lastName: spec.lastName || undefined,
218
+ pictureUrl: spec.pictureUrl || undefined,
219
+ isMachineAccount: spec.isMachineAccount || undefined,
220
+ provisioningMode: spec.provisioningMode || undefined,
221
+ identityProviderRef: toResourceRefInput(spec.identityProviderRef),
222
+ preferences: spec.preferences ? toIdentityAccountPreferencesInput(spec.preferences) : undefined,
223
+ };
224
+ }
@@ -81,6 +81,14 @@ export class IdentityProviderClient {
81
81
 
82
82
  /** Input for creating/updating a IdentityProvider. */
83
83
  export interface IdentityProviderInput {
84
+ /**
85
+ * The resource's `metadata.id`, for exact update addressing when set
86
+ * from a loaded resource. Required for updates to platform-scoped
87
+ * (org-less) kinds, where the org+slug fallback cannot match. On
88
+ * create, the cloud server stamps its own id regardless; the OSS
89
+ * server honors a caller-supplied id (existing apply semantics).
90
+ */
91
+ id?: string;
84
92
  name: string;
85
93
  slug?: string;
86
94
  org: string;
@@ -105,6 +113,7 @@ export function buildIdentityProviderProto(input: IdentityProviderInput): Identi
105
113
  apiVersion: "iam.stigmer.ai/v1",
106
114
  kind: "IdentityProvider",
107
115
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
116
+ ...(input.id && { id: input.id }),
108
117
  name: input.name,
109
118
  org: input.org,
110
119
  ...(input.slug && { slug: input.slug }),
@@ -127,3 +136,43 @@ export function buildIdentityProviderProto(input: IdentityProviderInput): Identi
127
136
  })),
128
137
  }) as IdentityProvider;
129
138
  }
139
+
140
+ /**
141
+ * Maps a fetched {@link IdentityProvider} to a complete {@link IdentityProviderInput} for `update()`.
142
+ *
143
+ * The update RPC replaces the ENTIRE spec — spread this mapper's output
144
+ * and override only the fields you edit (spread nested objects the same
145
+ * way):
146
+ *
147
+ * await client.update({ ...toIdentityProviderUpdateInput(res), description: next });
148
+ *
149
+ * Proto3 defaults normalize to `undefined`; resource references keep
150
+ * `version` (pinned refs) and `kind`.
151
+ */
152
+ export function toIdentityProviderUpdateInput(resource: IdentityProvider): IdentityProviderInput {
153
+ const meta = resource.metadata;
154
+ const spec = resource.spec ?? create(IdentityProviderSpecSchema);
155
+ return {
156
+ // Exact update addressing (id-first in the update pipeline) — for
157
+ // platform-scoped (org-less) kinds the org+slug fallback cannot
158
+ // match, so the id is the ONLY working address.
159
+ id: meta?.id || undefined,
160
+ name: meta?.name ?? "",
161
+ slug: meta?.slug || undefined,
162
+ org: meta?.org ?? "",
163
+ labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
164
+ visibility: meta?.visibility || undefined,
165
+ displayName: spec.displayName || undefined,
166
+ jwksUri: spec.jwksUri || undefined,
167
+ allowedIssuers: spec.allowedIssuers?.length ? [...spec.allowedIssuers] : undefined,
168
+ expectedAudience: spec.expectedAudience || undefined,
169
+ rateLimitBudget: spec.rateLimitBudget || undefined,
170
+ userinfoEndpoint: spec.userinfoEndpoint || undefined,
171
+ isSsoProvider: spec.isSsoProvider || undefined,
172
+ oidcClientId: spec.oidcClientId || undefined,
173
+ autoProvisionAccounts: spec.autoProvisionAccounts || undefined,
174
+ autoGrantOnOrg: spec.autoGrantOnOrg || undefined,
175
+ autoGrantRole: spec.autoGrantRole || undefined,
176
+ tenantOrgClaim: spec.tenantOrgClaim || undefined,
177
+ };
178
+ }
@@ -62,6 +62,14 @@ export class InvitationClient {
62
62
 
63
63
  /** Input for creating/updating a Invitation. */
64
64
  export interface InvitationInput {
65
+ /**
66
+ * The resource's `metadata.id`, for exact update addressing when set
67
+ * from a loaded resource. Required for updates to platform-scoped
68
+ * (org-less) kinds, where the org+slug fallback cannot match. On
69
+ * create, the cloud server stamps its own id regardless; the OSS
70
+ * server honors a caller-supplied id (existing apply semantics).
71
+ */
72
+ id?: string;
65
73
  name: string;
66
74
  slug?: string;
67
75
  org: string;
@@ -79,6 +87,7 @@ export function buildInvitationProto(input: InvitationInput): Invitation {
79
87
  apiVersion: "iam.stigmer.ai/v1",
80
88
  kind: "Invitation",
81
89
  metadata: Object.assign(create(ApiResourceMetadataSchema), {
90
+ ...(input.id && { id: input.id }),
82
91
  name: input.name,
83
92
  org: input.org,
84
93
  ...(input.slug && { slug: input.slug }),