@lerianstudio/matcher-mcp 5.0.0-beta.1 → 5.0.0-beta.10

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.
@@ -341,6 +341,11 @@ components:
341
341
  examples:
342
342
  - a1b2c3d4-5678-90ab-cdef-1234567890ab
343
343
  type: string
344
+ testable:
345
+ description: Whether Matcher can run a connectivity test for this connection's aggregator vendor
346
+ examples:
347
+ - true
348
+ type: boolean
344
349
  vendor:
345
350
  description: Aggregator vendor the connection is bound to
346
351
  enum:
@@ -355,6 +360,7 @@ components:
355
360
  - configName
356
361
  - baseUrl
357
362
  - accountRef
363
+ - testable
358
364
  type: object
359
365
  AggregatorConnectionListResponse:
360
366
  additionalProperties: false
@@ -878,6 +884,11 @@ components:
878
884
  BulkFailure:
879
885
  additionalProperties: false
880
886
  properties:
887
+ code:
888
+ description: Stable product error code for this row, when the failure has one
889
+ examples:
890
+ - MTCH-0514
891
+ type: string
881
892
  error:
882
893
  description: Human-readable reason the exception could not be processed
883
894
  examples:
@@ -1795,7 +1806,7 @@ components:
1795
1806
  properties:
1796
1807
  config:
1797
1808
  additionalProperties: {}
1798
- description: Source-specific configuration object (connection and parsing settings). Optional; defaults to an empty object when omitted.
1809
+ description: "Source-specific configuration object (connection and parsing settings). Optional; defaults to an empty object when omitted. Reserved key duplicate_key: the ordered list of mapped fields that make two rows the same row — any of external_id, amount, currency, date, description, fee_amount, fee_currency. Omit it and rows are deduplicated on external_id alone. A field this source's field map does not fill is refused, because a key over a field that is always empty makes every row a duplicate of every other. A source bound to an aggregator connection (reserved key connection_config_name) cannot carry a duplicate key of its own: the aggregator retracts a movement by naming its external id, so that id has to stay this source's row identity. A config holding both is refused in either direction — drop duplicate_key from a bound source, or disconnect the aggregator connection first. Reserved read-only key duplicate_key_changed_at: the RFC 3339 moment duplicate-key detection last changed meaning on this source, set by the server; a value sent by a client is discarded. It moves for either change that re-keys future rows — editing duplicate_key, or the field map remapping the column a declared field reads (a source keyed on description whose description column moves derives a different key for the same movement). Reserved key duplicate_policy: what happens to a row repeating the duplicate key — FLAG_AS_EXCEPTION (the default: the repeat is kept out of the import and raised as a duplicate exception on the row it repeated), KEEP_FIRST (the repeat is dropped and nothing is raised), or REJECT (the repeat is counted as an import error). Changing duplicate_key governs later imports only — rows already imported keep the key they were deduplicated under."
1799
1810
  type: object
1800
1811
  mapping:
1801
1812
  additionalProperties: {}
@@ -2225,7 +2236,7 @@ components:
2225
2236
  properties:
2226
2237
  config:
2227
2238
  additionalProperties: {}
2228
- description: Source-specific configuration object (connection and parsing settings). Optional; defaults to an empty object when omitted.
2239
+ description: "Source-specific configuration object (connection and parsing settings). Optional; defaults to an empty object when omitted. Reserved key duplicate_key: the ordered list of mapped fields that make two rows the same row — any of external_id, amount, currency, date, description, fee_amount, fee_currency. Omit it and rows are deduplicated on external_id alone. A field this source's field map does not fill is refused, because a key over a field that is always empty makes every row a duplicate of every other. A source bound to an aggregator connection (reserved key connection_config_name) cannot carry a duplicate key of its own: the aggregator retracts a movement by naming its external id, so that id has to stay this source's row identity. A config holding both is refused in either direction — drop duplicate_key from a bound source, or disconnect the aggregator connection first. Reserved read-only key duplicate_key_changed_at: the RFC 3339 moment duplicate-key detection last changed meaning on this source, set by the server; a value sent by a client is discarded. It moves for either change that re-keys future rows — editing duplicate_key, or the field map remapping the column a declared field reads (a source keyed on description whose description column moves derives a different key for the same movement). Reserved key duplicate_policy: what happens to a row repeating the duplicate key — FLAG_AS_EXCEPTION (the default: the repeat is kept out of the import and raised as a duplicate exception on the row it repeated), KEEP_FIRST (the repeat is dropped and nothing is raised), or REJECT (the repeat is counted as an import error). Changing duplicate_key governs later imports only — rows already imported keep the key they were deduplicated under."
2229
2240
  type: object
2230
2241
  name:
2231
2242
  description: Human-readable name of the source.
@@ -3966,6 +3977,11 @@ components:
3966
3977
  - "2025-01-15T00:00:00Z"
3967
3978
  format: date-time
3968
3979
  type: string
3980
+ dedupeKey:
3981
+ description: "Read-only: the duplicate-key value this row was imported under, derived from the source's duplicate key declaration at import time. A source can change that declaration later, so this is the only place that says which identity THIS row carries. Prefixed v1 when the key spells out the fields it was derived from, v1h when those fields were hashed because the spelled-out key was too long to index."
3982
+ examples:
3983
+ - v1|external_id=9:TXN-12345
3984
+ type: string
3969
3985
  description:
3970
3986
  description: Free-text description carried from the source
3971
3987
  examples:
@@ -4014,6 +4030,7 @@ components:
4014
4030
  - sourceId
4015
4031
  - contextId
4016
4032
  - externalId
4033
+ - dedupeKey
4017
4034
  - amount
4018
4035
  - currency
4019
4036
  - date
@@ -4048,17 +4065,17 @@ components:
4048
4065
  format: date-time
4049
4066
  type: string
4050
4067
  diagnosis:
4051
- description: Safe one-line diagnosis for a FAILED job (dialect diagnosis, rate-policy message, or generic safe message); empty for partial completed-with-errors jobs — internal error detail is never surfaced here
4068
+ description: Safe one-line diagnosis of anything the parser found worth reporting about the file (dialect mismatch, degraded settlement re-join, zero-detail file), the rate-policy message for policy-FAILED jobs, or a generic safe message for other FAILED jobs. Present on COMPLETED jobs too, including ones with zero failed rows; empty when there is nothing to report — internal error detail is never surfaced here
4052
4069
  examples:
4053
4070
  - file appears semicolon-delimited but the source declares comma; declare delimiter semicolon in the source dialect
4054
4071
  type: string
4055
4072
  droppedDuplicateReason:
4056
- description: "Display-only explanation of why droppedDuplicateRows rows were dropped: names the (source, external_id) collapsing key and the field mapping to check so the count does not read as silent data loss. Empty unless droppedDuplicateRows > 0"
4073
+ description: "Display-only explanation of why droppedDuplicateRows rows were kept out of the import: names the source's duplicate key as the identity that collided, says the repeats were attached as exceptions to the rows they repeated when the job flagged any (repeats of one row share one exception, so the queue holds one item per repeated row), and names the repeats that raised nothing when fewer were flagged than dropped, so the count does not read as silent data loss and the customer is sent to the configuration that decides it. Empty unless droppedDuplicateRows > 0"
4057
4074
  examples:
4058
- - Rows repeated a (source, external_id) key already present in this source and were dropped as duplicates. If unexpected, verify the field mapped to external_id is unique per row (a coarse or truncated mapping collapses distinct rows onto one key).
4075
+ - "Rows repeated the duplicate key this source deduplicates on and were kept out of the import. This source flags duplicates, so each repeat whose original was found was attached to that original as a duplicate exception in the exceptions queue. Repeats of the same original share one exception, so the queue holds one item per repeated row, not one per repeat. The rest found no imported row to attach to (another import of this source may still have been in progress), so no exception was raised for them and they are not in the queue: re-upload those rows once every import of this source has finished. If unexpected, review the source's duplicate key and the fields it names (a coarse or truncated mapping collapses distinct rows onto one key)."
4059
4076
  type: string
4060
4077
  droppedDuplicateRows:
4061
- description: Number of rows dropped as duplicates under the keep-first policy (same external_id within the upload or already persisted)
4078
+ description: Number of rows kept out of the import as duplicates (rows repeating the source's duplicate key within the upload or already persisted); see flaggedDuplicateRows for how many were also raised as exceptions
4062
4079
  examples:
4063
4080
  - 60
4064
4081
  format: int64
@@ -4085,7 +4102,7 @@ components:
4085
4102
  - transactions_2024.csv
4086
4103
  type: string
4087
4104
  flaggedDuplicateRows:
4088
- description: Number of dropped duplicates flagged as DUPLICATE_TRANSACTION exceptions under the FLAG_AS_EXCEPTION duplicate policy (subset of droppedDuplicateRows)
4105
+ description: "Number of dropped duplicate ROWS raised as DUPLICATE_TRANSACTION exceptions on the transaction they repeated, under the FLAG_AS_EXCEPTION duplicate policy — the default (subset of droppedDuplicateRows). Not a queue-item count: repeats of the same transaction share one exception, which carries how many times it was repeated"
4089
4106
  examples:
4090
4107
  - 15
4091
4108
  format: int64
@@ -6030,7 +6047,7 @@ components:
6030
6047
  type: string
6031
6048
  config:
6032
6049
  additionalProperties: {}
6033
- description: Source-specific configuration object (connection and parsing settings).
6050
+ description: Source-specific configuration object (connection and parsing settings). duplicate_key holds the ordered list of mapped fields that make two rows the same row; absent means rows are deduplicated on external_id alone. duplicate_key_changed_at is the server-set RFC 3339 moment duplicate-key detection last changed meaning on this source — either that list changing, or the field map remapping the column a declared field reads; rows imported before it keep the key they were deduplicated under.
6034
6051
  type: object
6035
6052
  contextId:
6036
6053
  description: Identifier of the context this source belongs to.
@@ -7356,7 +7373,7 @@ components:
7356
7373
  type: string
7357
7374
  config:
7358
7375
  additionalProperties: {}
7359
- description: Source-specific configuration object (connection and parsing settings).
7376
+ description: Source-specific configuration object (connection and parsing settings). duplicate_key holds the ordered list of mapped fields that make two rows the same row; absent means rows are deduplicated on external_id alone. duplicate_key_changed_at is the server-set RFC 3339 moment duplicate-key detection last changed meaning on this source — either that list changing, or the field map remapping the column a declared field reads; rows imported before it keep the key they were deduplicated under.
7360
7377
  type: object
7361
7378
  contextId:
7362
7379
  description: Identifier of the context this source belongs to.
@@ -7574,16 +7591,7 @@ components:
7574
7591
  - pluggy-main
7575
7592
  minLength: 1
7576
7593
  type: string
7577
- vendor:
7578
- description: "Aggregator vendor: pluggy or belvo"
7579
- enum:
7580
- - pluggy
7581
- - belvo
7582
- examples:
7583
- - pluggy
7584
- type: string
7585
7594
  required:
7586
- - vendor
7587
7595
  - configName
7588
7596
  type: object
7589
7597
  TestAggregatorConnectionResponse:
@@ -7668,6 +7676,11 @@ components:
7668
7676
  - "2025-01-15T00:00:00Z"
7669
7677
  format: date-time
7670
7678
  type: string
7679
+ dedupeKey:
7680
+ description: "Read-only: the duplicate-key value this row was imported under, derived from the source's duplicate key declaration at import time. A source can change that declaration later, so this is the only place that says which identity THIS row carries. Prefixed v1 when the key spells out the fields it was derived from, v1h when those fields were hashed because the spelled-out key was too long to index."
7681
+ examples:
7682
+ - v1|external_id=9:TXN-12345
7683
+ type: string
7671
7684
  description:
7672
7685
  description: Free-text description carried from the source
7673
7686
  examples:
@@ -7716,6 +7729,7 @@ components:
7716
7729
  - sourceId
7717
7730
  - contextId
7718
7731
  - externalId
7732
+ - dedupeKey
7719
7733
  - amount
7720
7734
  - currency
7721
7735
  - date
@@ -8102,7 +8116,7 @@ components:
8102
8116
  properties:
8103
8117
  config:
8104
8118
  additionalProperties: {}
8105
- description: Source-specific configuration object (connection and parsing settings).
8119
+ description: "Source-specific configuration object (connection and parsing settings). Reserved key duplicate_key: the ordered list of mapped fields that make two rows the same row — any of external_id, amount, currency, date, description, fee_amount, fee_currency. Send it empty of that key and rows are deduplicated on external_id alone. A field this source's field map does not fill is refused, because a key over a field that is always empty makes every row a duplicate of every other. A source bound to an aggregator connection (reserved key connection_config_name) cannot carry a duplicate key of its own: the aggregator retracts a movement by naming its external id, so that id has to stay this source's row identity. A config holding both is refused in either direction — drop duplicate_key from a bound source, or disconnect the aggregator connection first. Editing duplicate_key is allowed at any time and governs later imports only: rows already imported keep the key they were deduplicated under, and a duplicate straddling the change is knowingly not detected. Reserved read-only key duplicate_key_changed_at: the RFC 3339 moment duplicate-key detection last changed meaning on this source, set by the server; a value sent by a client is discarded. It moves for either change that re-keys future rows — editing duplicate_key, or the field map remapping the column a declared field reads (a source keyed on description whose description column moves derives a different key for the same movement). Reserved key duplicate_policy: what happens to a row repeating the duplicate key — FLAG_AS_EXCEPTION (the default: the repeat is kept out of the import and raised as a duplicate exception on the row it repeated), KEEP_FIRST (the repeat is dropped and nothing is raised), or REJECT (the repeat is counted as an import error)."
8106
8120
  type: object
8107
8121
  name:
8108
8122
  description: New human-readable name of the source.
@@ -10079,7 +10093,7 @@ paths:
10079
10093
  tags:
10080
10094
  - Configuration
10081
10095
  post:
10082
- description: "Creates a field map for a source within a context. Mapping keys form a closed vocabulary: required keys are external_id, amount, currency, date; optional keys are description, fee_amount, fee_currency. Values name source columns and must be non-empty strings."
10096
+ description: "Creates a field map for a source within a context. A source holds at most one field map: creating a second is rejected with a 409 carrying the configuration has-field-map code, and the caller should update the existing map instead. Mapping keys form a closed vocabulary: required keys are external_id, amount, currency, date; optional keys are description, fee_amount, fee_currency. Values name source columns and must be non-empty strings."
10083
10097
  operationId: createFieldMap
10084
10098
  parameters:
10085
10099
  - description: Context ID
@@ -10159,7 +10173,7 @@ paths:
10159
10173
  - Configuration
10160
10174
  /v1/discovery/aggregator-connections:
10161
10175
  get:
10162
- description: "Returns a cursor-paginated list of the tenant's Open-Finance data-aggregator (Pluggy/Belvo) connections, ordered by config name. The list is secret-free by construction: no credential material (clientId/secret/ciphertext) is ever returned."
10176
+ description: "Returns a cursor-paginated list of the tenant's Open-Finance data-aggregator (Pluggy/Belvo) connections, ordered by config name. The list is secret-free by construction: no credential material (clientId/secret/ciphertext) is ever returned. Each row carries `testable`, derived from the stored vendor, so a client knows whether the connectivity-test action can run at all without keeping its own vendor list."
10163
10177
  operationId: listAggregatorConnections
10164
10178
  parameters:
10165
10179
  - description: Maximum number of records to return
@@ -10227,7 +10241,7 @@ paths:
10227
10241
  - Discovery
10228
10242
  /v1/discovery/aggregator-connections/test:
10229
10243
  post:
10230
- description: "Runs a live connectivity check for an existing Open-Finance data-aggregator (Pluggy/Belvo) connection using its already-sealed credential, addressed by (vendor, configName). No credential is supplied or returned: the result is the secret-free boolean health of the connection."
10244
+ description: "Runs a live connectivity check for an existing Open-Finance data-aggregator (Pluggy/Belvo) connection using its already-sealed credential, addressed by configName. The vendor is read from the stored connection, not from the request. No credential is supplied or returned: the result is the secret-free boolean health of the connection. Two refusals are deliberately distinct: a config name matching no connection is 404 MTCH-0005, while a connection whose stored vendor Matcher has no test path for yet (Belvo today) is 422 MTCH-0210 and no test runs. The list endpoint's per-connection `testable` flag tells a client which is which before it offers the action."
10231
10245
  operationId: testAggregatorConnection
10232
10246
  requestBody:
10233
10247
  content:
@@ -12503,7 +12517,7 @@ paths:
12503
12517
  type: https://errors.lerian.studio/v1/MTCH-0108
12504
12518
  title: Conflict
12505
12519
  status: 409
12506
- detail: fee schedule is still in use; remove the fee rules and fee variance history that reference it before deleting it
12520
+ detail: This fee schedule is still referenced by fee rules; nothing was deleted. Remove the referencing fee rules, then retry the deletion.
12507
12521
  errors:
12508
12522
  - location: fee-schedule.delete.blocking-contexts
12509
12523
  value:
@@ -48,8 +48,10 @@ export function registerFieldMapCreateTool(server) {
48
48
  'required/optional keys and the critical external_id join-key rule). ' +
49
49
  "A source must be mapped (or be self-mapping, e.g. camt053) before a " +
50
50
  'context can be activated — see context_setup_progress to check ' +
51
- 'readiness. Returns the created field map, or a structured RFC 9457 ' +
52
- 'error naming every invalid/missing/unknown key.',
51
+ 'readiness. A source holds at most ONE field map: posting a second is ' +
52
+ 'refused with a 409 conflict, so use field_map_update to change the ' +
53
+ 'mapping a source already has. Returns the created field map, or a ' +
54
+ 'structured RFC 9457 error naming every invalid/missing/unknown key.',
53
55
  inputSchema: createFieldMapInputShape,
54
56
  }, async (args, extra) => {
55
57
  return dispatchFieldMap({
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/tools/field-map/create.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,0DAA0D;AAC1D,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,6EAA6E;AAC7E,uEAAuE;AACvE,8EAA8E;AAC9E,mCAAmC;AACnC,EAAE;AACF,2EAA2E;AAC3E,kDAAkD;AAElD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEvF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,sEAAsE;QACpE,iCAAiC,CACpC;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,0DAA0D,CAAC;IACvE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CACzE,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAyB;IAEzB,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAA;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAiB;IAC1D,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,WAAW,EACT,+DAA+D;YAC/D,kEAAkE;YAClE,sEAAsE;YACtE,iEAAiE;YACjE,sEAAsE;YACtE,sEAAsE;YACtE,iEAAiE;YACjE,qEAAqE;YACrE,iDAAiD;QACnD,WAAW,EAAE,wBAAwB;KACtC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,gBAAgB,CACrB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;YACvD,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;SACpC,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/tools/field-map/create.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,0DAA0D;AAC1D,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,6EAA6E;AAC7E,uEAAuE;AACvE,8EAA8E;AAC9E,mCAAmC;AACnC,EAAE;AACF,2EAA2E;AAC3E,kDAAkD;AAElD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEvF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,sEAAsE;QACpE,iCAAiC,CACpC;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,0DAA0D,CAAC;IACvE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CACzE,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAyB;IAEzB,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAA;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAiB;IAC1D,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,WAAW,EACT,+DAA+D;YAC/D,kEAAkE;YAClE,sEAAsE;YACtE,iEAAiE;YACjE,sEAAsE;YACtE,sEAAsE;YACtE,iEAAiE;YACjE,uEAAuE;YACvE,qEAAqE;YACrE,oEAAoE;YACpE,qEAAqE;QACvE,WAAW,EAAE,wBAAwB;KACtC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,gBAAgB,CACrB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;YACvD,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;SACpC,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -79,7 +79,13 @@ export function registerIngestionJobTransactionsListTool(server) {
79
79
  'sort_order (asc|desc), and/or sort_by ' +
80
80
  '(id|created_at|date|status|extraction_status). The response carries ' +
81
81
  '{ items, nextCursor } — paginate by re-calling with the returned ' +
82
- 'nextCursor. No tenant field is accepted.',
82
+ 'nextCursor. Each row carries a read-only dedupeKey: the duplicate-key ' +
83
+ 'identity that row was imported under. A source can change its ' +
84
+ 'duplicate-key declaration later, so this is the only place that says ' +
85
+ 'which identity THIS row carries — prefixed v1 when the key spells out ' +
86
+ 'the fields it was derived from, v1h when those fields were hashed ' +
87
+ 'because the spelled-out key was too long to index. No tenant field is ' +
88
+ 'accepted.',
83
89
  inputSchema: listJobTransactionsInputShape,
84
90
  }, async (args, extra) => {
85
91
  const query = buildListQuery(args);
@@ -1 +1 @@
1
- {"version":3,"file":"job-transactions-list.js","sourceRoot":"","sources":["../../../src/tools/ingestion/job-transactions-list.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,8DAA8D;AAC9D,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,uEAAuE;AACvE,iFAAiF;AACjF,iFAAiF;AAEjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI;IACJ,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,mBAAmB;CACX,CAAA;AAEV,gGAAgG;AAChG,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,yDAAyD,CAAC;IACtE,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,mEAAmE;QACjE,oEAAoE,CACvE;IACH,UAAU,EAAE,CAAC;SACV,IAAI,CAAC,WAAW,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,wBAAwB,CAAC;IACrC,OAAO,EAAE,CAAC;SACP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I,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;YAC5D,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1C,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"job-transactions-list.js","sourceRoot":"","sources":["../../../src/tools/ingestion/job-transactions-list.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,8DAA8D;AAC9D,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,uEAAuE;AACvE,iFAAiF;AACjF,iFAAiF;AAEjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI;IACJ,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,mBAAmB;CACX,CAAA;AAEV,gGAAgG;AAChG,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,yDAAyD,CAAC;IACtE,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,mEAAmE;QACjE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ACxE,WAAW;QACb,WAAW,EAAE,6BAA6B;KAC3C,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;QAClC,OAAO,iBAAiB,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,0BAA0B,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;YAC5D,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1C,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -128,8 +128,13 @@ export function registerIngestionTransactionsSearchTool(server) {
128
128
  'date_from/date_to (RFC 3339), reference (exact external ID), currency ' +
129
129
  '(ISO 4217), source_id (UUID), status ' +
130
130
  '(UNMATCHED|MATCHED|IGNORED|PENDING_REVIEW), limit (1–50), and offset ' +
131
- '(>= 0). Paginate by re-calling with a bumped offset. No tenant field is ' +
132
- 'accepted.',
131
+ '(>= 0). Paginate by re-calling with a bumped offset. Each row carries ' +
132
+ 'a read-only dedupeKey: the duplicate-key identity that row was ' +
133
+ 'imported under. A source can change its duplicate-key declaration ' +
134
+ 'later, so this is the only place that says which identity THIS row ' +
135
+ 'carries — prefixed v1 when the key spells out the fields it was ' +
136
+ 'derived from, v1h when those fields were hashed because the ' +
137
+ 'spelled-out key was too long to index. No tenant field is accepted.',
133
138
  inputSchema: searchTransactionsInputShape,
134
139
  }, async (args, extra) => {
135
140
  const query = buildSearchQuery(args);
@@ -1 +1 @@
1
- {"version":3,"file":"transactions-search.js","sourceRoot":"","sources":["../../../src/tools/ingestion/transactions-search.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,wDAAwD;AACxD,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,gFAAgF;AAChF,iFAAiF;AACjF,0EAA0E;AAC1E,i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E,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1C,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"transactions-search.js","sourceRoot":"","sources":["../../../src/tools/ingestion/transactions-search.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,wDAAwD;AACxD,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,gFAAgF;AAChF,iFAAiF;AACjF,0EAA0E;AAC1E,iFAAiF;AACjF,wCAAwC;AAExC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAE9E,kEAAkE;AAClE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW;IACX,SAAS;IACT,SAAS;IACT,gBAAgB;CACR,CAAA;AAEV,8GAA8G;AAC9G,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,sEAAsE;QACpE,4BAA4B,CAC/B;IACH,CAAC,EAAE,CAAC;SACD,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,sDAAsD,CAAC;IACnE,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,oEAAoE;QAClE,+CAA+C,CAClD;IACH,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,qEAAqE;QACnE,+CAA+C,CAClD;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,4DAA4D,CAAC;IACzE,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,SAAS,EAAE,CAAC;SACT,M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EAAoE;YACpE,qEAAqE;YACrE,kEAAkE;YAClE,8DAA8D;YAC9D,qEAAqE;QACvE,WAAW,EAAE,4BAA4B;KAC1C,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;QACpC,OAAO,iBAAiB,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,6BAA6B,CAAC,IAAI,CAAC,SAAS,CAAC;YACnD,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1C,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -86,8 +86,11 @@ export function registerIngestionUploadBeginTool(server) {
86
86
  '" then file=@<your-local-file>.',
87
87
  '4. On success matcher returns 202 with a jobId. POLL ingestion_job_get ' +
88
88
  '(with this contextId and that jobId) to watch status. COMPLETED and ' +
89
- 'FAILED are terminal; on FAILED read the `diagnosis` field for the ' +
90
- 'reason.',
89
+ 'FAILED are terminal. ALWAYS read the `diagnosis` field when present, ' +
90
+ 'on either terminal status: on FAILED it is the reason, and on ' +
91
+ 'COMPLETED — including a job with zero failed rows — it is a ' +
92
+ 'file-level note the operator must act on, such as a settlement ' +
93
+ 're-join that fell back to degraded attribution.',
91
94
  '5. SIZE CAP: the streaming route is governed by the operator-' +
92
95
  'configured runtime key ingestion.max_upload_bytes (default ~1 GiB; ' +
93
96
  'range 1 MiB–8 GiB). It counts the TOTAL request body — every part, ' +
@@ -1 +1 @@
1
- {"version":3,"file":"upload-begin.js","sourceRoot":"","sources":["../../../src/tools/ingestion/upload-begin.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E;AAC7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AE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAA;IACxE,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -49,7 +49,21 @@ export const createSourceInputShape = {
49
49
  .optional()
50
50
  .describe('Source-specific configuration object (connection and parsing settings). ' +
51
51
  'Optional; defaults to an empty object server-side when omitted. Its ' +
52
- 'shape depends on the source type and is validated server-side.'),
52
+ 'shape depends on the source type and is validated server-side. ' +
53
+ 'Reserved key duplicate_key: the ordered list of mapped fields that ' +
54
+ 'make two rows the same row (any of external_id, amount, currency, ' +
55
+ 'date, description, fee_amount, fee_currency); omit it and rows are ' +
56
+ 'deduplicated on external_id alone. A field the field map of this ' +
57
+ 'source does not fill is refused. A source bound to an aggregator ' +
58
+ 'connection (reserved key connection_config_name) cannot carry a ' +
59
+ 'duplicate key of its own — the aggregator retracts a movement by ' +
60
+ 'naming its external id, so that id has to stay the row identity; a ' +
61
+ 'config holding both is refused, so drop duplicate_key or disconnect ' +
62
+ 'the aggregator first. Reserved key duplicate_policy: what ' +
63
+ 'happens to a row repeating that key — FLAG_AS_EXCEPTION (the default: ' +
64
+ 'the repeat is kept out of the import and raised as a duplicate ' +
65
+ 'exception on the row it repeated), KEEP_FIRST (dropped, nothing ' +
66
+ 'raised) or REJECT (counted as an import error).'),
53
67
  };
54
68
  /**
55
69
  * Build the POST body from the input minus the path-only `contextId`. Only the
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/tools/source/create.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,6EAA6E;AAC7E,gFAAgF;AAChF,mBAAmB;AACnB,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAE5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,kBAA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CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EACT,oEAAoE;YACpE,4DAA4D;YAC5D,kEAAkE;YAClE,wEAAwE;YACxE,kDAAkD;YAClD,yEAAyE;YACzE,sEAAsE;YACtE,yEAAyE;YACzE,wEAAwE;QAC1E,WAAW,EAAE,sBAAsB;KACpC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,cAAc,CACnB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC;YACxC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC;SAC5B,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/tools/source/create.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,6EAA6E;AAC7E,gFAAgF;AAChF,mBAAmB;AACnB,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAE5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEhE,+FAA+F;AAC/F,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ;IACR,MAAM;IACN,SAAS;IACT,QAAQ;IACR,SAAS;CACD,CAAA;AAEV,qFAAqF;AACrF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAA;AAEtD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,wEAAwE;QACtE,yEAAyE;QACzE,iCAAiC,CACpC;IACH,IAAI,EAAE,CAAC;SACJ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AAO,cAAc,CACnB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC;YACxC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC;SAC5B,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -4,6 +4,13 @@
4
4
  // contextId on single-resource ops, so both contextId and sourceId are path
5
5
  // params. The source must belong to a context owned by the relayed token's
6
6
  // tenant — matcher enforces that; no tenant field is accepted.
7
+ //
8
+ // This is also where an operator READS the duplicate-key declaration back: which
9
+ // fields this source deduplicates on, and when that declaration last changed.
10
+ // The second half matters as much as the first — a key edit governs later
11
+ // imports only, so the change moment is the only way to tell which rows were
12
+ // deduplicated under which key. Both live in the returned `config`, so the tool
13
+ // description names them; the input shape stays the two path ids.
7
14
  import { z } from 'zod';
8
15
  import { contextSourcePath, dispatchSource } from './shared.js';
9
16
  /** Zod raw shape for `source_get` input — both path ids. */
@@ -29,7 +36,16 @@ export function registerSourceGetTool(server) {
29
36
  'Provide both contextId and sourceId (path params; contextId is not a ' +
30
37
  "tenant field). The source must belong to your token's tenant. Returns " +
31
38
  'the source, or a structured RFC 9457 error (e.g. 404 if it does not ' +
32
- 'exist or is not yours).',
39
+ 'exist or is not yours). In the returned config, duplicate_key is the ' +
40
+ 'ordered list of mapped fields that make two rows the same row — absent ' +
41
+ 'means rows are deduplicated on external_id alone — and ' +
42
+ 'duplicate_key_changed_at is the server-set RFC 3339 moment ' +
43
+ 'duplicate-key detection last changed meaning on this source: either ' +
44
+ 'that list changing, or the field map remapping the column a declared ' +
45
+ 'field reads. Rows imported before it keep the key they were ' +
46
+ 'deduplicated under, so a duplicate straddling that moment is not ' +
47
+ 'detected. duplicate_policy is what happens to a repeat: ' +
48
+ 'FLAG_AS_EXCEPTION (the default), KEEP_FIRST or REJECT.',
33
49
  inputSchema: getSourceInputShape,
34
50
  }, async (args, extra) => {
35
51
  return dispatchSource({
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/tools/source/get.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,+DAA+D;AAE/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE/D,4DAA4D;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,+CAA+C,CAAC;CAC7D,CAAA;AAKD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAiB;IACrD,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,WAAW,EACT,sEAAsE;YACtE,uEAAuE;YACvE,wEAAwE;YACxE,sEAAsE;YACtE,yBAAyB;QAC3B,WAAW,EAAE,mBAAmB;KACjC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,cAAc,CACnB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;SACvD,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/tools/source/get.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,+DAA+D;AAC/D,EAAE;AACF,iFAAiF;AACjF,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,gFAAgF;AAChF,kEAAkE;AAElE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE/D,4DAA4D;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,+CAA+C,CAAC;CAC7D,CAAA;AAKD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAiB;IACrD,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,WAAW,EACT,sEAAsE;YACtE,uEAAuE;YACvE,wEAAwE;YACxE,sEAAsE;YACtE,uEAAuE;YACvE,yEAAyE;YACzE,yDAAyD;YACzD,6DAA6D;YAC7D,sEAAsE;YACtE,uEAAuE;YACvE,8DAA8D;YAC9D,mEAAmE;YACnE,0DAA0D;YAC1D,wDAAwD;QAC1D,WAAW,EAAE,mBAAmB;KACjC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,cAAc,CACnB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;SACvD,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -36,7 +36,25 @@ export const updateSourceInputShape = {
36
36
  config: z
37
37
  .record(z.string(), z.unknown())
38
38
  .optional()
39
- .describe('Source-specific configuration object (validated server-side).'),
39
+ .describe('Source-specific configuration object (validated server-side). ' +
40
+ 'Reserved key duplicate_key: the ordered list of mapped fields that ' +
41
+ 'make two rows the same row (any of external_id, amount, currency, ' +
42
+ 'date, description, fee_amount, fee_currency); a config without it ' +
43
+ 'deduplicates on external_id alone. Editing it governs later imports ' +
44
+ 'only; rows already imported keep the key they were deduplicated ' +
45
+ 'under, and duplicate_key_changed_at (server-set, read-only) records ' +
46
+ 'the moment detection last changed meaning — this list changing, or ' +
47
+ 'the field map remapping the column a declared field reads. ' +
48
+ 'A source bound to an aggregator connection (reserved key ' +
49
+ 'connection_config_name) cannot carry a duplicate key of its own — ' +
50
+ 'the aggregator retracts a movement by naming its external id, so ' +
51
+ 'that id has to stay the row identity; a config holding both is ' +
52
+ 'refused, so drop duplicate_key or disconnect the aggregator first. ' +
53
+ 'Reserved key duplicate_policy: what happens ' +
54
+ 'to a row repeating that key — FLAG_AS_EXCEPTION (the default: the ' +
55
+ 'repeat is kept out of the import and raised as a duplicate exception ' +
56
+ 'on the row it repeated), KEEP_FIRST (dropped, nothing raised) or ' +
57
+ 'REJECT (counted as an import error).'),
40
58
  };
41
59
  /**
42
60
  * Build the PATCH body from the input minus the path-only ids. Only the fields
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/tools/source/update.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,iFAAiF;AACjF,4EAA4E;AAC5E,yEAAyE;AACzE,2EAA2E;AAC3E,2BAA2B;AAE3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE/D,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAA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AAoE;QACpE,sEAAsE;QACtE,kEAAkE;QAClE,sEAAsE;QACtE,qEAAqE;QACrE,6DAA6D;QAC7D,2DAA2D;QAC3D,oEAAoE;QACpE,mEAAmE;QACnE,iEAAiE;QACjE,qEAAqE;QACrE,8CAA8C;QAC9C,oEAAoE;QACpE,uEAAuE;QACvE,mEAAmE;QACnE,sCAAsC,CACzC;CACJ,CAAA;AAOD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAuB;IAEvB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;IACpE,KAAK,UAAU,CAAA;IACf,KAAK,SAAS,CAAA;IACd,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EACT,0EAA0E;YAC1E,yEAAyE;YACzE,kEAAkE;YAClE,sEAAsE;YACtE,wEAAwE;YACxE,iBAAiB;QACnB,WAAW,EAAE,sBAAsB;KACpC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,cAAc,CACnB;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;YACtD,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC;SAC5B,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lerianstudio/matcher-mcp",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.10",
4
4
  "type": "module",
5
5
  "description": "Model Context Protocol server for the Matcher reconciliation engine",
6
6
  "license": "Apache-2.0",