@glasser-ai/cli 0.1.135 → 0.1.142

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 (2) hide show
  1. package/dist/glasser.js +1416 -225
  2. package/package.json +1 -1
package/dist/glasser.js CHANGED
@@ -4320,8 +4320,8 @@ var require_webidl = __commonJS({
4320
4320
  message: `"${context3.value}" is an invalid ${context3.type}.`
4321
4321
  });
4322
4322
  };
4323
- webidl.brandCheck = function(V, I2) {
4324
- if (!FunctionPrototypeSymbolHasInstance(I2, V)) {
4323
+ webidl.brandCheck = function(V, I4) {
4324
+ if (!FunctionPrototypeSymbolHasInstance(I4, V)) {
4325
4325
  const err = new TypeError("Illegal invocation");
4326
4326
  err.code = "ERR_INVALID_THIS";
4327
4327
  throw err;
@@ -4351,8 +4351,8 @@ var require_webidl = __commonJS({
4351
4351
  message: "Illegal constructor"
4352
4352
  });
4353
4353
  };
4354
- webidl.util.MakeTypeAssertion = function(I2) {
4355
- return (O) => FunctionPrototypeSymbolHasInstance(I2, O);
4354
+ webidl.util.MakeTypeAssertion = function(I4) {
4355
+ return (O) => FunctionPrototypeSymbolHasInstance(I4, O);
4356
4356
  };
4357
4357
  webidl.util.Type = function(V) {
4358
4358
  switch (typeof V) {
@@ -5198,11 +5198,11 @@ var require_util2 = __commonJS({
5198
5198
  }
5199
5199
  function tryUpgradeRequestToAPotentiallyTrustworthyURL(request5) {
5200
5200
  }
5201
- function sameOrigin(A, B2) {
5202
- if (A.origin === B2.origin && A.origin === "null") {
5201
+ function sameOrigin(A, B5) {
5202
+ if (A.origin === B5.origin && A.origin === "null") {
5203
5203
  return true;
5204
5204
  }
5205
- if (A.protocol === B2.protocol && A.hostname === B2.hostname && A.port === B2.port) {
5205
+ if (A.protocol === B5.protocol && A.hostname === B5.hostname && A.port === B5.port) {
5206
5206
  return true;
5207
5207
  }
5208
5208
  return false;
@@ -17004,14 +17004,14 @@ var require_cache = __commonJS({
17004
17004
  var require_date = __commonJS({
17005
17005
  "../../node_modules/@effect/platform-node/node_modules/undici/lib/util/date.js"(exports, module) {
17006
17006
  "use strict";
17007
- function parseHttpDate(date7) {
17008
- switch (date7[3]) {
17007
+ function parseHttpDate(date8) {
17008
+ switch (date8[3]) {
17009
17009
  case ",":
17010
- return parseImfDate(date7);
17010
+ return parseImfDate(date8);
17011
17011
  case " ":
17012
- return parseAscTimeDate(date7);
17012
+ return parseAscTimeDate(date8);
17013
17013
  default:
17014
- return parseRfc850Date(date7);
17014
+ return parseRfc850Date(date8);
17015
17015
  }
17016
17016
  }
17017
17017
  function makeDate(year, monthIdx, day, hour, minute, second, weekday) {
@@ -17021,66 +17021,66 @@ var require_date = __commonJS({
17021
17021
  }
17022
17022
  return result3.getUTCFullYear() === year && result3.getUTCMonth() === monthIdx && result3.getUTCDate() === day && result3.getUTCHours() === hour && result3.getUTCMinutes() === minute && result3.getUTCSeconds() === second && result3.getUTCDay() === weekday ? result3 : void 0;
17023
17023
  }
17024
- function parseImfDate(date7) {
17025
- if (date7.length !== 29 || date7[4] !== " " || date7[7] !== " " || date7[11] !== " " || date7[16] !== " " || date7[19] !== ":" || date7[22] !== ":" || date7[25] !== " " || date7[26] !== "G" || date7[27] !== "M" || date7[28] !== "T") {
17024
+ function parseImfDate(date8) {
17025
+ if (date8.length !== 29 || date8[4] !== " " || date8[7] !== " " || date8[11] !== " " || date8[16] !== " " || date8[19] !== ":" || date8[22] !== ":" || date8[25] !== " " || date8[26] !== "G" || date8[27] !== "M" || date8[28] !== "T") {
17026
17026
  return void 0;
17027
17027
  }
17028
17028
  let weekday = -1;
17029
- if (date7[0] === "S" && date7[1] === "u" && date7[2] === "n") {
17029
+ if (date8[0] === "S" && date8[1] === "u" && date8[2] === "n") {
17030
17030
  weekday = 0;
17031
- } else if (date7[0] === "M" && date7[1] === "o" && date7[2] === "n") {
17031
+ } else if (date8[0] === "M" && date8[1] === "o" && date8[2] === "n") {
17032
17032
  weekday = 1;
17033
- } else if (date7[0] === "T" && date7[1] === "u" && date7[2] === "e") {
17033
+ } else if (date8[0] === "T" && date8[1] === "u" && date8[2] === "e") {
17034
17034
  weekday = 2;
17035
- } else if (date7[0] === "W" && date7[1] === "e" && date7[2] === "d") {
17035
+ } else if (date8[0] === "W" && date8[1] === "e" && date8[2] === "d") {
17036
17036
  weekday = 3;
17037
- } else if (date7[0] === "T" && date7[1] === "h" && date7[2] === "u") {
17037
+ } else if (date8[0] === "T" && date8[1] === "h" && date8[2] === "u") {
17038
17038
  weekday = 4;
17039
- } else if (date7[0] === "F" && date7[1] === "r" && date7[2] === "i") {
17039
+ } else if (date8[0] === "F" && date8[1] === "r" && date8[2] === "i") {
17040
17040
  weekday = 5;
17041
- } else if (date7[0] === "S" && date7[1] === "a" && date7[2] === "t") {
17041
+ } else if (date8[0] === "S" && date8[1] === "a" && date8[2] === "t") {
17042
17042
  weekday = 6;
17043
17043
  } else {
17044
17044
  return void 0;
17045
17045
  }
17046
17046
  let day = 0;
17047
- if (date7[5] === "0") {
17048
- const code = date7.charCodeAt(6);
17047
+ if (date8[5] === "0") {
17048
+ const code = date8.charCodeAt(6);
17049
17049
  if (code < 49 || code > 57) {
17050
17050
  return void 0;
17051
17051
  }
17052
17052
  day = code - 48;
17053
17053
  } else {
17054
- const code1 = date7.charCodeAt(5);
17054
+ const code1 = date8.charCodeAt(5);
17055
17055
  if (code1 < 49 || code1 > 51) {
17056
17056
  return void 0;
17057
17057
  }
17058
- const code2 = date7.charCodeAt(6);
17058
+ const code2 = date8.charCodeAt(6);
17059
17059
  if (code2 < 48 || code2 > 57) {
17060
17060
  return void 0;
17061
17061
  }
17062
17062
  day = (code1 - 48) * 10 + (code2 - 48);
17063
17063
  }
17064
17064
  let monthIdx = -1;
17065
- if (date7[8] === "J" && date7[9] === "a" && date7[10] === "n") {
17065
+ if (date8[8] === "J" && date8[9] === "a" && date8[10] === "n") {
17066
17066
  monthIdx = 0;
17067
- } else if (date7[8] === "F" && date7[9] === "e" && date7[10] === "b") {
17067
+ } else if (date8[8] === "F" && date8[9] === "e" && date8[10] === "b") {
17068
17068
  monthIdx = 1;
17069
- } else if (date7[8] === "M" && date7[9] === "a") {
17070
- if (date7[10] === "r") {
17069
+ } else if (date8[8] === "M" && date8[9] === "a") {
17070
+ if (date8[10] === "r") {
17071
17071
  monthIdx = 2;
17072
- } else if (date7[10] === "y") {
17072
+ } else if (date8[10] === "y") {
17073
17073
  monthIdx = 4;
17074
17074
  } else {
17075
17075
  return void 0;
17076
17076
  }
17077
- } else if (date7[8] === "J") {
17078
- if (date7[9] === "a" && date7[10] === "n") {
17077
+ } else if (date8[8] === "J") {
17078
+ if (date8[9] === "a" && date8[10] === "n") {
17079
17079
  monthIdx = 0;
17080
- } else if (date7[9] === "u") {
17081
- if (date7[10] === "n") {
17080
+ } else if (date8[9] === "u") {
17081
+ if (date8[10] === "n") {
17082
17082
  monthIdx = 5;
17083
- } else if (date7[10] === "l") {
17083
+ } else if (date8[10] === "l") {
17084
17084
  monthIdx = 6;
17085
17085
  } else {
17086
17086
  return void 0;
@@ -17088,55 +17088,55 @@ var require_date = __commonJS({
17088
17088
  } else {
17089
17089
  return void 0;
17090
17090
  }
17091
- } else if (date7[8] === "A") {
17092
- if (date7[9] === "p" && date7[10] === "r") {
17091
+ } else if (date8[8] === "A") {
17092
+ if (date8[9] === "p" && date8[10] === "r") {
17093
17093
  monthIdx = 3;
17094
- } else if (date7[9] === "u" && date7[10] === "g") {
17094
+ } else if (date8[9] === "u" && date8[10] === "g") {
17095
17095
  monthIdx = 7;
17096
17096
  } else {
17097
17097
  return void 0;
17098
17098
  }
17099
- } else if (date7[8] === "S" && date7[9] === "e" && date7[10] === "p") {
17099
+ } else if (date8[8] === "S" && date8[9] === "e" && date8[10] === "p") {
17100
17100
  monthIdx = 8;
17101
- } else if (date7[8] === "O" && date7[9] === "c" && date7[10] === "t") {
17101
+ } else if (date8[8] === "O" && date8[9] === "c" && date8[10] === "t") {
17102
17102
  monthIdx = 9;
17103
- } else if (date7[8] === "N" && date7[9] === "o" && date7[10] === "v") {
17103
+ } else if (date8[8] === "N" && date8[9] === "o" && date8[10] === "v") {
17104
17104
  monthIdx = 10;
17105
- } else if (date7[8] === "D" && date7[9] === "e" && date7[10] === "c") {
17105
+ } else if (date8[8] === "D" && date8[9] === "e" && date8[10] === "c") {
17106
17106
  monthIdx = 11;
17107
17107
  } else {
17108
17108
  return void 0;
17109
17109
  }
17110
- const yearDigit1 = date7.charCodeAt(12);
17110
+ const yearDigit1 = date8.charCodeAt(12);
17111
17111
  if (yearDigit1 < 48 || yearDigit1 > 57) {
17112
17112
  return void 0;
17113
17113
  }
17114
- const yearDigit2 = date7.charCodeAt(13);
17114
+ const yearDigit2 = date8.charCodeAt(13);
17115
17115
  if (yearDigit2 < 48 || yearDigit2 > 57) {
17116
17116
  return void 0;
17117
17117
  }
17118
- const yearDigit3 = date7.charCodeAt(14);
17118
+ const yearDigit3 = date8.charCodeAt(14);
17119
17119
  if (yearDigit3 < 48 || yearDigit3 > 57) {
17120
17120
  return void 0;
17121
17121
  }
17122
- const yearDigit4 = date7.charCodeAt(15);
17122
+ const yearDigit4 = date8.charCodeAt(15);
17123
17123
  if (yearDigit4 < 48 || yearDigit4 > 57) {
17124
17124
  return void 0;
17125
17125
  }
17126
17126
  const year = (yearDigit1 - 48) * 1e3 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48);
17127
17127
  let hour = 0;
17128
- if (date7[17] === "0") {
17129
- const code = date7.charCodeAt(18);
17128
+ if (date8[17] === "0") {
17129
+ const code = date8.charCodeAt(18);
17130
17130
  if (code < 48 || code > 57) {
17131
17131
  return void 0;
17132
17132
  }
17133
17133
  hour = code - 48;
17134
17134
  } else {
17135
- const code1 = date7.charCodeAt(17);
17135
+ const code1 = date8.charCodeAt(17);
17136
17136
  if (code1 < 48 || code1 > 50) {
17137
17137
  return void 0;
17138
17138
  }
17139
- const code2 = date7.charCodeAt(18);
17139
+ const code2 = date8.charCodeAt(18);
17140
17140
  if (code2 < 48 || code2 > 57) {
17141
17141
  return void 0;
17142
17142
  }
@@ -17146,36 +17146,36 @@ var require_date = __commonJS({
17146
17146
  hour = (code1 - 48) * 10 + (code2 - 48);
17147
17147
  }
17148
17148
  let minute = 0;
17149
- if (date7[20] === "0") {
17150
- const code = date7.charCodeAt(21);
17149
+ if (date8[20] === "0") {
17150
+ const code = date8.charCodeAt(21);
17151
17151
  if (code < 48 || code > 57) {
17152
17152
  return void 0;
17153
17153
  }
17154
17154
  minute = code - 48;
17155
17155
  } else {
17156
- const code1 = date7.charCodeAt(20);
17156
+ const code1 = date8.charCodeAt(20);
17157
17157
  if (code1 < 48 || code1 > 53) {
17158
17158
  return void 0;
17159
17159
  }
17160
- const code2 = date7.charCodeAt(21);
17160
+ const code2 = date8.charCodeAt(21);
17161
17161
  if (code2 < 48 || code2 > 57) {
17162
17162
  return void 0;
17163
17163
  }
17164
17164
  minute = (code1 - 48) * 10 + (code2 - 48);
17165
17165
  }
17166
17166
  let second = 0;
17167
- if (date7[23] === "0") {
17168
- const code = date7.charCodeAt(24);
17167
+ if (date8[23] === "0") {
17168
+ const code = date8.charCodeAt(24);
17169
17169
  if (code < 48 || code > 57) {
17170
17170
  return void 0;
17171
17171
  }
17172
17172
  second = code - 48;
17173
17173
  } else {
17174
- const code1 = date7.charCodeAt(23);
17174
+ const code1 = date8.charCodeAt(23);
17175
17175
  if (code1 < 48 || code1 > 53) {
17176
17176
  return void 0;
17177
17177
  }
17178
- const code2 = date7.charCodeAt(24);
17178
+ const code2 = date8.charCodeAt(24);
17179
17179
  if (code2 < 48 || code2 > 57) {
17180
17180
  return void 0;
17181
17181
  }
@@ -17183,48 +17183,48 @@ var require_date = __commonJS({
17183
17183
  }
17184
17184
  return makeDate(year, monthIdx, day, hour, minute, second, weekday);
17185
17185
  }
17186
- function parseAscTimeDate(date7) {
17187
- if (date7.length !== 24 || date7[7] !== " " || date7[10] !== " " || date7[19] !== " ") {
17186
+ function parseAscTimeDate(date8) {
17187
+ if (date8.length !== 24 || date8[7] !== " " || date8[10] !== " " || date8[19] !== " ") {
17188
17188
  return void 0;
17189
17189
  }
17190
17190
  let weekday = -1;
17191
- if (date7[0] === "S" && date7[1] === "u" && date7[2] === "n") {
17191
+ if (date8[0] === "S" && date8[1] === "u" && date8[2] === "n") {
17192
17192
  weekday = 0;
17193
- } else if (date7[0] === "M" && date7[1] === "o" && date7[2] === "n") {
17193
+ } else if (date8[0] === "M" && date8[1] === "o" && date8[2] === "n") {
17194
17194
  weekday = 1;
17195
- } else if (date7[0] === "T" && date7[1] === "u" && date7[2] === "e") {
17195
+ } else if (date8[0] === "T" && date8[1] === "u" && date8[2] === "e") {
17196
17196
  weekday = 2;
17197
- } else if (date7[0] === "W" && date7[1] === "e" && date7[2] === "d") {
17197
+ } else if (date8[0] === "W" && date8[1] === "e" && date8[2] === "d") {
17198
17198
  weekday = 3;
17199
- } else if (date7[0] === "T" && date7[1] === "h" && date7[2] === "u") {
17199
+ } else if (date8[0] === "T" && date8[1] === "h" && date8[2] === "u") {
17200
17200
  weekday = 4;
17201
- } else if (date7[0] === "F" && date7[1] === "r" && date7[2] === "i") {
17201
+ } else if (date8[0] === "F" && date8[1] === "r" && date8[2] === "i") {
17202
17202
  weekday = 5;
17203
- } else if (date7[0] === "S" && date7[1] === "a" && date7[2] === "t") {
17203
+ } else if (date8[0] === "S" && date8[1] === "a" && date8[2] === "t") {
17204
17204
  weekday = 6;
17205
17205
  } else {
17206
17206
  return void 0;
17207
17207
  }
17208
17208
  let monthIdx = -1;
17209
- if (date7[4] === "J" && date7[5] === "a" && date7[6] === "n") {
17209
+ if (date8[4] === "J" && date8[5] === "a" && date8[6] === "n") {
17210
17210
  monthIdx = 0;
17211
- } else if (date7[4] === "F" && date7[5] === "e" && date7[6] === "b") {
17211
+ } else if (date8[4] === "F" && date8[5] === "e" && date8[6] === "b") {
17212
17212
  monthIdx = 1;
17213
- } else if (date7[4] === "M" && date7[5] === "a") {
17214
- if (date7[6] === "r") {
17213
+ } else if (date8[4] === "M" && date8[5] === "a") {
17214
+ if (date8[6] === "r") {
17215
17215
  monthIdx = 2;
17216
- } else if (date7[6] === "y") {
17216
+ } else if (date8[6] === "y") {
17217
17217
  monthIdx = 4;
17218
17218
  } else {
17219
17219
  return void 0;
17220
17220
  }
17221
- } else if (date7[4] === "J") {
17222
- if (date7[5] === "a" && date7[6] === "n") {
17221
+ } else if (date8[4] === "J") {
17222
+ if (date8[5] === "a" && date8[6] === "n") {
17223
17223
  monthIdx = 0;
17224
- } else if (date7[5] === "u") {
17225
- if (date7[6] === "n") {
17224
+ } else if (date8[5] === "u") {
17225
+ if (date8[6] === "n") {
17226
17226
  monthIdx = 5;
17227
- } else if (date7[6] === "l") {
17227
+ } else if (date8[6] === "l") {
17228
17228
  monthIdx = 6;
17229
17229
  } else {
17230
17230
  return void 0;
@@ -17232,56 +17232,56 @@ var require_date = __commonJS({
17232
17232
  } else {
17233
17233
  return void 0;
17234
17234
  }
17235
- } else if (date7[4] === "A") {
17236
- if (date7[5] === "p" && date7[6] === "r") {
17235
+ } else if (date8[4] === "A") {
17236
+ if (date8[5] === "p" && date8[6] === "r") {
17237
17237
  monthIdx = 3;
17238
- } else if (date7[5] === "u" && date7[6] === "g") {
17238
+ } else if (date8[5] === "u" && date8[6] === "g") {
17239
17239
  monthIdx = 7;
17240
17240
  } else {
17241
17241
  return void 0;
17242
17242
  }
17243
- } else if (date7[4] === "S" && date7[5] === "e" && date7[6] === "p") {
17243
+ } else if (date8[4] === "S" && date8[5] === "e" && date8[6] === "p") {
17244
17244
  monthIdx = 8;
17245
- } else if (date7[4] === "O" && date7[5] === "c" && date7[6] === "t") {
17245
+ } else if (date8[4] === "O" && date8[5] === "c" && date8[6] === "t") {
17246
17246
  monthIdx = 9;
17247
- } else if (date7[4] === "N" && date7[5] === "o" && date7[6] === "v") {
17247
+ } else if (date8[4] === "N" && date8[5] === "o" && date8[6] === "v") {
17248
17248
  monthIdx = 10;
17249
- } else if (date7[4] === "D" && date7[5] === "e" && date7[6] === "c") {
17249
+ } else if (date8[4] === "D" && date8[5] === "e" && date8[6] === "c") {
17250
17250
  monthIdx = 11;
17251
17251
  } else {
17252
17252
  return void 0;
17253
17253
  }
17254
17254
  let day = 0;
17255
- if (date7[8] === " ") {
17256
- const code = date7.charCodeAt(9);
17255
+ if (date8[8] === " ") {
17256
+ const code = date8.charCodeAt(9);
17257
17257
  if (code < 49 || code > 57) {
17258
17258
  return void 0;
17259
17259
  }
17260
17260
  day = code - 48;
17261
17261
  } else {
17262
- const code1 = date7.charCodeAt(8);
17262
+ const code1 = date8.charCodeAt(8);
17263
17263
  if (code1 < 49 || code1 > 51) {
17264
17264
  return void 0;
17265
17265
  }
17266
- const code2 = date7.charCodeAt(9);
17266
+ const code2 = date8.charCodeAt(9);
17267
17267
  if (code2 < 48 || code2 > 57) {
17268
17268
  return void 0;
17269
17269
  }
17270
17270
  day = (code1 - 48) * 10 + (code2 - 48);
17271
17271
  }
17272
17272
  let hour = 0;
17273
- if (date7[11] === "0") {
17274
- const code = date7.charCodeAt(12);
17273
+ if (date8[11] === "0") {
17274
+ const code = date8.charCodeAt(12);
17275
17275
  if (code < 48 || code > 57) {
17276
17276
  return void 0;
17277
17277
  }
17278
17278
  hour = code - 48;
17279
17279
  } else {
17280
- const code1 = date7.charCodeAt(11);
17280
+ const code1 = date8.charCodeAt(11);
17281
17281
  if (code1 < 48 || code1 > 50) {
17282
17282
  return void 0;
17283
17283
  }
17284
- const code2 = date7.charCodeAt(12);
17284
+ const code2 = date8.charCodeAt(12);
17285
17285
  if (code2 < 48 || code2 > 57) {
17286
17286
  return void 0;
17287
17287
  }
@@ -17291,163 +17291,163 @@ var require_date = __commonJS({
17291
17291
  hour = (code1 - 48) * 10 + (code2 - 48);
17292
17292
  }
17293
17293
  let minute = 0;
17294
- if (date7[14] === "0") {
17295
- const code = date7.charCodeAt(15);
17294
+ if (date8[14] === "0") {
17295
+ const code = date8.charCodeAt(15);
17296
17296
  if (code < 48 || code > 57) {
17297
17297
  return void 0;
17298
17298
  }
17299
17299
  minute = code - 48;
17300
17300
  } else {
17301
- const code1 = date7.charCodeAt(14);
17301
+ const code1 = date8.charCodeAt(14);
17302
17302
  if (code1 < 48 || code1 > 53) {
17303
17303
  return void 0;
17304
17304
  }
17305
- const code2 = date7.charCodeAt(15);
17305
+ const code2 = date8.charCodeAt(15);
17306
17306
  if (code2 < 48 || code2 > 57) {
17307
17307
  return void 0;
17308
17308
  }
17309
17309
  minute = (code1 - 48) * 10 + (code2 - 48);
17310
17310
  }
17311
17311
  let second = 0;
17312
- if (date7[17] === "0") {
17313
- const code = date7.charCodeAt(18);
17312
+ if (date8[17] === "0") {
17313
+ const code = date8.charCodeAt(18);
17314
17314
  if (code < 48 || code > 57) {
17315
17315
  return void 0;
17316
17316
  }
17317
17317
  second = code - 48;
17318
17318
  } else {
17319
- const code1 = date7.charCodeAt(17);
17319
+ const code1 = date8.charCodeAt(17);
17320
17320
  if (code1 < 48 || code1 > 53) {
17321
17321
  return void 0;
17322
17322
  }
17323
- const code2 = date7.charCodeAt(18);
17323
+ const code2 = date8.charCodeAt(18);
17324
17324
  if (code2 < 48 || code2 > 57) {
17325
17325
  return void 0;
17326
17326
  }
17327
17327
  second = (code1 - 48) * 10 + (code2 - 48);
17328
17328
  }
17329
- const yearDigit1 = date7.charCodeAt(20);
17329
+ const yearDigit1 = date8.charCodeAt(20);
17330
17330
  if (yearDigit1 < 48 || yearDigit1 > 57) {
17331
17331
  return void 0;
17332
17332
  }
17333
- const yearDigit2 = date7.charCodeAt(21);
17333
+ const yearDigit2 = date8.charCodeAt(21);
17334
17334
  if (yearDigit2 < 48 || yearDigit2 > 57) {
17335
17335
  return void 0;
17336
17336
  }
17337
- const yearDigit3 = date7.charCodeAt(22);
17337
+ const yearDigit3 = date8.charCodeAt(22);
17338
17338
  if (yearDigit3 < 48 || yearDigit3 > 57) {
17339
17339
  return void 0;
17340
17340
  }
17341
- const yearDigit4 = date7.charCodeAt(23);
17341
+ const yearDigit4 = date8.charCodeAt(23);
17342
17342
  if (yearDigit4 < 48 || yearDigit4 > 57) {
17343
17343
  return void 0;
17344
17344
  }
17345
17345
  const year = (yearDigit1 - 48) * 1e3 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48);
17346
17346
  return makeDate(year, monthIdx, day, hour, minute, second, weekday);
17347
17347
  }
17348
- function parseRfc850Date(date7) {
17348
+ function parseRfc850Date(date8) {
17349
17349
  let commaIndex = -1;
17350
17350
  let weekday = -1;
17351
- if (date7[0] === "S") {
17352
- if (date7[1] === "u" && date7[2] === "n" && date7[3] === "d" && date7[4] === "a" && date7[5] === "y") {
17351
+ if (date8[0] === "S") {
17352
+ if (date8[1] === "u" && date8[2] === "n" && date8[3] === "d" && date8[4] === "a" && date8[5] === "y") {
17353
17353
  weekday = 0;
17354
17354
  commaIndex = 6;
17355
- } else if (date7[1] === "a" && date7[2] === "t" && date7[3] === "u" && date7[4] === "r" && date7[5] === "d" && date7[6] === "a" && date7[7] === "y") {
17355
+ } else if (date8[1] === "a" && date8[2] === "t" && date8[3] === "u" && date8[4] === "r" && date8[5] === "d" && date8[6] === "a" && date8[7] === "y") {
17356
17356
  weekday = 6;
17357
17357
  commaIndex = 8;
17358
17358
  }
17359
- } else if (date7[0] === "M" && date7[1] === "o" && date7[2] === "n" && date7[3] === "d" && date7[4] === "a" && date7[5] === "y") {
17359
+ } else if (date8[0] === "M" && date8[1] === "o" && date8[2] === "n" && date8[3] === "d" && date8[4] === "a" && date8[5] === "y") {
17360
17360
  weekday = 1;
17361
17361
  commaIndex = 6;
17362
- } else if (date7[0] === "T") {
17363
- if (date7[1] === "u" && date7[2] === "e" && date7[3] === "s" && date7[4] === "d" && date7[5] === "a" && date7[6] === "y") {
17362
+ } else if (date8[0] === "T") {
17363
+ if (date8[1] === "u" && date8[2] === "e" && date8[3] === "s" && date8[4] === "d" && date8[5] === "a" && date8[6] === "y") {
17364
17364
  weekday = 2;
17365
17365
  commaIndex = 7;
17366
- } else if (date7[1] === "h" && date7[2] === "u" && date7[3] === "r" && date7[4] === "s" && date7[5] === "d" && date7[6] === "a" && date7[7] === "y") {
17366
+ } else if (date8[1] === "h" && date8[2] === "u" && date8[3] === "r" && date8[4] === "s" && date8[5] === "d" && date8[6] === "a" && date8[7] === "y") {
17367
17367
  weekday = 4;
17368
17368
  commaIndex = 8;
17369
17369
  }
17370
- } else if (date7[0] === "W" && date7[1] === "e" && date7[2] === "d" && date7[3] === "n" && date7[4] === "e" && date7[5] === "s" && date7[6] === "d" && date7[7] === "a" && date7[8] === "y") {
17370
+ } else if (date8[0] === "W" && date8[1] === "e" && date8[2] === "d" && date8[3] === "n" && date8[4] === "e" && date8[5] === "s" && date8[6] === "d" && date8[7] === "a" && date8[8] === "y") {
17371
17371
  weekday = 3;
17372
17372
  commaIndex = 9;
17373
- } else if (date7[0] === "F" && date7[1] === "r" && date7[2] === "i" && date7[3] === "d" && date7[4] === "a" && date7[5] === "y") {
17373
+ } else if (date8[0] === "F" && date8[1] === "r" && date8[2] === "i" && date8[3] === "d" && date8[4] === "a" && date8[5] === "y") {
17374
17374
  weekday = 5;
17375
17375
  commaIndex = 6;
17376
17376
  } else {
17377
17377
  return void 0;
17378
17378
  }
17379
- if (date7[commaIndex] !== "," || date7.length - commaIndex - 1 !== 23 || date7[commaIndex + 1] !== " " || date7[commaIndex + 4] !== "-" || date7[commaIndex + 8] !== "-" || date7[commaIndex + 11] !== " " || date7[commaIndex + 14] !== ":" || date7[commaIndex + 17] !== ":" || date7[commaIndex + 20] !== " " || date7[commaIndex + 21] !== "G" || date7[commaIndex + 22] !== "M" || date7[commaIndex + 23] !== "T") {
17379
+ if (date8[commaIndex] !== "," || date8.length - commaIndex - 1 !== 23 || date8[commaIndex + 1] !== " " || date8[commaIndex + 4] !== "-" || date8[commaIndex + 8] !== "-" || date8[commaIndex + 11] !== " " || date8[commaIndex + 14] !== ":" || date8[commaIndex + 17] !== ":" || date8[commaIndex + 20] !== " " || date8[commaIndex + 21] !== "G" || date8[commaIndex + 22] !== "M" || date8[commaIndex + 23] !== "T") {
17380
17380
  return void 0;
17381
17381
  }
17382
17382
  let day = 0;
17383
- if (date7[commaIndex + 2] === "0") {
17384
- const code = date7.charCodeAt(commaIndex + 3);
17383
+ if (date8[commaIndex + 2] === "0") {
17384
+ const code = date8.charCodeAt(commaIndex + 3);
17385
17385
  if (code < 49 || code > 57) {
17386
17386
  return void 0;
17387
17387
  }
17388
17388
  day = code - 48;
17389
17389
  } else {
17390
- const code1 = date7.charCodeAt(commaIndex + 2);
17390
+ const code1 = date8.charCodeAt(commaIndex + 2);
17391
17391
  if (code1 < 49 || code1 > 51) {
17392
17392
  return void 0;
17393
17393
  }
17394
- const code2 = date7.charCodeAt(commaIndex + 3);
17394
+ const code2 = date8.charCodeAt(commaIndex + 3);
17395
17395
  if (code2 < 48 || code2 > 57) {
17396
17396
  return void 0;
17397
17397
  }
17398
17398
  day = (code1 - 48) * 10 + (code2 - 48);
17399
17399
  }
17400
17400
  let monthIdx = -1;
17401
- if (date7[commaIndex + 5] === "J" && date7[commaIndex + 6] === "a" && date7[commaIndex + 7] === "n") {
17401
+ if (date8[commaIndex + 5] === "J" && date8[commaIndex + 6] === "a" && date8[commaIndex + 7] === "n") {
17402
17402
  monthIdx = 0;
17403
- } else if (date7[commaIndex + 5] === "F" && date7[commaIndex + 6] === "e" && date7[commaIndex + 7] === "b") {
17403
+ } else if (date8[commaIndex + 5] === "F" && date8[commaIndex + 6] === "e" && date8[commaIndex + 7] === "b") {
17404
17404
  monthIdx = 1;
17405
- } else if (date7[commaIndex + 5] === "M" && date7[commaIndex + 6] === "a" && date7[commaIndex + 7] === "r") {
17405
+ } else if (date8[commaIndex + 5] === "M" && date8[commaIndex + 6] === "a" && date8[commaIndex + 7] === "r") {
17406
17406
  monthIdx = 2;
17407
- } else if (date7[commaIndex + 5] === "A" && date7[commaIndex + 6] === "p" && date7[commaIndex + 7] === "r") {
17407
+ } else if (date8[commaIndex + 5] === "A" && date8[commaIndex + 6] === "p" && date8[commaIndex + 7] === "r") {
17408
17408
  monthIdx = 3;
17409
- } else if (date7[commaIndex + 5] === "M" && date7[commaIndex + 6] === "a" && date7[commaIndex + 7] === "y") {
17409
+ } else if (date8[commaIndex + 5] === "M" && date8[commaIndex + 6] === "a" && date8[commaIndex + 7] === "y") {
17410
17410
  monthIdx = 4;
17411
- } else if (date7[commaIndex + 5] === "J" && date7[commaIndex + 6] === "u" && date7[commaIndex + 7] === "n") {
17411
+ } else if (date8[commaIndex + 5] === "J" && date8[commaIndex + 6] === "u" && date8[commaIndex + 7] === "n") {
17412
17412
  monthIdx = 5;
17413
- } else if (date7[commaIndex + 5] === "J" && date7[commaIndex + 6] === "u" && date7[commaIndex + 7] === "l") {
17413
+ } else if (date8[commaIndex + 5] === "J" && date8[commaIndex + 6] === "u" && date8[commaIndex + 7] === "l") {
17414
17414
  monthIdx = 6;
17415
- } else if (date7[commaIndex + 5] === "A" && date7[commaIndex + 6] === "u" && date7[commaIndex + 7] === "g") {
17415
+ } else if (date8[commaIndex + 5] === "A" && date8[commaIndex + 6] === "u" && date8[commaIndex + 7] === "g") {
17416
17416
  monthIdx = 7;
17417
- } else if (date7[commaIndex + 5] === "S" && date7[commaIndex + 6] === "e" && date7[commaIndex + 7] === "p") {
17417
+ } else if (date8[commaIndex + 5] === "S" && date8[commaIndex + 6] === "e" && date8[commaIndex + 7] === "p") {
17418
17418
  monthIdx = 8;
17419
- } else if (date7[commaIndex + 5] === "O" && date7[commaIndex + 6] === "c" && date7[commaIndex + 7] === "t") {
17419
+ } else if (date8[commaIndex + 5] === "O" && date8[commaIndex + 6] === "c" && date8[commaIndex + 7] === "t") {
17420
17420
  monthIdx = 9;
17421
- } else if (date7[commaIndex + 5] === "N" && date7[commaIndex + 6] === "o" && date7[commaIndex + 7] === "v") {
17421
+ } else if (date8[commaIndex + 5] === "N" && date8[commaIndex + 6] === "o" && date8[commaIndex + 7] === "v") {
17422
17422
  monthIdx = 10;
17423
- } else if (date7[commaIndex + 5] === "D" && date7[commaIndex + 6] === "e" && date7[commaIndex + 7] === "c") {
17423
+ } else if (date8[commaIndex + 5] === "D" && date8[commaIndex + 6] === "e" && date8[commaIndex + 7] === "c") {
17424
17424
  monthIdx = 11;
17425
17425
  } else {
17426
17426
  return void 0;
17427
17427
  }
17428
- const yearDigit1 = date7.charCodeAt(commaIndex + 9);
17428
+ const yearDigit1 = date8.charCodeAt(commaIndex + 9);
17429
17429
  if (yearDigit1 < 48 || yearDigit1 > 57) {
17430
17430
  return void 0;
17431
17431
  }
17432
- const yearDigit2 = date7.charCodeAt(commaIndex + 10);
17432
+ const yearDigit2 = date8.charCodeAt(commaIndex + 10);
17433
17433
  if (yearDigit2 < 48 || yearDigit2 > 57) {
17434
17434
  return void 0;
17435
17435
  }
17436
17436
  let year = (yearDigit1 - 48) * 10 + (yearDigit2 - 48);
17437
17437
  year += year < 70 ? 2e3 : 1900;
17438
17438
  let hour = 0;
17439
- if (date7[commaIndex + 12] === "0") {
17440
- const code = date7.charCodeAt(commaIndex + 13);
17439
+ if (date8[commaIndex + 12] === "0") {
17440
+ const code = date8.charCodeAt(commaIndex + 13);
17441
17441
  if (code < 48 || code > 57) {
17442
17442
  return void 0;
17443
17443
  }
17444
17444
  hour = code - 48;
17445
17445
  } else {
17446
- const code1 = date7.charCodeAt(commaIndex + 12);
17446
+ const code1 = date8.charCodeAt(commaIndex + 12);
17447
17447
  if (code1 < 48 || code1 > 50) {
17448
17448
  return void 0;
17449
17449
  }
17450
- const code2 = date7.charCodeAt(commaIndex + 13);
17450
+ const code2 = date8.charCodeAt(commaIndex + 13);
17451
17451
  if (code2 < 48 || code2 > 57) {
17452
17452
  return void 0;
17453
17453
  }
@@ -17457,36 +17457,36 @@ var require_date = __commonJS({
17457
17457
  hour = (code1 - 48) * 10 + (code2 - 48);
17458
17458
  }
17459
17459
  let minute = 0;
17460
- if (date7[commaIndex + 15] === "0") {
17461
- const code = date7.charCodeAt(commaIndex + 16);
17460
+ if (date8[commaIndex + 15] === "0") {
17461
+ const code = date8.charCodeAt(commaIndex + 16);
17462
17462
  if (code < 48 || code > 57) {
17463
17463
  return void 0;
17464
17464
  }
17465
17465
  minute = code - 48;
17466
17466
  } else {
17467
- const code1 = date7.charCodeAt(commaIndex + 15);
17467
+ const code1 = date8.charCodeAt(commaIndex + 15);
17468
17468
  if (code1 < 48 || code1 > 53) {
17469
17469
  return void 0;
17470
17470
  }
17471
- const code2 = date7.charCodeAt(commaIndex + 16);
17471
+ const code2 = date8.charCodeAt(commaIndex + 16);
17472
17472
  if (code2 < 48 || code2 > 57) {
17473
17473
  return void 0;
17474
17474
  }
17475
17475
  minute = (code1 - 48) * 10 + (code2 - 48);
17476
17476
  }
17477
17477
  let second = 0;
17478
- if (date7[commaIndex + 18] === "0") {
17479
- const code = date7.charCodeAt(commaIndex + 19);
17478
+ if (date8[commaIndex + 18] === "0") {
17479
+ const code = date8.charCodeAt(commaIndex + 19);
17480
17480
  if (code < 48 || code > 57) {
17481
17481
  return void 0;
17482
17482
  }
17483
17483
  second = code - 48;
17484
17484
  } else {
17485
- const code1 = date7.charCodeAt(commaIndex + 18);
17485
+ const code1 = date8.charCodeAt(commaIndex + 18);
17486
17486
  if (code1 < 48 || code1 > 53) {
17487
17487
  return void 0;
17488
17488
  }
17489
- const code2 = date7.charCodeAt(commaIndex + 19);
17489
+ const code2 = date8.charCodeAt(commaIndex + 19);
17490
17490
  if (code2 < 48 || code2 > 57) {
17491
17491
  return void 0;
17492
17492
  }
@@ -22758,9 +22758,9 @@ var require_util3 = __commonJS({
22758
22758
  var assert2 = __require("node:assert");
22759
22759
  var { URLSerializer } = require_data_url();
22760
22760
  var { isValidHeaderName } = require_util2();
22761
- function urlEquals(A, B2, excludeFragment = false) {
22761
+ function urlEquals(A, B5, excludeFragment = false) {
22762
22762
  const serializedA = URLSerializer(A, excludeFragment);
22763
- const serializedB = URLSerializer(B2, excludeFragment);
22763
+ const serializedB = URLSerializer(B5, excludeFragment);
22764
22764
  return serializedA === serializedB;
22765
22765
  }
22766
22766
  function getFieldValues(header) {
@@ -23586,11 +23586,11 @@ var require_util4 = __commonJS({
23586
23586
  "Dec"
23587
23587
  ];
23588
23588
  var IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, "0"));
23589
- function toIMFDate(date7) {
23590
- if (typeof date7 === "number") {
23591
- date7 = new Date(date7);
23589
+ function toIMFDate(date8) {
23590
+ if (typeof date8 === "number") {
23591
+ date8 = new Date(date8);
23592
23592
  }
23593
- return `${IMFDays[date7.getUTCDay()]}, ${IMFPaddedNumbers[date7.getUTCDate()]} ${IMFMonths[date7.getUTCMonth()]} ${date7.getUTCFullYear()} ${IMFPaddedNumbers[date7.getUTCHours()]}:${IMFPaddedNumbers[date7.getUTCMinutes()]}:${IMFPaddedNumbers[date7.getUTCSeconds()]} GMT`;
23593
+ return `${IMFDays[date8.getUTCDay()]}, ${IMFPaddedNumbers[date8.getUTCDate()]} ${IMFMonths[date8.getUTCMonth()]} ${date8.getUTCFullYear()} ${IMFPaddedNumbers[date8.getUTCHours()]}:${IMFPaddedNumbers[date8.getUTCMinutes()]}:${IMFPaddedNumbers[date8.getUTCSeconds()]} GMT`;
23594
23594
  }
23595
23595
  function validateCookieMaxAge(maxAge) {
23596
23596
  if (maxAge < 0) {
@@ -27645,9 +27645,9 @@ function formatPropertyKey(name) {
27645
27645
  function formatPath(path10) {
27646
27646
  return path10.map((key) => `[${formatPropertyKey(key)}]`).join("");
27647
27647
  }
27648
- function formatDate(date7) {
27648
+ function formatDate(date8) {
27649
27649
  try {
27650
- return date7.toISOString();
27650
+ return date8.toISOString();
27651
27651
  } catch {
27652
27652
  return "Invalid Date";
27653
27653
  }
@@ -28476,7 +28476,7 @@ var Number2 = /* @__PURE__ */ make4((self, that) => {
28476
28476
  });
28477
28477
  var BigInt2 = /* @__PURE__ */ make4((self, that) => self < that ? -1 : 1);
28478
28478
  var mapInput = /* @__PURE__ */ dual(2, (self, f) => make4((b1, b2) => self(f(b1), f(b2))));
28479
- var Date2 = /* @__PURE__ */ mapInput(Number2, (date7) => date7.getTime());
28479
+ var Date2 = /* @__PURE__ */ mapInput(Number2, (date8) => date8.getTime());
28480
28480
  var isLessThan = (O) => dual(2, (self, that) => O(self, that) === -1);
28481
28481
  var isGreaterThan = (O) => dual(2, (self, that) => O(self, that) === 1);
28482
28482
  var isLessThanOrEqualTo = (O) => dual(2, (self, that) => O(self, that) !== 1);
@@ -32817,12 +32817,12 @@ var logWithLevel = (level) => (...message) => {
32817
32817
  const clock = fiber3.getRef(ClockRef);
32818
32818
  const loggers = fiber3.getRef(CurrentLoggers);
32819
32819
  if (loggers.size > 0) {
32820
- const date7 = new Date(clock.currentTimeMillisUnsafe());
32820
+ const date8 = new Date(clock.currentTimeMillisUnsafe());
32821
32821
  for (const logger2 of loggers) {
32822
32822
  logger2.log({
32823
32823
  cause,
32824
32824
  fiber: fiber3,
32825
- date: date7,
32825
+ date: date8,
32826
32826
  logLevel: logLevel2,
32827
32827
  message
32828
32828
  });
@@ -32853,10 +32853,10 @@ var logLevelColors = {
32853
32853
  Error: [colors.red],
32854
32854
  Fatal: [colors.bgBrightRed, colors.black]
32855
32855
  };
32856
- var defaultDateFormat = (date7) => `${date7.getHours().toString().padStart(2, "0")}:${date7.getMinutes().toString().padStart(2, "0")}:${date7.getSeconds().toString().padStart(2, "0")}.${date7.getMilliseconds().toString().padStart(3, "0")}`;
32856
+ var defaultDateFormat = (date8) => `${date8.getHours().toString().padStart(2, "0")}:${date8.getMinutes().toString().padStart(2, "0")}:${date8.getSeconds().toString().padStart(2, "0")}.${date8.getMilliseconds().toString().padStart(3, "0")}`;
32857
32857
  var defaultLogger = /* @__PURE__ */ loggerMake(({
32858
32858
  cause,
32859
- date: date7,
32859
+ date: date8,
32860
32860
  fiber: fiber3,
32861
32861
  logLevel: logLevel2,
32862
32862
  message
@@ -32865,7 +32865,7 @@ var defaultLogger = /* @__PURE__ */ loggerMake(({
32865
32865
  if (cause.reasons.length > 0) {
32866
32866
  message_.push(causePretty(cause));
32867
32867
  }
32868
- const now2 = date7.getTime();
32868
+ const now2 = date8.getTime();
32869
32869
  const spans = fiber3.getRef(CurrentLogSpans);
32870
32870
  let spanString = "";
32871
32871
  for (const span2 of spans) {
@@ -32877,7 +32877,7 @@ var defaultLogger = /* @__PURE__ */ loggerMake(({
32877
32877
  }
32878
32878
  const console2 = fiber3.getRef(ConsoleRef);
32879
32879
  const log3 = fiber3.getRef(LogToStderr) ? console2.error : console2.log;
32880
- log3(`[${defaultDateFormat(date7)}] ${logLevel2.toUpperCase()} (#${fiber3.id})${spanString}:`, ...message_);
32880
+ log3(`[${defaultDateFormat(date8)}] ${logLevel2.toUpperCase()} (#${fiber3.id})${spanString}:`, ...message_);
32881
32881
  });
32882
32882
  var tracerLogger = /* @__PURE__ */ loggerMake(({
32883
32883
  cause,
@@ -33679,8 +33679,8 @@ var makeUtc = (epochMillis) => {
33679
33679
  });
33680
33680
  return self;
33681
33681
  };
33682
- var fromDateUnsafe = (date7) => {
33683
- const epochMillis = date7.getTime();
33682
+ var fromDateUnsafe = (date8) => {
33683
+ const epochMillis = date8.getTime();
33684
33684
  if (Number.isNaN(epochMillis)) {
33685
33685
  throw new IllegalArgumentError2("Invalid date");
33686
33686
  }
@@ -33695,9 +33695,9 @@ var makeUnsafe4 = (input) => {
33695
33695
  if ("epochMilliseconds" in input) {
33696
33696
  return fromDateUnsafe(new Date(input.epochMilliseconds));
33697
33697
  }
33698
- const date7 = /* @__PURE__ */ new Date(0);
33699
- setPartsDate(date7, input);
33700
- return fromDateUnsafe(date7);
33698
+ const date8 = /* @__PURE__ */ new Date(0);
33699
+ setPartsDate(date8, input);
33700
+ return fromDateUnsafe(date8);
33701
33701
  } else if (typeof input === "string" && !hasZone(input)) {
33702
33702
  return fromDateUnsafe(/* @__PURE__ */ new Date(input + "Z"));
33703
33703
  }
@@ -33821,15 +33821,15 @@ var toDate = (self) => {
33821
33821
  return new Date(self.adjustedEpochMilliseconds);
33822
33822
  }
33823
33823
  const parts2 = self.zone.format.formatToParts(self.epochMilliseconds).filter((_) => _.type !== "literal");
33824
- const date7 = /* @__PURE__ */ new Date(0);
33825
- date7.setUTCFullYear(Number(parts2[2].value), Number(parts2[0].value) - 1, Number(parts2[1].value));
33826
- date7.setUTCHours(Number(parts2[3].value), Number(parts2[4].value), Number(parts2[5].value), Number(parts2[6].value));
33827
- self.adjustedEpochMilliseconds = date7.getTime();
33828
- return date7;
33824
+ const date8 = /* @__PURE__ */ new Date(0);
33825
+ date8.setUTCFullYear(Number(parts2[2].value), Number(parts2[0].value) - 1, Number(parts2[1].value));
33826
+ date8.setUTCHours(Number(parts2[3].value), Number(parts2[4].value), Number(parts2[5].value), Number(parts2[6].value));
33827
+ self.adjustedEpochMilliseconds = date8.getTime();
33828
+ return date8;
33829
33829
  };
33830
33830
  var zonedOffset = (self) => {
33831
- const date7 = toDate(self);
33832
- return date7.getTime() - toEpochMillis(self);
33831
+ const date8 = toDate(self);
33832
+ return date8.getTime() - toEpochMillis(self);
33833
33833
  };
33834
33834
  var offsetToString = (offset) => {
33835
33835
  const abs3 = Math.abs(offset);
@@ -33843,31 +33843,31 @@ var offsetToString = (offset) => {
33843
33843
  };
33844
33844
  var zonedOffsetIso = (self) => offsetToString(zonedOffset(self));
33845
33845
  var toEpochMillis = (self) => self.epochMilliseconds;
33846
- var setPartsDate = (date7, parts2) => {
33846
+ var setPartsDate = (date8, parts2) => {
33847
33847
  if (parts2.year !== void 0) {
33848
- date7.setUTCFullYear(parts2.year);
33848
+ date8.setUTCFullYear(parts2.year);
33849
33849
  }
33850
33850
  if (parts2.month !== void 0) {
33851
- date7.setUTCMonth(parts2.month - 1);
33851
+ date8.setUTCMonth(parts2.month - 1);
33852
33852
  }
33853
33853
  if (parts2.day !== void 0) {
33854
- date7.setUTCDate(parts2.day);
33854
+ date8.setUTCDate(parts2.day);
33855
33855
  }
33856
33856
  if (parts2.weekDay !== void 0) {
33857
- const diff = parts2.weekDay - date7.getUTCDay();
33858
- date7.setUTCDate(date7.getUTCDate() + diff);
33857
+ const diff = parts2.weekDay - date8.getUTCDay();
33858
+ date8.setUTCDate(date8.getUTCDate() + diff);
33859
33859
  }
33860
33860
  if (parts2.hour !== void 0) {
33861
- date7.setUTCHours(parts2.hour);
33861
+ date8.setUTCHours(parts2.hour);
33862
33862
  }
33863
33863
  if (parts2.minute !== void 0) {
33864
- date7.setUTCMinutes(parts2.minute);
33864
+ date8.setUTCMinutes(parts2.minute);
33865
33865
  }
33866
33866
  if (parts2.second !== void 0) {
33867
- date7.setUTCSeconds(parts2.second);
33867
+ date8.setUTCSeconds(parts2.second);
33868
33868
  }
33869
33869
  if (parts2.millisecond !== void 0) {
33870
- date7.setUTCMilliseconds(parts2.millisecond);
33870
+ date8.setUTCMilliseconds(parts2.millisecond);
33871
33871
  }
33872
33872
  };
33873
33873
  var constDayMillis = 24 * 60 * 60 * 1e3;
@@ -33942,8 +33942,8 @@ var calculateNamedOffset = (utcMillis, adjustedMillis, zone) => {
33942
33942
  };
33943
33943
  var formatIso = (self) => toDateUtc(self).toISOString();
33944
33944
  var formatIsoOffset = (self) => {
33945
- const date7 = toDate(self);
33946
- return self._tag === "Utc" ? date7.toISOString() : `${date7.toISOString().slice(0, -1)}${zonedOffsetIso(self)}`;
33945
+ const date8 = toDate(self);
33946
+ return self._tag === "Utc" ? date8.toISOString() : `${date8.toISOString().slice(0, -1)}${zonedOffsetIso(self)}`;
33947
33947
  };
33948
33948
  var formatIsoZoned = (self) => self.zone._tag === "Offset" ? formatIsoOffset(self) : `${formatIsoOffset(self)}[${self.zone.id}]`;
33949
33949
 
@@ -37833,7 +37833,7 @@ function passthrough3() {
37833
37833
  var numberFromString = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Number4(), /* @__PURE__ */ String3());
37834
37834
  var bigintFromString = /* @__PURE__ */ new Transformation(/* @__PURE__ */ BigInt3(), /* @__PURE__ */ String3());
37835
37835
  var dateFromString = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Date3(), /* @__PURE__ */ transform(formatDate));
37836
- var dateFromMillis = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Date3(), /* @__PURE__ */ transform((date7) => date7.getTime()));
37836
+ var dateFromMillis = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Date3(), /* @__PURE__ */ transform((date8) => date8.getTime()));
37837
37837
  var durationFromString = /* @__PURE__ */ transformOrFail2({
37838
37838
  decode: (s, options4) => match(fromInput(s), {
37839
37839
  onNone: () => fail6(new InvalidValue({
@@ -46795,14 +46795,14 @@ function isUint32(annotations2) {
46795
46795
  ...annotations2
46796
46796
  });
46797
46797
  }
46798
- function encodeDatePayload(date7) {
46799
- if (globalThis.Number.isNaN(date7.getTime())) {
46800
- throw new globalThis.RangeError(`Expected a valid Date, got ${format(date7)}`);
46798
+ function encodeDatePayload(date8) {
46799
+ if (globalThis.Number.isNaN(date8.getTime())) {
46800
+ throw new globalThis.RangeError(`Expected a valid Date, got ${format(date8)}`);
46801
46801
  }
46802
- return date7.toISOString();
46802
+ return date8.toISOString();
46803
46803
  }
46804
- function formatDateRuntime(date7) {
46805
- return `new Date(${format(date7.getTime())})`;
46804
+ function formatDateRuntime(date8) {
46805
+ return `new Date(${format(date8.getTime())})`;
46806
46806
  }
46807
46807
  var isGreaterThanDate = /* @__PURE__ */ makeIsGreaterThan({
46808
46808
  order: Date2,
@@ -48875,7 +48875,7 @@ var DateTimeUtc = /* @__PURE__ */ declare((u) => isDateTime2(u) && isUtc2(u), {
48875
48875
  toCodecJson: () => link()(String5, dateTimeUtcFromString),
48876
48876
  toArbitrary: () => (fc, ctx) => fc.date(dateArbitraryConstraints(ctx?.constraint?.ordered?.order === Order3 ? ctx.constraint.ordered : void 0, {
48877
48877
  noInvalidDate: true
48878
- }, toDateUtc2)).map((date7) => fromDateUnsafe2(date7)),
48878
+ }, toDateUtc2)).map((date8) => fromDateUnsafe2(date8)),
48879
48879
  toFormatter: () => (utc) => utc.toString(),
48880
48880
  toEquivalence: () => Equivalence3
48881
48881
  });
@@ -48975,7 +48975,7 @@ var DateTimeZoned = /* @__PURE__ */ declare((u) => isDateTime2(u) && isZoned2(u)
48975
48975
  max: new globalThis.Date(864e13 - 14 * 60 * 60 * 1e3),
48976
48976
  min: new globalThis.Date(-864e13 + 14 * 60 * 60 * 1e3),
48977
48977
  noInvalidDate: true
48978
- }, toDateUtc2)), fc.constantFrom("UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney")).map(([date7, zone]) => makeZonedUnsafe2(date7, {
48978
+ }, toDateUtc2)), fc.constantFrom("UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney")).map(([date8, zone]) => makeZonedUnsafe2(date8, {
48979
48979
  timeZone: zone
48980
48980
  })),
48981
48981
  toFormatter: () => (zoned) => formatIsoZoned2(zoned),
@@ -49828,9 +49828,9 @@ function parseSetCookie(header) {
49828
49828
  if (value4 === void 0) {
49829
49829
  break;
49830
49830
  }
49831
- const date7 = new Date(value4);
49832
- if (!isNaN(date7.getTime())) {
49833
- options4.expires = date7;
49831
+ const date8 = new Date(value4);
49832
+ if (!isNaN(date8.getTime())) {
49833
+ options4.expires = date8;
49834
49834
  }
49835
49835
  break;
49836
49836
  }
@@ -55875,9 +55875,9 @@ var TomlParser = class {
55875
55875
  if (token === "true") return true;
55876
55876
  if (token === "false") return false;
55877
55877
  if (token.length === 0) this.fail("Expected a value");
55878
- const date7 = this.parseDate(token);
55879
- if (date7 !== void 0) {
55880
- return date7;
55878
+ const date8 = this.parseDate(token);
55879
+ if (date8 !== void 0) {
55880
+ return date8;
55881
55881
  }
55882
55882
  const number4 = this.parseNumber(token);
55883
55883
  if (number4 !== void 0) {
@@ -55886,16 +55886,16 @@ var TomlParser = class {
55886
55886
  this.fail(`Invalid value '${token}'`);
55887
55887
  }
55888
55888
  parseDate(token) {
55889
- const date7 = "\\d{4}-\\d{2}-\\d{2}";
55889
+ const date8 = "\\d{4}-\\d{2}-\\d{2}";
55890
55890
  const time2 = "\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?";
55891
- if (new RegExp(`^${date7}[Tt]${time2}(?:[Zz]|[+-]\\d{2}:\\d{2})$`).test(token)) {
55891
+ if (new RegExp(`^${date8}[Tt]${time2}(?:[Zz]|[+-]\\d{2}:\\d{2})$`).test(token)) {
55892
55892
  const value3 = new Date(token.replace("t", "T").replace("z", "Z"));
55893
55893
  if (Number.isNaN(value3.getTime())) {
55894
55894
  this.fail(`Invalid date-time '${token}'`);
55895
55895
  }
55896
55896
  return value3;
55897
55897
  }
55898
- if (new RegExp(`^${date7}[Tt]${time2}$`).test(token) || new RegExp(`^${date7}$`).test(token) || new RegExp(`^${time2}$`).test(token)) {
55898
+ if (new RegExp(`^${date8}[Tt]${time2}$`).test(token) || new RegExp(`^${date8}$`).test(token) || new RegExp(`^${time2}$`).test(token)) {
55899
55899
  return token.replace("t", "T");
55900
55900
  }
55901
55901
  return void 0;
@@ -57393,7 +57393,7 @@ var regExpGroups = {
57393
57393
  8: (opts) => new Seconds(opts),
57394
57394
  9: (opts) => new Milliseconds(opts)
57395
57395
  };
57396
- var makeDateParts = (dateMask, date7, locales) => {
57396
+ var makeDateParts = (dateMask, date8, locales) => {
57397
57397
  const parts2 = [];
57398
57398
  let result3 = null;
57399
57399
  while (result3 = DATE_PART_REGEXP.exec(dateMask)) {
@@ -57403,14 +57403,14 @@ var makeDateParts = (dateMask, date7, locales) => {
57403
57403
  const token = result3[index2] || match9;
57404
57404
  parts2.push(regExpGroups[index2]({
57405
57405
  token,
57406
- date: date7,
57406
+ date: date8,
57407
57407
  parts: parts2,
57408
57408
  locales
57409
57409
  }));
57410
57410
  } else {
57411
57411
  parts2.push(new Token({
57412
57412
  token: result3[index2] || match9,
57413
- date: date7,
57413
+ date: date8,
57414
57414
  parts: parts2,
57415
57415
  locales
57416
57416
  }));
@@ -57552,13 +57552,13 @@ var Day = class extends DatePart {
57552
57552
  this.date.setDate(Number.parseInt(value3.slice(-2)));
57553
57553
  }
57554
57554
  toString() {
57555
- const date7 = this.date.getDate();
57555
+ const date8 = this.date.getDate();
57556
57556
  const day = this.date.getDay();
57557
57557
  switch (this.token) {
57558
57558
  case "DD":
57559
- return `${date7}`.padStart(2, "0");
57559
+ return `${date8}`.padStart(2, "0");
57560
57560
  case "Do":
57561
- return `${date7}${this.ordinalIndicator(date7)}`;
57561
+ return `${date8}${this.ordinalIndicator(date8)}`;
57562
57562
  case "d":
57563
57563
  return `${day + 1}`;
57564
57564
  case "ddd":
@@ -57566,7 +57566,7 @@ var Day = class extends DatePart {
57566
57566
  case "dddd":
57567
57567
  return this.locales.weekdays[day];
57568
57568
  default:
57569
- return `${date7}`;
57569
+ return `${date8}`;
57570
57570
  }
57571
57571
  }
57572
57572
  ordinalIndicator(day) {
@@ -61210,7 +61210,7 @@ var promptSingle = (single) => {
61210
61210
  case "Date":
61211
61211
  return map7(run3(date3({
61212
61212
  message
61213
- })), (date7) => commandLineArg(date7.toISOString()));
61213
+ })), (date8) => commandLineArg(date8.toISOString()));
61214
61214
  case "Float":
61215
61215
  return map7(run3(float2({
61216
61216
  message
@@ -65578,15 +65578,26 @@ var WEB_RESEARCH_FIELD_NOTES = [
65578
65578
  "source is a publisher or site name.",
65579
65579
  "exa_similarity_score is Exa's own score and is comparable only within one response."
65580
65580
  ].join(" ");
65581
+ var SolutionRequestCharge = Schema_exports.Struct({
65582
+ charge_usd: Schema_exports.NullOr(UsdAmount).annotate({
65583
+ description: "Charge for Runs created by this request only. Replayed Runs and free reads add zero. Null while a newly created Run is unsettled or its admission source is unknown. This is not the historical total in charge_usd or runs[].charge_usd."
65584
+ }),
65585
+ created_run_ids: Schema_exports.Array(RunId),
65586
+ replayed_run_ids: Schema_exports.Array(RunId),
65587
+ unknown_run_ids: Schema_exports.Array(RunId)
65588
+ });
65581
65589
  var solutionResultFields = {
65582
65590
  error: Schema_exports.NullOr(Schema_exports.Struct({ code: Schema_exports.String, message: Schema_exports.String })),
65583
65591
  charge_usd: Schema_exports.NullOr(UsdAmount).annotate({
65584
- description: "Total charge of runs in this Solution response. Null until all listed Runs settle. Each Run retains its own charge; failures can also be charged."
65592
+ description: "Historical total Charge of the listed Runs, including replayed or read Runs. Null until all listed Runs settle. This is not new spending by the current request; request_charge reports that separately. Failures can also be charged."
65585
65593
  }),
65586
65594
  charge_basis: Run.fields.charge_basis.annotate({
65587
65595
  description: "Single-Run charge basis, or null for a multi-Run total. Read runs[].charge_basis for each charge."
65588
65596
  }),
65589
65597
  runs: Schema_exports.Array(RunSummary),
65598
+ request_charge: Schema_exports.optionalKey(SolutionRequestCharge).annotate({
65599
+ description: "Request-scoped admission and Charge evidence. Record created_run_ids across the user's work, then count each settled Run once. Changing task_id does not turn an idempotent replay into a new Run. A result read has zero Charge and empty admission lists."
65600
+ }),
65590
65601
  result_url: Schema_exports.String.annotate({
65591
65602
  description: "Authenticated, read-only URL path for polling this normalized result and total charge. Use with the API origin. Does not create Runs or resume fallback. GET /v1/runs/:id still returns the native, individual Run."
65592
65603
  })
@@ -65680,6 +65691,473 @@ var WebResearchRequest = Schema_exports.Struct({
65680
65691
  ...commonFields
65681
65692
  });
65682
65693
 
65694
+ // ../../packages/contract/src/solutions-amazon-analysis.ts
65695
+ var decimal = (signed, description) => {
65696
+ const value3 = Schema_exports.String.annotate({ description }).check(
65697
+ Schema_exports.isPattern(
65698
+ signed ? /^-?(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$/ : /^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$/
65699
+ )
65700
+ );
65701
+ return signed ? value3.check(Schema_exports.makeFilter((value4) => value4 !== "-0.00")) : value3;
65702
+ };
65703
+ var AmazonAnalysisAmount = decimal(
65704
+ false,
65705
+ "Exact non-negative decimal amount in the specified currency, with 2 to 6 decimal places. No currency conversion."
65706
+ ).check(Schema_exports.isMaxLength(24));
65707
+ var S2 = Schema_exports.NullOr(Schema_exports.String);
65708
+ var Amount = decimal(
65709
+ true,
65710
+ "Exact signed decimal amount in the output currency, with 2 to 6 decimal places. No currency conversion."
65711
+ );
65712
+ var Percent = decimal(
65713
+ true,
65714
+ "Exact signed percentage value (15.00 means 15%), with 2 to 6 decimal places."
65715
+ );
65716
+ var NonNegativePercent = decimal(
65717
+ false,
65718
+ "Exact non-negative percentage value (15.00 means 15%), with 2 to 6 decimal places."
65719
+ ).check(Schema_exports.isMaxLength(24));
65720
+ var AmazonPriceAnalysisOptions = Schema_exports.Struct({
65721
+ price_type: Schema_exports.Literals(["AMAZON", "NEW", "LISTPRICE"]),
65722
+ from_at: Schema_exports.optional(Timestamp),
65723
+ to_at: Schema_exports.optional(Timestamp),
65724
+ minimum_change_percent: Schema_exports.optional(NonNegativePercent),
65725
+ minimum_change_amount: Schema_exports.optional(AmazonAnalysisAmount),
65726
+ group_tolerance_amount: Schema_exports.optional(AmazonAnalysisAmount),
65727
+ minimum_available_hours: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(1))),
65728
+ unavailable_break_hours: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(1)))
65729
+ });
65730
+ var AmazonPriceAnalysisRequest = Schema_exports.Struct({
65731
+ analysis: Schema_exports.Literal("price_history"),
65732
+ token: NonEmpty.check(Schema_exports.isMaxLength(16384)),
65733
+ ...AmazonPriceAnalysisOptions.fields
65734
+ });
65735
+ var AmazonPriceAnalysisOutput = Schema_exports.Struct({
65736
+ asin: S2,
65737
+ amazon_domain: S2,
65738
+ currency: S2,
65739
+ price_type: Schema_exports.Literals(["AMAZON", "NEW", "LISTPRICE"]),
65740
+ from_at: S2,
65741
+ to_at: S2,
65742
+ provider_updated_at: S2,
65743
+ definition_break_at: S2,
65744
+ thresholds: Schema_exports.Struct({
65745
+ minimum_change_percent: NonNegativePercent,
65746
+ minimum_change_amount: Amount,
65747
+ group_tolerance_amount: Amount,
65748
+ minimum_available_hours: Schema_exports.Int,
65749
+ unavailable_break_hours: Schema_exports.Int
65750
+ }),
65751
+ median_method: Schema_exports.Literal("lower_time_weighted_median"),
65752
+ percent_rounding: Schema_exports.Literal("toward_zero_6_decimals"),
65753
+ segments_evaluated: Schema_exports.Int,
65754
+ limitations: Schema_exports.Array(Schema_exports.String),
65755
+ episodes: Schema_exports.Array(
65756
+ Schema_exports.Struct({
65757
+ direction: Schema_exports.Literals(["increase", "decrease"]),
65758
+ first_observed_at: Schema_exports.String,
65759
+ end_at: Schema_exports.String,
65760
+ end_reason: Schema_exports.Literals([
65761
+ "price_changed",
65762
+ "unavailable_gap",
65763
+ "definition_changed",
65764
+ "observation_end"
65765
+ ]),
65766
+ open_at_observation_end: Schema_exports.Boolean,
65767
+ start_before_window: Schema_exports.Boolean,
65768
+ price: Amount,
65769
+ price_min: Amount,
65770
+ price_max: Amount,
65771
+ baseline_price: Amount,
65772
+ previous_available_price: Schema_exports.NullOr(Amount),
65773
+ amount_vs_baseline: Amount,
65774
+ percent_vs_baseline: Schema_exports.NullOr(Percent),
65775
+ amount_vs_previous: Schema_exports.NullOr(Amount),
65776
+ percent_vs_previous: Schema_exports.NullOr(Percent),
65777
+ baseline_from_at: Schema_exports.String,
65778
+ baseline_available_duration_ms: Schema_exports.Int,
65779
+ calendar_duration_ms: Schema_exports.Int,
65780
+ available_duration_ms: Schema_exports.Int,
65781
+ window_available_duration_ms: Schema_exports.Int,
65782
+ has_unavailable_gaps: Schema_exports.Boolean,
65783
+ reverted_at: S2
65784
+ })
65785
+ )
65786
+ });
65787
+ var AmazonEconomicsScenario = Schema_exports.Struct({
65788
+ selling_price: Schema_exports.NullOr(AmazonAnalysisAmount),
65789
+ cogs: Schema_exports.NullOr(AmazonAnalysisAmount),
65790
+ inbound_freight: Schema_exports.NullOr(AmazonAnalysisAmount),
65791
+ duties: Schema_exports.NullOr(AmazonAnalysisAmount),
65792
+ referral_fee: Schema_exports.NullOr(AmazonAnalysisAmount),
65793
+ fulfillment_fee: Schema_exports.NullOr(AmazonAnalysisAmount),
65794
+ returns_warranty: Schema_exports.NullOr(AmazonAnalysisAmount),
65795
+ discounts: Schema_exports.NullOr(AmazonAnalysisAmount),
65796
+ advertising: Schema_exports.NullOr(AmazonAnalysisAmount)
65797
+ });
65798
+ var AmazonEconomicsRequest = Schema_exports.Struct({
65799
+ analysis: Schema_exports.Literal("economics"),
65800
+ currency: Schema_exports.String.check(Schema_exports.isPattern(/^[A-Z]{3}$/)),
65801
+ base: AmazonEconomicsScenario,
65802
+ downside: AmazonEconomicsScenario,
65803
+ evidence_notes: Schema_exports.Array(Schema_exports.String)
65804
+ });
65805
+ var ScenarioResult = Schema_exports.Struct({
65806
+ inputs: AmazonEconomicsScenario,
65807
+ total_cost: Schema_exports.NullOr(Amount),
65808
+ contribution_margin: Schema_exports.NullOr(Amount),
65809
+ contribution_margin_percent: Schema_exports.NullOr(Percent),
65810
+ missing_inputs: Schema_exports.Array(Schema_exports.String)
65811
+ });
65812
+ var AmazonEconomicsOutput = Schema_exports.Struct({
65813
+ currency: Schema_exports.String,
65814
+ input_origin: Schema_exports.Literal("user_supplied"),
65815
+ base: ScenarioResult,
65816
+ downside: ScenarioResult,
65817
+ complete: Schema_exports.Boolean,
65818
+ evidence_notes: Schema_exports.Array(Schema_exports.String),
65819
+ limitations: Schema_exports.Array(Schema_exports.String)
65820
+ });
65821
+ var AmazonSuppliedReview = Schema_exports.Struct({
65822
+ id: NonEmpty,
65823
+ asin: Schema_exports.String.check(Schema_exports.isPattern(/^[A-Z0-9]{10}$/)),
65824
+ url: S2,
65825
+ title: S2,
65826
+ text: NonEmpty,
65827
+ rating: Schema_exports.NullOr(Schema_exports.Number),
65828
+ published_at: S2,
65829
+ date_text: S2,
65830
+ verified_purchase: Schema_exports.NullOr(Schema_exports.Boolean),
65831
+ vine: Schema_exports.NullOr(Schema_exports.Boolean),
65832
+ language: S2,
65833
+ variation_asin: S2,
65834
+ variant_attributes: Schema_exports.Array(Schema_exports.String)
65835
+ });
65836
+ var Theme2 = Schema_exports.Struct({
65837
+ name: NonEmpty,
65838
+ kind: Schema_exports.Literals([
65839
+ "product_defect",
65840
+ "shipping",
65841
+ "seller_authenticity",
65842
+ "price",
65843
+ "support",
65844
+ "user_care",
65845
+ "purchase_reason",
65846
+ "other"
65847
+ ]),
65848
+ supporting_review_ids: Schema_exports.Array(NonEmpty),
65849
+ counterexample_review_ids: Schema_exports.Array(NonEmpty),
65850
+ interpretation: S2,
65851
+ action_to_test: S2,
65852
+ ambiguity: S2,
65853
+ confidence: Schema_exports.Literals(["low", "medium", "high", "unknown"])
65854
+ });
65855
+ var AmazonReviewAnalysisRequest = Schema_exports.Struct({
65856
+ analysis: Schema_exports.Literal("reviews"),
65857
+ country: NonEmpty,
65858
+ tokens: Schema_exports.Array(NonEmpty.check(Schema_exports.isMaxLength(16384))),
65859
+ supplied_reviews: Schema_exports.Array(AmazonSuppliedReview),
65860
+ sampling_design: Schema_exports.Literals([
65861
+ "recent_pages",
65862
+ "user_supplied",
65863
+ "rating_stratified",
65864
+ "random",
65865
+ "time_stratified"
65866
+ ]),
65867
+ sampling_notes: Schema_exports.String,
65868
+ themes: Schema_exports.Array(Theme2)
65869
+ });
65870
+ var AmazonReviewAnalysisOutput = Schema_exports.Struct({
65871
+ amazon_domain: Schema_exports.String,
65872
+ reviews: Schema_exports.Int,
65873
+ asins: Schema_exports.Array(Schema_exports.String),
65874
+ sampling_design: AmazonReviewAnalysisRequest.fields.sampling_design,
65875
+ sampling_notes: Schema_exports.String,
65876
+ representativeness: Schema_exports.Literal("not_established"),
65877
+ assessment_method: Schema_exports.Literal("analyst_tagged_sample"),
65878
+ themes: Schema_exports.Array(
65879
+ Schema_exports.Struct({
65880
+ ...Theme2.fields,
65881
+ review_mentions: Schema_exports.Int,
65882
+ sample_reviews: Schema_exports.Int,
65883
+ claim_status: Schema_exports.Literal("customer_report")
65884
+ })
65885
+ ),
65886
+ limitations: Schema_exports.Array(Schema_exports.String)
65887
+ });
65888
+ var Rating = Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 0, maximum: 3 }));
65889
+ var Ratings = Schema_exports.Struct({
65890
+ demand_signal: Rating,
65891
+ competition_room: Rating,
65892
+ differentiation_evidence: Rating,
65893
+ overall_opportunity: Rating
65894
+ });
65895
+ var AmazonOpportunityRequest = Schema_exports.Struct({
65896
+ analysis: Schema_exports.Literal("opportunity"),
65897
+ country: NonEmpty,
65898
+ candidate: NonEmpty,
65899
+ requested_stage: Schema_exports.Literals(["stop", "investigate", "insufficient", "launch_case"]),
65900
+ ratings: Schema_exports.NullOr(Ratings),
65901
+ evidence: Schema_exports.Struct({
65902
+ demand_sources: Schema_exports.Array(NonEmpty),
65903
+ independent_demand: Schema_exports.NullOr(Schema_exports.Boolean),
65904
+ comparable_asins: Schema_exports.Array(Schema_exports.String.check(Schema_exports.isPattern(/^[A-Z0-9]{10}$/))),
65905
+ comparable_offer_gap: Schema_exports.NullOr(Schema_exports.Boolean),
65906
+ pain_sources: Schema_exports.Array(NonEmpty),
65907
+ independent_pain_evidence: Schema_exports.NullOr(Schema_exports.Boolean),
65908
+ price_history: Schema_exports.Array(
65909
+ Schema_exports.Struct({
65910
+ asin: Schema_exports.String.check(Schema_exports.isPattern(/^[A-Z0-9]{10}$/)),
65911
+ country: NonEmpty,
65912
+ price_type: Schema_exports.Literals(["AMAZON", "NEW", "LISTPRICE"]),
65913
+ source: NonEmpty,
65914
+ series_verified: Schema_exports.NullOr(Schema_exports.Boolean)
65915
+ })
65916
+ ),
65917
+ solution_validated: Schema_exports.NullOr(Schema_exports.Boolean),
65918
+ category_requirements_checked: Schema_exports.NullOr(Schema_exports.Boolean)
65919
+ }),
65920
+ economics: Schema_exports.NullOr(AmazonEconomicsRequest),
65921
+ next_validation: NonEmpty
65922
+ });
65923
+ var AmazonOpportunityOutput = Schema_exports.Struct({
65924
+ candidate: Schema_exports.String,
65925
+ country: Schema_exports.String,
65926
+ requested_stage: AmazonOpportunityRequest.fields.requested_stage,
65927
+ decision_stage: AmazonOpportunityRequest.fields.requested_stage,
65928
+ assessment_method: Schema_exports.Literal("analyst_supplied_with_evidence_gates"),
65929
+ ratings_input: Schema_exports.NullOr(Ratings),
65930
+ ratings_applied: Schema_exports.NullOr(Ratings),
65931
+ evidence: AmazonOpportunityRequest.fields.evidence,
65932
+ economics: Schema_exports.NullOr(AmazonEconomicsOutput),
65933
+ missing_evidence: Schema_exports.Array(Schema_exports.String),
65934
+ limitations: Schema_exports.Array(Schema_exports.String),
65935
+ next_validation: Schema_exports.String
65936
+ });
65937
+ var AmazonAnalysisRequest = Schema_exports.Union([
65938
+ AmazonPriceAnalysisRequest,
65939
+ AmazonEconomicsRequest,
65940
+ AmazonReviewAnalysisRequest,
65941
+ AmazonOpportunityRequest
65942
+ ]);
65943
+ var AmazonAnalysisResult = Schema_exports.Struct({
65944
+ analysis: Schema_exports.Literals(["price_history", "economics", "reviews", "opportunity"]),
65945
+ result_status: Schema_exports.Literals(["success", "no_result", "pending", "error"]),
65946
+ output: Schema_exports.NullOr(
65947
+ Schema_exports.Union([
65948
+ AmazonPriceAnalysisOutput,
65949
+ AmazonEconomicsOutput,
65950
+ AmazonReviewAnalysisOutput,
65951
+ AmazonOpportunityOutput
65952
+ ])
65953
+ ),
65954
+ charge_usd: Schema_exports.Literal("0.00"),
65955
+ source_charge_usd: Schema_exports.NullOr(UsdAmount),
65956
+ request_charge: solutionResultFields.request_charge,
65957
+ runs: Schema_exports.Array(RunSummary),
65958
+ source_result_urls: Schema_exports.Array(Schema_exports.String),
65959
+ error: solutionResultFields.error
65960
+ }).annotate({ identifier: "AmazonAnalysisResult" });
65961
+
65962
+ // ../../packages/contract/src/solutions-amazon-research.ts
65963
+ var AMAZON_ACTIONS = [
65964
+ "search",
65965
+ "product",
65966
+ "keywords",
65967
+ "keyword_volume",
65968
+ "reviews",
65969
+ "price_history",
65970
+ "offers",
65971
+ "merchant_search",
65972
+ "merchant_page"
65973
+ ];
65974
+ var AMAZON_PROVIDERS = ["serpapi", "dataforseo", "apify", "keepa", "serper"];
65975
+ var S3 = Schema_exports.NullOr(Schema_exports.String);
65976
+ var N2 = Schema_exports.NullOr(Schema_exports.Number);
65977
+ var I2 = Schema_exports.NullOr(Schema_exports.Int);
65978
+ var B2 = Schema_exports.NullOr(Schema_exports.Boolean);
65979
+ var AmazonProduct = Schema_exports.Struct({
65980
+ asin: S3,
65981
+ title: S3,
65982
+ url: S3,
65983
+ brand: S3,
65984
+ image_url: S3,
65985
+ price: N2,
65986
+ price_text: S3,
65987
+ currency: S3,
65988
+ rating: N2,
65989
+ reviews: I2.annotate({
65990
+ description: "Provider-reported displayed review total; may aggregate variants. Not the collected review sample size."
65991
+ }),
65992
+ position: I2,
65993
+ sponsored: B2,
65994
+ bought_past_month_text: S3,
65995
+ stock_text: S3,
65996
+ condition_text: S3,
65997
+ price_basis: Schema_exports.Literal("displayed_listing_price"),
65998
+ variants: Schema_exports.Array(Schema_exports.Struct({ asin: S3, label: S3, selected: B2 })),
65999
+ attributes: Schema_exports.Array(Schema_exports.Struct({ name: S3, value: S3 }))
66000
+ });
66001
+ var AmazonSearchOutput = Schema_exports.Struct({
66002
+ items: Schema_exports.Array(AmazonProduct),
66003
+ amazon_domain: S3,
66004
+ total_matches: I2,
66005
+ next_page: I2
66006
+ });
66007
+ var AmazonProductOutput = Schema_exports.Struct({
66008
+ product: AmazonProduct,
66009
+ amazon_domain: S3,
66010
+ purchase_options: Schema_exports.Array(
66011
+ Schema_exports.Struct({ condition: S3, price: N2, price_text: S3, stock_text: S3, seller_text: S3 })
66012
+ )
66013
+ });
66014
+ var AmazonKeywordsOutput = Schema_exports.Struct({
66015
+ mode: Schema_exports.Literals(["related", "exact"]),
66016
+ location_code: I2,
66017
+ language: S3,
66018
+ items: Schema_exports.Array(
66019
+ Schema_exports.Struct({
66020
+ keyword: S3,
66021
+ dataforseo_search_volume: I2,
66022
+ updated_at: S3
66023
+ })
66024
+ ),
66025
+ total_matches: I2,
66026
+ next_offset: I2
66027
+ }).annotate({
66028
+ description: "DataForSEO's estimated term-level Amazon search counts, not sales. Overlapping terms must not be summed into market size."
66029
+ });
66030
+ var AmazonReviewsOutput = Schema_exports.Struct({
66031
+ asin: S3,
66032
+ amazon_domain: S3,
66033
+ items: Schema_exports.Array(
66034
+ Schema_exports.Struct({
66035
+ id: S3,
66036
+ url: S3,
66037
+ asin: S3,
66038
+ title: S3,
66039
+ text: S3,
66040
+ rating: N2,
66041
+ published_at: S3,
66042
+ date_text: S3,
66043
+ verified_purchase: B2,
66044
+ vine: B2,
66045
+ language: S3,
66046
+ helpful_votes: I2,
66047
+ variation_asin: S3,
66048
+ variant_attributes: Schema_exports.Array(Schema_exports.String)
66049
+ })
66050
+ ),
66051
+ sample_kind: Schema_exports.Literals(["recent_page", "filtered_pages"]),
66052
+ sampling: Schema_exports.Struct({
66053
+ requested_pages: I2,
66054
+ observed_pages: Schema_exports.Array(Schema_exports.Int),
66055
+ sort: S3,
66056
+ rating_filter: S3,
66057
+ keyword_filter: S3,
66058
+ reviewer_type: S3,
66059
+ representative: Schema_exports.Literal("not_established")
66060
+ }),
66061
+ next_cursor: Schema_exports.Null
66062
+ }).annotate({
66063
+ description: "Budget-bounded pages with optional rating/keyword/verified-purchase filters. Observed pages are reported separately from requested pages. No representative-population claim. Review allegations remain unverified."
66064
+ });
66065
+ var AmazonPriceHistoryOutput = Schema_exports.Struct({
66066
+ updated_at: S3,
66067
+ asin: S3,
66068
+ title: S3,
66069
+ amazon_domain: S3,
66070
+ currency: S3,
66071
+ series: Schema_exports.Array(
66072
+ Schema_exports.Struct({
66073
+ price_type: Schema_exports.Literals(["AMAZON", "NEW", "LISTPRICE"]),
66074
+ points: Schema_exports.Array(
66075
+ Schema_exports.Struct({ observed_at: Schema_exports.String, price: N2, available: Schema_exports.Boolean })
66076
+ )
66077
+ })
66078
+ )
66079
+ }).annotate({
66080
+ description: "Keepa's separate price series. Unavailable observations have price=null. NEW changed definition on 2026-02-23; do not join baselines across that date. Historical observations are not checkout quotes."
66081
+ });
66082
+ var AmazonOffersOutput = Schema_exports.Struct({
66083
+ asin: S3,
66084
+ title: S3,
66085
+ amazon_domain: S3,
66086
+ currency: S3,
66087
+ updated_at: S3,
66088
+ refresh_success: B2,
66089
+ parent_asin: S3,
66090
+ number_of_items: I2,
66091
+ package_quantity: I2,
66092
+ size: S3,
66093
+ color: S3,
66094
+ material: S3,
66095
+ fee_context: Schema_exports.Struct({ fulfillment_fee: N2, updated_at: S3, referral_fee_percent: N2 }),
66096
+ items: Schema_exports.Array(
66097
+ Schema_exports.Struct({
66098
+ seller_id: S3,
66099
+ condition_code: I2,
66100
+ condition_text: S3,
66101
+ is_amazon: B2,
66102
+ fulfilled_by_amazon: B2,
66103
+ last_seen_at: S3,
66104
+ price_observed_at: S3,
66105
+ price: N2,
66106
+ shipping: N2,
66107
+ landed_price: N2
66108
+ })
66109
+ )
66110
+ }).annotate({
66111
+ description: "Keepa's observed live-offer snapshot for this exact ASIN. Numeric condition codes retain Keepa meaning; last-seen and price-change times differ. Historical cached observations are not a verified checkout quote. Competitor fees are context, not the candidate SKU's cost."
66112
+ });
66113
+ var AmazonResearchRequest = Schema_exports.Struct({
66114
+ action: Schema_exports.Literals(AMAZON_ACTIONS),
66115
+ country: NonEmpty.annotate({
66116
+ description: "Explicit Amazon marketplace country. Supported: us, gb, de, fr, it, es, ca, jp, in, au. Related keywords supports us/en only; exact keyword_volume has its own exposed locale/language pairs."
66117
+ }),
66118
+ provider: providerField(AMAZON_PROVIDERS),
66119
+ max_charge_usd: Schema_exports.optional(UsdAmount.check(Schema_exports.isMaxLength(20))),
66120
+ review_pages: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: 10 }))),
66121
+ review_rating: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: 5 }))),
66122
+ review_sort: Schema_exports.optional(Schema_exports.Literals(["recent", "helpful"])),
66123
+ verified_only: Schema_exports.optional(Schema_exports.Boolean),
66124
+ review_keyword: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(200))),
66125
+ url: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(2048), Schema_exports.isPattern(/^https?:\/\//))),
66126
+ query: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(200))),
66127
+ keywords: Schema_exports.optional(
66128
+ Schema_exports.Array(NonEmpty).check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(1e3))
66129
+ ),
66130
+ asin: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isPattern(/^[A-Z0-9]{10}$/))),
66131
+ page: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: 20 }))),
66132
+ limit: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: 100 }))),
66133
+ offset: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 0, maximum: 1e4 }))),
66134
+ language: Schema_exports.optional(NonEmpty),
66135
+ days: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(1))),
66136
+ task_id: commonFields.task_id,
66137
+ metadata: commonFields.metadata
66138
+ }).annotate({
66139
+ description: "merchant_search: query, optional language; merchant_page: exact public url; search: query and optional page; product/reviews/offers: exact asin; reviews supports bounded review_pages, review_rating, review_sort, verified_only and review_keyword; keywords: query, optional language/limit/offset (us/en only); keyword_volume: explicit keywords and language; max_charge_usd rejects requests exceeding the caller cap before creating a Run; price_history: exact asin and optional days (default 180). Unsupported fields are rejected before charging. No listing edits, fee estimates or recurring monitoring."
66140
+ });
66141
+ var AmazonResearchResult = Schema_exports.Struct({
66142
+ ...Run.fields,
66143
+ action: Schema_exports.Literals(AMAZON_ACTIONS),
66144
+ output: Schema_exports.NullOr(
66145
+ Schema_exports.Union([
66146
+ AmazonSearchOutput,
66147
+ AmazonProductOutput,
66148
+ AmazonKeywordsOutput,
66149
+ AmazonReviewsOutput,
66150
+ AmazonPriceHistoryOutput,
66151
+ AmazonOffersOutput,
66152
+ WebShoppingOutput,
66153
+ WebScrapeOutput
66154
+ ])
66155
+ ),
66156
+ result_status: Schema_exports.Literals(["success", "no_result", "error", "pending"]),
66157
+ ...solutionResultFields
66158
+ }).annotate({ identifier: "AmazonResearchResult" });
66159
+ var AmazonResearchResultQuery = SolutionResultQuery;
66160
+
65683
66161
  // ../../packages/contract/src/solutions-company-intelligence.ts
65684
66162
  var COMPANY_INTELLIGENCE_ACTIONS = [
65685
66163
  "search",
@@ -65992,6 +66470,131 @@ var CompanyIntelligenceRequest = Schema_exports.Struct({
65992
66470
  ...commonFields
65993
66471
  });
65994
66472
 
66473
+ // ../../packages/contract/src/solutions-creator-research.ts
66474
+ var CREATOR_ACTIONS = ["search", "content", "profile", "contact", "shop"];
66475
+ var CREATOR_PLATFORMS = [
66476
+ "tiktok",
66477
+ "threads",
66478
+ "instagram",
66479
+ "youtube",
66480
+ "x",
66481
+ "twitch",
66482
+ "onlyfans"
66483
+ ];
66484
+ var CREATOR_PROVIDERS = [
66485
+ "scrapecreators",
66486
+ "tikhub",
66487
+ "influencersclub",
66488
+ "kalodata",
66489
+ "apify"
66490
+ ];
66491
+ var S4 = Schema_exports.NullOr(Schema_exports.String);
66492
+ var N3 = Schema_exports.NullOr(Schema_exports.Number);
66493
+ var I3 = Schema_exports.NullOr(Schema_exports.Int);
66494
+ var B3 = Schema_exports.NullOr(Schema_exports.Boolean);
66495
+ var CreatorContact = Schema_exports.Struct({
66496
+ type: S4,
66497
+ value: S4,
66498
+ usage: S4.annotate({
66499
+ description: "Provider-reported contact type, such as business or personal. Null when unknown; an email is not assumed to be a business email."
66500
+ }),
66501
+ verified: B3.annotate({
66502
+ description: "Only the Provider's explicit verification result; null when not reported."
66503
+ }),
66504
+ source_url: S4
66505
+ });
66506
+ var CreatorAccount = Schema_exports.Struct({
66507
+ platform: S4,
66508
+ id: S4,
66509
+ handle: S4,
66510
+ name: S4,
66511
+ url: S4,
66512
+ bio: S4,
66513
+ followers: I3,
66514
+ following: I3,
66515
+ posts: I3,
66516
+ verified: B3,
66517
+ influencersclub_engagement_percent: N3.annotate({
66518
+ description: "Influencers.club's engagement_percent, unchanged. Its sampling and formula can differ from a rate calculated from recent posts."
66519
+ })
66520
+ });
66521
+ var CreatorMatch = Schema_exports.Struct({
66522
+ ...CreatorAccount.fields,
66523
+ matching_posts: Schema_exports.Array(
66524
+ Schema_exports.Struct({ id: S4, url: S4, title: S4, text: S4, published_at: S4 })
66525
+ )
66526
+ });
66527
+ var CreatorSearchOutput = Schema_exports.Struct({
66528
+ items: Schema_exports.Array(CreatorMatch),
66529
+ next_cursor: S4,
66530
+ has_more: B3,
66531
+ total_matches: I3.annotate({
66532
+ description: "Provider-reported total matching accounts; null for content discovery. Never the number of sampled authors."
66533
+ })
66534
+ });
66535
+ var CreatorProfileOutput = Schema_exports.Struct({
66536
+ ...CreatorAccount.fields,
66537
+ profiles: Schema_exports.Array(CreatorAccount),
66538
+ contacts: Schema_exports.Array(CreatorContact)
66539
+ });
66540
+ var CreatorContactOutput = Schema_exports.Struct({ contacts: Schema_exports.Array(CreatorContact) });
66541
+ var CreatorShopOutput = Schema_exports.Struct({
66542
+ creator: CreatorAccount,
66543
+ kalodata_creator_id: S4,
66544
+ region: S4,
66545
+ currency: S4,
66546
+ date_range: S4,
66547
+ kalodata_revenue: N3,
66548
+ kalodata_video_revenue: N3,
66549
+ kalodata_live_revenue: N3,
66550
+ kalodata_sales: N3,
66551
+ kalodata_video_views: N3,
66552
+ kalodata_live_views: N3,
66553
+ contacts: Schema_exports.Array(CreatorContact)
66554
+ }).annotate({
66555
+ description: "Kalodata's estimates, in the returned currency and date range. No currency conversion or price estimate is applied."
66556
+ });
66557
+ var CreatorResearchRequest = Schema_exports.Struct({
66558
+ action: Schema_exports.Literals(CREATOR_ACTIONS),
66559
+ platform: Schema_exports.Literals(CREATOR_PLATFORMS),
66560
+ provider: providerField(CREATOR_PROVIDERS),
66561
+ query: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(500))),
66562
+ handle: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(2048))),
66563
+ cursor: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(4096))),
66564
+ require_email: Schema_exports.optional(Schema_exports.Boolean).annotate({
66565
+ description: "profile/contact via influencersclub only: true maps to email_required=must_have, false to preferred. Other Providers reject this filter."
66566
+ }),
66567
+ creator_id: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(100))).annotate({
66568
+ description: "shop only: Kalodata creator_id. Do not assume another platform's user id is interchangeable."
66569
+ }),
66570
+ region: Schema_exports.optional(NonEmpty),
66571
+ language: Schema_exports.optional(NonEmpty),
66572
+ currency: Schema_exports.optional(NonEmpty),
66573
+ date_range: Schema_exports.optional(NonEmpty),
66574
+ category_ids: Schema_exports.optional(Schema_exports.Array(Schema_exports.Int)),
66575
+ shop_id: Schema_exports.optional(NonEmpty),
66576
+ need_extra: Schema_exports.optional(Schema_exports.Boolean),
66577
+ task_id: commonFields.task_id,
66578
+ metadata: commonFields.metadata
66579
+ }).annotate({
66580
+ description: "search: TikTok/Threads accounts by query; content: Instagram/YouTube posts by query, grouped by author within one page; profile: influencersclub enrichment by handle; contact: handle to contact details; shop: TikTok Shop detail by Kalodata creator_id, region, language, currency and date_range. Unsupported filters are rejected before a Run. Follower and campaign-budget screening happens after discovery; these are not search filters."
66581
+ });
66582
+ var CreatorResearchResult = Schema_exports.Struct({
66583
+ ...Run.fields,
66584
+ action: Schema_exports.Literals(CREATOR_ACTIONS),
66585
+ output: Schema_exports.NullOr(
66586
+ Schema_exports.Union([
66587
+ CreatorSearchOutput,
66588
+ CreatorProfileOutput,
66589
+ CreatorContactOutput,
66590
+ CreatorShopOutput
66591
+ ])
66592
+ ),
66593
+ result_status: Schema_exports.Literals(["success", "no_result", "error", "pending"]),
66594
+ ...solutionResultFields
66595
+ }).annotate({ identifier: "CreatorResearchResult" });
66596
+ var CreatorResearchResultQuery = SolutionResultQuery;
66597
+
65995
66598
  // ../../packages/contract/src/solutions-market-data.ts
65996
66599
  var MARKET_DATA_ACTIONS = [
65997
66600
  "property_value",
@@ -66428,9 +67031,19 @@ var SOCIAL_PLATFORMS = [
66428
67031
  "youtube",
66429
67032
  "tiktok",
66430
67033
  "instagram",
66431
- "linkedin"
67034
+ "linkedin",
67035
+ "facebook",
67036
+ "threads"
67037
+ ];
67038
+ var SOCIAL_MODES = [
67039
+ "search",
67040
+ "profile",
67041
+ "feed",
67042
+ "post",
67043
+ "find",
67044
+ "comments",
67045
+ "trending"
66432
67046
  ];
66433
- var SOCIAL_MODES = ["search", "profile", "feed", "post", "find"];
66434
67047
  var SOCIAL_RESEARCH_PROVIDERS = ["scrapecreators", "apify", "tikhub", "pdl"];
66435
67048
  var SoS = Schema_exports.NullOr(Schema_exports.String);
66436
67049
  var SoI = Schema_exports.NullOr(Schema_exports.Int);
@@ -66459,7 +67072,7 @@ var socialPost = {
66459
67072
  comments: SoI,
66460
67073
  shares: d3(
66461
67074
  SoI,
66462
- "X: retweets. TikTok: share count (share-sheet sends, not reposts). LinkedIn: reposts. Null on Reddit, YouTube and Instagram."
67075
+ "X: retweets. TikTok: share count (share-sheet sends, not reposts). LinkedIn and Threads: reposts. Null on Reddit, YouTube and Instagram."
66463
67076
  ),
66464
67077
  views: d3(
66465
67078
  SoI,
@@ -66477,7 +67090,10 @@ var SocialProfileOutput = Schema_exports.Struct({
66477
67090
  SoS,
66478
67091
  "The account's own website: LinkedIn company website, X profile link (expanded, never t.co); null elsewhere."
66479
67092
  ),
66480
- followers: d3(SoI, "Followers; Reddit: subreddit subscribers; YouTube: subscribers."),
67093
+ followers: d3(
67094
+ SoI,
67095
+ "Followers; Reddit: subreddit subscribers or user-profile followers; YouTube: subscribers."
67096
+ ),
66481
67097
  following: d3(SoI, "Accounts this account follows. Null on Reddit, YouTube and LinkedIn."),
66482
67098
  posts: SoI,
66483
67099
  verified: Schema_exports.NullOr(Schema_exports.Boolean)
@@ -66489,7 +67105,7 @@ var SocialProfilesOutput = Schema_exports.Struct({
66489
67105
  Schema_exports.Struct({
66490
67106
  platform: d3(
66491
67107
  SoS,
66492
- "Lower-case network name. The six social_research platforms use their request names (twitter is x); other networks (facebook, github, \u2026) pass through."
67108
+ "Lower-case network name. The eight social_research platforms use their request names (twitter is x); other networks (facebook, github, \u2026) pass through."
66493
67109
  ),
66494
67110
  url: SoS,
66495
67111
  handle: d3(
@@ -66508,12 +67124,57 @@ var SocialProfilesOutput = Schema_exports.Struct({
66508
67124
  "People Data Labs' 1\u201310 score for how well the person record matches the input; it covers the whole person, not one profile. linkedin.find only; null elsewhere."
66509
67125
  )
66510
67126
  });
67127
+ var SocialCommentOutput = Schema_exports.Struct({
67128
+ id: SoS,
67129
+ url: SoS,
67130
+ text: SoS,
67131
+ author: SoS,
67132
+ author_url: SoS,
67133
+ published_at: d3(SoS, "Exact ISO 8601 UTC time; relative ages are not converted to dates."),
67134
+ likes: SoI,
67135
+ replies: SoI,
67136
+ parent_comment_id: SoS,
67137
+ post_id: SoS,
67138
+ post_url: SoS
67139
+ });
67140
+ var SocialCommentsOutput = Schema_exports.Struct({ items: Schema_exports.Array(SocialCommentOutput) });
67141
+ var SocialTrendingOutput = Schema_exports.Struct({
67142
+ items: Schema_exports.Array(
67143
+ Schema_exports.Struct({
67144
+ kind: Schema_exports.Literals(["topic", "hashtag", "video"]),
67145
+ title: SoS,
67146
+ query: SoS,
67147
+ url: SoS,
67148
+ position: SoI,
67149
+ source_label: d3(
67150
+ SoS,
67151
+ "Provider-reported trend label, preserved verbatim (for example #17 hyped). Not an overall platform rank."
67152
+ ),
67153
+ posts: d3(SoI, "Provider-reported post count; not the number of sampled posts."),
67154
+ views: SoI,
67155
+ post: Schema_exports.NullOr(SocialPostOutput)
67156
+ })
67157
+ )
67158
+ });
67159
+ var SocialPagination = Schema_exports.Struct({
67160
+ next_cursor: d3(
67161
+ SoS,
67162
+ "Opaque next-page token. Pass it as cursor with the same platform, mode, provider and search parameters."
67163
+ ),
67164
+ has_more: Schema_exports.NullOr(Schema_exports.Boolean),
67165
+ total_matches: d3(
67166
+ SoI,
67167
+ "Provider-reported match count, never the number of items in this page. Null when unavailable."
67168
+ )
67169
+ });
66511
67170
  var SOCIAL_RESEARCH_OUTPUT_FIELDS = {
66512
67171
  profile: "platform, handle, name, url, bio, headline, website, followers, following, posts, verified",
66513
67172
  search: "items[]: id, url, title, text, author, author_url, published_at, likes, comments, shares, views",
66514
67173
  feed: "items[]: same post fields as search",
66515
67174
  post: "id, url, title, text, author, author_url, published_at, likes, comments, shares, views",
66516
- find: "profiles[]: platform, url, handle, scrapecreators_confidence, followers (Reddit: matching subreddits); pdl_likelihood"
67175
+ find: "profiles[]: platform, url, handle, scrapecreators_confidence, followers (Reddit: matching subreddits); pdl_likelihood",
67176
+ comments: "items[]: id, url, text, author, author_url, published_at, likes, replies, parent_comment_id, post_id, post_url",
67177
+ trending: "items[]: kind (topic, hashtag or video), title, query, url, position, source_label, posts, views, post (YouTube video detail; null for topics)"
66517
67178
  };
66518
67179
  var SocialResearchResult = Schema_exports.Struct({
66519
67180
  ...Run.fields,
@@ -66521,7 +67182,14 @@ var SocialResearchResult = Schema_exports.Struct({
66521
67182
  description: "`<platform>.<mode>`; a LinkedIn company page in profile mode is linkedin.company."
66522
67183
  }),
66523
67184
  output: Schema_exports.NullOr(
66524
- Schema_exports.Union([SocialProfileOutput, SocialPostsOutput, SocialPostOutput, SocialProfilesOutput])
67185
+ Schema_exports.Union([
67186
+ SocialProfileOutput,
67187
+ SocialPostsOutput,
67188
+ SocialPostOutput,
67189
+ SocialProfilesOutput,
67190
+ SocialCommentsOutput,
67191
+ SocialTrendingOutput
67192
+ ])
66525
67193
  ).annotate({
66526
67194
  description: `Normalized fields per mode, shared by every platform. The Provider's native output is not repeated here; it stays on the Run (GET /v1/runs/:id). Values a platform or Provider does not report are null.
66527
67195
 
@@ -66529,6 +67197,7 @@ ${Object.entries(
66529
67197
  SOCIAL_RESEARCH_OUTPUT_FIELDS
66530
67198
  ).map(([mode, fields]) => `- ${mode}: ${fields}`).join("\n")}`
66531
67199
  }),
67200
+ pagination: Schema_exports.NullOr(SocialPagination),
66532
67201
  result_status: Schema_exports.Literals(["success", "no_result", "error", "pending"]).annotate({
66533
67202
  description: "Business delivery status, independent of the final Run lifecycle in status. no_result is an empty but valid answer; error means the Provider output could not be delivered."
66534
67203
  }),
@@ -66539,7 +67208,7 @@ var SocialResearchRequest = Schema_exports.Struct({
66539
67208
  platform: Schema_exports.Literals(SOCIAL_PLATFORMS),
66540
67209
  mode: Schema_exports.optional(
66541
67210
  Schema_exports.Literals(SOCIAL_MODES).annotate({
66542
- description: "Default: search. Every platform supports each mode.\n\n- search: posts matching query.\n- profile: account details from handle (Reddit: subreddit). For LinkedIn, supply a person or company url.\n- feed: recent posts or videos from handle. For LinkedIn, supply a company url.\n- post: one post or video from url.\n- find: other social profiles from handle. For LinkedIn, supply a person's profile url; for Reddit, supply query to find subreddits."
67211
+ description: "Default: search. search/profile/feed/post/comments support eight platforms. find supports the original six platforms. trending supports tiktok/youtube/x/reddit only.\n\n- search: posts matching query.\n- profile: account details from handle (Reddit: subreddit). For LinkedIn, supply a person or company url.\n- feed: recent posts or videos from handle. For LinkedIn, supply a company or personal profile url. Facebook requires url.\n- post: one post or video from url.\n- find: other social profiles from handle. For LinkedIn, supply a person's profile url; for Reddit, supply query to find subreddits.\n- comments: comments under a post url (X also accepts post_id; Threads returns a public preview without pagination).\n- trending: current topics on TikTok, X and Reddit; YouTube defaults to Apify ordinary trending videos, including Hype-labelled videos; select scrapecreators for Shorts. Neither is an official topic ranking."
66543
67212
  })
66544
67213
  ),
66545
67214
  provider: providerField(SOCIAL_RESEARCH_PROVIDERS),
@@ -66550,11 +67219,418 @@ var SocialResearchRequest = Schema_exports.Struct({
66550
67219
  })
66551
67220
  ),
66552
67221
  url: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(2048))),
66553
- // 没有 limit:社交端点按游标翻页,没有一个收行数;收下又不读是撒谎。
66554
- // 不用 commonFields(没有 limit),task_id 与 metadata 单独加。
67222
+ trend_type: Schema_exports.optional(
67223
+ Schema_exports.Literals(["topics", "hashtags"]).annotate({
67224
+ description: "TikTok only. Default topics returns current search words; hashtags returns Creative Center rankings, with region and a time_range in days (7, 30 or 90), limit and cursor."
67225
+ })
67226
+ ),
67227
+ search_by: Schema_exports.optional(
67228
+ Schema_exports.Literals(["keyword", "hashtag", "music"]).annotate({
67229
+ description: "Default keyword. TikTok also supports hashtag/music; Instagram supports hashtag. Music requires music_id; hashtags require hashtag."
67230
+ })
67231
+ ),
67232
+ hashtag: Schema_exports.optional(NonEmpty),
67233
+ music_id: Schema_exports.optional(NonEmpty),
67234
+ subreddit: Schema_exports.optional(NonEmpty),
67235
+ account_type: Schema_exports.optional(
67236
+ Schema_exports.Literals(["user", "subreddit"]).annotate({
67237
+ description: "Reddit only. Default subreddit preserves the existing profile/feed behavior; user reads a Reddit member."
67238
+ })
67239
+ ),
67240
+ post_id: Schema_exports.optional(NonEmpty),
67241
+ cursor: Schema_exports.optional(
67242
+ NonEmpty.annotate({
67243
+ description: "Opaque token from pagination.next_cursor. Do not invent tokens. Not supported by every Endpoint."
67244
+ })
67245
+ ),
67246
+ sort: Schema_exports.optional(
67247
+ NonEmpty.annotate({
67248
+ description: "Provider-native sort value for this platform and mode; unsupported values are rejected by the target Endpoint."
67249
+ })
67250
+ ),
67251
+ time_range: Schema_exports.optional(
67252
+ NonEmpty.annotate({
67253
+ description: "Provider-native relative date filter; not a promise of complete historical coverage."
67254
+ })
67255
+ ),
67256
+ start_date: Schema_exports.optional(NonEmpty),
67257
+ end_date: Schema_exports.optional(NonEmpty),
67258
+ region: Schema_exports.optional(NonEmpty),
67259
+ duration: Schema_exports.optional(NonEmpty),
67260
+ search_type: Schema_exports.optional(NonEmpty),
67261
+ limit: Schema_exports.optional(
67262
+ Schema_exports.Int.check(Schema_exports.isGreaterThan(0)).annotate({
67263
+ description: "Only routes whose Provider accepts a result count. YouTube trending via Apify defaults to 10. Page-sized routes reject this field instead of silently truncating paid results."
67264
+ })
67265
+ ),
67266
+ max_charge_usd: Schema_exports.optional(
67267
+ UsdAmount.annotate({
67268
+ description: "Apify routes only: maximum Charge in USD for this Run, translated to maxTotalChargeUsd."
67269
+ })
67270
+ ),
67271
+ // task_id 与 metadata 不随 Provider 传递。
67272
+ task_id: commonFields.task_id,
67273
+ metadata: commonFields.metadata
67274
+ });
67275
+
67276
+ // ../../packages/contract/src/solutions-stock-research.ts
67277
+ var STOCK_ACTIONS = [
67278
+ "company",
67279
+ "income",
67280
+ "balance_sheet",
67281
+ "cash_flow",
67282
+ "segments",
67283
+ "metrics",
67284
+ "earnings",
67285
+ "guidance",
67286
+ "prices",
67287
+ "news",
67288
+ "screen",
67289
+ "macro"
67290
+ ];
67291
+ var S5 = Schema_exports.NullOr(Schema_exports.String);
67292
+ var N4 = Schema_exports.NullOr(Schema_exports.Finite);
67293
+ var B4 = Schema_exports.NullOr(Schema_exports.Boolean);
67294
+ var date7 = NonEmpty.check(Schema_exports.isPattern(/^\d{4}-\d{2}-\d{2}$/));
67295
+ var ticker = NonEmpty.check(Schema_exports.isPattern(/^[A-Za-z0-9.-]{1,12}$/));
67296
+ var StockFilter = Schema_exports.Struct({
67297
+ field: NonEmpty.check(Schema_exports.isMaxLength(80)),
67298
+ operator: Schema_exports.Literals(["gt", "lt", "gte", "lte", "eq", "in"]),
67299
+ value: Schema_exports.Union([
67300
+ Schema_exports.Finite,
67301
+ NonEmpty.check(Schema_exports.isMaxLength(200)),
67302
+ Schema_exports.Array(NonEmpty.check(Schema_exports.isMaxLength(200))).check(Schema_exports.isMaxLength(100))
67303
+ ])
67304
+ });
67305
+ var StockResearchRequest = Schema_exports.Struct({
67306
+ action: Schema_exports.Literals(STOCK_ACTIONS),
67307
+ provider: providerField(["financialdatasets"]),
67308
+ ticker: Schema_exports.optional(ticker),
67309
+ cik: Schema_exports.optional(NonEmpty.check(Schema_exports.isPattern(/^\d{1,10}$/))),
67310
+ period: Schema_exports.optional(Schema_exports.Literals(["annual", "quarterly", "ttm"])),
67311
+ mode: Schema_exports.optional(Schema_exports.Literals(["snapshot", "history"])).annotate({
67312
+ description: "metrics/prices/macro only; defaults to snapshot. History requires the action-specific period or date inputs."
67313
+ }),
67314
+ statement: Schema_exports.optional(Schema_exports.Literals(["all", "income", "balance_sheet", "cash_flow"])),
67315
+ macro: Schema_exports.optional(
67316
+ Schema_exports.Literals(["interest_rates", "inflation", "yield_curve", "banks", "inflation_series"])
67317
+ ),
67318
+ bank: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(200))),
67319
+ series: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(200))),
67320
+ limit: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: 100 }))),
67321
+ cursor: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(2e3))),
67322
+ interval: Schema_exports.optional(Schema_exports.Literals(["day", "week", "month", "year"])),
67323
+ start_date: Schema_exports.optional(date7),
67324
+ end_date: Schema_exports.optional(date7),
67325
+ metric_name: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(200))),
67326
+ filters: Schema_exports.optional(
67327
+ Schema_exports.Array(StockFilter).check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(20))
67328
+ ),
67329
+ describe_filters: Schema_exports.optional(Schema_exports.Boolean).annotate({
67330
+ description: "screen only: true reads available fields, aliases, operators and company labels for free; filters and limit are then rejected."
67331
+ }),
67332
+ report_period: Schema_exports.optional(date7),
67333
+ report_period_gte: Schema_exports.optional(date7),
67334
+ report_period_lte: Schema_exports.optional(date7),
67335
+ report_period_gt: Schema_exports.optional(date7),
67336
+ report_period_lt: Schema_exports.optional(date7),
67337
+ filing_date: Schema_exports.optional(date7),
67338
+ filing_date_gte: Schema_exports.optional(date7),
67339
+ filing_date_lte: Schema_exports.optional(date7),
67340
+ filing_date_gt: Schema_exports.optional(date7),
67341
+ filing_date_lt: Schema_exports.optional(date7),
67342
+ max_charge_usd: Schema_exports.optional(UsdAmount),
66555
67343
  task_id: commonFields.task_id,
66556
67344
  metadata: commonFields.metadata
67345
+ }).annotate({
67346
+ parseOptions: { onExcessProperty: "error" },
67347
+ description: "One FinancialDatasets operation per request. Unused fields are rejected before charging. Empty data can still be charged. No currency conversion, estimated missing values or automatic pagination."
67348
+ });
67349
+ var StockPeriod = Schema_exports.Struct({
67350
+ ticker: S5,
67351
+ currency: S5,
67352
+ period: S5,
67353
+ fiscal_period: S5,
67354
+ report_date: S5,
67355
+ filing_date: S5,
67356
+ filed_at: S5,
67357
+ form_type: S5,
67358
+ filing_url: S5,
67359
+ accession_number: S5
67360
+ });
67361
+ var page = { next_cursor: S5, has_more: B4, pagination_supported: Schema_exports.Boolean };
67362
+ var StockCompany = Schema_exports.Struct({
67363
+ ticker: S5,
67364
+ cik: S5,
67365
+ name: S5,
67366
+ industry: S5,
67367
+ sector: S5,
67368
+ exchange: S5,
67369
+ location: S5,
67370
+ sic_code: S5,
67371
+ sic_sector: S5,
67372
+ sic_industry: S5,
67373
+ is_active: B4,
67374
+ sec_filings_url: S5,
67375
+ market_cap: N4,
67376
+ currency: S5
67377
+ });
67378
+ var StockIncome = Schema_exports.Struct({
67379
+ ...StockPeriod.fields,
67380
+ consolidated_income: N4,
67381
+ cost_of_revenue: N4,
67382
+ dividends_per_common_share: N4,
67383
+ earnings_per_share: N4,
67384
+ earnings_per_share_diluted: N4,
67385
+ ebit: N4,
67386
+ gross_profit: N4,
67387
+ income_tax_expense: N4,
67388
+ interest_expense: N4,
67389
+ net_income: N4,
67390
+ net_income_common_stock: N4,
67391
+ net_income_discontinued_operations: N4,
67392
+ net_income_non_controlling_interests: N4,
67393
+ nonoperating_income_expense: N4,
67394
+ operating_expense: N4,
67395
+ operating_income: N4,
67396
+ preferred_dividends_impact: N4,
67397
+ research_and_development: N4,
67398
+ revenue: N4,
67399
+ selling_general_and_administrative_expenses: N4,
67400
+ weighted_average_shares: N4,
67401
+ weighted_average_shares_diluted: N4
67402
+ });
67403
+ var StockBalance = Schema_exports.Struct({
67404
+ ...StockPeriod.fields,
67405
+ accumulated_other_comprehensive_income: N4,
67406
+ cash_and_equivalents: N4,
67407
+ current_assets: N4,
67408
+ current_debt: N4,
67409
+ current_investments: N4,
67410
+ current_liabilities: N4,
67411
+ deferred_revenue: N4,
67412
+ deposit_liabilities: N4,
67413
+ goodwill_and_intangible_assets: N4,
67414
+ inventory: N4,
67415
+ investments: N4,
67416
+ non_current_assets: N4,
67417
+ non_current_debt: N4,
67418
+ non_current_investments: N4,
67419
+ non_current_liabilities: N4,
67420
+ outstanding_shares: N4,
67421
+ property_plant_and_equipment: N4,
67422
+ retained_earnings: N4,
67423
+ shareholders_equity: N4,
67424
+ tax_assets: N4,
67425
+ tax_liabilities: N4,
67426
+ total_assets: N4,
67427
+ total_debt: N4,
67428
+ total_liabilities: N4,
67429
+ trade_and_non_trade_payables: N4,
67430
+ trade_and_non_trade_receivables: N4
67431
+ });
67432
+ var StockCashFlow = Schema_exports.Struct({
67433
+ ...StockPeriod.fields,
67434
+ business_acquisitions_and_disposals: N4,
67435
+ capital_expenditure: N4,
67436
+ change_in_cash_and_equivalents: N4,
67437
+ depreciation_and_amortization: N4,
67438
+ dividends_and_other_cash_distributions: N4,
67439
+ effect_of_exchange_rate_changes: N4,
67440
+ ending_cash_balance: N4,
67441
+ free_cash_flow: N4,
67442
+ investment_acquisitions_and_disposals: N4,
67443
+ issuance_or_purchase_of_equity_shares: N4,
67444
+ issuance_or_repayment_of_debt_securities: N4,
67445
+ net_cash_flow_from_financing: N4,
67446
+ net_cash_flow_from_investing: N4,
67447
+ net_cash_flow_from_operations: N4,
67448
+ net_income: N4,
67449
+ property_plant_and_equipment: N4,
67450
+ share_based_compensation: N4
67451
+ });
67452
+ var StockMetrics = Schema_exports.Struct({
67453
+ ...StockPeriod.fields,
67454
+ asset_turnover: N4,
67455
+ book_value_growth: N4,
67456
+ book_value_per_share: N4,
67457
+ cash_ratio: N4,
67458
+ current_ratio: N4,
67459
+ days_sales_outstanding: N4,
67460
+ debt_to_assets: N4,
67461
+ debt_to_equity: N4,
67462
+ dividend_yield: N4,
67463
+ earnings_growth: N4,
67464
+ earnings_per_share: N4,
67465
+ earnings_per_share_growth: N4,
67466
+ ebitda_growth: N4,
67467
+ enterprise_value: N4,
67468
+ enterprise_value_to_ebitda_ratio: N4,
67469
+ enterprise_value_to_revenue_ratio: N4,
67470
+ free_cash_flow_growth: N4,
67471
+ free_cash_flow_per_share: N4,
67472
+ free_cash_flow_yield: N4,
67473
+ gross_margin: N4,
67474
+ interest_coverage: N4,
67475
+ inventory_turnover: N4,
67476
+ market_cap: N4,
67477
+ net_margin: N4,
67478
+ operating_cash_flow_ratio: N4,
67479
+ operating_cycle: N4,
67480
+ operating_income_growth: N4,
67481
+ operating_margin: N4,
67482
+ payout_ratio: N4,
67483
+ peg_ratio: N4,
67484
+ price_to_book_ratio: N4,
67485
+ price_to_earnings_ratio: N4,
67486
+ price_to_sales_ratio: N4,
67487
+ quick_ratio: N4,
67488
+ receivables_turnover: N4,
67489
+ return_on_assets: N4,
67490
+ return_on_equity: N4,
67491
+ return_on_invested_capital: N4,
67492
+ revenue_growth: N4,
67493
+ stock_price: N4,
67494
+ working_capital_turnover: N4
67495
+ });
67496
+ var StockSegment = Schema_exports.Struct({
67497
+ ...StockPeriod.fields,
67498
+ statement: S5,
67499
+ metric: S5,
67500
+ dimension: S5,
67501
+ label: S5,
67502
+ value: N4
67503
+ });
67504
+ var StockEarningsPeriod = Schema_exports.Struct({
67505
+ revenue: N4,
67506
+ estimated_revenue: N4,
67507
+ earnings_per_share: N4,
67508
+ estimated_earnings_per_share: N4,
67509
+ earnings_per_share_diluted: N4,
67510
+ eps_surprise: S5,
67511
+ eps_surprise_ratio: N4,
67512
+ revenue_surprise: S5,
67513
+ revenue_surprise_ratio: N4,
67514
+ gross_margin: N4,
67515
+ operating_margin: N4,
67516
+ net_margin: N4,
67517
+ net_income: N4,
67518
+ free_cash_flow: N4,
67519
+ revenue_growth_ratio: N4
67520
+ });
67521
+ var StockEarnings = Schema_exports.Struct({
67522
+ ...StockPeriod.fields,
67523
+ source_type: S5,
67524
+ filing_window: S5,
67525
+ quarterly: Schema_exports.NullOr(StockEarningsPeriod),
67526
+ annual: Schema_exports.NullOr(StockEarningsPeriod),
67527
+ ttm: Schema_exports.NullOr(StockEarningsPeriod)
67528
+ });
67529
+ var StockGuidance = Schema_exports.Struct({
67530
+ ticker: S5,
67531
+ metric_name: S5,
67532
+ period_text: S5,
67533
+ period_type: S5,
67534
+ report_date: S5,
67535
+ low: N4,
67536
+ high: N4,
67537
+ point_estimate: N4,
67538
+ prior_value: N4,
67539
+ unit: S5,
67540
+ currency: S5,
67541
+ change_direction: S5,
67542
+ source_url: S5,
67543
+ source_text: S5,
67544
+ raw_text: S5
67545
+ });
67546
+ var StockPrice = Schema_exports.Struct({
67547
+ ticker: S5,
67548
+ currency: S5,
67549
+ observed_at: S5,
67550
+ price_date: S5,
67551
+ time_text: S5,
67552
+ price: N4,
67553
+ open: N4,
67554
+ high: N4,
67555
+ low: N4,
67556
+ close: N4,
67557
+ volume: N4,
67558
+ day_change: N4,
67559
+ day_change_percent: N4
67560
+ });
67561
+ var StockNews = Schema_exports.Struct({ ticker: S5, title: S5, url: S5, source: S5, published_at: S5 });
67562
+ var StockScreenMatch = Schema_exports.Struct({
67563
+ ...StockPeriod.fields,
67564
+ sector: S5,
67565
+ industry: S5,
67566
+ metrics: Schema_exports.Array(
67567
+ Schema_exports.Struct({
67568
+ name: Schema_exports.String,
67569
+ value: Schema_exports.NullOr(Schema_exports.Union([Schema_exports.Finite, Schema_exports.String]))
67570
+ })
67571
+ )
66557
67572
  });
67573
+ var StockScreenFilters = Schema_exports.Struct({
67574
+ fields: Schema_exports.Array(
67575
+ Schema_exports.Struct({
67576
+ name: Schema_exports.String,
67577
+ group: Schema_exports.String,
67578
+ values: Schema_exports.Array(Schema_exports.String)
67579
+ })
67580
+ ),
67581
+ operators: Schema_exports.Array(Schema_exports.String),
67582
+ aliases: Schema_exports.Array(Schema_exports.Struct({ alias: Schema_exports.String, field: Schema_exports.String }))
67583
+ });
67584
+ var StockMacro = Schema_exports.Struct({
67585
+ observation_date: S5,
67586
+ bank: S5,
67587
+ name: S5,
67588
+ series: S5,
67589
+ value: N4,
67590
+ rate_percent: N4,
67591
+ change_1m_percent: N4,
67592
+ change_12m_percent: N4,
67593
+ tenor: S5,
67594
+ yield_percent: N4
67595
+ });
67596
+ var StockMacroOption = Schema_exports.Struct({
67597
+ id: S5,
67598
+ name: S5,
67599
+ description: S5,
67600
+ unit: S5,
67601
+ frequency: S5
67602
+ });
67603
+ var STOCK_OUTPUT_SCHEMAS = {
67604
+ company: StockCompany,
67605
+ income: Schema_exports.Struct({ items: Schema_exports.Array(StockIncome), ...page }),
67606
+ balance_sheet: Schema_exports.Struct({ items: Schema_exports.Array(StockBalance), ...page }),
67607
+ cash_flow: Schema_exports.Struct({ items: Schema_exports.Array(StockCashFlow), ...page }),
67608
+ segments: Schema_exports.Struct({ items: Schema_exports.Array(StockSegment), ...page }),
67609
+ metrics: Schema_exports.Struct({ items: Schema_exports.Array(StockMetrics), ...page }),
67610
+ earnings: Schema_exports.Struct({ items: Schema_exports.Array(StockEarnings), ...page }),
67611
+ guidance: Schema_exports.Struct({ items: Schema_exports.Array(StockGuidance), ...page }),
67612
+ prices: Schema_exports.Struct({ items: Schema_exports.Array(StockPrice), ...page }),
67613
+ news: Schema_exports.Struct({ items: Schema_exports.Array(StockNews), ...page }),
67614
+ screen: Schema_exports.Struct({ items: Schema_exports.Array(StockScreenMatch), ...page }),
67615
+ macro: Schema_exports.Struct({ items: Schema_exports.Array(StockMacro), ...page })
67616
+ };
67617
+ var StockResearchResult = Schema_exports.Struct({
67618
+ ...Run.fields,
67619
+ action: Schema_exports.Literals(STOCK_ACTIONS),
67620
+ output: Schema_exports.NullOr(
67621
+ Schema_exports.Union([
67622
+ ...Object.values(STOCK_OUTPUT_SCHEMAS),
67623
+ StockScreenFilters,
67624
+ Schema_exports.Struct({ items: Schema_exports.Array(StockMacroOption), ...page })
67625
+ ])
67626
+ ),
67627
+ result_status: Schema_exports.Literals(["success", "no_result", "error", "pending"]),
67628
+ ...solutionResultFields
67629
+ }).annotate({
67630
+ identifier: "StockResearchResult",
67631
+ description: "Financial amounts retain currency; ratios and growth are unchanged fractions (0.3 means 30%). Macro rates and price day_change_percent are percentages. Missing fields are null. Run completed_at is retrieval time, never a substitute for an observation date."
67632
+ });
67633
+ var StockResearchResultQuery = SolutionResultQuery;
66558
67634
 
66559
67635
  // ../../packages/contract/src/solutions.ts
66560
67636
  var SOLUTION_IDS = ["gtm"];
@@ -66565,6 +67641,9 @@ var GTM_CAPABILITIES = [
66565
67641
  "people_search",
66566
67642
  "seo_research",
66567
67643
  "social_research",
67644
+ "creator_research",
67645
+ "amazon_research",
67646
+ "stock_research",
66568
67647
  "market_data"
66569
67648
  ];
66570
67649
  var GtmCapability = Schema_exports.Literals(GTM_CAPABILITIES);
@@ -66601,6 +67680,27 @@ var MarketDataTerminal = MarketDataResponse.check(
66601
67680
  var MarketDataInFlight = MarketDataResponse.check(
66602
67681
  Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
66603
67682
  ).pipe(HttpApiSchema_exports.status(202));
67683
+ var CreatorResearchResponse = Schema_exports.Union([CreatorResearchResult]);
67684
+ var CreatorResearchTerminal = CreatorResearchResponse.check(
67685
+ Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
67686
+ ).pipe(HttpApiSchema_exports.status(200));
67687
+ var CreatorResearchInFlight = CreatorResearchResponse.check(
67688
+ Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
67689
+ ).pipe(HttpApiSchema_exports.status(202));
67690
+ var AmazonResearchResponse = Schema_exports.Union([AmazonResearchResult]);
67691
+ var AmazonResearchTerminal = AmazonResearchResponse.check(
67692
+ Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
67693
+ ).pipe(HttpApiSchema_exports.status(200));
67694
+ var AmazonResearchInFlight = AmazonResearchResponse.check(
67695
+ Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
67696
+ ).pipe(HttpApiSchema_exports.status(202));
67697
+ var StockResearchResponse = Schema_exports.Union([StockResearchResult]);
67698
+ var StockResearchTerminal = StockResearchResponse.check(
67699
+ Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
67700
+ ).pipe(HttpApiSchema_exports.status(200));
67701
+ var StockResearchInFlight = StockResearchResponse.check(
67702
+ Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
67703
+ ).pipe(HttpApiSchema_exports.status(202));
66604
67704
  var SocialResearchResponse = Schema_exports.Union([SocialResearchResult]);
66605
67705
  var SocialResearchTerminal = SocialResearchResponse.check(
66606
67706
  Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
@@ -66624,7 +67724,7 @@ var SeoResearchInFlight = SeoResearchResponse.check(
66624
67724
  ).pipe(HttpApiSchema_exports.status(202));
66625
67725
  var IdempotencyKeyHeaders = Schema_exports.Struct({
66626
67726
  "idempotency-key": Schema_exports.String.check(Schema_exports.isMinLength(1)).annotate({
66627
- description: "Generate a unique value for each intended execution (a UUID is recommended). Retry with the same key and execution parameters to retrieve the original Run without a second charge. Changing execution parameters with the same key returns 409; changing task_id or metadata does not update the original Run."
67727
+ description: "Generate a new unique value (prefer a random UUID) for each independent lookup, even with identical parameters on the same day. Retry the same intended execution with its original key and parameters to retrieve the original Run without another Charge. Changing execution parameters with the same key returns 409; changing task_id or metadata does not start a new Run. Existing opaque keys remain valid for recovery."
66628
67728
  })
66629
67729
  });
66630
67730
  var operation = (id2, summary, description) => OpenApi_exports.annotations({ identifier: id2, summary, description });
@@ -66836,7 +67936,7 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
66836
67936
  operation(
66837
67937
  "gtm-social-research",
66838
67938
  "Social research",
66839
- "Public social media data on Reddit, X, YouTube, TikTok, Instagram and LinkedIn: search posts, read an account, its recent posts or one post, and find the same account on other platforms. Choose a platform and a mode and supply a query, handle or url.\n\nEvery mode returns normalized output shared by all six platforms, with the last Run's id, provider and lifecycle status: profile gives one account (platform, handle, name, url, bio, headline, website, followers, following, posts, verified), search and feed give output.items[] of posts (id, url, title, text, author, author_url, published_at, likes, comments, shares, views), post gives one post with the same fields, find gives output.profiles[] (platform, url, handle, scrapecreators_confidence, followers; for Reddit the matching subreddits) plus pdl_likelihood. The Provider's native output is not repeated in output; it stays on the Run and is readable with GET /v1/runs/:id. A value a platform or Provider does not report is null.\n\nRead result_status separately from status: success, no_result, error or pending. An empty but valid answer is no_result and keeps the mode's shape (items or profiles is [], or every field is null). charge_usd is the total of this response's runs and is null until every listed Run settles. provider=auto selects the first eligible Provider and tries the next only on PROVIDER_ERROR, TIMED_OUT, or a 503 at admission; a named Provider never falls back. For QUEUED/RUNNING (HTTP 202, the Apify routes), poll the authenticated result_url on the API origin. Reuse the same Idempotency-Key and execution parameters for an intentional retry."
67939
+ "Public social media data on Reddit, X, YouTube, TikTok, Instagram, LinkedIn, Facebook and Threads: platform-specific searches, account profiles, feeds, post details and comments. Trending is available on TikTok, X and Reddit; YouTube defaults to Apify ordinary trending videos with Provider labels; select scrapecreators for Shorts. Threads comments are a public preview without pagination. find retains the original six platforms. Choose a platform and a mode and supply a query, handle or url.\n\nEvery mode returns normalized output shared across platforms, with the last Run's id, provider and lifecycle status: profile gives one account (platform, handle, name, url, bio, headline, website, followers, following, posts, verified), search and feed give output.items[] of posts (id, url, title, text, author, author_url, published_at, likes, comments, shares, views), post gives one post with the same fields, find gives output.profiles[] (platform, url, handle, scrapecreators_confidence, followers; for Reddit the matching subreddits) plus pdl_likelihood. comments gives output.items[] with id, url, text, author, author_url, published_at, likes, replies, parent_comment_id, post_id and post_url. trending gives items with kind, title, query, url, position, source_label, posts, views and optional post data. pagination reports next_cursor, has_more and total_matches; absent Provider values are null, never the sample count. Unsupported filters fail before execution instead of being silently ignored. The Provider's native output is not repeated in output; it stays on the Run and is readable with GET /v1/runs/:id. A value a platform or Provider does not report is null.\n\nRead result_status separately from status: success, no_result, error or pending. An empty but valid answer is no_result and keeps the mode's shape (items or profiles is [], or every field is null). charge_usd is the total of this response's runs and is null until every listed Run settles. provider=auto selects the first eligible Provider and tries the next only on PROVIDER_ERROR, TIMED_OUT, or a 503 at admission; a named Provider never falls back. For QUEUED/RUNNING (HTTP 202, the Apify routes), poll the authenticated result_url on the API origin. Reuse the same Idempotency-Key and execution parameters for an intentional retry."
66840
67940
  )
66841
67941
  )
66842
67942
  ).add(
@@ -66876,6 +67976,97 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
66876
67976
  "Follow result_url from a market data call to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
66877
67977
  )
66878
67978
  )
67979
+ ).add(
67980
+ HttpApiEndpoint_exports.post("gtm-creator-research", "/v1/solutions/gtm/creator_research", {
67981
+ payload: CreatorResearchRequest,
67982
+ headers: IdempotencyKeyHeaders,
67983
+ success: [CreatorResearchTerminal, CreatorResearchInFlight],
67984
+ error: solutionRunErrors
67985
+ }).annotateMerge(
67986
+ operation(
67987
+ "gtm-creator-research",
67988
+ "Creator research",
67989
+ "Discover creator accounts, group matching content by author, enrich cross-platform profiles, find contacts, or inspect TikTok Shop performance. Use action and platform with the action-specific inputs. Output is normalized; missing values are null. Contacts preserve the Provider's email type and verification state. Engagement and sales estimates retain their Provider names and units. Content discovery groups one page only; use next_cursor to continue and deduplicate across pages. Unsupported filters fail before a Run. HTTP 202 returns a signed, authenticated result_url to read the same Runs without another Charge. Provider-native output remains on GET /v1/runs/:id. provider=auto falls back only on Provider errors, timeouts or admission 503, never on an empty result."
67990
+ )
67991
+ )
67992
+ ).add(
67993
+ HttpApiEndpoint_exports.get(
67994
+ "gtm-creator-research-result",
67995
+ "/v1/solutions/gtm/creator_research/result",
67996
+ {
67997
+ query: CreatorResearchResultQuery,
67998
+ success: CreatorResearchResult,
67999
+ error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
68000
+ }
68001
+ ).annotateMerge(
68002
+ operation(
68003
+ "gtm-creator-research-result",
68004
+ "Read a creator research result",
68005
+ "Follow result_url from a creator research call to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
68006
+ )
68007
+ )
68008
+ ).add(
68009
+ HttpApiEndpoint_exports.post("gtm-stock-research", "/v1/solutions/gtm/stock_research", {
68010
+ payload: StockResearchRequest,
68011
+ headers: IdempotencyKeyHeaders,
68012
+ success: [StockResearchTerminal, StockResearchInFlight],
68013
+ error: solutionRunErrors
68014
+ }).annotateMerge(
68015
+ operation(
68016
+ "gtm-stock-research",
68017
+ "Stock research",
68018
+ "Read company facts, financial statements, segments, current or historical financial metrics, earnings, guidance, prices, news, screener matches and macro data through FinancialDatasets. Each request maps to one Endpoint and one Run. Missing fields remain null; currency, reporting periods and source dates remain separate. Ratios are fractions; macro rates are percentages. Unsupported fields and requests exceeding max_charge_usd fail before a Run. A signed authenticated result_url reads the same Runs without another Charge. Provider-native output remains on GET /v1/runs/:id."
68019
+ )
68020
+ )
68021
+ ).add(
68022
+ HttpApiEndpoint_exports.get("gtm-stock-research-result", "/v1/solutions/gtm/stock_research/result", {
68023
+ query: StockResearchResultQuery,
68024
+ success: StockResearchResult,
68025
+ error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
68026
+ }).annotateMerge(
68027
+ operation(
68028
+ "gtm-stock-research-result",
68029
+ "Read a Stock research result",
68030
+ "Follow result_url from a Stock research call to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
68031
+ )
68032
+ )
68033
+ ).add(
68034
+ HttpApiEndpoint_exports.post("gtm-amazon-research", "/v1/solutions/gtm/amazon_research", {
68035
+ payload: AmazonResearchRequest,
68036
+ headers: IdempotencyKeyHeaders,
68037
+ success: [AmazonResearchTerminal, AmazonResearchInFlight],
68038
+ error: solutionRunErrors
68039
+ }).annotateMerge(
68040
+ operation(
68041
+ "gtm-amazon-research",
68042
+ "Amazon research",
68043
+ "Search Amazon products, inspect an exact ASIN, retrieve related or exact-term demand estimates, collect bounded filtered review pages, or read historical prices and separate merchant-offer observations. Require an explicit marketplace. Missing fields remain null; estimates, review samples and unavailable prices retain their evidence limits. Unsupported fields and requests exceeding max_charge_usd fail before a Run. HTTP 202 returns a signed, authenticated result_url to read the same Runs without another Charge. Provider-native output remains on GET /v1/runs/:id. provider=auto falls back only on Provider errors, timeouts or admission 503, never on an empty result."
68044
+ )
68045
+ )
68046
+ ).add(
68047
+ HttpApiEndpoint_exports.get("gtm-amazon-research-result", "/v1/solutions/gtm/amazon_research/result", {
68048
+ query: AmazonResearchResultQuery,
68049
+ success: AmazonResearchResult,
68050
+ error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
68051
+ }).annotateMerge(
68052
+ operation(
68053
+ "gtm-amazon-research-result",
68054
+ "Read an Amazon research result",
68055
+ "Follow result_url from an Amazon research call to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
68056
+ )
68057
+ )
68058
+ ).add(
68059
+ HttpApiEndpoint_exports.post("gtm-amazon-analysis", "/v1/solutions/gtm/amazon_research/analyze", {
68060
+ payload: AmazonAnalysisRequest,
68061
+ success: AmazonAnalysisResult,
68062
+ error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
68063
+ }).annotateMerge(
68064
+ operation(
68065
+ "gtm-amazon-analysis",
68066
+ "Analyze Amazon research evidence",
68067
+ "Free deterministic analysis of authorized price history, supplied unit economics, tagged review samples or opportunity evidence gates. This operation creates no Runs and calls no Providers. Price and review result tokens are authenticated against the current Workspace and Key policy. Supplied costs, qualitative tags and evidence judgments stay explicitly attributed to the caller. Unknown costs remain unknown; missing evidence prevents launch readiness. charge_usd is always 0.00; source_charge_usd reports the existing data Runs separately."
68068
+ )
68069
+ )
66879
68070
  );
66880
68071
  var balance = HttpApiGroup_exports.make("Balance").add(
66881
68072
  HttpApiEndpoint_exports.get("balance", "/v1/balance", {
@@ -68564,7 +69755,7 @@ import os3 from "node:os";
68564
69755
  import { existsSync as existsSync2, mkdirSync as mkdirSync3, writeFileSync as writeFileSync4 } from "node:fs";
68565
69756
  import os2 from "node:os";
68566
69757
  import path8 from "node:path";
68567
- var SKILL_MARKDOWN = true ? "---\nname: glasser\nversion: 0.1.135\ndescription: >\n Reach for this when a task needs external or paid data \u2014 person or company\n enrichment and search, contact unlock, job postings, social media profiles,\n posts and comments (TikTok, Douyin, Instagram, YouTube, X, Reddit and\n more), SEO keywords and backlinks, web,\n news, image, video, maps, places, scholar or shopping search, US property\n and rental data, SEC filings, company financials and stock prices, vehicle\n history and car listings, software reviews, AI model benchmarks, customs\n trade records, US statutes, compliance and KYC checks, movie, TV and game\n data, Chinese e-commerce listings and reviews, creator audience analytics,\n phone number checks, webpage scraping, or\n any other paid data API \u2014 and check the data sources before writing a\n scraper or telling the user something is inaccessible. 2,000+ paid\n endpoints across 80+ providers behind one Key: search, inspect\n the price, run, pay per call, no signup at each vendor. Works through the\n glasser CLI, or through the Glasser MCP server where the runtime cannot\n shell out. If the user already has their own key or integration for a\n specific provider, use that first.\n---\n\n# Glasser\n\nGlasser is a broker: it sells runnable third-party API operations\n(\"Endpoints\") under a single Key. You search the data sources, inspect an\nEndpoint's contract and Price, and run it \u2014 the response is the provider's\nown output, nothing renamed or reshaped.\n\n## Identify your surface FIRST\n\nDecide by the actual execution environment, not the product name and not\nwhether a terminal exists. The wrong setup cannot work.\n\n- **`glasser` MCP tools already loaded** (`search`, `inspect`, `run`,\n `runs_get`, `runs_list`, `runs_stop`, `balance`): nothing to install. The\n verbs map one to one onto the CLI commands below; only `run` differs, in\n that it needs an `idempotency_key` you generate (a UUID). Call `balance`;\n if it succeeds, skip to **First run**. The rules in this file apply either\n way.\n\n- **Hosted assistant** (claude.ai, Claude Desktop chat, Cowork, ChatGPT,\n Gemini \u2014 even with a code sandbox: it runs in the provider's cloud, not on\n the human's machine, and resets between tasks): do NOT install anything.\n Tell the human to add Glasser as a custom MCP connector, then stop. In\n Claude, give them this link; it opens the Add custom connector dialog\n with the name and URL filled in:\n https://api.glasser.ai/connect/claude\n Then Continue \u2192 Add \u2192 sign in to Glasser, choose the Workspace, Allow.\n Glasser is on in the next chat. Other products: the server URL is\n `https://api.glasser.ai/mcp`; steps per client at\n https://glasser.ai/docs/mcp-server.md. If the product has no custom\n connectors, say so and point to the same account's coding agent\n (ChatGPT \u2192 Codex, Gemini \u2192 Gemini CLI, Claude \u2192 Claude Code).\n\n- **Local coding agent** (Claude Code, Codex, Cursor, Copilot, Gemini CLI,\n OpenClaw, Hermes on the user's machine; Grok Bot on its own persistent\n cloud computer): the human authorized the whole flow by pasting this. If\n your runtime asks permission for shell commands, request it ONCE and work\n straight through. Continue to **Setup**.\n\n- **Sandboxed agent** (cloud container, restricted egress): run\n `curl -sI https://api.glasser.ai/health` first. A proxy 403, DNS failure\n or timeout means an egress allowlist. Do not retry, do not try other\n hosts. Tell the human `api.glasser.ai` is blocked by the environment's\n network policy, offer the MCP connector or an allowlist for `glasser.ai`\n and `api.glasser.ai` on 443, then stop.\n\nNever ask the human to paste a Key into chat.\n\n## Setup\n\n```sh\nglasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest\n```\n\nOne command when the CLI is missing, and it installs the current version.\nWithout npm, `curl -fsSL https://glasser.ai/install.sh | sh` does the same\njob. A fresh install selects the latest version, so no separate registry\nversion check is needed. The installer reports what it needs and where it\nwrote the binary \u2014 read its output rather than guessing. If the CLI was\nalready installed, the server tells you when to upgrade (see **Upgrading**).\n\nFor agents with persistent skills, run `glasser skill install`. It saves\nthis file for every coding agent it finds (Claude Code, Codex, Cursor, Gemini\nCLI, Copilot and others), so future sessions load it; the installer already\nran it. For any other agent, save the complete file from\nhttps://glasser.ai/SKILL.md in your user-level skill directory and enable it\nfor future sessions. Do this only during setup or CLI upgrades.\n\n## Authentication\n\nRun `glasser balance --json`. Exit 0 means authentication works; continue to\n**First run**. A missing or rejected Key needs one. Handle other failures\nfrom the error message instead of starting another login.\n\n**Where a Key comes from.** Two sources, and the environment takes precedence\nover the local store. `GLASSER_API_KEY` needs no file on disk, so it is what\nCI, scripts and scheduled jobs use, and it is the source that still works on a\nmachine whose own store will not outlive the session \u2014 a cloud session, a\ncontainer. Mint that Key in the console. The local store is what `glasser\nlogin` writes and what `glasser keys add --label <l> --key <k>` fills by hand;\nit lives on the machine the CLI ran on, and lasts as long as that machine does.\n\n**With a user present**, in this order:\n\n1. Run `glasser login` with your shell tool's background execution support.\n The CLI opens the sign-in page when possible and prints a fallback URL and\n a matching code.\n2. Relay that URL and code exactly as printed \u2014 a plain URL, readable in a\n terminal \u2014 with a brief explanation of the next step. Nothing else starts\n until this message is out.\n3. Wait for that same command to finish, using the shell tool's wait or output\n operation with short waits. A pending result means wait again, not return\n a final reply. Browser approval needs no further chat message. Give brief\n progress updates during the wait; the CLI polls for up to 15 minutes.\n Stop waiting when login succeeds, fails, expires, or the user cancels.\n\nOnce login succeeds, use the available balance in its output and continue to\n**First run**, unless login warns that `GLASSER_API_KEY` overrides the saved\nKey or the summary has no available balance. In either case, run\n`glasser balance --json` in the environment subsequent commands will use. Login's\nsummary uses the new Key directly; it does not verify an environment Key.\n\nIf that check rejects an environment Key, another login will not fix it.\nPreserve runtime-managed authentication: changing the variable or bypassing\nit for a command needs the user's authorization. When the user requires it\nto stay unchanged, report the blocker and the runtime correction needed.\nFor other failures, report the actual error; a network failure does not show\nthat a Key is invalid. If authorization expires, a new login needs a new\nURL and code relayed before waiting again.\nNever ask the user to paste a Key. `glasser login --json` is a usage error by\ndesign \u2014 that flow needs a human.\n\n## First run\n\nSetup is finished when login succeeds and reports the available balance\nwithout an environment Key override, or `glasser balance` exits 0 in the\nenvironment subsequent commands will use \u2014 with the MCP tools, when\n`balance` succeeds.\nIf setup is blocked, give a brief status, the confirmed cause, and the next\nstep needed to resolve it. You may state which steps succeeded, but do not\nclaim readiness or offer task prompts while authentication is blocked.\nLogin's balance is not usable evidence for commands that use a rejected Key.\n\nOnce setup is finished, if the user already gave you a task, continue it.\nFor a setup-only request, reply briefly in the user's language: confirm\nGlasser is ready, report the available balance from login or the balance\ncheck, then recommend one small, ready-to-send example task.\nUse a conversational lead-in that explains how the suggestion can help\nthe user, rather than a generic list heading. Connect it to their goals\nwhen known, or briefly describe what they could accomplish with Glasser.\n\nBase the task on the user's project, interests or goals when that context\nis available. Otherwise, choose one example from Glasser's\ncapabilities. Give it a concrete subject and a clear result the user can ask for.\n\nFor both completed and blocked setup, omit Workspace names/slugs, Key\nlabels/values/prefixes, and installation details such as versions, paths or\npackage-manager output. Name a configuration variable when it explains the\nblocker. Report useful status, not a transcript of the setup commands.\n\nWhen a balance response includes `first_run_reward.description`, relay that\nmessage in the user's language alongside the task suggestion. If absent,\nomit rewards. Use `glasser balance --json` when checking balance through the\nCLI. Reuse the setup response; do not call balance just for rewards or delay\nan existing task.\n\nFor a setup-only request, finish with the task suggestion and wait for the\nuser to choose it. Then follow the normal inspect, pricing and approval rules\nbefore a paid Run.\n\n## Upgrading\n\nThe server tells you when to upgrade \u2014 you do not have to compare versions\nby hand. Upgrade when any of these appears:\n\n- a response carries a `client` block. It is present only when this CLI is\n behind, and it says everything needed to act: `client_version`,\n `minimum_version`, `latest_version`, a runnable `upgrade_command`, and a\n `reason`. It rides in the response body,\n so it reaches `-j` output like any other field;\n- a command fails with `control: \"client.version_unsupported\"`. This CLI is\n too old to read part of the catalog, and `search` and `inspect` are refused\n rather than answered with a shortened list \u2014 a missing row would be\n invisible to you. Run the `upgrade_command` from `details`, then retry;\n- a command printed an `Update available` notice \u2014 the CLI asks the npm\n registry at most once every three hours and prints this on stderr. This one\n never\n appears in `-j` mode, because both streams stay machine-clean; the `client`\n block above is the `-j` signal.\n\nAfter upgrading, refresh the installed Skill as described in **Setup**.\nThe Skill and the CLI update together. Never downgrade. An available update\nnever interrupts work: finish the task at hand, then upgrade before the\nnext one. If the registry is unreachable, proceed with the installed\nversion \u2014 do not block the task on an upgrade check.\n\n## When to use\n\n- The task needs a capability (enrich a person or company, search the web,\n etc.) and no key or integration for it exists in the environment.\n- Workflow, in order:\n 0. Every search needs `--use-case \"<what they asked for>\"`, a browse with no\n query included: the user's own request, in their words, with the subject\n in it. Search refuses to run without it. One piece of the user's work is\n one **task**. Search prints a task id; pass it back\n with `--task <id>` on every later search, inspect and run for that same\n piece of work. Run that first search on its own and wait for the id:\n searches started in parallel before you have it each open a separate\n task. After that, search in parallel as much as you like, each with\n `--task <id>`. Every command that prints a follow-up command already\n carries the id in it, so working from what you are given keeps a task\n together with no bookkeeping.\n\n The use case and the task id cost nothing. The task id lets you list one\n task's Runs together with `glasser runs list --task <id>`.\n 1. `glasser search \"<capability>\" --use-case \"<what they asked for>\"` \u2014 find candidate Endpoints. The\n Provider column reads `pdl (People Data Labs)`: the first word is the\n slug every `-p` flag takes, the name in parentheses is who the data\n comes from \u2014 use it when the user names a vendor, and when you report\n the source back. Several Providers may sell the same capability: the\n list is ranked by relevance only, the Price sits beside each row, and\n the choice is yours.\n - A page holds 5 rows and the footer says how many matches there are in\n total. Pass the printed cursor with `--cursor` to see the rest.\n - The Score column is the cosine similarity between your words and that\n Endpoint's description, in [-1, 1], shown as `-` when semantic scoring\n did not run. It is a similarity signal for comparing rows on one page,\n not a verdict: the row order comes from fusing a keyword and a semantic\n ranking, and the ranking always returns its nearest candidates.\n - **Neither a page of low scores nor reaching the last page shows that\n the catalog lacks a capability.** Before you tell the user something is\n unavailable: read the total, page through with `--cursor`, search again\n with different words (the catalog is indexed on how each Endpoint\n describes itself, which may not be your phrasing), and inspect every\n candidate whose name is close to the task \u2014 `inspect` is free.\n 2. `glasser inspect -p <provider> -e <endpoint>` \u2014 **read the Price and\n the charge clauses BEFORE running.** The Price is what a normal\n COMPLETED call costs; the charge clauses list the exceptions (e.g.\n `NO_RESULT $0.00` means an empty answer is free). For any given\n endpoint the clauses are authoritative. Also identify which input\n fields control result volume (`num`, `size`, `limit`, arrays of\n queries) \u2014 the charge rule may read the input, so volume parameters\n can change what a call costs. Start small; raise only when the user\n needs more.\n Follow the inspected `input_schema`: some Endpoints take an object;\n native task submissions take an array of task objects. A completed\n submission returns receipts and task IDs. Use the matching task-result\n Endpoint to retrieve the data, with a task ID from the same Workspace.\n 3. `glasser run -p <provider> -e <endpoint> -i '<json>'` \u2014 execute.\n 4. Report the result AND the charge to the user (run output includes the\n charged amount). Every Run also prints a `Run URL` (the `run_url` field\n in `-j`; absent from the `-o` file): the Workspace console page holding\n that Run's records exactly as the Provider returned them, private to\n Workspace members. When your answer relies on a Run, cite that URL as\n its source \u2014 the Run id alone opens nothing for the user.\n\n## When NOT to use\n\n- **Precedence: an explicit user instruction > the user's own integrations\n and keys > Glasser.** If the user has their own key, client, or\n integration for the capability, use that instead.\n- **Runs spend the Workspace balance.** Do not run Endpoints speculatively,\n in loops, or for bulk operations without telling the user the per-call\n Price and getting their go-ahead.\n- Do not use it for capabilities the environment already provides for free.\n- **The catalog changes often** \u2014 Endpoints and Providers are added weekly.\n Search every time you need one; never cache or reuse a listing from an\n earlier session, and never answer \"what can Glasser do\" from memory.\n\n## Adding funds\n\nOnly the user can add funds, in the console at https://app.glasser.ai/balance \u2014\nno command or tool does it. Raise this only when a Run fails with\n`insufficient balance` or the user asks.\n\n- **Top up** on the Balance page.\n- **Grants** are free balance; users often call them \"credits\". The Balance\n page lists the Grants a Workspace can receive and their terms. Send the\n user there.\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `glasser login` | Browser device authorization; stores a Key |\n| `glasser search [\"<query>\"] --use-case \"<sentence>\" [--limit N] [--cursor C] [--task T]` | Search Endpoints, 5 per page (max 20); `--use-case` is required on every search; `-q`/`--query` takes the same query; use `--query=<query>` when it starts with `-`; the footer prints the match total, the task id, the next-page cursor for `--cursor`, and a search-again command that carries the task and the use case |\n| `glasser inspect -p <provider> -e <endpoint> [--endpoint-version N] [--task T]` | Schemas, current Price, charge clauses, supported version |\n| `glasser run -p <provider> -e <endpoint> [-i '<json>' \\| -f <file>] [--idempotency-key K] [--task T] [--wait] [--wait-timeout s] [-o file]` | Execute an Endpoint |\n| `glasser runs list [--limit --cursor --status --provider --endpoint --task]` | List past Runs; `--task` is an exact match |\n| `glasser runs get -r <runId> [--wait] [-o file]` | Fetch one Run |\n| `glasser runs stop -r <runId>` | Stop a queued/running Run |\n| `glasser balance` | Balance, held and available; doubles as the auth probe |\n| `glasser balance history [--limit --cursor --kind]` | Ledger of charges, refunds, top-ups and Grants |\n| `glasser keys add/list/activate/remove` | Manage Keys stored on this machine |\n\nGlobal flags: `-j/--json` (raw JSON to stdout, errors as a single JSON\nobject on stderr), `--help`, `--version`.\n\nFacts that matter when scripting:\n\n- Exit codes: `0` success, `1` runtime failure, `2` usage error, `130`\n interrupted.\n- In `-j` mode, stdout is data only; parse stderr for the error object.\n- For large outputs, prefer `-o <file>` and read the file selectively \u2014\n dumping a full provider payload into your context wastes it.\n- If a Run has `response_file`, check its `state` and `body_field`.\n If its state is `link_pending`, read the same Run to prepare the link; do not\n execute the Endpoint again. `-o` makes this read automatically, downloads an\n available complete JSON file and verifies its byte count\n and SHA-256. `output: null` alone does not mean an empty result. Download\n links expire after at most one hour; `runs get` refreshes them during the\n file's 7-day availability period without another execution or charge.\n Provider-native download links remain part of the Provider's own output.\n- Money is always an **exact decimal string** (e.g. `\"0.0125\"`), never a\n float. Do not do float arithmetic on it.\n- Env: `GLASSER_API_KEY`, `GLASSER_API_BASE_URL` (default\n `https://api.glasser.ai`; point it elsewhere and that stack's Workspace\n is what gets billed), `NO_COLOR`.\n\n## Run statuses and waiting\n\n| Status | Meaning |\n|---|---|\n| `QUEUED` | Accepted, not yet dispatched to the provider |\n| `RUNNING` | Dispatched, provider has not answered yet |\n| `COMPLETED` | Terminal \u2014 the provider answered (its answer may still be a \"not found\") |\n| `FAILED` | Terminal \u2014 no usable provider answer; the failure block says why |\n| `STOPPED` | Terminal \u2014 stopped via `runs stop`. Dispatch wins the race: a Run already sent to the provider completes and is charged |\n\nInspect shows each Endpoint's run mode: a `sync` Endpoint returns the\nfinished Run in the same response (its timeout is printed next to the\nmode) \u2014 `--wait` on those adds nothing. For anything still `QUEUED` or\n`RUNNING`, either pass `--wait` up front or poll with\n`glasser runs get -r <runId> --wait`; interactive sessions that want to\nkeep talking can fire without `--wait` and poll between replies.\n\n## Troubleshooting\n\n| Symptom | Meaning / action |\n|---|---|\n| `Invalid or missing API key` | Check the Key source. If `GLASSER_API_KEY` is set, correct it through its owner; login does not replace it. With no environment Key, use `glasser login` to replace a missing or rejected local Key |\n| Exit `2` | Your command line is wrong \u2014 fix it from the message; nothing reached the API and nothing was charged |\n| `Input does not match the endpoint's input schema` | Read the `issues:` lines under the error \u2014 they name the exact field and constraint. No Run was created and nothing was charged; fix the input and run again |\n| `insufficient balance` | The Workspace cannot cover the Price. Tell the user to add funds in the console (see **Adding funds**) \u2014 do not retry |\n| `rate_limited` | The Workspace or the endpoint is at its limit. Wait `retry_after_ms` (the error carries it; the hint prints it), then retry the same command once \u2014 do not loop |\n| Transport error / timeout with a retry hint | Outcome unknown \u2014 a Run may exist. Retry with the SAME Idempotency-Key exactly as the hint prints it |\n| `COMPLETED` but the provider answered 4xx / 5xx (`provider_response.http_status`) | The provider's own error; `charge_basis.clause` says what it cost: PROVIDER_ERROR, or NO_RESULT when the Endpoint reads that status (often 404) as a miss. Read the provider's message: run the same input once more with a NEW Idempotency-Key when it says so (the same key only replays this Run), then try another Endpoint \u2014 the same text can mean a bad input or a provider outage |\n| `FAILED` with a charge shown | Legitimate when the charge clauses say so \u2014 report both the failure and the charge |\n| `Update available` notice | Finish the current task, re-run the installer, then update the installed skill as described in **Upgrading** |\n\n## Running safely\n\n- `run` prints `Charge: $X (rule)` \u2014 the amount billed under the\n endpoint's charge rule. Report that number to the user.\n- `run` prints the Idempotency-Key it used (auto-generated when omitted;\n `--json` mode requires an explicit `--idempotency-key`). On an ambiguous\n failure \u2014 timeout, dropped connection, nonzero exit with no clear answer \u2014\n **retry with the SAME key**: it returns the original Run instead of\n charging again.\n- **Two indicators, not one.** A Run's status and the provider's response\n are separate. `COMPLETED` means the provider answered \u2014 a `COMPLETED` Run\n whose payload is a provider 404 (\"person not found\") is a normal outcome,\n not an error. Whether it is charged follows the endpoint's charge clauses\n from inspect. Report both the Run status and what the provider actually\n said.\n- Use `--wait` to block until the Run settles; without it, poll with\n `glasser runs get -r <runId> --wait`.\n\n## Rules for agents\n\n1. The user's own keys, integrations and explicit instructions outrank\n Glasser \u2014 it fills gaps, never routes around what the user has.\n2. Always inspect before running; never guess input parameters \u2014 the input\n schema and charge clauses from `inspect` are the source of truth.\n3. Runs spend the Workspace balance: no speculative, looped, or bulk runs\n without naming the per-call Price and getting the user's go-ahead.\n4. Start with small volume parameters; raise them only on request.\n5. Interactive auth is `glasser login` \u2014 never ask the user to paste a Key.\n6. On an ambiguous failure, retry with the SAME Idempotency-Key.\n7. Carry the SAME `--task` through one piece of work, the way you carry that\n key \u2014 search prints it, inspect and run take it.\n8. Report two indicators after every run \u2014 the Run status and what the\n provider said \u2014 plus the printed `Charge:` amount; cite the `Run URL`,\n never the bare Run id, as the source of what your answer used.\n9. Money is an exact decimal string; never do float arithmetic on it.\n10. Prefer `-o <file>` for large outputs; `-j` when you parse.\n11. When any command prints an `Update available` notice: finish the task,\n re-run the installer, then update the installed skill as described in\n **Upgrading**.\n12. The CLI is the source of truth for flags \u2014 run `glasser <command>\n --help` when unsure.\n13. `rate_limited` means back off: wait `retry_after_ms`, then retry the\n same command once; never loop on it.\n\n`--endpoint-version` selects a supported compatible contract. It does not lock Price.\nCompatible updates keep the version; older versions work until explicitly retired.\nNew Runs use the selected version's Price at admission. Accepted Runs keep their original Price.\n" : readFileSync4(new URL("../../api/src/http/skill/SKILL.md", import.meta.url), "utf8");
69758
+ var SKILL_MARKDOWN = true ? "---\nname: glasser\nversion: 0.1.142\ndescription: >\n Reach for this when a task needs external or paid data \u2014 person or company\n enrichment and search, contact unlock, job postings, social media profiles,\n posts and comments (TikTok, Douyin, Instagram, YouTube, X, Reddit and\n more), SEO keywords and backlinks, web,\n news, image, video, maps, places, scholar or shopping search, US property\n and rental data, SEC filings, company financials and stock prices, vehicle\n history and car listings, software reviews, AI model benchmarks, customs\n trade records, US statutes, compliance and KYC checks, movie, TV and game\n data, Chinese e-commerce listings and reviews, creator audience analytics,\n phone number checks, webpage scraping, or\n any other paid data API \u2014 and check the data sources before writing a\n scraper or telling the user something is inaccessible. 2,000+ paid\n endpoints across 80+ providers behind one Key: search, inspect\n the price, run, pay per call, no signup at each vendor. Works through the\n glasser CLI, or through the Glasser MCP server where the runtime cannot\n shell out. If the user already has their own key or integration for a\n specific provider, use that first.\n---\n\n# Glasser\n\nGlasser is a broker: it sells runnable third-party API operations\n(\"Endpoints\") under a single Key. You search the data sources, inspect an\nEndpoint's contract and Price, and run it \u2014 the response is the provider's\nown output, nothing renamed or reshaped.\n\n## Identify your surface FIRST\n\nDecide by the actual execution environment, not the product name and not\nwhether a terminal exists. The wrong setup cannot work.\n\n- **`glasser` MCP tools already loaded** (`search`, `inspect`, `run`,\n `runs_get`, `runs_list`, `runs_stop`, `balance`): nothing to install. The\n verbs map one to one onto the CLI commands below; only `run` differs, in\n that it needs an `idempotency_key` you generate (a UUID). Call `balance`;\n if it succeeds, skip to **First run**. The rules in this file apply either\n way.\n\n- **Hosted assistant** (claude.ai, Claude Desktop chat, Cowork, ChatGPT,\n Gemini \u2014 even with a code sandbox: it runs in the provider's cloud, not on\n the human's machine, and resets between tasks): do NOT install anything.\n Tell the human to add Glasser as a custom MCP connector, then stop. In\n Claude, give them this link; it opens the Add custom connector dialog\n with the name and URL filled in:\n https://api.glasser.ai/connect/claude\n Then Continue \u2192 Add \u2192 sign in to Glasser, choose the Workspace, Allow.\n Glasser is on in the next chat. Other products: the server URL is\n `https://api.glasser.ai/mcp`; steps per client at\n https://glasser.ai/docs/mcp-server.md. If the product has no custom\n connectors, say so and point to the same account's coding agent\n (ChatGPT \u2192 Codex, Gemini \u2192 Gemini CLI, Claude \u2192 Claude Code).\n\n- **Local coding agent** (Claude Code, Codex, Cursor, Copilot, Gemini CLI,\n OpenClaw, Hermes on the user's machine; Grok Bot on its own persistent\n cloud computer): the human authorized the whole flow by pasting this. If\n your runtime asks permission for shell commands, request it ONCE and work\n straight through. Continue to **Setup**.\n\n- **Sandboxed agent** (cloud container, restricted egress): run\n `curl -sI https://api.glasser.ai/health` first. A proxy 403, DNS failure\n or timeout means an egress allowlist. Do not retry, do not try other\n hosts. Tell the human `api.glasser.ai` is blocked by the environment's\n network policy, offer the MCP connector or an allowlist for `glasser.ai`\n and `api.glasser.ai` on 443, then stop.\n\nNever ask the human to paste a Key into chat.\n\n## Setup\n\n```sh\nglasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest\n```\n\nOne command when the CLI is missing, and it installs the current version.\nWithout npm, `curl -fsSL https://glasser.ai/install.sh | sh` does the same\njob. A fresh install selects the latest version, so no separate registry\nversion check is needed. The installer reports what it needs and where it\nwrote the binary \u2014 read its output rather than guessing. If the CLI was\nalready installed, the server tells you when to upgrade (see **Upgrading**).\n\nFor agents with persistent skills, run `glasser skill install`. It saves\nthis file for every coding agent it finds (Claude Code, Codex, Cursor, Gemini\nCLI, Copilot and others), so future sessions load it; the installer already\nran it. For any other agent, save the complete file from\nhttps://glasser.ai/SKILL.md in your user-level skill directory and enable it\nfor future sessions. Do this only during setup or CLI upgrades.\n\n## Authentication\n\nRun `glasser balance --json`. Exit 0 means authentication works; continue to\n**First run**. A missing or rejected Key needs one. Handle other failures\nfrom the error message instead of starting another login.\n\n**Where a Key comes from.** Two sources, and the environment takes precedence\nover the local store. `GLASSER_API_KEY` needs no file on disk, so it is what\nCI, scripts and scheduled jobs use, and it is the source that still works on a\nmachine whose own store will not outlive the session \u2014 a cloud session, a\ncontainer. Mint that Key in the console. The local store is what `glasser\nlogin` writes and what `glasser keys add --label <l> --key <k>` fills by hand;\nit lives on the machine the CLI ran on, and lasts as long as that machine does.\n\n**With a user present**, in this order:\n\n1. Run `glasser login` with your shell tool's background execution support.\n The CLI opens the sign-in page when possible and prints a fallback URL and\n a matching code.\n2. Relay that URL and code exactly as printed \u2014 a plain URL, readable in a\n terminal \u2014 with a brief explanation of the next step. Nothing else starts\n until this message is out.\n3. Wait for that same command to finish, using the shell tool's wait or output\n operation with short waits. A pending result means wait again, not return\n a final reply. Browser approval needs no further chat message. Give brief\n progress updates during the wait; the CLI polls for up to 15 minutes.\n Stop waiting when login succeeds, fails, expires, or the user cancels.\n\nOnce login succeeds, use the available balance in its output and continue to\n**First run**, unless login warns that `GLASSER_API_KEY` overrides the saved\nKey or the summary has no available balance. In either case, run\n`glasser balance --json` in the environment subsequent commands will use. Login's\nsummary uses the new Key directly; it does not verify an environment Key.\n\nIf that check rejects an environment Key, another login will not fix it.\nPreserve runtime-managed authentication: changing the variable or bypassing\nit for a command needs the user's authorization. When the user requires it\nto stay unchanged, report the blocker and the runtime correction needed.\nFor other failures, report the actual error; a network failure does not show\nthat a Key is invalid. If authorization expires, a new login needs a new\nURL and code relayed before waiting again.\nNever ask the user to paste a Key. `glasser login --json` is a usage error by\ndesign \u2014 that flow needs a human.\n\n## First run\n\nSetup is finished when login succeeds and reports the available balance\nwithout an environment Key override, or `glasser balance` exits 0 in the\nenvironment subsequent commands will use \u2014 with the MCP tools, when\n`balance` succeeds.\nIf setup is blocked, give a brief status, the confirmed cause, and the next\nstep needed to resolve it. You may state which steps succeeded, but do not\nclaim readiness or offer task prompts while authentication is blocked.\nLogin's balance is not usable evidence for commands that use a rejected Key.\n\nOnce setup is finished, if the user already gave you a task, continue it.\nFor a setup-only request, reply briefly in the user's language: confirm\nGlasser is ready, report the available balance from login or the balance\ncheck, then recommend one small, ready-to-send example task.\nUse a conversational lead-in that explains how the suggestion can help\nthe user, rather than a generic list heading. Connect it to their goals\nwhen known, or briefly describe what they could accomplish with Glasser.\n\nBase the task on the user's project, interests or goals when that context\nis available. Otherwise, choose one example from Glasser's\ncapabilities. Give it a concrete subject and a clear result the user can ask for.\n\nFor both completed and blocked setup, omit Workspace names/slugs, Key\nlabels/values/prefixes, and installation details such as versions, paths or\npackage-manager output. Name a configuration variable when it explains the\nblocker. Report useful status, not a transcript of the setup commands.\n\nWhen a balance response includes `first_run_reward.description`, relay that\nmessage in the user's language alongside the task suggestion. If absent,\nomit rewards. Use `glasser balance --json` when checking balance through the\nCLI. Reuse the setup response; do not call balance just for rewards or delay\nan existing task.\n\nFor a setup-only request, finish with the task suggestion and wait for the\nuser to choose it. Then follow the normal inspect, pricing and approval rules\nbefore a paid Run.\n\n## Upgrading\n\nThe server tells you when to upgrade \u2014 you do not have to compare versions\nby hand. Upgrade when any of these appears:\n\n- a response carries a `client` block. It is present only when this CLI is\n behind, and it says everything needed to act: `client_version`,\n `minimum_version`, `latest_version`, a runnable `upgrade_command`, and a\n `reason`. It rides in the response body,\n so it reaches `-j` output like any other field;\n- a command fails with `control: \"client.version_unsupported\"`. This CLI is\n too old to read part of the catalog, and `search` and `inspect` are refused\n rather than answered with a shortened list \u2014 a missing row would be\n invisible to you. Run the `upgrade_command` from `details`, then retry;\n- a command printed an `Update available` notice \u2014 the CLI asks the npm\n registry at most once every three hours and prints this on stderr. This one\n never\n appears in `-j` mode, because both streams stay machine-clean; the `client`\n block above is the `-j` signal.\n\nAfter upgrading, refresh the installed Skill as described in **Setup**.\nThe Skill and the CLI update together. Never downgrade. An available update\nnever interrupts work: finish the task at hand, then upgrade before the\nnext one. If the registry is unreachable, proceed with the installed\nversion \u2014 do not block the task on an upgrade check.\n\n## When to use\n\n- The task needs a capability (enrich a person or company, search the web,\n etc.) and no key or integration for it exists in the environment.\n- Workflow, in order:\n 0. Every search needs `--use-case \"<what they asked for>\"`, a browse with no\n query included: the user's own request, in their words, with the subject\n in it. Search refuses to run without it. One piece of the user's work is\n one **task**. Search prints a task id; pass it back\n with `--task <id>` on every later search, inspect and run for that same\n piece of work. Run that first search on its own and wait for the id:\n searches started in parallel before you have it each open a separate\n task. After that, search in parallel as much as you like, each with\n `--task <id>`. Every command that prints a follow-up command already\n carries the id in it, so working from what you are given keeps a task\n together with no bookkeeping.\n\n The use case and the task id cost nothing. The task id lets you list one\n task's Runs together with `glasser runs list --task <id>`.\n 1. `glasser search \"<capability>\" --use-case \"<what they asked for>\"` \u2014 find candidate Endpoints. The\n Provider column reads `pdl (People Data Labs)`: the first word is the\n slug every `-p` flag takes, the name in parentheses is who the data\n comes from \u2014 use it when the user names a vendor, and when you report\n the source back. Several Providers may sell the same capability: the\n list is ranked by relevance only, the Price sits beside each row, and\n the choice is yours.\n - A page holds 5 rows and the footer says how many matches there are in\n total. Pass the printed cursor with `--cursor` to see the rest.\n - The Score column is the cosine similarity between your words and that\n Endpoint's description, in [-1, 1], shown as `-` when semantic scoring\n did not run. It is a similarity signal for comparing rows on one page,\n not a verdict: the row order comes from fusing a keyword and a semantic\n ranking, and the ranking always returns its nearest candidates.\n - **Neither a page of low scores nor reaching the last page shows that\n the catalog lacks a capability.** Before you tell the user something is\n unavailable: read the total, page through with `--cursor`, search again\n with different words (the catalog is indexed on how each Endpoint\n describes itself, which may not be your phrasing), and inspect every\n candidate whose name is close to the task \u2014 `inspect` is free.\n 2. `glasser inspect -p <provider> -e <endpoint>` \u2014 **read the Price and\n the charge clauses BEFORE running.** The Price is what a normal\n COMPLETED call costs; the charge clauses list the exceptions (e.g.\n `NO_RESULT $0.00` means an empty answer is free). For any given\n endpoint the clauses are authoritative. Also identify which input\n fields control result volume (`num`, `size`, `limit`, arrays of\n queries) \u2014 the charge rule may read the input, so volume parameters\n can change what a call costs. Start small; raise only when the user\n needs more.\n Follow the inspected `input_schema`: some Endpoints take an object;\n native task submissions take an array of task objects. A completed\n submission returns receipts and task IDs. Use the matching task-result\n Endpoint to retrieve the data, with a task ID from the same Workspace.\n 3. `glasser run -p <provider> -e <endpoint> -i '<json>'` \u2014 execute.\n 4. Report the result AND the charge to the user (run output includes the\n charged amount). Every Run also prints a `Run URL` (the `run_url` field\n in `-j`; absent from the `-o` file): the Workspace console page holding\n that Run's records exactly as the Provider returned them, private to\n Workspace members. When your answer relies on a Run, cite that URL as\n its source \u2014 the Run id alone opens nothing for the user.\n\n## When NOT to use\n\n- **Precedence: an explicit user instruction > the user's own integrations\n and keys > Glasser.** If the user has their own key, client, or\n integration for the capability, use that instead.\n- **Runs spend the Workspace balance.** Do not run Endpoints speculatively,\n in loops, or for bulk operations without telling the user the per-call\n Price and getting their go-ahead.\n- Do not use it for capabilities the environment already provides for free.\n- **The catalog changes often** \u2014 Endpoints and Providers are added weekly.\n Search every time you need one; never cache or reuse a listing from an\n earlier session, and never answer \"what can Glasser do\" from memory.\n\n## Adding funds\n\nOnly the user can add funds, in the console at https://app.glasser.ai/balance \u2014\nno command or tool does it. Raise this only when a Run fails with\n`insufficient balance` or the user asks.\n\n- **Top up** on the Balance page.\n- **Grants** are free balance; users often call them \"credits\". The Balance\n page lists the Grants a Workspace can receive and their terms. Send the\n user there.\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `glasser login` | Browser device authorization; stores a Key |\n| `glasser search [\"<query>\"] --use-case \"<sentence>\" [--limit N] [--cursor C] [--task T]` | Search Endpoints, 5 per page (max 20); `--use-case` is required on every search; `-q`/`--query` takes the same query; use `--query=<query>` when it starts with `-`; the footer prints the match total, the task id, the next-page cursor for `--cursor`, and a search-again command that carries the task and the use case |\n| `glasser inspect -p <provider> -e <endpoint> [--endpoint-version N] [--task T]` | Schemas, current Price, charge clauses, supported version |\n| `glasser run -p <provider> -e <endpoint> [-i '<json>' \\| -f <file>] [--idempotency-key K] [--task T] [--wait] [--wait-timeout s] [-o file]` | Execute an Endpoint |\n| `glasser runs list [--limit --cursor --status --provider --endpoint --task]` | List past Runs; `--task` is an exact match |\n| `glasser runs get -r <runId> [--wait] [-o file]` | Fetch one Run |\n| `glasser runs stop -r <runId>` | Stop a queued/running Run |\n| `glasser balance` | Balance, held and available; doubles as the auth probe |\n| `glasser balance history [--limit --cursor --kind]` | Ledger of charges, refunds, top-ups and Grants |\n| `glasser keys add/list/activate/remove` | Manage Keys stored on this machine |\n\nGlobal flags: `-j/--json` (raw JSON to stdout, errors as a single JSON\nobject on stderr), `--help`, `--version`.\n\nFacts that matter when scripting:\n\n- Exit codes: `0` success, `1` runtime failure, `2` usage error, `130`\n interrupted.\n- In `-j` mode, stdout is data only; parse stderr for the error object.\n- For large outputs, prefer `-o <file>` and read the file selectively \u2014\n dumping a full provider payload into your context wastes it.\n- If a Run has `response_file`, check its `state` and `body_field`.\n If its state is `link_pending`, read the same Run to prepare the link; do not\n execute the Endpoint again. `-o` makes this read automatically, downloads an\n available complete JSON file and verifies its byte count\n and SHA-256. `output: null` alone does not mean an empty result. Download\n links expire after at most one hour; `runs get` refreshes them during the\n file's 7-day availability period without another execution or charge.\n Provider-native download links remain part of the Provider's own output.\n- Money is always an **exact decimal string** (e.g. `\"0.0125\"`), never a\n float. Do not do float arithmetic on it.\n- Env: `GLASSER_API_KEY`, `GLASSER_API_BASE_URL` (default\n `https://api.glasser.ai`; point it elsewhere and that stack's Workspace\n is what gets billed), `NO_COLOR`.\n\n## Run statuses and waiting\n\n| Status | Meaning |\n|---|---|\n| `QUEUED` | Accepted, not yet dispatched to the provider |\n| `RUNNING` | Dispatched, provider has not answered yet |\n| `COMPLETED` | Terminal \u2014 the provider answered (its answer may still be a \"not found\") |\n| `FAILED` | Terminal \u2014 no usable provider answer; the failure block says why |\n| `STOPPED` | Terminal \u2014 stopped via `runs stop`. Dispatch wins the race: a Run already sent to the provider completes and is charged |\n\nInspect shows each Endpoint's run mode: a `sync` Endpoint returns the\nfinished Run in the same response (its timeout is printed next to the\nmode) \u2014 `--wait` on those adds nothing. For anything still `QUEUED` or\n`RUNNING`, either pass `--wait` up front or poll with\n`glasser runs get -r <runId> --wait`; interactive sessions that want to\nkeep talking can fire without `--wait` and poll between replies.\n\n## Troubleshooting\n\n| Symptom | Meaning / action |\n|---|---|\n| `Invalid or missing API key` | Check the Key source. If `GLASSER_API_KEY` is set, correct it through its owner; login does not replace it. With no environment Key, use `glasser login` to replace a missing or rejected local Key |\n| Exit `2` | Your command line is wrong \u2014 fix it from the message; nothing reached the API and nothing was charged |\n| `Input does not match the endpoint's input schema` | Read the `issues:` lines under the error \u2014 they name the exact field and constraint. No Run was created and nothing was charged; fix the input and run again |\n| `insufficient balance` | The Workspace cannot cover the Price. Tell the user to add funds in the console (see **Adding funds**) \u2014 do not retry |\n| `rate_limited` | The Workspace or the endpoint is at its limit. Wait `retry_after_ms` (the error carries it; the hint prints it), then retry the same command once \u2014 do not loop |\n| Transport error / timeout with a retry hint | Outcome unknown \u2014 a Run may exist. Retry with the SAME Idempotency-Key exactly as the hint prints it |\n| `COMPLETED` but the provider answered 4xx / 5xx (`provider_response.http_status`) | The provider's own error; `charge_basis.clause` says what it cost: PROVIDER_ERROR, or NO_RESULT when the Endpoint reads that status (often 404) as a miss. Read the provider's message: run the same input once more with a NEW Idempotency-Key when it says so (the same key only replays this Run), then try another Endpoint \u2014 the same text can mean a bad input or a provider outage |\n| `FAILED` with a charge shown | Legitimate when the charge clauses say so \u2014 report both the failure and the charge |\n| `Update available` notice | Finish the current task, re-run the installer, then update the installed skill as described in **Upgrading** |\n\n## Running safely\n\nFor a fresh independent lookup, use a fresh random UUID, including repeated\nlookups with identical inputs on the same day. Reuse the original key only\nwhen recovering that same execution after an uncertain outcome. Changing a\nTask does not reset a key. Read an existing Run for an explicit historical\nrequest and retain its observation time.\n\nMCP and Solution results expose `request_charge`: its `created_run_ids` identify\nnew work, `replayed_run_ids` identify existing work, and `charge_usd` counts only\nnewly created Runs for that request. It is null while a created Run is unsettled\nor its admission source is unknown. A replay or free read adds zero even when\nthe original Run has a positive historical Charge. Retain created Run ids across\npolls and count each settled Run once in the user's work; a free poll does not\nerase the Charge of an earlier creation. If these fields are absent, do not\ninfer new spending from the historical Run Charge.\n\n- `run` prints `Charge: $X (rule)` \u2014 the amount billed under the\n endpoint's charge rule. Report that number to the user.\n- `run` prints the Idempotency-Key it used (auto-generated when omitted;\n `--json` mode requires an explicit `--idempotency-key`). On an ambiguous\n failure \u2014 timeout, dropped connection, nonzero exit with no clear answer \u2014\n **retry with the SAME key**: it returns the original Run instead of\n charging again.\n- **Two indicators, not one.** A Run's status and the provider's response\n are separate. `COMPLETED` means the provider answered \u2014 a `COMPLETED` Run\n whose payload is a provider 404 (\"person not found\") is a normal outcome,\n not an error. Whether it is charged follows the endpoint's charge clauses\n from inspect. Report both the Run status and what the provider actually\n said.\n- Use `--wait` to block until the Run settles; without it, poll with\n `glasser runs get -r <runId> --wait`.\n\n## Rules for agents\n\n1. The user's own keys, integrations and explicit instructions outrank\n Glasser \u2014 it fills gaps, never routes around what the user has.\n2. Always inspect before running; never guess input parameters \u2014 the input\n schema and charge clauses from `inspect` are the source of truth.\n3. Runs spend the Workspace balance: no speculative, looped, or bulk runs\n without naming the per-call Price and getting the user's go-ahead.\n4. Start with small volume parameters; raise them only on request.\n5. Interactive auth is `glasser login` \u2014 never ask the user to paste a Key.\n6. On an ambiguous failure, retry with the SAME Idempotency-Key.\n7. Carry the SAME `--task` through one piece of work, the way you carry that\n key \u2014 search prints it, inspect and run take it.\n8. Report two indicators after every run \u2014 the Run status and what the\n provider said \u2014 plus the printed `Charge:` amount; cite the `Run URL`,\n never the bare Run id, as the source of what your answer used.\n9. Money is an exact decimal string; never do float arithmetic on it.\n10. Prefer `-o <file>` for large outputs; `-j` when you parse.\n11. When any command prints an `Update available` notice: finish the task,\n re-run the installer, then update the installed skill as described in\n **Upgrading**.\n12. The CLI is the source of truth for flags \u2014 run `glasser <command>\n --help` when unsure.\n13. `rate_limited` means back off: wait `retry_after_ms`, then retry the\n same command once; never loop on it.\n\n`--endpoint-version` selects a supported compatible contract. It does not lock Price.\nCompatible updates keep the version; older versions work until explicitly retired.\nNew Runs use the selected version's Price at admission. Accepted Runs keep their original Price.\n" : readFileSync4(new URL("../../api/src/http/skill/SKILL.md", import.meta.url), "utf8");
68568
69759
  var SKILL_NAME = "glasser";
68569
69760
  var absolute = (value3, fallback) => value3 !== void 0 && path8.isAbsolute(value3) ? value3 : fallback;
68570
69761
  function agents(env) {
@@ -68674,7 +69865,7 @@ var skill = Command_exports.make("skill").pipe(
68674
69865
  // package.json
68675
69866
  var package_default = {
68676
69867
  name: "@glasser-ai/cli",
68677
- version: "0.1.135",
69868
+ version: "0.1.142",
68678
69869
  description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
68679
69870
  license: "MIT",
68680
69871
  type: "module",