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

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 (114) hide show
  1. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/browser/extraction/index.mjs +119 -162
  3. package/dist/lib/browser/extraction/index.mjs.map +4 -4
  4. package/dist/lib/browser/index.mjs +978 -157
  5. package/dist/lib/browser/index.mjs.map +4 -4
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  8. package/dist/lib/node-esm/extraction/index.mjs +119 -162
  9. package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/index.mjs +978 -157
  11. package/dist/lib/node-esm/index.mjs.map +4 -4
  12. package/dist/lib/node-esm/meta.json +1 -1
  13. package/dist/types/src/conversation/context.d.ts +14 -7
  14. package/dist/types/src/conversation/context.d.ts.map +1 -1
  15. package/dist/types/src/conversation/conversation.d.ts +11 -12
  16. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  17. package/dist/types/src/diff.d.ts.map +1 -1
  18. package/dist/types/src/errors.d.ts +38 -42
  19. package/dist/types/src/errors.d.ts.map +1 -1
  20. package/dist/types/src/execution-graph.d.ts +85 -0
  21. package/dist/types/src/execution-graph.d.ts.map +1 -0
  22. package/dist/types/src/execution-graph.test.d.ts +2 -0
  23. package/dist/types/src/execution-graph.test.d.ts.map +1 -0
  24. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  25. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +60 -52
  26. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  27. package/dist/types/src/extraction/extraction.d.ts +24 -13
  28. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  29. package/dist/types/src/extraction/quotes.d.ts +1 -1
  30. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  31. package/dist/types/src/functions/services.d.ts +18 -5
  32. package/dist/types/src/functions/services.d.ts.map +1 -1
  33. package/dist/types/src/index.d.ts +2 -1
  34. package/dist/types/src/index.d.ts.map +1 -1
  35. package/dist/types/src/session/GenericToolkit.d.ts +84 -0
  36. package/dist/types/src/session/GenericToolkit.d.ts.map +1 -0
  37. package/dist/types/src/session/artifact-diff.d.ts +2 -2
  38. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  39. package/dist/types/src/session/error-handling.d.ts +2 -2
  40. package/dist/types/src/session/error-handling.d.ts.map +1 -1
  41. package/dist/types/src/session/format.d.ts +4 -174
  42. package/dist/types/src/session/format.d.ts.map +1 -1
  43. package/dist/types/src/session/index.d.ts +1 -0
  44. package/dist/types/src/session/index.d.ts.map +1 -1
  45. package/dist/types/src/session/observer.d.ts +3 -3
  46. package/dist/types/src/session/observer.d.ts.map +1 -1
  47. package/dist/types/src/session/session.d.ts +15 -11
  48. package/dist/types/src/session/session.d.ts.map +1 -1
  49. package/dist/types/src/session/toolkit.d.ts +7 -6
  50. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  51. package/dist/types/src/session/version-pin.d.ts +3 -3
  52. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  53. package/dist/types/src/types/artifact.d.ts +20 -0
  54. package/dist/types/src/types/artifact.d.ts.map +1 -0
  55. package/dist/types/src/types/index.d.ts +2 -0
  56. package/dist/types/src/types/index.d.ts.map +1 -0
  57. package/dist/types/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +28 -31
  59. package/src/conversation/context.ts +49 -17
  60. package/src/conversation/conversation.ts +28 -23
  61. package/src/diff.test.ts +3 -3
  62. package/src/diff.ts +5 -0
  63. package/src/errors.ts +4 -4
  64. package/src/execution-graph.test.ts +740 -0
  65. package/src/execution-graph.ts +509 -0
  66. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +2 -2
  67. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +46 -54
  68. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +10 -9
  69. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +38 -44
  70. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
  71. package/src/extraction/extraction.ts +7 -6
  72. package/src/extraction/quotes.test.ts +2 -2
  73. package/src/extraction/quotes.ts +3 -3
  74. package/src/functions/services.ts +93 -50
  75. package/src/index.ts +2 -1
  76. package/src/session/GenericToolkit.ts +130 -0
  77. package/src/session/artifact-diff.ts +2 -2
  78. package/src/session/error-handling.ts +11 -6
  79. package/src/session/format.test.ts +5 -4
  80. package/src/session/format.ts +18 -13
  81. package/src/session/index.ts +2 -0
  82. package/src/session/observer.ts +4 -3
  83. package/src/session/session.conversations.json +1 -0
  84. package/src/session/session.test.ts +51 -210
  85. package/src/session/session.ts +40 -28
  86. package/src/session/toolkit.ts +19 -13
  87. package/src/session/version-pin.ts +4 -5
  88. package/src/templates/{format.tpl → instructions/format.tpl} +1 -0
  89. package/src/templates/{system.tpl → instructions/system.tpl} +10 -12
  90. package/src/templates/system.ts +2 -2
  91. package/src/{types.ts → types/artifact.ts} +22 -3
  92. package/src/types/index.ts +5 -0
  93. package/dist/lib/browser/chunk-5GJYG2ML.mjs +0 -396
  94. package/dist/lib/browser/chunk-5GJYG2ML.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-UB26N5UF.mjs +0 -89
  96. package/dist/lib/browser/chunk-UB26N5UF.mjs.map +0 -7
  97. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs +0 -13
  98. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs +0 -91
  99. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +0 -7
  100. package/dist/lib/node-esm/chunk-FLFCEB4P.mjs +0 -398
  101. package/dist/lib/node-esm/chunk-FLFCEB4P.mjs.map +0 -7
  102. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs +0 -14
  103. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  104. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  105. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  106. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  107. package/dist/types/src/types.d.ts +0 -16
  108. package/dist/types/src/types.d.ts.map +0 -1
  109. package/src/session/__snapshots__/session.test.ts.snap +0 -32
  110. package/src/session/version-pin.test.ts +0 -7
  111. package/src/summarization/summarization.test.ts +0 -197
  112. /package/dist/lib/browser/{named-entity-recognition-QPYHML66.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  113. /package/dist/lib/node-esm/{named-entity-recognition-2HDF46YX.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
  114. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -1,6 +1,8 @@
1
1
  import { type ReadonlySignal } from '@preact/signals-core';
2
- import { Context, Schema } from 'effect';
2
+ import * as Context from 'effect/Context';
3
+ import * as Schema from 'effect/Schema';
3
4
  import { Blueprint } from '@dxos/blueprints';
5
+ import { Resource } from '@dxos/context';
4
6
  import { DXN, type Ref, Type } from '@dxos/echo';
5
7
  import { type Queue } from '@dxos/echo-db';
6
8
  import { ComplexSet } from '@dxos/util';
@@ -14,7 +16,7 @@ export declare const ContextBinding: Type.obj<Schema.Struct<{
14
16
  name: Schema.SchemaClass<string, string, never>;
15
17
  description: Schema.optional<typeof Schema.String>;
16
18
  instructions: Schema.mutable<Schema.Struct<{
17
- source: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
19
+ source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
18
20
  content: string;
19
21
  }>, import("@dxos/echo-protocol").EncodedReference, never>;
20
22
  inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
@@ -30,7 +32,7 @@ export declare const ContextBinding: Type.obj<Schema.Struct<{
30
32
  name: Schema.SchemaClass<string, string, never>;
31
33
  description: Schema.optional<typeof Schema.String>;
32
34
  instructions: Schema.mutable<Schema.Struct<{
33
- source: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
35
+ source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
34
36
  content: string;
35
37
  }>, import("@dxos/echo-protocol").EncodedReference, never>;
36
38
  inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
@@ -70,15 +72,20 @@ export declare class Bindings {
70
72
  /**
71
73
  * Manages bindings of blueprints and objects to a conversation.
72
74
  */
73
- export declare class AiContextBinder {
75
+ export declare class AiContextBinder extends Resource {
74
76
  private readonly _queue;
75
77
  /**
76
78
  * Reactive query of all bindings.
77
79
  */
78
- readonly bindings: ReadonlySignal<Bindings>;
79
- readonly blueprints: ReadonlySignal<Ref.Ref<Blueprint.Blueprint>[]>;
80
- readonly objects: ReadonlySignal<Ref.Ref<Type.Expando>[]>;
80
+ private _bindings?;
81
+ private _blueprints?;
82
+ private _objects?;
81
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>[]>;
87
+ protected _open(): Promise<void>;
88
+ protected _close(): Promise<void>;
82
89
  /**
83
90
  * Asynchronous query of all bindings.
84
91
  */
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/conversation/context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,k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eAAgB,SAAQ,QAAQ;IAS/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IARnC;;OAEG;IAEH,OAAO,CAAC,SAAS,CAAC,CAA2B;IAC7C,OAAO,CAAC,WAAW,CAAC,CAAiD;IACrE,OAAO,CAAC,QAAQ,CAAC,CAA0C;gBAE9B,MAAM,EAAE,KAAK;IAI1C,IAAI,QAAQ,6BAGX;IAED,IAAI,UAAU,mDAGb;IAED,IAAI,OAAO,4CAGV;cAGwB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;cAQtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAMhD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAM1B,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBxC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBhD,OAAO,CAAC,OAAO;CAmBhB;;YAKW,eAAe;;AAH3B,qBAAa,gBAAiB,SAAQ,qBAKnC;CAAG"}
@@ -1,23 +1,20 @@
1
- import { type AiTool, type AiToolkit } from '@effect/ai';
2
- import { Effect } from 'effect';
1
+ import type * as Toolkit from '@effect/ai/Toolkit';
2
+ import * as Effect from 'effect/Effect';
3
+ import { Resource } from '@dxos/context';
3
4
  import { type Queue } from '@dxos/echo-db';
4
- import { DataType } from '@dxos/schema';
5
+ import { Message } from '@dxos/types';
5
6
  import { type AiSessionRunError, type AiSessionRunRequirements, type GenerationObserver } from '../session';
6
7
  import { AiContextBinder, type ContextBinding } from './context';
7
- export type AiConversationRunRequirements<Tools extends AiTool.Any> = AiSessionRunRequirements | AiTool.ToHandler<Tools>;
8
8
  export interface AiConversationRunParams {
9
9
  prompt: string;
10
10
  system?: string;
11
11
  observer?: GenerationObserver;
12
12
  }
13
- export type AiConversationOptions = {
14
- queue: Queue<DataType.Message | ContextBinding>;
15
- };
16
13
  /**
17
14
  * Durable conversation state (initiated by users and agents) backed by a Queue.
18
15
  * Executes tools based on AI responses and supports cancellation of in-progress requests.
19
16
  */
20
- export declare class AiConversation {
17
+ export declare class AiConversation extends Resource {
21
18
  /**
22
19
  * Message and binding queue.
23
20
  */
@@ -30,13 +27,15 @@ export declare class AiConversation {
30
27
  * Toolkit from the current session request.
31
28
  */
32
29
  private _toolkit;
33
- constructor(options: AiConversationOptions);
30
+ constructor(queue: Queue<Message.Message | ContextBinding>);
31
+ protected _open(): Promise<void>;
32
+ protected _close(): Promise<void>;
34
33
  get context(): AiContextBinder;
35
- get toolkit(): AiToolkit.ToHandler<AiTool.Any> | undefined;
36
- getHistory(): Promise<DataType.Message[]>;
34
+ get toolkit(): Toolkit.WithHandler<any> | undefined;
35
+ getHistory(): Promise<Message.Message[]>;
37
36
  /**
38
37
  * Creates a new cancelable request effect.
39
38
  */
40
- createRequest<Tools extends AiTool.Any>(params: AiConversationRunParams): Effect.Effect<DataType.Message[], AiSessionRunError, AiConversationRunRequirements<Tools>>;
39
+ createRequest(params: AiConversationRunParams): Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements>;
41
40
  }
42
41
  //# sourceMappingURL=conversation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/conversation/conversation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAS,MAAM,EAAU,MAAM,QAAQ,CAAC;AAG/C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAoB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEnF,MAAM,MAAM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AM,EAAE,KAAG,IAAI,EAyB1D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,CAAC,EAAE,UAAU,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,EAAE;;;GAU5F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,UAAU,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,EAAE,KAAG,MAgBlF,CAAC"}
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/diff.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAc3D,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,SAAS,MAAM,EAAE,KAAG,IAAI,EAyB1D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,CAAC,EAAE,UAAU,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,EAAE;;;GAU5F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,UAAU,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,EAAE,KAAG,MAgBlF,CAAC"}
@@ -1,75 +1,71 @@
1
1
  import { BaseError } from '@dxos/errors';
2
- declare const AiAssistantError_base: {
3
- new (message: string, options?: import("@dxos/errors").BaseErrorOptions): {
4
- #code: "AI_ASSISTANT_ERROR";
5
- #context: Record<string, unknown>;
6
- readonly name: "AI_ASSISTANT_ERROR";
7
- readonly code: "AI_ASSISTANT_ERROR";
8
- readonly _tag: "AI_ASSISTANT_ERROR";
9
- readonly context: Record<string, unknown>;
10
- message: string;
2
+ declare const AiModelError_base: {
3
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
4
+ code: "AI_MODEL_ERROR";
5
+ context: Record<string, unknown>;
6
+ readonly name: "AI_MODEL_ERROR";
7
+ readonly message: string;
8
+ readonly _tag: "AI_MODEL_ERROR";
11
9
  stack?: string;
12
10
  cause?: unknown;
13
11
  };
14
- code: "AI_ASSISTANT_ERROR";
12
+ code: "AI_MODEL_ERROR";
15
13
  is(error: unknown): error is BaseError;
16
- wrap(message: string, options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
17
- #code: "AI_ASSISTANT_ERROR";
18
- #context: Record<string, unknown>;
19
- readonly name: "AI_ASSISTANT_ERROR";
20
- readonly code: "AI_ASSISTANT_ERROR";
21
- readonly _tag: "AI_ASSISTANT_ERROR";
22
- readonly context: Record<string, unknown>;
23
- message: string;
14
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause"> & {
15
+ ifTypeDiffers?: boolean;
16
+ }): (error: unknown) => {
17
+ code: "AI_MODEL_ERROR";
18
+ context: Record<string, unknown>;
19
+ readonly name: "AI_MODEL_ERROR";
20
+ readonly message: string;
21
+ readonly _tag: "AI_MODEL_ERROR";
24
22
  stack?: string;
25
23
  cause?: unknown;
26
24
  };
27
- extend<Code extends string>(code: Code): any;
25
+ extend<Code extends string = string>(code: Code, message?: string): any;
28
26
  isError(error: unknown): error is Error;
29
27
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
30
28
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
31
29
  stackTraceLimit: number;
32
30
  };
33
31
  /**
34
- * Generic error for AI agent execution.
32
+ * Generic error from AI model.
35
33
  */
36
- export declare class AiAssistantError extends AiAssistantError_base {
34
+ export declare class AiModelError extends AiModelError_base {
37
35
  }
38
- declare const AnthropicError_base: {
39
- new (message: string, options?: import("@dxos/errors").BaseErrorOptions): {
40
- #code: "ANTHROPIC_ERROR";
41
- #context: Record<string, unknown>;
42
- readonly name: "ANTHROPIC_ERROR";
43
- readonly code: "ANTHROPIC_ERROR";
44
- readonly _tag: "ANTHROPIC_ERROR";
45
- readonly context: Record<string, unknown>;
46
- message: string;
36
+ declare const AiAssistantError_base: {
37
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
38
+ code: "AI_ASSISTANT_ERROR";
39
+ context: Record<string, unknown>;
40
+ readonly name: "AI_ASSISTANT_ERROR";
41
+ readonly message: string;
42
+ readonly _tag: "AI_ASSISTANT_ERROR";
47
43
  stack?: string;
48
44
  cause?: unknown;
49
45
  };
50
- code: "ANTHROPIC_ERROR";
46
+ code: "AI_ASSISTANT_ERROR";
51
47
  is(error: unknown): error is BaseError;
52
- wrap(message: string, options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
53
- #code: "ANTHROPIC_ERROR";
54
- #context: Record<string, unknown>;
55
- readonly name: "ANTHROPIC_ERROR";
56
- readonly code: "ANTHROPIC_ERROR";
57
- readonly _tag: "ANTHROPIC_ERROR";
58
- readonly context: Record<string, unknown>;
59
- message: string;
48
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause"> & {
49
+ ifTypeDiffers?: boolean;
50
+ }): (error: unknown) => {
51
+ code: "AI_ASSISTANT_ERROR";
52
+ context: Record<string, unknown>;
53
+ readonly name: "AI_ASSISTANT_ERROR";
54
+ readonly message: string;
55
+ readonly _tag: "AI_ASSISTANT_ERROR";
60
56
  stack?: string;
61
57
  cause?: unknown;
62
58
  };
63
- extend<Code extends string>(code: Code): any;
59
+ extend<Code extends string = string>(code: Code, message?: string): any;
64
60
  isError(error: unknown): error is Error;
65
61
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
66
62
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
67
63
  stackTraceLimit: number;
68
64
  };
69
65
  /**
70
- * Parsed error from the anthropic API.
66
+ * Generic error for AI agent execution.
71
67
  */
72
- export declare class AnthropicError extends AnthropicError_base {
68
+ export declare class AiAssistantError extends AiAssistantError_base {
73
69
  }
74
70
  export {};
75
71
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,qBAAsC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE/E;;GAEG;AACH,qBAAa,cAAe,SAAQ,mBAAmC;CAAG"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;qBAWivB,CAAC;;;;;;;;;;;;;;;;AAT3xB;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAAoD;CAAG;;;;;;;;;;;;;;qBAMisB,CAAC;;;;;;;;;;;;;;;;AAJ3xB;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,qBAA4D;CAAG"}
@@ -0,0 +1,85 @@
1
+ import { Obj } from '@dxos/echo';
2
+ import { LogLevel } from '@dxos/log';
3
+ import { ContentBlock } from '@dxos/types';
4
+ /**
5
+ * Mercurial-style Commit.
6
+ */
7
+ export type Commit = {
8
+ id: string;
9
+ parents: string[];
10
+ branch: string;
11
+ icon?: string;
12
+ level?: LogLevel;
13
+ message: string;
14
+ timestamp?: Date;
15
+ tags?: string[];
16
+ };
17
+ /**
18
+ * Models the execution graph based on a stream of events.
19
+ */
20
+ export declare class ExecutionGraph {
21
+ private readonly _skipBlocks;
22
+ private _commits;
23
+ private _branchNames;
24
+ private _lastBlockId;
25
+ private _toolCallCommitIds;
26
+ private _lastCommitByBranch;
27
+ private _pendingToolResults;
28
+ constructor(_skipBlocks?: ContentBlock.Any['_tag'][]);
29
+ /**
30
+ * Adds events to the graph.
31
+ */
32
+ addEvents(events: Obj.Any[]): void;
33
+ /**
34
+ * Processes a message event and creates commits for its blocks.
35
+ */
36
+ private _processMessage;
37
+ /**
38
+ * Processes an AgentStatus event.
39
+ */
40
+ private _processAgentStatus;
41
+ /**
42
+ * Stable sort: objects with 'created' field are sorted by it, others remain in place.
43
+ */
44
+ private sortObjectsByCreated;
45
+ /**
46
+ * Returns the current state of the graph.
47
+ */
48
+ getGraph(lastRequest?: boolean): {
49
+ branches: string[];
50
+ commits: Commit[];
51
+ };
52
+ /**
53
+ * Tracks tool calls and handles pending tool result updates.
54
+ */
55
+ private _trackToolCalls;
56
+ /**
57
+ * Updates pending tool results to point to an AgentStatus event.
58
+ */
59
+ private _updatePendingToolResults;
60
+ /**
61
+ * Handles late updates when AgentStatus is processed before tool result.
62
+ */
63
+ private _handleLateToolResultUpdate;
64
+ /**
65
+ * Gets the branch name for a tool call.
66
+ */
67
+ private _getToolCallBranch;
68
+ /**
69
+ * Gets the parents for an AgentStatus commit.
70
+ */
71
+ private _getAgentStatusParents;
72
+ /**
73
+ * Checks if a commit is a tool call commit.
74
+ */
75
+ private _isToolCallCommit;
76
+ /**
77
+ * Checks if a commit is a tool result commit.
78
+ */
79
+ private _isToolResultCommit;
80
+ /**
81
+ * Extracts tool call ID from a commit ID.
82
+ */
83
+ private _extractToolCallId;
84
+ }
85
+ //# sourceMappingURL=execution-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-graph.d.ts","sourceRoot":"","sources":["../../../src/execution-graph.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAY,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAW,MAAM,aAAa,CAAC;AAKpD;;GAEG;AAEH,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,E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ceRoot":"","sources":["../../../src/execution-graph.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"extraction-llm-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-llm-function/extraction-llm-function.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAI1E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKlE,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAkD5F,CAAC"}
1
+ {"version":3,"file":"extraction-llm-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-llm-function/extraction-llm-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAElE,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAqD5F,CAAC"}
@@ -2,34 +2,29 @@
2
2
  * Named Entity Recognition model
3
3
  */
4
4
  export declare const extractionNerFunction: import("@dxos/functions").FunctionDefinition<{
5
- readonly objects?: readonly import("@dxos/echo-schema").Expando[] | undefined;
6
5
  readonly options?: {
7
6
  readonly timeout?: number | undefined;
8
7
  readonly fallbackToRaw?: boolean | undefined;
9
8
  } | undefined;
10
- readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
9
+ readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
11
10
  id: string;
12
11
  parentMessage?: string | undefined;
13
12
  created: string;
14
13
  sender: {
15
14
  name?: string | undefined;
16
- contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
17
- fields?: {
18
- readonly value: string;
19
- readonly category?: string | undefined;
20
- readonly label: string;
21
- }[] | undefined;
15
+ contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
22
16
  image?: string | undefined;
23
17
  fullName?: string | undefined;
24
18
  preferredName?: string | undefined;
25
19
  nickname?: string | undefined;
26
- organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
27
- id: string;
20
+ organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
28
21
  description?: string | undefined;
22
+ id: string;
29
23
  name?: string | undefined;
30
24
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
31
25
  image?: string | undefined;
32
26
  website?: string | undefined;
27
+ location?: readonly [number, number, (number | undefined)?] | undefined;
33
28
  }> | undefined;
34
29
  jobTitle?: string | undefined;
35
30
  department?: string | undefined;
@@ -63,11 +58,17 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
63
58
  readonly label?: string | undefined;
64
59
  }[] | undefined;
65
60
  birthday?: string | undefined;
61
+ fields?: {
62
+ readonly value: string;
63
+ readonly label: string;
64
+ readonly category?: string | undefined;
65
+ }[] | undefined;
66
+ location?: readonly [number, number, (number | undefined)?] | undefined;
66
67
  }> | undefined;
67
68
  identityDid?: string | undefined;
68
69
  identityKey?: string | undefined;
69
70
  email?: string | undefined;
70
- role?: "user" | "assistant" | undefined;
71
+ role?: "user" | "assistant" | "tool" | undefined;
71
72
  };
72
73
  blocks: ({
73
74
  version: unknown;
@@ -75,23 +76,23 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
75
76
  pending?: boolean | undefined;
76
77
  objectId: string;
77
78
  } | {
78
- name?: string | undefined;
79
79
  _tag: "file";
80
- url: string;
81
80
  pending?: boolean | undefined;
81
+ url: string;
82
+ name?: string | undefined;
82
83
  mediaType?: string | undefined;
83
84
  } | {
84
85
  id?: string | undefined;
86
+ _tag: "image";
87
+ pending?: boolean | undefined;
85
88
  source?: {
86
- type: "base64";
87
89
  mediaType: string;
90
+ type: "base64";
88
91
  data: string;
89
92
  } | {
90
- type: "http";
91
93
  url: string;
94
+ type: "http";
92
95
  } | undefined;
93
- _tag: "image";
94
- pending?: boolean | undefined;
95
96
  } | {
96
97
  _tag: "json";
97
98
  pending?: boolean | undefined;
@@ -103,13 +104,13 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
103
104
  pending?: boolean | undefined;
104
105
  } | {
105
106
  _tag: "reasoning";
107
+ pending?: boolean | undefined;
106
108
  reasoningText?: string | undefined;
107
- signature?: string | undefined;
108
109
  redactedText?: string | undefined;
109
- pending?: boolean | undefined;
110
+ signature?: string | undefined;
110
111
  } | {
112
+ reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
111
113
  _tag: "reference";
112
- reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
113
114
  pending?: boolean | undefined;
114
115
  } | {
115
116
  _tag: "select";
@@ -125,15 +126,15 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
125
126
  pending?: boolean | undefined;
126
127
  } | {
127
128
  _tag: "summary";
129
+ pending?: boolean | undefined;
130
+ mimeType?: string | undefined;
131
+ message?: string | undefined;
128
132
  model?: string | undefined;
129
133
  usage?: {
130
134
  readonly inputTokens?: number | undefined;
131
135
  readonly outputTokens?: number | undefined;
132
136
  readonly totalTokens?: number | undefined;
133
137
  } | undefined;
134
- pending?: boolean | undefined;
135
- mimeType?: string | undefined;
136
- message?: string | undefined;
137
138
  toolCalls?: number | undefined;
138
139
  errors?: number | undefined;
139
140
  duration?: number | undefined;
@@ -147,18 +148,20 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
147
148
  _tag: "toolkit";
148
149
  pending?: boolean | undefined;
149
150
  } | {
150
- name: string;
151
151
  _tag: "toolCall";
152
152
  pending?: boolean | undefined;
153
+ name: string;
153
154
  toolCallId: string;
154
155
  input: string;
156
+ providerExecuted: boolean;
155
157
  } | {
156
- name: string;
157
158
  _tag: "toolResult";
158
- error?: string | undefined;
159
159
  pending?: boolean | undefined;
160
+ name: string;
160
161
  toolCallId: string;
162
+ providerExecuted: boolean;
161
163
  result?: string | undefined;
164
+ error?: string | undefined;
162
165
  } | {
163
166
  text: string;
164
167
  _tag: "transcript";
@@ -169,30 +172,27 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
169
172
  [x: string]: any;
170
173
  } | undefined;
171
174
  };
175
+ readonly objects?: readonly import("@dxos/echo/internal").Expando[] | undefined;
172
176
  }, {
173
- readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
177
+ readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
174
178
  id: string;
175
179
  parentMessage?: string | undefined;
176
180
  created: string;
177
181
  sender: {
178
182
  name?: string | undefined;
179
- contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
180
- fields?: {
181
- readonly value: string;
182
- readonly category?: string | undefined;
183
- readonly label: string;
184
- }[] | undefined;
183
+ contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
185
184
  image?: string | undefined;
186
185
  fullName?: string | undefined;
187
186
  preferredName?: string | undefined;
188
187
  nickname?: string | undefined;
189
- organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
190
- id: string;
188
+ organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
191
189
  description?: string | undefined;
190
+ id: string;
192
191
  name?: string | undefined;
193
192
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
194
193
  image?: string | undefined;
195
194
  website?: string | undefined;
195
+ location?: readonly [number, number, (number | undefined)?] | undefined;
196
196
  }> | undefined;
197
197
  jobTitle?: string | undefined;
198
198
  department?: string | undefined;
@@ -226,11 +226,17 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
226
226
  readonly label?: string | undefined;
227
227
  }[] | undefined;
228
228
  birthday?: string | undefined;
229
+ fields?: {
230
+ readonly value: string;
231
+ readonly label: string;
232
+ readonly category?: string | undefined;
233
+ }[] | undefined;
234
+ location?: readonly [number, number, (number | undefined)?] | undefined;
229
235
  }> | undefined;
230
236
  identityDid?: string | undefined;
231
237
  identityKey?: string | undefined;
232
238
  email?: string | undefined;
233
- role?: "user" | "assistant" | undefined;
239
+ role?: "user" | "assistant" | "tool" | undefined;
234
240
  };
235
241
  blocks: ({
236
242
  version: unknown;
@@ -238,23 +244,23 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
238
244
  pending?: boolean | undefined;
239
245
  objectId: string;
240
246
  } | {
241
- name?: string | undefined;
242
247
  _tag: "file";
243
- url: string;
244
248
  pending?: boolean | undefined;
249
+ url: string;
250
+ name?: string | undefined;
245
251
  mediaType?: string | undefined;
246
252
  } | {
247
253
  id?: string | undefined;
254
+ _tag: "image";
255
+ pending?: boolean | undefined;
248
256
  source?: {
249
- type: "base64";
250
257
  mediaType: string;
258
+ type: "base64";
251
259
  data: string;
252
260
  } | {
253
- type: "http";
254
261
  url: string;
262
+ type: "http";
255
263
  } | undefined;
256
- _tag: "image";
257
- pending?: boolean | undefined;
258
264
  } | {
259
265
  _tag: "json";
260
266
  pending?: boolean | undefined;
@@ -266,13 +272,13 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
266
272
  pending?: boolean | undefined;
267
273
  } | {
268
274
  _tag: "reasoning";
275
+ pending?: boolean | undefined;
269
276
  reasoningText?: string | undefined;
270
- signature?: string | undefined;
271
277
  redactedText?: string | undefined;
272
- pending?: boolean | undefined;
278
+ signature?: string | undefined;
273
279
  } | {
280
+ reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
274
281
  _tag: "reference";
275
- reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
276
282
  pending?: boolean | undefined;
277
283
  } | {
278
284
  _tag: "select";
@@ -288,15 +294,15 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
288
294
  pending?: boolean | undefined;
289
295
  } | {
290
296
  _tag: "summary";
297
+ pending?: boolean | undefined;
298
+ mimeType?: string | undefined;
299
+ message?: string | undefined;
291
300
  model?: string | undefined;
292
301
  usage?: {
293
302
  readonly inputTokens?: number | undefined;
294
303
  readonly outputTokens?: number | undefined;
295
304
  readonly totalTokens?: number | undefined;
296
305
  } | undefined;
297
- pending?: boolean | undefined;
298
- mimeType?: string | undefined;
299
- message?: string | undefined;
300
306
  toolCalls?: number | undefined;
301
307
  errors?: number | undefined;
302
308
  duration?: number | undefined;
@@ -310,18 +316,20 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
310
316
  _tag: "toolkit";
311
317
  pending?: boolean | undefined;
312
318
  } | {
313
- name: string;
314
319
  _tag: "toolCall";
315
320
  pending?: boolean | undefined;
321
+ name: string;
316
322
  toolCallId: string;
317
323
  input: string;
324
+ providerExecuted: boolean;
318
325
  } | {
319
- name: string;
320
326
  _tag: "toolResult";
321
- error?: string | undefined;
322
327
  pending?: boolean | undefined;
328
+ name: string;
323
329
  toolCallId: string;
330
+ providerExecuted: boolean;
324
331
  result?: string | undefined;
332
+ error?: string | undefined;
325
333
  } | {
326
334
  text: string;
327
335
  _tag: "transcript";
@@ -333,5 +341,5 @@ export declare const extractionNerFunction: import("@dxos/functions").FunctionDe
333
341
  } | undefined;
334
342
  };
335
343
  readonly timeElapsed: number;
336
- }>;
344
+ }, import("@dxos/functions").FunctionServices>;
337
345
  //# sourceMappingURL=extraction-ner-function.d.ts.map