@dxos/assistant 0.8.4-main.e8ec1fe → 0.8.4-main.ef1bc66f44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/lib/neutral/chunk-ZPC54VRM.mjs +596 -0
  2. package/dist/lib/neutral/chunk-ZPC54VRM.mjs.map +7 -0
  3. package/dist/lib/{browser → neutral}/extraction/index.mjs +5 -5
  4. package/dist/lib/neutral/extraction/index.mjs.map +7 -0
  5. package/dist/lib/{browser → neutral}/index.mjs +320 -681
  6. package/dist/lib/neutral/index.mjs.map +7 -0
  7. package/dist/lib/neutral/meta.json +1 -0
  8. package/dist/lib/neutral/testing/index.mjs +38 -0
  9. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  10. package/dist/types/src/conversation/context.d.ts +97 -62
  11. package/dist/types/src/conversation/context.d.ts.map +1 -1
  12. package/dist/types/src/conversation/context.test.d.ts +2 -0
  13. package/dist/types/src/conversation/context.test.d.ts.map +1 -0
  14. package/dist/types/src/conversation/conversation.d.ts +40 -15
  15. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  16. package/dist/types/src/conversation/conversation.test.d.ts +2 -0
  17. package/dist/types/src/conversation/conversation.test.d.ts.map +1 -0
  18. package/dist/types/src/diff.d.ts +3 -1
  19. package/dist/types/src/diff.d.ts.map +1 -1
  20. package/dist/types/src/errors.d.ts +12 -16
  21. package/dist/types/src/errors.d.ts.map +1 -1
  22. package/dist/types/src/execution-graph.d.ts +2 -2
  23. package/dist/types/src/execution-graph.d.ts.map +1 -1
  24. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +247 -245
  25. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  26. package/dist/types/src/extraction/extraction.d.ts +342 -308
  27. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  28. package/dist/types/src/extraction/quotes.d.ts +2 -2
  29. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  30. package/dist/types/src/functions/services.d.ts +6 -7
  31. package/dist/types/src/functions/services.d.ts.map +1 -1
  32. package/dist/types/src/functions.test.d.ts +2 -0
  33. package/dist/types/src/functions.test.d.ts.map +1 -0
  34. package/dist/types/src/session/GenericToolkit.d.ts +23 -0
  35. package/dist/types/src/session/GenericToolkit.d.ts.map +1 -1
  36. package/dist/types/src/session/artifact-diff.d.ts +1 -1
  37. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  38. package/dist/types/src/session/format.d.ts +3 -3
  39. package/dist/types/src/session/format.d.ts.map +1 -1
  40. package/dist/types/src/session/index.d.ts +1 -0
  41. package/dist/types/src/session/index.d.ts.map +1 -1
  42. package/dist/types/src/session/observer.d.ts +4 -3
  43. package/dist/types/src/session/observer.d.ts.map +1 -1
  44. package/dist/types/src/session/session.d.ts +14 -9
  45. package/dist/types/src/session/session.d.ts.map +1 -1
  46. package/dist/types/src/session/toolkit.d.ts +5 -6
  47. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  48. package/dist/types/src/session/version-pin.d.ts +2 -2
  49. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  50. package/dist/types/src/testing/index.d.ts +2 -0
  51. package/dist/types/src/testing/index.d.ts.map +1 -0
  52. package/dist/types/src/testing/layer.d.ts +22 -0
  53. package/dist/types/src/testing/layer.d.ts.map +1 -0
  54. package/dist/types/src/types/artifact.d.ts +13 -5
  55. package/dist/types/src/types/artifact.d.ts.map +1 -1
  56. package/dist/types/tsconfig.tsbuildinfo +1 -1
  57. package/package.json +40 -33
  58. package/src/conversation/context.test.ts +46 -0
  59. package/src/conversation/context.ts +211 -67
  60. package/src/conversation/conversation.test.ts +65 -0
  61. package/src/conversation/conversation.ts +123 -48
  62. package/src/diff.test.ts +35 -4
  63. package/src/diff.ts +13 -4
  64. package/src/errors.ts +2 -2
  65. package/src/execution-graph.test.ts +1 -1
  66. package/src/execution-graph.ts +4 -4
  67. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +7 -7
  68. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +1 -1
  69. package/src/extraction/extraction.ts +4 -4
  70. package/src/extraction/quotes.ts +4 -5
  71. package/src/functions/services.ts +55 -30
  72. package/src/functions.conversations.json +1 -0
  73. package/src/functions.test.ts +74 -0
  74. package/src/session/GenericToolkit.ts +30 -0
  75. package/src/session/artifact-diff.ts +1 -1
  76. package/src/session/format.test.ts +101 -38
  77. package/src/session/format.ts +12 -13
  78. package/src/session/index.ts +1 -0
  79. package/src/session/observer.ts +3 -1
  80. package/src/session/session.conversations.json +1 -1
  81. package/src/session/session.test.ts +26 -13
  82. package/src/session/session.ts +36 -14
  83. package/src/session/toolkit.ts +13 -22
  84. package/src/session/version-pin.ts +4 -3
  85. package/src/templates/instructions/format.tpl +0 -4
  86. package/src/testing/index.ts +5 -0
  87. package/src/testing/layer.ts +84 -0
  88. package/src/types/artifact.ts +31 -13
  89. package/dist/lib/browser/extraction/index.mjs.map +0 -7
  90. package/dist/lib/browser/index.mjs.map +0 -7
  91. package/dist/lib/browser/meta.json +0 -1
  92. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  93. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
  94. package/dist/lib/node-esm/extraction/index.mjs +0 -226
  95. package/dist/lib/node-esm/extraction/index.mjs.map +0 -7
  96. package/dist/lib/node-esm/index.mjs +0 -1291
  97. package/dist/lib/node-esm/index.mjs.map +0 -7
  98. package/dist/lib/node-esm/meta.json +0 -1
  99. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  100. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/conversation/context.ts", "../../../src/conversation/conversation.ts", "../../../src/diff.ts", "../../../src/execution-graph.ts", "../../../src/templates/system.ts", "raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/instructions/format.tpl?raw", "raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/instructions/system.tpl?raw"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, Registry } from '@effect-atom/atom-react';\nimport * as EArray from 'effect/Array';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Schema from 'effect/Schema';\n\nimport { Blueprint } from '@dxos/blueprints';\nimport { Resource } from '@dxos/context';\nimport { DXN, Obj, Query, type Ref, Type } from '@dxos/echo';\nimport { type Queue } from '@dxos/echo-db';\nimport { assertArgument } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { ComplexSet, isTruthy } from '@dxos/util';\n\n/**\n * Thread message that binds or unbinds contextual objects to a conversation.\n */\n// TODO(burdon): Move to @dxos/schema ContentBlock?\nexport const ContextBinding = Schema.Struct({\n blueprints: Schema.Struct({\n added: Schema.Array(Type.Ref(Blueprint.Blueprint)),\n removed: Schema.Array(Type.Ref(Blueprint.Blueprint)),\n }),\n\n objects: Schema.Struct({\n added: Schema.Array(Type.Ref(Type.Obj)),\n removed: Schema.Array(Type.Ref(Type.Obj)),\n }),\n}).pipe(\n Type.object({\n typename: 'dxos.org/type/ContextBinding',\n version: '0.1.0',\n }),\n);\n\nexport interface ContextBinding extends Schema.Schema.Type<typeof ContextBinding> {}\n\nexport type BindingProps = Partial<{\n blueprints: Ref.Ref<Blueprint.Blueprint>[];\n objects: Ref.Ref<Obj.Unknown>[];\n}>;\n\nexport class Bindings {\n readonly blueprints = new ComplexSet<Ref.Ref<Blueprint.Blueprint>>((ref) => ref.dxn.toString());\n\n // TODO(burdon): Some DXNs have the Space prefix so only compare the object ID.\n readonly objects = new ComplexSet<Ref.Ref<Obj.Unknown>>((ref) => ref.dxn.asEchoDXN()?.echoId);\n\n toJSON() {\n return {\n blueprints: EArray.fromIterable(this.blueprints).map((ref) => ref.dxn.toString()),\n objects: EArray.fromIterable(this.objects).map((ref) => ref.dxn.toString()),\n };\n }\n}\n\nexport type AiContextBinderOptions = {\n queue: Queue;\n registry?: Registry.Registry;\n};\n\n/**\n * Manages bindings of blueprints and objects to a conversation.\n */\n// TODO(burdon): Context should manage ephemeral state of bindings until prompt is issued?\nexport class AiContextBinder extends Resource {\n private readonly _blueprints = Atom.make<Blueprint.Blueprint[]>([]).pipe(Atom.keepAlive);\n private readonly _objects = Atom.make<Obj.Unknown[]>([]).pipe(Atom.keepAlive);\n private readonly _registry: Registry.Registry;\n private readonly _queue: Queue;\n\n constructor(options: AiContextBinderOptions) {\n super();\n assertArgument(options.queue, 'options.queue', 'Queue is required');\n this._queue = options.queue;\n this._registry = options.registry ?? Registry.make();\n }\n\n /**\n * Returns the blueprints atom for subscription.\n */\n get blueprints(): Atom.Atom<Blueprint.Blueprint[]> {\n return this._blueprints;\n }\n\n /**\n * Returns the objects atom for subscription.\n */\n get objects(): Atom.Atom<Obj.Unknown[]> {\n return this._objects;\n }\n\n /**\n * Gets the current blueprints value.\n */\n getBlueprints(): Blueprint.Blueprint[] {\n return this._registry.get(this._blueprints);\n }\n\n /**\n * Gets the current objects value.\n */\n getObjects(): Obj.Unknown[] {\n return this._registry.get(this._objects);\n }\n\n /**\n * Subscribe to changes in blueprints.\n */\n subscribeBlueprints(cb: (blueprints: Blueprint.Blueprint[]) => void): () => void {\n return this._registry.subscribe(this._blueprints, () => cb(this._registry.get(this._blueprints)));\n }\n\n /**\n * Subscribe to changes in objects.\n */\n subscribeObjects(cb: (objects: Obj.Unknown[]) => void): () => void {\n return this._registry.subscribe(this._objects, () => cb(this._registry.get(this._objects)));\n }\n\n protected override async _open(): Promise<void> {\n const query = this._queue.query(Query.type(ContextBinding));\n\n // Process initial state before returning.\n const initialResults = await query.run();\n await this._updateBindings(initialResults);\n\n // Subscribe to future changes.\n this._ctx.onDispose(\n query.subscribe(async () => {\n await this._updateBindings(query.results);\n }),\n );\n }\n\n private async _updateBindings(items: ContextBinding[]): Promise<void> {\n // Skip update if no items - preserve existing state set by bind().\n if (items.length === 0) {\n return;\n }\n\n const bindings = this._reduce(items);\n\n // Resolve references (loading them first if needed).\n const currentBlueprints = this._registry.get(this._blueprints);\n const currentObjects = this._registry.get(this._objects);\n const newBlueprints = await this._resolve(bindings.blueprints, currentBlueprints);\n const newObjects = await this._resolve(bindings.objects, currentObjects);\n\n // Atomic updates - subscribers notified automatically.\n this._registry.set(this._blueprints, newBlueprints);\n this._registry.set(this._objects, newObjects);\n\n log('updated bindings', {\n blueprints: newBlueprints.length,\n objects: newObjects.length,\n });\n }\n\n protected override async _close(): Promise<void> {\n // Reset atoms to empty state.\n this._registry.set(this._blueprints, []);\n this._registry.set(this._objects, []);\n }\n\n async bind({ blueprints, objects }: BindingProps): Promise<void> {\n const currentBlueprints = this._registry.get(this._blueprints);\n const currentObjects = this._registry.get(this._objects);\n\n const { added: addedBlueprints, next: nextBlueprints } = this._processBindings(blueprints, currentBlueprints);\n const { added: addedObjects, next: nextObjects } = this._processBindings(objects, currentObjects);\n if (!addedBlueprints.length && !addedObjects.length) {\n return;\n }\n\n // Atomic updates - subscribers notified automatically.\n this._registry.set(this._blueprints, nextBlueprints);\n this._registry.set(this._objects, nextObjects);\n\n log('bind', { blueprints: addedBlueprints.length, objects: addedObjects.length });\n await this._queue.append([\n Obj.make(ContextBinding, {\n blueprints: {\n added: addedBlueprints,\n removed: [],\n },\n objects: {\n added: addedObjects,\n removed: [],\n },\n }),\n ]);\n }\n\n async unbind({ blueprints, objects }: BindingProps): Promise<void> {\n if (!blueprints?.length && !objects?.length) {\n return;\n }\n\n log('unbind', { blueprints: blueprints?.length, objects: objects?.length });\n await this._queue.append([\n Obj.make(ContextBinding, {\n blueprints: {\n added: [],\n removed: blueprints ?? [],\n },\n objects: {\n added: [],\n removed: objects ?? [],\n },\n }),\n ]);\n }\n\n /**\n * Process bindings to filter duplicates and determine next state.\n */\n private _processBindings<T extends Obj.Unknown>(\n refs: Ref.Ref<T>[] | undefined,\n current: T[],\n ): { added: Ref.Ref<T>[]; next: T[] } {\n const next = [...current];\n const added: Ref.Ref<T>[] = [];\n if (!refs?.length) {\n return { added, next };\n }\n\n const seen = new Set(current.map((obj) => Obj.getDXN(obj).toString()));\n for (const ref of refs) {\n const dxn = ref.dxn.toString();\n if (!seen.has(dxn)) {\n seen.add(dxn);\n added.push(ref);\n\n // Only resolve target if available (has target or resolver).\n if (ref.isAvailable) {\n const target = ref.target;\n if (target) {\n next.push(target);\n }\n }\n }\n }\n\n return { added, next };\n }\n\n /**\n * Reduce results into sets of blueprints and objects.\n */\n private _reduce(items: ContextBinding[]): Bindings {\n return Function.pipe(\n items,\n EArray.reduce(new Bindings(), (context, { blueprints, objects }) => {\n blueprints.added.forEach((ref) => context.blueprints.add(ref));\n blueprints.removed.forEach((ref) => context.blueprints.delete(ref));\n\n objects.added.forEach((ref) => context.objects.add(ref));\n objects.removed.forEach((ref) => {\n for (const obj of context.objects) {\n if (DXN.equalsEchoId(obj.dxn, ref.dxn)) {\n context.objects.delete(obj);\n }\n }\n });\n\n return context;\n }),\n );\n }\n\n /**\n * Resolve references to objects, loading them first if needed and falling back to existing objects.\n */\n private async _resolve<T>(refs: Iterable<Ref.Ref<T>>, current: T[]): Promise<T[]> {\n const refArray = [...refs];\n\n // Load all refs that need loading.\n await Promise.all(refArray.map((ref) => ref.load()));\n\n return refArray\n .map((ref) => {\n let target: T | undefined;\n // Only resolve target if available (has target or resolver).\n if (ref.isAvailable) {\n target = ref.target;\n }\n\n // Fallback to existing object.\n return target ?? current.find((obj) => Obj.getDXN(obj as any).toString() === ref.dxn.toString());\n })\n .filter(isTruthy);\n }\n}\n\nexport class AiContextService extends Context.Tag('@dxos/assistant/AiContextService')<\n AiContextService,\n {\n binder: AiContextBinder;\n }\n>() {\n static bindContext = ({ blueprints, objects }: BindingProps): Effect.Effect<void, never, AiContextService> =>\n Effect.gen(function* () {\n const { binder } = yield* AiContextService;\n yield* Effect.promise(() => binder.bind({ blueprints, objects }));\n });\n\n static findObjects = <T extends Type.Entity.Any>(\n type: T,\n ): Effect.Effect<Schema.Schema.Type<T>[], never, AiContextService> => {\n return Effect.gen(function* () {\n const { binder } = yield* AiContextService;\n return binder.getObjects().filter(Obj.instanceOf(type));\n });\n };\n\n /**\n * Glorified type cast until we figure out function service typing.\n * For context, the AiContextService is provided to functions called from tool calls, but it's not implemented in types yet.\n * @deprecated\n */\n static fixFunctionHandlerType = <A, E, R>(\n eff: Effect.Effect<A, E, R>,\n ): Effect.Effect<A, E, Exclude<R, AiContextService>> => eff as any;\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as Tool from '@effect/ai/Tool';\nimport type * as Toolkit from '@effect/ai/Toolkit';\nimport type { Registry } from '@effect-atom/atom-react';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport { type ToolExecutionService, type ToolResolverService } from '@dxos/ai';\nimport { Resource } from '@dxos/context';\nimport { Obj } from '@dxos/echo';\nimport { type Queue } from '@dxos/echo-db';\nimport { acquireReleaseResource } from '@dxos/effect';\nimport { QueueService } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { Message } from '@dxos/types';\n\nimport {\n AiSession,\n type AiSessionRunError,\n type AiSessionRunRequirements,\n type GenerationObserver,\n createToolkit,\n} from '../session';\n\nimport { AiContextBinder, AiContextService, type ContextBinding } from './context';\n\nexport interface AiConversationRunProps {\n prompt: string;\n system?: string;\n observer?: GenerationObserver;\n}\n\nexport type AiConversationOptions = {\n queue: Queue<Message.Message | ContextBinding>;\n toolkit?: Toolkit.Any;\n registry?: Registry.Registry;\n};\n\n/**\n * Durable conversation state (initiated by users and agents) backed by a Queue.\n * Executes tools based on AI responses and supports cancellation of in-progress requests.\n */\nexport class AiConversation extends Resource {\n /**\n * Blueprints and objects bound to the conversation.\n */\n private readonly _binder: AiContextBinder;\n private readonly _queue: Queue<Message.Message | ContextBinding>;\n private readonly _toolkit?: Toolkit.Any;\n\n public constructor(options: AiConversationOptions) {\n super();\n this._queue = options.queue;\n this._toolkit = options.toolkit;\n invariant(this._queue);\n this._binder = new AiContextBinder({ queue: this._queue, registry: options.registry });\n }\n\n protected override async _open(): Promise<void> {\n await this._binder.open(this._ctx);\n }\n\n public get queue() {\n return this._queue;\n }\n\n public get context() {\n return this._binder;\n }\n\n public get toolkit() {\n return this._toolkit;\n }\n\n public async getHistory(): Promise<Message.Message[]> {\n const queueItems = await this._queue.queryObjects(); // TODO(burdon): Update.\n return queueItems.filter(Obj.instanceOf(Message.Message));\n }\n\n getTools(): Effect.Effect<Record<string, Tool.Any>, never, ToolExecutionService | ToolResolverService> {\n return Effect.gen(this, function* () {\n const blueprints = this.context.getBlueprints();\n const tookit = yield* createToolkit({ toolkit: this._toolkit, blueprints });\n return tookit.tools;\n }).pipe(Effect.orDie);\n }\n\n /**\n * Creates a new cancelable request effect.\n */\n public createRequest(\n params: AiConversationRunProps,\n ): Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements> {\n return Effect.gen(this, function* () {\n const history = yield* Effect.promise(() => this.getHistory());\n\n // Create toolkit.\n const blueprints = this.context.getBlueprints();\n const toolkit = yield* createToolkit({\n toolkit: this._toolkit,\n blueprints,\n });\n\n // Context objects.\n const objects = this.context.getObjects();\n\n log('run', {\n history: history.length,\n blueprints: blueprints.length,\n tools: Object.keys(toolkit.tools).length,\n objects: objects.length,\n });\n\n // Process request.\n const session = new AiSession();\n const messages = yield* session.run({ history, blueprints, toolkit, objects, ...params }).pipe(\n Effect.provide(\n Layer.mergeAll(\n Layer.succeed(AiContextService, {\n binder: this.context,\n }),\n Layer.succeed(AiConversationService, this),\n ),\n ),\n );\n\n log('result', {\n messages: messages.length,\n duration: session.duration,\n toolCalls: session.toolCalls,\n });\n\n // Append to queue.\n yield* Effect.promise(() => this._queue.append(messages));\n return messages;\n });\n }\n}\n\n/**\n * Gives access to the ai conversation.\n */\nexport class AiConversationService extends Context.Tag('@dxos/assistant/AiConversationService')<\n AiConversationService,\n AiConversation\n>() {\n /**\n * Create a new conversation layer from options.\n */\n static layer = (options: AiConversationOptions): Layer.Layer<AiConversationService | AiContextService> =>\n aiContextFromConversation.pipe(\n Layer.provideMerge(\n Layer.scoped(\n AiConversationService,\n Effect.gen(function* () {\n const conversation = yield* acquireReleaseResource(() => new AiConversation(options));\n return conversation;\n }),\n ),\n ),\n );\n\n /**\n * Create a new conversation with a new queue.\n */\n static layerNewQueue = (\n options?: Omit<AiConversationOptions, 'queue'>,\n ): Layer.Layer<AiConversationService | AiContextService, never, QueueService> =>\n Layer.unwrapScoped(\n Effect.gen(function* () {\n return AiConversationService.layer({\n ...options,\n queue: yield* QueueService.createQueue<Message.Message | ContextBinding>(),\n });\n }),\n );\n\n /**\n * Run a prompt in the current conversation.\n */\n static run = (\n params: AiConversationRunProps,\n ): Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements | AiConversationService> =>\n Effect.gen(function* () {\n const conversation = yield* AiConversationService;\n return yield* conversation.createRequest(params);\n });\n}\n\nconst aiContextFromConversation = Layer.effect(\n AiContextService,\n Effect.gen(function* () {\n const conversation = yield* AiConversationService;\n return {\n binder: conversation.context,\n };\n }),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { next as A, type Doc } from '@automerge/automerge';\n\nimport { DocAccessor, toCursorRange } from '@dxos/echo-db';\nimport { log } from '@dxos/log';\nimport { isNonNullable } from '@dxos/util';\n\n// Relevant info:\n// https://github.com/Minahil-official/GPT-4.1-Promting-Guide?tab=readme-ov-file#-apply-patch-tool-format-v4a-diff\n\n// TODO(burdon): Anthropic only.\n// https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool#example-str-replace-command\n// AI_TOOL_NOT_FOUND: str_replace_based_edit_tool\n// 'str_replace_based_edit_tool',\n\n// TOOD(burdon): Support append to end (no \"-\").\n\nexport type Diff = {\n match: string;\n replace: string;\n};\n\n/**\n * Convert a list of diffs into a list of operations.\n */\nexport const reduceDiffs = (diffs: readonly string[]): Diff[] => {\n return diffs.reduce<Diff[]>((acc, diff) => {\n const current = acc[acc.length - 1];\n const [op, ...rest] = diff.split(' ');\n switch (op) {\n case '-': {\n if (current && !current.match) {\n current.match += rest.join(' ');\n } else {\n acc.push({ match: rest.join(' '), replace: '' });\n }\n return acc;\n }\n case '+': {\n if (current && !current.replace) {\n current.replace += rest.join(' ');\n } else {\n acc.push({ match: '', replace: rest.join(' ') });\n }\n return acc;\n }\n default: {\n throw new Error(`Invalid diff format: each line must start with \"- \" or \"+ \", got: ${JSON.stringify(diff)}`);\n }\n }\n }, []);\n};\n\nexport const computeDiffsWithCursors = <T>(accessor: DocAccessor<T>, diffs: readonly string[]) => {\n return reduceDiffs(diffs)\n .map((diff) => {\n const text = DocAccessor.getValue<string>(accessor);\n const idx = text.indexOf(diff.match);\n if (idx !== -1) {\n return { cursor: toCursorRange(accessor, idx, idx + diff.match.length), text: diff.replace };\n }\n })\n .filter(isNonNullable);\n};\n\nexport const applyDiffs = <T>(\n accessor: DocAccessor<T>,\n diffs: readonly string[],\n { errorOnNotFound = false }: { errorOnNotFound?: boolean } = {},\n): string => {\n for (const diff of reduceDiffs(diffs)) {\n accessor.handle.change((doc: Doc<T>) => {\n const text = DocAccessor.getValue<string>(accessor);\n const idx = text.indexOf(diff.match);\n if (idx !== -1) {\n // TODO(burdon): Replace smallest substring.\n // NOTE: This only replaces the first match.\n A.splice(doc, accessor.path as A.Prop[], idx, diff.match.length, diff.replace);\n } else {\n if (errorOnNotFound) {\n throw new Error(`Diff not found: ${diff.match}`);\n } else {\n log.warn('diff not found', diff);\n }\n }\n });\n }\n\n return DocAccessor.getValue<string>(accessor);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { AgentStatus } from '@dxos/ai';\nimport { type Entity, Obj, type Ref } from '@dxos/echo';\nimport { MESSAGE_PROPERTY_TOOL_CALL_ID } from '@dxos/functions';\nimport { type ObjectId } from '@dxos/keys';\nimport { LogLevel } from '@dxos/log';\nimport { ContentBlock, Message } from '@dxos/types';\nimport { isNonNullable } from '@dxos/util';\n\nconst SKIP_BLOCKS: ContentBlock.Any['_tag'][] = ['text'];\n\n/**\n * Mercurial-style Commit.\n */\n// TODO(wittjosiah): Reconcile with @dxos/react-ui-components.\nexport type Commit = {\n id: string;\n parents: string[];\n branch: string;\n icon?: string;\n level?: LogLevel;\n message: string;\n timestamp?: Date;\n tags?: string[];\n};\n\n// TODO(burdon): Add colors?\nenum IconType {\n // General status.\n SUCCESS = 'ph--check-circle--regular',\n WARNING = 'ph--warning-circle--regular',\n ERROR = 'ph--x-circle--regular',\n FLAG = 'ph--flag--regular',\n ROCKET = 'ph--rocket--regular',\n TIMER = 'ph--timer--regular',\n\n // Interactions.\n USER = 'ph--user--regular',\n USER_INTERACTION = 'ph--user-sound--regular',\n AGENT = 'ph--robot--regular',\n THINKING = 'ph--brain--regular',\n LINK = 'ph--link--regular',\n TOOL = 'ph--wrench--regular',\n}\n\n/**\n * Models the execution graph based on a stream of events.\n */\nexport class ExecutionGraph {\n // TODO(dmaretskyi): Evolve the internal state to support chats, functions, circuit workflows, etc.\n private _commits: Commit[] = [];\n private _branchNames = new Set<string>();\n private _lastBlockId: string | undefined;\n\n // Tool call tracking.\n private _toolCallCommitIds = new Map<string, string>(); // toolCallId -> commitId\n private _lastCommitByBranch = new Map<string, string>(); // branch -> last commitId\n private _pendingToolResults = new Map<string, string>(); // toolCallId -> toolResultCommitId\n\n constructor(private readonly _skipBlocks: ContentBlock.Any['_tag'][] = SKIP_BLOCKS) {}\n\n /**\n * Adds events to the graph.\n */\n addEvents(events: Entity.Unknown[]) {\n const sortedEvents = this.sortObjectsByCreated(events);\n for (const event of sortedEvents) {\n if (Obj.instanceOf(Message.Message, event)) {\n this._processMessage(event);\n } else if (Obj.instanceOf(AgentStatus, event)) {\n this._processAgentStatus(event);\n }\n }\n }\n\n /**\n * Processes a message event and creates commits for its blocks.\n */\n private _processMessage(message: Message.Message) {\n const messageCommits = messageToCommits(\n message,\n this._lastBlockId,\n this._toolCallCommitIds,\n this._lastCommitByBranch,\n this._skipBlocks,\n );\n this._commits.push(...messageCommits);\n\n // Track branches.\n messageCommits.forEach((commit) => this._branchNames.add(commit.branch));\n\n // Track tool calls and update pending tool results.\n this._trackToolCalls(messageCommits);\n\n // Update last block ID for sequential chaining.\n if (messageCommits.length > 0) {\n this._lastBlockId = messageCommits[messageCommits.length - 1].id;\n }\n }\n\n /**\n * Processes an AgentStatus event.\n */\n private _processAgentStatus(event: AgentStatus) {\n const branch = this._getToolCallBranch(event.parentMessage, event.toolCallId);\n this._branchNames.add(branch);\n\n const agentStatusCommit: Commit = {\n id: event.id,\n branch,\n message: event.message,\n icon: IconType.FLAG,\n parents: this._getAgentStatusParents(event),\n timestamp: new Date(event.created),\n };\n\n this._commits.push(agentStatusCommit);\n\n // Update last block ID for sequential chaining.\n this._lastBlockId = event.id;\n\n // Update pending tool results to point to this AgentStatus.\n if (event.toolCallId) {\n this._lastCommitByBranch.set(branch, event.id);\n this._updatePendingToolResults(event.toolCallId, event.id);\n }\n }\n\n /**\n * Stable sort: objects with 'created' field are sorted by it, others remain in place.\n */\n private sortObjectsByCreated(objects: any[]) {\n const sortedObjects = objects.slice();\n // Find indices of objects with 'created'\n const createdObjects: { idx: number; obj: any }[] = [];\n sortedObjects.forEach((obj, idx) => {\n if (obj && typeof obj.created === 'string') {\n createdObjects.push({ idx, obj });\n }\n });\n // Sort only the objects with 'created' by their date, stable\n createdObjects.sort((a, b) => {\n const aDate = new Date(a.obj.created).getTime();\n const bDate = new Date(b.obj.created).getTime();\n return aDate - bDate;\n });\n // Place sorted createdObjects back into their original positions\n let createdIdx = 0;\n return sortedObjects.map((obj, _idx) => {\n if (obj && typeof obj.created === 'string') {\n return createdObjects[createdIdx++].obj;\n }\n return obj;\n });\n }\n\n /**\n * Returns the current state of the graph.\n */\n getGraph(lastRequest = false): { branches: string[]; commits: Commit[] } {\n const idx = lastRequest ? this._commits.findLastIndex((c) => c.tags?.includes('user')) : -1;\n const commits = idx === -1 ? this._commits : this._commits.slice(idx);\n\n return {\n branches: Array.from(this._branchNames),\n commits,\n };\n }\n\n /**\n * Tracks tool calls and handles pending tool result updates.\n */\n private _trackToolCalls(commits: Commit[]) {\n commits.forEach((commit) => {\n if (this._isToolCallCommit(commit)) {\n const toolCallId = this._extractToolCallId(commit.id);\n if (toolCallId) {\n this._toolCallCommitIds.set(toolCallId, commit.id);\n }\n }\n\n if (this._isToolResultCommit(commit)) {\n const toolCallId = this._extractToolCallId(commit.id);\n if (toolCallId) {\n this._pendingToolResults.set(toolCallId, commit.id);\n this._handleLateToolResultUpdate(toolCallId, commit.id);\n }\n }\n\n this._lastCommitByBranch.set(commit.branch, commit.id);\n });\n }\n\n /**\n * Updates pending tool results to point to an AgentStatus event.\n */\n private _updatePendingToolResults(toolCallId: string, agentStatusId: string) {\n const toolResultId = this._pendingToolResults.get(toolCallId);\n if (!toolResultId) return;\n\n const toolResultCommit = this._commits.find((c) => c.id === toolResultId);\n if (!toolResultCommit) return;\n\n const toolCallCommitId = this._toolCallCommitIds.get(toolCallId);\n if (!toolCallCommitId) return;\n\n // Replace tool call commit with AgentStatus commit.\n const toolCallIndex = toolResultCommit.parents.indexOf(toolCallCommitId);\n if (toolCallIndex !== -1) {\n toolResultCommit.parents[toolCallIndex] = agentStatusId;\n }\n\n this._pendingToolResults.delete(toolCallId);\n }\n\n /**\n * Handles late updates when AgentStatus is processed before tool result.\n */\n private _handleLateToolResultUpdate(toolCallId: string, toolResultId: string) {\n const toolCallCommitId = this._toolCallCommitIds.get(toolCallId);\n if (!toolCallCommitId) return;\n\n const messageId = toolCallCommitId.split('_toolCall_')[0];\n const toolCallBranch = `${messageId}_${toolCallId}`;\n const agentStatusCommitId = this._lastCommitByBranch.get(toolCallBranch);\n\n if (agentStatusCommitId && agentStatusCommitId !== toolCallCommitId) {\n const toolResultCommit = this._commits.find((c) => c.id === toolResultId);\n if (toolResultCommit) {\n const toolCallIndex = toolResultCommit.parents.indexOf(toolCallCommitId);\n if (toolCallIndex !== -1) {\n toolResultCommit.parents[toolCallIndex] = agentStatusCommitId;\n }\n }\n this._pendingToolResults.delete(toolCallId);\n }\n }\n\n /**\n * Gets the branch name for a tool call.\n */\n private _getToolCallBranch(parentMessage?: ObjectId, toolCallId?: string): string {\n if (toolCallId) {\n return toolCallId;\n }\n return parentMessage || 'main';\n }\n\n /**\n * Gets the parents for an AgentStatus commit.\n */\n private _getAgentStatusParents(event: AgentStatus): string[] {\n if (event.parentMessage && event.toolCallId) {\n return [getToolCallId(event.parentMessage, event.toolCallId)];\n }\n return [];\n }\n\n /**\n * Checks if a commit is a tool call commit.\n */\n private _isToolCallCommit(commit: Commit): boolean {\n return commit.message.includes('Calling tool');\n }\n\n /**\n * Checks if a commit is a tool result commit.\n */\n private _isToolResultCommit(commit: Commit): boolean {\n return commit.message.includes('Tool call succeeded') || commit.message.includes('Tool error:');\n }\n\n /**\n * Extracts tool call ID from a commit ID.\n */\n private _extractToolCallId(commitId: string): string | undefined {\n const toolCallMatch = commitId.match(/_toolCall_(.+)$/);\n const toolResultMatch = commitId.match(/_toolResult_(.+)$/);\n return toolCallMatch?.[1] || toolResultMatch?.[1];\n }\n}\n\n/**\n * Creates commits for all blocks in a message.\n */\n// TODO(burdon): Pass in AiToolProvider.\nconst messageToCommits = (\n message: Message.Message,\n lastBlockId?: string,\n toolCallIds?: Map<string, string>,\n lastCommitByBranch?: Map<string, string>,\n skipBlocks?: ContentBlock.Any['_tag'][],\n): Commit[] => {\n let previousBlockId: string | undefined = lastBlockId;\n\n return message.blocks\n .map((block, idx) => {\n const branch = getMessageBranch(message);\n const parents = getBlockParents(block, previousBlockId, message, toolCallIds, lastCommitByBranch);\n if (skipBlocks?.includes(block._tag)) {\n return null;\n }\n\n const commit = createBlockCommit(block, message, branch, parents, idx);\n if (commit) {\n previousBlockId = commit.id;\n }\n\n return commit;\n })\n .filter(isNonNullable);\n};\n\n/**\n * Determines the parent commits for a block based on its type and context.\n */\nconst getBlockParents = (\n block: ContentBlock.Any,\n previousBlockId: string | undefined,\n message: Message.Message,\n toolCallIds?: Map<string, string>,\n lastCommitByBranch?: Map<string, string>,\n): string[] => {\n const parents: string[] = [];\n\n if (block._tag === 'toolResult') {\n // Tool results have two parents: previous block and last block from tool call branch.\n if (previousBlockId) {\n parents.push(previousBlockId);\n }\n\n const toolCallCommitId = toolCallIds?.get(block.toolCallId);\n if (toolCallCommitId) {\n const toolCallBranch = getToolCallBranchFromCommitId(toolCallCommitId, block.toolCallId);\n const lastBlockFromToolCallBranch = lastCommitByBranch?.get(toolCallBranch);\n\n if (lastBlockFromToolCallBranch) {\n parents.push(lastBlockFromToolCallBranch);\n } else {\n // Fallback to tool call commit if no AgentStatus exists yet.\n parents.push(toolCallCommitId);\n }\n }\n } else {\n // For other blocks, use previous block as parent (or tool call parent for first block).\n if (previousBlockId) {\n parents.push(previousBlockId);\n } else {\n const toolCallParent = getParentId(message);\n if (toolCallParent) {\n parents.push(toolCallParent);\n }\n }\n }\n\n return parents;\n};\n\n/**\n * Creates a commit for a specific block.\n */\nconst createBlockCommit = (\n block: ContentBlock.Any,\n message: Message.Message,\n branch: string,\n parents: string[],\n idx: number,\n): Commit | null => {\n const timestamp = new Date(message.created);\n switch (block._tag) {\n case 'text':\n if (!block.text.trim().length) return null;\n return {\n id: getGenericBlockId(message.id, idx),\n branch,\n parents,\n timestamp,\n ...(message.sender.role === 'user'\n ? {\n icon: IconType.USER,\n tags: ['user'],\n message: 'Processing request...',\n }\n : {\n icon: IconType.AGENT,\n message: `Response (${block.text.split(' ').length} words)`,\n }),\n } satisfies Commit;\n\n case 'toolCall':\n return {\n id: getToolCallId(message.id, block.toolCallId),\n branch,\n parents,\n timestamp,\n icon: IconType.TOOL,\n level: LogLevel.INFO,\n message: `Calling tool (${block.name})`,\n } satisfies Commit;\n\n case 'toolResult':\n return {\n id: getToolResultId(message.id, block.toolCallId),\n branch,\n parents,\n timestamp,\n icon: block.error ? IconType.ERROR : IconType.SUCCESS,\n level: block.error ? LogLevel.ERROR : LogLevel.INFO,\n message: block.error ? 'Tool error: ' + block.error : 'Tool call succeeded',\n } satisfies Commit;\n\n case 'summary':\n return {\n id: getGenericBlockId(message.id, idx),\n branch,\n parents,\n timestamp,\n icon: IconType.ROCKET,\n level: LogLevel.INFO,\n message: ContentBlock.createSummaryMessage(block),\n } satisfies Commit;\n\n case 'status':\n return {\n id: getGenericBlockId(message.id, idx),\n branch,\n parents,\n timestamp,\n message: block.statusText,\n level: LogLevel.INFO,\n icon: IconType.FLAG,\n } satisfies Commit;\n\n case 'reasoning':\n return {\n id: getGenericBlockId(message.id, idx),\n branch,\n parents,\n timestamp,\n message: block.reasoningText ?? 'Thinking...',\n icon: IconType.THINKING,\n } satisfies Commit;\n\n case 'reference':\n return {\n id: getGenericBlockId(message.id, idx),\n branch,\n parents,\n timestamp,\n icon: IconType.LINK,\n message: stringifyRef(block.reference),\n } satisfies Commit;\n\n default:\n return null;\n }\n};\n\n/**\n * Gets the tool call branch name from a tool call commit ID.\n */\nconst getToolCallBranchFromCommitId = (toolCallCommitId: string, toolCallId: string): string => {\n const messageId = toolCallCommitId.split('_toolCall_')[0];\n return `${messageId}_${toolCallId}`;\n};\n\nconst getToolCallId = (messageId: ObjectId, toolCallId: string) => `${messageId}_toolCall_${toolCallId}`;\nconst getToolResultId = (messageId: ObjectId, toolCallId: string) => `${messageId}_toolResult_${toolCallId}`;\nconst getGenericBlockId = (messageId: ObjectId, idx: number) => `${messageId}_block_${idx}`;\n\nconst getBranchName = (options: { parentMessage?: ObjectId; toolCallId?: string }) => {\n if (options.toolCallId) {\n return options.toolCallId;\n } else if (options.parentMessage) {\n return options.parentMessage;\n } else {\n return 'main';\n }\n};\n\nconst getMessageBranch = (message: Message.Message) => {\n return getBranchName({\n parentMessage: message.parentMessage,\n toolCallId: message.properties?.[MESSAGE_PROPERTY_TOOL_CALL_ID],\n });\n};\n\nconst getParentId = (message: Message.Message) => {\n if (message.parentMessage && message.properties?.[MESSAGE_PROPERTY_TOOL_CALL_ID]) {\n return getToolCallId(message.parentMessage, message.properties[MESSAGE_PROPERTY_TOOL_CALL_ID]);\n } else {\n return undefined;\n }\n};\n\nconst stringifyRef = (ref: Ref.Unknown) => {\n if (ref.target) {\n return stringifyObject(ref.target);\n }\n\n return ref.dxn.asEchoDXN()?.echoId ?? ref.dxn.asQueueDXN()?.objectId ?? '';\n};\n\nconst stringifyObject = (obj: Obj.Unknown) => {\n return Obj.getLabel(obj) ?? Obj.getTypename(obj) ?? obj.id;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport defaultsDeep from 'lodash.defaultsdeep';\n\nimport { type ModelCapabilities } from '@dxos/ai';\nimport { Template } from '@dxos/blueprints';\n\nimport FORMAT from './instructions/format.tpl?raw';\nimport SYSTEM from './instructions/system.tpl?raw';\n\n/**\n * System template variables.\n */\nexport type SystemPromptOptions = ModelCapabilities & {\n DATETIME: string;\n};\n\n/**\n * Base system prompt.\n * NOTE: This contains protocol instructions that can not be dynamically edited.\n */\nexport const createSystemPrompt = (options: Partial<SystemPromptOptions> = {}) =>\n Template.process<SystemPromptOptions>(\n FORMAT,\n defaultsDeep(options, {\n DATETIME: new Date().toISOString(),\n }),\n );\n\nexport const templates = {\n /** Editable system prompt.*/\n system: Template.make({\n /**\n * NOTE: We are forbidden from accessing randomness at model level in cloudflare, so we have to have pre-generated ids.\n */\n id: '01K2J2FZWH39F55CS7B26GP1Q3',\n source: SYSTEM,\n }),\n};\n", "{{! System Core }}\n\n## Input Formats\n\n### Blueprints\n\nYou may be provided with Blueprint definitions that include specific instructions and tools for a given set of tasks.\nBlue print instructions will be enclosed in a <blueprint> tag.\n\n### Context objects\n\nYou may be provided with references to objects that are relevant to the current prompt.\nObjects will be in the form of a <object> tag with a <dxn> element that is the unique key of the object required by many tools.\nThe <typename> element is the type of the object.\n\n<object>\n <dxn>object-id</dxn>\n <typename>example.com/type/TypeName</typename>\n</object>\n\n## Response Formats\n\nIt is very important to respond in the correct format.\nYou response must be valid Markdown.\nIn some cases you should respond with well-formed XML tags along with the content.\nCode snippets should use 2-space indents.\n\n{{#if cot}}\nBefore responding, explain your reasoning and include your detailed chain-of-thought enclosed in a <cot> tag.\nThe <cot> tag should be the first thing in your response.\n{{/if}}\n\n## Block references\n\nYou can reply with a block reference for objects if you have the DXN. For example:\n\n<object>\n <dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M</dxn>\n</object>\n<object>\n <dxn>dxn:echo:@:01K24XPK464FSCKVQJAB2H662M</dxn>\n</object>\n\n### Suggestions\n\nEach suggestion must in the form of a proposed action enclosed in a <suggestion> tag.\nExample: <suggestion>Show on a map</suggestion>\nDo not use bullets when listing suggestions.\n\n### Multiple choice questions\n\nYou may ask multiple choice questions by wrapping consise options inside <option> tags inside a well formed <select> tag.\nExample: <select><option>Yes</option><option>No</option></select>\n\n## Context\n\nThe current date and time is {{DATETIME}}.\n", "{{! System Prompt }}\n\n- You are a helpful assistant called Kai. \n- Your name is Kai and you are powered by different language models.\n- You were created by DXOS and operate inside of Composer and on the DXOS EDGE network.\n- In your initial greeting state your name and make some suggestions based on the current context objects.\n- You are an advanced AI assistant capable of creating and managing artifacts from provided data and tools.\n- Your task is to process user commands and questions and decide how best to respond.\n- In general be concise and direct.\n- Follow all instructions carefully.\n\n## Planning\n\n- Analyze the structure and type of the content in the user's message.\n- Determine if you complete the task using the available blueprint definitions?\n- If you can't complete the task using the available blueprint definitions, query the list of available blueprint definitions using the appropriate tool.\n- Identify which blueprint definitions are relevant to the user's request.\n- Evaluate the potential benefits of creating an artifact vs. normal processing for each identified element.\n- Make a final decision on whether to create an artifact and explain your reasoning.\n- Are the required blueprint definitions already available?\n- If not, select which blueprint definition(s) will be the most relevant and require them using the require_artifact_definitions tool.\n- The require'd artifact tools will be available for use after require.\n- If creating an artifact, outline how you will structure it within the response.\n- Decide if the artifact needs to be shown to the user.\n- Call the show tool to show the artifact to the user.\n- Your reasoning must include: whether to use artifacts or not, to create one or query, whether to show the artifact to the user, and how to structure the response.\n\n## Blueprints and Artifacts\n\n- Determine if the interaction involves an artifact. Prefer artifacts for tables, lists, spreadsheets, kanbans, games, images, and other structured data.\n- Determine if the user is explicitly talking about creating a new artifact, or wants to use an existing artifact.\n- If it is ambiguous, query for existing artifacts first and then decide.\n- If you decide to create an artifact, call the associated tool to create the artifact.\n- Artifacts are stored in the database. Tools are used to create and query artifacts.\n- If you are unsure about creating an artifact ask the user for clarification.\n- Artifacts are mutable objects that can change over the course of the conversation.\n- Always re-query the artifact using the tool (like query or inspect) to get the latest state of the artifact before answering the user.\n- You must never generate the id of the artifact; only recall the ids that are already in the history.\n- Artifacts are created by requiring the specific artifact using the require_artifact tool and creating it by calling the associated tool.\n- You can add suggested actions at the end of your response.\n- Suggested actions should be very concise and start with a verb and be phrased as a command to an agent -- not a question to the user.\n- Suggested actions must be in the form of a user instruction that you can follow.\n- Suggested actions could include actions that create artifacts.\n- After creating an artifact use a tool to add it to the chat context.\n\n## Context\n\nToday is {{DATETIME}}.\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,MAAMC,gBAAgB;AAC/B,YAAYC,YAAY;AACxB,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AACzB,SAASC,KAAKC,KAAKC,OAAiBC,YAAY;AAEhD,SAASC,sBAAsB;AAC/B,SAASC,WAAW;AACpB,SAASC,YAAYC,gBAAgB;;AAM9B,IAAMC,iBAAwBC,cAAO;EAC1CC,YAAmBD,cAAO;IACxBE,OAAcC,aAAMT,KAAKU,IAAIf,UAAUA,SAAS,CAAA;IAChDgB,SAAgBF,aAAMT,KAAKU,IAAIf,UAAUA,SAAS,CAAA;EACpD,CAAA;EAEAiB,SAAgBN,cAAO;IAC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CAACC,YAAAA;AACrB,MAAIA,QAAQ7F,YAAY;AACtB,WAAO6F,QAAQ7F;EACjB,WAAW6F,QAAQ9F,eAAe;AAChC,WAAO8F,QAAQ9F;EACjB,OAAO;AACL,WAAO;EACT;AACF;AAEA,IAAMiE,mBAAmB,CAAC7E,YAAAA;AACxB,SAAOyG,cAAc;IACnB7F,eAAeZ,QAAQY;IACvBC,YAAYb,QAAQ2G,aAAaC,6BAAAA;EACnC,CAAA;AACF;AAEA,IAAMtB,cAAc,CAACtF,YAAAA;AACnB,MAAIA,QAAQY,iBAAiBZ,QAAQ2G,aAAaC,6BAAAA,GAAgC;AAChF,WAAO3C,cAAcjE,QAAQY,eAAeZ,QAAQ2G,WAAWC,6BAAAA,CAA8B;EAC/F,OAAO;AACL,WAAOC;EACT;AACF;AAEA,IAAMN,eAAe,CAACO,QAAAA;AACpB,MAAIA,IAAIC,QAAQ;AACd,WAAOC,gBAAgBF,IAAIC,MAAM;EACnC;AAEA,SAAOD,IAAIG,IAAIC,UAAS,GAAIC,UAAUL,IAAIG,IAAIG,WAAU,GAAIC,YAAY;AAC1E;AAEA,IAAML,kBAAkB,CAACrF,QAAAA;AACvB,SAAOjC,KAAI4H,SAAS3F,GAAAA,KAAQjC,KAAI6H,YAAY5F,GAAAA,KAAQA,IAAIjB;AAC1D;;;ACxfA,OAAO8G,kBAAkB;AAGzB,SAASC,gBAAgB;;;ACPzB;;;ACAA;;;AFuBO,IAAMC,qBAAqB,CAACC,UAAwC,CAAC,MAC1EC,SAASC,QACPC,gBACAC,aAAaJ,SAAS;EACpBK,WAAU,oBAAIC,KAAAA,GAAOC,YAAW;AAClC,CAAA,CAAA;AAGG,IAAMC,YAAY;;EAEvBC,QAAQR,SAASS,KAAK;;;;IAIpBC,IAAI;IACJC,QAAQC;EACV,CAAA;AACF;",
6
+ "names": ["Atom", "Registry", "EArray", "Context", "Effect", "Function", "Schema", "Blueprint", "Resource", "DXN", "Obj", "Query", "Type", "assertArgument", "log", "ComplexSet", "isTruthy", "ContextBinding", "Struct", "blueprints", "added", "Array", "Ref", "removed", "objects", "pipe", "object", "typename", "version", "Bindings", "ref", "dxn", "toString", "asEchoDXN", "echoId", "toJSON", "fromIterable", "map", "AiContextBinder", "_blueprints", "make", "keepAlive", "_objects", "_registry", "_queue", "options", "queue", "registry", "getBlueprints", "get", "getObjects", "subscribeBlueprints", "cb", "subscribe", "subscribeObjects", "_open", "query", "type", "initialResults", "run", "_updateBindings", "_ctx", "onDispose", "results", "items", "length", "bindings", "_reduce", "currentBlueprints", "currentObjects", "newBlueprints", "_resolve", "newObjects", "set", "_close", "bind", "addedBlueprints", "next", "nextBlueprints", "_processBindings", "addedObjects", "nextObjects", "append", "unbind", "refs", "current", "seen", "Set", "obj", "getDXN", "has", "add", "push", "isAvailable", "target", "reduce", "context", "forEach", "delete", "equalsEchoId", "refArray", "Promise", "all", "load", "find", "filter", "AiContextService", "Tag", "bindContext", "gen", "binder", "promise", "findObjects", "instanceOf", "fixFunctionHandlerType", "eff", "Context", "Effect", "Layer", "Resource", "Obj", "acquireReleaseResource", "QueueService", "invariant", "log", "Message", "AiConversation", "Resource", "_binder", "_queue", "_toolkit", "options", "queue", "toolkit", "invariant", "AiContextBinder", "registry", "_open", "open", "_ctx", "context", "getHistory", "queueItems", "queryObjects", "filter", "Obj", "instanceOf", "Message", "getTools", "gen", "blueprints", "getBlueprints", "tookit", "createToolkit", "tools", "pipe", "orDie", "createRequest", "params", "history", "promise", "objects", "getObjects", "log", "length", "Object", "keys", "session", "AiSession", "messages", "run", "provide", "mergeAll", "succeed", "AiContextService", "binder", "AiConversationService", "duration", "toolCalls", "append", "Tag", "layer", "aiContextFromConversation", "provideMerge", "scoped", "conversation", "acquireReleaseResource", "layerNewQueue", "unwrapScoped", "QueueService", "createQueue", "effect", "next", "A", "DocAccessor", "toCursorRange", "log", "isNonNullable", "reduceDiffs", "diffs", "reduce", "acc", "diff", "current", "length", "op", "rest", "split", "match", "join", "push", "replace", "Error", "JSON", "stringify", "computeDiffsWithCursors", "accessor", "map", "text", "getValue", "idx", "indexOf", "cursor", "filter", "applyDiffs", "errorOnNotFound", "handle", "change", "doc", "splice", "path", "warn", "AgentStatus", "Obj", "MESSAGE_PROPERTY_TOOL_CALL_ID", "LogLevel", "ContentBlock", "Message", "isNonNullable", "SKIP_BLOCKS", "ExecutionGraph", "_commits", "_branchNames", "Set", "_lastBlockId", "_toolCallCommitIds", "Map", "_lastCommitByBranch", "_pendingToolResults", "_skipBlocks", "SKIP_BLOCKS", "addEvents", "events", "sortedEvents", "sortObjectsByCreated", "event", "Obj", "instanceOf", "Message", "_processMessage", "AgentStatus", "_processAgentStatus", "message", "messageCommits", "messageToCommits", "push", "forEach", "commit", "add", "branch", "_trackToolCalls", "length", "id", "_getToolCallBranch", "parentMessage", "toolCallId", "agentStatusCommit", "icon", "parents", "_getAgentStatusParents", "timestamp", "Date", "created", "set", "_updatePendingToolResults", "objects", "sortedObjects", "slice", "createdObjects", "obj", "idx", "sort", "a", "b", "aDate", "getTime", "bDate", "createdIdx", "map", "_idx", "getGraph", "lastRequest", "findLastIndex", "c", "tags", "includes", "commits", "branches", "Array", "from", "_isToolCallCommit", "_extractToolCallId", "_isToolResultCommit", "_handleLateToolResultUpdate", "agentStatusId", "toolResultId", "get", "toolResultCommit", "find", "toolCallCommitId", "toolCallIndex", "indexOf", "delete", "messageId", "split", "toolCallBranch", "agentStatusCommitId", "getToolCallId", "commitId", "toolCallMatch", "match", "toolResultMatch", "lastBlockId", "toolCallIds", "lastCommitByBranch", "skipBlocks", "previousBlockId", "blocks", "block", "getMessageBranch", "getBlockParents", "_tag", "createBlockCommit", "filter", "isNonNullable", "getToolCallBranchFromCommitId", "lastBlockFromToolCallBranch", "toolCallParent", "getParentId", "text", "trim", "getGenericBlockId", "sender", "role", "level", "LogLevel", "INFO", "name", "getToolResultId", "error", "ERROR", "ContentBlock", "createSummaryMessage", "statusText", "reasoningText", "stringifyRef", "reference", "getBranchName", "options", "properties", "MESSAGE_PROPERTY_TOOL_CALL_ID", "undefined", "ref", "target", "stringifyObject", "dxn", "asEchoDXN", "echoId", "asQueueDXN", "objectId", "getLabel", "getTypename", "defaultsDeep", "Template", "createSystemPrompt", "options", "Template", "process", "FORMAT", "defaultsDeep", "DATETIME", "Date", "toISOString", "templates", "system", "make", "id", "source", "SYSTEM"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/conversation/context.ts":{"bytes":34702,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Array","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/session/artifact-diff.ts":{"bytes":2584,"imports":[{"path":"effect/Context","kind":"import-statement","external":true}],"format":"esm"},"src/session/observer.ts":{"bytes":5545,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true}],"format":"esm"},"src/errors.ts":{"bytes":1412,"imports":[{"path":"@dxos/errors","kind":"import-statement","external":true}],"format":"esm"},"src/session/format.ts":{"bytes":16498,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"effect/Option","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/log","kind":"import-statement","external":true},{"path":"@dxos/types","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":25668,"imports":[{"path":"@effect/ai/LanguageModel","kind":"import-statement","external":true},{"path":"effect/Chunk","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Stream","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/types","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":4007,"imports":[{"path":"@effect/ai/Toolkit","kind":"import-statement","external":true},{"path":"effect/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":4167,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/session/GenericToolkit.ts":{"bytes":9447,"imports":[{"path":"@effect/ai/Toolkit","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Pipeable","kind":"import-statement","external":true}],"format":"esm"},"src/session/index.ts":{"bytes":1106,"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"},{"path":"src/session/format.ts","kind":"import-statement","original":"./format"},{"path":"src/session/GenericToolkit.ts","kind":"import-statement","original":"./GenericToolkit"}],"format":"esm"},"src/conversation/conversation.ts":{"bytes":18652,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","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/types","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":9957,"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":51089,"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/types","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/artifact.ts":{"bytes":10624,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":456,"imports":[{"path":"src/types/artifact.ts","kind":"import-statement","original":"./artifact"}],"format":"esm"},"src/functions/services.ts":{"bytes":22415,"imports":[{"path":"@effect/ai/Tool","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"effect/Schema","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":"src/session/index.ts","kind":"import-statement","original":"../session"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"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/instructions/format.tpl?raw":{"bytes":1827,"imports":[]},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/instructions/system.tpl?raw":{"bytes":3351,"imports":[]},"src/templates/system.ts":{"bytes":3189,"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/instructions/format.tpl?raw","kind":"import-statement","original":"./instructions/format.tpl?raw"},{"path":"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/instructions/system.tpl?raw","kind":"import-statement","original":"./instructions/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/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/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/extraction/extraction.ts":{"bytes":6865,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"format":"esm"},"src/extraction/extraction-llm-function/extraction-llm-function.ts":{"bytes":6754,"imports":[{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/extraction/extraction.ts","kind":"import-statement","original":"../extraction"}],"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/extraction-ner-function.ts":{"bytes":6222,"imports":[{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/extraction/extraction.ts","kind":"import-statement","original":"../extraction"}],"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/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/quotes.ts":{"bytes":7035,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","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/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"},"src/testing/layer.ts":{"bytes":9140,"imports":[{"path":"@effect-atom/atom","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/ai/testing","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions-runtime","kind":"import-statement","external":true},{"path":"@dxos/functions-runtime/testing","kind":"import-statement","external":true},{"path":"src/functions/index.ts","kind":"import-statement","original":"../functions"},{"path":"src/session/index.ts","kind":"import-statement","original":"../session"}],"format":"esm"},"src/testing/index.ts":{"bytes":451,"imports":[{"path":"src/testing/layer.ts","kind":"import-statement","original":"./layer"}],"format":"esm"}},"outputs":{"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":64436},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-ZPC54VRM.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Array","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","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/types","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/types","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true}],"exports":["AiAssistantError","AiContextBinder","AiContextService","AiConversation","AiConversationService","AiModelError","AiSession","ArtifactDiffResolver","ArtifactId","Bindings","ContextBinding","ExecutionGraph","GenerationObserver","GenericToolkit","RefFromLLM","ToolExecutionServices","VersionPin","applyDiffs","computeDiffsWithCursors","createArtifactElement","createSystemPrompt","createToolkit","formatSystemPrompt","formatUserPrompt","makeToolExecutionServiceFromFunctions","makeToolResolverFromFunctions","reduceDiffs","templates"],"entryPoint":"src/index.ts","inputs":{"src/conversation/context.ts":{"bytesInOutput":8012},"src/conversation/index.ts":{"bytesInOutput":0},"src/conversation/conversation.ts":{"bytesInOutput":4203},"src/index.ts":{"bytesInOutput":0},"src/diff.ts":{"bytesInOutput":2190},"src/execution-graph.ts":{"bytesInOutput":11999},"src/templates/system.ts":{"bytesInOutput":540},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/instructions/format.tpl?raw":{"bytesInOutput":1909},"raw-loader:/__w/dxos/dxos/packages/core/assistant/src/templates/instructions/system.tpl?raw":{"bytesInOutput":3424},"src/templates/index.ts":{"bytesInOutput":0}},"bytes":33684},"dist/lib/neutral/extraction/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17558},"dist/lib/neutral/extraction/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@xenova/transformers","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["ExtractionInput","ExtractionOutput","ReferencedQuotes","combineNerTokens","createTokenGroups","extractFullEntities","extractionAnthropicFunction","extractionNerFunction","findQuotes","getNer","insertReferences","processTranscriptMessage"],"entryPoint":"src/extraction/index.ts","inputs":{"src/extraction/extraction.ts":{"bytesInOutput":1365},"src/extraction/index.ts":{"bytesInOutput":0},"src/extraction/extraction-llm-function/extraction-llm-function.ts":{"bytesInOutput":455},"src/extraction/extraction-llm-function/index.ts":{"bytesInOutput":0},"src/extraction/extraction-ner-function/extraction-ner-function.ts":{"bytesInOutput":431},"src/extraction/extraction-ner-function/index.ts":{"bytesInOutput":0},"src/extraction/extraction-ner-function/named-entity-recognition.ts":{"bytesInOutput":2276},"src/extraction/quotes.ts":{"bytesInOutput":1660}},"bytes":6789},"dist/lib/neutral/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5192},"dist/lib/neutral/testing/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-ZPC54VRM.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/ai/testing","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions-runtime","kind":"import-statement","external":true},{"path":"@dxos/functions-runtime/testing","kind":"import-statement","external":true}],"exports":["AssistantTestLayer","AssistantTestLayerWithTriggers"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/layer.ts":{"bytesInOutput":1895},"src/testing/index.ts":{"bytesInOutput":0}},"bytes":2145},"dist/lib/neutral/chunk-ZPC54VRM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":51891},"dist/lib/neutral/chunk-ZPC54VRM.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"effect/Option","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/log","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@effect/ai/LanguageModel","kind":"import-statement","external":true},{"path":"effect/Chunk","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Stream","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/types","kind":"import-statement","external":true},{"path":"@effect/ai/Toolkit","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@effect/ai/Toolkit","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Pipeable","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@effect/ai/Tool","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"effect/Schema","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}],"exports":["AiAssistantError","AiModelError","AiSession","ArtifactDiffResolver","ArtifactId","GenerationObserver","GenericToolkit_exports","RefFromLLM","ToolExecutionServices","VersionPin","createArtifactElement","createToolkit","formatSystemPrompt","formatUserPrompt","makeToolExecutionServiceFromFunctions","makeToolResolverFromFunctions"],"inputs":{"src/session/artifact-diff.ts":{"bytesInOutput":143},"src/session/observer.ts":{"bytesInOutput":917},"src/errors.ts":{"bytesInOutput":232},"src/session/format.ts":{"bytesInOutput":3750},"src/session/session.ts":{"bytesInOutput":4784},"src/session/toolkit.ts":{"bytesInOutput":693},"src/session/version-pin.ts":{"bytesInOutput":732},"src/session/GenericToolkit.ts":{"bytesInOutput":1178},"src/session/index.ts":{"bytesInOutput":0},"src/types/artifact.ts":{"bytesInOutput":2133},"src/types/index.ts":{"bytesInOutput":0},"src/functions/services.ts":{"bytesInOutput":4737},"src/functions/index.ts":{"bytesInOutput":0}},"bytes":20032},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
@@ -0,0 +1,38 @@
1
+ import {
2
+ GenericToolkit_exports,
3
+ ToolExecutionServices
4
+ } from "../chunk-ZPC54VRM.mjs";
5
+ import "../chunk-J5LGTIGS.mjs";
6
+
7
+ // src/testing/layer.ts
8
+ import { Registry } from "@effect-atom/atom";
9
+ import * as Layer from "effect/Layer";
10
+ import * as Match from "effect/Match";
11
+ import { AiService } from "@dxos/ai";
12
+ import { TestAiService } from "@dxos/ai/testing";
13
+ import { CredentialsService, TracingService } from "@dxos/functions";
14
+ import { TracingServiceExt, TriggerDispatcher, TriggerStateStore } from "@dxos/functions-runtime";
15
+ import { FunctionInvocationServiceLayerTest, TestDatabaseLayer } from "@dxos/functions-runtime/testing";
16
+ var AssistantTestLayer = ({ aiServicePreset = "direct", model = "@anthropic/claude-opus-4-0", functions = [], toolkits = [], types = [], credentials = [], tracing = "noop", disableLlmMemoization = false } = {}) => {
17
+ const toolkit = GenericToolkit_exports.merge(...toolkits);
18
+ return Layer.mergeAll(AiService.model(model), ToolExecutionServices).pipe(Layer.provideMerge(FunctionInvocationServiceLayerTest({
19
+ functions
20
+ })), Layer.provideMerge(Layer.mergeAll(TestAiService({
21
+ preset: aiServicePreset,
22
+ disableMemoization: disableLlmMemoization
23
+ }), TestDatabaseLayer({
24
+ spaceKey: "fixed",
25
+ types
26
+ }), CredentialsService.configuredLayer(credentials), Match.value(tracing).pipe(Match.when("noop", () => TracingService.layerNoop), Match.when("console", () => TracingServiceExt.layerLogInfo()), Match.when("pretty", () => TracingServiceExt.layerConsolePrettyPrint({
27
+ toolkit: (toolkits.length > 0 ? GenericToolkit_exports.merge(...toolkits) : GenericToolkit_exports.empty).toolkit
28
+ })), Match.exhaustive))), Layer.provideMerge(GenericToolkit_exports.providerLayer(toolkit)));
29
+ };
30
+ var AssistantTestLayerWithTriggers = (options) => Layer.mergeAll(AssistantTestLayer(options), TriggerDispatcher.layer({
31
+ timeControl: "manual",
32
+ startingTime: /* @__PURE__ */ new Date("2025-09-05T15:01:00.000Z")
33
+ }).pipe(Layer.provide(Registry.layer))).pipe(Layer.provideMerge(TriggerStateStore.layerMemory));
34
+ export {
35
+ AssistantTestLayer,
36
+ AssistantTestLayerWithTriggers
37
+ };
38
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/testing/layer.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Registry } from '@effect-atom/atom';\nimport * as Layer from 'effect/Layer';\nimport * as Match from 'effect/Match';\n\nimport { AiService, type ModelName } from '@dxos/ai';\nimport { TestAiService } from '@dxos/ai/testing';\nimport type { Type } from '@dxos/echo';\nimport { CredentialsService, type FunctionDefinition, type ServiceCredential, TracingService } from '@dxos/functions';\nimport { TracingServiceExt, TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';\nimport { FunctionInvocationServiceLayerTest, TestDatabaseLayer } from '@dxos/functions-runtime/testing';\n\nimport { ToolExecutionServices } from '../functions';\nimport { GenericToolkit } from '../session';\n\ninterface TestLayerOptions {\n aiServicePreset?: 'direct' | 'edge-local' | 'edge-remote';\n model?: ModelName;\n functions?: FunctionDefinition.Any[];\n toolkits?: GenericToolkit.GenericToolkit[];\n types?: Type.Entity.Any[];\n credentials?: ServiceCredential[];\n /*\n * Tracing configuration.\n * @default 'noop'\n */\n tracing?: 'noop' | 'console' | 'pretty';\n\n disableLlmMemoization?: boolean;\n}\n\nexport const AssistantTestLayer = ({\n aiServicePreset = 'direct',\n model = '@anthropic/claude-opus-4-0',\n functions = [],\n toolkits = [],\n types = [],\n credentials = [],\n tracing = 'noop',\n disableLlmMemoization = false,\n}: TestLayerOptions = {}) => {\n const toolkit = GenericToolkit.merge(...toolkits);\n return Layer.mergeAll(AiService.model(model), ToolExecutionServices).pipe(\n Layer.provideMerge(\n FunctionInvocationServiceLayerTest({\n functions,\n }),\n ),\n Layer.provideMerge(\n Layer.mergeAll(\n TestAiService({ preset: aiServicePreset, disableMemoization: disableLlmMemoization }),\n TestDatabaseLayer({\n spaceKey: 'fixed',\n types,\n }),\n CredentialsService.configuredLayer(credentials),\n Match.value(tracing).pipe(\n Match.when('noop', () => TracingService.layerNoop),\n Match.when('console', () => TracingServiceExt.layerLogInfo()),\n Match.when('pretty', () =>\n TracingServiceExt.layerConsolePrettyPrint({\n toolkit: (toolkits.length > 0 ? GenericToolkit.merge(...toolkits) : GenericToolkit.empty).toolkit as any,\n }),\n ),\n Match.exhaustive,\n ),\n ),\n ),\n Layer.provideMerge(GenericToolkit.providerLayer(toolkit)),\n );\n};\n\ninterface TestLayerWithTriggersOptions extends TestLayerOptions {}\n\nexport const AssistantTestLayerWithTriggers = (options: TestLayerWithTriggersOptions) =>\n Layer.mergeAll(\n AssistantTestLayer(options),\n TriggerDispatcher.layer({ timeControl: 'manual', startingTime: new Date('2025-09-05T15:01:00.000Z') }).pipe(\n Layer.provide(Registry.layer),\n ),\n ).pipe(Layer.provideMerge(TriggerStateStore.layerMemory));\n"],
5
+ "mappings": ";;;;;;;AAIA,SAASA,gBAAgB;AACzB,YAAYC,WAAW;AACvB,YAAYC,WAAW;AAEvB,SAASC,iBAAiC;AAC1C,SAASC,qBAAqB;AAE9B,SAASC,oBAAqEC,sBAAsB;AACpG,SAASC,mBAAmBC,mBAAmBC,yBAAyB;AACxE,SAASC,oCAAoCC,yBAAyB;AAqB/D,IAAMC,qBAAqB,CAAC,EACjCC,kBAAkB,UAClBC,QAAQ,8BACRC,YAAY,CAAA,GACZC,WAAW,CAAA,GACXC,QAAQ,CAAA,GACRC,cAAc,CAAA,GACdC,UAAU,QACVC,wBAAwB,MAAK,IACT,CAAC,MAAC;AACtB,QAAMC,UAAUC,uBAAeC,MAAK,GAAIP,QAAAA;AACxC,SAAaQ,eAASC,UAAUX,MAAMA,KAAAA,GAAQY,qBAAAA,EAAuBC,KAC7DC,mBACJC,mCAAmC;IACjCd;EACF,CAAA,CAAA,GAEIa,mBACEJ,eACJM,cAAc;IAAEC,QAAQlB;IAAiBmB,oBAAoBZ;EAAsB,CAAA,GACnFa,kBAAkB;IAChBC,UAAU;IACVjB;EACF,CAAA,GACAkB,mBAAmBC,gBAAgBlB,WAAAA,GAC7BmB,YAAMlB,OAAAA,EAASQ,KACbW,WAAK,QAAQ,MAAMC,eAAeC,SAAS,GAC3CF,WAAK,WAAW,MAAMG,kBAAkBC,aAAY,CAAA,GACpDJ,WAAK,UAAU,MACnBG,kBAAkBE,wBAAwB;IACxCtB,UAAUL,SAAS4B,SAAS,IAAItB,uBAAeC,MAAK,GAAIP,QAAAA,IAAYM,uBAAeuB,OAAOxB;EAC5F,CAAA,CAAA,GAEIyB,gBAAU,CAAA,CAAA,GAIhBlB,mBAAaN,uBAAeyB,cAAc1B,OAAAA,CAAAA,CAAAA;AAEpD;AAIO,IAAM2B,iCAAiC,CAACC,YACvCzB,eACJZ,mBAAmBqC,OAAAA,GACnBC,kBAAkBC,MAAM;EAAEC,aAAa;EAAUC,cAAc,oBAAIC,KAAK,0BAAA;AAA4B,CAAA,EAAG3B,KAC/F4B,cAAQC,SAASL,KAAK,CAAA,CAAA,EAE9BxB,KAAWC,mBAAa6B,kBAAkBC,WAAW,CAAA;",
6
+ "names": ["Registry", "Layer", "Match", "AiService", "TestAiService", "CredentialsService", "TracingService", "TracingServiceExt", "TriggerDispatcher", "TriggerStateStore", "FunctionInvocationServiceLayerTest", "TestDatabaseLayer", "AssistantTestLayer", "aiServicePreset", "model", "functions", "toolkits", "types", "credentials", "tracing", "disableLlmMemoization", "toolkit", "GenericToolkit", "merge", "mergeAll", "AiService", "ToolExecutionServices", "pipe", "provideMerge", "FunctionInvocationServiceLayerTest", "TestAiService", "preset", "disableMemoization", "TestDatabaseLayer", "spaceKey", "CredentialsService", "configuredLayer", "value", "when", "TracingService", "layerNoop", "TracingServiceExt", "layerLogInfo", "layerConsolePrettyPrint", "length", "empty", "exhaustive", "providerLayer", "AssistantTestLayerWithTriggers", "options", "TriggerDispatcher", "layer", "timeControl", "startingTime", "Date", "provide", "Registry", "TriggerStateStore", "layerMemory"]
7
+ }
@@ -1,103 +1,138 @@
1
- import { type ReadonlySignal } from '@preact/signals-core';
1
+ import { Atom, Registry } from '@effect-atom/atom-react';
2
2
  import * as Context from 'effect/Context';
3
+ import * as Effect from 'effect/Effect';
3
4
  import * as Schema from 'effect/Schema';
4
5
  import { Blueprint } from '@dxos/blueprints';
5
6
  import { Resource } from '@dxos/context';
6
- import { DXN, type Ref, Type } from '@dxos/echo';
7
+ import { DXN, Obj, type Ref, Type } from '@dxos/echo';
7
8
  import { type Queue } from '@dxos/echo-db';
8
9
  import { ComplexSet } from '@dxos/util';
9
10
  /**
10
11
  * Thread message that binds or unbinds contextual objects to a conversation.
11
12
  */
12
- export declare const ContextBinding: Type.obj<Schema.Struct<{
13
- blueprints: Schema.Struct<{
14
- added: Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
15
- key: Schema.SchemaClass<string, string, never>;
16
- name: Schema.SchemaClass<string, string, never>;
17
- description: Schema.optional<typeof Schema.String>;
18
- instructions: Schema.mutable<Schema.Struct<{
19
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
20
- content: string;
21
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
22
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
23
- name: typeof Schema.String;
24
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
25
- default: Schema.optional<typeof Schema.Any>;
26
- }>>>>>;
27
- }>>;
28
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
29
- }>>>>;
30
- removed: Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
31
- key: Schema.SchemaClass<string, string, never>;
32
- name: Schema.SchemaClass<string, string, never>;
33
- description: Schema.optional<typeof Schema.String>;
34
- instructions: Schema.mutable<Schema.Struct<{
35
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
36
- content: string;
37
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
38
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
39
- name: typeof Schema.String;
40
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
41
- default: Schema.optional<typeof Schema.Any>;
42
- }>>>>>;
43
- }>>;
44
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
45
- }>>>>;
46
- }>;
47
- objects: Schema.Struct<{
48
- added: Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
49
- [x: string]: any;
50
- id: string;
51
- }, never>>>;
52
- removed: Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
53
- [x: string]: any;
54
- id: string;
55
- }, never>>>;
56
- }>;
57
- }>>;
13
+ export declare const ContextBinding: Type.Obj<{
14
+ readonly blueprints: {
15
+ readonly added: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
16
+ readonly description?: string | undefined;
17
+ readonly name: string;
18
+ readonly key: string;
19
+ readonly instructions: {
20
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
21
+ readonly content: string;
22
+ }>;
23
+ readonly inputs?: readonly {
24
+ readonly function?: string | undefined;
25
+ readonly name: string;
26
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
27
+ readonly default?: any;
28
+ }[] | undefined;
29
+ };
30
+ readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
31
+ }>[];
32
+ readonly removed: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
33
+ readonly description?: string | undefined;
34
+ readonly name: string;
35
+ readonly key: string;
36
+ readonly instructions: {
37
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
38
+ readonly content: string;
39
+ }>;
40
+ readonly inputs?: readonly {
41
+ readonly function?: string | undefined;
42
+ readonly name: string;
43
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
44
+ readonly default?: any;
45
+ }[] | undefined;
46
+ };
47
+ readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
48
+ }>[];
49
+ };
50
+ readonly objects: {
51
+ readonly added: readonly import("@dxos/echo/internal").Ref<any>[];
52
+ readonly removed: readonly import("@dxos/echo/internal").Ref<any>[];
53
+ };
54
+ }, Schema.Struct.Fields>;
58
55
  export interface ContextBinding extends Schema.Schema.Type<typeof ContextBinding> {
59
56
  }
60
57
  export type BindingProps = Partial<{
61
58
  blueprints: Ref.Ref<Blueprint.Blueprint>[];
62
- objects: Ref.Ref<Type.Expando>[];
59
+ objects: Ref.Ref<Obj.Unknown>[];
63
60
  }>;
64
61
  export declare class Bindings {
65
62
  readonly blueprints: ComplexSet<Ref.Ref<Blueprint.Blueprint>>;
66
- readonly objects: ComplexSet<Ref.Ref<Type.Expando>>;
63
+ readonly objects: ComplexSet<Ref.Ref<Obj.Unknown>>;
67
64
  toJSON(): {
68
65
  blueprints: DXN.String[];
69
66
  objects: DXN.String[];
70
67
  };
71
68
  }
69
+ export type AiContextBinderOptions = {
70
+ queue: Queue;
71
+ registry?: Registry.Registry;
72
+ };
72
73
  /**
73
74
  * Manages bindings of blueprints and objects to a conversation.
74
75
  */
75
76
  export declare class AiContextBinder extends Resource {
77
+ private readonly _blueprints;
78
+ private readonly _objects;
79
+ private readonly _registry;
76
80
  private readonly _queue;
81
+ constructor(options: AiContextBinderOptions);
82
+ /**
83
+ * Returns the blueprints atom for subscription.
84
+ */
85
+ get blueprints(): Atom.Atom<Blueprint.Blueprint[]>;
86
+ /**
87
+ * Returns the objects atom for subscription.
88
+ */
89
+ get objects(): Atom.Atom<Obj.Unknown[]>;
90
+ /**
91
+ * Gets the current blueprints value.
92
+ */
93
+ getBlueprints(): Blueprint.Blueprint[];
94
+ /**
95
+ * Gets the current objects value.
96
+ */
97
+ getObjects(): Obj.Unknown[];
98
+ /**
99
+ * Subscribe to changes in blueprints.
100
+ */
101
+ subscribeBlueprints(cb: (blueprints: Blueprint.Blueprint[]) => void): () => void;
77
102
  /**
78
- * Reactive query of all bindings.
103
+ * Subscribe to changes in objects.
79
104
  */
80
- private _bindings?;
81
- private _blueprints?;
82
- private _objects?;
83
- constructor(_queue: Queue);
84
- get bindings(): ReadonlySignal<Bindings>;
85
- get blueprints(): ReadonlySignal<Ref.Ref<Blueprint.Blueprint>[]>;
86
- get objects(): ReadonlySignal<Ref.Ref<Type.Expando>[]>;
105
+ subscribeObjects(cb: (objects: Obj.Unknown[]) => void): () => void;
87
106
  protected _open(): Promise<void>;
107
+ private _updateBindings;
88
108
  protected _close(): Promise<void>;
109
+ bind({ blueprints, objects }: BindingProps): Promise<void>;
110
+ unbind({ blueprints, objects }: BindingProps): Promise<void>;
111
+ /**
112
+ * Process bindings to filter duplicates and determine next state.
113
+ */
114
+ private _processBindings;
89
115
  /**
90
- * Asynchronous query of all bindings.
116
+ * Reduce results into sets of blueprints and objects.
91
117
  */
92
- query(): Promise<Bindings>;
93
- bind(props: BindingProps): Promise<void>;
94
- unbind(props: BindingProps): Promise<void>;
95
118
  private _reduce;
119
+ /**
120
+ * Resolve references to objects, loading them first if needed and falling back to existing objects.
121
+ */
122
+ private _resolve;
96
123
  }
97
124
  declare const AiContextService_base: Context.TagClass<AiContextService, "@dxos/assistant/AiContextService", {
98
125
  binder: AiContextBinder;
99
126
  }>;
100
127
  export declare class AiContextService extends AiContextService_base {
128
+ static bindContext: ({ blueprints, objects }: BindingProps) => Effect.Effect<void, never, AiContextService>;
129
+ static findObjects: <T extends Type.Entity.Any>(type: T) => Effect.Effect<Schema.Schema.Type<T>[], never, AiContextService>;
130
+ /**
131
+ * Glorified type cast until we figure out function service typing.
132
+ * For context, the AiContextService is provided to functions called from tool calls, but it's not implemented in types yet.
133
+ * @deprecated
134
+ */
135
+ static fixFunctionHandlerType: <A, E, R>(eff: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, AiContextService>>;
101
136
  }
102
137
  export {};
103
138
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/conversation/context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAY,MA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,GAAG,MAAM,IAAI;cAIzC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAejC,eAAe;cAwBJ,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAM1C,IAAI,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B1D,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBlE;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA8BxB;;OAEG;IACH,OAAO,CAAC,OAAO;IAqBf;;OAEG;YACW,QAAQ;CAmBvB;;YAKW,eAAe;;AAH3B,qBAAa,gBAAiB,SAAQ,qBAKnC;IACD,MAAM,CAAC,WAAW,GAAI,yBAAyB,YAAY,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAIrG;IAEL,MAAM,CAAC,WAAW,GAAI,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,GAAG,EAC7C,MAAM,CAAC,KACN,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAKhE;IAEF;;;;OAIG;IACH,MAAM,CAAC,sBAAsB,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EACtC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAe;CACpE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=context.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.test.d.ts","sourceRoot":"","sources":["../../../../src/conversation/context.test.ts"],"names":[],"mappings":""}