annotation-kit 0.0.0-stage → 0.1.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.
Files changed (121) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +75 -0
  3. package/README.md +114 -2
  4. package/README.zh-CN.md +112 -0
  5. package/dist/annotation-kit.css +157 -0
  6. package/dist/chunks/references-ukB-tSle.js +1126 -0
  7. package/dist/chunks/references-ukB-tSle.js.map +1 -0
  8. package/dist/electron/element-context.cjs +72 -0
  9. package/dist/electron/guest-preload.cjs +327 -0
  10. package/dist/electron.js +394 -0
  11. package/dist/electron.js.map +1 -0
  12. package/dist/index.js +910 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/react.js +2256 -0
  15. package/dist/react.js.map +1 -0
  16. package/dist/styles.d.ts +2 -0
  17. package/dist/types/address.d.ts +53 -0
  18. package/dist/types/address.d.ts.map +1 -0
  19. package/dist/types/client/Workbench.d.ts +11 -0
  20. package/dist/types/client/Workbench.d.ts.map +1 -0
  21. package/dist/types/client/composer/PacketPreview.d.ts +12 -0
  22. package/dist/types/client/composer/PacketPreview.d.ts.map +1 -0
  23. package/dist/types/client/composer/ReferenceCard.d.ts +12 -0
  24. package/dist/types/client/composer/ReferenceCard.d.ts.map +1 -0
  25. package/dist/types/client/composer/attachments.d.ts +10 -0
  26. package/dist/types/client/composer/attachments.d.ts.map +1 -0
  27. package/dist/types/client/composer/commit.d.ts +4 -0
  28. package/dist/types/client/composer/commit.d.ts.map +1 -0
  29. package/dist/types/client/composer/packets.d.ts +53 -0
  30. package/dist/types/client/composer/packets.d.ts.map +1 -0
  31. package/dist/types/client/composer/reference-presentation.d.ts +4 -0
  32. package/dist/types/client/composer/reference-presentation.d.ts.map +1 -0
  33. package/dist/types/client/error-copy.d.ts +69 -0
  34. package/dist/types/client/error-copy.d.ts.map +1 -0
  35. package/dist/types/client/errors.d.ts +10 -0
  36. package/dist/types/client/errors.d.ts.map +1 -0
  37. package/dist/types/client/files/FileSelectionAction.d.ts +7 -0
  38. package/dist/types/client/files/FileSelectionAction.d.ts.map +1 -0
  39. package/dist/types/client/files/SelectionCard.d.ts +14 -0
  40. package/dist/types/client/files/SelectionCard.d.ts.map +1 -0
  41. package/dist/types/client/files/document-workflow.d.ts +34 -0
  42. package/dist/types/client/files/document-workflow.d.ts.map +1 -0
  43. package/dist/types/client/files/pages/DocumentChrome.d.ts +30 -0
  44. package/dist/types/client/files/pages/DocumentChrome.d.ts.map +1 -0
  45. package/dist/types/client/files/pages/PageSelectionAction.d.ts +7 -0
  46. package/dist/types/client/files/pages/PageSelectionAction.d.ts.map +1 -0
  47. package/dist/types/client/files/pages/batches.d.ts +21 -0
  48. package/dist/types/client/files/pages/batches.d.ts.map +1 -0
  49. package/dist/types/client/files/pages/geometry.d.ts +16 -0
  50. package/dist/types/client/files/pages/geometry.d.ts.map +1 -0
  51. package/dist/types/client/files/pages/image-store.d.ts +8 -0
  52. package/dist/types/client/files/pages/image-store.d.ts.map +1 -0
  53. package/dist/types/client/files/pages/images.d.ts +41 -0
  54. package/dist/types/client/files/pages/images.d.ts.map +1 -0
  55. package/dist/types/client/files/pages/interaction.d.ts +55 -0
  56. package/dist/types/client/files/pages/interaction.d.ts.map +1 -0
  57. package/dist/types/client/files/pages/selection.d.ts +25 -0
  58. package/dist/types/client/files/pages/selection.d.ts.map +1 -0
  59. package/dist/types/client/files/pages/snapshot.d.ts +31 -0
  60. package/dist/types/client/files/pages/snapshot.d.ts.map +1 -0
  61. package/dist/types/client/files/references.d.ts +80 -0
  62. package/dist/types/client/files/references.d.ts.map +1 -0
  63. package/dist/types/client/files/selection.d.ts +11 -0
  64. package/dist/types/client/files/selection.d.ts.map +1 -0
  65. package/dist/types/client/files/sheets/SheetRecovery.d.ts +12 -0
  66. package/dist/types/client/files/sheets/SheetRecovery.d.ts.map +1 -0
  67. package/dist/types/client/files/sheets/SheetSurface.d.ts +27 -0
  68. package/dist/types/client/files/sheets/SheetSurface.d.ts.map +1 -0
  69. package/dist/types/client/files/sheets/geometry.d.ts +30 -0
  70. package/dist/types/client/files/sheets/geometry.d.ts.map +1 -0
  71. package/dist/types/client/files/sheets/navigation.d.ts +4 -0
  72. package/dist/types/client/files/sheets/navigation.d.ts.map +1 -0
  73. package/dist/types/client/files/sheets/snapshot.d.ts +45 -0
  74. package/dist/types/client/files/sheets/snapshot.d.ts.map +1 -0
  75. package/dist/types/client/locales.d.ts +148 -0
  76. package/dist/types/client/locales.d.ts.map +1 -0
  77. package/dist/types/client/messages/SentAnnotations.d.ts +18 -0
  78. package/dist/types/client/messages/SentAnnotations.d.ts.map +1 -0
  79. package/dist/types/client/messages/presentation.d.ts +39 -0
  80. package/dist/types/client/messages/presentation.d.ts.map +1 -0
  81. package/dist/types/client/model.d.ts +68 -0
  82. package/dist/types/client/model.d.ts.map +1 -0
  83. package/dist/types/client/quoted-context.d.ts +3 -0
  84. package/dist/types/client/quoted-context.d.ts.map +1 -0
  85. package/dist/types/client/responses/ResponseCard.d.ts +12 -0
  86. package/dist/types/client/responses/ResponseCard.d.ts.map +1 -0
  87. package/dist/types/client/responses/ResponseOverlay.d.ts +7 -0
  88. package/dist/types/client/responses/ResponseOverlay.d.ts.map +1 -0
  89. package/dist/types/client/responses/composer.d.ts +11 -0
  90. package/dist/types/client/responses/composer.d.ts.map +1 -0
  91. package/dist/types/client/responses/controller.d.ts +39 -0
  92. package/dist/types/client/responses/controller.d.ts.map +1 -0
  93. package/dist/types/client/responses/references.d.ts +62 -0
  94. package/dist/types/client/responses/references.d.ts.map +1 -0
  95. package/dist/types/client/responses/selection.d.ts +43 -0
  96. package/dist/types/client/responses/selection.d.ts.map +1 -0
  97. package/dist/types/electron/bridge.d.mts +45 -0
  98. package/dist/types/electron/bridge.d.mts.map +1 -0
  99. package/dist/types/electron/build-preload.d.mts +4 -0
  100. package/dist/types/electron/build-preload.d.mts.map +1 -0
  101. package/dist/types/electron/element-context.d.cts +7 -0
  102. package/dist/types/electron/element-context.d.cts.map +1 -0
  103. package/dist/types/electron/guest-preload.d.cts +2 -0
  104. package/dist/types/electron/guest-preload.d.cts.map +1 -0
  105. package/dist/types/electron/index.d.ts +5 -0
  106. package/dist/types/electron/index.d.ts.map +1 -0
  107. package/dist/types/host-contracts.d.ts +104 -0
  108. package/dist/types/host-contracts.d.ts.map +1 -0
  109. package/dist/types/index.d.ts +32 -0
  110. package/dist/types/index.d.ts.map +1 -0
  111. package/dist/types/react.d.ts +14 -0
  112. package/dist/types/react.d.ts.map +1 -0
  113. package/dist/types/shared/desktop.d.ts +75 -0
  114. package/dist/types/shared/desktop.d.ts.map +1 -0
  115. package/dist/types/shared/surface.d.ts +11 -0
  116. package/dist/types/shared/surface.d.ts.map +1 -0
  117. package/dist/types/ui/icons.d.ts +11 -0
  118. package/dist/types/ui/icons.d.ts.map +1 -0
  119. package/dist/types/ui/regions.d.ts +28 -0
  120. package/dist/types/ui/regions.d.ts.map +1 -0
  121. package/package.json +82 -3
@@ -0,0 +1,11 @@
1
+ export type FileKind = 'code' | 'text' | 'markdown';
2
+ export interface FileSelection {
3
+ readonly text: string;
4
+ readonly startLine: number;
5
+ readonly endLine: number;
6
+ readonly startColumn?: number;
7
+ readonly endColumn?: number;
8
+ }
9
+ /** A selection is accepted only when both ends belong to the same preview body. */
10
+ export declare function readFileSelection(range: Range, root: HTMLElement, kind: FileKind): FileSelection | undefined;
11
+ //# sourceMappingURL=selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../src/client/files/selection.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;AAEnD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,GAAG,aAAa,GAAG,SAAS,CA0C5G"}
@@ -0,0 +1,12 @@
1
+ import type { PropsLocale } from '../../../host-contracts.ts';
2
+ import { type DocumentAnnotationBridge } from '../document-workflow.ts';
3
+ import { PageBatches } from '../pages/batches.ts';
4
+ export declare function failedSheetPreview(root: ParentNode): {
5
+ host: HTMLElement;
6
+ address: string;
7
+ } | undefined;
8
+ /** The session overlay outlives a failed document body. Its UI stays inside that preview. */
9
+ export declare function sheetRecoveryComponent(bridge: DocumentAnnotationBridge, batches: PageBatches): ({ sessionId, t }: PropsLocale<"annotations"> & {
10
+ sessionId: string;
11
+ }) => import("react").JSX.Element | null;
12
+ //# sourceMappingURL=SheetRecovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetRecovery.d.ts","sourceRoot":"","sources":["../../../../../src/client/files/sheets/SheetRecovery.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EAAoB,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAMjD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU;;;cAMlD;AAED,6FAA6F;AAC7F,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,wBAAwB,EAAE,OAAO,EAAE,WAAW,IAE7D,kBAAkB,WAAW,CAAC,aAAa,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,wCAuDnG"}
@@ -0,0 +1,27 @@
1
+ import type { PropsLocale } from '../../../host-contracts.ts';
2
+ import type { WorkbookInstance, Workbook as WorkbookComponent } from '@fortune-sheet/react';
3
+ import type { Sheet } from '@fortune-sheet/core';
4
+ import type { ComponentType, PropsWithoutRef, Ref, ComponentProps } from 'react';
5
+ import { type DocumentAnnotationBridge } from '../document-workflow.ts';
6
+ import { PageBatches } from '../pages/batches.ts';
7
+ type Translate = PropsLocale<'annotations'>['t'];
8
+ type WorkbookProps = ComponentProps<typeof WorkbookComponent>;
9
+ export declare function SheetSurface({ resourceAddress: address, format, value, bridge, at: t, batches, t: excelT, Workbook, bodyCss, workbookCss }: {
10
+ resourceAddress: string;
11
+ t: PropsLocale<string>['t'];
12
+ Workbook: ComponentType<PropsWithoutRef<WorkbookProps> & {
13
+ ref?: Ref<WorkbookInstance>;
14
+ }>;
15
+ bodyCss: Record<string, string>;
16
+ workbookCss?: string;
17
+ format: 'xlsx' | 'csv';
18
+ value: {
19
+ sheets: Sheet[];
20
+ unsupportedFeatures: string[];
21
+ };
22
+ bridge: DocumentAnnotationBridge;
23
+ at: Translate;
24
+ batches: PageBatches;
25
+ }): import("react").JSX.Element;
26
+ export {};
27
+ //# sourceMappingURL=SheetSurface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetSurface.d.ts","sourceRoot":"","sources":["../../../../../src/client/files/sheets/SheetSurface.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC3F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EAAoB,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAQjD,KAAK,SAAS,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAA;AAChD,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAI7D,wBAAgB,YAAY,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAgB,EAAE,EAAE;IAChJ,eAAe,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;KAAE,CAAC,CAAC;IAChJ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IACtD,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QAAC,mBAAmB,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAAC,MAAM,EAAE,wBAAwB,CAAC;IAAC,EAAE,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CACzJ,+BA0LA"}
@@ -0,0 +1,30 @@
1
+ import type { Hooks, Sheet } from '@fortune-sheet/core';
2
+ import type { SheetRange } from './snapshot.ts';
3
+ export interface Box {
4
+ left: number;
5
+ top: number;
6
+ width: number;
7
+ height: number;
8
+ right: number;
9
+ bottom: number;
10
+ }
11
+ export declare function clip(box: Box, bounds: Box): Box | undefined;
12
+ export declare function union(boxes: readonly Box[]): Box | undefined;
13
+ type Paint = Parameters<NonNullable<Hooks['afterRenderCell']>>[1];
14
+ /** Public cell paint hooks already include zoom and frozen-pane offsets. No React internals. */
15
+ export declare class PaintedCells {
16
+ private cells;
17
+ private columns;
18
+ private rows;
19
+ private columnStarts;
20
+ private rowStarts;
21
+ private headerLeft?;
22
+ private headerTop?;
23
+ clear(): void;
24
+ column(index: number, left: number, width: number, ctx: CanvasRenderingContext2D, headerHeight?: number): void;
25
+ row(index: number, top: number, height: number, ctx: CanvasRenderingContext2D, headerWidth?: number): void;
26
+ record(info: Paint, ctx: CanvasRenderingContext2D): void;
27
+ range(range: SheetRange, bounds: Box, frozen?: Sheet['frozen']): Box | undefined;
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../../src/client/files/sheets/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,WAAW,GAAG;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAChH,wBAAgB,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAI3D;AACD,wBAAgB,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG,EAAE,GAAG,GAAG,GAAG,SAAS,CAK5D;AACD,KAAK,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEjE,gGAAgG;AAChG,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAA0F;IACvG,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,IAAI,CAA4B;IACxC,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,UAAU,CAAC,CAAQ;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAQ;IAC1B,KAAK;IACL,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,wBAAwB,EAAE,YAAY,SAAK;IAMnG,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,wBAAwB,EAAE,WAAW,SAAK;IAM/F,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,wBAAwB;IAUjD,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,SAAS;CAsCjF"}
@@ -0,0 +1,4 @@
1
+ import type { SpreadsheetSnapshot } from './snapshot.ts';
2
+ export declare function registerSpreadsheet(address: string, reveal: (snapshot: SpreadsheetSnapshot) => void): () => void;
3
+ export declare function revealSpreadsheet(snapshot: SpreadsheetSnapshot): boolean;
4
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/client/files/sheets/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAGxD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,cAGnG;AACD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,OAAO,CAKxE"}
@@ -0,0 +1,45 @@
1
+ import type { Cell, Selection, Sheet } from '@fortune-sheet/core';
2
+ export type CellValue = string | number | boolean | null;
3
+ export type SheetRange = {
4
+ row: [number, number];
5
+ column: [number, number];
6
+ };
7
+ export type SheetCell = {
8
+ row: number;
9
+ column: number;
10
+ raw: CellValue;
11
+ display: string;
12
+ formula?: string;
13
+ cached?: CellValue;
14
+ format?: string;
15
+ };
16
+ export type SheetMerge = {
17
+ row: number;
18
+ column: number;
19
+ rows: number;
20
+ columns: number;
21
+ };
22
+ export interface SpreadsheetSnapshot {
23
+ readonly version: 3;
24
+ readonly id: string;
25
+ readonly address: string;
26
+ readonly kind: 'xlsx' | 'csv';
27
+ readonly sheet: {
28
+ id: string;
29
+ name: string;
30
+ };
31
+ readonly range: SheetRange;
32
+ readonly a1: string;
33
+ readonly cells: readonly SheetCell[];
34
+ readonly merges: readonly SheetMerge[];
35
+ readonly text: string;
36
+ readonly comment?: string;
37
+ }
38
+ export declare function columnName(column: number): string;
39
+ export declare function rangeName(range: SheetRange): string;
40
+ export declare function readRange(value: unknown): SheetRange | undefined;
41
+ /** Freeze public Workbook API data as soon as the comment opens, never on Save. */
42
+ export declare function spreadsheetSnapshot(address: string, kind: 'xlsx' | 'csv', sheet: Sheet, selection: Selection, values: (Cell | null)[][]): SpreadsheetSnapshot;
43
+ /** Parse only the bounded, versioned public schema; ignore unrelated persisted properties. */
44
+ export declare function readSpreadsheetSnapshot(value: Record<string, unknown>): SpreadsheetSnapshot | undefined;
45
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../../../src/client/files/sheets/snapshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAEjE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AACxD,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,C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G,MAAM,CAInD;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAKhE;AAED,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAC3G,MAAM,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,mBAAmB,CAoBhD;AAED,8FAA8F;AAC9F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,mBAAmB,GAAG,SAAS,CA6BvG"}
@@ -0,0 +1,148 @@
1
+ export declare const zh: {
2
+ 'response.title': string;
3
+ 'response.add': string;
4
+ 'response.placeholder': string;
5
+ 'response.selected': string;
6
+ 'response.source': string;
7
+ 'response.edit': string;
8
+ 'response.location': string;
9
+ 'response.save': string;
10
+ 'sheet.unavailable': string;
11
+ 'sheet.cell': string;
12
+ 'sheet.value': string;
13
+ 'sheet.formula': string;
14
+ 'sheet.raw': string;
15
+ 'sheet.empty': string;
16
+ 'page.request': string;
17
+ 'page.ask': string;
18
+ 'page.placeholder': string;
19
+ 'page.pick': string;
20
+ 'page.comment': string;
21
+ 'page.edit': string;
22
+ 'page.delete': string;
23
+ 'page.one': string;
24
+ 'page.many': string;
25
+ 'page.cancel': string;
26
+ 'page.save': string;
27
+ 'page.send': string;
28
+ 'page.sending': string;
29
+ 'page.changes': string;
30
+ 'page.submit': string;
31
+ 'page.senderUnavailable': string;
32
+ 'page.region': string;
33
+ 'page.regionHint': string;
34
+ 'page.restoring': string;
35
+ 'page.imageMissing': string;
36
+ 'page.officePage': string;
37
+ 'file.one': string;
38
+ 'file.many': string;
39
+ 'file.selections': string;
40
+ 'file.remove': string;
41
+ 'file.removeAll': string;
42
+ 'file.openSource': string;
43
+ 'file.openFailed': string;
44
+ 'file.sourceBlock': string;
45
+ 'file.snapshot': string;
46
+ 'message.expand': string;
47
+ 'message.collapse': string;
48
+ 'message.evidence': string;
49
+ adjust: string;
50
+ cancel: string;
51
+ placeholder: string;
52
+ annotating: string;
53
+ send: string;
54
+ 'packet.one': string;
55
+ 'packet.many': string;
56
+ 'packet.edit': string;
57
+ 'packet.removeAll': string;
58
+ annotate: string;
59
+ element: string;
60
+ region: string;
61
+ close: string;
62
+ pick: string;
63
+ comment: string;
64
+ save: string;
65
+ saving: string;
66
+ add: string;
67
+ adding: string;
68
+ delete: string;
69
+ noSession: string;
70
+ empty: string;
71
+ saved: string;
72
+ screenshot: string;
73
+ selection: string;
74
+ 'packet.title': string;
75
+ 'packet.screenshot': string;
76
+ 'packet.done': string;
77
+ 'packet.remove': string;
78
+ 'file.add': string;
79
+ 'file.adding': string;
80
+ 'file.addTitle': string;
81
+ 'file.openSession': string;
82
+ 'file.addFailed': string;
83
+ "error.responseInvalid": string;
84
+ "error.responseChanged": string;
85
+ "error.responseUnavailable": string;
86
+ "error.browserNotReady": string;
87
+ "error.originalSession": string;
88
+ "error.sessionChangedSend": string;
89
+ "error.sessionChangedAdd": string;
90
+ "error.sessionChangedDocument": string;
91
+ "error.documentBusy": string;
92
+ "error.fileChanged": string;
93
+ "error.quickTextOnly": string;
94
+ "error.senderUnavailable": string;
95
+ "error.senderUnsupported": string;
96
+ "error.sessionNotReady": string;
97
+ "error.imageLimit": string;
98
+ "error.imageDraftLimit": string;
99
+ "error.disposed": string;
100
+ "error.emptyContent": string;
101
+ "error.fileImageMismatch": string;
102
+ "error.imageMismatch": string;
103
+ "error.imageCountMismatch": string;
104
+ "error.noSession": string;
105
+ "error.composerNotReady": string;
106
+ "error.composerBusy": string;
107
+ "error.imageServiceNotReady": string;
108
+ "error.imageFormat": string;
109
+ "error.composerImages": string;
110
+ "error.draftChanged": string;
111
+ "error.imageDraftUnsupported": string;
112
+ "error.imageDraftIncompatible": string;
113
+ "error.invalidDocument": string;
114
+ "error.batchLimit": string;
115
+ "error.batchFull": string;
116
+ "error.sendFailed": string;
117
+ "error.packetExpired": string;
118
+ "error.packetImageExpired": string;
119
+ "error.invalidSelection": string;
120
+ "error.selectionLimit": string;
121
+ "error.selectionDraft": string;
122
+ "error.contiguousSelection": string;
123
+ "error.separateRanges": string;
124
+ "error.selectionTooLarge": string;
125
+ "error.sheetNotReady": string;
126
+ "error.sheetUnavailable": string;
127
+ "error.sourceUnavailable": string;
128
+ "error.invalidBatch": string;
129
+ "error.commentRequired": string;
130
+ "error.imageMissing": string;
131
+ "error.regionUnavailable": string;
132
+ "error.pageNotReady": string;
133
+ "error.captureRegion": string;
134
+ "error.encodeRegion": string;
135
+ "error.regionTooLarge": string;
136
+ "error.pageImageMismatch": string;
137
+ "error.cancelled": string;
138
+ "error.imageRestoring": string;
139
+ "error.imageDraftLost": string;
140
+ "error.restoreImage": string;
141
+ "error.restoreAttachmentRetry": string;
142
+ "error.restoreAttachment": string;
143
+ "error.storeOpen": string;
144
+ "error.storeWrite": string;
145
+ };
146
+ export declare const en: Record<keyof typeof zh, string>;
147
+ export type AnnotationKey = keyof typeof zh;
148
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCd,CAAA;AACD,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CA6B9C,CAAA;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,EAAE,CAAA"}
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { PropsLocale } from '../../host-contracts.ts';
3
+ import { type FileSnapshot } from '../files/references.ts';
4
+ import { type ResponseAnnotationSnapshot } from '../responses/references.ts';
5
+ export interface SentAnnotationsProps<C, A> extends PropsLocale<'annotations'> {
6
+ content: readonly C[];
7
+ attachments: readonly A[];
8
+ fallback: ReactNode;
9
+ renderDefault(content: readonly C[], attachments: readonly A[]): ReactNode;
10
+ renderText(text: string): ReactNode;
11
+ imageName(attachment: A): string | undefined;
12
+ renderImage(attachment: A): ReactNode;
13
+ openFile?: (snapshot: FileSnapshot) => void | Promise<void>;
14
+ openResponse?: (snapshot: ResponseAnnotationSnapshot) => void | Promise<void>;
15
+ }
16
+ /** Annotation metadata is a display hint, never HTML, a URL to fetch, or model instructions. */
17
+ export declare function SentAnnotations<C, A>({ content, attachments, fallback, renderDefault, renderImage, renderText, imageName, t, openFile, openResponse }: SentAnnotationsProps<C, A>): string | number | boolean | import("react").JSX.Element | Iterable<ReactNode> | null | undefined;
18
+ //# sourceMappingURL=SentAnnotations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SentAnnotations.d.ts","sourceRoot":"","sources":["../../../../src/client/messages/SentAnnotations.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAExE,OAAO,EAAoB,KAAK,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAG9F,MAAM,WAAW,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,WAAW,CAAC,aAAa,CAAC;IAC5E,OAAO,EAAE,SAAS,CAAC,EAAE,CAAA;IACrB,WAAW,EAAE,SAAS,CAAC,EAAE,CAAA;IACzB,QAAQ,EAAE,SAAS,CAAA;IACnB,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,CAAA;IAC1E,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,SAAS,CAAC,UAAU,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAAA;IAC5C,WAAW,CAAC,UAAU,EAAE,CAAC,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3D,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,0BAA0B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9E;AAED,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,oGAsDjL"}
@@ -0,0 +1,39 @@
1
+ /** Versioned, JSON-safe sent-message presentation. Model evidence stays in text. */
2
+ export declare const ANNOTATION_PRESENTATION = "aione-annotations";
3
+ export type SentAnnotation = {
4
+ readonly id: number;
5
+ readonly comment: string;
6
+ readonly title: string;
7
+ readonly url: string;
8
+ readonly target: string;
9
+ readonly screenshot: string;
10
+ };
11
+ export interface AnnotationPresentation {
12
+ readonly source: typeof ANNOTATION_PRESENTATION;
13
+ readonly summary: string;
14
+ readonly data: {
15
+ readonly version: 1;
16
+ readonly id: string;
17
+ readonly entries: readonly SentAnnotation[];
18
+ };
19
+ }
20
+ export interface SerializedAnnotation {
21
+ readonly text: string;
22
+ readonly presentation: AnnotationPresentation;
23
+ }
24
+ export declare function annotationPresentation(id: string, entries: readonly {
25
+ readonly id: number;
26
+ readonly comment: string;
27
+ readonly image: {
28
+ readonly name: string;
29
+ };
30
+ readonly selection: {
31
+ readonly title: string;
32
+ readonly url: string;
33
+ readonly selector?: string;
34
+ readonly kind: string;
35
+ };
36
+ }[]): AnnotationPresentation;
37
+ /** Only explicit v1 metadata opts in. Plain text, legacy dumps and unknown versions stay untouched. */
38
+ export declare function readAnnotation(block: unknown): SerializedAnnotation | undefined;
39
+ //# sourceMappingURL=presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../../src/client/messages/presentation.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,sBAAsB,CAAA;AAE1D,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,OAAO,uBAAuB,CAAA;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;KAAE,CAAA;CACzG;AACD,MAAM,WAAW,oBAAoB;IAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAA;CAAE;AAE9G,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACxF,QAAQ,CAAC,SAAS,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACxH,EAAE,GAAG,sBAAsB,CAK3B;AAMD,uGAAuG;AACvG,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,GAAG,SAAS,CAY/E"}
@@ -0,0 +1,68 @@
1
+ import type { BrowserSurfaceHandle } from '../shared/surface.ts';
2
+ import type { BrowserAnnotationSelection, DesktopAnnotations } from '../shared/desktop.ts';
3
+ import type { ComposerBridge } from '../host-contracts.ts';
4
+ import type { AnnotationEntry } from './composer/packets.ts';
5
+ import { type AnnotationFailure } from './errors.ts';
6
+ export { formatAnnotations } from './composer/packets.ts';
7
+ export interface AnnotationDraft {
8
+ readonly active: boolean;
9
+ readonly mode: 'element' | 'region';
10
+ readonly lease: string;
11
+ readonly epoch: string;
12
+ readonly selection?: BrowserAnnotationSelection;
13
+ readonly comment: string;
14
+ readonly saving: boolean;
15
+ readonly error?: AnnotationFailure;
16
+ readonly target?: string;
17
+ readonly editing?: {
18
+ readonly entry: AnnotationEntry;
19
+ readonly commit: (comment: string) => void;
20
+ };
21
+ }
22
+ export interface AnnotationState {
23
+ readonly drafts: Readonly<Record<string, AnnotationDraft>>;
24
+ }
25
+ /** Window-local snapshots. Navigation only invalidates targets not yet saved. */
26
+ export declare class AnnotationsModel {
27
+ private readonly desktop;
28
+ private readonly composer;
29
+ private readonly leaseOf;
30
+ private state;
31
+ private readonly listeners;
32
+ private readonly surfaces;
33
+ private readonly operations;
34
+ private alive;
35
+ private nextId;
36
+ private readonly visibleMarkers;
37
+ private readonly pending;
38
+ private readonly unsubscribe;
39
+ constructor(desktop: DesktopAnnotations | undefined, composer: ComposerBridge, leaseOf?: (surface: BrowserSurfaceHandle) => string | undefined);
40
+ readonly getSnapshot: () => AnnotationState;
41
+ readonly subscribe: (listener: () => void) => (() => void);
42
+ readonly refresh: () => void;
43
+ available(surface: BrowserSurfaceHandle): boolean;
44
+ hasTarget(): boolean;
45
+ controls(): {
46
+ count: number;
47
+ entries: readonly AnnotationEntry[];
48
+ edit(id: number): void;
49
+ remove(id: number): void;
50
+ review(): void;
51
+ clear(): void;
52
+ send(): void;
53
+ } | undefined;
54
+ markerVisible(id: number): boolean;
55
+ readonly edit: (entry: AnnotationEntry, commit: (comment: string) => void) => boolean;
56
+ toggle(surface: BrowserSurfaceHandle): Promise<void>;
57
+ setMode(surface: BrowserSurfaceHandle, mode: 'element' | 'region'): Promise<void>;
58
+ setComment(surfaceId: string, comment: string): void;
59
+ cancel(surfaceId: string): void;
60
+ save(surface: BrowserSurfaceHandle): Promise<void>;
61
+ dispose(): void;
62
+ private receive;
63
+ private update;
64
+ private nextOperation;
65
+ private currentOperation;
66
+ private publish;
67
+ }
68
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/client/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,KAAK,EAAE,0BAA0B,EAAE,kBAAkB,EAA0B,MAAM,sBAAsB,CAAA;AAClH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAsC,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,MAA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,CAAC,WAAW,CAAY;gBAEX,OAAO,EAAE,kBAAkB,GAAG,SAAS,EAAmB,QAAQ,EAAE,cAAc,EAC5F,OAAO,GAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,MAAM,GAAG,SAGrE;IAIH,QAAQ,CAAC,WAAW,QAAO,eAAe,CAAc;IACxD,QAAQ,CAAC,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAGxD;IACD,QAAQ,CAAC,OAAO,QAAO,IAAI,CAQ1B;IACD,SAAS,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO;IAGjD,SAAS,IAAI,OAAO;IACpB,QAAQ;;;;;;;;;IACR,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAElC,QAAQ,CAAC,IAAI,GAAI,OAAO,eAAe,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,KAAG,OAAO,CAQnF;IAEK,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BpD,OAAO,CAAC,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAcvF,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAKpD,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAQzB,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCxD,OAAO,IAAI,IAAI;IAcf,OAAO,CAAC,OAAO;IAyBf,OAAO,CAAC,MAAM;IAGd,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,OAAO;CAKhB"}
@@ -0,0 +1,3 @@
1
+ /** Preserve source text inside a fence that the source cannot close. */
2
+ export declare function quotedContext(text: string): string;
3
+ //# sourceMappingURL=quoted-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quoted-context.d.ts","sourceRoot":"","sources":["../../../src/client/quoted-context.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKlD"}
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { PropsLocale } from '../../host-contracts.ts';
3
+ import type { ResponseAnnotationSnapshot } from './references.ts';
4
+ export declare function ResponseCard({ items, draft, t, onOpen, onRemove, onClear, renderText }: PropsLocale<'annotations'> & {
5
+ readonly items: readonly ResponseAnnotationSnapshot[];
6
+ readonly draft?: boolean;
7
+ readonly onOpen?: (snapshot: ResponseAnnotationSnapshot, edit: boolean, trigger?: HTMLElement) => void | Promise<void>;
8
+ readonly onRemove?: (snapshot: ResponseAnnotationSnapshot) => void;
9
+ readonly onClear?: () => void;
10
+ readonly renderText?: (text: string) => ReactNode;
11
+ }): import("react").JSX.Element | null;
12
+ //# sourceMappingURL=ResponseCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseCard.d.ts","sourceRoot":"","sources":["../../../../src/client/responses/ResponseCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAGjE,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,KAAa,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAyB,EAAE,EAAE,WAAW,CAAC,aAAa,CAAC,GAAG;IAC3I,QAAQ,CAAC,KAAK,EAAE,SAAS,0BAA0B,EAAE,CAAA;IACrD,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,0BAA0B,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtH,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,0BAA0B,KAAK,IAAI,CAAA;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAA;CAClD,sCAwBA"}
@@ -0,0 +1,7 @@
1
+ import type { PropsLocale } from '../../host-contracts.ts';
2
+ import type { ResponseController } from './controller.ts';
3
+ export declare function ResponseOverlay({ controller, sessionId, t }: PropsLocale<'annotations'> & {
4
+ readonly controller: ResponseController;
5
+ readonly sessionId: string;
6
+ }): import("react").JSX.Element | null;
7
+ //# sourceMappingURL=ResponseOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseOverlay.d.ts","sourceRoot":"","sources":["../../../../src/client/responses/ResponseOverlay.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAczD,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,WAAW,CAAC,aAAa,CAAC,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,sCAsIjK"}
@@ -0,0 +1,11 @@
1
+ import type { ResponseAnnotationSnapshot } from './references.ts';
2
+ /** The persisted Composer document owns these items; no parallel window-local draft store. */
3
+ export interface ResponseComposer {
4
+ read(sessionId: string): readonly ResponseAnnotationSnapshot[];
5
+ replace(snapshot: ResponseAnnotationSnapshot): void;
6
+ remove(sessionId: string, id: string): void;
7
+ clear(sessionId: string): void;
8
+ focus(sessionId: string): void;
9
+ open?: (snapshot: ResponseAnnotationSnapshot, edit: boolean, trigger?: HTMLElement) => Promise<void>;
10
+ }
11
+ //# sourceMappingURL=composer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../../../src/client/responses/composer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAEjE,8FAA8F;AAC9F,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,0BAA0B,EAAE,CAAA;IAC9D,OAAO,CAAC,QAAQ,EAAE,0BAA0B,GAAG,IAAI,CAAA;IACnD,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3C,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,0BAA0B,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACrG"}
@@ -0,0 +1,39 @@
1
+ import { type AnnotationFailure } from '../errors.ts';
2
+ import type { ComposerBridge } from '../../host-contracts.ts';
3
+ import type { ResponseAnnotationSnapshot } from './references.ts';
4
+ import { type ResponseSelection, type ResponseSurface } from './selection.ts';
5
+ export interface ResponseEditor {
6
+ readonly snapshot: ResponseAnnotationSnapshot;
7
+ readonly initial: boolean;
8
+ readonly trigger?: HTMLElement;
9
+ }
10
+ /** Ephemeral surface/interaction state only. All saved content lives in Composer references. */
11
+ export declare class ResponseController {
12
+ readonly composer: ComposerBridge;
13
+ private readonly load;
14
+ readonly surfaces: Set<ResponseSurface>;
15
+ private listeners;
16
+ private revision;
17
+ private operation;
18
+ private disposed;
19
+ candidate?: ResponseSelection;
20
+ editor?: ResponseEditor;
21
+ selectedId?: string;
22
+ selected?: ResponseAnnotationSnapshot;
23
+ failure?: AnnotationFailure;
24
+ busy: boolean;
25
+ constructor(composer: ComposerBridge, load: (sessionId: string, seq: number) => Promise<void>);
26
+ getSnapshot: () => number;
27
+ subscribe: (listener: () => void) => (() => void);
28
+ changed: () => void;
29
+ register(surface: ResponseSurface): () => void;
30
+ select(sessionId: string): void;
31
+ dismiss(restoreFocus?: boolean): void;
32
+ add(): Promise<void>;
33
+ ranges(snapshot: ResponseAnnotationSnapshot): Range[];
34
+ open(snapshot: ResponseAnnotationSnapshot, edit: boolean, trigger?: HTMLElement): Promise<void>;
35
+ save(comment: string): void;
36
+ remove(): void;
37
+ dispose(): void;
38
+ }
39
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/client/responses/controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAiF,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE5J,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,0BAA0B,CAAA;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAC/B;AAED,gGAAgG;AAChG,qBAAa,kBAAkB;IAajB,QAAQ,CAAC,QAAQ,EAAE,cAAc;IAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;IAZpE,QAAQ,CAAC,QAAQ,uBAA6B;IAC9C,OAAO,CAAC,SAAS,CAAwB;IACzC,OAAO,CAAC,QAAQ,CAAI;IACpB,OAAO,CAAC,SAAS,CAAI;IACrB,OAAO,CAAC,QAAQ,CAAQ;IACxB,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,0BAA0B,CAAA;IACrC,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,IAAI,UAAQ;gBAES,QAAQ,EAAE,cAAc,EAAmB,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;IACvH,WAAW,QAAO,MAAM,CAAiB;IACzC,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAAsF;IACtI,OAAO,QAAO,IAAI,CAA0E;IAC5F,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,IAAI;IAK9C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAO/B,OAAO,CAAC,YAAY,UAAQ,GAAG,IAAI;IAc7B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB1B,MAAM,CAAC,QAAQ,EAAE,0BAA0B,GAAG,KAAK,EAAE;IAQ/C,IAAI,CAAC,QAAQ,EAAE,0BAA0B,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCrG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAS3B,MAAM,IAAI,IAAI;IASd,OAAO,IAAI,IAAI;CAChB"}
@@ -0,0 +1,62 @@
1
+ import type { InputState, ReferenceInsert, TokenSpan } from '../../host-contracts.ts';
2
+ export declare const RESPONSE_SOURCE = "aione-response-annotations";
3
+ export declare const RESPONSE_SELECTION_BYTES: number;
4
+ /** Offsets count UTF-16 code units in the visible text projection, not Markdown source. */
5
+ export interface ResponseTextAnchor {
6
+ readonly blockIndex: number;
7
+ readonly start: number;
8
+ readonly end: number;
9
+ readonly prefixHash: string;
10
+ readonly text: string;
11
+ }
12
+ export interface ResponseAnnotationSnapshot {
13
+ readonly version: 1;
14
+ readonly id: string;
15
+ readonly sessionId: string;
16
+ readonly nodeKey: string;
17
+ readonly nodeId: string;
18
+ readonly turn: number;
19
+ readonly step: number;
20
+ readonly seq: number;
21
+ readonly text: string;
22
+ readonly comment: string;
23
+ readonly anchors: readonly ResponseTextAnchor[];
24
+ }
25
+ /** Reconstruct trusted fields; durable references and message metadata are untrusted input. */
26
+ export declare function readResponseSnapshot(value: unknown): ResponseAnnotationSnapshot | undefined;
27
+ export declare function decodeResponseReference(ref: string): ResponseAnnotationSnapshot | undefined;
28
+ export declare function responseReference(snapshot: ResponseAnnotationSnapshot, label: string): ReferenceInsert;
29
+ export declare function responseSelections(input: Pick<InputState, 'occurrences' | 'draftRev'>): {
30
+ snapshot: ResponseAnnotationSnapshot;
31
+ span: TokenSpan;
32
+ ref: string;
33
+ }[];
34
+ export declare function assertResponseCapacity(input: Pick<InputState, 'occurrences'>, ref: string, replacing?: string): void;
35
+ export declare function serializeResponseReference(ref: string, signal: AbortSignal): {
36
+ text: string;
37
+ presentation: {
38
+ source: string;
39
+ summary: string;
40
+ data: {
41
+ anchors: {
42
+ blockIndex: number;
43
+ start: number;
44
+ end: number;
45
+ prefixHash: string;
46
+ text: string;
47
+ }[];
48
+ version: 1;
49
+ id: string;
50
+ sessionId: string;
51
+ nodeKey: string;
52
+ nodeId: string;
53
+ turn: number;
54
+ step: number;
55
+ seq: number;
56
+ text: string;
57
+ comment: string;
58
+ };
59
+ };
60
+ };
61
+ export declare function readSentResponse(block: unknown): ResponseAnnotationSnapshot | undefined;
62
+ //# sourceMappingURL=references.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../src/client/responses/references.ts"],"names":[],"mappings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