apps 0.0.1-beta.110 → 0.0.1-beta.116

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,6 +1,6 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-JCX2K2SI.js";
3
+ } from "./chunk-OSVCX4MV.js";
4
4
  import {
5
5
  failOnNetworkRefusal
6
6
  } from "./chunk-HLMJBE4T.js";
@@ -2,9 +2,10 @@ import {
2
2
  skillFromFiles
3
3
  } from "./chunk-PBGPES67.js";
4
4
  import {
5
+ PartialListing,
5
6
  joinPath,
6
7
  mergeMeta
7
- } from "./chunk-ZXG7RMCB.js";
8
+ } from "./chunk-OIMMQRYE.js";
8
9
  import {
9
10
  isShortenedStated,
10
11
  parseProviderError,
@@ -547,6 +548,7 @@ var parseSkillLoadFailed = (error) => Schema_exports.decodeUnknownOption(SkillLo
547
548
  );
548
549
  var errorName = (error) => (error.name.length > 0 ? error.name : "Error").slice(0, 128);
549
550
  var ownCode = (error, secrets) => Predicate_exports.hasProperty(error, "code") && Schema_exports.is(FailureCode)(error.code) && error.code !== "" ? boundText(error.code, secrets, 128) : void 0;
551
+ var causeCode = (error, secrets) => error.cause instanceof Error ? ownCode(error.cause, secrets) : void 0;
550
552
  var reservedFields = /* @__PURE__ */ new Set(["name", "message", "stack", "cause", "_tag"]);
551
553
  var ownFields = (error, code, secrets) => {
552
554
  const fields = {};
@@ -689,8 +691,9 @@ var failureDetail = (error, secrets) => {
689
691
  message: boundFailureMessage(error.message, secrets)
690
692
  };
691
693
  if (error instanceof Error) {
692
- const code = ownCode(error, secrets);
693
- const fields = ownFields(error, code, secrets);
694
+ const own = ownCode(error, secrets);
695
+ const code = own ?? causeCode(error, secrets);
696
+ const fields = ownFields(error, own, secrets);
694
697
  return {
695
698
  source: "app",
696
699
  errorName: errorName(error),
@@ -829,17 +832,32 @@ var readCatalog = (root, options) => Effect_exports.gen(function* () {
829
832
  const tools = [];
830
833
  const routers = [];
831
834
  const { wanted, secrets } = options;
835
+ const listing = (read) => sourced(
836
+ () => read().pipe(
837
+ Effect_exports.map((tools2) => ({ tools: tools2, error: void 0 })),
838
+ Effect_exports.catchIf(
839
+ Schema_exports.is(PartialListing),
840
+ ({ tools: tools2, error }) => Effect_exports.succeed({ tools: tools2, error: safeFailure(error, secrets) })
841
+ )
842
+ ),
843
+ secrets
844
+ );
832
845
  const readSource = (source, path, relative) => Effect_exports.gen(function* () {
833
846
  const describe = source.describe;
834
- const [meta, listed] = yield* Effect_exports.all(
847
+ const [meta, { tools: listed, error }] = yield* Effect_exports.all(
835
848
  [
836
849
  routerMeta(source, secrets),
837
- options.summary && source.summaries !== void 0 ? sourced(source.summaries, secrets) : relative !== void 0 && describe !== void 0 ? sourced(
850
+ options.summary && source.summaries !== void 0 ? listing(source.summaries) : relative !== void 0 && describe !== void 0 ? sourced(
838
851
  () => Effect_exports.forEach(relative, (name) => describe(name), {
839
852
  concurrency: "unbounded"
840
853
  }),
841
854
  secrets
842
- ).pipe(Effect_exports.map((tools2) => tools2.filter((tool) => tool !== void 0))) : sourced(source.list, secrets)
855
+ ).pipe(
856
+ Effect_exports.map((tools2) => ({
857
+ tools: tools2.filter((tool) => tool !== void 0),
858
+ error: void 0
859
+ }))
860
+ ) : listing(source.list)
843
861
  ],
844
862
  { concurrency: "unbounded" }
845
863
  );
@@ -859,18 +877,18 @@ var readCatalog = (root, options) => Effect_exports.gen(function* () {
859
877
  annotations: { ...tool.annotations, readOnlyHint: readOnly }
860
878
  });
861
879
  }
862
- return { meta, found };
880
+ return { meta, found, error };
863
881
  });
864
882
  const include = (source, path, relative) => Effect_exports.gen(function* () {
865
883
  if (path === "") {
866
- const { meta, found } = yield* readSource(source, path, relative);
884
+ const { meta, found, error } = yield* readSource(source, path, relative);
867
885
  tools.push(...found);
868
- return { meta, error: void 0 };
886
+ return { meta, error };
869
887
  }
870
888
  const result = yield* Effect_exports.result(readSource(source, path, relative));
871
889
  if (Result_exports.isFailure(result)) return { meta: source.overrides, error: result.failure };
872
890
  tools.push(...result.success.found);
873
- return { meta: result.success.meta, error: void 0 };
891
+ return { meta: result.success.meta, error: result.success.error };
874
892
  });
875
893
  const visit = (node, path) => Effect_exports.gen(function* () {
876
894
  if (path !== "" || wanted === void 0 && node.meta !== void 0)
@@ -903,8 +921,8 @@ var readCatalog = (root, options) => Effect_exports.gen(function* () {
903
921
  if (root?.kind === "router") yield* visit(root, "");
904
922
  else if (root?.kind === "dynamic" && options.scheduled !== true) {
905
923
  const read = yield* include(root, "", wanted === void 0 ? void 0 : [...wanted]);
906
- if (wanted === void 0 && read.meta !== void 0)
907
- routers.push(yield* entry("", read.meta));
924
+ if (wanted === void 0 && (read.meta !== void 0 || read.error !== void 0))
925
+ routers.push(yield* entry("", read.meta, read.error));
908
926
  }
909
927
  return { tools, routers };
910
928
  });
@@ -2,7 +2,7 @@ import {
2
2
  declaredOperations,
3
3
  nativeOperation,
4
4
  nativeRouter
5
- } from "./chunk-ZXG7RMCB.js";
5
+ } from "./chunk-OIMMQRYE.js";
6
6
  import {
7
7
  fromPromise,
8
8
  method
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-BKIQCV72.js";
3
+ } from "./chunk-6A6P5TYV.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-ZXG7RMCB.js";
8
+ } from "./chunk-OIMMQRYE.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {