@procedures/lib 0.0.0-stage → 0.1.0

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 (114) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +119 -2
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/cli-flags.d.ts +27 -0
  6. package/dist/cli-flags.d.ts.map +1 -0
  7. package/dist/cli-flags.js +33 -0
  8. package/dist/cli-flags.js.map +1 -0
  9. package/dist/dag/builder.d.ts +18 -0
  10. package/dist/dag/builder.d.ts.map +1 -0
  11. package/dist/dag/builder.js +35 -0
  12. package/dist/dag/builder.js.map +1 -0
  13. package/dist/dag/index.d.ts +12 -0
  14. package/dist/dag/index.d.ts.map +1 -0
  15. package/dist/dag/index.js +12 -0
  16. package/dist/dag/index.js.map +1 -0
  17. package/dist/git/index.d.ts +5 -0
  18. package/dist/git/index.d.ts.map +1 -0
  19. package/dist/git/index.js +5 -0
  20. package/dist/git/index.js.map +1 -0
  21. package/dist/git/ref-parser.d.ts +34 -0
  22. package/dist/git/ref-parser.d.ts.map +1 -0
  23. package/dist/git/ref-parser.js +70 -0
  24. package/dist/git/ref-parser.js.map +1 -0
  25. package/dist/index.d.ts +14 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +20 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/module.d.ts +16 -0
  30. package/dist/module.d.ts.map +1 -0
  31. package/dist/module.js +156 -0
  32. package/dist/module.js.map +1 -0
  33. package/dist/procedures/core/catch.d.ts +33 -0
  34. package/dist/procedures/core/catch.d.ts.map +1 -0
  35. package/dist/procedures/core/catch.js +118 -0
  36. package/dist/procedures/core/catch.js.map +1 -0
  37. package/dist/procedures/core/index.d.ts +9 -0
  38. package/dist/procedures/core/index.d.ts.map +1 -0
  39. package/dist/procedures/core/index.js +8 -0
  40. package/dist/procedures/core/index.js.map +1 -0
  41. package/dist/procedures/dag/index.d.ts +5 -0
  42. package/dist/procedures/dag/index.d.ts.map +1 -0
  43. package/dist/procedures/dag/index.js +5 -0
  44. package/dist/procedures/dag/index.js.map +1 -0
  45. package/dist/procedures/dag/traverse.d.ts +54 -0
  46. package/dist/procedures/dag/traverse.d.ts.map +1 -0
  47. package/dist/procedures/dag/traverse.js +252 -0
  48. package/dist/procedures/dag/traverse.js.map +1 -0
  49. package/dist/procedures/ecosystem/index.d.ts +7 -0
  50. package/dist/procedures/ecosystem/index.d.ts.map +1 -0
  51. package/dist/procedures/ecosystem/index.js +6 -0
  52. package/dist/procedures/ecosystem/index.js.map +1 -0
  53. package/dist/procedures/ecosystem/procedures.d.ts +63 -0
  54. package/dist/procedures/ecosystem/procedures.d.ts.map +1 -0
  55. package/dist/procedures/ecosystem/procedures.js +215 -0
  56. package/dist/procedures/ecosystem/procedures.js.map +1 -0
  57. package/dist/procedures/lib/audit.d.ts +29 -0
  58. package/dist/procedures/lib/audit.d.ts.map +1 -0
  59. package/dist/procedures/lib/audit.js +236 -0
  60. package/dist/procedures/lib/audit.js.map +1 -0
  61. package/dist/procedures/lib/index.d.ts +8 -0
  62. package/dist/procedures/lib/index.d.ts.map +1 -0
  63. package/dist/procedures/lib/index.js +8 -0
  64. package/dist/procedures/lib/index.js.map +1 -0
  65. package/dist/procedures/lib/new.d.ts +18 -0
  66. package/dist/procedures/lib/new.d.ts.map +1 -0
  67. package/dist/procedures/lib/new.js +170 -0
  68. package/dist/procedures/lib/new.js.map +1 -0
  69. package/dist/procedures/lib/rename.d.ts +28 -0
  70. package/dist/procedures/lib/rename.d.ts.map +1 -0
  71. package/dist/procedures/lib/rename.js +267 -0
  72. package/dist/procedures/lib/rename.js.map +1 -0
  73. package/dist/procedures/lib/scan.d.ts +14 -0
  74. package/dist/procedures/lib/scan.d.ts.map +1 -0
  75. package/dist/procedures/lib/scan.js +102 -0
  76. package/dist/procedures/lib/scan.js.map +1 -0
  77. package/dist/register.d.ts +10 -0
  78. package/dist/register.d.ts.map +1 -0
  79. package/dist/register.js +19 -0
  80. package/dist/register.js.map +1 -0
  81. package/dist/scoped-input.d.ts +17 -0
  82. package/dist/scoped-input.d.ts.map +1 -0
  83. package/dist/scoped-input.js +23 -0
  84. package/dist/scoped-input.js.map +1 -0
  85. package/dist/types.d.ts +248 -0
  86. package/dist/types.d.ts.map +1 -0
  87. package/dist/types.js +231 -0
  88. package/dist/types.js.map +1 -0
  89. package/dist/workspace.d.ts +46 -0
  90. package/dist/workspace.d.ts.map +1 -0
  91. package/dist/workspace.js +98 -0
  92. package/dist/workspace.js.map +1 -0
  93. package/package.json +84 -3
  94. package/src/cli-flags.ts +49 -0
  95. package/src/dag/builder.ts +44 -0
  96. package/src/dag/index.ts +23 -0
  97. package/src/git/index.ts +11 -0
  98. package/src/git/ref-parser.ts +83 -0
  99. package/src/index.ts +57 -0
  100. package/src/module.ts +207 -0
  101. package/src/procedures/core/catch.ts +142 -0
  102. package/src/procedures/core/index.ts +9 -0
  103. package/src/procedures/dag/index.ts +5 -0
  104. package/src/procedures/dag/traverse.ts +281 -0
  105. package/src/procedures/ecosystem/index.ts +12 -0
  106. package/src/procedures/ecosystem/procedures.ts +317 -0
  107. package/src/procedures/lib/audit.ts +307 -0
  108. package/src/procedures/lib/index.ts +8 -0
  109. package/src/procedures/lib/new.ts +216 -0
  110. package/src/procedures/lib/rename.ts +355 -0
  111. package/src/procedures/lib/scan.ts +143 -0
  112. package/src/register.ts +23 -0
  113. package/src/types.ts +526 -0
  114. package/src/workspace.ts +110 -0
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The global flags of the `mark` CLI.
3
+ *
4
+ * `mark` reads a global flag before the command path. After the path, a flag is global only when
5
+ * the procedure does not declare a flag of that name: `mark docker compose down -v` gives `-v` to
6
+ * the procedure. `lib.audit` reports each procedure flag that hides a global flag in this way.
7
+ *
8
+ * This module has no side effects: `mark` imports it before it loads the procedures.
9
+ */
10
+ export const CLI_GLOBAL_FLAGS = [
11
+ { long: "help", short: "h", takesValue: false, description: "Show the help" },
12
+ { long: "version", short: "v", takesValue: false, description: "Show the version" },
13
+ { long: "verbose", short: "V", takesValue: false, description: "Show more output" },
14
+ { long: "format", short: "f", takesValue: true, description: "The output format: text, json, table or streaming" },
15
+ { long: "local", takesValue: false, description: "Run the command in this process, not on the CLI server" },
16
+ { long: "json", takesValue: true, description: "Run a procedure reference that is given as JSON" },
17
+ { long: "no-input", takesValue: false, description: "Never ask for a missing argument (also when CI is set)" },
18
+ { long: "interactive", short: "i", takesValue: false, mode: true, description: "Start the REPL" },
19
+ { long: "server", takesValue: false, mode: true, description: "Start the CLI server" },
20
+ { long: "port", takesValue: true, serverOption: true, description: "The port of the CLI server (with --server)" },
21
+ { long: "host", takesValue: true, serverOption: true, description: "The host of the CLI server (with --server)" },
22
+ {
23
+ long: "transport",
24
+ takesValue: true,
25
+ serverOption: true,
26
+ description: "The transport of the CLI server: http, websocket or both (with --server)",
27
+ },
28
+ ];
29
+ /** The global flag with this long name or short letter */
30
+ export function findGlobalFlag(name, short) {
31
+ return CLI_GLOBAL_FLAGS.find((flag) => (short ? flag.short === name : flag.long === name));
32
+ }
33
+ //# sourceMappingURL=cli-flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-flags.js","sourceRoot":"","sources":["../src/cli-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiBH,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE;IAC7E,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE;IACnF,EAAE,IAAI,EAAE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
1
+ /**
2
+ * DAG Builder
3
+ *
4
+ * Builds the ecosystem-specific dependency DAG from package scan results. This is the only
5
+ * domain-specific piece; the generic DAG algorithms (buildLeveledDAG, executeDAG, filterDAGFromRoot,
6
+ * getAncestors, getDescendants, ...) live in @procedures/dag. This package previously
7
+ * vendored a verbatim copy of those — see documentation/BUGS-2026-07.md (DAG de-dup).
8
+ */
9
+ import type { DAGNode, PackageInfo } from "../types.js";
10
+ /**
11
+ * Build DAG nodes from package info.
12
+ *
13
+ * Creates nodes only for packages that are mark1russell7 dependencies and exist in the scanned
14
+ * packages. `id` mirrors `name` so the nodes satisfy client-dag's DAGNode contract (which keys by
15
+ * id) while the ecosystem code keeps using the readable `name`.
16
+ */
17
+ export declare function buildDAGNodes(packages: Record<string, PackageInfo>): Map<string, DAGNode>;
18
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/dag/builder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GACpC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBtB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * DAG Builder
3
+ *
4
+ * Builds the ecosystem-specific dependency DAG from package scan results. This is the only
5
+ * domain-specific piece; the generic DAG algorithms (buildLeveledDAG, executeDAG, filterDAGFromRoot,
6
+ * getAncestors, getDescendants, ...) live in @procedures/dag. This package previously
7
+ * vendored a verbatim copy of those — see documentation/BUGS-2026-07.md (DAG de-dup).
8
+ */
9
+ /**
10
+ * Build DAG nodes from package info.
11
+ *
12
+ * Creates nodes only for packages that are mark1russell7 dependencies and exist in the scanned
13
+ * packages. `id` mirrors `name` so the nodes satisfy client-dag's DAGNode contract (which keys by
14
+ * id) while the ecosystem code keeps using the readable `name`.
15
+ */
16
+ export function buildDAGNodes(packages) {
17
+ const nodes = new Map();
18
+ for (const [name, info] of Object.entries(packages)) {
19
+ // Only include packages that have mark1russell7 dependencies or are dependencies of others.
20
+ const deps = info.mark1russell7Deps.filter((dep) => packages[dep] !== undefined);
21
+ const gitRef = info.gitRemote ?? `github:mark1russell7/${info.name}#${info.currentBranch ?? "main"}`;
22
+ const requiredBranch = info.currentBranch ?? "main";
23
+ const node = {
24
+ id: name,
25
+ name,
26
+ repoPath: info.repoPath,
27
+ gitRef,
28
+ requiredBranch,
29
+ dependencies: deps,
30
+ };
31
+ nodes.set(name, node);
32
+ }
33
+ return nodes;
34
+ }
35
+ //# sourceMappingURL=builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/dag/builder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAqC;IAErC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEzC,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,4FAA4F;QAC5F,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;QAEjF,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,IAAI,wBAAwB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,aAAa,IAAI,MAAM,EAAE,CAAC;QACrG,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC;QAEpD,MAAM,IAAI,GAAY;YACpB,EAAE,EAAE,IAAI;YACR,IAAI;YACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM;YACN,cAAc;YACd,YAAY,EAAE,IAAI;SACnB,CAAC;QAEF,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * DAG utilities.
3
+ *
4
+ * The generic DAG algorithms are re-exported from @procedures/dag; only buildDAGNodes
5
+ * (which builds the ecosystem package graph) is domain-specific and stays local. This package
6
+ * previously vendored a verbatim copy of the generic algorithms — deduplicated here. The nodes
7
+ * carry an `id` (mirroring `name`) so they satisfy client-dag's generic `DAGNode` contract.
8
+ * See documentation/BUGS-2026-07.md (DAG de-dup / H27).
9
+ */
10
+ export { buildLeveledDAG, getTopologicalOrder, visualizeDAG, executeDAG, executeDAGSequential, createProcessor, filterDAGFromRoot, getAncestors, getDescendants, } from "@procedures/dag";
11
+ export { buildDAGNodes } from "./builder.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dag/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * DAG utilities.
3
+ *
4
+ * The generic DAG algorithms are re-exported from @procedures/dag; only buildDAGNodes
5
+ * (which builds the ecosystem package graph) is domain-specific and stays local. This package
6
+ * previously vendored a verbatim copy of the generic algorithms — deduplicated here. The nodes
7
+ * carry an `id` (mirroring `name`) so they satisfy client-dag's generic `DAGNode` contract.
8
+ * See documentation/BUGS-2026-07.md (DAG de-dup / H27).
9
+ */
10
+ export { buildLeveledDAG, getTopologicalOrder, visualizeDAG, executeDAG, executeDAGSequential, createProcessor, filterDAGFromRoot, getAncestors, getDescendants, } from "@procedures/dag";
11
+ export { buildDAGNodes } from "./builder.js";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dag/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Git utilities
3
+ */
4
+ export { parseGitRef, isGitRef, isMark1Russell7Ref, extractMark1Russell7Deps, getPackageNameFromRef, } from "./ref-parser.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/git/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Git utilities
3
+ */
4
+ export { parseGitRef, isGitRef, isMark1Russell7Ref, extractMark1Russell7Deps, getPackageNameFromRef, } from "./ref-parser.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/git/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Git reference parser
3
+ *
4
+ * Parses git references from package.json dependencies like:
5
+ * - github:mark1russell7/logger#main
6
+ * - github:mark1russell7/client#v1.0.0
7
+ */
8
+ import type { GitRef } from "../types.js";
9
+ /**
10
+ * Parse a git reference string into its components
11
+ *
12
+ * @example
13
+ * parseGitRef("github:mark1russell7/logger#main")
14
+ * // { raw: "...", host: "github", owner: "mark1russell7", repo: "logger", ref: "main" }
15
+ */
16
+ export declare function parseGitRef(refString: string): GitRef | null;
17
+ /**
18
+ * Check if a dependency string is a git reference
19
+ */
20
+ export declare function isGitRef(dep: string): boolean;
21
+ /**
22
+ * Check if a dependency is a mark1russell7 git reference
23
+ */
24
+ export declare function isMark1Russell7Ref(dep: string): boolean;
25
+ /**
26
+ * Extract mark1russell7 git refs from package.json dependencies
27
+ */
28
+ export declare function extractMark1Russell7Deps(dependencies: Record<string, string>): GitRef[];
29
+ /**
30
+ * Get the package name from a git ref
31
+ * Uses the repo name, optionally scoped with @mark1russell7/
32
+ */
33
+ export declare function getPackageNameFromRef(ref: GitRef): string;
34
+ //# sourceMappingURL=ref-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-parser.d.ts","sourceRoot":"","sources":["../../src/git/ref-parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAoB5D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,MAAM,EAAE,CAaV;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKzD"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Git reference parser
3
+ *
4
+ * Parses git references from package.json dependencies like:
5
+ * - github:mark1russell7/logger#main
6
+ * - github:mark1russell7/client#v1.0.0
7
+ */
8
+ /**
9
+ * Parse a git reference string into its components
10
+ *
11
+ * @example
12
+ * parseGitRef("github:mark1russell7/logger#main")
13
+ * // { raw: "...", host: "github", owner: "mark1russell7", repo: "logger", ref: "main" }
14
+ */
15
+ export function parseGitRef(refString) {
16
+ // Pattern: host:owner/repo#ref
17
+ // Examples:
18
+ // github:mark1russell7/logger#main
19
+ // gitlab:user/project#develop
20
+ const match = refString.match(/^(\w+):([^/]+)\/([^#]+)#(.+)$/);
21
+ if (!match) {
22
+ return null;
23
+ }
24
+ const [, host, owner, repo, ref] = match;
25
+ return {
26
+ raw: refString,
27
+ host: host,
28
+ owner: owner,
29
+ repo: repo,
30
+ ref: ref,
31
+ };
32
+ }
33
+ /**
34
+ * Check if a dependency string is a git reference
35
+ */
36
+ export function isGitRef(dep) {
37
+ return /^\w+:[^/]+\/[^#]+#.+$/.test(dep);
38
+ }
39
+ /**
40
+ * Check if a dependency is a mark1russell7 git reference
41
+ */
42
+ export function isMark1Russell7Ref(dep) {
43
+ return dep.includes("mark1russell7/");
44
+ }
45
+ /**
46
+ * Extract mark1russell7 git refs from package.json dependencies
47
+ */
48
+ export function extractMark1Russell7Deps(dependencies) {
49
+ const refs = [];
50
+ for (const [, version] of Object.entries(dependencies)) {
51
+ if (isMark1Russell7Ref(version)) {
52
+ const ref = parseGitRef(version);
53
+ if (ref) {
54
+ refs.push(ref);
55
+ }
56
+ }
57
+ }
58
+ return refs;
59
+ }
60
+ /**
61
+ * Get the package name from a git ref
62
+ * Uses the repo name, optionally scoped with @mark1russell7/
63
+ */
64
+ export function getPackageNameFromRef(ref) {
65
+ // For mark1russell7 repos, the package name is usually @mark1russell7/{repo}
66
+ // But some packages like "client" are unscoped
67
+ // We'll need to check the actual package.json to be sure
68
+ return ref.repo;
69
+ }
70
+ //# sourceMappingURL=ref-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-parser.js","sourceRoot":"","sources":["../../src/git/ref-parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB;IAC3C,+BAA+B;IAC/B,YAAY;IACZ,qCAAqC;IACrC,gCAAgC;IAChC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAE/D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;IAEzC,OAAO;QACL,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,IAAK;QACX,KAAK,EAAE,KAAM;QACb,IAAI,EAAE,IAAK;QACX,GAAG,EAAE,GAAI;KACV,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,OAAO,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,GAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAoC;IAEpC,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACvD,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,GAAG,EAAE,CAAC;gBACR,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,6EAA6E;IAC7E,+CAA+C;IAC/C,yDAAyD;IACzD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @procedures/lib
3
+ *
4
+ * Library management procedures for the workspace - scan, new, audit, rename.
5
+ */
6
+ import "./register.js";
7
+ export * from "./types.js";
8
+ export { libScan, libRename, libNew, libAudit, } from "./procedures/lib/index.js";
9
+ export { ecosystemProcedures, EcosystemProceduresInputSchema, } from "./procedures/ecosystem/index.js";
10
+ export type { EcosystemProceduresInput, EcosystemProceduresOutput, ProcedureInfo, PackageProcedures, } from "./procedures/ecosystem/index.js";
11
+ export { buildDAGNodes, filterDAGFromRoot, getAncestors, getDescendants, buildLeveledDAG, getTopologicalOrder, visualizeDAG, executeDAG, executeDAGSequential, createProcessor, } from "./dag/index.js";
12
+ export { parseGitRef, isGitRef, isMark1Russell7Ref, extractMark1Russell7Deps, getPackageNameFromRef, } from "./git/index.js";
13
+ export { CLI_GLOBAL_FLAGS, findGlobalFlag, type CliGlobalFlag } from "./cli-flags.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,eAAe,CAAC;AAGvB,cAAc,YAAY,CAAC;AAG3B,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,aAAa,EACb,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @procedures/lib
3
+ *
4
+ * Library management procedures for the workspace - scan, new, audit, rename.
5
+ */
6
+ // Importing the package registers its procedures, as in the other client packages (BUGS-2026-07 H18)
7
+ import "./register.js";
8
+ // Re-export types
9
+ export * from "./types.js";
10
+ // Re-export procedures
11
+ export { libScan, libRename, libNew, libAudit, } from "./procedures/lib/index.js";
12
+ // Re-export ecosystem procedures
13
+ export { ecosystemProcedures, EcosystemProceduresInputSchema, } from "./procedures/ecosystem/index.js";
14
+ // Re-export DAG utilities (ecosystem-specific)
15
+ export { buildDAGNodes, filterDAGFromRoot, getAncestors, getDescendants, buildLeveledDAG, getTopologicalOrder, visualizeDAG, executeDAG, executeDAGSequential, createProcessor, } from "./dag/index.js";
16
+ // Re-export git utilities
17
+ export { parseGitRef, isGitRef, isMark1Russell7Ref, extractMark1Russell7Deps, getPackageNameFromRef, } from "./git/index.js";
18
+ // The global flags of the mark CLI (also at "@procedures/lib/cli-flags", with no side effects)
19
+ export { CLI_GLOBAL_FLAGS, findGlobalFlag } from "./cli-flags.js";
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qGAAqG;AACrG,OAAO,eAAe,CAAC;AAEvB,kBAAkB;AAClB,cAAc,YAAY,CAAC;AAE3B,uBAAuB;AACvB,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,2BAA2B,CAAC;AAEnC,iCAAiC;AACjC,OAAO,EACL,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AAQzC,+CAA+C;AAC/C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,0BAA0B;AAC1B,OAAO,EACL,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB,+FAA+F;AAC/F,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAsB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Module (no side effects): the procedures of this package as data, for `createRegistry()`.
3
+ *
4
+ * Procedure Registration for lib operations
5
+ *
6
+ * This is the canonical home for lib.* procedures.
7
+ * client-cli no longer registers these to avoid duplicates.
8
+ */
9
+ import { type ProcedureModule } from "@procedures/client";
10
+ /**
11
+ * The module of this package, for `createRegistry()`: its procedures as data. Importing this
12
+ * file registers nothing. (`register.ts` registers the same procedures in the global registry.)
13
+ */
14
+ export declare const libModule: ProcedureModule;
15
+ export default libModule;
16
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAA4D,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAmLpH;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,eAYG,CAAC;eAEb,SAAS"}
package/dist/module.js ADDED
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Module (no side effects): the procedures of this package as data, for `createRegistry()`.
3
+ *
4
+ * Procedure Registration for lib operations
5
+ *
6
+ * This is the canonical home for lib.* procedures.
7
+ * client-cli no longer registers these to avoid duplicates.
8
+ */
9
+ import { createProcedure, zodAdapter, RUNS_REFS_TAG, defineModule } from "@procedures/client";
10
+ import gitModule from "@procedures/git/module";
11
+ import fsModule from "@procedures/fs/module";
12
+ import { libScan, libRename, libNew, libAudit, } from "./procedures/lib/index.js";
13
+ import { ecosystemProcedures, EcosystemProceduresInputSchema, EcosystemProceduresOutputSchema, } from "./procedures/ecosystem/index.js";
14
+ import { dagTraverse } from "./procedures/dag/index.js";
15
+ import { coreCatch } from "./procedures/core/index.js";
16
+ import { LibScanInputSchema, LibRenameInputSchema, LibNewInputSchema, LibAuditInputSchema, DagTraverseInputSchema, CoreCatchInputSchema, LibScanOutputSchema, LibRenameOutputSchema, LibNewOutputSchema, LibAuditOutputSchema, DagTraverseOutputSchema, CoreCatchOutputSchema, } from "./types.js";
17
+ // =============================================================================
18
+ // lib.* Procedures
19
+ // =============================================================================
20
+ const libScanProcedure = createProcedure()
21
+ .path(["lib", "scan"])
22
+ .input(zodAdapter(LibScanInputSchema))
23
+ .output(zodAdapter(LibScanOutputSchema))
24
+ .meta({
25
+ description: "Scan for packages in the git directory",
26
+ calls: ["fs.readdir", "fs.read.json", "git.status", "git.remote"],
27
+ args: [],
28
+ shorts: {},
29
+ output: "json",
30
+ })
31
+ .handler(async (input, ctx) => {
32
+ return libScan(input, ctx);
33
+ })
34
+ .build();
35
+ const libRenameProcedure = createProcedure()
36
+ .path(["lib", "rename"])
37
+ .input(zodAdapter(LibRenameInputSchema))
38
+ .output(zodAdapter(LibRenameOutputSchema))
39
+ .meta({
40
+ description: "Rename a package across the ecosystem",
41
+ calls: ["fs.glob", "fs.read.json", "fs.write", "fs.exists"],
42
+ args: ["oldName", "newName"],
43
+ shorts: { dryRun: "n" },
44
+ output: "json",
45
+ })
46
+ .handler(async (input, ctx) => {
47
+ return libRename(input, ctx);
48
+ })
49
+ .build();
50
+ const libNewProcedure = createProcedure()
51
+ .path(["lib", "new"])
52
+ .input(zodAdapter(LibNewInputSchema))
53
+ .output(zodAdapter(LibNewOutputSchema))
54
+ .meta({
55
+ description: "Create a new package in the ecosystem",
56
+ calls: ["shell.run", "fs.exists", "fs.mkdir", "fs.write", "fs.read.json"],
57
+ args: ["name"],
58
+ shorts: { dryRun: "n" },
59
+ output: "json",
60
+ })
61
+ .handler(async (input, ctx) => {
62
+ return libNew(input, ctx);
63
+ })
64
+ .build();
65
+ const libAuditProcedure = createProcedure()
66
+ .path(["lib", "audit"])
67
+ .input(zodAdapter(LibAuditInputSchema))
68
+ .output(zodAdapter(LibAuditOutputSchema))
69
+ .meta({
70
+ description: "Audit ecosystem packages for issues",
71
+ calls: ["fs.readdir", "fs.read.json", "git.status", "git.remote", "fs.exists", "fs.mkdir", "fs.write"],
72
+ args: [],
73
+ shorts: { fix: "f" },
74
+ output: "json",
75
+ })
76
+ .handler(async (input, ctx) => {
77
+ return libAudit(input, ctx);
78
+ })
79
+ .build();
80
+ // =============================================================================
81
+ // ecosystem.* Procedures
82
+ // =============================================================================
83
+ const ecosystemProceduresProcedure = createProcedure()
84
+ .path(["ecosystem", "procedures"])
85
+ .input(zodAdapter(EcosystemProceduresInputSchema))
86
+ .output(zodAdapter(EcosystemProceduresOutputSchema))
87
+ .meta({
88
+ description: "List all procedures across the ecosystem",
89
+ args: [],
90
+ shorts: { namespace: "n" },
91
+ output: "json",
92
+ })
93
+ .handler(async (input, ctx) => {
94
+ return ecosystemProcedures(input, ctx);
95
+ })
96
+ .build();
97
+ // =============================================================================
98
+ // dag.* Procedures
99
+ // =============================================================================
100
+ const dagTraverseProcedure = createProcedure()
101
+ .path(["dag", "traverse"])
102
+ .input(zodAdapter(DagTraverseInputSchema))
103
+ .output(zodAdapter(DagTraverseOutputSchema))
104
+ .meta({
105
+ description: "Traverse ecosystem packages in dependency order, executing visit procedure for each",
106
+ // It runs the procedure refs of its input: a server with an expose rule limits what they call
107
+ tags: [RUNS_REFS_TAG],
108
+ args: [],
109
+ shorts: { root: "r", concurrency: "j", continueOnError: "c", dryRun: "d" },
110
+ output: "streaming",
111
+ })
112
+ .handler(async (input, ctx) => {
113
+ return dagTraverse(input, ctx);
114
+ })
115
+ .build();
116
+ // =============================================================================
117
+ // core.* Procedures
118
+ // =============================================================================
119
+ const coreCatchProcedure = createProcedure()
120
+ .path(["core", "catch"])
121
+ .input(zodAdapter(CoreCatchInputSchema))
122
+ .output(zodAdapter(CoreCatchOutputSchema))
123
+ .meta({
124
+ description: "Execute a procedure with error handling",
125
+ // It runs the procedure refs of its input: a server with an expose rule limits what they call
126
+ tags: [RUNS_REFS_TAG],
127
+ args: [],
128
+ shorts: {},
129
+ output: "json",
130
+ })
131
+ .handler(async (input, ctx) => {
132
+ return coreCatch(input, ctx);
133
+ })
134
+ .build();
135
+ // =============================================================================
136
+ // Registration
137
+ // =============================================================================
138
+ /**
139
+ * The module of this package, for `createRegistry()`: its procedures as data. Importing this
140
+ * file registers nothing. (`register.ts` registers the same procedures in the global registry.)
141
+ */
142
+ export const libModule = defineModule("@procedures/lib", [
143
+ // lib.* procedures (canonical home)
144
+ libScanProcedure,
145
+ libRenameProcedure,
146
+ libNewProcedure,
147
+ libAuditProcedure,
148
+ // ecosystem.* procedures
149
+ ecosystemProceduresProcedure,
150
+ // dag.* procedures (canonical home)
151
+ dagTraverseProcedure,
152
+ // core.* procedures
153
+ coreCatchProcedure,
154
+ ], [fsModule, gitModule]);
155
+ export default libModule;
156
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAwB,MAAM,oBAAoB,CAAC;AACpH,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,QAAQ,MAAM,uB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4B;IAC5B,oCAAoC;IACpC,oBAAoB;IACpB,oBAAoB;IACpB,kBAAkB;CACnB,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAE5B,eAAe,SAAS,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * core.catch procedure
3
+ *
4
+ * Wraps a procedure execution with error handling.
5
+ * The `try` procedure ref should use `$when: "catch"` so it's not
6
+ * executed during hydration but instead by this procedure.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * {
11
+ * $proc: ["core", "catch"],
12
+ * input: {
13
+ * try: {
14
+ * $proc: ["git", "commit"],
15
+ * input: { message: "auto" },
16
+ * $when: "catch" // Defer execution to catch procedure
17
+ * },
18
+ * handler: {
19
+ * $proc: ["core", "identity"],
20
+ * input: { value: { continue: true } },
21
+ * $when: "catch"
22
+ * }
23
+ * }
24
+ * }
25
+ * ```
26
+ */
27
+ import type { ProcedureContext } from "@procedures/client";
28
+ import type { CoreCatchInput, CoreCatchOutput } from "../../types.js";
29
+ /**
30
+ * Execute a procedure with error handling
31
+ */
32
+ export declare function coreCatch(input: CoreCatchInput, ctx: ProcedureContext): Promise<CoreCatchOutput>;
33
+ //# sourceMappingURL=catch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catch.d.ts","sourceRoot":"","sources":["../../../src/procedures/core/catch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,oBAAoB,CAAC;AAS1E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;GAEG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,cAAc,EACrB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,eAAe,CAAC,CAiG1B"}