@intentius/chant 0.124.26 → 0.124.27

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.
@@ -4,8 +4,11 @@
4
4
  *
5
5
  * The base activities are core's own (`./activities`): plain async functions
6
6
  * taking a single args object, with no workflow engine anywhere in the call
7
- * path. They are imported statically, so `loadActivities([])` works in a
8
- * project that has installed nothing but chant. Product-specific appliers stay
7
+ * path. They ship with core, so `loadActivities([])` works in a project that
8
+ * has installed nothing but chant. They are imported when activities are
9
+ * loaded, not when this module is: their implementations reach lint, codegen
10
+ * and `typescript`, and every `*.op.ts` imports `@intentius/chant/op`, which
11
+ * re-exports this module (#3982). Product-specific appliers stay
9
12
  * in their owning lexicon (#809) and are pulled in dynamically per the
10
13
  * project's configured lexicon list.
11
14
  */
@@ -40,7 +43,7 @@ export declare const ACTIVITY_FALLBACKS_EXPORT = "ACTIVITY_FALLBACKS";
40
43
  * lexicon's activity of the same name; otherwise a later lexicon's export
41
44
  * replaces an earlier one's.
42
45
  *
43
- * Never throws: the base library is a static import, so there is no "no
46
+ * Never throws: the base library ships with core, so there is no "no
44
47
  * activities registered" state to report.
45
48
  */
46
49
  export declare function loadActivities(lexicons?: string[]): Promise<Map<string, ActivityFn>>;
@@ -1 +1 @@
1
- {"version":3,"file":"activity-registry.d.ts","sourceRoot":"","sources":["../../src/op/activity-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG9E,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEnG;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,uBAAuB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4,14 @@
4
4
  *
5
5
  * The base activities are core's own (`./activities`): plain async functions
6
6
  * taking a single args object, with no workflow engine anywhere in the call
7
- * path. They are imported statically, so `loadActivities([])` works in a
8
- * project that has installed nothing but chant. Product-specific appliers stay
7
+ * path. They ship with core, so `loadActivities([])` works in a project that
8
+ * has installed nothing but chant. They are imported when activities are
9
+ * loaded, not when this module is: their implementations reach lint, codegen
10
+ * and `typescript`, and every `*.op.ts` imports `@intentius/chant/op`, which
11
+ * re-exports this module (#3982). Product-specific appliers stay
9
12
  * in their owning lexicon (#809) and are pulled in dynamically per the
10
13
  * project's configured lexicon list.
11
14
  */
12
- import * as baseActivities from "./activities/index.js";
13
15
  import { ACTIVITY_PROFILES } from "./activity-profiles.js";
14
16
  import { importLexiconModule, importLexiconPackage } from "../lexicon-module.js";
15
17
  /**
@@ -51,12 +53,12 @@ function collectActivities(mod, into) {
51
53
  * lexicon's activity of the same name; otherwise a later lexicon's export
52
54
  * replaces an earlier one's.
53
55
  *
54
- * Never throws: the base library is a static import, so there is no "no
56
+ * Never throws: the base library ships with core, so there is no "no
55
57
  * activities registered" state to report.
56
58
  */
57
59
  export async function loadActivities(lexicons = []) {
58
60
  const activities = new Map();
59
- collectActivities(baseActivities, activities);
61
+ collectActivities((await import("./activities/index.js")), activities);
60
62
  for (const name of lexicons) {
61
63
  try {
62
64
  // chant #2520 — a lexicon declared by module path has no subpath to
@@ -1 +1 @@
1
- {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/op/discover.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC,OAAO,EAAwB,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI1E,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IACh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,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA6CrF;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACzC,wCAAwC;IACxC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,2GAA2G;IAC3G,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA2C/F"}
@@ -41,21 +41,28 @@ async function findDiscoveryRoot(cwd) {
41
41
  }
42
42
  return gitRoot;
43
43
  }
44
+ const isOpFile = (name, full) => name.endsWith(".op.ts") && !name.endsWith(".test.ts") && !name.endsWith(".spec.ts") && !hasDiscoveryMarkerSync(full);
44
45
  /**
45
46
  * Every `*.op.ts` file below the Op root, through the one discovery walk
46
47
  * (`../discovery/walk.ts`, #2527). The walk down stops at child projects
47
48
  * whatever the root is, so a configless layout whose Op root is the git root
48
49
  * no longer collects its sibling projects' Ops. The project's
49
50
  * `exclude`/`include` globs and the skip marker apply.
51
+ *
52
+ * The globs come from evaluating the project config, which registers tsx
53
+ * (#3976), so they are resolved only when an Op file could be found. A walk
54
+ * that includes `**` first reaches every path any `include` could re-admit,
55
+ * and stops at the first Op file. When it finds none, no globs could find
56
+ * one either.
50
57
  */
51
58
  async function collectOpFiles(root) {
52
- return walkDiscovery({
53
- walker: "ops",
54
- root,
55
- globs: await resolveDiscoveryGlobs(root),
56
- excludeDirs: await workspaceMemberDirs(root),
57
- accept: (name, full) => name.endsWith(".op.ts") && !name.endsWith(".test.ts") && !name.endsWith(".spec.ts") && !hasDiscoveryMarkerSync(full),
58
- });
59
+ const excludeDirs = await workspaceMemberDirs(root);
60
+ // A limit of 0 ends the walk at the first file it accepts.
61
+ const any = { max: 0, truncated: false };
62
+ walkDiscovery({ walker: "ops", root, globs: { root, exclude: [], include: ["**"] }, excludeDirs, limit: any, accept: isOpFile });
63
+ if (!any.truncated)
64
+ return [];
65
+ return walkDiscovery({ walker: "ops", root, globs: await resolveDiscoveryGlobs(root), excludeDirs, accept: isOpFile });
59
66
  }
60
67
  /** The `OpConfig` behind an exported value, or `undefined` when the value is not an Op. An Op entity carries its config on `.props` (`./resource.ts`); `name` and `phases` are what every consumer of a discovered Op reads. */
61
68
  function opConfigOf(value) {
@@ -1 +1 @@
1
- {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/op/runtimes/local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAaH,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AA0CpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,iBAAiB,CA8J3F"}
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/op/runtimes/local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAYH,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AA0CpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,iBAAiB,CAiK3F"}
@@ -24,7 +24,6 @@ import { runOpLocally, OpRunFailure } from "../local-executor.js";
24
24
  import { loadActivityContracts } from "../activity-contract-registry.js";
25
25
  import { resumeGatesOf } from "../gate-checkpoint.js";
26
26
  import { stepHeartbeatMs } from "../step-console.js";
27
- import { runComponents } from "../../components/cli-support.js";
28
27
  import { discoverOps } from "../discover.js";
29
28
  import { readRunLedger, runEnvOf, DEFAULT_RUN_ENV } from "../../lifecycle/run-ledger.js";
30
29
  import { runStateOf, } from "../runtime.js";
@@ -199,7 +198,10 @@ export function createLocalOpRuntime(opts = {}) {
199
198
  throw new Error(`the local runtime runs "${op}" in the foreground — there is no detached run to cancel. ` +
200
199
  `Press Ctrl-C in the terminal running it, or pass --on <lexicon> for a hosted run.`);
201
200
  },
202
- runComponents(path, selector, options) {
201
+ async runComponents(path, selector, options) {
202
+ // Imported here, not at the top: the components driver is most of core's components tree, and this module is
203
+ // re-exported by `@intentius/chant/op`, which every `*.op.ts` imports (#3982).
204
+ const { runComponents } = await import("../../components/cli-support.js");
203
205
  return runComponents(path, selector, options);
204
206
  },
205
207
  };