@olane/o-lane 0.7.25 → 0.7.27

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.
@@ -1 +1 @@
1
- {"version":3,"file":"o-capability.result.d.ts","sourceRoot":"","sources":["../../../src/capabilities/o-capability.result.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F,qBAAa,iBAAkB,YAAW,0BAA0B;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;gBAEZ,MAAM,EAAE,0BAA0B;IAQ9C,MAAM;;;;;;;;;;;IAUN,QAAQ;CAGT"}
1
+ {"version":3,"file":"o-capability.result.d.ts","sourceRoot":"","sources":["../../../src/capabilities/o-capability.result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F,qBAAa,iBAAkB,YAAW,0BAA0B;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;gBAEZ,MAAM,EAAE,0BAA0B;IAS9C,MAAM;;;;;;;;;;;IAUN,QAAQ;CAGT"}
@@ -7,6 +7,7 @@ export class oCapabilityResult {
7
7
  this.type = config.type || oCapabilityType.UNKNOWN;
8
8
  this.config = config.config;
9
9
  this.error = config.error;
10
+ this.shouldPersist = config.shouldPersist;
10
11
  }
11
12
  toJSON() {
12
13
  return {
@@ -14,7 +15,7 @@ export class oCapabilityResult {
14
15
  result: this.result,
15
16
  type: this.type,
16
17
  error: this.error,
17
- config: this.config?.toJSON()
18
+ config: this.config?.toJSON(),
18
19
  };
19
20
  }
20
21
  toString() {
@@ -1 +1 @@
1
- {"version":3,"file":"execute.capability.d.ts","sourceRoot":"","sources":["../../../src/capabilities-execute/execute.capability.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAEzF,qBAAa,kBAAmB,SAAQ,uBAAuB;IACtD,MAAM,EAAG,wBAAwB,CAAC;IAEzC,IAAI,IAAI,IAAI,eAAe,CAE1B;IAED,MAAM,KAAK,IAAI,oBAEd;IAEK,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAepD,SAAS,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAatC,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;CA8HxC"}
1
+ {"version":3,"file":"execute.capability.d.ts","sourceRoot":"","sources":["../../../src/capabilities-execute/execute.capability.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAEzF,qBAAa,kBAAmB,SAAQ,uBAAuB;IACtD,MAAM,EAAG,wBAAwB,CAAC;IAEzC,IAAI,IAAI,IAAI,eAAe,CAE1B;IAED,MAAM,KAAK,IAAI,oBAEd;IAEK,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAepD,SAAS,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAatC,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;CA2NxC"}
@@ -35,8 +35,62 @@ export class oCapabilityExecute extends oCapabilityIntelligence {
35
35
  async run() {
36
36
  // Check if we're in replay mode
37
37
  if (this.config.isReplay) {
38
- this.logger.debug('Execute capability is being replayed - re-executing to restore state');
38
+ this.logger.debug('Execute capability is being replayed - using stored execution data');
39
+ // Extract stored execution data
40
+ const storedExecution = this.config.storedExecution;
41
+ // Validate stored data exists (strict mode - fail if missing)
42
+ if (!storedExecution) {
43
+ throw new oError(oErrorCodes.INVALID_RESPONSE, 'Replay mode enabled but no stored execution data found');
44
+ }
45
+ if (!storedExecution.handshakeResult || !storedExecution.taskConfig) {
46
+ throw new oError(oErrorCodes.INVALID_RESPONSE, 'Replay mode enabled but stored execution data is incomplete');
47
+ }
48
+ const { handshakeResult, taskConfig } = storedExecution;
49
+ const { method, params } = taskConfig;
50
+ this.logger.debug('Replaying task execution with stored data', {
51
+ method,
52
+ params,
53
+ skipHandshake: true,
54
+ skipIntelligence: true,
55
+ skipApproval: true,
56
+ });
57
+ // Execute the stored task directly (skip handshake, AI, and approval)
58
+ try {
59
+ const taskResponse = await this.node.use(new oAddress(this.config.params.address), {
60
+ method: method,
61
+ params: params,
62
+ });
63
+ // Check if the tool response contains _save flag
64
+ const shouldPersist = taskResponse.result?.data?._save === true;
65
+ if (shouldPersist) {
66
+ this.logger.debug('Tool response contains _save flag - lane will be persisted to config');
67
+ }
68
+ // Return an EVALUATE result that contains the task execution output
69
+ return new oCapabilityResult({
70
+ type: oCapabilityType.EVALUATE,
71
+ config: this.config,
72
+ result: {
73
+ handshakeResult: handshakeResult,
74
+ taskConfig: taskConfig,
75
+ response: taskResponse.result,
76
+ },
77
+ shouldPersist,
78
+ });
79
+ }
80
+ catch (error) {
81
+ this.logger.error('Failed to execute during replay:', `Error when trying to use ${this.config?.params?.address} with config: ${JSON.stringify(taskConfig)} resulting in error: ${error?.message}`);
82
+ return new oCapabilityResult({
83
+ type: oCapabilityType.EVALUATE,
84
+ config: this.config,
85
+ result: {
86
+ handshakeResult: handshakeResult,
87
+ taskConfig: taskConfig,
88
+ },
89
+ error: `Error when trying to use ${this.config?.params?.address} with config: ${JSON.stringify(taskConfig)} resulting in error: ${error?.message}`,
90
+ });
91
+ }
39
92
  }
93
+ // Normal execution flow (not replay)
40
94
  const handshake = await this.handshake();
41
95
  if (!handshake.result) {
42
96
  throw new oError(oErrorCodes.INVALID_RESPONSE, 'Handshake failed');
@@ -101,6 +155,10 @@ export class oCapabilityExecute extends oCapabilityIntelligence {
101
155
  type: oCapabilityType.EVALUATE,
102
156
  config: this.config,
103
157
  result: {
158
+ handshakeResult: {
159
+ tools: handshake.result.tools,
160
+ methods: handshake.result.methods,
161
+ },
104
162
  taskConfig: {
105
163
  method: method,
106
164
  params: params,
@@ -118,6 +176,16 @@ export class oCapabilityExecute extends oCapabilityIntelligence {
118
176
  return new oCapabilityResult({
119
177
  type: oCapabilityType.EVALUATE,
120
178
  config: this.config,
179
+ result: {
180
+ handshakeResult: {
181
+ tools: handshake.result.tools,
182
+ methods: handshake.result.methods,
183
+ },
184
+ taskConfig: {
185
+ method: method,
186
+ params: params,
187
+ },
188
+ },
121
189
  error: `Error when trying to use ${this.config?.params?.address} with config: ${JSON.stringify({
122
190
  method: method,
123
191
  params: params,
@@ -1,8 +1,21 @@
1
1
  import { oCapabilityConfig } from '../../capabilities/o-capability.config.js';
2
+ import { oMethod } from '@olane/o-protocol';
2
3
  export interface oCapabilityExecuteConfig extends oCapabilityConfig {
3
4
  params: {
4
5
  address: string;
5
6
  intent: string;
6
7
  };
8
+ storedExecution?: {
9
+ handshakeResult: {
10
+ tools: string[];
11
+ methods: {
12
+ [key: string]: oMethod;
13
+ };
14
+ };
15
+ taskConfig: {
16
+ method: string;
17
+ params: any;
18
+ };
19
+ };
7
20
  }
8
21
  //# sourceMappingURL=o-capability.configure-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"o-capability.configure-config.d.ts","sourceRoot":"","sources":["../../../../src/capabilities-execute/interfaces/o-capability.configure-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE9E,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
1
+ {"version":3,"file":"o-capability.configure-config.d.ts","sourceRoot":"","sources":["../../../../src/capabilities-execute/interfaces/o-capability.configure-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,eAAe,CAAC,EAAE;QAChB,eAAe,EAAE;YACf,KAAK,EAAE,MAAM,EAAE,CAAC;YAChB,OAAO,EAAE;gBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;aAAE,CAAC;SACrC,CAAC;QACF,UAAU,EAAE;YACV,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,EAAE,GAAG,CAAC;SACb,CAAC;KACH,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"o-lane.storage-manager.d.ts","sourceRoot":"","sources":["../../../src/storage/o-lane.storage-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAqB,MAAM,0BAA0B,CAAC;AAGjG,KAAK,KAAK,GAAG,GAAG,CAAC;AAEjB,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,GAAG,CAAkB;IAC7B,OAAO,CAAC,IAAI,CAAQ;gBAER,IAAI,EAAE,KAAK;IAIvB;;;OAGG;IACH,gBAAgB,IAAI,GAAG;IAQvB;;;OAGG;IACH,SAAS,IAAI,GAAG;IAQhB;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC;IAWjC;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IAyB1B;;;;OAIG;IACG,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwC5E;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAoEjE;;;;;;OAMG;IACH,sBAAsB,CAAC,cAAc,EAAE,eAAe,GAAG,OAAO;IAShE;;;OAGG;IACH,YAAY,IAAI,GAAG,GAAG,SAAS;IAI/B;;OAEG;IACH,UAAU,IAAI,IAAI;CAGnB"}
1
+ {"version":3,"file":"o-lane.storage-manager.d.ts","sourceRoot":"","sources":["../../../src/storage/o-lane.storage-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,OAAO,EACL,iBAAiB,EACjB,eAAe,EAEhB,MAAM,0BAA0B,CAAC;AAGlC,KAAK,KAAK,GAAG,GAAG,CAAC;AAEjB,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,GAAG,CAAkB;IAC7B,OAAO,CAAC,IAAI,CAAQ;gBAER,IAAI,EAAE,KAAK;IAIvB;;;OAGG;IACH,gBAAgB,IAAI,GAAG;IAQvB;;;OAGG;IACH,SAAS,IAAI,GAAG;IAQhB;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC;IAWjC;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IAyB1B;;;;OAIG;IACG,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2C5E;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAiFjE;;;;;;OAMG;IACH,sBAAsB,CAAC,cAAc,EAAE,eAAe,GAAG,OAAO;IAShE;;;OAGG;IACH,YAAY,IAAI,GAAG,GAAG,SAAS;IAI/B;;OAEG;IACH,UAAU,IAAI,IAAI;CAGnB"}
@@ -12,7 +12,7 @@ import { oAddress, oError, oErrorCodes, NodeState } from '@olane/o-core';
12
12
  import { CID } from 'multiformats';
13
13
  import * as json from 'multiformats/codecs/json';
14
14
  import { sha256 } from 'multiformats/hashes/sha2';
15
- import { oCapabilityResult, oCapabilityType } from '../capabilities/index.js';
15
+ import { oCapabilityResult, oCapabilityType, } from '../capabilities/index.js';
16
16
  export class oLaneStorageManager {
17
17
  constructor(lane) {
18
18
  this.lane = lane;
@@ -144,14 +144,23 @@ export class oLaneStorageManager {
144
144
  if (this.shouldReplayCapability(capabilityType)) {
145
145
  this.lane.logger.debug(`Replaying capability: ${capabilityType}`);
146
146
  // Create a capability result with replay flag
147
+ const replayConfig = {
148
+ ...sequenceItem.config,
149
+ isReplay: true,
150
+ node: this.lane.node,
151
+ history: this.lane.agentHistory,
152
+ };
153
+ // For EXECUTE capabilities, add stored execution data to skip handshake and intelligence
154
+ if (capabilityType === oCapabilityType.EXECUTE &&
155
+ sequenceItem.result) {
156
+ replayConfig.storedExecution = {
157
+ handshakeResult: sequenceItem?.result?.handshakeResult,
158
+ taskConfig: sequenceItem?.result?.taskConfig,
159
+ };
160
+ }
147
161
  const replayStep = new oCapabilityResult({
148
162
  type: capabilityType,
149
- config: {
150
- ...sequenceItem.config,
151
- isReplay: true,
152
- node: this.lane.node,
153
- history: this.lane.agentHistory,
154
- },
163
+ config: replayConfig,
155
164
  result: sequenceItem.result,
156
165
  error: sequenceItem.error,
157
166
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-lane",
3
- "version": "0.7.25",
3
+ "version": "0.7.27",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  "devDependencies": {
37
37
  "@eslint/eslintrc": "^3.3.1",
38
38
  "@eslint/js": "^9.29.0",
39
- "@olane/o-test": "0.7.25",
39
+ "@olane/o-test": "0.7.27",
40
40
  "@tsconfig/node20": "^20.1.6",
41
41
  "@types/handlebars": "^4.1.0",
42
42
  "@types/jest": "^30.0.0",
@@ -57,15 +57,15 @@
57
57
  "typescript": "5.4.5"
58
58
  },
59
59
  "dependencies": {
60
- "@olane/o-config": "0.7.25",
61
- "@olane/o-core": "0.7.25",
62
- "@olane/o-node": "0.7.25",
63
- "@olane/o-protocol": "0.7.25",
64
- "@olane/o-storage": "0.7.25",
65
- "@olane/o-tool": "0.7.25",
60
+ "@olane/o-config": "0.7.27",
61
+ "@olane/o-core": "0.7.27",
62
+ "@olane/o-node": "0.7.27",
63
+ "@olane/o-protocol": "0.7.27",
64
+ "@olane/o-storage": "0.7.27",
65
+ "@olane/o-tool": "0.7.27",
66
66
  "debug": "^4.4.1",
67
67
  "dotenv": "^16.5.0",
68
68
  "handlebars": "^4.7.8"
69
69
  },
70
- "gitHead": "42cd24f9c37fbd9676cfda18b97e7bd28e87e152"
70
+ "gitHead": "9914642225b2337d251cd2b7a909bb85d8333292"
71
71
  }