@mulmoclaude/accounting-plugin 3.0.1 → 4.0.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/dist/server/router.d.ts +1 -0
- package/dist/server/router.d.ts.map +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js.map +1 -1
- package/dist/vue/Preview.vue.d.ts +2 -2
- package/dist/vue/Preview.vue.d.ts.map +1 -1
- package/dist/vue/previewSummary.d.ts +15 -4
- package/dist/vue/previewSummary.d.ts.map +1 -1
- package/dist/vue.cjs +18 -13
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.js +18 -13
- package/dist/vue.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ToolResultComplete } from "gui-chat-protocol/vue";
|
|
1
2
|
type __VLS_Props = {
|
|
2
|
-
|
|
3
|
-
jsonData?: Record<string, unknown>;
|
|
3
|
+
result: ToolResultComplete;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
6
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.vue.d.ts","sourceRoot":"","sources":["../../src/vue/Preview.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Preview.vue.d.ts","sourceRoot":"","sources":["../../src/vue/Preview.vue"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAUhE,KAAK,WAAW,GAAG;IAAE,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC;AA0ClD,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -3,13 +3,24 @@
|
|
|
3
3
|
export type TranslateFn = (key: string, named?: Record<string, unknown>) => string;
|
|
4
4
|
export declare function summariseError(json: Record<string, unknown>, translate: TranslateFn): string | null;
|
|
5
5
|
export declare function summariseEntry(json: Record<string, unknown>, translate: TranslateFn): string | null;
|
|
6
|
+
/** UNREACHABLE on the live path, deliberately. Only `getReport` produces a
|
|
7
|
+
* `profitLoss` payload, and it is not in `PREVIEW_ACTIONS`, so the bridge never
|
|
8
|
+
* posts its result and no card is rendered to summarise. Kept because the
|
|
9
|
+
* decision is one line to reverse (#2716) and because the tests below pin the
|
|
10
|
+
* formatting for whoever reverses it — but a passing test here is NOT evidence
|
|
11
|
+
* that anything renders. */
|
|
6
12
|
export declare function summarisePl(json: Record<string, unknown>, translate: TranslateFn): string | null;
|
|
13
|
+
/** UNREACHABLE on the live path, for the same reason as `summarisePl` above. */
|
|
7
14
|
export declare function summariseBs(json: Record<string, unknown>, translate: TranslateFn): string | null;
|
|
8
15
|
export declare function summariseBook(json: Record<string, unknown>, translate: TranslateFn): string | null;
|
|
9
16
|
export declare function summariseFallback(json: Record<string, unknown>, translate: TranslateFn): string;
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* payload. */
|
|
17
|
+
/** The payload as a record, or an empty one. `isRecord` rejects arrays, which
|
|
18
|
+
* the old `typeof value === "object"` check spread into the payload. */
|
|
13
19
|
export declare const asPayload: (value: unknown) => Record<string, unknown>;
|
|
14
|
-
|
|
20
|
+
/** `data` is `ToolResult.data` — the only place the payload arrives. There used
|
|
21
|
+
* to be a second `jsonData` parameter merged over it, for "hosts that carry it
|
|
22
|
+
* there"; no host ever did and the router only ever writes `data`
|
|
23
|
+
* (`router.ts`), so it was dead weight on a function whose whole job is to
|
|
24
|
+
* pick a branch. */
|
|
25
|
+
export declare function summarisePreview(data: unknown, translate: TranslateFn): string;
|
|
15
26
|
//# sourceMappingURL=previewSummary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"previewSummary.d.ts","sourceRoot":"","sources":["../../src/vue/previewSummary.ts"],"names":[],"mappings":"AAaA;6DAC6D;AAC7D,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAQnF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAInG;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAUnG;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAUhG;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAWhG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAOlG;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,CAI/F;AAED
|
|
1
|
+
{"version":3,"file":"previewSummary.d.ts","sourceRoot":"","sources":["../../src/vue/previewSummary.ts"],"names":[],"mappings":"AAaA;6DAC6D;AAC7D,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAQnF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAInG;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAUnG;AAED;;;;;6BAK6B;AAC7B,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAUhG;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAWhG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAOlG;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,CAI/F;AAED;yEACyE;AACzE,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAmC,CAAC;AAErG;;;;qBAIqB;AACrB,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,GAAG,MAAM,CAU9E"}
|
package/dist/vue.cjs
CHANGED
|
@@ -5442,6 +5442,12 @@ function summariseEntry(json, translate) {
|
|
|
5442
5442
|
if (!entryId || !date) return null;
|
|
5443
5443
|
return translate("pluginAccounting.preview.entry", { date });
|
|
5444
5444
|
}
|
|
5445
|
+
/** UNREACHABLE on the live path, deliberately. Only `getReport` produces a
|
|
5446
|
+
* `profitLoss` payload, and it is not in `PREVIEW_ACTIONS`, so the bridge never
|
|
5447
|
+
* posts its result and no card is rendered to summarise. Kept because the
|
|
5448
|
+
* decision is one line to reverse (#2716) and because the tests below pin the
|
|
5449
|
+
* formatting for whoever reverses it — but a passing test here is NOT evidence
|
|
5450
|
+
* that anything renders. */
|
|
5445
5451
|
function summarisePl(json, translate) {
|
|
5446
5452
|
const { profitLoss } = json;
|
|
5447
5453
|
if (!require_shared.isRecord(profitLoss)) return null;
|
|
@@ -5453,6 +5459,7 @@ function summarisePl(json, translate) {
|
|
|
5453
5459
|
net: require_shared.formatAmountNumeric(netIncome)
|
|
5454
5460
|
});
|
|
5455
5461
|
}
|
|
5462
|
+
/** UNREACHABLE on the live path, for the same reason as `summarisePl` above. */
|
|
5456
5463
|
function summariseBs(json, translate) {
|
|
5457
5464
|
const { balanceSheet } = json;
|
|
5458
5465
|
if (!require_shared.isRecord(balanceSheet)) return null;
|
|
@@ -5481,15 +5488,16 @@ function summariseFallback(json, translate) {
|
|
|
5481
5488
|
if (bookId !== void 0) return translate("pluginAccounting.previewSummary", { bookId });
|
|
5482
5489
|
return translate("pluginAccounting.previewGeneric");
|
|
5483
5490
|
}
|
|
5484
|
-
/**
|
|
5485
|
-
*
|
|
5486
|
-
* payload. */
|
|
5491
|
+
/** The payload as a record, or an empty one. `isRecord` rejects arrays, which
|
|
5492
|
+
* the old `typeof value === "object"` check spread into the payload. */
|
|
5487
5493
|
var asPayload = (value) => require_shared.isRecord(value) ? value : {};
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5494
|
+
/** `data` is `ToolResult.data` — the only place the payload arrives. There used
|
|
5495
|
+
* to be a second `jsonData` parameter merged over it, for "hosts that carry it
|
|
5496
|
+
* there"; no host ever did and the router only ever writes `data`
|
|
5497
|
+
* (`router.ts`), so it was dead weight on a function whose whole job is to
|
|
5498
|
+
* pick a branch. */
|
|
5499
|
+
function summarisePreview(data, translate) {
|
|
5500
|
+
const json = asPayload(data);
|
|
5493
5501
|
return summariseError(json, translate) ?? summariseEntry(json, translate) ?? summarisePl(json, translate) ?? summariseBs(json, translate) ?? summariseBook(json, translate) ?? summariseFallback(json, translate);
|
|
5494
5502
|
}
|
|
5495
5503
|
//#endregion
|
|
@@ -5502,14 +5510,11 @@ var _hoisted_1 = {
|
|
|
5502
5510
|
//#region src/vue/Preview.vue
|
|
5503
5511
|
var Preview_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
5504
5512
|
__name: "Preview",
|
|
5505
|
-
props: {
|
|
5506
|
-
data: {},
|
|
5507
|
-
jsonData: {}
|
|
5508
|
-
},
|
|
5513
|
+
props: { result: {} },
|
|
5509
5514
|
setup(__props) {
|
|
5510
5515
|
const { t } = useAccountingI18n();
|
|
5511
5516
|
const props = __props;
|
|
5512
|
-
const summary = (0, vue.computed)(() => summarisePreview(props.data,
|
|
5517
|
+
const summary = (0, vue.computed)(() => summarisePreview(props.result.data, t));
|
|
5513
5518
|
return (_ctx, _cache) => {
|
|
5514
5519
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", { class: "material-icons text-base align-middle mr-1" }, "account_balance", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(summary.value), 1)]);
|
|
5515
5520
|
};
|