deepline 0.3.141 → 0.3.142
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/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +65 -2
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +11 -0
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +111 -0
- package/dist/bundling-sources/shared_libs/play-runtime/bettercontact-batching.ts +34 -8
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +271 -44
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +25 -6
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +132 -8
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +49 -54
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +14 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +118 -29
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-queue-health.ts +183 -36
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +4 -1
- package/dist/cli/index.js +242 -12
- package/dist/cli/index.mjs +242 -12
- package/dist/index.d.mts +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +1 -1
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -3063,7 +3063,7 @@ var SDK_RELEASE = {
|
|
|
3063
3063
|
// getters keep their established compatibility behavior.
|
|
3064
3064
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
3065
3065
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
3066
|
-
version: "0.3.
|
|
3066
|
+
version: "0.3.142",
|
|
3067
3067
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
3068
3068
|
packageCapabilities: {
|
|
3069
3069
|
updatePreferences: 1
|
|
@@ -11098,6 +11098,10 @@ function errorToJsonPayload(error) {
|
|
|
11098
11098
|
if (maybeRecord?.details && typeof maybeRecord.details === "object" && !Array.isArray(maybeRecord.details)) {
|
|
11099
11099
|
details.details = maybeRecord.details;
|
|
11100
11100
|
}
|
|
11101
|
+
const providerConcurrency = providerConcurrencyDiagnostic(maybeRecord);
|
|
11102
|
+
if (providerConcurrency) {
|
|
11103
|
+
details.providerConcurrency = providerConcurrency;
|
|
11104
|
+
}
|
|
11101
11105
|
if (typeof maybeRecord?.cause === "string") {
|
|
11102
11106
|
details.cause = maybeRecord.cause;
|
|
11103
11107
|
}
|
|
@@ -11111,6 +11115,33 @@ function errorToJsonPayload(error) {
|
|
|
11111
11115
|
}
|
|
11112
11116
|
};
|
|
11113
11117
|
}
|
|
11118
|
+
function formatProviderConcurrencyDiagnostic(error) {
|
|
11119
|
+
const value = error && typeof error === "object" ? error : null;
|
|
11120
|
+
const diagnostic = providerConcurrencyDiagnostic(value);
|
|
11121
|
+
if (!diagnostic) return null;
|
|
11122
|
+
const count = diagnostic.inFlightProviderRequestsAt429;
|
|
11123
|
+
const concurrency = count > 1 ? `${count - 1} other same-provider request${count === 2 ? "" : "s"} overlapped the failed request` : "no other same-provider request was active";
|
|
11124
|
+
return `Provider concurrency at the 429: ${count} active request${count === 1 ? "" : "s"} in this Play execution, including the failed request; ${concurrency}. Other Play executions and direct CLI/API calls are not included.`;
|
|
11125
|
+
}
|
|
11126
|
+
function providerConcurrencyDiagnostic(value) {
|
|
11127
|
+
if (!value || value.origin !== "provider" || value.statusCode !== 429 && value.status !== 429) {
|
|
11128
|
+
return null;
|
|
11129
|
+
}
|
|
11130
|
+
const publicDetails = value.publicDetails;
|
|
11131
|
+
if (!publicDetails || typeof publicDetails !== "object" || Array.isArray(publicDetails)) {
|
|
11132
|
+
return null;
|
|
11133
|
+
}
|
|
11134
|
+
const details = publicDetails;
|
|
11135
|
+
const count = details.inFlightProviderRequestsAt429;
|
|
11136
|
+
if (details.providerConcurrencyScope !== "same_provider_in_play_execution" || details.includesFailedRequest !== true || typeof count !== "number" || !Number.isInteger(count) || count < 1) {
|
|
11137
|
+
return null;
|
|
11138
|
+
}
|
|
11139
|
+
return {
|
|
11140
|
+
scope: "same_provider_in_play_execution",
|
|
11141
|
+
inFlightProviderRequestsAt429: count,
|
|
11142
|
+
includesFailedRequest: true
|
|
11143
|
+
};
|
|
11144
|
+
}
|
|
11114
11145
|
function printJsonError(error) {
|
|
11115
11146
|
printJson(errorToJsonPayload(error));
|
|
11116
11147
|
}
|
|
@@ -25454,6 +25485,14 @@ function buildRunPackageTextLines(packaged) {
|
|
|
25454
25485
|
const lines = isRuntimeLimitCheckpoint ? runtimeLimitCheckpointLines(packaged, runId, checkpointFailure) : [
|
|
25455
25486
|
`${status === "completed" ? "\u2713" : status === "failed" ? "\u2717" : "\u2022"} ${status} ${runId}`
|
|
25456
25487
|
];
|
|
25488
|
+
const outcome = typeof run.outcome === "string" ? run.outcome : null;
|
|
25489
|
+
if (outcome) lines.push(` outcome: ${outcome}`);
|
|
25490
|
+
const recovery = readRecord(run.recovery);
|
|
25491
|
+
if (recovery) {
|
|
25492
|
+
const mode = typeof recovery.mode === "string" ? recovery.mode : "recovered";
|
|
25493
|
+
const sourceRunId = typeof recovery.sourceRunId === "string" ? ` from ${recovery.sourceRunId}` : "";
|
|
25494
|
+
lines.push(` recovery: ${mode}${sourceRunId}`);
|
|
25495
|
+
}
|
|
25457
25496
|
const runError = typeof run.error === "string" && run.error.trim() ? run.error.trim() : null;
|
|
25458
25497
|
const structuredRuntimeLimitMessage = typeof runtimeLimitFailure?.message === "string" && runtimeLimitFailure.message.trim() ? `${typeof runtimeLimitFailure.code === "string" ? runtimeLimitFailure.code : "RUNTIME_LIMIT_EXCEEDED"}: ${runtimeLimitFailure.message.trim()}` : null;
|
|
25459
25498
|
const displayRunError = structuredRuntimeLimitMessage ?? runError;
|
|
@@ -48236,6 +48275,8 @@ function toolContractJsonForDescribe(tool, requestedToolId) {
|
|
|
48236
48275
|
const inputSchema = publicToolInputSchemaForDescribe(
|
|
48237
48276
|
recordField2(tool, "inputSchema", "input_schema")
|
|
48238
48277
|
);
|
|
48278
|
+
const outputSchemaRecord = recordField2(tool, "outputSchema", "output_schema");
|
|
48279
|
+
const outputFields = toolOutputFieldsForDisplay(outputSchemaRecord);
|
|
48239
48280
|
const usageGuidance = recordField2(tool, "usageGuidance", "usage_guidance");
|
|
48240
48281
|
const toolExecutionResult = recordField2(
|
|
48241
48282
|
usageGuidance,
|
|
@@ -48249,6 +48290,18 @@ function toolContractJsonForDescribe(tool, requestedToolId) {
|
|
|
48249
48290
|
arrayField2(toolExecutionResult, "extractedValues", "extracted_values")
|
|
48250
48291
|
);
|
|
48251
48292
|
const pricing = Capability.fromCatalogEntry(tool).describe().customerCost();
|
|
48293
|
+
const executionMetadataRecord = recordField2(
|
|
48294
|
+
tool,
|
|
48295
|
+
"executionMetadata",
|
|
48296
|
+
"execution_metadata"
|
|
48297
|
+
);
|
|
48298
|
+
const executionMetadata = Object.keys(executionMetadataRecord).length > 0 ? executionMetadataRecord : null;
|
|
48299
|
+
const batchCapabilityRecord = recordField2(
|
|
48300
|
+
tool,
|
|
48301
|
+
"batchCapability",
|
|
48302
|
+
"batch_capability"
|
|
48303
|
+
);
|
|
48304
|
+
const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
|
|
48252
48305
|
const deprecation = recordField2(tool, "deprecation");
|
|
48253
48306
|
const replacementToolId = stringField2(
|
|
48254
48307
|
deprecation,
|
|
@@ -48282,14 +48335,14 @@ function toolContractJsonForDescribe(tool, requestedToolId) {
|
|
|
48282
48335
|
...deprecationExecution ? { execution: deprecationExecution } : {}
|
|
48283
48336
|
}
|
|
48284
48337
|
} : {},
|
|
48285
|
-
inputFields: inputFields.map(
|
|
48286
|
-
name: field.name,
|
|
48287
|
-
type: field.type ?? "unknown",
|
|
48288
|
-
required: Boolean(field.required),
|
|
48289
|
-
...field.description ? { description: field.description } : {},
|
|
48290
|
-
...Object.prototype.hasOwnProperty.call(field, "default") ? { default: field.default } : {}
|
|
48291
|
-
})),
|
|
48338
|
+
inputFields: inputFields.map(inputFieldJsonForDescribe),
|
|
48292
48339
|
inputSchema,
|
|
48340
|
+
...Object.keys(outputSchemaRecord).length > 0 ? {
|
|
48341
|
+
outputSchema: publicToolInputSchemaForDescribe(outputSchemaRecord),
|
|
48342
|
+
outputFields: outputFields.map(inputFieldJsonForDescribe)
|
|
48343
|
+
} : {},
|
|
48344
|
+
...executionMetadata ? { executionMetadata } : {},
|
|
48345
|
+
...batchCapability ? { batchCapability } : {},
|
|
48293
48346
|
cost: pricing,
|
|
48294
48347
|
getters: {
|
|
48295
48348
|
extractedLists,
|
|
@@ -48441,6 +48494,8 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
48441
48494
|
if (Array.isArray(contract.categories) && contract.categories.length) {
|
|
48442
48495
|
console.log(`Tags: ${contract.categories.join(", ")}`);
|
|
48443
48496
|
}
|
|
48497
|
+
printToolOutputArrayShape(contract);
|
|
48498
|
+
printToolExecutionHints(contract);
|
|
48444
48499
|
if (contract.deprecated === true) {
|
|
48445
48500
|
const deprecation = isRecord12(contract.deprecation) ? contract.deprecation : {};
|
|
48446
48501
|
const message = stringField2(deprecation, "message");
|
|
@@ -48477,12 +48532,13 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
48477
48532
|
const description = stringField2(field, "description");
|
|
48478
48533
|
const enumValues = Array.isArray(field.enum) ? field.enum : [];
|
|
48479
48534
|
const enumSuffix = enumValues.length ? ` enum=${enumValues.map(String).join("|")}` : "";
|
|
48535
|
+
const itemBoundsSuffix = arrayItemBoundsSuffix(field);
|
|
48480
48536
|
const defaultSuffix = Object.prototype.hasOwnProperty.call(
|
|
48481
48537
|
field,
|
|
48482
48538
|
"default"
|
|
48483
48539
|
) ? ` default=${JSON.stringify(field.default)}` : "";
|
|
48484
48540
|
console.log(
|
|
48485
|
-
`- ${name}${required}: ${type}${enumSuffix}${defaultSuffix}${description ? ` - ${description}` : ""}`
|
|
48541
|
+
`- ${name}${required}: ${type}${enumSuffix}${itemBoundsSuffix}${defaultSuffix}${description ? ` - ${description}` : ""}`
|
|
48486
48542
|
);
|
|
48487
48543
|
}
|
|
48488
48544
|
}
|
|
@@ -48562,15 +48618,17 @@ function printToolSchemaOnly(tool, requestedToolId) {
|
|
|
48562
48618
|
const description = typeof field.description === "string" ? field.description : "";
|
|
48563
48619
|
const enumValues = Array.isArray(field.enum) ? field.enum : [];
|
|
48564
48620
|
const enumSuffix = enumValues.length ? ` enum=${enumValues.map(String).join("|")}` : "";
|
|
48621
|
+
const itemBoundsSuffix = arrayItemBoundsSuffix(field);
|
|
48565
48622
|
const defaultSuffix = Object.prototype.hasOwnProperty.call(
|
|
48566
48623
|
field,
|
|
48567
48624
|
"default"
|
|
48568
48625
|
) ? ` default=${JSON.stringify(field.default)}` : "";
|
|
48569
48626
|
console.log(
|
|
48570
|
-
`- ${name}${required}: ${type}${enumSuffix}${defaultSuffix}${description ? ` - ${description}` : ""}`
|
|
48627
|
+
`- ${name}${required}: ${type}${enumSuffix}${itemBoundsSuffix}${defaultSuffix}${description ? ` - ${description}` : ""}`
|
|
48571
48628
|
);
|
|
48572
48629
|
}
|
|
48573
48630
|
}
|
|
48631
|
+
printToolOutputArrayShape(contract);
|
|
48574
48632
|
const declaredSchema = declaredToolJsonSchema(
|
|
48575
48633
|
recordField2(contract, "inputSchema")
|
|
48576
48634
|
);
|
|
@@ -48746,11 +48804,19 @@ function toolMetadataJsonForDescribe(tool, requestedToolId) {
|
|
|
48746
48804
|
deepline_pricing_details: _snakeDeeplinePricingDetails,
|
|
48747
48805
|
...publicTool
|
|
48748
48806
|
} = tool;
|
|
48807
|
+
const outputSchemaRecord = recordField2(tool, "outputSchema", "output_schema");
|
|
48749
48808
|
return {
|
|
48750
48809
|
...publicTool,
|
|
48751
48810
|
toolId,
|
|
48752
48811
|
provider: tool.provider,
|
|
48753
48812
|
displayName: tool.displayName,
|
|
48813
|
+
...Object.keys(outputSchemaRecord).length > 0 ? {
|
|
48814
|
+
outputSchema: publicToolInputSchemaForDescribe(outputSchemaRecord),
|
|
48815
|
+
outputFields: toolOutputFieldsForDisplay(outputSchemaRecord).map(
|
|
48816
|
+
inputFieldJsonForDescribe
|
|
48817
|
+
)
|
|
48818
|
+
} : {},
|
|
48819
|
+
inputFields: inputFields.map(inputFieldJsonForDescribe),
|
|
48754
48820
|
cost: Capability.fromCatalogEntry(tool).describe().customerCost(),
|
|
48755
48821
|
usageGuidance,
|
|
48756
48822
|
runtimeOutputHelp: {
|
|
@@ -48809,8 +48875,27 @@ function formatListedToolCost(tool) {
|
|
|
48809
48875
|
return displayText ? `Cost: ${displayText}` : "";
|
|
48810
48876
|
}
|
|
48811
48877
|
function toolInputFieldsForDisplay(inputSchema) {
|
|
48812
|
-
if (Array.isArray(inputSchema.fields))
|
|
48813
|
-
|
|
48878
|
+
if (Array.isArray(inputSchema.fields)) {
|
|
48879
|
+
const fields = inputSchema.fields.filter(isRecord12);
|
|
48880
|
+
if (!isRecord12(inputSchema.jsonSchema)) return fields;
|
|
48881
|
+
const jsonSchemaFields = new Map(
|
|
48882
|
+
recursiveToolInputFieldsForDisplay({
|
|
48883
|
+
jsonSchema: inputSchema.jsonSchema
|
|
48884
|
+
}).flatMap(
|
|
48885
|
+
(field) => typeof field.name === "string" ? [[field.name, field]] : []
|
|
48886
|
+
)
|
|
48887
|
+
);
|
|
48888
|
+
return fields.map((field) => {
|
|
48889
|
+
const jsonSchemaField = typeof field.name === "string" ? jsonSchemaFields.get(field.name) : void 0;
|
|
48890
|
+
const minItems = typeof field.minItems === "number" ? field.minItems : jsonSchemaField?.minItems;
|
|
48891
|
+
const maxItems = typeof field.maxItems === "number" ? field.maxItems : jsonSchemaField?.maxItems;
|
|
48892
|
+
return {
|
|
48893
|
+
...field,
|
|
48894
|
+
...typeof minItems === "number" ? { minItems } : {},
|
|
48895
|
+
...typeof maxItems === "number" ? { maxItems } : {}
|
|
48896
|
+
};
|
|
48897
|
+
});
|
|
48898
|
+
}
|
|
48814
48899
|
const jsonSchema = isRecord12(inputSchema.jsonSchema) ? inputSchema.jsonSchema : inputSchema;
|
|
48815
48900
|
const properties = isRecord12(jsonSchema.properties) ? jsonSchema.properties : {};
|
|
48816
48901
|
const required = Array.isArray(jsonSchema.required) ? new Set(jsonSchema.required.map(String)) : /* @__PURE__ */ new Set();
|
|
@@ -48821,10 +48906,36 @@ function toolInputFieldsForDisplay(inputSchema) {
|
|
|
48821
48906
|
type: typeof property.type === "string" ? property.type : "unknown",
|
|
48822
48907
|
required: required.has(name),
|
|
48823
48908
|
description: property.description,
|
|
48909
|
+
...typeof property.minItems === "number" ? { minItems: property.minItems } : {},
|
|
48910
|
+
...typeof property.maxItems === "number" ? { maxItems: property.maxItems } : {},
|
|
48824
48911
|
...Object.prototype.hasOwnProperty.call(property, "default") ? { default: property.default } : {}
|
|
48825
48912
|
};
|
|
48826
48913
|
});
|
|
48827
48914
|
}
|
|
48915
|
+
function toolOutputFieldsForDisplay(outputSchema) {
|
|
48916
|
+
if (Object.keys(outputSchema).length === 0) return [];
|
|
48917
|
+
return recursiveToolInputFieldsForDisplay({
|
|
48918
|
+
jsonSchema: outputSchema
|
|
48919
|
+
}).filter(
|
|
48920
|
+
(field) => typeof field.name === "string" && field.name.includes("[]")
|
|
48921
|
+
);
|
|
48922
|
+
}
|
|
48923
|
+
function printToolOutputArrayShape(tool) {
|
|
48924
|
+
const outputFields = toolOutputFieldsForDisplay(
|
|
48925
|
+
recordField2(isRecord12(tool) ? tool : {}, "outputSchema", "output_schema")
|
|
48926
|
+
);
|
|
48927
|
+
if (outputFields.length === 0) return;
|
|
48928
|
+
console.log(" Output array shape (declared schema):");
|
|
48929
|
+
for (const field of outputFields.slice(0, 60)) {
|
|
48930
|
+
const name = String(field.name);
|
|
48931
|
+
const type = stringField2(field, "type") || "unknown";
|
|
48932
|
+
const itemBounds = arrayItemBoundsSuffix(field);
|
|
48933
|
+
console.log(` - ${name}: ${type}${itemBounds}`);
|
|
48934
|
+
}
|
|
48935
|
+
if (outputFields.length > 60) {
|
|
48936
|
+
console.log(` - \u2026 ${outputFields.length - 60} more schema fields`);
|
|
48937
|
+
}
|
|
48938
|
+
}
|
|
48828
48939
|
function canonicalToolJsonSchema(inputSchema) {
|
|
48829
48940
|
return isRecord12(inputSchema.jsonSchema) ? inputSchema.jsonSchema : inputSchema;
|
|
48830
48941
|
}
|
|
@@ -48914,6 +49025,8 @@ function recursiveToolInputFieldsForDisplay(inputSchema) {
|
|
|
48914
49025
|
required,
|
|
48915
49026
|
description: schema.description,
|
|
48916
49027
|
...Array.isArray(schema.enum) ? { enum: schema.enum } : {},
|
|
49028
|
+
...typeof schema.minItems === "number" ? { minItems: schema.minItems } : {},
|
|
49029
|
+
...typeof schema.maxItems === "number" ? { maxItems: schema.maxItems } : {},
|
|
48917
49030
|
...Object.prototype.hasOwnProperty.call(schema, "default") ? { default: schema.default } : {}
|
|
48918
49031
|
});
|
|
48919
49032
|
}
|
|
@@ -48945,6 +49058,121 @@ function recursiveToolInputFieldsForDisplay(inputSchema) {
|
|
|
48945
49058
|
visit(root, "", false);
|
|
48946
49059
|
return fields.size ? [...fields.values()] : toolInputFieldsForDisplay(inputSchema);
|
|
48947
49060
|
}
|
|
49061
|
+
function inputFieldJsonForDescribe(field) {
|
|
49062
|
+
return {
|
|
49063
|
+
name: field.name,
|
|
49064
|
+
type: field.type ?? "unknown",
|
|
49065
|
+
required: Boolean(field.required),
|
|
49066
|
+
...field.description ? { description: field.description } : {},
|
|
49067
|
+
...typeof field.minItems === "number" ? { minItems: field.minItems } : {},
|
|
49068
|
+
...typeof field.maxItems === "number" ? { maxItems: field.maxItems } : {},
|
|
49069
|
+
...Object.prototype.hasOwnProperty.call(field, "default") ? { default: field.default } : {}
|
|
49070
|
+
};
|
|
49071
|
+
}
|
|
49072
|
+
function arrayItemBoundsSuffix(field) {
|
|
49073
|
+
const minItems = typeof field.minItems === "number" && Number.isFinite(field.minItems) ? field.minItems : null;
|
|
49074
|
+
const maxItems = typeof field.maxItems === "number" && Number.isFinite(field.maxItems) ? field.maxItems : null;
|
|
49075
|
+
if (minItems !== null && maxItems !== null) {
|
|
49076
|
+
return ` items=${minItems}..${maxItems}`;
|
|
49077
|
+
}
|
|
49078
|
+
if (minItems !== null) return ` minItems=${minItems}`;
|
|
49079
|
+
if (maxItems !== null) return ` maxItems=${maxItems}`;
|
|
49080
|
+
return "";
|
|
49081
|
+
}
|
|
49082
|
+
function printToolExecutionHints(value) {
|
|
49083
|
+
const batchCapabilityRecord = recordField2(
|
|
49084
|
+
isRecord12(value) ? value : {},
|
|
49085
|
+
"batchCapability",
|
|
49086
|
+
"batch_capability"
|
|
49087
|
+
);
|
|
49088
|
+
const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
|
|
49089
|
+
const executionMetadata = recordField2(
|
|
49090
|
+
isRecord12(value) ? value : {},
|
|
49091
|
+
"executionMetadata",
|
|
49092
|
+
"execution_metadata"
|
|
49093
|
+
);
|
|
49094
|
+
if (batchCapability) {
|
|
49095
|
+
const status = stringField2(batchCapability, "status") || "unknown";
|
|
49096
|
+
const surface = stringField2(batchCapability, "surface");
|
|
49097
|
+
const operation = stringField2(
|
|
49098
|
+
batchCapability,
|
|
49099
|
+
"batchOperation",
|
|
49100
|
+
"batch_operation"
|
|
49101
|
+
);
|
|
49102
|
+
const maxBatchSize = numberField2(
|
|
49103
|
+
batchCapability,
|
|
49104
|
+
"maxBatchSize",
|
|
49105
|
+
"max_batch_size"
|
|
49106
|
+
);
|
|
49107
|
+
const notes = stringField2(batchCapability, "notes");
|
|
49108
|
+
console.log("");
|
|
49109
|
+
console.log("Batching:");
|
|
49110
|
+
console.log(`- Catalog status: ${status}${surface ? ` (${surface})` : ""}`);
|
|
49111
|
+
if (operation) console.log(`- Batch operation: ${operation}`);
|
|
49112
|
+
if (maxBatchSize !== null) {
|
|
49113
|
+
console.log(`- Maximum batch size: ${maxBatchSize} items`);
|
|
49114
|
+
}
|
|
49115
|
+
if (status === "compiled") {
|
|
49116
|
+
console.log(
|
|
49117
|
+
"- Compatible per-row Play calls can coalesce; separate tools execute requests do not coalesce."
|
|
49118
|
+
);
|
|
49119
|
+
} else if (surface !== "docs") {
|
|
49120
|
+
console.log(
|
|
49121
|
+
"- Play does not automatically coalesce per-row calls for this operation; send a native batch as one request when its input schema supports one."
|
|
49122
|
+
);
|
|
49123
|
+
}
|
|
49124
|
+
if (notes) console.log(`- Details: ${notes}`);
|
|
49125
|
+
}
|
|
49126
|
+
const configuredRateLimits = arrayField2(
|
|
49127
|
+
executionMetadata,
|
|
49128
|
+
"configuredRateLimits",
|
|
49129
|
+
"configured_rate_limits"
|
|
49130
|
+
).filter(isRecord12);
|
|
49131
|
+
if (configuredRateLimits.length > 0) {
|
|
49132
|
+
console.log("");
|
|
49133
|
+
console.log(
|
|
49134
|
+
"Configured Deepline pacing (guidance, not a guaranteed provider quota):"
|
|
49135
|
+
);
|
|
49136
|
+
for (const limit of configuredRateLimits) {
|
|
49137
|
+
const requests = numberField2(limit, "requestsPerWindow");
|
|
49138
|
+
const windowMs = numberField2(limit, "windowMs");
|
|
49139
|
+
if (requests === null || windowMs === null) continue;
|
|
49140
|
+
const usage = stringField2(limit, "usage") || "unknown";
|
|
49141
|
+
const usageText = usage === "queue_hint" ? "queue hint" : usage === "enforced" ? "Deepline enforced" : usage === "queue_hint_and_enforced" ? "queue hint and Deepline enforced" : usage === "disabled" ? "disabled" : usage;
|
|
49142
|
+
const explicitMaxConcurrency = numberField2(
|
|
49143
|
+
limit,
|
|
49144
|
+
"explicitMaxConcurrency",
|
|
49145
|
+
"explicit_max_concurrency"
|
|
49146
|
+
);
|
|
49147
|
+
const concurrencyText = explicitMaxConcurrency === null ? "no explicit concurrency limit" : `explicit concurrency limit ${explicitMaxConcurrency}`;
|
|
49148
|
+
console.log(
|
|
49149
|
+
`- ${requests} requests per ${formatRateWindow(windowMs)} (${usageText}; ${concurrencyText})`
|
|
49150
|
+
);
|
|
49151
|
+
}
|
|
49152
|
+
}
|
|
49153
|
+
const queueHint = recordField2(executionMetadata, "queueHint", "queue_hint");
|
|
49154
|
+
const requestsPerSecondHint = numberField2(
|
|
49155
|
+
queueHint,
|
|
49156
|
+
"requestsPerSecondHint",
|
|
49157
|
+
"requests_per_second_hint"
|
|
49158
|
+
);
|
|
49159
|
+
const derivedConcurrency = numberField2(
|
|
49160
|
+
queueHint,
|
|
49161
|
+
"derivedConcurrency",
|
|
49162
|
+
"derived_concurrency"
|
|
49163
|
+
);
|
|
49164
|
+
if (requestsPerSecondHint !== null && requestsPerSecondHint > 0 && derivedConcurrency !== null) {
|
|
49165
|
+
console.log(
|
|
49166
|
+
`Derived runtime queue hint: ${requestsPerSecondHint} requests/second; ${derivedConcurrency} derived concurrency. This is not an observed provider concurrency limit.`
|
|
49167
|
+
);
|
|
49168
|
+
}
|
|
49169
|
+
}
|
|
49170
|
+
function formatRateWindow(windowMs) {
|
|
49171
|
+
if (windowMs === 1e3) return "second";
|
|
49172
|
+
if (windowMs === 6e4) return "minute";
|
|
49173
|
+
if (windowMs === 36e5) return "hour";
|
|
49174
|
+
return `${windowMs}ms`;
|
|
49175
|
+
}
|
|
48948
49176
|
function printSamples(samples) {
|
|
48949
49177
|
const requestPayload = samplePayload(samples, "request");
|
|
48950
49178
|
const responsePayload = samplePayload(samples, "response");
|
|
@@ -50931,6 +51159,8 @@ Examples:
|
|
|
50931
51159
|
printJsonError(error);
|
|
50932
51160
|
} else if (error instanceof Error) {
|
|
50933
51161
|
console.error(`Error: ${error.message}`);
|
|
51162
|
+
const providerConcurrency = formatProviderConcurrencyDiagnostic(error);
|
|
51163
|
+
if (providerConcurrency) console.error(providerConcurrency);
|
|
50934
51164
|
} else {
|
|
50935
51165
|
console.error(`Error: ${String(error)}`);
|
|
50936
51166
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1162,9 +1162,9 @@ interface ProviderDefinition {
|
|
|
1162
1162
|
*
|
|
1163
1163
|
* Returned by {@link DeeplineClient.listTools} and ranked tool search. Use
|
|
1164
1164
|
* `getTool(toolId)` or the matching HTTP describe route for provider-specific
|
|
1165
|
-
* schema, examples, pricing,
|
|
1165
|
+
* schema, examples, pricing, extraction guidance, and execution metadata.
|
|
1166
1166
|
*/
|
|
1167
|
-
interface ToolDefinition {
|
|
1167
|
+
interface ToolDefinition extends ToolExecutionMetadataFields {
|
|
1168
1168
|
/** Unique tool identifier used in API calls (e.g. `"dropleads_search_people"`). */
|
|
1169
1169
|
toolId: string;
|
|
1170
1170
|
/** Provider that backs this tool (e.g. `"hunter"`, `"dropleads"`, `"test"`). */
|
|
@@ -1299,6 +1299,42 @@ interface ToolDefinition {
|
|
|
1299
1299
|
/** Actionable message shown when a connection is required. */
|
|
1300
1300
|
connectionMessage?: string;
|
|
1301
1301
|
}
|
|
1302
|
+
type ToolBatchCapability = {
|
|
1303
|
+
status: 'compiled' | 'exposed_uncompiled' | 'upstream_only';
|
|
1304
|
+
surface: 'registry' | 'local' | 'docs';
|
|
1305
|
+
batchKind: 'identifier_batch' | 'query_share' | 'async_dataset_job';
|
|
1306
|
+
batchOperation: string | null;
|
|
1307
|
+
maxBatchSize: number | null;
|
|
1308
|
+
notes: string;
|
|
1309
|
+
};
|
|
1310
|
+
/** Optional batching, pacing, and configured rate metadata for tool catalog entries. */
|
|
1311
|
+
interface ToolExecutionMetadataFields {
|
|
1312
|
+
batchCapability?: ToolBatchCapability;
|
|
1313
|
+
batch_capability?: ToolBatchCapability;
|
|
1314
|
+
executionMetadata?: ToolExecutionMetadata;
|
|
1315
|
+
execution_metadata?: ToolExecutionMetadata;
|
|
1316
|
+
}
|
|
1317
|
+
type ToolExecutionMetadata = {
|
|
1318
|
+
provider: string;
|
|
1319
|
+
sourceOperation: string;
|
|
1320
|
+
effectiveOperation: string;
|
|
1321
|
+
batch: {
|
|
1322
|
+
batchOperation: string | null;
|
|
1323
|
+
maxBatchSize: number;
|
|
1324
|
+
};
|
|
1325
|
+
configuredRateLimits: Array<{
|
|
1326
|
+
source: 'deepline_configuration';
|
|
1327
|
+
scope: string;
|
|
1328
|
+
requestsPerWindow: number;
|
|
1329
|
+
windowMs: number;
|
|
1330
|
+
usage: 'queue_hint' | 'enforced' | 'queue_hint_and_enforced' | 'disabled';
|
|
1331
|
+
explicitMaxConcurrency: number | null;
|
|
1332
|
+
}>;
|
|
1333
|
+
queueHint: {
|
|
1334
|
+
requestsPerSecondHint: number;
|
|
1335
|
+
derivedConcurrency: number;
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1302
1338
|
interface ModelProviderOptionField {
|
|
1303
1339
|
name: string;
|
|
1304
1340
|
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
@@ -1655,6 +1691,11 @@ interface PlayRunPackage {
|
|
|
1655
1691
|
startedAt?: number | null;
|
|
1656
1692
|
finishedAt?: number | null;
|
|
1657
1693
|
durationMs?: number | null;
|
|
1694
|
+
outcome?: PlayRunOutcome;
|
|
1695
|
+
recovery?: {
|
|
1696
|
+
mode: 'replayed' | 'forced' | 'recovered' | 'joined';
|
|
1697
|
+
sourceRunId?: string;
|
|
1698
|
+
};
|
|
1658
1699
|
error?: string;
|
|
1659
1700
|
/** Canonical explanation of what this run is doing or waiting on. */
|
|
1660
1701
|
activity?: PlayRunActivityProjection | null;
|
|
@@ -1699,6 +1740,11 @@ interface PlayRunPackage {
|
|
|
1699
1740
|
logs?: PlayRunActionPackage;
|
|
1700
1741
|
};
|
|
1701
1742
|
}
|
|
1743
|
+
/**
|
|
1744
|
+
* Stable classification of whether this run executed work or reused/recovered
|
|
1745
|
+
* an existing durable run outcome.
|
|
1746
|
+
*/
|
|
1747
|
+
type PlayRunOutcome = 'executed' | 'reused' | 'joined' | 'recovered' | 'forced' | 'waiting' | 'failed';
|
|
1702
1748
|
/**
|
|
1703
1749
|
* Current status of a play execution, returned by {@link DeeplineClient.getPlayStatus}.
|
|
1704
1750
|
*
|
|
@@ -1730,6 +1776,12 @@ interface PlayStatus {
|
|
|
1730
1776
|
dashboardUrl?: string;
|
|
1731
1777
|
/** Product-level play-run state. */
|
|
1732
1778
|
status: 'queued' | 'running' | 'waiting' | 'completed' | 'failed' | 'cancelled';
|
|
1779
|
+
/** How this run was admitted or recovered, when the server can prove it. */
|
|
1780
|
+
outcome?: PlayRunOutcome;
|
|
1781
|
+
recovery?: {
|
|
1782
|
+
mode: 'replayed' | 'forced' | 'recovered' | 'joined';
|
|
1783
|
+
sourceRunId?: string;
|
|
1784
|
+
};
|
|
1733
1785
|
/** Execution progress with logs and error details. */
|
|
1734
1786
|
progress?: PlayProgressStatus;
|
|
1735
1787
|
/** Partial or final result. Available once the play returns. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1162,9 +1162,9 @@ interface ProviderDefinition {
|
|
|
1162
1162
|
*
|
|
1163
1163
|
* Returned by {@link DeeplineClient.listTools} and ranked tool search. Use
|
|
1164
1164
|
* `getTool(toolId)` or the matching HTTP describe route for provider-specific
|
|
1165
|
-
* schema, examples, pricing,
|
|
1165
|
+
* schema, examples, pricing, extraction guidance, and execution metadata.
|
|
1166
1166
|
*/
|
|
1167
|
-
interface ToolDefinition {
|
|
1167
|
+
interface ToolDefinition extends ToolExecutionMetadataFields {
|
|
1168
1168
|
/** Unique tool identifier used in API calls (e.g. `"dropleads_search_people"`). */
|
|
1169
1169
|
toolId: string;
|
|
1170
1170
|
/** Provider that backs this tool (e.g. `"hunter"`, `"dropleads"`, `"test"`). */
|
|
@@ -1299,6 +1299,42 @@ interface ToolDefinition {
|
|
|
1299
1299
|
/** Actionable message shown when a connection is required. */
|
|
1300
1300
|
connectionMessage?: string;
|
|
1301
1301
|
}
|
|
1302
|
+
type ToolBatchCapability = {
|
|
1303
|
+
status: 'compiled' | 'exposed_uncompiled' | 'upstream_only';
|
|
1304
|
+
surface: 'registry' | 'local' | 'docs';
|
|
1305
|
+
batchKind: 'identifier_batch' | 'query_share' | 'async_dataset_job';
|
|
1306
|
+
batchOperation: string | null;
|
|
1307
|
+
maxBatchSize: number | null;
|
|
1308
|
+
notes: string;
|
|
1309
|
+
};
|
|
1310
|
+
/** Optional batching, pacing, and configured rate metadata for tool catalog entries. */
|
|
1311
|
+
interface ToolExecutionMetadataFields {
|
|
1312
|
+
batchCapability?: ToolBatchCapability;
|
|
1313
|
+
batch_capability?: ToolBatchCapability;
|
|
1314
|
+
executionMetadata?: ToolExecutionMetadata;
|
|
1315
|
+
execution_metadata?: ToolExecutionMetadata;
|
|
1316
|
+
}
|
|
1317
|
+
type ToolExecutionMetadata = {
|
|
1318
|
+
provider: string;
|
|
1319
|
+
sourceOperation: string;
|
|
1320
|
+
effectiveOperation: string;
|
|
1321
|
+
batch: {
|
|
1322
|
+
batchOperation: string | null;
|
|
1323
|
+
maxBatchSize: number;
|
|
1324
|
+
};
|
|
1325
|
+
configuredRateLimits: Array<{
|
|
1326
|
+
source: 'deepline_configuration';
|
|
1327
|
+
scope: string;
|
|
1328
|
+
requestsPerWindow: number;
|
|
1329
|
+
windowMs: number;
|
|
1330
|
+
usage: 'queue_hint' | 'enforced' | 'queue_hint_and_enforced' | 'disabled';
|
|
1331
|
+
explicitMaxConcurrency: number | null;
|
|
1332
|
+
}>;
|
|
1333
|
+
queueHint: {
|
|
1334
|
+
requestsPerSecondHint: number;
|
|
1335
|
+
derivedConcurrency: number;
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1302
1338
|
interface ModelProviderOptionField {
|
|
1303
1339
|
name: string;
|
|
1304
1340
|
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
@@ -1655,6 +1691,11 @@ interface PlayRunPackage {
|
|
|
1655
1691
|
startedAt?: number | null;
|
|
1656
1692
|
finishedAt?: number | null;
|
|
1657
1693
|
durationMs?: number | null;
|
|
1694
|
+
outcome?: PlayRunOutcome;
|
|
1695
|
+
recovery?: {
|
|
1696
|
+
mode: 'replayed' | 'forced' | 'recovered' | 'joined';
|
|
1697
|
+
sourceRunId?: string;
|
|
1698
|
+
};
|
|
1658
1699
|
error?: string;
|
|
1659
1700
|
/** Canonical explanation of what this run is doing or waiting on. */
|
|
1660
1701
|
activity?: PlayRunActivityProjection | null;
|
|
@@ -1699,6 +1740,11 @@ interface PlayRunPackage {
|
|
|
1699
1740
|
logs?: PlayRunActionPackage;
|
|
1700
1741
|
};
|
|
1701
1742
|
}
|
|
1743
|
+
/**
|
|
1744
|
+
* Stable classification of whether this run executed work or reused/recovered
|
|
1745
|
+
* an existing durable run outcome.
|
|
1746
|
+
*/
|
|
1747
|
+
type PlayRunOutcome = 'executed' | 'reused' | 'joined' | 'recovered' | 'forced' | 'waiting' | 'failed';
|
|
1702
1748
|
/**
|
|
1703
1749
|
* Current status of a play execution, returned by {@link DeeplineClient.getPlayStatus}.
|
|
1704
1750
|
*
|
|
@@ -1730,6 +1776,12 @@ interface PlayStatus {
|
|
|
1730
1776
|
dashboardUrl?: string;
|
|
1731
1777
|
/** Product-level play-run state. */
|
|
1732
1778
|
status: 'queued' | 'running' | 'waiting' | 'completed' | 'failed' | 'cancelled';
|
|
1779
|
+
/** How this run was admitted or recovered, when the server can prove it. */
|
|
1780
|
+
outcome?: PlayRunOutcome;
|
|
1781
|
+
recovery?: {
|
|
1782
|
+
mode: 'replayed' | 'forced' | 'recovered' | 'joined';
|
|
1783
|
+
sourceRunId?: string;
|
|
1784
|
+
};
|
|
1733
1785
|
/** Execution progress with logs and error details. */
|
|
1734
1786
|
progress?: PlayProgressStatus;
|
|
1735
1787
|
/** Partial or final result. Available once the play returns. */
|
package/dist/index.js
CHANGED
|
@@ -864,7 +864,7 @@ var SDK_RELEASE = {
|
|
|
864
864
|
// getters keep their established compatibility behavior.
|
|
865
865
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
866
866
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
867
|
-
version: "0.3.
|
|
867
|
+
version: "0.3.142",
|
|
868
868
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
869
869
|
packageCapabilities: {
|
|
870
870
|
updatePreferences: 1
|
package/dist/index.mjs
CHANGED
|
@@ -768,7 +768,7 @@ var SDK_RELEASE = {
|
|
|
768
768
|
// getters keep their established compatibility behavior.
|
|
769
769
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
770
770
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
771
|
-
version: "0.3.
|
|
771
|
+
version: "0.3.142",
|
|
772
772
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
773
773
|
packageCapabilities: {
|
|
774
774
|
updatePreferences: 1
|
package/dist/release.d.mts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.142";
|
|
153
153
|
readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
|
|
154
154
|
readonly packageCapabilities: {
|
|
155
155
|
readonly updatePreferences: 1;
|
package/dist/release.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.142";
|
|
153
153
|
readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
|
|
154
154
|
readonly packageCapabilities: {
|
|
155
155
|
readonly updatePreferences: 1;
|
package/dist/release.js
CHANGED
|
@@ -74,7 +74,7 @@ var SDK_RELEASE = {
|
|
|
74
74
|
// getters keep their established compatibility behavior.
|
|
75
75
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
76
76
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
77
|
-
version: "0.3.
|
|
77
|
+
version: "0.3.142",
|
|
78
78
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
79
79
|
packageCapabilities: {
|
|
80
80
|
updatePreferences: 1
|
package/dist/release.mjs
CHANGED
|
@@ -48,7 +48,7 @@ var SDK_RELEASE = {
|
|
|
48
48
|
// getters keep their established compatibility behavior.
|
|
49
49
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
50
50
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
51
|
-
version: "0.3.
|
|
51
|
+
version: "0.3.142",
|
|
52
52
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
53
53
|
packageCapabilities: {
|
|
54
54
|
updatePreferences: 1
|