@talonic/mcp 0.1.101 → 0.1.103
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 +12 -0
- package/dist/http-server.js +470 -69
- package/dist/http-server.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +465 -68
- package/dist/index.js.map +1 -1
- package/dist/server.js +482 -71
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3667,9 +3667,9 @@ var readOnly = {
|
|
|
3667
3667
|
idempotentHint: true,
|
|
3668
3668
|
openWorldHint: false
|
|
3669
3669
|
};
|
|
3670
|
-
var write = (idempotent,
|
|
3670
|
+
var write = (idempotent, destructive2 = false) => ({
|
|
3671
3671
|
readOnlyHint: false,
|
|
3672
|
-
destructiveHint:
|
|
3672
|
+
destructiveHint: destructive2,
|
|
3673
3673
|
idempotentHint: idempotent,
|
|
3674
3674
|
openWorldHint: false
|
|
3675
3675
|
});
|
|
@@ -4172,9 +4172,9 @@ var readOnly2 = {
|
|
|
4172
4172
|
idempotentHint: true,
|
|
4173
4173
|
openWorldHint: false
|
|
4174
4174
|
};
|
|
4175
|
-
var write2 = (idempotent,
|
|
4175
|
+
var write2 = (idempotent, destructive2 = false) => ({
|
|
4176
4176
|
readOnlyHint: false,
|
|
4177
|
-
destructiveHint:
|
|
4177
|
+
destructiveHint: destructive2,
|
|
4178
4178
|
idempotentHint: idempotent,
|
|
4179
4179
|
openWorldHint: false
|
|
4180
4180
|
});
|
|
@@ -4402,9 +4402,9 @@ var readOnly3 = {
|
|
|
4402
4402
|
idempotentHint: true,
|
|
4403
4403
|
openWorldHint: false
|
|
4404
4404
|
};
|
|
4405
|
-
var write3 = (idempotent,
|
|
4405
|
+
var write3 = (idempotent, destructive2 = false) => ({
|
|
4406
4406
|
readOnlyHint: false,
|
|
4407
|
-
destructiveHint:
|
|
4407
|
+
destructiveHint: destructive2,
|
|
4408
4408
|
idempotentHint: idempotent,
|
|
4409
4409
|
openWorldHint: false
|
|
4410
4410
|
});
|
|
@@ -5109,9 +5109,9 @@ var readOnly4 = {
|
|
|
5109
5109
|
idempotentHint: true,
|
|
5110
5110
|
openWorldHint: false
|
|
5111
5111
|
};
|
|
5112
|
-
var write4 = (idempotent,
|
|
5112
|
+
var write4 = (idempotent, destructive2 = false) => ({
|
|
5113
5113
|
readOnlyHint: false,
|
|
5114
|
-
destructiveHint:
|
|
5114
|
+
destructiveHint: destructive2,
|
|
5115
5115
|
idempotentHint: idempotent,
|
|
5116
5116
|
openWorldHint: false
|
|
5117
5117
|
});
|
|
@@ -5729,9 +5729,403 @@ var readOnly6 = {
|
|
|
5729
5729
|
idempotentHint: true,
|
|
5730
5730
|
openWorldHint: false
|
|
5731
5731
|
};
|
|
5732
|
-
var write6 =
|
|
5732
|
+
var write6 = {
|
|
5733
5733
|
readOnlyHint: false,
|
|
5734
|
-
destructiveHint:
|
|
5734
|
+
destructiveHint: false,
|
|
5735
|
+
idempotentHint: false,
|
|
5736
|
+
openWorldHint: false
|
|
5737
|
+
};
|
|
5738
|
+
var destructive = {
|
|
5739
|
+
readOnlyHint: false,
|
|
5740
|
+
destructiveHint: true,
|
|
5741
|
+
idempotentHint: false,
|
|
5742
|
+
openWorldHint: false
|
|
5743
|
+
};
|
|
5744
|
+
var BASE = "/v1/processes";
|
|
5745
|
+
var pid = (a) => encodeURIComponent(a.process_id);
|
|
5746
|
+
var LIST_DESCRIPTION2 = "List the workspace's processes: name, live version (null = draft only), folder, tags and number of steps. Start here; use the id with the other talonic_process_* tools.";
|
|
5747
|
+
var RUN_DESCRIPTION = `Start a published process for one item with values by field name, e.g. {"Vendor": "Acme", "Amount": 1200}. Only for processes whose items are posted (started by hand, by another system or by a form). Returns the run id, and the process's reply when it has a reply step. Starting a process can send mail, call other systems and ask people to sign: call only when the user asks for it.`;
|
|
5748
|
+
var STATUS_DESCRIPTION4 = "Where a process run stands: per step, how many items are waiting, done or failed, and each item's state. Without run_id, the latest run.";
|
|
5749
|
+
var RUNS_DESCRIPTION2 = "Runs across all processes, newest first: state (running, completed, failed, stuck = open with a failed item), items done, waiting and failed. Filter by process or by runs waiting for the caller.";
|
|
5750
|
+
var WAITING_DESCRIPTION = "Sign-offs and forms waiting for the caller (the person behind the key): per process and step, how many items wait. Use talonic_process_status to see the items, then talonic_process_sign.";
|
|
5751
|
+
var SIGN_DESCRIPTION = "Sign a sign-off step of a run for the caller: approve all waiting items, or only `items`. A step that offers choices needs `decision` (one of its choices). Allowed only where the caller is assigned to the step. Signing moves real work on: call only when the user decides.";
|
|
5752
|
+
var GET_DESCRIPTION2 = "One process with its draft: fields, steps (id, kind, name, settings) and the arrows between them. Use it to see step ids before talonic_process_change with step_id, or to read what a process does.";
|
|
5753
|
+
var CREATE_DESCRIPTION2 = "Set up a new process as a DRAFT. Pass `description` in the user's own words (what comes in, what is read or checked, who decides, what goes out), or `workflow_json` with an exported n8n workflow to take it over. Nothing runs and nothing is sent until talonic_process_publish. The answer names what a person still has to choose (`stillOpen`, `questions`): tell the user those. Uses a model call for `description`.";
|
|
5754
|
+
var CHANGE_DESCRIPTION = "Change a process draft from an instruction in plain words: add, remove or reorder steps, change who decides, what is sent, any setting. With `step_id` only that step's settings change. Touches the draft only; the live version stays until talonic_process_publish. If the answer is `needs_confirmation`, NOTHING was saved: the change means fewer people or checks look at items. Tell the user exactly those points and ask; call again with `confirmed: true` only after they said yes, never on a first call.";
|
|
5755
|
+
var CHECK_DESCRIPTION = "What a draft still needs before it can go live (`stillNeeded`, per step), every problem the check finds, and what publishing would change against the live version. Call before talonic_process_publish and tell the user what is open.";
|
|
5756
|
+
var TEST_RUN_DESCRIPTION = "Run the DRAFT on real documents in a test copy: nothing is delivered, emailed or called. Steps not set up yet end the test (`endsAt`). Returns `processId` of the test copy and `runId`; follow with talonic_process_status on that processId.";
|
|
5757
|
+
var PUBLISH_DESCRIPTION = "Make the draft the LIVE version. From then on the process runs for real: it starts on what its start says (arriving documents, mail, another system), sends its mail and calls its systems. Refused while talonic_process_check finds an error. Call only when the user said to publish; show them talonic_process_check first.";
|
|
5758
|
+
var VERSIONS_DESCRIPTION = "The published versions of a process, newest first, with who published and why.";
|
|
5759
|
+
var ROLLBACK_DESCRIPTION = "Make an earlier published version live again. Changes what runs for real: call only when the user asks for it.";
|
|
5760
|
+
var DELETE_DESCRIPTION2 = "Delete a process. Not possible while a run is open. Cannot be undone: call only when the user asked to delete this process by name.";
|
|
5761
|
+
var ITEM_DESCRIPTION = "One item's way through a run, step by step (status, time, note such as why it stopped or where a mail went), and its values now. Item keys come from talonic_process_status.";
|
|
5762
|
+
var RETRY_DESCRIPTION = "Try every failed step of a run again. Steps that send or call will send or call again: use when the cause of the failure is fixed.";
|
|
5763
|
+
var SEND_BACK_DESCRIPTION = "Send items back from a sign-off step with a reason, for the caller: the opposite of talonic_process_sign. Allowed only where the caller is assigned. Moves real work: call only when the user decides.";
|
|
5764
|
+
var SETUP_DESCRIPTION = "What processes of this workspace can use: who a step can wait for (roles, groups), the connected mailboxes and whether each may send, the names of stored secrets (never values), and the shared data a look-up step can read. Connecting a mailbox and storing a secret happen in the Talonic web app, not here.";
|
|
5765
|
+
var MAILBOX_OWNERSHIP_DESCRIPTION = "Say whether a connected mailbox is one person's own (`individual`: only that person may put it on a process) or the company's (`company`: everyone who builds processes may). A governance decision: call only when the user asks.";
|
|
5766
|
+
var ADDRESS_DESCRIPTION = "The address other systems send items to (a webhook). Without `make` it only says whether one exists; the address itself is shown once, when made. With `make: true` it makes one and returns `path` to post to. An existing address is replaced only with `replace: true`: the old one stops working AT ONCE and whatever sends to it stops getting through, so ask the user first. `test: true` is the address of the test copy.";
|
|
5767
|
+
function registerProcessesTools(server, getToken, baseUrl) {
|
|
5768
|
+
const tools = [
|
|
5769
|
+
[
|
|
5770
|
+
"talonic_process_list",
|
|
5771
|
+
"Processes",
|
|
5772
|
+
LIST_DESCRIPTION2,
|
|
5773
|
+
{},
|
|
5774
|
+
readOnly6,
|
|
5775
|
+
() => runTool(() => apiJson(getToken, baseUrl, "GET", "/v1/processes"))
|
|
5776
|
+
],
|
|
5777
|
+
[
|
|
5778
|
+
"talonic_process_run",
|
|
5779
|
+
"Start a process for one item",
|
|
5780
|
+
RUN_DESCRIPTION,
|
|
5781
|
+
{
|
|
5782
|
+
process_id: zUuid().describe("The process id from talonic_process_list"),
|
|
5783
|
+
values: z.record(z.string(), z.unknown()).describe("Values by field name")
|
|
5784
|
+
},
|
|
5785
|
+
write6,
|
|
5786
|
+
(a) => runTool(
|
|
5787
|
+
() => apiJson(
|
|
5788
|
+
getToken,
|
|
5789
|
+
baseUrl,
|
|
5790
|
+
"POST",
|
|
5791
|
+
`/v1/processes/${encodeURIComponent(a.process_id)}/items`,
|
|
5792
|
+
{ body: { values: a.values ?? {} } }
|
|
5793
|
+
)
|
|
5794
|
+
)
|
|
5795
|
+
],
|
|
5796
|
+
[
|
|
5797
|
+
"talonic_process_status",
|
|
5798
|
+
"Process run status",
|
|
5799
|
+
STATUS_DESCRIPTION4,
|
|
5800
|
+
{
|
|
5801
|
+
process_id: zUuid().describe("The process id"),
|
|
5802
|
+
run_id: zUuid().optional().describe("A run id; default the latest run")
|
|
5803
|
+
},
|
|
5804
|
+
readOnly6,
|
|
5805
|
+
async (a) => runTool(async () => {
|
|
5806
|
+
const q = a.run_id ? `?run=${encodeURIComponent(a.run_id)}` : "";
|
|
5807
|
+
const id = encodeURIComponent(a.process_id);
|
|
5808
|
+
const [status3, items] = await Promise.all([
|
|
5809
|
+
apiJson(getToken, baseUrl, "GET", `/v1/processes/${id}/status${q}`),
|
|
5810
|
+
apiJson(getToken, baseUrl, "GET", `/v1/processes/${id}/items${q}`)
|
|
5811
|
+
]);
|
|
5812
|
+
return { status: status3, items };
|
|
5813
|
+
})
|
|
5814
|
+
],
|
|
5815
|
+
[
|
|
5816
|
+
"talonic_process_runs",
|
|
5817
|
+
"Process runs",
|
|
5818
|
+
RUNS_DESCRIPTION2,
|
|
5819
|
+
{
|
|
5820
|
+
state: z.enum(["running", "completed", "failed", "stuck"]).optional(),
|
|
5821
|
+
process_id: zUuid().optional(),
|
|
5822
|
+
waiting_for_me: z.boolean().optional(),
|
|
5823
|
+
page: z.number().int().min(0).optional()
|
|
5824
|
+
},
|
|
5825
|
+
readOnly6,
|
|
5826
|
+
(a) => {
|
|
5827
|
+
const q = new URLSearchParams();
|
|
5828
|
+
if (a.state) q.set("state", a.state);
|
|
5829
|
+
if (a.process_id) q.set("process", a.process_id);
|
|
5830
|
+
if (a.waiting_for_me) q.set("waitingForMe", "1");
|
|
5831
|
+
if (a.page) q.set("page", String(a.page));
|
|
5832
|
+
const qs = q.toString();
|
|
5833
|
+
return runTool(
|
|
5834
|
+
() => apiJson(getToken, baseUrl, "GET", `/v1/processes/runs${qs ? `?${qs}` : ""}`)
|
|
5835
|
+
);
|
|
5836
|
+
}
|
|
5837
|
+
],
|
|
5838
|
+
[
|
|
5839
|
+
"talonic_process_waiting_for_me",
|
|
5840
|
+
"Waiting for me",
|
|
5841
|
+
WAITING_DESCRIPTION,
|
|
5842
|
+
{},
|
|
5843
|
+
readOnly6,
|
|
5844
|
+
() => runTool(() => apiJson(getToken, baseUrl, "GET", "/v1/processes/waiting"))
|
|
5845
|
+
],
|
|
5846
|
+
[
|
|
5847
|
+
"talonic_process_sign",
|
|
5848
|
+
"Sign a process step",
|
|
5849
|
+
SIGN_DESCRIPTION,
|
|
5850
|
+
{
|
|
5851
|
+
process_id: zUuid(),
|
|
5852
|
+
run_id: zUuid(),
|
|
5853
|
+
step_id: z.string().min(1).max(64).describe("The sign-off step's id (stepId from talonic_process_waiting_for_me)"),
|
|
5854
|
+
items: z.array(z.string().min(1).max(200)).max(200).optional().describe("Item keys; default every waiting item"),
|
|
5855
|
+
decision: z.string().min(1).max(60).optional().describe("One of the step's choices, when it offers any")
|
|
5856
|
+
},
|
|
5857
|
+
write6,
|
|
5858
|
+
(a) => runTool(
|
|
5859
|
+
() => apiJson(
|
|
5860
|
+
getToken,
|
|
5861
|
+
baseUrl,
|
|
5862
|
+
"POST",
|
|
5863
|
+
`/v1/processes/${encodeURIComponent(a.process_id)}/runs/${encodeURIComponent(a.run_id)}/holds/${encodeURIComponent(a.step_id)}/release`,
|
|
5864
|
+
{
|
|
5865
|
+
body: {
|
|
5866
|
+
...a.items ? { items: a.items } : {},
|
|
5867
|
+
...a.decision ? { decision: a.decision } : {}
|
|
5868
|
+
}
|
|
5869
|
+
}
|
|
5870
|
+
)
|
|
5871
|
+
)
|
|
5872
|
+
],
|
|
5873
|
+
[
|
|
5874
|
+
"talonic_process_get",
|
|
5875
|
+
"One process",
|
|
5876
|
+
GET_DESCRIPTION2,
|
|
5877
|
+
{ process_id: zUuid().describe("The process id from talonic_process_list") },
|
|
5878
|
+
readOnly6,
|
|
5879
|
+
(a) => runTool(() => apiJson(getToken, baseUrl, "GET", `${BASE}/${pid(a)}`))
|
|
5880
|
+
],
|
|
5881
|
+
[
|
|
5882
|
+
"talonic_process_create",
|
|
5883
|
+
"New process draft",
|
|
5884
|
+
CREATE_DESCRIPTION2,
|
|
5885
|
+
{
|
|
5886
|
+
description: z.string().min(10).max(2e3).optional().describe("What the process should do, complete and in the user's words"),
|
|
5887
|
+
workflow_json: z.string().min(2).max(4e5).optional().describe("An exported n8n workflow as JSON text, instead of description")
|
|
5888
|
+
},
|
|
5889
|
+
write6,
|
|
5890
|
+
(a) => runTool(() => {
|
|
5891
|
+
if (a.workflow_json) {
|
|
5892
|
+
let workflow;
|
|
5893
|
+
try {
|
|
5894
|
+
workflow = JSON.parse(a.workflow_json);
|
|
5895
|
+
} catch {
|
|
5896
|
+
throw new Error("workflow_json is not valid JSON.");
|
|
5897
|
+
}
|
|
5898
|
+
return apiJson(getToken, baseUrl, "POST", BASE, { body: { workflow } });
|
|
5899
|
+
}
|
|
5900
|
+
if (!a.description) throw new Error("Pass description or workflow_json.");
|
|
5901
|
+
return apiJson(getToken, baseUrl, "POST", BASE, { body: { description: a.description } });
|
|
5902
|
+
})
|
|
5903
|
+
],
|
|
5904
|
+
[
|
|
5905
|
+
"talonic_process_change",
|
|
5906
|
+
"Change a process draft",
|
|
5907
|
+
CHANGE_DESCRIPTION,
|
|
5908
|
+
{
|
|
5909
|
+
process_id: zUuid(),
|
|
5910
|
+
change: z.string().min(1).max(2e3).describe("What should change, in plain words"),
|
|
5911
|
+
step_id: z.string().min(1).max(80).optional().describe("Only this step's settings (id from talonic_process_get)"),
|
|
5912
|
+
confirmed: z.boolean().optional().describe(
|
|
5913
|
+
"Leave out. true only after needs_confirmation was shown to the user and they agreed"
|
|
5914
|
+
)
|
|
5915
|
+
},
|
|
5916
|
+
write6,
|
|
5917
|
+
(a) => runTool(
|
|
5918
|
+
() => apiJson(getToken, baseUrl, "POST", `${BASE}/${pid(a)}/change`, {
|
|
5919
|
+
body: {
|
|
5920
|
+
change: a.change,
|
|
5921
|
+
...a.step_id ? { stepId: a.step_id } : {},
|
|
5922
|
+
...a.confirmed === true ? { confirmed: true } : {}
|
|
5923
|
+
}
|
|
5924
|
+
})
|
|
5925
|
+
)
|
|
5926
|
+
],
|
|
5927
|
+
[
|
|
5928
|
+
"talonic_process_check",
|
|
5929
|
+
"Check a process draft",
|
|
5930
|
+
CHECK_DESCRIPTION,
|
|
5931
|
+
{ process_id: zUuid() },
|
|
5932
|
+
readOnly6,
|
|
5933
|
+
async (a) => runTool(async () => {
|
|
5934
|
+
const [check, changes] = await Promise.all([
|
|
5935
|
+
apiJson(getToken, baseUrl, "GET", `${BASE}/${pid(a)}/check`),
|
|
5936
|
+
apiJson(getToken, baseUrl, "GET", `${BASE}/${pid(a)}/changes`)
|
|
5937
|
+
]);
|
|
5938
|
+
return { check, changes };
|
|
5939
|
+
})
|
|
5940
|
+
],
|
|
5941
|
+
[
|
|
5942
|
+
"talonic_process_test_run",
|
|
5943
|
+
"Test a process draft",
|
|
5944
|
+
TEST_RUN_DESCRIPTION,
|
|
5945
|
+
{
|
|
5946
|
+
process_id: zUuid(),
|
|
5947
|
+
document_ids: z.array(zUuid()).min(1).max(100).describe("Documents to run the draft on")
|
|
5948
|
+
},
|
|
5949
|
+
write6,
|
|
5950
|
+
(a) => runTool(
|
|
5951
|
+
() => apiJson(getToken, baseUrl, "POST", `${BASE}/${pid(a)}/test-run`, {
|
|
5952
|
+
body: { documentIds: a.document_ids }
|
|
5953
|
+
})
|
|
5954
|
+
)
|
|
5955
|
+
],
|
|
5956
|
+
[
|
|
5957
|
+
"talonic_process_publish",
|
|
5958
|
+
"Publish a process",
|
|
5959
|
+
PUBLISH_DESCRIPTION,
|
|
5960
|
+
{
|
|
5961
|
+
process_id: zUuid(),
|
|
5962
|
+
reason: z.string().max(2e3).optional().describe("Why this change, for the record")
|
|
5963
|
+
},
|
|
5964
|
+
destructive,
|
|
5965
|
+
(a) => runTool(
|
|
5966
|
+
() => apiJson(getToken, baseUrl, "POST", `${BASE}/${pid(a)}/publish`, {
|
|
5967
|
+
body: a.reason ? { reason: a.reason } : {}
|
|
5968
|
+
})
|
|
5969
|
+
)
|
|
5970
|
+
],
|
|
5971
|
+
[
|
|
5972
|
+
"talonic_process_versions",
|
|
5973
|
+
"Process versions",
|
|
5974
|
+
VERSIONS_DESCRIPTION,
|
|
5975
|
+
{ process_id: zUuid() },
|
|
5976
|
+
readOnly6,
|
|
5977
|
+
(a) => runTool(() => apiJson(getToken, baseUrl, "GET", `${BASE}/${pid(a)}/versions`))
|
|
5978
|
+
],
|
|
5979
|
+
[
|
|
5980
|
+
"talonic_process_rollback",
|
|
5981
|
+
"Roll a process back",
|
|
5982
|
+
ROLLBACK_DESCRIPTION,
|
|
5983
|
+
{
|
|
5984
|
+
process_id: zUuid(),
|
|
5985
|
+
version: z.number().int().min(1).describe("The version number to make live again")
|
|
5986
|
+
},
|
|
5987
|
+
destructive,
|
|
5988
|
+
(a) => runTool(
|
|
5989
|
+
() => apiJson(
|
|
5990
|
+
getToken,
|
|
5991
|
+
baseUrl,
|
|
5992
|
+
"POST",
|
|
5993
|
+
`${BASE}/${pid(a)}/versions/${encodeURIComponent(String(a.version))}/rollback`
|
|
5994
|
+
)
|
|
5995
|
+
)
|
|
5996
|
+
],
|
|
5997
|
+
[
|
|
5998
|
+
"talonic_process_delete",
|
|
5999
|
+
"Delete a process",
|
|
6000
|
+
DELETE_DESCRIPTION2,
|
|
6001
|
+
{ process_id: zUuid() },
|
|
6002
|
+
destructive,
|
|
6003
|
+
(a) => runTool(() => apiJson(getToken, baseUrl, "DELETE", `${BASE}/${pid(a)}`))
|
|
6004
|
+
],
|
|
6005
|
+
[
|
|
6006
|
+
"talonic_process_item",
|
|
6007
|
+
"One item of a run",
|
|
6008
|
+
ITEM_DESCRIPTION,
|
|
6009
|
+
{
|
|
6010
|
+
process_id: zUuid(),
|
|
6011
|
+
run_id: zUuid(),
|
|
6012
|
+
item_key: z.string().min(1).max(200).describe("The item's key (documentId) from the run")
|
|
6013
|
+
},
|
|
6014
|
+
readOnly6,
|
|
6015
|
+
(a) => runTool(
|
|
6016
|
+
() => apiJson(
|
|
6017
|
+
getToken,
|
|
6018
|
+
baseUrl,
|
|
6019
|
+
"GET",
|
|
6020
|
+
`${BASE}/${pid(a)}/runs/${encodeURIComponent(a.run_id)}/items/${encodeURIComponent(a.item_key)}`
|
|
6021
|
+
)
|
|
6022
|
+
)
|
|
6023
|
+
],
|
|
6024
|
+
[
|
|
6025
|
+
"talonic_process_retry",
|
|
6026
|
+
"Retry a run's failed steps",
|
|
6027
|
+
RETRY_DESCRIPTION,
|
|
6028
|
+
{ run_id: zUuid() },
|
|
6029
|
+
write6,
|
|
6030
|
+
(a) => runTool(
|
|
6031
|
+
() => apiJson(getToken, baseUrl, "POST", `${BASE}/runs/${encodeURIComponent(a.run_id)}/retry`)
|
|
6032
|
+
)
|
|
6033
|
+
],
|
|
6034
|
+
[
|
|
6035
|
+
"talonic_process_send_back",
|
|
6036
|
+
"Send items back from a sign-off",
|
|
6037
|
+
SEND_BACK_DESCRIPTION,
|
|
6038
|
+
{
|
|
6039
|
+
process_id: zUuid(),
|
|
6040
|
+
run_id: zUuid(),
|
|
6041
|
+
step_id: z.string().min(1).max(64),
|
|
6042
|
+
items: z.array(z.string().min(1).max(200)).min(1).max(200).describe("Item keys"),
|
|
6043
|
+
reason: z.string().min(1).max(2e3).describe("Why they go back, in the user's words")
|
|
6044
|
+
},
|
|
6045
|
+
write6,
|
|
6046
|
+
(a) => runTool(
|
|
6047
|
+
() => apiJson(
|
|
6048
|
+
getToken,
|
|
6049
|
+
baseUrl,
|
|
6050
|
+
"POST",
|
|
6051
|
+
`${BASE}/${pid(a)}/runs/${encodeURIComponent(a.run_id)}/holds/${encodeURIComponent(a.step_id)}/send-back`,
|
|
6052
|
+
{ body: { items: a.items, reason: a.reason } }
|
|
6053
|
+
)
|
|
6054
|
+
)
|
|
6055
|
+
],
|
|
6056
|
+
[
|
|
6057
|
+
"talonic_process_setup",
|
|
6058
|
+
"What processes can use",
|
|
6059
|
+
SETUP_DESCRIPTION,
|
|
6060
|
+
{},
|
|
6061
|
+
readOnly6,
|
|
6062
|
+
async () => runTool(async () => {
|
|
6063
|
+
const [people, mailboxes, secrets, lookupData] = await Promise.all([
|
|
6064
|
+
apiJson(getToken, baseUrl, "GET", `${BASE}/people`),
|
|
6065
|
+
apiJson(getToken, baseUrl, "GET", `${BASE}/mailboxes`),
|
|
6066
|
+
apiJson(getToken, baseUrl, "GET", `${BASE}/secrets`),
|
|
6067
|
+
apiJson(getToken, baseUrl, "GET", `${BASE}/lookup-data`)
|
|
6068
|
+
]);
|
|
6069
|
+
return { people, mailboxes, secrets, lookupData };
|
|
6070
|
+
})
|
|
6071
|
+
],
|
|
6072
|
+
[
|
|
6073
|
+
"talonic_process_mailbox_ownership",
|
|
6074
|
+
"Say whose a mailbox is",
|
|
6075
|
+
MAILBOX_OWNERSHIP_DESCRIPTION,
|
|
6076
|
+
{
|
|
6077
|
+
mailbox_id: zUuid().describe("The mailbox id from talonic_process_setup"),
|
|
6078
|
+
ownership: z.enum(["individual", "company"])
|
|
6079
|
+
},
|
|
6080
|
+
write6,
|
|
6081
|
+
(a) => runTool(
|
|
6082
|
+
() => apiJson(
|
|
6083
|
+
getToken,
|
|
6084
|
+
baseUrl,
|
|
6085
|
+
"PUT",
|
|
6086
|
+
`${BASE}/mailboxes/${encodeURIComponent(a.mailbox_id)}/ownership`,
|
|
6087
|
+
{ body: { ownership: a.ownership } }
|
|
6088
|
+
)
|
|
6089
|
+
)
|
|
6090
|
+
],
|
|
6091
|
+
[
|
|
6092
|
+
"talonic_process_address",
|
|
6093
|
+
"A process's address for other systems",
|
|
6094
|
+
ADDRESS_DESCRIPTION,
|
|
6095
|
+
{
|
|
6096
|
+
process_id: zUuid(),
|
|
6097
|
+
make: z.boolean().optional().describe("true: make the address. Default: only say whether one exists"),
|
|
6098
|
+
test: z.boolean().optional().describe("The address of the test copy"),
|
|
6099
|
+
replace: z.boolean().optional().describe("true only after the user agreed to switch the existing address off")
|
|
6100
|
+
},
|
|
6101
|
+
destructive,
|
|
6102
|
+
(a) => runTool(
|
|
6103
|
+
() => a.make === true ? apiJson(getToken, baseUrl, "PUT", `${BASE}/${pid(a)}/address`, {
|
|
6104
|
+
body: {
|
|
6105
|
+
...a.test === true ? { test: true } : {},
|
|
6106
|
+
...a.replace === true ? { replace: true } : {}
|
|
6107
|
+
}
|
|
6108
|
+
}) : apiJson(getToken, baseUrl, "GET", `${BASE}/${pid(a)}/address`)
|
|
6109
|
+
)
|
|
6110
|
+
]
|
|
6111
|
+
];
|
|
6112
|
+
for (const [name, title, description, inputSchema11, annotations, handler] of tools) {
|
|
6113
|
+
server.registerTool(
|
|
6114
|
+
name,
|
|
6115
|
+
{ title, description, inputSchema: inputSchema11, annotations: { title, ...annotations } },
|
|
6116
|
+
async (args) => handler(args)
|
|
6117
|
+
);
|
|
6118
|
+
}
|
|
6119
|
+
}
|
|
6120
|
+
var readOnly7 = {
|
|
6121
|
+
readOnlyHint: true,
|
|
6122
|
+
destructiveHint: false,
|
|
6123
|
+
idempotentHint: true,
|
|
6124
|
+
openWorldHint: false
|
|
6125
|
+
};
|
|
6126
|
+
var write7 = (idempotent, destructive2 = false) => ({
|
|
6127
|
+
readOnlyHint: false,
|
|
6128
|
+
destructiveHint: destructive2,
|
|
5735
6129
|
idempotentHint: idempotent,
|
|
5736
6130
|
openWorldHint: false
|
|
5737
6131
|
});
|
|
@@ -5767,7 +6161,7 @@ function handleSaveConfig2(getToken, baseUrl, args) {
|
|
|
5767
6161
|
})
|
|
5768
6162
|
);
|
|
5769
6163
|
}
|
|
5770
|
-
var
|
|
6164
|
+
var RUN_DESCRIPTION2 = [
|
|
5771
6165
|
"Resolve a domain now: read every configured source, match rows across systems, and replace the domain's golden records. Earlier accept / split decisions are kept. Deterministic; running it again on the same data gives the same records.",
|
|
5772
6166
|
"USE WHEN: the sources changed, or the domain has never been resolved.",
|
|
5773
6167
|
"NOT FOR: reading the result (talonic_master_records_overview).",
|
|
@@ -5885,7 +6279,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
|
|
|
5885
6279
|
"Read the Master Records configuration",
|
|
5886
6280
|
CONFIG_DESCRIPTION2,
|
|
5887
6281
|
{},
|
|
5888
|
-
|
|
6282
|
+
readOnly7,
|
|
5889
6283
|
() => handleConfig2(getToken, baseUrl)
|
|
5890
6284
|
],
|
|
5891
6285
|
[
|
|
@@ -5893,15 +6287,15 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
|
|
|
5893
6287
|
"Save the Master Records configuration",
|
|
5894
6288
|
SAVE_CONFIG_DESCRIPTION2,
|
|
5895
6289
|
saveConfigInputSchema2,
|
|
5896
|
-
|
|
6290
|
+
write7(true, true),
|
|
5897
6291
|
(a) => handleSaveConfig2(getToken, baseUrl, a)
|
|
5898
6292
|
],
|
|
5899
6293
|
[
|
|
5900
6294
|
"talonic_master_records_run",
|
|
5901
6295
|
"Resolve master records",
|
|
5902
|
-
|
|
6296
|
+
RUN_DESCRIPTION2,
|
|
5903
6297
|
runInputSchema,
|
|
5904
|
-
|
|
6298
|
+
write7(true),
|
|
5905
6299
|
(a) => handleRun(getToken, baseUrl, a)
|
|
5906
6300
|
],
|
|
5907
6301
|
[
|
|
@@ -5909,7 +6303,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
|
|
|
5909
6303
|
"Master records overview",
|
|
5910
6304
|
OVERVIEW_DESCRIPTION2,
|
|
5911
6305
|
overviewInputSchema,
|
|
5912
|
-
|
|
6306
|
+
readOnly7,
|
|
5913
6307
|
(a) => handleOverview2(getToken, baseUrl, a)
|
|
5914
6308
|
],
|
|
5915
6309
|
[
|
|
@@ -5917,7 +6311,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
|
|
|
5917
6311
|
"One golden record",
|
|
5918
6312
|
RECORD_DESCRIPTION,
|
|
5919
6313
|
recordInputSchema,
|
|
5920
|
-
|
|
6314
|
+
readOnly7,
|
|
5921
6315
|
(a) => handleGetRecord(getToken, baseUrl, a)
|
|
5922
6316
|
],
|
|
5923
6317
|
[
|
|
@@ -5925,7 +6319,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
|
|
|
5925
6319
|
"Accept or split a golden record",
|
|
5926
6320
|
DECIDE_DESCRIPTION2,
|
|
5927
6321
|
decideInputSchema2,
|
|
5928
|
-
|
|
6322
|
+
write7(true),
|
|
5929
6323
|
(a) => handleDecide2(getToken, baseUrl, a)
|
|
5930
6324
|
],
|
|
5931
6325
|
[
|
|
@@ -5933,7 +6327,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
|
|
|
5933
6327
|
"Master data changes checked against documents",
|
|
5934
6328
|
CHANGES_DESCRIPTION,
|
|
5935
6329
|
changesInputSchema,
|
|
5936
|
-
|
|
6330
|
+
readOnly7,
|
|
5937
6331
|
(a) => handleChanges(getToken, baseUrl, a)
|
|
5938
6332
|
],
|
|
5939
6333
|
[
|
|
@@ -5941,7 +6335,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
|
|
|
5941
6335
|
"Source id to golden record crosswalk",
|
|
5942
6336
|
CROSSWALK_DESCRIPTION,
|
|
5943
6337
|
crosswalkInputSchema,
|
|
5944
|
-
|
|
6338
|
+
readOnly7,
|
|
5945
6339
|
(a) => handleCrosswalk(getToken, baseUrl, a)
|
|
5946
6340
|
]
|
|
5947
6341
|
];
|
|
@@ -5953,15 +6347,15 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
|
|
|
5953
6347
|
);
|
|
5954
6348
|
}
|
|
5955
6349
|
}
|
|
5956
|
-
var
|
|
6350
|
+
var readOnly8 = {
|
|
5957
6351
|
readOnlyHint: true,
|
|
5958
6352
|
destructiveHint: false,
|
|
5959
6353
|
idempotentHint: true,
|
|
5960
6354
|
openWorldHint: false
|
|
5961
6355
|
};
|
|
5962
|
-
var
|
|
6356
|
+
var write8 = (idempotent, destructive2 = false) => ({
|
|
5963
6357
|
readOnlyHint: false,
|
|
5964
|
-
destructiveHint:
|
|
6358
|
+
destructiveHint: destructive2,
|
|
5965
6359
|
idempotentHint: idempotent,
|
|
5966
6360
|
openWorldHint: false
|
|
5967
6361
|
});
|
|
@@ -5979,7 +6373,7 @@ var SPECS_DESCRIPTION = [
|
|
|
5979
6373
|
function handleSpecs(getToken, baseUrl) {
|
|
5980
6374
|
return runTool(() => apiJson(getToken, baseUrl, "GET", "/v1/submissions/specs"));
|
|
5981
6375
|
}
|
|
5982
|
-
var
|
|
6376
|
+
var LIST_DESCRIPTION3 = [
|
|
5983
6377
|
"The inbox: every submission workbook of the workspace with its cedent, status (not_captured, captured, mapped, failed), captured values, facts and metrics under a target structure, and failed / warned checks.",
|
|
5984
6378
|
'USE WHEN: the headline ("which submissions are in, which are mapped, which have problems") or finding a submission by file name.',
|
|
5985
6379
|
"NOT FOR: what to fix (talonic_submissions_issues); the facts (talonic_submissions_export).",
|
|
@@ -6205,15 +6599,15 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6205
6599
|
"Submission target structures",
|
|
6206
6600
|
SPECS_DESCRIPTION,
|
|
6207
6601
|
{},
|
|
6208
|
-
|
|
6602
|
+
readOnly8,
|
|
6209
6603
|
() => handleSpecs(getToken, baseUrl)
|
|
6210
6604
|
],
|
|
6211
6605
|
[
|
|
6212
6606
|
"talonic_submissions_list",
|
|
6213
6607
|
"Submissions inbox",
|
|
6214
|
-
|
|
6608
|
+
LIST_DESCRIPTION3,
|
|
6215
6609
|
listInputSchema,
|
|
6216
|
-
|
|
6610
|
+
readOnly8,
|
|
6217
6611
|
(a) => handleList(getToken, baseUrl, a)
|
|
6218
6612
|
],
|
|
6219
6613
|
[
|
|
@@ -6221,7 +6615,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6221
6615
|
"Submissions worklist",
|
|
6222
6616
|
ISSUES_DESCRIPTION5,
|
|
6223
6617
|
issuesInputSchema3,
|
|
6224
|
-
|
|
6618
|
+
readOnly8,
|
|
6225
6619
|
(a) => handleIssues5(getToken, baseUrl, a)
|
|
6226
6620
|
],
|
|
6227
6621
|
[
|
|
@@ -6229,7 +6623,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6229
6623
|
"Capture and map submissions",
|
|
6230
6624
|
PROCESS_DESCRIPTION2,
|
|
6231
6625
|
processInputSchema2,
|
|
6232
|
-
|
|
6626
|
+
write8(true),
|
|
6233
6627
|
(a) => handleProcess2(getToken, baseUrl, a)
|
|
6234
6628
|
],
|
|
6235
6629
|
[
|
|
@@ -6237,7 +6631,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6237
6631
|
"Submission completeness",
|
|
6238
6632
|
COMPLETENESS_DESCRIPTION,
|
|
6239
6633
|
completenessInputSchema,
|
|
6240
|
-
|
|
6634
|
+
readOnly8,
|
|
6241
6635
|
(a) => handleCompleteness(getToken, baseUrl, a)
|
|
6242
6636
|
],
|
|
6243
6637
|
[
|
|
@@ -6245,7 +6639,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6245
6639
|
"Submission facts by metric and year",
|
|
6246
6640
|
MATRIX_DESCRIPTION,
|
|
6247
6641
|
matrixInputSchema,
|
|
6248
|
-
|
|
6642
|
+
readOnly8,
|
|
6249
6643
|
(a) => handleMatrix(getToken, baseUrl, a)
|
|
6250
6644
|
],
|
|
6251
6645
|
[
|
|
@@ -6253,7 +6647,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6253
6647
|
"Submission figures",
|
|
6254
6648
|
FACTS_DESCRIPTION,
|
|
6255
6649
|
factsInputSchema,
|
|
6256
|
-
|
|
6650
|
+
readOnly8,
|
|
6257
6651
|
(a) => handleFacts(getToken, baseUrl, a)
|
|
6258
6652
|
],
|
|
6259
6653
|
[
|
|
@@ -6261,7 +6655,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6261
6655
|
"Submission checks",
|
|
6262
6656
|
CHECKS_DESCRIPTION,
|
|
6263
6657
|
checksInputSchema,
|
|
6264
|
-
|
|
6658
|
+
readOnly8,
|
|
6265
6659
|
(a) => handleChecks(getToken, baseUrl, a)
|
|
6266
6660
|
],
|
|
6267
6661
|
[
|
|
@@ -6269,7 +6663,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6269
6663
|
"Review label mappings",
|
|
6270
6664
|
REVIEW_DESCRIPTION,
|
|
6271
6665
|
reviewInputSchema,
|
|
6272
|
-
|
|
6666
|
+
write8(true),
|
|
6273
6667
|
(a) => handleReview(getToken, baseUrl, a)
|
|
6274
6668
|
],
|
|
6275
6669
|
[
|
|
@@ -6277,7 +6671,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6277
6671
|
"Questions for the client's experts",
|
|
6278
6672
|
QUESTIONS_DESCRIPTION,
|
|
6279
6673
|
questionsInputSchema,
|
|
6280
|
-
|
|
6674
|
+
write8(true),
|
|
6281
6675
|
(a) => handleQuestions(getToken, baseUrl, a)
|
|
6282
6676
|
],
|
|
6283
6677
|
[
|
|
@@ -6285,7 +6679,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
|
|
|
6285
6679
|
"Export submission facts",
|
|
6286
6680
|
EXPORT_DESCRIPTION,
|
|
6287
6681
|
exportInputSchema,
|
|
6288
|
-
|
|
6682
|
+
readOnly8,
|
|
6289
6683
|
(a) => handleExport(getToken, baseUrl, a)
|
|
6290
6684
|
]
|
|
6291
6685
|
];
|
|
@@ -6302,7 +6696,7 @@ var INDEX_PERIOD_RE = /^\d{4}(-\d{2}|-Q[1-4]|-H[12])?$/;
|
|
|
6302
6696
|
var modelIdArg = zUuid().describe("Price model id (from talonic_price_baseline_models).");
|
|
6303
6697
|
var fromArg = z.string().regex(MONTH_RE).describe("First month of the evaluation window, `YYYY-MM`.");
|
|
6304
6698
|
var toArg = z.string().regex(MONTH_RE).describe("Last month of the evaluation window, `YYYY-MM`.");
|
|
6305
|
-
var
|
|
6699
|
+
var readOnly9 = {
|
|
6306
6700
|
readOnlyHint: true,
|
|
6307
6701
|
destructiveHint: false,
|
|
6308
6702
|
idempotentHint: true,
|
|
@@ -6909,7 +7303,7 @@ function handleImport2(getToken, baseUrl, args) {
|
|
|
6909
7303
|
);
|
|
6910
7304
|
}
|
|
6911
7305
|
function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
6912
|
-
const
|
|
7306
|
+
const write9 = (idempotent) => ({
|
|
6913
7307
|
readOnlyHint: false,
|
|
6914
7308
|
destructiveHint: false,
|
|
6915
7309
|
idempotentHint: idempotent,
|
|
@@ -6921,7 +7315,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
6921
7315
|
title: "Find contracts and invoices",
|
|
6922
7316
|
description: DOCUMENTS_DESCRIPTION,
|
|
6923
7317
|
inputSchema: documentsInputSchema,
|
|
6924
|
-
annotations:
|
|
7318
|
+
annotations: readOnly9
|
|
6925
7319
|
},
|
|
6926
7320
|
async (args) => handleDocuments(getToken, baseUrl, args)
|
|
6927
7321
|
);
|
|
@@ -6931,7 +7325,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
6931
7325
|
title: "Build or enrich a price model from a contract",
|
|
6932
7326
|
description: EXTRACT_DESCRIPTION,
|
|
6933
7327
|
inputSchema: extractInputSchema,
|
|
6934
|
-
annotations:
|
|
7328
|
+
annotations: write9(false)
|
|
6935
7329
|
},
|
|
6936
7330
|
async (args) => handleExtract2(getToken, baseUrl, args)
|
|
6937
7331
|
);
|
|
@@ -6941,7 +7335,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
6941
7335
|
title: "List or read price models",
|
|
6942
7336
|
description: MODELS_DESCRIPTION,
|
|
6943
7337
|
inputSchema: modelsInputSchema,
|
|
6944
|
-
annotations:
|
|
7338
|
+
annotations: readOnly9
|
|
6945
7339
|
},
|
|
6946
7340
|
async (args) => handleModels(getToken, baseUrl, args)
|
|
6947
7341
|
);
|
|
@@ -6951,7 +7345,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
6951
7345
|
title: "Edit or confirm a price model",
|
|
6952
7346
|
description: UPDATE_DESCRIPTION,
|
|
6953
7347
|
inputSchema: updateInputSchema,
|
|
6954
|
-
annotations:
|
|
7348
|
+
annotations: write9(true)
|
|
6955
7349
|
},
|
|
6956
7350
|
async (args) => handleUpdate(getToken, baseUrl, args)
|
|
6957
7351
|
);
|
|
@@ -6961,7 +7355,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
6961
7355
|
title: "Recompute contract prices",
|
|
6962
7356
|
description: PRICES_DESCRIPTION,
|
|
6963
7357
|
inputSchema: pricesInputSchema,
|
|
6964
|
-
annotations:
|
|
7358
|
+
annotations: readOnly9
|
|
6965
7359
|
},
|
|
6966
7360
|
async (args) => handlePrices(getToken, baseUrl, args)
|
|
6967
7361
|
);
|
|
@@ -6971,7 +7365,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
6971
7365
|
title: "Download the price baseline workbook",
|
|
6972
7366
|
description: WORKBOOK_DESCRIPTION,
|
|
6973
7367
|
inputSchema: workbookInputSchema,
|
|
6974
|
-
annotations:
|
|
7368
|
+
annotations: readOnly9
|
|
6975
7369
|
},
|
|
6976
7370
|
async (args) => handleWorkbook(getToken, baseUrl, args)
|
|
6977
7371
|
);
|
|
@@ -6981,7 +7375,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
6981
7375
|
title: "Check an invoice against the contract",
|
|
6982
7376
|
description: COMPARE_DESCRIPTION,
|
|
6983
7377
|
inputSchema: compareInputSchema,
|
|
6984
|
-
annotations:
|
|
7378
|
+
annotations: write9(false)
|
|
6985
7379
|
},
|
|
6986
7380
|
async (args) => handleCompare(getToken, baseUrl, args)
|
|
6987
7381
|
);
|
|
@@ -6991,7 +7385,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
6991
7385
|
title: "Audit-proof invoice",
|
|
6992
7386
|
description: PROOF_INVOICE_DESCRIPTION,
|
|
6993
7387
|
inputSchema: proofInvoiceInputSchema,
|
|
6994
|
-
annotations:
|
|
7388
|
+
annotations: readOnly9
|
|
6995
7389
|
},
|
|
6996
7390
|
async (args) => handleProofInvoice(getToken, baseUrl, args)
|
|
6997
7391
|
);
|
|
@@ -7001,7 +7395,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7001
7395
|
title: "Index catalog and values",
|
|
7002
7396
|
description: INDICES_DESCRIPTION,
|
|
7003
7397
|
inputSchema: indicesInputSchema,
|
|
7004
|
-
annotations:
|
|
7398
|
+
annotations: readOnly9
|
|
7005
7399
|
},
|
|
7006
7400
|
async (args) => handleIndices(getToken, baseUrl, args)
|
|
7007
7401
|
);
|
|
@@ -7011,7 +7405,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7011
7405
|
title: "Fetch public index values",
|
|
7012
7406
|
description: REFRESH_DESCRIPTION2,
|
|
7013
7407
|
inputSchema: refreshInputSchema,
|
|
7014
|
-
annotations: { ...
|
|
7408
|
+
annotations: { ...write9(true), openWorldHint: true }
|
|
7015
7409
|
},
|
|
7016
7410
|
async (args) => handleRefresh(getToken, baseUrl, args)
|
|
7017
7411
|
);
|
|
@@ -7021,7 +7415,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7021
7415
|
title: "Enter sourced index values",
|
|
7022
7416
|
description: MANUAL_DESCRIPTION,
|
|
7023
7417
|
inputSchema: manualInputSchema,
|
|
7024
|
-
annotations:
|
|
7418
|
+
annotations: write9(true)
|
|
7025
7419
|
},
|
|
7026
7420
|
async (args) => handleManual(getToken, baseUrl, args)
|
|
7027
7421
|
);
|
|
@@ -7031,7 +7425,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7031
7425
|
title: "Contract register and expected invoices",
|
|
7032
7426
|
description: REGISTER_DESCRIPTION2,
|
|
7033
7427
|
inputSchema: registerInputSchema2,
|
|
7034
|
-
annotations:
|
|
7428
|
+
annotations: readOnly9
|
|
7035
7429
|
},
|
|
7036
7430
|
async (args) => handleRegister2(getToken, baseUrl, args)
|
|
7037
7431
|
);
|
|
@@ -7041,7 +7435,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7041
7435
|
title: "Contract workbook and open inputs",
|
|
7042
7436
|
description: CONTRACT_DESCRIPTION3,
|
|
7043
7437
|
inputSchema: contractInputSchema3,
|
|
7044
|
-
annotations:
|
|
7438
|
+
annotations: readOnly9
|
|
7045
7439
|
},
|
|
7046
7440
|
async (args) => handleContract3(getToken, baseUrl, args)
|
|
7047
7441
|
);
|
|
@@ -7051,7 +7445,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7051
7445
|
title: "Answer an open contract input",
|
|
7052
7446
|
description: ANSWER_DESCRIPTION,
|
|
7053
7447
|
inputSchema: answerInputSchema,
|
|
7054
|
-
annotations:
|
|
7448
|
+
annotations: write9(true)
|
|
7055
7449
|
},
|
|
7056
7450
|
async (args) => handleAnswer(getToken, baseUrl, args)
|
|
7057
7451
|
);
|
|
@@ -7061,7 +7455,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7061
7455
|
title: "List assumptions",
|
|
7062
7456
|
description: ASSUMPTIONS_DESCRIPTION,
|
|
7063
7457
|
inputSchema: assumptionsInputSchema,
|
|
7064
|
-
annotations:
|
|
7458
|
+
annotations: readOnly9
|
|
7065
7459
|
},
|
|
7066
7460
|
async (args) => handleAssumptions(getToken, baseUrl, args)
|
|
7067
7461
|
);
|
|
@@ -7071,7 +7465,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7071
7465
|
title: "Make, replace or withdraw an assumption",
|
|
7072
7466
|
description: ASSUME_DESCRIPTION,
|
|
7073
7467
|
inputSchema: assumeInputSchema,
|
|
7074
|
-
annotations: { ...
|
|
7468
|
+
annotations: { ...write9(false), destructiveHint: true }
|
|
7075
7469
|
},
|
|
7076
7470
|
async (args) => handleAssume(getToken, baseUrl, args)
|
|
7077
7471
|
);
|
|
@@ -7081,7 +7475,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7081
7475
|
title: "Sync external price data",
|
|
7082
7476
|
description: SYNC_DESCRIPTION,
|
|
7083
7477
|
inputSchema: syncInputSchema,
|
|
7084
|
-
annotations: { ...
|
|
7478
|
+
annotations: { ...write9(true), openWorldHint: true }
|
|
7085
7479
|
},
|
|
7086
7480
|
async (args) => handleSync(getToken, baseUrl, args)
|
|
7087
7481
|
);
|
|
@@ -7091,7 +7485,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7091
7485
|
title: "Import candidates and status",
|
|
7092
7486
|
description: IMPORTS_DESCRIPTION,
|
|
7093
7487
|
inputSchema: importsInputSchema,
|
|
7094
|
-
annotations:
|
|
7488
|
+
annotations: readOnly9
|
|
7095
7489
|
},
|
|
7096
7490
|
async (args) => handleImports(getToken, baseUrl, args)
|
|
7097
7491
|
);
|
|
@@ -7101,7 +7495,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
|
|
|
7101
7495
|
title: "Import contracts from data capture",
|
|
7102
7496
|
description: IMPORT_DESCRIPTION2,
|
|
7103
7497
|
inputSchema: importInputSchema2,
|
|
7104
|
-
annotations:
|
|
7498
|
+
annotations: write9(true)
|
|
7105
7499
|
},
|
|
7106
7500
|
async (args) => handleImport2(getToken, baseUrl, args)
|
|
7107
7501
|
);
|
|
@@ -7882,7 +8276,7 @@ async function resolveFieldId(getToken, baseUrl, args) {
|
|
|
7882
8276
|
resolution: { matched_by: resolved.matched_by, redirected_from: resolved.redirected_from }
|
|
7883
8277
|
};
|
|
7884
8278
|
}
|
|
7885
|
-
var
|
|
8279
|
+
var LIST_DESCRIPTION4 = [
|
|
7886
8280
|
"List the workspace's Field Registry \u2014 the canonical concepts Talonic has discovered across every ingested document, each with a stable id, maturity level, data type, synonyms and occurrence count.",
|
|
7887
8281
|
"",
|
|
7888
8282
|
"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.",
|
|
@@ -7911,7 +8305,7 @@ async function handleListFields(getToken, baseUrl, args) {
|
|
|
7911
8305
|
})
|
|
7912
8306
|
);
|
|
7913
8307
|
}
|
|
7914
|
-
var
|
|
8308
|
+
var GET_DESCRIPTION3 = [
|
|
7915
8309
|
"Get the CONCEPT CARD for one Field Registry field: what it means (curated description + extraction instruction), its synonyms and aliases, maturity, where it occurs (document/occurrence counts, first/last seen, document-type spread), its value distribution (top values with counts, distinct count, examples), schema usage, and identity links (superseded_by, absorbed concepts).",
|
|
7916
8310
|
"",
|
|
7917
8311
|
"USE WHEN: you must decide whether a field is the right concept 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 live concept behind it.",
|
|
@@ -7996,7 +8390,7 @@ function registerFieldTools(server, getToken, baseUrl) {
|
|
|
7996
8390
|
"talonic_list_fields",
|
|
7997
8391
|
{
|
|
7998
8392
|
title: "List fields",
|
|
7999
|
-
description:
|
|
8393
|
+
description: LIST_DESCRIPTION4,
|
|
8000
8394
|
inputSchema: listFieldsInputSchema,
|
|
8001
8395
|
annotations: {
|
|
8002
8396
|
title: "List fields",
|
|
@@ -8013,7 +8407,7 @@ function registerFieldTools(server, getToken, baseUrl) {
|
|
|
8013
8407
|
"talonic_get_field",
|
|
8014
8408
|
{
|
|
8015
8409
|
title: "Look up a field",
|
|
8016
|
-
description:
|
|
8410
|
+
description: GET_DESCRIPTION3,
|
|
8017
8411
|
inputSchema: getFieldInputSchema,
|
|
8018
8412
|
annotations: {
|
|
8019
8413
|
title: "Look up a field",
|
|
@@ -8246,7 +8640,7 @@ function registerAgentRegistryTools(server, getToken, baseUrl, opts = {}) {
|
|
|
8246
8640
|
async (args) => handleInvokeAgentTool(getToken, baseUrl, args)
|
|
8247
8641
|
);
|
|
8248
8642
|
}
|
|
8249
|
-
var
|
|
8643
|
+
var LIST_DESCRIPTION5 = [
|
|
8250
8644
|
"List the workspace's Specs. A Spec is a saved extraction pipeline: an ordered list of processing steps plus the fields it produces; 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.",
|
|
8251
8645
|
"",
|
|
8252
8646
|
"USE WHEN: the user wants to run 'their pipeline' / 'the invoice Spec', or you need a spec_id for talonic_run_spec / talonic_get_spec.",
|
|
@@ -8254,7 +8648,7 @@ var LIST_DESCRIPTION4 = [
|
|
|
8254
8648
|
"ARGS: optional `search` (name contains, case-insensitive), `limit` (1\u2013100, default 20), `cursor` (from pagination.next_cursor), `order` (asc|desc by updated_at).",
|
|
8255
8649
|
"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 } }."
|
|
8256
8650
|
].join("\n");
|
|
8257
|
-
var
|
|
8651
|
+
var GET_DESCRIPTION4 = [
|
|
8258
8652
|
"Get one Spec's structure: identity and version state, the schema its output rows follow, `nodes[]` (the processing steps as the user configured them, in editing order), `phases[]` (the steps as they actually run, in run order; one configured validation step can run as several phases, so the two lists can differ), and `fields[]` (Spec field \u2194 schema field).",
|
|
8259
8653
|
"",
|
|
8260
8654
|
"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.",
|
|
@@ -8306,7 +8700,7 @@ function registerSpecTools(server, getToken, baseUrl) {
|
|
|
8306
8700
|
"talonic_list_specs",
|
|
8307
8701
|
{
|
|
8308
8702
|
title: "List pipelines",
|
|
8309
|
-
description:
|
|
8703
|
+
description: LIST_DESCRIPTION5,
|
|
8310
8704
|
inputSchema: listSpecsInputSchema,
|
|
8311
8705
|
annotations: { title: "List pipelines", ...READ_ONLY4 },
|
|
8312
8706
|
_meta: widgetToolMeta("listSpecs")
|
|
@@ -8317,7 +8711,7 @@ function registerSpecTools(server, getToken, baseUrl) {
|
|
|
8317
8711
|
"talonic_get_spec",
|
|
8318
8712
|
{
|
|
8319
8713
|
title: "Look up a pipeline",
|
|
8320
|
-
description:
|
|
8714
|
+
description: GET_DESCRIPTION4,
|
|
8321
8715
|
inputSchema: getSpecInputSchema,
|
|
8322
8716
|
annotations: { title: "Look up a pipeline", ...READ_ONLY4 },
|
|
8323
8717
|
_meta: widgetToolMeta("getSpec")
|
|
@@ -8331,7 +8725,7 @@ function mapRunStatus(raw) {
|
|
|
8331
8725
|
return "failed";
|
|
8332
8726
|
return "processing";
|
|
8333
8727
|
}
|
|
8334
|
-
var
|
|
8728
|
+
var RUN_DESCRIPTION3 = [
|
|
8335
8729
|
"Run a Spec \u2014 the customer's configured pipeline \u2014 over documents, in one call. 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 ingests them first). Consumes credits.",
|
|
8336
8730
|
"",
|
|
8337
8731
|
"USE WHEN: the user wants to 'run the invoice pipeline on these documents', process files through their Spec, or produce the Spec's structured rows.",
|
|
@@ -8546,7 +8940,7 @@ function registerRunTools(server, getToken, baseUrl) {
|
|
|
8546
8940
|
"talonic_run_spec",
|
|
8547
8941
|
{
|
|
8548
8942
|
title: "Run a pipeline",
|
|
8549
|
-
description:
|
|
8943
|
+
description: RUN_DESCRIPTION3,
|
|
8550
8944
|
inputSchema: runSpecInputSchema,
|
|
8551
8945
|
annotations: {
|
|
8552
8946
|
title: "Run a pipeline",
|
|
@@ -8722,7 +9116,7 @@ function registerAskTools(server, getToken, baseUrl) {
|
|
|
8722
9116
|
|
|
8723
9117
|
// package.json
|
|
8724
9118
|
var package_default = {
|
|
8725
|
-
version: "0.1.
|
|
9119
|
+
version: "0.1.103"};
|
|
8726
9120
|
|
|
8727
9121
|
// src/version.ts
|
|
8728
9122
|
var VERSION = package_default.version;
|
|
@@ -8911,6 +9305,9 @@ function createServer(options) {
|
|
|
8911
9305
|
if (options.includePortfolioTools) {
|
|
8912
9306
|
registerPortfolioTools(server, rawToken, baseUrl);
|
|
8913
9307
|
}
|
|
9308
|
+
if (options.includeProcessesTools) {
|
|
9309
|
+
registerProcessesTools(server, rawToken, baseUrl);
|
|
9310
|
+
}
|
|
8914
9311
|
if (options.includeMasterRecordsTools) {
|
|
8915
9312
|
registerMasterRecordsTools(server, rawToken, baseUrl);
|
|
8916
9313
|
}
|