@yansirplus/cli 0.5.17 → 0.5.18

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 (52) hide show
  1. package/README.md +12 -6
  2. package/agent-catalog/agentOS/SKILL.md +22 -0
  3. package/agent-catalog/agentOS/references/agent/decision-graph.json +530 -0
  4. package/agent-catalog/agentOS/references/agent/errors.json +497 -0
  5. package/agent-catalog/agentOS/references/agent/invariant-matrix.json +337 -0
  6. package/agent-catalog/agentOS/references/agent/primitives.json +989 -0
  7. package/agent-catalog/agentOS/references/agent/recipes.json +109 -0
  8. package/agent-catalog/agentOS/references/agent/start-here.md +25 -0
  9. package/agent-catalog/agentOS/references/package-map.md +72 -0
  10. package/agent-catalog/agentOS/references/provenance.json +251 -0
  11. package/agent-catalog/agentOS/references/public-api/cli.md +20 -0
  12. package/agent-catalog/agentOS/references/public-api/client.md +88 -0
  13. package/agent-catalog/agentOS/references/public-api/core.md +1817 -0
  14. package/agent-catalog/agentOS/references/public-api/runtime.md +794 -0
  15. package/dist/build/agent-authoring/config.d.ts +20 -5
  16. package/dist/build/agent-authoring/config.js +132 -32
  17. package/dist/build/agent-authoring/manifest-compiler.d.ts +131 -2
  18. package/dist/build/agent-authoring/manifest-compiler.js +630 -8
  19. package/dist/build/agent-authoring/shared.d.ts +2 -0
  20. package/dist/build/agent-authoring/shared.js +2 -0
  21. package/dist/build/agent-authoring/static-target.d.ts +6 -3
  22. package/dist/build/agent-authoring/static-target.js +1807 -286
  23. package/dist/build/agent-authoring.d.ts +3 -3
  24. package/dist/build/agent-authoring.js +1 -1
  25. package/dist/build/build-cli.d.ts +1 -1
  26. package/dist/build/build-cli.js +1614 -26
  27. package/dist/check/algorithmic/client-boundary-checks.mjs +3 -34
  28. package/dist/check/algorithmic/convergence-smoke-checks.mjs +652 -6
  29. package/dist/check/algorithmic/distribution-checks.mjs +8 -7
  30. package/dist/check/algorithmic/package-boundary-checks.mjs +3 -2
  31. package/dist/check/algorithmic/repo-surface-checks.mjs +55 -1
  32. package/dist/check/algorithmic/static-target-checks.mjs +83 -5
  33. package/dist/check/algorithmic-checks.mjs +10 -17
  34. package/dist/check/default-gate.mjs +3 -3
  35. package/dist/check/effect-scan-gate.mjs +121 -0
  36. package/dist/check/package-graph.mjs +2 -32
  37. package/dist/consumer-overlay.mjs +802 -0
  38. package/dist/lib/public-api-model.mjs +19 -0
  39. package/dist/lib/repo-source-files.mjs +26 -0
  40. package/dist/lib/ts-module-loader.mjs +44 -0
  41. package/dist/lib/workspace-manifest.mjs +77 -0
  42. package/dist/main.mjs +151 -21
  43. package/package.json +8 -4
  44. package/dist/check/check-coverage.mjs +0 -231
  45. package/dist/generate/generate-agent-docs.mjs +0 -435
  46. package/dist/generate/generate-carrier-reference.mjs +0 -514
  47. package/dist/generate/generate-docs.mjs +0 -345
  48. package/dist/generate/generate-effect-skill-manifests.mjs +0 -193
  49. package/dist/generate/project-docs-site.mjs +0 -190
  50. package/dist/lib/boundary-rules.mjs +0 -63
  51. package/dist/lib/capability-routes.mjs +0 -354
  52. package/dist/lib/projection-sink.mjs +0 -113
@@ -1,113 +0,0 @@
1
- const isNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
2
-
3
- const sourceRefIssue = (source) => {
4
- if (!isNonEmptyString(source.kind)) return "projection source kind must be non-empty";
5
- if (!isNonEmptyString(source.ref)) return "projection source ref must be non-empty";
6
- if (source.hash !== undefined && !isNonEmptyString(source.hash)) {
7
- return "projection source hash must be non-empty when present";
8
- }
9
- if (source.kind !== "source-set" && source.sources !== undefined) {
10
- return "projection source children require source-set kind";
11
- }
12
- if (
13
- source.kind === "source-set" &&
14
- (!Array.isArray(source.sources) || source.sources.length === 0)
15
- ) {
16
- return "projection source-set must include at least one source";
17
- }
18
- for (const child of source.sources ?? []) {
19
- const issue = sourceRefIssue(child);
20
- if (issue !== undefined) return `${source.ref}: ${issue}`;
21
- }
22
- return undefined;
23
- };
24
-
25
- export const defineProjectionSpec = (spec) => {
26
- if (!isNonEmptyString(spec.id)) throw new Error("projection id must be non-empty");
27
- if (!Number.isInteger(spec.version) || spec.version < 1) {
28
- throw new Error("projection version must be a positive integer");
29
- }
30
- const sourceIssue = sourceRefIssue(spec.source);
31
- if (sourceIssue !== undefined) throw new Error(sourceIssue);
32
- return spec;
33
- };
34
-
35
- const provenanceOf = (spec) => ({
36
- projection: {
37
- id: spec.id,
38
- version: spec.version,
39
- },
40
- source: spec.source,
41
- });
42
-
43
- const projectionOk = (provenance, output) => ({ _tag: "ok", output, provenance });
44
-
45
- const projectionFailure = (provenance, reason, issues) => ({
46
- _tag: "failure",
47
- reason,
48
- provenance,
49
- ...(issues === undefined ? {} : { issues }),
50
- });
51
-
52
- const isThenable = (value) =>
53
- value !== null &&
54
- (typeof value === "object" || typeof value === "function") &&
55
- "then" in value &&
56
- typeof value.then === "function";
57
-
58
- const isProjectionResult = (value) =>
59
- value !== null &&
60
- typeof value === "object" &&
61
- "_tag" in value &&
62
- (value._tag === "ok" || value._tag === "failure");
63
-
64
- const project = (spec, input) => {
65
- const provenance = provenanceOf(spec);
66
- const context = {
67
- provenance,
68
- ok: (output) => projectionOk(provenance, output),
69
- failure: (reason, issues) => projectionFailure(provenance, reason, issues),
70
- };
71
-
72
- try {
73
- const result = spec.project(input, context);
74
- if (isThenable(result)) return projectionFailure(provenance, "projection_returned_thenable");
75
- if (!isProjectionResult(result))
76
- return projectionFailure(provenance, "projection_result_invalid");
77
- return result._tag === "ok"
78
- ? projectionOk(provenance, result.output)
79
- : projectionFailure(provenance, result.reason, result.issues);
80
- } catch {
81
- return projectionFailure(provenance, "projection_threw");
82
- }
83
- };
84
-
85
- const defaultEquals = (actual, expected) => Object.is(actual, expected);
86
-
87
- export const checkProjectionSink = async (spec, input, sink) => {
88
- const result = project(spec, input);
89
- if (result._tag === "failure") return { _tag: "projection_failed", result };
90
-
91
- const current = await sink.read();
92
- if (current._tag === "found" && (sink.equals ?? defaultEquals)(current.output, result.output)) {
93
- return { _tag: "current", result, actual: current.output };
94
- }
95
-
96
- return {
97
- _tag: "stale",
98
- result,
99
- expected: result.output,
100
- actual: current,
101
- };
102
- };
103
-
104
- export const runProjectionSink = async (spec, input, sink) => {
105
- const checked = await checkProjectionSink(spec, input, sink);
106
- if (checked._tag !== "stale") return checked;
107
- await sink.write(checked.expected);
108
- return {
109
- _tag: "updated",
110
- result: checked.result,
111
- previous: checked.actual,
112
- };
113
- };