tillbooks 1.0.0-beta.4 → 1.0.0-beta.5

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.
Files changed (118) hide show
  1. package/README.md +1 -1
  2. package/bin/till.mjs +2 -2
  3. package/dist/api/accrual-actions.js +2 -2
  4. package/dist/api/accrual-actions.js.map +1 -1
  5. package/dist/api/asset-actions.js +17 -5
  6. package/dist/api/asset-actions.js.map +1 -1
  7. package/dist/api/db-path.d.ts +9 -3
  8. package/dist/api/db-path.js +16 -7
  9. package/dist/api/db-path.js.map +1 -1
  10. package/dist/api/egress-actions.js +1 -1
  11. package/dist/api/egress-actions.js.map +1 -1
  12. package/dist/api/env-actions.js +2 -2
  13. package/dist/api/env-actions.js.map +1 -1
  14. package/dist/api/mail-actions.js +1 -1
  15. package/dist/api/mail-actions.js.map +1 -1
  16. package/dist/api/up.d.ts +47 -10
  17. package/dist/api/up.js +185 -23
  18. package/dist/api/up.js.map +1 -1
  19. package/dist/core/accruals/accrual.d.ts +37 -0
  20. package/dist/core/accruals/accrual.js +204 -75
  21. package/dist/core/accruals/accrual.js.map +1 -1
  22. package/dist/core/accruals/annualReconciliation.d.ts +11 -3
  23. package/dist/core/accruals/annualReconciliation.js +61 -7
  24. package/dist/core/accruals/annualReconciliation.js.map +1 -1
  25. package/dist/core/accruals/index.d.ts +3 -3
  26. package/dist/core/accruals/index.js +2 -2
  27. package/dist/core/accruals/index.js.map +1 -1
  28. package/dist/core/accruals/lines.d.ts +10 -0
  29. package/dist/core/accruals/lines.js +12 -0
  30. package/dist/core/accruals/lines.js.map +1 -1
  31. package/dist/core/accruals/schema.d.ts +1 -1
  32. package/dist/core/accruals/schema.js +23 -0
  33. package/dist/core/accruals/schema.js.map +1 -1
  34. package/dist/core/agent/vorschlagPin.js +21 -2
  35. package/dist/core/agent/vorschlagPin.js.map +1 -1
  36. package/dist/core/assets/disposal.d.ts +10 -0
  37. package/dist/core/assets/disposal.js +411 -54
  38. package/dist/core/assets/disposal.js.map +1 -1
  39. package/dist/core/assets/invoiceClearing.d.ts +27 -0
  40. package/dist/core/assets/invoiceClearing.js +48 -0
  41. package/dist/core/assets/invoiceClearing.js.map +1 -0
  42. package/dist/core/assets/ledger.js +61 -1
  43. package/dist/core/assets/ledger.js.map +1 -1
  44. package/dist/core/assets/proceedsLink.d.ts +197 -0
  45. package/dist/core/assets/proceedsLink.js +550 -0
  46. package/dist/core/assets/proceedsLink.js.map +1 -0
  47. package/dist/core/assets/reversal.d.ts +11 -3
  48. package/dist/core/assets/reversal.js +82 -7
  49. package/dist/core/assets/reversal.js.map +1 -1
  50. package/dist/core/assets/transactionSchema.d.ts +1 -1
  51. package/dist/core/assets/transactionSchema.js +20 -0
  52. package/dist/core/assets/transactionSchema.js.map +1 -1
  53. package/dist/core/checklists/probes.js +7 -3
  54. package/dist/core/checklists/probes.js.map +1 -1
  55. package/dist/core/data/portability.d.ts +22 -0
  56. package/dist/core/data/portability.js +104 -33
  57. package/dist/core/data/portability.js.map +1 -1
  58. package/dist/core/drafting/draft.d.ts +4 -1
  59. package/dist/core/drafting/draft.js +29 -6
  60. package/dist/core/drafting/draft.js.map +1 -1
  61. package/dist/core/egress/egress.js +10 -2
  62. package/dist/core/egress/egress.js.map +1 -1
  63. package/dist/core/egress/probe.d.ts +21 -1
  64. package/dist/core/egress/probe.js +34 -1
  65. package/dist/core/egress/probe.js.map +1 -1
  66. package/dist/core/landscape/controlFile.d.ts +1 -1
  67. package/dist/core/landscape/controlFile.js +11 -5
  68. package/dist/core/landscape/controlFile.js.map +1 -1
  69. package/dist/core/landscape/copy.d.ts +38 -0
  70. package/dist/core/landscape/copy.js +140 -16
  71. package/dist/core/landscape/copy.js.map +1 -1
  72. package/dist/core/landscape/index.d.ts +2 -1
  73. package/dist/core/landscape/index.js +2 -1
  74. package/dist/core/landscape/index.js.map +1 -1
  75. package/dist/core/landscape/ledgerGuard.d.ts +56 -0
  76. package/dist/core/landscape/ledgerGuard.js +141 -0
  77. package/dist/core/landscape/ledgerGuard.js.map +1 -0
  78. package/dist/core/landscape/operations.d.ts +2 -1
  79. package/dist/core/landscape/operations.js +35 -17
  80. package/dist/core/landscape/operations.js.map +1 -1
  81. package/dist/core/ledger/postEntry.d.ts +5 -0
  82. package/dist/core/ledger/postEntry.js +6 -1
  83. package/dist/core/ledger/postEntry.js.map +1 -1
  84. package/dist/core/mail/adapters.d.ts +119 -5
  85. package/dist/core/mail/adapters.js +520 -36
  86. package/dist/core/mail/adapters.js.map +1 -1
  87. package/dist/core/mail/index.d.ts +3 -3
  88. package/dist/core/mail/index.js +2 -2
  89. package/dist/core/mail/index.js.map +1 -1
  90. package/dist/core/mail/mailstore.d.ts +44 -4
  91. package/dist/core/mail/mailstore.js +80 -17
  92. package/dist/core/mail/mailstore.js.map +1 -1
  93. package/dist/core/migration/plan.js +1 -1
  94. package/dist/core/migration/plan.js.map +1 -1
  95. package/dist/core/migration/seams.d.ts +23 -4
  96. package/dist/core/migration/seams.js +28 -5
  97. package/dist/core/migration/seams.js.map +1 -1
  98. package/dist/core/migration/steps.js +1 -1
  99. package/dist/core/migration/steps.js.map +1 -1
  100. package/dist/core/payments/payment.d.ts +9 -0
  101. package/dist/core/payments/payment.js +23 -4
  102. package/dist/core/payments/payment.js.map +1 -1
  103. package/dist/core/sales/creditNote.js +13 -2
  104. package/dist/core/sales/creditNote.js.map +1 -1
  105. package/dist/core/settings/registry.js +78 -0
  106. package/dist/core/settings/registry.js.map +1 -1
  107. package/dist/core/store/sqlite-store.d.ts +58 -2
  108. package/dist/core/store/sqlite-store.js +157 -4
  109. package/dist/core/store/sqlite-store.js.map +1 -1
  110. package/dist/core/support/config.js +7 -5
  111. package/dist/core/support/config.js.map +1 -1
  112. package/dist/core/support/diagnostics.js +10 -4
  113. package/dist/core/support/diagnostics.js.map +1 -1
  114. package/dist/studio/assets/{client-DR_5d8Ug.js → client-C-MB27wE.js} +1 -1
  115. package/dist/studio/assets/{index-BWThh9ML.js → index-Bmd1SeS9.js} +48 -48
  116. package/dist/studio/assets/{streamableHttp-DJDULPJ5.js → streamableHttp-CEB-NrND.js} +1 -1
  117. package/dist/studio/index.html +1 -1
  118. package/package.json +1 -1
package/README.md CHANGED
@@ -22,7 +22,7 @@ as drafts and contact details, runs without asking, and every call the agent mak
22
22
  The dial covers agents that connect to TILL. An agent that can drive your browser or run commands on
23
23
  your computer can act as you: give your agent TILL, not your browser or your shell.
24
24
 
25
- > **Public beta, version 1.0.0-beta.2.** Nomadik GmbH, the company behind TILL, keeps its own books
25
+ > **Public beta, version 1.0.0-beta.5.** Nomadik GmbH, the company behind TILL, keeps its own books
26
26
  > in it. If you move your books to TILL, keep your old system running until the figures match, and
27
27
  > read [what the beta does not do yet](#what-the-beta-does-not-do-yet) first.
28
28
 
package/bin/till.mjs CHANGED
@@ -203,7 +203,7 @@ switch (command) {
203
203
  ? {
204
204
  adoptedBook:
205
205
  choice.adoptedUnavailable !== undefined
206
- ? { path: choice.adoptedUnavailable.path, unavailable: 'missing' }
206
+ ? { path: choice.adoptedUnavailable.path, unavailable: choice.adoptedUnavailable.reason }
207
207
  : { path: choice.path },
208
208
  }
209
209
  : {}),
@@ -217,7 +217,7 @@ switch (command) {
217
217
  // A live instance already owns the machine: point at it, open the browser there, and exit 0.
218
218
  // Starting a second scheduler on one database is the exact double-fire the lock prevents.
219
219
  // The holder URL carries a one-time ticket derived from the key file (D166): print it to a
220
- // terminal only, and open it through `openStudioLink`, which keeps it off the command line on macOS.
220
+ // terminal only, and open it through `openStudioLink`, which keeps it off every command line (D162).
221
221
  const { redactStudioLink } = await import(new URL('../dist/api/up.js', import.meta.url));
222
222
  const shown = process.stderr.isTTY === true ? result.holder.url : redactStudioLink(result.holder.url);
223
223
  console.error(`till up: already running at ${shown} (pid ${result.holder.pid}). Opening it.`);
@@ -23,7 +23,7 @@ export function accrualActions(h) {
23
23
  const { ctxAction, ctxSchema, STR, INT } = h;
24
24
  return [
25
25
  // --- N2: accruals (OR 958b) -------------------------------------------------------------------
26
- ctxAction('accrual_create', 'write:reversible:internal', "Describe an Abgrenzung (OR Art. 958b) and save it as a DRAFT: `kind` is one of prepaid_expense (Aufwand vorausbezahlt, Dr 1300), accrued_income (Ertrag noch nicht fakturiert, Dr 1300), accrued_expense (Aufwand noch nicht fakturiert, Cr 2300) or deferred_income (Ertrag vorausbezahlt erhalten, Cr 2300); `contraAccount` is the P&L account (number or id, income for the income kinds, expense for the expense kinds); `amountMinor` is integer Rappen; `periodEnd` is the balance-sheet date. Returns the draft with the exact lines the post will write and the reversal lines dated the day after. Nothing is posted.", ctxSchema({
26
+ ctxAction('accrual_create', 'write:reversible:internal', "Describe an Abgrenzung (OR Art. 958b) and save it as a DRAFT: `kind` is one of prepaid_expense (Aufwand vorausbezahlt, Dr 1300), accrued_income (Ertrag noch nicht fakturiert, Dr 1300), accrued_expense (Aufwand noch nicht fakturiert, Cr 2300) or deferred_income (Ertrag vorausbezahlt erhalten, Cr 2300); `contraAccount` is the P&L account (number or id, income for the income kinds, expense for the expense kinds); `amountMinor` is integer Rappen; `periodEnd` is the balance-sheet date. Returns the draft with the exact lines the post will write and the reversal lines dated the day after. Nothing is posted. A `sourceRef` beginning `asset_transaction:` is reserved for the Abgrenzung a fixed-asset disposal posts itself (D192) and refused `reserved_source_ref`.", ctxSchema({
27
27
  kind: STR,
28
28
  periodEnd: STR,
29
29
  amountMinor: INT,
@@ -35,7 +35,7 @@ export function accrualActions(h) {
35
35
  idempotencyKey: STR,
36
36
  }, ['kind', 'periodEnd', 'amountMinor', 'contraAccount', 'description', 'idempotencyKey']), (ctx, input) => accrualCreate(ctx, input)),
37
37
  ctxAction('accrual_post', 'write:correctable:books', "Post a drafted Abgrenzung as an atomic PAIR: the accrual entry dated `periodEnd` (source `accrual`) and its automatic Rückbuchung dated the first day after (a real reversal, linked). A locked reversal date rolls the whole pair back, so the books never carry an accrual without the reversal that backs it out. Idempotent per accrual: the same key replays, a different key on a posted accrual is `already_posted`, a discarded draft is `draft_discarded`.", ctxSchema({ accrualId: STR, idempotencyKey: STR }, ['accrualId', 'idempotencyKey']), (ctx, input) => accrualPost(ctx, input)),
38
- ctxAction('accrual_reverse', 'write:correctable:books', "Revert a posted Abgrenzung without editing history: posts the MIRROR pair (the Storno dated `periodEnd`, its own reversal dated the day after), so all four entries net to zero on every account in both periods. Refuses `already_reversed` a second time and `not_posted` on a draft.", ctxSchema({ accrualId: STR, reason: STR, idempotencyKey: STR }, ['accrualId', 'idempotencyKey']), (ctx, input) => accrualReverse(ctx, input)),
38
+ ctxAction('accrual_reverse', 'write:correctable:books', "Revert a posted Abgrenzung without editing history: posts the MIRROR pair (the Storno dated `periodEnd`, its own reversal dated the day after), so all four entries net to zero on every account in both periods. Refuses `already_reversed` a second time and `not_posted` on a draft. D192: an Abgrenzung a fixed-asset disposal posted itself (sourceRef `asset_transaction:<id>`) is refused `accrual_backs_disposal`: reverse the disposal, which takes it back with it.", ctxSchema({ accrualId: STR, reason: STR, idempotencyKey: STR }, ['accrualId', 'idempotencyKey']), (ctx, input) => accrualReverse(ctx, input)),
39
39
  ctxAction('accrual_discard', 'write:correctable:internal', 'Retire a drafted Abgrenzung before it posts. The row stays on record as `discarded` with its reason; a posted accrual cannot be discarded (`already_posted`), reverse it instead.', ctxSchema({ accrualId: STR, reason: STR, idempotencyKey: STR }, ['accrualId', 'idempotencyKey']), (ctx, input) => accrualDiscard(ctx, input)),
40
40
  ctxAction('accrual_get', 'read', 'Read one Abgrenzung: the row, its lines and reversal lines (from the same function the post uses), and the journal entries it has produced (the accrual, its reversal, the Storno pair).', ctxSchema({ accrualId: STR }, ['accrualId']), (ctx, input) => accrualGet(ctx, input)),
41
41
  ctxAction('accrual_list', 'read', 'List Abgrenzungen, newest period first, filtered by periodEnd, status (draft | posted | reversed | discarded) or kind. `totalMinor` sums the drafts and the posted ones. savedViewId applies a saved view (G00).', ctxSchema({ periodEnd: STR, status: STR, kind: STR, savedViewId: STR }), (ctx, input) => accrualList(ctx, input)),
@@ -1 +1 @@
1
- {"version":3,"file":"accrual-actions.js","sourceRoot":"","sources":["../../src/api/accrual-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAe9D,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAAC,CAAuB;IACpD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7C,OAAO;QACL,iGAAiG;QACjG,SAAS,CACP,gBAAgB,EAChB,2BAA2B,EAC3B,imBAAimB,EACjmB,SAAS,CACP;YACE,IAAI,EAAE,GAAG;YACT,SAAS,EAAE,GAAG;YACd,WAAW,EAAE,GAAG;YAChB,aAAa,EAAE,GAAG;YAClB,WAAW,EAAE,GAAG;YAChB,SAAS,EAAE,GAAG;YACd,YAAY,EAAE,GAAG;YACjB,QAAQ,EAAE,GAAG;YACb,cAAc,EAAE,GAAG;SACpB,EACD,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,CAAC,CACvF,EACD,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,KAAc,CAAC,CACnD;QACD,SAAS,CACP,cAAc,EACd,yBAAyB,EACzB,qcAAqc,EACrc,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW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AC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,KAAc,CAAC,CAC1D;QACD,SAAS,CACP,qBAAqB,EACrB,MAAM,EACN,+KAA+K,EAC/K,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EACxB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,KAAc,CAAC,CACvD;QACD,SAAS,CACP,2BAA2B,EAC3B,MAAM,EACN,umBAAumB,EACvmB,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAClC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,EAAE,KAAc,CAAC,CAC7D;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"accrual-actions.js","sourceRoot":"","sources":["../../src/api/accrual-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAe9D,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAAC,CAAuB;IACpD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7C,OAAO;QACL,iGAAiG;QACjG,SAAS,CACP,gBAAgB,EAChB,2BAA2B,EAC3B,2vBAA2vB,EAC3vB,SAAS,CACP;YACE,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GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,KAAc,CAAC,CAC1D;QACD,SAAS,CACP,qBAAqB,EACrB,yBAAyB,EACzB,q6BAAq6B,EACr6B,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,EAC7E,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,KAAc,CAAC,CACvD;QACD,SAAS,CACP,wBAAwB,EACxB,yBAAyB,EACzB,2gBAA2gB,EAC3gB,SAAS,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,EACzF,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,KAAc,CAAC,CAC1D;QACD,SAAS,CACP,qBAAqB,EACrB,MAAM,EACN,+KAA+K,EAC/K,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EACxB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,KAAc,CAAC,CACvD;QACD,SAAS,CACP,2BAA2B,EAC3B,MAAM,EACN,umBAAumB,EACvmB,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAClC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,EAAE,KAAc,CAAC,CAC7D;KACF,CAAC;AACJ,CAAC"}
@@ -207,7 +207,7 @@ export function assetActions(h) {
207
207
  to: STR,
208
208
  }), (ctx, input) => assetDepreciationRunList(ctx, as(input))),
209
209
  // --- H06, Asset Disposal (MONEY PATH: posts the terminal disposal journal) --------------------
210
- ctxAction('asset_disposal_preview', 'read', 'Preview the exact disposal journal for an active or fully_depreciated fixed asset (H06) WITHOUT posting anything. Given the asset, a disposalDate, proceedsRappen (>= 0), a gainLossAccountId (an income or expense account) and, when proceeds > 0, a proceedsAccountId (a bank/receivable asset or a liability account), it returns the current cost / accumulated depreciation / net book value, the signed gainLossRappen (proceeds minus NBV: positive is a gain, negative a loss), and the full balanced journal_lines it WOULD post: Dr accumulated depreciation, Dr proceeds account, the book loss (Dr) or gain (Cr) on the gainLossAccountId, and Cr the asset cost account. The lines are the SAME lines asset_dispose posts, so the preview never disagrees with the posting. Pure read: it writes nothing, creates no journal and does NOT check the period lock, so it is exactly the tool for seeing what a disposal would book before finding out the period is sealed. Refused before any calculation with not_found (foreign asset, §H-TENANT), asset_already_disposed / asset_archived / asset_not_acquired (a draft has no cost basis), invalid_proceeds (negative or non-integer), invalid_gain_loss_account or invalid_proceeds_account (missing, foreign, or wrong type).', ctxSchema({
210
+ ctxAction('asset_disposal_preview', 'read', 'Preview the exact disposal journal for an active or fully_depreciated fixed asset (H06) WITHOUT posting anything. Given the asset, a disposalDate, proceedsRappen (>= 0), a gainLossAccountId (an income or expense account) and, when proceeds > 0, a proceedsAccountId (a bank/receivable asset or a liability account), it returns the current cost / accumulated depreciation / net book value, the signed gainLossRappen (proceeds minus NBV: positive is a gain, negative a loss), and the full balanced journal_lines it WOULD post: Dr accumulated depreciation, Dr proceeds account, the book loss (Dr) or gain (Cr) on the gainLossAccountId, and Cr the asset cost account. The lines are the SAME lines asset_dispose posts, so the preview never disagrees with the posting. Pure read: it writes nothing, creates no journal and does NOT check the period lock, so it is exactly the tool for seeing what a disposal would book before finding out the period is sealed. Refused before any calculation with not_found (foreign asset, §H-TENANT), asset_already_disposed / asset_archived / asset_not_acquired (a draft has no cost basis), invalid_proceeds (negative or non-integer), invalid_gain_loss_account or invalid_proceeds_account (missing, foreign, or wrong type). Optional (D191): proceedsInvoiceId (an issued A10 sales invoice) and/or proceedsPaymentId (a standing A14 incoming payment; with both, the payment must settle that invoice) name the document the proceeds came with; it is stored on the disposal row (sourceDocumentType invoice or payment, the invoice when both) and asset_transaction_reverse then refuses proceeds_settled while it stands. Refused invalid_proceeds_document (reason not_found for a foreign or unknown id, not_an_invoice, not_issued, not_incoming, not_standing, payment_not_for_invoice, no_proceeds for a scrap). A payment given alone that lies wholly on one invoice (every allocation on it, nothing left on account) links that invoice (invoiceFromPayment true); otherwise the payment stays the link, warned proceeds_payment_spans_invoices (several invoices) or proceeds_payment_partly_unallocated (one invoice plus a remainder or another target). D192 (setting assets.proceeds_booking): under clear_via_document (default) a disposal linked to an invoice takes its proceeds FROM the invoice: the proceeds line debits the account of the invoice\'s ONE sale line (its credit outside 2200) for that line\'s booked CHF (never re-converted), with its cost centre and no tax code, so the sale and its VAT count once, on the invoice; proceedsRappen and proceedsAccountId are then optional and, when given, must equal the derived values (else invalid_input reason proceeds_from_document). Refused invalid_proceeds_document reason no_sale_line (no posted sale line, e.g. a migrated open item), sale_not_single_line (two or more sale lines: invoice the asset alone), proceeds_needs_invoice (a payment that does not lie wholly on one invoice: issue the invoice, allocate_payment, then dispose against it), invoice_already_cleared (another standing disposal resolves to this invoice, in both modes; also a trigger). A disposal and an invoice in different financial years (setting assets.cross_year_sale): post_abgrenzung (default) also posts ONE A38 Abgrenzung in the same transaction (accrued_income when handed over in the earlier year, deferred_income when invoiced in it; dated the earlier year\'s last day, its Rückbuchung the next day; returned as abgrenzung and in the preview), refuse answers sale_in_other_financial_year with suggestedDisposalDate; years further apart refuse years_not_adjacent; a locked Abgrenzung leg refuses period_locked with leg abgrenzung (reopen with unlock_period, or for a sealed period dispose unlinked onto a transit account and clear it by hand). A disposalDate after today refuses disposal_date_in_future; one before the day an earlier disposal of the asset was reversed refuses disposal_date_before_reversal (the asset is back on the books only from then). Warnings: sale_reduced (a credit note, Skonto or write-off on the invoice; the gain is stated before it), sale_in_other_month, abgrenzung_period_locked (preview). Under book_proceeds the caller\'s proceeds are booked as before: proceeds_double_counted when the account is not a non-tax credit line of the invoice (2200 warns) or, for a payment link, any account the payment\'s entry moved; an invoice\'s own sale account is accepted (the manual clearing), warned proceeds_exceed_sale_line above its largest sale line, and refused sale_in_other_financial_year across a year end. Per call, proceedsBooking or crossYearSale may differ from the setting with a required proceedsBookingReason or crossYearSaleReason (reason_required otherwise), stamped on the description and audited (override_proceeds_booking, override_cross_year_sale). Without a link the disposal behaves as before and its reverse checks no proceeds.', ctxSchema({
211
211
  assetId: STR,
212
212
  disposalDate: STR,
213
213
  proceedsRappen: INT,
@@ -216,8 +216,14 @@ export function assetActions(h) {
216
216
  reason: STR,
217
217
  counterpartyName: STR,
218
218
  notes: STR,
219
- }, ['assetId', 'disposalDate', 'proceedsRappen', 'gainLossAccountId']), (ctx, input) => assetDisposalPreview(ctx, as(input))),
220
- ctxAction('asset_dispose', 'write:correctable:books', 'Dispose an active or fully_depreciated fixed asset (H06): the TERMINAL financial event (sale, scrap, donation, write-off, retirement). In ONE atomic transaction it (a) posts ONE balanced GL journal via A02 (source=asset_disposal) clearing the asset cost (Cr) and its accumulated depreciation (Dr), recognising the proceeds (Dr the proceedsAccountId) and the resulting book gain (Cr) or loss (Dr) on the gainLossAccountId; (b) writes ONE append-only asset_transaction (type=disposal, deltaCostRappen = -cost, deltaAccumDeprRappen = -accumulated, proceedsRappen, gainLossRappen) naming that journal; and (c) moves the asset to status=disposed, forces net_book_value_rappen to 0 and stamps disposed_at / disposal_proceeds_rappen (cost and accumulated stay for historical reporting). The gain/loss SIGN is proceedsRappen minus net book value: proceeds above NBV credit the gain account, below NBV debit the loss account, exactly equal writes no gain/loss line. A scrap (proceedsRappen = 0) writes no proceeds line and needs no proceedsAccountId. After success the asset is permanently excluded from every future depreciation run (H03/H04 status filter) and asset_update refuses it with asset_terminal. Refused with not_found (foreign asset, §H-TENANT), asset_already_disposed (a second dispose: first wins, second is refused), asset_archived, asset_not_acquired (a draft has no cost basis), invalid_proceeds, invalid_gain_loss_account, invalid_proceeds_account, or period_locked (disposalDate in a hard-locked A03 period). A wrong disposal is corrected by reversing the journal (A02) plus a compensating asset_transaction, never an un-dispose. Idempotent on idempotencyKey: a replay returns the original {asset, transaction, journalEntry, gainLossRappen} and posts no second journal, appends no second transaction and re-flips no status.', ctxSchema({
219
+ proceedsInvoiceId: STR,
220
+ proceedsPaymentId: STR,
221
+ proceedsBooking: STR,
222
+ proceedsBookingReason: STR,
223
+ crossYearSale: STR,
224
+ crossYearSaleReason: STR,
225
+ }, ['assetId', 'disposalDate', 'gainLossAccountId']), (ctx, input) => assetDisposalPreview(ctx, as(input))),
226
+ ctxAction('asset_dispose', 'write:correctable:books', 'Dispose an active or fully_depreciated fixed asset (H06): the TERMINAL financial event (sale, scrap, donation, write-off, retirement). In ONE atomic transaction it (a) posts ONE balanced GL journal via A02 (source=asset_disposal) clearing the asset cost (Cr) and its accumulated depreciation (Dr), recognising the proceeds (Dr the proceedsAccountId) and the resulting book gain (Cr) or loss (Dr) on the gainLossAccountId; (b) writes ONE append-only asset_transaction (type=disposal, deltaCostRappen = -cost, deltaAccumDeprRappen = -accumulated, proceedsRappen, gainLossRappen) naming that journal; and (c) moves the asset to status=disposed, forces net_book_value_rappen to 0 and stamps disposed_at / disposal_proceeds_rappen (cost and accumulated stay for historical reporting). The gain/loss SIGN is proceedsRappen minus net book value: proceeds above NBV credit the gain account, below NBV debit the loss account, exactly equal writes no gain/loss line. A scrap (proceedsRappen = 0) writes no proceeds line and needs no proceedsAccountId. After success the asset is permanently excluded from every future depreciation run (H03/H04 status filter) and asset_update refuses it with asset_terminal. Refused with not_found (foreign asset, §H-TENANT), asset_already_disposed (a second dispose: first wins, second is refused), asset_archived, asset_not_acquired (a draft has no cost basis), invalid_proceeds, invalid_gain_loss_account, invalid_proceeds_account, or period_locked (disposalDate in a hard-locked A03 period). A wrong disposal is corrected by reversing the journal (A02) plus a compensating asset_transaction, never an un-dispose. Idempotent on idempotencyKey: a replay returns the original {asset, transaction, journalEntry, gainLossRappen} and posts no second journal, appends no second transaction and re-flips no status. Optional (D191): proceedsInvoiceId (an issued A10 sales invoice) and/or proceedsPaymentId (a standing A14 incoming payment; with both, the payment must settle that invoice) name the document the proceeds came with; it is stored on the disposal row (sourceDocumentType invoice or payment, the invoice when both) and asset_transaction_reverse then refuses proceeds_settled while it stands. Refused invalid_proceeds_document (reason not_found for a foreign or unknown id, not_an_invoice, not_issued, not_incoming, not_standing, payment_not_for_invoice, no_proceeds for a scrap). A payment given alone that lies wholly on one invoice (every allocation on it, nothing left on account) links that invoice (invoiceFromPayment true); otherwise the payment stays the link, warned proceeds_payment_spans_invoices (several invoices) or proceeds_payment_partly_unallocated (one invoice plus a remainder or another target). D192 (setting assets.proceeds_booking): under clear_via_document (default) a disposal linked to an invoice takes its proceeds FROM the invoice: the proceeds line debits the account of the invoice\'s ONE sale line (its credit outside 2200) for that line\'s booked CHF (never re-converted), with its cost centre and no tax code, so the sale and its VAT count once, on the invoice; proceedsRappen and proceedsAccountId are then optional and, when given, must equal the derived values (else invalid_input reason proceeds_from_document). Refused invalid_proceeds_document reason no_sale_line (no posted sale line, e.g. a migrated open item), sale_not_single_line (two or more sale lines: invoice the asset alone), proceeds_needs_invoice (a payment that does not lie wholly on one invoice: issue the invoice, allocate_payment, then dispose against it), invoice_already_cleared (another standing disposal resolves to this invoice, in both modes; also a trigger). A disposal and an invoice in different financial years (setting assets.cross_year_sale): post_abgrenzung (default) also posts ONE A38 Abgrenzung in the same transaction (accrued_income when handed over in the earlier year, deferred_income when invoiced in it; dated the earlier year\'s last day, its Rückbuchung the next day; returned as abgrenzung and in the preview), refuse answers sale_in_other_financial_year with suggestedDisposalDate; years further apart refuse years_not_adjacent; a locked Abgrenzung leg refuses period_locked with leg abgrenzung (reopen with unlock_period, or for a sealed period dispose unlinked onto a transit account and clear it by hand). A disposalDate after today refuses disposal_date_in_future; one before the day an earlier disposal of the asset was reversed refuses disposal_date_before_reversal (the asset is back on the books only from then). Warnings: sale_reduced (a credit note, Skonto or write-off on the invoice; the gain is stated before it), sale_in_other_month, abgrenzung_period_locked (preview). Under book_proceeds the caller\'s proceeds are booked as before: proceeds_double_counted when the account is not a non-tax credit line of the invoice (2200 warns) or, for a payment link, any account the payment\'s entry moved; an invoice\'s own sale account is accepted (the manual clearing), warned proceeds_exceed_sale_line above its largest sale line, and refused sale_in_other_financial_year across a year end. Per call, proceedsBooking or crossYearSale may differ from the setting with a required proceedsBookingReason or crossYearSaleReason (reason_required otherwise), stamped on the description and audited (override_proceeds_booking, override_cross_year_sale). Without a link the disposal behaves as before and its reverse checks no proceeds.', ctxSchema({
221
227
  assetId: STR,
222
228
  disposalDate: STR,
223
229
  proceedsRappen: INT,
@@ -226,8 +232,14 @@ export function assetActions(h) {
226
232
  reason: STR,
227
233
  counterpartyName: STR,
228
234
  notes: STR,
235
+ proceedsInvoiceId: STR,
236
+ proceedsPaymentId: STR,
237
+ proceedsBooking: STR,
238
+ proceedsBookingReason: STR,
239
+ crossYearSale: STR,
240
+ crossYearSaleReason: STR,
229
241
  idempotencyKey: STR,
230
- }, ['assetId', 'disposalDate', 'proceedsRappen', 'gainLossAccountId', 'idempotencyKey']), (ctx, input) => assetDispose(ctx, as(input))),
242
+ }, ['assetId', 'disposalDate', 'gainLossAccountId', 'idempotencyKey']), (ctx, input) => assetDispose(ctx, as(input))),
231
243
  ctxAction('asset_disposal_get', 'read', 'Read one fixed-asset DISPOSAL sub-ledger transaction by id (H06), with the balanced GL journal entry it posted. transactionId must name a disposal-type asset_transaction in this workspace: a foreign id, or an id naming an acquisition / depreciation event, is not_found rather than a leak of the wrong event through the disposal verb (§H-TENANT).', ctxSchema({ transactionId: STR }, ['transactionId']), (ctx, input) => assetDisposalGet(ctx, as(input))),
232
244
  // --- H07, Asset Ledger & Reconciliation ------------------------------------------------------
233
245
  // The READ half derives everything from the append-only asset_transaction sub-ledger; the one write
@@ -254,7 +266,7 @@ export function assetActions(h) {
254
266
  idempotencyKey: STR,
255
267
  }, ['assetId', 'date', 'costRappen', 'idempotencyKey']), (ctx, input) => assetOpeningBalance(ctx, as(input))),
256
268
  // --- D170, the register's undo verb (MONEY PATH: posts the owned A02 mirror) -------------------
257
- ctxAction('asset_transaction_reverse', 'write:correctable:books', 'Storniere one financial event on a fixed asset (D170): an acquisition, an additional capitalisation, an opening balance or a disposal, named by assetId and transactionId (from asset_ledger_get). In ONE transaction it posts the faithful A02 reversing entry of the event (OR 957a, dated today) and appends a compensating asset_transaction (type <event>_reversal, the negated deltas) naming that mirror, so the register and the GL stay reconciled; nothing is edited or deleted. A reversed acquisition or opening closes the asset (archived, book value 0): the corrected purchase is a fresh asset. A reversed capitalisation lowers cost and book value. A reversed disposal returns the asset to active (or fully_depreciated at its residual) and clears the disposal date and proceeds. Refused, writing nothing: asset_disposed (reverse the disposal first), capitalisation_stands (reverse the capitalisations before the baseline), depreciation_posted naming the runs (asset_depreciation_run_reverse first, newest first; for a capitalisation only runs of its period or later count), not_reversible (a depreciation row goes with its run; a correcting row is not reversed), already_reversed naming the compensating row, invalid_transition, reason_required, period_locked when today is sealed, not_found (foreign or mismatched ids, §H-TENANT). An event whose entry a raw reverse_entry already took out (a book from before this verb) adopts that reversal and posts nothing (adopted:true). The raw reverse_entry refuses these entries (owned_by asset_transaction_reverse). Idempotent on idempotencyKey; one mirror per event whatever the key.', ctxSchema({ assetId: STR, transactionId: STR, reason: STR, idempotencyKey: STR }, ['assetId', 'transactionId', 'reason', 'idempotencyKey']), (ctx, input) => assetTransactionReverse(ctx, as(input))),
269
+ ctxAction('asset_transaction_reverse', 'write:correctable:books', 'Storniere one financial event on a fixed asset (D170): an acquisition, an additional capitalisation, an opening balance or a disposal, named by assetId and transactionId (from asset_ledger_get). In ONE transaction it posts the faithful A02 reversing entry of the event (OR 957a, dated today) and appends a compensating asset_transaction (type <event>_reversal, the negated deltas) naming that mirror, so the register and the GL stay reconciled; nothing is edited or deleted. A reversed acquisition or opening closes the asset (archived, book value 0): the corrected purchase is a fresh asset. A reversed capitalisation lowers cost and book value. A reversed disposal returns the asset to active (or fully_depreciated at its residual) and clears the disposal date and proceeds. Refused, writing nothing: asset_disposed (reverse the disposal first), capitalisation_stands (reverse the capitalisations before the baseline), depreciation_posted naming the runs (asset_depreciation_run_reverse first, newest first; for a capitalisation only runs of its period or later count), not_reversible (a depreciation row goes with its run; a correcting row is not reversed), already_reversed naming the compensating row, invalid_transition, reason_required, period_locked when today is sealed, not_found (foreign or mismatched ids, §H-TENANT). An event whose entry a raw reverse_entry already took out (a book from before this verb) adopts that reversal and posts nothing (adopted:true). The raw reverse_entry refuses these entries (owned_by asset_transaction_reverse). Idempotent on idempotencyKey; one mirror per event whatever the key. D191: a disposal that names a proceeds document (invoice or incoming payment) is refused proceeds_settled while that document stands (an invoice: not cancelled and not credited in full, or a payment on it stands that was not paid back by a refund on its credit notes; a payment: not reversed), naming the document and the payments, with a hint in undo order (credit note plus refund for a real receipt, reverse_payment only for one booked in error). A single differing case passes overrideProceedsCheck:true with a required overrideReason (reason_required otherwise); the reason is written onto the correcting row and the mirror text and audited (override_proceeds_check). An unlinked disposal is never checked. The workspace setting assets.proceeds_check decides the rule: refuse (default), warn (reverse and name the standing document in warnings, code proceeds_document_stands) or off (no check); asset_ledger_get reports it as proceedsCheck. D192: a disposal that posted an Abgrenzung (a sale across a year end) takes it back in the same transaction through A38\'s own reverse, both Storno legs dated with this reverse (the disposal stays booked in the earlier year, so a Storno on the Abgrenzung\'s periodEnd would misstate both years); the result names it as abgrenzungReversed.', ctxSchema({ assetId: STR, transactionId: STR, reason: STR, overrideProceedsCheck: BOOL, overrideReason: STR, idempotencyKey: STR }, ['assetId', 'transactionId', 'reason', 'idempotencyKey']), (ctx, input) => assetTransactionReverse(ctx, as(input))),
258
270
  ];
259
271
  }
260
272
  //# sourceMappingURL=asset-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-actions.js","sourceRoot":"","sources":["../../src/api/asset-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,o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cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,EAC3I,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CACxD;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"asset-actions.js","sourceRoot":"","sources":["../../src/api/asset-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAiBjC,iGAAiG;AACjG,SAAS,EAAE,CAAI,KAAkB;IAC/B,OAAO,KAAqB,CAAC;AAC/B,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,YAAY,CAAC,CAAqB;IAChD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IAEnD;;yGAEqG;IACrG,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE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AAwB,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CACzD;QACD,SAAS,CACP,uBAAuB,EACvB,yBAAyB,EACzB,8rCAA8rC,EAC9rC,SAAS,CACP;YACE,OAAO,EAAE,GAAG;YACZ,IAAI,EAAE,GAAG;YACT,UAAU,EAAE,GAAG;YACf,qBAAqB,EAAE,GAAG;YAC1B,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,GAAG;YAChB,cAAc,EAAE,GAAG;SACpB,EACD,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,CAAC,CACpD,EACD,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CACpD;QAED,kGAAkG;QAClG,SAAS,CACP,2BAA2B,EAC3B,yBAAyB,EACzB,+1FAA+1F,EAC/1F,SAAS,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,qBAAqB,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,EAC7L,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CACxD;KACF,CAAC;AACJ,CAAC"}
@@ -40,7 +40,10 @@ export declare function isDbPathPinned(env?: NodeJS.ProcessEnv): boolean;
40
40
  * else, writable by group or world, not JSON, or a `dbPath` that is not an absolute path. Never throws.
41
41
  */
42
42
  export declare function readAdoptedBookPath(env?: NodeJS.ProcessEnv): string | null;
43
- /** Why an adopted book cannot be opened: the file is gone, or it is there and the open failed. */
43
+ /**
44
+ * Why an adopted book cannot be opened: the file is gone (`missing`), or it is there and is no book TILL
45
+ * can open (`unopenable`: the open failed, or the file holds 0 bytes, critic R4-L1).
46
+ */
44
47
  export type AdoptedBookUnavailableReason = 'missing' | 'unopenable';
45
48
  /** An adopted book this process could not open. Reported to the Studio, never papered over. */
46
49
  export interface AdoptedBookUnavailable {
@@ -68,8 +71,11 @@ export declare function resolveDbChoice(env?: NodeJS.ProcessEnv): DbChoice;
68
71
  */
69
72
  export declare function resolveDbPath(env?: NodeJS.ProcessEnv): string;
70
73
  /**
71
- * `resolveDbChoice`, plus the directory of the chosen file made durably (as `ensureDbPath` does). Not
72
- * for an unavailable adopted book: its path is `:memory:`, so nothing is created anywhere.
74
+ * `resolveDbChoice`, plus the directory of the chosen file made durably. Not for an unavailable
75
+ * adopted book: its path is `:memory:`, so nothing is created anywhere. This is what every face
76
+ * (`till up`, `till mcp`, `till serve`) opens through, so it is also where a missing path that a
77
+ * registered non-main environment expects (its data root) fails LOUD, before anything is created:
78
+ * the store would otherwise open it as a brand-new, empty ledger (`ledgerGuard.ts`).
73
79
  */
74
80
  export declare function ensureDbChoice(env?: NodeJS.ProcessEnv): DbChoice;
75
81
  /** The one sentence a terminal face prints when it refuses to start without the adopted book. */
@@ -28,6 +28,7 @@ import { lstatSync, readFileSync, statSync } from 'node:fs';
28
28
  import { homedir } from 'node:os';
29
29
  import { join, dirname, isAbsolute } from 'node:path';
30
30
  import { makeDirectoryDurably } from '../core/store/sqlite-store.js';
31
+ import { assertEnvironmentLedgerPresent, ledgerFilePresent } from '../core/landscape/ledgerGuard.js';
31
32
  /** The in-memory location, spelled the way better-sqlite3 spells it. */
32
33
  export const MEMORY_DB = ':memory:';
33
34
  /** The default directory holding the ledger, when `TILL_DB_PATH` says nothing. */
@@ -94,6 +95,11 @@ export function resolveDbChoice(env = process.env) {
94
95
  return { path: defaultDbPath(), source: 'default' };
95
96
  if (isMissing(adopted))
96
97
  return { path: MEMORY_DB, source: 'adopted', adoptedUnavailable: { path: adopted, reason: 'missing' } };
98
+ // Critic R4-L1: a 0-byte book (a half-restored disk, an interrupted copy) is there but holds no ledger,
99
+ // and SQLite would open it as a new, empty one. It is unavailable like a missing book, with the
100
+ // `unopenable` wording ("no longer a TILL book"), since the file itself is still found.
101
+ if (!ledgerFilePresent(adopted))
102
+ return { path: MEMORY_DB, source: 'adopted', adoptedUnavailable: { path: adopted, reason: 'unopenable' } };
97
103
  return { path: adopted, source: 'adopted' };
98
104
  }
99
105
  /**
@@ -106,13 +112,18 @@ export function resolveDbPath(env = process.env) {
106
112
  return resolveDbChoice(env).path;
107
113
  }
108
114
  /**
109
- * `resolveDbChoice`, plus the directory of the chosen file made durably (as `ensureDbPath` does). Not
110
- * for an unavailable adopted book: its path is `:memory:`, so nothing is created anywhere.
115
+ * `resolveDbChoice`, plus the directory of the chosen file made durably. Not for an unavailable
116
+ * adopted book: its path is `:memory:`, so nothing is created anywhere. This is what every face
117
+ * (`till up`, `till mcp`, `till serve`) opens through, so it is also where a missing path that a
118
+ * registered non-main environment expects (its data root) fails LOUD, before anything is created:
119
+ * the store would otherwise open it as a brand-new, empty ledger (`ledgerGuard.ts`).
111
120
  */
112
121
  export function ensureDbChoice(env = process.env) {
113
122
  const choice = resolveDbChoice(env);
114
- if (choice.path !== MEMORY_DB)
123
+ if (choice.path !== MEMORY_DB) {
124
+ assertEnvironmentLedgerPresent(choice.path, [resolveSupportDir(env)]);
115
125
  makeDirectoryDurably(dirname(choice.path));
126
+ }
116
127
  return choice;
117
128
  }
118
129
  /** The one sentence a terminal face prints when it refuses to start without the adopted book. */
@@ -129,10 +140,8 @@ export function adoptedUnavailableRefusal(face, unavailable) {
129
140
  * of existence. The store syncs the ledger's own directory entry when it creates the file.
130
141
  */
131
142
  export function ensureDbPath(env = process.env) {
132
- const path = resolveDbPath(env);
133
- if (path !== MEMORY_DB)
134
- makeDirectoryDurably(dirname(path));
135
- return path;
143
+ // The same guard and durable directory as `ensureDbChoice`: one code path, so the two cannot drift.
144
+ return ensureDbChoice(env).path;
136
145
  }
137
146
  /**
138
147
  * G08's directory. Honours `TILL_SU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S,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAChH,OAAO,GAAG,IAAI,+BAA+B,IAAI,KAAK,WAAW,CAAC,IAAI,4EAA4E,CAAC;AACrJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,MAAyB,OAAO,CAAC,GAAG;IAC/D,oGAAoG;IACpG,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACpE,MAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC;IAChD,OAAO,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;AACrF,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACnE,MAAM,UAAU,GAAG,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,EAAE;QAAE,OAAO,UAAU,CAAC;IACrE,MAAM,OAAO,GAAG,GAAG,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC7E,OAAO,IAAI,CAAC,YAAY,EAAE,EAAE,SAAS,CAAC,CAAC;AACzC,CAAC"}
@@ -24,7 +24,7 @@ import { egressSelfTest, egressStatus } from '../core/egress/index.js';
24
24
  export function egressActions(h) {
25
25
  const { ctxAction, ctxSchema } = h;
26
26
  return [
27
- ctxAction('egress_self_test', 'read', 'Run the offline proof (OP6): install a socket-level probe over every network vector (TCP, UDP, DNS, TLS, HTTP(S), fetch, WebSocket, subprocess) and run a REAL end-to-end draft generation (E04 mail read -> E05 voice retrieve -> E06 compose -> E04 Drafts write) under it. Reports honestly: passed:true with socketsOpened:0 when the whole loop opened zero sockets (the claim, measured, and it holds with wifi on or off because the probe counts sockets and does not depend on the network being down); egress_violated with the offenders named when any socket was opened (we report our own violation loudly, never degrade the claim quietly); needs_setup naming what is missing (mail_store, voice_profile, local_runtime, draftable_thread) when a real run cannot be attempted; self_test_incomplete when the loop could not finish for a non-egress reason. Produces a draft in the practitioner\'s own local Drafts folder; mints nothing else. Reads egress.read; deliberately readable by an agent auditing the claim.', ctxSchema(), (ctx) => egressSelfTest(ctx)),
27
+ ctxAction('egress_self_test', 'read', 'Run the offline proof (OP6): install a socket-level probe over every network vector (TCP, UDP, DNS, TLS, HTTP(S), fetch, WebSocket, subprocess) and run a REAL end-to-end draft generation (E04 mail read -> E05 voice retrieve -> E06 compose -> E04 Drafts write) under it. Reports honestly: passed:true with socketsOpened:0 when the whole loop opened zero sockets (the claim, measured, and it holds with wifi on or off because the probe counts sockets and does not depend on the network being down); egress_violated with the offenders named when any socket was opened (we report our own violation loudly, never degrade the claim quietly); needs_setup naming what is missing (mail_store, voice_profile, local_runtime, draftable_thread) when a real run cannot be attempted; self_test_incomplete when the loop could not finish for a non-egress reason. One local subprocess is allow-listed by name, path and arguments and is not a violation: the Thunderbird busy check lsof -t -w -- <files> (it opens no socket), which every outcome names under localSubprocesses so a run never claims that no subprocess ran. Produces a draft in the practitioner\'s own local Drafts folder; mints nothing else. Reads egress.read; deliberately readable by an agent auditing the claim.', ctxSchema(), (ctx) => egressSelfTest(ctx)),
28
28
  ctxAction('egress_status', 'read', 'The standing trust indicator (P5, observed never stored): the egress state of THIS process. state=local when the probe is installed and has observed zero outbound sockets this session, violated when it has seen one or more (with the offenders), unknown when the probe could not install (an unverified claim renders as unverified, never as optimism). socketsOpened is the observed count and since is when the observer started. Scoped to the TILL process, NOT the Mac: the mail app uses the internet (that is how mail arrives); this reports only what TILL itself did. Reads egress.read.', ctxSchema(), (ctx) => egressStatus(ctx)),
29
29
  ];
30
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"egress-actions.js","sourceRoot":"","sources":["../../src/api/egress-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAcvE,sCAAsC;AACtC,MAAM,UAAU,aAAa,CAAC,CAAsB;IAClD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IAEnC,OAAO;QACL,SAAS,CACP,kBAAkB,EAClB,MAAM,EACN,6+BAA6+B,EAC7+B,SAAS,EAAE,EACX,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAC7B;QACD,SAAS,CACP,eAAe,EACf,MAAM,EACN,0kBAA0kB,EAC1kB,SAAS,EAAE,EACX,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAC3B;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"egress-actions.js","sourceRoot":"","sources":["../../src/api/egress-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAcvE,sCAAsC;AACtC,MAAM,UAAU,aAAa,CAAC,CAAsB;IAClD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IAEnC,OAAO;QACL,SAAS,CACP,kBAAkB,EAClB,MAAM,EACN,6uCAA6uC,EAC7uC,SAAS,EAAE,EACX,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAC7B;QACD,SAAS,CACP,eAAe,EACf,MAAM,EACN,0kBAA0kB,EAC1kB,SAAS,EAAE,EACX,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAC3B;KACF,CAAC;AACJ,CAAC"}
@@ -108,7 +108,7 @@ export function envActions(h) {
108
108
  confirmed: BOOL,
109
109
  idempotencyKey: STR,
110
110
  }, ['name', 'policy']), (ctx, input, deps) => stagedWrite(ctx, input, 'env_create', () => envCreate(landscapeDeps(ctx, deps), input))),
111
- ctxAction('env_copy', 'write:final:erase', 'Copy data one-way from a source environment into a lower one, sanitized. scope is instance (every workspace) or mandate:<workspaceId> (one workspace, others in the target untouched). sanitize is raw (verbatim), pseudonymize (deterministic PII masking, valid CH test IBANs, amounts intact unless scaleFactor is given) or structure_synthetic (structure kept, amounts and transactions replaced). Build-then-swap: a failed copy leaves the prior target intact. Refuses target=main and refuses a source whose tier rank is not strictly above the target (down-only). The SECRET FLOOR always neutralizes live access secrets (bank/EBICS/token) regardless of level; the owner-only retainSecrets override lifts it. Refuses a copy into the active env without force. Unconfirmed, returns the exact plan and changes nothing (P8).', ctxSchema({
111
+ ctxAction('env_copy', 'write:final:erase', 'Copy data one-way from a source environment into a lower one, sanitized. scope is instance (every workspace) or mandate:<workspaceId> (one workspace, others in the target untouched). sanitize is raw (verbatim), pseudonymize (deterministic PII masking, valid CH test IBANs, amounts intact unless scaleFactor is given) or structure_synthetic (structure kept, amounts and transactions replaced). Build-then-swap: a failed copy leaves the prior target intact, and the swap is one atomic rename, refused (copy_swap_refused, reason target_in_use) while any other connection has the target open; an instance copy rebuilds a target whose ledger file is not a SQLite database, and any other failure to quiesce the target answers copy_swap_refused with reason target_quiesce_failed. A mandate copy into a target whose ledger file has gone missing answers target_data_missing (rebuild it first). Refuses target=main and refuses a source whose tier rank is not strictly above the target (down-only). The SECRET FLOOR always neutralizes live access secrets (bank/EBICS/token) regardless of level; the owner-only retainSecrets override lifts it. Refuses a copy into the active env: switch away first (the serving process holds it open, so even a forced swap answers copy_swap_refused, reason target_in_use). Unconfirmed, returns the exact plan and changes nothing (P8).', ctxSchema({
112
112
  source: STR,
113
113
  target: STR,
114
114
  scope: STR,
@@ -119,7 +119,7 @@ export function envActions(h) {
119
119
  confirmed: BOOL,
120
120
  idempotencyKey: STR,
121
121
  }, ['source', 'target']), (ctx, input, deps) => stagedWrite(ctx, input, 'env_copy', () => envCopy(landscapeDeps(ctx, deps), input))),
122
- ctxAction('env_reset', 'write:final:erase', 'Wipe and repopulate an environment from its data policy, build-then-swap: a new db file is seeded and gated (foreign-key check plus a balance re-foot) and swapped in only on success, so a failed reset leaves the prior environment intact. Refused on main (by data root, not just name) and on the active env without force. Reset of a copy-policy env is Phase B. Unconfirmed, returns a plan and changes nothing (P8).', ctxSchema({ name: STR, seed: STR, force: BOOL, confirmed: BOOL, idempotencyKey: STR }, ['name']), (ctx, input, deps) => stagedWrite(ctx, input, 'env_reset', () => envReset(landscapeDeps(ctx, deps), input))),
122
+ ctxAction('env_reset', 'write:final:erase', 'Wipe and repopulate an environment from its data policy, build-then-swap: a new db file is seeded and gated (foreign-key check plus a balance re-foot) and swapped in only on success by one atomic rename, so a failed reset leaves the prior environment intact; the swap is refused (swap_refused, reason target_in_use) while any other connection has the environment open. A ledger file that is not a SQLite database is rebuilt; any other failure to quiesce it answers swap_refused with reason target_quiesce_failed. Refused on main (by data root, not just name) and on the active env: switch away first (the serving process holds it open, so even a forced swap answers swap_refused, reason target_in_use). Reset of a copy-policy env is Phase B. Unconfirmed, returns a plan and changes nothing (P8).', ctxSchema({ name: STR, seed: STR, force: BOOL, confirmed: BOOL, idempotencyKey: STR }, ['name']), (ctx, input, deps) => stagedWrite(ctx, input, 'env_reset', () => envReset(landscapeDeps(ctx, deps), input))),
123
123
  ctxAction('env_delete', 'write:final:erase', 'Remove a named environment`s data root and its landscape entry. Refused on main always, on a standard tier without force (use reset), and on the active environment (switch away first). Unconfirmed, returns a plan and changes nothing (P8).', ctxSchema({ name: STR, force: BOOL, confirmed: BOOL, idempotencyKey: STR }, ['name']), (ctx, input, deps) => stagedWrite(ctx, input, 'env_delete', () => envDelete(landscapeDeps(ctx, deps), input))),
124
124
  ];
125
125
  }
@@ -1 +1 @@
1
- {"version":3,"file":"env-actions.js","sourceRoot":"","sources":["../../src/api/env-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKnD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,cAAc,GAEf,MAAM,4BAA4B,CAAC;AAiBpC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C,uGAAuG;AACvG,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE/E,wGAAwG;AACxG,SAAS,aAAa,CAAC,GAAqB,EAAE,IAAa;IACzD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,iBAAiB,EAAE,CAAC;IAC1D,OAAO;QACL,UAAU;QACV,gBAAgB,EAAE,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC;QAClD,UAAU,EAAE,aAAa,EAAE;QAC3B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;QAC1B,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC;QAClC,yFAAyF;QACzF,GAAG,EAAE,GAAG,CAA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AAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAChG,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAC5G;QACD,SAAS,CACP,YAAY,EACZ,mBAAmB,EACnB,gPAAgP,EAChP,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EACrF,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAC9G;KACF,CAAC;AACJ,CAAC"}
@@ -27,7 +27,7 @@ export function mailActions(h) {
27
27
  ctxAction('mail_reindex', 'write:final:erase', 'Lies den Mail-Speicher neu ein: walk the store and derive the index (threads and messages keyed on Message-ID), storing a locator and a sha256 per message and NEVER a body (OP6 index-never-copy). Senders matching a contact e-mail resolve to that contact; unknown senders stay indexed with none. Messages deleted in the mail client leave the index (the store is the authority); unparseable ones are skipped and counted, never fatal. Answers { indexed, skipped, removed, skippedReasons }.', ctxSchema({ accountId: STR, idempotencyKey: STR }, ['accountId']), (ctx, input) => reindexMailStore(ctx, as(input))),
28
28
  ctxAction('mail_threads_list', 'read', 'Die Korrespondenz-Warteschlange (P5, computed at query time): threads with their bucket derived from newest-message direction versus newest draft (needs_reply, drafted, done; recent and all as views), filterable by account or contact. savedViewId applies a G00 saved view; its stored filters merge underneath any filter named explicitly here.', ctxSchema({ accountId: STR, bucket: STR, contactId: STR, savedViewId: STR }), (ctx, input) => listMailThreads(ctx, as(input))),
29
29
  ctxAction('mail_thread_get', 'read', 'Ein Thread mit seinen Nachrichten, bodies read ON DEMAND from the mail store via each store_ref, never from SQLite. A message whose locator no longer resolves answers error message_moved while the rest of the thread still renders; a body whose re-read hash disagrees with the indexed sha256 comes back flagged stale:true.', ctxSchema({ threadId: STR }, ['threadId']), (ctx, input) => getMailThread(ctx, as(input))),
30
- ctxAction('mail_draft_write', 'write:final:internal', 'Schreibe einen Entwurf in den Entwurfsordner des Mail-Programms: renders an RFC-5322 reply (From the account address, To the counterpart, In-Reply-To the newest inbound message) into the local Drafts folder and persists locator + hash, not the body. The human reviews and sends it in their own mail app: TILL has no send verb and no SMTP anywhere (P8 by construction). One idempotency key writes exactly ONE Drafts message however often it is called; an unwritable folder answers drafts_not_writable.', ctxSchema({ threadId: STR, body: STR, inReplyTo: STR, draftRunId: STR, idempotencyKey: STR }, ['threadId', 'body']), (ctx, input) => writeMailDraft(ctx, as(input))),
30
+ ctxAction('mail_draft_write', 'write:final:internal', 'Schreibe einen Entwurf in den Entwurfsordner des Mail-Programms: renders an RFC-5322 reply (From the account address, To the counterpart, In-Reply-To the newest inbound message) into the local Drafts folder and persists locator + hash, not the body. The human reviews and sends it in their own mail app: TILL has no send verb and no SMTP anywhere (P8 by construction). One idempotency key writes exactly ONE Drafts message however often it is called; an unwritable folder answers drafts_not_writable, a mail client holding the Drafts mbox mail_store_busy (reason mail_client_running, or mail_client_unknown when the lsof busy check could not answer, which refuses rather than write), and a Drafts file that changed under the write mail_store_changed, with nothing written in any of the three.', ctxSchema({ threadId: STR, body: STR, inReplyTo: STR, draftRunId: STR, idempotencyKey: STR }, ['threadId', 'body']), (ctx, input) => writeMailDraft(ctx, as(input))),
31
31
  ctxAction('mail_drafts_list', 'read', 'Die von TILL zurückgeschriebenen Entwürfe (P5): locator, hash, draft-run provenance and reply target per draft, for one thread or across the workspace, newest first.', ctxSchema({ threadId: STR }), (ctx, input) => listMailDrafts(ctx, as(input))),
32
32
  ];
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mail-actions.js","sourceRoot":"","sources":["../../src/api/mail-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,uBAAuB,CAAC;AAe/B,iGAAiG;AACjG,SAAS,EAAE,CAAI,KAAkB;IAC/B,OAAO,KAAqB,CAAC;AAC/B,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,WAAW,CAAC,CAAoB;IAC9C,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAExC,OAAO;QACL,SAAS,CACP,cAAc,EACd,oBAAoB,EACpB,8YAA8Y,EAC9Y,SAAS,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,EACnH,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CACjD;QACD,SAAS,CACP,oBAAoB,EACpB,MAAM,EACN,sKAAsK,EACtK,SAAS,EAAE,EACX,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAC/B;QACD,SAAS,CACP,cAAc,EACd,mBAAmB,EACnB,weAAwe,EACxe,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EACjE,CA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AAC,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,EAC5E,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAChD;QACD,SAAS,CACP,iBAAiB,EACjB,MAAM,EACN,mUAAmU,EACnU,SAAS,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAC1C,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAC9C;QACD,SAAS,CACP,kBAAkB,EAClB,sBAAsB,EACtB,0xBAA0xB,EAC1xB,SAAS,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,EACnH,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAC/C;QACD,SAAS,CACP,kBAAkB,EAClB,MAAM,EACN,uKAAuK,EACvK,SAAS,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAC5B,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAC/C;KACF,CAAC;AACJ,CAAC"}
package/dist/api/up.d.ts CHANGED
@@ -22,10 +22,12 @@
22
22
  * prints its URL, opens the browser at it and exits without starting a second scheduler.
23
23
  */
24
24
  import type { IncomingMessage, Server, ServerResponse } from 'node:http';
25
+ import type { ChildProcess, SpawnOptions } from 'node:child_process';
25
26
  import type { LocalFileGrant } from '../core/files/index.js';
26
27
  import { type ServedModeConfig } from './served-mode.js';
27
28
  import { type StudioKeySource } from './studio-key-store.js';
28
29
  import { type StudioDeviceRegistry } from './studio-devices.js';
30
+ import { type AdoptedBookUnavailable } from './db-path.js';
29
31
  import { type Scheduler } from './scheduler.js';
30
32
  import { type UpLock } from './up-lock.js';
31
33
  import type { SqliteStore } from '../core/store/sqlite-store.js';
@@ -68,16 +70,49 @@ export declare function serveStudio(req: IncomingMessage, res: ServerResponse, s
68
70
  * not owner-only, and a ticket is a credential until it is spent.
69
71
  */
70
72
  export declare function redactStudioLink(url: string): string;
71
- /** Open the default browser at `url`, best-effort. A launch failure is never fatal: the URL is logged, minus any key. */
72
- export declare function openBrowser(url: string, log?: (line: string) => void): void;
73
73
  /**
74
- * Open a Studio link (it carries a one-time ticket, D166) through the operating system. On macOS the
75
- * link goes to `osascript` on stdin (`open location`), not on a command line: an argument is visible to
76
- * every account on the machine through `ps` while the process lives, and the reopen door can be fired
77
- * by any local program. Elsewhere it falls back to `openBrowser` (`xdg-open` takes the URL as an
78
- * argument; a ticket seen there is single-use and expires, DECISIONS D166). Best-effort, never fatal.
74
+ * What the openers below touch outside this process. Overridable so a suite records every command line
75
+ * they would run instead of opening a browser (`test/api/up-open-argv.test.mjs`).
79
76
  */
80
- export declare function openStudioLink(url: string, log?: (line: string) => void): void;
77
+ export interface OpenerPorts {
78
+ platform: NodeJS.Platform;
79
+ spawn: (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
80
+ /** Where a handoff file may be written, in order (a fresh owner-only directory inside the first that takes it). */
81
+ handoffDirs: readonly string[];
82
+ /** How long a handoff file lives before it is removed. */
83
+ handoffTtlMs: number;
84
+ }
85
+ /** A browser that is still starting reads the handoff file late; half a minute covers a cold start. */
86
+ export declare const HANDOFF_TTL_MS = 30000;
87
+ /** The prefix of a handoff directory, so a later open can sweep one an exited process left behind. */
88
+ export declare const HANDOFF_DIR_PREFIX = "till-open-";
89
+ /**
90
+ * Open the default browser at `url`, best-effort. A launch failure is never fatal: the URL is logged.
91
+ * The fragment is CUT before the command line is built (it may carry a ticket or a key): a Studio link
92
+ * that must keep its ticket goes through `openStudioLink`.
93
+ */
94
+ export declare function openBrowser(url: string, log?: (line: string) => void, ports?: OpenerPorts): void;
95
+ /**
96
+ * Remove handoff directories of ours older than their lifetime: a process that exited early (the
97
+ * second `till up`, which redirects and exits) left them. Runs before every handoff and at start.
98
+ * Only a directory `writeHandoff` could have made is touched (critic r1 F1): a mkdtemp-shaped name,
99
+ * a real directory (never a symlink) this account owns, holding nothing but the page, itself a plain
100
+ * file. Anything else is left alone, whatever its age.
101
+ */
102
+ export declare function sweepStudioHandoffs(ports?: Pick<OpenerPorts, 'handoffDirs' | 'handoffTtlMs'>): void;
103
+ /**
104
+ * Open a Studio link (it carries a one-time ticket, D166) through the operating system WITHOUT the
105
+ * ticket ever reaching a command line (D162 point 3), on every platform and every fallback:
106
+ *
107
+ * - macOS: the link goes to `osascript` on stdin (`open location`);
108
+ * - elsewhere, and when `osascript` cannot start: the opener gets the `file:` URL of an owner-only
109
+ * handoff page that forwards to the link (`writeHandoff`);
110
+ * - when no handoff can be written, or the link is not ours: the bare URL, and the tab pairs itself
111
+ * or shows how to get in.
112
+ *
113
+ * Best-effort, never fatal.
114
+ */
115
+ export declare function openStudioLink(url: string, log?: (line: string) => void, ports?: OpenerPorts): void;
81
116
  /**
82
117
  * N02 (D183, critic F6): the local-file grant `till up` hands its faces and its scheduler, or none. Only a
83
118
  * LOCAL instance (not served) bound to LOOPBACK reads receipts by path: a served caller sits across a
@@ -134,11 +169,13 @@ export interface UpOptions {
134
169
  /**
135
170
  * D166 point 8 (critic F1/F2): `dbPath` is the ADOPTED book (`resolveDbChoice` source `adopted`).
136
171
  * Then a failed open does not stop `till up`: it starts on an in-memory book and reports the adopted
137
- * book unavailable (`unopenable`). `unavailable: 'missing'` says the file is already known to be gone.
172
+ * book unavailable (`unopenable`). `unavailable` says `resolveDbChoice` already found it unavailable,
173
+ * and why: `missing` (the file is gone) or `unopenable` (it is there but holds no ledger, e.g. 0 bytes,
174
+ * critic R4-L1/R5-L1), so the Studio shows the sentence that fits.
138
175
  */
139
176
  adoptedBook?: {
140
177
  path: string;
141
- unavailable?: 'missing';
178
+ unavailable?: AdoptedBookUnavailable['reason'];
142
179
  };
143
180
  log?: (line: string) => void;
144
181
  }