@caplets/core 0.18.4 → 0.18.6
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/index.js +26 -26
- package/dist/native/process-cleanup.d.ts +4 -1
- package/dist/native.d.ts +1 -1
- package/dist/native.js +21 -19
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1320,7 +1320,7 @@ const EMPTY_COMPLETION_RESULT = { completion: {
|
|
|
1320
1320
|
} };
|
|
1321
1321
|
//#endregion
|
|
1322
1322
|
//#region package.json
|
|
1323
|
-
var version = "0.18.
|
|
1323
|
+
var version = "0.18.6";
|
|
1324
1324
|
//#endregion
|
|
1325
1325
|
//#region src/serve/session.ts
|
|
1326
1326
|
var CapletsMcpSession = class {
|
|
@@ -5420,7 +5420,7 @@ function redactRemoteMessage(message) {
|
|
|
5420
5420
|
return String(redactSecrets(message)).replace(/\b(authorization\s*:\s*(?:basic|bearer)\s+)[^\s,;]+/giu, "$1[REDACTED]").replace(/\b((?:access_)?token=)[^\s,;]+/giu, "$1[REDACTED]").replace(/\b((?:token|secret|authorization|auth|api[-_]?key|password|credential|clientsecret|client_secret|code|refresh(?:_token)?)\s*[=:]\s*)[^\s,;]+/giu, "$1[REDACTED]");
|
|
5421
5421
|
}
|
|
5422
5422
|
//#endregion
|
|
5423
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
5423
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/compose.js
|
|
5424
5424
|
var compose = (middleware, onError, onNotFound) => {
|
|
5425
5425
|
return (context, next) => {
|
|
5426
5426
|
let index = -1;
|
|
@@ -5451,7 +5451,7 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
5451
5451
|
};
|
|
5452
5452
|
};
|
|
5453
5453
|
//#endregion
|
|
5454
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
5454
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/http-exception.js
|
|
5455
5455
|
var HTTPException = class extends Error {
|
|
5456
5456
|
res;
|
|
5457
5457
|
status;
|
|
@@ -5479,10 +5479,10 @@ var HTTPException = class extends Error {
|
|
|
5479
5479
|
}
|
|
5480
5480
|
};
|
|
5481
5481
|
//#endregion
|
|
5482
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
5482
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/request/constants.js
|
|
5483
5483
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
5484
5484
|
//#endregion
|
|
5485
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
5485
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/body.js
|
|
5486
5486
|
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
5487
5487
|
const { all = false, dot = false } = options;
|
|
5488
5488
|
const contentType = (request instanceof HonoRequest ? request.raw.headers : request.headers).get("Content-Type");
|
|
@@ -5530,7 +5530,7 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
5530
5530
|
});
|
|
5531
5531
|
};
|
|
5532
5532
|
//#endregion
|
|
5533
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
5533
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/url.js
|
|
5534
5534
|
var splitPath = (path) => {
|
|
5535
5535
|
const paths = path.split("/");
|
|
5536
5536
|
if (paths[0] === "") paths.shift();
|
|
@@ -5694,7 +5694,7 @@ var getQueryParams = (url, key) => {
|
|
|
5694
5694
|
};
|
|
5695
5695
|
var decodeURIComponent_ = decodeURIComponent;
|
|
5696
5696
|
//#endregion
|
|
5697
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
5697
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/request.js
|
|
5698
5698
|
var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
|
|
5699
5699
|
var HonoRequest = class {
|
|
5700
5700
|
/**
|
|
@@ -5966,7 +5966,7 @@ var HonoRequest = class {
|
|
|
5966
5966
|
}
|
|
5967
5967
|
};
|
|
5968
5968
|
//#endregion
|
|
5969
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
5969
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/html.js
|
|
5970
5970
|
var HtmlEscapedCallbackPhase = {
|
|
5971
5971
|
Stringify: 1,
|
|
5972
5972
|
BeforeStream: 2,
|
|
@@ -5996,7 +5996,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
5996
5996
|
else return resStr;
|
|
5997
5997
|
};
|
|
5998
5998
|
//#endregion
|
|
5999
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
5999
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/context.js
|
|
6000
6000
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
6001
6001
|
var setDefaultContentType = (contentType, headers) => {
|
|
6002
6002
|
return {
|
|
@@ -6357,7 +6357,7 @@ var Context = class {
|
|
|
6357
6357
|
};
|
|
6358
6358
|
};
|
|
6359
6359
|
//#endregion
|
|
6360
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
6360
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router.js
|
|
6361
6361
|
var METHODS = [
|
|
6362
6362
|
"get",
|
|
6363
6363
|
"post",
|
|
@@ -6369,10 +6369,10 @@ var METHODS = [
|
|
|
6369
6369
|
var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
|
|
6370
6370
|
var UnsupportedPathError = class extends Error {};
|
|
6371
6371
|
//#endregion
|
|
6372
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
6372
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/constants.js
|
|
6373
6373
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
6374
6374
|
//#endregion
|
|
6375
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
6375
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/hono-base.js
|
|
6376
6376
|
var notFoundHandler = (c) => {
|
|
6377
6377
|
return c.text("404 Not Found", 404);
|
|
6378
6378
|
};
|
|
@@ -6706,7 +6706,7 @@ var Hono$1 = class _Hono {
|
|
|
6706
6706
|
};
|
|
6707
6707
|
};
|
|
6708
6708
|
//#endregion
|
|
6709
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
6709
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
6710
6710
|
var emptyParam = [];
|
|
6711
6711
|
function match(method, path) {
|
|
6712
6712
|
const matchers = this.buildAllMatchers();
|
|
@@ -6723,7 +6723,7 @@ function match(method, path) {
|
|
|
6723
6723
|
return match2(method, path);
|
|
6724
6724
|
}
|
|
6725
6725
|
//#endregion
|
|
6726
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
6726
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
6727
6727
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
6728
6728
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
6729
6729
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -6802,7 +6802,7 @@ var Node$1 = class _Node {
|
|
|
6802
6802
|
}
|
|
6803
6803
|
};
|
|
6804
6804
|
//#endregion
|
|
6805
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
6805
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
6806
6806
|
var Trie = class {
|
|
6807
6807
|
#context = { varIndex: 0 };
|
|
6808
6808
|
#root = new Node$1();
|
|
@@ -6860,7 +6860,7 @@ var Trie = class {
|
|
|
6860
6860
|
}
|
|
6861
6861
|
};
|
|
6862
6862
|
//#endregion
|
|
6863
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
6863
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
6864
6864
|
var nullMatcher = [
|
|
6865
6865
|
/^$/,
|
|
6866
6866
|
[],
|
|
@@ -6991,7 +6991,7 @@ var RegExpRouter = class {
|
|
|
6991
6991
|
}
|
|
6992
6992
|
};
|
|
6993
6993
|
//#endregion
|
|
6994
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
6994
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/smart-router/router.js
|
|
6995
6995
|
var SmartRouter = class {
|
|
6996
6996
|
name = "SmartRouter";
|
|
6997
6997
|
#routers = [];
|
|
@@ -7038,7 +7038,7 @@ var SmartRouter = class {
|
|
|
7038
7038
|
}
|
|
7039
7039
|
};
|
|
7040
7040
|
//#endregion
|
|
7041
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
7041
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/trie-router/node.js
|
|
7042
7042
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
7043
7043
|
var hasChildren = (children) => {
|
|
7044
7044
|
for (const _ in children) return true;
|
|
@@ -7191,7 +7191,7 @@ var Node = class _Node {
|
|
|
7191
7191
|
}
|
|
7192
7192
|
};
|
|
7193
7193
|
//#endregion
|
|
7194
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
7194
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/trie-router/router.js
|
|
7195
7195
|
var TrieRouter = class {
|
|
7196
7196
|
name = "TrieRouter";
|
|
7197
7197
|
#node;
|
|
@@ -7211,7 +7211,7 @@ var TrieRouter = class {
|
|
|
7211
7211
|
}
|
|
7212
7212
|
};
|
|
7213
7213
|
//#endregion
|
|
7214
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
7214
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/hono.js
|
|
7215
7215
|
var Hono = class extends Hono$1 {
|
|
7216
7216
|
/**
|
|
7217
7217
|
* Creates an instance of the Hono class.
|
|
@@ -7252,7 +7252,7 @@ object({
|
|
|
7252
7252
|
client_secret: string().optional()
|
|
7253
7253
|
});
|
|
7254
7254
|
//#endregion
|
|
7255
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
7255
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/stream.js
|
|
7256
7256
|
var StreamingApi = class {
|
|
7257
7257
|
writer;
|
|
7258
7258
|
encoder;
|
|
@@ -7325,7 +7325,7 @@ var StreamingApi = class {
|
|
|
7325
7325
|
}
|
|
7326
7326
|
};
|
|
7327
7327
|
//#endregion
|
|
7328
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
7328
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/helper/streaming/sse.js
|
|
7329
7329
|
var SSEStreamingApi = class extends StreamingApi {
|
|
7330
7330
|
constructor(writable, readable) {
|
|
7331
7331
|
super(writable, readable);
|
|
@@ -7349,7 +7349,7 @@ var SSEStreamingApi = class extends StreamingApi {
|
|
|
7349
7349
|
}
|
|
7350
7350
|
};
|
|
7351
7351
|
//#endregion
|
|
7352
|
-
//#region ../../node_modules/.pnpm/@hono+mcp@0.3.0_@modelcontextprotocol+sdk@1.29.0_zod@4.4.3__hono-rate-limiter@0.5.3_hono@4.12.
|
|
7352
|
+
//#region ../../node_modules/.pnpm/@hono+mcp@0.3.0_@modelcontextprotocol+sdk@1.29.0_zod@4.4.3__hono-rate-limiter@0.5.3_hono@4.12.23__hono@4.12.23_zod@4.4.3/node_modules/@hono/mcp/dist/index.js
|
|
7353
7353
|
let isOldBunVersion = () => {
|
|
7354
7354
|
const version = typeof Bun !== "undefined" ? Bun.version : void 0;
|
|
7355
7355
|
if (version === void 0) return false;
|
|
@@ -7790,7 +7790,7 @@ var StreamableHTTPTransport = class {
|
|
|
7790
7790
|
}
|
|
7791
7791
|
};
|
|
7792
7792
|
//#endregion
|
|
7793
|
-
//#region ../../node_modules/.pnpm/@hono+node-server@2.0.
|
|
7793
|
+
//#region ../../node_modules/.pnpm/@hono+node-server@2.0.4_hono@4.12.23/node_modules/@hono/node-server/dist/index.mjs
|
|
7794
7794
|
var RequestError = class extends Error {
|
|
7795
7795
|
constructor(message, options) {
|
|
7796
7796
|
super(message, options);
|
|
@@ -8713,7 +8713,7 @@ const serve = (options, listeningListener) => {
|
|
|
8713
8713
|
return server;
|
|
8714
8714
|
};
|
|
8715
8715
|
//#endregion
|
|
8716
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
8716
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/color.js
|
|
8717
8717
|
function getColorEnabled() {
|
|
8718
8718
|
const { process, Deno } = globalThis;
|
|
8719
8719
|
return !(typeof Deno?.noColor === "boolean" ? Deno.noColor : process !== void 0 ? "NO_COLOR" in process?.env : false);
|
|
@@ -8730,7 +8730,7 @@ async function getColorEnabledAsync() {
|
|
|
8730
8730
|
})() : !getColorEnabled());
|
|
8731
8731
|
}
|
|
8732
8732
|
//#endregion
|
|
8733
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
8733
|
+
//#region ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/middleware/logger/index.js
|
|
8734
8734
|
var humanize = (times) => {
|
|
8735
8735
|
const [delimiter, separator] = [",", "."];
|
|
8736
8736
|
return times.map((v) => v.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + delimiter)).join(separator);
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { NativeCapletsService } from "./service";
|
|
2
|
-
export
|
|
2
|
+
export type NativeCapletsProcessCleanupOptions = {
|
|
3
|
+
writeErr?: (message: string) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare function registerNativeCapletsProcessCleanup(service: NativeCapletsService, options?: NativeCapletsProcessCleanupOptions): void;
|
package/dist/native.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createNativeCapletsService, type NativeCapletTool, type NativeCapletsService, type NativeCapletsServiceOptions, type NativeCapletsToolsChangedListener, } from "./native/service";
|
|
2
|
-
export { registerNativeCapletsProcessCleanup } from "./native/process-cleanup";
|
|
2
|
+
export { registerNativeCapletsProcessCleanup, type NativeCapletsProcessCleanupOptions, } from "./native/process-cleanup";
|
|
3
3
|
export { nativeCapletPromptGuidance, nativeCapletToolDescription, nativeCapletToolName, nativeCapletsSystemGuidance, } from "./native/tools";
|
|
4
4
|
export { generatedToolInputSchema } from "./tools";
|
|
5
5
|
export { generatedToolInputJsonSchema } from "./generated-tool-input-schema";
|
package/dist/native.js
CHANGED
|
@@ -155,10 +155,10 @@ var RemoteNativeCapletsService = class {
|
|
|
155
155
|
await this.reloadFromClient();
|
|
156
156
|
return !this.closed;
|
|
157
157
|
} catch (retryError) {
|
|
158
|
-
this.warn(`Could not reload remote Caplets tools: ${errorMessage$
|
|
158
|
+
this.warn(`Could not reload remote Caplets tools: ${errorMessage$2(retryError)}\n`);
|
|
159
159
|
return false;
|
|
160
160
|
}
|
|
161
|
-
this.warn(`Could not reload remote Caplets tools: ${errorMessage$
|
|
161
|
+
this.warn(`Could not reload remote Caplets tools: ${errorMessage$2(error)}\n`);
|
|
162
162
|
return false;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -213,11 +213,7 @@ var RemoteNativeCapletsService = class {
|
|
|
213
213
|
for (const listener of this.listeners) listener(tools);
|
|
214
214
|
}
|
|
215
215
|
warn(message) {
|
|
216
|
-
|
|
217
|
-
this.options.writeErr(message);
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
process.stderr.write(message);
|
|
216
|
+
this.options.writeErr?.(message);
|
|
221
217
|
}
|
|
222
218
|
};
|
|
223
219
|
function remoteToolToNativeTool(tool) {
|
|
@@ -248,14 +244,14 @@ function operationNamesFromSchema(schema) {
|
|
|
248
244
|
function isPlainObject(value) {
|
|
249
245
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
250
246
|
}
|
|
251
|
-
function errorMessage$
|
|
247
|
+
function errorMessage$2(error) {
|
|
252
248
|
return error instanceof Error ? error.message : String(error);
|
|
253
249
|
}
|
|
254
250
|
function remoteAuthError() {
|
|
255
251
|
return new CapletsError("AUTH_FAILED", "Remote Caplets authentication failed; check CAPLETS_SERVER_USER and CAPLETS_SERVER_PASSWORD.");
|
|
256
252
|
}
|
|
257
253
|
function isSessionFailure(error) {
|
|
258
|
-
const message = errorMessage$
|
|
254
|
+
const message = errorMessage$2(error).toLowerCase();
|
|
259
255
|
return /session|transport|connection|connect|closed|invalid/u.test(message);
|
|
260
256
|
}
|
|
261
257
|
function isAuthFailure(error) {
|
|
@@ -264,7 +260,7 @@ function isAuthFailure(error) {
|
|
|
264
260
|
const statusCode = typeof candidate?.statusCode === "number" ? candidate.statusCode : void 0;
|
|
265
261
|
const code = typeof candidate?.code === "number" ? candidate.code : void 0;
|
|
266
262
|
if (status === 401 || status === 403 || statusCode === 401 || statusCode === 403 || code === 401 || code === 403) return true;
|
|
267
|
-
return /\b(401|403|unauthorized|forbidden)\b/iu.test(errorMessage$
|
|
263
|
+
return /\b(401|403|unauthorized|forbidden)\b/iu.test(errorMessage$2(error));
|
|
268
264
|
}
|
|
269
265
|
//#endregion
|
|
270
266
|
//#region src/native/service.ts
|
|
@@ -286,7 +282,7 @@ function createNativeCapletsService(options = {}) {
|
|
|
286
282
|
}), local, options);
|
|
287
283
|
} catch (error) {
|
|
288
284
|
local.close().catch((closeError) => {
|
|
289
|
-
writeErr(options, `Could not close local overlay Caplets service: ${errorMessage(closeError)}\n`);
|
|
285
|
+
writeErr(options, `Could not close local overlay Caplets service: ${errorMessage$1(closeError)}\n`);
|
|
290
286
|
});
|
|
291
287
|
throw error;
|
|
292
288
|
}
|
|
@@ -296,7 +292,10 @@ function createNativeCapletsService(options = {}) {
|
|
|
296
292
|
var DefaultNativeCapletsService = class {
|
|
297
293
|
engine;
|
|
298
294
|
constructor(options) {
|
|
299
|
-
this.engine = new CapletsEngine(
|
|
295
|
+
this.engine = new CapletsEngine({
|
|
296
|
+
...options,
|
|
297
|
+
writeErr: options.writeErr ?? (() => void 0)
|
|
298
|
+
});
|
|
300
299
|
}
|
|
301
300
|
listTools() {
|
|
302
301
|
return this.engine.enabledServers().map((caplet) => {
|
|
@@ -381,7 +380,7 @@ var CompositeNativeCapletsService = class {
|
|
|
381
380
|
for (const listener of this.listeners) try {
|
|
382
381
|
listener(this.listTools());
|
|
383
382
|
} catch (error) {
|
|
384
|
-
writeErr(this.options, `Caplets tools-changed listener failed: ${errorMessage(error)}\n`);
|
|
383
|
+
writeErr(this.options, `Caplets tools-changed listener failed: ${errorMessage$1(error)}\n`);
|
|
385
384
|
}
|
|
386
385
|
}
|
|
387
386
|
mergeTools() {
|
|
@@ -393,7 +392,7 @@ var CompositeNativeCapletsService = class {
|
|
|
393
392
|
try {
|
|
394
393
|
return await service.reload();
|
|
395
394
|
} catch (error) {
|
|
396
|
-
writeErr(this.options, `Could not reload composite Caplets tools from ${label}: ${errorMessage(error)}\n`);
|
|
395
|
+
writeErr(this.options, `Could not reload composite Caplets tools from ${label}: ${errorMessage$1(error)}\n`);
|
|
397
396
|
return;
|
|
398
397
|
}
|
|
399
398
|
}
|
|
@@ -406,7 +405,7 @@ function createLocalOverlayConfigLoader(options) {
|
|
|
406
405
|
try {
|
|
407
406
|
result = loadLocalOverlayConfigWithSources(configPath, projectConfigPath);
|
|
408
407
|
} catch (error) {
|
|
409
|
-
writeErr(options, `Caplets local overlay warning: Could not load local overlay config: ${errorMessage(error)}\n`);
|
|
408
|
+
writeErr(options, `Caplets local overlay warning: Could not load local overlay config: ${errorMessage$1(error)}\n`);
|
|
410
409
|
if (hasLoaded) throw new CapletsError("CONFIG_INVALID", "Caplets local overlay reload failed; keeping last known-good config.", error);
|
|
411
410
|
hasLoaded = true;
|
|
412
411
|
return parseConfig({});
|
|
@@ -423,14 +422,14 @@ function warningKey(warning) {
|
|
|
423
422
|
return `${warning.kind}\0${warning.path}\0${warning.message}`;
|
|
424
423
|
}
|
|
425
424
|
function writeErr(options, message) {
|
|
426
|
-
|
|
425
|
+
options.writeErr?.(message);
|
|
427
426
|
}
|
|
428
|
-
function errorMessage(error) {
|
|
427
|
+
function errorMessage$1(error) {
|
|
429
428
|
return error instanceof Error ? error.message : String(error);
|
|
430
429
|
}
|
|
431
430
|
//#endregion
|
|
432
431
|
//#region src/native/process-cleanup.ts
|
|
433
|
-
function registerNativeCapletsProcessCleanup(service) {
|
|
432
|
+
function registerNativeCapletsProcessCleanup(service, options = {}) {
|
|
434
433
|
let closed = false;
|
|
435
434
|
const close = async () => {
|
|
436
435
|
if (closed) return;
|
|
@@ -438,7 +437,7 @@ function registerNativeCapletsProcessCleanup(service) {
|
|
|
438
437
|
try {
|
|
439
438
|
await service.close();
|
|
440
439
|
} catch (error) {
|
|
441
|
-
|
|
440
|
+
options.writeErr?.(`Failed to close Caplets service: ${errorMessage(error)}\n`);
|
|
442
441
|
process.exitCode = 1;
|
|
443
442
|
}
|
|
444
443
|
};
|
|
@@ -454,5 +453,8 @@ function registerNativeCapletsProcessCleanup(service) {
|
|
|
454
453
|
process.once("SIGINT", closeAndExit);
|
|
455
454
|
process.once("SIGTERM", closeAndExit);
|
|
456
455
|
}
|
|
456
|
+
function errorMessage(error) {
|
|
457
|
+
return error instanceof Error ? error.message : String(error);
|
|
458
|
+
}
|
|
457
459
|
//#endregion
|
|
458
460
|
export { RemoteNativeCapletsService, createNativeCapletsService, createSdkRemoteCapletsClient, generatedToolInputJsonSchema, generatedToolInputSchema, nativeCapletPromptGuidance, nativeCapletToolDescription, nativeCapletToolName, nativeCapletsSystemGuidance, registerNativeCapletsProcessCleanup, resolveNativeCapletsServiceOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caplets/core",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "Core runtime library for Caplets progressive disclosure gateways.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"caplets",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@apidevtools/swagger-parser": "^12.1.0",
|
|
48
48
|
"@hono/mcp": "^0.3.0",
|
|
49
|
-
"@hono/node-server": "^2.0.
|
|
49
|
+
"@hono/node-server": "^2.0.4",
|
|
50
50
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
51
51
|
"commander": "^14.0.3",
|
|
52
52
|
"graphql": "^16.14.0",
|
|
53
|
-
"hono": "^4.12.
|
|
53
|
+
"hono": "^4.12.23",
|
|
54
54
|
"vfile": "^6.0.3",
|
|
55
55
|
"vfile-matter": "^5.0.1",
|
|
56
56
|
"yaml": "^2.9.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/node": "^25.9.1",
|
|
61
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
61
|
+
"@typescript/native-preview": "7.0.0-dev.20260526.1",
|
|
62
62
|
"rolldown": "^1.0.2",
|
|
63
63
|
"typescript": "^6.0.3",
|
|
64
64
|
"vitest": "^4.1.7"
|