@talonic/mcp 0.1.102 → 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/dist/index.js CHANGED
@@ -3667,9 +3667,9 @@ var readOnly = {
3667
3667
  idempotentHint: true,
3668
3668
  openWorldHint: false
3669
3669
  };
3670
- var write = (idempotent, destructive = false) => ({
3670
+ var write = (idempotent, destructive2 = false) => ({
3671
3671
  readOnlyHint: false,
3672
- destructiveHint: destructive,
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, destructive = false) => ({
4175
+ var write2 = (idempotent, destructive2 = false) => ({
4176
4176
  readOnlyHint: false,
4177
- destructiveHint: destructive,
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, destructive = false) => ({
4405
+ var write3 = (idempotent, destructive2 = false) => ({
4406
4406
  readOnlyHint: false,
4407
- destructiveHint: destructive,
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, destructive = false) => ({
5112
+ var write4 = (idempotent, destructive2 = false) => ({
5113
5113
  readOnlyHint: false,
5114
- destructiveHint: destructive,
5114
+ destructiveHint: destructive2,
5115
5115
  idempotentHint: idempotent,
5116
5116
  openWorldHint: false
5117
5117
  });
@@ -5735,12 +5735,35 @@ var write6 = {
5735
5735
  idempotentHint: false,
5736
5736
  openWorldHint: false
5737
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);
5738
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.";
5739
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.`;
5740
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.";
5741
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.";
5742
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.";
5743
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.";
5744
5767
  function registerProcessesTools(server, getToken, baseUrl) {
5745
5768
  const tools = [
5746
5769
  [
@@ -5846,6 +5869,244 @@ function registerProcessesTools(server, getToken, baseUrl) {
5846
5869
  }
5847
5870
  )
5848
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
+ )
5849
6110
  ]
5850
6111
  ];
5851
6112
  for (const [name, title, description, inputSchema11, annotations, handler] of tools) {
@@ -5862,9 +6123,9 @@ var readOnly7 = {
5862
6123
  idempotentHint: true,
5863
6124
  openWorldHint: false
5864
6125
  };
5865
- var write7 = (idempotent, destructive = false) => ({
6126
+ var write7 = (idempotent, destructive2 = false) => ({
5866
6127
  readOnlyHint: false,
5867
- destructiveHint: destructive,
6128
+ destructiveHint: destructive2,
5868
6129
  idempotentHint: idempotent,
5869
6130
  openWorldHint: false
5870
6131
  });
@@ -6092,9 +6353,9 @@ var readOnly8 = {
6092
6353
  idempotentHint: true,
6093
6354
  openWorldHint: false
6094
6355
  };
6095
- var write8 = (idempotent, destructive = false) => ({
6356
+ var write8 = (idempotent, destructive2 = false) => ({
6096
6357
  readOnlyHint: false,
6097
- destructiveHint: destructive,
6358
+ destructiveHint: destructive2,
6098
6359
  idempotentHint: idempotent,
6099
6360
  openWorldHint: false
6100
6361
  });
@@ -8044,7 +8305,7 @@ async function handleListFields(getToken, baseUrl, args) {
8044
8305
  })
8045
8306
  );
8046
8307
  }
8047
- var GET_DESCRIPTION2 = [
8308
+ var GET_DESCRIPTION3 = [
8048
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).",
8049
8310
  "",
8050
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.",
@@ -8146,7 +8407,7 @@ function registerFieldTools(server, getToken, baseUrl) {
8146
8407
  "talonic_get_field",
8147
8408
  {
8148
8409
  title: "Look up a field",
8149
- description: GET_DESCRIPTION2,
8410
+ description: GET_DESCRIPTION3,
8150
8411
  inputSchema: getFieldInputSchema,
8151
8412
  annotations: {
8152
8413
  title: "Look up a field",
@@ -8387,7 +8648,7 @@ var LIST_DESCRIPTION5 = [
8387
8648
  "ARGS: optional `search` (name contains, case-insensitive), `limit` (1\u2013100, default 20), `cursor` (from pagination.next_cursor), `order` (asc|desc by updated_at).",
8388
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 } }."
8389
8650
  ].join("\n");
8390
- var GET_DESCRIPTION3 = [
8651
+ var GET_DESCRIPTION4 = [
8391
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).",
8392
8653
  "",
8393
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.",
@@ -8450,7 +8711,7 @@ function registerSpecTools(server, getToken, baseUrl) {
8450
8711
  "talonic_get_spec",
8451
8712
  {
8452
8713
  title: "Look up a pipeline",
8453
- description: GET_DESCRIPTION3,
8714
+ description: GET_DESCRIPTION4,
8454
8715
  inputSchema: getSpecInputSchema,
8455
8716
  annotations: { title: "Look up a pipeline", ...READ_ONLY4 },
8456
8717
  _meta: widgetToolMeta("getSpec")
@@ -8855,7 +9116,7 @@ function registerAskTools(server, getToken, baseUrl) {
8855
9116
 
8856
9117
  // package.json
8857
9118
  var package_default = {
8858
- version: "0.1.102"};
9119
+ version: "0.1.103"};
8859
9120
 
8860
9121
  // src/version.ts
8861
9122
  var VERSION = package_default.version;