@olane/o-lane 0.7.12-alpha.9 → 0.7.13-alpha.0

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 (97) hide show
  1. package/dist/src/capabilities/enums/o-capability.type-enum.d.ts +1 -0
  2. package/dist/src/capabilities/enums/o-capability.type-enum.d.ts.map +1 -1
  3. package/dist/src/capabilities/enums/o-capability.type-enum.js +1 -0
  4. package/dist/src/capabilities/interfaces/o-capability.config.d.ts +4 -2
  5. package/dist/src/capabilities/interfaces/o-capability.config.d.ts.map +1 -1
  6. package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts +1 -0
  7. package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts.map +1 -1
  8. package/dist/src/capabilities/o-capability.d.ts +3 -2
  9. package/dist/src/capabilities/o-capability.d.ts.map +1 -1
  10. package/dist/src/capabilities/o-capability.intelligence.d.ts.map +1 -1
  11. package/dist/src/capabilities/o-capability.intelligence.js +33 -8
  12. package/dist/src/capabilities/o-capability.js +3 -0
  13. package/dist/src/capabilities/o-capability.result.d.ts +2 -0
  14. package/dist/src/capabilities/o-capability.result.d.ts.map +1 -1
  15. package/dist/src/capabilities/o-capability.result.js +2 -0
  16. package/dist/src/capabilities/utils/result-stream-parser.d.ts +37 -0
  17. package/dist/src/capabilities/utils/result-stream-parser.d.ts.map +1 -0
  18. package/dist/src/capabilities/utils/result-stream-parser.js +90 -0
  19. package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts +1 -0
  20. package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts.map +1 -1
  21. package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts +2 -0
  22. package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts.map +1 -1
  23. package/dist/src/capabilities-multiple-step/o-capability.multiple-step.js +12 -0
  24. package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts +1 -0
  25. package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts.map +1 -1
  26. package/dist/src/capabilities-search/o-capability.search.d.ts.map +1 -1
  27. package/dist/src/capabilities-search/o-capability.search.js +24 -6
  28. package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts +1 -0
  29. package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts.map +1 -1
  30. package/dist/src/capabilities-task/o-capability.task.d.ts.map +1 -1
  31. package/dist/src/capabilities-task/o-capability.task.js +4 -0
  32. package/dist/src/errors/capability-errors.d.ts +71 -0
  33. package/dist/src/errors/capability-errors.d.ts.map +1 -0
  34. package/dist/src/errors/capability-errors.js +142 -0
  35. package/dist/src/errors/index.d.ts +5 -0
  36. package/dist/src/errors/index.d.ts.map +1 -0
  37. package/dist/src/errors/index.js +4 -0
  38. package/dist/src/formatters/index.d.ts +7 -0
  39. package/dist/src/formatters/index.d.ts.map +1 -0
  40. package/dist/src/formatters/index.js +6 -0
  41. package/dist/src/formatters/markdown-builder.d.ts +65 -0
  42. package/dist/src/formatters/markdown-builder.d.ts.map +1 -0
  43. package/dist/src/formatters/markdown-builder.js +120 -0
  44. package/dist/src/index.d.ts +2 -0
  45. package/dist/src/index.d.ts.map +1 -1
  46. package/dist/src/index.js +2 -0
  47. package/dist/src/interfaces/o-lane.config.d.ts +5 -2
  48. package/dist/src/interfaces/o-lane.config.d.ts.map +1 -1
  49. package/dist/src/o-lane.d.ts +8 -1
  50. package/dist/src/o-lane.d.ts.map +1 -1
  51. package/dist/src/o-lane.js +165 -23
  52. package/dist/src/o-lane.mixin.d.ts +17 -0
  53. package/dist/src/o-lane.mixin.d.ts.map +1 -0
  54. package/dist/src/o-lane.mixin.js +136 -0
  55. package/dist/src/o-lane.tool.d.ts +12 -19
  56. package/dist/src/o-lane.tool.d.ts.map +1 -1
  57. package/dist/src/o-lane.tool.js +11 -93
  58. package/dist/src/prompts/agent.prompt.d.ts +11 -0
  59. package/dist/src/prompts/agent.prompt.d.ts.map +1 -1
  60. package/dist/src/prompts/agent.prompt.js +34 -10
  61. package/dist/src/prompts/configure.prompt.d.ts +7 -0
  62. package/dist/src/prompts/configure.prompt.d.ts.map +1 -1
  63. package/dist/src/prompts/configure.prompt.js +8 -1
  64. package/dist/src/prompts/custom.prompt.d.ts +7 -0
  65. package/dist/src/prompts/custom.prompt.d.ts.map +1 -1
  66. package/dist/src/prompts/custom.prompt.js +77 -0
  67. package/dist/src/storage/index.d.ts +8 -0
  68. package/dist/src/storage/index.d.ts.map +1 -0
  69. package/dist/src/storage/index.js +12 -0
  70. package/dist/src/storage/interfaces/prompt-storage.interface.d.ts +102 -0
  71. package/dist/src/storage/interfaces/prompt-storage.interface.d.ts.map +1 -0
  72. package/dist/src/storage/interfaces/prompt-storage.interface.js +1 -0
  73. package/dist/src/storage/methods/prompt-storage.methods.d.ts +9 -0
  74. package/dist/src/storage/methods/prompt-storage.methods.d.ts.map +1 -0
  75. package/dist/src/storage/methods/prompt-storage.methods.js +338 -0
  76. package/dist/src/storage/prompt-loader.d.ts +40 -0
  77. package/dist/src/storage/prompt-loader.d.ts.map +1 -0
  78. package/dist/src/storage/prompt-loader.js +126 -0
  79. package/dist/src/storage/prompt-schema.d.ts +42 -0
  80. package/dist/src/storage/prompt-schema.d.ts.map +1 -0
  81. package/dist/src/storage/prompt-schema.js +29 -0
  82. package/dist/src/storage/prompt-seeder.d.ts +42 -0
  83. package/dist/src/storage/prompt-seeder.d.ts.map +1 -0
  84. package/dist/src/storage/prompt-seeder.js +141 -0
  85. package/dist/src/storage/prompt-storage-provider.tool.d.ts +99 -0
  86. package/dist/src/storage/prompt-storage-provider.tool.d.ts.map +1 -0
  87. package/dist/src/storage/prompt-storage-provider.tool.js +320 -0
  88. package/dist/test/prompt-seeder.spec.d.ts +2 -0
  89. package/dist/test/prompt-seeder.spec.d.ts.map +1 -0
  90. package/dist/test/prompt-seeder.spec.js +254 -0
  91. package/dist/test/prompt-storage-provider.spec.d.ts +2 -0
  92. package/dist/test/prompt-storage-provider.spec.d.ts.map +1 -0
  93. package/dist/test/prompt-storage-provider.spec.js +456 -0
  94. package/package.json +10 -7
  95. package/dist/test/ai.spec.d.ts +0 -2
  96. package/dist/test/ai.spec.d.ts.map +0 -1
  97. package/dist/test/ai.spec.js +0 -19
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Structured error types for capability execution
3
+ */
4
+ export var CapabilityErrorType;
5
+ (function (CapabilityErrorType) {
6
+ // Tool/Resource errors
7
+ CapabilityErrorType["NOT_FOUND"] = "not_found";
8
+ CapabilityErrorType["UNAUTHORIZED"] = "unauthorized";
9
+ CapabilityErrorType["FORBIDDEN"] = "forbidden";
10
+ // Configuration errors
11
+ CapabilityErrorType["INVALID_CONFIG"] = "invalid_config";
12
+ CapabilityErrorType["MISSING_PARAMETER"] = "missing_parameter";
13
+ CapabilityErrorType["INVALID_PARAMETER"] = "invalid_parameter";
14
+ // Execution errors
15
+ CapabilityErrorType["TOOL_ERROR"] = "tool_error";
16
+ CapabilityErrorType["TIMEOUT"] = "timeout";
17
+ CapabilityErrorType["NETWORK_ERROR"] = "network_error";
18
+ // State errors
19
+ CapabilityErrorType["INVALID_STATE"] = "invalid_state";
20
+ CapabilityErrorType["RESOURCE_EXHAUSTED"] = "resource_exhausted";
21
+ // Unknown
22
+ CapabilityErrorType["UNKNOWN"] = "unknown";
23
+ })(CapabilityErrorType || (CapabilityErrorType = {}));
24
+ /**
25
+ * Structured capability error with context and remediation suggestions
26
+ */
27
+ export class CapabilityError extends Error {
28
+ constructor(type, message, context = {}, originalError) {
29
+ super(message);
30
+ this.name = 'CapabilityError';
31
+ this.type = type;
32
+ this.context = context;
33
+ this.originalError = originalError;
34
+ // Maintain proper stack trace
35
+ if (Error.captureStackTrace) {
36
+ Error.captureStackTrace(this, CapabilityError);
37
+ }
38
+ }
39
+ /**
40
+ * Get a human-readable error message with context
41
+ */
42
+ toHumanReadable() {
43
+ let message = `${this.getErrorTypeLabel()}: ${this.message}`;
44
+ if (this.context.cycle !== undefined) {
45
+ message += `\n\nOccurred in Cycle ${this.context.cycle}`;
46
+ }
47
+ if (this.context.capabilityType) {
48
+ message += `\nCapability: ${this.context.capabilityType}`;
49
+ }
50
+ if (this.context.toolAddress) {
51
+ message += `\nTool: ${this.context.toolAddress}`;
52
+ }
53
+ if (this.context.method) {
54
+ message += `\nMethod: ${this.context.method}`;
55
+ }
56
+ const remediation = this.getRemediation();
57
+ if (remediation) {
58
+ message += `\n\nSuggestion: ${remediation}`;
59
+ }
60
+ return message;
61
+ }
62
+ /**
63
+ * Get a friendly label for the error type
64
+ */
65
+ getErrorTypeLabel() {
66
+ const labels = {
67
+ [CapabilityErrorType.NOT_FOUND]: 'Resource Not Found',
68
+ [CapabilityErrorType.UNAUTHORIZED]: 'Unauthorized',
69
+ [CapabilityErrorType.FORBIDDEN]: 'Forbidden',
70
+ [CapabilityErrorType.INVALID_CONFIG]: 'Invalid Configuration',
71
+ [CapabilityErrorType.MISSING_PARAMETER]: 'Missing Parameter',
72
+ [CapabilityErrorType.INVALID_PARAMETER]: 'Invalid Parameter',
73
+ [CapabilityErrorType.TOOL_ERROR]: 'Tool Execution Error',
74
+ [CapabilityErrorType.TIMEOUT]: 'Timeout',
75
+ [CapabilityErrorType.NETWORK_ERROR]: 'Network Error',
76
+ [CapabilityErrorType.INVALID_STATE]: 'Invalid State',
77
+ [CapabilityErrorType.RESOURCE_EXHAUSTED]: 'Resource Exhausted',
78
+ [CapabilityErrorType.UNKNOWN]: 'Unknown Error',
79
+ };
80
+ return labels[this.type] || 'Error';
81
+ }
82
+ /**
83
+ * Get remediation suggestion based on error type
84
+ */
85
+ getRemediation() {
86
+ const remediations = {
87
+ [CapabilityErrorType.NOT_FOUND]: 'Verify the tool address exists and is accessible. Use search to find available tools.',
88
+ [CapabilityErrorType.UNAUTHORIZED]: 'Check that you have the necessary permissions to access this resource.',
89
+ [CapabilityErrorType.INVALID_CONFIG]: 'Review the configuration parameters and ensure they match the required format.',
90
+ [CapabilityErrorType.MISSING_PARAMETER]: 'Provide all required parameters. Use the tool\'s handshake to see parameter requirements.',
91
+ [CapabilityErrorType.INVALID_PARAMETER]: 'Check that parameter values match the expected types and constraints.',
92
+ [CapabilityErrorType.TOOL_ERROR]: 'Review the tool\'s error message and adjust your request accordingly.',
93
+ [CapabilityErrorType.TIMEOUT]: 'The operation took too long. Try simplifying the request or increasing the timeout.',
94
+ [CapabilityErrorType.NETWORK_ERROR]: 'Check your network connection and try again.',
95
+ [CapabilityErrorType.RESOURCE_EXHAUSTED]: 'You may have hit a rate limit or resource quota. Try again later.',
96
+ };
97
+ return remediations[this.type] || null;
98
+ }
99
+ /**
100
+ * Convert to JSON for serialization
101
+ */
102
+ toJSON() {
103
+ return {
104
+ name: this.name,
105
+ type: this.type,
106
+ message: this.message,
107
+ context: this.context,
108
+ humanReadable: this.toHumanReadable(),
109
+ stack: this.stack,
110
+ };
111
+ }
112
+ /**
113
+ * Create a CapabilityError from a generic error
114
+ */
115
+ static from(error, context = {}) {
116
+ if (error instanceof CapabilityError) {
117
+ return error;
118
+ }
119
+ // Try to infer error type from message
120
+ let type = CapabilityErrorType.UNKNOWN;
121
+ const message = error?.message || String(error);
122
+ if (message.includes('not found') || message.includes('404')) {
123
+ type = CapabilityErrorType.NOT_FOUND;
124
+ }
125
+ else if (message.includes('unauthorized') || message.includes('401')) {
126
+ type = CapabilityErrorType.UNAUTHORIZED;
127
+ }
128
+ else if (message.includes('forbidden') || message.includes('403')) {
129
+ type = CapabilityErrorType.FORBIDDEN;
130
+ }
131
+ else if (message.includes('timeout')) {
132
+ type = CapabilityErrorType.TIMEOUT;
133
+ }
134
+ else if (message.includes('network') || message.includes('ECONNREFUSED')) {
135
+ type = CapabilityErrorType.NETWORK_ERROR;
136
+ }
137
+ else if (message.includes('parameter') || message.includes('config')) {
138
+ type = CapabilityErrorType.INVALID_CONFIG;
139
+ }
140
+ return new CapabilityError(type, message, context, error instanceof Error ? error : undefined);
141
+ }
142
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Error handling exports
3
+ */
4
+ export { CapabilityError, CapabilityErrorType, type CapabilityErrorContext, } from './capability-errors.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,KAAK,sBAAsB,GAC5B,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Error handling exports
3
+ */
4
+ export { CapabilityError, CapabilityErrorType, } from './capability-errors.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utilities for programmatic markdown generation
3
+ * Used only for system-generated content like execution traces
4
+ * AI-generated responses handle their own formatting via prompts
5
+ */
6
+ export { MarkdownBuilder } from './markdown-builder.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formatters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Utilities for programmatic markdown generation
3
+ * Used only for system-generated content like execution traces
4
+ * AI-generated responses handle their own formatting via prompts
5
+ */
6
+ export { MarkdownBuilder } from './markdown-builder.js';
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Utility class for building markdown formatted strings
3
+ * Used for programmatic content generation (execution traces, etc.)
4
+ * NOT used for AI-generated responses - AI handles its own formatting
5
+ */
6
+ export declare class MarkdownBuilder {
7
+ private parts;
8
+ /**
9
+ * Add a header
10
+ */
11
+ header(text: string, level?: number): this;
12
+ /**
13
+ * Add a paragraph
14
+ */
15
+ paragraph(text: string): this;
16
+ /**
17
+ * Add a bulleted list
18
+ */
19
+ list(items: string[], ordered?: boolean): this;
20
+ /**
21
+ * Add a code block
22
+ */
23
+ code(content: string, language?: string): this;
24
+ /**
25
+ * Add inline code
26
+ */
27
+ inline(text: string): string;
28
+ /**
29
+ * Add bold text
30
+ */
31
+ bold(text: string): string;
32
+ /**
33
+ * Add italic text
34
+ */
35
+ italic(text: string): string;
36
+ /**
37
+ * Add a link
38
+ */
39
+ link(text: string, url: string): string;
40
+ /**
41
+ * Add a collapsible details section
42
+ */
43
+ details(summary: string, content: string): this;
44
+ /**
45
+ * Add a horizontal rule
46
+ */
47
+ hr(): this;
48
+ /**
49
+ * Add raw text without additional spacing
50
+ */
51
+ raw(text: string): this;
52
+ /**
53
+ * Add a line break
54
+ */
55
+ br(): this;
56
+ /**
57
+ * Build the final markdown string
58
+ */
59
+ build(): string;
60
+ /**
61
+ * Create a new builder instance
62
+ */
63
+ static create(): MarkdownBuilder;
64
+ }
65
+ //# sourceMappingURL=markdown-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-builder.d.ts","sourceRoot":"","sources":["../../../src/formatters/markdown-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,KAAK,CAAgB;IAE7B;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,IAAI;IAO7C;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQ7B;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,OAAe,GAAG,IAAI;IASrD;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAW,GAAG,IAAI;IAQlD;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI5B;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI1B;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI5B;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAIvC;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAU/C;;OAEG;IACH,EAAE,IAAI,IAAI;IAMV;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKvB;;OAEG;IACH,EAAE,IAAI,IAAI;IAKV;;OAEG;IACH,KAAK,IAAI,MAAM;IAIf;;OAEG;IACH,MAAM,CAAC,MAAM,IAAI,eAAe;CAGjC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Utility class for building markdown formatted strings
3
+ * Used for programmatic content generation (execution traces, etc.)
4
+ * NOT used for AI-generated responses - AI handles its own formatting
5
+ */
6
+ export class MarkdownBuilder {
7
+ constructor() {
8
+ this.parts = [];
9
+ }
10
+ /**
11
+ * Add a header
12
+ */
13
+ header(text, level = 1) {
14
+ const prefix = '#'.repeat(Math.max(1, Math.min(6, level)));
15
+ this.parts.push(`${prefix} ${text}`);
16
+ this.parts.push('');
17
+ return this;
18
+ }
19
+ /**
20
+ * Add a paragraph
21
+ */
22
+ paragraph(text) {
23
+ if (text) {
24
+ this.parts.push(text);
25
+ this.parts.push('');
26
+ }
27
+ return this;
28
+ }
29
+ /**
30
+ * Add a bulleted list
31
+ */
32
+ list(items, ordered = false) {
33
+ items.forEach((item, idx) => {
34
+ const prefix = ordered ? `${idx + 1}. ` : '- ';
35
+ this.parts.push(`${prefix}${item}`);
36
+ });
37
+ this.parts.push('');
38
+ return this;
39
+ }
40
+ /**
41
+ * Add a code block
42
+ */
43
+ code(content, language = '') {
44
+ this.parts.push(`\`\`\`${language}`);
45
+ this.parts.push(content);
46
+ this.parts.push('```');
47
+ this.parts.push('');
48
+ return this;
49
+ }
50
+ /**
51
+ * Add inline code
52
+ */
53
+ inline(text) {
54
+ return `\`${text}\``;
55
+ }
56
+ /**
57
+ * Add bold text
58
+ */
59
+ bold(text) {
60
+ return `**${text}**`;
61
+ }
62
+ /**
63
+ * Add italic text
64
+ */
65
+ italic(text) {
66
+ return `*${text}*`;
67
+ }
68
+ /**
69
+ * Add a link
70
+ */
71
+ link(text, url) {
72
+ return `[${text}](${url})`;
73
+ }
74
+ /**
75
+ * Add a collapsible details section
76
+ */
77
+ details(summary, content) {
78
+ this.parts.push('<details>');
79
+ this.parts.push(`<summary>${summary}</summary>`);
80
+ this.parts.push('');
81
+ this.parts.push(content);
82
+ this.parts.push('</details>');
83
+ this.parts.push('');
84
+ return this;
85
+ }
86
+ /**
87
+ * Add a horizontal rule
88
+ */
89
+ hr() {
90
+ this.parts.push('---');
91
+ this.parts.push('');
92
+ return this;
93
+ }
94
+ /**
95
+ * Add raw text without additional spacing
96
+ */
97
+ raw(text) {
98
+ this.parts.push(text);
99
+ return this;
100
+ }
101
+ /**
102
+ * Add a line break
103
+ */
104
+ br() {
105
+ this.parts.push('');
106
+ return this;
107
+ }
108
+ /**
109
+ * Build the final markdown string
110
+ */
111
+ build() {
112
+ return this.parts.join('\n').trim();
113
+ }
114
+ /**
115
+ * Create a new builder instance
116
+ */
117
+ static create() {
118
+ return new MarkdownBuilder();
119
+ }
120
+ }
@@ -2,6 +2,7 @@ export * from './o-lane.js';
2
2
  export * from './interfaces/index.js';
3
3
  export * from './manager/o-lane.manager.js';
4
4
  export * from './o-lane.context.js';
5
+ export * from './o-lane.mixin.js';
5
6
  export * from './o-lane.tool.js';
6
7
  export * from './capabilities/index.js';
7
8
  export * from './intent/index.js';
@@ -14,4 +15,5 @@ export * from './capabilities-task/o-capability.task.js';
14
15
  export * from './prompts/custom.prompt.js';
15
16
  export * from './intent-encoder/index.js';
16
17
  export * from './enum/o-lane.status-enum.js';
18
+ export * from './storage/index.js';
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC;AACnE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC;AACnE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
package/dist/src/index.js CHANGED
@@ -2,6 +2,7 @@ export * from './o-lane.js';
2
2
  export * from './interfaces/index.js';
3
3
  export * from './manager/o-lane.manager.js';
4
4
  export * from './o-lane.context.js';
5
+ export * from './o-lane.mixin.js';
5
6
  export * from './o-lane.tool.js';
6
7
  export * from './capabilities/index.js';
7
8
  export * from './intent/index.js';
@@ -14,3 +15,4 @@ export * from './capabilities-task/o-capability.task.js';
14
15
  export * from './prompts/custom.prompt.js';
15
16
  export * from './intent-encoder/index.js';
16
17
  export * from './enum/o-lane.status-enum.js';
18
+ export * from './storage/index.js';
@@ -1,8 +1,8 @@
1
1
  import { oAddress } from '@olane/o-core';
2
+ import { oToolBase } from '@olane/o-tool';
2
3
  import { oLaneContext } from '../o-lane.context.js';
3
4
  import { oCapability } from '../capabilities/o-capability.js';
4
5
  import { oIntent } from '../intent/o-intent.js';
5
- import { oLaneTool } from '../o-lane.tool.js';
6
6
  export interface oLaneConfig {
7
7
  intent: oIntent;
8
8
  caller: oAddress;
@@ -10,10 +10,13 @@ export interface oLaneConfig {
10
10
  sequence?: any[];
11
11
  streamTo?: oAddress;
12
12
  capabilities?: oCapability[];
13
- currentNode: oLaneTool;
13
+ currentNode: oToolBase;
14
14
  extraInstructions?: string;
15
15
  parentLaneId?: string;
16
16
  maxCycles?: number;
17
17
  persistToConfig?: boolean;
18
+ onChunk?: (chunk: any) => void;
19
+ useStream?: boolean;
20
+ requestId?: string | number;
18
21
  }
19
22
  //# sourceMappingURL=o-lane.config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"o-lane.config.d.ts","sourceRoot":"","sources":["../../../src/interfaces/o-lane.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAS,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,WAAW;IAE1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,QAAQ,CAAC;IAEjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IAEjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAG7B,WAAW,EAAE,SAAS,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
1
+ {"version":3,"file":"o-lane.config.d.ts","sourceRoot":"","sources":["../../../src/interfaces/o-lane.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAS,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,MAAM,WAAW,WAAW;IAE1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,QAAQ,CAAC;IAEjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IAEjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAI7B,WAAW,EAAE,SAAS,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B"}
@@ -15,6 +15,7 @@ export declare class oLane extends oObject {
15
15
  MAX_CYCLES: number;
16
16
  status: oLaneStatus;
17
17
  result: oCapabilityResult | undefined;
18
+ onChunk?: (chunk: any) => void;
18
19
  constructor(config: oLaneConfig);
19
20
  get intent(): oIntent;
20
21
  toCIDInput(): any;
@@ -27,12 +28,18 @@ export declare class oLane extends oObject {
27
28
  toCID(): Promise<CID>;
28
29
  store(): Promise<CID>;
29
30
  get agentHistory(): string;
31
+ /**
32
+ * Generate a human-readable execution trace of the lane
33
+ * Shows the decision points and flow of execution
34
+ */
35
+ getExecutionTrace(): string;
30
36
  preflight(): Promise<void>;
31
37
  execute(): Promise<oCapabilityResult | undefined>;
32
38
  get capabilities(): import("./capabilities/o-capability.js").oCapability[];
33
39
  resultToConfig(result: any): oCapabilityConfig;
34
40
  doCapability(currentStep: oCapabilityResult): Promise<oCapabilityResult>;
35
41
  loop(): Promise<oCapabilityResult>;
42
+ emitNonFinalChunk(result: oCapabilityResult, payload: any): Promise<void>;
36
43
  postflight(response?: oCapabilityResult): Promise<oCapabilityResult | undefined>;
37
44
  cancel(): void;
38
45
  /**
@@ -46,6 +53,6 @@ export declare class oLane extends oObject {
46
53
  * Other capabilities use cached results
47
54
  */
48
55
  private shouldReplayCapability;
49
- get node(): import("./o-lane.tool.js").oLaneTool;
56
+ get node(): import("@olane/o-tool").oToolBase;
50
57
  }
51
58
  //# sourceMappingURL=o-lane.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"o-lane.d.ts","sourceRoot":"","sources":["../../src/o-lane.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,OAAO,EAER,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAInC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,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