@talonic/mcp 0.1.105 → 0.1.106
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 +103 -1
- package/dist/content.d.ts +22 -2
- package/dist/content.js +5662 -7848
- package/dist/content.js.map +1 -1
- package/dist/http-server.js +71 -66
- package/dist/http-server.js.map +1 -1
- package/dist/index.js +67 -65
- package/dist/index.js.map +1 -1
- package/dist/server.js +67 -65
- package/dist/server.js.map +1 -1
- package/package.json +2 -1
package/dist/server.js
CHANGED
|
@@ -2432,7 +2432,7 @@ var inputSchema = {
|
|
|
2432
2432
|
instructions: z.string().optional().describe(
|
|
2433
2433
|
"Natural-language guidance for the extractor, e.g. 'Focus on the billing section. Amounts are in EUR.'"
|
|
2434
2434
|
),
|
|
2435
|
-
include_markdown: z.boolean().optional().describe("
|
|
2435
|
+
include_markdown: z.boolean().optional().describe("Also return the document's full text as markdown, alongside the fields."),
|
|
2436
2436
|
include_provenance: z.boolean().optional().describe(
|
|
2437
2437
|
"Include per-field provenance (source_text, section, page) showing where each value was found in the document."
|
|
2438
2438
|
)
|
|
@@ -2481,7 +2481,7 @@ var outputSchema = {
|
|
|
2481
2481
|
document: z.string().optional(),
|
|
2482
2482
|
dashboard: z.string().optional()
|
|
2483
2483
|
}).optional().describe("URLs for self, document, and human-readable dashboard view."),
|
|
2484
|
-
markdown: z.string().optional().describe("
|
|
2484
|
+
markdown: z.string().optional().describe("The document's full text as markdown. Present only when `include_markdown: true`."),
|
|
2485
2485
|
cost: z.object({
|
|
2486
2486
|
costCredits: z.number().describe("Credits consumed by this call."),
|
|
2487
2487
|
costEur: z.number().describe("Approximate EUR cost of this call."),
|
|
@@ -2757,7 +2757,7 @@ function registerGetBalance(server, getTalonic) {
|
|
|
2757
2757
|
var DESCRIPTION4 = [
|
|
2758
2758
|
"Read Talonic's machine-readable credit pricing catalog: fixed per-unit rates so you can predict spend BEFORE running anything.",
|
|
2759
2759
|
"",
|
|
2760
|
-
"USE WHEN: estimating the cost of
|
|
2760
|
+
"USE WHEN: estimating the cost of planned work (reading documents, extracting fields, matching records), or answering a pricing question. Public \u2014 works without spending credits.",
|
|
2761
2761
|
"NOT FOR: the workspace's current balance (use talonic_get_balance) or what it has already spent (use talonic_get_usage).",
|
|
2762
2762
|
"ARGS: none.",
|
|
2763
2763
|
"RETURNS: currency, credits_per_eur, multipliers (e.g. batch 0.5x), and units[] \u2014 each { unit, label, credits, eur, free }."
|
|
@@ -2809,7 +2809,7 @@ function registerGetPricing(server, getTalonic) {
|
|
|
2809
2809
|
var DESCRIPTION5 = [
|
|
2810
2810
|
"Read the workspace's per-function credit consumption over a trailing window: where the credits actually went.",
|
|
2811
2811
|
"",
|
|
2812
|
-
"USE WHEN: the user asks what they have spent credits on, or you want to see which
|
|
2812
|
+
"USE WHEN: the user asks what they have spent credits on, or you want to see which kind of work (reading documents, structuring data, answering questions) takes most of the credits.",
|
|
2813
2813
|
"NOT FOR: the remaining balance (use talonic_get_balance) or per-unit rates (use talonic_get_pricing).",
|
|
2814
2814
|
"ARGS: days (optional, default 30, clamped 1-365).",
|
|
2815
2815
|
"RETURNS: period_days, total_credits, and by_function[] \u2014 each { operation_type, operations, credits }, highest spend first."
|
|
@@ -7926,7 +7926,7 @@ var outputValue = z.object({
|
|
|
7926
7926
|
var outputs = z.record(z.string().min(1), outputValue).describe(
|
|
7927
7927
|
"Output field key to { value, confidence?, reasoning?, escalate?, quote?, document_id? }. Use only declared fields."
|
|
7928
7928
|
);
|
|
7929
|
-
var pipelineId = zUuid().optional().describe("Optional
|
|
7929
|
+
var pipelineId = zUuid().optional().describe("Optional run UUID: only that run's tasks.");
|
|
7930
7930
|
var listInput = { status, limit, cursor, pipeline_id: pipelineId };
|
|
7931
7931
|
var idInput = { task_id: taskId };
|
|
7932
7932
|
var heartbeatInput = { task_id: taskId, execution_epoch: executionEpoch };
|
|
@@ -8089,39 +8089,39 @@ var MUTATING = {
|
|
|
8089
8089
|
};
|
|
8090
8090
|
var DESCRIPTIONS = {
|
|
8091
8091
|
list: [
|
|
8092
|
-
"List
|
|
8092
|
+
"List the agent tasks waiting in this workspace: checks a Spec hands to an outside agent (your agent) instead of a person, one per document.",
|
|
8093
8093
|
"",
|
|
8094
|
-
"USE WHEN: looking for
|
|
8094
|
+
"USE WHEN: looking for work for your agent to do; begin with status 'available'. To take a batch from one run (e.g. 'take 10 tasks of run X'), list with pipeline_id and status 'available', then claim each with talonic_claim_agent_task; a task another agent took returns HTTP 409, so skip it and take the next.",
|
|
8095
8095
|
"NOT FOR: reading the immutable task payload (use talonic_get_agent_task) or taking a lease (use talonic_claim_agent_task).",
|
|
8096
8096
|
"ARGS: optional status, pipeline_id, limit, and cursor. RETURNS: metadata only plus pagination.next_cursor."
|
|
8097
8097
|
].join("\n"),
|
|
8098
8098
|
get: [
|
|
8099
|
-
"
|
|
8099
|
+
"Read one agent task: its fixed input, instructions, and the output fields it expects. Each read is recorded against the task.",
|
|
8100
8100
|
"",
|
|
8101
8101
|
"USE WHEN: inspecting a listed task before deciding whether to process it.",
|
|
8102
8102
|
"NOT FOR: acquiring the task (use talonic_claim_agent_task) or returning results (use talonic_submit_agent_task).",
|
|
8103
8103
|
"ARGS: task_id. RETURNS: metadata, input_snapshot, output_contract, instructions, and timeout_fallthrough."
|
|
8104
8104
|
].join("\n"),
|
|
8105
8105
|
claim: [
|
|
8106
|
-
"Claim an available
|
|
8106
|
+
"Claim an available agent task so no one else works on it, or reclaim it after its lease expires.",
|
|
8107
8107
|
"",
|
|
8108
8108
|
"USE WHEN: ready to process a task. Save the returned execution_epoch and lease_expires_at.",
|
|
8109
8109
|
"NOT FOR: merely inspecting work (use talonic_get_agent_task) or extending an active lease (use talonic_heartbeat_agent_task).",
|
|
8110
8110
|
"A conflicting live claim returns HTTP 409. A successful claim returns the task payload: input_snapshot, instructions, and output_contract, whose entries carry each field's Spec rules (description) and allowed codes (enumValues). Review the documents against those rules."
|
|
8111
8111
|
].join("\n"),
|
|
8112
8112
|
heartbeat: [
|
|
8113
|
-
"Extend the lease on a claimed
|
|
8113
|
+
"Extend the lease on a claimed agent task so you keep it while you work.",
|
|
8114
8114
|
"",
|
|
8115
8115
|
"USE WHEN: processing may continue past lease_expires_at; heartbeat before expiry using the epoch from claim.",
|
|
8116
8116
|
"NOT FOR: acquiring a task (use talonic_claim_agent_task) or submitting finished outputs (use talonic_submit_agent_task).",
|
|
8117
8117
|
"ARGS: task_id and execution_epoch. Stale or foreign claims return HTTP 409."
|
|
8118
8118
|
].join("\n"),
|
|
8119
8119
|
submit: [
|
|
8120
|
-
"Submit
|
|
8120
|
+
"Submit the output fields for a claimed agent task; the document then continues through its Spec.",
|
|
8121
8121
|
"",
|
|
8122
8122
|
"USE WHEN: processing is complete and every required output in output_contract is ready.",
|
|
8123
8123
|
"NOT FOR: undeclared fields or partial lease maintenance (use talonic_heartbeat_agent_task).",
|
|
8124
|
-
"ARGS: task_id, execution_epoch, outputs keyed exactly by declared field key, and optional summary.
|
|
8124
|
+
"ARGS: task_id, execution_epoch, outputs keyed exactly by declared field key, and optional summary. Talonic checks every field and type before writing anything: all are saved or none."
|
|
8125
8125
|
].join("\n")
|
|
8126
8126
|
};
|
|
8127
8127
|
function registerAgentTaskTools(server, getToken, baseUrl) {
|
|
@@ -8938,10 +8938,10 @@ var DESTRUCTIVE = {
|
|
|
8938
8938
|
var AUTH_NOTE = "AUTH: a tlnc_ key needs a per-app 'decide' grant; an OAuth connector session needs the apps:decide scope (consented at connect) and a live workspace role of senior_member or above. A 403 (decide_grant_required, insufficient_scope, insufficient_tier) names what is missing \u2014 tell the user, do not retry.";
|
|
8939
8939
|
var DESCRIPTIONS2 = {
|
|
8940
8940
|
list: [
|
|
8941
|
-
"List one External-mode app's decision tasks (runs
|
|
8941
|
+
"List one External-mode app's decision tasks (runs waiting for an outside agent to decide), newest first.",
|
|
8942
8942
|
"",
|
|
8943
8943
|
"USE WHEN: looking for decisions to make for an app; begin with status 'available'. This is the polling alternative to the app.decision_task.offered webhook.",
|
|
8944
|
-
"NOT FOR:
|
|
8944
|
+
"NOT FOR: agent tasks on documents in a Spec (use talonic_list_agent_tasks), reading a task's input package (claim it, then talonic_read_decision_package), or taking a lease (talonic_claim_decision_task).",
|
|
8945
8945
|
"ARGS: app_id, optional status, limit, cursor. RETURNS: task metadata only (id, run_id, status, execution_epoch, lease and sla_deadline_at timing) plus pagination.next_cursor.",
|
|
8946
8946
|
AUTH_NOTE
|
|
8947
8947
|
].join("\n"),
|
|
@@ -8953,7 +8953,7 @@ var DESCRIPTIONS2 = {
|
|
|
8953
8953
|
AUTH_NOTE
|
|
8954
8954
|
].join("\n"),
|
|
8955
8955
|
package: [
|
|
8956
|
-
"Read one page of a claimed decision task's
|
|
8956
|
+
"Read one page of a claimed decision task's fixed input: the records the decision must be made from, each with the locator to cite as evidence. Only the current claimant may read it; each page read is recorded on the run.",
|
|
8957
8957
|
"",
|
|
8958
8958
|
"USE WHEN: after a successful claim, walking pages from package.first_cursor while pagination.has_more is true. The first page also carries the source documents list. A mining_round package is one record { system_prompt, first_turn, tools }.",
|
|
8959
8959
|
"NOT FOR: unclaimed tasks (HTTP 409; claim first) or listing tasks (talonic_list_decision_tasks).",
|
|
@@ -8969,7 +8969,7 @@ var DESCRIPTIONS2 = {
|
|
|
8969
8969
|
AUTH_NOTE
|
|
8970
8970
|
].join("\n"),
|
|
8971
8971
|
submit: [
|
|
8972
|
-
"Submit the decision for a claimed decision task;
|
|
8972
|
+
"Submit the decision for a claimed decision task; Talonic checks it before saving anything, then the run continues.",
|
|
8973
8973
|
"",
|
|
8974
8974
|
"USE WHEN: the decision is final. outcome must satisfy output_contract from the claim (plain JSON Schema, or the verdict_matrix / record_set envelope), evidence lists the package locators relied on (verbatim; [] only if the app allows unevidenced decisions), rationale is a short summary. Rejections are HTTP 422 with the reason and change nothing; the task stays claimed under your epoch, so fix and resubmit before the lease ends.",
|
|
8975
8975
|
"NOT FOR: giving the task back undecided (talonic_release_decision_task) or declaring it undecidable (talonic_fail_decision_task). Stale epoch is HTTP 409.",
|
|
@@ -8985,7 +8985,7 @@ var DESCRIPTIONS2 = {
|
|
|
8985
8985
|
AUTH_NOTE
|
|
8986
8986
|
].join("\n"),
|
|
8987
8987
|
fail: [
|
|
8988
|
-
"Report that the claimed decision task cannot be decided:
|
|
8988
|
+
"Report that the claimed decision task cannot be decided: sends it to a person for review with your reason AND applies the app's declared fallback policy (rules decide, hold for review, or fail the run).",
|
|
8989
8989
|
"",
|
|
8990
8990
|
"USE WHEN: the package is insufficient or contradictory and no claimant could decide it. This ends the task (status 'failed').",
|
|
8991
8991
|
"NOT FOR: temporary give-backs (talonic_release_decision_task) or a decision you can make with low confidence (submit it with confidence set).",
|
|
@@ -9310,7 +9310,7 @@ function probeMiningInUse(token, baseUrl) {
|
|
|
9310
9310
|
});
|
|
9311
9311
|
}
|
|
9312
9312
|
var DESCRIPTION11 = [
|
|
9313
|
-
"Get the
|
|
9313
|
+
"Get the full text of a document as markdown, including scanned pages.",
|
|
9314
9314
|
"",
|
|
9315
9315
|
"USE WHEN: the user wants the full text \u2014 'what does it say', summarise, or translate a document.",
|
|
9316
9316
|
"NOT FOR: specific structured fields (use talonic_extract with a schema).",
|
|
@@ -9335,7 +9335,7 @@ var inputSchema10 = {
|
|
|
9335
9335
|
};
|
|
9336
9336
|
var outputSchema11 = {
|
|
9337
9337
|
document_id: z.string().describe("ID of the document the markdown was extracted from."),
|
|
9338
|
-
markdown: z.string().describe("
|
|
9338
|
+
markdown: z.string().describe("The document's full text as markdown."),
|
|
9339
9339
|
cost: z.object({
|
|
9340
9340
|
costCredits: z.number(),
|
|
9341
9341
|
costEur: z.number(),
|
|
@@ -9416,11 +9416,11 @@ function registerToMarkdown(server, getTalonic, opts = {}) {
|
|
|
9416
9416
|
}
|
|
9417
9417
|
var MATURITIES = ["core", "proven", "candidate"];
|
|
9418
9418
|
var maturityArg = z.enum(MATURITIES).optional().describe(
|
|
9419
|
-
"Filter by maturity: `core` (
|
|
9419
|
+
"Filter by maturity: `core` (established and trusted, safe to build on), `proven` (recurring, stable id), `candidate` (seen recently, may still be merged or renamed)."
|
|
9420
9420
|
);
|
|
9421
9421
|
var fieldIdArg = zUuid().optional().describe("Field UUID (from talonic_list_fields / talonic_search).");
|
|
9422
9422
|
var fieldNameArg = z.string().min(1).optional().describe(
|
|
9423
|
-
"Field NAME instead of an id \u2014
|
|
9423
|
+
"Field NAME instead of an id \u2014 matched against the field's name, other spellings and synonyms, including fields that were merged into it. Use the user's wording ('Invoice No', 'Vertragsnummer')."
|
|
9424
9424
|
);
|
|
9425
9425
|
async function resolveFieldId(getToken, baseUrl, args) {
|
|
9426
9426
|
if (args.field_id) return { id: args.field_id };
|
|
@@ -9433,18 +9433,20 @@ async function resolveFieldId(getToken, baseUrl, args) {
|
|
|
9433
9433
|
};
|
|
9434
9434
|
}
|
|
9435
9435
|
var LIST_DESCRIPTION4 = [
|
|
9436
|
-
"List the workspace's
|
|
9436
|
+
"List the fields your workspace's documents carry (vendor name, invoice total, notice period \u2026), each with a stable id, how established it is (maturity), data type, synonyms and how often it occurs.",
|
|
9437
9437
|
"",
|
|
9438
9438
|
"USE WHEN: you need to know WHAT data exists before querying it, want to pick the right concept for a question, or need the exact field id for talonic_get_field / talonic_field_values.",
|
|
9439
|
-
"NOT FOR: locating a specific document (talonic_search) or filtering documents by a value (talonic_filter). Not a warm-up before answering a question about the documents: call talonic_ask for that.
|
|
9439
|
+
"NOT FOR: locating a specific document (talonic_search) or filtering documents by a value (talonic_filter). Not a warm-up before answering a question about the documents: call talonic_ask for that. Many fields are one-off candidates; pass maturity core or proven unless the user asks for candidates.",
|
|
9440
9440
|
"",
|
|
9441
|
-
"ARGS: `search` (case-insensitive contains on name), `maturity` (core | proven | candidate \u2014 prefer `core`/`proven` for anything you will build on), `include_superseded` (default false:
|
|
9441
|
+
"ARGS: `search` (case-insensitive contains on name), `maturity` (core | proven | candidate \u2014 prefer `core`/`proven` for anything you will build on), `include_superseded` (default false: fields merged into another are hidden so you never see two ids for one field), `limit`, `cursor`.",
|
|
9442
9442
|
"RETURNS: data[] of { id, canonical_name, display_name, data_type, maturity, tier, synonyms, description, occurrence_count, superseded_by, links } plus cursor pagination."
|
|
9443
9443
|
].join("\n");
|
|
9444
9444
|
var listFieldsInputSchema = {
|
|
9445
9445
|
search: z.string().optional().describe("Case-insensitive contains match on canonical_name / display_name."),
|
|
9446
9446
|
maturity: maturityArg,
|
|
9447
|
-
include_superseded: z.boolean().optional().describe(
|
|
9447
|
+
include_superseded: z.boolean().optional().describe(
|
|
9448
|
+
"Include fields merged into another one (they carry `superseded_by`). Default false."
|
|
9449
|
+
),
|
|
9448
9450
|
limit: z.number().int().min(1).max(100).optional().describe("Page size (default 20, max 100)."),
|
|
9449
9451
|
cursor: z.string().optional().describe("Opaque cursor from pagination.next_cursor.")
|
|
9450
9452
|
};
|
|
@@ -9462,20 +9464,18 @@ async function handleListFields(getToken, baseUrl, args) {
|
|
|
9462
9464
|
);
|
|
9463
9465
|
}
|
|
9464
9466
|
var GET_DESCRIPTION3 = [
|
|
9465
|
-
"
|
|
9467
|
+
"Describe one field: what it means, its synonyms and other names, maturity, where it occurs (document and occurrence counts, first and last seen, which document types), its values (top values with counts, distinct count, examples), which schemas use it, and the fields merged into it (superseded_by).",
|
|
9466
9468
|
"",
|
|
9467
|
-
"USE WHEN: you must decide whether a field is the right
|
|
9469
|
+
"USE WHEN: you must decide whether a field is the right one for a question, need example values or the value shape before writing a filter, or hold a field NAME from the user and need the field behind it.",
|
|
9468
9470
|
"NOT FOR: listing many fields (talonic_list_fields) or reading every value (talonic_field_values).",
|
|
9469
9471
|
"",
|
|
9470
|
-
"ARGS: exactly one of `field_id` or `name`.
|
|
9472
|
+
"ARGS: exactly one of `field_id` or `name`. A name is matched against field names, other spellings and synonyms and followed to the current field; `resolution` says how it matched. `include_history: true` adds the field's history (merges, renames, maturity changes).",
|
|
9471
9473
|
"RETURNS: the card { id, canonical_name, maturity, data_type, definition, identity, occurrence, values, usage, links } plus `resolution` when a name was given and `history` when requested."
|
|
9472
9474
|
].join("\n");
|
|
9473
9475
|
var getFieldInputSchema = {
|
|
9474
9476
|
field_id: fieldIdArg,
|
|
9475
9477
|
name: fieldNameArg,
|
|
9476
|
-
include_history: z.boolean().optional().describe(
|
|
9477
|
-
"Append the concept's curation history (tier changes, merges, renames), newest first."
|
|
9478
|
-
)
|
|
9478
|
+
include_history: z.boolean().optional().describe("Add the field's history (maturity changes, merges, renames), newest first.")
|
|
9479
9479
|
};
|
|
9480
9480
|
async function handleGetField(getToken, baseUrl, args) {
|
|
9481
9481
|
if (!args.field_id && !args.name) return validationError("Provide `field_id` or `name`.");
|
|
@@ -9503,9 +9503,9 @@ async function handleGetField(getToken, baseUrl, args) {
|
|
|
9503
9503
|
});
|
|
9504
9504
|
}
|
|
9505
9505
|
var VALUES_DESCRIPTION = [
|
|
9506
|
-
"Read a field's CURRENT VALUES across documents, with
|
|
9506
|
+
"Read a field's CURRENT VALUES across documents, with evidence: one row per value, with the document id, filename and type, the value, its confidence, the label it appeared under in the document, the exact source text, and how the label was matched to this field (`resolved_by`).",
|
|
9507
9507
|
"",
|
|
9508
|
-
"USE WHEN: the user asks 'what are all the X across my documents', you need to tabulate or
|
|
9508
|
+
"USE WHEN: the user asks 'what are all the X across my documents', you need to tabulate or total one field across all documents, or you want the evidence (source text + document) behind a value.",
|
|
9509
9509
|
"NOT FOR: multi-field row-shaped queries over documents (talonic_filter) or one document's full field set (talonic_get_document).",
|
|
9510
9510
|
"",
|
|
9511
9511
|
"ARGS: exactly one of `field_id` or `name`; optional `document_id` (one document), `value` (case-insensitive contains filter), `limit` (max 100), `cursor`.",
|
|
@@ -9611,13 +9611,13 @@ function unwrap(res) {
|
|
|
9611
9611
|
}
|
|
9612
9612
|
var documentIdsArg = z.array(zUuid()).max(1e3).optional().describe("Restrict to these document ids (hard filter, enforced server-side).");
|
|
9613
9613
|
var FIND_DESCRIPTION = [
|
|
9614
|
-
"
|
|
9614
|
+
"Find where the data behind a concept lives before querying anything: turns a phrase ('payment volume per transaction', 'counterparty', 'Vertragslaufzeit') into the fields, values, documents and text passages that carry it, matching what it means as well as its words, even when the field has a different name.",
|
|
9615
9615
|
"",
|
|
9616
|
-
"USE WHEN: the user asks about a concept and you are not sure which field holds it, when talonic_list_fields / talonic_search came back empty or ambiguous, or when the answer may
|
|
9616
|
+
"USE WHEN: the user asks about a concept and you are not sure which field holds it, when talonic_list_fields / talonic_search came back empty or ambiguous, or when the answer may sit in a document's text rather than in a field. Pass `account` whenever the question names one portfolio company (an account from talonic_list_accounts), so another company's figures cannot come back.",
|
|
9617
9617
|
"NOT FOR: reading a known field's values (talonic_field_values) or filtering by a known field (talonic_filter).",
|
|
9618
9618
|
"",
|
|
9619
9619
|
"ARGS: `query` (the concept, in the user's words), optional `concepts[]` (several concepts resolved to fields in one call; fields only, no text search), `top_k` (1\u201325, default 10), `document_ids` (hard scope), `account` (one account by name or alias, e.g. 'Filu'; narrows like document_ids; an unknown name returns an error listing the accounts).",
|
|
9620
|
-
"RETURNS: four ranked groups \u2014 FIELDS (canonical_name, field ids/keys, maturity, occurrence_count, sample values with their documents), VALUES, DOCUMENTS and PASSAGES \u2014 every item
|
|
9620
|
+
"RETURNS: four ranked groups \u2014 FIELDS (canonical_name, field ids/keys, maturity, occurrence_count, sample values with their documents), VALUES, DOCUMENTS and PASSAGES \u2014 every item ready to pass to the next call. Read-only."
|
|
9621
9621
|
].join("\n");
|
|
9622
9622
|
var findDataInputSchema = {
|
|
9623
9623
|
query: z.string().min(1).describe("The natural-language concept to locate."),
|
|
@@ -9652,14 +9652,14 @@ async function handleFindData(getToken, baseUrl, args) {
|
|
|
9652
9652
|
}
|
|
9653
9653
|
var DEDICATED = /* @__PURE__ */ new Set(["find_data"]);
|
|
9654
9654
|
var LIST_TOOLS_DESCRIPTION = [
|
|
9655
|
-
"List
|
|
9655
|
+
"List Talonic's data tools: read-only look-ups and queries over the workspace (find_data, describe_data, query_data for a read-only SQL query over the extracted data, get_document_markdown, workspace_overview, \u2026), each with its input schema and whether THIS credential may call it.",
|
|
9656
9656
|
"Target API: https://talonic.com/docs/api (GET /v1/agent/tools).",
|
|
9657
9657
|
"",
|
|
9658
9658
|
"USE WHEN: you want a capability talonic_* tools do not cover directly (e.g. SQL over the structured data, a workspace overview, cohort discovery) \u2014 list here, then call talonic_invoke_agent_tool with the tool name and its args.",
|
|
9659
|
-
"NOT FOR: answering the user's question about their documents \u2014 call talonic_ask, which
|
|
9659
|
+
"NOT FOR: answering the user's question about their documents \u2014 call talonic_ask, which answers in one call with citations. Also not for discovering fields (talonic_find_data) or documents (talonic_search).",
|
|
9660
9660
|
"",
|
|
9661
9661
|
"ARGS: `only_invocable` (default true \u2014 hide tools this credential cannot run), `include_schemas` (default true \u2014 include each tool's JSON input schema).",
|
|
9662
|
-
"RETURNS: { tools[] of { name, description, impact, capability, can_invoke, input_schema? }, invocable_count, totalCount }.
|
|
9662
|
+
"RETURNS: { tools[] of { name, description, impact, capability, can_invoke, input_schema? }, invocable_count, totalCount }. Data tools that already have their own talonic_* tool (find_data) are left out; call the dedicated tool."
|
|
9663
9663
|
].join("\n");
|
|
9664
9664
|
var listAgentToolsInputSchema = {
|
|
9665
9665
|
only_invocable: z.boolean().optional().describe("Hide tools this credential cannot invoke. Default true."),
|
|
@@ -9690,12 +9690,12 @@ async function handleListAgentTools(getToken, baseUrl, args) {
|
|
|
9690
9690
|
});
|
|
9691
9691
|
}
|
|
9692
9692
|
var INVOKE_DESCRIPTION = [
|
|
9693
|
-
"
|
|
9694
|
-
"READ-ONLY FOR EVERY CREDENTIAL: the platform runs each caller of this route, API key or OAuth session alike, as its least-privilege viewer role, which grants only the
|
|
9695
|
-
"Target API: Talonic
|
|
9693
|
+
"Run ONE named data tool directly and get its exact output (e.g. `query_data` for a read-only SQL SELECT over the extracted data, `describe_data` for the queryable field list, `get_document_markdown` to read a document's text).",
|
|
9694
|
+
"READ-ONLY FOR EVERY CREDENTIAL: the platform runs each caller of this route, API key or OAuth session alike, as its least-privilege viewer role, which grants only the read-only data tools (capability `data.read`). Tools that write are never invocable here, however you connected, so this tool reads and never changes workspace data.",
|
|
9695
|
+
"Target API: Talonic data tools \u2014 https://talonic.com/docs/api (POST /v1/agent/tools/{name}/invoke; input schemas from talonic_list_agent_tools).",
|
|
9696
9696
|
"",
|
|
9697
9697
|
"USE WHEN: talonic_list_agent_tools showed a tool with can_invoke: true that does what you need. Pass exactly the `args` its input_schema declares.",
|
|
9698
|
-
"NOT FOR: answering a question about the documents (talonic_ask
|
|
9698
|
+
"NOT FOR: answering a question about the documents (talonic_ask returns one cited answer). Use this only for a query the user asked for, or when talonic_ask could not answer.",
|
|
9699
9699
|
"",
|
|
9700
9700
|
"ARGS: `name` (tool name), `args` (object matching the tool's input_schema), optional `document_ids` (hard scope for scope-aware tools).",
|
|
9701
9701
|
"RETURNS: { tool, result (the tool's parsed output), citations?, artifacts?, cards? }. Denied capabilities come back as an error naming the capability required; the platform re-checks every call."
|
|
@@ -9803,15 +9803,15 @@ function registerAgentRegistryTools(server, getToken, baseUrl, opts = {}) {
|
|
|
9803
9803
|
);
|
|
9804
9804
|
}
|
|
9805
9805
|
var LIST_DESCRIPTION5 = [
|
|
9806
|
-
"List the workspace's Specs. A Spec is a saved
|
|
9806
|
+
"List the workspace's Specs. A Spec is a saved way of reading one kind of document: the fields it produces and the steps (reading, checks, look-ups, reviews) that fill them; talonic_run_spec runs it over documents. Each row: id, name, description, schema_id (the schema the run's output rows follow \u2014 a DIFFERENT id from the Spec's), version / materialized_version (the published version runs use; null = never published), field_count, node_count, timestamps.",
|
|
9807
9807
|
"",
|
|
9808
|
-
"USE WHEN: the user wants to run 'their
|
|
9808
|
+
"USE WHEN: the user wants to run 'their invoice Spec' / 'our contract set-up', or you need a spec_id for talonic_run_spec / talonic_get_spec.",
|
|
9809
9809
|
"NOT FOR: ad-hoc extraction schemas (talonic_list_schemas) or discovering fields (talonic_list_fields). Not a warm-up before answering a question about the documents: call talonic_ask for that.",
|
|
9810
9810
|
"ARGS: optional `search` (name contains, case-insensitive), `limit` (1\u2013100, default 20), `cursor` (from pagination.next_cursor), `order` (asc|desc by updated_at).",
|
|
9811
9811
|
"RETURNS: { data[] of { id, name, description, schema_id, version, materialized_version, materialized_at, field_count, node_count, created_at, updated_at, links }, pagination { total, limit, has_more, next_cursor } }."
|
|
9812
9812
|
].join("\n");
|
|
9813
9813
|
var GET_DESCRIPTION4 = [
|
|
9814
|
-
"Get one Spec's structure: identity and version state, the schema its output rows follow, `nodes[]` (the
|
|
9814
|
+
"Get one Spec's structure: identity and version state, the schema its output rows follow, `nodes[]` (the steps as the user set them up, in editing order), `phases[]` (the same steps in the order a run carries them out; one check can appear more than once, so the two lists can differ), and `fields[]` (Spec field \u2194 schema field).",
|
|
9815
9815
|
"",
|
|
9816
9816
|
"USE WHEN: you need to explain what a run will do, confirm a Spec is published (`version` non-null) before talonic_run_spec, or map field names to keys.",
|
|
9817
9817
|
"NOT FOR: listing Specs (talonic_list_specs) or starting a run (talonic_run_spec).",
|
|
@@ -9861,10 +9861,10 @@ function registerSpecTools(server, getToken, baseUrl) {
|
|
|
9861
9861
|
server.registerTool(
|
|
9862
9862
|
"talonic_list_specs",
|
|
9863
9863
|
{
|
|
9864
|
-
title: "List
|
|
9864
|
+
title: "List Specs",
|
|
9865
9865
|
description: LIST_DESCRIPTION5,
|
|
9866
9866
|
inputSchema: listSpecsInputSchema,
|
|
9867
|
-
annotations: { title: "List
|
|
9867
|
+
annotations: { title: "List Specs", ...READ_ONLY6 },
|
|
9868
9868
|
_meta: widgetToolMeta("listSpecs")
|
|
9869
9869
|
},
|
|
9870
9870
|
async (args) => handleListSpecs(getToken, baseUrl, args)
|
|
@@ -9872,10 +9872,10 @@ function registerSpecTools(server, getToken, baseUrl) {
|
|
|
9872
9872
|
server.registerTool(
|
|
9873
9873
|
"talonic_get_spec",
|
|
9874
9874
|
{
|
|
9875
|
-
title: "Look up a
|
|
9875
|
+
title: "Look up a Spec",
|
|
9876
9876
|
description: GET_DESCRIPTION4,
|
|
9877
9877
|
inputSchema: getSpecInputSchema,
|
|
9878
|
-
annotations: { title: "Look up a
|
|
9878
|
+
annotations: { title: "Look up a Spec", ...READ_ONLY6 },
|
|
9879
9879
|
_meta: widgetToolMeta("getSpec")
|
|
9880
9880
|
},
|
|
9881
9881
|
async (args) => handleGetSpec(getToken, baseUrl, args)
|
|
@@ -9888,15 +9888,15 @@ function mapRunStatus(raw) {
|
|
|
9888
9888
|
return "processing";
|
|
9889
9889
|
}
|
|
9890
9890
|
var RUN_DESCRIPTION3 = [
|
|
9891
|
-
"Run
|
|
9891
|
+
"Run one of the workspace's Specs over documents, in one call, and get one structured row per document. Two inputs: `document_ids` (documents already in the workspace; for a new file, first talonic_request_upload \u2192 poll talonic_get_document until completed) OR `file_urls` (public https files, max 20; Talonic fetches and reads them first). Consumes credits.",
|
|
9892
9892
|
"",
|
|
9893
|
-
"USE WHEN: the user wants to 'run the invoice
|
|
9893
|
+
"USE WHEN: the user wants to 'run the invoice Spec on these documents', process files through their Spec, or produce the Spec's structured rows.",
|
|
9894
9894
|
"NOT FOR: one-off extraction with an ad-hoc schema (talonic_extract), or checking progress (talonic_get_run) / reading rows (talonic_get_run_results).",
|
|
9895
|
-
"ARGS: `spec_id` (talonic_list_specs); exactly one of `document_ids[]` (1\u2013500) or `file_urls[]` (1\u201320, https); optional `name`, `pipeline_mode` (`new` default | `append` to the Spec's
|
|
9895
|
+
"ARGS: `spec_id` (talonic_list_specs); exactly one of `document_ids[]` (1\u2013500) or `file_urls[]` (1\u201320, https); optional `name`, `pipeline_mode` (`new` default | `append` to the Spec's current run); `batch_id` and flat `metadata` only with file_urls.",
|
|
9896
9896
|
"RETURNS: RunEnvelope { run_kind ('pipeline'|'run'), run_id, pipeline_id, spec_id, status ('processing'|'completed'|'failed'), raw_status, input_count, documents?, message?, links }. Then poll talonic_get_run with the `pipeline_id` when run_kind is 'pipeline', or with the `run_id` when it is 'run', every 5\u201310 s until status is completed/failed, then talonic_get_run_results."
|
|
9897
9897
|
].join("\n");
|
|
9898
9898
|
var GET_RUN_DESCRIPTION = [
|
|
9899
|
-
"Poll a Spec run started by talonic_run_spec: normalised status plus document
|
|
9899
|
+
"Poll a Spec run started by talonic_run_spec: normalised status plus progress per document and, for run_kind 'pipeline', per step.",
|
|
9900
9900
|
"",
|
|
9901
9901
|
"USE WHEN: waiting for a run to finish \u2014 poll every 5\u201310 s; stop on `completed` or `failed`.",
|
|
9902
9902
|
"NOT FOR: reading the structured rows (talonic_get_run_results) or starting a run (talonic_run_spec).",
|
|
@@ -9904,7 +9904,7 @@ var GET_RUN_DESCRIPTION = [
|
|
|
9904
9904
|
"RETURNS: { run_kind, run_id, pipeline_id, spec_id, status, raw_status, input_count?, progress { total_documents, completed_documents, error_documents, phases?[] }, documents?[], error_message?, created_at, updated_at }."
|
|
9905
9905
|
].join("\n");
|
|
9906
9906
|
var RESULTS_DESCRIPTION = [
|
|
9907
|
-
"Read a Spec run's structured rows \u2014 one row per document with the Spec's fields as clean values (held
|
|
9907
|
+
"Read a Spec run's structured rows \u2014 one row per document with the Spec's fields as clean values (values held for review come back null), plus the column definitions.",
|
|
9908
9908
|
"",
|
|
9909
9909
|
"USE WHEN: talonic_get_run reports `completed` (partial rows are also readable while `processing`).",
|
|
9910
9910
|
"NOT FOR: progress (talonic_get_run) or per-field provenance of a single value (include: ['provenance'] here, or talonic_field_values).",
|
|
@@ -9920,7 +9920,7 @@ var runSpecInputSchema = {
|
|
|
9920
9920
|
document_ids: documentIdsArg2,
|
|
9921
9921
|
file_urls: fileUrlsArg,
|
|
9922
9922
|
name: z.string().min(1).max(200).optional().describe("Display name for the run."),
|
|
9923
|
-
pipeline_mode: z.enum(["new", "append"]).optional().describe("`new` (default) or `append` to the Spec's
|
|
9923
|
+
pipeline_mode: z.enum(["new", "append"]).optional().describe("`new` (default) or `append` to the Spec's current run."),
|
|
9924
9924
|
batch_id: z.string().min(1).max(200).optional().describe("Caller grouping key (file_urls path only)."),
|
|
9925
9925
|
metadata: metadataArg
|
|
9926
9926
|
};
|
|
@@ -9930,7 +9930,7 @@ var runRefInputSchema = {
|
|
|
9930
9930
|
};
|
|
9931
9931
|
var resultsInputSchema = {
|
|
9932
9932
|
run_id: uuid.optional().describe(
|
|
9933
|
-
"The RunEnvelope's run_id. Alone: a run_kind 'run' submission (/v1/run). With pipeline_id:
|
|
9933
|
+
"The RunEnvelope's run_id. Alone: a run_kind 'run' submission (/v1/run). With pipeline_id: only the rows of that submission."
|
|
9934
9934
|
),
|
|
9935
9935
|
pipeline_id: uuid.optional().describe(
|
|
9936
9936
|
"The RunEnvelope's pipeline_id (run_kind 'pipeline'); rows come from /v1/pipelines/{id}/results."
|
|
@@ -10101,11 +10101,11 @@ function registerRunTools(server, getToken, baseUrl) {
|
|
|
10101
10101
|
server.registerTool(
|
|
10102
10102
|
"talonic_run_spec",
|
|
10103
10103
|
{
|
|
10104
|
-
title: "Run a
|
|
10104
|
+
title: "Run a Spec",
|
|
10105
10105
|
description: RUN_DESCRIPTION3,
|
|
10106
10106
|
inputSchema: runSpecInputSchema,
|
|
10107
10107
|
annotations: {
|
|
10108
|
-
title: "Run a
|
|
10108
|
+
title: "Run a Spec",
|
|
10109
10109
|
readOnlyHint: false,
|
|
10110
10110
|
destructiveHint: false,
|
|
10111
10111
|
openWorldHint: true
|
|
@@ -10142,9 +10142,9 @@ var ASK_DEFAULT_WAIT_S = 45;
|
|
|
10142
10142
|
var ASK_MAX_WAIT_S = 55;
|
|
10143
10143
|
var POLL_HINT = "still processing \u2014 call talonic_get_answer with this ask_id in a few seconds";
|
|
10144
10144
|
var ASK_DESCRIPTION = [
|
|
10145
|
-
"Ask a natural-language question over the workspace's documents and get a cited, verified answer (markdown).
|
|
10145
|
+
"Ask a natural-language question over the workspace's documents and get a cited, verified answer (markdown). Talonic looks across the extracted data and the documents' text, backs every claim that matters with a quote from a source document, and checks the answer before returning it. Consumes credits.",
|
|
10146
10146
|
"",
|
|
10147
|
-
"USE WHEN (the default for questions): the user asks anything about what their documents contain \u2014 counts, totals, duplicates, comparisons, anomalies ('which vendors invoiced us twice in May?'), or a summary across documents. One call replaces exploring fields, schemas,
|
|
10147
|
+
"USE WHEN (the default for questions): the user asks anything about what their documents contain \u2014 counts, totals, duplicates, comparisons, anomalies ('which vendors invoiced us twice in May?'), or a summary across documents. One call replaces exploring fields, schemas, Specs and queries yourself; skip that exploration.",
|
|
10148
10148
|
"NOT FOR: reading a known field's values (talonic_field_values, free) or filtering documents by a known value (talonic_filter, free); locating which field holds a concept (talonic_find_data).",
|
|
10149
10149
|
"ARGS: `question`; optional `scope` { document_ids[], schema_id, pipeline_id, data_product_id, document_type, source_id, tags[], ingested_after, ingested_before } (ANDed), `conversation_id` (continue a thread), `output_format` { instruction, template }, `wait_seconds` (0\u201355, default 45).",
|
|
10150
10150
|
"RETURNS: { ask_id, status ('completed'|'processing'|'error'), conversation_id, answer (markdown), citations[] { quote, document_id, kind, filename, app_url }, verification { verdict, checks_total, checks_unsupported, correction }, usage { tokens, credits_charged }, tool_calls, artifacts[], waited_ms }. If status is still 'processing' after the wait, call talonic_get_answer with the ask_id."
|
|
@@ -10161,7 +10161,7 @@ var uuid2 = zUuid();
|
|
|
10161
10161
|
var scopeSchema = z.object({
|
|
10162
10162
|
document_ids: z.array(uuid2).max(500).optional().describe("Only these documents."),
|
|
10163
10163
|
schema_id: uuid2.optional().describe("Only documents extracted with this schema."),
|
|
10164
|
-
pipeline_id: uuid2.optional().describe("Only documents of this
|
|
10164
|
+
pipeline_id: uuid2.optional().describe("Only documents of this Spec run."),
|
|
10165
10165
|
data_product_id: uuid2.optional().describe(
|
|
10166
10166
|
"Only documents of this data product (a curated document collection; rarely needed)."
|
|
10167
10167
|
),
|
|
@@ -10174,11 +10174,13 @@ var scopeSchema = z.object({
|
|
|
10174
10174
|
var askInputSchema = {
|
|
10175
10175
|
question: z.string().min(1).max(4e3).describe("The question, in the user's words."),
|
|
10176
10176
|
scope: scopeSchema,
|
|
10177
|
-
conversation_id: uuid2.optional().describe("Continue this conversation;
|
|
10177
|
+
conversation_id: uuid2.optional().describe("Continue this conversation; earlier questions and answers are taken into account."),
|
|
10178
10178
|
output_format: z.object({
|
|
10179
10179
|
instruction: z.string().max(1e3).optional(),
|
|
10180
10180
|
template: z.string().max(4e3).optional()
|
|
10181
|
-
}).optional().describe(
|
|
10181
|
+
}).optional().describe(
|
|
10182
|
+
"Shape the answer's layout (a table, a list, a template); never changes which sources it rests on."
|
|
10183
|
+
),
|
|
10182
10184
|
wait_seconds: z.number().int().min(0).max(ASK_MAX_WAIT_S).optional().describe(
|
|
10183
10185
|
`Seconds to wait for the answer before returning 'processing' (default ${ASK_DEFAULT_WAIT_S}, max ${ASK_MAX_WAIT_S}).`
|
|
10184
10186
|
)
|
|
@@ -12388,7 +12390,7 @@ function registerToolGroups(server, keys, getToken, baseUrl) {
|
|
|
12388
12390
|
|
|
12389
12391
|
// package.json
|
|
12390
12392
|
var package_default = {
|
|
12391
|
-
version: "0.1.
|
|
12393
|
+
version: "0.1.106"};
|
|
12392
12394
|
|
|
12393
12395
|
// src/version.ts
|
|
12394
12396
|
var VERSION = package_default.version;
|