@stigmer/sdk 1.0.3 → 2.0.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.
Files changed (170) hide show
  1. package/__tests__/gen/invitation-client.test.d.ts +2 -0
  2. package/__tests__/gen/invitation-client.test.d.ts.map +1 -0
  3. package/__tests__/gen/invitation-client.test.js +106 -0
  4. package/__tests__/gen/invitation-client.test.js.map +1 -0
  5. package/__tests__/gen/proto-utils.test.js +41 -1
  6. package/__tests__/gen/proto-utils.test.js.map +1 -1
  7. package/__tests__/gen/session-client.test.js +10 -6
  8. package/__tests__/gen/session-client.test.js.map +1 -1
  9. package/__tests__/stigmer.test.d.ts +2 -0
  10. package/__tests__/stigmer.test.d.ts.map +1 -0
  11. package/__tests__/stigmer.test.js +94 -0
  12. package/__tests__/stigmer.test.js.map +1 -0
  13. package/activity.d.ts +26 -0
  14. package/activity.d.ts.map +1 -0
  15. package/activity.js +30 -0
  16. package/activity.js.map +1 -0
  17. package/billing.d.ts +9 -2
  18. package/billing.d.ts.map +1 -1
  19. package/billing.js +1 -0
  20. package/billing.js.map +1 -1
  21. package/config.d.ts +19 -0
  22. package/config.d.ts.map +1 -1
  23. package/config.js.map +1 -1
  24. package/gen/agent.d.ts +2 -0
  25. package/gen/agent.d.ts.map +1 -1
  26. package/gen/agent.js +1 -0
  27. package/gen/agent.js.map +1 -1
  28. package/gen/agentexecution.d.ts +7 -0
  29. package/gen/agentexecution.d.ts.map +1 -1
  30. package/gen/agentexecution.js +6 -0
  31. package/gen/agentexecution.js.map +1 -1
  32. package/gen/agentinstance.d.ts +4 -0
  33. package/gen/agentinstance.d.ts.map +1 -1
  34. package/gen/agentinstance.js +9 -0
  35. package/gen/agentinstance.js.map +1 -1
  36. package/gen/apikey.d.ts +2 -0
  37. package/gen/apikey.d.ts.map +1 -1
  38. package/gen/apikey.js +4 -2
  39. package/gen/apikey.js.map +1 -1
  40. package/gen/artifact.d.ts +2 -0
  41. package/gen/artifact.d.ts.map +1 -1
  42. package/gen/artifact.js +1 -0
  43. package/gen/artifact.js.map +1 -1
  44. package/gen/authorization-config.d.ts.map +1 -1
  45. package/gen/authorization-config.js +0 -1
  46. package/gen/authorization-config.js.map +1 -1
  47. package/gen/client.d.ts +0 -4
  48. package/gen/client.d.ts.map +1 -1
  49. package/gen/client.js +0 -4
  50. package/gen/client.js.map +1 -1
  51. package/gen/environment.d.ts +2 -0
  52. package/gen/environment.d.ts.map +1 -1
  53. package/gen/environment.js +1 -0
  54. package/gen/environment.js.map +1 -1
  55. package/gen/executioncontext.d.ts +2 -0
  56. package/gen/executioncontext.d.ts.map +1 -1
  57. package/gen/executioncontext.js +1 -0
  58. package/gen/executioncontext.js.map +1 -1
  59. package/gen/iampolicy.d.ts +2 -0
  60. package/gen/iampolicy.d.ts.map +1 -1
  61. package/gen/iampolicy.js +1 -0
  62. package/gen/iampolicy.js.map +1 -1
  63. package/gen/identityaccount.d.ts +2 -0
  64. package/gen/identityaccount.d.ts.map +1 -1
  65. package/gen/identityaccount.js +1 -0
  66. package/gen/identityaccount.js.map +1 -1
  67. package/gen/identityprovider.d.ts +2 -0
  68. package/gen/identityprovider.d.ts.map +1 -1
  69. package/gen/identityprovider.js +1 -0
  70. package/gen/identityprovider.js.map +1 -1
  71. package/gen/invitation.d.ts +2 -0
  72. package/gen/invitation.d.ts.map +1 -1
  73. package/gen/invitation.js +4 -2
  74. package/gen/invitation.js.map +1 -1
  75. package/gen/mcpserver.d.ts +2 -0
  76. package/gen/mcpserver.d.ts.map +1 -1
  77. package/gen/mcpserver.js +1 -0
  78. package/gen/mcpserver.js.map +1 -1
  79. package/gen/oauthapp.d.ts +2 -0
  80. package/gen/oauthapp.d.ts.map +1 -1
  81. package/gen/oauthapp.js +1 -0
  82. package/gen/oauthapp.js.map +1 -1
  83. package/gen/organization.d.ts +2 -0
  84. package/gen/organization.d.ts.map +1 -1
  85. package/gen/organization.js +1 -0
  86. package/gen/organization.js.map +1 -1
  87. package/gen/platformclient.d.ts +2 -0
  88. package/gen/platformclient.d.ts.map +1 -1
  89. package/gen/platformclient.js +4 -2
  90. package/gen/platformclient.js.map +1 -1
  91. package/gen/project.d.ts +2 -0
  92. package/gen/project.d.ts.map +1 -1
  93. package/gen/project.js +1 -0
  94. package/gen/project.js.map +1 -1
  95. package/gen/proto-utils.d.ts +6 -0
  96. package/gen/proto-utils.d.ts.map +1 -1
  97. package/gen/proto-utils.js +9 -0
  98. package/gen/proto-utils.js.map +1 -1
  99. package/gen/session.d.ts +5 -4
  100. package/gen/session.d.ts.map +1 -1
  101. package/gen/session.js +3 -3
  102. package/gen/session.js.map +1 -1
  103. package/gen/skill.d.ts +3 -0
  104. package/gen/skill.d.ts.map +1 -1
  105. package/gen/skill.js +3 -1
  106. package/gen/skill.js.map +1 -1
  107. package/gen/workflow.d.ts +11 -1
  108. package/gen/workflow.d.ts.map +1 -1
  109. package/gen/workflow.js +37 -1
  110. package/gen/workflow.js.map +1 -1
  111. package/gen/workflowexecution.d.ts +4 -0
  112. package/gen/workflowexecution.d.ts.map +1 -1
  113. package/gen/workflowexecution.js +2 -0
  114. package/gen/workflowexecution.js.map +1 -1
  115. package/gen/workflowinstance.d.ts +4 -0
  116. package/gen/workflowinstance.d.ts.map +1 -1
  117. package/gen/workflowinstance.js +9 -0
  118. package/gen/workflowinstance.js.map +1 -1
  119. package/index.d.ts +3 -0
  120. package/index.d.ts.map +1 -1
  121. package/index.js +2 -0
  122. package/index.js.map +1 -1
  123. package/package.json +2 -2
  124. package/runner-adapter.d.ts +22 -0
  125. package/runner-adapter.d.ts.map +1 -0
  126. package/runner-adapter.js +2 -0
  127. package/runner-adapter.js.map +1 -0
  128. package/src/__tests__/gen/invitation-client.test.ts +132 -0
  129. package/src/__tests__/gen/proto-utils.test.ts +47 -1
  130. package/src/__tests__/gen/session-client.test.ts +12 -6
  131. package/src/__tests__/stigmer.test.ts +133 -0
  132. package/src/activity.ts +51 -0
  133. package/src/billing.ts +10 -2
  134. package/src/config.ts +20 -0
  135. package/src/gen/agent.ts +3 -0
  136. package/src/gen/agentexecution.ts +11 -1
  137. package/src/gen/agentinstance.ts +10 -1
  138. package/src/gen/apikey.ts +6 -2
  139. package/src/gen/artifact.ts +3 -0
  140. package/src/gen/authorization-config.ts +0 -1
  141. package/src/gen/client.ts +0 -5
  142. package/src/gen/environment.ts +3 -0
  143. package/src/gen/executioncontext.ts +3 -0
  144. package/src/gen/iampolicy.ts +3 -0
  145. package/src/gen/identityaccount.ts +3 -0
  146. package/src/gen/identityprovider.ts +3 -0
  147. package/src/gen/invitation.ts +6 -2
  148. package/src/gen/mcpserver.ts +3 -0
  149. package/src/gen/oauthapp.ts +3 -0
  150. package/src/gen/organization.ts +3 -0
  151. package/src/gen/platformclient.ts +6 -2
  152. package/src/gen/project.ts +3 -0
  153. package/src/gen/proto-utils.ts +11 -0
  154. package/src/gen/session.ts +8 -7
  155. package/src/gen/skill.ts +6 -1
  156. package/src/gen/workflow.ts +35 -3
  157. package/src/gen/workflowexecution.ts +6 -0
  158. package/src/gen/workflowinstance.ts +10 -1
  159. package/src/index.ts +11 -0
  160. package/src/runner-adapter.ts +21 -0
  161. package/src/stigmer.ts +69 -0
  162. package/stigmer.d.ts +23 -0
  163. package/stigmer.d.ts.map +1 -1
  164. package/stigmer.js +51 -0
  165. package/stigmer.js.map +1 -1
  166. package/gen/runner.d.ts +0 -32
  167. package/gen/runner.d.ts.map +0 -1
  168. package/gen/runner.js +0 -130
  169. package/gen/runner.js.map +0 -1
  170. package/src/gen/runner.ts +0 -122
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,UAAU,EACV,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AM,gBAAgB,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,KAAK,sBAAsB,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC"}
package/index.js CHANGED
@@ -9,6 +9,8 @@ export { isResourceAvailable, } from "./resource-availability";
9
9
  export { getGrantableRoles, hasGrantableRoles, isRoleGrantable, } from "./authorization-config";
10
10
  export { iamRoleToString, iamRoleFromString, iamRoleDisplayName, iamRoleDescription, } from "./iam-role";
11
11
  export { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
12
+ // Activity client (unified recents)
13
+ export { ActivityClient, } from "./activity";
12
14
  // Billing client
13
15
  export { BillingClient, } from "./billing";
14
16
  // Search client
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,mBAAmB;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,iBAAiB;AACjB,OAAO,EACL,YAAY,EAEZ,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EAEX,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EAEd,gBAAgB,EAChB,cAAc,GACf,MAAM,UAAU,CAAC;AAElB,wBAAwB;AACxB,OAAO,EAEL,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,8CAA8C;AAC9C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AAEpE,iBAAiB;AACjB,OAAO,EACL,aAAa,GAOd,MAAM,WAAW,CAAC;AAEnB,gBAAgB;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,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,iBAAiB,GAElB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,eAAe,GAGhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,gBAAgB,GAEjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,GAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,GAKhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,GAErB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAqB,MAAM,eAAe,CAAC;AACjE,OAAO,EACL,aAAa,GAMd,MAAM,eAAe,CAAC;AAEvB,mCAAmC;AACnC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,cAAc,GAMf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,uBAAuB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigmer/sdk",
3
- "version": "1.0.3",
3
+ "version": "2.0.0",
4
4
  "description": "Stigmer TypeScript SDK — typed API client for all Stigmer platform resources",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -40,6 +40,6 @@
40
40
  "peerDependencies": {
41
41
  "@bufbuild/protobuf": "^2.0.0",
42
42
  "@connectrpc/connect-node": "^2.0.0",
43
- "@stigmer/protos": "1.0.3"
43
+ "@stigmer/protos": "2.0.0"
44
44
  }
45
45
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Framework-agnostic RunnerAdapter interface.
3
+ *
4
+ * This is the canonical type definition re-exported by `@stigmer/react`.
5
+ * Non-React consumers (Node.js scripts, custom frameworks) can import
6
+ * directly from `@stigmer/sdk`.
7
+ *
8
+ * When `executionTarget` is `"local"`, SDK clients automatically call
9
+ * the adapter at the appropriate lifecycle points. The consumer never
10
+ * needs to manage runner processes directly.
11
+ */
12
+ export interface RunnerAdapter {
13
+ /** Called after a session is created with executionTarget=LOCAL. */
14
+ onSessionCreated(sessionId: string): Promise<void>;
15
+ /** Called when a session reaches a terminal phase. */
16
+ onSessionTerminated(sessionId: string): Promise<void>;
17
+ /** Called after a workflow execution is created with executionTarget=LOCAL. */
18
+ onWorkflowExecutionCreated(executionId: string): Promise<void>;
19
+ /** Called when a workflow execution reaches a terminal phase. */
20
+ onWorkflowExecutionTerminated(executionId: string): Promise<void>;
21
+ }
22
+ //# sourceMappingURL=runner-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-adapter.d.ts","sourceRoot":"","sources":["../src/runner-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,sDAAsD;IACtD,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,+EAA+E;IAC/E,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,iEAAiE;IACjE,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runner-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-adapter.js","sourceRoot":"","sources":["../src/runner-adapter.ts"],"names":[],"mappings":""}
@@ -0,0 +1,132 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { create, toBinary, fromBinary } from "@bufbuild/protobuf";
3
+ import { timestampDate } from "@bufbuild/protobuf/wkt";
4
+ import { InvitationSchema } from "@stigmer/protos/ai/stigmer/iam/invitation/v1/api_pb";
5
+ import { InvitationSpecSchema } from "@stigmer/protos/ai/stigmer/iam/invitation/v1/spec_pb";
6
+ import { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
7
+ import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
8
+ import { stripUndefined, toTimestamp } from "../../gen/proto-utils";
9
+
10
+ /**
11
+ * Exercises the same code path as the generated `buildInvitationProto` to
12
+ * verify that Timestamp fields serialize without error after the codegen fix.
13
+ */
14
+ function buildInvitationProto(input: {
15
+ name: string;
16
+ org: string;
17
+ role: IamRole;
18
+ expiresAt: Date | string;
19
+ maxRedemptions?: number;
20
+ label?: string;
21
+ }) {
22
+ const expiresAt = input.expiresAt !== undefined ? toTimestamp(input.expiresAt) : undefined;
23
+ return Object.assign(create(InvitationSchema), {
24
+ apiVersion: "iam.stigmer.ai/v1",
25
+ kind: "Invitation",
26
+ metadata: Object.assign(create(ApiResourceMetadataSchema), {
27
+ name: input.name,
28
+ org: input.org,
29
+ }),
30
+ spec: Object.assign(create(InvitationSpecSchema), stripUndefined({
31
+ role: input.role,
32
+ maxRedemptions: input.maxRedemptions,
33
+ expiresAt,
34
+ label: input.label,
35
+ })),
36
+ });
37
+ }
38
+
39
+ describe("buildInvitationProto", () => {
40
+ it("produces a message with a valid Timestamp from a Date", () => {
41
+ const expiresAt = new Date("2026-06-19T12:00:00.000Z");
42
+ const msg = buildInvitationProto({
43
+ name: "test-invite",
44
+ org: "acme",
45
+ role: IamRole.viewer,
46
+ expiresAt,
47
+ });
48
+
49
+ expect(msg.spec?.expiresAt).toBeDefined();
50
+ expect(msg.spec!.expiresAt!.seconds).toBe(
51
+ BigInt(Math.floor(expiresAt.getTime() / 1000)),
52
+ );
53
+ expect(timestampDate(msg.spec!.expiresAt!).getTime()).toBe(
54
+ expiresAt.getTime(),
55
+ );
56
+ });
57
+
58
+ it("produces a message with a valid Timestamp from an ISO string", () => {
59
+ const isoString = "2026-07-01T00:00:00.000Z";
60
+ const msg = buildInvitationProto({
61
+ name: "string-invite",
62
+ org: "acme",
63
+ role: IamRole.member,
64
+ expiresAt: isoString,
65
+ });
66
+
67
+ const expected = new Date(isoString);
68
+ expect(msg.spec?.expiresAt).toBeDefined();
69
+ expect(msg.spec!.expiresAt!.seconds).toBe(
70
+ BigInt(Math.floor(expected.getTime() / 1000)),
71
+ );
72
+ });
73
+
74
+ it("serializes to binary without error (the original bug)", () => {
75
+ const msg = buildInvitationProto({
76
+ name: "binary-test",
77
+ org: "acme",
78
+ role: IamRole.admin,
79
+ expiresAt: new Date(Date.now() + 7 * 86_400_000),
80
+ maxRedemptions: 1,
81
+ label: "test label",
82
+ });
83
+
84
+ const bytes = toBinary(InvitationSchema, msg);
85
+ expect(bytes.length).toBeGreaterThan(0);
86
+
87
+ const decoded = fromBinary(InvitationSchema, bytes);
88
+ expect(decoded.spec?.expiresAt).toBeDefined();
89
+ expect(decoded.spec!.expiresAt!.seconds).toBe(msg.spec!.expiresAt!.seconds);
90
+ expect(decoded.spec?.role).toBe(IamRole.admin);
91
+ expect(decoded.spec?.maxRedemptions).toBe(1);
92
+ expect(decoded.spec?.label).toBe("test label");
93
+ expect(decoded.metadata?.name).toBe("binary-test");
94
+ expect(decoded.metadata?.org).toBe("acme");
95
+ });
96
+
97
+ it("handles 7-day expiry (matches UI default options)", () => {
98
+ const now = Date.now();
99
+ const sevenDays = new Date(now + 7 * 86_400_000);
100
+ const msg = buildInvitationProto({
101
+ name: "7day",
102
+ org: "test-org",
103
+ role: IamRole.viewer,
104
+ expiresAt: sevenDays,
105
+ });
106
+
107
+ const bytes = toBinary(InvitationSchema, msg);
108
+ const decoded = fromBinary(InvitationSchema, bytes);
109
+ const decodedDate = timestampDate(decoded.spec!.expiresAt!);
110
+
111
+ const diffMs = Math.abs(decodedDate.getTime() - sevenDays.getTime());
112
+ expect(diffMs).toBeLessThan(1000);
113
+ });
114
+
115
+ it("handles 30-day expiry (matches UI default options)", () => {
116
+ const now = Date.now();
117
+ const thirtyDays = new Date(now + 30 * 86_400_000);
118
+ const msg = buildInvitationProto({
119
+ name: "30day",
120
+ org: "test-org",
121
+ role: IamRole.owner,
122
+ expiresAt: thirtyDays,
123
+ });
124
+
125
+ const bytes = toBinary(InvitationSchema, msg);
126
+ const decoded = fromBinary(InvitationSchema, bytes);
127
+ const decodedDate = timestampDate(decoded.spec!.expiresAt!);
128
+
129
+ const diffMs = Math.abs(decodedDate.getTime() - thirtyDays.getTime());
130
+ expect(diffMs).toBeLessThan(1000);
131
+ });
132
+ });
@@ -1,5 +1,6 @@
1
1
  import { describe, it, expect } from "vitest";
2
- import { stripUndefined } from "../../gen/proto-utils";
2
+ import { stripUndefined, toTimestamp } from "../../gen/proto-utils";
3
+ import { timestampDate } from "@bufbuild/protobuf/wkt";
3
4
 
4
5
  describe("stripUndefined", () => {
5
6
  it("removes keys with undefined values", () => {
@@ -51,3 +52,48 @@ describe("stripUndefined", () => {
51
52
  expect(result).toEqual({});
52
53
  });
53
54
  });
55
+
56
+ describe("toTimestamp", () => {
57
+ it("converts a Date to a Timestamp with correct seconds", () => {
58
+ const date = new Date("2026-05-19T12:00:00.000Z");
59
+ const ts = toTimestamp(date);
60
+ expect(ts.seconds).toBe(BigInt(Math.floor(date.getTime() / 1000)));
61
+ expect(ts.nanos).toBe(0);
62
+ });
63
+
64
+ it("converts a Date with milliseconds to a Timestamp with nanos", () => {
65
+ const date = new Date("2026-01-15T08:30:00.456Z");
66
+ const ts = toTimestamp(date);
67
+ const expectedSeconds = BigInt(Math.floor(date.getTime() / 1000));
68
+ expect(ts.seconds).toBe(expectedSeconds);
69
+ expect(ts.nanos).toBe(456_000_000);
70
+ });
71
+
72
+ it("converts an ISO string to a Timestamp", () => {
73
+ const isoString = "2026-06-01T00:00:00.000Z";
74
+ const ts = toTimestamp(isoString);
75
+ const expected = new Date(isoString);
76
+ expect(ts.seconds).toBe(BigInt(Math.floor(expected.getTime() / 1000)));
77
+ });
78
+
79
+ it("roundtrips correctly through timestampDate", () => {
80
+ const original = new Date("2026-03-10T15:45:30.000Z");
81
+ const ts = toTimestamp(original);
82
+ const roundtripped = timestampDate(ts);
83
+ expect(roundtripped.getTime()).toBe(original.getTime());
84
+ });
85
+
86
+ it("handles epoch (Unix timestamp 0)", () => {
87
+ const epoch = new Date(0);
88
+ const ts = toTimestamp(epoch);
89
+ expect(ts.seconds).toBe(BigInt(0));
90
+ expect(ts.nanos).toBe(0);
91
+ });
92
+
93
+ it("handles far-future dates", () => {
94
+ const future = new Date("2099-12-31T23:59:59.000Z");
95
+ const ts = toTimestamp(future);
96
+ expect(ts.seconds).toBe(BigInt(Math.floor(future.getTime() / 1000)));
97
+ expect(timestampDate(ts).getTime()).toBe(future.getTime());
98
+ });
99
+ });
@@ -1,6 +1,7 @@
1
1
  import { describe, it, expect, beforeEach } from "vitest";
2
2
  import type { Transport } from "@connectrpc/connect";
3
3
  import type { Session } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
4
+ import { ExecutionTarget } from "@stigmer/protos/ai/stigmer/agentic/session/v1/enum_pb";
4
5
  import { SessionClient, type SessionInput } from "../../gen/session";
5
6
 
6
7
  interface CapturedRequest {
@@ -82,8 +83,6 @@ describe("SessionClient proto serialization", () => {
82
83
  org: "o1",
83
84
  agentInstanceId: "ai-123",
84
85
  subject: "Help with deployment",
85
- threadId: "thread-abc",
86
- sandboxId: "sandbox-xyz",
87
86
  };
88
87
 
89
88
  await client.create(input);
@@ -91,8 +90,6 @@ describe("SessionClient proto serialization", () => {
91
90
  const proto = captured[0].message as Session;
92
91
  expect(proto.spec?.agentInstanceId).toBe("ai-123");
93
92
  expect(proto.spec?.subject).toBe("Help with deployment");
94
- expect(proto.spec?.threadId).toBe("thread-abc");
95
- expect(proto.spec?.sandboxId).toBe("sandbox-xyz");
96
93
  });
97
94
 
98
95
  it("does not overwrite protobuf defaults when optional fields are omitted", async () => {
@@ -101,8 +98,17 @@ describe("SessionClient proto serialization", () => {
101
98
  const proto = captured[0].message as Session;
102
99
  expect(proto.spec?.agentInstanceId).toBe("");
103
100
  expect(proto.spec?.subject).toBe("");
104
- expect(proto.spec?.threadId).toBe("");
105
- expect(proto.spec?.sandboxId).toBe("");
101
+ });
102
+
103
+ it("serializes executionTarget when provided", async () => {
104
+ await client.create({
105
+ name: "s1",
106
+ org: "o1",
107
+ executionTarget: ExecutionTarget.LOCAL,
108
+ });
109
+
110
+ const proto = captured[0].message as Session;
111
+ expect(proto.spec?.executionTarget).toBe(ExecutionTarget.LOCAL);
106
112
  });
107
113
 
108
114
  it("serializes metadata map when provided", async () => {
@@ -0,0 +1,133 @@
1
+ import { describe, it, expect, beforeEach } from "vitest";
2
+ import type { Transport } from "@connectrpc/connect";
3
+ import type { Session } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
4
+ import { ExecutionTarget } from "@stigmer/protos/ai/stigmer/agentic/session/v1/enum_pb";
5
+ import { Stigmer } from "../stigmer";
6
+
7
+ interface CapturedRequest {
8
+ methodName: string;
9
+ message: unknown;
10
+ }
11
+
12
+ function createCapturingTransport(): {
13
+ transport: Transport;
14
+ captured: CapturedRequest[];
15
+ } {
16
+ const captured: CapturedRequest[] = [];
17
+
18
+ const transport = {
19
+ unary: async (
20
+ method: { name: string },
21
+ _signal: unknown,
22
+ _timeout: unknown,
23
+ _header: unknown,
24
+ message: unknown,
25
+ ) => ({
26
+ header: new Headers(),
27
+ trailer: new Headers(),
28
+ message,
29
+ }),
30
+ stream: async () => {
31
+ throw new Error("streaming not implemented in test transport");
32
+ },
33
+ } as unknown as Transport;
34
+
35
+ const originalUnary = (transport as unknown as Record<string, unknown>).unary as (
36
+ ...args: unknown[]
37
+ ) => Promise<unknown>;
38
+
39
+ (transport as unknown as Record<string, unknown>).unary = async (
40
+ method: { name: string },
41
+ signal: unknown,
42
+ timeout: unknown,
43
+ header: unknown,
44
+ message: unknown,
45
+ ...rest: unknown[]
46
+ ) => {
47
+ captured.push({ methodName: method.name, message });
48
+ return originalUnary(method, signal, timeout, header, message, ...rest);
49
+ };
50
+
51
+ return { transport, captured };
52
+ }
53
+
54
+ describe("Stigmer execution target defaults", () => {
55
+ let captured: CapturedRequest[];
56
+ let stigmer: Stigmer;
57
+
58
+ describe("with executionTarget: 'local'", () => {
59
+ beforeEach(() => {
60
+ const ctx = createCapturingTransport();
61
+ captured = ctx.captured;
62
+ stigmer = new Stigmer({
63
+ baseUrl: "http://localhost:7234",
64
+ apiKey: "test-key",
65
+ executionTarget: "local",
66
+ customTransport: ctx.transport,
67
+ });
68
+ });
69
+
70
+ it("injects LOCAL into session.create when per-call input omits it", async () => {
71
+ await stigmer.session.create({ name: "test", org: "test-org" });
72
+ const proto = captured[0].message as Session;
73
+ expect(proto.spec?.executionTarget).toBe(ExecutionTarget.LOCAL);
74
+ });
75
+
76
+ it("preserves per-call override on session.create", async () => {
77
+ await stigmer.session.create({
78
+ name: "test",
79
+ org: "test-org",
80
+ executionTarget: ExecutionTarget.CLOUD,
81
+ });
82
+ const proto = captured[0].message as Session;
83
+ expect(proto.spec?.executionTarget).toBe(ExecutionTarget.CLOUD);
84
+ });
85
+
86
+ it("injects LOCAL into session.apply when per-call input omits it", async () => {
87
+ await stigmer.session.apply({ name: "test", org: "test-org" });
88
+ const proto = captured[0].message as Session;
89
+ expect(proto.spec?.executionTarget).toBe(ExecutionTarget.LOCAL);
90
+ });
91
+ });
92
+
93
+ describe("with executionTarget: 'cloud'", () => {
94
+ beforeEach(() => {
95
+ const ctx = createCapturingTransport();
96
+ captured = ctx.captured;
97
+ stigmer = new Stigmer({
98
+ baseUrl: "http://localhost:7234",
99
+ apiKey: "test-key",
100
+ executionTarget: "cloud",
101
+ customTransport: ctx.transport,
102
+ });
103
+ });
104
+
105
+ it("injects CLOUD into session.create", async () => {
106
+ await stigmer.session.create({ name: "test", org: "test-org" });
107
+ const proto = captured[0].message as Session;
108
+ expect(proto.spec?.executionTarget).toBe(ExecutionTarget.CLOUD);
109
+ });
110
+ });
111
+
112
+ describe("without executionTarget config", () => {
113
+ beforeEach(() => {
114
+ const ctx = createCapturingTransport();
115
+ captured = ctx.captured;
116
+ stigmer = new Stigmer({
117
+ baseUrl: "http://localhost:7234",
118
+ apiKey: "test-key",
119
+ customTransport: ctx.transport,
120
+ });
121
+ });
122
+
123
+ it("does not inject executionTarget on session.create", async () => {
124
+ await stigmer.session.create({ name: "test", org: "test-org" });
125
+ const proto = captured[0].message as Session;
126
+ expect(proto.spec?.executionTarget).toBe(ExecutionTarget.UNSPECIFIED);
127
+ });
128
+
129
+ it("defaultExecutionTarget is undefined", () => {
130
+ expect(stigmer.defaultExecutionTarget).toBeUndefined();
131
+ });
132
+ });
133
+ });
@@ -0,0 +1,51 @@
1
+ import { createClient, type Client, type Transport } from "@connectrpc/connect";
2
+ import { create } from "@bufbuild/protobuf";
3
+ import { ActivityQueryController } from "@stigmer/protos/ai/stigmer/activity/v1/query_pb";
4
+ import { ListRecentActivityRequestSchema } from "@stigmer/protos/ai/stigmer/activity/v1/io_pb";
5
+ import type { RecentActivityEntry } from "@stigmer/protos/ai/stigmer/activity/v1/io_pb";
6
+ import { wrapError } from "./gen/errors";
7
+
8
+ export type { RecentActivityEntry };
9
+
10
+ /** Parameters for listing recent activity. */
11
+ export interface ListRecentActivityParams {
12
+ /** Maximum entries to return. Defaults to 30. */
13
+ readonly pageSize?: number;
14
+ /** Organization slug for the org-scoped fast path. */
15
+ readonly org?: string;
16
+ }
17
+
18
+ /** Response from listing recent activity. */
19
+ export interface ListRecentActivityResponse {
20
+ readonly entries: RecentActivityEntry[];
21
+ }
22
+
23
+ /**
24
+ * Client for the unified recent activity query.
25
+ *
26
+ * Returns a merged, time-sorted list of the caller's most recent
27
+ * sessions and workflow executions in a single RPC call.
28
+ */
29
+ export class ActivityClient {
30
+ private readonly client: Client<typeof ActivityQueryController>;
31
+
32
+ constructor(transport: Transport) {
33
+ this.client = createClient(ActivityQueryController, transport);
34
+ }
35
+
36
+ async listRecentActivity(
37
+ params?: ListRecentActivityParams,
38
+ ): Promise<ListRecentActivityResponse> {
39
+ try {
40
+ const resp = await this.client.listRecentActivity(
41
+ create(ListRecentActivityRequestSchema, {
42
+ pageSize: params?.pageSize ?? 30,
43
+ org: params?.org ?? "",
44
+ }),
45
+ );
46
+ return { entries: [...resp.entries] };
47
+ } catch (e) {
48
+ throw wrapError(e);
49
+ }
50
+ }
51
+ }
package/src/billing.ts CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  type CustomerModelPricingResponse,
20
20
  } from "@stigmer/protos/ai/stigmer/billing/v1/io_pb";
21
21
  import type { BillingAccount, CreditBalance } from "@stigmer/protos/ai/stigmer/billing/v1/billing_account_pb";
22
- import type { LedgerEntryType } from "@stigmer/protos/ai/stigmer/billing/v1/enum_pb";
22
+ import type { LedgerEntryType, LedgerView } from "@stigmer/protos/ai/stigmer/billing/v1/enum_pb";
23
23
  import { PageInfoSchema } from "@stigmer/protos/ai/stigmer/commons/rpc/pagination_pb";
24
24
  import { timestampFromDate } from "@bufbuild/protobuf/wkt";
25
25
  import { wrapError } from "./gen/errors";
@@ -50,9 +50,16 @@ export interface SetAutoRechargeConfigParams {
50
50
  /** Parameters for querying the credit ledger. */
51
51
  export interface GetCreditLedgerParams {
52
52
  readonly orgId: string;
53
- /** Pagination: `{ num, size }` where `num` is 1-based page number. */
53
+ /** Pagination: `{ num, size }` where `num` is the 0-based page number. */
54
54
  readonly page?: { readonly num: number; readonly size: number };
55
55
  readonly typeFilter?: LedgerEntryType[];
56
+ /**
57
+ * Server-resolved ledger slice. When set to `LedgerView.statement`, the
58
+ * server returns only customer-facing money-movement entry types and
59
+ * excludes internal mechanics (per-call usage debits, reservation
60
+ * holds/releases). Defaults to the full ledger.
61
+ */
62
+ readonly view?: LedgerView;
56
63
  }
57
64
 
58
65
  /** Parameters for querying the billing usage report. */
@@ -136,6 +143,7 @@ export class BillingClient {
136
143
  }),
137
144
  }),
138
145
  ...(params.typeFilter?.length && { typeFilter: params.typeFilter }),
146
+ ...(params.view !== undefined && { view: params.view }),
139
147
  }),
140
148
  );
141
149
  } catch (e) {
package/src/config.ts CHANGED
@@ -73,6 +73,26 @@ export interface StigmerConfig {
73
73
  */
74
74
  readonly fetch?: typeof globalThis.fetch;
75
75
 
76
+ /**
77
+ * Default execution target for all sessions and workflow executions
78
+ * created through this client.
79
+ *
80
+ * - `"local"` -- Client provides runners (desktop app, CLI, or
81
+ * customer-managed runner process).
82
+ * - `"cloud"` -- Server provisions cloud sandboxes automatically.
83
+ * - `undefined` (default) -- Server decides based on deployment
84
+ * context (`LOCAL` for OSS/self-hosted, `CLOUD` for managed).
85
+ *
86
+ * This is an app-level setting, not a per-session choice. Workspace
87
+ * state, runner processes, and sandbox provisioning are all scoped
88
+ * to the application, not individual sessions.
89
+ *
90
+ * Per-call overrides on `SessionInput.executionTarget` or
91
+ * `WorkflowExecutionInput.executionTarget` take precedence when
92
+ * explicitly set.
93
+ */
94
+ readonly executionTarget?: "local" | "cloud";
95
+
76
96
  /**
77
97
  * Pre-built ConnectRPC transport.
78
98
  *
package/src/gen/agent.ts CHANGED
@@ -12,6 +12,7 @@ import { AgentQueryController } from "@stigmer/protos/ai/stigmer/agentic/agent/v
12
12
  import { AgentSpecSchema, ToolApprovalOverrideSchema, McpServerUsageSchema, McpAccessSchema, SubAgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
13
13
  import { EnvVarDeclarationSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
14
14
  import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
15
+ import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
15
16
  import { ApiResourceReferenceSchema, type UpdateVisibilityInput } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
16
17
  import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
17
18
  import { PageInfoSchema } from "@stigmer/protos/ai/stigmer/commons/rpc/pagination_pb";
@@ -103,6 +104,7 @@ export interface AgentInput {
103
104
  slug?: string;
104
105
  org: string;
105
106
  labels?: Record<string, string>;
107
+ visibility?: ApiResourceVisibility;
106
108
  description?: string;
107
109
  iconUrl?: string;
108
110
  instructions?: string;
@@ -207,6 +209,7 @@ function buildAgentProto(input: AgentInput): Agent {
207
209
  org: input.org,
208
210
  ...(input.slug && { slug: input.slug }),
209
211
  ...(input.labels && { labels: input.labels }),
212
+ ...(input.visibility && { visibility: input.visibility }),
210
213
  }),
211
214
  spec: Object.assign(create(AgentSpecSchema), stripUndefined({
212
215
  description: input.description,
@@ -3,14 +3,16 @@
3
3
  import { wrapError } from "./errors";
4
4
  import { stripUndefined } from "./proto-utils";
5
5
  import { type EnvVarInput } from "./types";
6
- import { create } from "@bufbuild/protobuf";
6
+ import { create, type JsonObject } from "@bufbuild/protobuf";
7
7
  import { createClient, type Client, type Transport } from "@connectrpc/connect";
8
8
  import { AgentExecutionSchema, type AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
9
9
  import { AgentExecutionCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/command_pb";
10
+ import { InteractionMode } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
10
11
  import { AgentExecutionIdSchema, AgentExecutionUpdateStatusInputSchema, UpdateStatusResponseSchema, SubmitApprovalInputSchema, CancelAgentExecutionInputSchema, TerminateAgentExecutionInputSchema, RecoverAgentExecutionInputSchema, PauseAgentExecutionInputSchema, ResumeAgentExecutionInputSchema, UploadAttachmentRequestSchema, UploadAttachmentResponseSchema, ListAgentExecutionsRequestSchema, AgentExecutionListSchema, ListAgentExecutionsBySessionRequestSchema, GetArtifactDownloadUrlRequestSchema, GetArtifactDownloadUrlResponseSchema, GetArtifactContentRequestSchema, GetArtifactContentResponseSchema, GetExecutionUsageReportInputSchema, GetExecutionUsageReportOutputSchema, GetSessionUsageReportInputSchema, GetSessionUsageReportOutputSchema, GetAgentUsageReportInputSchema, GetAgentUsageReportOutputSchema, GetOrgUsageReportInputSchema, GetOrgUsageReportOutputSchema, GetAgentExecutionSummaryRequestSchema, AgentExecutionSummarySchema, type AgentExecutionUpdateStatusInput, type UpdateStatusResponse, 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 GetArtifactContentRequest, type GetArtifactContentResponse, type GetExecutionUsageReportInput, type GetExecutionUsageReportOutput, type GetSessionUsageReportInput, type GetSessionUsageReportOutput, type GetAgentUsageReportInput, type GetAgentUsageReportOutput, type GetOrgUsageReportInput, type GetOrgUsageReportOutput, type GetAgentExecutionSummaryRequest, type AgentExecutionSummary } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
11
12
  import { AgentExecutionQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/query_pb";
12
13
  import { AgentExecutionSpecSchema, ContextManagementConfigSchema, ExecutionConfigSchema, AttachmentSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
13
14
  import { ExecutionValueSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/spec_pb";
15
+ import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
14
16
  import { ApiResourceIdSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
15
17
  import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
16
18
 
@@ -165,6 +167,7 @@ export interface AgentExecutionInput {
165
167
  slug?: string;
166
168
  org: string;
167
169
  labels?: Record<string, string>;
170
+ visibility?: ApiResourceVisibility;
168
171
  sessionId?: string;
169
172
  agentId?: string;
170
173
  message?: string;
@@ -175,6 +178,7 @@ export interface AgentExecutionInput {
175
178
  parentWorkflowId?: string;
176
179
  attachments?: AttachmentInput[];
177
180
  workspaceFileRefs?: string[];
181
+ activityTaskQueue?: string;
178
182
  }
179
183
 
180
184
  /** SDK input type for ExecutionConfig. */
@@ -184,6 +188,8 @@ export interface ExecutionConfigInput {
184
188
  maxToolRounds?: number;
185
189
  maxToolResultChars?: number;
186
190
  maxCostUsd?: number;
191
+ interactionMode?: InteractionMode;
192
+ structuredOutputSchema?: JsonObject;
187
193
  }
188
194
 
189
195
  /** SDK input type for ContextManagementConfig. */
@@ -218,6 +224,8 @@ function buildExecutionConfigProto(input: ExecutionConfigInput) {
218
224
  if (input.maxToolRounds !== undefined) msg.maxToolRounds = input.maxToolRounds;
219
225
  if (input.maxToolResultChars !== undefined) msg.maxToolResultChars = input.maxToolResultChars;
220
226
  if (input.maxCostUsd !== undefined) msg.maxCostUsd = input.maxCostUsd;
227
+ if (input.interactionMode !== undefined) msg.interactionMode = input.interactionMode;
228
+ if (input.structuredOutputSchema !== undefined) msg.structuredOutputSchema = input.structuredOutputSchema;
221
229
  return msg;
222
230
  }
223
231
 
@@ -248,6 +256,7 @@ function buildAgentExecutionProto(input: AgentExecutionInput): AgentExecution {
248
256
  org: input.org,
249
257
  ...(input.slug && { slug: input.slug }),
250
258
  ...(input.labels && { labels: input.labels }),
259
+ ...(input.visibility && { visibility: input.visibility }),
251
260
  }),
252
261
  spec: Object.assign(create(AgentExecutionSpecSchema), stripUndefined({
253
262
  sessionId: input.sessionId,
@@ -260,6 +269,7 @@ function buildAgentExecutionProto(input: AgentExecutionInput): AgentExecution {
260
269
  parentWorkflowId: input.parentWorkflowId,
261
270
  attachments,
262
271
  workspaceFileRefs: input.workspaceFileRefs,
272
+ activityTaskQueue: input.activityTaskQueue,
263
273
  })),
264
274
  }) as AgentExecution;
265
275
  }