@things-factory/ai-assistant 10.1.259 → 10.1.261

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.
@@ -1 +1 @@
1
- {"version":3,"file":"assistant-selection-bar.test.js","sourceRoot":"","sources":["../../client/components/assistant-selection-bar.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,4BAA4B,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAA;AAElH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,uFAAuF,EAAE,GAAG,EAAE;QAC/F,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,+EAA+E,CAAC,CAAA;IACvG,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0FAA0F,EAAE,GAAG,EAAE;QAClG,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAA;QACpE,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,2CAA2C,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oFAAoF,EAAE,GAAG,EAAE;QAC5F,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,wIAAwI,CAAC,CAAA;QAC9J,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,0EAA0E,CAAC,CAAA;QAChG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAA;IAC9D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,IAAI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ar) - one bar for every application's lists. What it is held to here is\n * its source and its words; its behaviour on a real grid is held by the applications' browser tests (operato-office\n * test/browser/page-ai-input.test.js).\n */\nimport { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\nconst bare = readFileSync(join(__dirname, 'assistant-selection-bar.ts'), 'utf-8').replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n\ndescribe('the selection bar', () => {\n it('★ counts every way a grid picks - a row, the header\\'s select-all, a new page of rows', () => {\n expect(bare).toMatch(/GRID_EVENTS = \\['select-record-change', 'select-all-change', 'list-adopted'\\]/)\n })\n\n it('★ asks for its grid when it needs it - a page finds its grid only after its first render', () => {\n expect(bare).toMatch(/gridOf\\?: \\(\\) => SelectionGrid \\| undefined/)\n expect(bare).not.toMatch(/@property\\(\\{ attribute: false \\}\\) grist/)\n })\n\n it('★ hands the rows as keys of the list, to this screen\\'s conversation, sent at once', () => {\n expect(bare).toMatch(/selection: \\{ title: this\\.name, list: this\\.list, records: selectedRecords\\(rows, \\{ axis: this\\.axis, labelOf: this\\.labelOf \\}\\) \\}/)\n expect(bare).toMatch(/ask: request\\?\\.trim\\(\\) \\|\\| i18next\\.t\\('ai-assistant\\.selection\\.ask'/)\n expect(bare).not.toMatch(/draft|continueCurrent|transcript/)\n })\n\n it('keeps the words unless the request was sent', () => {\n expect(bare).toMatch(/if \\(outcome\\?\\.sent && this\\.request === request\\) this\\.request = ''/)\n })\n\n it('every word it shows reads in every language', () => {\n const keys = [...new Set([...bare.matchAll(/'(ai-assistant\\.selection\\.[\\w-]+)'/g)].map(([, key]) => key))]\n expect(keys.length).toBe(7)\n for (const locale of ['en', 'ko', 'ja', 'zh', 'ms', 'es']) {\n const words = JSON.parse(readFileSync(join(__dirname, `../../translations/${locale}.json`), 'utf-8'))\n for (const key of keys) expect([locale, key, typeof words[key]]).toEqual([locale, key, 'string'])\n expect(words['ai-assistant.selection.ask']).toMatch(/\\{n\\}/)\n expect(words['ai-assistant.selection.ask']).toMatch(/\\{title\\}/)\n expect(words['ai-assistant.selection.count']).toMatch(/\\{n\\}/)\n }\n })\n})\n"]}
1
+ {"version":3,"file":"assistant-selection-bar.test.js","sourceRoot":"","sources":["../../client/components/assistant-selection-bar.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;GAIG;AACH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IACtB,IAAI,EAAE,CAAC,OAA6B,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACpF,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE;IACb,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;IAClC,UAAU,EAAE;QACV,aAAa,KAAI,CAAC;KACnB;CACF,CAAC,CAAC,CAAA;AACH,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAW,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAW,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAW,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAC3J,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;AACtE,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACjC,iHAAiH;IACjH,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA;IACtD,MAAM,EAAE,OAAO,EA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IAAI,CAAC,CAAA;IAC9E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gGAAgG,EAAE,GAAG,EAAE;QACxG,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;QAC9B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC7E,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,GAAG,GAAG,IAAK,uBAA+B,EAAE,CAAA;QAClD,GAAG,CAAC,KAAK,GAAG,CAAC,CAAA;QACb,GAAG,CAAC,SAAS,GAAG,KAAK,CAAA;QACrB,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC7C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["/*\n * 「AI와 작업」 over a list (ox-assistant-selection-bar) - one bar for every application's lists. What it is held to here is\n * its source and its words; its behaviour on a real grid is held by the applications' browser tests (operato-office\n * test/browser/page-ai-input.test.js).\n */\nimport { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\n/*\n * The bar's actions are run here for real: the page action runner is the published one (`@operato/context`, loaded by\n * node itself - jest does not transform node_modules), and the bar's template is read as lit would get it. lit,\n * the icons and the words are stood in for, since this suite runs without a DOM.\n */\njest.mock('lit', () => ({\n html: (strings: TemplateStringsArray, ...values: unknown[]) => ({ strings, values }),\n css: () => '',\n nothing: Symbol.for('lit-nothing'),\n LitElement: class {\n requestUpdate() {}\n }\n}))\njest.mock('lit/decorators.js', () => ({ customElement: () => (it: unknown) => it, property: () => (it: unknown) => it, state: () => (it: unknown) => it }))\njest.mock('@material/web/icon/icon.js', () => ({}), { virtual: true })\njest.mock('@operato/context', () => {\n /* The published runner itself: its one file has no imports, so it is turned into CommonJS here and evaluated. */\n const { readFileSync } = jest.requireActual('node:fs')\n const { dirname, join } = jest.requireActual('node:path')\n const { transformSync } = jest.requireActual('@babel/core')\n const file = join(dirname(require.resolve('@operato/context/package.json')), 'dist/src/tools/page-action.js')\n const { code } = transformSync(readFileSync(file, 'utf-8'), { babelrc: false, configFile: false, plugins: ['@babel/plugin-transform-modules-commonjs'] })\n const module = { exports: {} as Record<string, unknown> }\n new Function('module', 'exports', code)(module, module.exports)\n return { ...module.exports, PageActionStyles: '' }\n})\njest.mock('@operato/i18n', () => ({ i18next: { t: (key: string) => key } }))\njest.mock('@operato/layout', () => ({ notify: jest.fn() }))\njest.mock('@operato/styles', () => ({ ButtonStyles: '', FormFieldStyles: '' }))\njest.mock('../utils/assistant-ask', () => ({ askAssistant: jest.fn() }))\njest.mock('../utils/assistant-selection', () => ({ selectedRecords: jest.fn() }))\n\nimport { notify } from '@operato/layout'\n\nimport { OxAssistantSelectionBar, SelectionAction } from './assistant-selection-bar'\n\ntype Drawn = { strings: readonly string[]; values: any[] }\n\n/** The value bound to `name=` in the bar's button template (`?danger`, `aria-disabled`, `title`, `@click`). */\nconst bound = (drawn: Drawn, name: string) => {\n const at = drawn.strings.findIndex(part => /\\s$/.test(` ${part.slice(0, part.length - name.length - 1)}`) && part.endsWith(`${name}=`))\n if (at < 0) throw new Error(`no ${name} in the template`)\n return drawn.values[at]\n}\n\nconst barWith = (count: number) => {\n /* `renderAction` is private to the bar; the suite reaches it as the template lit would be handed. */\n const bar = new (OxAssistantSelectionBar as any)()\n bar.count = count\n return bar as { count: number; renderAction(action: SelectionAction): Drawn }\n}\n\nconst bare = readFileSync(join(__dirname, 'assistant-selection-bar.ts'), 'utf-8').replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n\ndescribe('the selection bar', () => {\n it('★ counts every way a grid picks - a row, the header\\'s select-all, a new page of rows', () => {\n expect(bare).toMatch(/GRID_EVENTS = \\['select-record-change', 'select-all-change', 'list-adopted'\\]/)\n })\n\n it('★ asks for its grid when it needs it - a page finds its grid only after its first render', () => {\n expect(bare).toMatch(/gridOf\\?: \\(\\) => SelectionGrid \\| undefined/)\n expect(bare).not.toMatch(/@property\\(\\{ attribute: false \\}\\) grist/)\n })\n\n it('★ hands the rows as keys of the list, to this screen\\'s conversation, sent at once', () => {\n expect(bare).toMatch(/selection: \\{ title: this\\.name, list: this\\.list, records: selectedRecords\\(rows, \\{ axis: this\\.axis, labelOf: this\\.labelOf \\}\\) \\}/)\n expect(bare).toMatch(/ask: request\\?\\.trim\\(\\) \\|\\| i18next\\.t\\('ai-assistant\\.selection\\.ask'/)\n expect(bare).not.toMatch(/draft|continueCurrent|transcript/)\n })\n\n it('keeps the words unless the request was sent', () => {\n expect(bare).toMatch(/if \\(outcome\\?\\.sent && this\\.request === request\\) this\\.request = ''/)\n })\n\n it('every word it shows reads in every language', () => {\n const keys = [...new Set([...bare.matchAll(/'(ai-assistant\\.selection\\.[\\w-]+)'/g)].map(([, key]) => key))]\n expect(keys.length).toBe(8)\n for (const locale of ['en', 'ko', 'ja', 'zh', 'ms', 'es']) {\n const words = JSON.parse(readFileSync(join(__dirname, `../../translations/${locale}.json`), 'utf-8'))\n for (const key of keys) expect([locale, key, typeof words[key]]).toEqual([locale, key, 'string'])\n expect(words['ai-assistant.selection.ask']).toMatch(/\\{n\\}/)\n expect(words['ai-assistant.selection.ask']).toMatch(/\\{title\\}/)\n expect(words['ai-assistant.selection.count']).toMatch(/\\{n\\}/)\n }\n })\n})\n\ndescribe('the selection bar\\'s actions', () => {\n beforeEach(() => (notify as jest.Mock).mockClear())\n\n it('★ draws a destructive action as danger, an ordinary one not', () => {\n const bar = barWith(1)\n expect(bound(bar.renderAction({ title: 'delete', action: () => {}, emphasis: { danger: true } }), '?danger')).toBe(true)\n expect(bound(bar.renderAction({ title: 'copy', action: () => {} }), '?danger')).toBe(false)\n })\n\n it('★ a one-row action with two rows picked does not run - it is aria-disabled and says why', async () => {\n const bar = barWith(2)\n const action = jest.fn()\n const drawn = bar.renderAction({ title: 'open', single: true, action })\n expect(bound(drawn, 'aria-disabled')).toBe('true')\n expect(bound(drawn, 'title')).toBe('ai-assistant.selection.pick-one')\n await bound(drawn, '@click')({})\n expect(action).not.toHaveBeenCalled()\n expect(notify).toHaveBeenCalledWith({ message: 'ai-assistant.selection.pick-one', level: 'info' })\n\n const one = barWith(1).renderAction({ title: 'open', single: true, action })\n expect(bound(one, 'aria-disabled')).toBe('false')\n })\n\n it('★ pressed twice while its first run is out, it runs once', async () => {\n const bar = barWith(1)\n let finish!: () => void\n const action = jest.fn(() => new Promise<void>(resolve => (finish = resolve)))\n const declared: SelectionAction = { id: 'twice', title: 'send', single: true, action }\n const first = bound(bar.renderAction(declared), '@click')({})\n const second = bound(bar.renderAction(declared), '@click')({})\n expect(bound(bar.renderAction(declared), 'aria-disabled')).toBe('true')\n finish()\n await Promise.all([first, second])\n await new Promise(resolve => setTimeout(resolve, 0))\n expect(action).toHaveBeenCalledTimes(1)\n })\n})\n\ndescribe('the selection bar without the assistant', () => {\n /** Every template drawn under `drawn`, the outer one first - lit's nested `html` results as the mock hands them. */\n const templates = (drawn: any): Drawn[] =>\n drawn && typeof drawn === 'object' && Array.isArray(drawn.strings)\n ? [drawn, ...drawn.values.flatMap((value: any) => (Array.isArray(value) ? value.flatMap(templates) : templates(value)))]\n : []\n const drawnWith = (assistant?: boolean) => {\n const bar = new (OxAssistantSelectionBar as any)()\n bar.count = 1\n bar.actions = [{ id: 'delete', title: 'delete', action: () => {}, emphasis: { danger: true } }]\n if (assistant !== undefined) bar.assistant = assistant\n return templates(bar.render()).map(template => template.strings.join(''))\n }\n\n it('★ offers 「AI와 작업」 unless told not to - the lists that had it keep it', () => {\n const drawn = drawnWith()\n expect(drawn.some(template => template.includes('<form'))).toBe(true)\n expect(drawn.some(template => template.includes('data-action='))).toBe(true)\n })\n\n it('★ assistant=false keeps the picked count and the list\\'s own actions, without the request form', () => {\n const drawn = drawnWith(false)\n expect(drawn.some(template => template.includes('<form'))).toBe(false)\n expect(drawn.some(template => template.includes('class=\"scope\"'))).toBe(true)\n expect(drawn.some(template => template.includes('data-action='))).toBe(true)\n })\n\n it('shows nothing while no row is picked, whatever assistant says', () => {\n const bar = new (OxAssistantSelectionBar as any)()\n bar.count = 0\n bar.assistant = false\n expect(templates(bar.render())).toEqual([])\n })\n})\n"]}
@@ -28,3 +28,5 @@ export * from './utils/assistant-activity.js';
28
28
  export * from './utils/assistant-request-context.js';
29
29
  export * from './utils/assistant-capability.js';
30
30
  export * from './utils/assistant-capability-read.js';
31
+ export { loadPdfjs, drawPdfPage } from './utils/pdf-pages.js';
32
+ export { pdfPageText, isScannedPage } from './utils/document-text.js';
@@ -30,4 +30,7 @@ export * from './utils/assistant-activity.js';
30
30
  export * from './utils/assistant-request-context.js';
31
31
  export * from './utils/assistant-capability.js';
32
32
  export * from './utils/assistant-capability-read.js';
33
+ /* Shared document readers for material-driven editors. */
34
+ export { loadPdfjs, drawPdfPage } from './utils/pdf-pages.js';
35
+ export { pdfPageText, isScannedPage } from './utils/document-text.js';
33
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,oCAAoC,CAAA;AAClD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uCAAuC,CAAA;AACrD,cAAc,yCAAyC,CAAA;AACvD,cAAc,wCAAwC,CAAA;AACtD,cAAc,2CAA2C,CAAA;AACzD,cAAc,oCAAoC,CAAA;AAClD,cAAc,2CAA2C,CAAA;AACzD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,mFAAmF;AACnF,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,gCAAgC,CAAA;AAC9C,0GAA0G;AAC1G,cAAc,yCAAyC,CAAA;AACvD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sCAAsC,CAAA","sourcesContent":["/**\n * `@things-factory/ai-assistant` — 대화면.\n *\n * 표준 컴포넌트는 `<ox-assistant-chat>` 이다.\n */\nexport * from './components/assistant-chat.js'\nexport * from './components/chat-defaults.js'\nexport * from './components/assistant-mode.js'\nexport * from './components/markdown.js'\nexport * from './components/chat-echo-dedup.js'\nexport * from './components/chat-input-builder.js'\nexport * from './components/mention-popup.js'\nexport * from './components/mention-popup-helpers.js'\nexport * from './utils/assistant-session-controller.js'\nexport * from './utils/assistant-session-transport.js'\nexport * from './components/assistant-session-toolbar.js'\nexport * from './utils/assistant-session-admin.js'\nexport * from './components/assistant-session-manager.js'\nexport * from './components/assistant-dock.js'\nexport * from './setup-assistant-dock.js'\nexport * from './utils/assistant-surface.js'\nexport * from './utils/assistant-proposals.js'\n/* The AI 작업 패널's blocks, drawn - also a dashboard card's (ADR-0160 decision 5). */\nexport * from './components/workspace-view.js'\nexport * from './utils/assistant-ask.js'\nexport * from './utils/assistant-selection.js'\n/* 「AI와 작업」 over a list - every application's lists hand their picked rows by it (shared-dock §2-11-1). */\nexport * from './components/assistant-selection-bar.js'\nexport * from './utils/assistant-activity.js'\nexport * from './utils/assistant-request-context.js'\nexport * from './utils/assistant-capability.js'\nexport * from './utils/assistant-capability-read.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,oCAAoC,CAAA;AAClD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uCAAuC,CAAA;AACrD,cAAc,yCAAyC,CAAA;AACvD,cAAc,wCAAwC,CAAA;AACtD,cAAc,2CAA2C,CAAA;AACzD,cAAc,oCAAoC,CAAA;AAClD,cAAc,2CAA2C,CAAA;AACzD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,mFAAmF;AACnF,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,gCAAgC,CAAA;AAC9C,0GAA0G;AAC1G,cAAc,yCAAyC,CAAA;AACvD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sCAAsC,CAAA;AAEpD,0DAA0D;AAC1D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA","sourcesContent":["/**\n * `@things-factory/ai-assistant` — 대화면.\n *\n * 표준 컴포넌트는 `<ox-assistant-chat>` 이다.\n */\nexport * from './components/assistant-chat.js'\nexport * from './components/chat-defaults.js'\nexport * from './components/assistant-mode.js'\nexport * from './components/markdown.js'\nexport * from './components/chat-echo-dedup.js'\nexport * from './components/chat-input-builder.js'\nexport * from './components/mention-popup.js'\nexport * from './components/mention-popup-helpers.js'\nexport * from './utils/assistant-session-controller.js'\nexport * from './utils/assistant-session-transport.js'\nexport * from './components/assistant-session-toolbar.js'\nexport * from './utils/assistant-session-admin.js'\nexport * from './components/assistant-session-manager.js'\nexport * from './components/assistant-dock.js'\nexport * from './setup-assistant-dock.js'\nexport * from './utils/assistant-surface.js'\nexport * from './utils/assistant-proposals.js'\n/* The AI 작업 패널's blocks, drawn - also a dashboard card's (ADR-0160 decision 5). */\nexport * from './components/workspace-view.js'\nexport * from './utils/assistant-ask.js'\nexport * from './utils/assistant-selection.js'\n/* 「AI와 작업」 over a list - every application's lists hand their picked rows by it (shared-dock §2-11-1). */\nexport * from './components/assistant-selection-bar.js'\nexport * from './utils/assistant-activity.js'\nexport * from './utils/assistant-request-context.js'\nexport * from './utils/assistant-capability.js'\nexport * from './utils/assistant-capability-read.js'\n\n/* Shared document readers for material-driven editors. */\nexport { loadPdfjs, drawPdfPage } from './utils/pdf-pages.js'\nexport { pdfPageText, isScannedPage } from './utils/document-text.js'\n"]}