@to11ai/sdk 2.1.0-rc → 2.1.0-rc.1

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.
@@ -1,8 +1,8 @@
1
1
  // ---------------------------------------------------------------------------
2
2
  // ProjectEnvironmentResource — fluent SDK surface for project environments.
3
3
  // ---------------------------------------------------------------------------
4
- // Spec: docs/product-specs/2026-05-14-environments-registry.md
5
- // Plan: docs/exec-plans/active/2026-05-14-env-registry-plan.md §S21
4
+ // Spec: docs/archive-2026-08/specs/2026-05-14-environments-registry.md
5
+ // Plan: docs/archive-2026-08/plans/active/2026-05-14-env-registry-plan.md §S21
6
6
  //
7
7
  // Mirrors `PromptResource` in shape so existing call-site intuition
8
8
  // transfers: each method takes a flat input object, unwraps the API
@@ -138,13 +138,22 @@ function getProjectPromptsPath(projectId: string): string {
138
138
  * first-class case: a non-chat payload throws rather than being silently
139
139
  * coerced (a text prompt is sugar for a single-block chat and is being removed
140
140
  * from the API).
141
+ *
142
+ * a SKILL cannot arrive here in practice — the platform excludes
143
+ * skills from `GET …/prompts` unless a caller asks for them, so a consumer
144
+ * that never asked never learns a skill's slug, and the render response for
145
+ * one carries no `rendered` field for the closed generated schema to accept.
146
+ * The guard stays anyway, because it is why a mistake fails loudly rather than
147
+ * quietly, and it now says something TRUE for the case it would catch:
148
+ * advising a maintainer to "author the prompt as chat blocks" is impossible
149
+ * for a skill and would send them to change content that is already correct.
141
150
  */
142
151
  function renderedToMessages(
143
152
  rendered: ResolvedPrompt["rendered"],
144
153
  ): RenderedChatMessage[] {
145
154
  if (rendered.format !== "chat") {
146
155
  throw new Error(
147
- "[to11ai/sdk] Unsupported non-chat prompt format; author the prompt as chat blocks.",
156
+ `[to11ai/sdk] unsupported prompt format \`${rendered.format}\`: only \`chat\` resolves to messages`,
148
157
  );
149
158
  }
150
159
  return rendered.messages;
@@ -655,7 +664,7 @@ export class PromptResource<F extends RenderFormat | undefined = undefined> {
655
664
  * Note on `description` semantics: `undefined` means "do not change" —
656
665
  * the SDK omits the field from the body in that case. Pass
657
666
  * `description: ""` (empty string) or `description: null` to explicitly
658
- * clear it (the server normalises both).
667
+ * clear it (the server normalizes both).
659
668
  */
660
669
  async updateProjectLabel(
661
670
  input: UpdateProjectPromptLabelInput,
@@ -2,7 +2,7 @@
2
2
  * Format-at-load shaping: turn a neutral `RenderedPrompt` into a provider-shaped
3
3
  * `{ messages, config, metadata }` result the caller spreads into their own
4
4
  * provider `create()` call. Header-only — this only reshapes data, it never
5
- * sends a request. See docs/product-specs/2026-07-14-to11-2691-sdk-simpler-setup.md.
5
+ * sends a request. See docs/archive-2026-08/specs/2026-07-14-to11-2691-sdk-simpler-setup.md.
6
6
  */
7
7
 
8
8
  import {
@@ -16,7 +16,7 @@
16
16
  * trace/span ids in `traceparent`. We return `null` (caller omits).
17
17
  *
18
18
  * @see https://www.w3.org/TR/trace-context/ for the wire format.
19
- * @see docs/product-specs/2026-05-20-to11-1016-sdk-traceparent-propagation.md
19
+ * @see docs/archive-2026-08/specs/2026-05-20-to11-1016-sdk-traceparent-propagation.md
20
20
  */
21
21
 
22
22
  // NOTE: deliberately NO top-level `import ... from "node:module"`. With the