@m8tes/sdk 0.1.0-alpha.6 → 0.1.0-alpha.8

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/CHANGELOG.md CHANGED
@@ -13,6 +13,40 @@ All notable changes to `@m8tes/sdk`.
13
13
  > While the version is a `-alpha.N` prerelease, publish with dist-tag `alpha`.
14
14
  > The first stable release is published with `--tag latest` deliberately.
15
15
 
16
+ ## [0.1.0-alpha.8] - 2026-09-06
17
+
18
+ ### Added
19
+
20
+ - **`client.groups` for recursive shared Teams.** Create and move nested groups, inspect visible
21
+ ancestor paths and management capabilities, manage direct and inherited viewer, runner, or
22
+ editor roles, and run the verified-email invitation lifecycle. New invitations default to
23
+ editor, while migrated grants remain viewer. Membership calls are account-scoped and independent
24
+ of organization membership and the legacy bulk Mate visibility operation exposed by
25
+ `groups.share()`.
26
+ - Agent responses expose `can_manage`, `can_execute`, and owner-only `can_share` so clients can
27
+ present the effective capabilities of a scoped Team member.
28
+
29
+ ## [0.1.0-alpha.7] - 2026-09-06
30
+
31
+ ### Fixed
32
+
33
+ - **`runs.reply()` forwards every per-reply override.** The body was hard-coded to `{ message }`,
34
+ so `tools`, `permission_mode`, `task_setup_tools`, `feedback` and `human_in_the_loop` never
35
+ reached the server, though `RunReply` accepts all five and the Python SDK sends them. An object
36
+ literal was a compile error, so the silent path was narrow but real: an options object built in a
37
+ variable that ALSO sets `raiseOnError` or `idempotencyKey` — an SDK wrapper forwarding caller
38
+ options is the obvious shape — type-checks clean and dropped the rest. `human_in_the_loop: false`
39
+ is the one that bites: it is the documented way to pin non-interactive behaviour, so an unattended
40
+ TypeScript reply loop could still pause on a question. `RunReplyOptions` now declares all five and
41
+ is the single source of truth for the body; `test/server-drift.test.ts` pins it against the
42
+ server's own `RunReply` model. `stream` is now sent explicitly, as `sdk/py` and `@m8tes/react`
43
+ already do.
44
+ - **A mid-turn override 409 is `ConflictError`, not `RunNotStreamingError`.** Sending any
45
+ per-reply override while the current turn is still executing is refused with 409 so the
46
+ override cannot be silently dropped. `http.stream()` used to map every stream 409 to
47
+ "the run already finished, fall back to `get()`" — true for `GET /runs/{id}/stream`,
48
+ false for POST reply/create. Callers pinning `human_in_the_loop: false` mid-turn would
49
+ have been told the run ended while it was still executing under the old settings.
16
50
  ## [0.1.0-alpha.6] - 2026-09-05
17
51
 
18
52
  ### Fixed
package/README.md CHANGED
@@ -109,6 +109,35 @@ await client.tasks.triggers.create(task.id, { type: "app", app: "github", trigge
109
109
  const { url } = await client.tasks.enableWebhook(task.id);
110
110
  ```
111
111
 
112
+ ## Recursive Teams
113
+
114
+ Organize agents into nested Teams and grant a role across one subtree:
115
+
116
+ ```ts
117
+ const marketing = await client.groups.create({ name: "Marketing" });
118
+ const paidAds = await client.groups.create({ name: "Paid Ads", parent_id: marketing.id });
119
+ const google = await client.groups.create({ name: "Google", parent_id: paidAds.id });
120
+ await client.agents.update(agent.id, { group_id: google.id });
121
+
122
+ const invite = await client.groups.invite(marketing.id, {
123
+ email: "ada@example.com",
124
+ role: "runner",
125
+ });
126
+ const members = await client.groups.members(google.id); // includes inherited roles
127
+ await client.groups.updateMember(marketing.id, members.data[0]!.member_id, { role: "editor" });
128
+ ```
129
+
130
+ New invitations default to `editor`; choose `viewer` for read access or `runner` for read plus
131
+ run/chat/reply/cancel/approve. Editors can also edit Mates, tasks, documents, and work inside the
132
+ subtree. Existing grants remain `viewer`. Roles inherit through child Teams. Editors cannot manage
133
+ members or roles, self-escalate, reorganize Teams, or move a Mate out of the shared scope.
134
+
135
+ Team sharing is account-scoped and does not make someone an organization member. Runs use the
136
+ shared Mate owner's bound tools and billing while auditing the human requester separately;
137
+ credentials stay opaque. Group CRUD still accepts `user_id` for end-user isolation, while
138
+ membership and invitation methods do not. `groups.share()` remains the separate legacy bulk
139
+ operation for direct Mates' visibility.
140
+
112
141
  ## Human-in-the-loop
113
142
 
114
143
  When a run pauses, the stream emits an `approval-request` or `question` event. Answer it and the run resumes.
@@ -1117,5 +1117,5 @@ function seg(value) {
1117
1117
  }
1118
1118
 
1119
1119
  export { APIError, AuthenticationError, BillingError, ConflictError, M8tesApiError, NotFoundError, PROTOCOL_VERSION, PermissionDeniedError, RateLimitError, RunFailedError, RunNotStreamingError, TERMINAL_EVENT_TYPES, ValidationError, accumulate, createAccumulator, createNormalizer, createSseDecoder, errorClassForStatus, errorFromResponse, initialConversationState, isTerminalEvent, parseErrorEnvelope, parseRetryAfter, parseSse, seg, splitConcatenatedJson };
1120
- //# sourceMappingURL=chunk-F6B6R3SP.js.map
1121
- //# sourceMappingURL=chunk-F6B6R3SP.js.map
1120
+ //# sourceMappingURL=chunk-5X7I2XPE.js.map
1121
+ //# sourceMappingURL=chunk-5X7I2XPE.js.map