@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
@@ -0,0 +1,10 @@
1
+ import { type WorkspaceToolName } from "@yansirplus/runtime";
2
+ export declare const AUTHORING_DEFAULTS_VERSION: "framework-defaults@agentos/v1";
3
+ export type JsonRecord = Readonly<Record<string, unknown>>;
4
+ export declare const isRecord: (value: unknown) => value is JsonRecord;
5
+ export declare const isNonEmptyString: (value: unknown) => value is string;
6
+ export declare const hasFunction: (value: unknown, seen?: any) => boolean;
7
+ export declare const findFunctionPath: (value: unknown, path: string, seen?: any) => string | null;
8
+ export declare const digestText: (text: string) => string;
9
+ export declare const digestHex64: (text: string) => string;
10
+ export declare const isWorkspaceToolName: (name: string) => name is WorkspaceToolName;
@@ -0,0 +1,57 @@
1
+ import { WORKSPACE_TOOL_NAMES } from "@yansirplus/runtime";
2
+ export const AUTHORING_DEFAULTS_VERSION = "framework-defaults@agentos/v1";
3
+ export const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4
+ export const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
5
+ export const hasFunction = (value, seen = new Set()) => {
6
+ if (typeof value === "function")
7
+ return true;
8
+ if (typeof value !== "object" || value === null)
9
+ return false;
10
+ if (seen.has(value))
11
+ return false;
12
+ seen.add(value);
13
+ if (Array.isArray(value))
14
+ return value.some((item) => hasFunction(item, seen));
15
+ return Object.values(value).some((item) => hasFunction(item, seen));
16
+ };
17
+ export const findFunctionPath = (value, path, seen = new Set()) => {
18
+ if (typeof value === "function")
19
+ return path;
20
+ if (typeof value !== "object" || value === null)
21
+ return null;
22
+ if (seen.has(value))
23
+ return null;
24
+ seen.add(value);
25
+ if (Array.isArray(value)) {
26
+ for (let index = 0; index < value.length; index += 1) {
27
+ const found = findFunctionPath(value[index], `${path}[${index}]`, seen);
28
+ if (found !== null)
29
+ return found;
30
+ }
31
+ return null;
32
+ }
33
+ for (const [key, child] of Object.entries(value)) {
34
+ const found = findFunctionPath(child, `${path}.${key}`, seen);
35
+ if (found !== null)
36
+ return found;
37
+ }
38
+ return null;
39
+ };
40
+ export const digestText = (text) => {
41
+ let hash = 0x811c9dc5;
42
+ for (let index = 0; index < text.length; index += 1) {
43
+ hash ^= text.charCodeAt(index);
44
+ hash = Math.imul(hash, 0x01000193) >>> 0;
45
+ }
46
+ return `fnv1a32:${hash.toString(16).padStart(8, "0")}:${text.length}`;
47
+ };
48
+ export const digestHex64 = (text) => {
49
+ let hash = 0xcbf29ce484222325n;
50
+ for (let index = 0; index < text.length; index += 1) {
51
+ hash ^= BigInt(text.charCodeAt(index));
52
+ hash = BigInt.asUintN(64, hash * 0x100000001b3n);
53
+ }
54
+ return hash.toString(16).padStart(16, "0");
55
+ };
56
+ const workspaceToolNames = new Set(WORKSPACE_TOOL_NAMES);
57
+ export const isWorkspaceToolName = (name) => workspaceToolNames.has(name);
@@ -0,0 +1,59 @@
1
+ import type { ProviderResourceId } from "@yansirplus/core/runtime-protocol";
2
+ import type { HandlerKind } from "@yansirplus/core/runtime-protocol";
3
+ import type { AuthoredAgentManifest } from "./manifest-compiler.js";
4
+ import { AGENTOS_CONFIG_LLM_ROUTE, AGENTOS_CONFIG_TARGET, type AgentOsConfigClientKind, type AgentOsConfigLlmRoute, type AgentOsConfigProfile, type AgentOsConfigTargetKind, type AgentOsConfigWorkspaceTopology, type NormalizedAgentOsConfig } from "./config.js";
5
+ export type StaticTargetGeneratedFilePath = ".agentos/generated/manifest.json" | ".agentos/generated/deployment.json" | ".agentos/generated/provenance.json" | ".agentos/generated/fingerprints.json" | ".agentos/generated/target.ts" | ".agentos/generated/cloudflare-scope.ts" | ".agentos/generated/worker.ts" | ".agentos/generated/wrangler.jsonc" | ".agentos/generated/sveltekit.remote.ts" | ".agentos/generated/client.ts" | ".agentos/generated/client.d.ts";
6
+ export interface StaticTargetGeneratedFile {
7
+ readonly path: StaticTargetGeneratedFilePath;
8
+ readonly text: string;
9
+ }
10
+ export type StaticTargetModuleImportKind = "target-runtime" | "target-scope-helper" | "target-worker" | "target-config" | "provider-runtime" | "execution-domain-runtime" | "workspace-host" | "workspace-binding" | "platform-runtime" | "workspace-client" | "client-core" | "client-framework" | "client-transport" | "effect-runtime" | "semantic-json" | "authored-tool";
11
+ export interface StaticTargetModuleImport {
12
+ readonly kind: StaticTargetModuleImportKind;
13
+ readonly source: string;
14
+ readonly imports: ReadonlyArray<string>;
15
+ }
16
+ export interface CanonicalDeploymentIR {
17
+ readonly profile: AgentOsConfigProfile;
18
+ readonly target: typeof AGENTOS_CONFIG_TARGET.CLOUDFLARE_DO_V1;
19
+ readonly llmRoute: typeof AGENTOS_CONFIG_LLM_ROUTE.OPENAI_CHAT_COMPATIBLE;
20
+ readonly client: AgentOsConfigClientKind;
21
+ readonly workspaceTopology?: AgentOsConfigWorkspaceTopology;
22
+ readonly toolNames: ReadonlyArray<string>;
23
+ }
24
+ export interface MountIR {
25
+ readonly driver: {
26
+ readonly kind: "cloudflare-do";
27
+ readonly className: string;
28
+ readonly binding: string;
29
+ };
30
+ readonly projectionSinks: ReadonlyArray<"agent.info" | "workspace.state" | "workspace.files" | "runtime.events" | "runtime.input_requests">;
31
+ readonly providerResourceId?: ProviderResourceId;
32
+ }
33
+ export interface StaticTargetLink {
34
+ readonly files: ReadonlyArray<StaticTargetGeneratedFile>;
35
+ readonly moduleGraph: ReadonlyArray<StaticTargetModuleImport>;
36
+ readonly canonicalDeployment: CanonicalDeploymentIR;
37
+ readonly mount: MountIR;
38
+ }
39
+ export type StaticTargetLinkIssue = {
40
+ readonly kind: "unsupported_static_target";
41
+ readonly target: AgentOsConfigTargetKind;
42
+ } | {
43
+ readonly kind: "unsupported_static_llm_route";
44
+ readonly route: AgentOsConfigLlmRoute;
45
+ } | {
46
+ readonly kind: "invalid_static_package_scope";
47
+ readonly scope: string;
48
+ };
49
+ export interface StaticTargetLinkOptions {
50
+ readonly packageScope?: string;
51
+ }
52
+ export type StaticTargetLinkResult = {
53
+ readonly ok: true;
54
+ readonly value: StaticTargetLink;
55
+ } | {
56
+ readonly ok: false;
57
+ readonly issues: ReadonlyArray<StaticTargetLinkIssue>;
58
+ };
59
+ export declare const linkWorkspaceStaticTarget: <K extends HandlerKind = HandlerKind>(normalized: NormalizedAgentOsConfig<AuthoredAgentManifest<K>>, options?: StaticTargetLinkOptions) => StaticTargetLinkResult;