@makaio/framework 1.0.0-dev-1789404058608 → 1.0.0-dev-1789642522820

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 (117) hide show
  1. package/dist/.makaio-build.json +2 -2
  2. package/dist/{adapter-C4v_gNTI.mjs → adapter-DSRgsh2d.mjs} +1 -1
  3. package/dist/adapters/claude/index.d.mts +24 -24
  4. package/dist/adapters/claude/index.mjs +3 -3
  5. package/dist/bus/index.mjs +1 -1
  6. package/dist/bus-BOGcnhgA.mjs +9 -0
  7. package/dist/client-DqfP7BeX.mjs +1 -0
  8. package/dist/clients/index.d.mts +152 -11
  9. package/dist/clients/index.mjs +1 -1
  10. package/dist/contracts/adapter/index.d.mts +2 -2
  11. package/dist/contracts/adapter/index.mjs +1 -1
  12. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  13. package/dist/contracts/artifact/index.d.mts +2 -2
  14. package/dist/contracts/capabilities/index.d.mts +1 -1
  15. package/dist/contracts/client/index.d.mts +3 -3
  16. package/dist/contracts/client/index.mjs +1 -1
  17. package/dist/contracts/extension/index.d.mts +4 -4
  18. package/dist/contracts/index.d.mts +35 -35
  19. package/dist/contracts/index.mjs +1 -1
  20. package/dist/contracts/materialization/index.d.mts +1 -1
  21. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  22. package/dist/contracts/session/index.d.mts +2 -2
  23. package/dist/contracts/session/index.mjs +1 -1
  24. package/dist/contracts/shared/index.d.mts +1 -1
  25. package/dist/contracts/variant/index.d.mts +1 -1
  26. package/dist/contracts/worker/index.d.mts +1 -1
  27. package/dist/contracts/workflow/index.d.mts +2 -2
  28. package/dist/drizzle/0040_session_generation.sql +1 -0
  29. package/dist/drizzle/meta/_journal.json +7 -0
  30. package/dist/{framework-packages-Bg4edkkM.mjs → framework-packages-BNFG51Td.mjs} +1 -1
  31. package/dist/{hook-responses-Dq16X3Cb.d.mts → hook-responses-CQ2q0aPE.d.mts} +47 -4
  32. package/dist/{index-DaAWCLe9.d.mts → index-B-u0Tu8X.d.mts} +24 -24
  33. package/dist/{index-C1nSuiG0.d.mts → index-B6WkHnCQ.d.mts} +1 -1
  34. package/dist/{index-Du4wUv9q.d.mts → index-BS-Fhlux.d.mts} +48 -13
  35. package/dist/{index-BArnbdj6.d.mts → index-Bh57xARQ.d.mts} +65 -65
  36. package/dist/{index-DH0m01hJ2.d.mts → index-CXpgL3gz2.d.mts} +3 -3
  37. package/dist/{index-n1hV8uFw2.d.mts → index-CdWxSwhQ2.d.mts} +11 -11
  38. package/dist/{index-DjQebquc.d.mts → index-ClKwF6LE.d.mts} +291 -291
  39. package/dist/{index-BUC9P6Q12.d.mts → index-CztxEJrG2.d.mts} +51 -8
  40. package/dist/{index-BEi6nx1S2.d.mts → index-De_oh9M-2.d.mts} +1 -1
  41. package/dist/{index-N3f65Z_S.d.mts → index-Dn23R_ck.d.mts} +9 -9
  42. package/dist/{index-gu4mzfTr.d.mts → index-Hnsy6XhM.d.mts} +1 -1
  43. package/dist/{index-CWlvL7GB.d.mts → index-nkix3hP7.d.mts} +6 -6
  44. package/dist/{index-CGxjX4fw.d.mts → index-p1l00SGS.d.mts} +320 -12
  45. package/dist/{index-T-aAKybB.d.mts → index-xsaaa85T.d.mts} +8 -8
  46. package/dist/{index-HMb0RcTG2.d.mts → index-zEkS2L862.d.mts} +18 -12
  47. package/dist/kernel/extension/index.d.mts +1 -1
  48. package/dist/kernel/index.d.mts +2 -2
  49. package/dist/kernel/observability/index.d.mts +1 -1
  50. package/dist/{namespace-DQpBf2CK.d.mts → namespace-B5IFLQc-.d.mts} +6 -6
  51. package/dist/{namespace-Cmu-5_P9.d.mts → namespace-BR03HE8G.d.mts} +42 -0
  52. package/dist/{namespace-uCaKZm89.d.mts → namespace-BqfzcRkL.d.mts} +3 -3
  53. package/dist/{namespace-CPGTaFqO.d.mts → namespace-Phxf0Lep.d.mts} +2 -2
  54. package/dist/{namespace-D2RZfl0a.d.mts → namespace-UFcDEBJB.d.mts} +2 -2
  55. package/dist/{namespace-DSRoDmT6.d.mts → namespace-rJ3ycPMg.d.mts} +2 -2
  56. package/dist/{orchestrator-shared-CtPB6PAr.mjs → orchestrator-shared-CxO1lfpP.mjs} +1 -1
  57. package/dist/ownership-memory-handler-BOhmmlJj.mjs +1 -0
  58. package/dist/{package-D-oIvXJD.d.mts → package-CDj3F-L3.d.mts} +1 -1
  59. package/dist/package.json +1 -1
  60. package/dist/{registry-DNMjJ-Oj.mjs → registry-DtaRGU8i.mjs} +1 -0
  61. package/dist/{schema-BA1cHBbc.d.mts → schema-DqKCg5Ec.d.mts} +30 -0
  62. package/dist/{schemas-CJKDu4Kt.d.mts → schemas-2_D4iVbb.d.mts} +1 -1
  63. package/dist/{schemas-BQsXr4FF.d.mts → schemas-CFciElld.d.mts} +7 -7
  64. package/dist/{schemas-BcynDWi-.d.mts → schemas-Cj6Gbqch.d.mts} +7 -7
  65. package/dist/schemas-CkxAK13D.mjs +1 -0
  66. package/dist/{schemas-e8o4JGBu.d.mts → schemas-Cq1d5tid.d.mts} +2 -2
  67. package/dist/services/adapter-runtime/index.d.mts +3 -3
  68. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  69. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  70. package/dist/services/agent-runtime/index.d.mts +2 -2
  71. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  72. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  73. package/dist/services/execution-target/index.d.mts +1 -1
  74. package/dist/services/filesystem/namespace.d.mts +6 -6
  75. package/dist/services/filesystem/schemas.d.mts +3 -3
  76. package/dist/services/index.d.mts +28 -28
  77. package/dist/services/index.mjs +1 -1
  78. package/dist/services/session/index.d.mts +4 -4
  79. package/dist/services/session/index.mjs +1 -1
  80. package/dist/services/session/messages/namespace.d.mts +1 -1
  81. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  82. package/dist/services/session/storage/namespace.d.mts +1 -1
  83. package/dist/services/session/storage/schema.d.mts +1 -1
  84. package/dist/services/session/storage/schema.mjs +1 -1
  85. package/dist/services/session/testing/index.mjs +2 -1
  86. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  87. package/dist/services/settings/namespace.d.mts +4 -4
  88. package/dist/services/subagent-template/index.d.mts +2 -2
  89. package/dist/services/subagent-template/namespace.d.mts +1 -1
  90. package/dist/services/subagent-template/schemas.d.mts +1 -1
  91. package/dist/services/tool-approval/index.mjs +1 -1
  92. package/dist/services/tools/index.mjs +1 -1
  93. package/dist/services/tray-menu/index.d.mts +2 -2
  94. package/dist/services/tray-menu/namespace.d.mts +1 -1
  95. package/dist/services/tray-menu/schemas.d.mts +1 -1
  96. package/dist/services/workflow-transitions/index.mjs +1 -1
  97. package/dist/session-BP5aq2kt.mjs +95 -0
  98. package/dist/{session-BB0s7c2B.mjs → session-BcArFp9M.mjs} +1 -1
  99. package/dist/{session-lineage-BQimcKsh.d.mts → session-lineage-C3myyt5x.d.mts} +1 -1
  100. package/dist/storage/drizzle/client.mjs +1 -1
  101. package/dist/storage/drizzle/index.mjs +1 -1
  102. package/dist/{tool-approval-service-pbkGcAV8.mjs → tool-approval-service-CXTklh3T.mjs} +1 -1
  103. package/dist/{tools-C5Gy0IQG.mjs → tools-hiFv-jJn.mjs} +1 -1
  104. package/dist/{transition-JmAdtcwW.d.mts → transition-D-Lgbp1j.d.mts} +1 -1
  105. package/dist/{types-C5MnkQv6.d.mts → types-D5kqrOad.d.mts} +18 -9
  106. package/dist/{view-builder-ByHQ4Oop.d.mts → view-builder-CHUTXJDl.d.mts} +2 -2
  107. package/dist/workflow-engine/index.d.mts +34 -34
  108. package/dist/workflow-engine/package.d.mts +1 -1
  109. package/dist/{workflow-transitions-C0sg3kar.mjs → workflow-transitions-BalNKTtE.mjs} +1 -1
  110. package/package.json +1 -1
  111. package/dist/bus-DlTN167w.mjs +0 -9
  112. package/dist/client-CgtNXGXg.mjs +0 -1
  113. package/dist/ownership-memory-handler-xex7sLiX.mjs +0 -1
  114. package/dist/schemas-ClkcU_N5.mjs +0 -1
  115. package/dist/session-6UG5udTX.mjs +0 -95
  116. package/dist/{index-CCH0Dnty2.d.mts → index-Htfr-K5U2.d.mts} +6 -6
  117. package/dist/{schemas-lAb9QH1A.d.mts → schemas-JjyFxrC0.d.mts} +8 -8
@@ -3131,6 +3131,23 @@ declare const sessionStorageSchema: _$_makaio_storage_drizzle0.DialectSchema<{
3131
3131
  }, {}, {
3132
3132
  length: number | undefined;
3133
3133
  }>;
3134
+ generation: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
3135
+ name: string;
3136
+ tableName: "sessions";
3137
+ dataType: "number";
3138
+ columnType: "SQLiteInteger";
3139
+ data: number;
3140
+ driverParam: number;
3141
+ notNull: true;
3142
+ hasDefault: true;
3143
+ isPrimaryKey: false;
3144
+ isAutoincrement: false;
3145
+ hasRuntimeDefault: false;
3146
+ enumValues: undefined;
3147
+ baseColumn: never;
3148
+ identity: undefined;
3149
+ generated: undefined;
3150
+ }, {}, {}>;
3134
3151
  adapterName: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
3135
3152
  name: "adapter_name";
3136
3153
  tableName: "sessions";
@@ -4597,7 +4614,8 @@ type SearchSessionRow = {
4597
4614
  parent_session_id: string | null;
4598
4615
  root_session_id: string | null;
4599
4616
  fork_point_message_id: string | null;
4600
- branch_kind: IMakaioSession['branchKind'] | null;
4617
+ branch_kind: IMakaioSession['branchKind'] | null; /** Compaction ordinal. `NOT NULL` in the schema, so a matched row always carries one. */
4618
+ generation: number;
4601
4619
  adapter_name: string | null;
4602
4620
  adapter_session_id: string | null;
4603
4621
  adapter_id: string | null;
@@ -5463,7 +5481,16 @@ declare function isTrackingStub(session: Pick<IMakaioSession, 'isImported' | 'im
5463
5481
  declare class ObservedSessionIngestionService {
5464
5482
  private readonly bus;
5465
5483
  /**
5466
- * Adapter session IDs owned by the managed orchestration path.
5484
+ * Adapter session IDs owned by the managed orchestration path, mapped to the
5485
+ * framework session id when `client.runtime.started` already resolved one.
5486
+ *
5487
+ * A Map rather than a Set because the provider session id is not a durable
5488
+ * handle on this path: after a confirmed rotation the stored row is found
5489
+ * under `currentAdapterSessionId`, not the origin `adapterSessionId` a
5490
+ * source-less lookup compares. The framework session id does not move, so
5491
+ * remembering it here is what lets a compaction reported under a rotated id
5492
+ * still reach its row. The value stays `undefined` when the observation
5493
+ * carried none, and the lookup fallback covers that case.
5467
5494
  *
5468
5495
  * FIFO-capped at {@link MANAGED_SESSION_CAP}; insertion order is the
5469
5496
  * eviction order (mirrors the client services' gate).
@@ -5579,11 +5606,19 @@ declare class ObservedSessionIngestionService {
5579
5606
  /**
5580
5607
  * Rebind an already known observed session to the runtime continuing it.
5581
5608
  *
5582
- * Refreshes runtime/locality facts only (working directory, transcript path,
5583
- * owning machine). A continuation carries no evidence about origin, lineage,
5584
- * import status or creation time, so it must not be able to write them —
5585
- * that is precisely what routing resume/compact through the import upsert
5586
- * used to do.
5609
+ * Refreshes runtime/locality facts (working directory, transcript path,
5610
+ * owning machine) and, for `compact` only, advances the row's `generation`
5611
+ * ordinal — the one thing a continuation *is* first-hand evidence of, since
5612
+ * the provider is reporting its own context reset. A continuation still
5613
+ * carries no evidence about origin, lineage, import status or creation time,
5614
+ * so it must not be able to write those — that is precisely what routing
5615
+ * resume/compact through the import upsert used to do.
5616
+ *
5617
+ * The ordinal is deliberately not a `compress` lineage row: those are keyed
5618
+ * on the compaction boundary record inside the transcript, which no hook
5619
+ * payload carries, so only the importer can create them. The ordinal gives
5620
+ * consumers the generation boundary at the moment it happens; the lineage
5621
+ * gives them the compacted content once the import catches up.
5587
5622
  *
5588
5623
  * A `'not-found'` outcome is resolved by the ingestion policy, because the
5589
5624
  * skip is only correct while a transcript import is still coming:
@@ -6596,8 +6631,8 @@ declare const MessageRoutingNamespace: _$_makaio_storage_core0.StorageNamespaceD
6596
6631
  agentId: z.ZodString;
6597
6632
  status: z.ZodEnum<{
6598
6633
  completed: "completed";
6599
- sent: "sent";
6600
6634
  acknowledged: "acknowledged";
6635
+ sent: "sent";
6601
6636
  }>;
6602
6637
  timestamp: z.ZodNumber;
6603
6638
  error: z.ZodOptional<z.ZodString>;
@@ -6622,8 +6657,8 @@ declare const MessageRoutingNamespace: _$_makaio_storage_core0.StorageNamespaceD
6622
6657
  agentId: z.ZodString;
6623
6658
  status: z.ZodEnum<{
6624
6659
  completed: "completed";
6625
- sent: "sent";
6626
6660
  acknowledged: "acknowledged";
6661
+ sent: "sent";
6627
6662
  }>;
6628
6663
  timestamp: z.ZodNumber;
6629
6664
  error: z.ZodOptional<z.ZodString>;
@@ -6710,7 +6745,7 @@ declare const MessageRoutingNamespace: _$_makaio_storage_core0.StorageNamespaceD
6710
6745
  tableName: "message_routing";
6711
6746
  dataType: "string";
6712
6747
  columnType: "SQLiteText";
6713
- data: "completed" | "sent" | "acknowledged";
6748
+ data: "completed" | "acknowledged" | "sent";
6714
6749
  driverParam: string;
6715
6750
  notNull: true;
6716
6751
  hasDefault: false;
@@ -6781,8 +6816,8 @@ declare const MessageRoutingSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core
6781
6816
  agentId: z.ZodString;
6782
6817
  status: z.ZodEnum<{
6783
6818
  completed: "completed";
6784
- sent: "sent";
6785
6819
  acknowledged: "acknowledged";
6820
+ sent: "sent";
6786
6821
  }>;
6787
6822
  timestamp: z.ZodNumber;
6788
6823
  error: z.ZodOptional<z.ZodString>;
@@ -6807,8 +6842,8 @@ declare const MessageRoutingSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core
6807
6842
  agentId: z.ZodString;
6808
6843
  status: z.ZodEnum<{
6809
6844
  completed: "completed";
6810
- sent: "sent";
6811
6845
  acknowledged: "acknowledged";
6846
+ sent: "sent";
6812
6847
  }>;
6813
6848
  timestamp: z.ZodNumber;
6814
6849
  error: z.ZodOptional<z.ZodString>;
@@ -6952,7 +6987,7 @@ declare const messageRouting: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<
6952
6987
  tableName: "message_routing";
6953
6988
  dataType: "string";
6954
6989
  columnType: "SQLiteText";
6955
- data: "completed" | "sent" | "acknowledged";
6990
+ data: "completed" | "acknowledged" | "sent";
6956
6991
  driverParam: string;
6957
6992
  notNull: true;
6958
6993
  hasDefault: false;