macro-agent 0.0.15 → 0.0.17
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.
- package/dist/acp/index.d.ts +1 -1
- package/dist/acp/index.d.ts.map +1 -1
- package/dist/acp/index.js.map +1 -1
- package/dist/acp/macro-agent.d.ts +21 -0
- package/dist/acp/macro-agent.d.ts.map +1 -1
- package/dist/acp/macro-agent.js +182 -0
- package/dist/acp/macro-agent.js.map +1 -1
- package/dist/acp/types.d.ts +31 -2
- package/dist/acp/types.d.ts.map +1 -1
- package/dist/acp/types.js.map +1 -1
- package/dist/agent/agent-manager.d.ts.map +1 -1
- package/dist/agent/agent-manager.js +23 -5
- package/dist/agent/agent-manager.js.map +1 -1
- package/dist/map/adapter/acp-over-map.d.ts +15 -0
- package/dist/map/adapter/acp-over-map.d.ts.map +1 -1
- package/dist/map/adapter/acp-over-map.js +204 -9
- package/dist/map/adapter/acp-over-map.js.map +1 -1
- package/dist/store/event-store.d.ts.map +1 -1
- package/dist/store/event-store.js +92 -53
- package/dist/store/event-store.js.map +1 -1
- package/dist/store/instance.d.ts +0 -2
- package/dist/store/instance.d.ts.map +1 -1
- package/dist/store/instance.js +1 -24
- package/dist/store/instance.js.map +1 -1
- package/package.json +3 -3
- package/references/acp-factory-ref/package-lock.json +2 -2
- package/references/acp-factory-ref/package.json +2 -2
- package/references/claude-code-acp/package-lock.json +2 -2
- package/references/claude-code-acp/package.json +1 -1
- package/references/claude-code-acp/src/acp-agent.ts +3 -6
- package/src/acp/__tests__/history.test.ts +526 -0
- package/src/acp/__tests__/integration.test.ts +2 -1
- package/src/acp/index.ts +4 -0
- package/src/acp/macro-agent.ts +329 -85
- package/src/acp/types.ts +39 -2
- package/src/agent/__tests__/agent-manager.test.ts +4 -6
- package/src/agent/agent-manager.ts +24 -5
- package/src/map/adapter/__tests__/acp-over-map-history.test.ts +664 -0
- package/src/map/adapter/__tests__/acp-over-map-persistence.e2e.test.ts +440 -0
- package/src/map/adapter/acp-over-map.ts +246 -7
- package/src/store/__tests__/event-store.test.ts +4 -12
- package/src/store/__tests__/instance.test.ts +5 -7
- package/src/store/event-store.ts +115 -57
- package/src/store/instance.ts +1 -29
package/src/store/instance.ts
CHANGED
|
@@ -213,9 +213,6 @@ export interface ResolvedInstance {
|
|
|
213
213
|
/** Whether this is a new instance */
|
|
214
214
|
isNew: boolean;
|
|
215
215
|
|
|
216
|
-
/** Whether this is using legacy path mode */
|
|
217
|
-
isLegacy: boolean;
|
|
218
|
-
|
|
219
216
|
/** Backend type to use */
|
|
220
217
|
backendType: string;
|
|
221
218
|
}
|
|
@@ -300,25 +297,11 @@ export function resolveInstancePath(config: StoreConfig): ResolvedInstance {
|
|
|
300
297
|
instancePath: ':memory:',
|
|
301
298
|
namespace,
|
|
302
299
|
isNew: true,
|
|
303
|
-
isLegacy: false,
|
|
304
300
|
backendType: 'memory',
|
|
305
301
|
};
|
|
306
302
|
}
|
|
307
303
|
|
|
308
|
-
//
|
|
309
|
-
if (config.path) {
|
|
310
|
-
const legacyInstanceId = deriveInstanceIdFromPath(config.path);
|
|
311
|
-
return {
|
|
312
|
-
instanceId: legacyInstanceId,
|
|
313
|
-
instancePath: config.path,
|
|
314
|
-
namespace,
|
|
315
|
-
isNew: !fs.existsSync(config.path),
|
|
316
|
-
isLegacy: true,
|
|
317
|
-
backendType: 'json',
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// New instance resolution
|
|
304
|
+
// Instance resolution
|
|
322
305
|
const instanceId = config.instanceId ?? generateInstanceId();
|
|
323
306
|
|
|
324
307
|
if (!isValidInstanceId(instanceId)) {
|
|
@@ -339,21 +322,10 @@ export function resolveInstancePath(config: StoreConfig): ResolvedInstance {
|
|
|
339
322
|
instancePath,
|
|
340
323
|
namespace,
|
|
341
324
|
isNew,
|
|
342
|
-
isLegacy: false,
|
|
343
325
|
backendType,
|
|
344
326
|
};
|
|
345
327
|
}
|
|
346
328
|
|
|
347
|
-
/**
|
|
348
|
-
* Derive an instance ID from a legacy path
|
|
349
|
-
*/
|
|
350
|
-
function deriveInstanceIdFromPath(legacyPath: string): string {
|
|
351
|
-
// Use the filename without extension as the instance ID
|
|
352
|
-
const basename = path.basename(legacyPath, path.extname(legacyPath));
|
|
353
|
-
// Sanitize to valid instance ID
|
|
354
|
-
return basename.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
355
|
-
}
|
|
356
|
-
|
|
357
329
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
358
330
|
// Instance Directory Management
|
|
359
331
|
// ─────────────────────────────────────────────────────────────────────────────
|