@semiont/sdk 0.5.4 → 0.5.6

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 (79) hide show
  1. package/dist/index.d.ts +1792 -52
  2. package/dist/index.js +140 -44
  3. package/dist/index.js.map +1 -1
  4. package/package.json +9 -6
  5. package/dist/awaitable.d.ts +0 -103
  6. package/dist/awaitable.d.ts.map +0 -1
  7. package/dist/bus-request.d.ts +0 -18
  8. package/dist/bus-request.d.ts.map +0 -1
  9. package/dist/cache.d.ts +0 -57
  10. package/dist/cache.d.ts.map +0 -1
  11. package/dist/client.d.ts +0 -138
  12. package/dist/client.d.ts.map +0 -1
  13. package/dist/index.d.ts.map +0 -1
  14. package/dist/namespaces/admin.d.ts +0 -27
  15. package/dist/namespaces/admin.d.ts.map +0 -1
  16. package/dist/namespaces/auth.d.ts +0 -26
  17. package/dist/namespaces/auth.d.ts.map +0 -1
  18. package/dist/namespaces/beckon.d.ts +0 -12
  19. package/dist/namespaces/beckon.d.ts.map +0 -1
  20. package/dist/namespaces/bind.d.ts +0 -11
  21. package/dist/namespaces/bind.d.ts.map +0 -1
  22. package/dist/namespaces/browse.d.ts +0 -111
  23. package/dist/namespaces/browse.d.ts.map +0 -1
  24. package/dist/namespaces/frame.d.ts +0 -29
  25. package/dist/namespaces/frame.d.ts.map +0 -1
  26. package/dist/namespaces/gather.d.ts +0 -16
  27. package/dist/namespaces/gather.d.ts.map +0 -1
  28. package/dist/namespaces/job.d.ts +0 -32
  29. package/dist/namespaces/job.d.ts.map +0 -1
  30. package/dist/namespaces/mark.d.ts +0 -27
  31. package/dist/namespaces/mark.d.ts.map +0 -1
  32. package/dist/namespaces/match.d.ts +0 -15
  33. package/dist/namespaces/match.d.ts.map +0 -1
  34. package/dist/namespaces/types.d.ts +0 -438
  35. package/dist/namespaces/types.d.ts.map +0 -1
  36. package/dist/namespaces/yield.d.ts +0 -23
  37. package/dist/namespaces/yield.d.ts.map +0 -1
  38. package/dist/session/errors.d.ts +0 -18
  39. package/dist/session/errors.d.ts.map +0 -1
  40. package/dist/session/http-session-factory.d.ts +0 -15
  41. package/dist/session/http-session-factory.d.ts.map +0 -1
  42. package/dist/session/knowledge-base.d.ts +0 -95
  43. package/dist/session/knowledge-base.d.ts.map +0 -1
  44. package/dist/session/open-resource.d.ts +0 -22
  45. package/dist/session/open-resource.d.ts.map +0 -1
  46. package/dist/session/registry.d.ts +0 -31
  47. package/dist/session/registry.d.ts.map +0 -1
  48. package/dist/session/semiont-browser.d.ts +0 -141
  49. package/dist/session/semiont-browser.d.ts.map +0 -1
  50. package/dist/session/semiont-session.d.ts +0 -210
  51. package/dist/session/semiont-session.d.ts.map +0 -1
  52. package/dist/session/session-factory.d.ts +0 -31
  53. package/dist/session/session-factory.d.ts.map +0 -1
  54. package/dist/session/session-signals.d.ts +0 -40
  55. package/dist/session/session-signals.d.ts.map +0 -1
  56. package/dist/session/session-storage.d.ts +0 -41
  57. package/dist/session/session-storage.d.ts.map +0 -1
  58. package/dist/session/storage.d.ts +0 -52
  59. package/dist/session/storage.d.ts.map +0 -1
  60. package/dist/session/testing.d.ts +0 -7
  61. package/dist/session/testing.d.ts.map +0 -1
  62. package/dist/state/flows/beckon-state-unit.d.ts +0 -22
  63. package/dist/state/flows/beckon-state-unit.d.ts.map +0 -1
  64. package/dist/state/flows/gather-state-unit.d.ts +0 -12
  65. package/dist/state/flows/gather-state-unit.d.ts.map +0 -1
  66. package/dist/state/flows/mark-state-unit.d.ts +0 -17
  67. package/dist/state/flows/mark-state-unit.d.ts.map +0 -1
  68. package/dist/state/flows/match-state-unit.d.ts +0 -7
  69. package/dist/state/flows/match-state-unit.d.ts.map +0 -1
  70. package/dist/state/flows/yield-state-unit.d.ts +0 -25
  71. package/dist/state/flows/yield-state-unit.d.ts.map +0 -1
  72. package/dist/state/index.d.ts +0 -10
  73. package/dist/state/index.d.ts.map +0 -1
  74. package/dist/state/lib/search-pipeline.d.ts +0 -38
  75. package/dist/state/lib/search-pipeline.d.ts.map +0 -1
  76. package/dist/state/lib/state-unit.d.ts +0 -33
  77. package/dist/state/lib/state-unit.d.ts.map +0 -1
  78. package/dist/state/lib/worker-bus.d.ts +0 -21
  79. package/dist/state/lib/worker-bus.d.ts.map +0 -1
@@ -1,52 +0,0 @@
1
- /**
2
- * Pure helpers and storage-adapter-driven loaders for the Semiont
3
- * session layer.
4
- *
5
- * Contains:
6
- * - Storage key shape (constants, `sessionKey(kbId)`)
7
- * - JWT expiry parsing and "is expired" check
8
- * - URL/protocol helpers for KB instances
9
- * - Loaders/savers that take a `SessionStorage` and operate over it
10
- * (no direct `localStorage` access)
11
- *
12
- * No React imports, no module-scoped state, no side effects beyond
13
- * whatever the passed-in `SessionStorage` does.
14
- */
15
- import type { HttpEndpoint, KnowledgeBase } from './knowledge-base';
16
- import type { SessionStorage } from './session-storage';
17
- export declare const STORAGE_KEY = "semiont.knowledgeBases";
18
- export declare const ACTIVE_KEY = "semiont.activeKnowledgeBaseId";
19
- /** Refresh the access token this many milliseconds before it expires. */
20
- export declare const REFRESH_BEFORE_EXP_MS: number;
21
- /** The shape persisted per KB. */
22
- export interface StoredSession {
23
- access: string;
24
- refresh: string;
25
- }
26
- export declare function sessionKey(kbId: string): string;
27
- export declare function getStoredSession(storage: SessionStorage, kbId: string): StoredSession | null;
28
- export declare function setStoredSession(storage: SessionStorage, kbId: string, session: StoredSession): void;
29
- export declare function clearStoredSession(storage: SessionStorage, kbId: string): void;
30
- export declare function parseJwtExpiry(token: string): Date | null;
31
- export declare function isJwtExpired(token: string): boolean;
32
- /**
33
- * Load the persisted KB list. Entries that don't conform to the current
34
- * `KnowledgeBase` shape are dropped silently — the storage format has no
35
- * back-compat layer (the project's stance on storage migrations: change
36
- * the shape directly, no legacy fallbacks). Stale entries vanish; the
37
- * user re-adds the affected KBs.
38
- */
39
- export declare function loadKnowledgeBases(storage: SessionStorage): KnowledgeBase[];
40
- export declare function saveKnowledgeBases(storage: SessionStorage, knowledgeBases: KnowledgeBase[]): void;
41
- export declare function defaultProtocol(host: string): 'http' | 'https';
42
- export declare function isValidHostname(host: string): boolean;
43
- /**
44
- * Build the wire URL for an HTTP KB endpoint. HTTP-shaped helper —
45
- * lives next to the KB list machinery because the frontend Panel needs
46
- * it for the auth round-trip when adding a KB. Code that holds a
47
- * uniform `KnowledgeBase` should not call this; it should hand the KB
48
- * to a transport factory and let the factory inspect `endpoint.kind`.
49
- */
50
- export declare function kbBackendUrl(endpoint: HttpEndpoint): string;
51
- export declare function generateKbId(): string;
52
- //# sourceMappingURL=storage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/session/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,eAAO,MAAM,WAAW,2BAA2B,CAAC;AACpD,eAAO,MAAM,UAAU,kCAAkC,CAAC;AAE1D,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,QAAgB,CAAC;AAEnD,kCAAkC;AAClC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAID,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAY5F;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAEpG;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9E;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAUzD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAInD;AAuBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,EAAE,CAS3E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,IAAI,CAEjG;AAID,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAE9D;AAKD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAW3D;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Test-only exports for the session module. Tests import `__resetForTests`
3
- * to clear the `SemiontBrowser` singleton between runs. Production code
4
- * must not import this file.
5
- */
6
- export { __resetForTests } from './registry';
7
- //# sourceMappingURL=testing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/session/testing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -1,22 +0,0 @@
1
- import { type Observable } from 'rxjs';
2
- import type { AnnotationId } from '@semiont/core';
3
- import type { SemiontClient } from '../../client';
4
- import type { StateUnit } from '../lib/state-unit';
5
- export interface BeckonStateUnit extends StateUnit {
6
- hoveredAnnotationId$: Observable<AnnotationId | null>;
7
- hover(annotationId: AnnotationId | null): void;
8
- focus(annotationId: AnnotationId): void;
9
- sparkle(annotationId: AnnotationId): void;
10
- }
11
- export declare function createBeckonStateUnit(client: SemiontClient): BeckonStateUnit;
12
- /** Default milliseconds the mouse must dwell before beckon:hover is emitted. */
13
- export declare const HOVER_DELAY_MS = 150;
14
- type EmitHover = (annotationId: AnnotationId | null) => void;
15
- export interface HoverHandlers {
16
- handleMouseEnter: (annotationId: AnnotationId) => void;
17
- handleMouseLeave: () => void;
18
- cleanup: () => void;
19
- }
20
- export declare function createHoverHandlers(emit: EmitHover, delayMs: number): HoverHandlers;
21
- export {};
22
- //# sourceMappingURL=beckon-state-unit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beckon-state-unit.d.ts","sourceRoot":"","sources":["../../../src/state/flows/beckon-state-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAqB,MAAM,MAAM,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,oBAAoB,EAAE,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACtD,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/C,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IACxC,OAAO,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;CAC3C;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAyB5E;AAED,gFAAgF;AAChF,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,KAAK,SAAS,GAAG,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,KAAK,IAAI,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,gBAAgB,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IACvD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CA8BnF"}
@@ -1,12 +0,0 @@
1
- import { type Observable } from 'rxjs';
2
- import type { GatheredContext, ResourceId, AnnotationId } from '@semiont/core';
3
- import type { SemiontClient } from '../../client';
4
- import type { StateUnit } from '../lib/state-unit';
5
- export interface GatherStateUnit extends StateUnit {
6
- context$: Observable<GatheredContext | null>;
7
- loading$: Observable<boolean>;
8
- error$: Observable<Error | null>;
9
- annotationId$: Observable<AnnotationId | null>;
10
- }
11
- export declare function createGatherStateUnit(client: SemiontClient, resourceId: ResourceId): GatherStateUnit;
12
- //# sourceMappingURL=gather-state-unit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gather-state-unit.d.ts","sourceRoot":"","sources":["../../../src/state/flows/gather-state-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAqB,MAAM,MAAM,CAAC;AAE3E,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,QAAQ,EAAE,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAC7C,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACjC,aAAa,EAAE,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;CAChD;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,UAAU,GACrB,eAAe,CAoDjB"}
@@ -1,17 +0,0 @@
1
- import { type Observable } from 'rxjs';
2
- import type { ResourceId, Motivation, Selector, components } from '@semiont/core';
3
- import type { SemiontClient } from '../../client';
4
- import type { StateUnit } from '../lib/state-unit';
5
- type JobProgress = components['schemas']['JobProgress'];
6
- export interface PendingAnnotation {
7
- selector: Selector | Selector[];
8
- motivation: Motivation;
9
- }
10
- export interface MarkStateUnit extends StateUnit {
11
- pendingAnnotation$: Observable<PendingAnnotation | null>;
12
- assistingMotivation$: Observable<Motivation | null>;
13
- progress$: Observable<JobProgress | null>;
14
- }
15
- export declare function createMarkStateUnit(client: SemiontClient, resourceId: ResourceId): MarkStateUnit;
16
- export {};
17
- //# sourceMappingURL=mark-state-unit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mark-state-unit.d.ts","sourceRoot":"","sources":["../../../src/state/flows/mark-state-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAqB,MAAM,MAAM,CAAC;AAE3E,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAY,UAAU,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,KAAK,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAChC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,kBAAkB,EAAE,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACzD,oBAAoB,EAAE,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACpD,SAAS,EAAE,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC3C;AAcD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,UAAU,GACrB,aAAa,CA6Gf"}
@@ -1,7 +0,0 @@
1
- import type { ResourceId } from '@semiont/core';
2
- import type { SemiontClient } from '../../client';
3
- import type { StateUnit } from '../lib/state-unit';
4
- export interface MatchStateUnit extends StateUnit {
5
- }
6
- export declare function createMatchStateUnit(client: SemiontClient, _resourceId: ResourceId): MatchStateUnit;
7
- //# sourceMappingURL=match-state-unit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"match-state-unit.d.ts","sourceRoot":"","sources":["../../../src/state/flows/match-state-unit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,cAAe,SAAQ,SAAS;CAAG;AAEpD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,UAAU,GACtB,cAAc,CA2BhB"}
@@ -1,25 +0,0 @@
1
- import { type Observable } from 'rxjs';
2
- import type { ResourceId, GatheredContext, components } from '@semiont/core';
3
- import type { SemiontClient } from '../../client';
4
- import type { StateUnit } from '../lib/state-unit';
5
- type JobProgress = components['schemas']['JobProgress'];
6
- export interface GenerateDocumentOptions {
7
- title: string;
8
- storageUri: string;
9
- prompt?: string;
10
- /** Body locale — language the generated resource is written in. Falls back to the state unit's UI locale when unset. */
11
- language?: string;
12
- /** Source-resource locale — language of the resource the annotation lives on. Forwarded to the prompt for context-snippet awareness. BCP-47. */
13
- sourceLanguage?: string;
14
- temperature?: number;
15
- maxTokens?: number;
16
- context: GatheredContext;
17
- }
18
- export interface YieldStateUnit extends StateUnit {
19
- isGenerating$: Observable<boolean>;
20
- progress$: Observable<JobProgress | null>;
21
- generate(referenceId: string, options: GenerateDocumentOptions): void;
22
- }
23
- export declare function createYieldStateUnit(client: SemiontClient, resourceId: ResourceId, locale: string): YieldStateUnit;
24
- export {};
25
- //# sourceMappingURL=yield-state-unit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"yield-state-unit.d.ts","sourceRoot":"","sources":["../../../src/state/flows/yield-state-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAqB,MAAM,MAAM,CAAC;AAE3E,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,KAAK,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;AAExD,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wHAAwH;IACxH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gJAAgJ;IAChJ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,aAAa,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IACnC,SAAS,EAAE,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACvE;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,cAAc,CAmDhB"}
@@ -1,10 +0,0 @@
1
- export { type StateUnit, createDisposer } from './lib/state-unit';
2
- export { createSearchPipeline, type SearchPipeline, type SearchPipelineOptions, type SearchState, } from './lib/search-pipeline';
3
- export type { WorkerBus } from './lib/worker-bus';
4
- export { createBeckonStateUnit, type BeckonStateUnit, createHoverHandlers, type HoverHandlers, HOVER_DELAY_MS, } from './flows/beckon-state-unit';
5
- export { createGatherStateUnit, type GatherStateUnit, } from './flows/gather-state-unit';
6
- export { createMatchStateUnit, type MatchStateUnit, } from './flows/match-state-unit';
7
- export { createYieldStateUnit, type YieldStateUnit, type GenerateDocumentOptions, } from './flows/yield-state-unit';
8
- export { createMarkStateUnit, type MarkStateUnit, type PendingAnnotation, } from './flows/mark-state-unit';
9
- export type { ConnectionState } from '@semiont/core';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,aAAa,EAClB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -1,38 +0,0 @@
1
- /**
2
- * createSearchPipeline
3
- *
4
- * A debounced-search RxJS pipeline factory. Combines an input Subject with a
5
- * downstream fetch function and emits typed `{ results, isSearching }` state.
6
- *
7
- * Designed to be created once per consumer instance and held for its lifetime
8
- * (e.g. by a view layer's lazy initializer), then observed via `state$`. The
9
- * pipeline is pure RxJS — unit-testable without any view-layer dependency.
10
- *
11
- * The fetch function is expected to return `Observable<T[] | undefined>`,
12
- * matching the cache-miss-then-data shape of `BrowseNamespace` Observables:
13
- * `undefined` means "fetch in flight, no value yet"; an array means "data
14
- * available (possibly empty)".
15
- */
16
- import { type Observable } from 'rxjs';
17
- export interface SearchState<T> {
18
- results: T[];
19
- isSearching: boolean;
20
- }
21
- export interface SearchPipeline<T> {
22
- /** Latest query string. Bind to a controlled input. */
23
- query$: Observable<string>;
24
- /** Latest search state — results plus a loading flag. */
25
- state$: Observable<SearchState<T>>;
26
- /** Push a new query value. Triggers the debounced fetch. */
27
- setQuery(value: string): void;
28
- /** Tear down the input Subject. Call from the consumer's cleanup hook. */
29
- dispose(): void;
30
- }
31
- export interface SearchPipelineOptions {
32
- /** Milliseconds to wait after the last keystroke before fetching. Default 250. */
33
- debounceMs?: number;
34
- /** Initial query value. Useful for modals that open with a pre-filled term. */
35
- initialQuery?: string;
36
- }
37
- export declare function createSearchPipeline<T>(fetch: (query: string) => Observable<T[] | undefined>, options?: SearchPipelineOptions): SearchPipeline<T>;
38
- //# sourceMappingURL=search-pipeline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-pipeline.d.ts","sourceRoot":"","sources":["../../../src/state/lib/search-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAGpD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,uDAAuD;IACvD,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC3B,yDAAyD;IACzD,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0EAA0E;IAC1E,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,UAAU,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,EACrD,OAAO,GAAE,qBAA0B,GAClC,cAAc,CAAC,CAAC,CAAC,CAgCnB"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Marker for the state-unit pattern: a stateful, lifecycled object with an
3
- * RxJS-shaped public surface, constructed by a factory function
4
- * (`createFooStateUnit`), with internal state held in a closure.
5
- *
6
- * The structural contract is `dispose()` — the rest of the pattern
7
- * (closure-based identity, Observable public surface, internal Subjects
8
- * exposed as `.asObservable()` views, no leaked subscriptions, composition
9
- * by parameter rather than ownership) is convention enforced by review,
10
- * not the type system.
11
- *
12
- * See `packages/sdk/docs/STATE-UNITS.md` for the full axioms and rationale.
13
- */
14
- export interface StateUnit {
15
- /**
16
- * Idempotent, total teardown. Completes every Subject the unit owns,
17
- * unsubscribes every internal subscription, releases timers / abort
18
- * controllers / network handles. Safe to call multiple times — the
19
- * second call is a no-op.
20
- */
21
- dispose(): void;
22
- }
23
- /**
24
- * Compose multiple disposers into a single `dispose()` call. Accepts either
25
- * a `StateUnit` (whose `dispose()` will be invoked) or a plain teardown
26
- * function. The returned object is itself disposable; call its `dispose()`
27
- * once to tear down everything that was added.
28
- */
29
- export declare function createDisposer(): {
30
- add(item: StateUnit | (() => void)): void;
31
- dispose(): void;
32
- };
33
- //# sourceMappingURL=state-unit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state-unit.d.ts","sourceRoot":"","sources":["../../../src/state/lib/state-unit.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;OAKG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI;IAChC,GAAG,CAAC,IAAI,EAAE,SAAS,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1C,OAAO,IAAI,IAAI,CAAC;CACjB,CAOA"}
@@ -1,21 +0,0 @@
1
- /**
2
- * WorkerBus — minimal channel-bus surface that worker-side adapters
3
- * (e.g. `JobClaimAdapter` in `@semiont/jobs`, `SmelterActorStateUnit` in
4
- * `@semiont/make-meaning`) need.
5
- *
6
- * Transport-neutral by design. HTTP `ActorStateUnit` (from `@semiont/api-client`)
7
- * satisfies it directly; an in-process worker can pass a small shim around
8
- * an `EventBus` with a `() => Promise<void>` `emit` that calls into the
9
- * actor system.
10
- *
11
- * `addChannels` is optional because in-process buses receive every emit
12
- * implicitly — only HTTP needs to widen its SSE subscription set to
13
- * include worker-only channels (`job:queued`, `yield:created`, etc.).
14
- */
15
- import type { Observable } from 'rxjs';
16
- export interface WorkerBus {
17
- on$<T = Record<string, unknown>>(channel: string): Observable<T>;
18
- emit(channel: string, payload: Record<string, unknown>): Promise<void>;
19
- addChannels?(channels: readonly string[]): void;
20
- }
21
- //# sourceMappingURL=worker-bus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker-bus.d.ts","sourceRoot":"","sources":["../../../src/state/lib/worker-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IACjE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,WAAW,CAAC,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACjD"}