openpond-sdk 0.1.1 → 0.1.3

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/LEARNING.md CHANGED
@@ -42,3 +42,9 @@ historical batches.
42
42
  All client requests support an optional `AbortSignal`. Aborting a request does
43
43
  not cancel remote compute; use `cancel_grade` and read the authoritative terminal
44
44
  job state. Page through list responses with `nextCursor` as `afterId`.
45
+
46
+ ## Publish a reviewed batch to a hosted model
47
+
48
+ Call `learning.publishBatch({ batchId, modelProjectId })` against the hosted API after sealing an approved batch. This stores its immutable Taskset package and attaches the exact release to the model. It does not start training. The service authorizes the model and batch in the same team and deduplicates publication by release identity.
49
+
50
+ Model configuration can save `trainingSetup.rewardBindingRef` before selecting a Taskset. The reference pins a binding ID, revision and content hash; task compatibility and training readiness remain separate checks. Use `createModelProjectSaveRequest` with `createModelProjectsClient().checkConfiguration()` / `.saveConfiguration()` for hosted configuration operations, and `configurationCandidates()` for available starting models. Keep one request identity for transport retries.
package/TASKSETS.md ADDED
@@ -0,0 +1,31 @@
1
+ # Published Taskset inventory
2
+
3
+ `openpond-sdk/taskset-catalog` provides authenticated, paginated metadata reads
4
+ for the selected hosted workspace. The service applies workspace access and
5
+ optional Model Project attachment filtering before returning records.
6
+
7
+ ```ts
8
+ import { OpenPondTasksetCatalogClient } from "openpond-sdk/taskset-catalog";
9
+
10
+ const tasksets = new OpenPondTasksetCatalogClient({
11
+ baseUrl: "https://api.openpond.ai",
12
+ apiKey,
13
+ teamId,
14
+ });
15
+ const page = await tasksets.list({ limit: 30, modelProjectId });
16
+ const item = await tasksets.get(page.items[0].id);
17
+ const selected = await tasksets.resolve(item.release);
18
+ const next = page.nextCursor
19
+ ? await tasksets.list({ limit: 30, modelProjectId, afterId: page.nextCursor })
20
+ : null;
21
+ ```
22
+
23
+ The item's `id` is the hosted inventory identity. Its `release` pins the portable
24
+ ID, revision and content hash used in model configuration. Metadata reads contain
25
+ no task rows, private verifier source or object-store locations. Publication and
26
+ package byte counts do not establish grading or training readiness.
27
+
28
+ The client rejects responses for a different workspace or requested resource,
29
+ limits catalog responses to 4 MiB, supports abort signals, and does not follow
30
+ redirects with credentials. `OpenPondTasksetCatalogError` preserves HTTP status and
31
+ the service's error code.
package/dist/index.js CHANGED
@@ -2708,6 +2708,8 @@ function requiredId(value, label) {
2708
2708
  // src/learning.ts
2709
2709
  var learning_exports = {};
2710
2710
  __export(learning_exports, {
2711
+ LearningBatchPublicationResultSchema: () => LearningBatchPublicationResultSchema,
2712
+ LearningBatchPublicationSchema: () => LearningBatchPublicationSchema,
2711
2713
  OpenPondLearningClient: () => OpenPondLearningClient,
2712
2714
  OpenPondLearningError: () => OpenPondLearningError
2713
2715
  });
@@ -2724,6 +2726,18 @@ import {
2724
2726
  import { assertBoundedTaskJson } from "@openpond/evals/task-schema";
2725
2727
  import * as learning_star from "@openpond/evals/learning";
2726
2728
  import * as rewards_star from "@openpond/evals/rewards";
2729
+ var LearningBatchPublicationSchema = z.object({
2730
+ batchId: z.string().trim().min(1).max(500),
2731
+ modelProjectId: z.string().trim().min(1).max(500)
2732
+ }).strict();
2733
+ var LearningBatchPublicationResultSchema = z.object({
2734
+ batchId: z.string().min(1),
2735
+ projectId: z.string().min(1),
2736
+ tasksetId: z.string().min(1),
2737
+ releaseId: z.string().min(1),
2738
+ revision: z.number().int().positive(),
2739
+ contentHash: z.string().regex(/^[a-f0-9]{64}$/)
2740
+ }).strict();
2727
2741
  var OpenPondLearningError = class extends Error {
2728
2742
  constructor(status, code, message, details) {
2729
2743
  super(message);
@@ -2765,6 +2779,13 @@ var OpenPondLearningClient = class {
2765
2779
  const request = LearningReadRequestSchema.parse({ action: "list", scope: this.#options.scope, kind, ...query });
2766
2780
  return z.object({ items: z.array(learningResourceSchemas[kind]).max(100), nextCursor: z.string().nullable() }).strict().parse(await this.#request("read", request, options));
2767
2781
  }
2782
+ /** Hosted publication only: stores an immutable package and attaches it, without starting training. */
2783
+ async publishBatch(input, options = {}) {
2784
+ const request = LearningBatchPublicationSchema.parse(input);
2785
+ const result = LearningBatchPublicationResultSchema.parse(await this.#request("publish-batch", { ...request, scope: this.#options.scope }, options));
2786
+ if (result.batchId !== request.batchId) throw new OpenPondLearningError(502, "batch_identity_mismatch", "Published batch response did not match the requested batch.", null);
2787
+ return result;
2788
+ }
2768
2789
  async #request(endpoint, body, options) {
2769
2790
  assertBoundedTaskJson(body, 16777216);
2770
2791
  const response = await (this.#options.fetch ?? globalThis.fetch)(`${this.#options.baseUrl}/v1/learning/${endpoint}`, {