@caplets/core 0.11.0 → 0.12.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Spirit-Led Software LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -1314,7 +1314,7 @@ const EMPTY_COMPLETION_RESULT = { completion: {
1314
1314
  } };
1315
1315
  //#endregion
1316
1316
  //#region package.json
1317
- var version = "0.11.0";
1317
+ var version = "0.12.0";
1318
1318
  //#endregion
1319
1319
  //#region src/runtime.ts
1320
1320
  var CapletsRuntime = class {
package/dist/native.js CHANGED
@@ -2,7 +2,7 @@ import { E as errorResult, S as resolveProjectConfigPath, a as OpenApiManager, b
2
2
  import { generatedToolInputJsonSchema } from "./generated-tool-input-schema.js";
3
3
  //#region src/native/tools.ts
4
4
  function nativeCapletToolName(capletId) {
5
- return `caplets_${capletId.replace(/_/g, "__").replace(/-/g, "_dash_")}`;
5
+ return `caplets_${capletId.replace(/_/g, "__").replace(/-/g, "_")}`;
6
6
  }
7
7
  function nativeCapletsSystemGuidance(toolNames) {
8
8
  return [
@@ -89,4 +89,30 @@ var DefaultNativeCapletsService = class {
89
89
  }
90
90
  };
91
91
  //#endregion
92
- export { createNativeCapletsService, generatedToolInputJsonSchema, generatedToolInputSchema, nativeCapletPromptGuidance, nativeCapletToolDescription, nativeCapletToolName, nativeCapletsSystemGuidance };
92
+ //#region src/native/process-cleanup.ts
93
+ function registerNativeCapletsProcessCleanup(service) {
94
+ let closed = false;
95
+ const close = async () => {
96
+ if (closed) return;
97
+ closed = true;
98
+ try {
99
+ await service.close();
100
+ } catch (error) {
101
+ console.error("Failed to close Caplets service:", error);
102
+ process.exitCode = 1;
103
+ }
104
+ };
105
+ const closeBeforeExit = () => {
106
+ close();
107
+ };
108
+ const closeAndExit = () => {
109
+ close().finally(() => {
110
+ process.exit(process.exitCode ?? 0);
111
+ });
112
+ };
113
+ process.once("beforeExit", closeBeforeExit);
114
+ process.once("SIGINT", closeAndExit);
115
+ process.once("SIGTERM", closeAndExit);
116
+ }
117
+ //#endregion
118
+ export { createNativeCapletsService, generatedToolInputJsonSchema, generatedToolInputSchema, nativeCapletPromptGuidance, nativeCapletToolDescription, nativeCapletToolName, nativeCapletsSystemGuidance, registerNativeCapletsProcessCleanup };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caplets/core",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Core runtime library for Caplets progressive disclosure gateways.",
5
5
  "keywords": [
6
6
  "caplets",
@@ -33,15 +33,6 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "scripts": {
37
- "build": "rm -rf dist && rolldown -c",
38
- "build:watch": "rolldown -c --watch",
39
- "prepack": "pnpm build",
40
- "schema:check": "rolldown -c rolldown.schema.config.ts && node dist-schema/generate-config-schema.js --check && rm -rf dist-schema",
41
- "schema:generate": "rolldown -c rolldown.schema.config.ts && node dist-schema/generate-config-schema.js && rm -rf dist-schema",
42
- "typecheck": "tsc --noEmit",
43
- "test": "vitest run"
44
- },
45
36
  "dependencies": {
46
37
  "@apidevtools/swagger-parser": "^12.1.0",
47
38
  "@modelcontextprotocol/sdk": "^1.29.0",
@@ -59,5 +50,13 @@
59
50
  },
60
51
  "engines": {
61
52
  "node": ">=22"
53
+ },
54
+ "scripts": {
55
+ "build": "rm -rf dist && rolldown -c",
56
+ "build:watch": "rolldown -c --watch",
57
+ "schema:check": "rolldown -c rolldown.schema.config.ts && node dist-schema/generate-config-schema.js --check && rm -rf dist-schema",
58
+ "schema:generate": "rolldown -c rolldown.schema.config.ts && node dist-schema/generate-config-schema.js && rm -rf dist-schema",
59
+ "typecheck": "tsc --noEmit",
60
+ "test": "vitest run"
62
61
  }
63
- }
62
+ }