@olane/o-lane 0.7.12-alpha.74 → 0.7.12-alpha.76

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 (46) hide show
  1. package/dist/src/ag-ui/ag-ui-constants.d.ts +90 -0
  2. package/dist/src/ag-ui/ag-ui-constants.d.ts.map +1 -0
  3. package/dist/src/ag-ui/ag-ui-constants.js +113 -0
  4. package/dist/src/ag-ui/ag-ui-event-mapper.d.ts +88 -0
  5. package/dist/src/ag-ui/ag-ui-event-mapper.d.ts.map +1 -0
  6. package/dist/src/ag-ui/ag-ui-event-mapper.js +487 -0
  7. package/dist/src/ag-ui/ag-ui-olane.tool.d.ts +45 -0
  8. package/dist/src/ag-ui/ag-ui-olane.tool.d.ts.map +1 -0
  9. package/dist/src/ag-ui/ag-ui-olane.tool.js +257 -0
  10. package/dist/src/ag-ui/ag-ui-stream-manager.d.ts +99 -0
  11. package/dist/src/ag-ui/ag-ui-stream-manager.d.ts.map +1 -0
  12. package/dist/src/ag-ui/ag-ui-stream-manager.js +160 -0
  13. package/dist/src/ag-ui/ag-ui-utils.d.ts +50 -0
  14. package/dist/src/ag-ui/ag-ui-utils.d.ts.map +1 -0
  15. package/dist/src/ag-ui/ag-ui-utils.js +287 -0
  16. package/dist/src/ag-ui/index.d.ts +17 -0
  17. package/dist/src/ag-ui/index.d.ts.map +1 -0
  18. package/dist/src/ag-ui/index.js +21 -0
  19. package/dist/src/ag-ui/transports/ag-ui-transport.interface.d.ts +44 -0
  20. package/dist/src/ag-ui/transports/ag-ui-transport.interface.d.ts.map +1 -0
  21. package/dist/src/ag-ui/transports/ag-ui-transport.interface.js +26 -0
  22. package/dist/src/ag-ui/transports/callback-transport.d.ts +13 -0
  23. package/dist/src/ag-ui/transports/callback-transport.d.ts.map +1 -0
  24. package/dist/src/ag-ui/transports/callback-transport.js +26 -0
  25. package/dist/src/ag-ui/transports/console-transport.d.ts +14 -0
  26. package/dist/src/ag-ui/transports/console-transport.d.ts.map +1 -0
  27. package/dist/src/ag-ui/transports/console-transport.js +63 -0
  28. package/dist/src/ag-ui/transports/index.d.ts +5 -0
  29. package/dist/src/ag-ui/transports/index.d.ts.map +1 -0
  30. package/dist/src/ag-ui/transports/index.js +4 -0
  31. package/dist/src/ag-ui/transports/onode-transport.d.ts +34 -0
  32. package/dist/src/ag-ui/transports/onode-transport.d.ts.map +1 -0
  33. package/dist/src/ag-ui/transports/onode-transport.js +83 -0
  34. package/dist/src/ag-ui/types/ag-ui-config.interface.d.ts +105 -0
  35. package/dist/src/ag-ui/types/ag-ui-config.interface.d.ts.map +1 -0
  36. package/dist/src/ag-ui/types/ag-ui-config.interface.js +1 -0
  37. package/dist/src/ag-ui/types/ag-ui-event.types.d.ts +266 -0
  38. package/dist/src/ag-ui/types/ag-ui-event.types.d.ts.map +1 -0
  39. package/dist/src/ag-ui/types/ag-ui-event.types.js +6 -0
  40. package/dist/src/ag-ui/types/index.d.ts +3 -0
  41. package/dist/src/ag-ui/types/index.d.ts.map +1 -0
  42. package/dist/src/ag-ui/types/index.js +2 -0
  43. package/dist/src/index.d.ts +1 -0
  44. package/dist/src/index.d.ts.map +1 -1
  45. package/dist/src/index.js +2 -0
  46. package/package.json +7 -7
@@ -0,0 +1,90 @@
1
+ /**
2
+ * AG-UI Protocol Constants
3
+ */
4
+ /**
5
+ * AG-UI protocol version this implementation supports
6
+ */
7
+ export declare const AG_UI_PROTOCOL_VERSION = "1.0.0";
8
+ /**
9
+ * Default configuration values
10
+ */
11
+ export declare const AG_UI_DEFAULTS: {
12
+ /**
13
+ * Default state snapshot interval (every N cycles)
14
+ */
15
+ STATE_SNAPSHOT_INTERVAL: number;
16
+ /**
17
+ * Maximum delta history to keep
18
+ */
19
+ MAX_DELTA_HISTORY: number;
20
+ /**
21
+ * Default text chunk size for streaming
22
+ */
23
+ TEXT_CHUNK_SIZE: number;
24
+ /**
25
+ * Enable debug logging by default
26
+ */
27
+ DEBUG_ENABLED: boolean;
28
+ /**
29
+ * Enable AG-UI by default
30
+ */
31
+ AGUI_ENABLED: boolean;
32
+ /**
33
+ * Emit activity events by default
34
+ */
35
+ EMIT_ACTIVITY_EVENTS: boolean;
36
+ /**
37
+ * Emit reasoning events by default
38
+ */
39
+ EMIT_REASONING_EVENTS: boolean;
40
+ /**
41
+ * Include raw events by default
42
+ */
43
+ INCLUDE_RAW_EVENTS: boolean;
44
+ /**
45
+ * Auto-generate thread ID by default
46
+ */
47
+ AUTO_GENERATE_THREAD_ID: boolean;
48
+ };
49
+ /**
50
+ * Activity types for AG-UI activity events
51
+ */
52
+ export declare const ACTIVITY_TYPES: {
53
+ readonly PLAN: "PLAN";
54
+ readonly EXECUTE: "EXECUTE";
55
+ readonly EVALUATE: "EVALUATE";
56
+ readonly SEARCH: "SEARCH";
57
+ readonly CONFIGURE: "CONFIGURE";
58
+ readonly ERROR: "ERROR";
59
+ readonly PROGRESS: "PROGRESS";
60
+ };
61
+ /**
62
+ * Event type categories for filtering
63
+ */
64
+ export declare const EVENT_CATEGORIES: {
65
+ readonly LIFECYCLE: readonly ["RunStarted", "RunFinished", "RunError", "StepStarted", "StepFinished"];
66
+ readonly MESSAGES: readonly ["TextMessageStart", "TextMessageContent", "TextMessageEnd", "TextMessageChunk"];
67
+ readonly TOOL_CALLS: readonly ["ToolCallStart", "ToolCallArgs", "ToolCallEnd", "ToolCallResult", "ToolCallChunk"];
68
+ readonly STATE: readonly ["StateSnapshot", "StateDelta", "MessagesSnapshot"];
69
+ readonly ACTIVITY: readonly ["ActivitySnapshot", "ActivityDelta"];
70
+ readonly SPECIAL: readonly ["Raw", "Custom"];
71
+ readonly REASONING: readonly ["ReasoningStart", "ReasoningEnd", "ReasoningMessageStart", "ReasoningMessageContent", "ReasoningMessageEnd", "ReasoningMessageChunk"];
72
+ };
73
+ /**
74
+ * Default message roles
75
+ */
76
+ export declare const MESSAGE_ROLES: {
77
+ readonly DEVELOPER: "developer";
78
+ readonly SYSTEM: "system";
79
+ readonly ASSISTANT: "assistant";
80
+ readonly USER: "user";
81
+ readonly TOOL: "tool";
82
+ };
83
+ /**
84
+ * Run outcome types
85
+ */
86
+ export declare const RUN_OUTCOMES: {
87
+ readonly SUCCESS: "success";
88
+ readonly INTERRUPT: "interrupt";
89
+ };
90
+ //# sourceMappingURL=ag-ui-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ag-ui-constants.d.ts","sourceRoot":"","sources":["../../../src/ag-ui/ag-ui-constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEJ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;CAgCnB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY;;;CAGf,CAAC"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * AG-UI Protocol Constants
3
+ */
4
+ /**
5
+ * AG-UI protocol version this implementation supports
6
+ */
7
+ export const AG_UI_PROTOCOL_VERSION = '1.0.0';
8
+ /**
9
+ * Default configuration values
10
+ */
11
+ export const AG_UI_DEFAULTS = {
12
+ /**
13
+ * Default state snapshot interval (every N cycles)
14
+ */
15
+ STATE_SNAPSHOT_INTERVAL: 5,
16
+ /**
17
+ * Maximum delta history to keep
18
+ */
19
+ MAX_DELTA_HISTORY: 100,
20
+ /**
21
+ * Default text chunk size for streaming
22
+ */
23
+ TEXT_CHUNK_SIZE: 100,
24
+ /**
25
+ * Enable debug logging by default
26
+ */
27
+ DEBUG_ENABLED: false,
28
+ /**
29
+ * Enable AG-UI by default
30
+ */
31
+ AGUI_ENABLED: true,
32
+ /**
33
+ * Emit activity events by default
34
+ */
35
+ EMIT_ACTIVITY_EVENTS: true,
36
+ /**
37
+ * Emit reasoning events by default
38
+ */
39
+ EMIT_REASONING_EVENTS: true,
40
+ /**
41
+ * Include raw events by default
42
+ */
43
+ INCLUDE_RAW_EVENTS: false,
44
+ /**
45
+ * Auto-generate thread ID by default
46
+ */
47
+ AUTO_GENERATE_THREAD_ID: true,
48
+ };
49
+ /**
50
+ * Activity types for AG-UI activity events
51
+ */
52
+ export const ACTIVITY_TYPES = {
53
+ PLAN: 'PLAN',
54
+ EXECUTE: 'EXECUTE',
55
+ EVALUATE: 'EVALUATE',
56
+ SEARCH: 'SEARCH',
57
+ CONFIGURE: 'CONFIGURE',
58
+ ERROR: 'ERROR',
59
+ PROGRESS: 'PROGRESS',
60
+ };
61
+ /**
62
+ * Event type categories for filtering
63
+ */
64
+ export const EVENT_CATEGORIES = {
65
+ LIFECYCLE: [
66
+ 'RunStarted',
67
+ 'RunFinished',
68
+ 'RunError',
69
+ 'StepStarted',
70
+ 'StepFinished',
71
+ ],
72
+ MESSAGES: [
73
+ 'TextMessageStart',
74
+ 'TextMessageContent',
75
+ 'TextMessageEnd',
76
+ 'TextMessageChunk',
77
+ ],
78
+ TOOL_CALLS: [
79
+ 'ToolCallStart',
80
+ 'ToolCallArgs',
81
+ 'ToolCallEnd',
82
+ 'ToolCallResult',
83
+ 'ToolCallChunk',
84
+ ],
85
+ STATE: ['StateSnapshot', 'StateDelta', 'MessagesSnapshot'],
86
+ ACTIVITY: ['ActivitySnapshot', 'ActivityDelta'],
87
+ SPECIAL: ['Raw', 'Custom'],
88
+ REASONING: [
89
+ 'ReasoningStart',
90
+ 'ReasoningEnd',
91
+ 'ReasoningMessageStart',
92
+ 'ReasoningMessageContent',
93
+ 'ReasoningMessageEnd',
94
+ 'ReasoningMessageChunk',
95
+ ],
96
+ };
97
+ /**
98
+ * Default message roles
99
+ */
100
+ export const MESSAGE_ROLES = {
101
+ DEVELOPER: 'developer',
102
+ SYSTEM: 'system',
103
+ ASSISTANT: 'assistant',
104
+ USER: 'user',
105
+ TOOL: 'tool',
106
+ };
107
+ /**
108
+ * Run outcome types
109
+ */
110
+ export const RUN_OUTCOMES = {
111
+ SUCCESS: 'success',
112
+ INTERRUPT: 'interrupt',
113
+ };
@@ -0,0 +1,88 @@
1
+ import { oCapabilityType } from '../capabilities/enums/o-capability.type-enum.js';
2
+ import { oCapabilityResult } from '../capabilities/o-capability.result.js';
3
+ import { oIntent } from '../intent/o-intent.js';
4
+ import { AGUIEvent, RunStarted, RunFinished, RunError, StepStarted, StepFinished, StateSnapshot, StateDelta, ActivitySnapshot } from './types/ag-ui-event.types.js';
5
+ import { AGUIEventContext, AGUIEventMappingConfig } from './types/ag-ui-config.interface.js';
6
+ /**
7
+ * Maps oLane execution events to AG-UI protocol events
8
+ */
9
+ export declare class AGUIEventMapper {
10
+ private config;
11
+ private context;
12
+ constructor(context: AGUIEventContext, config?: Partial<AGUIEventMappingConfig>);
13
+ /**
14
+ * Map lane creation to RunStarted event
15
+ */
16
+ mapLaneStartToRunStarted(intent: oIntent, input?: unknown): RunStarted;
17
+ /**
18
+ * Map lane completion to RunFinished event
19
+ */
20
+ mapLaneCompleteToRunFinished(result: oCapabilityResult): RunFinished;
21
+ /**
22
+ * Map lane error to RunError event
23
+ */
24
+ mapLaneErrorToRunError(error: Error | string): RunError;
25
+ /**
26
+ * Map capability execution start to StepStarted event
27
+ */
28
+ mapCapabilityStartToStepStarted(capabilityType: oCapabilityType): StepStarted;
29
+ /**
30
+ * Map capability execution end to StepFinished event
31
+ */
32
+ mapCapabilityEndToStepFinished(capabilityType: oCapabilityType): StepFinished;
33
+ /**
34
+ * Map capability result to appropriate AG-UI events
35
+ * This is the core mapping logic that handles different capability types
36
+ */
37
+ mapCapabilityToEvents(result: oCapabilityResult, cycleNumber: number): AGUIEvent[];
38
+ /**
39
+ * Map EVALUATE capability to text message events (agent reasoning)
40
+ */
41
+ private mapEvaluateCapability;
42
+ /**
43
+ * Map TASK capability to tool call events
44
+ */
45
+ private mapTaskCapability;
46
+ /**
47
+ * Map SEARCH capability to activity events
48
+ */
49
+ private mapSearchCapability;
50
+ /**
51
+ * Map CONFIGURE capability to activity events
52
+ */
53
+ private mapConfigureCapability;
54
+ /**
55
+ * Map MULTIPLE_STEP capability to activity events
56
+ */
57
+ private mapMultipleStepCapability;
58
+ /**
59
+ * Map ERROR capability to activity events
60
+ */
61
+ private mapErrorCapability;
62
+ /**
63
+ * Map unknown capability to custom event
64
+ */
65
+ private mapUnknownCapability;
66
+ /**
67
+ * Map execution sequence to state snapshot
68
+ */
69
+ mapSequenceToStateSnapshot(sequence: oCapabilityResult[]): StateSnapshot;
70
+ /**
71
+ * Map execution sequence update to state delta
72
+ */
73
+ mapSequenceToStateDelta(oldSequence: oCapabilityResult[], newSequence: oCapabilityResult[]): StateDelta | null;
74
+ /**
75
+ * Map streaming chunk to activity event
76
+ * Extracts capability result from oResponse wrapper and maps appropriately
77
+ */
78
+ mapChunkToActivity(chunk: any, cycleNumber: number): ActivitySnapshot;
79
+ /**
80
+ * Update the event context
81
+ */
82
+ updateContext(updates: Partial<AGUIEventContext>): void;
83
+ /**
84
+ * Get current context
85
+ */
86
+ getContext(): AGUIEventContext;
87
+ }
88
+ //# sourceMappingURL=ag-ui-event-mapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ag-ui-event-mapper.d.ts","sourceRoot":"","sources":["../../../src/ag-ui/ag-ui-event-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,SAAS,EACT,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,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