@ai-matrx/associations 0.5.2 → 0.6.0

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.cts CHANGED
@@ -11104,9 +11104,13 @@ interface AssociationsIdentity {
11104
11104
  ensureOrgId?(): Promise<string>;
11105
11105
  }
11106
11106
  /**
11107
- * The scream seam REQUIRED: recovery layers must scream somewhere. Every
11108
- * degraded path, every `demanded_schema_violation`, every create-then-attach
11109
- * partial failure reports here regardless of notifier availability.
11107
+ * The scream seam. Every degraded path, every `demanded_schema_violation`,
11108
+ * every create-then-attach partial failure reports here regardless of
11109
+ * notifier availability.
11110
+ *
11111
+ * DEFAULT (0.6.0, C23): absent → `createDefaultErrorSink()` — a tagged
11112
+ * `console.error` per event that announces ONCE that no sink is bound and
11113
+ * names the remedy. A host with a diagnostics surface binds its own.
11110
11114
  */
11111
11115
  type ErrorSink = (event: {
11112
11116
  code: string;
@@ -11171,9 +11175,13 @@ interface AssociationsNotifier {
11171
11175
  }): void;
11172
11176
  }
11173
11177
  /**
11174
- * The draggable-window seam (today: `WindowPanel` in AssociationWindow).
11175
- * Absent → the package's internal fixed overlay (non-draggable); behavior
11176
- * identical, chrome plainer.
11178
+ * The window seam.
11179
+ *
11180
+ * DEFAULT (0.6.0, C23): absent → `DefaultWindowShell`, the package's OWN
11181
+ * window — draggable, resizable, maximizable, viewport-clamped, portalled,
11182
+ * non-modal, mobile bottom-card. Not a degradation; the shipped default.
11183
+ * A host binds this port only when its own window MANAGER (tray docking,
11184
+ * workspace persistence, cross-window z-order) must own the surface.
11177
11185
  */
11178
11186
  interface WindowShellPort {
11179
11187
  Window: ComponentType<{
@@ -11210,12 +11218,35 @@ interface CapturePickOpts {
11210
11218
  description?: string;
11211
11219
  }
11212
11220
  /**
11213
- * The capture-toolbar seam (today: features/files upload + pickers and
11214
- * features/data-tables imports in AssociationCaptureToolbar). PER-HANDLER
11215
- * optional: the toolbar renders only the chips whose handler exists; zero
11216
- * handlers → the toolbar renders nothing. NEVER dead buttons.
11221
+ * The capture-toolbar seam. PER-HANDLER optional: the toolbar renders only
11222
+ * the chips it can actually honour; a chip with no path behind it is never
11223
+ * rendered dead. NEVER dead buttons.
11224
+ *
11225
+ * THE UPLOAD DEFAULT (0.6.0, C23): a host does NOT have to build an upload
11226
+ * flow. Bind the one-file primitive `uploadFile` and the package ships the
11227
+ * WHOLE flow over it — the file input, whole-body drag-and-drop, sequential
11228
+ * uploads, the stall watchdog, per-file outcomes, and the loud
11229
+ * created-but-unattached report. `requestUpload` stays for a host that owns
11230
+ * a richer pipeline (duplicate-alias dialogs, progress UI); when both are
11231
+ * bound `requestUpload` wins.
11217
11232
  */
11218
11233
  interface CapturePort {
11234
+ /**
11235
+ * The MINIMAL upload primitive: persist ONE file, answer with its id (or
11236
+ * an honest error). Everything else — batching, drag-and-drop, progress
11237
+ * state, failure copy — is the package's job.
11238
+ */
11239
+ uploadFile?(file: File, opts: {
11240
+ folderPath: string;
11241
+ visibility?: string;
11242
+ }): Promise<{
11243
+ ok: true;
11244
+ id: string;
11245
+ } | {
11246
+ ok: false;
11247
+ error: string;
11248
+ }>;
11249
+ /** The full host upload pipeline. Wins over `uploadFile` when bound. */
11219
11250
  requestUpload?(opts: CaptureUploadOpts): Promise<CaptureUploadResult>;
11220
11251
  /** Resolves with picked file ids, or null/empty on cancel. */
11221
11252
  openFilePicker?(opts: CapturePickOpts): Promise<string[] | null>;
@@ -11314,14 +11345,16 @@ interface EntityDoorsPort {
11314
11345
  }>;
11315
11346
  }
11316
11347
  /**
11317
- * Everything a host binds, once. `createAssociationsStore(cfg)` (/core, W2)
11318
- * throws when a REQUIRED port is missing; every optional port degrades per
11319
- * its own documented contract, never silently.
11348
+ * Everything a host binds, once. `createAssociationsStore(cfg)` (/core)
11349
+ * throws when `dataSource` or `identity` is missing those two ARE the
11350
+ * host's app identity and cannot be defaulted. Every other port ships a
11351
+ * working default (C23) or degrades per its own documented contract, never
11352
+ * silently.
11320
11353
  */
11321
11354
  interface AssociationsConfig {
11322
11355
  dataSource: AssociationsDataSource;
11323
11356
  identity: AssociationsIdentity;
11324
- errorSink: ErrorSink;
11357
+ errorSink?: ErrorSink;
11325
11358
  entityOverlay?: EntityOverlayMap;
11326
11359
  notifier?: AssociationsNotifier;
11327
11360
  windowShell?: WindowShellPort;
package/dist/index.d.ts CHANGED
@@ -11104,9 +11104,13 @@ interface AssociationsIdentity {
11104
11104
  ensureOrgId?(): Promise<string>;
11105
11105
  }
11106
11106
  /**
11107
- * The scream seam REQUIRED: recovery layers must scream somewhere. Every
11108
- * degraded path, every `demanded_schema_violation`, every create-then-attach
11109
- * partial failure reports here regardless of notifier availability.
11107
+ * The scream seam. Every degraded path, every `demanded_schema_violation`,
11108
+ * every create-then-attach partial failure reports here regardless of
11109
+ * notifier availability.
11110
+ *
11111
+ * DEFAULT (0.6.0, C23): absent → `createDefaultErrorSink()` — a tagged
11112
+ * `console.error` per event that announces ONCE that no sink is bound and
11113
+ * names the remedy. A host with a diagnostics surface binds its own.
11110
11114
  */
11111
11115
  type ErrorSink = (event: {
11112
11116
  code: string;
@@ -11171,9 +11175,13 @@ interface AssociationsNotifier {
11171
11175
  }): void;
11172
11176
  }
11173
11177
  /**
11174
- * The draggable-window seam (today: `WindowPanel` in AssociationWindow).
11175
- * Absent → the package's internal fixed overlay (non-draggable); behavior
11176
- * identical, chrome plainer.
11178
+ * The window seam.
11179
+ *
11180
+ * DEFAULT (0.6.0, C23): absent → `DefaultWindowShell`, the package's OWN
11181
+ * window — draggable, resizable, maximizable, viewport-clamped, portalled,
11182
+ * non-modal, mobile bottom-card. Not a degradation; the shipped default.
11183
+ * A host binds this port only when its own window MANAGER (tray docking,
11184
+ * workspace persistence, cross-window z-order) must own the surface.
11177
11185
  */
11178
11186
  interface WindowShellPort {
11179
11187
  Window: ComponentType<{
@@ -11210,12 +11218,35 @@ interface CapturePickOpts {
11210
11218
  description?: string;
11211
11219
  }
11212
11220
  /**
11213
- * The capture-toolbar seam (today: features/files upload + pickers and
11214
- * features/data-tables imports in AssociationCaptureToolbar). PER-HANDLER
11215
- * optional: the toolbar renders only the chips whose handler exists; zero
11216
- * handlers → the toolbar renders nothing. NEVER dead buttons.
11221
+ * The capture-toolbar seam. PER-HANDLER optional: the toolbar renders only
11222
+ * the chips it can actually honour; a chip with no path behind it is never
11223
+ * rendered dead. NEVER dead buttons.
11224
+ *
11225
+ * THE UPLOAD DEFAULT (0.6.0, C23): a host does NOT have to build an upload
11226
+ * flow. Bind the one-file primitive `uploadFile` and the package ships the
11227
+ * WHOLE flow over it — the file input, whole-body drag-and-drop, sequential
11228
+ * uploads, the stall watchdog, per-file outcomes, and the loud
11229
+ * created-but-unattached report. `requestUpload` stays for a host that owns
11230
+ * a richer pipeline (duplicate-alias dialogs, progress UI); when both are
11231
+ * bound `requestUpload` wins.
11217
11232
  */
11218
11233
  interface CapturePort {
11234
+ /**
11235
+ * The MINIMAL upload primitive: persist ONE file, answer with its id (or
11236
+ * an honest error). Everything else — batching, drag-and-drop, progress
11237
+ * state, failure copy — is the package's job.
11238
+ */
11239
+ uploadFile?(file: File, opts: {
11240
+ folderPath: string;
11241
+ visibility?: string;
11242
+ }): Promise<{
11243
+ ok: true;
11244
+ id: string;
11245
+ } | {
11246
+ ok: false;
11247
+ error: string;
11248
+ }>;
11249
+ /** The full host upload pipeline. Wins over `uploadFile` when bound. */
11219
11250
  requestUpload?(opts: CaptureUploadOpts): Promise<CaptureUploadResult>;
11220
11251
  /** Resolves with picked file ids, or null/empty on cancel. */
11221
11252
  openFilePicker?(opts: CapturePickOpts): Promise<string[] | null>;
@@ -11314,14 +11345,16 @@ interface EntityDoorsPort {
11314
11345
  }>;
11315
11346
  }
11316
11347
  /**
11317
- * Everything a host binds, once. `createAssociationsStore(cfg)` (/core, W2)
11318
- * throws when a REQUIRED port is missing; every optional port degrades per
11319
- * its own documented contract, never silently.
11348
+ * Everything a host binds, once. `createAssociationsStore(cfg)` (/core)
11349
+ * throws when `dataSource` or `identity` is missing those two ARE the
11350
+ * host's app identity and cannot be defaulted. Every other port ships a
11351
+ * working default (C23) or degrades per its own documented contract, never
11352
+ * silently.
11320
11353
  */
11321
11354
  interface AssociationsConfig {
11322
11355
  dataSource: AssociationsDataSource;
11323
11356
  identity: AssociationsIdentity;
11324
- errorSink: ErrorSink;
11357
+ errorSink?: ErrorSink;
11325
11358
  entityOverlay?: EntityOverlayMap;
11326
11359
  notifier?: AssociationsNotifier;
11327
11360
  windowShell?: WindowShellPort;