@juli-os/ledger 0.1.1 → 0.1.2

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { createLedgerStore, type LifecycleStore } from './platform/ledger/store.ts';
2
2
  export type { Workflow, Step, WorkflowStatus, StepStatus, StepKind } from './contracts/entities.ts';
3
- export { createUsageStore, type UsageStore, type UsageStats } from './platform/ledger/usage.ts';
4
- export { priceUsage, findPrice, type UsageCost, type UsageRow } from './platform/ledger/pricing.ts';
5
- export { emptyCaseFile, parseCaseFile, serializeCaseFile, type CaseFileDoc, appendSection, appendExecution, appendDecision, appendReference, originalEmail, } from './platform/ledger/casefile.ts';
3
+ export { createUsageStore, type UsageRecord, type UsageStats, type TimelinePoint, type UsageStore, } from './platform/ledger/usage.ts';
4
+ export { findPrice, priceUsage, type TierWhen, type PriceTier, type ModelPrice, PRICING_SOURCE, PRICING_RETRIEVED_AT, BIGMODEL_PRICES, type UsageRow, type CostBreakdown, type ModelUsageCost, type UsageCost, } from './platform/ledger/pricing.ts';
5
+ export { emptyCaseFile, parseCaseFile, serializeCaseFile, withOriginal, appendSection, appendExecution, appendDecision, appendReference, originalEmail, type CaseDecision, type ArtifactRef, type CaseFileDoc, } from './platform/ledger/casefile.ts';
6
6
  export { rfc3339, systemClock, randomIds, type Clock, type IdGen } from './platform/shared/clock.ts';
7
7
  export { asRecord, safeParse, type JsonRecord, type JsonValue } from './platform/shared/json.ts';
package/dist/index.js CHANGED
@@ -103,6 +103,17 @@ var parseCaseFile = (raw, now) => {
103
103
  };
104
104
  };
105
105
  var serializeCaseFile = (cf) => JSON.stringify(cf);
106
+ var withOriginal = (cf, o, now) => ({
107
+ ...cf,
108
+ original: {
109
+ from: o.from,
110
+ ...o.fromName !== void 0 && o.fromName !== "" ? { from_name: o.fromName } : {},
111
+ subject: o.subject,
112
+ body: o.body,
113
+ message_id: o.messageId
114
+ },
115
+ updatedAt: rfc3339(now)
116
+ });
106
117
  var appendSection = (cf, section, value, now) => ({
107
118
  ...cf,
108
119
  ...section === "extract" ? { extract: value } : { draft: value },
@@ -1228,6 +1239,9 @@ var parseAssistantLine = (line) => {
1228
1239
  }
1229
1240
  };
1230
1241
  export {
1242
+ BIGMODEL_PRICES,
1243
+ PRICING_RETRIEVED_AT,
1244
+ PRICING_SOURCE,
1231
1245
  appendDecision,
1232
1246
  appendExecution,
1233
1247
  appendReference,
@@ -1244,5 +1258,6 @@ export {
1244
1258
  rfc3339,
1245
1259
  safeParse,
1246
1260
  serializeCaseFile,
1247
- systemClock
1261
+ systemClock,
1262
+ withOriginal
1248
1263
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juli-os/ledger",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "juli-os L1 layer: the ledger of record for agent work — workflows, steps, case files, and token usage in one zero-dependency SQLite layer.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",