spaps-sdk 1.7.0 → 1.8.0
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 +2 -0
- package/README.md +49 -3
- package/dist/index.d.mts +112 -5
- package/dist/index.d.ts +112 -5
- package/dist/index.js +9 -0
- package/dist/index.mjs +9 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.7.0] - 2026-05-09
|
|
10
|
+
|
|
9
11
|
- Added `dayrate.getCheckoutStatus(sessionId)` and checkout-status response types for Bookme/dayrate confirmation polling.
|
|
10
12
|
- Added browser-safe runtime helpers: guarded environment reads, `TokenManager.decodePayload()`, and SPAPS envelope unwrapping/type guards.
|
|
11
13
|
- Added `headerProvider` SDK config for per-request custom context headers without overriding SDK-managed auth headers.
|
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ Relevant environment variables:
|
|
|
88
88
|
| `appLinks` | Authenticated create and public resolve helpers for application-scoped short links |
|
|
89
89
|
| `email` | Template lookup, preview, and send helpers |
|
|
90
90
|
| `entitlements` | User and resource entitlement queries |
|
|
91
|
-
| `skillEvals` | Paid blind skill-eval cases, review rooms,
|
|
91
|
+
| `skillEvals` | Paid blind skill-eval cases, review rooms, reviewer marks, insight inboxes, and controlled reveal |
|
|
92
92
|
| `dayrate` | Availability, Stripe booking, x402 booking-hold, and checkout-status helpers |
|
|
93
93
|
| `admin` | Product and pricing admin helpers |
|
|
94
94
|
| `cfo` | CFO-facing reporting endpoints |
|
|
@@ -146,7 +146,7 @@ console.log(`/${link.app_slug}/${link.username}/${link.slug}`);
|
|
|
146
146
|
|
|
147
147
|
### Skill Evals
|
|
148
148
|
|
|
149
|
-
Use `skillEvals` for SPAPS-owned blind
|
|
149
|
+
Use `skillEvals` for SPAPS-owned blind review of agent-skill logs. Paid creation uses the same `PAYMENT-SIGNATURE` header shape as the x402 namespace. Reviewers submit `valuable` and `not_valuable` marks, and submitters read those marks through an insight inbox before applying skill changes.
|
|
150
150
|
|
|
151
151
|
```ts
|
|
152
152
|
const signedPayment = "base64-x402-payment";
|
|
@@ -163,7 +163,13 @@ const created = await spaps.skillEvals.createCase(
|
|
|
163
163
|
evidence_summary: "Validation passed",
|
|
164
164
|
artifact_hash: "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
165
165
|
artifact_mime: "text/markdown",
|
|
166
|
+
jsonl_log_ref: "spaps-artifact://logs/a.jsonl",
|
|
167
|
+
jsonl_log_hash: "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
168
|
+
skill_ref: "skill://docs-review",
|
|
169
|
+
skill_version_ref: "skill://docs-review/v2.0",
|
|
166
170
|
skill_version_digest: "sha256:1111111111111111111111111111111111111111111111111111111111111111",
|
|
171
|
+
model_id: "openai/gpt-5.4",
|
|
172
|
+
effort_level: "medium",
|
|
167
173
|
provenance_ref: "skill://private/a",
|
|
168
174
|
},
|
|
169
175
|
{
|
|
@@ -172,10 +178,21 @@ const created = await spaps.skillEvals.createCase(
|
|
|
172
178
|
evidence_summary: "Validation passed",
|
|
173
179
|
artifact_hash: "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
174
180
|
artifact_mime: "text/markdown",
|
|
181
|
+
jsonl_log_ref: "spaps-artifact://logs/b.jsonl",
|
|
182
|
+
jsonl_log_hash: "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
183
|
+
skill_ref: "skill://docs-review",
|
|
184
|
+
skill_version_ref: "skill://docs-review/v2.1",
|
|
175
185
|
skill_version_digest: "sha256:2222222222222222222222222222222222222222222222222222222222222222",
|
|
186
|
+
model_id: "openai/gpt-5.4",
|
|
187
|
+
effort_level: "medium",
|
|
176
188
|
provenance_ref: "skill://private/b",
|
|
177
189
|
},
|
|
178
190
|
],
|
|
191
|
+
case_policy: {
|
|
192
|
+
access_mode: "team_private",
|
|
193
|
+
allowed_model_efforts: [{ model_id: "openai/gpt-5.4", effort_level: "medium" }],
|
|
194
|
+
participant_allowlist: ["reviewer-actor-id"],
|
|
195
|
+
},
|
|
179
196
|
idempotency_key: "eval-create-001",
|
|
180
197
|
},
|
|
181
198
|
{ paymentSignature: signedPayment }
|
|
@@ -183,6 +200,35 @@ const created = await spaps.skillEvals.createCase(
|
|
|
183
200
|
|
|
184
201
|
const room = await spaps.skillEvals.getReviewRoom(created.case_id);
|
|
185
202
|
console.log(room.reviewer_state);
|
|
203
|
+
|
|
204
|
+
const review = await spaps.skillEvals.submitReview(created.case_id, {
|
|
205
|
+
review_marks: [
|
|
206
|
+
{
|
|
207
|
+
candidate_id: "B",
|
|
208
|
+
kind: "valuable",
|
|
209
|
+
note: "B checks the configured docs path before recommending an edit.",
|
|
210
|
+
reason_code: "prevents_wrong_repo_patch",
|
|
211
|
+
confidence: "high",
|
|
212
|
+
criterion: "Finds repo boundaries",
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
const inbox = await spaps.skillEvals.getInsights(created.case_id);
|
|
218
|
+
console.log(inbox.valuable[0]?.jsonl_log_ref, review.review_mark_counts);
|
|
219
|
+
|
|
220
|
+
await spaps.skillEvals.respondToReview(created.case_id, inbox.valuable[0].source_review_id, {
|
|
221
|
+
response: "applied",
|
|
222
|
+
reason: "Updated the skill from the concrete log-backed insight.",
|
|
223
|
+
applied_insight_ref: inbox.valuable[0].insight_ref,
|
|
224
|
+
skill_change_ref: "skill://docs-review/v2.1",
|
|
225
|
+
skill_version_before: "skill://docs-review/v2.0",
|
|
226
|
+
skill_version_after: "skill://docs-review/v2.1",
|
|
227
|
+
jsonl_log_ref: "spaps-artifact://logs/apply.jsonl",
|
|
228
|
+
jsonl_log_hash: "sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
229
|
+
model_id: "openai/gpt-5.4",
|
|
230
|
+
effort_level: "medium",
|
|
231
|
+
});
|
|
186
232
|
```
|
|
187
233
|
|
|
188
234
|
### Custom Context Headers
|
|
@@ -319,7 +365,7 @@ npm run test:readme
|
|
|
319
365
|
## Metadata
|
|
320
366
|
|
|
321
367
|
- `package_name`: `spaps-sdk`
|
|
322
|
-
- `latest_version`: `1.
|
|
368
|
+
- `latest_version`: `1.7.0`
|
|
323
369
|
- `minimum_runtime`: `Node.js >=14.0.0`
|
|
324
370
|
- `api_base_url`: `https://api.sweetpotato.dev`
|
|
325
371
|
|
package/dist/index.d.mts
CHANGED
|
@@ -383,8 +383,10 @@ interface X402VerifyHandoffOptions {
|
|
|
383
383
|
type SkillEvalDisclosurePolicy = 'blind_then_controlled_reveal';
|
|
384
384
|
type SkillEvalEligibilitySource = 'admin_assigned' | 'entitlement' | 'policy_import' | 'manual_override';
|
|
385
385
|
type SkillEvalConfidence = 'low' | 'medium' | 'high';
|
|
386
|
+
type SkillEvalReviewMarkKind = 'valuable' | 'not_valuable';
|
|
386
387
|
type SkillEvalPosterResponse = 'accepted' | 'rejected' | 'needs_clarification' | 'applied';
|
|
387
388
|
type SkillEvalRevealField = 'skill_version_digest' | 'provenance_ref';
|
|
389
|
+
type SkillEvalAccessMode = 'public' | 'team_private';
|
|
388
390
|
type SkillEvalGovernancePurpose = 'adopt_skill' | 'retire_skill' | 'merge_skill' | 'split_skill' | 'reviewer_policy' | 'fund_bounty';
|
|
389
391
|
interface SkillEvalCandidateInput {
|
|
390
392
|
candidate_id: string;
|
|
@@ -392,12 +394,33 @@ interface SkillEvalCandidateInput {
|
|
|
392
394
|
evidence_summary: string;
|
|
393
395
|
artifact_hash: string;
|
|
394
396
|
artifact_mime: string;
|
|
397
|
+
jsonl_log_ref: string;
|
|
398
|
+
jsonl_log_hash: string;
|
|
399
|
+
skill_ref: string;
|
|
400
|
+
skill_version_ref: string;
|
|
395
401
|
skill_version_digest: string;
|
|
402
|
+
model_id: string;
|
|
403
|
+
effort_level: string;
|
|
396
404
|
provenance_ref: string;
|
|
397
405
|
}
|
|
406
|
+
interface SkillEvalModelEffort {
|
|
407
|
+
model_id: string;
|
|
408
|
+
effort_level: string;
|
|
409
|
+
}
|
|
410
|
+
interface SkillEvalCasePolicy {
|
|
411
|
+
access_mode?: SkillEvalAccessMode;
|
|
412
|
+
allowed_model_efforts: SkillEvalModelEffort[];
|
|
413
|
+
min_contribution_score?: number | null;
|
|
414
|
+
contribution_score_source_ref?: string | null;
|
|
415
|
+
viewer_allowlist?: string[];
|
|
416
|
+
skill_user_allowlist?: string[];
|
|
417
|
+
participant_allowlist?: string[];
|
|
418
|
+
}
|
|
398
419
|
interface SkillEvalReviewerEligibilityInput {
|
|
399
420
|
reviewer_actor_id: string;
|
|
400
421
|
eligibility_source?: SkillEvalEligibilitySource;
|
|
422
|
+
contribution_score?: number | null;
|
|
423
|
+
contribution_score_source_ref?: string | null;
|
|
401
424
|
}
|
|
402
425
|
interface CreateSkillEvalCaseRequest {
|
|
403
426
|
title: string;
|
|
@@ -405,6 +428,7 @@ interface CreateSkillEvalCaseRequest {
|
|
|
405
428
|
success_criteria: string[];
|
|
406
429
|
candidates: SkillEvalCandidateInput[];
|
|
407
430
|
disclosure_policy?: SkillEvalDisclosurePolicy;
|
|
431
|
+
case_policy: SkillEvalCasePolicy;
|
|
408
432
|
idempotency_key: string;
|
|
409
433
|
reviewer_eligibility?: SkillEvalReviewerEligibilityInput[];
|
|
410
434
|
}
|
|
@@ -423,6 +447,9 @@ interface SkillEvalCaseResponse {
|
|
|
423
447
|
x402_receipt_id?: string | null;
|
|
424
448
|
payload_fingerprint?: string;
|
|
425
449
|
case_version: number;
|
|
450
|
+
access_mode?: SkillEvalAccessMode;
|
|
451
|
+
case_policy?: SkillEvalCasePolicy;
|
|
452
|
+
actor_access?: SkillEvalActorAccess;
|
|
426
453
|
created_at?: string | null;
|
|
427
454
|
updated_at?: string | null;
|
|
428
455
|
idempotent_replay?: boolean;
|
|
@@ -431,6 +458,11 @@ interface SkillEvalCaseResponse {
|
|
|
431
458
|
success_criteria?: string[];
|
|
432
459
|
candidates?: SkillEvalCandidateResponse[];
|
|
433
460
|
}
|
|
461
|
+
interface SkillEvalActorAccess {
|
|
462
|
+
can_view: boolean;
|
|
463
|
+
can_use_skill: boolean;
|
|
464
|
+
can_participate: boolean;
|
|
465
|
+
}
|
|
434
466
|
interface SkillEvalCandidateResponse {
|
|
435
467
|
candidate_id: string;
|
|
436
468
|
output_ref: string;
|
|
@@ -439,6 +471,10 @@ interface SkillEvalCandidateResponse {
|
|
|
439
471
|
artifact_mime: string;
|
|
440
472
|
skill_version_digest?: string;
|
|
441
473
|
provenance_ref?: string;
|
|
474
|
+
jsonl_log_ref?: string;
|
|
475
|
+
jsonl_log_hash?: string;
|
|
476
|
+
model_id?: string;
|
|
477
|
+
effort_level?: string;
|
|
442
478
|
}
|
|
443
479
|
interface SkillEvalReviewRoom {
|
|
444
480
|
case_id: string;
|
|
@@ -447,14 +483,24 @@ interface SkillEvalReviewRoom {
|
|
|
447
483
|
success_criteria: string[];
|
|
448
484
|
candidates: SkillEvalCandidateResponse[];
|
|
449
485
|
reviewer_state: string;
|
|
486
|
+
actor_access?: SkillEvalActorAccess;
|
|
450
487
|
case_version: number;
|
|
451
488
|
}
|
|
489
|
+
interface SkillEvalReviewMarkInput {
|
|
490
|
+
candidate_id: string;
|
|
491
|
+
kind: SkillEvalReviewMarkKind;
|
|
492
|
+
note: string;
|
|
493
|
+
reason_code: string;
|
|
494
|
+
confidence: SkillEvalConfidence;
|
|
495
|
+
criterion?: string | null;
|
|
496
|
+
}
|
|
452
497
|
interface SubmitSkillEvalReviewRequest {
|
|
453
|
-
winner_candidate_id
|
|
454
|
-
rationale
|
|
455
|
-
missing_from_winner
|
|
498
|
+
winner_candidate_id?: string | null;
|
|
499
|
+
rationale?: string | null;
|
|
500
|
+
missing_from_winner?: string | null;
|
|
456
501
|
criteria_challenge?: string | null;
|
|
457
|
-
confidence
|
|
502
|
+
confidence?: SkillEvalConfidence | null;
|
|
503
|
+
review_marks?: SkillEvalReviewMarkInput[];
|
|
458
504
|
}
|
|
459
505
|
interface SkillEvalRewardEvent {
|
|
460
506
|
reward_event_id?: string;
|
|
@@ -463,17 +509,77 @@ interface SkillEvalRewardEvent {
|
|
|
463
509
|
interface SkillEvalReviewResponse {
|
|
464
510
|
review_id: string;
|
|
465
511
|
status: string;
|
|
512
|
+
review_mark_counts?: {
|
|
513
|
+
valuable: number;
|
|
514
|
+
not_valuable: number;
|
|
515
|
+
};
|
|
466
516
|
reward_event?: SkillEvalRewardEvent | null;
|
|
467
517
|
}
|
|
518
|
+
interface SkillEvalInsight {
|
|
519
|
+
insight_ref: string;
|
|
520
|
+
mark_id?: string | null;
|
|
521
|
+
source_review_id: string;
|
|
522
|
+
reviewer_actor_id?: string | null;
|
|
523
|
+
source_review_created_at?: string | null;
|
|
524
|
+
candidate_id: string;
|
|
525
|
+
kind: SkillEvalReviewMarkKind;
|
|
526
|
+
note: string;
|
|
527
|
+
reason_code: string;
|
|
528
|
+
confidence: SkillEvalConfidence;
|
|
529
|
+
criterion?: string | null;
|
|
530
|
+
jsonl_log_ref: string;
|
|
531
|
+
jsonl_log_hash: string;
|
|
532
|
+
source_candidate?: {
|
|
533
|
+
output_ref?: string | null;
|
|
534
|
+
evidence_summary?: string | null;
|
|
535
|
+
artifact_hash?: string | null;
|
|
536
|
+
artifact_mime?: string | null;
|
|
537
|
+
model_id?: string | null;
|
|
538
|
+
effort_level?: string | null;
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
interface SkillEvalInsightsResponse {
|
|
542
|
+
case_id: string;
|
|
543
|
+
status?: string;
|
|
544
|
+
task_claim?: string;
|
|
545
|
+
success_criteria?: string[];
|
|
546
|
+
case_version?: number;
|
|
547
|
+
valuable: SkillEvalInsight[];
|
|
548
|
+
not_valuable: SkillEvalInsight[];
|
|
549
|
+
counts?: {
|
|
550
|
+
valuable: number;
|
|
551
|
+
not_valuable: number;
|
|
552
|
+
};
|
|
553
|
+
visibility_policy?: {
|
|
554
|
+
access_mode?: SkillEvalAccessMode;
|
|
555
|
+
actor_access?: SkillEvalActorAccess;
|
|
556
|
+
reviewer_identity_visible?: boolean;
|
|
557
|
+
case_policy?: SkillEvalCasePolicy;
|
|
558
|
+
};
|
|
559
|
+
}
|
|
468
560
|
interface RespondToSkillEvalReviewRequest {
|
|
469
561
|
response: SkillEvalPosterResponse;
|
|
470
562
|
reason: string;
|
|
563
|
+
applied_insight_ref?: string | null;
|
|
471
564
|
skill_change_ref?: string | null;
|
|
565
|
+
skill_version_before?: string | null;
|
|
566
|
+
skill_version_after?: string | null;
|
|
567
|
+
jsonl_log_ref?: string | null;
|
|
568
|
+
jsonl_log_hash?: string | null;
|
|
569
|
+
model_id?: string | null;
|
|
570
|
+
effort_level?: string | null;
|
|
472
571
|
}
|
|
473
572
|
interface SkillEvalPosterResponseResult {
|
|
474
573
|
response_id: string;
|
|
475
574
|
response: SkillEvalPosterResponse;
|
|
575
|
+
applied_insight_ref?: string | null;
|
|
476
576
|
skill_change_ref?: string | null;
|
|
577
|
+
skill_version_before?: string | null;
|
|
578
|
+
skill_version_after?: string | null;
|
|
579
|
+
jsonl_log_ref?: string | null;
|
|
580
|
+
jsonl_log_hash?: string | null;
|
|
581
|
+
model_id?: string | null;
|
|
582
|
+
effort_level?: string | null;
|
|
477
583
|
reward_event?: SkillEvalRewardEvent | null;
|
|
478
584
|
}
|
|
479
585
|
interface RevealSkillEvalEvidenceRequest {
|
|
@@ -948,6 +1054,7 @@ declare class SPAPSClient<SecureMessageMetadata extends Record<string, any> = Re
|
|
|
948
1054
|
createCase: (payload: CreateSkillEvalCaseRequest, options?: SkillEvalCreateOptions) => Promise<SkillEvalCaseResponse>;
|
|
949
1055
|
getCase: (caseId: string) => Promise<SkillEvalCaseResponse>;
|
|
950
1056
|
getReviewRoom: (caseId: string) => Promise<SkillEvalReviewRoom>;
|
|
1057
|
+
getInsights: (caseId: string) => Promise<SkillEvalInsightsResponse>;
|
|
951
1058
|
submitReview: (caseId: string, payload: SubmitSkillEvalReviewRequest, options?: SkillEvalMutationOptions) => Promise<SkillEvalReviewResponse>;
|
|
952
1059
|
respondToReview: (caseId: string, reviewId: string, payload: RespondToSkillEvalReviewRequest, options?: SkillEvalMutationOptions) => Promise<SkillEvalPosterResponseResult>;
|
|
953
1060
|
lockReviews: (caseId: string, options?: SkillEvalMutationOptions) => Promise<SkillEvalCaseResponse>;
|
|
@@ -1176,4 +1283,4 @@ declare function createServerClient(secretKey: string, options?: Omit<SPAPSConfi
|
|
|
1176
1283
|
*/
|
|
1177
1284
|
declare function detectKeyType(key: string): ApiKeyType | null;
|
|
1178
1285
|
|
|
1179
|
-
export { type AdminConfig, type ApiKeyType, type CheckoutLineItem, type CheckoutLineItemPriceData, type CreateCheckoutSessionPayload, type CreateSkillEvalCaseRequest, type CreateSkillEvalGovernanceSnapshotRequest, DEFAULT_ADMIN_ACCOUNTS, type EmailSendOptions, type EmailSendResult, type EmailTemplate, type EmailTemplatePreview, type EntitlementCheckResult, type EntitlementListParams, type FeatureContext, type FeatureDefinition, FeatureEvaluator, type HeaderProvider, type ImportSkillEvalGovernanceOutcomeRequest, type IssueReportListParams, type IssueReportStatusParams, type PermissionCheckResult, PermissionChecker, type RespondToSkillEvalReviewRequest, type RevealSkillEvalEvidenceRequest, RoleHierarchy, SPAPSClient as SPAPS, SPAPSClient, type SPAPSConfig, type SPAPSEnvelope, type SkillEvalCandidateInput, type SkillEvalCandidateResponse, type SkillEvalCaseResponse, type SkillEvalConfidence, type SkillEvalCreateOptions, type SkillEvalDisclosurePolicy, type SkillEvalEligibilitySource, type SkillEvalGovernanceOutcomeResult, type SkillEvalGovernancePurpose, type SkillEvalGovernanceSnapshotResult, type SkillEvalMutationOptions, type SkillEvalPosterResponse, type SkillEvalPosterResponseResult, type SkillEvalRevealField, type SkillEvalRevealResult, type SkillEvalReviewResponse, type SkillEvalReviewRoom, type SkillEvalReviewerEligibilityInput, type SkillEvalRewardEvent, type SubmitSkillEvalReviewRequest, type TemplateVariable, TokenManager, WalletUtils, WebSocketAuthHelper, type WebSocketAuthHelperConfig, type X402ExecuteActionOptions, X402PaymentRequiredSDKError, type X402ReceiptListParams, type X402VerifyHandoffOptions, canAccessAdmin, createBrowserClient, createPermissionChecker, createServerClient, SPAPSClient as default, defaultPermissionChecker, detectKeyType, getRoleAwareErrorMessage, getUserDisplay, getUserRole, hasPermission, isAdminAccount, isEnvelope, isErrorEnvelope, isSuccessEnvelope, unwrapEnvelope, unwrapNestedData, verifyCryptoWebhookSignature };
|
|
1286
|
+
export { type AdminConfig, type ApiKeyType, type CheckoutLineItem, type CheckoutLineItemPriceData, type CreateCheckoutSessionPayload, type CreateSkillEvalCaseRequest, type CreateSkillEvalGovernanceSnapshotRequest, DEFAULT_ADMIN_ACCOUNTS, type EmailSendOptions, type EmailSendResult, type EmailTemplate, type EmailTemplatePreview, type EntitlementCheckResult, type EntitlementListParams, type FeatureContext, type FeatureDefinition, FeatureEvaluator, type HeaderProvider, type ImportSkillEvalGovernanceOutcomeRequest, type IssueReportListParams, type IssueReportStatusParams, type PermissionCheckResult, PermissionChecker, type RespondToSkillEvalReviewRequest, type RevealSkillEvalEvidenceRequest, RoleHierarchy, SPAPSClient as SPAPS, SPAPSClient, type SPAPSConfig, type SPAPSEnvelope, type SkillEvalAccessMode, type SkillEvalActorAccess, type SkillEvalCandidateInput, type SkillEvalCandidateResponse, type SkillEvalCasePolicy, type SkillEvalCaseResponse, type SkillEvalConfidence, type SkillEvalCreateOptions, type SkillEvalDisclosurePolicy, type SkillEvalEligibilitySource, type SkillEvalGovernanceOutcomeResult, type SkillEvalGovernancePurpose, type SkillEvalGovernanceSnapshotResult, type SkillEvalInsight, type SkillEvalInsightsResponse, type SkillEvalModelEffort, type SkillEvalMutationOptions, type SkillEvalPosterResponse, type SkillEvalPosterResponseResult, type SkillEvalRevealField, type SkillEvalRevealResult, type SkillEvalReviewMarkInput, type SkillEvalReviewMarkKind, type SkillEvalReviewResponse, type SkillEvalReviewRoom, type SkillEvalReviewerEligibilityInput, type SkillEvalRewardEvent, type SubmitSkillEvalReviewRequest, type TemplateVariable, TokenManager, WalletUtils, WebSocketAuthHelper, type WebSocketAuthHelperConfig, type X402ExecuteActionOptions, X402PaymentRequiredSDKError, type X402ReceiptListParams, type X402VerifyHandoffOptions, canAccessAdmin, createBrowserClient, createPermissionChecker, createServerClient, SPAPSClient as default, defaultPermissionChecker, detectKeyType, getRoleAwareErrorMessage, getUserDisplay, getUserRole, hasPermission, isAdminAccount, isEnvelope, isErrorEnvelope, isSuccessEnvelope, unwrapEnvelope, unwrapNestedData, verifyCryptoWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -383,8 +383,10 @@ interface X402VerifyHandoffOptions {
|
|
|
383
383
|
type SkillEvalDisclosurePolicy = 'blind_then_controlled_reveal';
|
|
384
384
|
type SkillEvalEligibilitySource = 'admin_assigned' | 'entitlement' | 'policy_import' | 'manual_override';
|
|
385
385
|
type SkillEvalConfidence = 'low' | 'medium' | 'high';
|
|
386
|
+
type SkillEvalReviewMarkKind = 'valuable' | 'not_valuable';
|
|
386
387
|
type SkillEvalPosterResponse = 'accepted' | 'rejected' | 'needs_clarification' | 'applied';
|
|
387
388
|
type SkillEvalRevealField = 'skill_version_digest' | 'provenance_ref';
|
|
389
|
+
type SkillEvalAccessMode = 'public' | 'team_private';
|
|
388
390
|
type SkillEvalGovernancePurpose = 'adopt_skill' | 'retire_skill' | 'merge_skill' | 'split_skill' | 'reviewer_policy' | 'fund_bounty';
|
|
389
391
|
interface SkillEvalCandidateInput {
|
|
390
392
|
candidate_id: string;
|
|
@@ -392,12 +394,33 @@ interface SkillEvalCandidateInput {
|
|
|
392
394
|
evidence_summary: string;
|
|
393
395
|
artifact_hash: string;
|
|
394
396
|
artifact_mime: string;
|
|
397
|
+
jsonl_log_ref: string;
|
|
398
|
+
jsonl_log_hash: string;
|
|
399
|
+
skill_ref: string;
|
|
400
|
+
skill_version_ref: string;
|
|
395
401
|
skill_version_digest: string;
|
|
402
|
+
model_id: string;
|
|
403
|
+
effort_level: string;
|
|
396
404
|
provenance_ref: string;
|
|
397
405
|
}
|
|
406
|
+
interface SkillEvalModelEffort {
|
|
407
|
+
model_id: string;
|
|
408
|
+
effort_level: string;
|
|
409
|
+
}
|
|
410
|
+
interface SkillEvalCasePolicy {
|
|
411
|
+
access_mode?: SkillEvalAccessMode;
|
|
412
|
+
allowed_model_efforts: SkillEvalModelEffort[];
|
|
413
|
+
min_contribution_score?: number | null;
|
|
414
|
+
contribution_score_source_ref?: string | null;
|
|
415
|
+
viewer_allowlist?: string[];
|
|
416
|
+
skill_user_allowlist?: string[];
|
|
417
|
+
participant_allowlist?: string[];
|
|
418
|
+
}
|
|
398
419
|
interface SkillEvalReviewerEligibilityInput {
|
|
399
420
|
reviewer_actor_id: string;
|
|
400
421
|
eligibility_source?: SkillEvalEligibilitySource;
|
|
422
|
+
contribution_score?: number | null;
|
|
423
|
+
contribution_score_source_ref?: string | null;
|
|
401
424
|
}
|
|
402
425
|
interface CreateSkillEvalCaseRequest {
|
|
403
426
|
title: string;
|
|
@@ -405,6 +428,7 @@ interface CreateSkillEvalCaseRequest {
|
|
|
405
428
|
success_criteria: string[];
|
|
406
429
|
candidates: SkillEvalCandidateInput[];
|
|
407
430
|
disclosure_policy?: SkillEvalDisclosurePolicy;
|
|
431
|
+
case_policy: SkillEvalCasePolicy;
|
|
408
432
|
idempotency_key: string;
|
|
409
433
|
reviewer_eligibility?: SkillEvalReviewerEligibilityInput[];
|
|
410
434
|
}
|
|
@@ -423,6 +447,9 @@ interface SkillEvalCaseResponse {
|
|
|
423
447
|
x402_receipt_id?: string | null;
|
|
424
448
|
payload_fingerprint?: string;
|
|
425
449
|
case_version: number;
|
|
450
|
+
access_mode?: SkillEvalAccessMode;
|
|
451
|
+
case_policy?: SkillEvalCasePolicy;
|
|
452
|
+
actor_access?: SkillEvalActorAccess;
|
|
426
453
|
created_at?: string | null;
|
|
427
454
|
updated_at?: string | null;
|
|
428
455
|
idempotent_replay?: boolean;
|
|
@@ -431,6 +458,11 @@ interface SkillEvalCaseResponse {
|
|
|
431
458
|
success_criteria?: string[];
|
|
432
459
|
candidates?: SkillEvalCandidateResponse[];
|
|
433
460
|
}
|
|
461
|
+
interface SkillEvalActorAccess {
|
|
462
|
+
can_view: boolean;
|
|
463
|
+
can_use_skill: boolean;
|
|
464
|
+
can_participate: boolean;
|
|
465
|
+
}
|
|
434
466
|
interface SkillEvalCandidateResponse {
|
|
435
467
|
candidate_id: string;
|
|
436
468
|
output_ref: string;
|
|
@@ -439,6 +471,10 @@ interface SkillEvalCandidateResponse {
|
|
|
439
471
|
artifact_mime: string;
|
|
440
472
|
skill_version_digest?: string;
|
|
441
473
|
provenance_ref?: string;
|
|
474
|
+
jsonl_log_ref?: string;
|
|
475
|
+
jsonl_log_hash?: string;
|
|
476
|
+
model_id?: string;
|
|
477
|
+
effort_level?: string;
|
|
442
478
|
}
|
|
443
479
|
interface SkillEvalReviewRoom {
|
|
444
480
|
case_id: string;
|
|
@@ -447,14 +483,24 @@ interface SkillEvalReviewRoom {
|
|
|
447
483
|
success_criteria: string[];
|
|
448
484
|
candidates: SkillEvalCandidateResponse[];
|
|
449
485
|
reviewer_state: string;
|
|
486
|
+
actor_access?: SkillEvalActorAccess;
|
|
450
487
|
case_version: number;
|
|
451
488
|
}
|
|
489
|
+
interface SkillEvalReviewMarkInput {
|
|
490
|
+
candidate_id: string;
|
|
491
|
+
kind: SkillEvalReviewMarkKind;
|
|
492
|
+
note: string;
|
|
493
|
+
reason_code: string;
|
|
494
|
+
confidence: SkillEvalConfidence;
|
|
495
|
+
criterion?: string | null;
|
|
496
|
+
}
|
|
452
497
|
interface SubmitSkillEvalReviewRequest {
|
|
453
|
-
winner_candidate_id
|
|
454
|
-
rationale
|
|
455
|
-
missing_from_winner
|
|
498
|
+
winner_candidate_id?: string | null;
|
|
499
|
+
rationale?: string | null;
|
|
500
|
+
missing_from_winner?: string | null;
|
|
456
501
|
criteria_challenge?: string | null;
|
|
457
|
-
confidence
|
|
502
|
+
confidence?: SkillEvalConfidence | null;
|
|
503
|
+
review_marks?: SkillEvalReviewMarkInput[];
|
|
458
504
|
}
|
|
459
505
|
interface SkillEvalRewardEvent {
|
|
460
506
|
reward_event_id?: string;
|
|
@@ -463,17 +509,77 @@ interface SkillEvalRewardEvent {
|
|
|
463
509
|
interface SkillEvalReviewResponse {
|
|
464
510
|
review_id: string;
|
|
465
511
|
status: string;
|
|
512
|
+
review_mark_counts?: {
|
|
513
|
+
valuable: number;
|
|
514
|
+
not_valuable: number;
|
|
515
|
+
};
|
|
466
516
|
reward_event?: SkillEvalRewardEvent | null;
|
|
467
517
|
}
|
|
518
|
+
interface SkillEvalInsight {
|
|
519
|
+
insight_ref: string;
|
|
520
|
+
mark_id?: string | null;
|
|
521
|
+
source_review_id: string;
|
|
522
|
+
reviewer_actor_id?: string | null;
|
|
523
|
+
source_review_created_at?: string | null;
|
|
524
|
+
candidate_id: string;
|
|
525
|
+
kind: SkillEvalReviewMarkKind;
|
|
526
|
+
note: string;
|
|
527
|
+
reason_code: string;
|
|
528
|
+
confidence: SkillEvalConfidence;
|
|
529
|
+
criterion?: string | null;
|
|
530
|
+
jsonl_log_ref: string;
|
|
531
|
+
jsonl_log_hash: string;
|
|
532
|
+
source_candidate?: {
|
|
533
|
+
output_ref?: string | null;
|
|
534
|
+
evidence_summary?: string | null;
|
|
535
|
+
artifact_hash?: string | null;
|
|
536
|
+
artifact_mime?: string | null;
|
|
537
|
+
model_id?: string | null;
|
|
538
|
+
effort_level?: string | null;
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
interface SkillEvalInsightsResponse {
|
|
542
|
+
case_id: string;
|
|
543
|
+
status?: string;
|
|
544
|
+
task_claim?: string;
|
|
545
|
+
success_criteria?: string[];
|
|
546
|
+
case_version?: number;
|
|
547
|
+
valuable: SkillEvalInsight[];
|
|
548
|
+
not_valuable: SkillEvalInsight[];
|
|
549
|
+
counts?: {
|
|
550
|
+
valuable: number;
|
|
551
|
+
not_valuable: number;
|
|
552
|
+
};
|
|
553
|
+
visibility_policy?: {
|
|
554
|
+
access_mode?: SkillEvalAccessMode;
|
|
555
|
+
actor_access?: SkillEvalActorAccess;
|
|
556
|
+
reviewer_identity_visible?: boolean;
|
|
557
|
+
case_policy?: SkillEvalCasePolicy;
|
|
558
|
+
};
|
|
559
|
+
}
|
|
468
560
|
interface RespondToSkillEvalReviewRequest {
|
|
469
561
|
response: SkillEvalPosterResponse;
|
|
470
562
|
reason: string;
|
|
563
|
+
applied_insight_ref?: string | null;
|
|
471
564
|
skill_change_ref?: string | null;
|
|
565
|
+
skill_version_before?: string | null;
|
|
566
|
+
skill_version_after?: string | null;
|
|
567
|
+
jsonl_log_ref?: string | null;
|
|
568
|
+
jsonl_log_hash?: string | null;
|
|
569
|
+
model_id?: string | null;
|
|
570
|
+
effort_level?: string | null;
|
|
472
571
|
}
|
|
473
572
|
interface SkillEvalPosterResponseResult {
|
|
474
573
|
response_id: string;
|
|
475
574
|
response: SkillEvalPosterResponse;
|
|
575
|
+
applied_insight_ref?: string | null;
|
|
476
576
|
skill_change_ref?: string | null;
|
|
577
|
+
skill_version_before?: string | null;
|
|
578
|
+
skill_version_after?: string | null;
|
|
579
|
+
jsonl_log_ref?: string | null;
|
|
580
|
+
jsonl_log_hash?: string | null;
|
|
581
|
+
model_id?: string | null;
|
|
582
|
+
effort_level?: string | null;
|
|
477
583
|
reward_event?: SkillEvalRewardEvent | null;
|
|
478
584
|
}
|
|
479
585
|
interface RevealSkillEvalEvidenceRequest {
|
|
@@ -948,6 +1054,7 @@ declare class SPAPSClient<SecureMessageMetadata extends Record<string, any> = Re
|
|
|
948
1054
|
createCase: (payload: CreateSkillEvalCaseRequest, options?: SkillEvalCreateOptions) => Promise<SkillEvalCaseResponse>;
|
|
949
1055
|
getCase: (caseId: string) => Promise<SkillEvalCaseResponse>;
|
|
950
1056
|
getReviewRoom: (caseId: string) => Promise<SkillEvalReviewRoom>;
|
|
1057
|
+
getInsights: (caseId: string) => Promise<SkillEvalInsightsResponse>;
|
|
951
1058
|
submitReview: (caseId: string, payload: SubmitSkillEvalReviewRequest, options?: SkillEvalMutationOptions) => Promise<SkillEvalReviewResponse>;
|
|
952
1059
|
respondToReview: (caseId: string, reviewId: string, payload: RespondToSkillEvalReviewRequest, options?: SkillEvalMutationOptions) => Promise<SkillEvalPosterResponseResult>;
|
|
953
1060
|
lockReviews: (caseId: string, options?: SkillEvalMutationOptions) => Promise<SkillEvalCaseResponse>;
|
|
@@ -1176,4 +1283,4 @@ declare function createServerClient(secretKey: string, options?: Omit<SPAPSConfi
|
|
|
1176
1283
|
*/
|
|
1177
1284
|
declare function detectKeyType(key: string): ApiKeyType | null;
|
|
1178
1285
|
|
|
1179
|
-
export { type AdminConfig, type ApiKeyType, type CheckoutLineItem, type CheckoutLineItemPriceData, type CreateCheckoutSessionPayload, type CreateSkillEvalCaseRequest, type CreateSkillEvalGovernanceSnapshotRequest, DEFAULT_ADMIN_ACCOUNTS, type EmailSendOptions, type EmailSendResult, type EmailTemplate, type EmailTemplatePreview, type EntitlementCheckResult, type EntitlementListParams, type FeatureContext, type FeatureDefinition, FeatureEvaluator, type HeaderProvider, type ImportSkillEvalGovernanceOutcomeRequest, type IssueReportListParams, type IssueReportStatusParams, type PermissionCheckResult, PermissionChecker, type RespondToSkillEvalReviewRequest, type RevealSkillEvalEvidenceRequest, RoleHierarchy, SPAPSClient as SPAPS, SPAPSClient, type SPAPSConfig, type SPAPSEnvelope, type SkillEvalCandidateInput, type SkillEvalCandidateResponse, type SkillEvalCaseResponse, type SkillEvalConfidence, type SkillEvalCreateOptions, type SkillEvalDisclosurePolicy, type SkillEvalEligibilitySource, type SkillEvalGovernanceOutcomeResult, type SkillEvalGovernancePurpose, type SkillEvalGovernanceSnapshotResult, type SkillEvalMutationOptions, type SkillEvalPosterResponse, type SkillEvalPosterResponseResult, type SkillEvalRevealField, type SkillEvalRevealResult, type SkillEvalReviewResponse, type SkillEvalReviewRoom, type SkillEvalReviewerEligibilityInput, type SkillEvalRewardEvent, type SubmitSkillEvalReviewRequest, type TemplateVariable, TokenManager, WalletUtils, WebSocketAuthHelper, type WebSocketAuthHelperConfig, type X402ExecuteActionOptions, X402PaymentRequiredSDKError, type X402ReceiptListParams, type X402VerifyHandoffOptions, canAccessAdmin, createBrowserClient, createPermissionChecker, createServerClient, SPAPSClient as default, defaultPermissionChecker, detectKeyType, getRoleAwareErrorMessage, getUserDisplay, getUserRole, hasPermission, isAdminAccount, isEnvelope, isErrorEnvelope, isSuccessEnvelope, unwrapEnvelope, unwrapNestedData, verifyCryptoWebhookSignature };
|
|
1286
|
+
export { type AdminConfig, type ApiKeyType, type CheckoutLineItem, type CheckoutLineItemPriceData, type CreateCheckoutSessionPayload, type CreateSkillEvalCaseRequest, type CreateSkillEvalGovernanceSnapshotRequest, DEFAULT_ADMIN_ACCOUNTS, type EmailSendOptions, type EmailSendResult, type EmailTemplate, type EmailTemplatePreview, type EntitlementCheckResult, type EntitlementListParams, type FeatureContext, type FeatureDefinition, FeatureEvaluator, type HeaderProvider, type ImportSkillEvalGovernanceOutcomeRequest, type IssueReportListParams, type IssueReportStatusParams, type PermissionCheckResult, PermissionChecker, type RespondToSkillEvalReviewRequest, type RevealSkillEvalEvidenceRequest, RoleHierarchy, SPAPSClient as SPAPS, SPAPSClient, type SPAPSConfig, type SPAPSEnvelope, type SkillEvalAccessMode, type SkillEvalActorAccess, type SkillEvalCandidateInput, type SkillEvalCandidateResponse, type SkillEvalCasePolicy, type SkillEvalCaseResponse, type SkillEvalConfidence, type SkillEvalCreateOptions, type SkillEvalDisclosurePolicy, type SkillEvalEligibilitySource, type SkillEvalGovernanceOutcomeResult, type SkillEvalGovernancePurpose, type SkillEvalGovernanceSnapshotResult, type SkillEvalInsight, type SkillEvalInsightsResponse, type SkillEvalModelEffort, type SkillEvalMutationOptions, type SkillEvalPosterResponse, type SkillEvalPosterResponseResult, type SkillEvalRevealField, type SkillEvalRevealResult, type SkillEvalReviewMarkInput, type SkillEvalReviewMarkKind, type SkillEvalReviewResponse, type SkillEvalReviewRoom, type SkillEvalReviewerEligibilityInput, type SkillEvalRewardEvent, type SubmitSkillEvalReviewRequest, type TemplateVariable, TokenManager, WalletUtils, WebSocketAuthHelper, type WebSocketAuthHelperConfig, type X402ExecuteActionOptions, X402PaymentRequiredSDKError, type X402ReceiptListParams, type X402VerifyHandoffOptions, canAccessAdmin, createBrowserClient, createPermissionChecker, createServerClient, SPAPSClient as default, defaultPermissionChecker, detectKeyType, getRoleAwareErrorMessage, getUserDisplay, getUserRole, hasPermission, isAdminAccount, isEnvelope, isErrorEnvelope, isSuccessEnvelope, unwrapEnvelope, unwrapNestedData, verifyCryptoWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -1488,6 +1488,15 @@ var SPAPSClient = class _SPAPSClient {
|
|
|
1488
1488
|
);
|
|
1489
1489
|
return this.unwrapApiResponse(res, "Failed to get skill eval room");
|
|
1490
1490
|
},
|
|
1491
|
+
getInsights: async (caseId) => {
|
|
1492
|
+
const res = await this.client.get(
|
|
1493
|
+
`/api/skill-evals/cases/${encodeURIComponent(caseId)}/insights`
|
|
1494
|
+
);
|
|
1495
|
+
return this.unwrapApiResponse(
|
|
1496
|
+
res,
|
|
1497
|
+
"Failed to get skill eval insights"
|
|
1498
|
+
);
|
|
1499
|
+
},
|
|
1491
1500
|
submitReview: async (caseId, payload, options) => {
|
|
1492
1501
|
const config = this.skillEvalMutationConfig(options);
|
|
1493
1502
|
const res = await this.client.post(
|
package/dist/index.mjs
CHANGED
|
@@ -1453,6 +1453,15 @@ var SPAPSClient = class _SPAPSClient {
|
|
|
1453
1453
|
);
|
|
1454
1454
|
return this.unwrapApiResponse(res, "Failed to get skill eval room");
|
|
1455
1455
|
},
|
|
1456
|
+
getInsights: async (caseId) => {
|
|
1457
|
+
const res = await this.client.get(
|
|
1458
|
+
`/api/skill-evals/cases/${encodeURIComponent(caseId)}/insights`
|
|
1459
|
+
);
|
|
1460
|
+
return this.unwrapApiResponse(
|
|
1461
|
+
res,
|
|
1462
|
+
"Failed to get skill eval insights"
|
|
1463
|
+
);
|
|
1464
|
+
},
|
|
1456
1465
|
submitReview: async (caseId, payload, options) => {
|
|
1457
1466
|
const config = this.skillEvalMutationConfig(options);
|
|
1458
1467
|
const res = await this.client.post(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spaps-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Sweet Potato Authentication & Payment Service SDK - Zero-config client with built-in permission checking, role-based access control, and dayrate scheduling",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"axios": "^1.15.1",
|
|
53
53
|
"cross-fetch": "^4.0.0",
|
|
54
|
-
"spaps-types": "^1.
|
|
54
|
+
"spaps-types": "^1.2.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^20.10.0",
|