@swarm.ing/pieui 2.0.32 → 2.0.34

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 (53) hide show
  1. package/dist/agent/index.d.ts +11 -0
  2. package/dist/agent/index.d.ts.map +1 -0
  3. package/dist/agent/index.esm.js +2 -0
  4. package/dist/agent/index.js +2 -0
  5. package/dist/cli.js +159 -138
  6. package/dist/components/Common/AutoRedirectCard/ui/AutoRedirectCard.d.ts +1 -1
  7. package/dist/components/Common/AutoRedirectCard/ui/AutoRedirectCard.d.ts.map +1 -1
  8. package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts +1 -1
  9. package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts.map +1 -1
  10. package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts +1 -1
  11. package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts.map +1 -1
  12. package/dist/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.d.ts +1 -1
  13. package/dist/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.d.ts.map +1 -1
  14. package/dist/components/Common/HiddenCard/ui/HiddenCard.d.ts +1 -1
  15. package/dist/components/Common/HiddenCard/ui/HiddenCard.d.ts.map +1 -1
  16. package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts +1 -1
  17. package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts.map +1 -1
  18. package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts +1 -1
  19. package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts.map +1 -1
  20. package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts +1 -1
  21. package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts.map +1 -1
  22. package/dist/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.d.ts +1 -1
  23. package/dist/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.d.ts.map +1 -1
  24. package/dist/components/Containers/BoxCard/ui/BoxCard.d.ts +1 -1
  25. package/dist/components/Containers/BoxCard/ui/BoxCard.d.ts.map +1 -1
  26. package/dist/components/Containers/OneOfCard/ui/OneOfCard.d.ts +1 -1
  27. package/dist/components/Containers/OneOfCard/ui/OneOfCard.d.ts.map +1 -1
  28. package/dist/components/Containers/SequenceCard/ui/SequenceCard.d.ts +1 -1
  29. package/dist/components/Containers/SequenceCard/ui/SequenceCard.d.ts.map +1 -1
  30. package/dist/components/Containers/UnionCard/ui/UnionCard.d.ts +1 -1
  31. package/dist/components/Containers/UnionCard/ui/UnionCard.d.ts.map +1 -1
  32. package/dist/components/PieBaseRoot/index.d.ts +1 -1
  33. package/dist/components/PieBaseRoot/index.d.ts.map +1 -1
  34. package/dist/components/PieCard/index.d.ts +1 -1
  35. package/dist/components/PieCard/index.d.ts.map +1 -1
  36. package/dist/components/PieRoot/index.d.ts +1 -1
  37. package/dist/components/PieRoot/index.d.ts.map +1 -1
  38. package/dist/components/UI/index.d.ts +1 -1
  39. package/dist/components/UI/index.d.ts.map +1 -1
  40. package/dist/components/UILoading/index.d.ts +1 -1
  41. package/dist/components/UILoading/index.d.ts.map +1 -1
  42. package/dist/components/index.esm.js +1 -1
  43. package/dist/components/index.js +1 -1
  44. package/dist/index.d.ts +0 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.esm.js +2 -1
  47. package/dist/index.js +2 -1
  48. package/dist/storybook/addon/index.esm.js +1 -1
  49. package/dist/storybook/addon/index.js +1 -1
  50. package/dist/storybook/index.d.ts +3 -3
  51. package/dist/storybook/index.d.ts.map +1 -1
  52. package/dist/storybook/index.js +1 -1
  53. package/package.json +10 -3
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Optional OpenAI-agent integration entry.
3
+ *
4
+ * These helpers depend on `@openai/agents` (which transitively pulls the OpenAI
5
+ * + MCP SDKs). They are intentionally split out of the main `@swarm.ing/pieui`
6
+ * barrel so that apps which only use the UI primitives never ship the agent
7
+ * stack to the browser. Import from `@swarm.ing/pieui/agent` when you need to
8
+ * expose PieCard methods as OpenAI function tools.
9
+ */
10
+ export { getMittAgentTools, usePieMittAgentTools, type MittAgentTool, type MittAgentToolDescriptor, type MittAgentToolsOptions, } from '../util/mittAgentTools';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,OAAO,EACH,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC7B,MAAM,wBAAwB,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{tool as A}from"@openai/agents";import{useContext as P,useMemo as I}from"react";import S from"mitt";import{createContext as O,useCallback as w,useContext as E}from"react";var Z=null;function $(){if(!Z)Z=S();return Z}var R=O(null);var q=R;var z=/^pie(.+?)_(.+)$/;function D(X=$(),Q={}){let G=[],H=new Set;for(let j of X.all.keys()){if(typeof j!=="string")continue;let W=j.match(z);if(!W)continue;let[,J,L]=W,B={methodName:J,cardName:L,eventName:j};if(Q.filter&&!Q.filter(B))continue;let Y=Q.nameFor?.(B)??`${L}_${J}`;if(H.has(Y))continue;H.add(Y);let U=Q.describe?.(B)??`Invokes the "${J}" method on the PieCard "${L}" by emitting the in-process mitt event "${j}". The optional "payload" argument is forwarded verbatim to the card's handler.`;G.push(A({name:Y,description:U,strict:!1,parameters:{type:"object",properties:{payload:{description:"Arbitrary JSON payload forwarded to the PieCard method handler. Omit for fire-and-forget calls."}},required:[],additionalProperties:!0},execute:async(F)=>{let V=F?.payload;return X.emit(j,V),`Emitted "${j}"`}}))}return G}function _(X={}){let G=P(q)??$(),H=[];for(let B of G.all.keys())if(typeof B==="string"&&z.test(B))H.push(B);H.sort();let j=H.join("|"),{filter:W,describe:J,nameFor:L}=X;return I(()=>D(G,{filter:W,describe:J,nameFor:L}),[G,j,W,J,L])}export{_ as usePieMittAgentTools,D as getMittAgentTools};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ var M=Object.create;var{getPrototypeOf:w,defineProperty:Y,getOwnPropertyNames:V,getOwnPropertyDescriptor:E}=Object,S=Object.prototype.hasOwnProperty;var f=(j,B,G)=>{G=j!=null?M(w(j)):{};let H=B||!j||!j.__esModule?Y(G,"default",{value:j,enumerable:!0}):G;for(let J of V(j))if(!S.call(H,J))Y(H,J,{get:()=>j[J],enumerable:!0});return H},F=new WeakMap,x=(j)=>{var B=F.get(j),G;if(B)return B;if(B=Y({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function")V(j).map((H)=>!S.call(B,H)&&Y(B,H,{get:()=>j[H],enumerable:!(G=E(j,H))||G.enumerable}));return F.set(j,B),B};var T=(j,B)=>{for(var G in B)Y(j,G,{get:B[G],enumerable:!0,configurable:!0,set:(H)=>B[G]=()=>H})};var C={};T(C,{usePieMittAgentTools:()=>I,getMittAgentTools:()=>U});module.exports=x(C);var A=require("@openai/agents"),$=require("react");var O=f(require("mitt")),Z=require("react"),z=null;function D(){if(!z)z=O.default();return z}var b=Z.createContext(null);var R=b;var P=/^pie(.+?)_(.+)$/;function U(j=D(),B={}){let G=[],H=new Set;for(let J of j.all.keys()){if(typeof J!=="string")continue;let X=J.match(P);if(!X)continue;let[,Q,W]=X,L={methodName:Q,cardName:W,eventName:J};if(B.filter&&!B.filter(L))continue;let q=B.nameFor?.(L)??`${W}_${Q}`;if(H.has(q))continue;H.add(q);let _=B.describe?.(L)??`Invokes the "${Q}" method on the PieCard "${W}" by emitting the in-process mitt event "${J}". The optional "payload" argument is forwarded verbatim to the card's handler.`;G.push(A.tool({name:q,description:_,strict:!1,parameters:{type:"object",properties:{payload:{description:"Arbitrary JSON payload forwarded to the PieCard method handler. Omit for fire-and-forget calls."}},required:[],additionalProperties:!0},execute:async(K)=>{let k=K?.payload;return j.emit(J,k),`Emitted "${J}"`}}))}return G}function I(j={}){let G=$.useContext(R)??D(),H=[];for(let L of G.all.keys())if(typeof L==="string"&&P.test(L))H.push(L);H.sort();let J=H.join("|"),{filter:X,describe:Q,nameFor:W}=j;return $.useMemo(()=>U(G,{filter:X,describe:Q,nameFor:W}),[G,J,X,Q,W])}
package/dist/cli.js CHANGED
@@ -4,29 +4,15 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
7
  var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
8
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
9
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
10
  for (let key of __getOwnPropNames(mod))
23
11
  if (!__hasOwnProp.call(to, key))
24
12
  __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
13
+ get: () => mod[key],
26
14
  enumerable: true
27
15
  });
28
- if (canCache)
29
- cache.set(mod, to);
30
16
  return to;
31
17
  };
32
18
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
@@ -175430,6 +175416,7 @@ var require_acorn = __commonJS((exports2, module2) => {
175430
175416
  var defaultOptions = {
175431
175417
  ecmaVersion: null,
175432
175418
  sourceType: "script",
175419
+ strict: false,
175433
175420
  onInsertedSemicolon: null,
175434
175421
  onTrailingComma: null,
175435
175422
  allowReserved: null,
@@ -175543,7 +175530,7 @@ Defaulting to 2020, but this will stop working in the future.`);
175543
175530
  this.context = this.initialContext();
175544
175531
  this.exprAllowed = true;
175545
175532
  this.inModule = options.sourceType === "module";
175546
- this.strict = this.inModule || this.strictDirective(this.pos);
175533
+ this.strict = this.inModule || options.strict === true || this.strictDirective(this.pos);
175547
175534
  this.potentialArrowAt = -1;
175548
175535
  this.potentialArrowInForAwait = false;
175549
175536
  this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
@@ -175559,9 +175546,12 @@ Defaulting to 2020, but this will stop working in the future.`);
175559
175546
  };
175560
175547
  var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowReturn: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, allowUsing: { configurable: true }, inClassStaticBlock: { configurable: true } };
175561
175548
  Parser.prototype.parse = function parse2() {
175549
+ var this$1$1 = this;
175562
175550
  var node = this.options.program || this.startNode();
175563
175551
  this.nextToken();
175564
- return this.parseTopLevel(node);
175552
+ return this.catchStackOverflow(function() {
175553
+ return this$1$1.parseTopLevel(node);
175554
+ });
175565
175555
  };
175566
175556
  prototypeAccessors.inFunction.get = function() {
175567
175557
  return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
@@ -175696,6 +175686,17 @@ Defaulting to 2020, but this will stop working in the future.`);
175696
175686
  this.next();
175697
175687
  return true;
175698
175688
  };
175689
+ pp$9.catchStackOverflow = function(f) {
175690
+ try {
175691
+ return f();
175692
+ } catch (e) {
175693
+ if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) {
175694
+ this.raise(this.start, "Not enough stack space to parse input");
175695
+ } else {
175696
+ throw e;
175697
+ }
175698
+ }
175699
+ };
175699
175700
  pp$9.expectContextual = function(name) {
175700
175701
  if (!this.eatContextual(name)) {
175701
175702
  this.unexpected();
@@ -175781,12 +175782,12 @@ Defaulting to 2020, but this will stop working in the future.`);
175781
175782
  };
175782
175783
  var pp$8 = Parser.prototype;
175783
175784
  pp$8.parseTopLevel = function(node) {
175784
- var exports4 = Object.create(null);
175785
+ var exports$1 = Object.create(null);
175785
175786
  if (!node.body) {
175786
175787
  node.body = [];
175787
175788
  }
175788
175789
  while (this.type !== types$1.eof) {
175789
- var stmt = this.parseStatement(null, true, exports4);
175790
+ var stmt = this.parseStatement(null, true, exports$1);
175790
175791
  node.body.push(stmt);
175791
175792
  }
175792
175793
  if (this.inModule) {
@@ -175875,9 +175876,17 @@ Defaulting to 2020, but this will stop working in the future.`);
175875
175876
  return true;
175876
175877
  }
175877
175878
  var id = this.input.slice(idStart, next);
175878
- if (keywordRelationalOperator.test(id) || isFor && id === "of") {
175879
+ if (keywordRelationalOperator.test(id)) {
175879
175880
  return false;
175880
175881
  }
175882
+ if (isFor && !isAwaitUsing && id === "of") {
175883
+ skipWhiteSpace.lastIndex = next;
175884
+ var skipAfterOf = skipWhiteSpace.exec(this.input);
175885
+ next = next + skipAfterOf[0].length;
175886
+ if (this.input.charCodeAt(next) !== 61 || (ch = this.input.charCodeAt(next + 1)) === 61 || ch === 62) {
175887
+ return false;
175888
+ }
175889
+ }
175881
175890
  return true;
175882
175891
  };
175883
175892
  pp$8.isAwaitUsing = function(isFor) {
@@ -175886,7 +175895,7 @@ Defaulting to 2020, but this will stop working in the future.`);
175886
175895
  pp$8.isUsing = function(isFor) {
175887
175896
  return this.isUsingKeyword(false, isFor);
175888
175897
  };
175889
- pp$8.parseStatement = function(context, topLevel, exports4) {
175898
+ pp$8.parseStatement = function(context, topLevel, exports$1) {
175890
175899
  var starttype = this.type, node = this.startNode(), kind;
175891
175900
  if (this.isLet(context)) {
175892
175901
  starttype = types$1._var;
@@ -175955,7 +175964,7 @@ Defaulting to 2020, but this will stop working in the future.`);
175955
175964
  this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
175956
175965
  }
175957
175966
  }
175958
- return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports4);
175967
+ return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1);
175959
175968
  default:
175960
175969
  if (this.isAsyncFunction()) {
175961
175970
  if (context) {
@@ -175969,6 +175978,9 @@ Defaulting to 2020, but this will stop working in the future.`);
175969
175978
  if (!this.allowUsing) {
175970
175979
  this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
175971
175980
  }
175981
+ if (context) {
175982
+ this.raise(this.start, "Using declaration is not allowed in single-statement positions");
175983
+ }
175972
175984
  if (usingKind === "await using") {
175973
175985
  if (!this.canAwait) {
175974
175986
  this.raise(this.start, "Await using cannot appear outside of async function");
@@ -176103,14 +176115,15 @@ Defaulting to 2020, but this will stop working in the future.`);
176103
176115
  };
176104
176116
  pp$8.parseForAfterInit = function(node, init, awaitAt) {
176105
176117
  if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init.declarations.length === 1) {
176106
- if (this.options.ecmaVersion >= 9) {
176107
- if (this.type === types$1._in) {
176108
- if (awaitAt > -1) {
176109
- this.unexpected(awaitAt);
176110
- }
176111
- } else {
176112
- node.await = awaitAt > -1;
176118
+ if (this.type === types$1._in) {
176119
+ if ((init.kind === "using" || init.kind === "await using") && !init.declarations[0].init) {
176120
+ this.raise(this.start, "Using declaration is not allowed in for-in loops");
176113
176121
  }
176122
+ if (this.options.ecmaVersion >= 9 && awaitAt > -1) {
176123
+ this.unexpected(awaitAt);
176124
+ }
176125
+ } else if (this.options.ecmaVersion >= 9) {
176126
+ node.await = awaitAt > -1;
176114
176127
  }
176115
176128
  return this.parseForIn(node, init);
176116
176129
  }
@@ -176625,11 +176638,11 @@ Defaulting to 2020, but this will stop working in the future.`);
176625
176638
  var key = node.key;
176626
176639
  return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
176627
176640
  }
176628
- pp$8.parseExportAllDeclaration = function(node, exports4) {
176641
+ pp$8.parseExportAllDeclaration = function(node, exports$1) {
176629
176642
  if (this.options.ecmaVersion >= 11) {
176630
176643
  if (this.eatContextual("as")) {
176631
176644
  node.exported = this.parseModuleExportName();
176632
- this.checkExport(exports4, node.exported, this.lastTokStart);
176645
+ this.checkExport(exports$1, node.exported, this.lastTokStart);
176633
176646
  } else {
176634
176647
  node.exported = null;
176635
176648
  }
@@ -176645,22 +176658,22 @@ Defaulting to 2020, but this will stop working in the future.`);
176645
176658
  this.semicolon();
176646
176659
  return this.finishNode(node, "ExportAllDeclaration");
176647
176660
  };
176648
- pp$8.parseExport = function(node, exports4) {
176661
+ pp$8.parseExport = function(node, exports$1) {
176649
176662
  this.next();
176650
176663
  if (this.eat(types$1.star)) {
176651
- return this.parseExportAllDeclaration(node, exports4);
176664
+ return this.parseExportAllDeclaration(node, exports$1);
176652
176665
  }
176653
176666
  if (this.eat(types$1._default)) {
176654
- this.checkExport(exports4, "default", this.lastTokStart);
176667
+ this.checkExport(exports$1, "default", this.lastTokStart);
176655
176668
  node.declaration = this.parseExportDefaultDeclaration();
176656
176669
  return this.finishNode(node, "ExportDefaultDeclaration");
176657
176670
  }
176658
176671
  if (this.shouldParseExportStatement()) {
176659
176672
  node.declaration = this.parseExportDeclaration(node);
176660
176673
  if (node.declaration.type === "VariableDeclaration") {
176661
- this.checkVariableExport(exports4, node.declaration.declarations);
176674
+ this.checkVariableExport(exports$1, node.declaration.declarations);
176662
176675
  } else {
176663
- this.checkExport(exports4, node.declaration.id, node.declaration.id.start);
176676
+ this.checkExport(exports$1, node.declaration.id, node.declaration.id.start);
176664
176677
  }
176665
176678
  node.specifiers = [];
176666
176679
  node.source = null;
@@ -176669,7 +176682,7 @@ Defaulting to 2020, but this will stop working in the future.`);
176669
176682
  }
176670
176683
  } else {
176671
176684
  node.declaration = null;
176672
- node.specifiers = this.parseExportSpecifiers(exports4);
176685
+ node.specifiers = this.parseExportSpecifiers(exports$1);
176673
176686
  if (this.eatContextual("from")) {
176674
176687
  if (this.type !== types$1.string) {
176675
176688
  this.unexpected();
@@ -176717,62 +176730,62 @@ Defaulting to 2020, but this will stop working in the future.`);
176717
176730
  return declaration;
176718
176731
  }
176719
176732
  };
176720
- pp$8.checkExport = function(exports4, name, pos) {
176721
- if (!exports4) {
176733
+ pp$8.checkExport = function(exports$1, name, pos) {
176734
+ if (!exports$1) {
176722
176735
  return;
176723
176736
  }
176724
176737
  if (typeof name !== "string") {
176725
176738
  name = name.type === "Identifier" ? name.name : name.value;
176726
176739
  }
176727
- if (hasOwn(exports4, name)) {
176740
+ if (hasOwn(exports$1, name)) {
176728
176741
  this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
176729
176742
  }
176730
- exports4[name] = true;
176743
+ exports$1[name] = true;
176731
176744
  };
176732
- pp$8.checkPatternExport = function(exports4, pat) {
176745
+ pp$8.checkPatternExport = function(exports$1, pat) {
176733
176746
  var type = pat.type;
176734
176747
  if (type === "Identifier") {
176735
- this.checkExport(exports4, pat, pat.start);
176748
+ this.checkExport(exports$1, pat, pat.start);
176736
176749
  } else if (type === "ObjectPattern") {
176737
176750
  for (var i2 = 0, list2 = pat.properties;i2 < list2.length; i2 += 1) {
176738
176751
  var prop = list2[i2];
176739
- this.checkPatternExport(exports4, prop);
176752
+ this.checkPatternExport(exports$1, prop);
176740
176753
  }
176741
176754
  } else if (type === "ArrayPattern") {
176742
176755
  for (var i$1 = 0, list$1 = pat.elements;i$1 < list$1.length; i$1 += 1) {
176743
176756
  var elt = list$1[i$1];
176744
176757
  if (elt) {
176745
- this.checkPatternExport(exports4, elt);
176758
+ this.checkPatternExport(exports$1, elt);
176746
176759
  }
176747
176760
  }
176748
176761
  } else if (type === "Property") {
176749
- this.checkPatternExport(exports4, pat.value);
176762
+ this.checkPatternExport(exports$1, pat.value);
176750
176763
  } else if (type === "AssignmentPattern") {
176751
- this.checkPatternExport(exports4, pat.left);
176764
+ this.checkPatternExport(exports$1, pat.left);
176752
176765
  } else if (type === "RestElement") {
176753
- this.checkPatternExport(exports4, pat.argument);
176766
+ this.checkPatternExport(exports$1, pat.argument);
176754
176767
  }
176755
176768
  };
176756
- pp$8.checkVariableExport = function(exports4, decls) {
176757
- if (!exports4) {
176769
+ pp$8.checkVariableExport = function(exports$1, decls) {
176770
+ if (!exports$1) {
176758
176771
  return;
176759
176772
  }
176760
176773
  for (var i2 = 0, list2 = decls;i2 < list2.length; i2 += 1) {
176761
176774
  var decl = list2[i2];
176762
- this.checkPatternExport(exports4, decl.id);
176775
+ this.checkPatternExport(exports$1, decl.id);
176763
176776
  }
176764
176777
  };
176765
176778
  pp$8.shouldParseExportStatement = function() {
176766
176779
  return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
176767
176780
  };
176768
- pp$8.parseExportSpecifier = function(exports4) {
176781
+ pp$8.parseExportSpecifier = function(exports$1) {
176769
176782
  var node = this.startNode();
176770
176783
  node.local = this.parseModuleExportName();
176771
176784
  node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
176772
- this.checkExport(exports4, node.exported, node.exported.start);
176785
+ this.checkExport(exports$1, node.exported, node.exported.start);
176773
176786
  return this.finishNode(node, "ExportSpecifier");
176774
176787
  };
176775
- pp$8.parseExportSpecifiers = function(exports4) {
176788
+ pp$8.parseExportSpecifiers = function(exports$1) {
176776
176789
  var nodes = [], first = true;
176777
176790
  this.expect(types$1.braceL);
176778
176791
  while (!this.eat(types$1.braceR)) {
@@ -176784,7 +176797,7 @@ Defaulting to 2020, but this will stop working in the future.`);
176784
176797
  } else {
176785
176798
  first = false;
176786
176799
  }
176787
- nodes.push(this.parseExportSpecifier(exports4));
176800
+ nodes.push(this.parseExportSpecifier(exports$1));
176788
176801
  }
176789
176802
  return nodes;
176790
176803
  };
@@ -177353,17 +177366,20 @@ Defaulting to 2020, but this will stop working in the future.`);
177353
177366
  other[kind] = true;
177354
177367
  };
177355
177368
  pp$5.parseExpression = function(forInit, refDestructuringErrors) {
177356
- var startPos = this.start, startLoc = this.startLoc;
177357
- var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
177358
- if (this.type === types$1.comma) {
177359
- var node = this.startNodeAt(startPos, startLoc);
177360
- node.expressions = [expr];
177361
- while (this.eat(types$1.comma)) {
177362
- node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));
177369
+ var this$1$1 = this;
177370
+ return this.catchStackOverflow(function() {
177371
+ var { start: startPos, startLoc } = this$1$1;
177372
+ var expr = this$1$1.parseMaybeAssign(forInit, refDestructuringErrors);
177373
+ if (this$1$1.type === types$1.comma) {
177374
+ var node = this$1$1.startNodeAt(startPos, startLoc);
177375
+ node.expressions = [expr];
177376
+ while (this$1$1.eat(types$1.comma)) {
177377
+ node.expressions.push(this$1$1.parseMaybeAssign(forInit, refDestructuringErrors));
177378
+ }
177379
+ return this$1$1.finishNode(node, "SequenceExpression");
177363
177380
  }
177364
- return this.finishNode(node, "SequenceExpression");
177365
- }
177366
- return expr;
177381
+ return expr;
177382
+ });
177367
177383
  };
177368
177384
  pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
177369
177385
  if (this.isContextual("yield")) {
@@ -177435,7 +177451,7 @@ Defaulting to 2020, but this will stop working in the future.`);
177435
177451
  if (this.checkExpressionErrors(refDestructuringErrors)) {
177436
177452
  return expr;
177437
177453
  }
177438
- if (this.eat(types$1.question)) {
177454
+ if (!(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.question)) {
177439
177455
  var node = this.startNodeAt(startPos, startLoc);
177440
177456
  node.test = expr;
177441
177457
  node.consequent = this.parseMaybeAssign();
@@ -177931,6 +177947,9 @@ Defaulting to 2020, but this will stop working in the future.`);
177931
177947
  }
177932
177948
  var startPos = this.start, startLoc = this.startLoc;
177933
177949
  node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
177950
+ if (node.callee.type === "Super") {
177951
+ this.raiseRecoverable(startPos, "Invalid use of 'super'");
177952
+ }
177934
177953
  if (this.eat(types$1.parenL)) {
177935
177954
  node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
177936
177955
  } else {
@@ -180446,7 +180465,7 @@ Defaulting to 2020, but this will stop working in the future.`);
180446
180465
  }
180447
180466
  return this.finishToken(type, word);
180448
180467
  };
180449
- var version = "8.16.0";
180468
+ var version = "8.17.0";
180450
180469
  Parser.acorn = {
180451
180470
  Parser,
180452
180471
  version,
@@ -188749,6 +188768,7 @@ export default function LoadingScreen() {
188749
188768
  );
188750
188769
  }
188751
188770
  `;
188771
+
188752
188772
  // src/code/templates/rootLayout.ts
188753
188773
  var rootLayoutTemplate = `import type { Metadata } from "next";
188754
188774
  import "./globals.css";
@@ -194605,77 +194625,7 @@ ${detail}` : `${opts.method} ${opts.url} failed: ${response.status}`;
194605
194625
  // src/code/commands/cardDumpMetadata.ts
194606
194626
  var import_node_fs6 = __toESM(require("node:fs"));
194607
194627
  var import_node_path8 = __toESM(require("node:path"));
194608
- // src/code/introspection/schemaContext.ts
194609
- var import_node_path5 = __toESM(require("node:path"));
194610
- var __dirname = "/home/runner/work/pieui/pieui/src/code/introspection";
194611
- var DEFAULT_COMPILER_OPTIONS = () => ({
194612
- allowJs: true,
194613
- jsx: ts2.JsxEmit.ReactJSX,
194614
- target: ts2.ScriptTarget.ES2020,
194615
- module: ts2.ModuleKind.NodeNext,
194616
- moduleResolution: ts2.ModuleResolutionKind.NodeNext,
194617
- esModuleInterop: true,
194618
- allowSyntheticDefaultImports: true,
194619
- skipLibCheck: true
194620
- });
194621
- var createSchemaContext = (files) => {
194622
- const cliSchemaPath = import_node_path5.default.join(__dirname, "..", "commands", "cli-schema.d.ts");
194623
- const uniqueFiles = Array.from(new Set([cliSchemaPath, ...files]));
194624
- const program = TJS.getProgramFromFiles(uniqueFiles, DEFAULT_COMPILER_OPTIONS());
194625
- const checker = program.getTypeChecker();
194626
- const generator = TJS.buildGenerator(program, {
194627
- required: true,
194628
- strictNullChecks: true,
194629
- excludePrivate: true,
194630
- ref: false,
194631
- aliasRef: false,
194632
- topRef: false,
194633
- noExtraProps: true,
194634
- ignoreErrors: true
194635
- });
194636
- if (!generator) {
194637
- throw new Error("Failed to create JSON Schema generator");
194638
- }
194639
- return { program, checker, generator };
194640
- };
194641
- var findTypeDeclaration = (program, checker, typeName) => {
194642
- for (const sourceFile of program.getSourceFiles()) {
194643
- if (sourceFile.isDeclarationFile)
194644
- continue;
194645
- let found = null;
194646
- const visit = (node) => {
194647
- if (found)
194648
- return;
194649
- if ((ts2.isInterfaceDeclaration(node) || ts2.isTypeAliasDeclaration(node)) && node.name.text === typeName) {
194650
- const symbol = checker.getSymbolAtLocation(node.name);
194651
- if (symbol) {
194652
- found = { symbol, declaration: node };
194653
- }
194654
- return;
194655
- }
194656
- ts2.forEachChild(node, visit);
194657
- };
194658
- visit(sourceFile);
194659
- if (found)
194660
- return found;
194661
- }
194662
- return null;
194663
- };
194664
- var buildSchemaForType = (ctx, typeName) => {
194665
- try {
194666
- const schema = ctx.generator.getSchemaForSymbol(typeName);
194667
- if (!schema)
194668
- return null;
194669
- const decl = findTypeDeclaration(ctx.program, ctx.checker, typeName);
194670
- if (decl) {
194671
- const declaredType = ctx.checker.getDeclaredTypeOfSymbol(decl.symbol);
194672
- patchSchemaForType(declaredType, schema, ctx.checker);
194673
- }
194674
- return schema;
194675
- } catch {
194676
- return null;
194677
- }
194678
- };
194628
+
194679
194629
  // src/code/introspection/errors.ts
194680
194630
  class IntrospectionError extends Error {
194681
194631
  sourceFile;
@@ -194750,6 +194700,77 @@ var errorOptsFromNode = (sourceFile, node) => ({
194750
194700
  ...lineCol(sourceFile, node)
194751
194701
  });
194752
194702
 
194703
+ // src/code/introspection/schemaContext.ts
194704
+ var import_node_path5 = __toESM(require("node:path"));
194705
+ var __dirname = "/home/runner/work/pieui/pieui/src/code/introspection";
194706
+ var DEFAULT_COMPILER_OPTIONS = () => ({
194707
+ allowJs: true,
194708
+ jsx: ts2.JsxEmit.ReactJSX,
194709
+ target: ts2.ScriptTarget.ES2020,
194710
+ module: ts2.ModuleKind.NodeNext,
194711
+ moduleResolution: ts2.ModuleResolutionKind.NodeNext,
194712
+ esModuleInterop: true,
194713
+ allowSyntheticDefaultImports: true,
194714
+ skipLibCheck: true
194715
+ });
194716
+ var createSchemaContext = (files) => {
194717
+ const cliSchemaPath = import_node_path5.default.join(__dirname, "..", "commands", "cli-schema.d.ts");
194718
+ const uniqueFiles = Array.from(new Set([cliSchemaPath, ...files]));
194719
+ const program = TJS.getProgramFromFiles(uniqueFiles, DEFAULT_COMPILER_OPTIONS());
194720
+ const checker = program.getTypeChecker();
194721
+ const generator = TJS.buildGenerator(program, {
194722
+ required: true,
194723
+ strictNullChecks: true,
194724
+ excludePrivate: true,
194725
+ ref: false,
194726
+ aliasRef: false,
194727
+ topRef: false,
194728
+ noExtraProps: true,
194729
+ ignoreErrors: true
194730
+ });
194731
+ if (!generator) {
194732
+ throw new Error("Failed to create JSON Schema generator");
194733
+ }
194734
+ return { program, checker, generator };
194735
+ };
194736
+ var findTypeDeclaration = (program, checker, typeName) => {
194737
+ for (const sourceFile of program.getSourceFiles()) {
194738
+ if (sourceFile.isDeclarationFile)
194739
+ continue;
194740
+ let found = null;
194741
+ const visit = (node) => {
194742
+ if (found)
194743
+ return;
194744
+ if ((ts2.isInterfaceDeclaration(node) || ts2.isTypeAliasDeclaration(node)) && node.name.text === typeName) {
194745
+ const symbol = checker.getSymbolAtLocation(node.name);
194746
+ if (symbol) {
194747
+ found = { symbol, declaration: node };
194748
+ }
194749
+ return;
194750
+ }
194751
+ ts2.forEachChild(node, visit);
194752
+ };
194753
+ visit(sourceFile);
194754
+ if (found)
194755
+ return found;
194756
+ }
194757
+ return null;
194758
+ };
194759
+ var buildSchemaForType = (ctx, typeName) => {
194760
+ try {
194761
+ const schema = ctx.generator.getSchemaForSymbol(typeName);
194762
+ if (!schema)
194763
+ return null;
194764
+ const decl = findTypeDeclaration(ctx.program, ctx.checker, typeName);
194765
+ if (decl) {
194766
+ const declaredType = ctx.checker.getDeclaredTypeOfSymbol(decl.symbol);
194767
+ patchSchemaForType(declaredType, schema, ctx.checker);
194768
+ }
194769
+ return schema;
194770
+ } catch {
194771
+ return null;
194772
+ }
194773
+ };
194753
194774
  // src/code/introspection/typeToSchema.ts
194754
194775
  var MAX_DEPTH = 12;
194755
194776
  var isOptionalProperty = (sym) => {
@@ -1,4 +1,4 @@
1
1
  import { AutoRedirectCardProps } from '../types';
2
- declare const AutoRedirectCard: ({ data }: AutoRedirectCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const AutoRedirectCard: ({ data }: AutoRedirectCardProps) => import("react").JSX.Element;
3
3
  export default AutoRedirectCard;
4
4
  //# sourceMappingURL=AutoRedirectCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AutoRedirectCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/AutoRedirectCard/ui/AutoRedirectCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAKhD,QAAA,MAAM,gBAAgB,GAAI,UAAU,qBAAqB,4CAexD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"AutoRedirectCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/AutoRedirectCard/ui/AutoRedirectCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAKhD,QAAA,MAAM,gBAAgB,GAAI,UAAU,qBAAqB,gCAexD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { CloudStorageCardProps } from '../types';
2
- declare const CloudStorageCard: ({ data }: CloudStorageCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const CloudStorageCard: ({ data }: CloudStorageCardProps) => import("react").JSX.Element;
3
3
  export default CloudStorageCard;
4
4
  //# sourceMappingURL=CloudStorageCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CloudStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/CloudStorageCard/ui/CloudStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGhD,QAAA,MAAM,gBAAgB,GAAI,UAAU,qBAAqB,4CA6CxD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"CloudStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/CloudStorageCard/ui/CloudStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGhD,QAAA,MAAM,gBAAgB,GAAI,UAAU,qBAAqB,gCA6CxD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { DeviceStorageCardProps } from '../types';
2
- declare const DeviceStorageCard: ({ data }: DeviceStorageCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const DeviceStorageCard: ({ data }: DeviceStorageCardProps) => import("react").JSX.Element;
3
3
  export default DeviceStorageCard;
4
4
  //# sourceMappingURL=DeviceStorageCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/DeviceStorageCard/ui/DeviceStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAGjD,QAAA,MAAM,iBAAiB,GAAI,UAAU,sBAAsB,4CA0C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
1
+ {"version":3,"file":"DeviceStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/DeviceStorageCard/ui/DeviceStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAGjD,QAAA,MAAM,iBAAiB,GAAI,UAAU,sBAAsB,gCA0C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { HTMLEmbedCardProps } from '../types';
2
- declare const HTMLEmbedCard: ({ data }: HTMLEmbedCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const HTMLEmbedCard: ({ data }: HTMLEmbedCardProps) => import("react").JSX.Element;
3
3
  export default HTMLEmbedCard;
4
4
  //# sourceMappingURL=HTMLEmbedCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HTMLEmbedCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG7C,QAAA,MAAM,aAAa,GAAI,UAAU,kBAAkB,4CAoElD,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"HTMLEmbedCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG7C,QAAA,MAAM,aAAa,GAAI,UAAU,kBAAkB,gCAoElD,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { HiddenCardProps } from '../types';
2
- declare const HiddenCard: ({ data }: HiddenCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const HiddenCard: ({ data }: HiddenCardProps) => import("react").JSX.Element;
3
3
  export default HiddenCard;
4
4
  //# sourceMappingURL=HiddenCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HiddenCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/HiddenCard/ui/HiddenCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,QAAA,MAAM,UAAU,GAAI,UAAU,eAAe,4CAgC5C,CAAA;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"HiddenCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/HiddenCard/ui/HiddenCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,QAAA,MAAM,UAAU,GAAI,UAAU,eAAe,gCAgC5C,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { IOEventsCardProps } from '../types';
2
- declare const IOEventsCard: ({ data }: IOEventsCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const IOEventsCard: ({ data }: IOEventsCardProps) => import("react").JSX.Element;
3
3
  export default IOEventsCard;
4
4
  //# sourceMappingURL=IOEventsCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IOEventsCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/IOEventsCard/ui/IOEventsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,iBAAiB,EAAE,MAAM,UAAU,CAAA;AA8EzD,QAAA,MAAM,YAAY,GAAI,UAAU,iBAAiB,4CA6DhD,CAAA;AAED,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"IOEventsCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/IOEventsCard/ui/IOEventsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,iBAAiB,EAAE,MAAM,UAAU,CAAA;AA8EzD,QAAA,MAAM,YAAY,GAAI,UAAU,iBAAiB,gCA6DhD,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { SecureStorageCardProps } from '../types';
2
- declare const SecureStorageCard: ({ data }: SecureStorageCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const SecureStorageCard: ({ data }: SecureStorageCardProps) => import("react").JSX.Element;
3
3
  export default SecureStorageCard;
4
4
  //# sourceMappingURL=SecureStorageCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SecureStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/SecureStorageCard/ui/SecureStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAGjD,QAAA,MAAM,iBAAiB,GAAI,UAAU,sBAAsB,4CA6C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
1
+ {"version":3,"file":"SecureStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/SecureStorageCard/ui/SecureStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAGjD,QAAA,MAAM,iBAAiB,GAAI,UAAU,sBAAsB,gCA6C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { SessionStorageCardProps } from '../types';
2
- declare const SessionStorageCard: ({ data }: SessionStorageCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const SessionStorageCard: ({ data }: SessionStorageCardProps) => import("react").JSX.Element;
3
3
  export default SessionStorageCard;
4
4
  //# sourceMappingURL=SessionStorageCard.d.ts.map