@tessar/plugins 0.0.0-stage → 0.1.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/README.md CHANGED
@@ -1,3 +1,36 @@
1
- # Temporary Holding Version
1
+ # @tessar/plugins
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Optional Node host utilities for loading plugins after an application is packaged,
4
+ managing npm plugin packages, and structured logging. Requires Node 24.14 or newer.
5
+
6
+ ```sh
7
+ npm install @tessar/core @tessar/plugins
8
+ ```
9
+
10
+ ```ts
11
+ import { PluginManager } from "@tessar/plugins";
12
+ import { LoggerPlugin } from "@tessar/plugins/logger";
13
+
14
+ const manager = new PluginManager({
15
+ directory: ".my-cli",
16
+ hostUrl: import.meta.url,
17
+ });
18
+ const plugins = [new LoggerPlugin(), ...await manager.load()];
19
+ // Pass plugins to new Controller({ id, agent, plugins }).
20
+ // Dispose Controller first, then call manager.dispose() in finally.
21
+ ```
22
+
23
+ Custom files under `plugins/`, or folders with an index entry, default-export a
24
+ plugin instance. The manager supplies the host's public `@tessar/core` imports.
25
+ Erasable TypeScript custom files are supported; npm packages publish JavaScript.
26
+
27
+ `install(source)`, `update(name?)` and `remove(name)` use npm in the managed `npm/`
28
+ subdirectory. Installed package names are recorded in `plugins.json` under
29
+ `packages`; custom files are discovered automatically. `load()` never installs
30
+ missing dependencies. A consuming CLI chooses its own command name and directory.
31
+
32
+ Logger writes JSON lifecycle/error entries to stderr by default. Use
33
+ `new LoggerPlugin({ write: entry => yourLogger.write(entry) })` for another sink.
34
+
35
+ This is an early 0.x release. See the
36
+ [repository](https://github.com/hphucdev-04/tessar) for usage and contracts.
@@ -0,0 +1,34 @@
1
+ import type { Plugin } from "@tessar/core";
2
+ export interface PluginManagerOptions {
3
+ directory: string;
4
+ /** A host module URL from which public SDK imports resolve. */
5
+ hostUrl?: string;
6
+ }
7
+ /** Opt-in Node host utilities; PluginHost still owns setup and resource cleanup. */
8
+ export declare class PluginManager {
9
+ readonly directory: string;
10
+ private readonly npmDirectory;
11
+ private readonly hostUrl;
12
+ private readonly prefix;
13
+ private readonly graph;
14
+ private resolver?;
15
+ private disposed;
16
+ private mutation;
17
+ constructor(options: PluginManagerOptions);
18
+ private check;
19
+ private readJson;
20
+ private manifest;
21
+ private configuration;
22
+ discover(): Promise<string[]>;
23
+ private registerResolver;
24
+ load(sources?: readonly string[]): Promise<Plugin[]>;
25
+ private mutate;
26
+ private saveConfiguration;
27
+ private npm;
28
+ install(source: string, options?: {
29
+ name?: string;
30
+ }): Promise<string>;
31
+ update(name?: string): Promise<void>;
32
+ remove(name: string): Promise<void>;
33
+ dispose(): void;
34
+ }
package/dist/index.js ADDED
@@ -0,0 +1,311 @@
1
+ import { readFile, readdir, mkdir, writeFile, stat } from "node:fs/promises";
2
+ import { existsSync } from "node:fs";
3
+ import { createRequire, registerHooks } from "node:module";
4
+ import { isAbsolute, join, resolve, dirname, delimiter } from "node:path";
5
+ import { pathToFileURL } from "node:url";
6
+ import { randomUUID } from "node:crypto";
7
+ import { execFile } from "node:child_process";
8
+ import { promisify } from "node:util";
9
+ const extensions = [".mjs", ".js", ".cjs", ".mts", ".ts", ".cts"];
10
+ const isEntry = (name) => extensions.some((ext) => name.endsWith(ext)) &&
11
+ !/\.d\.(?:ts|mts|cts)$/.test(name);
12
+ const missing = (error) => error.code === "ENOENT";
13
+ const execute = promisify(execFile);
14
+ const packageName = /^(@[a-z0-9._-]+\/[a-z0-9._-]+|[a-z0-9][a-z0-9._-]*)(?:@.+)?$/i;
15
+ function validName(name) {
16
+ if (packageName.exec(name)?.[1] !== name)
17
+ throw Error("Invalid plugin package name: " + name);
18
+ }
19
+ /** Opt-in Node host utilities; PluginHost still owns setup and resource cleanup. */
20
+ export class PluginManager {
21
+ directory;
22
+ npmDirectory;
23
+ hostUrl;
24
+ prefix = "tessar-plugin:" + randomUUID() + "/";
25
+ graph = new Set();
26
+ resolver;
27
+ disposed = false;
28
+ mutation = Promise.resolve();
29
+ constructor(options) {
30
+ if (!options.directory.trim())
31
+ throw Error("Plugin directory must be nonempty");
32
+ this.directory = resolve(options.directory);
33
+ this.npmDirectory = join(this.directory, "npm");
34
+ this.hostUrl = options.hostUrl ?? import.meta.url;
35
+ }
36
+ check() {
37
+ if (this.disposed)
38
+ throw Error("PluginManager is disposed");
39
+ }
40
+ async readJson(filename) {
41
+ let data;
42
+ try {
43
+ data = JSON.parse(await readFile(filename, "utf8"));
44
+ }
45
+ catch (error) {
46
+ if (missing(error))
47
+ return {};
48
+ throw new Error("Invalid JSON file " + filename, { cause: error });
49
+ }
50
+ if (!data || typeof data !== "object" || Array.isArray(data))
51
+ throw Error("Expected a JSON object in " + filename);
52
+ return data;
53
+ }
54
+ manifest() {
55
+ return this.readJson(join(this.npmDirectory, "package.json"));
56
+ }
57
+ async configuration() {
58
+ const filename = join(this.directory, "plugins.json");
59
+ const data = await this.readJson(filename);
60
+ if (data.packages !== undefined &&
61
+ (!Array.isArray(data.packages) ||
62
+ data.packages.some((value) => typeof value !== "string" || !value.trim())))
63
+ throw Error("Invalid packages in " + filename);
64
+ return data;
65
+ }
66
+ async discover() {
67
+ this.check();
68
+ const directory = join(this.directory, "plugins");
69
+ let entries;
70
+ try {
71
+ entries = await readdir(directory, { withFileTypes: true });
72
+ }
73
+ catch (error) {
74
+ if (!missing(error))
75
+ throw error;
76
+ entries = [];
77
+ }
78
+ const sources = [];
79
+ for (const entry of entries.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
80
+ if (entry.isFile() && isEntry(entry.name))
81
+ sources.push(join(directory, entry.name));
82
+ else if (entry.isDirectory()) {
83
+ const files = await readdir(join(directory, entry.name));
84
+ const indexes = extensions
85
+ .map((ext) => "index" + ext)
86
+ .filter((name) => files.includes(name));
87
+ if (indexes.length > 1)
88
+ throw Error("Ambiguous plugin entry: " + join(directory, entry.name));
89
+ if (indexes[0])
90
+ sources.push(join(directory, entry.name, indexes[0]));
91
+ }
92
+ }
93
+ const config = await this.configuration();
94
+ this.check();
95
+ return [...sources, ...(config.packages ?? [])];
96
+ }
97
+ registerResolver() {
98
+ if (this.resolver)
99
+ return;
100
+ this.resolver = registerHooks({
101
+ resolve: (specifier, context, nextResolve) => {
102
+ const sdkPrefix = this.prefix + "sdk/";
103
+ if (specifier.startsWith(sdkPrefix))
104
+ return nextResolve(decodeURIComponent(specifier.slice(sdkPrefix.length)), { ...context, parentURL: this.hostUrl });
105
+ if (specifier.startsWith(this.prefix)) {
106
+ const source = decodeURIComponent(specifier.slice(this.prefix.length));
107
+ const result = nextResolve(source, {
108
+ ...context,
109
+ parentURL: pathToFileURL(join(this.npmDirectory, "package.json"))
110
+ .href,
111
+ });
112
+ this.graph.add(result.url);
113
+ return result;
114
+ }
115
+ if (context.parentURL && this.graph.has(context.parentURL)) {
116
+ if (specifier === "@tessar/core" ||
117
+ specifier.startsWith("@tessar/core/"))
118
+ // Resolve through ESM: require's default resolver retains caller search paths.
119
+ return {
120
+ url: import.meta.resolve(sdkPrefix + encodeURIComponent(specifier)),
121
+ shortCircuit: true,
122
+ };
123
+ try {
124
+ const result = nextResolve(specifier, context);
125
+ this.graph.add(result.url);
126
+ return result;
127
+ }
128
+ catch (error) {
129
+ const code = error.code;
130
+ if ((code !== "ERR_MODULE_NOT_FOUND" &&
131
+ code !== "MODULE_NOT_FOUND") ||
132
+ specifier.startsWith(".") ||
133
+ isAbsolute(specifier) ||
134
+ specifier.includes(":") ||
135
+ specifier.startsWith("#"))
136
+ throw error;
137
+ // Custom files can also use dependencies in the managed npm environment.
138
+ const url = context.conditions.includes("require")
139
+ ? pathToFileURL(createRequire(join(this.npmDirectory, "package.json")).resolve(specifier)).href
140
+ : import.meta.resolve(this.prefix + encodeURIComponent(specifier));
141
+ this.graph.add(url);
142
+ return {
143
+ url,
144
+ shortCircuit: true,
145
+ };
146
+ }
147
+ }
148
+ return nextResolve(specifier, context);
149
+ },
150
+ });
151
+ }
152
+ async load(sources) {
153
+ this.check();
154
+ const entries = sources ?? (await this.discover());
155
+ this.check();
156
+ if (entries.length)
157
+ this.registerResolver();
158
+ const plugins = [], ids = new Set();
159
+ for (const source of entries) {
160
+ try {
161
+ const specifier = isAbsolute(source) || source.startsWith(".")
162
+ ? pathToFileURL(resolve(this.directory, source)).href
163
+ : source;
164
+ const module = await import(this.prefix + encodeURIComponent(specifier));
165
+ this.check();
166
+ const plugin = module.default;
167
+ if (!plugin ||
168
+ typeof plugin !== "object" ||
169
+ typeof plugin.id !== "string" ||
170
+ !plugin.id.trim() ||
171
+ typeof plugin.setup !== "function")
172
+ throw Error("Expected a default Plugin export with id and setup(tessar)");
173
+ if (ids.has(plugin.id))
174
+ throw Error("Duplicate plugin ID: " + plugin.id);
175
+ ids.add(plugin.id);
176
+ plugins.push(plugin);
177
+ }
178
+ catch (error) {
179
+ throw new Error("Cannot load plugin " +
180
+ source +
181
+ ": " +
182
+ (error instanceof Error ? error.message : String(error)), { cause: error });
183
+ }
184
+ }
185
+ return plugins;
186
+ }
187
+ mutate(operation) {
188
+ const next = this.mutation.then(() => {
189
+ this.check();
190
+ return operation();
191
+ });
192
+ this.mutation = next.catch(() => { });
193
+ return next;
194
+ }
195
+ async saveConfiguration(config) {
196
+ await writeFile(join(this.directory, "plugins.json"), JSON.stringify(config, null, 2) + "\n");
197
+ }
198
+ async npm(args) {
199
+ const parameters = [
200
+ ...args,
201
+ "--prefix",
202
+ this.npmDirectory,
203
+ "--no-audit",
204
+ "--no-fund",
205
+ ];
206
+ // Windows .cmd launchers require a shell; invoke npm's JS entry with Node instead.
207
+ if (process.platform === "win32") {
208
+ const directories = [
209
+ dirname(process.execPath),
210
+ ...(process.env.PATH ?? "").split(delimiter),
211
+ ];
212
+ const cli = directories
213
+ .map((dir) => join(dir, "node_modules/npm/bin/npm-cli.js"))
214
+ .find(existsSync);
215
+ if (!cli)
216
+ throw Error("npm is not installed alongside Node or on PATH");
217
+ return (await execute(process.execPath, [cli, ...parameters], {
218
+ cwd: this.npmDirectory,
219
+ windowsHide: true,
220
+ })).stdout;
221
+ }
222
+ else
223
+ return (await execute("npm", parameters, {
224
+ cwd: this.npmDirectory,
225
+ windowsHide: true,
226
+ })).stdout;
227
+ }
228
+ install(source, options = {}) {
229
+ return this.mutate(async () => {
230
+ if (!source.trim() || source.startsWith("-"))
231
+ throw Error("Invalid plugin source");
232
+ const local = isAbsolute(source) ||
233
+ source.startsWith(".") ||
234
+ source.startsWith("file:");
235
+ const target = local
236
+ ? resolve(this.directory, source.replace(/^file:/, ""))
237
+ : source;
238
+ let sourceName = local
239
+ ? (await stat(target)).isDirectory()
240
+ ? JSON.parse(await readFile(join(target, "package.json"), "utf8")).name
241
+ : undefined
242
+ : packageName.exec(source)?.[1];
243
+ const name = options.name ?? sourceName;
244
+ if (typeof name !== "string")
245
+ throw Error("Provide a package name for Git, tarball or URL sources");
246
+ validName(name);
247
+ const config = await this.configuration();
248
+ await mkdir(this.npmDirectory, { recursive: true });
249
+ if (!existsSync(join(this.npmDirectory, "package.json")))
250
+ await writeFile(join(this.npmDirectory, "package.json"), JSON.stringify({ private: true, type: "module" }, null, 2) + "\n");
251
+ if (!sourceName) {
252
+ const packed = JSON.parse(await this.npm([
253
+ "pack",
254
+ "--dry-run",
255
+ "--ignore-scripts",
256
+ "--json",
257
+ target,
258
+ ]));
259
+ sourceName = packed[0]?.name;
260
+ }
261
+ if (sourceName !== name)
262
+ throw Error("Requested name " +
263
+ name +
264
+ " differs from source package " +
265
+ sourceName);
266
+ await this.npm(["install", "--save-exact", "--install-links", target]);
267
+ const manifest = await this.manifest();
268
+ if (!manifest.dependencies?.[name])
269
+ throw Error("Installed source did not provide requested package " + name);
270
+ config.packages = [...new Set([...(config.packages ?? []), name])];
271
+ await this.saveConfiguration(config);
272
+ return name;
273
+ });
274
+ }
275
+ update(name) {
276
+ return this.mutate(async () => {
277
+ const manifest = await this.manifest();
278
+ const config = await this.configuration();
279
+ const names = name
280
+ ? [name]
281
+ : (config.packages ?? []).filter((value) => manifest.dependencies?.[value]);
282
+ for (const value of names) {
283
+ validName(value);
284
+ if (!config.packages?.includes(value) ||
285
+ !manifest.dependencies?.[value])
286
+ throw Error("Not an installed plugin: " + value);
287
+ }
288
+ if (names.length)
289
+ await this.npm(["update", ...names]);
290
+ });
291
+ }
292
+ remove(name) {
293
+ return this.mutate(async () => {
294
+ validName(name);
295
+ const before = await this.manifest();
296
+ const config = await this.configuration();
297
+ if (!config.packages?.includes(name) || !before.dependencies?.[name])
298
+ throw Error("Not an installed plugin: " + name);
299
+ await this.npm(["uninstall", name]);
300
+ config.packages = (config.packages ?? []).filter((value) => value !== name);
301
+ await this.saveConfiguration(config);
302
+ });
303
+ }
304
+ dispose() {
305
+ this.disposed = true;
306
+ this.resolver?.deregister();
307
+ this.resolver = undefined;
308
+ this.graph.clear();
309
+ }
310
+ }
311
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAe,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAgBtC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE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;YAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC;gBAClE,MAAM,KAAK,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAAC;YAClD,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;YACpC,MAAM,CAAC,QAAQ,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAC9C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAC1B,CAAC;YACF,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO;QACL,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import { type EventContext, type Plugin, type PluginContext } from "@tessar/core";
2
+ export interface LogEntry extends EventContext {
3
+ level: "info" | "warn" | "error";
4
+ type: string;
5
+ timestamp: string;
6
+ payload: unknown;
7
+ }
8
+ export interface LoggerOptions {
9
+ write?: (entry: LogEntry) => void | Promise<void>;
10
+ }
11
+ /** Structured lifecycle/error logs. Destinations and formatting belong to the host. */
12
+ export declare class LoggerPlugin implements Plugin {
13
+ readonly id = "logger";
14
+ private readonly write;
15
+ constructor(options?: LoggerOptions);
16
+ setup(tessar: PluginContext): void;
17
+ }
18
+ declare const _default: LoggerPlugin;
19
+ export default _default;
package/dist/logger.js ADDED
@@ -0,0 +1,61 @@
1
+ import { ready as readyHooks, thread as threadHooks, stream as streamHooks, turn as turnHooks, model as modelHooks, tool as toolHooks, diagnostic as diagnosticHooks, session as sessionHooks } from "@tessar/core";
2
+ import {} from "@tessar/core";
3
+ const events = [
4
+ readyHooks,
5
+ threadHooks.started,
6
+ threadHooks.shutdown,
7
+ threadHooks.forked,
8
+ threadHooks.renamed,
9
+ threadHooks.deleted,
10
+ streamHooks.started,
11
+ streamHooks.end,
12
+ streamHooks.error,
13
+ streamHooks.suspended,
14
+ streamHooks.resumed,
15
+ streamHooks.cancel,
16
+ turnHooks.start,
17
+ turnHooks.end,
18
+ modelHooks.start,
19
+ modelHooks.end,
20
+ modelHooks.error,
21
+ toolHooks.start,
22
+ toolHooks.end,
23
+ toolHooks.error,
24
+ diagnosticHooks,
25
+ sessionHooks.created,
26
+ sessionHooks.modelChanged,
27
+ sessionHooks.threadCreated,
28
+ sessionHooks.threadSwitched,
29
+ sessionHooks.threadRenamed,
30
+ sessionHooks.threadForked,
31
+ sessionHooks.threadDeleted,
32
+ sessionHooks.inputQueued,
33
+ sessionHooks.inputDiscarded,
34
+ sessionHooks.closed,
35
+ ];
36
+ /** Structured lifecycle/error logs. Destinations and formatting belong to the host. */
37
+ export class LoggerPlugin {
38
+ id = "logger";
39
+ write;
40
+ constructor(options = {}) {
41
+ this.write =
42
+ options.write ??
43
+ ((entry) => {
44
+ console.error(JSON.stringify(entry));
45
+ });
46
+ }
47
+ setup(tessar) {
48
+ for (const name of events)
49
+ tessar.hook(name, (event) => this.write(Object.freeze({
50
+ ...event,
51
+ timestamp: event.timestamp ?? new Date().toISOString(),
52
+ level: "error" in event.payload && event.payload.error
53
+ ? "error"
54
+ : event.type === streamHooks.suspended
55
+ ? "warn"
56
+ : "info",
57
+ })));
58
+ }
59
+ }
60
+ export default new LoggerPlugin();
61
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,IAAI,WAAW,EAAE,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;gBACvC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,MAAqB;QACzB,KAAK,MAAM,IAAI,IAAI,MAAM;YACvB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAC1B,IAAI,CAAC,KAAK,CACR,MAAM,CAAC,MAAM,CAAC;gBACZ,GAAG,KAAK;gBACR,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACtD,KAAK,EACH,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK;oBAC7C,CAAC,CAAC,OAAO;oBACT,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS;wBACpC,CAAC,CAAC,MAAM;wBACR,CAAC,CAAC,MAAM;aACf,CAAC,CACH,CACF,CAAC;IACN,CAAC;CACF;AAED,eAAe,IAAI,YAAY,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "@tessar/plugins",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Node plugin loading, npm package management and a built-in logger for Tessar.",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/hphucdev-04/tessar.git",
9
+ "directory": "packages/plugins"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public",
13
+ "registry": "https://registry.npmjs.org/"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./logger": {
21
+ "types": "./dist/logger.d.ts",
22
+ "import": "./dist/logger.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "engines": {
29
+ "node": ">=24.14.0"
30
+ },
31
+ "peerDependencies": {
32
+ "@tessar/core": "^0.1.0"
33
+ },
34
+ "peerDependenciesMeta": {
35
+ "@tessar/core": {
36
+ "optional": true
37
+ }
38
+ },
39
+ "devDependencies": {
40
+ "@tessar/core": "0.1.0"
41
+ },
42
+ "scripts": {
43
+ "build": "tsc -p tsconfig.json",
44
+ "typecheck": "tsc --noEmit -p tsconfig.json"
45
+ }
6
46
  }