@pluginfinity/core 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 +21 -0
- package/README.md +24 -0
- package/config.js +47 -0
- package/index.d.ts +75 -0
- package/index.js +4 -0
- package/package.json +42 -0
- package/tsdoc-metadata.json +11 -0
- package/version.js +15 -0
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/core
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@pluginfinity/core)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
|
|
8
|
+
The platform-free domain model of [pluginfinity](https://github.com/spencerbeggs/pluginfinity): the plugin-wide config fields and the per-target override shape, with the plugin source model and the host capability schema still to come.
|
|
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,47 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/config.ts
|
|
4
|
+
/**
|
|
5
|
+
* A plugin name as every host spells it: kebab-case, lowercase letters and
|
|
6
|
+
* digits separated by single hyphens.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
const PluginName = Schema.String.check(Schema.isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, { message: "must be kebab-case: lowercase letters and digits separated by single hyphens" }));
|
|
11
|
+
/**
|
|
12
|
+
* The plugin-wide fields of a pluginfinity config, before any target key.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* `@pluginfinity/targets` spreads these into the assembled `PluginfinityConfig`
|
|
16
|
+
* beside one key per target. Base keys and target ids share one key space,
|
|
17
|
+
* so a base key must never equal a target id.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
const BaseConfigFields = {
|
|
22
|
+
/** The plugin's name for every host. Not read from `package.json`. */
|
|
23
|
+
name: PluginName };
|
|
24
|
+
/**
|
|
25
|
+
* The names of the plugin-wide config fields.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
const BASE_CONFIG_KEYS = Object.keys(BaseConfigFields);
|
|
30
|
+
/**
|
|
31
|
+
* What a target key may override for that host.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
const TargetOverride = Schema.Struct({
|
|
36
|
+
/** The plugin's name on this host, when it differs from the base `name`. */
|
|
37
|
+
name: Schema.optionalKey(PluginName) });
|
|
38
|
+
/**
|
|
39
|
+
* A target key's value: `true` to enable the target with no overrides, or an
|
|
40
|
+
* override object. An absent key means the target is off; `false` is rejected.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
const TargetSetting = Schema.Union([Schema.Literal(true), TargetOverride]);
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { BASE_CONFIG_KEYS, BaseConfigFields, PluginName, TargetOverride, TargetSetting };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
//#region src/config.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A plugin name as every host spells it: kebab-case, lowercase letters and
|
|
5
|
+
* digits separated by single hyphens.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare const PluginName: Schema.String;
|
|
10
|
+
/**
|
|
11
|
+
* The plugin-wide fields of a pluginfinity config, before any target key.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* `@pluginfinity/targets` spreads these into the assembled `PluginfinityConfig`
|
|
15
|
+
* beside one key per target. Base keys and target ids share one key space,
|
|
16
|
+
* so a base key must never equal a target id.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export declare const BaseConfigFields: {
|
|
21
|
+
/** The plugin's name for every host. Not read from `package.json`. */
|
|
22
|
+
readonly name: Schema.String;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The names of the plugin-wide config fields.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export declare const BASE_CONFIG_KEYS: ReadonlyArray<string>;
|
|
30
|
+
/**
|
|
31
|
+
* What a target key may override for that host.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare const TargetOverride: Schema.Struct<{
|
|
36
|
+
/** The plugin's name on this host, when it differs from the base `name`. */
|
|
37
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* The decoded `TargetOverride`.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export type TargetOverride = typeof TargetOverride.Type;
|
|
45
|
+
/**
|
|
46
|
+
* A target key's value: `true` to enable the target with no overrides, or an
|
|
47
|
+
* override object. An absent key means the target is off; `false` is rejected.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export declare const TargetSetting: Schema.Union<readonly [Schema.Literal<true>, Schema.Struct<{
|
|
52
|
+
/** The plugin's name on this host, when it differs from the base `name`. */
|
|
53
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
54
|
+
}>]>;
|
|
55
|
+
/**
|
|
56
|
+
* The decoded `TargetSetting`.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export type TargetSetting = typeof TargetSetting.Type;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/version.d.ts
|
|
63
|
+
/**
|
|
64
|
+
* The version of `@pluginfinity/core` this build was made from.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* A build-time literal: the bundler replaces `process.env.__PACKAGE_VERSION__`
|
|
68
|
+
* with this package's own version, so this is not a runtime environment read.
|
|
69
|
+
* `"0.0.0"` is the unbuilt-source fallback.
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
export declare const CORE_VERSION: string;
|
|
74
|
+
//#endregion
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pluginfinity/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "The pluginfinity domain model: the host-neutral plugin source, the Target capability schema and the pluginfinity config shape. Platform-free.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"pluginfinity",
|
|
8
|
+
"agent-plugin",
|
|
9
|
+
"effect"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/spencerbeggs/pluginfinity/tree/main/packages/core#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/spencerbeggs/pluginfinity/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/spencerbeggs/pluginfinity.git",
|
|
18
|
+
"directory": "packages/core"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "C. Spencer Beggs",
|
|
23
|
+
"email": "spencer@beggs.codes",
|
|
24
|
+
"url": "https://spencerbeg.gs"
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./index.d.ts",
|
|
31
|
+
"import": "./index.js",
|
|
32
|
+
"default": "./index.js"
|
|
33
|
+
},
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"effect": "^4.0.0"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=24.11.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -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/core` 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 CORE_VERSION = "0.0.1";
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CORE_VERSION };
|