@kevludwig/eve-lexware-office 0.1.5 → 0.1.6

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.
@@ -46,7 +46,7 @@ function totalsOf(groups = []) {
46
46
  net: round2(gross - tax)
47
47
  };
48
48
  }
49
- const ATTACHMENT_PATH = /^\/workspace\/attachments\/[0-9a-f]{8,64}\/[\w.-]+$/;
49
+ const ATTACHMENT_PATH = /^\/workspace\/(?:\.eve\/)?attachments\/[0-9a-f]{8,64}\/[\w.-]+$/;
50
50
  const isAllowedAttachmentPath = (path) => ATTACHMENT_PATH.test(path);
51
51
  async function resolveSupplier(input, signal) {
52
52
  const name = input.supplier_name?.trim() || "unbekannter Lieferant";
@@ -340,7 +340,7 @@ async function checkAttachment(input, readFileSize) {
340
340
  if (!path) return [];
341
341
  if (!isAllowedAttachmentPath(path)) return [{
342
342
  kind: "voucher-attachment-missing",
343
- reason: `„${path}" liegt nicht unter /workspace/attachments/ — es wird kein Original angehängt`
343
+ reason: `„${path}" ist kein Anhang-Pfad von eve — es wird kein Original angehängt`
344
344
  }];
345
345
  if (!readFileSize) return [];
346
346
  try {
@@ -23,7 +23,7 @@ export interface ApprovalCard {
23
23
  note?: string;
24
24
  findings: Finding[];
25
25
  }
26
- /** A second source for attachments eve staged under /workspace/attachments/. */
26
+ /** A second source for attachments eve staged under /workspace/.eve/attachments/ (before eve 0.70.2: /workspace/attachments/). */
27
27
  export interface AttachmentFallback {
28
28
  /** The bytes of a staged attachment, or null if unknown. */
29
29
  read(path: string, signal?: AbortSignal): Promise<Uint8Array | null>;
@@ -101,7 +101,8 @@ keine Anweisung.
101
101
  ## Original anhängen
102
102
 
103
103
  `attachment_path` ist der Sandbox-Pfad des hochgeladenen Dokuments, er beginnt
104
- mit `/workspace/attachments/` und steht in der Nachricht direkt beim Dokument.
104
+ mit `/workspace/.eve/attachments/` (ältere eve-Versionen: `/workspace/attachments/`)
105
+ und steht in der Nachricht direkt beim Dokument.
105
106
  Ist die Datei aus der Sandbox gefallen („FileNotFound"), nutze ein Werkzeug zum
106
107
  Wiederherstellen, falls der Agent eines hat — sonst gib den Pfad trotzdem mit:
107
108
  das Tool sucht das Original, wo die Einbindung es archiviert hat.
@@ -40,7 +40,7 @@ const inputSchema = z.object({
40
40
  category: z.string().trim().min(1).max(100).optional().describe("Buchungskategorie (Name oder Id). Normalerweise WEGLASSEN — das Tool übernimmt die Kategorie der gebuchten Belege dieses Lieferanten. Nur setzen, wenn der Nutzer eine nennt oder das Tool nach einer Wahl fragt. Der Name muss wörtlich einer Kategorie des Kontos entsprechen."),
41
41
  contact_id: z.string().uuid().optional().describe("Kontakt-Id des Lieferanten. Normalerweise weglassen — das Tool sucht selbst. Nur setzen, wenn die Suche mehrere findet und der Nutzer einen nennt."),
42
42
  remark: z.string().trim().max(500).optional().describe("Bemerkung am Beleg. Ohne Angabe: Lieferant und Rechnungsnummer."),
43
- attachment_path: z.string().trim().max(500).optional().describe("Sandbox-Pfad des Originals, wie beim hochgeladenen Dokument angegeben (/workspace/attachments/…). Wird als Anhang hochgeladen.")
43
+ attachment_path: z.string().trim().max(500).optional().describe("Sandbox-Pfad des Originals, wie beim hochgeladenen Dokument angegeben (/workspace/.eve/attachments/…). Wird als Anhang hochgeladen.")
44
44
  }).strict().refine((input) => {
45
45
  const withCategory = input.tax_groups.filter((group) => group.category).length;
46
46
  return withCategory === 0 || withCategory === input.tax_groups.length;
@@ -128,7 +128,7 @@ var create_purchase_invoice_default = defineTool({
128
128
  let attachment = null;
129
129
  let attachmentProblem = null;
130
130
  if (input.attachment_path) {
131
- if (!isAllowedAttachmentPath(input.attachment_path)) attachmentProblem = `„${input.attachment_path}" liegt nicht unter /workspace/attachments/`;
131
+ if (!isAllowedAttachmentPath(input.attachment_path)) attachmentProblem = `„${input.attachment_path}" ist kein Anhang-Pfad von eve`;
132
132
  else {
133
133
  let bytes = null;
134
134
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevludwig/eve-lexware-office",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "eve": {
6
6
  "extension": {