@agentxm/client-core 0.17.0 → 0.18.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.
- package/dist/src/unstable/agent-capabilities/catalog.d.ts +54 -10
- package/dist/src/unstable/agent-capabilities/catalog.d.ts.map +1 -1
- package/dist/src/unstable/agent-capabilities/data/agents/hermes.d.ts +27 -5
- package/dist/src/unstable/agent-capabilities/data/agents/hermes.d.ts.map +1 -1
- package/dist/src/unstable/agent-capabilities/data/agents/hermes.js +17 -5
- package/dist/src/unstable/agent-capabilities/data/agents/hermes.js.map +1 -1
- package/dist/src/unstable/agent-capabilities/schema.d.ts +19 -19
- package/dist/src/unstable/agent-capabilities/schema.d.ts.map +1 -1
- package/dist/src/unstable/agent-capabilities/schema.js +2 -1
- package/dist/src/unstable/agent-capabilities/schema.js.map +1 -1
- package/dist/src/unstable/agents/mcp-sync.d.ts.map +1 -1
- package/dist/src/unstable/agents/mcp-sync.js +19 -3
- package/dist/src/unstable/agents/mcp-sync.js.map +1 -1
- package/dist/src/unstable/cli-runtime/command-summary.d.ts +1 -1
- package/dist/src/unstable/cli-runtime/command-summary.d.ts.map +1 -1
- package/dist/src/unstable/cli-runtime/command-summary.js.map +1 -1
- package/dist/src/unstable/extensions/configured-entry.d.ts +11 -0
- package/dist/src/unstable/extensions/configured-entry.d.ts.map +1 -0
- package/dist/src/unstable/extensions/configured-entry.js +8 -0
- package/dist/src/unstable/extensions/configured-entry.js.map +1 -0
- package/dist/src/unstable/extensions/index.d.ts +1 -0
- package/dist/src/unstable/extensions/index.d.ts.map +1 -1
- package/dist/src/unstable/extensions/index.js +1 -0
- package/dist/src/unstable/extensions/index.js.map +1 -1
- package/dist/src/unstable/extensions/materializable-from-disk.d.ts.map +1 -1
- package/dist/src/unstable/extensions/materializable-from-disk.js +5 -4
- package/dist/src/unstable/extensions/materializable-from-disk.js.map +1 -1
- package/dist/src/unstable/files/manager.d.ts.map +1 -1
- package/dist/src/unstable/files/manager.js +2 -2
- package/dist/src/unstable/files/manager.js.map +1 -1
- package/dist/src/unstable/hooks/manager.d.ts.map +1 -1
- package/dist/src/unstable/hooks/manager.js +2 -2
- package/dist/src/unstable/hooks/manager.js.map +1 -1
- package/dist/src/unstable/libraries/index.d.ts +3 -0
- package/dist/src/unstable/libraries/index.d.ts.map +1 -0
- package/dist/src/unstable/libraries/index.js +2 -0
- package/dist/src/unstable/libraries/index.js.map +1 -0
- package/dist/src/unstable/libraries/ref.d.ts +17 -0
- package/dist/src/unstable/libraries/ref.d.ts.map +1 -0
- package/dist/src/unstable/libraries/ref.js +43 -0
- package/dist/src/unstable/libraries/ref.js.map +1 -0
- package/dist/src/unstable/lint/catalog/mcp-server/manifest-keys-recognized.js +2 -2
- package/dist/src/unstable/lint/catalog/mcp-server/manifest-keys-recognized.js.map +1 -1
- package/dist/src/unstable/lint/catalog/mcp-server/manifest-present.js +3 -3
- package/dist/src/unstable/lint/catalog/mcp-server/manifest-present.js.map +1 -1
- package/dist/src/unstable/lint/catalog/mcp-server/manifest-schema-valid.js +2 -2
- package/dist/src/unstable/lint/catalog/mcp-server/manifest-schema-valid.js.map +1 -1
- package/dist/src/unstable/lint/catalog/shared/manifest-json.js +1 -1
- package/dist/src/unstable/lint/catalog/shared/manifest-json.js.map +1 -1
- package/dist/src/unstable/lint/catalog/shared/schema-rule.js +1 -1
- package/dist/src/unstable/lint/catalog/shared/schema-rule.js.map +1 -1
- package/dist/src/unstable/lockfile/index.d.ts +3 -3
- package/dist/src/unstable/lockfile/index.d.ts.map +1 -1
- package/dist/src/unstable/lockfile/index.js +2 -2
- package/dist/src/unstable/lockfile/index.js.map +1 -1
- package/dist/src/unstable/lockfile/lockfile.d.ts +936 -3
- package/dist/src/unstable/lockfile/lockfile.d.ts.map +1 -1
- package/dist/src/unstable/lockfile/lockfile.js +223 -31
- package/dist/src/unstable/lockfile/lockfile.js.map +1 -1
- package/dist/src/unstable/lockfile/schema.d.ts +96 -0
- package/dist/src/unstable/lockfile/schema.d.ts.map +1 -1
- package/dist/src/unstable/lockfile/schema.js +54 -0
- package/dist/src/unstable/lockfile/schema.js.map +1 -1
- package/dist/src/unstable/mcps/config-writer.d.ts.map +1 -1
- package/dist/src/unstable/mcps/config-writer.js +77 -29
- package/dist/src/unstable/mcps/config-writer.js.map +1 -1
- package/dist/src/unstable/mcps/inspection.d.ts.map +1 -1
- package/dist/src/unstable/mcps/inspection.js +24 -4
- package/dist/src/unstable/mcps/inspection.js.map +1 -1
- package/dist/src/unstable/mcps/manifest-schema.d.ts +3 -3
- package/dist/src/unstable/mcps/manifest-schema.d.ts.map +1 -1
- package/dist/src/unstable/mcps/manifest-schema.js +4 -4
- package/dist/src/unstable/mcps/manifest-schema.js.map +1 -1
- package/dist/src/unstable/mcps/operations/publish.d.ts +1 -1
- package/dist/src/unstable/mcps/operations/publish.js +1 -1
- package/dist/src/unstable/packs/dependency-resolution.d.ts +3 -1
- package/dist/src/unstable/packs/dependency-resolution.d.ts.map +1 -1
- package/dist/src/unstable/packs/dependency-resolution.js +11 -10
- package/dist/src/unstable/packs/dependency-resolution.js.map +1 -1
- package/dist/src/unstable/packs/expansion.d.ts +3 -0
- package/dist/src/unstable/packs/expansion.d.ts.map +1 -1
- package/dist/src/unstable/packs/expansion.js +2 -2
- package/dist/src/unstable/packs/expansion.js.map +1 -1
- package/dist/src/unstable/registry/__generated__/registry-client.d.ts +1592 -146
- package/dist/src/unstable/registry/__generated__/registry-client.d.ts.map +1 -1
- package/dist/src/unstable/registry/__generated__/registry-client.js +246 -0
- package/dist/src/unstable/registry/__generated__/registry-client.js.map +1 -1
- package/dist/src/unstable/registry/admin-client.d.ts +2 -2
- package/dist/src/unstable/registry/client.d.ts +52 -0
- package/dist/src/unstable/registry/client.d.ts.map +1 -1
- package/dist/src/unstable/registry/client.js.map +1 -1
- package/dist/src/unstable/registry/index.d.ts +1 -1
- package/dist/src/unstable/registry/index.d.ts.map +1 -1
- package/dist/src/unstable/registry/index.js.map +1 -1
- package/dist/src/unstable/registry/local-client.d.ts.map +1 -1
- package/dist/src/unstable/registry/local-client.js +1 -0
- package/dist/src/unstable/registry/local-client.js.map +1 -1
- package/dist/src/unstable/registry/remote-client.d.ts.map +1 -1
- package/dist/src/unstable/registry/remote-client.js +59 -0
- package/dist/src/unstable/registry/remote-client.js.map +1 -1
- package/dist/src/unstable/rules/manager.d.ts.map +1 -1
- package/dist/src/unstable/rules/manager.js +2 -2
- package/dist/src/unstable/rules/manager.js.map +1 -1
- package/dist/src/unstable/settings/index.d.ts +2 -2
- package/dist/src/unstable/settings/index.d.ts.map +1 -1
- package/dist/src/unstable/settings/index.js +1 -1
- package/dist/src/unstable/settings/index.js.map +1 -1
- package/dist/src/unstable/settings/schema.d.ts +52 -0
- package/dist/src/unstable/settings/schema.d.ts.map +1 -1
- package/dist/src/unstable/settings/schema.js +71 -1
- package/dist/src/unstable/settings/schema.js.map +1 -1
- package/dist/src/unstable/workspace/initialization.d.ts +28 -0
- package/dist/src/unstable/workspace/initialization.d.ts.map +1 -1
- package/dist/src/unstable/workspace/service-interface.d.ts +25 -2
- package/dist/src/unstable/workspace/service-interface.d.ts.map +1 -1
- package/dist/src/unstable/workspace/service-interface.js.map +1 -1
- package/dist/src/unstable/workspace/service.d.ts +83 -6
- package/dist/src/unstable/workspace/service.d.ts.map +1 -1
- package/dist/src/unstable/workspace/service.js +134 -50
- package/dist/src/unstable/workspace/service.js.map +1 -1
- package/dist/src/unstable/workspace/test-stubs.d.ts +2 -0
- package/dist/src/unstable/workspace/test-stubs.d.ts.map +1 -1
- package/dist/src/unstable/workspace/test-stubs.js +10 -0
- package/dist/src/unstable/workspace/test-stubs.js.map +1 -1
- package/dist/src/unstable/workspace/version-currency/collectors.d.ts.map +1 -1
- package/dist/src/unstable/workspace/version-currency/collectors.js +2 -3
- package/dist/src/unstable/workspace/version-currency/collectors.js.map +1 -1
- package/dist/src/unstable/workspace/version-currency/test-stubs.d.ts.map +1 -1
- package/dist/src/unstable/workspace/version-currency/test-stubs.js +1 -0
- package/dist/src/unstable/workspace/version-currency/test-stubs.js.map +1 -1
- package/dist/src/unstable/yaml/index.d.ts +13 -0
- package/dist/src/unstable/yaml/index.d.ts.map +1 -0
- package/dist/src/unstable/yaml/index.js +73 -0
- package/dist/src/unstable/yaml/index.js.map +1 -0
- package/package.json +12 -4
- package/site-content/__generated__/schemas/axm-lock.schema.json +77 -0
- package/site-content/__generated__/schemas/{mcp-server.schema.json → mcp.schema.json} +1 -1
- package/site-content/__generated__/schemas/settings.schema.json +61 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/unstable/workspace/service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/unstable/workspace/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAqBxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAStD,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,UAAU,EAEf,KAAK,SAAS,EAEd,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EAEjB,KAAK,cAAc,EAGnB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EAEd,KAAK,SAAS,EAMd,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAYtC,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,K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,WAAW,CAAC,KAAK,EAAE,aAAa,KAAK,aAAa;6BAgB3D,MAAM,SAAS,aAAa;mCAatB,MAAM;+BAcV,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAwBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAKiB,gBAAgB;4CAgE1B,gBAAgB;iCAwB3B,MAAM,WAAW,CAAC,KAAK,EAAE,cAAc,KAAK,cAAc;8BAoB7D,MAAM,SAAS,cAAc;4BAa/B,MAAM;4BAyCN,MAAM;kCAgBA,MAAM;8BAaV,MAAM;oCAiBA,MAAM;gCAaV,MAAM;+BAiBP,MAAM;2BAaV,MAAM;kCAiBC,MAAM;8BAaV,MAAM;iDAqBa,eAAe;+CAgCjB,eAAe;+CAwH5D,CAAC;AAEL;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,iFACM,CAAC"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* WorkspaceMutations mutation facade implementation.
|
|
3
3
|
*
|
|
4
4
|
* This is the sole public gateway for all settings and lockfile read/write
|
|
5
|
-
* operations. It reads through `WorkspaceReadModel
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* operations. It reads through `WorkspaceReadModel`, writes settings directly,
|
|
6
|
+
* and commits lockfile snapshots through the lockfile module so cross-process
|
|
7
|
+
* updates are serialized and merged per entry. It also serializes in-process
|
|
8
|
+
* mutations via a single Semaphore(1). No other service should perform settings
|
|
9
|
+
* or lockfile I/O in production; the per-service semaphores in
|
|
9
10
|
* `settings/service.ts` and `lockfile/service.ts` have been removed.
|
|
10
11
|
*
|
|
11
12
|
* Supporting logic is split into focused modules:
|
|
@@ -21,7 +22,7 @@ import * as Path from "effect/Path";
|
|
|
21
22
|
import * as Option from "effect/Option";
|
|
22
23
|
import * as Schema from "effect/Schema";
|
|
23
24
|
import * as Semaphore from "effect/Semaphore";
|
|
24
|
-
import { LOCKFILE_NAME, LOCKFILE_VERSION,
|
|
25
|
+
import { LOCKFILE_NAME, LOCKFILE_VERSION, commitLockfileSnapshotUpdate, makeRegistryLibraryLockEntry, makeRegistryPackLockEntry, } from "../lockfile/index.js";
|
|
25
26
|
import { computeSkillPaths } from "../skills/paths.js";
|
|
26
27
|
import { computePackPaths } from "../packs/paths.js";
|
|
27
28
|
import { sanitizeName } from "../extensions/utils.js";
|
|
@@ -351,7 +352,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
351
352
|
},
|
|
352
353
|
},
|
|
353
354
|
};
|
|
354
|
-
yield*
|
|
355
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
355
356
|
})).pipe(Effect.withSpan("WorkspaceMutations.setFiles")),
|
|
356
357
|
setFilesLock: ({ name, lockEntry }) => withMutex(Effect.gen(function* () {
|
|
357
358
|
const currentLockfile = yield* readLockfileSafe(workspaceDir);
|
|
@@ -368,7 +369,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
368
369
|
},
|
|
369
370
|
},
|
|
370
371
|
};
|
|
371
|
-
yield*
|
|
372
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
372
373
|
})).pipe(Effect.withSpan("WorkspaceMutations.setFilesLock")),
|
|
373
374
|
removeFiles: (name) => withMutex(Effect.gen(function* () {
|
|
374
375
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -390,7 +391,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
390
391
|
})()
|
|
391
392
|
: currentLockfile;
|
|
392
393
|
yield* writeSettings(workspaceDir, remainingSettings).pipe(Effect.provide(fsLayer));
|
|
393
|
-
yield*
|
|
394
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, remainingLockfile).pipe(Effect.provide(fsLayer));
|
|
394
395
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeFiles")),
|
|
395
396
|
removeFilesSettings: (name) => withMutex(Effect.gen(function* () {
|
|
396
397
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -411,10 +412,11 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
411
412
|
return;
|
|
412
413
|
const { [name]: _, ...remainingContext } = currentLockedContext;
|
|
413
414
|
void _;
|
|
414
|
-
|
|
415
|
+
const updatedLockfile = {
|
|
415
416
|
...currentLockfile,
|
|
416
417
|
files: remainingContext,
|
|
417
|
-
}
|
|
418
|
+
};
|
|
419
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
418
420
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeFilesLock")),
|
|
419
421
|
updateFilesEntry: (name, updater) => withMutex(Effect.gen(function* () {
|
|
420
422
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -463,7 +465,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
463
465
|
const currentLockfile = yield* readLockfileSafe(workspaceDir);
|
|
464
466
|
const currentLockedRules = currentLockfile.rules ?? {};
|
|
465
467
|
const previous = currentLockedRules[name];
|
|
466
|
-
|
|
468
|
+
const updatedLockfile = {
|
|
467
469
|
...currentLockfile,
|
|
468
470
|
rules: {
|
|
469
471
|
...currentLockedRules,
|
|
@@ -473,13 +475,14 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
473
475
|
updatedAt: new Date(),
|
|
474
476
|
},
|
|
475
477
|
},
|
|
476
|
-
}
|
|
478
|
+
};
|
|
479
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
477
480
|
})).pipe(Effect.withSpan("WorkspaceMutations.setRule")),
|
|
478
481
|
setRuleLock: ({ name, lockEntry }) => withMutex(Effect.gen(function* () {
|
|
479
482
|
const currentLockfile = yield* readLockfileSafe(workspaceDir);
|
|
480
483
|
const currentLockedRules = currentLockfile.rules ?? {};
|
|
481
484
|
const previous = currentLockedRules[name];
|
|
482
|
-
|
|
485
|
+
const updatedLockfile = {
|
|
483
486
|
...currentLockfile,
|
|
484
487
|
rules: {
|
|
485
488
|
...currentLockedRules,
|
|
@@ -489,7 +492,8 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
489
492
|
updatedAt: new Date(),
|
|
490
493
|
},
|
|
491
494
|
},
|
|
492
|
-
}
|
|
495
|
+
};
|
|
496
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
493
497
|
})).pipe(Effect.withSpan("WorkspaceMutations.setRuleLock")),
|
|
494
498
|
removeRule: (name) => withMutex(Effect.gen(function* () {
|
|
495
499
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -511,7 +515,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
511
515
|
})()
|
|
512
516
|
: currentLockfile;
|
|
513
517
|
yield* writeSettings(workspaceDir, remainingSettings).pipe(Effect.provide(fsLayer));
|
|
514
|
-
yield*
|
|
518
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, remainingLockfile).pipe(Effect.provide(fsLayer));
|
|
515
519
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeRule")),
|
|
516
520
|
removeRuleSettings: (name) => withMutex(Effect.gen(function* () {
|
|
517
521
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -532,10 +536,11 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
532
536
|
return;
|
|
533
537
|
const { [name]: _, ...remainingRules } = currentLockedRules;
|
|
534
538
|
void _;
|
|
535
|
-
|
|
539
|
+
const updatedLockfile = {
|
|
536
540
|
...currentLockfile,
|
|
537
541
|
rules: remainingRules,
|
|
538
|
-
}
|
|
542
|
+
};
|
|
543
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
539
544
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeRuleLock")),
|
|
540
545
|
updateRuleEntry: (name, updater) => withMutex(Effect.gen(function* () {
|
|
541
546
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -584,7 +589,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
584
589
|
const currentLockfile = yield* readLockfileSafe(workspaceDir);
|
|
585
590
|
const currentLockedHooks = currentLockfile.hooks ?? {};
|
|
586
591
|
const previous = currentLockedHooks[name];
|
|
587
|
-
|
|
592
|
+
const updatedLockfile = {
|
|
588
593
|
...currentLockfile,
|
|
589
594
|
hooks: {
|
|
590
595
|
...currentLockedHooks,
|
|
@@ -594,13 +599,14 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
594
599
|
updatedAt: new Date(),
|
|
595
600
|
},
|
|
596
601
|
},
|
|
597
|
-
}
|
|
602
|
+
};
|
|
603
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
598
604
|
})).pipe(Effect.withSpan("WorkspaceMutations.setHook")),
|
|
599
605
|
setHookLock: ({ name, lockEntry }) => withMutex(Effect.gen(function* () {
|
|
600
606
|
const currentLockfile = yield* readLockfileSafe(workspaceDir);
|
|
601
607
|
const currentLockedHooks = currentLockfile.hooks ?? {};
|
|
602
608
|
const previous = currentLockedHooks[name];
|
|
603
|
-
|
|
609
|
+
const updatedLockfile = {
|
|
604
610
|
...currentLockfile,
|
|
605
611
|
hooks: {
|
|
606
612
|
...currentLockedHooks,
|
|
@@ -610,7 +616,8 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
610
616
|
updatedAt: new Date(),
|
|
611
617
|
},
|
|
612
618
|
},
|
|
613
|
-
}
|
|
619
|
+
};
|
|
620
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
614
621
|
})).pipe(Effect.withSpan("WorkspaceMutations.setHookLock")),
|
|
615
622
|
removeHook: (name) => withMutex(Effect.gen(function* () {
|
|
616
623
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -632,7 +639,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
632
639
|
})()
|
|
633
640
|
: currentLockfile;
|
|
634
641
|
yield* writeSettings(workspaceDir, remainingSettings).pipe(Effect.provide(fsLayer));
|
|
635
|
-
yield*
|
|
642
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, remainingLockfile).pipe(Effect.provide(fsLayer));
|
|
636
643
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeHook")),
|
|
637
644
|
removeHookSettings: (name) => withMutex(Effect.gen(function* () {
|
|
638
645
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -653,10 +660,11 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
653
660
|
return;
|
|
654
661
|
const { [name]: _, ...remainingHooks } = currentLockedHooks;
|
|
655
662
|
void _;
|
|
656
|
-
|
|
663
|
+
const updatedLockfile = {
|
|
657
664
|
...currentLockfile,
|
|
658
665
|
hooks: remainingHooks,
|
|
659
|
-
}
|
|
666
|
+
};
|
|
667
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
660
668
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeHookLock")),
|
|
661
669
|
updateHookEntry: (name, updater) => withMutex(Effect.gen(function* () {
|
|
662
670
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -747,7 +755,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
747
755
|
},
|
|
748
756
|
},
|
|
749
757
|
};
|
|
750
|
-
yield*
|
|
758
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
751
759
|
})).pipe(Effect.withSpan("WorkspaceMutations.setSkill")),
|
|
752
760
|
setSkillLock: ({ name, lockEntry }) => withMutex(Effect.gen(function* () {
|
|
753
761
|
// Update lockfile only (skip settings) — used for pack dependencies
|
|
@@ -765,7 +773,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
765
773
|
},
|
|
766
774
|
},
|
|
767
775
|
};
|
|
768
|
-
yield*
|
|
776
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
769
777
|
})).pipe(Effect.withSpan("WorkspaceMutations.setSkillLock")),
|
|
770
778
|
removeSkill: (name) => withMutex(Effect.gen(function* () {
|
|
771
779
|
// Update settings
|
|
@@ -785,7 +793,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
785
793
|
const { [name]: __, ...remainingLockSkills } = currentLockfile.skills;
|
|
786
794
|
void __;
|
|
787
795
|
const updatedLockfile = { ...currentLockfile, skills: remainingLockSkills };
|
|
788
|
-
yield*
|
|
796
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
789
797
|
}
|
|
790
798
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeSkill")),
|
|
791
799
|
removeSkillFromSettings: (name) => withMutex(Effect.gen(function* () {
|
|
@@ -828,7 +836,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
828
836
|
[name]: { ...oldEntry, agents: [...agents] },
|
|
829
837
|
},
|
|
830
838
|
};
|
|
831
|
-
yield*
|
|
839
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
832
840
|
})),
|
|
833
841
|
addConfiguredAgent: (agentId) => withMutex(Effect.gen(function* () {
|
|
834
842
|
const validId = yield* Schema.decodeUnknownEffect(ConfigurableAgentIdSchema)(agentId).pipe(Effect.mapError((error) => makeAppError({
|
|
@@ -899,7 +907,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
899
907
|
},
|
|
900
908
|
},
|
|
901
909
|
};
|
|
902
|
-
yield*
|
|
910
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
903
911
|
})).pipe(Effect.withSpan("WorkspaceMutations.setPack")),
|
|
904
912
|
setPackEntry: (name, entry) => withMutex(Effect.gen(function* () {
|
|
905
913
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -927,9 +935,65 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
927
935
|
const { [name]: __, ...remainingLockedPacks } = currentLockedPacks;
|
|
928
936
|
void __;
|
|
929
937
|
const updatedLockfile = { ...currentLockfile, packs: remainingLockedPacks };
|
|
930
|
-
yield*
|
|
938
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
931
939
|
}
|
|
932
940
|
})).pipe(Effect.withSpan("WorkspaceMutations.removePack")),
|
|
941
|
+
getConfiguredLibraryEntries: () => readSettingsSafe(workspaceDir).pipe(Effect.map((s) => s.libraries ?? {}), Effect.withSpan("WorkspaceMutations.getConfiguredLibraryEntries")),
|
|
942
|
+
getLockedLibraries: () => readLockfileSafe(workspaceDir).pipe(Effect.map((lf) => lf.libraries ?? {})),
|
|
943
|
+
getLockedLibrary: (name) => readLockfileSafe(workspaceDir).pipe(Effect.map((lf) => Option.fromUndefinedOr((lf.libraries ?? {})[name]))),
|
|
944
|
+
setLibrary: (args) => withMutex(Effect.gen(function* () {
|
|
945
|
+
const { source, name, ...lockFields } = args;
|
|
946
|
+
const lockEntry = makeRegistryLibraryLockEntry({
|
|
947
|
+
...lockFields,
|
|
948
|
+
name,
|
|
949
|
+
});
|
|
950
|
+
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
951
|
+
const currentLibraries = currentSettings.libraries ?? {};
|
|
952
|
+
const existing = currentLibraries[name];
|
|
953
|
+
const enabled = existing?.enabled ?? true;
|
|
954
|
+
const authored = existing?.authored ?? false;
|
|
955
|
+
const updatedSettings = {
|
|
956
|
+
...currentSettings,
|
|
957
|
+
libraries: { ...currentLibraries, [name]: { source, enabled, authored } },
|
|
958
|
+
};
|
|
959
|
+
yield* writeSettings(workspaceDir, updatedSettings).pipe(Effect.provide(fsLayer));
|
|
960
|
+
const currentLockfile = yield* readLockfileSafe(workspaceDir);
|
|
961
|
+
const currentLockedLibraries = currentLockfile.libraries ?? {};
|
|
962
|
+
const updatedLockfile = {
|
|
963
|
+
...currentLockfile,
|
|
964
|
+
libraries: {
|
|
965
|
+
...currentLockedLibraries,
|
|
966
|
+
[name]: {
|
|
967
|
+
...lockEntry,
|
|
968
|
+
updatedAt: new Date(),
|
|
969
|
+
},
|
|
970
|
+
},
|
|
971
|
+
};
|
|
972
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
973
|
+
})).pipe(Effect.withSpan("WorkspaceMutations.setLibrary")),
|
|
974
|
+
setLibraryEntry: (name, entry) => withMutex(Effect.gen(function* () {
|
|
975
|
+
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
976
|
+
const currentLibraries = currentSettings.libraries ?? {};
|
|
977
|
+
const updatedSettings = {
|
|
978
|
+
...currentSettings,
|
|
979
|
+
libraries: { ...currentLibraries, [name]: entry },
|
|
980
|
+
};
|
|
981
|
+
yield* writeSettings(workspaceDir, updatedSettings).pipe(Effect.provide(fsLayer));
|
|
982
|
+
})).pipe(Effect.withSpan("WorkspaceMutations.setLibraryEntry")),
|
|
983
|
+
removeLibrary: (name) => withMutex(Effect.gen(function* () {
|
|
984
|
+
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
985
|
+
const currentLibraries = currentSettings.libraries ?? {};
|
|
986
|
+
const { [name]: removedLibrary, ...remainingLibraries } = currentLibraries;
|
|
987
|
+
void removedLibrary;
|
|
988
|
+
const updatedSettings = { ...currentSettings, libraries: remainingLibraries };
|
|
989
|
+
yield* writeSettings(workspaceDir, updatedSettings).pipe(Effect.provide(fsLayer));
|
|
990
|
+
const currentLockfile = yield* readLockfileSafe(workspaceDir);
|
|
991
|
+
const currentLockedLibraries = currentLockfile.libraries ?? {};
|
|
992
|
+
const { [name]: removedLock, ...remainingLockedLibraries } = currentLockedLibraries;
|
|
993
|
+
void removedLock;
|
|
994
|
+
const updatedLockfile = { ...currentLockfile, libraries: remainingLockedLibraries };
|
|
995
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
996
|
+
})).pipe(Effect.withSpan("WorkspaceMutations.removeLibrary")),
|
|
933
997
|
getPackDir: (name, owner) => Effect.succeed(computePackPaths(path.join, baseDir, owner, name)),
|
|
934
998
|
// -----------------------------------------------------------------------
|
|
935
999
|
// Command methods
|
|
@@ -966,7 +1030,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
966
1030
|
},
|
|
967
1031
|
},
|
|
968
1032
|
};
|
|
969
|
-
yield*
|
|
1033
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
970
1034
|
})).pipe(Effect.withSpan("WorkspaceMutations.setCommand")),
|
|
971
1035
|
setCommandLock: ({ name, lockEntry }) => withMutex(Effect.gen(function* () {
|
|
972
1036
|
// Update lockfile only (skip settings) — used for pack dependencies
|
|
@@ -982,7 +1046,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
982
1046
|
},
|
|
983
1047
|
},
|
|
984
1048
|
};
|
|
985
|
-
yield*
|
|
1049
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
986
1050
|
})),
|
|
987
1051
|
removeCommand: (name) => withMutex(Effect.gen(function* () {
|
|
988
1052
|
// Update settings
|
|
@@ -1005,7 +1069,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1005
1069
|
...currentLockfile,
|
|
1006
1070
|
commands: remainingLockedCommands,
|
|
1007
1071
|
};
|
|
1008
|
-
yield*
|
|
1072
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1009
1073
|
}
|
|
1010
1074
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeCommand")),
|
|
1011
1075
|
updateCommandEntry: (name, updater) => withMutex(Effect.gen(function* () {
|
|
@@ -1073,7 +1137,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1073
1137
|
},
|
|
1074
1138
|
},
|
|
1075
1139
|
};
|
|
1076
|
-
yield*
|
|
1140
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1077
1141
|
})).pipe(Effect.withSpan("WorkspaceMutations.setSubagent")),
|
|
1078
1142
|
setSubagentLock: ({ name, lockEntry }) => withMutex(Effect.gen(function* () {
|
|
1079
1143
|
// Update lockfile only (skip settings) — used for pack dependencies
|
|
@@ -1092,7 +1156,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1092
1156
|
},
|
|
1093
1157
|
},
|
|
1094
1158
|
};
|
|
1095
|
-
yield*
|
|
1159
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1096
1160
|
})),
|
|
1097
1161
|
removeSubagent: (name) => withMutex(Effect.gen(function* () {
|
|
1098
1162
|
// Update settings
|
|
@@ -1115,7 +1179,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1115
1179
|
...currentLockfile,
|
|
1116
1180
|
subagents: remainingLockedSubagents,
|
|
1117
1181
|
};
|
|
1118
|
-
yield*
|
|
1182
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1119
1183
|
}
|
|
1120
1184
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeSubagent")),
|
|
1121
1185
|
updateSubagentEntry: (name, updater) => withMutex(Effect.gen(function* () {
|
|
@@ -1158,7 +1222,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1158
1222
|
const { [name]: _, ...remaining } = currentLockedSubagents;
|
|
1159
1223
|
void _;
|
|
1160
1224
|
const updatedLockfile = { ...currentLockfile, subagents: remaining };
|
|
1161
|
-
yield*
|
|
1225
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1162
1226
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeSubagentLock")),
|
|
1163
1227
|
// -----------------------------------------------------------------------
|
|
1164
1228
|
// MCP Server methods
|
|
@@ -1216,7 +1280,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1216
1280
|
},
|
|
1217
1281
|
},
|
|
1218
1282
|
};
|
|
1219
|
-
yield*
|
|
1283
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1220
1284
|
})).pipe(Effect.withSpan("WorkspaceMutations.setMcpServer")),
|
|
1221
1285
|
setMcpServerLock: ({ name, lockEntry }) => withMutex(Effect.gen(function* () {
|
|
1222
1286
|
// Update lockfile only (skip settings) — used for pack dependencies
|
|
@@ -1232,7 +1296,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1232
1296
|
},
|
|
1233
1297
|
},
|
|
1234
1298
|
};
|
|
1235
|
-
yield*
|
|
1299
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1236
1300
|
})),
|
|
1237
1301
|
updateMcpServerEntry: (name, updater) => withMutex(Effect.gen(function* () {
|
|
1238
1302
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -1278,7 +1342,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1278
1342
|
...currentLockfile,
|
|
1279
1343
|
mcpServers: remainingLockedMcpServers,
|
|
1280
1344
|
};
|
|
1281
|
-
yield*
|
|
1345
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1282
1346
|
}
|
|
1283
1347
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeMcpServer")),
|
|
1284
1348
|
// -----------------------------------------------------------------------
|
|
@@ -1291,7 +1355,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1291
1355
|
const { [name]: _, ...remainingSkills } = currentLockfile.skills;
|
|
1292
1356
|
void _;
|
|
1293
1357
|
const updatedLockfile = { ...currentLockfile, skills: remainingSkills };
|
|
1294
|
-
yield*
|
|
1358
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1295
1359
|
})).pipe(Effect.withSpan("WorkspaceMutations.removeSkillLock")),
|
|
1296
1360
|
removeCommandSettings: (name) => withMutex(Effect.gen(function* () {
|
|
1297
1361
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -1311,7 +1375,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1311
1375
|
const { [name]: _, ...remainingCommands } = currentLockedCommands;
|
|
1312
1376
|
void _;
|
|
1313
1377
|
const updatedLockfile = { ...currentLockfile, commands: remainingCommands };
|
|
1314
|
-
yield*
|
|
1378
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1315
1379
|
})),
|
|
1316
1380
|
removeMcpServerSettings: (name) => withMutex(Effect.gen(function* () {
|
|
1317
1381
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -1331,7 +1395,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1331
1395
|
const { [name]: _, ...remainingMcpServers } = currentLockedMcpServers;
|
|
1332
1396
|
void _;
|
|
1333
1397
|
const updatedLockfile = { ...currentLockfile, mcpServers: remainingMcpServers };
|
|
1334
|
-
yield*
|
|
1398
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1335
1399
|
})),
|
|
1336
1400
|
removePackSettings: (name) => withMutex(Effect.gen(function* () {
|
|
1337
1401
|
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
@@ -1351,7 +1415,27 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1351
1415
|
const { [name]: _, ...remainingPacks } = currentLockedPacks;
|
|
1352
1416
|
void _;
|
|
1353
1417
|
const updatedLockfile = { ...currentLockfile, packs: remainingPacks };
|
|
1354
|
-
yield*
|
|
1418
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1419
|
+
})),
|
|
1420
|
+
removeLibrarySettings: (name) => withMutex(Effect.gen(function* () {
|
|
1421
|
+
const currentSettings = yield* readSettingsSafe(workspaceDir);
|
|
1422
|
+
const currentLibraries = currentSettings.libraries ?? {};
|
|
1423
|
+
if (!(name in currentLibraries))
|
|
1424
|
+
return;
|
|
1425
|
+
const { [name]: _, ...remainingLibraries } = currentLibraries;
|
|
1426
|
+
void _;
|
|
1427
|
+
const updatedSettings = { ...currentSettings, libraries: remainingLibraries };
|
|
1428
|
+
yield* writeSettings(workspaceDir, updatedSettings).pipe(Effect.provide(fsLayer));
|
|
1429
|
+
})),
|
|
1430
|
+
removeLibraryLock: (name) => withMutex(Effect.gen(function* () {
|
|
1431
|
+
const currentLockfile = yield* readLockfileSafe(workspaceDir);
|
|
1432
|
+
const currentLockedLibraries = currentLockfile.libraries ?? {};
|
|
1433
|
+
if (!(name in currentLockedLibraries))
|
|
1434
|
+
return;
|
|
1435
|
+
const { [name]: _, ...remainingLibraries } = currentLockedLibraries;
|
|
1436
|
+
void _;
|
|
1437
|
+
const updatedLockfile = { ...currentLockfile, libraries: remainingLibraries };
|
|
1438
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1355
1439
|
})),
|
|
1356
1440
|
// -----------------------------------------------------------------------
|
|
1357
1441
|
// Pack dependency queries
|
|
@@ -1397,7 +1481,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1397
1481
|
[target.name]: { ...entry, retainedByPack: true },
|
|
1398
1482
|
},
|
|
1399
1483
|
};
|
|
1400
|
-
yield*
|
|
1484
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1401
1485
|
break;
|
|
1402
1486
|
}
|
|
1403
1487
|
case "command": {
|
|
@@ -1412,7 +1496,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1412
1496
|
[target.name]: { ...entry, retainedByPack: true },
|
|
1413
1497
|
},
|
|
1414
1498
|
};
|
|
1415
|
-
yield*
|
|
1499
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1416
1500
|
break;
|
|
1417
1501
|
}
|
|
1418
1502
|
case "mcp-server": {
|
|
@@ -1427,7 +1511,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1427
1511
|
[target.name]: { ...entry, retainedByPack: true },
|
|
1428
1512
|
},
|
|
1429
1513
|
};
|
|
1430
|
-
yield*
|
|
1514
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1431
1515
|
break;
|
|
1432
1516
|
}
|
|
1433
1517
|
case "files": {
|
|
@@ -1442,7 +1526,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1442
1526
|
[target.name]: { ...entry, retainedByPack: true },
|
|
1443
1527
|
},
|
|
1444
1528
|
};
|
|
1445
|
-
yield*
|
|
1529
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1446
1530
|
break;
|
|
1447
1531
|
}
|
|
1448
1532
|
case "rule": {
|
|
@@ -1457,7 +1541,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1457
1541
|
[target.name]: { ...entry, retainedByPack: true },
|
|
1458
1542
|
},
|
|
1459
1543
|
};
|
|
1460
|
-
yield*
|
|
1544
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1461
1545
|
break;
|
|
1462
1546
|
}
|
|
1463
1547
|
case "hook": {
|
|
@@ -1472,7 +1556,7 @@ export const loadWorkspace = (options) => Effect.gen(function* () {
|
|
|
1472
1556
|
[target.name]: { ...entry, retainedByPack: true },
|
|
1473
1557
|
},
|
|
1474
1558
|
};
|
|
1475
|
-
yield*
|
|
1559
|
+
yield* commitLockfileSnapshotUpdate(workspaceDir, currentLockfile, updatedLockfile).pipe(Effect.provide(fsLayer));
|
|
1476
1560
|
break;
|
|
1477
1561
|
}
|
|
1478
1562
|
case "pack":
|