@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.
Files changed (47) hide show
  1. package/PUBLIC_API.md +22 -0
  2. package/README.md +34 -0
  3. package/dist/build/agent-authoring/config.d.ts +177 -0
  4. package/dist/build/agent-authoring/config.js +607 -0
  5. package/dist/build/agent-authoring/manifest-compiler.d.ts +159 -0
  6. package/dist/build/agent-authoring/manifest-compiler.js +737 -0
  7. package/dist/build/agent-authoring/shared.d.ts +10 -0
  8. package/dist/build/agent-authoring/shared.js +57 -0
  9. package/dist/build/agent-authoring/static-target.d.ts +59 -0
  10. package/dist/build/agent-authoring/static-target.js +1857 -0
  11. package/dist/build/agent-authoring.d.ts +9 -0
  12. package/dist/build/agent-authoring.js +5 -0
  13. package/dist/build/build-cli.d.ts +2 -0
  14. package/dist/build/build-cli.js +264 -0
  15. package/dist/check/algorithmic/architecture-checks.mjs +971 -0
  16. package/dist/check/algorithmic/client-boundary-checks.mjs +337 -0
  17. package/dist/check/algorithmic/convergence-smoke-checks.mjs +608 -0
  18. package/dist/check/algorithmic/distribution-checks.mjs +919 -0
  19. package/dist/check/algorithmic/owner-checks.mjs +647 -0
  20. package/dist/check/algorithmic/package-boundary-checks.mjs +985 -0
  21. package/dist/check/algorithmic/projection-boundary-checks.mjs +302 -0
  22. package/dist/check/algorithmic/repo-surface-checks.mjs +267 -0
  23. package/dist/check/algorithmic/runtime-structural-checks.mjs +264 -0
  24. package/dist/check/algorithmic/source-alias-checks.mjs +106 -0
  25. package/dist/check/algorithmic/static-target-checks.mjs +447 -0
  26. package/dist/check/algorithmic-checks.mjs +482 -0
  27. package/dist/check/check-coverage.mjs +231 -0
  28. package/dist/check/command-runner.mjs +22 -0
  29. package/dist/check/default-gate.mjs +51 -0
  30. package/dist/check/gate-selector.mjs +305 -0
  31. package/dist/check/manifest-rules.mjs +223 -0
  32. package/dist/check/package-graph.mjs +464 -0
  33. package/dist/generate/generate-agent-docs.mjs +435 -0
  34. package/dist/generate/generate-carrier-reference.mjs +514 -0
  35. package/dist/generate/generate-docs.mjs +345 -0
  36. package/dist/generate/generate-effect-skill-manifests.mjs +193 -0
  37. package/dist/generate/project-docs-site.mjs +190 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +25 -0
  40. package/dist/lib/agent-docs-model.mjs +888 -0
  41. package/dist/lib/boundary-rules.mjs +63 -0
  42. package/dist/lib/capability-routes.mjs +354 -0
  43. package/dist/lib/projection-sink.mjs +113 -0
  44. package/dist/lib/public-api-model.mjs +306 -0
  45. package/dist/main.mjs +233 -0
  46. package/dist/runner.mjs +127 -0
  47. package/package.json +32 -0
package/PUBLIC_API.md ADDED
@@ -0,0 +1,22 @@
1
+ <!-- generated by packages/cli/src/generate/generate-docs.mjs; edit docs/surface.json and exported TSDoc in packages/cli/src -->
2
+
3
+ # @yansirplus/cli Public API
4
+
5
+ Status: 0.5.x active development. CLI root exports are the supported developer API; command internals remain implementation details.
6
+
7
+ ## Public exports
8
+
9
+ - `.:compileAgentTree` - Compile an authored `agent/` tree into one normalized manifest plus provenance. Runtime facts and provider material are rejected before they can become manifest truth.
10
+ - `.:linkWorkspaceStaticTarget` - Link normalized workspace authoring intent to a closed-target residual program. Implementation wiring is static imports and factory composition; manifest and deployment JSON remain semantic/provenance data only.
11
+
12
+ ## Experimental exports
13
+
14
+ None.
15
+
16
+ ## Deprecated exports
17
+
18
+ None.
19
+
20
+ ## Internal-only exports
21
+
22
+ Any package file or symbol not listed above.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ <!-- generated by packages/cli/src/generate/generate-docs.mjs; edit docs/surface.json and docs/packages/cli.md -->
2
+
3
+ # @yansirplus/cli
4
+
5
+ ## Purpose
6
+
7
+ `@yansirplus/cli` is the developer command package for generated projections,
8
+ authored agent builds, structural checks, and distribution gates.
9
+
10
+ ## Public API Status
11
+
12
+ 0.5.x active development. CLI commands are the supported developer surface; generated projections remain owned by their source facts.
13
+
14
+ ## Invariant
15
+
16
+ The CLI consumes source facts and executes gates. It does not own package
17
+ facts, public API intent, carrier declarations, ledger identity, or substrate
18
+ runtime behavior.
19
+
20
+ ## Minimal Usage
21
+
22
+ ```sh
23
+ bun run agentos -- check all
24
+ bun run agentos -- check guard public-api
25
+ bun run agentos -- build --cwd /path/to/app
26
+ bun run agentos -- generate docs
27
+ ```
28
+
29
+ ## Verification
30
+
31
+ ```sh
32
+ bun run agentos -- --help
33
+ bun run agentos -- check guard ag-ui-sse-axis
34
+ ```
@@ -0,0 +1,177 @@
1
+ import type { AgentManifest, ProviderResourceId, WorkspaceBindingRef, WorkspaceTopology } from "@yansirplus/core/runtime-protocol";
2
+ import { type DeploymentSpec, type HandlerKind } from "@yansirplus/core/runtime-protocol";
3
+ import { type WorkspaceToolName } from "@yansirplus/runtime";
4
+ import type { AgentManifestFactKey, AgentManifestOrigin, AuthoredAgentManifest, CompiledAgentManifest } from "./manifest-compiler.js";
5
+ export declare const AGENTOS_CONFIG_PROFILE: {
6
+ readonly WORKSPACE_V1: "workspace@1";
7
+ readonly CHAT_V1: "chat@1";
8
+ };
9
+ export type AgentOsConfigProfile = (typeof AGENTOS_CONFIG_PROFILE)[keyof typeof AGENTOS_CONFIG_PROFILE];
10
+ export declare const AGENTOS_CONFIG_TARGET: {
11
+ readonly CLOUDFLARE_DO_V1: "cloudflare-do@1";
12
+ };
13
+ export type AgentOsConfigTargetKind = (typeof AGENTOS_CONFIG_TARGET)[keyof typeof AGENTOS_CONFIG_TARGET];
14
+ export declare const AGENTOS_CONFIG_CLIENT: {
15
+ readonly SVELTE_KIT_REMOTE_V1: "svelte-kit-remote@1";
16
+ readonly BROWSER_DIRECT_V1: "browser-direct@1";
17
+ };
18
+ export type AgentOsConfigClientKind = (typeof AGENTOS_CONFIG_CLIENT)[keyof typeof AGENTOS_CONFIG_CLIENT];
19
+ export declare const AGENTOS_CONFIG_LLM_ROUTE: {
20
+ readonly OPENAI_CHAT_COMPATIBLE: "openai-chat-compatible";
21
+ };
22
+ export type AgentOsConfigLlmRoute = (typeof AGENTOS_CONFIG_LLM_ROUTE)[keyof typeof AGENTOS_CONFIG_LLM_ROUTE];
23
+ export interface AgentOsConfigDeployment {
24
+ readonly id: string;
25
+ readonly version?: string;
26
+ }
27
+ export interface AgentOsConfigCloudflareDoTarget {
28
+ readonly kind: typeof AGENTOS_CONFIG_TARGET.CLOUDFLARE_DO_V1;
29
+ readonly durableObject: {
30
+ readonly className: string;
31
+ readonly binding: string;
32
+ };
33
+ }
34
+ export type AgentOsConfigTarget = AgentOsConfigCloudflareDoTarget;
35
+ export interface AgentOsConfigClient {
36
+ readonly kind: AgentOsConfigClientKind;
37
+ }
38
+ export interface AgentOsConfigLlm {
39
+ readonly route: AgentOsConfigLlmRoute;
40
+ readonly endpointRef: string;
41
+ readonly credentialRef: string;
42
+ readonly modelRef: string;
43
+ }
44
+ export type AgentOsConfigWorkspaceTopology = WorkspaceTopology;
45
+ export interface AgentOsConfigWorkspace {
46
+ readonly binding: string;
47
+ readonly root: string;
48
+ readonly topology?: AgentOsConfigWorkspaceTopology;
49
+ }
50
+ export interface AgentOsConfigBase {
51
+ readonly $schema?: string;
52
+ readonly profile: AgentOsConfigProfile;
53
+ readonly agent: string;
54
+ readonly deployment: AgentOsConfigDeployment;
55
+ readonly target: AgentOsConfigTarget;
56
+ readonly client: AgentOsConfigClient;
57
+ readonly llm: AgentOsConfigLlm;
58
+ }
59
+ export interface AgentOsWorkspaceConfigV1 extends AgentOsConfigBase {
60
+ readonly profile: typeof AGENTOS_CONFIG_PROFILE.WORKSPACE_V1;
61
+ readonly workspace: AgentOsConfigWorkspace;
62
+ }
63
+ export interface AgentOsChatConfigV1 extends AgentOsConfigBase {
64
+ readonly profile: typeof AGENTOS_CONFIG_PROFILE.CHAT_V1;
65
+ readonly workspace?: never;
66
+ }
67
+ export type AgentOsConfigV1 = AgentOsWorkspaceConfigV1 | AgentOsChatConfigV1;
68
+ export type AgentOsConfigFactKey = `/${string}`;
69
+ export type AgentOsConfigOrigin = `author:agentos.config.jsonc#${AgentOsConfigFactKey}` | `macro(${typeof AGENTOS_CONFIG_PROFILE.WORKSPACE_V1})#${AgentOsConfigFactKey}` | `macro(${typeof AGENTOS_CONFIG_PROFILE.CHAT_V1})#${AgentOsConfigFactKey}` | `derived:${string}`;
70
+ export type AgentOsConfigIssue = {
71
+ readonly kind: "config_not_object";
72
+ readonly path: "agentos.config.jsonc";
73
+ } | {
74
+ readonly kind: "unknown_field";
75
+ readonly path: string;
76
+ readonly field: string;
77
+ } | {
78
+ readonly kind: "invalid_config_value";
79
+ readonly path: string;
80
+ readonly field: string;
81
+ readonly reason: string;
82
+ } | {
83
+ readonly kind: "runtime_fact_forbidden";
84
+ readonly path: string;
85
+ readonly field: string;
86
+ } | {
87
+ readonly kind: "function_in_config";
88
+ readonly path: string;
89
+ } | {
90
+ readonly kind: "workspace_scope_not_manifest_owned";
91
+ readonly path: "agent/agent.json#/scope";
92
+ readonly reason: "scope_not_manifest_owned" | "stable_scope_id_missing";
93
+ } | {
94
+ readonly kind: "llm_material_env_name_collision";
95
+ readonly path: "agentos.config.jsonc#/llm";
96
+ readonly envName: string;
97
+ readonly refs: readonly [string, string];
98
+ } | {
99
+ readonly kind: "workspace_default_tool_shadowed";
100
+ readonly path: string;
101
+ readonly toolId: WorkspaceToolName;
102
+ } | {
103
+ readonly kind: "tool_material_ref_unresolved";
104
+ readonly toolId: string;
105
+ readonly materialRef: string;
106
+ } | {
107
+ readonly kind: "tool_execution_domain_ref_unresolved";
108
+ readonly toolId: string;
109
+ readonly executionDomain: string;
110
+ } | {
111
+ readonly kind: "tool_interaction_ref_unresolved";
112
+ readonly toolId: string;
113
+ readonly interaction: string;
114
+ };
115
+ export interface StaticTargetProvenance {
116
+ readonly manifest: Readonly<Record<AgentManifestFactKey, AgentManifestOrigin>>;
117
+ readonly deployment: Readonly<Record<AgentOsConfigFactKey, AgentOsConfigOrigin>>;
118
+ readonly exclusions: Readonly<Record<string, AgentManifestOrigin>>;
119
+ }
120
+ export type DecodeAgentOsConfigResult = {
121
+ readonly ok: true;
122
+ readonly value: AgentOsConfigV1;
123
+ } | {
124
+ readonly ok: false;
125
+ readonly issues: ReadonlyArray<AgentOsConfigIssue>;
126
+ };
127
+ export interface NormalizedAgentOsConfigBase<M extends AgentManifest = AgentManifest> {
128
+ readonly profile: AgentOsConfigProfile;
129
+ readonly config: AgentOsConfigV1;
130
+ readonly deployment: DeploymentSpec<M>;
131
+ readonly deploymentVersion?: string;
132
+ readonly authoredToolNames: ReadonlyArray<string>;
133
+ readonly target: AgentOsConfigTarget;
134
+ readonly client: AgentOsConfigClient;
135
+ readonly llm: AgentOsConfigLlm;
136
+ readonly origins: Readonly<Record<AgentOsConfigFactKey, AgentOsConfigOrigin>>;
137
+ readonly provenance: StaticTargetProvenance;
138
+ }
139
+ export interface NormalizedWorkspaceAgentOsConfig<M extends AgentManifest = AgentManifest> extends NormalizedAgentOsConfigBase<M> {
140
+ readonly profile: typeof AGENTOS_CONFIG_PROFILE.WORKSPACE_V1;
141
+ readonly config: AgentOsWorkspaceConfigV1;
142
+ readonly workspace: AgentOsConfigWorkspace & {
143
+ readonly topology: AgentOsConfigWorkspaceTopology;
144
+ readonly bindingRef: WorkspaceBindingRef;
145
+ readonly providerResourceId: ProviderResourceId;
146
+ readonly cloudflareSandboxId: string;
147
+ };
148
+ }
149
+ export interface NormalizedChatAgentOsConfig<M extends AgentManifest = AgentManifest> extends NormalizedAgentOsConfigBase<M> {
150
+ readonly profile: typeof AGENTOS_CONFIG_PROFILE.CHAT_V1;
151
+ readonly config: AgentOsChatConfigV1;
152
+ }
153
+ export type NormalizedAgentOsConfig<M extends AgentManifest = AgentManifest> = NormalizedWorkspaceAgentOsConfig<M> | NormalizedChatAgentOsConfig<M>;
154
+ export type NormalizeAgentOsConfigResult<M extends AgentManifest = AgentManifest> = {
155
+ readonly ok: true;
156
+ readonly value: NormalizedAgentOsConfig<M>;
157
+ } | {
158
+ readonly ok: false;
159
+ readonly issues: ReadonlyArray<AgentOsConfigIssue>;
160
+ };
161
+ export type LlmMaterialEnvKind = "endpoint" | "credential" | "model";
162
+ export interface LlmMaterialEnvBinding {
163
+ readonly kind: LlmMaterialEnvKind;
164
+ readonly ref: string;
165
+ readonly envName: string;
166
+ }
167
+ export declare const materialEnvNameForRef: (kind: LlmMaterialEnvKind, ref: string) => string;
168
+ export declare const llmMaterialEnvBindingsForRefs: (refs: ReadonlyArray<{
169
+ readonly kind: LlmMaterialEnvKind;
170
+ readonly ref: string;
171
+ }>) => ReadonlyArray<LlmMaterialEnvBinding>;
172
+ export declare const llmMaterialEnvNameCollisionIssues: (bindings: ReadonlyArray<LlmMaterialEnvBinding>) => ReadonlyArray<Extract<AgentOsConfigIssue, {
173
+ readonly kind: "llm_material_env_name_collision";
174
+ }>>;
175
+ export declare const llmMaterialEnvBindings: (llm: AgentOsConfigLlm) => ReadonlyArray<LlmMaterialEnvBinding>;
176
+ export declare const decodeAgentOsConfig: (value: unknown) => DecodeAgentOsConfigResult;
177
+ export declare const normalizeAgentOsConfig: <K extends HandlerKind = HandlerKind>(config: AgentOsConfigV1, compiled: CompiledAgentManifest<K>) => NormalizeAgentOsConfigResult<AuthoredAgentManifest<K>>;