Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts +3 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts +3 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +226 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +223 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/bin/cli +53 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/bin/migration-config.json +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +49 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +49 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.js +76 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +72 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.d.mts +47 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.d.ts +47 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.js +114 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.mjs +98 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.mjs.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +63 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +63 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.js +123 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.mjs +117 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.d.mts +6 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.d.ts +6 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.js +11 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.mjs +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.mjs.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +31 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +31 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.js +282 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.mjs +277 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +1 -0
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const partialParse: (input: string) => unknown;
|
| 2 |
+
export { partialParse };
|
| 3 |
+
//# sourceMappingURL=parser.d.mts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"parser.d.mts","sourceRoot":"","sources":["../../src/_vendor/partial-json-parser/parser.ts"],"names":[],"mappings":"AAKA,QAAA,MAgQE,YAAY,GAAI,OAAO,MAAM,KAAG,OAAgE,CAAC;AAEnG,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const partialParse: (input: string) => unknown;
|
| 2 |
+
export { partialParse };
|
| 3 |
+
//# sourceMappingURL=parser.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/_vendor/partial-json-parser/parser.ts"],"names":[],"mappings":"AAKA,QAAA,M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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.partialParse = void 0;
|
| 4 |
+
const tokenize = (input) => {
|
| 5 |
+
let current = 0;
|
| 6 |
+
let tokens = [];
|
| 7 |
+
while (current < input.length) {
|
| 8 |
+
let char = input[current];
|
| 9 |
+
if (char === '\\') {
|
| 10 |
+
current++;
|
| 11 |
+
continue;
|
| 12 |
+
}
|
| 13 |
+
if (char === '{') {
|
| 14 |
+
tokens.push({
|
| 15 |
+
type: 'brace',
|
| 16 |
+
value: '{',
|
| 17 |
+
});
|
| 18 |
+
current++;
|
| 19 |
+
continue;
|
| 20 |
+
}
|
| 21 |
+
if (char === '}') {
|
| 22 |
+
tokens.push({
|
| 23 |
+
type: 'brace',
|
| 24 |
+
value: '}',
|
| 25 |
+
});
|
| 26 |
+
current++;
|
| 27 |
+
continue;
|
| 28 |
+
}
|
| 29 |
+
if (char === '[') {
|
| 30 |
+
tokens.push({
|
| 31 |
+
type: 'paren',
|
| 32 |
+
value: '[',
|
| 33 |
+
});
|
| 34 |
+
current++;
|
| 35 |
+
continue;
|
| 36 |
+
}
|
| 37 |
+
if (char === ']') {
|
| 38 |
+
tokens.push({
|
| 39 |
+
type: 'paren',
|
| 40 |
+
value: ']',
|
| 41 |
+
});
|
| 42 |
+
current++;
|
| 43 |
+
continue;
|
| 44 |
+
}
|
| 45 |
+
if (char === ':') {
|
| 46 |
+
tokens.push({
|
| 47 |
+
type: 'separator',
|
| 48 |
+
value: ':',
|
| 49 |
+
});
|
| 50 |
+
current++;
|
| 51 |
+
continue;
|
| 52 |
+
}
|
| 53 |
+
if (char === ',') {
|
| 54 |
+
tokens.push({
|
| 55 |
+
type: 'delimiter',
|
| 56 |
+
value: ',',
|
| 57 |
+
});
|
| 58 |
+
current++;
|
| 59 |
+
continue;
|
| 60 |
+
}
|
| 61 |
+
if (char === '"') {
|
| 62 |
+
let value = '';
|
| 63 |
+
let danglingQuote = false;
|
| 64 |
+
char = input[++current];
|
| 65 |
+
while (char !== '"') {
|
| 66 |
+
if (current === input.length) {
|
| 67 |
+
danglingQuote = true;
|
| 68 |
+
break;
|
| 69 |
+
}
|
| 70 |
+
if (char === '\\') {
|
| 71 |
+
current++;
|
| 72 |
+
if (current === input.length) {
|
| 73 |
+
danglingQuote = true;
|
| 74 |
+
break;
|
| 75 |
+
}
|
| 76 |
+
value += char + input[current];
|
| 77 |
+
char = input[++current];
|
| 78 |
+
}
|
| 79 |
+
else {
|
| 80 |
+
value += char;
|
| 81 |
+
char = input[++current];
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
char = input[++current];
|
| 85 |
+
if (!danglingQuote) {
|
| 86 |
+
tokens.push({
|
| 87 |
+
type: 'string',
|
| 88 |
+
value,
|
| 89 |
+
});
|
| 90 |
+
}
|
| 91 |
+
continue;
|
| 92 |
+
}
|
| 93 |
+
let WHITESPACE = /\s/;
|
| 94 |
+
if (char && WHITESPACE.test(char)) {
|
| 95 |
+
current++;
|
| 96 |
+
continue;
|
| 97 |
+
}
|
| 98 |
+
let NUMBERS = /[0-9]/;
|
| 99 |
+
if ((char && NUMBERS.test(char)) || char === '-' || char === '.') {
|
| 100 |
+
let value = '';
|
| 101 |
+
if (char === '-') {
|
| 102 |
+
value += char;
|
| 103 |
+
char = input[++current];
|
| 104 |
+
}
|
| 105 |
+
while ((char && NUMBERS.test(char)) || char === '.') {
|
| 106 |
+
value += char;
|
| 107 |
+
char = input[++current];
|
| 108 |
+
}
|
| 109 |
+
tokens.push({
|
| 110 |
+
type: 'number',
|
| 111 |
+
value,
|
| 112 |
+
});
|
| 113 |
+
continue;
|
| 114 |
+
}
|
| 115 |
+
let LETTERS = /[a-z]/i;
|
| 116 |
+
if (char && LETTERS.test(char)) {
|
| 117 |
+
let value = '';
|
| 118 |
+
while (char && LETTERS.test(char)) {
|
| 119 |
+
if (current === input.length) {
|
| 120 |
+
break;
|
| 121 |
+
}
|
| 122 |
+
value += char;
|
| 123 |
+
char = input[++current];
|
| 124 |
+
}
|
| 125 |
+
if (value == 'true' || value == 'false' || value === 'null') {
|
| 126 |
+
tokens.push({
|
| 127 |
+
type: 'name',
|
| 128 |
+
value,
|
| 129 |
+
});
|
| 130 |
+
}
|
| 131 |
+
else {
|
| 132 |
+
// unknown token, e.g. `nul` which isn't quite `null`
|
| 133 |
+
current++;
|
| 134 |
+
continue;
|
| 135 |
+
}
|
| 136 |
+
continue;
|
| 137 |
+
}
|
| 138 |
+
current++;
|
| 139 |
+
}
|
| 140 |
+
return tokens;
|
| 141 |
+
}, strip = (tokens) => {
|
| 142 |
+
if (tokens.length === 0) {
|
| 143 |
+
return tokens;
|
| 144 |
+
}
|
| 145 |
+
let lastToken = tokens[tokens.length - 1];
|
| 146 |
+
switch (lastToken.type) {
|
| 147 |
+
case 'separator':
|
| 148 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 149 |
+
return strip(tokens);
|
| 150 |
+
break;
|
| 151 |
+
case 'number':
|
| 152 |
+
let lastCharacterOfLastToken = lastToken.value[lastToken.value.length - 1];
|
| 153 |
+
if (lastCharacterOfLastToken === '.' || lastCharacterOfLastToken === '-') {
|
| 154 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 155 |
+
return strip(tokens);
|
| 156 |
+
}
|
| 157 |
+
case 'string':
|
| 158 |
+
let tokenBeforeTheLastToken = tokens[tokens.length - 2];
|
| 159 |
+
if (tokenBeforeTheLastToken?.type === 'delimiter') {
|
| 160 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 161 |
+
return strip(tokens);
|
| 162 |
+
}
|
| 163 |
+
else if (tokenBeforeTheLastToken?.type === 'brace' && tokenBeforeTheLastToken.value === '{') {
|
| 164 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 165 |
+
return strip(tokens);
|
| 166 |
+
}
|
| 167 |
+
break;
|
| 168 |
+
case 'delimiter':
|
| 169 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 170 |
+
return strip(tokens);
|
| 171 |
+
break;
|
| 172 |
+
}
|
| 173 |
+
return tokens;
|
| 174 |
+
}, unstrip = (tokens) => {
|
| 175 |
+
let tail = [];
|
| 176 |
+
tokens.map((token) => {
|
| 177 |
+
if (token.type === 'brace') {
|
| 178 |
+
if (token.value === '{') {
|
| 179 |
+
tail.push('}');
|
| 180 |
+
}
|
| 181 |
+
else {
|
| 182 |
+
tail.splice(tail.lastIndexOf('}'), 1);
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
if (token.type === 'paren') {
|
| 186 |
+
if (token.value === '[') {
|
| 187 |
+
tail.push(']');
|
| 188 |
+
}
|
| 189 |
+
else {
|
| 190 |
+
tail.splice(tail.lastIndexOf(']'), 1);
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
});
|
| 194 |
+
if (tail.length > 0) {
|
| 195 |
+
tail.reverse().map((item) => {
|
| 196 |
+
if (item === '}') {
|
| 197 |
+
tokens.push({
|
| 198 |
+
type: 'brace',
|
| 199 |
+
value: '}',
|
| 200 |
+
});
|
| 201 |
+
}
|
| 202 |
+
else if (item === ']') {
|
| 203 |
+
tokens.push({
|
| 204 |
+
type: 'paren',
|
| 205 |
+
value: ']',
|
| 206 |
+
});
|
| 207 |
+
}
|
| 208 |
+
});
|
| 209 |
+
}
|
| 210 |
+
return tokens;
|
| 211 |
+
}, generate = (tokens) => {
|
| 212 |
+
let output = '';
|
| 213 |
+
tokens.map((token) => {
|
| 214 |
+
switch (token.type) {
|
| 215 |
+
case 'string':
|
| 216 |
+
output += '"' + token.value + '"';
|
| 217 |
+
break;
|
| 218 |
+
default:
|
| 219 |
+
output += token.value;
|
| 220 |
+
break;
|
| 221 |
+
}
|
| 222 |
+
});
|
| 223 |
+
return output;
|
| 224 |
+
}, partialParse = (input) => JSON.parse(generate(unstrip(strip(tokenize(input)))));
|
| 225 |
+
exports.partialParse = partialParse;
|
| 226 |
+
//# sourceMappingURL=parser.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/_vendor/partial-json-parser/parser.ts"],"names":[],"mappings":";;;AAKA,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAW,EAAE;IACxC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,MAAM,GAAY,EAAE,CAAC;IAEzB,OAAO,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAC9B,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAE1B,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,SAAS;QACX,CAAC;QAED,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,GAAG;aACX,CAAC,CA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2 |
+
let current = 0;
|
| 3 |
+
let tokens = [];
|
| 4 |
+
while (current < input.length) {
|
| 5 |
+
let char = input[current];
|
| 6 |
+
if (char === '\\') {
|
| 7 |
+
current++;
|
| 8 |
+
continue;
|
| 9 |
+
}
|
| 10 |
+
if (char === '{') {
|
| 11 |
+
tokens.push({
|
| 12 |
+
type: 'brace',
|
| 13 |
+
value: '{',
|
| 14 |
+
});
|
| 15 |
+
current++;
|
| 16 |
+
continue;
|
| 17 |
+
}
|
| 18 |
+
if (char === '}') {
|
| 19 |
+
tokens.push({
|
| 20 |
+
type: 'brace',
|
| 21 |
+
value: '}',
|
| 22 |
+
});
|
| 23 |
+
current++;
|
| 24 |
+
continue;
|
| 25 |
+
}
|
| 26 |
+
if (char === '[') {
|
| 27 |
+
tokens.push({
|
| 28 |
+
type: 'paren',
|
| 29 |
+
value: '[',
|
| 30 |
+
});
|
| 31 |
+
current++;
|
| 32 |
+
continue;
|
| 33 |
+
}
|
| 34 |
+
if (char === ']') {
|
| 35 |
+
tokens.push({
|
| 36 |
+
type: 'paren',
|
| 37 |
+
value: ']',
|
| 38 |
+
});
|
| 39 |
+
current++;
|
| 40 |
+
continue;
|
| 41 |
+
}
|
| 42 |
+
if (char === ':') {
|
| 43 |
+
tokens.push({
|
| 44 |
+
type: 'separator',
|
| 45 |
+
value: ':',
|
| 46 |
+
});
|
| 47 |
+
current++;
|
| 48 |
+
continue;
|
| 49 |
+
}
|
| 50 |
+
if (char === ',') {
|
| 51 |
+
tokens.push({
|
| 52 |
+
type: 'delimiter',
|
| 53 |
+
value: ',',
|
| 54 |
+
});
|
| 55 |
+
current++;
|
| 56 |
+
continue;
|
| 57 |
+
}
|
| 58 |
+
if (char === '"') {
|
| 59 |
+
let value = '';
|
| 60 |
+
let danglingQuote = false;
|
| 61 |
+
char = input[++current];
|
| 62 |
+
while (char !== '"') {
|
| 63 |
+
if (current === input.length) {
|
| 64 |
+
danglingQuote = true;
|
| 65 |
+
break;
|
| 66 |
+
}
|
| 67 |
+
if (char === '\\') {
|
| 68 |
+
current++;
|
| 69 |
+
if (current === input.length) {
|
| 70 |
+
danglingQuote = true;
|
| 71 |
+
break;
|
| 72 |
+
}
|
| 73 |
+
value += char + input[current];
|
| 74 |
+
char = input[++current];
|
| 75 |
+
}
|
| 76 |
+
else {
|
| 77 |
+
value += char;
|
| 78 |
+
char = input[++current];
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
char = input[++current];
|
| 82 |
+
if (!danglingQuote) {
|
| 83 |
+
tokens.push({
|
| 84 |
+
type: 'string',
|
| 85 |
+
value,
|
| 86 |
+
});
|
| 87 |
+
}
|
| 88 |
+
continue;
|
| 89 |
+
}
|
| 90 |
+
let WHITESPACE = /\s/;
|
| 91 |
+
if (char && WHITESPACE.test(char)) {
|
| 92 |
+
current++;
|
| 93 |
+
continue;
|
| 94 |
+
}
|
| 95 |
+
let NUMBERS = /[0-9]/;
|
| 96 |
+
if ((char && NUMBERS.test(char)) || char === '-' || char === '.') {
|
| 97 |
+
let value = '';
|
| 98 |
+
if (char === '-') {
|
| 99 |
+
value += char;
|
| 100 |
+
char = input[++current];
|
| 101 |
+
}
|
| 102 |
+
while ((char && NUMBERS.test(char)) || char === '.') {
|
| 103 |
+
value += char;
|
| 104 |
+
char = input[++current];
|
| 105 |
+
}
|
| 106 |
+
tokens.push({
|
| 107 |
+
type: 'number',
|
| 108 |
+
value,
|
| 109 |
+
});
|
| 110 |
+
continue;
|
| 111 |
+
}
|
| 112 |
+
let LETTERS = /[a-z]/i;
|
| 113 |
+
if (char && LETTERS.test(char)) {
|
| 114 |
+
let value = '';
|
| 115 |
+
while (char && LETTERS.test(char)) {
|
| 116 |
+
if (current === input.length) {
|
| 117 |
+
break;
|
| 118 |
+
}
|
| 119 |
+
value += char;
|
| 120 |
+
char = input[++current];
|
| 121 |
+
}
|
| 122 |
+
if (value == 'true' || value == 'false' || value === 'null') {
|
| 123 |
+
tokens.push({
|
| 124 |
+
type: 'name',
|
| 125 |
+
value,
|
| 126 |
+
});
|
| 127 |
+
}
|
| 128 |
+
else {
|
| 129 |
+
// unknown token, e.g. `nul` which isn't quite `null`
|
| 130 |
+
current++;
|
| 131 |
+
continue;
|
| 132 |
+
}
|
| 133 |
+
continue;
|
| 134 |
+
}
|
| 135 |
+
current++;
|
| 136 |
+
}
|
| 137 |
+
return tokens;
|
| 138 |
+
}, strip = (tokens) => {
|
| 139 |
+
if (tokens.length === 0) {
|
| 140 |
+
return tokens;
|
| 141 |
+
}
|
| 142 |
+
let lastToken = tokens[tokens.length - 1];
|
| 143 |
+
switch (lastToken.type) {
|
| 144 |
+
case 'separator':
|
| 145 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 146 |
+
return strip(tokens);
|
| 147 |
+
break;
|
| 148 |
+
case 'number':
|
| 149 |
+
let lastCharacterOfLastToken = lastToken.value[lastToken.value.length - 1];
|
| 150 |
+
if (lastCharacterOfLastToken === '.' || lastCharacterOfLastToken === '-') {
|
| 151 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 152 |
+
return strip(tokens);
|
| 153 |
+
}
|
| 154 |
+
case 'string':
|
| 155 |
+
let tokenBeforeTheLastToken = tokens[tokens.length - 2];
|
| 156 |
+
if (tokenBeforeTheLastToken?.type === 'delimiter') {
|
| 157 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 158 |
+
return strip(tokens);
|
| 159 |
+
}
|
| 160 |
+
else if (tokenBeforeTheLastToken?.type === 'brace' && tokenBeforeTheLastToken.value === '{') {
|
| 161 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 162 |
+
return strip(tokens);
|
| 163 |
+
}
|
| 164 |
+
break;
|
| 165 |
+
case 'delimiter':
|
| 166 |
+
tokens = tokens.slice(0, tokens.length - 1);
|
| 167 |
+
return strip(tokens);
|
| 168 |
+
break;
|
| 169 |
+
}
|
| 170 |
+
return tokens;
|
| 171 |
+
}, unstrip = (tokens) => {
|
| 172 |
+
let tail = [];
|
| 173 |
+
tokens.map((token) => {
|
| 174 |
+
if (token.type === 'brace') {
|
| 175 |
+
if (token.value === '{') {
|
| 176 |
+
tail.push('}');
|
| 177 |
+
}
|
| 178 |
+
else {
|
| 179 |
+
tail.splice(tail.lastIndexOf('}'), 1);
|
| 180 |
+
}
|
| 181 |
+
}
|
| 182 |
+
if (token.type === 'paren') {
|
| 183 |
+
if (token.value === '[') {
|
| 184 |
+
tail.push(']');
|
| 185 |
+
}
|
| 186 |
+
else {
|
| 187 |
+
tail.splice(tail.lastIndexOf(']'), 1);
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
});
|
| 191 |
+
if (tail.length > 0) {
|
| 192 |
+
tail.reverse().map((item) => {
|
| 193 |
+
if (item === '}') {
|
| 194 |
+
tokens.push({
|
| 195 |
+
type: 'brace',
|
| 196 |
+
value: '}',
|
| 197 |
+
});
|
| 198 |
+
}
|
| 199 |
+
else if (item === ']') {
|
| 200 |
+
tokens.push({
|
| 201 |
+
type: 'paren',
|
| 202 |
+
value: ']',
|
| 203 |
+
});
|
| 204 |
+
}
|
| 205 |
+
});
|
| 206 |
+
}
|
| 207 |
+
return tokens;
|
| 208 |
+
}, generate = (tokens) => {
|
| 209 |
+
let output = '';
|
| 210 |
+
tokens.map((token) => {
|
| 211 |
+
switch (token.type) {
|
| 212 |
+
case 'string':
|
| 213 |
+
output += '"' + token.value + '"';
|
| 214 |
+
break;
|
| 215 |
+
default:
|
| 216 |
+
output += token.value;
|
| 217 |
+
break;
|
| 218 |
+
}
|
| 219 |
+
});
|
| 220 |
+
return output;
|
| 221 |
+
}, partialParse = (input) => JSON.parse(generate(unstrip(strip(tokenize(input)))));
|
| 222 |
+
export { partialParse };
|
| 223 |
+
//# sourceMappingURL=parser.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"parser.mjs","source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C"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/bin/cli
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
const { spawnSync } = require('child_process');
|
| 4 |
+
|
| 5 |
+
const commands = {
|
| 6 |
+
migrate: {
|
| 7 |
+
description:
|
| 8 |
+
'Run migrations to update your code using @anthropic-ai/sdk@0.41 to be compatible with @anthropic-ai/sdk@0.50',
|
| 9 |
+
fn: () => {
|
| 10 |
+
const result = spawnSync(
|
| 11 |
+
'npx',
|
| 12 |
+
[
|
| 13 |
+
'-y',
|
| 14 |
+
'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz',
|
| 15 |
+
'--migrationConfig',
|
| 16 |
+
require.resolve('./migration-config.json'),
|
| 17 |
+
...process.argv.slice(3),
|
| 18 |
+
],
|
| 19 |
+
{ stdio: 'inherit' },
|
| 20 |
+
);
|
| 21 |
+
if (result.status !== 0) {
|
| 22 |
+
process.exit(result.status);
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
},
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
function exitWithHelp() {
|
| 29 |
+
console.log(`Usage: anthropic-ai-sdk <subcommand>`);
|
| 30 |
+
console.log();
|
| 31 |
+
console.log('Subcommands:');
|
| 32 |
+
|
| 33 |
+
for (const [name, info] of Object.entries(commands)) {
|
| 34 |
+
console.log(` ${name} ${info.description}`);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
console.log();
|
| 38 |
+
process.exit(1);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
if (process.argv.length < 3) {
|
| 42 |
+
exitWithHelp();
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
const commandName = process.argv[2];
|
| 46 |
+
|
| 47 |
+
const command = commands[commandName];
|
| 48 |
+
if (!command) {
|
| 49 |
+
console.log(`Unknown subcommand ${commandName}.`);
|
| 50 |
+
exitWithHelp();
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
command.fn();
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/bin/migration-config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"pkg": "@anthropic-ai/sdk",
|
| 3 |
+
"githubRepo": "https://github.com/anthropics/anthropic-sdk-typescript",
|
| 4 |
+
"clientClass": "Anthropic",
|
| 5 |
+
"baseClientClass": "BaseAnthropic",
|
| 6 |
+
"methods": []
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type BaseAnthropic } from "../client.mjs";
|
| 2 |
+
import { type PromiseOrValue } from "../internal/types.mjs";
|
| 3 |
+
import { type APIResponseProps, type WithRequestID } from "../internal/parse.mjs";
|
| 4 |
+
/**
|
| 5 |
+
* A subclass of `Promise` providing additional helper methods
|
| 6 |
+
* for interacting with the SDK.
|
| 7 |
+
*/
|
| 8 |
+
export declare class APIPromise<T> extends Promise<WithRequestID<T>> {
|
| 9 |
+
#private;
|
| 10 |
+
private responsePromise;
|
| 11 |
+
private parseResponse;
|
| 12 |
+
private parsedPromise;
|
| 13 |
+
constructor(client: BaseAnthropic, responsePromise: Promise<APIResponseProps>, parseResponse?: (client: BaseAnthropic, props: APIResponseProps) => PromiseOrValue<WithRequestID<T>>);
|
| 14 |
+
_thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U>;
|
| 15 |
+
/**
|
| 16 |
+
* Gets the raw `Response` instance instead of parsing the response
|
| 17 |
+
* data.
|
| 18 |
+
*
|
| 19 |
+
* If you want to parse the response body but still get the `Response`
|
| 20 |
+
* instance, you can use {@link withResponse()}.
|
| 21 |
+
*
|
| 22 |
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
| 23 |
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
| 24 |
+
* to your `tsconfig.json`.
|
| 25 |
+
*/
|
| 26 |
+
asResponse(): Promise<Response>;
|
| 27 |
+
/**
|
| 28 |
+
* Gets the parsed response data, the raw `Response` instance and the ID of the request,
|
| 29 |
+
* returned via the `request-id` header which is useful for debugging requests and resporting
|
| 30 |
+
* issues to Anthropic.
|
| 31 |
+
*
|
| 32 |
+
* If you just want to get the raw `Response` instance without parsing it,
|
| 33 |
+
* you can use {@link asResponse()}.
|
| 34 |
+
*
|
| 35 |
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
| 36 |
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
| 37 |
+
* to your `tsconfig.json`.
|
| 38 |
+
*/
|
| 39 |
+
withResponse(): Promise<{
|
| 40 |
+
data: T;
|
| 41 |
+
response: Response;
|
| 42 |
+
request_id: string | null | undefined;
|
| 43 |
+
}>;
|
| 44 |
+
private parse;
|
| 45 |
+
then<TResult1 = WithRequestID<T>, TResult2 = never>(onfulfilled?: ((value: WithRequestID<T>) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
| 46 |
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<WithRequestID<T> | TResult>;
|
| 47 |
+
finally(onfinally?: (() => void) | undefined | null): Promise<WithRequestID<T>>;
|
| 48 |
+
}
|
| 49 |
+
//# sourceMappingURL=api-promise.d.mts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"api-promise.d.mts","sourceRoot":"","sources":["../src/core/api-promise.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,aAAa,EAAE;OAEtB,EAAE,KAAK,cAAc,EAAE;OACvB,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAGnB;AAED;;;GAGG;AACH,qBAAa,UAAU,CAAC,CAAC,CAAE,SAAQ,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;;IAMxD,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,aAAa;IANvB,OAAO,CAAC,aAAa,CAAwC;gBAI3D,MAAM,EAAE,aAAa,EACb,eAAe,EAAE,OAAO,CAAC,gBAAgB,CAAC,EAC1C,aAAa,GAAE,CACrB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,gBAAgB,KACpB,cAAc,CAAC,aAAa,CAAC,CAAC,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/@anthropic-ai/sdk/core/api-promise.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type BaseAnthropic } from "../client.js";
|
| 2 |
+
import { type PromiseOrValue } from "../internal/types.js";
|
| 3 |
+
import { type APIResponseProps, type WithRequestID } from "../internal/parse.js";
|
| 4 |
+
/**
|
| 5 |
+
* A subclass of `Promise` providing additional helper methods
|
| 6 |
+
* for interacting with the SDK.
|
| 7 |
+
*/
|
| 8 |
+
export declare class APIPromise<T> extends Promise<WithRequestID<T>> {
|
| 9 |
+
#private;
|
| 10 |
+
private responsePromise;
|
| 11 |
+
private parseResponse;
|
| 12 |
+
private parsedPromise;
|
| 13 |
+
constructor(client: BaseAnthropic, responsePromise: Promise<APIResponseProps>, parseResponse?: (client: BaseAnthropic, props: APIResponseProps) => PromiseOrValue<WithRequestID<T>>);
|
| 14 |
+
_thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U>;
|
| 15 |
+
/**
|
| 16 |
+
* Gets the raw `Response` instance instead of parsing the response
|
| 17 |
+
* data.
|
| 18 |
+
*
|
| 19 |
+
* If you want to parse the response body but still get the `Response`
|
| 20 |
+
* instance, you can use {@link withResponse()}.
|
| 21 |
+
*
|
| 22 |
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
| 23 |
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
| 24 |
+
* to your `tsconfig.json`.
|
| 25 |
+
*/
|
| 26 |
+
asResponse(): Promise<Response>;
|
| 27 |
+
/**
|
| 28 |
+
* Gets the parsed response data, the raw `Response` instance and the ID of the request,
|
| 29 |
+
* returned via the `request-id` header which is useful for debugging requests and resporting
|
| 30 |
+
* issues to Anthropic.
|
| 31 |
+
*
|
| 32 |
+
* If you just want to get the raw `Response` instance without parsing it,
|
| 33 |
+
* you can use {@link asResponse()}.
|
| 34 |
+
*
|
| 35 |
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
| 36 |
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
| 37 |
+
* to your `tsconfig.json`.
|
| 38 |
+
*/
|
| 39 |
+
withResponse(): Promise<{
|
| 40 |
+
data: T;
|
| 41 |
+
response: Response;
|
| 42 |
+
request_id: string | null | undefined;
|
| 43 |
+
}>;
|
| 44 |
+
private parse;
|
| 45 |
+
then<TResult1 = WithRequestID<T>, TResult2 = never>(onfulfilled?: ((value: WithRequestID<T>) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
| 46 |
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<WithRequestID<T> | TResult>;
|
| 47 |
+
finally(onfinally?: (() => void) | undefined | null): Promise<WithRequestID<T>>;
|
| 48 |
+
}
|
| 49 |
+
//# sourceMappingURL=api-promise.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"api-promise.d.ts","sourceRoot":"","sources":["../src/core/api-promise.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,aAAa,EAAE;OAEtB,EAAE,KAAK,cAAc,EAAE;OACvB,EACL,KAAK,gBAAgB,EACrB,KAAK,aA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B,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAChF,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAI7B,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAGzF"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 3 |
+
var _APIPromise_client;
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.APIPromise = void 0;
|
| 6 |
+
const tslib_1 = require("../internal/tslib.js");
|
| 7 |
+
const parse_1 = require("../internal/parse.js");
|
| 8 |
+
/**
|
| 9 |
+
* A subclass of `Promise` providing additional helper methods
|
| 10 |
+
* for interacting with the SDK.
|
| 11 |
+
*/
|
| 12 |
+
class APIPromise extends Promise {
|
| 13 |
+
constructor(client, responsePromise, parseResponse = parse_1.defaultParseResponse) {
|
| 14 |
+
super((resolve) => {
|
| 15 |
+
// this is maybe a bit weird but this has to be a no-op to not implicitly
|
| 16 |
+
// parse the response body; instead .then, .catch, .finally are overridden
|
| 17 |
+
// to parse the response
|
| 18 |
+
resolve(null);
|
| 19 |
+
});
|
| 20 |
+
this.responsePromise = responsePromise;
|
| 21 |
+
this.parseResponse = parseResponse;
|
| 22 |
+
_APIPromise_client.set(this, void 0);
|
| 23 |
+
tslib_1.__classPrivateFieldSet(this, _APIPromise_client, client, "f");
|
| 24 |
+
}
|
| 25 |
+
_thenUnwrap(transform) {
|
| 26 |
+
return new APIPromise(tslib_1.__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => (0, parse_1.addRequestID)(transform(await this.parseResponse(client, props), props), props.response));
|
| 27 |
+
}
|
| 28 |
+
/**
|
| 29 |
+
* Gets the raw `Response` instance instead of parsing the response
|
| 30 |
+
* data.
|
| 31 |
+
*
|
| 32 |
+
* If you want to parse the response body but still get the `Response`
|
| 33 |
+
* instance, you can use {@link withResponse()}.
|
| 34 |
+
*
|
| 35 |
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
| 36 |
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
| 37 |
+
* to your `tsconfig.json`.
|
| 38 |
+
*/
|
| 39 |
+
asResponse() {
|
| 40 |
+
return this.responsePromise.then((p) => p.response);
|
| 41 |
+
}
|
| 42 |
+
/**
|
| 43 |
+
* Gets the parsed response data, the raw `Response` instance and the ID of the request,
|
| 44 |
+
* returned via the `request-id` header which is useful for debugging requests and resporting
|
| 45 |
+
* issues to Anthropic.
|
| 46 |
+
*
|
| 47 |
+
* If you just want to get the raw `Response` instance without parsing it,
|
| 48 |
+
* you can use {@link asResponse()}.
|
| 49 |
+
*
|
| 50 |
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
| 51 |
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
| 52 |
+
* to your `tsconfig.json`.
|
| 53 |
+
*/
|
| 54 |
+
async withResponse() {
|
| 55 |
+
const [data, response] = await Promise.all([this.parse(), this.asResponse()]);
|
| 56 |
+
return { data, response, request_id: response.headers.get('request-id') };
|
| 57 |
+
}
|
| 58 |
+
parse() {
|
| 59 |
+
if (!this.parsedPromise) {
|
| 60 |
+
this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(tslib_1.__classPrivateFieldGet(this, _APIPromise_client, "f"), data));
|
| 61 |
+
}
|
| 62 |
+
return this.parsedPromise;
|
| 63 |
+
}
|
| 64 |
+
then(onfulfilled, onrejected) {
|
| 65 |
+
return this.parse().then(onfulfilled, onrejected);
|
| 66 |
+
}
|
| 67 |
+
catch(onrejected) {
|
| 68 |
+
return this.parse().catch(onrejected);
|
| 69 |
+
}
|
| 70 |
+
finally(onfinally) {
|
| 71 |
+
return this.parse().finally(onfinally);
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
exports.APIPromise = APIPromise;
|
| 75 |
+
_APIPromise_client = new WeakMap();
|
| 76 |
+
//# sourceMappingURL=api-promise.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"api-promise.js","sourceRoot":"","sources":["../src/core/api-promise.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;AAKtF,gDAK2B;AAE3B;;;GAGG;AACH,MAAa,UAAc,SAAQ,OAAyB;IAI1D,YACE,MAAqB,EACb,eAA0C,EAC1C,gBAGgC,4BAAoB;QAE5D,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE;YAChB,yEAAyE;YACzE,0EAA0E;Y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AAqC,CACrF,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEQ,IAAI,CACX,WAAgG,EAChG,UAAmF;QAEnF,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAEQ,KAAK,CACZ,UAAiF;QAEjF,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAEQ,OAAO,CAAC,SAA2C;QAC1D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AApFD,gCAoFC"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.mjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
var _APIPromise_client;
|
| 3 |
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "../internal/tslib.mjs";
|
| 4 |
+
import { defaultParseResponse, addRequestID, } from "../internal/parse.mjs";
|
| 5 |
+
/**
|
| 6 |
+
* A subclass of `Promise` providing additional helper methods
|
| 7 |
+
* for interacting with the SDK.
|
| 8 |
+
*/
|
| 9 |
+
export class APIPromise extends Promise {
|
| 10 |
+
constructor(client, responsePromise, parseResponse = defaultParseResponse) {
|
| 11 |
+
super((resolve) => {
|
| 12 |
+
// this is maybe a bit weird but this has to be a no-op to not implicitly
|
| 13 |
+
// parse the response body; instead .then, .catch, .finally are overridden
|
| 14 |
+
// to parse the response
|
| 15 |
+
resolve(null);
|
| 16 |
+
});
|
| 17 |
+
this.responsePromise = responsePromise;
|
| 18 |
+
this.parseResponse = parseResponse;
|
| 19 |
+
_APIPromise_client.set(this, void 0);
|
| 20 |
+
__classPrivateFieldSet(this, _APIPromise_client, client, "f");
|
| 21 |
+
}
|
| 22 |
+
_thenUnwrap(transform) {
|
| 23 |
+
return new APIPromise(__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => addRequestID(transform(await this.parseResponse(client, props), props), props.response));
|
| 24 |
+
}
|
| 25 |
+
/**
|
| 26 |
+
* Gets the raw `Response` instance instead of parsing the response
|
| 27 |
+
* data.
|
| 28 |
+
*
|
| 29 |
+
* If you want to parse the response body but still get the `Response`
|
| 30 |
+
* instance, you can use {@link withResponse()}.
|
| 31 |
+
*
|
| 32 |
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
| 33 |
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
| 34 |
+
* to your `tsconfig.json`.
|
| 35 |
+
*/
|
| 36 |
+
asResponse() {
|
| 37 |
+
return this.responsePromise.then((p) => p.response);
|
| 38 |
+
}
|
| 39 |
+
/**
|
| 40 |
+
* Gets the parsed response data, the raw `Response` instance and the ID of the request,
|
| 41 |
+
* returned via the `request-id` header which is useful for debugging requests and resporting
|
| 42 |
+
* issues to Anthropic.
|
| 43 |
+
*
|
| 44 |
+
* If you just want to get the raw `Response` instance without parsing it,
|
| 45 |
+
* you can use {@link asResponse()}.
|
| 46 |
+
*
|
| 47 |
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
| 48 |
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
| 49 |
+
* to your `tsconfig.json`.
|
| 50 |
+
*/
|
| 51 |
+
async withResponse() {
|
| 52 |
+
const [data, response] = await Promise.all([this.parse(), this.asResponse()]);
|
| 53 |
+
return { data, response, request_id: response.headers.get('request-id') };
|
| 54 |
+
}
|
| 55 |
+
parse() {
|
| 56 |
+
if (!this.parsedPromise) {
|
| 57 |
+
this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, "f"), data));
|
| 58 |
+
}
|
| 59 |
+
return this.parsedPromise;
|
| 60 |
+
}
|
| 61 |
+
then(onfulfilled, onrejected) {
|
| 62 |
+
return this.parse().then(onfulfilled, onrejected);
|
| 63 |
+
}
|
| 64 |
+
catch(onrejected) {
|
| 65 |
+
return this.parse().catch(onrejected);
|
| 66 |
+
}
|
| 67 |
+
finally(onfinally) {
|
| 68 |
+
return this.parse().finally(onfinally);
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
_APIPromise_client = new WeakMap();
|
| 72 |
+
//# sourceMappingURL=api-promise.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"api-promise.mjs","sourceRoot":"","sources":["../src/core/api-promise.ts"],"names":[],"mappings":"AAAA,sFAAsF;;;OAK/E,EAGL,oBAAoB,EACpB,YAAY,GACb;AAED;;;GAGG;AACH,MAAM,OAAO,UAAc,SAAQ,OAAyB;IAI1D,YACE,MAAqB,EACb,eAA0C,EAC1C,gBAGgC,oBAAoB;QAE5D,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE;YAChB,yEA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EAAE,IAAI,CAAqC,CACrF,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEQ,IAAI,CACX,WAAgG,EAChG,UAAmF;QAEnF,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAEQ,KAAK,CACZ,UAAiF;QAEjF,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAEQ,OAAO,CAAC,SAA2C;QAC1D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.d.mts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare class AnthropicError extends Error {
|
| 2 |
+
}
|
| 3 |
+
export declare class APIError<TStatus extends number | undefined = number | undefined, THeaders extends Headers | undefined = Headers | undefined, TError extends Object | undefined = Object | undefined> extends AnthropicError {
|
| 4 |
+
/** HTTP status for the response that caused the error */
|
| 5 |
+
readonly status: TStatus;
|
| 6 |
+
/** HTTP headers for the response that caused the error */
|
| 7 |
+
readonly headers: THeaders;
|
| 8 |
+
/** JSON body of the response that caused the error */
|
| 9 |
+
readonly error: TError;
|
| 10 |
+
readonly requestID: string | null | undefined;
|
| 11 |
+
constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders);
|
| 12 |
+
private static makeMessage;
|
| 13 |
+
static generate(status: number | undefined, errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined): APIError;
|
| 14 |
+
}
|
| 15 |
+
export declare class APIUserAbortError extends APIError<undefined, undefined, undefined> {
|
| 16 |
+
constructor({ message }?: {
|
| 17 |
+
message?: string;
|
| 18 |
+
});
|
| 19 |
+
}
|
| 20 |
+
export declare class APIConnectionError extends APIError<undefined, undefined, undefined> {
|
| 21 |
+
constructor({ message, cause }: {
|
| 22 |
+
message?: string | undefined;
|
| 23 |
+
cause?: Error | undefined;
|
| 24 |
+
});
|
| 25 |
+
}
|
| 26 |
+
export declare class APIConnectionTimeoutError extends APIConnectionError {
|
| 27 |
+
constructor({ message }?: {
|
| 28 |
+
message?: string;
|
| 29 |
+
});
|
| 30 |
+
}
|
| 31 |
+
export declare class BadRequestError extends APIError<400, Headers> {
|
| 32 |
+
}
|
| 33 |
+
export declare class AuthenticationError extends APIError<401, Headers> {
|
| 34 |
+
}
|
| 35 |
+
export declare class PermissionDeniedError extends APIError<403, Headers> {
|
| 36 |
+
}
|
| 37 |
+
export declare class NotFoundError extends APIError<404, Headers> {
|
| 38 |
+
}
|
| 39 |
+
export declare class ConflictError extends APIError<409, Headers> {
|
| 40 |
+
}
|
| 41 |
+
export declare class UnprocessableEntityError extends APIError<422, Headers> {
|
| 42 |
+
}
|
| 43 |
+
export declare class RateLimitError extends APIError<429, Headers> {
|
| 44 |
+
}
|
| 45 |
+
export declare class InternalServerError extends APIError<number, Headers> {
|
| 46 |
+
}
|
| 47 |
+
//# sourceMappingURL=error.d.mts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"error.d.mts","sourceRoot":"","sources":["../src/core/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<TStatus extends number | undefined = number | undefined, THeaders extends Headers | undefined = Headers | undefined, TError extends Object | undefined = Object | undefined> extends AnthropicError {
|
| 4 |
+
/** HTTP status for the response that caused the error */
|
| 5 |
+
readonly status: TStatus;
|
| 6 |
+
/** HTTP headers for the response that caused the error */
|
| 7 |
+
readonly headers: THeaders;
|
| 8 |
+
/** JSON body of the response that caused the error */
|
| 9 |
+
readonly error: TError;
|
| 10 |
+
readonly requestID: string | null | undefined;
|
| 11 |
+
constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders);
|
| 12 |
+
private static makeMessage;
|
| 13 |
+
static generate(status: number | undefined, errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined): APIError;
|
| 14 |
+
}
|
| 15 |
+
export declare class APIUserAbortError extends APIError<undefined, undefined, undefined> {
|
| 16 |
+
constructor({ message }?: {
|
| 17 |
+
message?: string;
|
| 18 |
+
});
|
| 19 |
+
}
|
| 20 |
+
export declare class APIConnectionError extends APIError<undefined, undefined, undefined> {
|
| 21 |
+
constructor({ message, cause }: {
|
| 22 |
+
message?: string | undefined;
|
| 23 |
+
cause?: Error | undefined;
|
| 24 |
+
});
|
| 25 |
+
}
|
| 26 |
+
export declare class APIConnectionTimeoutError extends APIConnectionError {
|
| 27 |
+
constructor({ message }?: {
|
| 28 |
+
message?: string;
|
| 29 |
+
});
|
| 30 |
+
}
|
| 31 |
+
export declare class BadRequestError extends APIError<400, Headers> {
|
| 32 |
+
}
|
| 33 |
+
export declare class AuthenticationError extends APIError<401, Headers> {
|
| 34 |
+
}
|
| 35 |
+
export declare class PermissionDeniedError extends APIError<403, Headers> {
|
| 36 |
+
}
|
| 37 |
+
export declare class NotFoundError extends APIError<404, Headers> {
|
| 38 |
+
}
|
| 39 |
+
export declare class ConflictError extends APIError<409, Headers> {
|
| 40 |
+
}
|
| 41 |
+
export declare class UnprocessableEntityError extends APIError<422, Headers> {
|
| 42 |
+
}
|
| 43 |
+
export declare class RateLimitError extends APIError<429, Headers> {
|
| 44 |
+
}
|
| 45 |
+
export declare class InternalServerError extends APIError<number, Headers> {
|
| 46 |
+
}
|
| 47 |
+
//# sourceMappingURL=error.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/core/error.ts"],"names":[],"mappings":"AAIA,qBAAa,cAAe,SAAQ,KAAK;CAAG;AAE5C,qBAAa,QAAQ,CACnB,OAAO,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EACvD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAC1D,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CACtD,SAAQ,cAAc;IACtB,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,QAAQ;IAQ1F,OAAO,CAAC,MAAM,CAAC,WAAW;IAqB1B,MAAM,CAAC,QAAQ,CACb,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,QAAQ;CAyCZ;AAED,qBAAa,iBAAkB,SAAQ,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;gBAClE,EAAE,OAA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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 3 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 4 |
+
exports.InternalServerError = exports.RateLimitError = exports.UnprocessableEntityError = exports.ConflictError = exports.NotFoundError = exports.PermissionDeniedError = exports.AuthenticationError = exports.BadRequestError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIUserAbortError = exports.APIError = exports.AnthropicError = void 0;
|
| 5 |
+
const errors_1 = require("../internal/errors.js");
|
| 6 |
+
class AnthropicError extends Error {
|
| 7 |
+
}
|
| 8 |
+
exports.AnthropicError = AnthropicError;
|
| 9 |
+
class APIError extends AnthropicError {
|
| 10 |
+
constructor(status, error, message, headers) {
|
| 11 |
+
super(`${APIError.makeMessage(status, error, message)}`);
|
| 12 |
+
this.status = status;
|
| 13 |
+
this.headers = headers;
|
| 14 |
+
this.requestID = headers?.get('request-id');
|
| 15 |
+
this.error = error;
|
| 16 |
+
}
|
| 17 |
+
static makeMessage(status, error, message) {
|
| 18 |
+
const msg = error?.message ?
|
| 19 |
+
typeof error.message === 'string' ?
|
| 20 |
+
error.message
|
| 21 |
+
: JSON.stringify(error.message)
|
| 22 |
+
: error ? JSON.stringify(error)
|
| 23 |
+
: message;
|
| 24 |
+
if (status && msg) {
|
| 25 |
+
return `${status} ${msg}`;
|
| 26 |
+
}
|
| 27 |
+
if (status) {
|
| 28 |
+
return `${status} status code (no body)`;
|
| 29 |
+
}
|
| 30 |
+
if (msg) {
|
| 31 |
+
return msg;
|
| 32 |
+
}
|
| 33 |
+
return '(no status code or body)';
|
| 34 |
+
}
|
| 35 |
+
static generate(status, errorResponse, message, headers) {
|
| 36 |
+
if (!status || !headers) {
|
| 37 |
+
return new APIConnectionError({ message, cause: (0, errors_1.castToError)(errorResponse) });
|
| 38 |
+
}
|
| 39 |
+
const error = errorResponse;
|
| 40 |
+
if (status === 400) {
|
| 41 |
+
return new BadRequestError(status, error, message, headers);
|
| 42 |
+
}
|
| 43 |
+
if (status === 401) {
|
| 44 |
+
return new AuthenticationError(status, error, message, headers);
|
| 45 |
+
}
|
| 46 |
+
if (status === 403) {
|
| 47 |
+
return new PermissionDeniedError(status, error, message, headers);
|
| 48 |
+
}
|
| 49 |
+
if (status === 404) {
|
| 50 |
+
return new NotFoundError(status, error, message, headers);
|
| 51 |
+
}
|
| 52 |
+
if (status === 409) {
|
| 53 |
+
return new ConflictError(status, error, message, headers);
|
| 54 |
+
}
|
| 55 |
+
if (status === 422) {
|
| 56 |
+
return new UnprocessableEntityError(status, error, message, headers);
|
| 57 |
+
}
|
| 58 |
+
if (status === 429) {
|
| 59 |
+
return new RateLimitError(status, error, message, headers);
|
| 60 |
+
}
|
| 61 |
+
if (status >= 500) {
|
| 62 |
+
return new InternalServerError(status, error, message, headers);
|
| 63 |
+
}
|
| 64 |
+
return new APIError(status, error, message, headers);
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
exports.APIError = APIError;
|
| 68 |
+
class APIUserAbortError extends APIError {
|
| 69 |
+
constructor({ message } = {}) {
|
| 70 |
+
super(undefined, undefined, message || 'Request was aborted.', undefined);
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
exports.APIUserAbortError = APIUserAbortError;
|
| 74 |
+
class APIConnectionError extends APIError {
|
| 75 |
+
constructor({ message, cause }) {
|
| 76 |
+
super(undefined, undefined, message || 'Connection error.', undefined);
|
| 77 |
+
// in some environments the 'cause' property is already declared
|
| 78 |
+
// @ts-ignore
|
| 79 |
+
if (cause)
|
| 80 |
+
this.cause = cause;
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
exports.APIConnectionError = APIConnectionError;
|
| 84 |
+
class APIConnectionTimeoutError extends APIConnectionError {
|
| 85 |
+
constructor({ message } = {}) {
|
| 86 |
+
super({ message: message ?? 'Request timed out.' });
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
exports.APIConnectionTimeoutError = APIConnectionTimeoutError;
|
| 90 |
+
class BadRequestError extends APIError {
|
| 91 |
+
}
|
| 92 |
+
exports.BadRequestError = BadRequestError;
|
| 93 |
+
class AuthenticationError extends APIError {
|
| 94 |
+
}
|
| 95 |
+
exports.AuthenticationError = AuthenticationError;
|
| 96 |
+
class PermissionDeniedError extends APIError {
|
| 97 |
+
}
|
| 98 |
+
exports.PermissionDeniedError = PermissionDeniedError;
|
| 99 |
+
class NotFoundError extends APIError {
|
| 100 |
+
}
|
| 101 |
+
exports.NotFoundError = NotFoundError;
|
| 102 |
+
class ConflictError extends APIError {
|
| 103 |
+
}
|
| 104 |
+
exports.ConflictError = ConflictError;
|
| 105 |
+
class UnprocessableEntityError extends APIError {
|
| 106 |
+
}
|
| 107 |
+
exports.UnprocessableEntityError = UnprocessableEntityError;
|
| 108 |
+
class RateLimitError extends APIError {
|
| 109 |
+
}
|
| 110 |
+
exports.RateLimitError = RateLimitError;
|
| 111 |
+
class InternalServerError extends APIError {
|
| 112 |
+
}
|
| 113 |
+
exports.InternalServerError = InternalServerError;
|
| 114 |
+
//# sourceMappingURL=error.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/core/error.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAAiD;AAEjD,MAAa,cAAe,SAAQ,KAAK;CAAG;AAA5C,wCAA4C;AAE5C,MAAa,QAIX,SAAQ,cAAc;IAUtB,YAAY,MAAe,EAAE,KAAa,EAAE,OAA2B,EAAE,OAAiB;QACxF,KAAK,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,OAAO,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEO,MAAM,CAAC,WAAW,CAAC,MAA0B,EAAE,KAAU,EAAE,OAA2B;QAC5F,MAAM,GAAG,GACP,KAAK,EAAE,OAAO,CAAC,CAAC;YACd,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC;gBACjC,KAAK,CAAC,OAAO;gBACf,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC;YACjC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;gBAC/B,CAAC,CAAC,OAAO,CAAC;QAEZ,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;YAClB,OAAO,GAAG,MAA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UTING.md for details.
|
| 2 |
+
import { castToError } from "../internal/errors.mjs";
|
| 3 |
+
export class AnthropicError extends Error {
|
| 4 |
+
}
|
| 5 |
+
export class APIError extends AnthropicError {
|
| 6 |
+
constructor(status, error, message, headers) {
|
| 7 |
+
super(`${APIError.makeMessage(status, error, message)}`);
|
| 8 |
+
this.status = status;
|
| 9 |
+
this.headers = headers;
|
| 10 |
+
this.requestID = headers?.get('request-id');
|
| 11 |
+
this.error = error;
|
| 12 |
+
}
|
| 13 |
+
static makeMessage(status, error, message) {
|
| 14 |
+
const msg = error?.message ?
|
| 15 |
+
typeof error.message === 'string' ?
|
| 16 |
+
error.message
|
| 17 |
+
: JSON.stringify(error.message)
|
| 18 |
+
: error ? JSON.stringify(error)
|
| 19 |
+
: message;
|
| 20 |
+
if (status && msg) {
|
| 21 |
+
return `${status} ${msg}`;
|
| 22 |
+
}
|
| 23 |
+
if (status) {
|
| 24 |
+
return `${status} status code (no body)`;
|
| 25 |
+
}
|
| 26 |
+
if (msg) {
|
| 27 |
+
return msg;
|
| 28 |
+
}
|
| 29 |
+
return '(no status code or body)';
|
| 30 |
+
}
|
| 31 |
+
static generate(status, errorResponse, message, headers) {
|
| 32 |
+
if (!status || !headers) {
|
| 33 |
+
return new APIConnectionError({ message, cause: castToError(errorResponse) });
|
| 34 |
+
}
|
| 35 |
+
const error = errorResponse;
|
| 36 |
+
if (status === 400) {
|
| 37 |
+
return new BadRequestError(status, error, message, headers);
|
| 38 |
+
}
|
| 39 |
+
if (status === 401) {
|
| 40 |
+
return new AuthenticationError(status, error, message, headers);
|
| 41 |
+
}
|
| 42 |
+
if (status === 403) {
|
| 43 |
+
return new PermissionDeniedError(status, error, message, headers);
|
| 44 |
+
}
|
| 45 |
+
if (status === 404) {
|
| 46 |
+
return new NotFoundError(status, error, message, headers);
|
| 47 |
+
}
|
| 48 |
+
if (status === 409) {
|
| 49 |
+
return new ConflictError(status, error, message, headers);
|
| 50 |
+
}
|
| 51 |
+
if (status === 422) {
|
| 52 |
+
return new UnprocessableEntityError(status, error, message, headers);
|
| 53 |
+
}
|
| 54 |
+
if (status === 429) {
|
| 55 |
+
return new RateLimitError(status, error, message, headers);
|
| 56 |
+
}
|
| 57 |
+
if (status >= 500) {
|
| 58 |
+
return new InternalServerError(status, error, message, headers);
|
| 59 |
+
}
|
| 60 |
+
return new APIError(status, error, message, headers);
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
export class APIUserAbortError extends APIError {
|
| 64 |
+
constructor({ message } = {}) {
|
| 65 |
+
super(undefined, undefined, message || 'Request was aborted.', undefined);
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
export class APIConnectionError extends APIError {
|
| 69 |
+
constructor({ message, cause }) {
|
| 70 |
+
super(undefined, undefined, message || 'Connection error.', undefined);
|
| 71 |
+
// in some environments the 'cause' property is already declared
|
| 72 |
+
// @ts-ignore
|
| 73 |
+
if (cause)
|
| 74 |
+
this.cause = cause;
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
export class APIConnectionTimeoutError extends APIConnectionError {
|
| 78 |
+
constructor({ message } = {}) {
|
| 79 |
+
super({ message: message ?? 'Request timed out.' });
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
export class BadRequestError extends APIError {
|
| 83 |
+
}
|
| 84 |
+
export class AuthenticationError extends APIError {
|
| 85 |
+
}
|
| 86 |
+
export class PermissionDeniedError extends APIError {
|
| 87 |
+
}
|
| 88 |
+
export class NotFoundError extends APIError {
|
| 89 |
+
}
|
| 90 |
+
export class ConflictError extends APIError {
|
| 91 |
+
}
|
| 92 |
+
export class UnprocessableEntityError extends APIError {
|
| 93 |
+
}
|
| 94 |
+
export class RateLimitError extends APIError {
|
| 95 |
+
}
|
| 96 |
+
export class InternalServerError extends APIError {
|
| 97 |
+
}
|
| 98 |
+
//# sourceMappingURL=error.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/error.mjs.map
ADDED
|
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,QAAsB;CAAG;AAE7D,MAAM,OAAO,mBAAoB,SAAQ,QAAyB;CAAG"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.d.mts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { FinalRequestOptions } from "../internal/request-options.mjs";
|
| 2 |
+
import { type BaseAnthropic } from "../client.mjs";
|
| 3 |
+
import { APIPromise } from "./api-promise.mjs";
|
| 4 |
+
import { type APIResponseProps } from "../internal/parse.mjs";
|
| 5 |
+
export type PageRequestOptions = Pick<FinalRequestOptions, 'query' | 'headers' | 'body' | 'path' | 'method'>;
|
| 6 |
+
export declare abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
| 7 |
+
#private;
|
| 8 |
+
protected options: FinalRequestOptions;
|
| 9 |
+
protected response: Response;
|
| 10 |
+
protected body: unknown;
|
| 11 |
+
constructor(client: BaseAnthropic, response: Response, body: unknown, options: FinalRequestOptions);
|
| 12 |
+
abstract nextPageRequestOptions(): PageRequestOptions | null;
|
| 13 |
+
abstract getPaginatedItems(): Item[];
|
| 14 |
+
hasNextPage(): boolean;
|
| 15 |
+
getNextPage(): Promise<this>;
|
| 16 |
+
iterPages(): AsyncGenerator<this>;
|
| 17 |
+
[Symbol.asyncIterator](): AsyncGenerator<Item>;
|
| 18 |
+
}
|
| 19 |
+
/**
|
| 20 |
+
* This subclass of Promise will resolve to an instantiated Page once the request completes.
|
| 21 |
+
*
|
| 22 |
+
* It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:
|
| 23 |
+
*
|
| 24 |
+
* for await (const item of client.items.list()) {
|
| 25 |
+
* console.log(item)
|
| 26 |
+
* }
|
| 27 |
+
*/
|
| 28 |
+
export declare class PagePromise<PageClass extends AbstractPage<Item>, Item = ReturnType<PageClass['getPaginatedItems']>[number]> extends APIPromise<PageClass> implements AsyncIterable<Item> {
|
| 29 |
+
constructor(client: BaseAnthropic, request: Promise<APIResponseProps>, Page: new (...args: ConstructorParameters<typeof AbstractPage>) => PageClass);
|
| 30 |
+
/**
|
| 31 |
+
* Allow auto-paginating iteration on an unawaited list call, eg:
|
| 32 |
+
*
|
| 33 |
+
* for await (const item of client.items.list()) {
|
| 34 |
+
* console.log(item)
|
| 35 |
+
* }
|
| 36 |
+
*/
|
| 37 |
+
[Symbol.asyncIterator](): AsyncGenerator<Item>;
|
| 38 |
+
}
|
| 39 |
+
export interface PageResponse<Item> {
|
| 40 |
+
data: Array<Item>;
|
| 41 |
+
has_more: boolean;
|
| 42 |
+
first_id: string | null;
|
| 43 |
+
last_id: string | null;
|
| 44 |
+
}
|
| 45 |
+
export interface PageParams {
|
| 46 |
+
/**
|
| 47 |
+
* Number of items per page.
|
| 48 |
+
*/
|
| 49 |
+
limit?: number;
|
| 50 |
+
before_id?: string;
|
| 51 |
+
after_id?: string;
|
| 52 |
+
}
|
| 53 |
+
export declare class Page<Item> extends AbstractPage<Item> implements PageResponse<Item> {
|
| 54 |
+
data: Array<Item>;
|
| 55 |
+
has_more: boolean;
|
| 56 |
+
first_id: string | null;
|
| 57 |
+
last_id: string | null;
|
| 58 |
+
constructor(client: BaseAnthropic, response: Response, body: PageResponse<Item>, options: FinalRequestOptions);
|
| 59 |
+
getPaginatedItems(): Item[];
|
| 60 |
+
hasNextPage(): boolean;
|
| 61 |
+
nextPageRequestOptions(): PageRequestOptions | null;
|
| 62 |
+
}
|
| 63 |
+
//# sourceMappingURL=pagination.d.mts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"pagination.d.mts","sourceRoot":"","sources":["../src/core/pagination.ts"],"names":[],"mappings":"OAGO,EAAE,mBAAmB,EAAE;OAEvB,EAAE,KAAK,aAAa,EAAE;OACtB,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,gBAAgB,EAAE;AAGhC,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAE7G,8BAAsB,YAAY,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;;IAErE,SAAS,CAAC,OAAO,EAAE,mBAAmB,CAAC;IAEvC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC;gBAEZ,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB;IAOlG,QAAQ,CAAC,sBAAsB,IAAI,kBAAkB,GAAG,IAAI;IAE5D,QAAQ,CAAC,iBAAiB,IAAI,IAAI,EAAE;IAEpC,WAAW,IAAI,OAAO;IAMhB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,SAAS,IAAI,cAAc,CAAC,IAAI,CAAC;IASjC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC;CAOtD;AAED;;;;;;;;GAQG;AACH,qBAAa,WAAW,CACpB,SAAS,SAAS,YAAY,CAA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IAAI,kBAAkB,GAAG,IAAI;CA8BpD"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { FinalRequestOptions } from "../internal/request-options.js";
|
| 2 |
+
import { type BaseAnthropic } from "../client.js";
|
| 3 |
+
import { APIPromise } from "./api-promise.js";
|
| 4 |
+
import { type APIResponseProps } from "../internal/parse.js";
|
| 5 |
+
export type PageRequestOptions = Pick<FinalRequestOptions, 'query' | 'headers' | 'body' | 'path' | 'method'>;
|
| 6 |
+
export declare abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
| 7 |
+
#private;
|
| 8 |
+
protected options: FinalRequestOptions;
|
| 9 |
+
protected response: Response;
|
| 10 |
+
protected body: unknown;
|
| 11 |
+
constructor(client: BaseAnthropic, response: Response, body: unknown, options: FinalRequestOptions);
|
| 12 |
+
abstract nextPageRequestOptions(): PageRequestOptions | null;
|
| 13 |
+
abstract getPaginatedItems(): Item[];
|
| 14 |
+
hasNextPage(): boolean;
|
| 15 |
+
getNextPage(): Promise<this>;
|
| 16 |
+
iterPages(): AsyncGenerator<this>;
|
| 17 |
+
[Symbol.asyncIterator](): AsyncGenerator<Item>;
|
| 18 |
+
}
|
| 19 |
+
/**
|
| 20 |
+
* This subclass of Promise will resolve to an instantiated Page once the request completes.
|
| 21 |
+
*
|
| 22 |
+
* It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:
|
| 23 |
+
*
|
| 24 |
+
* for await (const item of client.items.list()) {
|
| 25 |
+
* console.log(item)
|
| 26 |
+
* }
|
| 27 |
+
*/
|
| 28 |
+
export declare class PagePromise<PageClass extends AbstractPage<Item>, Item = ReturnType<PageClass['getPaginatedItems']>[number]> extends APIPromise<PageClass> implements AsyncIterable<Item> {
|
| 29 |
+
constructor(client: BaseAnthropic, request: Promise<APIResponseProps>, Page: new (...args: ConstructorParameters<typeof AbstractPage>) => PageClass);
|
| 30 |
+
/**
|
| 31 |
+
* Allow auto-paginating iteration on an unawaited list call, eg:
|
| 32 |
+
*
|
| 33 |
+
* for await (const item of client.items.list()) {
|
| 34 |
+
* console.log(item)
|
| 35 |
+
* }
|
| 36 |
+
*/
|
| 37 |
+
[Symbol.asyncIterator](): AsyncGenerator<Item>;
|
| 38 |
+
}
|
| 39 |
+
export interface PageResponse<Item> {
|
| 40 |
+
data: Array<Item>;
|
| 41 |
+
has_more: boolean;
|
| 42 |
+
first_id: string | null;
|
| 43 |
+
last_id: string | null;
|
| 44 |
+
}
|
| 45 |
+
export interface PageParams {
|
| 46 |
+
/**
|
| 47 |
+
* Number of items per page.
|
| 48 |
+
*/
|
| 49 |
+
limit?: number;
|
| 50 |
+
before_id?: string;
|
| 51 |
+
after_id?: string;
|
| 52 |
+
}
|
| 53 |
+
export declare class Page<Item> extends AbstractPage<Item> implements PageResponse<Item> {
|
| 54 |
+
data: Array<Item>;
|
| 55 |
+
has_more: boolean;
|
| 56 |
+
first_id: string | null;
|
| 57 |
+
last_id: string | null;
|
| 58 |
+
constructor(client: BaseAnthropic, response: Response, body: PageResponse<Item>, options: FinalRequestOptions);
|
| 59 |
+
getPaginatedItems(): Item[];
|
| 60 |
+
hasNextPage(): boolean;
|
| 61 |
+
nextPageRequestOptions(): PageRequestOptions | null;
|
| 62 |
+
}
|
| 63 |
+
//# sourceMappingURL=pagination.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/core/pagination.ts"],"names":[],"mappings":"OAGO,EAAE,mBAAmB,EAAE;OAEvB,EAAE,KAAK,aAAa,EAAE;OACtB,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,gBAAgB,EAAE;AAGhC,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAE7G,8BAAsB,YAAY,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;;IAErE,SAAS,CAAC,OAAO,EAAE,mBAAmB,CAAC;IAEvC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC;gBAEZ,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB;IAOlG,QAAQ,CAAC,sBAAsB,IAAI,kBAAkB,GAAG,IAAI;IAE5D,QAAQ,CAAC,iBAAiB,IAAI,IAAI,EAAE;IAEpC,WAAW,IAAI,OAAO;IAMhB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,SAAS,IAAI,cAAc,CAAC,IAAI,CAAC;IASjC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC;CAOtD;AAED;;;;;;;;GAQG;AACH,qBAAa,WAAW,CACpB,SAAS,SAAS,YAAY,CAAC,IAAI,CAAC,EACpC,IAAI,GAAG,UAAU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|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 3 |
+
var _AbstractPage_client;
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.Page = exports.PagePromise = exports.AbstractPage = void 0;
|
| 6 |
+
const tslib_1 = require("../internal/tslib.js");
|
| 7 |
+
const error_1 = require("./error.js");
|
| 8 |
+
const parse_1 = require("../internal/parse.js");
|
| 9 |
+
const api_promise_1 = require("./api-promise.js");
|
| 10 |
+
const values_1 = require("../internal/utils/values.js");
|
| 11 |
+
class AbstractPage {
|
| 12 |
+
constructor(client, response, body, options) {
|
| 13 |
+
_AbstractPage_client.set(this, void 0);
|
| 14 |
+
tslib_1.__classPrivateFieldSet(this, _AbstractPage_client, client, "f");
|
| 15 |
+
this.options = options;
|
| 16 |
+
this.response = response;
|
| 17 |
+
this.body = body;
|
| 18 |
+
}
|
| 19 |
+
hasNextPage() {
|
| 20 |
+
const items = this.getPaginatedItems();
|
| 21 |
+
if (!items.length)
|
| 22 |
+
return false;
|
| 23 |
+
return this.nextPageRequestOptions() != null;
|
| 24 |
+
}
|
| 25 |
+
async getNextPage() {
|
| 26 |
+
const nextOptions = this.nextPageRequestOptions();
|
| 27 |
+
if (!nextOptions) {
|
| 28 |
+
throw new error_1.AnthropicError('No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.');
|
| 29 |
+
}
|
| 30 |
+
return await tslib_1.__classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions);
|
| 31 |
+
}
|
| 32 |
+
async *iterPages() {
|
| 33 |
+
let page = this;
|
| 34 |
+
yield page;
|
| 35 |
+
while (page.hasNextPage()) {
|
| 36 |
+
page = await page.getNextPage();
|
| 37 |
+
yield page;
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
async *[(_AbstractPage_client = new WeakMap(), Symbol.asyncIterator)]() {
|
| 41 |
+
for await (const page of this.iterPages()) {
|
| 42 |
+
for (const item of page.getPaginatedItems()) {
|
| 43 |
+
yield item;
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
exports.AbstractPage = AbstractPage;
|
| 49 |
+
/**
|
| 50 |
+
* This subclass of Promise will resolve to an instantiated Page once the request completes.
|
| 51 |
+
*
|
| 52 |
+
* It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:
|
| 53 |
+
*
|
| 54 |
+
* for await (const item of client.items.list()) {
|
| 55 |
+
* console.log(item)
|
| 56 |
+
* }
|
| 57 |
+
*/
|
| 58 |
+
class PagePromise extends api_promise_1.APIPromise {
|
| 59 |
+
constructor(client, request, Page) {
|
| 60 |
+
super(client, request, async (client, props) => new Page(client, props.response, await (0, parse_1.defaultParseResponse)(client, props), props.options));
|
| 61 |
+
}
|
| 62 |
+
/**
|
| 63 |
+
* Allow auto-paginating iteration on an unawaited list call, eg:
|
| 64 |
+
*
|
| 65 |
+
* for await (const item of client.items.list()) {
|
| 66 |
+
* console.log(item)
|
| 67 |
+
* }
|
| 68 |
+
*/
|
| 69 |
+
async *[Symbol.asyncIterator]() {
|
| 70 |
+
const page = await this;
|
| 71 |
+
for await (const item of page) {
|
| 72 |
+
yield item;
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
exports.PagePromise = PagePromise;
|
| 77 |
+
class Page extends AbstractPage {
|
| 78 |
+
constructor(client, response, body, options) {
|
| 79 |
+
super(client, response, body, options);
|
| 80 |
+
this.data = body.data || [];
|
| 81 |
+
this.has_more = body.has_more || false;
|
| 82 |
+
this.first_id = body.first_id || null;
|
| 83 |
+
this.last_id = body.last_id || null;
|
| 84 |
+
}
|
| 85 |
+
getPaginatedItems() {
|
| 86 |
+
return this.data ?? [];
|
| 87 |
+
}
|
| 88 |
+
hasNextPage() {
|
| 89 |
+
if (this.has_more === false) {
|
| 90 |
+
return false;
|
| 91 |
+
}
|
| 92 |
+
return super.hasNextPage();
|
| 93 |
+
}
|
| 94 |
+
nextPageRequestOptions() {
|
| 95 |
+
if (this.options.query?.['before_id']) {
|
| 96 |
+
// in reverse
|
| 97 |
+
const first_id = this.first_id;
|
| 98 |
+
if (!first_id) {
|
| 99 |
+
return null;
|
| 100 |
+
}
|
| 101 |
+
return {
|
| 102 |
+
...this.options,
|
| 103 |
+
query: {
|
| 104 |
+
...(0, values_1.maybeObj)(this.options.query),
|
| 105 |
+
before_id: first_id,
|
| 106 |
+
},
|
| 107 |
+
};
|
| 108 |
+
}
|
| 109 |
+
const cursor = this.last_id;
|
| 110 |
+
if (!cursor) {
|
| 111 |
+
return null;
|
| 112 |
+
}
|
| 113 |
+
return {
|
| 114 |
+
...this.options,
|
| 115 |
+
query: {
|
| 116 |
+
...(0, values_1.maybeObj)(this.options.query),
|
| 117 |
+
after_id: cursor,
|
| 118 |
+
},
|
| 119 |
+
};
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
exports.Page = Page;
|
| 123 |
+
//# sourceMappingURL=pagination.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/core/pagination.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;AAEtF,sCAAyC;AAEzC,gDAAwE;AAExE,kDAA2C;AAE3C,wDAAoD;AAIpD,MAAsB,YAAY;IAOhC,YAAY,MAAqB,EAAE,QAAkB,EAAE,IAAa,EAAE,OAA4B;QANlG,uCAAuB;QAOrB,+BAAA,IAAI,wBAAW,MAAM,MAAA,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAMD,WAAW;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvC,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAChC,OAAO,IAAI,CAAC,sBAAsB,EAAE,IAAI,IAAI,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,WAAW,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QA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enAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
var _AbstractPage_client;
|
| 3 |
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "../internal/tslib.mjs";
|
| 4 |
+
import { AnthropicError } from "./error.mjs";
|
| 5 |
+
import { defaultParseResponse } from "../internal/parse.mjs";
|
| 6 |
+
import { APIPromise } from "./api-promise.mjs";
|
| 7 |
+
import { maybeObj } from "../internal/utils/values.mjs";
|
| 8 |
+
export class AbstractPage {
|
| 9 |
+
constructor(client, response, body, options) {
|
| 10 |
+
_AbstractPage_client.set(this, void 0);
|
| 11 |
+
__classPrivateFieldSet(this, _AbstractPage_client, client, "f");
|
| 12 |
+
this.options = options;
|
| 13 |
+
this.response = response;
|
| 14 |
+
this.body = body;
|
| 15 |
+
}
|
| 16 |
+
hasNextPage() {
|
| 17 |
+
const items = this.getPaginatedItems();
|
| 18 |
+
if (!items.length)
|
| 19 |
+
return false;
|
| 20 |
+
return this.nextPageRequestOptions() != null;
|
| 21 |
+
}
|
| 22 |
+
async getNextPage() {
|
| 23 |
+
const nextOptions = this.nextPageRequestOptions();
|
| 24 |
+
if (!nextOptions) {
|
| 25 |
+
throw new AnthropicError('No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.');
|
| 26 |
+
}
|
| 27 |
+
return await __classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions);
|
| 28 |
+
}
|
| 29 |
+
async *iterPages() {
|
| 30 |
+
let page = this;
|
| 31 |
+
yield page;
|
| 32 |
+
while (page.hasNextPage()) {
|
| 33 |
+
page = await page.getNextPage();
|
| 34 |
+
yield page;
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
async *[(_AbstractPage_client = new WeakMap(), Symbol.asyncIterator)]() {
|
| 38 |
+
for await (const page of this.iterPages()) {
|
| 39 |
+
for (const item of page.getPaginatedItems()) {
|
| 40 |
+
yield item;
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
/**
|
| 46 |
+
* This subclass of Promise will resolve to an instantiated Page once the request completes.
|
| 47 |
+
*
|
| 48 |
+
* It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:
|
| 49 |
+
*
|
| 50 |
+
* for await (const item of client.items.list()) {
|
| 51 |
+
* console.log(item)
|
| 52 |
+
* }
|
| 53 |
+
*/
|
| 54 |
+
export class PagePromise extends APIPromise {
|
| 55 |
+
constructor(client, request, Page) {
|
| 56 |
+
super(client, request, async (client, props) => new Page(client, props.response, await defaultParseResponse(client, props), props.options));
|
| 57 |
+
}
|
| 58 |
+
/**
|
| 59 |
+
* Allow auto-paginating iteration on an unawaited list call, eg:
|
| 60 |
+
*
|
| 61 |
+
* for await (const item of client.items.list()) {
|
| 62 |
+
* console.log(item)
|
| 63 |
+
* }
|
| 64 |
+
*/
|
| 65 |
+
async *[Symbol.asyncIterator]() {
|
| 66 |
+
const page = await this;
|
| 67 |
+
for await (const item of page) {
|
| 68 |
+
yield item;
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
export class Page extends AbstractPage {
|
| 73 |
+
constructor(client, response, body, options) {
|
| 74 |
+
super(client, response, body, options);
|
| 75 |
+
this.data = body.data || [];
|
| 76 |
+
this.has_more = body.has_more || false;
|
| 77 |
+
this.first_id = body.first_id || null;
|
| 78 |
+
this.last_id = body.last_id || null;
|
| 79 |
+
}
|
| 80 |
+
getPaginatedItems() {
|
| 81 |
+
return this.data ?? [];
|
| 82 |
+
}
|
| 83 |
+
hasNextPage() {
|
| 84 |
+
if (this.has_more === false) {
|
| 85 |
+
return false;
|
| 86 |
+
}
|
| 87 |
+
return super.hasNextPage();
|
| 88 |
+
}
|
| 89 |
+
nextPageRequestOptions() {
|
| 90 |
+
if (this.options.query?.['before_id']) {
|
| 91 |
+
// in reverse
|
| 92 |
+
const first_id = this.first_id;
|
| 93 |
+
if (!first_id) {
|
| 94 |
+
return null;
|
| 95 |
+
}
|
| 96 |
+
return {
|
| 97 |
+
...this.options,
|
| 98 |
+
query: {
|
| 99 |
+
...maybeObj(this.options.query),
|
| 100 |
+
before_id: first_id,
|
| 101 |
+
},
|
| 102 |
+
};
|
| 103 |
+
}
|
| 104 |
+
const cursor = this.last_id;
|
| 105 |
+
if (!cursor) {
|
| 106 |
+
return null;
|
| 107 |
+
}
|
| 108 |
+
return {
|
| 109 |
+
...this.options,
|
| 110 |
+
query: {
|
| 111 |
+
...maybeObj(this.options.query),
|
| 112 |
+
after_id: cursor,
|
| 113 |
+
},
|
| 114 |
+
};
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
//# sourceMappingURL=pagination.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["../src/core/pagination.ts"],"names":[],"mappings":"AAAA,sFAAsF;;;OAE/E,EAAE,cAAc,EAAE;OAElB,EAAE,oBAAoB,EAAiB;OAEvC,EAAE,UAAU,EAAE;OAEd,EAAE,QAAQ,EAAE;AAInB,MAAM,OAAgB,YAAY;IAOhC,YAAY,MAAqB,EAAE,QAAkB,EAAE,IAAa,EAAE,OAA4B;QANlG,uCAAuB;QAOrB,uBAAA,IAAI,wBAAW,MAAM,MAAA,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAMD,WAAW;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvC,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAChC,OAAO,IAAI,CAAC,sBAAsB,EAAE,IAAI,IAAI,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,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C,OAAO,CAAC;QAC5B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO;YACL,GAAG,IAAI,CAAC,OAAO;YACf,KAAK,EAAE;gBACL,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC/B,QAAQ,EAAE,MAAM;aACjB;SACF,CAAC;IACJ,CAAC;CACF"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { BaseAnthropic } from "../client.mjs";
|
| 2 |
+
export declare class APIResource {
|
| 3 |
+
protected _client: BaseAnthropic;
|
| 4 |
+
constructor(client: BaseAnthropic);
|
| 5 |
+
}
|
| 6 |
+
//# sourceMappingURL=resource.d.mts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"resource.d.mts","sourceRoot":"","sources":["../src/core/resource.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE;AAExB,qBAAa,WAAW;IACtB,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC;gBAErB,MAAM,EAAE,aAAa;CAGlC"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { BaseAnthropic } from "../client.js";
|
| 2 |
+
export declare class APIResource {
|
| 3 |
+
protected _client: BaseAnthropic;
|
| 4 |
+
constructor(client: BaseAnthropic);
|
| 5 |
+
}
|
| 6 |
+
//# sourceMappingURL=resource.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/core/resource.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE;AAExB,qBAAa,WAAW;IACtB,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC;gBAErB,MAAM,EAAE,aAAa;CAGlC"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 3 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 4 |
+
exports.APIResource = void 0;
|
| 5 |
+
class APIResource {
|
| 6 |
+
constructor(client) {
|
| 7 |
+
this._client = client;
|
| 8 |
+
}
|
| 9 |
+
}
|
| 10 |
+
exports.APIResource = APIResource;
|
| 11 |
+
//# sourceMappingURL=resource.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../src/core/resource.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAItF,MAAa,WAAW;IAGtB,YAAY,MAAqB;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF;AAND,kCAMC"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
export class APIResource {
|
| 3 |
+
constructor(client) {
|
| 4 |
+
this._client = client;
|
| 5 |
+
}
|
| 6 |
+
}
|
| 7 |
+
//# sourceMappingURL=resource.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/resource.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"resource.mjs","sourceRoot":"","sources":["../src/core/resource.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,MAAM,OAAO,WAAW;IAGtB,YAAY,MAAqB;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.d.mts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type ReadableStream } from "../internal/shim-types.mjs";
|
| 2 |
+
export type ServerSentEvent = {
|
| 3 |
+
event: string | null;
|
| 4 |
+
data: string;
|
| 5 |
+
raw: string[];
|
| 6 |
+
};
|
| 7 |
+
export declare class Stream<Item> implements AsyncIterable<Item> {
|
| 8 |
+
private iterator;
|
| 9 |
+
controller: AbortController;
|
| 10 |
+
constructor(iterator: () => AsyncIterator<Item>, controller: AbortController);
|
| 11 |
+
static fromSSEResponse<Item>(response: Response, controller: AbortController): Stream<Item>;
|
| 12 |
+
/**
|
| 13 |
+
* Generates a Stream from a newline-separated ReadableStream
|
| 14 |
+
* where each item is a JSON value.
|
| 15 |
+
*/
|
| 16 |
+
static fromReadableStream<Item>(readableStream: ReadableStream, controller: AbortController): Stream<Item>;
|
| 17 |
+
[Symbol.asyncIterator](): AsyncIterator<Item>;
|
| 18 |
+
/**
|
| 19 |
+
* Splits the stream into two streams which can be
|
| 20 |
+
* independently read from at different speeds.
|
| 21 |
+
*/
|
| 22 |
+
tee(): [Stream<Item>, Stream<Item>];
|
| 23 |
+
/**
|
| 24 |
+
* Converts this stream to a newline-separated ReadableStream of
|
| 25 |
+
* JSON stringified values in the stream
|
| 26 |
+
* which can be turned back into a Stream with `Stream.fromReadableStream()`.
|
| 27 |
+
*/
|
| 28 |
+
toReadableStream(): ReadableStream;
|
| 29 |
+
}
|
| 30 |
+
export declare function _iterSSEMessages(response: Response, controller: AbortController): AsyncGenerator<ServerSentEvent, void, unknown>;
|
| 31 |
+
//# sourceMappingURL=streaming.d.mts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"streaming.d.mts","sourceRoot":"","sources":["../src/core/streaming.ts"],"names":[],"mappings":"OACO,EAAE,KAAK,cAAc,EAAE;AAY9B,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,qBAAa,MAAM,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;IAIpD,OAAO,CAAC,QAAQ;IAHlB,UAAU,EAAE,eAAe,CAAC;gBAGlB,QAAQ,EAAE,MAAM,aAAa,CAAC,IAAI,CAAC,EAC3C,UAAU,EAAE,eAAe;IAK7B,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC;IA4D3F;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC;IA2C1G,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC;IAI7C;;;OAGG;IACH,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAwBnC;;;;OAIG;IACH,gBAAgB,IAAI,cAAc;CAyBnC;AAED,wBAAuB,gBAAgB,CACrC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,eAAe,GAC1B,cAAc,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,CA6BhD"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type ReadableStream } from "../internal/shim-types.js";
|
| 2 |
+
export type ServerSentEvent = {
|
| 3 |
+
event: string | null;
|
| 4 |
+
data: string;
|
| 5 |
+
raw: string[];
|
| 6 |
+
};
|
| 7 |
+
export declare class Stream<Item> implements AsyncIterable<Item> {
|
| 8 |
+
private iterator;
|
| 9 |
+
controller: AbortController;
|
| 10 |
+
constructor(iterator: () => AsyncIterator<Item>, controller: AbortController);
|
| 11 |
+
static fromSSEResponse<Item>(response: Response, controller: AbortController): Stream<Item>;
|
| 12 |
+
/**
|
| 13 |
+
* Generates a Stream from a newline-separated ReadableStream
|
| 14 |
+
* where each item is a JSON value.
|
| 15 |
+
*/
|
| 16 |
+
static fromReadableStream<Item>(readableStream: ReadableStream, controller: AbortController): Stream<Item>;
|
| 17 |
+
[Symbol.asyncIterator](): AsyncIterator<Item>;
|
| 18 |
+
/**
|
| 19 |
+
* Splits the stream into two streams which can be
|
| 20 |
+
* independently read from at different speeds.
|
| 21 |
+
*/
|
| 22 |
+
tee(): [Stream<Item>, Stream<Item>];
|
| 23 |
+
/**
|
| 24 |
+
* Converts this stream to a newline-separated ReadableStream of
|
| 25 |
+
* JSON stringified values in the stream
|
| 26 |
+
* which can be turned back into a Stream with `Stream.fromReadableStream()`.
|
| 27 |
+
*/
|
| 28 |
+
toReadableStream(): ReadableStream;
|
| 29 |
+
}
|
| 30 |
+
export declare function _iterSSEMessages(response: Response, controller: AbortController): AsyncGenerator<ServerSentEvent, void, unknown>;
|
| 31 |
+
//# sourceMappingURL=streaming.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../src/core/streaming.ts"],"names":[],"mappings":"OACO,EAAE,KAAK,cAAc,EAAE;AAY9B,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,qBAAa,MAAM,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;IAIpD,OAAO,CAAC,QAAQ;IAHlB,UAAU,EAAE,eAAe,CAAC;gBAGlB,QAAQ,EAAE,MAAM,aAAa,CAAC,IAAI,CAAC,EAC3C,UAAU,EAAE,eAAe;IAK7B,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.Stream = void 0;
|
| 4 |
+
exports._iterSSEMessages = _iterSSEMessages;
|
| 5 |
+
const error_1 = require("./error.js");
|
| 6 |
+
const shims_1 = require("../internal/shims.js");
|
| 7 |
+
const line_1 = require("../internal/decoders/line.js");
|
| 8 |
+
const shims_2 = require("../internal/shims.js");
|
| 9 |
+
const errors_1 = require("../internal/errors.js");
|
| 10 |
+
const values_1 = require("../internal/utils/values.js");
|
| 11 |
+
const bytes_1 = require("../internal/utils/bytes.js");
|
| 12 |
+
const error_2 = require("./error.js");
|
| 13 |
+
class Stream {
|
| 14 |
+
constructor(iterator, controller) {
|
| 15 |
+
this.iterator = iterator;
|
| 16 |
+
this.controller = controller;
|
| 17 |
+
}
|
| 18 |
+
static fromSSEResponse(response, controller) {
|
| 19 |
+
let consumed = false;
|
| 20 |
+
async function* iterator() {
|
| 21 |
+
if (consumed) {
|
| 22 |
+
throw new error_1.AnthropicError('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');
|
| 23 |
+
}
|
| 24 |
+
consumed = true;
|
| 25 |
+
let done = false;
|
| 26 |
+
try {
|
| 27 |
+
for await (const sse of _iterSSEMessages(response, controller)) {
|
| 28 |
+
if (sse.event === 'completion') {
|
| 29 |
+
try {
|
| 30 |
+
yield JSON.parse(sse.data);
|
| 31 |
+
}
|
| 32 |
+
catch (e) {
|
| 33 |
+
console.error(`Could not parse message into JSON:`, sse.data);
|
| 34 |
+
console.error(`From chunk:`, sse.raw);
|
| 35 |
+
throw e;
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
if (sse.event === 'message_start' ||
|
| 39 |
+
sse.event === 'message_delta' ||
|
| 40 |
+
sse.event === 'message_stop' ||
|
| 41 |
+
sse.event === 'content_block_start' ||
|
| 42 |
+
sse.event === 'content_block_delta' ||
|
| 43 |
+
sse.event === 'content_block_stop') {
|
| 44 |
+
try {
|
| 45 |
+
yield JSON.parse(sse.data);
|
| 46 |
+
}
|
| 47 |
+
catch (e) {
|
| 48 |
+
console.error(`Could not parse message into JSON:`, sse.data);
|
| 49 |
+
console.error(`From chunk:`, sse.raw);
|
| 50 |
+
throw e;
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
if (sse.event === 'ping') {
|
| 54 |
+
continue;
|
| 55 |
+
}
|
| 56 |
+
if (sse.event === 'error') {
|
| 57 |
+
throw new error_2.APIError(undefined, (0, values_1.safeJSON)(sse.data) ?? sse.data, undefined, response.headers);
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
done = true;
|
| 61 |
+
}
|
| 62 |
+
catch (e) {
|
| 63 |
+
// If the user calls `stream.controller.abort()`, we should exit without throwing.
|
| 64 |
+
if ((0, errors_1.isAbortError)(e))
|
| 65 |
+
return;
|
| 66 |
+
throw e;
|
| 67 |
+
}
|
| 68 |
+
finally {
|
| 69 |
+
// If the user `break`s, abort the ongoing request.
|
| 70 |
+
if (!done)
|
| 71 |
+
controller.abort();
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
return new Stream(iterator, controller);
|
| 75 |
+
}
|
| 76 |
+
/**
|
| 77 |
+
* Generates a Stream from a newline-separated ReadableStream
|
| 78 |
+
* where each item is a JSON value.
|
| 79 |
+
*/
|
| 80 |
+
static fromReadableStream(readableStream, controller) {
|
| 81 |
+
let consumed = false;
|
| 82 |
+
async function* iterLines() {
|
| 83 |
+
const lineDecoder = new line_1.LineDecoder();
|
| 84 |
+
const iter = (0, shims_2.ReadableStreamToAsyncIterable)(readableStream);
|
| 85 |
+
for await (const chunk of iter) {
|
| 86 |
+
for (const line of lineDecoder.decode(chunk)) {
|
| 87 |
+
yield line;
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
for (const line of lineDecoder.flush()) {
|
| 91 |
+
yield line;
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
async function* iterator() {
|
| 95 |
+
if (consumed) {
|
| 96 |
+
throw new error_1.AnthropicError('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');
|
| 97 |
+
}
|
| 98 |
+
consumed = true;
|
| 99 |
+
let done = false;
|
| 100 |
+
try {
|
| 101 |
+
for await (const line of iterLines()) {
|
| 102 |
+
if (done)
|
| 103 |
+
continue;
|
| 104 |
+
if (line)
|
| 105 |
+
yield JSON.parse(line);
|
| 106 |
+
}
|
| 107 |
+
done = true;
|
| 108 |
+
}
|
| 109 |
+
catch (e) {
|
| 110 |
+
// If the user calls `stream.controller.abort()`, we should exit without throwing.
|
| 111 |
+
if ((0, errors_1.isAbortError)(e))
|
| 112 |
+
return;
|
| 113 |
+
throw e;
|
| 114 |
+
}
|
| 115 |
+
finally {
|
| 116 |
+
// If the user `break`s, abort the ongoing request.
|
| 117 |
+
if (!done)
|
| 118 |
+
controller.abort();
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
return new Stream(iterator, controller);
|
| 122 |
+
}
|
| 123 |
+
[Symbol.asyncIterator]() {
|
| 124 |
+
return this.iterator();
|
| 125 |
+
}
|
| 126 |
+
/**
|
| 127 |
+
* Splits the stream into two streams which can be
|
| 128 |
+
* independently read from at different speeds.
|
| 129 |
+
*/
|
| 130 |
+
tee() {
|
| 131 |
+
const left = [];
|
| 132 |
+
const right = [];
|
| 133 |
+
const iterator = this.iterator();
|
| 134 |
+
const teeIterator = (queue) => {
|
| 135 |
+
return {
|
| 136 |
+
next: () => {
|
| 137 |
+
if (queue.length === 0) {
|
| 138 |
+
const result = iterator.next();
|
| 139 |
+
left.push(result);
|
| 140 |
+
right.push(result);
|
| 141 |
+
}
|
| 142 |
+
return queue.shift();
|
| 143 |
+
},
|
| 144 |
+
};
|
| 145 |
+
};
|
| 146 |
+
return [
|
| 147 |
+
new Stream(() => teeIterator(left), this.controller),
|
| 148 |
+
new Stream(() => teeIterator(right), this.controller),
|
| 149 |
+
];
|
| 150 |
+
}
|
| 151 |
+
/**
|
| 152 |
+
* Converts this stream to a newline-separated ReadableStream of
|
| 153 |
+
* JSON stringified values in the stream
|
| 154 |
+
* which can be turned back into a Stream with `Stream.fromReadableStream()`.
|
| 155 |
+
*/
|
| 156 |
+
toReadableStream() {
|
| 157 |
+
const self = this;
|
| 158 |
+
let iter;
|
| 159 |
+
return (0, shims_1.makeReadableStream)({
|
| 160 |
+
async start() {
|
| 161 |
+
iter = self[Symbol.asyncIterator]();
|
| 162 |
+
},
|
| 163 |
+
async pull(ctrl) {
|
| 164 |
+
try {
|
| 165 |
+
const { value, done } = await iter.next();
|
| 166 |
+
if (done)
|
| 167 |
+
return ctrl.close();
|
| 168 |
+
const bytes = (0, bytes_1.encodeUTF8)(JSON.stringify(value) + '\n');
|
| 169 |
+
ctrl.enqueue(bytes);
|
| 170 |
+
}
|
| 171 |
+
catch (err) {
|
| 172 |
+
ctrl.error(err);
|
| 173 |
+
}
|
| 174 |
+
},
|
| 175 |
+
async cancel() {
|
| 176 |
+
await iter.return?.();
|
| 177 |
+
},
|
| 178 |
+
});
|
| 179 |
+
}
|
| 180 |
+
}
|
| 181 |
+
exports.Stream = Stream;
|
| 182 |
+
async function* _iterSSEMessages(response, controller) {
|
| 183 |
+
if (!response.body) {
|
| 184 |
+
controller.abort();
|
| 185 |
+
if (typeof globalThis.navigator !== 'undefined' &&
|
| 186 |
+
globalThis.navigator.product === 'ReactNative') {
|
| 187 |
+
throw new error_1.AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`);
|
| 188 |
+
}
|
| 189 |
+
throw new error_1.AnthropicError(`Attempted to iterate over a response with no body`);
|
| 190 |
+
}
|
| 191 |
+
const sseDecoder = new SSEDecoder();
|
| 192 |
+
const lineDecoder = new line_1.LineDecoder();
|
| 193 |
+
const iter = (0, shims_2.ReadableStreamToAsyncIterable)(response.body);
|
| 194 |
+
for await (const sseChunk of iterSSEChunks(iter)) {
|
| 195 |
+
for (const line of lineDecoder.decode(sseChunk)) {
|
| 196 |
+
const sse = sseDecoder.decode(line);
|
| 197 |
+
if (sse)
|
| 198 |
+
yield sse;
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
for (const line of lineDecoder.flush()) {
|
| 202 |
+
const sse = sseDecoder.decode(line);
|
| 203 |
+
if (sse)
|
| 204 |
+
yield sse;
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
/**
|
| 208 |
+
* Given an async iterable iterator, iterates over it and yields full
|
| 209 |
+
* SSE chunks, i.e. yields when a double new-line is encountered.
|
| 210 |
+
*/
|
| 211 |
+
async function* iterSSEChunks(iterator) {
|
| 212 |
+
let data = new Uint8Array();
|
| 213 |
+
for await (const chunk of iterator) {
|
| 214 |
+
if (chunk == null) {
|
| 215 |
+
continue;
|
| 216 |
+
}
|
| 217 |
+
const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
|
| 218 |
+
: typeof chunk === 'string' ? (0, bytes_1.encodeUTF8)(chunk)
|
| 219 |
+
: chunk;
|
| 220 |
+
let newData = new Uint8Array(data.length + binaryChunk.length);
|
| 221 |
+
newData.set(data);
|
| 222 |
+
newData.set(binaryChunk, data.length);
|
| 223 |
+
data = newData;
|
| 224 |
+
let patternIndex;
|
| 225 |
+
while ((patternIndex = (0, line_1.findDoubleNewlineIndex)(data)) !== -1) {
|
| 226 |
+
yield data.slice(0, patternIndex);
|
| 227 |
+
data = data.slice(patternIndex);
|
| 228 |
+
}
|
| 229 |
+
}
|
| 230 |
+
if (data.length > 0) {
|
| 231 |
+
yield data;
|
| 232 |
+
}
|
| 233 |
+
}
|
| 234 |
+
class SSEDecoder {
|
| 235 |
+
constructor() {
|
| 236 |
+
this.event = null;
|
| 237 |
+
this.data = [];
|
| 238 |
+
this.chunks = [];
|
| 239 |
+
}
|
| 240 |
+
decode(line) {
|
| 241 |
+
if (line.endsWith('\r')) {
|
| 242 |
+
line = line.substring(0, line.length - 1);
|
| 243 |
+
}
|
| 244 |
+
if (!line) {
|
| 245 |
+
// empty line and we didn't previously encounter any messages
|
| 246 |
+
if (!this.event && !this.data.length)
|
| 247 |
+
return null;
|
| 248 |
+
const sse = {
|
| 249 |
+
event: this.event,
|
| 250 |
+
data: this.data.join('\n'),
|
| 251 |
+
raw: this.chunks,
|
| 252 |
+
};
|
| 253 |
+
this.event = null;
|
| 254 |
+
this.data = [];
|
| 255 |
+
this.chunks = [];
|
| 256 |
+
return sse;
|
| 257 |
+
}
|
| 258 |
+
this.chunks.push(line);
|
| 259 |
+
if (line.startsWith(':')) {
|
| 260 |
+
return null;
|
| 261 |
+
}
|
| 262 |
+
let [fieldname, _, value] = partition(line, ':');
|
| 263 |
+
if (value.startsWith(' ')) {
|
| 264 |
+
value = value.substring(1);
|
| 265 |
+
}
|
| 266 |
+
if (fieldname === 'event') {
|
| 267 |
+
this.event = value;
|
| 268 |
+
}
|
| 269 |
+
else if (fieldname === 'data') {
|
| 270 |
+
this.data.push(value);
|
| 271 |
+
}
|
| 272 |
+
return null;
|
| 273 |
+
}
|
| 274 |
+
}
|
| 275 |
+
function partition(str, delimiter) {
|
| 276 |
+
const index = str.indexOf(delimiter);
|
| 277 |
+
if (index !== -1) {
|
| 278 |
+
return [str.substring(0, index), delimiter, str.substring(index + delimiter.length)];
|
| 279 |
+
}
|
| 280 |
+
return [str, '', ''];
|
| 281 |
+
}
|
| 282 |
+
//# sourceMappingURL=streaming.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../src/core/streaming.ts"],"names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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { AnthropicError } from "./error.mjs";
|
| 2 |
+
import { makeReadableStream } from "../internal/shims.mjs";
|
| 3 |
+
import { findDoubleNewlineIndex, LineDecoder } from "../internal/decoders/line.mjs";
|
| 4 |
+
import { ReadableStreamToAsyncIterable } from "../internal/shims.mjs";
|
| 5 |
+
import { isAbortError } from "../internal/errors.mjs";
|
| 6 |
+
import { safeJSON } from "../internal/utils/values.mjs";
|
| 7 |
+
import { encodeUTF8 } from "../internal/utils/bytes.mjs";
|
| 8 |
+
import { APIError } from "./error.mjs";
|
| 9 |
+
export class Stream {
|
| 10 |
+
constructor(iterator, controller) {
|
| 11 |
+
this.iterator = iterator;
|
| 12 |
+
this.controller = controller;
|
| 13 |
+
}
|
| 14 |
+
static fromSSEResponse(response, controller) {
|
| 15 |
+
let consumed = false;
|
| 16 |
+
async function* iterator() {
|
| 17 |
+
if (consumed) {
|
| 18 |
+
throw new AnthropicError('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');
|
| 19 |
+
}
|
| 20 |
+
consumed = true;
|
| 21 |
+
let done = false;
|
| 22 |
+
try {
|
| 23 |
+
for await (const sse of _iterSSEMessages(response, controller)) {
|
| 24 |
+
if (sse.event === 'completion') {
|
| 25 |
+
try {
|
| 26 |
+
yield JSON.parse(sse.data);
|
| 27 |
+
}
|
| 28 |
+
catch (e) {
|
| 29 |
+
console.error(`Could not parse message into JSON:`, sse.data);
|
| 30 |
+
console.error(`From chunk:`, sse.raw);
|
| 31 |
+
throw e;
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
if (sse.event === 'message_start' ||
|
| 35 |
+
sse.event === 'message_delta' ||
|
| 36 |
+
sse.event === 'message_stop' ||
|
| 37 |
+
sse.event === 'content_block_start' ||
|
| 38 |
+
sse.event === 'content_block_delta' ||
|
| 39 |
+
sse.event === 'content_block_stop') {
|
| 40 |
+
try {
|
| 41 |
+
yield JSON.parse(sse.data);
|
| 42 |
+
}
|
| 43 |
+
catch (e) {
|
| 44 |
+
console.error(`Could not parse message into JSON:`, sse.data);
|
| 45 |
+
console.error(`From chunk:`, sse.raw);
|
| 46 |
+
throw e;
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
if (sse.event === 'ping') {
|
| 50 |
+
continue;
|
| 51 |
+
}
|
| 52 |
+
if (sse.event === 'error') {
|
| 53 |
+
throw new APIError(undefined, safeJSON(sse.data) ?? sse.data, undefined, response.headers);
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
done = true;
|
| 57 |
+
}
|
| 58 |
+
catch (e) {
|
| 59 |
+
// If the user calls `stream.controller.abort()`, we should exit without throwing.
|
| 60 |
+
if (isAbortError(e))
|
| 61 |
+
return;
|
| 62 |
+
throw e;
|
| 63 |
+
}
|
| 64 |
+
finally {
|
| 65 |
+
// If the user `break`s, abort the ongoing request.
|
| 66 |
+
if (!done)
|
| 67 |
+
controller.abort();
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
return new Stream(iterator, controller);
|
| 71 |
+
}
|
| 72 |
+
/**
|
| 73 |
+
* Generates a Stream from a newline-separated ReadableStream
|
| 74 |
+
* where each item is a JSON value.
|
| 75 |
+
*/
|
| 76 |
+
static fromReadableStream(readableStream, controller) {
|
| 77 |
+
let consumed = false;
|
| 78 |
+
async function* iterLines() {
|
| 79 |
+
const lineDecoder = new LineDecoder();
|
| 80 |
+
const iter = ReadableStreamToAsyncIterable(readableStream);
|
| 81 |
+
for await (const chunk of iter) {
|
| 82 |
+
for (const line of lineDecoder.decode(chunk)) {
|
| 83 |
+
yield line;
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
for (const line of lineDecoder.flush()) {
|
| 87 |
+
yield line;
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
async function* iterator() {
|
| 91 |
+
if (consumed) {
|
| 92 |
+
throw new AnthropicError('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');
|
| 93 |
+
}
|
| 94 |
+
consumed = true;
|
| 95 |
+
let done = false;
|
| 96 |
+
try {
|
| 97 |
+
for await (const line of iterLines()) {
|
| 98 |
+
if (done)
|
| 99 |
+
continue;
|
| 100 |
+
if (line)
|
| 101 |
+
yield JSON.parse(line);
|
| 102 |
+
}
|
| 103 |
+
done = true;
|
| 104 |
+
}
|
| 105 |
+
catch (e) {
|
| 106 |
+
// If the user calls `stream.controller.abort()`, we should exit without throwing.
|
| 107 |
+
if (isAbortError(e))
|
| 108 |
+
return;
|
| 109 |
+
throw e;
|
| 110 |
+
}
|
| 111 |
+
finally {
|
| 112 |
+
// If the user `break`s, abort the ongoing request.
|
| 113 |
+
if (!done)
|
| 114 |
+
controller.abort();
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
return new Stream(iterator, controller);
|
| 118 |
+
}
|
| 119 |
+
[Symbol.asyncIterator]() {
|
| 120 |
+
return this.iterator();
|
| 121 |
+
}
|
| 122 |
+
/**
|
| 123 |
+
* Splits the stream into two streams which can be
|
| 124 |
+
* independently read from at different speeds.
|
| 125 |
+
*/
|
| 126 |
+
tee() {
|
| 127 |
+
const left = [];
|
| 128 |
+
const right = [];
|
| 129 |
+
const iterator = this.iterator();
|
| 130 |
+
const teeIterator = (queue) => {
|
| 131 |
+
return {
|
| 132 |
+
next: () => {
|
| 133 |
+
if (queue.length === 0) {
|
| 134 |
+
const result = iterator.next();
|
| 135 |
+
left.push(result);
|
| 136 |
+
right.push(result);
|
| 137 |
+
}
|
| 138 |
+
return queue.shift();
|
| 139 |
+
},
|
| 140 |
+
};
|
| 141 |
+
};
|
| 142 |
+
return [
|
| 143 |
+
new Stream(() => teeIterator(left), this.controller),
|
| 144 |
+
new Stream(() => teeIterator(right), this.controller),
|
| 145 |
+
];
|
| 146 |
+
}
|
| 147 |
+
/**
|
| 148 |
+
* Converts this stream to a newline-separated ReadableStream of
|
| 149 |
+
* JSON stringified values in the stream
|
| 150 |
+
* which can be turned back into a Stream with `Stream.fromReadableStream()`.
|
| 151 |
+
*/
|
| 152 |
+
toReadableStream() {
|
| 153 |
+
const self = this;
|
| 154 |
+
let iter;
|
| 155 |
+
return makeReadableStream({
|
| 156 |
+
async start() {
|
| 157 |
+
iter = self[Symbol.asyncIterator]();
|
| 158 |
+
},
|
| 159 |
+
async pull(ctrl) {
|
| 160 |
+
try {
|
| 161 |
+
const { value, done } = await iter.next();
|
| 162 |
+
if (done)
|
| 163 |
+
return ctrl.close();
|
| 164 |
+
const bytes = encodeUTF8(JSON.stringify(value) + '\n');
|
| 165 |
+
ctrl.enqueue(bytes);
|
| 166 |
+
}
|
| 167 |
+
catch (err) {
|
| 168 |
+
ctrl.error(err);
|
| 169 |
+
}
|
| 170 |
+
},
|
| 171 |
+
async cancel() {
|
| 172 |
+
await iter.return?.();
|
| 173 |
+
},
|
| 174 |
+
});
|
| 175 |
+
}
|
| 176 |
+
}
|
| 177 |
+
export async function* _iterSSEMessages(response, controller) {
|
| 178 |
+
if (!response.body) {
|
| 179 |
+
controller.abort();
|
| 180 |
+
if (typeof globalThis.navigator !== 'undefined' &&
|
| 181 |
+
globalThis.navigator.product === 'ReactNative') {
|
| 182 |
+
throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`);
|
| 183 |
+
}
|
| 184 |
+
throw new AnthropicError(`Attempted to iterate over a response with no body`);
|
| 185 |
+
}
|
| 186 |
+
const sseDecoder = new SSEDecoder();
|
| 187 |
+
const lineDecoder = new LineDecoder();
|
| 188 |
+
const iter = ReadableStreamToAsyncIterable(response.body);
|
| 189 |
+
for await (const sseChunk of iterSSEChunks(iter)) {
|
| 190 |
+
for (const line of lineDecoder.decode(sseChunk)) {
|
| 191 |
+
const sse = sseDecoder.decode(line);
|
| 192 |
+
if (sse)
|
| 193 |
+
yield sse;
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
for (const line of lineDecoder.flush()) {
|
| 197 |
+
const sse = sseDecoder.decode(line);
|
| 198 |
+
if (sse)
|
| 199 |
+
yield sse;
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
/**
|
| 203 |
+
* Given an async iterable iterator, iterates over it and yields full
|
| 204 |
+
* SSE chunks, i.e. yields when a double new-line is encountered.
|
| 205 |
+
*/
|
| 206 |
+
async function* iterSSEChunks(iterator) {
|
| 207 |
+
let data = new Uint8Array();
|
| 208 |
+
for await (const chunk of iterator) {
|
| 209 |
+
if (chunk == null) {
|
| 210 |
+
continue;
|
| 211 |
+
}
|
| 212 |
+
const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
|
| 213 |
+
: typeof chunk === 'string' ? encodeUTF8(chunk)
|
| 214 |
+
: chunk;
|
| 215 |
+
let newData = new Uint8Array(data.length + binaryChunk.length);
|
| 216 |
+
newData.set(data);
|
| 217 |
+
newData.set(binaryChunk, data.length);
|
| 218 |
+
data = newData;
|
| 219 |
+
let patternIndex;
|
| 220 |
+
while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {
|
| 221 |
+
yield data.slice(0, patternIndex);
|
| 222 |
+
data = data.slice(patternIndex);
|
| 223 |
+
}
|
| 224 |
+
}
|
| 225 |
+
if (data.length > 0) {
|
| 226 |
+
yield data;
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
class SSEDecoder {
|
| 230 |
+
constructor() {
|
| 231 |
+
this.event = null;
|
| 232 |
+
this.data = [];
|
| 233 |
+
this.chunks = [];
|
| 234 |
+
}
|
| 235 |
+
decode(line) {
|
| 236 |
+
if (line.endsWith('\r')) {
|
| 237 |
+
line = line.substring(0, line.length - 1);
|
| 238 |
+
}
|
| 239 |
+
if (!line) {
|
| 240 |
+
// empty line and we didn't previously encounter any messages
|
| 241 |
+
if (!this.event && !this.data.length)
|
| 242 |
+
return null;
|
| 243 |
+
const sse = {
|
| 244 |
+
event: this.event,
|
| 245 |
+
data: this.data.join('\n'),
|
| 246 |
+
raw: this.chunks,
|
| 247 |
+
};
|
| 248 |
+
this.event = null;
|
| 249 |
+
this.data = [];
|
| 250 |
+
this.chunks = [];
|
| 251 |
+
return sse;
|
| 252 |
+
}
|
| 253 |
+
this.chunks.push(line);
|
| 254 |
+
if (line.startsWith(':')) {
|
| 255 |
+
return null;
|
| 256 |
+
}
|
| 257 |
+
let [fieldname, _, value] = partition(line, ':');
|
| 258 |
+
if (value.startsWith(' ')) {
|
| 259 |
+
value = value.substring(1);
|
| 260 |
+
}
|
| 261 |
+
if (fieldname === 'event') {
|
| 262 |
+
this.event = value;
|
| 263 |
+
}
|
| 264 |
+
else if (fieldname === 'data') {
|
| 265 |
+
this.data.push(value);
|
| 266 |
+
}
|
| 267 |
+
return null;
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
function partition(str, delimiter) {
|
| 271 |
+
const index = str.indexOf(delimiter);
|
| 272 |
+
if (index !== -1) {
|
| 273 |
+
return [str.substring(0, index), delimiter, str.substring(index + delimiter.length)];
|
| 274 |
+
}
|
| 275 |
+
return [str, '', ''];
|
| 276 |
+
}
|
| 277 |
+
//# sourceMappingURL=streaming.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["../src/core/streaming.ts"],"names":[],"mappings":"OAA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