@ai-matrx/agents 0.18.5 → 0.19.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/content-transfer/index.cjs.map +1 -1
  3. package/dist/content-transfer/index.js.map +1 -1
  4. package/dist/content-transfer/react/index.cjs.map +1 -1
  5. package/dist/content-transfer/react/index.js.map +1 -1
  6. package/dist/index.cjs +2 -2
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/mandates/index.cjs +2 -2
  11. package/dist/mandates/index.cjs.map +1 -1
  12. package/dist/mandates/index.d.cts +4 -4
  13. package/dist/mandates/index.d.ts +4 -4
  14. package/dist/mandates/index.js +2 -2
  15. package/dist/mandates/index.js.map +1 -1
  16. package/dist/matrx/index.cjs +2 -2
  17. package/dist/matrx/index.cjs.map +1 -1
  18. package/dist/matrx/index.js +2 -2
  19. package/dist/matrx/index.js.map +1 -1
  20. package/dist/react/index.cjs +1 -0
  21. package/dist/react/index.cjs.map +1 -1
  22. package/dist/react/index.js +1 -0
  23. package/dist/react/index.js.map +1 -1
  24. package/dist/sources/react/index.cjs +14 -4
  25. package/dist/sources/react/index.cjs.map +1 -1
  26. package/dist/sources/react/index.d.cts +11 -3
  27. package/dist/sources/react/index.d.ts +11 -3
  28. package/dist/sources/react/index.js +14 -4
  29. package/dist/sources/react/index.js.map +1 -1
  30. package/dist/sources/runtime/index.cjs +15 -4
  31. package/dist/sources/runtime/index.cjs.map +1 -1
  32. package/dist/sources/runtime/index.d.cts +22 -5
  33. package/dist/sources/runtime/index.d.ts +22 -5
  34. package/dist/sources/runtime/index.js +15 -4
  35. package/dist/sources/runtime/index.js.map +1 -1
  36. package/mandates/snapshots/keys.0.19.1.json +652 -0
  37. package/mandates/snapshots/keys.0.19.2.json +652 -0
  38. package/package.json +2 -2
@@ -447,8 +447,14 @@ interface SourceSetController extends SourceSetActions {
447
447
  toSourceSet(options?: {
448
448
  targetModelId?: string | undefined;
449
449
  }): SourceSet;
450
- /** Apply a set the review returned (forms, parts, caps, delivery). */
451
- applySourceSet(set: SourceSet): void;
450
+ /**
451
+ * Apply a set the review returned (forms, parts, caps, delivery). Pass
452
+ * `reviewed` — the set sent INTO the review — and every Source removed there
453
+ * leaves the list too (only those; one that landed meanwhile stays).
454
+ */
455
+ applySourceSet(set: SourceSet, options?: {
456
+ reviewed?: SourceSet | undefined;
457
+ }): void;
452
458
  /** POST /sources/resolve — the grounded text for a generator, named as the cards name them. */
453
459
  resolve(options?: {
454
460
  targetModelId?: string | undefined;
@@ -723,7 +729,9 @@ interface UseSourceSetResult extends SourceSetActions {
723
729
  targetModelId?: string | undefined;
724
730
  }) => SourceSet;
725
731
  /** Apply a set the review page returned (forms, parts, caps, delivery). */
726
- applySourceSet: (set: SourceSet) => void;
732
+ applySourceSet: (set: SourceSet, options?: {
733
+ reviewed?: SourceSet | undefined;
734
+ }) => void;
727
735
  /** POST /sources/resolve — the grounded text for a generator. */
728
736
  resolve: (options?: {
729
737
  targetModelId?: string | undefined;
@@ -447,8 +447,14 @@ interface SourceSetController extends SourceSetActions {
447
447
  toSourceSet(options?: {
448
448
  targetModelId?: string | undefined;
449
449
  }): SourceSet;
450
- /** Apply a set the review returned (forms, parts, caps, delivery). */
451
- applySourceSet(set: SourceSet): void;
450
+ /**
451
+ * Apply a set the review returned (forms, parts, caps, delivery). Pass
452
+ * `reviewed` — the set sent INTO the review — and every Source removed there
453
+ * leaves the list too (only those; one that landed meanwhile stays).
454
+ */
455
+ applySourceSet(set: SourceSet, options?: {
456
+ reviewed?: SourceSet | undefined;
457
+ }): void;
452
458
  /** POST /sources/resolve — the grounded text for a generator, named as the cards name them. */
453
459
  resolve(options?: {
454
460
  targetModelId?: string | undefined;
@@ -723,7 +729,9 @@ interface UseSourceSetResult extends SourceSetActions {
723
729
  targetModelId?: string | undefined;
724
730
  }) => SourceSet;
725
731
  /** Apply a set the review page returned (forms, parts, caps, delivery). */
726
- applySourceSet: (set: SourceSet) => void;
732
+ applySourceSet: (set: SourceSet, options?: {
733
+ reviewed?: SourceSet | undefined;
734
+ }) => void;
727
735
  /** POST /sources/resolve — the grounded text for a generator. */
728
736
  resolve: (options?: {
729
737
  targetModelId?: string | undefined;
@@ -356,9 +356,19 @@ function setCardWaitForClean(state, id, wait) {
356
356
  function setSourceTopic(state, topic) {
357
357
  return state.topic === topic ? state : { ...state, topic };
358
358
  }
359
- function applyReviewedSourceSet(state, set) {
359
+ function removedInReview(reviewed, answer) {
360
+ const kept = new Set(answer.sources.map(sourceKey));
361
+ return new Set(reviewed.sources.map(sourceKey).filter((k) => !kept.has(k)));
362
+ }
363
+ function applyReviewedSourceSet(state, set, reviewed) {
360
364
  let next = state;
361
- for (const card of state.cards) {
365
+ if (reviewed) {
366
+ const removed = removedInReview(reviewed, set);
367
+ for (const card of state.cards) {
368
+ if (card.draft.ref && removed.has(sourceKey(card.draft.ref))) next = removeCard(next, card.id);
369
+ }
370
+ }
371
+ for (const card of next.cards) {
362
372
  const ref = card.draft.ref;
363
373
  if (!ref) continue;
364
374
  const match = set.sources.find((r) => sameSourceRef(r, ref));
@@ -574,8 +584,8 @@ function createSourceSetController(adapter) {
574
584
  hasRef: (resourceType, resourceId) => hasSourceRef(store.getState(), resourceType, resourceId),
575
585
  liveCount: () => store.getState().cards.length,
576
586
  toSourceSet: (options = {}) => selectSourceSet(store.getState(), options),
577
- applySourceSet(set) {
578
- commit(applyReviewedSourceSet(store.getState(), set));
587
+ applySourceSet(set, options = {}) {
588
+ commit(applyReviewedSourceSet(store.getState(), set, options.reviewed));
579
589
  },
580
590
  async manifest() {
581
591
  const refs = readySourceRefs(store.getState());