@dxos/assistant 0.8.4-main.fd6878d → 0.8.4-main.fffef41

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 (122) hide show
  1. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/browser/extraction/index.mjs +121 -165
  3. package/dist/lib/browser/extraction/index.mjs.map +4 -4
  4. package/dist/lib/browser/index.mjs +1097 -161
  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 +121 -165
  9. package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/index.mjs +1097 -161
  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 +23 -10
  14. package/dist/types/src/conversation/context.d.ts.map +1 -1
  15. package/dist/types/src/conversation/conversation.d.ts +22 -31
  16. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  17. package/dist/types/src/diff.d.ts +15 -0
  18. package/dist/types/src/diff.d.ts.map +1 -0
  19. package/dist/types/src/diff.test.d.ts +2 -0
  20. package/dist/types/src/diff.test.d.ts.map +1 -0
  21. package/dist/types/src/errors.d.ts +45 -13
  22. package/dist/types/src/errors.d.ts.map +1 -1
  23. package/dist/types/src/execution-graph.d.ts +85 -0
  24. package/dist/types/src/execution-graph.d.ts.map +1 -0
  25. package/dist/types/src/execution-graph.test.d.ts +2 -0
  26. package/dist/types/src/execution-graph.test.d.ts.map +1 -0
  27. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +1 -1
  28. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  29. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +82 -43
  30. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  31. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  32. package/dist/types/src/extraction/extraction.d.ts +262 -225
  33. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  34. package/dist/types/src/extraction/quotes.d.ts +1 -1
  35. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  36. package/dist/types/src/functions/services.d.ts +18 -5
  37. package/dist/types/src/functions/services.d.ts.map +1 -1
  38. package/dist/types/src/index.d.ts +3 -1
  39. package/dist/types/src/index.d.ts.map +1 -1
  40. package/dist/types/src/session/GenericToolkit.d.ts +84 -0
  41. package/dist/types/src/session/GenericToolkit.d.ts.map +1 -0
  42. package/dist/types/src/session/artifact-diff.d.ts +2 -2
  43. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  44. package/dist/types/src/session/error-handling.d.ts +4 -0
  45. package/dist/types/src/session/error-handling.d.ts.map +1 -0
  46. package/dist/types/src/session/format.d.ts +5 -161
  47. package/dist/types/src/session/format.d.ts.map +1 -1
  48. package/dist/types/src/session/index.d.ts +3 -0
  49. package/dist/types/src/session/index.d.ts.map +1 -1
  50. package/dist/types/src/session/observer.d.ts +22 -0
  51. package/dist/types/src/session/observer.d.ts.map +1 -0
  52. package/dist/types/src/session/session.d.ts +22 -138
  53. package/dist/types/src/session/session.d.ts.map +1 -1
  54. package/dist/types/src/session/toolkit.d.ts +15 -0
  55. package/dist/types/src/session/toolkit.d.ts.map +1 -0
  56. package/dist/types/src/session/version-pin.d.ts +3 -3
  57. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  58. package/dist/types/src/templates/system.d.ts +8 -12
  59. package/dist/types/src/templates/system.d.ts.map +1 -1
  60. package/dist/types/src/types/artifact.d.ts +20 -0
  61. package/dist/types/src/types/artifact.d.ts.map +1 -0
  62. package/dist/types/src/types/index.d.ts +2 -0
  63. package/dist/types/src/types/index.d.ts.map +1 -0
  64. package/dist/types/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +29 -31
  66. package/src/conversation/context.ts +75 -22
  67. package/src/conversation/conversation.ts +80 -77
  68. package/src/diff.test.ts +43 -0
  69. package/src/diff.ts +84 -0
  70. package/src/errors.ts +6 -1
  71. package/src/execution-graph.test.ts +740 -0
  72. package/src/execution-graph.ts +509 -0
  73. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +9 -9
  74. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +47 -56
  75. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +16 -16
  76. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +42 -43
  77. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
  78. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
  79. package/src/extraction/extraction.ts +7 -6
  80. package/src/extraction/quotes.test.ts +2 -2
  81. package/src/extraction/quotes.ts +3 -3
  82. package/src/functions/services.ts +104 -56
  83. package/src/index.ts +3 -1
  84. package/src/session/GenericToolkit.ts +130 -0
  85. package/src/session/artifact-diff.ts +8 -4
  86. package/src/session/error-handling.ts +41 -0
  87. package/src/session/format.test.ts +5 -4
  88. package/src/session/format.ts +27 -22
  89. package/src/session/index.ts +4 -0
  90. package/src/session/observer.ts +59 -0
  91. package/src/session/session.conversations.json +1 -0
  92. package/src/session/session.test.ts +35 -191
  93. package/src/session/session.ts +119 -185
  94. package/src/session/toolkit.ts +48 -0
  95. package/src/session/version-pin.ts +4 -5
  96. package/src/templates/{format.tpl → instructions/format.tpl} +8 -2
  97. package/src/templates/{system.tpl → instructions/system.tpl} +15 -14
  98. package/src/templates/system.ts +25 -16
  99. package/src/{types.ts → types/artifact.ts} +22 -3
  100. package/src/types/index.ts +5 -0
  101. package/dist/lib/browser/chunk-6WRGDEMH.mjs +0 -89
  102. package/dist/lib/browser/chunk-6WRGDEMH.mjs.map +0 -7
  103. package/dist/lib/browser/chunk-NZGGCEF3.mjs +0 -341
  104. package/dist/lib/browser/chunk-NZGGCEF3.mjs.map +0 -7
  105. package/dist/lib/browser/named-entity-recognition-O46UTCLR.mjs +0 -13
  106. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs +0 -91
  107. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs.map +0 -7
  108. package/dist/lib/node-esm/chunk-XOOPGSGW.mjs +0 -343
  109. package/dist/lib/node-esm/chunk-XOOPGSGW.mjs.map +0 -7
  110. package/dist/lib/node-esm/named-entity-recognition-W4VMRCH6.mjs +0 -14
  111. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  112. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  113. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  114. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  115. package/dist/types/src/types.d.ts +0 -16
  116. package/dist/types/src/types.d.ts.map +0 -1
  117. package/src/session/__snapshots__/session.test.ts.snap +0 -32
  118. package/src/session/version-pin.test.ts +0 -7
  119. package/src/summarization/summarization.test.ts +0 -197
  120. /package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  121. /package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
  122. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -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,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAO,KAAK,GAAG,EAAiB,IAAI,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE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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,50 +1,41 @@
1
- import { type AiError, type AiLanguageModel, type AiTool, type AiToolkit } from '@effect/ai';
2
- import { Effect } from 'effect';
3
- import { type AiInputPreprocessingError, type AiToolNotFoundError, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
4
- import { Event } from '@dxos/async';
1
+ import type * as Toolkit from '@effect/ai/Toolkit';
2
+ import * as Effect from 'effect/Effect';
3
+ import { Resource } from '@dxos/context';
5
4
  import { type Queue } from '@dxos/echo-db';
6
- import { DataType } from '@dxos/schema';
7
- import { type AiAssistantError } from '../errors';
8
- import { AiSession, type GenerationObserver } from '../session';
5
+ import { Message } from '@dxos/types';
6
+ import { type AiSessionRunError, type AiSessionRunRequirements, type GenerationObserver } from '../session';
9
7
  import { AiContextBinder, type ContextBinding } from './context';
10
- export interface AiConversationRunParams<Tools extends AiTool.Any> {
8
+ export interface AiConversationRunParams {
11
9
  prompt: string;
12
10
  system?: string;
13
- toolkit?: AiToolkit.AiToolkit<Tools>;
14
11
  observer?: GenerationObserver;
15
- /**
16
- * @deprecated Remove
17
- */
18
- session?: AiSession;
19
12
  }
20
- export type AiConversationOptions = {
21
- queue: Queue<DataType.Message | ContextBinding>;
22
- };
23
13
  /**
24
- * Persistent conversation state.
25
- * Context + history + artifacts.
26
- * Backed by a Queue.
14
+ * Durable conversation state (initiated by users and agents) backed by a Queue.
15
+ * Executes tools based on AI responses and supports cancellation of in-progress requests.
27
16
  */
28
- export declare class AiConversation {
17
+ export declare class AiConversation extends Resource {
18
+ /**
19
+ * Message and binding queue.
20
+ */
29
21
  private readonly _queue;
30
22
  /**
31
23
  * Blueprints bound to the conversation.
32
24
  */
33
- readonly _context: AiContextBinder;
25
+ private readonly _context;
34
26
  /**
35
- * Fired when the execution loop begins.
36
- * This is called before the first message is sent.
37
- *
38
- * @deprecated Pass in a session instead.
27
+ * Toolkit from the current session request.
39
28
  */
40
- readonly onBegin: Event<AiSession>;
41
- constructor(options: AiConversationOptions);
29
+ private _toolkit;
30
+ constructor(queue: Queue<Message.Message | ContextBinding>);
31
+ protected _open(): Promise<void>;
32
+ protected _close(): Promise<void>;
42
33
  get context(): AiContextBinder;
43
- getHistory(): Promise<DataType.Message[]>;
34
+ get toolkit(): Toolkit.WithHandler<any> | undefined;
35
+ getHistory(): Promise<Message.Message[]>;
44
36
  /**
45
- * Executes a prompt.
46
- * Each invocation creates a new `AiSession`, which handles potential tool calls.
37
+ * Creates a new cancelable request effect.
47
38
  */
48
- run: <Tools extends AiTool.Any>({ session, ...params }: AiConversationRunParams<Tools>) => Effect.Effect<DataType.Message[], AiAssistantError | AiInputPreprocessingError | AiError.AiError | AiToolNotFoundError, AiLanguageModel.AiLanguageModel | ToolResolverService | ToolExecutionService | AiTool.ToHandler<Tools>>;
39
+ createRequest(params: AiConversationRunParams): Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements>;
49
40
  }
50
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,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,MAAM,EAAE,M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CAAC,IAAI,CAAC;cAKtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhD,IAAW,OAAO,oBAEjB;IAED,IAAW,OAAO,yCAEjB;IAEY,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAKrD;;OAEG;IACH,aAAa,CACX,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,CAAC;CA0CjF"}
@@ -0,0 +1,15 @@
1
+ import { DocAccessor } from '@dxos/echo-db';
2
+ export type Diff = {
3
+ match: string;
4
+ replace: string;
5
+ };
6
+ /**
7
+ * Convert a list of diffs into a list of operations.
8
+ */
9
+ export declare const reduceDiffs: (diffs: readonly string[]) => Diff[];
10
+ export declare const computeDiffsWithCursors: <T>(accessor: DocAccessor<T>, diffs: readonly string[]) => {
11
+ cursor: string;
12
+ text: string;
13
+ }[];
14
+ export declare const applyDiffs: <T>(accessor: DocAccessor<T>, diffs: readonly string[]) => string;
15
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=diff.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.test.d.ts","sourceRoot":"","sources":["../../../src/diff.test.ts"],"names":[],"mappings":""}
@@ -1,30 +1,62 @@
1
1
  import { BaseError } from '@dxos/errors';
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";
9
+ stack?: string;
10
+ cause?: unknown;
11
+ };
12
+ code: "AI_MODEL_ERROR";
13
+ is(error: unknown): error is BaseError;
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";
22
+ stack?: string;
23
+ cause?: unknown;
24
+ };
25
+ extend<Code extends string = string>(code: Code, message?: string): any;
26
+ isError(error: unknown): error is Error;
27
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
28
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
29
+ stackTraceLimit: number;
30
+ };
31
+ /**
32
+ * Generic error from AI model.
33
+ */
34
+ export declare class AiModelError extends AiModelError_base {
35
+ }
2
36
  declare const AiAssistantError_base: {
3
- new (message: string, options?: import("@dxos/errors").BaseErrorOptions): {
4
- #code: "AI_ASSISTANT_ERROR";
5
- #context: Record<string, unknown>;
37
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
38
+ code: "AI_ASSISTANT_ERROR";
39
+ context: Record<string, unknown>;
6
40
  readonly name: "AI_ASSISTANT_ERROR";
7
- readonly code: "AI_ASSISTANT_ERROR";
41
+ readonly message: string;
8
42
  readonly _tag: "AI_ASSISTANT_ERROR";
9
- readonly context: Record<string, unknown>;
10
- message: string;
11
43
  stack?: string;
12
44
  cause?: unknown;
13
45
  };
14
46
  code: "AI_ASSISTANT_ERROR";
15
47
  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>;
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>;
19
53
  readonly name: "AI_ASSISTANT_ERROR";
20
- readonly code: "AI_ASSISTANT_ERROR";
54
+ readonly message: string;
21
55
  readonly _tag: "AI_ASSISTANT_ERROR";
22
- readonly context: Record<string, unknown>;
23
- message: string;
24
56
  stack?: string;
25
57
  cause?: unknown;
26
58
  };
27
- extend<Code extends string>(code: Code): any;
59
+ extend<Code extends string = string>(code: Code, message?: string): any;
28
60
  isError(error: unknown): error is Error;
29
61
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
30
62
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
@@ -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"}
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,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAqBF;;GAEG;AACH,qBAAa,cAAc;IAWb,OAAO,CAAC,QAAQ,CAAC,WAAW;IATxC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,YAAY,CAAqB;IAGzC,OAAO,CAAC,kBAAkB,CAA6B;IACvD,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,mBAAmB,CAA6B;gBAE3B,WAAW,GAAE,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAgB;IAElF;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE;IAW3B;;OAEG;IACH,OAAO,CAAC,eAAe;IAsBvB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyB3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAyB5B;;OAEG;IACH,QAAQ,CAAC,WAAW,UAAQ,GAAG;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;IAUxE;;OAEG;IACH,OAAO,CAAC,eAAe;IAqBvB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAmBjC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAoBnC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAK3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=execution-graph.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-graph.test.d.ts","sourceRoot":"","sources":["../../../src/execution-graph.test.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
1
  import { type FunctionDefinition } from '@dxos/functions';
2
2
  import { ExtractionInput, ExtractionOutput } from '../extraction';
3
- export declare const extractionAnthropicFn: FunctionDefinition<ExtractionInput, ExtractionOutput>;
3
+ export declare const extractionAnthropicFunction: FunctionDefinition<ExtractionInput, ExtractionOutput>;
4
4
  //# sourceMappingURL=extraction-llm-function.d.ts.map
@@ -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,qBAAqB,EAAE,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAmDtF,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"}
@@ -1,32 +1,30 @@
1
- export declare const extractionNerFn: import("@dxos/functions").FunctionDefinition<{
2
- readonly objects?: readonly import("@dxos/echo-schema").Expando[] | undefined;
1
+ /**
2
+ * Named Entity Recognition model
3
+ */
4
+ export declare const extractionNerFunction: import("@dxos/functions").FunctionDefinition<{
3
5
  readonly options?: {
4
6
  readonly timeout?: number | undefined;
5
7
  readonly fallbackToRaw?: boolean | undefined;
6
8
  } | undefined;
7
- 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> & {
8
10
  id: string;
9
11
  parentMessage?: string | undefined;
10
12
  created: string;
11
13
  sender: {
12
14
  name?: string | undefined;
13
- contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
14
- fields?: {
15
- readonly value: string;
16
- readonly category?: string | undefined;
17
- readonly label: string;
18
- }[] | undefined;
15
+ contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
19
16
  image?: string | undefined;
20
17
  fullName?: string | undefined;
21
18
  preferredName?: string | undefined;
22
19
  nickname?: string | undefined;
23
- organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
20
+ organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
21
+ description?: string | undefined;
24
22
  id: string;
25
23
  name?: string | undefined;
26
- description?: string | undefined;
27
24
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
28
25
  image?: string | undefined;
29
26
  website?: string | undefined;
27
+ location?: readonly [number, number, (number | undefined)?] | undefined;
30
28
  }> | undefined;
31
29
  jobTitle?: string | undefined;
32
30
  department?: string | undefined;
@@ -60,11 +58,17 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
60
58
  readonly label?: string | undefined;
61
59
  }[] | undefined;
62
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;
63
67
  }> | undefined;
64
68
  identityDid?: string | undefined;
65
69
  identityKey?: string | undefined;
66
70
  email?: string | undefined;
67
- role?: "user" | "assistant" | undefined;
71
+ role?: "user" | "assistant" | "tool" | undefined;
68
72
  };
69
73
  blocks: ({
70
74
  version: unknown;
@@ -72,12 +76,15 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
72
76
  pending?: boolean | undefined;
73
77
  objectId: string;
74
78
  } | {
75
- name?: string | undefined;
76
79
  _tag: "file";
77
80
  pending?: boolean | undefined;
78
81
  url: string;
82
+ name?: string | undefined;
79
83
  mediaType?: string | undefined;
80
84
  } | {
85
+ id?: string | undefined;
86
+ _tag: "image";
87
+ pending?: boolean | undefined;
81
88
  source?: {
82
89
  mediaType: string;
83
90
  type: "base64";
@@ -86,9 +93,6 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
86
93
  url: string;
87
94
  type: "http";
88
95
  } | undefined;
89
- id?: string | undefined;
90
- _tag: "image";
91
- pending?: boolean | undefined;
92
96
  } | {
93
97
  _tag: "json";
94
98
  pending?: boolean | undefined;
@@ -105,7 +109,7 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
105
109
  redactedText?: string | undefined;
106
110
  signature?: string | undefined;
107
111
  } | {
108
- reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
112
+ reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
109
113
  _tag: "reference";
110
114
  pending?: boolean | undefined;
111
115
  } | {
@@ -118,8 +122,22 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
118
122
  statusText: string;
119
123
  } | {
120
124
  text: string;
121
- _tag: "suggest";
125
+ _tag: "suggestion";
126
+ pending?: boolean | undefined;
127
+ } | {
128
+ _tag: "summary";
122
129
  pending?: boolean | undefined;
130
+ mimeType?: string | undefined;
131
+ message?: string | undefined;
132
+ model?: string | undefined;
133
+ usage?: {
134
+ readonly inputTokens?: number | undefined;
135
+ readonly outputTokens?: number | undefined;
136
+ readonly totalTokens?: number | undefined;
137
+ } | undefined;
138
+ toolCalls?: number | undefined;
139
+ errors?: number | undefined;
140
+ duration?: number | undefined;
123
141
  } | {
124
142
  text: string;
125
143
  _tag: "text";
@@ -130,17 +148,19 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
130
148
  _tag: "toolkit";
131
149
  pending?: boolean | undefined;
132
150
  } | {
133
- name: string;
134
151
  _tag: "toolCall";
135
152
  pending?: boolean | undefined;
153
+ name: string;
136
154
  toolCallId: string;
137
- input: unknown;
155
+ input: string;
156
+ providerExecuted: boolean;
138
157
  } | {
139
- name: string;
140
158
  _tag: "toolResult";
141
159
  pending?: boolean | undefined;
160
+ name: string;
142
161
  toolCallId: string;
143
- result: unknown;
162
+ providerExecuted: boolean;
163
+ result?: string | undefined;
144
164
  error?: string | undefined;
145
165
  } | {
146
166
  text: string;
@@ -152,30 +172,27 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
152
172
  [x: string]: any;
153
173
  } | undefined;
154
174
  };
175
+ readonly objects?: readonly import("@dxos/echo/internal").Expando[] | undefined;
155
176
  }, {
156
- 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> & {
157
178
  id: string;
158
179
  parentMessage?: string | undefined;
159
180
  created: string;
160
181
  sender: {
161
182
  name?: string | undefined;
162
- contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
163
- fields?: {
164
- readonly value: string;
165
- readonly category?: string | undefined;
166
- readonly label: string;
167
- }[] | undefined;
183
+ contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
168
184
  image?: string | undefined;
169
185
  fullName?: string | undefined;
170
186
  preferredName?: string | undefined;
171
187
  nickname?: string | undefined;
172
- organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
188
+ organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
189
+ description?: string | undefined;
173
190
  id: string;
174
191
  name?: string | undefined;
175
- description?: string | undefined;
176
192
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
177
193
  image?: string | undefined;
178
194
  website?: string | undefined;
195
+ location?: readonly [number, number, (number | undefined)?] | undefined;
179
196
  }> | undefined;
180
197
  jobTitle?: string | undefined;
181
198
  department?: string | undefined;
@@ -209,11 +226,17 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
209
226
  readonly label?: string | undefined;
210
227
  }[] | undefined;
211
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;
212
235
  }> | undefined;
213
236
  identityDid?: string | undefined;
214
237
  identityKey?: string | undefined;
215
238
  email?: string | undefined;
216
- role?: "user" | "assistant" | undefined;
239
+ role?: "user" | "assistant" | "tool" | undefined;
217
240
  };
218
241
  blocks: ({
219
242
  version: unknown;
@@ -221,12 +244,15 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
221
244
  pending?: boolean | undefined;
222
245
  objectId: string;
223
246
  } | {
224
- name?: string | undefined;
225
247
  _tag: "file";
226
248
  pending?: boolean | undefined;
227
249
  url: string;
250
+ name?: string | undefined;
228
251
  mediaType?: string | undefined;
229
252
  } | {
253
+ id?: string | undefined;
254
+ _tag: "image";
255
+ pending?: boolean | undefined;
230
256
  source?: {
231
257
  mediaType: string;
232
258
  type: "base64";
@@ -235,9 +261,6 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
235
261
  url: string;
236
262
  type: "http";
237
263
  } | undefined;
238
- id?: string | undefined;
239
- _tag: "image";
240
- pending?: boolean | undefined;
241
264
  } | {
242
265
  _tag: "json";
243
266
  pending?: boolean | undefined;
@@ -254,7 +277,7 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
254
277
  redactedText?: string | undefined;
255
278
  signature?: string | undefined;
256
279
  } | {
257
- reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
280
+ reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
258
281
  _tag: "reference";
259
282
  pending?: boolean | undefined;
260
283
  } | {
@@ -267,8 +290,22 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
267
290
  statusText: string;
268
291
  } | {
269
292
  text: string;
270
- _tag: "suggest";
293
+ _tag: "suggestion";
294
+ pending?: boolean | undefined;
295
+ } | {
296
+ _tag: "summary";
271
297
  pending?: boolean | undefined;
298
+ mimeType?: string | undefined;
299
+ message?: string | undefined;
300
+ model?: string | undefined;
301
+ usage?: {
302
+ readonly inputTokens?: number | undefined;
303
+ readonly outputTokens?: number | undefined;
304
+ readonly totalTokens?: number | undefined;
305
+ } | undefined;
306
+ toolCalls?: number | undefined;
307
+ errors?: number | undefined;
308
+ duration?: number | undefined;
272
309
  } | {
273
310
  text: string;
274
311
  _tag: "text";
@@ -279,17 +316,19 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
279
316
  _tag: "toolkit";
280
317
  pending?: boolean | undefined;
281
318
  } | {
282
- name: string;
283
319
  _tag: "toolCall";
284
320
  pending?: boolean | undefined;
321
+ name: string;
285
322
  toolCallId: string;
286
- input: unknown;
323
+ input: string;
324
+ providerExecuted: boolean;
287
325
  } | {
288
- name: string;
289
326
  _tag: "toolResult";
290
327
  pending?: boolean | undefined;
328
+ name: string;
291
329
  toolCallId: string;
292
- result: unknown;
330
+ providerExecuted: boolean;
331
+ result?: string | undefined;
293
332
  error?: string | undefined;
294
333
  } | {
295
334
  text: string;
@@ -302,5 +341,5 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
302
341
  } | undefined;
303
342
  };
304
343
  readonly timeElapsed: number;
305
- }>;
344
+ }, import("@dxos/functions").FunctionServices>;
306
345
  //# sourceMappingURL=extraction-ner-function.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsC1B,CAAC"}
1
+ {"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAQA;;GAEG;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CA2ChC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"named-entity-recognition.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/named-entity-recognition.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAE/B,MAAM,sBAAsB,CAAC;AAK9B;;;;GAIG;AACH,eAAO,MAAM,MAAM,gDAQlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,yBAAyB,EAAE,CAM3F,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,yBAAyB,EAAE,KAAG,yBAAyB,EAAE,EAmClG,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,yBAAyB,EAAE,KAAG,yBAmBrE,CAAC"}
1
+ {"version":3,"file":"named-entity-recognition.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/named-entity-recognition.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAE/B,MAAM,sBAAsB,CAAC;AAM9B;;;;GAIG;AACH,eAAO,MAAM,MAAM,gDASlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,yBAAyB,EAAE,CAM3F,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,yBAAyB,EAAE,KAAG,yBAAyB,EAAE,EAmClG,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,yBAAyB,EAAE,KAAG,yBAmBrE,CAAC"}