apps 0.0.1-beta.37 → 0.0.1-beta.38

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 (80) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-KOOJUMLR.js → chunk-3MMG2H6M.js} +2 -2
  3. package/js/{chunk-LQBR7AI7.js → chunk-3V575NIW.js} +217 -19
  4. package/js/{chunk-24EIFQYZ.js → chunk-5P2WQRRM.js} +10 -8
  5. package/js/{chunk-BWUHMKHQ.js → chunk-5TJA7364.js} +2 -2
  6. package/js/{chunk-7KEKFBV7.js → chunk-7CSHVXVR.js} +3 -3
  7. package/js/{chunk-3LRFKLUX.js → chunk-BO4US6DZ.js} +9 -49
  8. package/js/{chunk-A4O72Z3A.js → chunk-DKUEYTYD.js} +167 -30
  9. package/js/{chunk-GHDZEEPO.js → chunk-DWMEIU2L.js} +395 -82
  10. package/js/{chunk-ENJCQWVF.js → chunk-E4BWL7KQ.js} +3 -3
  11. package/js/{chunk-CAOHGMNW.js → chunk-F3TBO2U3.js} +7 -94
  12. package/js/{chunk-POOIHRPF.js → chunk-GHXRRFZA.js} +11 -34
  13. package/js/{chunk-RSNZDT4L.js → chunk-JTMDWPCH.js} +2 -2
  14. package/js/{chunk-YW333DH3.js → chunk-KANDIVIH.js} +4 -4
  15. package/js/{chunk-2FWXCU5I.js → chunk-KAQD3DTI.js} +1 -1
  16. package/js/{chunk-KEZ4YZSP.js → chunk-MLHNVYHT.js} +2 -2
  17. package/js/{chunk-IJQ5LE74.js → chunk-MXDKXAY4.js} +363 -401
  18. package/js/{chunk-U74JVKTQ.js → chunk-NROBHRTG.js} +7 -7
  19. package/js/{chunk-BI6R577B.js → chunk-P7MGDPFD.js} +2 -2
  20. package/js/{chunk-D45FU4TZ.js → chunk-Q4QZDB2F.js} +3 -3
  21. package/js/{chunk-JU7F4PRK.js → chunk-RIXVGVA6.js} +2 -2
  22. package/js/{chunk-QQKHJ72Y.js → chunk-RJCWJNCH.js} +9 -9
  23. package/js/{chunk-UCOMVHGW.js → chunk-U5PFZDVB.js} +2 -2
  24. package/js/{chunk-PHO7HXTC.js → chunk-VIU2XXA7.js} +294 -47
  25. package/js/{chunk-TADLIUEU.js → chunk-VJQXXOQ3.js} +2 -2
  26. package/js/{chunk-NHCFIWN5.js → chunk-W2NV54JD.js} +1 -1
  27. package/js/{chunk-BI45HZWM.js → chunk-YQ35E7KS.js} +1 -1
  28. package/js/{chunk-WDBUOIWV.js → chunk-ZUKBIHMK.js} +3 -3
  29. package/js/client.js +13 -17
  30. package/js/contracts.js +16 -21
  31. package/js/effect.js +19 -24
  32. package/js/graphql.js +21 -26
  33. package/js/host.js +19 -24
  34. package/js/index.js +13 -26
  35. package/js/mcp/effect.js +21 -26
  36. package/js/mcp/stdio.js +21 -26
  37. package/js/mcp.js +23 -28
  38. package/js/openapi.js +17 -21
  39. package/js/react.js +2 -3
  40. package/js/skills/effect.js +6 -7
  41. package/js/skills.js +15 -17
  42. package/js/storage/facet.js +1 -214
  43. package/js/ui/auth/contracts.js +2 -2
  44. package/js/ui/auth.js +5 -5
  45. package/js/ui/contracts.js +5 -6
  46. package/js/ui/serving.js +10 -11
  47. package/package.json +1 -2
  48. package/runtime.json +1 -1
  49. package/types/apps/src/contracts/app.d.ts +0 -2
  50. package/types/apps/src/contracts/context.d.ts +12 -11
  51. package/types/apps/src/contracts/host.d.ts +10 -8
  52. package/types/apps/src/contracts/live.d.ts +2 -0
  53. package/types/apps/src/contracts/operations.d.ts +3 -3
  54. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  55. package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
  56. package/types/apps/src/contracts/protocols/4.d.ts +3 -3
  57. package/types/apps/src/contracts/protocols/5.d.ts +1 -1
  58. package/types/apps/src/contracts/protocols/6.d.ts +1 -1
  59. package/types/apps/src/contracts/protocols/7.d.ts +1 -1
  60. package/types/apps/src/contracts/sql.d.ts +58 -0
  61. package/types/apps/src/facet.d.ts +4 -5
  62. package/types/apps/src/implementation/openapi-compile.d.ts +2 -2
  63. package/types/apps/src/implementation/schema.d.ts +1 -10
  64. package/types/apps/src/implementation/sql.d.ts +66 -0
  65. package/types/apps/src/index.d.ts +1 -2
  66. package/js/chunk-73AV3JVU.js +0 -186
  67. package/js/chunk-HDAQBRT5.js +0 -1254
  68. package/js/chunk-IU7CCCUC.js +0 -630
  69. package/js/chunk-NHUHTWAF.js +0 -0
  70. package/js/chunk-V5DWGYRK.js +0 -268
  71. package/js/chunk-Y3XN4X4Q.js +0 -19
  72. package/types/app-data/src/implementation/cursor.d.ts +0 -10
  73. package/types/app-data/src/implementation/index-key.d.ts +0 -7
  74. package/types/app-data/src/implementation/promise.d.ts +0 -68
  75. package/types/app-data/src/implementation/range.d.ts +0 -8
  76. package/types/app-data/src/implementation/schema.d.ts +0 -18
  77. package/types/app-data/src/implementation/sqlite.d.ts +0 -11
  78. package/types/app-data/src/index.d.ts +0 -4
  79. package/types/apps/src/contracts/storage.d.ts +0 -68
  80. package/types/apps/src/implementation/storage.d.ts +0 -15
@@ -1,9 +1,3 @@
1
- import {
2
- Reactivity,
3
- invalidate,
4
- layer,
5
- mutation
6
- } from "./chunk-HDAQBRT5.js";
7
1
  import {
8
2
  Boolean,
9
3
  Cause,
@@ -43,6 +37,7 @@ import {
43
37
  constTrue,
44
38
  constVoid,
45
39
  constant,
40
+ context,
46
41
  contextWith,
47
42
  declareConstructor,
48
43
  decodeEffect,
@@ -65,6 +60,7 @@ import {
65
60
  fail4 as fail3,
66
61
  failCause,
67
62
  failCause2,
63
+ failCauseUnsafe,
68
64
  filter,
69
65
  filter2,
70
66
  filterInterruptors,
@@ -75,9 +71,11 @@ import {
75
71
  flatMap2,
76
72
  flatMapEager,
77
73
  flatMapNullishOr,
74
+ flow,
78
75
  forkDetach,
79
76
  fromInputUnsafe,
80
77
  fromJsonString,
78
+ fromQueue,
81
79
  gen,
82
80
  get,
83
81
  get3 as get2,
@@ -87,6 +85,7 @@ import {
87
85
  getOrNull,
88
86
  getOrThrowWith,
89
87
  getOrUndefined,
88
+ getOrUndefined2,
90
89
  getStackTraceLimit,
91
90
  getSuccess,
92
91
  getUnsafe,
@@ -109,6 +108,7 @@ import {
109
108
  joinAll,
110
109
  lastNonEmpty,
111
110
  link,
111
+ make3 as make,
112
112
  makeCompositeAtKey,
113
113
  makeMemoMapUnsafe,
114
114
  makeUnsafe2 as makeUnsafe,
@@ -124,14 +124,17 @@ import {
124
124
  never,
125
125
  none,
126
126
  offerUnsafe,
127
+ onExit,
127
128
  pipe,
128
129
  pipeArguments,
129
130
  provide2 as provide,
130
131
  provideMerge,
132
+ provideService,
131
133
  remove3 as remove,
132
134
  runCallbackWith,
133
135
  runForEachArray,
134
136
  runForkWith,
137
+ runIn,
135
138
  runSync,
136
139
  runSyncWith,
137
140
  scope,
@@ -148,6 +151,7 @@ import {
148
151
  symbol,
149
152
  symbol2,
150
153
  sync2 as sync,
154
+ tap,
151
155
  toCodecJson,
152
156
  toMillis,
153
157
  toPull,
@@ -158,7 +162,7 @@ import {
158
162
  void_2,
159
163
  whileLoop,
160
164
  zipRight
161
- } from "./chunk-IJQ5LE74.js";
165
+ } from "./chunk-MXDKXAY4.js";
162
166
  import {
163
167
  __export
164
168
  } from "./chunk-CZ7CSFO4.js";
@@ -610,27 +614,27 @@ __export(AtomRegistry_exports, {
610
614
  batchState: () => batchState,
611
615
  getResult: () => getResult,
612
616
  isAtomRegistry: () => isAtomRegistry,
613
- layer: () => layer2,
617
+ layer: () => layer,
614
618
  layerOptions: () => layerOptions,
615
- make: () => make,
619
+ make: () => make2,
616
620
  mount: () => mount,
617
621
  toStream: () => toStream,
618
622
  toStreamResult: () => toStreamResult
619
623
  });
620
624
  var TypeId2 = "~effect/reactivity/AtomRegistry";
621
625
  var isAtomRegistry = (u) => hasProperty(u, TypeId2);
622
- var make = (options) => new RegistryImpl(options?.initialValues, options?.scheduleTask, options?.timeoutResolution, options?.defaultIdleTTL);
626
+ var make2 = (options) => new RegistryImpl(options?.initialValues, options?.scheduleTask, options?.timeoutResolution, options?.defaultIdleTTL);
623
627
  var AtomRegistry = /* @__PURE__ */ Service(TypeId2);
624
628
  var layerOptions = (options) => effect(AtomRegistry, gen(function* () {
625
629
  const scope2 = yield* scope;
626
- const registry = make({
630
+ const registry = make2({
627
631
  ...options,
628
632
  scheduleTask: options?.scheduleTask
629
633
  });
630
634
  yield* addFinalizer(scope2, sync(() => registry.dispose()));
631
635
  return registry;
632
636
  }));
633
- var layer2 = /* @__PURE__ */ layerOptions();
637
+ var layer = /* @__PURE__ */ layerOptions();
634
638
  var toStream = /* @__PURE__ */ dual(2, (self, atom) => callback2((queue) => suspend(() => {
635
639
  const fiber = getCurrent();
636
640
  const scope2 = getUnsafe(fiber.context, Scope);
@@ -1442,11 +1446,11 @@ __export(Atom_exports, {
1442
1446
  Reset: () => Reset,
1443
1447
  SerializableTypeId: () => SerializableTypeId2,
1444
1448
  ServerValueTypeId: () => ServerValueTypeId,
1445
- TypeId: () => TypeId3,
1449
+ TypeId: () => TypeId4,
1446
1450
  WritableTypeId: () => WritableTypeId,
1447
1451
  autoDispose: () => autoDispose,
1448
1452
  batch: () => batch2,
1449
- context: () => context,
1453
+ context: () => context2,
1450
1454
  debounce: () => debounce,
1451
1455
  family: () => family,
1452
1456
  fn: () => fn,
@@ -1460,7 +1464,7 @@ __export(Atom_exports, {
1460
1464
  isWritable: () => isWritable,
1461
1465
  keepAlive: () => keepAlive,
1462
1466
  kvs: () => kvs,
1463
- make: () => make2,
1467
+ make: () => make4,
1464
1468
  makeRefreshOnSignal: () => makeRefreshOnSignal,
1465
1469
  map: () => map5,
1466
1470
  mapResult: () => mapResult,
@@ -1495,6 +1499,139 @@ __export(Atom_exports, {
1495
1499
  writable: () => writable
1496
1500
  });
1497
1501
 
1502
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/reactivity/Reactivity.js
1503
+ var TypeId3 = "~effect/reactivity/Reactivity";
1504
+ var Reactivity = /* @__PURE__ */ Service("effect/reactivity/Reactivity");
1505
+ var make3 = /* @__PURE__ */ sync(() => {
1506
+ const handlers = /* @__PURE__ */ new Map();
1507
+ const invalidateUnsafe = (keys) => {
1508
+ keysToHashes(keys, (hash2) => {
1509
+ const set4 = handlers.get(hash2);
1510
+ if (set4 === void 0) return;
1511
+ set4.forEach((run) => run());
1512
+ });
1513
+ };
1514
+ const invalidate2 = (keys) => contextWith((services) => {
1515
+ const pending = getOrUndefined2(services, PendingInvalidation);
1516
+ if (pending) {
1517
+ keysToHashes(keys, (hash2) => {
1518
+ pending.add(hash2);
1519
+ });
1520
+ } else {
1521
+ invalidateUnsafe(keys);
1522
+ }
1523
+ return void_2;
1524
+ });
1525
+ const mutation2 = (keys, effect3) => tap(effect3, invalidate2(keys));
1526
+ const registerUnsafe = (keys, handler) => {
1527
+ const resolvedKeys = [];
1528
+ keysToHashes(keys, (hash2) => {
1529
+ resolvedKeys.push(hash2);
1530
+ let set4 = handlers.get(hash2);
1531
+ if (set4 === void 0) {
1532
+ set4 = /* @__PURE__ */ new Set();
1533
+ handlers.set(hash2, set4);
1534
+ }
1535
+ set4.add(handler);
1536
+ });
1537
+ return () => {
1538
+ for (let i = 0; i < resolvedKeys.length; i++) {
1539
+ const set4 = handlers.get(resolvedKeys[i]);
1540
+ if (set4 === void 0) continue;
1541
+ set4.delete(handler);
1542
+ if (set4.size === 0) {
1543
+ handlers.delete(resolvedKeys[i]);
1544
+ }
1545
+ }
1546
+ };
1547
+ };
1548
+ const query = (keys, effect3) => gen(function* () {
1549
+ const services = yield* context();
1550
+ const scope2 = get(services, Scope);
1551
+ const results = yield* make();
1552
+ const runFork = flow(runForkWith(services), runIn(scope2));
1553
+ let running = false;
1554
+ let pending = false;
1555
+ const handleExit = (exit) => {
1556
+ if (exit._tag === "Failure") {
1557
+ failCauseUnsafe(results, exit.cause);
1558
+ } else {
1559
+ offerUnsafe(results, exit.value);
1560
+ }
1561
+ if (pending) {
1562
+ pending = false;
1563
+ runFork(effect3).addObserver(handleExit);
1564
+ } else {
1565
+ running = false;
1566
+ }
1567
+ };
1568
+ function run() {
1569
+ if (running) {
1570
+ pending = true;
1571
+ return;
1572
+ }
1573
+ running = true;
1574
+ runFork(effect3).addObserver(handleExit);
1575
+ }
1576
+ const cancel = registerUnsafe(keys, run);
1577
+ yield* addFinalizer(scope2, sync(cancel));
1578
+ run();
1579
+ return results;
1580
+ });
1581
+ const stream2 = (tables, effect3) => query(tables, effect3).pipe(map2(fromQueue), unwrap);
1582
+ const withBatch = (effect3) => suspend(() => {
1583
+ const pending = /* @__PURE__ */ new Set();
1584
+ return effect3.pipe(provideService(PendingInvalidation, pending), onExit((_) => sync(() => {
1585
+ pending.forEach((hash2) => {
1586
+ const set4 = handlers.get(hash2);
1587
+ if (set4 === void 0) return;
1588
+ set4.forEach((run) => run());
1589
+ });
1590
+ })));
1591
+ });
1592
+ return Reactivity.of({
1593
+ [TypeId3]: TypeId3,
1594
+ mutation: mutation2,
1595
+ query,
1596
+ stream: stream2,
1597
+ invalidateUnsafe,
1598
+ invalidate: invalidate2,
1599
+ registerUnsafe,
1600
+ withBatch
1601
+ });
1602
+ });
1603
+ var PendingInvalidation = class extends (/* @__PURE__ */ Service()("effect/reactivity/Reactivity/PendingInvalidation")) {
1604
+ };
1605
+ var mutation = /* @__PURE__ */ dual(2, (effect3, keys) => Reactivity.use((_) => _.mutation(keys, effect3)));
1606
+ var invalidate = (keys) => Reactivity.use((r) => r.invalidate(keys));
1607
+ var layer2 = /* @__PURE__ */ effect(Reactivity)(make3);
1608
+ function stringOrHash(u) {
1609
+ switch (typeof u) {
1610
+ case "string":
1611
+ case "number":
1612
+ case "bigint":
1613
+ case "boolean":
1614
+ return String(u);
1615
+ default:
1616
+ return hash(u);
1617
+ }
1618
+ }
1619
+ var keysToHashes = (keys, f) => {
1620
+ if (Array.isArray(keys)) {
1621
+ for (let i = 0; i < keys.length; i++) {
1622
+ f(stringOrHash(keys[i]));
1623
+ }
1624
+ return;
1625
+ }
1626
+ for (const key in keys) {
1627
+ f(key);
1628
+ const ids = keys[key];
1629
+ for (let i = 0; i < ids.length; i++) {
1630
+ f(`${key}:${stringOrHash(ids[i])}`);
1631
+ }
1632
+ }
1633
+ };
1634
+
1498
1635
  // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/persistence/KeyValueStore.js
1499
1636
  var ErrorTypeId = "~effect/persistence/KeyValueStore/KeyValueStoreError";
1500
1637
  var KeyValueStoreError = class extends (/* @__PURE__ */ TaggedError("KeyValueStoreError")) {
@@ -1539,8 +1676,8 @@ var toSchemaStore = (self, schema) => {
1539
1676
  };
1540
1677
 
1541
1678
  // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/reactivity/Atom.js
1542
- var TypeId3 = "~effect/reactivity/Atom";
1543
- var isAtom = (u) => hasProperty(u, TypeId3);
1679
+ var TypeId4 = "~effect/reactivity/Atom";
1680
+ var isAtom = (u) => hasProperty(u, TypeId4);
1544
1681
  var WritableTypeId = "~effect/reactivity/Atom/Writable";
1545
1682
  var setIdleTTL = /* @__PURE__ */ dual(2, (self, durationInput) => {
1546
1683
  const duration = fromInputUnsafe(durationInput);
@@ -1553,7 +1690,7 @@ var setIdleTTL = /* @__PURE__ */ dual(2, (self, durationInput) => {
1553
1690
  });
1554
1691
  var removeTtl = /* @__PURE__ */ setIdleTTL(0);
1555
1692
  var AtomProto = {
1556
- [TypeId3]: TypeId3,
1693
+ [TypeId4]: TypeId4,
1557
1694
  equals: Object.is,
1558
1695
  ...PipeInspectableProto,
1559
1696
  toJSON() {
@@ -1651,9 +1788,9 @@ var writable = (read, write, refresh2) => {
1651
1788
  function constSetSelf(ctx, value2) {
1652
1789
  ctx.setSelf(value2);
1653
1790
  }
1654
- var make2 = (arg, options) => {
1791
+ var make4 = (arg, options) => {
1655
1792
  const readOrAtom = makeRead(arg, options);
1656
- if (TypeId3 in readOrAtom) {
1793
+ if (TypeId4 in readOrAtom) {
1657
1794
  return readOrAtom;
1658
1795
  }
1659
1796
  return readable(readOrAtom);
@@ -1723,9 +1860,9 @@ function makeEffect(ctx, effect3, initialValue2, services = empty(), uninterrupt
1723
1860
  }
1724
1861
  return waiting(initialValue2);
1725
1862
  }
1726
- function runCallbackSync(services, effect3, onExit, uninterruptible = false) {
1863
+ function runCallbackSync(services, effect3, onExit2, uninterruptible = false) {
1727
1864
  if (isExit(effect3)) {
1728
- onExit(effect3);
1865
+ onExit2(effect3);
1729
1866
  return void 0;
1730
1867
  }
1731
1868
  const runFork = runForkWith(services);
@@ -1733,10 +1870,10 @@ function runCallbackSync(services, effect3, onExit, uninterruptible = false) {
1733
1870
  fiber.currentDispatcher?.flush();
1734
1871
  const result = fiber.pollUnsafe();
1735
1872
  if (result) {
1736
- onExit(result);
1873
+ onExit2(result);
1737
1874
  return void 0;
1738
1875
  }
1739
- const remove2 = fiber.addObserver(onExit);
1876
+ const remove2 = fiber.addObserver(onExit2);
1740
1877
  function cancel() {
1741
1878
  remove2();
1742
1879
  if (!uninterruptible) {
@@ -1745,10 +1882,10 @@ function runCallbackSync(services, effect3, onExit, uninterruptible = false) {
1745
1882
  }
1746
1883
  return cancel;
1747
1884
  }
1748
- function context(options) {
1749
- const memoMap = options?.memoMap ?? removeTtl(make2(() => makeMemoMapUnsafe()));
1885
+ function context2(options) {
1886
+ const memoMap = options?.memoMap ?? removeTtl(make4(() => makeMemoMapUnsafe()));
1750
1887
  const resolveMemoMap = (get5) => isAtom(memoMap) ? get5(memoMap) : memoMap;
1751
- let globalLayer = layer;
1888
+ let globalLayer = layer2;
1752
1889
  function factory(create) {
1753
1890
  const self = Object.create(RuntimeProto);
1754
1891
  self.keepAlive = false;
@@ -1768,9 +1905,9 @@ function context(options) {
1768
1905
  }
1769
1906
  factory.memoMap = memoMap;
1770
1907
  factory.addGlobalLayer = (layer3) => {
1771
- globalLayer = provideMerge(globalLayer, provide(layer3, layer));
1908
+ globalLayer = provideMerge(globalLayer, provide(layer3, layer2));
1772
1909
  };
1773
- const reactivityAtom = removeTtl(make2((get5) => contextWith((services) => buildWithMemoMap(layer, resolveMemoMap(get5), get(services, Scope))).pipe(map2(get(Reactivity)))));
1910
+ const reactivityAtom = removeTtl(make4((get5) => contextWith((services) => buildWithMemoMap(layer2, resolveMemoMap(get5), get(services, Scope))).pipe(map2(get(Reactivity)))));
1774
1911
  factory.withReactivity = (keys) => (atom) => transform2(atom, (get5) => {
1775
1912
  const reactivity = getOrThrow(get5(reactivityAtom));
1776
1913
  get5.addFinalizer(reactivity.registerUnsafe(keys, () => {
@@ -1783,7 +1920,7 @@ function context(options) {
1783
1920
  });
1784
1921
  return factory;
1785
1922
  }
1786
- var runtime = /* @__PURE__ */ context();
1923
+ var runtime = /* @__PURE__ */ context2();
1787
1924
  var withReactivity = runtime.withReactivity;
1788
1925
  var stream = (get5, stream2, options, services) => {
1789
1926
  const initialValue2 = options?.initialValue !== void 0 ? success(options.initialValue) : initial();