@clemrig/factory 0.2.0 → 0.2.1

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.
@@ -1,6 +1,2 @@
1
+ export { npmInstall as installFactory } from "../system/npm.js";
1
2
  export { createFromTemplates as createFactory } from "../system/templates.js";
2
- /** Installs `.factory/`'s dependencies; `output` explains a failure. */
3
- export declare function installFactory(factoryDir: string): Promise<{
4
- ok: boolean;
5
- output: string;
6
- }>;
package/dist/app/init.js CHANGED
@@ -1,15 +1,3 @@
1
- import { runProcess } from "@clemrig/flow";
1
+ export { npmInstall as installFactory } from "../system/npm.js";
2
2
  export { createFromTemplates as createFactory } from "../system/templates.js";
3
- /** Installs `.factory/`'s dependencies; `output` explains a failure. */
4
- export async function installFactory(factoryDir) {
5
- const install = await runProcess(["npm", "install", "--no-audit", "--no-fund"], factoryDir, 600_000).catch((error) => ({
6
- exitCode: 1,
7
- stdout: "",
8
- stderr: error instanceof Error ? error.message : String(error),
9
- }));
10
- return {
11
- ok: install.exitCode === 0,
12
- output: install.stderr || install.stdout,
13
- };
14
- }
15
3
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/app/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE9E,wEAAwE;AACxE,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,UAAkB;IAElB,MAAM,OAAO,GAAG,MAAM,UAAU,CAC9B,CAAC,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,CAAC,EAC7C,UAAU,EACV,OAAO,CACR,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;QAC3B,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAC/D,CAAC,CAAC,CAAC;IACJ,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,QAAQ,KAAK,CAAC;QAC1B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM;KACzC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/app/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1,4 +1,8 @@
1
- import type { RunState } from "@clemrig/flow";
1
+ import type { RunEntry, RunState } from "@clemrig/flow";
2
2
  import type { Factory } from "../system/factory.js";
3
+ /** The repository's runs, in creation order; an unreadable run comes with its error. */
4
+ export declare function listRuns(factory: Factory): Promise<RunEntry[]>;
5
+ /** One run of the repository; an unknown ID is refused. */
6
+ export declare function loadRun(factory: Factory, id: string): Promise<RunState>;
3
7
  /** A run's result lines: its workflow's rendering, or its validated data when the workflow left `factory.ts`. */
4
8
  export declare function presentResult(factory: Factory, state: Readonly<RunState>): string[];
package/dist/app/runs.js CHANGED
@@ -1,4 +1,12 @@
1
1
  import * as flow from "@clemrig/flow";
2
+ /** The repository's runs, in creation order; an unreadable run comes with its error. */
3
+ export function listRuns(factory) {
4
+ return flow.listRuns(factory.runsDir);
5
+ }
6
+ /** One run of the repository; an unknown ID is refused. */
7
+ export function loadRun(factory, id) {
8
+ return flow.loadRun(factory.runsDir, id);
9
+ }
2
10
  /** A run's result lines: its workflow's rendering, or its validated data when the workflow left `factory.ts`. */
3
11
  export function presentResult(factory, state) {
4
12
  return flow.presentResult(factory.workflows.get(state.workflow), state);
@@ -1 +1 @@
1
- {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/app/runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAItC,iHAAiH;AACjH,MAAM,UAAU,aAAa,CAC3B,OAAgB,EAChB,KAAyB;IAEzB,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;AAC1E,CAAC"}
1
+ {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/app/runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAItC,wFAAwF;AACxF,MAAM,UAAU,QAAQ,CAAC,OAAgB;IACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,OAAO,CAAC,OAAgB,EAAE,EAAU;IAClD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,aAAa,CAC3B,OAAgB,EAChB,KAAyB;IAEzB,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;AAC1E,CAAC"}
@@ -1,11 +1,11 @@
1
- import { listRuns, loadRun } from "@clemrig/flow";
1
+ import { listRuns, loadRun } from "../app/runs.js";
2
2
  /** Every run of the repository, or one run. */
3
3
  export async function status(factory, reporter, runId) {
4
4
  if (runId) {
5
- reporter.result(await loadRun(factory.runsDir, runId));
5
+ reporter.result(await loadRun(factory, runId));
6
6
  return 0;
7
7
  }
8
- for (const entry of await listRuns(factory.runsDir))
8
+ for (const entry of await listRuns(factory))
9
9
  if ("state" in entry)
10
10
  reporter.result(entry.state);
11
11
  else
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sour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E,KAAK,CAAC,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Installs the dependencies of the package in `dir`; `output` explains a failure. */
2
+ export declare function npmInstall(dir: string): Promise<{
3
+ ok: boolean;
4
+ output: string;
5
+ }>;
@@ -0,0 +1,14 @@
1
+ import { runProcess } from "@clemrig/flow";
2
+ /** Installs the dependencies of the package in `dir`; `output` explains a failure. */
3
+ export async function npmInstall(dir) {
4
+ const install = await runProcess(["npm", "install", "--no-audit", "--no-fund"], dir, 600_000).catch((error) => ({
5
+ exitCode: 1,
6
+ stdout: "",
7
+ stderr: error instanceof Error ? error.message : String(error),
8
+ }));
9
+ return {
10
+ ok: install.exitCode === 0,
11
+ output: install.stderr || install.stdout,
12
+ };
13
+ }
14
+ //# sourceMappingURL=npm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm.js","sourceRoot":"","sources":["../../src/system/npm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,sFAAsF;AACtF,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,GAAW;IAEX,MAAM,OAAO,GAAG,MAAM,UAAU,CAC9B,CAAC,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,CAAC,EAC7C,GAAG,EACH,OAAO,CACR,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;QAC3B,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAC/D,CAAC,CAAC,CAAC;IACJ,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,QAAQ,KAAK,CAAC;QAC1B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM;KACzC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clemrig/factory",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Write agent workflows in TypeScript inside any repository, run them in the terminal and watch them in a local dashboard",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "prepack": "npm run build"
39
39
  },
40
40
  "dependencies": {
41
- "@clemrig/flow": "0.1.0",
42
- "@clemrig/flow-ui": "0.1.0"
41
+ "@clemrig/flow": "0.2.0",
42
+ "@clemrig/flow-ui": "0.1.1"
43
43
  }
44
44
  }