@dxos/assistant 0.8.4-main.67995b8 → 0.8.4-main.a4bbb77
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/lib/browser/chunk-ILL2CN3G.mjs +374 -0
- package/dist/lib/browser/chunk-ILL2CN3G.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6WRGDEMH.mjs → chunk-UB26N5UF.mjs} +2 -2
- package/dist/lib/browser/chunk-UB26N5UF.mjs.map +7 -0
- package/dist/lib/browser/extraction/index.mjs +32 -29
- package/dist/lib/browser/extraction/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +682 -1035
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs → named-entity-recognition-QPYHML66.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-3UU5V4FS.mjs → chunk-BCFXTNSK.mjs} +2 -2
- package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GVKA7VL3.mjs +376 -0
- package/dist/lib/node-esm/chunk-GVKA7VL3.mjs.map +7 -0
- package/dist/lib/node-esm/extraction/index.mjs +32 -29
- package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +682 -1035
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs → named-entity-recognition-2HDF46YX.mjs} +2 -2
- package/dist/types/src/{context/binding.d.ts → conversation/context.d.ts} +45 -3
- package/dist/types/src/conversation/context.d.ts.map +1 -0
- package/dist/types/src/conversation/conversation.d.ts +24 -21
- package/dist/types/src/conversation/conversation.d.ts.map +1 -1
- package/dist/types/src/conversation/index.d.ts +1 -0
- package/dist/types/src/conversation/index.d.ts.map +1 -1
- package/dist/types/src/diff.d.ts +15 -0
- package/dist/types/src/diff.d.ts.map +1 -0
- package/dist/types/src/diff.test.d.ts +2 -0
- package/dist/types/src/diff.test.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +46 -9
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/execution-graph.d.ts +82 -0
- package/dist/types/src/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph.test.d.ts +2 -0
- package/dist/types/src/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +1 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +94 -55
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction.d.ts +250 -216
- package/dist/types/src/extraction/extraction.d.ts.map +1 -1
- package/dist/types/src/functions/services.d.ts +15 -3
- package/dist/types/src/functions/services.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/session/artifact-diff.d.ts +27 -0
- package/dist/types/src/session/artifact-diff.d.ts.map +1 -0
- package/dist/types/src/session/error-handling.d.ts +4 -0
- package/dist/types/src/session/error-handling.d.ts.map +1 -0
- package/dist/types/src/session/format.d.ts +184 -0
- package/dist/types/src/session/format.d.ts.map +1 -0
- package/dist/types/src/session/format.test.d.ts +2 -0
- package/dist/types/src/session/format.test.d.ts.map +1 -0
- package/dist/types/src/session/index.d.ts +3 -0
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/observer.d.ts +22 -0
- package/dist/types/src/session/observer.d.ts.map +1 -0
- package/dist/types/src/session/session.d.ts +23 -236
- package/dist/types/src/session/session.d.ts.map +1 -1
- package/dist/types/src/session/toolkit.d.ts +14 -0
- package/dist/types/src/session/toolkit.d.ts.map +1 -0
- package/dist/types/src/session/version-pin.d.ts +2 -2
- package/dist/types/src/session/version-pin.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +1 -1
- package/dist/types/src/templates/system.d.ts +18 -0
- package/dist/types/src/templates/system.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +3 -0
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -33
- package/src/conversation/context.ts +154 -0
- package/src/conversation/conversation.ts +76 -53
- package/src/conversation/index.ts +1 -0
- package/src/diff.test.ts +43 -0
- package/src/diff.ts +79 -0
- package/src/errors.ts +6 -1
- package/src/execution-graph.test.ts +738 -0
- package/src/execution-graph.ts +500 -0
- package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +8 -7
- package/src/extraction/extraction-llm-function/extraction-llm-function.ts +12 -10
- package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +9 -9
- package/src/extraction/extraction-ner-function/extraction-ner-function.ts +13 -6
- package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +2 -1
- package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
- package/src/extraction/quotes.test.ts +3 -3
- package/src/extraction/quotes.ts +2 -2
- package/src/functions/services.ts +97 -43
- package/src/index.ts +3 -2
- package/src/session/artifact-diff.ts +41 -0
- package/src/session/error-handling.ts +40 -0
- package/src/session/format.test.ts +60 -0
- package/src/session/format.ts +139 -0
- package/src/session/index.ts +3 -0
- package/src/session/observer.ts +58 -0
- package/src/session/session.conversations.json +1 -0
- package/src/session/session.test.ts +33 -197
- package/src/session/session.ts +119 -249
- package/src/session/toolkit.ts +46 -0
- package/src/session/version-pin.ts +4 -4
- package/src/summarization/summarization.test.ts +9 -7
- package/src/templates/format.tpl +60 -0
- package/src/templates/index.ts +1 -1
- package/src/templates/system.tpl +48 -0
- package/src/templates/system.ts +41 -0
- package/src/types.ts +10 -5
- package/src/typings.d.ts +5 -0
- package/dist/lib/browser/chunk-6WRGDEMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-SIXTNSGV.mjs +0 -250
- package/dist/lib/browser/chunk-SIXTNSGV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3UU5V4FS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FD5NXKDP.mjs +0 -252
- package/dist/lib/node-esm/chunk-FD5NXKDP.mjs.map +0 -7
- package/dist/types/bin/chat.d.ts +0 -2
- package/dist/types/bin/chat.d.ts.map +0 -1
- package/dist/types/src/context/binder.d.ts +0 -34
- package/dist/types/src/context/binder.d.ts.map +0 -1
- package/dist/types/src/context/binding.d.ts.map +0 -1
- package/dist/types/src/context/index.d.ts +0 -3
- package/dist/types/src/context/index.d.ts.map +0 -1
- package/dist/types/src/research/exa.d.ts +0 -12
- package/dist/types/src/research/exa.d.ts.map +0 -1
- package/dist/types/src/research/graph.d.ts +0 -51
- package/dist/types/src/research/graph.d.ts.map +0 -1
- package/dist/types/src/research/graph.test.d.ts +0 -2
- package/dist/types/src/research/graph.test.d.ts.map +0 -1
- package/dist/types/src/research/index.d.ts +0 -4
- package/dist/types/src/research/index.d.ts.map +0 -1
- package/dist/types/src/research/research.d.ts +0 -10
- package/dist/types/src/research/research.d.ts.map +0 -1
- package/dist/types/src/research/research.test.d.ts +0 -2
- package/dist/types/src/research/research.test.d.ts.map +0 -1
- package/dist/types/src/session/version-pin.test.d.ts +0 -2
- package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
- package/dist/types/src/templates/prompt.d.ts +0 -30
- package/dist/types/src/templates/prompt.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -3
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/src/context/binder.ts +0 -103
- package/src/context/binding.ts +0 -32
- package/src/context/index.ts +0 -6
- package/src/research/exa.ts +0 -97
- package/src/research/graph.test.ts +0 -64
- package/src/research/graph.ts +0 -369
- package/src/research/index.ts +0 -7
- package/src/research/instructions-research.tpl +0 -98
- package/src/research/research.test.ts +0 -190
- package/src/research/research.ts +0 -87
- package/src/session/__snapshots__/session.test.ts.snap +0 -32
- package/src/session/version-pin.test.ts +0 -7
- package/src/templates/assistant.tpl +0 -111
- package/src/templates/prompt.ts +0 -45
- package/src/testing/exa-search-1748337321991.ts +0 -131
- package/src/testing/exa-search-1748337331526.ts +0 -144
- package/src/testing/exa-search-1748337344119.ts +0 -133
- package/src/testing/index.ts +0 -11
- package/src/typedefs.d.ts +0 -8
- /package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs.map → named-entity-recognition-QPYHML66.mjs.map} +0 -0
- /package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs.map → named-entity-recognition-2HDF46YX.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/context/binding.ts":{"bytes":3145,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/context/binder.ts":{"bytes":10270,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/context/binding.ts","kind":"import-statement","original":"./binding"}],"format":"esm"},"src/context/index.ts":{"bytes":539,"imports":[{"path":"src/context/binder.ts","kind":"import-statement","original":"./binder"},{"path":"src/context/binding.ts","kind":"import-statement","original":"./binding"}],"format":"esm"},"src/errors.ts":{"bytes":939,"imports":[{"path":"@dxos/errors","kind":"import-statement","external":true}],"format":"esm"},"src/session/session.ts":{"bytes":38121,"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/errors.ts","kind":"import-statement","original":"../errors"}],"format":"esm"},"src/session/version-pin.ts":{"bytes":4197,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"src/session/index.ts":{"bytes":556,"imports":[{"path":"src/session/session.ts","kind":"import-statement","original":"./session"},{"path":"src/session/version-pin.ts","kind":"import-statement","original":"./version-pin"}],"format":"esm"},"src/conversation/conversation.ts":{"bytes":8811,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/context/index.ts","kind":"import-statement","original":"../context"},{"path":"src/session/index.ts","kind":"import-statement","original":"../session"}],"format":"esm"},"src/conversation/index.ts":{"bytes":475,"imports":[{"path":"src/conversation/conversation.ts","kind":"import-statement","original":"./conversation"}],"format":"esm"},"src/functions/services.ts":{"bytes":12439,"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/functions/index.ts":{"bytes":460,"imports":[{"path":"src/functions/services.ts","kind":"import-statement","original":"./services"}],"format":"esm"},"src/testing/exa-search-1748337321991.ts":{"bytes":75508,"imports":[],"format":"esm"},"src/testing/exa-search-1748337331526.ts":{"bytes":90578,"imports":[],"format":"esm"},"src/testing/exa-search-1748337344119.ts":{"bytes":69950,"imports":[],"format":"esm"},"src/testing/index.ts":{"bytes":1205,"imports":[{"path":"src/testing/exa-search-1748337321991.ts","kind":"import-statement","original":"./exa-search-1748337321991"},{"path":"src/testing/exa-search-1748337331526.ts","kind":"import-statement","original":"./exa-search-1748337331526"},{"path":"src/testing/exa-search-1748337344119.ts","kind":"import-statement","original":"./exa-search-1748337344119"}],"format":"esm"},"src/research/exa.ts":{"bytes":10782,"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"exa-js","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/testing/index.ts","kind":"import-statement","original":"../testing"}],"format":"esm"},"src/research/graph.ts":{"bytes":39456,"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"raw-loader:./instructions-research.tpl?raw":{"bytes":5238,"imports":[]},"src/research/research.ts":{"bytes":10460,"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/research/exa.ts","kind":"import-statement","original":"./exa"},{"path":"src/research/graph.ts","kind":"import-statement","original":"./graph"},{"path":"raw-loader:./instructions-research.tpl?raw","kind":"import-statement","original":"./instructions-research.tpl?raw"},{"path":"src/session/index.ts","kind":"import-statement","original":"../session"}],"format":"esm"},"src/research/index.ts":{"bytes":619,"imports":[{"path":"src/research/exa.ts","kind":"import-statement","original":"./exa"},{"path":"src/research/research.ts","kind":"import-statement","original":"./research"},{"path":"src/research/graph.ts","kind":"import-statement","original":"./graph"}],"format":"esm"},"raw-loader:./assistant.tpl?raw":{"bytes":5728,"imports":[]},"src/templates/prompt.ts":{"bytes":2143,"imports":[{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"raw-loader:./assistant.tpl?raw","kind":"import-statement","original":"./assistant.tpl?raw"}],"format":"esm"},"src/templates/index.ts":{"bytes":458,"imports":[{"path":"src/templates/prompt.ts","kind":"import-statement","original":"./prompt"}],"format":"esm"},"src/types.ts":{"bytes":6512,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":983,"imports":[{"path":"src/context/index.ts","kind":"import-statement","original":"./context"},{"path":"src/conversation/index.ts","kind":"import-statement","original":"./conversation"},{"path":"src/functions/index.ts","kind":"import-statement","original":"./functions"},{"path":"src/research/index.ts","kind":"import-statement","original":"./research"},{"path":"src/session/index.ts","kind":"import-statement","original":"./session"},{"path":"src/templates/index.ts","kind":"import-statement","original":"./templates"},{"path":"src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/extraction/extraction.ts":{"bytes":6822,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"raw-loader:./instructions.tpl?raw":{"bytes":1318,"imports":[]},"src/extraction/quotes.ts":{"bytes":7110,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/extraction/extraction-llm-function/extraction-llm-function.ts":{"bytes":8645,"imports":[{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"raw-loader:./instructions.tpl?raw","kind":"import-statement","original":"./instructions.tpl?raw"},{"path":"src/session/index.ts","kind":"import-statement","original":"../../session"},{"path":"src/extraction/extraction.ts","kind":"import-statement","original":"../extraction"},{"path":"src/extraction/quotes.ts","kind":"import-statement","original":"../quotes"}],"format":"esm"},"src/extraction/extraction-llm-function/index.ts":{"bytes":524,"imports":[{"path":"src/extraction/extraction-llm-function/extraction-llm-function.ts","kind":"import-statement","original":"./extraction-llm-function"}],"format":"esm"},"src/extraction/extraction-ner-function/named-entity-recognition.ts":{"bytes":10059,"imports":[{"path":"@xenova/transformers","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/extraction/extraction-ner-function/extraction-ner-function.ts":{"bytes":9056,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/extraction/extraction.ts","kind":"import-statement","original":"../extraction"},{"path":"src/extraction/quotes.ts","kind":"import-statement","original":"../quotes"},{"path":"src/extraction/extraction-ner-function/named-entity-recognition.ts","kind":"dynamic-import","original":"./named-entity-recognition"}],"format":"esm"},"src/extraction/extraction-ner-function/index.ts":{"bytes":652,"imports":[{"path":"src/extraction/extraction-ner-function/extraction-ner-function.ts","kind":"import-statement","original":"./extraction-ner-function"},{"path":"src/extraction/extraction-ner-function/named-entity-recognition.ts","kind":"import-statement","original":"./named-entity-recognition"}],"format":"esm"},"src/extraction/index.ts":{"bytes":803,"imports":[{"path":"src/extraction/extraction.ts","kind":"import-statement","original":"./extraction"},{"path":"src/extraction/extraction-llm-function/index.ts","kind":"import-statement","original":"./extraction-llm-function"},{"path":"src/extraction/extraction-ner-function/index.ts","kind":"import-statement","original":"./extraction-ner-function"},{"path":"src/extraction/quotes.ts","kind":"import-statement","original":"./quotes"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":168464},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-SIXTNSGV.mjs","kind":"import-statement"},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"exa-js","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"exports":["AiSession","ArtifactDiffResolver","ArtifactId","Bindings","ContextBinder","ContextBinding","Conversation","ExaToolkit","LiveExaHandler","LocalSearchHandler","LocalSearchToolkit","MockExaHandler","Subgraph","VersionPin","createArtifactElement","createExtractionSchema","createSystemPrompt","findRelatedSchema","getSanitizedSchemaName","makeGraphWriterHandler","makeGraphWriterToolkit","makeToolExecutionServiceFromFunctions","makeToolResolverFromFunctions","researchFn","sanitizeObjects"],"entryPoint":"src/index.ts","inputs":{"src/context/binder.ts":{"bytesInOutput":2163},"src/context/binding.ts":{"bytesInOutput":576},"src/context/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0},"src/conversation/conversation.ts":{"bytesInOutput":1586},"src/conversation/index.ts":{"bytesInOutput":0},"src/functions/services.ts":{"bytesInOutput":2918},"src/functions/index.ts":{"bytesInOutput":0},"src/research/exa.ts":{"bytesInOutput":2471},"src/testing/exa-search-1748337321991.ts":{"bytesInOutput":31265},"src/testing/exa-search-1748337331526.ts":{"bytesInOutput":43952},"src/testing/exa-search-1748337344119.ts":{"bytesInOutput":28760},"src/testing/index.ts":{"bytesInOutput":133},"src/research/index.ts":{"bytesInOutput":0},"src/research/research.ts":{"bytesInOutput":2103},"src/research/graph.ts":{"bytesInOutput":9226},"raw-loader:./instructions-research.tpl?raw":{"bytesInOutput":5375},"src/templates/prompt.ts":{"bytesInOutput":148},"raw-loader:./assistant.tpl?raw":{"bytesInOutput":5866},"src/templates/index.ts":{"bytesInOutput":0},"src/types.ts":{"bytesInOutput":1287}},"bytes":139068},"dist/lib/browser/extraction/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17044},"dist/lib/browser/extraction/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-SIXTNSGV.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-6WRGDEMH.mjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"dist/lib/browser/named-entity-recognition-O46UTCLR.mjs","kind":"dynamic-import"}],"exports":["ExtractionInput","ExtractionOutput","ReferencedQuotes","combineNerTokens","createTokenGroups","extractFullEntities","extractionAnthropicFn","extractionNerFn","findQuotes","getNer","insertReferences","processTranscriptMessage"],"entryPoint":"src/extraction/index.ts","inputs":{"src/extraction/extraction.ts":{"bytesInOutput":1370},"src/extraction/index.ts":{"bytesInOutput":0},"src/extraction/extraction-llm-function/extraction-llm-function.ts":{"bytesInOutput":1809},"raw-loader:./instructions.tpl?raw":{"bytesInOutput":1376},"src/extraction/quotes.ts":{"bytesInOutput":1673},"src/extraction/extraction-llm-function/index.ts":{"bytesInOutput":0},"src/extraction/extraction-ner-function/extraction-ner-function.ts":{"bytesInOutput":2729},"src/extraction/extraction-ner-function/index.ts":{"bytesInOutput":0}},"bytes":9719},"dist/lib/browser/chunk-SIXTNSGV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21368},"dist/lib/browser/chunk-SIXTNSGV.mjs":{"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AiSession","ArtifactDiffResolver","VersionPin"],"inputs":{"src/session/session.ts":{"bytesInOutput":7398},"src/errors.ts":{"bytesInOutput":123},"src/session/version-pin.ts":{"bytesInOutput":745},"src/session/index.ts":{"bytesInOutput":0}},"bytes":8475},"dist/lib/browser/named-entity-recognition-O46UTCLR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/named-entity-recognition-O46UTCLR.mjs":{"imports":[{"path":"dist/lib/browser/chunk-6WRGDEMH.mjs","kind":"import-statement"}],"exports":["combineNerTokens","createTokenGroups","extractFullEntities","getNer"],"entryPoint":"src/extraction/extraction-ner-function/named-entity-recognition.ts","inputs":{},"bytes":261},"dist/lib/browser/chunk-6WRGDEMH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5241},"dist/lib/browser/chunk-6WRGDEMH.mjs":{"imports":[{"path":"@xenova/transformers","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["combineNerTokens","createTokenGroups","extractFullEntities","getNer"],"inputs":{"src/extraction/extraction-ner-function/named-entity-recognition.ts":{"bytesInOutput":2265}},"bytes":2465}}}
|
|
1
|
+
{"inputs":{"src/conversation/context.ts":{"bytes":16750,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/session/artifact-diff.ts":{"bytes":2575,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"src/session/observer.ts":{"bytes":5294,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"src/errors.ts":{"bytes":1420,"imports":[{"path":"@dxos/errors","kind":"import-statement","external":true}],"format":"esm"},"src/session/format.ts":{"bytes":16676,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/errors.ts","kind":"import-statement","original":"../errors"},{"path":"src/session/artifact-diff.ts","kind":"import-statement","original":"./artifact-diff"}],"format":"esm"},"src/session/session.ts":{"bytes":24283,"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/session/format.ts","kind":"import-statement","original":"./format"},{"path":"src/session/observer.ts","kind":"import-statement","original":"./observer"},{"path":"@dxos/node-std/fs","kind":"require-call","external":true}],"format":"esm"},"src/session/toolkit.ts":{"bytes":4411,"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/session/version-pin.ts":{"bytes":4556,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"src/session/index.ts":{"bytes":832,"imports":[{"path":"src/session/artifact-diff.ts","kind":"import-statement","original":"./artifact-diff"},{"path":"src/session/observer.ts","kind":"import-statement","original":"./observer"},{"path":"src/session/session.ts","kind":"import-statement","original":"./session"},{"path":"src/session/toolkit.ts","kind":"import-statement","original":"./toolkit"},{"path":"src/session/version-pin.ts","kind":"import-statement","original":"./version-pin"}],"format":"esm"},"src/conversation/conversation.ts":{"bytes":12371,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/session/index.ts","kind":"import-statement","original":"../session"},{"path":"src/conversation/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/conversation/index.ts":{"bytes":562,"imports":[{"path":"src/conversation/context.ts","kind":"import-statement","original":"./context"},{"path":"src/conversation/conversation.ts","kind":"import-statement","original":"./conversation"}],"format":"esm"},"src/diff.ts":{"bytes":8472,"imports":[{"path":"@automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/execution-graph.ts":{"bytes":50847,"imports":[{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/functions/services.ts":{"bytes":19561,"imports":[{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/functions/index.ts":{"bytes":460,"imports":[{"path":"src/functions/services.ts","kind":"import-statement","original":"./services"}],"format":"esm"},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/format.tpl?raw":{"bytes":1915,"imports":[]},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/system.tpl?raw":{"bytes":3351,"imports":[]},"src/templates/system.ts":{"bytes":3127,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/format.tpl?raw","kind":"import-statement","original":"./format.tpl?raw"},{"path":"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/system.tpl?raw","kind":"import-statement","original":"./system.tpl?raw"}],"format":"esm"},"src/templates/index.ts":{"bytes":458,"imports":[{"path":"src/templates/system.ts","kind":"import-statement","original":"./system"}],"format":"esm"},"src/types.ts":{"bytes":6867,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1081,"imports":[{"path":"src/conversation/index.ts","kind":"import-statement","original":"./conversation"},{"path":"src/diff.ts","kind":"import-statement","original":"./diff"},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/execution-graph.ts","kind":"import-statement","original":"./execution-graph"},{"path":"src/functions/index.ts","kind":"import-statement","original":"./functions"},{"path":"src/session/index.ts","kind":"import-statement","original":"./session"},{"path":"src/templates/index.ts","kind":"import-statement","original":"./templates"},{"path":"src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/extraction/extraction.ts":{"bytes":6822,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/extraction/quotes.ts":{"bytes":7110,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/extraction/extraction-llm-function/instructions.tpl?raw":{"bytes":1318,"imports":[]},"src/extraction/extraction-llm-function/extraction-llm-function.ts":{"bytes":8731,"imports":[{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/session/index.ts","kind":"import-statement","original":"../../session"},{"path":"src/extraction/extraction.ts","kind":"import-statement","original":"../extraction"},{"path":"src/extraction/quotes.ts","kind":"import-statement","original":"../quotes"},{"path":"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/extraction/extraction-llm-function/instructions.tpl?raw","kind":"import-statement","original":"./instructions.tpl?raw"}],"format":"esm"},"src/extraction/extraction-llm-function/index.ts":{"bytes":524,"imports":[{"path":"src/extraction/extraction-llm-function/extraction-llm-function.ts","kind":"import-statement","original":"./extraction-llm-function"}],"format":"esm"},"src/extraction/extraction-ner-function/named-entity-recognition.ts":{"bytes":10067,"imports":[{"path":"@xenova/transformers","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/extraction/extraction-ner-function/extraction-ner-function.ts":{"bytes":9308,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/extraction/extraction.ts","kind":"import-statement","original":"../extraction"},{"path":"src/extraction/quotes.ts","kind":"import-statement","original":"../quotes"},{"path":"src/extraction/extraction-ner-function/named-entity-recognition.ts","kind":"dynamic-import","original":"./named-entity-recognition"}],"format":"esm"},"src/extraction/extraction-ner-function/index.ts":{"bytes":652,"imports":[{"path":"src/extraction/extraction-ner-function/extraction-ner-function.ts","kind":"import-statement","original":"./extraction-ner-function"},{"path":"src/extraction/extraction-ner-function/named-entity-recognition.ts","kind":"import-statement","original":"./named-entity-recognition"}],"format":"esm"},"src/extraction/index.ts":{"bytes":803,"imports":[{"path":"src/extraction/extraction.ts","kind":"import-statement","original":"./extraction"},{"path":"src/extraction/extraction-llm-function/index.ts","kind":"import-statement","original":"./extraction-llm-function"},{"path":"src/extraction/extraction-ner-function/index.ts","kind":"import-statement","original":"./extraction-ner-function"},{"path":"src/extraction/quotes.ts","kind":"import-statement","original":"./quotes"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":64434},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-ILL2CN3G.mjs","kind":"import-statement"},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["AiAssistantError","AiContextBinder","AiContextService","AiConversation","AiModelError","AiSession","ArtifactDiffResolver","ArtifactId","Bindings","ContextBinding","ExecutionGraph","GenerationObserver","VersionPin","applyDiffs","computeDiffsWithCursors","createArtifactElement","createSystemPrompt","createToolkit","makeToolExecutionServiceFromFunctions","makeToolResolverFromFunctions","reduceDiffs","templates"],"entryPoint":"src/index.ts","inputs":{"src/conversation/context.ts":{"bytesInOutput":3891},"src/conversation/index.ts":{"bytesInOutput":0},"src/conversation/conversation.ts":{"bytesInOutput":2806},"src/index.ts":{"bytesInOutput":0},"src/diff.ts":{"bytesInOutput":1899},"src/execution-graph.ts":{"bytesInOutput":12095},"src/functions/services.ts":{"bytesInOutput":4129},"src/functions/index.ts":{"bytesInOutput":0},"src/templates/system.ts":{"bytesInOutput":540},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/format.tpl?raw":{"bytesInOutput":2000},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/system.tpl?raw":{"bytesInOutput":3424},"src/templates/index.ts":{"bytesInOutput":0},"src/types.ts":{"bytesInOutput":1334}},"bytes":33145},"dist/lib/browser/extraction/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17256},"dist/lib/browser/extraction/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-ILL2CN3G.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-UB26N5UF.mjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"dist/lib/browser/named-entity-recognition-QPYHML66.mjs","kind":"dynamic-import"}],"exports":["ExtractionInput","ExtractionOutput","ReferencedQuotes","combineNerTokens","createTokenGroups","extractFullEntities","extractionAnthropicFunction","extractionNerFunction","findQuotes","getNer","insertReferences","processTranscriptMessage"],"entryPoint":"src/extraction/index.ts","inputs":{"src/extraction/extraction.ts":{"bytesInOutput":1370},"src/extraction/index.ts":{"bytesInOutput":0},"src/extraction/extraction-llm-function/extraction-llm-function.ts":{"bytesInOutput":1850},"src/extraction/quotes.ts":{"bytesInOutput":1673},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/extraction/extraction-llm-function/instructions.tpl?raw":{"bytesInOutput":1376},"src/extraction/extraction-llm-function/index.ts":{"bytesInOutput":0},"src/extraction/extraction-ner-function/extraction-ner-function.ts":{"bytesInOutput":2740},"src/extraction/extraction-ner-function/index.ts":{"bytesInOutput":0}},"bytes":9859},"dist/lib/browser/chunk-ILL2CN3G.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":29142},"dist/lib/browser/chunk-ILL2CN3G.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@effect/ai","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AiAssistantError","AiModelError","AiSession","ArtifactDiffResolver","GenerationObserver","VersionPin","createToolkit"],"inputs":{"src/session/artifact-diff.ts":{"bytesInOutput":134},"src/session/observer.ts":{"bytesInOutput":874},"src/errors.ts":{"bytesInOutput":236},"src/session/session.ts":{"bytesInOutput":4638},"src/session/format.ts":{"bytesInOutput":3790},"src/session/toolkit.ts":{"bytesInOutput":737},"src/session/version-pin.ts":{"bytesInOutput":1030},"src/session/index.ts":{"bytesInOutput":0}},"bytes":11837},"dist/lib/browser/named-entity-recognition-QPYHML66.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/named-entity-recognition-QPYHML66.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UB26N5UF.mjs","kind":"import-statement"}],"exports":["combineNerTokens","createTokenGroups","extractFullEntities","getNer"],"entryPoint":"src/extraction/extraction-ner-function/named-entity-recognition.ts","inputs":{},"bytes":261},"dist/lib/browser/chunk-UB26N5UF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5245},"dist/lib/browser/chunk-UB26N5UF.mjs":{"imports":[{"path":"@xenova/transformers","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["combineNerTokens","createTokenGroups","extractFullEntities","getNer"],"inputs":{"src/extraction/extraction-ner-function/named-entity-recognition.ts":{"bytesInOutput":2265}},"bytes":2465}}}
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
createTokenGroups,
|
|
4
4
|
extractFullEntities,
|
|
5
5
|
getNer
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UB26N5UF.mjs";
|
|
7
7
|
export {
|
|
8
8
|
combineNerTokens,
|
|
9
9
|
createTokenGroups,
|
|
10
10
|
extractFullEntities,
|
|
11
11
|
getNer
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=named-entity-recognition-
|
|
13
|
+
//# sourceMappingURL=named-entity-recognition-QPYHML66.mjs.map
|
|
@@ -10,7 +10,7 @@ var getNer = () => {
|
|
|
10
10
|
_ner = pipeline("ner", "Xenova/bert-base-NER").then((ner) => {
|
|
11
11
|
log.info("NER model is ready", void 0, {
|
|
12
12
|
F: __dxlog_file,
|
|
13
|
-
L:
|
|
13
|
+
L: 24,
|
|
14
14
|
S: void 0,
|
|
15
15
|
C: (f, a) => f(...a)
|
|
16
16
|
});
|
|
@@ -88,4 +88,4 @@ export {
|
|
|
88
88
|
createTokenGroups,
|
|
89
89
|
combineNerTokens
|
|
90
90
|
};
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
91
|
+
//# sourceMappingURL=chunk-BCFXTNSK.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/extraction/extraction-ner-function/named-entity-recognition.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n type TokenClassificationOutput,\n type TokenClassificationPipelineType,\n type TokenClassificationSingle,\n pipeline,\n} from '@xenova/transformers';\n\nimport { log } from '@dxos/log';\n\nlet _ner: Promise<TokenClassificationPipelineType>;\n\n/**\n * Named Entity Recognition pipeline.\n * Initializes the pipeline on first call.\n * @returns The singleton promise that resolves to a token classification pipeline.\n */\nexport const getNer = () => {\n if (!_ner) {\n _ner = pipeline('ner', 'Xenova/bert-base-NER').then((ner) => {\n log.info('NER model is ready');\n return ner;\n });\n }\n\n return _ner;\n};\n\n/**\n * Extracts entities from text using the named entity recognition pipeline and does simple grouping of tokens.\n */\nexport const extractFullEntities = async (text: string): Promise<TokenClassificationSingle[]> => {\n const ner = await getNer();\n const entities = (await ner(text)) as TokenClassificationOutput;\n const tokenGroups = createTokenGroups(entities);\n const combinedEntities = tokenGroups.map(combineNerTokens);\n return combinedEntities;\n};\n\nexport const createTokenGroups = (tokens: TokenClassificationSingle[]): TokenClassificationSingle[][] => {\n const tokenGroups: TokenClassificationSingle[][] = [];\n\n const canBeCombined = (prevToken: TokenClassificationSingle, currentToken: TokenClassificationSingle) => {\n const [currentState, currentEntity] = currentToken.entity.split('-'); // B, I, O\n const [prevState, prevEntity] = prevToken.entity.split('-'); // B, I, O\n if (prevEntity !== currentEntity) {\n return false;\n }\n if (prevState === 'O') {\n return false;\n }\n if (currentState === 'I') {\n return true;\n }\n if ((prevState === 'B' || prevState === 'I') && currentState === 'B') {\n return currentToken.word.startsWith('#');\n }\n return false;\n };\n\n for (const token of tokens) {\n if (tokenGroups.length === 0) {\n tokenGroups.push([token]);\n continue;\n }\n const lastTokenGroup = tokenGroups.at(-1)!;\n if (canBeCombined(lastTokenGroup.at(-1)!, token)) {\n lastTokenGroup.push(token);\n continue;\n }\n tokenGroups.push([token]);\n }\n\n return tokenGroups;\n};\n\nexport const combineNerTokens = (group: TokenClassificationSingle[]): TokenClassificationSingle => {\n const combinedToken: TokenClassificationSingle = {\n entity: group.at(0)!.entity.split('-')[1],\n score: group.reduce((acc, token) => acc + token.score, 0) / group.length,\n index: group.at(0)!.index,\n word: group.at(0)!.word,\n start: group.at(0)!.start,\n end: group.at(-1)!.end,\n };\n\n for (const token of group.slice(1)) {\n if (token.word.startsWith('#')) {\n combinedToken.word += token.word.replace(/^#+/, '');\n } else {\n combinedToken.word += ' ' + token.word;\n }\n }\n\n return combinedToken;\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAIEA,gBACK;AAEP,SAASC,WAAW;;AAEpB,IAAIC;AAOG,IAAMC,SAAS,MAAA;AACpB,MAAI,CAACD,MAAM;AACTA,WAAOF,SAAS,OAAO,sBAAA,EAAwBI,KAAK,CAACC,QAAAA;AACnDJ,UAAIK,KAAK,sBAAA,QAAA;;;;;;AACT,aAAOD;IACT,CAAA;EACF;AAEA,SAAOH;AACT;AAKO,IAAMK,sBAAsB,OAAOC,SAAAA;AACxC,QAAMH,MAAM,MAAMF,OAAAA;AAClB,QAAMM,WAAY,MAAMJ,IAAIG,IAAAA;AAC5B,QAAME,cAAcC,kBAAkBF,QAAAA;AACtC,QAAMG,mBAAmBF,YAAYG,IAAIC,gBAAAA;AACzC,SAAOF;AACT;AAEO,IAAMD,oBAAoB,CAACI,WAAAA;AAChC,QAAML,cAA6C,CAAA;AAEnD,QAAMM,gBAAgB,CAACC,WAAsCC,iBAAAA;AAC3D,UAAM,CAACC,cAAcC,aAAAA,IAAiBF,aAAaG,OAAOC,MAAM,GAAA;AAChE,UAAM,CAACC,WAAWC,UAAAA,IAAcP,UAAUI,OAAOC,MAAM,GAAA;AACvD,QAAIE,eAAeJ,eAAe;AAChC,aAAO;IACT;AACA,QAAIG,cAAc,KAAK;AACrB,aAAO;IACT;AACA,QAAIJ,iBAAiB,KAAK;AACxB,aAAO;IACT;AACA,SAAKI,cAAc,OAAOA,cAAc,QAAQJ,iBAAiB,KAAK;AACpE,aAAOD,aAAaO,KAAKC,WAAW,GAAA;IACtC;AACA,WAAO;EACT;AAEA,aAAWC,SAASZ,QAAQ;AAC1B,QAAIL,YAAYkB,WAAW,GAAG;AAC5BlB,kBAAYmB,KAAK;QAACF;OAAM;AACxB;IACF;AACA,UAAMG,iBAAiBpB,YAAYqB,GAAG,EAAC;AACvC,QAAIf,cAAcc,eAAeC,GAAG,EAAC,GAAKJ,KAAAA,GAAQ;AAChDG,qBAAeD,KAAKF,KAAAA;AACpB;IACF;AACAjB,gBAAYmB,KAAK;MAACF;KAAM;EAC1B;AAEA,SAAOjB;AACT;AAEO,IAAMI,mBAAmB,CAACkB,UAAAA;AAC/B,QAAMC,gBAA2C;IAC/CZ,QAAQW,MAAMD,GAAG,CAAA,EAAIV,OAAOC,MAAM,GAAA,EAAK,CAAA;IACvCY,OAAOF,MAAMG,OAAO,CAACC,KAAKT,UAAUS,MAAMT,MAAMO,OAAO,CAAA,IAAKF,MAAMJ;IAClES,OAAOL,MAAMD,GAAG,CAAA,EAAIM;IACpBZ,MAAMO,MAAMD,GAAG,CAAA,EAAIN;IACnBa,OAAON,MAAMD,GAAG,CAAA,EAAIO;IACpBC,KAAKP,MAAMD,GAAG,EAAC,EAAIQ;EACrB;AAEA,aAAWZ,SAASK,MAAMQ,MAAM,CAAA,GAAI;AAClC,QAAIb,MAAMF,KAAKC,WAAW,GAAA,GAAM;AAC9BO,oBAAcR,QAAQE,MAAMF,KAAKgB,QAAQ,OAAO,EAAA;IAClD,OAAO;AACLR,oBAAcR,QAAQ,MAAME,MAAMF;IACpC;EACF;AAEA,SAAOQ;AACT;",
|
|
6
|
+
"names": ["pipeline", "log", "_ner", "getNer", "then", "ner", "info", "extractFullEntities", "text", "entities", "tokenGroups", "createTokenGroups", "combinedEntities", "map", "combineNerTokens", "tokens", "canBeCombined", "prevToken", "currentToken", "currentState", "currentEntity", "entity", "split", "prevState", "prevEntity", "word", "startsWith", "token", "length", "push", "lastTokenGroup", "at", "group", "combinedToken", "score", "reduce", "acc", "index", "start", "end", "slice", "replace"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/session/artifact-diff.ts
|
|
4
|
+
import { Context } from "effect";
|
|
5
|
+
var ArtifactDiffResolver = class extends Context.Tag("@dxos/assistant/ArtifactDiffResolver")() {
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// src/session/observer.ts
|
|
9
|
+
import { Effect, Function } from "effect";
|
|
10
|
+
var GenerationObserver = Object.freeze({
|
|
11
|
+
make: ({ onBegin = Function.constant(Effect.void), onPart = Function.constant(Effect.void), onBlock = Function.constant(Effect.void), onEnd = Function.constant(Effect.void), onMessage = Function.constant(Effect.void) } = {}) => ({
|
|
12
|
+
onBegin,
|
|
13
|
+
onPart,
|
|
14
|
+
onBlock,
|
|
15
|
+
onEnd,
|
|
16
|
+
onMessage
|
|
17
|
+
}),
|
|
18
|
+
noop: () => GenerationObserver.make(),
|
|
19
|
+
/**
|
|
20
|
+
* Debug printer to be used in unit-tests and browser devtools.
|
|
21
|
+
*/
|
|
22
|
+
fromPrinter: (printer) => GenerationObserver.make({
|
|
23
|
+
onBlock: (block) => Effect.sync(() => {
|
|
24
|
+
if (block.pending) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
printer.printContentBlock(block);
|
|
28
|
+
}),
|
|
29
|
+
onMessage: (message) => Effect.sync(() => {
|
|
30
|
+
if (message.sender.role === "assistant") {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
printer.printMessage(message);
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// src/errors.ts
|
|
39
|
+
import { BaseError } from "@dxos/errors";
|
|
40
|
+
var AiModelError = class extends BaseError.extend("AI_MODEL_ERROR", "AI model error") {
|
|
41
|
+
};
|
|
42
|
+
var AiAssistantError = class extends BaseError.extend("AI_ASSISTANT_ERROR", "AI assistant error") {
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// src/session/session.ts
|
|
46
|
+
import { LanguageModel } from "@effect/ai";
|
|
47
|
+
import { Chunk, Effect as Effect3, Stream } from "effect";
|
|
48
|
+
import { AiParser, AiPreprocessor, callTool, getToolCalls } from "@dxos/ai";
|
|
49
|
+
import { todo } from "@dxos/debug";
|
|
50
|
+
import { Obj as Obj2 } from "@dxos/echo";
|
|
51
|
+
import { TracingService } from "@dxos/functions";
|
|
52
|
+
import { log as log2 } from "@dxos/log";
|
|
53
|
+
import { DataType as DataType2 } from "@dxos/schema";
|
|
54
|
+
|
|
55
|
+
// src/session/format.ts
|
|
56
|
+
import { Array, Effect as Effect2, Option, pipe } from "effect";
|
|
57
|
+
import { Template } from "@dxos/blueprints";
|
|
58
|
+
import { Obj } from "@dxos/echo";
|
|
59
|
+
import { ObjectVersion } from "@dxos/echo-db";
|
|
60
|
+
import { DatabaseService } from "@dxos/functions";
|
|
61
|
+
import { log } from "@dxos/log";
|
|
62
|
+
import { DataType } from "@dxos/schema";
|
|
63
|
+
import { trim } from "@dxos/util";
|
|
64
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/core/assistant/src/session/format.ts";
|
|
65
|
+
var formatSystemPrompt = ({ system, blueprints = [], objects = [] }) => Effect2.gen(function* () {
|
|
66
|
+
const blueprintDefs = yield* pipe(blueprints, Effect2.forEach((blueprint) => Effect2.succeed(blueprint.instructions)), Effect2.flatMap(Effect2.forEach((template) => DatabaseService.loadOption(template.source))), Effect2.map(Array.filter(Option.isSome)), Effect2.map(Array.map((template) => trim`
|
|
67
|
+
<blueprint>
|
|
68
|
+
${Template.process(template.value.content)}
|
|
69
|
+
</blueprint>
|
|
70
|
+
`)), Effect2.map((blueprints2) => blueprints2.length > 0 ? [
|
|
71
|
+
"## Blueprints Definitions",
|
|
72
|
+
...blueprints2
|
|
73
|
+
].join("\n\n") : void 0));
|
|
74
|
+
const objectDefs = yield* pipe(objects, Effect2.forEach((object) => Effect2.succeed(trim`
|
|
75
|
+
<object>
|
|
76
|
+
<dxn>${Obj.getDXN(object)}</dxn>
|
|
77
|
+
<typename>${Obj.getTypename(object)}</typename>
|
|
78
|
+
</object>
|
|
79
|
+
`)), Effect2.map((objects2) => objects2.length > 0 ? [
|
|
80
|
+
"## Context Objects",
|
|
81
|
+
...objects2
|
|
82
|
+
].join("\n\n") : void 0));
|
|
83
|
+
return yield* pipe(Effect2.succeed([
|
|
84
|
+
system,
|
|
85
|
+
blueprintDefs,
|
|
86
|
+
objectDefs
|
|
87
|
+
].filter((def) => def !== void 0)), Effect2.map((parts) => parts.join("\n\n")));
|
|
88
|
+
});
|
|
89
|
+
var formatUserPrompt = ({ prompt, history = [] }) => Effect2.gen(function* () {
|
|
90
|
+
const blocks = [];
|
|
91
|
+
const artifactDiffResolver = yield* Effect2.serviceOption(ArtifactDiffResolver);
|
|
92
|
+
if (Option.isSome(artifactDiffResolver)) {
|
|
93
|
+
const versions = gatherObjectVersions(history);
|
|
94
|
+
const artifactDiff = yield* Effect2.tryPromise({
|
|
95
|
+
try: () => artifactDiffResolver.value.resolve([
|
|
96
|
+
...versions.entries()
|
|
97
|
+
].map(([id, version]) => ({
|
|
98
|
+
id,
|
|
99
|
+
lastVersion: version
|
|
100
|
+
}))),
|
|
101
|
+
catch: AiAssistantError.wrap({
|
|
102
|
+
message: "Artifact diff resolution error"
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
log("version", {
|
|
106
|
+
artifactDiff,
|
|
107
|
+
versions
|
|
108
|
+
}, {
|
|
109
|
+
F: __dxlog_file,
|
|
110
|
+
L: 90,
|
|
111
|
+
S: this,
|
|
112
|
+
C: (f, a) => f(...a)
|
|
113
|
+
});
|
|
114
|
+
for (const [id, { version }] of [
|
|
115
|
+
...artifactDiff.entries()
|
|
116
|
+
]) {
|
|
117
|
+
if (ObjectVersion.equals(version, versions.get(id))) {
|
|
118
|
+
artifactDiff.delete(id);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
blocks.push({
|
|
122
|
+
_tag: "anchor",
|
|
123
|
+
objectId: id,
|
|
124
|
+
version
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (artifactDiff.size > 0) {
|
|
128
|
+
blocks.push(createArtifactUpdateBlock(artifactDiff));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return Obj.make(DataType.Message, {
|
|
132
|
+
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
133
|
+
sender: {
|
|
134
|
+
role: "user"
|
|
135
|
+
},
|
|
136
|
+
blocks: [
|
|
137
|
+
...blocks,
|
|
138
|
+
{
|
|
139
|
+
_tag: "text",
|
|
140
|
+
text: prompt
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
var gatherObjectVersions = (messages) => {
|
|
146
|
+
const artifactIds = /* @__PURE__ */ new Map();
|
|
147
|
+
for (const message of messages) {
|
|
148
|
+
for (const block of message.blocks) {
|
|
149
|
+
if (block._tag === "anchor") {
|
|
150
|
+
artifactIds.set(block.objectId, block.version);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return artifactIds;
|
|
155
|
+
};
|
|
156
|
+
var createArtifactUpdateBlock = (artifactDiff) => {
|
|
157
|
+
return {
|
|
158
|
+
_tag: "text",
|
|
159
|
+
// TODO(dmaretskyi): Does this need to be a special content-block?
|
|
160
|
+
disposition: "artifact-update",
|
|
161
|
+
text: trim`
|
|
162
|
+
The following artifacts have been updated since the last message:
|
|
163
|
+
${[
|
|
164
|
+
...artifactDiff.entries()
|
|
165
|
+
].map(([id, { diff }]) => `<changed-artifact id="${id}">${diff ? `
|
|
166
|
+
${diff}` : ""}</changed-artifact>`).join("\n")}
|
|
167
|
+
`
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// src/session/session.ts
|
|
172
|
+
function _define_property(obj, key, value) {
|
|
173
|
+
if (key in obj) {
|
|
174
|
+
Object.defineProperty(obj, key, {
|
|
175
|
+
value,
|
|
176
|
+
enumerable: true,
|
|
177
|
+
configurable: true,
|
|
178
|
+
writable: true
|
|
179
|
+
});
|
|
180
|
+
} else {
|
|
181
|
+
obj[key] = value;
|
|
182
|
+
}
|
|
183
|
+
return obj;
|
|
184
|
+
}
|
|
185
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/core/assistant/src/session/session.ts";
|
|
186
|
+
var AiSession = class {
|
|
187
|
+
/**
|
|
188
|
+
* @deprecated
|
|
189
|
+
*/
|
|
190
|
+
// TODO(burdon): Implement or remove.
|
|
191
|
+
async runStructured(_schema, _options) {
|
|
192
|
+
return todo();
|
|
193
|
+
}
|
|
194
|
+
constructor(_options = {}) {
|
|
195
|
+
_define_property(this, "_options", void 0);
|
|
196
|
+
_define_property(this, "_semaphore", void 0);
|
|
197
|
+
_define_property(this, "_history", void 0);
|
|
198
|
+
_define_property(this, "_pending", void 0);
|
|
199
|
+
_define_property(this, "run", void 0);
|
|
200
|
+
this._options = _options;
|
|
201
|
+
this._semaphore = Effect3.runSync(Effect3.makeSemaphore(1));
|
|
202
|
+
this._history = [];
|
|
203
|
+
this._pending = [];
|
|
204
|
+
this.run = ({ prompt, system: systemTemplate, history = [], objects = [], blueprints = [], toolkit, observer = GenerationObserver.noop() }) => Effect3.gen(this, function* () {
|
|
205
|
+
this._history = [
|
|
206
|
+
...history
|
|
207
|
+
];
|
|
208
|
+
this._pending = [];
|
|
209
|
+
const pending = this._pending;
|
|
210
|
+
const submitMessage = Effect3.fnUntraced(function* (message) {
|
|
211
|
+
pending.push(message);
|
|
212
|
+
yield* observer.onMessage(message);
|
|
213
|
+
yield* TracingService.emitConverationMessage(message);
|
|
214
|
+
return message;
|
|
215
|
+
});
|
|
216
|
+
const promptMessage = yield* submitMessage(yield* formatUserPrompt({
|
|
217
|
+
prompt,
|
|
218
|
+
history
|
|
219
|
+
}));
|
|
220
|
+
const system = yield* formatSystemPrompt({
|
|
221
|
+
system: systemTemplate,
|
|
222
|
+
blueprints,
|
|
223
|
+
objects
|
|
224
|
+
});
|
|
225
|
+
do {
|
|
226
|
+
log2("request", {
|
|
227
|
+
prompt: promptMessage,
|
|
228
|
+
system: {
|
|
229
|
+
snippet: createSnippet(system),
|
|
230
|
+
length: system.length
|
|
231
|
+
},
|
|
232
|
+
pending: this._pending.length,
|
|
233
|
+
history: this._history.length,
|
|
234
|
+
objects: objects?.length ?? 0
|
|
235
|
+
}, {
|
|
236
|
+
F: __dxlog_file2,
|
|
237
|
+
L: 103,
|
|
238
|
+
S: this,
|
|
239
|
+
C: (f, a) => f(...a)
|
|
240
|
+
});
|
|
241
|
+
const prompt2 = yield* AiPreprocessor.preprocessPrompt([
|
|
242
|
+
...this._history,
|
|
243
|
+
...this._pending
|
|
244
|
+
], {
|
|
245
|
+
system
|
|
246
|
+
});
|
|
247
|
+
const blocks = yield* LanguageModel.streamText({
|
|
248
|
+
prompt: prompt2,
|
|
249
|
+
toolkit,
|
|
250
|
+
disableToolCallResolution: true
|
|
251
|
+
}).pipe(
|
|
252
|
+
// TOOD(dmaretskyi): Error mapping.
|
|
253
|
+
AiParser.parseResponse({
|
|
254
|
+
onBegin: () => observer.onBegin(),
|
|
255
|
+
onBlock: (block) => observer.onBlock(block),
|
|
256
|
+
onPart: (part) => observer.onPart(part),
|
|
257
|
+
onEnd: (summary) => observer.onEnd(summary)
|
|
258
|
+
}),
|
|
259
|
+
Stream.runCollect,
|
|
260
|
+
Effect3.map(Chunk.toArray)
|
|
261
|
+
);
|
|
262
|
+
const response = yield* submitMessage(Obj2.make(DataType2.Message, {
|
|
263
|
+
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
264
|
+
sender: {
|
|
265
|
+
role: "assistant"
|
|
266
|
+
},
|
|
267
|
+
blocks
|
|
268
|
+
}));
|
|
269
|
+
const toolCalls = getToolCalls(response);
|
|
270
|
+
if (toolCalls.length === 0) {
|
|
271
|
+
break;
|
|
272
|
+
} else if (!toolkit) {
|
|
273
|
+
throw new Error("No toolkit provided");
|
|
274
|
+
}
|
|
275
|
+
const toolResults = yield* Effect3.forEach(toolCalls, (toolCall) => {
|
|
276
|
+
return callTool(toolkit, toolCall).pipe(Effect3.provide(TracingService.layerSubframe((context) => ({
|
|
277
|
+
...context,
|
|
278
|
+
parentMessage: response.id,
|
|
279
|
+
toolCallId: toolCall.toolCallId
|
|
280
|
+
}))));
|
|
281
|
+
});
|
|
282
|
+
yield* submitMessage(Obj2.make(DataType2.Message, {
|
|
283
|
+
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
284
|
+
sender: {
|
|
285
|
+
role: "tool"
|
|
286
|
+
},
|
|
287
|
+
blocks: toolResults
|
|
288
|
+
}));
|
|
289
|
+
} while (true);
|
|
290
|
+
log2("done", {
|
|
291
|
+
pending: this._pending.length
|
|
292
|
+
}, {
|
|
293
|
+
F: __dxlog_file2,
|
|
294
|
+
L: 174,
|
|
295
|
+
S: this,
|
|
296
|
+
C: (f, a) => f(...a)
|
|
297
|
+
});
|
|
298
|
+
return this._pending;
|
|
299
|
+
}).pipe(this._semaphore.withPermits(1), Effect3.withSpan("AiSession.run"));
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
var createSnippet = (text, len = 32) => text.length <= len * 2 ? text : [
|
|
303
|
+
text.slice(0, len),
|
|
304
|
+
"...",
|
|
305
|
+
text.slice(-len)
|
|
306
|
+
].join("");
|
|
307
|
+
|
|
308
|
+
// src/session/toolkit.ts
|
|
309
|
+
import { Toolkit } from "@effect/ai";
|
|
310
|
+
import { Effect as Effect4 } from "effect";
|
|
311
|
+
import { ToolExecutionService, ToolResolverService } from "@dxos/ai";
|
|
312
|
+
import { isTruthy } from "@dxos/util";
|
|
313
|
+
var createToolkit = ({ toolkit: toolkitParam, toolIds = [], blueprints = [] }) => Effect4.gen(function* () {
|
|
314
|
+
const blueprintToolkit = yield* ToolResolverService.resolveToolkit([
|
|
315
|
+
...blueprints.flatMap(({ tools }) => tools),
|
|
316
|
+
...toolIds
|
|
317
|
+
]);
|
|
318
|
+
const blueprintToolkitHandler = yield* blueprintToolkit.toContext(ToolExecutionService.handlersFor(blueprintToolkit));
|
|
319
|
+
const toolkit = Toolkit.merge(...[
|
|
320
|
+
toolkitParam,
|
|
321
|
+
blueprintToolkit
|
|
322
|
+
].filter(isTruthy));
|
|
323
|
+
return yield* toolkit.pipe(Effect4.provide(blueprintToolkitHandler));
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// src/session/version-pin.ts
|
|
327
|
+
import { Schema } from "effect";
|
|
328
|
+
import { getVersion } from "@dxos/echo-db";
|
|
329
|
+
import { ObjectId } from "@dxos/echo-schema";
|
|
330
|
+
function _define_property2(obj, key, value) {
|
|
331
|
+
if (key in obj) {
|
|
332
|
+
Object.defineProperty(obj, key, {
|
|
333
|
+
value,
|
|
334
|
+
enumerable: true,
|
|
335
|
+
configurable: true,
|
|
336
|
+
writable: true
|
|
337
|
+
});
|
|
338
|
+
} else {
|
|
339
|
+
obj[key] = value;
|
|
340
|
+
}
|
|
341
|
+
return obj;
|
|
342
|
+
}
|
|
343
|
+
var _class;
|
|
344
|
+
var ObjectVersionSchema = Schema.Unknown;
|
|
345
|
+
var VersionPinSchema = Schema.Struct({
|
|
346
|
+
// TODO(dmaretskyi): Use Ref when those support encoding.
|
|
347
|
+
objectId: ObjectId,
|
|
348
|
+
// TODO(dmaretskyi): Could be opaque.
|
|
349
|
+
version: ObjectVersionSchema
|
|
350
|
+
});
|
|
351
|
+
var VersionPin = (_class = class extends VersionPinSchema {
|
|
352
|
+
static fromObject(object) {
|
|
353
|
+
return VersionPin.make({
|
|
354
|
+
objectId: object.id,
|
|
355
|
+
version: getVersion(object)
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
static createBlock(pin) {
|
|
359
|
+
return {
|
|
360
|
+
_tag: "json",
|
|
361
|
+
disposition: VersionPin.DISPOSITION,
|
|
362
|
+
data: JSON.stringify(pin)
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
}, _define_property2(_class, "DISPOSITION", "version-pin"), _class);
|
|
366
|
+
|
|
367
|
+
export {
|
|
368
|
+
ArtifactDiffResolver,
|
|
369
|
+
GenerationObserver,
|
|
370
|
+
AiModelError,
|
|
371
|
+
AiAssistantError,
|
|
372
|
+
AiSession,
|
|
373
|
+
createToolkit,
|
|
374
|
+
VersionPin
|
|
375
|
+
};
|
|
376
|
+
//# sourceMappingURL=chunk-GVKA7VL3.mjs.map
|