@pluginfinity/targets 0.0.1

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 C. Spencer Beggs
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/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @pluginfinity/targets
2
+
3
+ [![npm](https://img.shields.io/npm/v/@pluginfinity%2Ftargets?label=npm&color=cb3837)](https://www.npmjs.com/package/@pluginfinity/targets)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-4caf50.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js %3E%3D24.11.0](https://img.shields.io/badge/Node.js-%3E%3D24.11.0-5fa04e.svg)](https://nodejs.org/)
6
+ [![TypeScript 7.0](https://img.shields.io/badge/TypeScript-7.0-3178c6.svg)](https://www.typescriptlang.org/)
7
+
8
+ The hosts [pluginfinity](https://github.com/spencerbeggs/pluginfinity) builds for (`claude` and `copilot` so far), kept as data, and the full config schema assembled from them.
9
+
10
+ > **Under development.** This package is part of [pluginfinity](https://www.npmjs.com/package/pluginfinity), which is in early `0.x` development. It installs and runs, but pluginfinity does not build plugins yet, and this package's contents will change without notice between `0.x` releases.
11
+
12
+ ## Install pluginfinity instead
13
+
14
+ To build agent plugins, or to write a `pluginfinity.config.ts`, install the `pluginfinity` package. It provides the command and the `defineConfig` helper.
15
+
16
+ ```bash
17
+ pnpm add -D pluginfinity
18
+ ```
19
+
20
+ This package is an internal layer of the pluginfinity CLI. It is published so that `pluginfinity` installs, not as an API: nothing it exports is supported for direct import, and only what the `pluginfinity` package exports carries a stability promise.
21
+
22
+ ## License
23
+
24
+ [MIT](LICENSE)
package/config.js ADDED
@@ -0,0 +1,36 @@
1
+ import { KNOWN_TARGET_IDS } from "./registry.js";
2
+ import { BASE_CONFIG_KEYS, BaseConfigFields, TargetSetting } from "@pluginfinity/core";
3
+ import { Schema } from "effect";
4
+
5
+ //#region src/config.ts
6
+ /**
7
+ * The whole `pluginfinity.config.ts` shape: the plugin-wide fields from
8
+ * `@pluginfinity/core` and one optional key per registry target.
9
+ *
10
+ * @remarks
11
+ * The target keys are spelled out rather than mapped from the registry so the
12
+ * editor sees each one by name; a test pins them to `KNOWN_TARGET_IDS`.
13
+ * Decode with `{ onExcessProperty: "error" }` to reject unknown keys.
14
+ *
15
+ * @public
16
+ */
17
+ const PluginfinityConfig = Schema.Struct({
18
+ ...BaseConfigFields,
19
+ claude: Schema.optionalKey(TargetSetting),
20
+ copilot: Schema.optionalKey(TargetSetting)
21
+ });
22
+ /**
23
+ * Every top-level key a config may hold: the base fields, then the target ids.
24
+ *
25
+ * @public
26
+ */
27
+ const CONFIG_KEYS = [...BASE_CONFIG_KEYS, ...KNOWN_TARGET_IDS];
28
+ /**
29
+ * The targets a config enables, in registry order.
30
+ *
31
+ * @public
32
+ */
33
+ const enabledTargets = (config) => KNOWN_TARGET_IDS.filter((id) => config[id] !== void 0);
34
+
35
+ //#endregion
36
+ export { CONFIG_KEYS, PluginfinityConfig, enabledTargets };
package/index.d.ts ADDED
@@ -0,0 +1,105 @@
1
+ import { Schema } from "effect";
2
+ //#region src/registry.d.ts
3
+ /**
4
+ * The id of every target pluginfinity knows, in registry order. One id names a
5
+ * target everywhere: the config key, `builds/<id>/` and `--target <id>`.
6
+ *
7
+ * @public
8
+ */
9
+ export declare const KNOWN_TARGET_IDS: readonly ["claude", "copilot"];
10
+ /**
11
+ * A known target id.
12
+ *
13
+ * @public
14
+ */
15
+ export declare const KnownTargetId: Schema.Literals<readonly ["claude", "copilot"]>;
16
+ /**
17
+ * The decoded `KnownTargetId`.
18
+ *
19
+ * @public
20
+ */
21
+ export type KnownTargetId = typeof KnownTargetId.Type;
22
+ /**
23
+ * One registry entry. Only an id and a display name for now; the capability
24
+ * description lands with the core `Target` schema.
25
+ *
26
+ * @public
27
+ */
28
+ interface TargetEntry {
29
+ readonly id: KnownTargetId;
30
+ readonly displayName: string;
31
+ }
32
+ /**
33
+ * Every target pluginfinity builds for.
34
+ *
35
+ * @public
36
+ */
37
+ export declare const TARGETS: ReadonlyArray<TargetEntry>;
38
+ /**
39
+ * Whether `id` names a known target.
40
+ *
41
+ * @public
42
+ */
43
+ export declare const isKnownTargetId: (id: string) => id is KnownTargetId;
44
+ //#endregion
45
+ //#region src/config.d.ts
46
+ /**
47
+ * The whole `pluginfinity.config.ts` shape: the plugin-wide fields from
48
+ * `@pluginfinity/core` and one optional key per registry target.
49
+ *
50
+ * @remarks
51
+ * The target keys are spelled out rather than mapped from the registry so the
52
+ * editor sees each one by name; a test pins them to `KNOWN_TARGET_IDS`.
53
+ * Decode with `{ onExcessProperty: "error" }` to reject unknown keys.
54
+ *
55
+ * @public
56
+ */
57
+ export declare const PluginfinityConfig: Schema.Struct<{
58
+ readonly name: Schema.String;
59
+ readonly claude: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<true>, Schema.Struct<{
60
+ readonly name: Schema.optionalKey<Schema.String>;
61
+ }>]>>;
62
+ readonly copilot: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<true>, Schema.Struct<{
63
+ readonly name: Schema.optionalKey<Schema.String>;
64
+ }>]>>;
65
+ }>;
66
+ /**
67
+ * A decoded pluginfinity config.
68
+ *
69
+ * @public
70
+ */
71
+ export type PluginfinityConfig = typeof PluginfinityConfig.Type;
72
+ /**
73
+ * What a `pluginfinity.config.ts` default-exports: the encoded config.
74
+ *
75
+ * @public
76
+ */
77
+ type PluginfinityConfigInput = typeof PluginfinityConfig.Encoded;
78
+ /**
79
+ * Every top-level key a config may hold: the base fields, then the target ids.
80
+ *
81
+ * @public
82
+ */
83
+ export declare const CONFIG_KEYS: ReadonlyArray<string>;
84
+ /**
85
+ * The targets a config enables, in registry order.
86
+ *
87
+ * @public
88
+ */
89
+ export declare const enabledTargets: (config: PluginfinityConfig) => ReadonlyArray<KnownTargetId>;
90
+ //#endregion
91
+ //#region src/version.d.ts
92
+ /**
93
+ * The version of `@pluginfinity/targets` this build was made from.
94
+ *
95
+ * @remarks
96
+ * A build-time literal: the bundler replaces `process.env.__PACKAGE_VERSION__`
97
+ * with this package's own version, so this is not a runtime environment read.
98
+ * `"0.0.0"` is the unbuilt-source fallback.
99
+ *
100
+ * @public
101
+ */
102
+ export declare const TARGETS_VERSION: string;
103
+ //#endregion
104
+ export type { PluginfinityConfigInput, TargetEntry };
105
+ //# sourceMappingURL=index.d.ts.map
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import { KNOWN_TARGET_IDS, KnownTargetId, TARGETS, isKnownTargetId } from "./registry.js";
2
+ import { CONFIG_KEYS, PluginfinityConfig, enabledTargets } from "./config.js";
3
+ import { TARGETS_VERSION } from "./version.js";
4
+
5
+ export { CONFIG_KEYS, KNOWN_TARGET_IDS, KnownTargetId, PluginfinityConfig, TARGETS, TARGETS_VERSION, enabledTargets, isKnownTargetId };
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@pluginfinity/targets",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "description": "The host targets pluginfinity builds for (Claude Code, GitHub Copilot), described as data against the @pluginfinity/core Target schema.",
6
+ "keywords": [
7
+ "pluginfinity",
8
+ "claude-code",
9
+ "copilot",
10
+ "agent-plugin",
11
+ "effect"
12
+ ],
13
+ "homepage": "https://github.com/spencerbeggs/pluginfinity/tree/main/packages/targets#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/spencerbeggs/pluginfinity/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/spencerbeggs/pluginfinity.git",
20
+ "directory": "packages/targets"
21
+ },
22
+ "license": "MIT",
23
+ "author": {
24
+ "name": "C. Spencer Beggs",
25
+ "email": "spencer@beggs.codes",
26
+ "url": "https://spencerbeg.gs"
27
+ },
28
+ "sideEffects": false,
29
+ "type": "module",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./index.d.ts",
33
+ "import": "./index.js",
34
+ "default": "./index.js"
35
+ },
36
+ "./package.json": "./package.json"
37
+ },
38
+ "dependencies": {
39
+ "@pluginfinity/core": "0.0.1"
40
+ },
41
+ "peerDependencies": {
42
+ "effect": "^4.0.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=24.11.0"
46
+ }
47
+ }
package/registry.js ADDED
@@ -0,0 +1,37 @@
1
+ import { Schema } from "effect";
2
+
3
+ //#region src/registry.ts
4
+ /**
5
+ * The id of every target pluginfinity knows, in registry order. One id names a
6
+ * target everywhere: the config key, `builds/<id>/` and `--target <id>`.
7
+ *
8
+ * @public
9
+ */
10
+ const KNOWN_TARGET_IDS = ["claude", "copilot"];
11
+ /**
12
+ * A known target id.
13
+ *
14
+ * @public
15
+ */
16
+ const KnownTargetId = Schema.Literals(KNOWN_TARGET_IDS);
17
+ /**
18
+ * Every target pluginfinity builds for.
19
+ *
20
+ * @public
21
+ */
22
+ const TARGETS = [{
23
+ id: "claude",
24
+ displayName: "Claude Code"
25
+ }, {
26
+ id: "copilot",
27
+ displayName: "GitHub Copilot"
28
+ }];
29
+ /**
30
+ * Whether `id` names a known target.
31
+ *
32
+ * @public
33
+ */
34
+ const isKnownTargetId = (id) => KNOWN_TARGET_IDS.includes(id);
35
+
36
+ //#endregion
37
+ export { KNOWN_TARGET_IDS, KnownTargetId, TARGETS, isKnownTargetId };
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.59.1"
9
+ }
10
+ ]
11
+ }
package/version.js ADDED
@@ -0,0 +1,15 @@
1
+ //#region src/version.ts
2
+ /**
3
+ * The version of `@pluginfinity/targets` this build was made from.
4
+ *
5
+ * @remarks
6
+ * A build-time literal: the bundler replaces `process.env.__PACKAGE_VERSION__`
7
+ * with this package's own version, so this is not a runtime environment read.
8
+ * `"0.0.0"` is the unbuilt-source fallback.
9
+ *
10
+ * @public
11
+ */
12
+ const TARGETS_VERSION = "0.0.1";
13
+
14
+ //#endregion
15
+ export { TARGETS_VERSION };