@agent-team-foundation/first-tree-hub 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-DUeYbwm-.mjs → bootstrap-B-FRMuvL.mjs} +13 -3
- package/dist/chunk-BSw8zbkd.mjs +37 -0
- package/dist/cli/index.mjs +94 -35
- package/dist/client-By1K4VVT-nVOhsXBy.mjs +4 -0
- package/dist/client-CLdRbuml-B416INrm.mjs +524 -0
- package/dist/dist-BLY7Bu-l.mjs +430 -0
- package/dist/{dist-BoHl9HwW.mjs → dist-FuUBFTEB.mjs} +100 -22
- package/dist/drizzle/0031_drop_system_configs.sql +11 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/errors-BmyRwN0Y-CIZZ_sDc.mjs +92 -0
- package/dist/{esm-CYu4tXXn.mjs → esm-iadMkGbV.mjs} +2 -37
- package/dist/execAsync-CCyouKZM.mjs +10 -0
- package/dist/{execAsync-XMc-nFn-.mjs → execAsync-pImxPKN5.mjs} +1 -1
- package/dist/{feishu-Dxk6ArOK.mjs → feishu-GvFABWW5.mjs} +2 -2
- package/dist/from-CaD373S1.mjs +3840 -0
- package/dist/{getMachineId-bsd-D0w3uAZa.mjs → getMachineId-bsd-DR4-Dysy.mjs} +3 -2
- package/dist/getMachineId-bsd-DjLgZlll.mjs +27 -0
- package/dist/getMachineId-darwin-B6WCAhc4.mjs +24 -0
- package/dist/{getMachineId-darwin-DOoYFb2_.mjs → getMachineId-darwin-CaD2juTg.mjs} +3 -2
- package/dist/getMachineId-linux-BeWHG1gK.mjs +20 -0
- package/dist/{getMachineId-linux-MlY63Zsw.mjs → getMachineId-linux-Dk3gWdQK.mjs} +2 -1
- package/dist/getMachineId-unsupported-BMJQItvF.mjs +15 -0
- package/dist/{getMachineId-unsupported-BS652RIy.mjs → getMachineId-unsupported-Bgz_Je1J.mjs} +2 -1
- package/dist/getMachineId-win-CdgcrzCW.mjs +26 -0
- package/dist/{getMachineId-win-B6hY8edq.mjs → getMachineId-win-vJ6VfDRI.mjs} +3 -2
- package/dist/index.mjs +9 -6
- package/dist/invitation-DWlyNb8x-BEgoZ9k1.mjs +4 -0
- package/dist/{invitation-B1pjAyOz-BaCA9PII.mjs → invitation-Dnn5gGGX-Ce7zbZpn.mjs} +4 -90
- package/dist/multipart-parser-BIksYTkk.mjs +294 -0
- package/dist/observability-C3nY6Jcz-Bk7FX689.mjs +96006 -0
- package/dist/observability-DttujCqj.mjs +5 -0
- package/dist/{saas-connect-DLSyrQcC.mjs → saas-connect-Df2CVAGp.mjs} +7402 -7052
- package/dist/src-CzQ5KF6D.mjs +1176 -0
- package/dist/src-DNBS5Yjj.mjs +735 -0
- package/dist/web/assets/index-43trJLR8.js +388 -0
- package/dist/web/assets/{index-COflQOwF.js → index-CD7rTdqm.js} +1 -1
- package/dist/web/assets/index-fNb_M0nL.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/invitation-CBnQyB7o-TmnIj3kx.mjs +0 -3
- package/dist/observability-C08jUFsJ.mjs +0 -4
- package/dist/observability-DPyf745N-BSc8QNcR.mjs +0 -33897
- package/dist/web/assets/index-BxGzfDTS.js +0 -383
- package/dist/web/assets/index-DDqPt6PI.css +0 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { i as __require, t as __commonJSMin } from "./chunk-BSw8zbkd.mjs";
|
|
2
|
+
import { t as require_src } from "./src-DNBS5Yjj.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js
|
|
4
|
+
var require_helpers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === void 0) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function() {
|
|
11
|
+
return m[k];
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === void 0) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
value: v
|
|
23
|
+
});
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) {
|
|
31
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
+
}
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.req = exports.json = exports.toBuffer = void 0;
|
|
38
|
+
const http$1 = __importStar(__require("http"));
|
|
39
|
+
const https = __importStar(__require("https"));
|
|
40
|
+
async function toBuffer(stream) {
|
|
41
|
+
let length = 0;
|
|
42
|
+
const chunks = [];
|
|
43
|
+
for await (const chunk of stream) {
|
|
44
|
+
length += chunk.length;
|
|
45
|
+
chunks.push(chunk);
|
|
46
|
+
}
|
|
47
|
+
return Buffer.concat(chunks, length);
|
|
48
|
+
}
|
|
49
|
+
exports.toBuffer = toBuffer;
|
|
50
|
+
async function json(stream) {
|
|
51
|
+
const str = (await toBuffer(stream)).toString("utf8");
|
|
52
|
+
try {
|
|
53
|
+
return JSON.parse(str);
|
|
54
|
+
} catch (_err) {
|
|
55
|
+
const err = _err;
|
|
56
|
+
err.message += ` (input: ${str})`;
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.json = json;
|
|
61
|
+
function req(url, opts = {}) {
|
|
62
|
+
const req = ((typeof url === "string" ? url : url.href).startsWith("https:") ? https : http$1).request(url, opts);
|
|
63
|
+
const promise = new Promise((resolve, reject) => {
|
|
64
|
+
req.once("response", resolve).once("error", reject).end();
|
|
65
|
+
});
|
|
66
|
+
req.then = promise.then.bind(promise);
|
|
67
|
+
return req;
|
|
68
|
+
}
|
|
69
|
+
exports.req = req;
|
|
70
|
+
}));
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js
|
|
73
|
+
var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
74
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
75
|
+
if (k2 === void 0) k2 = k;
|
|
76
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
77
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function() {
|
|
80
|
+
return m[k];
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
Object.defineProperty(o, k2, desc);
|
|
84
|
+
}) : (function(o, m, k, k2) {
|
|
85
|
+
if (k2 === void 0) k2 = k;
|
|
86
|
+
o[k2] = m[k];
|
|
87
|
+
}));
|
|
88
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
89
|
+
Object.defineProperty(o, "default", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
value: v
|
|
92
|
+
});
|
|
93
|
+
}) : function(o, v) {
|
|
94
|
+
o["default"] = v;
|
|
95
|
+
});
|
|
96
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
97
|
+
if (mod && mod.__esModule) return mod;
|
|
98
|
+
var result = {};
|
|
99
|
+
if (mod != null) {
|
|
100
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
101
|
+
}
|
|
102
|
+
__setModuleDefault(result, mod);
|
|
103
|
+
return result;
|
|
104
|
+
};
|
|
105
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
|
|
106
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
107
|
+
};
|
|
108
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
109
|
+
exports.Agent = void 0;
|
|
110
|
+
const net$1 = __importStar(__require("net"));
|
|
111
|
+
const http = __importStar(__require("http"));
|
|
112
|
+
const https_1 = __require("https");
|
|
113
|
+
__exportStar(require_helpers(), exports);
|
|
114
|
+
const INTERNAL = Symbol("AgentBaseInternalState");
|
|
115
|
+
var Agent = class extends http.Agent {
|
|
116
|
+
constructor(opts) {
|
|
117
|
+
super(opts);
|
|
118
|
+
this[INTERNAL] = {};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Determine whether this is an `http` or `https` request.
|
|
122
|
+
*/
|
|
123
|
+
isSecureEndpoint(options) {
|
|
124
|
+
if (options) {
|
|
125
|
+
if (typeof options.secureEndpoint === "boolean") return options.secureEndpoint;
|
|
126
|
+
if (typeof options.protocol === "string") return options.protocol === "https:";
|
|
127
|
+
}
|
|
128
|
+
const { stack } = /* @__PURE__ */ new Error();
|
|
129
|
+
if (typeof stack !== "string") return false;
|
|
130
|
+
return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
|
|
131
|
+
}
|
|
132
|
+
incrementSockets(name) {
|
|
133
|
+
if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) return null;
|
|
134
|
+
if (!this.sockets[name]) this.sockets[name] = [];
|
|
135
|
+
const fakeSocket = new net$1.Socket({ writable: false });
|
|
136
|
+
this.sockets[name].push(fakeSocket);
|
|
137
|
+
this.totalSocketCount++;
|
|
138
|
+
return fakeSocket;
|
|
139
|
+
}
|
|
140
|
+
decrementSockets(name, socket) {
|
|
141
|
+
if (!this.sockets[name] || socket === null) return;
|
|
142
|
+
const sockets = this.sockets[name];
|
|
143
|
+
const index = sockets.indexOf(socket);
|
|
144
|
+
if (index !== -1) {
|
|
145
|
+
sockets.splice(index, 1);
|
|
146
|
+
this.totalSocketCount--;
|
|
147
|
+
if (sockets.length === 0) delete this.sockets[name];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
getName(options) {
|
|
151
|
+
if (this.isSecureEndpoint(options)) return https_1.Agent.prototype.getName.call(this, options);
|
|
152
|
+
return super.getName(options);
|
|
153
|
+
}
|
|
154
|
+
createSocket(req, options, cb) {
|
|
155
|
+
const connectOpts = {
|
|
156
|
+
...options,
|
|
157
|
+
secureEndpoint: this.isSecureEndpoint(options)
|
|
158
|
+
};
|
|
159
|
+
const name = this.getName(connectOpts);
|
|
160
|
+
const fakeSocket = this.incrementSockets(name);
|
|
161
|
+
Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
|
|
162
|
+
this.decrementSockets(name, fakeSocket);
|
|
163
|
+
if (socket instanceof http.Agent) try {
|
|
164
|
+
return socket.addRequest(req, connectOpts);
|
|
165
|
+
} catch (err) {
|
|
166
|
+
return cb(err);
|
|
167
|
+
}
|
|
168
|
+
this[INTERNAL].currentSocket = socket;
|
|
169
|
+
super.createSocket(req, options, cb);
|
|
170
|
+
}, (err) => {
|
|
171
|
+
this.decrementSockets(name, fakeSocket);
|
|
172
|
+
cb(err);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
createConnection() {
|
|
176
|
+
const socket = this[INTERNAL].currentSocket;
|
|
177
|
+
this[INTERNAL].currentSocket = void 0;
|
|
178
|
+
if (!socket) throw new Error("No socket was returned in the `connect()` function");
|
|
179
|
+
return socket;
|
|
180
|
+
}
|
|
181
|
+
get defaultPort() {
|
|
182
|
+
return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
|
|
183
|
+
}
|
|
184
|
+
set defaultPort(v) {
|
|
185
|
+
if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
|
|
186
|
+
}
|
|
187
|
+
get protocol() {
|
|
188
|
+
return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
|
|
189
|
+
}
|
|
190
|
+
set protocol(v) {
|
|
191
|
+
if (this[INTERNAL]) this[INTERNAL].protocol = v;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
exports.Agent = Agent;
|
|
195
|
+
}));
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js
|
|
198
|
+
var require_parse_proxy_response = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
199
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
200
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
201
|
+
};
|
|
202
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
203
|
+
exports.parseProxyResponse = void 0;
|
|
204
|
+
const debug = (0, __importDefault(require_src()).default)("https-proxy-agent:parse-proxy-response");
|
|
205
|
+
function parseProxyResponse(socket) {
|
|
206
|
+
return new Promise((resolve, reject) => {
|
|
207
|
+
let buffersLength = 0;
|
|
208
|
+
const buffers = [];
|
|
209
|
+
function read() {
|
|
210
|
+
const b = socket.read();
|
|
211
|
+
if (b) ondata(b);
|
|
212
|
+
else socket.once("readable", read);
|
|
213
|
+
}
|
|
214
|
+
function cleanup() {
|
|
215
|
+
socket.removeListener("end", onend);
|
|
216
|
+
socket.removeListener("error", onerror);
|
|
217
|
+
socket.removeListener("readable", read);
|
|
218
|
+
}
|
|
219
|
+
function onend() {
|
|
220
|
+
cleanup();
|
|
221
|
+
debug("onend");
|
|
222
|
+
reject(/* @__PURE__ */ new Error("Proxy connection ended before receiving CONNECT response"));
|
|
223
|
+
}
|
|
224
|
+
function onerror(err) {
|
|
225
|
+
cleanup();
|
|
226
|
+
debug("onerror %o", err);
|
|
227
|
+
reject(err);
|
|
228
|
+
}
|
|
229
|
+
function ondata(b) {
|
|
230
|
+
buffers.push(b);
|
|
231
|
+
buffersLength += b.length;
|
|
232
|
+
const buffered = Buffer.concat(buffers, buffersLength);
|
|
233
|
+
const endOfHeaders = buffered.indexOf("\r\n\r\n");
|
|
234
|
+
if (endOfHeaders === -1) {
|
|
235
|
+
debug("have not received end of HTTP headers yet...");
|
|
236
|
+
read();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
|
|
240
|
+
const firstLine = headerParts.shift();
|
|
241
|
+
if (!firstLine) {
|
|
242
|
+
socket.destroy();
|
|
243
|
+
return reject(/* @__PURE__ */ new Error("No header received from proxy CONNECT response"));
|
|
244
|
+
}
|
|
245
|
+
const firstLineParts = firstLine.split(" ");
|
|
246
|
+
const statusCode = +firstLineParts[1];
|
|
247
|
+
const statusText = firstLineParts.slice(2).join(" ");
|
|
248
|
+
const headers = {};
|
|
249
|
+
for (const header of headerParts) {
|
|
250
|
+
if (!header) continue;
|
|
251
|
+
const firstColon = header.indexOf(":");
|
|
252
|
+
if (firstColon === -1) {
|
|
253
|
+
socket.destroy();
|
|
254
|
+
return reject(/* @__PURE__ */ new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
255
|
+
}
|
|
256
|
+
const key = header.slice(0, firstColon).toLowerCase();
|
|
257
|
+
const value = header.slice(firstColon + 1).trimStart();
|
|
258
|
+
const current = headers[key];
|
|
259
|
+
if (typeof current === "string") headers[key] = [current, value];
|
|
260
|
+
else if (Array.isArray(current)) current.push(value);
|
|
261
|
+
else headers[key] = value;
|
|
262
|
+
}
|
|
263
|
+
debug("got proxy server response: %o %o", firstLine, headers);
|
|
264
|
+
cleanup();
|
|
265
|
+
resolve({
|
|
266
|
+
connect: {
|
|
267
|
+
statusCode,
|
|
268
|
+
statusText,
|
|
269
|
+
headers
|
|
270
|
+
},
|
|
271
|
+
buffered
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
socket.on("error", onerror);
|
|
275
|
+
socket.on("end", onend);
|
|
276
|
+
read();
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
exports.parseProxyResponse = parseProxyResponse;
|
|
280
|
+
}));
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js
|
|
283
|
+
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
284
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
285
|
+
if (k2 === void 0) k2 = k;
|
|
286
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
287
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
288
|
+
enumerable: true,
|
|
289
|
+
get: function() {
|
|
290
|
+
return m[k];
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
Object.defineProperty(o, k2, desc);
|
|
294
|
+
}) : (function(o, m, k, k2) {
|
|
295
|
+
if (k2 === void 0) k2 = k;
|
|
296
|
+
o[k2] = m[k];
|
|
297
|
+
}));
|
|
298
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
299
|
+
Object.defineProperty(o, "default", {
|
|
300
|
+
enumerable: true,
|
|
301
|
+
value: v
|
|
302
|
+
});
|
|
303
|
+
}) : function(o, v) {
|
|
304
|
+
o["default"] = v;
|
|
305
|
+
});
|
|
306
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
307
|
+
if (mod && mod.__esModule) return mod;
|
|
308
|
+
var result = {};
|
|
309
|
+
if (mod != null) {
|
|
310
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
311
|
+
}
|
|
312
|
+
__setModuleDefault(result, mod);
|
|
313
|
+
return result;
|
|
314
|
+
};
|
|
315
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
316
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
317
|
+
};
|
|
318
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
319
|
+
exports.HttpsProxyAgent = void 0;
|
|
320
|
+
const net = __importStar(__require("net"));
|
|
321
|
+
const tls = __importStar(__require("tls"));
|
|
322
|
+
const assert_1 = __importDefault(__require("assert"));
|
|
323
|
+
const debug_1 = __importDefault(require_src());
|
|
324
|
+
const agent_base_1 = require_dist$1();
|
|
325
|
+
const url_1 = __require("url");
|
|
326
|
+
const parse_proxy_response_1 = require_parse_proxy_response();
|
|
327
|
+
const debug = (0, debug_1.default)("https-proxy-agent");
|
|
328
|
+
const setServernameFromNonIpHost = (options) => {
|
|
329
|
+
if (options.servername === void 0 && options.host && !net.isIP(options.host)) return {
|
|
330
|
+
...options,
|
|
331
|
+
servername: options.host
|
|
332
|
+
};
|
|
333
|
+
return options;
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
|
337
|
+
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
|
338
|
+
*
|
|
339
|
+
* Outgoing HTTP requests are first tunneled through the proxy server using the
|
|
340
|
+
* `CONNECT` HTTP request method to establish a connection to the proxy server,
|
|
341
|
+
* and then the proxy server connects to the destination target and issues the
|
|
342
|
+
* HTTP request from the proxy server.
|
|
343
|
+
*
|
|
344
|
+
* `https:` requests have their socket connection upgraded to TLS once
|
|
345
|
+
* the connection to the proxy server has been established.
|
|
346
|
+
*/
|
|
347
|
+
var HttpsProxyAgent = class extends agent_base_1.Agent {
|
|
348
|
+
constructor(proxy, opts) {
|
|
349
|
+
super(opts);
|
|
350
|
+
this.options = { path: void 0 };
|
|
351
|
+
this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
|
|
352
|
+
this.proxyHeaders = opts?.headers ?? {};
|
|
353
|
+
debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
|
|
354
|
+
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
|
355
|
+
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
|
356
|
+
this.connectOpts = {
|
|
357
|
+
ALPNProtocols: ["http/1.1"],
|
|
358
|
+
...opts ? omit(opts, "headers") : null,
|
|
359
|
+
host,
|
|
360
|
+
port
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Called when the node-core HTTP client library is creating a
|
|
365
|
+
* new HTTP request.
|
|
366
|
+
*/
|
|
367
|
+
async connect(req, opts) {
|
|
368
|
+
const { proxy } = this;
|
|
369
|
+
if (!opts.host) throw new TypeError("No \"host\" provided");
|
|
370
|
+
let socket;
|
|
371
|
+
if (proxy.protocol === "https:") {
|
|
372
|
+
debug("Creating `tls.Socket`: %o", this.connectOpts);
|
|
373
|
+
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
374
|
+
} else {
|
|
375
|
+
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
376
|
+
socket = net.connect(this.connectOpts);
|
|
377
|
+
}
|
|
378
|
+
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
379
|
+
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
380
|
+
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
|
|
381
|
+
if (proxy.username || proxy.password) {
|
|
382
|
+
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
383
|
+
headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
|
|
384
|
+
}
|
|
385
|
+
headers.Host = `${host}:${opts.port}`;
|
|
386
|
+
if (!headers["Proxy-Connection"]) headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
|
|
387
|
+
for (const name of Object.keys(headers)) payload += `${name}: ${headers[name]}\r\n`;
|
|
388
|
+
const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
|
|
389
|
+
socket.write(`${payload}\r\n`);
|
|
390
|
+
const { connect, buffered } = await proxyResponsePromise;
|
|
391
|
+
req.emit("proxyConnect", connect);
|
|
392
|
+
this.emit("proxyConnect", connect, req);
|
|
393
|
+
if (connect.statusCode === 200) {
|
|
394
|
+
req.once("socket", resume);
|
|
395
|
+
if (opts.secureEndpoint) {
|
|
396
|
+
debug("Upgrading socket connection to TLS");
|
|
397
|
+
return tls.connect({
|
|
398
|
+
...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
|
|
399
|
+
socket
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
return socket;
|
|
403
|
+
}
|
|
404
|
+
socket.destroy();
|
|
405
|
+
const fakeSocket = new net.Socket({ writable: false });
|
|
406
|
+
fakeSocket.readable = true;
|
|
407
|
+
req.once("socket", (s) => {
|
|
408
|
+
debug("Replaying proxy buffer for failed request");
|
|
409
|
+
(0, assert_1.default)(s.listenerCount("data") > 0);
|
|
410
|
+
s.push(buffered);
|
|
411
|
+
s.push(null);
|
|
412
|
+
});
|
|
413
|
+
return fakeSocket;
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
HttpsProxyAgent.protocols = ["http", "https"];
|
|
417
|
+
exports.HttpsProxyAgent = HttpsProxyAgent;
|
|
418
|
+
function resume(socket) {
|
|
419
|
+
socket.resume();
|
|
420
|
+
}
|
|
421
|
+
function omit(obj, ...keys) {
|
|
422
|
+
const ret = {};
|
|
423
|
+
let key;
|
|
424
|
+
for (key in obj) if (!keys.includes(key)) ret[key] = obj[key];
|
|
425
|
+
return ret;
|
|
426
|
+
}
|
|
427
|
+
}));
|
|
428
|
+
//#endregion
|
|
429
|
+
export default require_dist();
|
|
430
|
+
export {};
|
|
@@ -679,6 +679,104 @@ const paginationQuerySchema = z.object({
|
|
|
679
679
|
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
680
680
|
cursor: z.string().optional()
|
|
681
681
|
});
|
|
682
|
+
const contextTreeSnapshotStatusSchema = z.enum([
|
|
683
|
+
"active",
|
|
684
|
+
"stale",
|
|
685
|
+
"unavailable"
|
|
686
|
+
]);
|
|
687
|
+
const contextTreeStatusSeveritySchema = z.enum([
|
|
688
|
+
"ok",
|
|
689
|
+
"warning",
|
|
690
|
+
"error"
|
|
691
|
+
]);
|
|
692
|
+
const contextTreeStatusSchema = z.object({
|
|
693
|
+
label: z.string(),
|
|
694
|
+
detail: z.string().nullable(),
|
|
695
|
+
severity: contextTreeStatusSeveritySchema
|
|
696
|
+
});
|
|
697
|
+
const contextTreeNodeKindSchema = z.enum([
|
|
698
|
+
"root",
|
|
699
|
+
"domain",
|
|
700
|
+
"subdomain",
|
|
701
|
+
"leaf"
|
|
702
|
+
]);
|
|
703
|
+
const contextTreeChangeTypeSchema = z.enum([
|
|
704
|
+
"added",
|
|
705
|
+
"edited",
|
|
706
|
+
"removed"
|
|
707
|
+
]);
|
|
708
|
+
const contextTreeEdgeKindSchema = z.enum([
|
|
709
|
+
"parent",
|
|
710
|
+
"soft_link",
|
|
711
|
+
"markdown_link"
|
|
712
|
+
]);
|
|
713
|
+
const contextTreeRiskLevelSchema = z.enum([
|
|
714
|
+
"low",
|
|
715
|
+
"medium",
|
|
716
|
+
"high"
|
|
717
|
+
]);
|
|
718
|
+
const contextTreeNodeSchema = z.object({
|
|
719
|
+
id: z.string(),
|
|
720
|
+
path: z.string(),
|
|
721
|
+
sourcePath: z.string().nullable(),
|
|
722
|
+
title: z.string(),
|
|
723
|
+
kind: contextTreeNodeKindSchema,
|
|
724
|
+
owners: z.array(z.string()),
|
|
725
|
+
parentId: z.string().nullable(),
|
|
726
|
+
preview: z.string().nullable(),
|
|
727
|
+
relatedNodeIds: z.array(z.string()),
|
|
728
|
+
affectedContextArea: z.string(),
|
|
729
|
+
changeType: contextTreeChangeTypeSchema.nullable(),
|
|
730
|
+
changedAtCommit: z.string().nullable()
|
|
731
|
+
});
|
|
732
|
+
const contextTreeEdgeSchema = z.object({
|
|
733
|
+
source: z.string(),
|
|
734
|
+
target: z.string(),
|
|
735
|
+
kind: contextTreeEdgeKindSchema
|
|
736
|
+
});
|
|
737
|
+
const contextTreeChangeSchema = z.object({
|
|
738
|
+
path: z.string(),
|
|
739
|
+
nodeId: z.string().nullable(),
|
|
740
|
+
type: contextTreeChangeTypeSchema,
|
|
741
|
+
commit: z.string().nullable(),
|
|
742
|
+
changedAt: z.string().nullable(),
|
|
743
|
+
changedBy: z.string().nullable(),
|
|
744
|
+
summary: z.string().nullable()
|
|
745
|
+
});
|
|
746
|
+
const contextTreeUpdateSchema = z.object({
|
|
747
|
+
id: z.string(),
|
|
748
|
+
nodeId: z.string().nullable(),
|
|
749
|
+
path: z.string(),
|
|
750
|
+
title: z.string(),
|
|
751
|
+
changeType: contextTreeChangeTypeSchema,
|
|
752
|
+
affectedContextArea: z.string(),
|
|
753
|
+
reason: z.string(),
|
|
754
|
+
summary: z.string(),
|
|
755
|
+
changedBy: z.string().nullable(),
|
|
756
|
+
owners: z.array(z.string()),
|
|
757
|
+
relatedNodeIds: z.array(z.string()),
|
|
758
|
+
sourceCommit: z.string().nullable(),
|
|
759
|
+
riskLevel: contextTreeRiskLevelSchema
|
|
760
|
+
});
|
|
761
|
+
const contextTreeSummarySchema = z.object({
|
|
762
|
+
addedCount: z.number().int().nonnegative(),
|
|
763
|
+
editedCount: z.number().int().nonnegative(),
|
|
764
|
+
removedCount: z.number().int().nonnegative(),
|
|
765
|
+
changedNodeCount: z.number().int().nonnegative()
|
|
766
|
+
});
|
|
767
|
+
const contextTreeSnapshotSchema = z.object({
|
|
768
|
+
repo: z.string().nullable(),
|
|
769
|
+
branch: z.string().nullable(),
|
|
770
|
+
headCommit: z.string().nullable(),
|
|
771
|
+
syncedAt: z.string().nullable(),
|
|
772
|
+
snapshotStatus: contextTreeSnapshotStatusSchema,
|
|
773
|
+
contextStatus: contextTreeStatusSchema,
|
|
774
|
+
summary: contextTreeSummarySchema,
|
|
775
|
+
updates: z.array(contextTreeUpdateSchema),
|
|
776
|
+
nodes: z.array(contextTreeNodeSchema),
|
|
777
|
+
edges: z.array(contextTreeEdgeSchema),
|
|
778
|
+
changes: z.array(contextTreeChangeSchema)
|
|
779
|
+
});
|
|
682
780
|
const supportedImageMimeSchema = z.enum([
|
|
683
781
|
"image/png",
|
|
684
782
|
"image/jpeg",
|
|
@@ -956,8 +1054,6 @@ const createOrgFromMeSchema = z.object({
|
|
|
956
1054
|
name: z.string().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
957
1055
|
displayName: z.string().min(1).max(200)
|
|
958
1056
|
});
|
|
959
|
-
/** Body for `POST /auth/switch-org`. */
|
|
960
|
-
const switchOrgSchema = z.object({ organizationId: z.string().min(1) });
|
|
961
1057
|
z.object({
|
|
962
1058
|
id: z.string(),
|
|
963
1059
|
organizationId: z.string(),
|
|
@@ -1045,7 +1141,7 @@ const githubDevCallbackQuerySchema = z.object({
|
|
|
1045
1141
|
next: z.string().max(256).optional()
|
|
1046
1142
|
});
|
|
1047
1143
|
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1048
|
-
|
|
1144
|
+
z.object({
|
|
1049
1145
|
name: z.string().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/, "Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine((v) => !UUID_PATTERN.test(v), "Name must not be a UUID format"),
|
|
1050
1146
|
displayName: z.string().min(1).max(200),
|
|
1051
1147
|
maxAgents: z.number().int().min(0).default(0),
|
|
@@ -1200,24 +1296,6 @@ z.object({
|
|
|
1200
1296
|
totalMessages: z.number(),
|
|
1201
1297
|
byOrganization: z.array(orgStatsSchema)
|
|
1202
1298
|
});
|
|
1203
|
-
z.object({
|
|
1204
|
-
key: z.string(),
|
|
1205
|
-
value: z.unknown(),
|
|
1206
|
-
updatedAt: z.string()
|
|
1207
|
-
});
|
|
1208
|
-
const updateSystemConfigSchema = z.record(z.string(), z.unknown());
|
|
1209
|
-
const SYSTEM_CONFIG_KEYS = {
|
|
1210
|
-
INBOX_TIMEOUT_SECONDS: "inbox_timeout_seconds",
|
|
1211
|
-
MAX_RETRY_COUNT: "max_retry_count",
|
|
1212
|
-
POLLING_INTERVAL_SECONDS: "polling_interval_seconds",
|
|
1213
|
-
PRESENCE_CLEANUP_SECONDS: "presence_cleanup_seconds"
|
|
1214
|
-
};
|
|
1215
|
-
const SYSTEM_CONFIG_DEFAULTS = {
|
|
1216
|
-
[SYSTEM_CONFIG_KEYS.INBOX_TIMEOUT_SECONDS]: 300,
|
|
1217
|
-
[SYSTEM_CONFIG_KEYS.MAX_RETRY_COUNT]: 3,
|
|
1218
|
-
[SYSTEM_CONFIG_KEYS.POLLING_INTERVAL_SECONDS]: 5,
|
|
1219
|
-
[SYSTEM_CONFIG_KEYS.PRESENCE_CLEANUP_SECONDS]: 60
|
|
1220
|
-
};
|
|
1221
1299
|
/** Fixed 5-state machine. No custom statuses. */
|
|
1222
1300
|
const TASK_STATUSES = {
|
|
1223
1301
|
PENDING: "pending",
|
|
@@ -1389,4 +1467,4 @@ z.object({
|
|
|
1389
1467
|
capabilities: serverCapabilitiesSchema.optional()
|
|
1390
1468
|
}).passthrough();
|
|
1391
1469
|
//#endregion
|
|
1392
|
-
export {
|
|
1470
|
+
export { notificationQuerySchema as $, createChatSchema as A, githubDevCallbackQuerySchema as B, clientCapabilitiesSchema as C, updateTaskStatusSchema as Ct, createAdapterConfigSchema as D, contextTreeSnapshotSchema as E, defaultRuntimeConfigPayload as F, inboxPollQuerySchema as G, imageInlineContentSchema as H, delegateFeishuUserSchema as I, joinByInvitationSchema as J, isRedactedEnvValue as K, dryRunAgentRuntimeConfigSchema as L, createMemberSchema as M, createOrgFromMeSchema as N, createAdapterMappingSchema as O, createTaskSchema as P, messageSourceSchema as Q, extractMentions as R, agentTypeSchema as S, updateOrganizationSchema as St, connectTokenExchangeSchema as T, inboxAckFrameSchema as U, githubStartQuerySchema as V, inboxDeliverFrameSchema as W, listMeChatsQuerySchema as X, linkTaskChatSchema as Y, loginSchema as Z, adminCreateTaskSchema as _, updateAgentRuntimeConfigSchema as _t, AGENT_STATUSES as a, scanMentionTokens as at, agentPinnedMessageSchema as b, updateClientCapabilitiesSchema as bt, DEFAULT_RUNTIME_PROVIDER as c, sendToAgentSchema as ct, TASK_HEALTH_SIGNALS as d, sessionEventSchema as dt, paginationQuerySchema as et, TASK_STATUSES as f, sessionReconcileRequestSchema as ft, addParticipantSchema as g, updateAdapterConfigSchema as gt, addMeChatParticipantsSchema as h, taskListQuerySchema as ht, AGENT_SOURCES as i, safeRedirectPath as it, createMeChatSchema as j, createAgentSchema as k, MENTION_REGEX as l, sessionCompletionMessageSchema as lt, WS_AUTH_FRAME_TIMEOUT_MS as m, stripCode as mt, AGENT_NAME_REGEX as n, refreshTokenSchema as nt, AGENT_TYPES as o, selfServiceFeishuBotSchema as ot, TASK_TERMINAL_STATUSES as p, sessionStateMessageSchema as pt, isReservedAgentName as q, AGENT_SELECTOR_HEADER as r, runtimeStateMessageSchema as rt, AGENT_VISIBILITY as s, sendMessageSchema as st, AGENT_BIND_REJECT_REASONS as t, rebindAgentSchema as tt, TASK_CREATOR_TYPES as u, sessionEventMessageSchema as ut, adminUpdateTaskSchema as v, updateAgentSchema as vt, clientRegisterSchema as w, wsAuthFrameSchema as wt, agentRuntimeConfigPayloadSchema as x, updateMemberSchema as xt, agentBindRequestSchema as y, updateChatSchema as yt, githubCallbackQuerySchema as z };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- Drop the `system_configs` table — replaced by deployment-level env
|
|
2
|
+
-- vars (FIRST_TREE_HUB_INBOX_TIMEOUT_SECONDS, FIRST_TREE_HUB_MAX_RETRY_COUNT,
|
|
3
|
+
-- FIRST_TREE_HUB_POLLING_INTERVAL_SECONDS, FIRST_TREE_HUB_PRESENCE_CLEANUP_SECONDS,
|
|
4
|
+
-- FIRST_TREE_HUB_NOTIFICATION_WEBHOOK_URL).
|
|
5
|
+
--
|
|
6
|
+
-- See proposals/hub-strip-jwt-ambient-scope.20260508.md §3.5 + §6.3.
|
|
7
|
+
-- The table held tunables that were never customer-configurable; promoting
|
|
8
|
+
-- them to env vars closes the multi-tenant security gap where any org admin
|
|
9
|
+
-- could mutate cross-org runtime behavior.
|
|
10
|
+
|
|
11
|
+
DROP TABLE IF EXISTS "system_configs";
|
|
@@ -218,6 +218,13 @@
|
|
|
218
218
|
"when": 1777852800000,
|
|
219
219
|
"tag": "0030_chat_first_workspace",
|
|
220
220
|
"breakpoints": true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"idx": 31,
|
|
224
|
+
"version": "7",
|
|
225
|
+
"when": 1777939200000,
|
|
226
|
+
"tag": "0031_drop_system_configs",
|
|
227
|
+
"breakpoints": true
|
|
221
228
|
}
|
|
222
229
|
]
|
|
223
230
|
}
|