@m4trix/core 0.12.1 → 0.14.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/index.cjs CHANGED
@@ -1560,16 +1560,19 @@ var LayerName = effect.Brand.refined(
1560
1560
  (s) => effect.Brand.error(`Expected camelCase (e.g. myLayerFoo), got: ${s}`)
1561
1561
  );
1562
1562
  var DepedencyLayer = {
1563
- of(config) {
1564
- const name = LayerName(config.name);
1565
- const decode = effect.Schema.decodeUnknown(config.shape);
1566
- return {
1563
+ of(def) {
1564
+ const name = LayerName(def.name);
1565
+ const decodeConfig = effect.Schema.decodeUnknown(def.config);
1566
+ const dep = {
1567
1567
  _tag: "SkillDependencyDef",
1568
1568
  name,
1569
- _name: config.name,
1570
- shape: config.shape,
1571
- decode
1569
+ _name: def.name,
1570
+ config: def.config,
1571
+ decodeConfig
1572
1572
  };
1573
+ return Object.assign(dep, {
1574
+ define: () => dep
1575
+ });
1573
1576
  }
1574
1577
  };
1575
1578
  function toLayerArray(layers) {
@@ -1588,6 +1591,15 @@ function assertUniqueLayerNames(layers) {
1588
1591
  seen.add(key);
1589
1592
  }
1590
1593
  }
1594
+ var DoneTypeId = Symbol.for("sunken-trove/Done");
1595
+ var Done = {
1596
+ of(value) {
1597
+ return { [DoneTypeId]: DoneTypeId, _tag: "Done", done: value };
1598
+ },
1599
+ is(u) {
1600
+ return typeof u === "object" && u !== null && DoneTypeId in u && u[DoneTypeId] === DoneTypeId;
1601
+ }
1602
+ };
1591
1603
  var Skill = class _Skill {
1592
1604
  constructor(params) {
1593
1605
  this._inputSchema = params.inputSchema;
@@ -1694,7 +1706,7 @@ var Skill = class _Skill {
1694
1706
  for (const c of chunks) {
1695
1707
  yield c;
1696
1708
  }
1697
- yield { _tag: "Done", done: decodedDone };
1709
+ yield Done.of(decodedDone);
1698
1710
  },
1699
1711
  invoke: async (input, runtime) => {
1700
1712
  const decodedInput = effect.Effect.runSync(
@@ -1927,6 +1939,7 @@ exports.Channel = Channel;
1927
1939
  exports.ChannelName = ChannelName;
1928
1940
  exports.ConfiguredChannel = ConfiguredChannel;
1929
1941
  exports.DepedencyLayer = DepedencyLayer;
1942
+ exports.Done = Done;
1930
1943
  exports.EventMetaSchema = EventMetaSchema;
1931
1944
  exports.ExposeAuthError = ExposeAuthError;
1932
1945
  exports.ExpressEndpoint = ExpressEndpoint;