@yansirplus/cli 0.5.17
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/PUBLIC_API.md +22 -0
- package/README.md +34 -0
- package/dist/build/agent-authoring/config.d.ts +177 -0
- package/dist/build/agent-authoring/config.js +607 -0
- package/dist/build/agent-authoring/manifest-compiler.d.ts +159 -0
- package/dist/build/agent-authoring/manifest-compiler.js +737 -0
- package/dist/build/agent-authoring/shared.d.ts +10 -0
- package/dist/build/agent-authoring/shared.js +57 -0
- package/dist/build/agent-authoring/static-target.d.ts +59 -0
- package/dist/build/agent-authoring/static-target.js +1857 -0
- package/dist/build/agent-authoring.d.ts +9 -0
- package/dist/build/agent-authoring.js +5 -0
- package/dist/build/build-cli.d.ts +2 -0
- package/dist/build/build-cli.js +264 -0
- package/dist/check/algorithmic/architecture-checks.mjs +971 -0
- package/dist/check/algorithmic/client-boundary-checks.mjs +337 -0
- package/dist/check/algorithmic/convergence-smoke-checks.mjs +608 -0
- package/dist/check/algorithmic/distribution-checks.mjs +919 -0
- package/dist/check/algorithmic/owner-checks.mjs +647 -0
- package/dist/check/algorithmic/package-boundary-checks.mjs +985 -0
- package/dist/check/algorithmic/projection-boundary-checks.mjs +302 -0
- package/dist/check/algorithmic/repo-surface-checks.mjs +267 -0
- package/dist/check/algorithmic/runtime-structural-checks.mjs +264 -0
- package/dist/check/algorithmic/source-alias-checks.mjs +106 -0
- package/dist/check/algorithmic/static-target-checks.mjs +447 -0
- package/dist/check/algorithmic-checks.mjs +482 -0
- package/dist/check/check-coverage.mjs +231 -0
- package/dist/check/command-runner.mjs +22 -0
- package/dist/check/default-gate.mjs +51 -0
- package/dist/check/gate-selector.mjs +305 -0
- package/dist/check/manifest-rules.mjs +223 -0
- package/dist/check/package-graph.mjs +464 -0
- package/dist/generate/generate-agent-docs.mjs +435 -0
- package/dist/generate/generate-carrier-reference.mjs +514 -0
- package/dist/generate/generate-docs.mjs +345 -0
- package/dist/generate/generate-effect-skill-manifests.mjs +193 -0
- package/dist/generate/project-docs-site.mjs +190 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +25 -0
- package/dist/lib/agent-docs-model.mjs +888 -0
- package/dist/lib/boundary-rules.mjs +63 -0
- package/dist/lib/capability-routes.mjs +354 -0
- package/dist/lib/projection-sink.mjs +113 -0
- package/dist/lib/public-api-model.mjs +306 -0
- package/dist/main.mjs +233 -0
- package/dist/runner.mjs +127 -0
- package/package.json +32 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { Authored } from "@yansirplus/core";
|
|
2
|
+
import type { AgentSchemaSpec } from "@yansirplus/core/agent-schema";
|
|
3
|
+
import { type AuthorityRef } from "@yansirplus/core/effect-claim";
|
|
4
|
+
import { type MaterialRef } from "@yansirplus/core/material-ref";
|
|
5
|
+
import type { AgentExecutionDomainRef, AgentInteractionRef, AgentLlmRouteBindingRef, AgentManifest, AgentScopeIdentityPolicy } from "@yansirplus/core/runtime-protocol";
|
|
6
|
+
import { type HandlerKind } from "@yansirplus/core/runtime-protocol";
|
|
7
|
+
import { type WorkspaceToolInteractionFloor, type WorkspaceToolName } from "@yansirplus/runtime";
|
|
8
|
+
import { AUTHORING_DEFAULTS_VERSION } from "./shared.js";
|
|
9
|
+
export type AgentManifestFactKey = `/${string}`;
|
|
10
|
+
export type AgentManifestOrigin = `path:${string}` | `author:${string}#${string}` | `scaffold:${string}@${string}#${string}` | `default:${typeof AUTHORING_DEFAULTS_VERSION}#${string}` | `macro(workspace@1)#${string}`;
|
|
11
|
+
export interface AuthoredAgentTree {
|
|
12
|
+
readonly files: ReadonlyArray<AuthoredAgentTreeFile>;
|
|
13
|
+
}
|
|
14
|
+
export type AuthoredAgentTreeFile = AuthoredMarkdownFile | AuthoredJsonFile | AuthoredToolFile;
|
|
15
|
+
export interface AuthoredMarkdownFile {
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly kind: "markdown";
|
|
18
|
+
readonly text: string;
|
|
19
|
+
}
|
|
20
|
+
export interface AuthoredJsonFile {
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly kind: "json";
|
|
23
|
+
readonly value: unknown;
|
|
24
|
+
}
|
|
25
|
+
export type AuthoredToolEffect = "material" | "workspace_mutation" | "network" | "dispatch" | "provider_call" | (string & {});
|
|
26
|
+
export interface AuthoredToolDeclaration {
|
|
27
|
+
readonly bindingRef?: string;
|
|
28
|
+
readonly executionDomain?: string;
|
|
29
|
+
readonly interaction?: string;
|
|
30
|
+
readonly materialRefs?: ReadonlyArray<string>;
|
|
31
|
+
readonly effects?: ReadonlyArray<AuthoredToolEffect>;
|
|
32
|
+
readonly receiptPolicy?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface AuthoredToolFile {
|
|
35
|
+
readonly path: string;
|
|
36
|
+
readonly kind: "tool";
|
|
37
|
+
readonly declaration?: AuthoredToolDeclaration;
|
|
38
|
+
}
|
|
39
|
+
export interface AuthoredWorkspaceDefaultToolOverride {
|
|
40
|
+
readonly interaction?: WorkspaceToolInteractionFloor;
|
|
41
|
+
}
|
|
42
|
+
export type AuthoredWorkspaceDefaultToolControl = false | AuthoredWorkspaceDefaultToolOverride;
|
|
43
|
+
export interface AuthoredAgentJson {
|
|
44
|
+
readonly agentId?: string;
|
|
45
|
+
readonly version?: string;
|
|
46
|
+
readonly scope?: AgentScopeIdentityPolicy;
|
|
47
|
+
readonly effectAuthorityRef?: AuthorityRef;
|
|
48
|
+
readonly handlers?: ReadonlyArray<HandlerKind>;
|
|
49
|
+
readonly llmRoutes?: Readonly<Record<string, AgentLlmRouteBindingRef>>;
|
|
50
|
+
readonly tools?: Readonly<Record<string, AuthoredWorkspaceDefaultToolControl>>;
|
|
51
|
+
readonly materials?: Readonly<Record<string, MaterialRef>>;
|
|
52
|
+
readonly executionDomains?: Readonly<Record<string, AgentExecutionDomainRef>>;
|
|
53
|
+
readonly interactions?: Readonly<Record<string, AgentInteractionRef>>;
|
|
54
|
+
readonly outputSchema?: AgentSchemaSpec;
|
|
55
|
+
}
|
|
56
|
+
export type AuthoredAgentManifest<K extends HandlerKind = HandlerKind> = AgentManifest<K> & Authored<AgentManifest<K>>;
|
|
57
|
+
export interface CompiledAgentManifest<K extends HandlerKind = HandlerKind> {
|
|
58
|
+
readonly manifest: AuthoredAgentManifest<K>;
|
|
59
|
+
readonly provenance: Readonly<Record<AgentManifestFactKey, AgentManifestOrigin>>;
|
|
60
|
+
readonly workspaceToolControls: Readonly<Partial<Record<WorkspaceToolName, WorkspaceDefaultToolControl>>>;
|
|
61
|
+
readonly toolFilePaths: Readonly<Record<string, string>>;
|
|
62
|
+
}
|
|
63
|
+
export type CompileAgentTreeIssue = {
|
|
64
|
+
readonly kind: "unsupported_path";
|
|
65
|
+
readonly path: string;
|
|
66
|
+
readonly reason: string;
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: "duplicate_path";
|
|
69
|
+
readonly path: string;
|
|
70
|
+
readonly existingPath: string;
|
|
71
|
+
} | {
|
|
72
|
+
readonly kind: "duplicate_fact";
|
|
73
|
+
readonly factKey: AgentManifestFactKey;
|
|
74
|
+
readonly origins: readonly [AgentManifestOrigin, AgentManifestOrigin];
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: "non_overrideable_fact";
|
|
77
|
+
readonly factKey: AgentManifestFactKey;
|
|
78
|
+
readonly origins: readonly [AgentManifestOrigin, AgentManifestOrigin];
|
|
79
|
+
} | {
|
|
80
|
+
readonly kind: "missing_required_file";
|
|
81
|
+
readonly path: "agent/instructions.md";
|
|
82
|
+
} | {
|
|
83
|
+
readonly kind: "empty_instructions";
|
|
84
|
+
readonly path: string;
|
|
85
|
+
} | {
|
|
86
|
+
readonly kind: "invalid_json_file";
|
|
87
|
+
readonly path: string;
|
|
88
|
+
readonly reason: string;
|
|
89
|
+
} | {
|
|
90
|
+
readonly kind: "invalid_authored_value";
|
|
91
|
+
readonly path: string;
|
|
92
|
+
readonly field: string;
|
|
93
|
+
readonly reason: string;
|
|
94
|
+
} | {
|
|
95
|
+
readonly kind: "unknown_field";
|
|
96
|
+
readonly path: string;
|
|
97
|
+
readonly field: string;
|
|
98
|
+
} | {
|
|
99
|
+
readonly kind: "identity_field_forbidden";
|
|
100
|
+
readonly path: string;
|
|
101
|
+
readonly field: "id" | "name" | "kind";
|
|
102
|
+
} | {
|
|
103
|
+
readonly kind: "effectful_tool_missing_material";
|
|
104
|
+
readonly toolId: string;
|
|
105
|
+
} | {
|
|
106
|
+
readonly kind: "effectful_tool_missing_execution_domain";
|
|
107
|
+
readonly toolId: string;
|
|
108
|
+
} | {
|
|
109
|
+
readonly kind: "effectful_tool_missing_interaction";
|
|
110
|
+
readonly toolId: string;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: "effectful_tool_missing_receipt_policy";
|
|
113
|
+
readonly toolId: string;
|
|
114
|
+
} | {
|
|
115
|
+
readonly kind: "unknown_workspace_default_tool_control";
|
|
116
|
+
readonly path: string;
|
|
117
|
+
readonly toolId: string;
|
|
118
|
+
} | {
|
|
119
|
+
readonly kind: "workspace_default_tool_control_field_forbidden";
|
|
120
|
+
readonly path: string;
|
|
121
|
+
readonly toolId: string;
|
|
122
|
+
readonly field: string;
|
|
123
|
+
} | {
|
|
124
|
+
readonly kind: "workspace_default_tool_interaction_weakened";
|
|
125
|
+
readonly path: string;
|
|
126
|
+
readonly toolId: string;
|
|
127
|
+
readonly floor: WorkspaceToolInteractionFloor;
|
|
128
|
+
readonly attempted: WorkspaceToolInteractionFloor;
|
|
129
|
+
} | {
|
|
130
|
+
readonly kind: "workspace_default_tool_shadowed";
|
|
131
|
+
readonly path: string;
|
|
132
|
+
readonly toolId: string;
|
|
133
|
+
} | {
|
|
134
|
+
readonly kind: "runtime_fact_forbidden";
|
|
135
|
+
readonly path: string;
|
|
136
|
+
readonly field: string;
|
|
137
|
+
} | {
|
|
138
|
+
readonly kind: "function_in_manifest";
|
|
139
|
+
readonly path: string;
|
|
140
|
+
};
|
|
141
|
+
export type CompileAgentTreeResult<K extends HandlerKind = HandlerKind> = {
|
|
142
|
+
readonly ok: true;
|
|
143
|
+
readonly value: CompiledAgentManifest<K>;
|
|
144
|
+
} | {
|
|
145
|
+
readonly ok: false;
|
|
146
|
+
readonly issues: ReadonlyArray<CompileAgentTreeIssue>;
|
|
147
|
+
};
|
|
148
|
+
export type WorkspaceDefaultToolControl = {
|
|
149
|
+
readonly kind: "disabled";
|
|
150
|
+
readonly origin: AgentManifestOrigin;
|
|
151
|
+
} | {
|
|
152
|
+
readonly kind: "override";
|
|
153
|
+
readonly interaction?: {
|
|
154
|
+
readonly value: WorkspaceToolInteractionFloor;
|
|
155
|
+
readonly origin: AgentManifestOrigin;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
export declare const workspaceManifestMacroOrigin: (factKey: AgentManifestFactKey) => AgentManifestOrigin;
|
|
159
|
+
export declare const compileAgentTree: <K extends HandlerKind = HandlerKind>(tree: AuthoredAgentTree) => CompileAgentTreeResult<K>;
|