@runtypelabs/sdk 5.10.0 → 6.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/README.md +0 -2
- package/dist/index.cjs +226 -198
- package/dist/index.d.cts +7064 -2970
- package/dist/index.d.ts +7064 -2970
- package/dist/index.mjs +225 -197
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -27,7 +27,6 @@ __export(index_exports, {
|
|
|
27
27
|
AgentsNamespace: () => AgentsNamespace,
|
|
28
28
|
AnalyticsEndpoint: () => AnalyticsEndpoint,
|
|
29
29
|
ApiKeysEndpoint: () => ApiKeysEndpoint,
|
|
30
|
-
AppsEndpoint: () => AppsEndpoint,
|
|
31
30
|
BatchBuilder: () => BatchBuilder,
|
|
32
31
|
BatchesNamespace: () => BatchesNamespace,
|
|
33
32
|
BillingEndpoint: () => BillingEndpoint,
|
|
@@ -36,6 +35,7 @@ __export(index_exports, {
|
|
|
36
35
|
ClientEvalBuilder: () => ClientEvalBuilder,
|
|
37
36
|
ClientFlowBuilder: () => ClientFlowBuilder,
|
|
38
37
|
ClientTokensEndpoint: () => ClientTokensEndpoint,
|
|
38
|
+
CollectionsEndpoint: () => CollectionsEndpoint,
|
|
39
39
|
ContextTemplatesEndpoint: () => ContextTemplatesEndpoint,
|
|
40
40
|
ConversationsEndpoint: () => ConversationsEndpoint,
|
|
41
41
|
DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS: () => DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS,
|
|
@@ -1338,6 +1338,7 @@ var FlowBuilder = class {
|
|
|
1338
1338
|
markdownIfAvailable: config.markdownIfAvailable,
|
|
1339
1339
|
fetchMethod: config.fetchMethod === "http" ? "standard" : config.fetchMethod,
|
|
1340
1340
|
firecrawl: config.firecrawl,
|
|
1341
|
+
massive: config.massive,
|
|
1341
1342
|
outputVariable: config.outputVariable,
|
|
1342
1343
|
errorHandling: config.errorHandling,
|
|
1343
1344
|
defaultValue: config.defaultValue,
|
|
@@ -1473,7 +1474,10 @@ var FlowBuilder = class {
|
|
|
1473
1474
|
"send-stream",
|
|
1474
1475
|
config.name,
|
|
1475
1476
|
{
|
|
1476
|
-
message: config.message
|
|
1477
|
+
message: config.message,
|
|
1478
|
+
outputVariable: config.outputVariable,
|
|
1479
|
+
errorHandling: config.errorHandling,
|
|
1480
|
+
defaultValue: config.defaultValue
|
|
1477
1481
|
},
|
|
1478
1482
|
config.enabled,
|
|
1479
1483
|
config.when
|
|
@@ -1498,7 +1502,6 @@ var FlowBuilder = class {
|
|
|
1498
1502
|
fieldsToExclude: config.fieldsToExclude,
|
|
1499
1503
|
availableFields: config.availableFields,
|
|
1500
1504
|
outputVariable: config.outputVariable,
|
|
1501
|
-
fields: config.fields,
|
|
1502
1505
|
includeMetadata: config.includeMetadata,
|
|
1503
1506
|
streamOutput: config.streamOutput
|
|
1504
1507
|
},
|
|
@@ -1591,7 +1594,6 @@ var FlowBuilder = class {
|
|
|
1591
1594
|
vectorStore: config.vectorStore,
|
|
1592
1595
|
weaviateConfig: config.weaviateConfig,
|
|
1593
1596
|
vectorizeConfig: config.vectorizeConfig,
|
|
1594
|
-
pineconeConfig: config.pineconeConfig,
|
|
1595
1597
|
limit: config.limit,
|
|
1596
1598
|
threshold: config.threshold,
|
|
1597
1599
|
metadataFilters: config.metadataFilters,
|
|
@@ -1620,7 +1622,6 @@ var FlowBuilder = class {
|
|
|
1620
1622
|
recordType: config.recordType,
|
|
1621
1623
|
recordName: config.recordName,
|
|
1622
1624
|
textField: config.textField,
|
|
1623
|
-
storeInRecord: config.storeInRecord,
|
|
1624
1625
|
embeddingModel: config.embeddingModel,
|
|
1625
1626
|
maxLength: config.maxLength,
|
|
1626
1627
|
inputMode: config.inputMode,
|
|
@@ -1628,7 +1629,6 @@ var FlowBuilder = class {
|
|
|
1628
1629
|
itemAlias: config.itemAlias,
|
|
1629
1630
|
textTemplate: config.textTemplate,
|
|
1630
1631
|
batchSize: config.batchSize,
|
|
1631
|
-
vectorStore: config.vectorStore,
|
|
1632
1632
|
outputVariable: config.outputVariable,
|
|
1633
1633
|
streamOutput: config.streamOutput
|
|
1634
1634
|
},
|
|
@@ -1677,51 +1677,6 @@ var FlowBuilder = class {
|
|
|
1677
1677
|
);
|
|
1678
1678
|
return this;
|
|
1679
1679
|
}
|
|
1680
|
-
/**
|
|
1681
|
-
* Add a send text step
|
|
1682
|
-
*/
|
|
1683
|
-
sendText(config) {
|
|
1684
|
-
this.addStep(
|
|
1685
|
-
"send-text",
|
|
1686
|
-
config.name,
|
|
1687
|
-
{
|
|
1688
|
-
to: config.to,
|
|
1689
|
-
from: config.from,
|
|
1690
|
-
message: config.message,
|
|
1691
|
-
outputVariable: config.outputVariable,
|
|
1692
|
-
errorHandling: config.errorHandling,
|
|
1693
|
-
streamOutput: config.streamOutput
|
|
1694
|
-
},
|
|
1695
|
-
config.enabled,
|
|
1696
|
-
config.when
|
|
1697
|
-
);
|
|
1698
|
-
return this;
|
|
1699
|
-
}
|
|
1700
|
-
/**
|
|
1701
|
-
* Add a fetch GitHub step
|
|
1702
|
-
*/
|
|
1703
|
-
fetchGitHub(config) {
|
|
1704
|
-
this.addStep(
|
|
1705
|
-
"fetch-github",
|
|
1706
|
-
config.name,
|
|
1707
|
-
{
|
|
1708
|
-
repository: config.repository,
|
|
1709
|
-
branch: config.branch,
|
|
1710
|
-
path: config.path,
|
|
1711
|
-
token: config.token,
|
|
1712
|
-
outputVariable: config.outputVariable,
|
|
1713
|
-
contentType: config.contentType,
|
|
1714
|
-
includePatterns: config.includePatterns,
|
|
1715
|
-
excludePatterns: config.excludePatterns,
|
|
1716
|
-
compress: config.compress,
|
|
1717
|
-
style: config.style,
|
|
1718
|
-
streamOutput: config.streamOutput
|
|
1719
|
-
},
|
|
1720
|
-
config.enabled,
|
|
1721
|
-
config.when
|
|
1722
|
-
);
|
|
1723
|
-
return this;
|
|
1724
|
-
}
|
|
1725
1680
|
/** Add an api-call step. */
|
|
1726
1681
|
apiCall(config) {
|
|
1727
1682
|
return this.addRawStep("api-call", config);
|
|
@@ -2365,7 +2320,9 @@ var DEFINE_EVAL_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
|
|
|
2365
2320
|
"target",
|
|
2366
2321
|
"graders",
|
|
2367
2322
|
"cases",
|
|
2368
|
-
"virtual"
|
|
2323
|
+
"virtual",
|
|
2324
|
+
"recordedToolMode",
|
|
2325
|
+
"recordedToolUnmatchedPolicy"
|
|
2369
2326
|
]);
|
|
2370
2327
|
var DEFINE_EVAL_CASE_KEYS = /* @__PURE__ */ new Set(["name", "input", "expected", "expect"]);
|
|
2371
2328
|
function normalizeTarget(target) {
|
|
@@ -2434,9 +2391,15 @@ function defineEval(input) {
|
|
|
2434
2391
|
const unknownKeys = Object.keys(input).filter((k) => !DEFINE_EVAL_TOP_LEVEL_KEYS.has(k));
|
|
2435
2392
|
if (unknownKeys.length > 0) {
|
|
2436
2393
|
throw new Error(
|
|
2437
|
-
`defineEval: unknown field(s): ${unknownKeys.join(", ")}. Allowed fields are target, graders, cases, virtual.`
|
|
2394
|
+
`defineEval: unknown field(s): ${unknownKeys.join(", ")}. Allowed fields are target, graders, cases, virtual, recordedToolMode, recordedToolUnmatchedPolicy.`
|
|
2438
2395
|
);
|
|
2439
2396
|
}
|
|
2397
|
+
if (input.recordedToolMode !== void 0 && input.recordedToolMode !== "next_step" && input.recordedToolMode !== "continue") {
|
|
2398
|
+
throw new Error('defineEval "recordedToolMode" must be "next_step" or "continue"');
|
|
2399
|
+
}
|
|
2400
|
+
if (input.recordedToolUnmatchedPolicy !== void 0 && input.recordedToolUnmatchedPolicy !== "fail" && input.recordedToolUnmatchedPolicy !== "stub") {
|
|
2401
|
+
throw new Error('defineEval "recordedToolUnmatchedPolicy" must be "fail" or "stub"');
|
|
2402
|
+
}
|
|
2440
2403
|
const target = normalizeTarget(input.target);
|
|
2441
2404
|
if (input.name !== void 0 && (typeof input.name !== "string" || input.name.length === 0)) {
|
|
2442
2405
|
throw new Error('defineEval "name" must be a non-empty string when provided');
|
|
@@ -2485,7 +2448,14 @@ function defineEval(input) {
|
|
|
2485
2448
|
expect
|
|
2486
2449
|
};
|
|
2487
2450
|
});
|
|
2488
|
-
return {
|
|
2451
|
+
return {
|
|
2452
|
+
name,
|
|
2453
|
+
target,
|
|
2454
|
+
cases,
|
|
2455
|
+
virtual: input.virtual === true,
|
|
2456
|
+
...input.recordedToolMode !== void 0 ? { recordedToolMode: input.recordedToolMode } : {},
|
|
2457
|
+
...input.recordedToolUnmatchedPolicy !== void 0 ? { recordedToolUnmatchedPolicy: input.recordedToolUnmatchedPolicy } : {}
|
|
2458
|
+
};
|
|
2489
2459
|
}
|
|
2490
2460
|
function normalizeForHash(value) {
|
|
2491
2461
|
if (Array.isArray(value)) return value.map(normalizeForHash);
|
|
@@ -2501,9 +2471,13 @@ function normalizeForHash(value) {
|
|
|
2501
2471
|
return value;
|
|
2502
2472
|
}
|
|
2503
2473
|
async function computeEvalContentHash(definition) {
|
|
2474
|
+
const recordedToolMode = definition.recordedToolMode ?? "next_step";
|
|
2475
|
+
const recordedToolUnmatchedPolicy = definition.recordedToolUnmatchedPolicy ?? "fail";
|
|
2504
2476
|
const canonical = {
|
|
2505
2477
|
target: normalizeForHash(definition.target),
|
|
2506
2478
|
virtual: definition.virtual,
|
|
2479
|
+
...recordedToolMode !== "next_step" ? { recordedToolMode } : {},
|
|
2480
|
+
...recordedToolUnmatchedPolicy !== "fail" ? { recordedToolUnmatchedPolicy } : {},
|
|
2507
2481
|
cases: [...definition.cases].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0).map((c) => ({
|
|
2508
2482
|
name: c.name,
|
|
2509
2483
|
input: normalizeForHash(c.input),
|
|
@@ -3158,6 +3132,7 @@ var RuntypeFlowBuilder = class {
|
|
|
3158
3132
|
markdownIfAvailable: config.markdownIfAvailable,
|
|
3159
3133
|
fetchMethod: config.fetchMethod === "http" ? "standard" : config.fetchMethod,
|
|
3160
3134
|
firecrawl: config.firecrawl,
|
|
3135
|
+
massive: config.massive,
|
|
3161
3136
|
outputVariable: config.outputVariable,
|
|
3162
3137
|
errorHandling: config.errorHandling,
|
|
3163
3138
|
defaultValue: config.defaultValue,
|
|
@@ -3318,7 +3293,6 @@ var RuntypeFlowBuilder = class {
|
|
|
3318
3293
|
fieldsToExclude: config.fieldsToExclude,
|
|
3319
3294
|
availableFields: config.availableFields,
|
|
3320
3295
|
outputVariable: config.outputVariable,
|
|
3321
|
-
fields: config.fields,
|
|
3322
3296
|
includeMetadata: config.includeMetadata,
|
|
3323
3297
|
streamOutput: config.streamOutput
|
|
3324
3298
|
},
|
|
@@ -3411,7 +3385,6 @@ var RuntypeFlowBuilder = class {
|
|
|
3411
3385
|
vectorStore: config.vectorStore,
|
|
3412
3386
|
weaviateConfig: config.weaviateConfig,
|
|
3413
3387
|
vectorizeConfig: config.vectorizeConfig,
|
|
3414
|
-
pineconeConfig: config.pineconeConfig,
|
|
3415
3388
|
limit: config.limit,
|
|
3416
3389
|
threshold: config.threshold,
|
|
3417
3390
|
metadataFilters: config.metadataFilters,
|
|
@@ -3440,7 +3413,6 @@ var RuntypeFlowBuilder = class {
|
|
|
3440
3413
|
recordType: config.recordType,
|
|
3441
3414
|
recordName: config.recordName,
|
|
3442
3415
|
textField: config.textField,
|
|
3443
|
-
storeInRecord: config.storeInRecord,
|
|
3444
3416
|
embeddingModel: config.embeddingModel,
|
|
3445
3417
|
maxLength: config.maxLength,
|
|
3446
3418
|
inputMode: config.inputMode,
|
|
@@ -3448,7 +3420,6 @@ var RuntypeFlowBuilder = class {
|
|
|
3448
3420
|
itemAlias: config.itemAlias,
|
|
3449
3421
|
textTemplate: config.textTemplate,
|
|
3450
3422
|
batchSize: config.batchSize,
|
|
3451
|
-
vectorStore: config.vectorStore,
|
|
3452
3423
|
outputVariable: config.outputVariable,
|
|
3453
3424
|
streamOutput: config.streamOutput
|
|
3454
3425
|
},
|
|
@@ -3497,51 +3468,6 @@ var RuntypeFlowBuilder = class {
|
|
|
3497
3468
|
);
|
|
3498
3469
|
return this;
|
|
3499
3470
|
}
|
|
3500
|
-
/**
|
|
3501
|
-
* Add a send text step
|
|
3502
|
-
*/
|
|
3503
|
-
sendText(config) {
|
|
3504
|
-
this.addStep(
|
|
3505
|
-
"send-text",
|
|
3506
|
-
config.name,
|
|
3507
|
-
{
|
|
3508
|
-
to: config.to,
|
|
3509
|
-
from: config.from,
|
|
3510
|
-
message: config.message,
|
|
3511
|
-
outputVariable: config.outputVariable,
|
|
3512
|
-
errorHandling: config.errorHandling,
|
|
3513
|
-
streamOutput: config.streamOutput
|
|
3514
|
-
},
|
|
3515
|
-
config.enabled,
|
|
3516
|
-
config.when
|
|
3517
|
-
);
|
|
3518
|
-
return this;
|
|
3519
|
-
}
|
|
3520
|
-
/**
|
|
3521
|
-
* Add a fetch GitHub step
|
|
3522
|
-
*/
|
|
3523
|
-
fetchGitHub(config) {
|
|
3524
|
-
this.addStep(
|
|
3525
|
-
"fetch-github",
|
|
3526
|
-
config.name,
|
|
3527
|
-
{
|
|
3528
|
-
repository: config.repository,
|
|
3529
|
-
branch: config.branch,
|
|
3530
|
-
path: config.path,
|
|
3531
|
-
token: config.token,
|
|
3532
|
-
outputVariable: config.outputVariable,
|
|
3533
|
-
contentType: config.contentType,
|
|
3534
|
-
includePatterns: config.includePatterns,
|
|
3535
|
-
excludePatterns: config.excludePatterns,
|
|
3536
|
-
compress: config.compress,
|
|
3537
|
-
style: config.style,
|
|
3538
|
-
streamOutput: config.streamOutput
|
|
3539
|
-
},
|
|
3540
|
-
config.enabled,
|
|
3541
|
-
config.when
|
|
3542
|
-
);
|
|
3543
|
-
return this;
|
|
3544
|
-
}
|
|
3545
3471
|
/** Add an api-call step. */
|
|
3546
3472
|
apiCall(config) {
|
|
3547
3473
|
return this.addRawStep("api-call", config);
|
|
@@ -4100,6 +4026,18 @@ var EvalSuitesNamespace = class {
|
|
|
4100
4026
|
input
|
|
4101
4027
|
);
|
|
4102
4028
|
}
|
|
4029
|
+
/**
|
|
4030
|
+
* Dry-run of {@link addCaseFromExecution}: reconstruct an agent execution
|
|
4031
|
+
* exactly as capture would and return its recorded actions plus the fork
|
|
4032
|
+
* index each maps to (and whether the case would be fully replayable), so a
|
|
4033
|
+
* caller can build a fork picker without re-deriving the seed math. Reads
|
|
4034
|
+
* only — nothing is written.
|
|
4035
|
+
*/
|
|
4036
|
+
async getCapturePreview(executionId) {
|
|
4037
|
+
return this.getClient().get(
|
|
4038
|
+
`/eval/executions/${executionId}/capture-preview`
|
|
4039
|
+
);
|
|
4040
|
+
}
|
|
4103
4041
|
/** Edit, enable, or disable a test case. */
|
|
4104
4042
|
async updateCase(suiteId, caseId, input) {
|
|
4105
4043
|
return this.getClient().patch(
|
|
@@ -4113,6 +4051,55 @@ var EvalSuitesNamespace = class {
|
|
|
4113
4051
|
`/eval/suites/${suiteId}/cases/${caseId}`
|
|
4114
4052
|
);
|
|
4115
4053
|
}
|
|
4054
|
+
/**
|
|
4055
|
+
* List a suite's machine-proposed cases (the review queue). Every
|
|
4056
|
+
* generation source lands here; nothing enters the suite without an accept.
|
|
4057
|
+
*/
|
|
4058
|
+
async listProposals(suiteId, params) {
|
|
4059
|
+
return this.getClient().get(
|
|
4060
|
+
`/eval/suites/${suiteId}/proposals`,
|
|
4061
|
+
params
|
|
4062
|
+
);
|
|
4063
|
+
}
|
|
4064
|
+
/**
|
|
4065
|
+
* Accept a proposal — materializes it as an eval case and backlinks it.
|
|
4066
|
+
* Pass `options.case` to save an edited body instead (recorded as
|
|
4067
|
+
* `edited_accepted`; the machine original stays on the proposal for audit).
|
|
4068
|
+
*/
|
|
4069
|
+
async acceptProposal(suiteId, proposalId, options) {
|
|
4070
|
+
return this.getClient().post(
|
|
4071
|
+
`/eval/suites/${suiteId}/proposals/${proposalId}/accept`,
|
|
4072
|
+
options ?? {}
|
|
4073
|
+
);
|
|
4074
|
+
}
|
|
4075
|
+
/** Reject a proposal. The row survives as audit. */
|
|
4076
|
+
async rejectProposal(suiteId, proposalId) {
|
|
4077
|
+
return this.getClient().post(
|
|
4078
|
+
`/eval/suites/${suiteId}/proposals/${proposalId}/reject`,
|
|
4079
|
+
{}
|
|
4080
|
+
);
|
|
4081
|
+
}
|
|
4082
|
+
/**
|
|
4083
|
+
* Generate test-case proposals from the target's definition, fanned out
|
|
4084
|
+
* over an explicit diversity matrix (category × persona) and filtered for
|
|
4085
|
+
* gradeability. Results land as PROPOSALS for review — never directly in
|
|
4086
|
+
* the suite. Reserves one daily-eval quota slot per call.
|
|
4087
|
+
*/
|
|
4088
|
+
async generateCases(suiteId, input) {
|
|
4089
|
+
return this.getClient().post(
|
|
4090
|
+
`/eval/suites/${suiteId}/generate-cases`,
|
|
4091
|
+
input ?? {}
|
|
4092
|
+
);
|
|
4093
|
+
}
|
|
4094
|
+
/**
|
|
4095
|
+
* The coverage meter: which of the target's tools and instruction clauses
|
|
4096
|
+
* the suite's cases and graders already exercise. The instruction inventory
|
|
4097
|
+
* is cached server-side and refreshed when the definition changes; a cache
|
|
4098
|
+
* miss spends a metered model call, so this requires eval-write scope.
|
|
4099
|
+
*/
|
|
4100
|
+
async getCoverage(suiteId) {
|
|
4101
|
+
return this.getClient().get(`/eval/suites/${suiteId}/coverage`);
|
|
4102
|
+
}
|
|
4116
4103
|
};
|
|
4117
4104
|
|
|
4118
4105
|
// src/evals-namespace.ts
|
|
@@ -4344,6 +4331,28 @@ var EvalsNamespace = class {
|
|
|
4344
4331
|
const client = this.getClient();
|
|
4345
4332
|
return client.get(`/eval/runs/${runId}/scores`);
|
|
4346
4333
|
}
|
|
4334
|
+
/**
|
|
4335
|
+
* Record a lightweight human review of one AI-grader verdict ("the grader
|
|
4336
|
+
* got this right / wrong"), using the `scoreId` on a persisted outcome from
|
|
4337
|
+
* `getRunScores`. Reviews accumulate into the suite's judge-trust display
|
|
4338
|
+
* ("agrees with you N of M times"). Pass `null` to clear an earlier review.
|
|
4339
|
+
*
|
|
4340
|
+
* @example
|
|
4341
|
+
* ```typescript
|
|
4342
|
+
* const scores = await Runtype.evals.getRunScores(runId)
|
|
4343
|
+
* const outcome = scores.cases[0]?.outcomes.find((o) => o.kind === 'ai')
|
|
4344
|
+
* if (outcome?.scoreId) {
|
|
4345
|
+
* await Runtype.evals.reviewScore(outcome.scoreId, 'disagree')
|
|
4346
|
+
* }
|
|
4347
|
+
* ```
|
|
4348
|
+
*/
|
|
4349
|
+
async reviewScore(scoreId, verdict) {
|
|
4350
|
+
const client = this.getClient();
|
|
4351
|
+
return client.post(
|
|
4352
|
+
`/eval/scores/${scoreId}/review`,
|
|
4353
|
+
{ verdict }
|
|
4354
|
+
);
|
|
4355
|
+
}
|
|
4347
4356
|
/**
|
|
4348
4357
|
* Get evaluation status by ID
|
|
4349
4358
|
*
|
|
@@ -5511,7 +5520,9 @@ function normalizeFpoDefinition(fpo) {
|
|
|
5511
5520
|
surfaces: normalizeValue(fpo.surfaces ?? []),
|
|
5512
5521
|
...fpo.records !== void 0 && fpo.records !== null ? { records: normalizeValue(fpo.records) } : {},
|
|
5513
5522
|
...fpo.schedules !== void 0 && fpo.schedules !== null ? { schedules: normalizeValue(fpo.schedules) } : {},
|
|
5514
|
-
...fpo.secrets !== void 0 && fpo.secrets !== null ? { secrets: normalizeValue(fpo.secrets) } : {}
|
|
5523
|
+
...fpo.secrets !== void 0 && fpo.secrets !== null ? { secrets: normalizeValue(fpo.secrets) } : {},
|
|
5524
|
+
...fpo.evals !== void 0 && fpo.evals !== null ? { evals: normalizeValue(fpo.evals) } : {},
|
|
5525
|
+
...fpo.skills !== void 0 && fpo.skills !== null ? { skills: normalizeValue(fpo.skills) } : {}
|
|
5515
5526
|
};
|
|
5516
5527
|
}
|
|
5517
5528
|
async function computeFpoContentHash(fpo) {
|
|
@@ -6343,7 +6354,7 @@ var Runtype = class {
|
|
|
6343
6354
|
|
|
6344
6355
|
// src/version.ts
|
|
6345
6356
|
var FALLBACK_VERSION = "0.0.0";
|
|
6346
|
-
var SDK_VERSION = "
|
|
6357
|
+
var SDK_VERSION = "6.1.3".length > 0 ? "6.1.3" : FALLBACK_VERSION;
|
|
6347
6358
|
var RUNTYPE_CLIENT_KIND = "sdk";
|
|
6348
6359
|
var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
|
|
6349
6360
|
|
|
@@ -8587,6 +8598,69 @@ var RecordsEndpoint = class {
|
|
|
8587
8598
|
});
|
|
8588
8599
|
}
|
|
8589
8600
|
};
|
|
8601
|
+
var CollectionsEndpoint = class {
|
|
8602
|
+
constructor(client) {
|
|
8603
|
+
this.client = client;
|
|
8604
|
+
}
|
|
8605
|
+
/**
|
|
8606
|
+
* List collections with cursor pagination. `includeCount: true` adds
|
|
8607
|
+
* per-collection record counts.
|
|
8608
|
+
*/
|
|
8609
|
+
async list(params) {
|
|
8610
|
+
return this.client.get("/collections", params);
|
|
8611
|
+
}
|
|
8612
|
+
/**
|
|
8613
|
+
* Get a collection by slug. `includeHistory: true` embeds the append-only
|
|
8614
|
+
* schema version history.
|
|
8615
|
+
*/
|
|
8616
|
+
async get(slug, params) {
|
|
8617
|
+
return this.client.get(`/collections/${slug}`, params);
|
|
8618
|
+
}
|
|
8619
|
+
/**
|
|
8620
|
+
* Register a record type as a collection. `validationMode` defaults to
|
|
8621
|
+
* `off`, so creating a collection changes no existing behavior.
|
|
8622
|
+
*/
|
|
8623
|
+
async create(data) {
|
|
8624
|
+
return this.client.post("/collections", data);
|
|
8625
|
+
}
|
|
8626
|
+
/**
|
|
8627
|
+
* Update display fields, validation mode, or the schema. Breaking schema
|
|
8628
|
+
* changes are rejected while the resulting mode is `enforce`; transitioning
|
|
8629
|
+
* to `enforce` returns an `enforceCheck` dry-run summary.
|
|
8630
|
+
*/
|
|
8631
|
+
async update(slug, data) {
|
|
8632
|
+
return this.client.patch(`/collections/${slug}`, data);
|
|
8633
|
+
}
|
|
8634
|
+
/**
|
|
8635
|
+
* Delete the collection REGISTRATION only — records of the type are not
|
|
8636
|
+
* touched and revert to schemaless behavior.
|
|
8637
|
+
*/
|
|
8638
|
+
async delete(slug) {
|
|
8639
|
+
return this.client.delete(`/collections/${slug}`);
|
|
8640
|
+
}
|
|
8641
|
+
/**
|
|
8642
|
+
* Sample the type's most recently updated records and return a PROPOSED
|
|
8643
|
+
* schema with per-field confidence and sample values. Saves nothing —
|
|
8644
|
+
* review the proposal, then `update()` the collection.
|
|
8645
|
+
*/
|
|
8646
|
+
async inferSchema(slug, params) {
|
|
8647
|
+
return this.client.post(
|
|
8648
|
+
`/collections/${slug}/infer-schema`,
|
|
8649
|
+
params ?? {}
|
|
8650
|
+
);
|
|
8651
|
+
}
|
|
8652
|
+
/**
|
|
8653
|
+
* Dry-run existing records against a schema without writing anything — the
|
|
8654
|
+
* "N of M records would fail" preview before enabling `enforce`. Uses the
|
|
8655
|
+
* provided schema when given, otherwise the collection's saved schema.
|
|
8656
|
+
*/
|
|
8657
|
+
async validateExisting(slug, data) {
|
|
8658
|
+
return this.client.post(
|
|
8659
|
+
`/collections/${slug}/validate-existing`,
|
|
8660
|
+
data ?? {}
|
|
8661
|
+
);
|
|
8662
|
+
}
|
|
8663
|
+
};
|
|
8590
8664
|
var ApiKeysEndpoint = class {
|
|
8591
8665
|
constructor(client) {
|
|
8592
8666
|
this.client = client;
|
|
@@ -9206,13 +9280,21 @@ var ClientTokensEndpoint = class {
|
|
|
9206
9280
|
constructor(client) {
|
|
9207
9281
|
this.client = client;
|
|
9208
9282
|
}
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9283
|
+
async list(params) {
|
|
9284
|
+
const response = await this.client.get("/client-tokens", params);
|
|
9285
|
+
if (params?.limit !== void 0) {
|
|
9286
|
+
return {
|
|
9287
|
+
clientTokens: response.clientTokens,
|
|
9288
|
+
// The API always includes pagination when limit is supplied; the
|
|
9289
|
+
// fallback mirrors the server's own envelope math so the paged
|
|
9290
|
+
// overload stays total against older API deployments.
|
|
9291
|
+
pagination: response.pagination ?? {
|
|
9292
|
+
limit: params.limit,
|
|
9293
|
+
offset: params.offset ?? 0,
|
|
9294
|
+
hasMore: response.clientTokens.length === params.limit
|
|
9295
|
+
}
|
|
9296
|
+
};
|
|
9297
|
+
}
|
|
9216
9298
|
return response.clientTokens;
|
|
9217
9299
|
}
|
|
9218
9300
|
/**
|
|
@@ -12632,6 +12714,22 @@ var IntegrationsEndpoint = class {
|
|
|
12632
12714
|
async installSlack(data) {
|
|
12633
12715
|
return this.client.post("/integrations/slack/install", data);
|
|
12634
12716
|
}
|
|
12717
|
+
/**
|
|
12718
|
+
* Start the Slack "Add to Slack" OAuth handshake. Returns the Slack authorize
|
|
12719
|
+
* URL to open in a popup; the bot token is captured server-side by the
|
|
12720
|
+
* callback (never returned to the browser).
|
|
12721
|
+
*/
|
|
12722
|
+
async startSlackOAuth(data) {
|
|
12723
|
+
return this.client.post("/oauth/slack/start", data);
|
|
12724
|
+
}
|
|
12725
|
+
/**
|
|
12726
|
+
* Generate the Slack app manifest and one-click create-app deep link for a
|
|
12727
|
+
* surface. The manifest carries absolute API URLs derived server-side, so it
|
|
12728
|
+
* is always valid for Slack (relative proxy paths never leak in).
|
|
12729
|
+
*/
|
|
12730
|
+
async generateSlackManifest(data) {
|
|
12731
|
+
return this.client.post("/integrations/slack/manifest", data);
|
|
12732
|
+
}
|
|
12635
12733
|
};
|
|
12636
12734
|
var BillingEndpoint = class {
|
|
12637
12735
|
constructor(client) {
|
|
@@ -12650,7 +12748,15 @@ var BillingEndpoint = class {
|
|
|
12650
12748
|
return this.client.get("/billing/credits");
|
|
12651
12749
|
}
|
|
12652
12750
|
/**
|
|
12653
|
-
* Get
|
|
12751
|
+
* Get the caller's exact current UTC-month platform spend from the local
|
|
12752
|
+
* meter used for spend-cap enforcement. Returns 503 when that meter is unavailable.
|
|
12753
|
+
*/
|
|
12754
|
+
async getCurrentSpend() {
|
|
12755
|
+
return this.client.get("/billing/current-spend");
|
|
12756
|
+
}
|
|
12757
|
+
/**
|
|
12758
|
+
* Get spend analytics. The window is controlled by either `period` or `days`
|
|
12759
|
+
* (1–365, defaults to 30).
|
|
12654
12760
|
*/
|
|
12655
12761
|
async getSpendAnalytics(params) {
|
|
12656
12762
|
return this.client.get("/billing/spend-analytics", params);
|
|
@@ -12679,52 +12785,6 @@ var ToolApprovalGrantsEndpoint = class {
|
|
|
12679
12785
|
return this.client.delete(`/tool-approval-grants/${id}`);
|
|
12680
12786
|
}
|
|
12681
12787
|
};
|
|
12682
|
-
var AppsEndpoint = class {
|
|
12683
|
-
constructor(client) {
|
|
12684
|
-
this.client = client;
|
|
12685
|
-
}
|
|
12686
|
-
/** List apps for the authenticated owner, newest first. */
|
|
12687
|
-
async list() {
|
|
12688
|
-
return this.client.get("/apps");
|
|
12689
|
-
}
|
|
12690
|
-
/** Get an app by id, including its URL and active version pointer. */
|
|
12691
|
-
async get(id) {
|
|
12692
|
-
return this.client.get(`/apps/${id}`);
|
|
12693
|
-
}
|
|
12694
|
-
/** Create an app. A client token scoped to the app origin is auto-provisioned. */
|
|
12695
|
-
async create(data) {
|
|
12696
|
-
return this.client.post("/apps", data);
|
|
12697
|
-
}
|
|
12698
|
-
/** Update name, description, visibility, or status (suspended serves 410). */
|
|
12699
|
-
async update(id, data) {
|
|
12700
|
-
return this.client.patch(`/apps/${id}`, data);
|
|
12701
|
-
}
|
|
12702
|
-
/** Delete an app, its versions, and its hosting. Irreversible. */
|
|
12703
|
-
async delete(id) {
|
|
12704
|
-
return this.client.delete(`/apps/${id}`);
|
|
12705
|
-
}
|
|
12706
|
-
/** List an app's versions, newest first. */
|
|
12707
|
-
async listVersions(id) {
|
|
12708
|
-
return this.client.get(`/apps/${id}/versions`);
|
|
12709
|
-
}
|
|
12710
|
-
/** Upload a zipped bundle (raw application/zip body) as a new version. */
|
|
12711
|
-
async uploadVersion(id, zipBytes) {
|
|
12712
|
-
return this.client.postBinary(`/apps/${id}/versions`, zipBytes, "application/zip");
|
|
12713
|
-
}
|
|
12714
|
-
/**
|
|
12715
|
-
* Upload a bundle from in-memory file maps (the API zips server-side).
|
|
12716
|
-
* Text files in `files`, binary files base64-encoded in `filesBase64`.
|
|
12717
|
-
*/
|
|
12718
|
-
async uploadVersionFiles(id, data) {
|
|
12719
|
-
return this.client.post(`/apps/${id}/versions`, data);
|
|
12720
|
-
}
|
|
12721
|
-
/** Activate an uploaded version (deploy or rollback). */
|
|
12722
|
-
async activate(id, versionId) {
|
|
12723
|
-
return this.client.post(`/apps/${id}/activate`, {
|
|
12724
|
-
versionId
|
|
12725
|
-
});
|
|
12726
|
-
}
|
|
12727
|
-
};
|
|
12728
12788
|
|
|
12729
12789
|
// src/client.ts
|
|
12730
12790
|
function isObjectRecord(value) {
|
|
@@ -12761,6 +12821,7 @@ var RuntypeClient2 = class {
|
|
|
12761
12821
|
this.flows = new FlowsEndpoint(this);
|
|
12762
12822
|
this.prompts = new PromptsEndpoint(this);
|
|
12763
12823
|
this.records = new RecordsEndpoint(this);
|
|
12824
|
+
this.collections = new CollectionsEndpoint(this);
|
|
12764
12825
|
this.apiKeys = new ApiKeysEndpoint(this);
|
|
12765
12826
|
this.modelConfigs = new ModelConfigsEndpoint(this);
|
|
12766
12827
|
this.providerKeys = new ProviderKeysEndpoint(this);
|
|
@@ -12775,7 +12836,6 @@ var RuntypeClient2 = class {
|
|
|
12775
12836
|
this.clientTokens = new ClientTokensEndpoint(this);
|
|
12776
12837
|
this.agents = new AgentsEndpoint(this);
|
|
12777
12838
|
this.secrets = new SecretsEndpoint(this);
|
|
12778
|
-
this.apps = new AppsEndpoint(this);
|
|
12779
12839
|
this.schedules = new SchedulesEndpoint(this);
|
|
12780
12840
|
this.surfaces = new SurfacesEndpoint(this);
|
|
12781
12841
|
this.conversations = new ConversationsEndpoint(this);
|
|
@@ -13598,6 +13658,7 @@ var FETCH_URL_FIELDS = [
|
|
|
13598
13658
|
{ key: "markdownIfAvailable", format: "raw" },
|
|
13599
13659
|
{ key: "fetchMethod", format: "json", skipDefault: "standard" },
|
|
13600
13660
|
{ key: "firecrawl", format: "value" },
|
|
13661
|
+
{ key: "massive", format: "value" },
|
|
13601
13662
|
{ key: "outputVariable", format: "json" },
|
|
13602
13663
|
{ key: "streamOutput", format: "raw" },
|
|
13603
13664
|
{ key: "errorHandling", format: "value", skipDefault: "fail" },
|
|
@@ -13661,7 +13722,10 @@ var SEND_EMAIL_FIELDS = [
|
|
|
13661
13722
|
{ key: "defaultValue", format: "value" }
|
|
13662
13723
|
];
|
|
13663
13724
|
var SEND_STREAM_FIELDS = [
|
|
13664
|
-
{ key: "message", format: "template" }
|
|
13725
|
+
{ key: "message", format: "template" },
|
|
13726
|
+
{ key: "outputVariable", format: "json" },
|
|
13727
|
+
{ key: "errorHandling", format: "value", skipDefault: "fail" },
|
|
13728
|
+
{ key: "defaultValue", format: "value" }
|
|
13665
13729
|
];
|
|
13666
13730
|
var RETRIEVE_RECORD_FIELDS = [
|
|
13667
13731
|
{ key: "retrievalMode", format: "json" },
|
|
@@ -13673,7 +13737,6 @@ var RETRIEVE_RECORD_FIELDS = [
|
|
|
13673
13737
|
{ key: "fieldsToExclude", format: "json" },
|
|
13674
13738
|
{ key: "availableFields", format: "value" },
|
|
13675
13739
|
{ key: "outputVariable", format: "json" },
|
|
13676
|
-
{ key: "fields", format: "value" },
|
|
13677
13740
|
{ key: "includeMetadata", format: "raw" },
|
|
13678
13741
|
{ key: "streamOutput", format: "raw" }
|
|
13679
13742
|
];
|
|
@@ -13718,7 +13781,6 @@ var VECTOR_SEARCH_FIELDS = [
|
|
|
13718
13781
|
{ key: "vectorStore", format: "json" },
|
|
13719
13782
|
{ key: "weaviateConfig", format: "value" },
|
|
13720
13783
|
{ key: "vectorizeConfig", format: "value" },
|
|
13721
|
-
{ key: "pineconeConfig", format: "value" },
|
|
13722
13784
|
{ key: "limit", format: "raw", skipDefault: 5 },
|
|
13723
13785
|
{ key: "threshold", format: "raw", skipDefault: 0.7 },
|
|
13724
13786
|
{ key: "metadataFilters", format: "value" },
|
|
@@ -13735,7 +13797,6 @@ var GENERATE_EMBEDDING_FIELDS = [
|
|
|
13735
13797
|
{ key: "recordType", format: "json" },
|
|
13736
13798
|
{ key: "recordName", format: "json" },
|
|
13737
13799
|
{ key: "textField", format: "json" },
|
|
13738
|
-
{ key: "storeInRecord", format: "raw" },
|
|
13739
13800
|
{ key: "embeddingModel", format: "json" },
|
|
13740
13801
|
{ key: "maxLength", format: "raw" },
|
|
13741
13802
|
{ key: "inputMode", format: "json" },
|
|
@@ -13743,7 +13804,6 @@ var GENERATE_EMBEDDING_FIELDS = [
|
|
|
13743
13804
|
{ key: "itemAlias", format: "json" },
|
|
13744
13805
|
{ key: "textTemplate", format: "template" },
|
|
13745
13806
|
{ key: "batchSize", format: "raw" },
|
|
13746
|
-
{ key: "vectorStore", format: "value" },
|
|
13747
13807
|
{ key: "outputVariable", format: "json" },
|
|
13748
13808
|
{ key: "streamOutput", format: "raw" }
|
|
13749
13809
|
];
|
|
@@ -13763,31 +13823,9 @@ var SEND_EVENT_FIELDS = [
|
|
|
13763
13823
|
{ key: "streamOutput", format: "raw" },
|
|
13764
13824
|
{ key: "errorHandling", format: "value", skipDefault: "fail" }
|
|
13765
13825
|
];
|
|
13766
|
-
var SEND_TEXT_FIELDS = [
|
|
13767
|
-
{ key: "to", format: "json" },
|
|
13768
|
-
{ key: "from", format: "json" },
|
|
13769
|
-
{ key: "message", format: "template" },
|
|
13770
|
-
{ key: "outputVariable", format: "json" },
|
|
13771
|
-
{ key: "streamOutput", format: "raw" },
|
|
13772
|
-
{ key: "errorHandling", format: "value", skipDefault: "fail" }
|
|
13773
|
-
];
|
|
13774
|
-
var FETCH_GITHUB_FIELDS = [
|
|
13775
|
-
{ key: "repository", format: "json" },
|
|
13776
|
-
{ key: "branch", format: "json" },
|
|
13777
|
-
{ key: "path", format: "json" },
|
|
13778
|
-
{ key: "token", format: "json" },
|
|
13779
|
-
{ key: "outputVariable", format: "json" },
|
|
13780
|
-
{ key: "contentType", format: "json" },
|
|
13781
|
-
{ key: "includePatterns", format: "value" },
|
|
13782
|
-
{ key: "excludePatterns", format: "value" },
|
|
13783
|
-
{ key: "compress", format: "raw" },
|
|
13784
|
-
{ key: "style", format: "json" },
|
|
13785
|
-
{ key: "streamOutput", format: "raw" }
|
|
13786
|
-
];
|
|
13787
13826
|
var API_CALL_FIELDS = [
|
|
13788
13827
|
{ key: "http", format: "value" },
|
|
13789
13828
|
{ key: "auth", format: "value" },
|
|
13790
|
-
{ key: "requestTemplate", format: "template" },
|
|
13791
13829
|
{ key: "responseMapping", format: "value" },
|
|
13792
13830
|
{ key: "outputVariable", format: "json" },
|
|
13793
13831
|
{ key: "streamOutput", format: "raw" },
|
|
@@ -13798,7 +13836,6 @@ var EXECUTE_AGENT_FIELDS = [
|
|
|
13798
13836
|
{ key: "agentId", format: "json" },
|
|
13799
13837
|
{ key: "message", format: "template" },
|
|
13800
13838
|
{ key: "outputVariable", format: "json" },
|
|
13801
|
-
{ key: "variables", format: "value" },
|
|
13802
13839
|
{ key: "maxTurns", format: "raw" },
|
|
13803
13840
|
{ key: "timeout", format: "raw" },
|
|
13804
13841
|
{ key: "errorHandling", format: "value", skipDefault: "fail" },
|
|
@@ -13845,7 +13882,6 @@ var UPDATE_RECORD_FIELDS = [
|
|
|
13845
13882
|
{ key: "recordName", format: "json" },
|
|
13846
13883
|
{ key: "recordFilter", format: "value" },
|
|
13847
13884
|
{ key: "updates", format: "value" },
|
|
13848
|
-
{ key: "updatesTemplate", format: "template" },
|
|
13849
13885
|
{ key: "mergeStrategy", format: "json" },
|
|
13850
13886
|
{ key: "outputVariable", format: "json" },
|
|
13851
13887
|
{ key: "streamOutput", format: "raw" },
|
|
@@ -13882,7 +13918,6 @@ var PAGINATE_API_FIELDS = [
|
|
|
13882
13918
|
{ key: "startPage", format: "raw" },
|
|
13883
13919
|
{ key: "entitiesPath", format: "json" },
|
|
13884
13920
|
{ key: "entityPath", format: "json" },
|
|
13885
|
-
{ key: "entityIdPath", format: "json" },
|
|
13886
13921
|
{ key: "maxEntities", format: "raw" },
|
|
13887
13922
|
{ key: "requestDelayMs", format: "raw" },
|
|
13888
13923
|
{ key: "retryOnRateLimit", format: "raw" },
|
|
@@ -13902,13 +13937,10 @@ var STORE_VECTOR_FIELDS = [
|
|
|
13902
13937
|
{ key: "destination", format: "json" },
|
|
13903
13938
|
{ key: "weaviateConfig", format: "value" },
|
|
13904
13939
|
{ key: "vectorizeConfig", format: "value" },
|
|
13905
|
-
{ key: "pineconeConfig", format: "value" },
|
|
13906
13940
|
{ key: "weaviateConfigId", format: "json" },
|
|
13907
13941
|
{ key: "weaviateClassName", format: "json" },
|
|
13908
13942
|
{ key: "vectorizeConfigId", format: "json" },
|
|
13909
13943
|
{ key: "vectorizeNamespace", format: "json" },
|
|
13910
|
-
{ key: "pineconeConfigId", format: "json" },
|
|
13911
|
-
{ key: "pineconeNamespace", format: "json" },
|
|
13912
13944
|
{ key: "idTemplate", format: "template" },
|
|
13913
13945
|
{ key: "metadata", format: "value" },
|
|
13914
13946
|
{ key: "outputVariable", format: "json" },
|
|
@@ -13960,8 +13992,6 @@ var STEP_FIELD_REGISTRY = {
|
|
|
13960
13992
|
"generate-embedding": GENERATE_EMBEDDING_FIELDS,
|
|
13961
13993
|
"wait-until": WAIT_UNTIL_FIELDS,
|
|
13962
13994
|
"send-event": SEND_EVENT_FIELDS,
|
|
13963
|
-
"send-text": SEND_TEXT_FIELDS,
|
|
13964
|
-
"fetch-github": FETCH_GITHUB_FIELDS,
|
|
13965
13995
|
template: TEMPLATE_FIELDS,
|
|
13966
13996
|
"store-asset": STORE_ASSET_FIELDS,
|
|
13967
13997
|
"generate-pdf": GENERATE_PDF_FIELDS,
|
|
@@ -13981,7 +14011,6 @@ var STEP_TYPE_TO_METHOD = {
|
|
|
13981
14011
|
"retrieve-record": "retrieveRecord",
|
|
13982
14012
|
"get-record": "getRecord",
|
|
13983
14013
|
"list-records": "listRecords",
|
|
13984
|
-
"fetch-github": "fetchGitHub",
|
|
13985
14014
|
"transform-data": "transformData",
|
|
13986
14015
|
template: "template",
|
|
13987
14016
|
conditional: "conditional",
|
|
@@ -13989,7 +14018,6 @@ var STEP_TYPE_TO_METHOD = {
|
|
|
13989
14018
|
"upsert-record": "upsertRecord",
|
|
13990
14019
|
"update-record": "updateRecord",
|
|
13991
14020
|
"send-email": "sendEmail",
|
|
13992
|
-
"send-text": "sendText",
|
|
13993
14021
|
"send-event": "sendEvent",
|
|
13994
14022
|
"send-stream": "sendStream",
|
|
13995
14023
|
search: "search",
|
|
@@ -14015,7 +14043,6 @@ var STEP_TYPE_TO_METHOD = {
|
|
|
14015
14043
|
AgentsNamespace,
|
|
14016
14044
|
AnalyticsEndpoint,
|
|
14017
14045
|
ApiKeysEndpoint,
|
|
14018
|
-
AppsEndpoint,
|
|
14019
14046
|
BatchBuilder,
|
|
14020
14047
|
BatchesNamespace,
|
|
14021
14048
|
BillingEndpoint,
|
|
@@ -14024,6 +14051,7 @@ var STEP_TYPE_TO_METHOD = {
|
|
|
14024
14051
|
ClientEvalBuilder,
|
|
14025
14052
|
ClientFlowBuilder,
|
|
14026
14053
|
ClientTokensEndpoint,
|
|
14054
|
+
CollectionsEndpoint,
|
|
14027
14055
|
ContextTemplatesEndpoint,
|
|
14028
14056
|
ConversationsEndpoint,
|
|
14029
14057
|
DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS,
|