@forgeax/engine-plugin 0.1.26 → 0.1.28

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.
@@ -0,0 +1,36 @@
1
+ import type { ToolEvidenceKind, ToolRealm } from '@forgeax/engine-tool-runtime';
2
+
3
+ /**
4
+ * A source-only command declaration. Project discovery may load this contract
5
+ * without importing the executor, DOM, World, or a running Project.
6
+ */
7
+ export interface ToolCommandDeclaration {
8
+ readonly id: string;
9
+ readonly path?: readonly string[];
10
+ readonly title: string;
11
+ readonly summary: string;
12
+ readonly realm: ToolRealm;
13
+ readonly argsSchema?: string;
14
+ readonly resultSchema?: string;
15
+ readonly evidence?: readonly ToolEvidenceKind[];
16
+ /** Module specifier resolved only when the command is executed. */
17
+ readonly executor?: string;
18
+ readonly exportName?: string;
19
+ }
20
+
21
+ export interface ToolCommandContract {
22
+ readonly schemaVersion: '1.0.0';
23
+ readonly commands: readonly ToolCommandDeclaration[];
24
+ }
25
+
26
+ export function defineToolCommandContract(
27
+ commands: readonly ToolCommandDeclaration[],
28
+ ): ToolCommandContract {
29
+ return { schemaVersion: '1.0.0', commands: [...commands] };
30
+ }
31
+
32
+ export function isToolCommandContract(value: unknown): value is ToolCommandContract {
33
+ if (value === null || typeof value !== 'object') return false;
34
+ const candidate = value as Partial<ToolCommandContract>;
35
+ return candidate.schemaVersion === '1.0.0' && Array.isArray(candidate.commands);
36
+ }