openpond-sdk 0.5.11 → 0.5.13
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 +15 -0
- package/dist/{chunk-TKJU3BOW.js → chunk-5M3PPP7D.js} +9 -1
- package/dist/chunk-5M3PPP7D.js.map +7 -0
- package/dist/index.js +1 -1
- package/dist/learning.js +25 -3
- package/dist/learning.js.map +3 -3
- package/dist/types/packages/sdk/src/learning-client.d.ts +40 -0
- package/dist/types/packages/sdk/src/learning-client.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/learning.d.ts +1 -0
- package/dist/types/packages/sdk/src/learning.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/model-learning-policy.d.ts +20 -0
- package/dist/types/packages/sdk/src/model-learning-policy.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/chunk-TKJU3BOW.js.map +0 -7
package/LEARNING.md
CHANGED
|
@@ -43,6 +43,21 @@ 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
|
+
## Configure hosted learning
|
|
47
|
+
|
|
48
|
+
Use `hostedLearningPolicyReferences(project)` from `openpond-sdk/learning` with
|
|
49
|
+
the Model summary returned by the authenticated Model Projects API. It derives
|
|
50
|
+
the exact recipe, training-parent and retained-evaluation references used by the
|
|
51
|
+
hosted policy snapshot. The recipe identifier binds the Model's reviewed etag,
|
|
52
|
+
including its Harness and data settings; the content hash binds the recipe.
|
|
53
|
+
Missing recipe, starting model or retained evaluation is a configuration error.
|
|
54
|
+
|
|
55
|
+
Keep those references when changing a policy's pause state, schedule or limits.
|
|
56
|
+
Recompute them only when explicitly applying a newly reviewed Model configuration.
|
|
57
|
+
The server verifies the references when publishing the policy and retains the
|
|
58
|
+
immutable configuration for later preparation. Use `client.inspectPolicy(ref)`
|
|
59
|
+
for shared readiness counts and blockers without reserving or launching work.
|
|
60
|
+
|
|
46
61
|
## Connect an application
|
|
47
62
|
|
|
48
63
|
In the task format, open **Connect an application** and create a source credential.
|
|
@@ -59,6 +59,7 @@ import {
|
|
|
59
59
|
LearningReadRequestSchema,
|
|
60
60
|
TaskEvidenceInspectionResultSchema,
|
|
61
61
|
sameLearningRef,
|
|
62
|
+
LearningPolicyInspectionResultSchema,
|
|
62
63
|
assertLearningRequestJson,
|
|
63
64
|
learningResourceSchemas
|
|
64
65
|
} from "@openpond/evals/learning";
|
|
@@ -118,6 +119,13 @@ var OpenPondLearningClient = class {
|
|
|
118
119
|
if (!sameLearningRef(result.evidence, evidence)) throw new OpenPondLearningError(502, "evidence_identity_mismatch", "Inspection did not match the requested evidence release.", null);
|
|
119
120
|
return result;
|
|
120
121
|
}
|
|
122
|
+
/** Read current shared eligibility and budget without reserving or launching work. */
|
|
123
|
+
async inspectPolicy(policy, options = {}) {
|
|
124
|
+
const request = LearningReadRequestSchema.parse({ action: "inspect_policy", scope: this.#options.scope, policy });
|
|
125
|
+
const result = LearningPolicyInspectionResultSchema.parse(await this.#request("read", request, options));
|
|
126
|
+
if (!sameLearningRef(result.policy, policy)) throw new OpenPondLearningError(502, "policy_identity_mismatch", "Inspection did not match the requested policy release.", null);
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
121
129
|
/** Prepare once with createSourceCredentialRequest and reuse it for retries. */
|
|
122
130
|
async createSourceCredential(input, options = {}) {
|
|
123
131
|
const request = LearningSourceCredentialRequestSchema.parse({ ...input, action: "create", scope: this.#options.scope });
|
|
@@ -217,4 +225,4 @@ export {
|
|
|
217
225
|
OpenPondLearningError,
|
|
218
226
|
OpenPondLearningClient
|
|
219
227
|
};
|
|
220
|
-
//# sourceMappingURL=chunk-
|
|
228
|
+
//# sourceMappingURL=chunk-5M3PPP7D.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/learning-credentials.ts", "../src/learning-client.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from \"zod\";\nimport { ReleaseIdSchema } from \"@openpond/harness\";\nimport { LearningRevisionRefSchema } from \"@openpond/evals/learning\";\nimport { TaskSplitSchema } from \"@openpond/evals/tasksets\";\n\n/** Source credentials can submit evidence and feedback for one source only. */\nexport const LearningSourceCredentialSchema = z.object({\n id: ReleaseIdSchema,\n scope: ReleaseIdSchema,\n sourceId: ReleaseIdSchema,\n name: z.string().trim().min(1).max(100),\n keyPrefix: z.string().min(1).max(100),\n createdAt: z.iso.datetime(),\n expiresAt: z.iso.datetime(),\n revokedAt: z.iso.datetime().nullable(),\n}).strict();\nexport type LearningSourceCredential = z.infer<typeof LearningSourceCredentialSchema>;\nexport const LearningSourceCredentialSecretSchema = z.string().regex(/^opk_key_[A-Za-z0-9]{16}_[A-Za-z0-9]{48}$/);\n\nexport const LearningSourceCredentialRequestSchema = z.discriminatedUnion(\"action\", [\n z.object({ action: z.literal(\"create\"), scope: ReleaseIdSchema, sourceId: ReleaseIdSchema, name: z.string().trim().min(1).max(100), expiresAt: z.iso.datetime(), operationId: ReleaseIdSchema, apiKey: LearningSourceCredentialSecretSchema }).strict(),\n z.object({ action: z.literal(\"list\"), scope: ReleaseIdSchema, sourceId: ReleaseIdSchema, afterId: ReleaseIdSchema.optional(), limit: z.number().int().min(1).max(100).default(30) }).strict(),\n z.object({ action: z.literal(\"revoke\"), scope: ReleaseIdSchema, sourceId: ReleaseIdSchema, id: ReleaseIdSchema }).strict(),\n]);\nexport type LearningSourceCredentialRequest = z.infer<typeof LearningSourceCredentialRequestSchema>;\nexport const LearningSourceCredentialCreatedSchema = z.object({ credential: LearningSourceCredentialSchema, apiKey: LearningSourceCredentialSecretSchema }).strict();\nexport const LearningSourceCredentialPageSchema = z.object({ items: z.array(LearningSourceCredentialSchema).max(100), nextCursor: ReleaseIdSchema.nullable() }).strict();\nexport const LearningSourceConfigurationRequestSchema = z.object({ scope: ReleaseIdSchema, sourceId: ReleaseIdSchema }).strict();\nexport const LearningSourceConfigurationSchema = z.object({\n scope: ReleaseIdSchema, source: LearningRevisionRefSchema, taskDefinition: LearningRevisionRefSchema,\n enabled: z.boolean(), allowedSplits: z.array(TaskSplitSchema).min(1).max(4),\n}).strict();\n\n/** Keep this request in memory for retries. Hosts persist hashes, never its secret. */\nexport function createSourceCredentialRequest(input: { sourceId: string; name: string; expiresAt: string }) {\n return { ...input, operationId: crypto.randomUUID(), apiKey: `opk_key_${randomToken(16)}_${randomToken(48)}` };\n}\n\nfunction randomToken(length: number): string {\n const alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let value = \"\";\n while (value.length < length) {\n for (const byte of crypto.getRandomValues(new Uint8Array(64))) {\n // Rejection sampling avoids modulo bias in the 62-character alphabet.\n if (byte < 248) value += alphabet[byte % 62];\n if (value.length === length) return value;\n }\n }\n return value;\n}\n\n/** Hosts enforce expiry when issuing and authenticating; tokens are never permanent. */\nexport function assertLearningCredentialExpiry(expiresAt: string, now: Date): void {\n const expires = Date.parse(z.iso.datetime().parse(expiresAt));\n if (expires <= now.getTime() || expires > now.getTime() + 90 * 24 * 60 * 60 * 1_000) throw new Error(\"Source credentials must expire within 90 days.\");\n}\n", "import { z } from \"zod\";\nimport {\n LearningCommandRequestSchema, LearningOperationResultSchema, LearningReadRequestSchema,\n TaskEvidenceInspectionResultSchema, sameLearningRef, type LearningRevisionRef,\n LearningPolicyInspectionResultSchema,\n assertLearningRequestJson,\n learningResourceSchemas, type LearningCommand, type LearningOperationResult,\n type LearningResourceFor, type LearningResourceKind, type LearningResourcePage,\n type LearningResourceQuery, type TaskExampleSubmission, type TaskFeedbackSubmission,\n} from \"@openpond/evals/learning\";\nimport { assertBoundedTaskJson } from \"@openpond/evals/task-schema\";\nimport { LearningSourceCredentialSchema, LearningSourceCredentialRequestSchema, LearningSourceCredentialCreatedSchema, LearningSourceCredentialPageSchema, LearningSourceConfigurationRequestSchema, LearningSourceConfigurationSchema, type LearningSourceCredentialRequest } from \"./learning-credentials.js\";\n\nexport interface OpenPondLearningClientOptions {\n apiKey: string;\n baseUrl: string;\n /** Local profile or hosted team scope. The server checks the credential's ownership. */\n scope: string;\n fetch?: typeof globalThis.fetch;\n}\nexport interface LearningRequestOptions { signal?: AbortSignal }\nexport const LearningBatchPublicationSchema = z.object({\n batchId: z.string().trim().min(1).max(500), modelProjectId: z.string().trim().min(1).max(500),\n}).strict();\nexport const LearningBatchPublicationResultSchema = z.object({\n batchId: z.string().min(1), projectId: z.string().min(1), tasksetId: z.string().min(1),\n releaseId: z.string().min(1), revision: z.number().int().positive(), contentHash: z.string().regex(/^[a-f0-9]{64}$/),\n}).strict();\nexport class OpenPondLearningError extends Error {\n constructor(readonly status: number, readonly code: string, message: string, readonly details: unknown) {\n super(message);\n this.name = \"OpenPondLearningError\";\n }\n}\n\n/** The same portable commands are sent to the local and hosted execution owner. */\nexport class OpenPondLearningClient {\n readonly #options: OpenPondLearningClientOptions;\n constructor(options: OpenPondLearningClientOptions) {\n if (!options.apiKey.trim() || !options.scope.trim()) throw new Error(\"Learning API key and scope are required.\");\n const url = new URL(options.baseUrl);\n if (![\"http:\", \"https:\"].includes(url.protocol) || url.username || url.password || url.search || url.hash) throw new Error(\"Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.\");\n this.#options = { ...options, baseUrl: url.toString().replace(/\\/+$/, \"\") };\n }\n\n async command(command: LearningCommand, options: LearningRequestOptions = {}): Promise<LearningOperationResult> {\n assertLearningRequestJson(command);\n const request = LearningCommandRequestSchema.parse({ scope: this.#options.scope, command });\n const result = LearningOperationResultSchema.parse(await this.#request(\"commands\", request, options));\n if (result.operationId !== command.operationId) throw new OpenPondLearningError(502, \"operation_identity_mismatch\", \"Learning response did not match the submitted operation.\", null);\n return result;\n }\n\n submitExample(example: TaskExampleSubmission, options: LearningRequestOptions = {}) {\n return this.command({ action: \"submit_example\", operationId: example.idempotencyKey, example }, options);\n }\n\n submitFeedback(feedback: TaskFeedbackSubmission, options: LearningRequestOptions = {}) {\n return this.command({ action: \"submit_feedback\", operationId: feedback.idempotencyKey, feedback }, options);\n }\n\n async get<K extends LearningResourceKind>(kind: K, id: string, revision?: number, options: LearningRequestOptions = {}): Promise<LearningResourceFor<K>> {\n const request = LearningReadRequestSchema.parse({ action: \"get\", scope: this.#options.scope, kind, id, ...(revision === undefined ? {} : { revision }) });\n return learningResourceSchemas[kind].parse(await this.#request(\"read\", request, options)) as LearningResourceFor<K>;\n }\n\n async inspectEvidence(evidence: LearningRevisionRef, options: LearningRequestOptions = {}) {\n const request = LearningReadRequestSchema.parse({ action: \"inspect_evidence\", scope: this.#options.scope, evidence });\n const result = TaskEvidenceInspectionResultSchema.parse(await this.#request(\"read\", request, options));\n if (!sameLearningRef(result.evidence, evidence)) throw new OpenPondLearningError(502, \"evidence_identity_mismatch\", \"Inspection did not match the requested evidence release.\", null);\n return result;\n }\n\n /** Read current shared eligibility and budget without reserving or launching work. */\n async inspectPolicy(policy: LearningRevisionRef, options: LearningRequestOptions = {}) {\n const request = LearningReadRequestSchema.parse({ action: \"inspect_policy\", scope: this.#options.scope, policy });\n const result = LearningPolicyInspectionResultSchema.parse(await this.#request(\"read\", request, options));\n if (!sameLearningRef(result.policy, policy)) throw new OpenPondLearningError(502, \"policy_identity_mismatch\", \"Inspection did not match the requested policy release.\", null);\n return result;\n }\n\n /** Prepare once with createSourceCredentialRequest and reuse it for retries. */\n async createSourceCredential(input: Omit<Extract<LearningSourceCredentialRequest, { action: \"create\" }>, \"action\" | \"scope\">, options: LearningRequestOptions = {}) {\n const request = LearningSourceCredentialRequestSchema.parse({ ...input, action: \"create\", scope: this.#options.scope });\n const result = LearningSourceCredentialCreatedSchema.parse(await this.#request(\"credentials\", request, options));\n this.#assertCredentialScope(result.credential, input.sourceId);\n if (result.apiKey !== input.apiKey || !input.apiKey.startsWith(`${result.credential.keyPrefix}_`)) throw new OpenPondLearningError(502, \"credential_identity_mismatch\", \"Credential response did not match the prepared credential.\", null);\n return result;\n }\n\n async listSourceCredentials(sourceId: string, query: { afterId?: string; limit?: number } = {}, options: LearningRequestOptions = {}) {\n const request = LearningSourceCredentialRequestSchema.parse({ ...query, action: \"list\", scope: this.#options.scope, sourceId });\n const result = LearningSourceCredentialPageSchema.parse(await this.#request(\"credentials\", request, options));\n if (result.items.length > (query.limit ?? 30)) throw new OpenPondLearningError(502, \"credential_page_invalid\", \"Credential response exceeded the requested page size.\", null);\n for (const item of result.items) this.#assertCredentialScope(item, sourceId);\n return result;\n }\n\n async revokeSourceCredential(sourceId: string, id: string, options: LearningRequestOptions = {}) {\n const request = LearningSourceCredentialRequestSchema.parse({ action: \"revoke\", scope: this.#options.scope, sourceId, id });\n const result = LearningSourceCredentialSchema.parse(await this.#request(\"credentials\", request, options));\n this.#assertCredentialScope(result, sourceId);\n if (result.id !== id || result.revokedAt === null) throw new OpenPondLearningError(502, \"credential_revocation_mismatch\", \"Credential revocation did not match the requested credential.\", null);\n return result;\n }\n\n async sourceConfiguration(sourceId: string, options: LearningRequestOptions = {}) {\n const request = LearningSourceConfigurationRequestSchema.parse({ scope: this.#options.scope, sourceId });\n const result = LearningSourceConfigurationSchema.parse(await this.#request(\"source-config\", request, options));\n if (result.scope !== this.#options.scope || result.source.id !== sourceId) throw new OpenPondLearningError(502, \"source_identity_mismatch\", \"Source configuration did not match the requested source.\", null);\n return result;\n }\n\n #assertCredentialScope(value: { scope: string; sourceId: string }, sourceId: string) {\n if (value.scope !== this.#options.scope || value.sourceId !== sourceId) throw new OpenPondLearningError(502, \"credential_scope_mismatch\", \"Credential response did not match the requested source.\", null);\n }\n\n async list<K extends LearningResourceKind>(kind: K, query: Partial<LearningResourceQuery> = {}, options: LearningRequestOptions = {}): Promise<LearningResourcePage<K>> {\n const request = LearningReadRequestSchema.parse({ action: \"list\", scope: this.#options.scope, kind, ...query });\n return z.object({ items: z.array(learningResourceSchemas[kind]).max(100), nextCursor: z.string().nullable() }).strict().parse(await this.#request(\"read\", request, options)) as LearningResourcePage<K>;\n }\n\n /** Hosted publication only: stores an immutable package and attaches it, without starting training. */\n async publishBatch(input: z.infer<typeof LearningBatchPublicationSchema>, options: LearningRequestOptions = {}) {\n const request = LearningBatchPublicationSchema.parse(input);\n const result = LearningBatchPublicationResultSchema.parse(await this.#request(\"publish-batch\", { ...request, scope: this.#options.scope }, options));\n if (result.batchId !== request.batchId) throw new OpenPondLearningError(502, \"batch_identity_mismatch\", \"Published batch response did not match the requested batch.\", null);\n return result;\n }\n\n async #request(endpoint: \"commands\" | \"read\" | \"publish-batch\" | \"credentials\" | \"source-config\", body: unknown, options: LearningRequestOptions): Promise<unknown> {\n assertBoundedTaskJson(body, 16_777_216);\n const response = await (this.#options.fetch ?? globalThis.fetch)(`${this.#options.baseUrl}/v1/learning/${endpoint}`, {\n method: \"POST\", headers: { Authorization: `Bearer ${this.#options.apiKey}`, \"Content-Type\": \"application/json\", Accept: \"application/json\", \"X-OpenPond-Team-Id\": this.#options.scope }, body: JSON.stringify(body), signal: options.signal,\n redirect: \"error\",\n });\n const payload = await readBoundedLearningResponse(response);\n if (!response.ok) {\n const error = z.object({ code: z.string().optional(), error: z.string().optional() }).passthrough().safeParse(payload);\n throw new OpenPondLearningError(response.status, error.success ? error.data.code ?? \"learning_request_failed\" : \"learning_request_failed\", error.success ? error.data.error ?? `Learning request failed (${response.status}).` : `Learning request failed (${response.status}).`, payload);\n }\n return payload;\n }\n}\n\nasync function readBoundedLearningResponse(response: Response): Promise<unknown> {\n const maximumBytes = 16_777_216;\n const reader = response.body?.getReader();\n if (!reader) throw new OpenPondLearningError(response.status, \"empty_response\", \"Learning response was empty.\", null);\n const decoder = new TextDecoder();\n let bytes = 0;\n let text = \"\";\n try {\n while (true) {\n const next = await reader.read();\n if (next.done) break;\n bytes += next.value.byteLength;\n if (bytes > maximumBytes) throw new OpenPondLearningError(response.status, \"response_too_large\", \"Learning response exceeded 16 MiB; request a smaller page.\", null);\n text += decoder.decode(next.value, { stream: true });\n }\n text += decoder.decode();\n const value: unknown = JSON.parse(text);\n assertBoundedTaskJson(value, maximumBytes);\n return value;\n } finally {\n await reader.cancel();\n reader.releaseLock();\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA,SAAS,SAAS;AAElB,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB;AAGzB,IAAM,iCAAiC,EAAE,OAAO;AAAA,EACrD,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACtC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACpC,WAAW,EAAE,IAAI,SAAS;AAAA,EAC1B,WAAW,EAAE,IAAI,SAAS;AAAA,EAC1B,WAAW,EAAE,IAAI,SAAS,EAAE,SAAS;AACvC,CAAC,EAAE,OAAO;AAEH,IAAM,uCAAuC,EAAE,OAAO,EAAE,MAAM,2CAA2C;AAEzG,IAAM,wCAAwC,EAAE,mBAAmB,UAAU;AAAA,EAClF,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,QAAQ,GAAG,OAAO,iBAAiB,UAAU,iBAAiB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,WAAW,EAAE,IAAI,SAAS,GAAG,aAAa,iBAAiB,QAAQ,qCAAqC,CAAC,EAAE,OAAO;AAAA,EACtP,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,MAAM,GAAG,OAAO,iBAAiB,UAAU,iBAAiB,SAAS,gBAAgB,SAAS,GAAG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,OAAO;AAAA,EAC5L,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,QAAQ,GAAG,OAAO,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AO;AACrH,YAAM,IAAI,sBAAsB,SAAS,QAAQ,MAAM,UAAU,MAAM,KAAK,QAAQ,4BAA4B,2BAA2B,MAAM,UAAU,MAAM,KAAK,SAAS,4BAA4B,SAAS,MAAM,OAAO,4BAA4B,SAAS,MAAM,MAAM,OAAO;AAAA,IAC3R;AACA,WAAO;AAAA,EACT;AACF;AAEA,eAAe,4BAA4B,UAAsC;AAC/E,QAAM,eAAe;AACrB,QAAM,SAAS,SAAS,MAAM,UAAU;AACxC,MAAI,CAAC,OAAQ,OAAM,IAAI,sBAAsB,SAAS,QAAQ,kBAAkB,gCAAgC,IAAI;AACpH,QAAM,UAAU,IAAI,YAAY;AAChC,MAAI,QAAQ;AACZ,MAAI,OAAO;AACX,MAAI;AACF,WAAO,MAAM;AACX,YAAM,OAAO,MAAM,OAAO,KAAK;AAC/B,UAAI,KAAK,KAAM;AACf,eAAS,KAAK,MAAM;AACpB,UAAI,QAAQ,aAAc,OAAM,IAAI,sBAAsB,SAAS,QAAQ,sBAAsB,8DAA8D,IAAI;AACnK,cAAQ,QAAQ,OAAO,KAAK,OAAO,EAAE,QAAQ,KAAK,CAAC;AAAA,IACrD;AACA,YAAQ,QAAQ,OAAO;AACvB,UAAM,QAAiB,KAAK,MAAM,IAAI;AACtC,0BAAsB,OAAO,YAAY;AACzC,WAAO;AAAA,EACT,UAAE;AACA,UAAM,OAAO,OAAO;AACpB,WAAO,YAAY;AAAA,EACrB;AACF;",
|
|
6
|
+
"names": ["z", "z"]
|
|
7
|
+
}
|
package/dist/index.js
CHANGED
package/dist/learning.js
CHANGED
|
@@ -12,13 +12,34 @@ import {
|
|
|
12
12
|
OpenPondLearningError,
|
|
13
13
|
assertLearningCredentialExpiry,
|
|
14
14
|
createSourceCredentialRequest
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5M3PPP7D.js";
|
|
16
16
|
import "./chunk-5FBPNWT4.js";
|
|
17
|
-
import
|
|
17
|
+
import {
|
|
18
|
+
contentHash
|
|
19
|
+
} from "./chunk-QUOW6URQ.js";
|
|
18
20
|
|
|
19
21
|
// src/learning.ts
|
|
20
22
|
export * from "@openpond/evals/learning";
|
|
21
23
|
export * from "@openpond/evals/rewards";
|
|
24
|
+
|
|
25
|
+
// src/model-learning-policy.ts
|
|
26
|
+
import { LearningDomainError } from "@openpond/evals/learning";
|
|
27
|
+
function hostedLearningPolicyReferences(project) {
|
|
28
|
+
const setup = project.trainingSetup;
|
|
29
|
+
const base = setup.baseModel ?? project.defaultBaseModel;
|
|
30
|
+
if (!setup.recipe || !base || !setup.evaluationTasksetRef) {
|
|
31
|
+
throw new LearningDomainError(
|
|
32
|
+
"learning_model_configuration_incomplete",
|
|
33
|
+
422,
|
|
34
|
+
"Select a training recipe, starting model and retained evaluation before enabling hosted learning."
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
recipe: { id: `model-recipe-${project.etag}`, contentHash: contentHash(setup.recipe) },
|
|
39
|
+
trainingParent: { id: base.modelId, contentHash: contentHash(base) },
|
|
40
|
+
retentionEvaluation: { id: setup.evaluationTasksetRef.id, contentHash: setup.evaluationTasksetRef.contentHash }
|
|
41
|
+
};
|
|
42
|
+
}
|
|
22
43
|
export {
|
|
23
44
|
LearningBatchPublicationResultSchema,
|
|
24
45
|
LearningBatchPublicationSchema,
|
|
@@ -32,6 +53,7 @@ export {
|
|
|
32
53
|
OpenPondLearningClient,
|
|
33
54
|
OpenPondLearningError,
|
|
34
55
|
assertLearningCredentialExpiry,
|
|
35
|
-
createSourceCredentialRequest
|
|
56
|
+
createSourceCredentialRequest,
|
|
57
|
+
hostedLearningPolicyReferences
|
|
36
58
|
};
|
|
37
59
|
//# sourceMappingURL=learning.js.map
|
package/dist/learning.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/learning.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"@openpond/evals/learning\";\nexport * from \"@openpond/evals/rewards\";\nexport * from \"./learning-credentials.js\";\nexport * from \"./learning-client.js\";\n"],
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": ["../src/learning.ts", "../src/model-learning-policy.ts"],
|
|
4
|
+
"sourcesContent": ["export * from \"@openpond/evals/learning\";\nexport * from \"@openpond/evals/rewards\";\nexport * from \"./learning-credentials.js\";\nexport * from \"./learning-client.js\";\nexport * from \"./model-learning-policy.js\";\n", "import { LearningDomainError } from \"@openpond/evals/learning\";\nimport { contentHash } from \"@openpond/harness\";\n\nimport type { HostedModelProjectSummary } from \"./model-projects.js\";\n\n/** Bind a reviewed hosted Model configuration before asynchronous preparation.\n * Keep the established recipe identity: its id binds the whole Model revision,\n * including Harness and retention selections, while its hash binds the recipe.\n * Callers must obtain the summary from the authenticated Model API. */\nexport function hostedLearningPolicyReferences(project: HostedModelProjectSummary) {\n const setup = project.trainingSetup;\n const base = setup.baseModel ?? project.defaultBaseModel;\n if (!setup.recipe || !base || !setup.evaluationTasksetRef) {\n throw new LearningDomainError(\"learning_model_configuration_incomplete\", 422,\n \"Select a training recipe, starting model and retained evaluation before enabling hosted learning.\");\n }\n return {\n recipe: { id: `model-recipe-${project.etag}`, contentHash: contentHash(setup.recipe) },\n trainingParent: { id: base.modelId, contentHash: contentHash(base) },\n retentionEvaluation: { id: setup.evaluationTasksetRef.id, contentHash: setup.evaluationTasksetRef.contentHash },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,cAAc;;;ACDd,SAAS,2BAA2B;AAS7B,SAAS,+BAA+B,SAAoC;AACjF,QAAM,QAAQ,QAAQ;AACtB,QAAM,OAAO,MAAM,aAAa,QAAQ;AACxC,MAAI,CAAC,MAAM,UAAU,CAAC,QAAQ,CAAC,MAAM,sBAAsB;AACzD,UAAM,IAAI;AAAA,MAAoB;AAAA,MAA2C;AAAA,MACvE;AAAA,IAAmG;AAAA,EACvG;AACA,SAAO;AAAA,IACL,QAAQ,EAAE,IAAI,gBAAgB,QAAQ,IAAI,IAAI,aAAa,YAAY,MAAM,MAAM,EAAE;AAAA,IACrF,gBAAgB,EAAE,IAAI,KAAK,SAAS,aAAa,YAAY,IAAI,EAAE;AAAA,IACnE,qBAAqB,EAAE,IAAI,MAAM,qBAAqB,IAAI,aAAa,MAAM,qBAAqB,YAAY;AAAA,EAChH;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -59,6 +59,46 @@ export declare class OpenPondLearningClient {
|
|
|
59
59
|
}[];
|
|
60
60
|
};
|
|
61
61
|
}>;
|
|
62
|
+
/** Read current shared eligibility and budget without reserving or launching work. */
|
|
63
|
+
inspectPolicy(policy: LearningRevisionRef, options?: LearningRequestOptions): Promise<{
|
|
64
|
+
policy: {
|
|
65
|
+
id: string;
|
|
66
|
+
contentHash: string;
|
|
67
|
+
revision: number;
|
|
68
|
+
};
|
|
69
|
+
modelProjectId: string;
|
|
70
|
+
inspectedAt: string;
|
|
71
|
+
chain: {
|
|
72
|
+
schemaVersion: "openpond.learningChain.v1";
|
|
73
|
+
id: string;
|
|
74
|
+
revision: number;
|
|
75
|
+
modelProjectId: string;
|
|
76
|
+
activeIterationId: string | null;
|
|
77
|
+
latestIterationId: string;
|
|
78
|
+
lastReservedAt: string | null;
|
|
79
|
+
updatedAt: string;
|
|
80
|
+
} | null;
|
|
81
|
+
counts: {
|
|
82
|
+
eligible: number;
|
|
83
|
+
awaitingReview: number;
|
|
84
|
+
excluded: number;
|
|
85
|
+
consumed: number;
|
|
86
|
+
} | null;
|
|
87
|
+
minimumApprovedExamples: number;
|
|
88
|
+
canReserve: boolean;
|
|
89
|
+
blockers: {
|
|
90
|
+
code: string;
|
|
91
|
+
message: string;
|
|
92
|
+
}[];
|
|
93
|
+
cooldownUntil: string | null;
|
|
94
|
+
budget: {
|
|
95
|
+
reservedSpendUsd: number;
|
|
96
|
+
settledSpendUsd: number;
|
|
97
|
+
committedSpendUsd: number;
|
|
98
|
+
maximumIterationSpendUsd: number;
|
|
99
|
+
maximumDailySpendUsd: number;
|
|
100
|
+
};
|
|
101
|
+
}>;
|
|
62
102
|
/** Prepare once with createSourceCredentialRequest and reuse it for retries. */
|
|
63
103
|
createSourceCredential(input: Omit<Extract<LearningSourceCredentialRequest, {
|
|
64
104
|
action: "create";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learning-client.d.ts","sourceRoot":"","sources":["../../../../../src/learning-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEgD,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"learning-client.d.ts","sourceRoot":"","sources":["../../../../../src/learning-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEgD,KAAK,mBAAmB,EAGpD,KAAK,eAAe,EAAE,KAAK,uBAAuB,EAC3E,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAC9E,KAAK,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,KAAK,sBAAsB,EACpF,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAiO,KAAK,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAEhT,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACjC;AACD,MAAM,WAAW,sBAAsB;IAAG,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE;AAChE,eAAO,MAAM,8BAA8B;;;kBAEhC,CAAC;AACZ,eAAO,MAAM,oCAAoC;;;;;;;kBAGtC,CAAC;AACZ,qBAAa,qBAAsB,SAAQ,KAAK;IAClC,QAAQ,CAAC,MAAM,EAAE,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A;KAAO,EAAE,OAAO,GAAE,sBAA2B;;;;;;;;;;;;;IAQ9H,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;;;;;;;;;;IAQzF,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;;;;;;;;;;;;;;;IAW1E,IAAI,CAAC,CAAC,SAAS,oBAAoB,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,GAAE,OAAO,CAAC,qBAAqB,CAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAKvK,uGAAuG;IACjG,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,EAAE,OAAO,GAAE,sBAA2B;;;;;;;;CAoB/G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learning.d.ts","sourceRoot":"","sources":["../../../../../src/learning.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"learning.d.ts","sourceRoot":"","sources":["../../../../../src/learning.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HostedModelProjectSummary } from "./model-projects.js";
|
|
2
|
+
/** Bind a reviewed hosted Model configuration before asynchronous preparation.
|
|
3
|
+
* Keep the established recipe identity: its id binds the whole Model revision,
|
|
4
|
+
* including Harness and retention selections, while its hash binds the recipe.
|
|
5
|
+
* Callers must obtain the summary from the authenticated Model API. */
|
|
6
|
+
export declare function hostedLearningPolicyReferences(project: HostedModelProjectSummary): {
|
|
7
|
+
recipe: {
|
|
8
|
+
id: string;
|
|
9
|
+
contentHash: string;
|
|
10
|
+
};
|
|
11
|
+
trainingParent: {
|
|
12
|
+
id: string;
|
|
13
|
+
contentHash: string;
|
|
14
|
+
};
|
|
15
|
+
retentionEvaluation: {
|
|
16
|
+
id: string;
|
|
17
|
+
contentHash: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=model-learning-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-learning-policy.d.ts","sourceRoot":"","sources":["../../../../../src/model-learning-policy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAErE;;;uEAGuE;AACvE,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,yBAAyB;;;;;;;;;;;;;EAYhF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openpond-sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "Server-side TypeScript SDK for OpenPond sandboxes and agentic work",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"vitest": "4.1.10"
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
|
-
"@openpond/evals": "^0.10.
|
|
142
|
+
"@openpond/evals": "^0.10.5",
|
|
143
143
|
"@openpond/harness": "^0.3.0",
|
|
144
144
|
"esbuild": "0.28.1",
|
|
145
145
|
"zod": "^4.1.13"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/learning-credentials.ts", "../src/learning-client.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from \"zod\";\nimport { ReleaseIdSchema } from \"@openpond/harness\";\nimport { LearningRevisionRefSchema } from \"@openpond/evals/learning\";\nimport { TaskSplitSchema } from \"@openpond/evals/tasksets\";\n\n/** Source credentials can submit evidence and feedback for one source only. */\nexport const LearningSourceCredentialSchema = z.object({\n id: ReleaseIdSchema,\n scope: ReleaseIdSchema,\n sourceId: ReleaseIdSchema,\n name: z.string().trim().min(1).max(100),\n keyPrefix: z.string().min(1).max(100),\n createdAt: z.iso.datetime(),\n expiresAt: z.iso.datetime(),\n revokedAt: z.iso.datetime().nullable(),\n}).strict();\nexport type LearningSourceCredential = z.infer<typeof LearningSourceCredentialSchema>;\nexport const LearningSourceCredentialSecretSchema = z.string().regex(/^opk_key_[A-Za-z0-9]{16}_[A-Za-z0-9]{48}$/);\n\nexport const LearningSourceCredentialRequestSchema = z.discriminatedUnion(\"action\", [\n z.object({ action: z.literal(\"create\"), scope: ReleaseIdSchema, sourceId: ReleaseIdSchema, name: z.string().trim().min(1).max(100), expiresAt: z.iso.datetime(), operationId: ReleaseIdSchema, apiKey: LearningSourceCredentialSecretSchema }).strict(),\n z.object({ action: z.literal(\"list\"), scope: ReleaseIdSchema, sourceId: ReleaseIdSchema, afterId: ReleaseIdSchema.optional(), limit: z.number().int().min(1).max(100).default(30) }).strict(),\n z.object({ action: z.literal(\"revoke\"), scope: ReleaseIdSchema, sourceId: ReleaseIdSchema, id: ReleaseIdSchema }).strict(),\n]);\nexport type LearningSourceCredentialRequest = z.infer<typeof LearningSourceCredentialRequestSchema>;\nexport const LearningSourceCredentialCreatedSchema = z.object({ credential: LearningSourceCredentialSchema, apiKey: LearningSourceCredentialSecretSchema }).strict();\nexport const LearningSourceCredentialPageSchema = z.object({ items: z.array(LearningSourceCredentialSchema).max(100), nextCursor: ReleaseIdSchema.nullable() }).strict();\nexport const LearningSourceConfigurationRequestSchema = z.object({ scope: ReleaseIdSchema, sourceId: ReleaseIdSchema }).strict();\nexport const LearningSourceConfigurationSchema = z.object({\n scope: ReleaseIdSchema, source: LearningRevisionRefSchema, taskDefinition: LearningRevisionRefSchema,\n enabled: z.boolean(), allowedSplits: z.array(TaskSplitSchema).min(1).max(4),\n}).strict();\n\n/** Keep this request in memory for retries. Hosts persist hashes, never its secret. */\nexport function createSourceCredentialRequest(input: { sourceId: string; name: string; expiresAt: string }) {\n return { ...input, operationId: crypto.randomUUID(), apiKey: `opk_key_${randomToken(16)}_${randomToken(48)}` };\n}\n\nfunction randomToken(length: number): string {\n const alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let value = \"\";\n while (value.length < length) {\n for (const byte of crypto.getRandomValues(new Uint8Array(64))) {\n // Rejection sampling avoids modulo bias in the 62-character alphabet.\n if (byte < 248) value += alphabet[byte % 62];\n if (value.length === length) return value;\n }\n }\n return value;\n}\n\n/** Hosts enforce expiry when issuing and authenticating; tokens are never permanent. */\nexport function assertLearningCredentialExpiry(expiresAt: string, now: Date): void {\n const expires = Date.parse(z.iso.datetime().parse(expiresAt));\n if (expires <= now.getTime() || expires > now.getTime() + 90 * 24 * 60 * 60 * 1_000) throw new Error(\"Source credentials must expire within 90 days.\");\n}\n", "import { z } from \"zod\";\nimport {\n LearningCommandRequestSchema, LearningOperationResultSchema, LearningReadRequestSchema,\n TaskEvidenceInspectionResultSchema, sameLearningRef, type LearningRevisionRef,\n assertLearningRequestJson,\n learningResourceSchemas, type LearningCommand, type LearningOperationResult,\n type LearningResourceFor, type LearningResourceKind, type LearningResourcePage,\n type LearningResourceQuery, type TaskExampleSubmission, type TaskFeedbackSubmission,\n} from \"@openpond/evals/learning\";\nimport { assertBoundedTaskJson } from \"@openpond/evals/task-schema\";\nimport { LearningSourceCredentialSchema, LearningSourceCredentialRequestSchema, LearningSourceCredentialCreatedSchema, LearningSourceCredentialPageSchema, LearningSourceConfigurationRequestSchema, LearningSourceConfigurationSchema, type LearningSourceCredentialRequest } from \"./learning-credentials.js\";\n\nexport interface OpenPondLearningClientOptions {\n apiKey: string;\n baseUrl: string;\n /** Local profile or hosted team scope. The server checks the credential's ownership. */\n scope: string;\n fetch?: typeof globalThis.fetch;\n}\nexport interface LearningRequestOptions { signal?: AbortSignal }\nexport const LearningBatchPublicationSchema = z.object({\n batchId: z.string().trim().min(1).max(500), modelProjectId: z.string().trim().min(1).max(500),\n}).strict();\nexport const LearningBatchPublicationResultSchema = z.object({\n batchId: z.string().min(1), projectId: z.string().min(1), tasksetId: z.string().min(1),\n releaseId: z.string().min(1), revision: z.number().int().positive(), contentHash: z.string().regex(/^[a-f0-9]{64}$/),\n}).strict();\nexport class OpenPondLearningError extends Error {\n constructor(readonly status: number, readonly code: string, message: string, readonly details: unknown) {\n super(message);\n this.name = \"OpenPondLearningError\";\n }\n}\n\n/** The same portable commands are sent to the local and hosted execution owner. */\nexport class OpenPondLearningClient {\n readonly #options: OpenPondLearningClientOptions;\n constructor(options: OpenPondLearningClientOptions) {\n if (!options.apiKey.trim() || !options.scope.trim()) throw new Error(\"Learning API key and scope are required.\");\n const url = new URL(options.baseUrl);\n if (![\"http:\", \"https:\"].includes(url.protocol) || url.username || url.password || url.search || url.hash) throw new Error(\"Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.\");\n this.#options = { ...options, baseUrl: url.toString().replace(/\\/+$/, \"\") };\n }\n\n async command(command: LearningCommand, options: LearningRequestOptions = {}): Promise<LearningOperationResult> {\n assertLearningRequestJson(command);\n const request = LearningCommandRequestSchema.parse({ scope: this.#options.scope, command });\n const result = LearningOperationResultSchema.parse(await this.#request(\"commands\", request, options));\n if (result.operationId !== command.operationId) throw new OpenPondLearningError(502, \"operation_identity_mismatch\", \"Learning response did not match the submitted operation.\", null);\n return result;\n }\n\n submitExample(example: TaskExampleSubmission, options: LearningRequestOptions = {}) {\n return this.command({ action: \"submit_example\", operationId: example.idempotencyKey, example }, options);\n }\n\n submitFeedback(feedback: TaskFeedbackSubmission, options: LearningRequestOptions = {}) {\n return this.command({ action: \"submit_feedback\", operationId: feedback.idempotencyKey, feedback }, options);\n }\n\n async get<K extends LearningResourceKind>(kind: K, id: string, revision?: number, options: LearningRequestOptions = {}): Promise<LearningResourceFor<K>> {\n const request = LearningReadRequestSchema.parse({ action: \"get\", scope: this.#options.scope, kind, id, ...(revision === undefined ? {} : { revision }) });\n return learningResourceSchemas[kind].parse(await this.#request(\"read\", request, options)) as LearningResourceFor<K>;\n }\n\n async inspectEvidence(evidence: LearningRevisionRef, options: LearningRequestOptions = {}) {\n const request = LearningReadRequestSchema.parse({ action: \"inspect_evidence\", scope: this.#options.scope, evidence });\n const result = TaskEvidenceInspectionResultSchema.parse(await this.#request(\"read\", request, options));\n if (!sameLearningRef(result.evidence, evidence)) throw new OpenPondLearningError(502, \"evidence_identity_mismatch\", \"Inspection did not match the requested evidence release.\", null);\n return result;\n }\n\n /** Prepare once with createSourceCredentialRequest and reuse it for retries. */\n async createSourceCredential(input: Omit<Extract<LearningSourceCredentialRequest, { action: \"create\" }>, \"action\" | \"scope\">, options: LearningRequestOptions = {}) {\n const request = LearningSourceCredentialRequestSchema.parse({ ...input, action: \"create\", scope: this.#options.scope });\n const result = LearningSourceCredentialCreatedSchema.parse(await this.#request(\"credentials\", request, options));\n this.#assertCredentialScope(result.credential, input.sourceId);\n if (result.apiKey !== input.apiKey || !input.apiKey.startsWith(`${result.credential.keyPrefix}_`)) throw new OpenPondLearningError(502, \"credential_identity_mismatch\", \"Credential response did not match the prepared credential.\", null);\n return result;\n }\n\n async listSourceCredentials(sourceId: string, query: { afterId?: string; limit?: number } = {}, options: LearningRequestOptions = {}) {\n const request = LearningSourceCredentialRequestSchema.parse({ ...query, action: \"list\", scope: this.#options.scope, sourceId });\n const result = LearningSourceCredentialPageSchema.parse(await this.#request(\"credentials\", request, options));\n if (result.items.length > (query.limit ?? 30)) throw new OpenPondLearningError(502, \"credential_page_invalid\", \"Credential response exceeded the requested page size.\", null);\n for (const item of result.items) this.#assertCredentialScope(item, sourceId);\n return result;\n }\n\n async revokeSourceCredential(sourceId: string, id: string, options: LearningRequestOptions = {}) {\n const request = LearningSourceCredentialRequestSchema.parse({ action: \"revoke\", scope: this.#options.scope, sourceId, id });\n const result = LearningSourceCredentialSchema.parse(await this.#request(\"credentials\", request, options));\n this.#assertCredentialScope(result, sourceId);\n if (result.id !== id || result.revokedAt === null) throw new OpenPondLearningError(502, \"credential_revocation_mismatch\", \"Credential revocation did not match the requested credential.\", null);\n return result;\n }\n\n async sourceConfiguration(sourceId: string, options: LearningRequestOptions = {}) {\n const request = LearningSourceConfigurationRequestSchema.parse({ scope: this.#options.scope, sourceId });\n const result = LearningSourceConfigurationSchema.parse(await this.#request(\"source-config\", request, options));\n if (result.scope !== this.#options.scope || result.source.id !== sourceId) throw new OpenPondLearningError(502, \"source_identity_mismatch\", \"Source configuration did not match the requested source.\", null);\n return result;\n }\n\n #assertCredentialScope(value: { scope: string; sourceId: string }, sourceId: string) {\n if (value.scope !== this.#options.scope || value.sourceId !== sourceId) throw new OpenPondLearningError(502, \"credential_scope_mismatch\", \"Credential response did not match the requested source.\", null);\n }\n\n async list<K extends LearningResourceKind>(kind: K, query: Partial<LearningResourceQuery> = {}, options: LearningRequestOptions = {}): Promise<LearningResourcePage<K>> {\n const request = LearningReadRequestSchema.parse({ action: \"list\", scope: this.#options.scope, kind, ...query });\n return z.object({ items: z.array(learningResourceSchemas[kind]).max(100), nextCursor: z.string().nullable() }).strict().parse(await this.#request(\"read\", request, options)) as LearningResourcePage<K>;\n }\n\n /** Hosted publication only: stores an immutable package and attaches it, without starting training. */\n async publishBatch(input: z.infer<typeof LearningBatchPublicationSchema>, options: LearningRequestOptions = {}) {\n const request = LearningBatchPublicationSchema.parse(input);\n const result = LearningBatchPublicationResultSchema.parse(await this.#request(\"publish-batch\", { ...request, scope: this.#options.scope }, options));\n if (result.batchId !== request.batchId) throw new OpenPondLearningError(502, \"batch_identity_mismatch\", \"Published batch response did not match the requested batch.\", null);\n return result;\n }\n\n async #request(endpoint: \"commands\" | \"read\" | \"publish-batch\" | \"credentials\" | \"source-config\", body: unknown, options: LearningRequestOptions): Promise<unknown> {\n assertBoundedTaskJson(body, 16_777_216);\n const response = await (this.#options.fetch ?? globalThis.fetch)(`${this.#options.baseUrl}/v1/learning/${endpoint}`, {\n method: \"POST\", headers: { Authorization: `Bearer ${this.#options.apiKey}`, \"Content-Type\": \"application/json\", Accept: \"application/json\", \"X-OpenPond-Team-Id\": this.#options.scope }, body: JSON.stringify(body), signal: options.signal,\n redirect: \"error\",\n });\n const payload = await readBoundedLearningResponse(response);\n if (!response.ok) {\n const error = z.object({ code: z.string().optional(), error: z.string().optional() }).passthrough().safeParse(payload);\n throw new OpenPondLearningError(response.status, error.success ? error.data.code ?? \"learning_request_failed\" : \"learning_request_failed\", error.success ? error.data.error ?? `Learning request failed (${response.status}).` : `Learning request failed (${response.status}).`, payload);\n }\n return payload;\n }\n}\n\nasync function readBoundedLearningResponse(response: Response): Promise<unknown> {\n const maximumBytes = 16_777_216;\n const reader = response.body?.getReader();\n if (!reader) throw new OpenPondLearningError(response.status, \"empty_response\", \"Learning response was empty.\", null);\n const decoder = new TextDecoder();\n let bytes = 0;\n let text = \"\";\n try {\n while (true) {\n const next = await reader.read();\n if (next.done) break;\n bytes += next.value.byteLength;\n if (bytes > maximumBytes) throw new OpenPondLearningError(response.status, \"response_too_large\", \"Learning response exceeded 16 MiB; request a smaller page.\", null);\n text += decoder.decode(next.value, { stream: true });\n }\n text += decoder.decode();\n const value: unknown = JSON.parse(text);\n assertBoundedTaskJson(value, maximumBytes);\n return value;\n } finally {\n await reader.cancel();\n reader.releaseLock();\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAAA,SAAS,SAAS;AAElB,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB;AAGzB,IAAM,iCAAiC,EAAE,OAAO;AAAA,EACrD,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAA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