openpond-sdk 0.1.4 → 0.1.5

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
@@ -43,6 +43,43 @@ 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
45
 
46
+ ## Connect an application
47
+
48
+ In the task format, open **Connect an application** and create a source credential.
49
+ Copy it into the application's secret store before closing the panel. Credentials
50
+ expire within 90 days and can be revoked from the same panel. The list contains
51
+ metadata and key prefixes only; hosts store secret hashes.
52
+
53
+ Use that credential as `OPENPOND_API_KEY` in the examples above. It authorizes
54
+ `submitExample`, `submitFeedback` and `sourceConfiguration(sourceId)` for exactly
55
+ one source and scope. Configuration returns the source and task-definition
56
+ references, allowed splits and enabled status. It does not expose private
57
+ evidence. Reading resources, grading, review, publication, training and credential
58
+ management require the owning user's authenticated client.
59
+
60
+ Owners can also manage credentials through the SDK:
61
+
62
+ ```ts
63
+ import { createSourceCredentialRequest } from "openpond-sdk/learning";
64
+
65
+ const request = createSourceCredentialRequest({
66
+ sourceId,
67
+ name: "Application intake",
68
+ expiresAt: new Date(Date.now() + 30 * 86_400_000).toISOString(),
69
+ });
70
+ const issued = await ownerClient.createSourceCredential(request);
71
+ // Store issued.apiKey securely. Never log it or commit the prepared request.
72
+ const page = await ownerClient.listSourceCredentials(sourceId, { limit: 30 });
73
+ await ownerClient.revokeSourceCredential(sourceId, issued.credential.id);
74
+ ```
75
+
76
+ Keep the prepared request in memory for a transport retry: the same operation ID
77
+ and content returns the same credential, while changed content conflicts.
78
+ Revocation is idempotent; repeating creation does not reactivate a revoked key.
79
+ Use a new prepared request for a new credential. Disabling a source also prevents
80
+ new evidence submission. Hosts enforce authentication, expiry and source scope
81
+ on every request.
82
+
46
83
  ## Publish a reviewed batch to a hosted model
47
84
 
48
85
  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.