@amykit/plugin-plan-check 0.5.0 → 0.7.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.
package/README.md CHANGED
@@ -6,11 +6,23 @@ The quality bar for a drafted plan: the repository's own check, run in its check
6
6
 
7
7
  A plugin for [amy](https://github.com/nicolasmelo1/amy). It provides the `plan-check` port.
8
8
 
9
+ Use it with note-to-plan, which checks every plan it drafts before proposing it. It mounts the plan-check port and the check-plan action, and runs the repository's own check commands in the plan's checkout, so a plan only goes forward once the repository's own bar passes.
10
+
11
+ ## What it extends
12
+
13
+ | | |
14
+ | :-- | :-- |
15
+ | Ports | `plan-check` |
16
+ | Actions | `check-plan` |
17
+ | Operations | _none_ |
18
+ | Commands | _none_ |
19
+ | Events | _none_ |
20
+ | Environment | _none_ |
21
+
9
22
  ## Install
10
23
 
11
24
  ```sh
12
- # Add @amykit/plugin-plan-check to amy.yaml, then install configured plugins:
13
- amy init --install
25
+ amy add @amykit/plugin-plan-check
14
26
  ```
15
27
 
16
28
  Then name it in `~/.amy/config.yaml`:
@@ -27,6 +39,7 @@ workflows:
27
39
  ```yaml
28
40
  plugins:
29
41
  "@amykit/plugin-plan-check":
42
+ baseBranch: {}
30
43
  commands: {"default":["sf check"]}
31
44
  defaultBranch: "main"
32
45
  timeoutMs: 600000
@@ -34,8 +47,9 @@ plugins:
34
47
 
35
48
  | Setting | Type | Required | Default | What it is |
36
49
  | :-- | :-- | :-- | :-- | :-- |
50
+ | `baseBranch` | `record` | no | `{}` | where one repository's base branch is, instead of the fallback. A repository named here has its work cut from, and its pull requests opened against, that branch |
37
51
  | `commands` | `record` | no | `{"default":["sf check"]}` | the check commands per repository, with a `default` fallback. `sf check` is the whole quality bar in a repository that has one |
38
- | `defaultBranch` | `string` | no | `main` | the branch a plan branch is cut from, which is not always `main` |
52
+ | `defaultBranch` | `string` | no | `main` | the branch new work is cut from, for a repository that named none, which is not always `main` |
39
53
  | `timeoutMs` | `number` | no | `600000` | how long one check may run before it is given up on |
40
54
 
41
55
  Every field is checked at boot against the schema this package declares. A key that is
@@ -44,7 +58,7 @@ silently never applied.
44
58
 
45
59
  ## Where the reasoning is
46
60
 
47
- - [Writing a plugin](https://github.com/nicolasmelo1/amy/tree/main/docs/build/write-a-plugin.md)
61
+ - [Writing a plugin](https://github.com/nicolasmelo1/amy/tree/main/docs/guides/write-a-plugin.md)
48
62
  - [Reference: plugins](https://github.com/nicolasmelo1/amy/tree/main/docs/reference/plugins.md)
49
63
  - [Ports and the registry](https://github.com/nicolasmelo1/amy/tree/main/docs/concepts/ports.md)
50
64
 
package/dist/config.d.ts CHANGED
@@ -1,4 +1,26 @@
1
- import { ConfigSchema } from "@amykit/core";
2
1
  /** What this plugin needs told to it, and nothing more. */
3
- export declare const configSchema: ConfigSchema;
2
+ export declare const configSchema: {
3
+ commands: {
4
+ type: "record";
5
+ description: string;
6
+ default: {
7
+ default: string[];
8
+ };
9
+ };
10
+ timeoutMs: {
11
+ type: "number";
12
+ description: string;
13
+ default: number;
14
+ };
15
+ defaultBranch: {
16
+ readonly type: "string";
17
+ readonly description: "the branch new work is cut from, for a repository that named none, which is not always `main`";
18
+ readonly default: "main";
19
+ };
20
+ baseBranch: {
21
+ readonly type: "record";
22
+ readonly description: "where one repository's base branch is, instead of the fallback. A repository named here has its work cut from, and its pull requests opened against, that branch";
23
+ readonly default: {};
24
+ };
25
+ };
4
26
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,2DAA2D;AAC3D,eAAO,MAAM,YAAY,EAAE,YAiB1B,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;CAaD,CAAC"}
package/dist/config.js CHANGED
@@ -1,10 +1,7 @@
1
+ import { BRANCH_SETTINGS } from "@amykit/core";
1
2
  /** What this plugin needs told to it, and nothing more. */
2
3
  export const configSchema = {
3
- defaultBranch: {
4
- type: "string",
5
- description: "the branch a plan branch is cut from, which is not always `main`",
6
- default: "main",
7
- },
4
+ ...BRANCH_SETTINGS,
8
5
  commands: {
9
6
  type: "record",
10
7
  description: "the check commands per repository, with a `default` fallback. `sf check` is the whole quality bar in a repository that has one",
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,kEAAkE;QAC/E,OAAO,EAAE,MAAM;KAChB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,gIAAgI;QAClI,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE;KACnC;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;KACxB;CACF,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgB,MAAM,cAAc,CAAC;AAE7D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,eAAe;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,gIAAgI;QAClI,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE;KACnC;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;KACxB;CACqB,CAAC"}
package/dist/plugin.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import { Plugin } from "@amykit/core";
2
- export declare const plugin: Plugin;
1
+ export declare const plugin: import("@amykit/core").Plugin;
3
2
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,MAAM,EAAY,MAAM,cAAc,CAAC;AAIrD,eAAO,MAAM,MAAM,EAAE,MAgCpB,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,+BAsBjB,CAAC"}
package/dist/plugin.js CHANGED
@@ -1,20 +1,13 @@
1
- import { Git } from "@amykit/core";
1
+ import { definePlugin } from "@amykit/core";
2
2
  import { PlanCommandCheck } from "./PlanCommandCheck.js";
3
3
  import { configSchema } from "./config.js";
4
- export const plugin = {
4
+ export const plugin = definePlugin({
5
5
  name: "@amykit/plugin-plan-check",
6
- version: "0.1.0",
7
6
  configSchema,
8
7
  register(registry, ctx) {
9
- const git = new Git(ctx.runner, {
10
- workspaceRoot: ctx.paths.workspace,
11
- checkouts: ctx.paths.checkouts,
12
- defaultBranch: ctx.config.defaultBranch,
13
- baseBranch: ctx.config.baseBranch,
14
- },
15
8
  // The gate (and the agent it hands paths to) runs where the work runs:
16
9
  // with a worktree port mounted, that is the item's own tree.
17
- ctx.port("worktree"));
10
+ const { git } = ctx.checkouts();
18
11
  // The action and the port together, which is what the registry asks of a
19
12
  // plugin adding an action the core does not ship: an action nobody can
20
13
  // execute is a promise the machine cannot keep. `check-plan` is not in
@@ -25,5 +18,5 @@ export const plugin = {
25
18
  timeoutMs: ctx.config.timeoutMs,
26
19
  }));
27
20
  },
28
- };
21
+ });
29
22
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","source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zD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAsB;IACtD,IAAI,EAAE,2BAA2B;IACjC,YAAY;IACZ,QAAQ,CAAC,QAAQ,EAAE,GAAG;QACpB,uEAAuE;QACvE,6DAA6D;QAC7D,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAEhC,yEAAyE;QACzE,uEAAuE;QACvE,uEAAuE;QACvE,qEAAqE;QACrE,0DAA0D;QAC1D,QAAQ,CAAC,MAAM,CACb,YAAY,EACZ,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,EACvC,IAAI,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE;YACpC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,QAAoC;YACzD,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS;SAChC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amykit/plugin-plan-check",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "The quality bar for a drafted plan: the repository's own check, run in its checkout.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -27,9 +27,12 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
+ "amy": {
31
+ "about": "Use it with note-to-plan, which checks every plan it drafts before proposing it. It mounts the plan-check port and the check-plan action, and runs the repository's own check commands in the plan's checkout, so a plan only goes forward once the repository's own bar passes."
32
+ },
30
33
  "dependencies": {
31
- "@amykit/core": "^0.5.0",
32
- "@amykit/workflow-note-to-plan": "^0.5.0"
34
+ "@amykit/core": "^0.7.0",
35
+ "@amykit/workflow-note-to-plan": "^0.7.0"
33
36
  },
34
37
  "devDependencies": {
35
38
  "@amykit/test-fixtures": "^0.1.0"