@albertomarturelo/sii-mcp 0.11.0 → 0.12.0
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 +14 -0
- package/dist/tool-helpers.d.ts +5 -1
- package/dist/tool-helpers.d.ts.map +1 -1
- package/dist/tool-helpers.js +10 -2
- package/dist/tool-helpers.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,20 @@ Versions move in **lockstep** with `@albertomarturelo/sii-core` and
|
|
|
9
9
|
(ADR-003), so the domain detail behind each entry lives in the
|
|
10
10
|
[core changelog](../core/CHANGELOG.md).
|
|
11
11
|
|
|
12
|
+
## 0.12.0 — 2026-10-18
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **A failed tool call's text is a JSON object (#134):** `{ "error", "type", "reason"?,
|
|
17
|
+
"codigo"? }`, still with `isError: true`. Before, it was the bare message. It is the CLI's
|
|
18
|
+
JSON error without `exitCode`, with the same stable `type`. The verbatim SII message is still
|
|
19
|
+
in `error`. A client that parsed the bare text must read `error` instead.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **A session SII has closed is reported as expired (#139):** `whoami` and `auth_status` with
|
|
24
|
+
`refresh` answer `session_expired`. Before, they failed with "DatosCntrNow ausente".
|
|
25
|
+
|
|
12
26
|
## 0.11.0 — 2026-10-18
|
|
13
27
|
|
|
14
28
|
### Changed
|
package/dist/tool-helpers.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/** A failed tool call's text: the CLI's JSON error without `exitCode` (a tool has none), so
|
|
2
|
+
* both surfaces report the same stable `type` next to SII's verbatim message (ADR-012
|
|
3
|
+
* amendment). */
|
|
4
|
+
export declare function errorText(e: unknown): string;
|
|
1
5
|
/** Run a task and wrap its text as a tool result; domain errors come back as an
|
|
2
|
-
* error result carrying SII's Spanish message verbatim (CONVENTIONS). */
|
|
6
|
+
* error result carrying SII's Spanish message verbatim (CONVENTIONS) and its kind. */
|
|
3
7
|
export declare function toolText(fn: () => Promise<string>): Promise<{
|
|
4
8
|
content: {
|
|
5
9
|
type: 'text';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../src/tool-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../src/tool-helpers.ts"],"names":[],"mappings":"AAOA;;kBAEkB;AAClB,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAG5C;AAED;uFACuF;AACvF,wBAAsB,QAAQ,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;IACjE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC,CAMD"}
|
package/dist/tool-helpers.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
// Shared MCP tool helpers. Each domain module owns a `tools/<mod>.ts` exporting a
|
|
2
2
|
// `register<Mod>Tools(server, runtime)`; they all reuse `toolText` so SII's Spanish
|
|
3
3
|
// error messages surface verbatim and the registration stays uniform across modules.
|
|
4
|
+
import { classifyError } from '@albertomarturelo/sii-core';
|
|
4
5
|
const messageOf = (e) => (e instanceof Error ? e.message : String(e));
|
|
6
|
+
/** A failed tool call's text: the CLI's JSON error without `exitCode` (a tool has none), so
|
|
7
|
+
* both surfaces report the same stable `type` next to SII's verbatim message (ADR-012
|
|
8
|
+
* amendment). */
|
|
9
|
+
export function errorText(e) {
|
|
10
|
+
const { type, ...detail } = classifyError(e);
|
|
11
|
+
return JSON.stringify({ error: messageOf(e), type, ...detail });
|
|
12
|
+
}
|
|
5
13
|
/** Run a task and wrap its text as a tool result; domain errors come back as an
|
|
6
|
-
* error result carrying SII's Spanish message verbatim (CONVENTIONS). */
|
|
14
|
+
* error result carrying SII's Spanish message verbatim (CONVENTIONS) and its kind. */
|
|
7
15
|
export async function toolText(fn) {
|
|
8
16
|
try {
|
|
9
17
|
return { content: [{ type: 'text', text: await fn() }] };
|
|
10
18
|
}
|
|
11
19
|
catch (e) {
|
|
12
|
-
return { content: [{ type: 'text', text:
|
|
20
|
+
return { content: [{ type: 'text', text: errorText(e) }], isError: true };
|
|
13
21
|
}
|
|
14
22
|
}
|
|
15
23
|
//# sourceMappingURL=tool-helpers.js.map
|
package/dist/tool-helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-helpers.js","sourceRoot":"","sources":["../src/tool-helpers.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,oFAAoF;AACpF,qFAAqF;
|
|
1
|
+
{"version":3,"file":"tool-helpers.js","sourceRoot":"","sources":["../src/tool-helpers.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,oFAAoF;AACpF,qFAAqF;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,SAAS,GAAG,CAAC,CAAU,EAAU,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvF;;kBAEkB;AAClB,MAAM,UAAU,SAAS,CAAC,CAAU;IAClC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;AAClE,CAAC;AAED;uFACuF;AACvF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,EAAyB;IAItD,IAAI,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;IAC3D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC5E,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@albertomarturelo/sii-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP (stdio) server for Chile's SII (tax authority): exposes authenticated reads — RCV, F29, F22, boletas de honorarios, DTE-authorized, peticiones administrativas — plus factura borradores on the Portal MIPYME (never emission) and document downloads, as tools/resources for Claude Desktop and Claude Code. Each tool is a thin call into @albertomarturelo/sii-core tasks (ADR-003).",
|
|
6
6
|
"keywords": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
46
46
|
"playwright": "^1.49.0",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@albertomarturelo/sii-core": "^0.
|
|
48
|
+
"@albertomarturelo/sii-core": "^0.12.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsc -b"
|