@plainconceptsplatform/workflows 0.1.2 → 0.1.5

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 (67) hide show
  1. package/README.md +28 -10
  2. package/dist/catalog-installation.d.ts +3 -2
  3. package/dist/catalog-installation.js +26 -6
  4. package/dist/catalog-installation.test.js +104 -10
  5. package/dist/catalog-listing.d.ts +13 -0
  6. package/dist/catalog-listing.js +68 -0
  7. package/dist/catalog-listing.test.d.ts +1 -0
  8. package/dist/catalog-listing.test.js +137 -0
  9. package/dist/index.js +62 -11
  10. package/dist/index.test.d.ts +1 -0
  11. package/dist/index.test.js +112 -0
  12. package/dist/repository-inspection.test.d.ts +1 -0
  13. package/dist/repository-inspection.test.js +77 -0
  14. package/dist/workflow-catalog.d.ts +9 -7
  15. package/dist/workflow-catalog.js +21 -16
  16. package/dist/workflow-catalog.test.js +18 -3
  17. package/loops/actions/add-issue-labels/action.yml +30 -29
  18. package/loops/actions/agent-output.cjs +1 -0
  19. package/loops/actions/apply-agent-bundle/action.yml +24 -23
  20. package/loops/actions/apply-agent-bundle/apply-bundle.sh +1 -0
  21. package/loops/actions/apply-agent-comments/action.yml +42 -41
  22. package/loops/actions/apply-agent-labels/action.yml +55 -54
  23. package/loops/actions/apply-agent-output/action.yml +108 -107
  24. package/loops/actions/audit-close/action.yml +104 -103
  25. package/loops/actions/classify-route/action.yml +91 -90
  26. package/loops/actions/classify-route/classify-route.sh +1 -0
  27. package/loops/actions/cleanup-artifacts/action.yml +65 -64
  28. package/loops/actions/close-agent-issues/action.yml +43 -42
  29. package/loops/actions/create-agent-issues/action.yml +52 -51
  30. package/loops/actions/create-issue-comment/action.yml +29 -28
  31. package/loops/actions/download-agent-output/action.yml +53 -52
  32. package/loops/actions/identify-gate-subject/action.yml +97 -96
  33. package/loops/actions/link-pr-to-issue/action.yml +40 -39
  34. package/loops/actions/list-open-issues/action.yml +33 -32
  35. package/loops/actions/load-issue-context/action.yml +43 -42
  36. package/loops/actions/merge-agent-pr/action.yml +36 -35
  37. package/loops/actions/push-agent-branch/action.yml +45 -44
  38. package/loops/actions/remove-issue-labels/action.yml +35 -34
  39. package/loops/actions/stale-recovery/action.yml +288 -287
  40. package/loops/actions/update-agent-issues/action.yml +58 -57
  41. package/loops/actions/validate-refine-output/action.yml +44 -43
  42. package/loops/actions/validate-refine-output/validate-refine-output.sh +1 -0
  43. package/loops/actions/verify-composite-actions/action.yml +9 -8
  44. package/loops/actions/verify-composite-actions/verify-composite-actions.sh +1 -0
  45. package/loops/actions/verify-refine-output/action.yml +9 -8
  46. package/loops/actions/verify-refine-output/verify-refine-output.sh +1 -0
  47. package/loops/actions/verify-route-matrix/action.yml +9 -8
  48. package/loops/actions/verify-route-matrix/verify-route-matrix.sh +1 -0
  49. package/loops/scripts/compile-agent-workflows.mjs +18 -2
  50. package/loops/templates/agentics/agentics-checks.yml +86 -0
  51. package/loops/templates/agentics/agentics-maintenance.yml +121 -0
  52. package/loops/templates/ci/app-ci-dotnet-next.yml +167 -0
  53. package/loops/templates/ci/app-ci-node-monorepo.yml +178 -0
  54. package/loops/templates/opencode/opencode.ci.json +46 -0
  55. package/loops/templates/opencode/opencode.ci.json.md +41 -0
  56. package/loops/workflows/agent-apply-review.md +9 -10
  57. package/loops/workflows/agent-audit.md +6 -7
  58. package/loops/workflows/agent-direct.md +7 -8
  59. package/loops/workflows/agent-implement.md +7 -8
  60. package/loops/workflows/agent-merge-gate.md +9 -10
  61. package/loops/workflows/agent-propose.md +7 -8
  62. package/loops/workflows/agent-refine.md +5 -7
  63. package/loops/workflows/shared/opencode-ci.md +1 -0
  64. package/loops/workflows/shared/platform-defaults.md +1 -0
  65. package/loops/workflows/work-router.yml +1 -0
  66. package/package.json +2 -2
  67. package/loops/aw/repo-config.md +0 -12
@@ -1,64 +1,65 @@
1
- name: Clean up artifacts
2
- description: Delete workflow artifacts older than the configured retention period.
3
- inputs:
4
- token:
5
- description: GitHub token with actions write access.
6
- required: true
7
- artifact-retention-days:
8
- description: Retention period in days. Invalid or empty values use 3.
9
- required: false
10
- default: ''
11
- runs:
12
- using: composite
13
- steps:
14
- - name: Delete expired artifacts
15
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
16
- env:
17
- ARTIFACT_RETENTION_DAYS: ${{ inputs.artifact-retention-days }}
18
- with:
19
- github-token: ${{ inputs.token }}
20
- script: |
21
- const parsedDays = Number.parseInt(process.env.ARTIFACT_RETENTION_DAYS, 10);
22
- const days = Number.isInteger(parsedDays) && parsedDays > 0 ? parsedDays : 3;
23
- const cutoff = new Date(Date.now() - days * 24 * 60 * 60 * 1000);
24
-
25
- core.info(`Retention: ${days} days (cutoff ${cutoff.toISOString()})`);
26
-
27
- const artifacts = await github.paginate(github.rest.actions.listArtifactsForRepo, {
28
- ...context.repo,
29
- per_page: 100,
30
- });
31
-
32
- const expired = artifacts.filter((artifact) => new Date(artifact.created_at) < cutoff);
33
-
34
- let deleted = 0;
35
- const failed = [];
36
-
37
- for (const artifact of expired) {
38
- try {
39
- await github.rest.actions.deleteArtifact({
40
- ...context.repo,
41
- artifact_id: artifact.id,
42
- });
43
-
44
- core.info(`Deleted ${artifact.name} (created ${artifact.created_at})`);
45
- deleted += 1;
46
- } catch (error) {
47
- core.warning(`Could not delete ${artifact.name} (${artifact.id}): ${error.message}`);
48
- failed.push(artifact.name);
49
- }
50
- }
51
-
52
- await core.summary
53
- .addHeading('Artifact cleanup', 2)
54
- .addList([
55
- `Retention: ${days} days (cutoff ${cutoff.toISOString()})`,
56
- `Deleted: ${deleted}`,
57
- `Failed to delete: ${failed.length}`,
58
- `Within retention: ${artifacts.length - expired.length}`,
59
- ])
60
- .write();
61
-
62
- if (failed.length > 0) {
63
- core.setFailed(`${failed.length} artifact(s) could not be deleted: ${failed.join(', ')}`);
64
- }
1
+ # Managed by @plainconceptsplatform/workflows. Source: loops/actions/cleanup-artifacts/action.yml. Update with workflows update --force; consumer edits may be overwritten.
2
+ name: Clean up artifacts
3
+ description: Delete workflow artifacts older than the configured retention period.
4
+ inputs:
5
+ token:
6
+ description: GitHub token with actions write access.
7
+ required: true
8
+ artifact-retention-days:
9
+ description: Retention period in days. Invalid or empty values use 3.
10
+ required: false
11
+ default: ''
12
+ runs:
13
+ using: composite
14
+ steps:
15
+ - name: Delete expired artifacts
16
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
17
+ env:
18
+ ARTIFACT_RETENTION_DAYS: ${{ inputs.artifact-retention-days }}
19
+ with:
20
+ github-token: ${{ inputs.token }}
21
+ script: |
22
+ const parsedDays = Number.parseInt(process.env.ARTIFACT_RETENTION_DAYS, 10);
23
+ const days = Number.isInteger(parsedDays) && parsedDays > 0 ? parsedDays : 3;
24
+ const cutoff = new Date(Date.now() - days * 24 * 60 * 60 * 1000);
25
+
26
+ core.info(`Retention: ${days} days (cutoff ${cutoff.toISOString()})`);
27
+
28
+ const artifacts = await github.paginate(github.rest.actions.listArtifactsForRepo, {
29
+ ...context.repo,
30
+ per_page: 100,
31
+ });
32
+
33
+ const expired = artifacts.filter((artifact) => new Date(artifact.created_at) < cutoff);
34
+
35
+ let deleted = 0;
36
+ const failed = [];
37
+
38
+ for (const artifact of expired) {
39
+ try {
40
+ await github.rest.actions.deleteArtifact({
41
+ ...context.repo,
42
+ artifact_id: artifact.id,
43
+ });
44
+
45
+ core.info(`Deleted ${artifact.name} (created ${artifact.created_at})`);
46
+ deleted += 1;
47
+ } catch (error) {
48
+ core.warning(`Could not delete ${artifact.name} (${artifact.id}): ${error.message}`);
49
+ failed.push(artifact.name);
50
+ }
51
+ }
52
+
53
+ await core.summary
54
+ .addHeading('Artifact cleanup', 2)
55
+ .addList([
56
+ `Retention: ${days} days (cutoff ${cutoff.toISOString()})`,
57
+ `Deleted: ${deleted}`,
58
+ `Failed to delete: ${failed.length}`,
59
+ `Within retention: ${artifacts.length - expired.length}`,
60
+ ])
61
+ .write();
62
+
63
+ if (failed.length > 0) {
64
+ core.setFailed(`${failed.length} artifact(s) could not be deleted: ${failed.join(', ')}`);
65
+ }
@@ -1,42 +1,43 @@
1
- name: Close agent issues
2
- description: Close every close_issue item from agent_output.json.
3
- inputs:
4
- output-file:
5
- description: Path to agent_output.json.
6
- required: true
7
- token:
8
- description: GitHub token with issues:write.
9
- required: true
10
- runs:
11
- using: composite
12
- steps:
13
- - name: Close issues
14
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
15
- env:
16
- AGENT_OUTPUT_LIB: ${{ github.action_path }}/../agent-output.cjs
17
- OUTPUT_FILE: ${{ inputs.output-file }}
18
- with:
19
- github-token: ${{ inputs.token }}
20
- script: |
21
- const { readAgentItems } = require(process.env.AGENT_OUTPUT_LIB);
22
- const items = readAgentItems(process.env.OUTPUT_FILE, 'close_issue');
23
-
24
- let closed = 0;
25
-
26
- for (const item of items) {
27
- if (!item.item_number) {
28
- core.warning(`close_issue item has no item_number, skipping: ${JSON.stringify(item)}`);
29
- continue;
30
- }
31
-
32
- await github.rest.issues.update({
33
- ...context.repo,
34
- issue_number: Number(item.item_number),
35
- state: 'closed',
36
- state_reason: item.state_reason === 'not_planned' ? 'not_planned' : 'completed',
37
- });
38
-
39
- closed += 1;
40
- }
41
-
42
- core.info(`Closed ${closed} issue(s).`);
1
+ # Managed by @plainconceptsplatform/workflows. Source: loops/actions/close-agent-issues/action.yml. Update with workflows update --force; consumer edits may be overwritten.
2
+ name: Close agent issues
3
+ description: Close every close_issue item from agent_output.json.
4
+ inputs:
5
+ output-file:
6
+ description: Path to agent_output.json.
7
+ required: true
8
+ token:
9
+ description: GitHub token with issues:write.
10
+ required: true
11
+ runs:
12
+ using: composite
13
+ steps:
14
+ - name: Close issues
15
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
16
+ env:
17
+ AGENT_OUTPUT_LIB: ${{ github.action_path }}/../agent-output.cjs
18
+ OUTPUT_FILE: ${{ inputs.output-file }}
19
+ with:
20
+ github-token: ${{ inputs.token }}
21
+ script: |
22
+ const { readAgentItems } = require(process.env.AGENT_OUTPUT_LIB);
23
+ const items = readAgentItems(process.env.OUTPUT_FILE, 'close_issue');
24
+
25
+ let closed = 0;
26
+
27
+ for (const item of items) {
28
+ if (!item.item_number) {
29
+ core.warning(`close_issue item has no item_number, skipping: ${JSON.stringify(item)}`);
30
+ continue;
31
+ }
32
+
33
+ await github.rest.issues.update({
34
+ ...context.repo,
35
+ issue_number: Number(item.item_number),
36
+ state: 'closed',
37
+ state_reason: item.state_reason === 'not_planned' ? 'not_planned' : 'completed',
38
+ });
39
+
40
+ closed += 1;
41
+ }
42
+
43
+ core.info(`Closed ${closed} issue(s).`);
@@ -1,51 +1,52 @@
1
- name: Create agent issues
2
- description: Create every create_issue item from agent_output.json.
3
- inputs:
4
- output-file:
5
- description: Path to agent_output.json.
6
- required: true
7
- token:
8
- description: GitHub token with issues:write.
9
- required: true
10
- outputs:
11
- created-count:
12
- description: Number of issues created.
13
- value: ${{ steps.create.outputs.created-count }}
14
- first-issue-number:
15
- description: Issue number of the first issue created, or empty.
16
- value: ${{ steps.create.outputs.first-issue-number }}
17
- runs:
18
- using: composite
19
- steps:
20
- - name: Create issues
21
- id: create
22
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
23
- env:
24
- AGENT_OUTPUT_LIB: ${{ github.action_path }}/../agent-output.cjs
25
- OUTPUT_FILE: ${{ inputs.output-file }}
26
- with:
27
- github-token: ${{ inputs.token }}
28
- script: |
29
- const { readAgentItems } = require(process.env.AGENT_OUTPUT_LIB);
30
- const items = readAgentItems(process.env.OUTPUT_FILE, 'create_issue');
31
-
32
- const created = [];
33
-
34
- for (const item of items) {
35
- if (!item.title) {
36
- core.warning(`create_issue item has no title, skipping: ${JSON.stringify(item)}`);
37
- continue;
38
- }
39
-
40
- const { data } = await github.rest.issues.create({
41
- ...context.repo,
42
- title: item.title,
43
- body: item.body ?? '',
44
- });
45
-
46
- created.push(data.number);
47
- core.info(`Created #${data.number}: ${item.title}`);
48
- }
49
-
50
- core.setOutput('created-count', String(created.length));
51
- core.setOutput('first-issue-number', created.length > 0 ? String(created[0]) : '');
1
+ # Managed by @plainconceptsplatform/workflows. Source: loops/actions/create-agent-issues/action.yml. Update with workflows update --force; consumer edits may be overwritten.
2
+ name: Create agent issues
3
+ description: Create every create_issue item from agent_output.json.
4
+ inputs:
5
+ output-file:
6
+ description: Path to agent_output.json.
7
+ required: true
8
+ token:
9
+ description: GitHub token with issues:write.
10
+ required: true
11
+ outputs:
12
+ created-count:
13
+ description: Number of issues created.
14
+ value: ${{ steps.create.outputs.created-count }}
15
+ first-issue-number:
16
+ description: Issue number of the first issue created, or empty.
17
+ value: ${{ steps.create.outputs.first-issue-number }}
18
+ runs:
19
+ using: composite
20
+ steps:
21
+ - name: Create issues
22
+ id: create
23
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
24
+ env:
25
+ AGENT_OUTPUT_LIB: ${{ github.action_path }}/../agent-output.cjs
26
+ OUTPUT_FILE: ${{ inputs.output-file }}
27
+ with:
28
+ github-token: ${{ inputs.token }}
29
+ script: |
30
+ const { readAgentItems } = require(process.env.AGENT_OUTPUT_LIB);
31
+ const items = readAgentItems(process.env.OUTPUT_FILE, 'create_issue');
32
+
33
+ const created = [];
34
+
35
+ for (const item of items) {
36
+ if (!item.title) {
37
+ core.warning(`create_issue item has no title, skipping: ${JSON.stringify(item)}`);
38
+ continue;
39
+ }
40
+
41
+ const { data } = await github.rest.issues.create({
42
+ ...context.repo,
43
+ title: item.title,
44
+ body: item.body ?? '',
45
+ });
46
+
47
+ created.push(data.number);
48
+ core.info(`Created #${data.number}: ${item.title}`);
49
+ }
50
+
51
+ core.setOutput('created-count', String(created.length));
52
+ core.setOutput('first-issue-number', created.length > 0 ? String(created[0]) : '');
@@ -1,28 +1,29 @@
1
- name: Create issue comment
2
- description: Create a comment on an issue or pull request.
3
- inputs:
4
- token:
5
- description: GitHub token used by github-script.
6
- required: true
7
- issue-number:
8
- description: Issue or pull request number.
9
- required: true
10
- body:
11
- description: Complete Markdown comment body.
12
- required: true
13
- runs:
14
- using: composite
15
- steps:
16
- - name: Create comment
17
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
18
- env:
19
- ISSUE_NUMBER: ${{ inputs.issue-number }}
20
- BODY: ${{ inputs.body }}
21
- with:
22
- github-token: ${{ inputs.token }}
23
- script: |
24
- await github.rest.issues.createComment({
25
- ...context.repo,
26
- issue_number: Number(process.env.ISSUE_NUMBER),
27
- body: process.env.BODY,
28
- });
1
+ # Managed by @plainconceptsplatform/workflows. Source: loops/actions/create-issue-comment/action.yml. Update with workflows update --force; consumer edits may be overwritten.
2
+ name: Create issue comment
3
+ description: Create a comment on an issue or pull request.
4
+ inputs:
5
+ token:
6
+ description: GitHub token used by github-script.
7
+ required: true
8
+ issue-number:
9
+ description: Issue or pull request number.
10
+ required: true
11
+ body:
12
+ description: Complete Markdown comment body.
13
+ required: true
14
+ runs:
15
+ using: composite
16
+ steps:
17
+ - name: Create comment
18
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
19
+ env:
20
+ ISSUE_NUMBER: ${{ inputs.issue-number }}
21
+ BODY: ${{ inputs.body }}
22
+ with:
23
+ github-token: ${{ inputs.token }}
24
+ script: |
25
+ await github.rest.issues.createComment({
26
+ ...context.repo,
27
+ issue_number: Number(process.env.ISSUE_NUMBER),
28
+ body: process.env.BODY,
29
+ });
@@ -1,52 +1,53 @@
1
- name: Download agent output
2
- description: Download the agent artifact and expose the output JSON and bundle paths.
3
- inputs:
4
- artifact-name:
5
- description: >-
6
- Artifact name to download. gh-aw prefixes it with the value it derives from the
7
- workflow's inputs, so a workflow_call worker must pass the activation job's
8
- artifact_prefix output followed by "agent", not the bare name.
9
- required: true
10
- outputs:
11
- output-file:
12
- description: Path to agent_output.json, or empty if not found.
13
- value: ${{ steps.download.outputs.output-file }}
14
- bundle-file:
15
- description: Path to the git bundle, or empty if not found.
16
- value: ${{ steps.download.outputs.bundle-file }}
17
- item-count:
18
- description: Number of items in the agent output.
19
- value: ${{ steps.download.outputs.item-count }}
20
- runs:
21
- using: composite
22
- steps:
23
- - name: Download agent artifact
24
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
25
- with:
26
- name: ${{ inputs.artifact-name }}
27
- path: agent-artifact
28
- - name: Locate output and bundle
29
- id: download
30
- shell: bash
31
- env:
32
- ARTIFACT_NAME: ${{ inputs.artifact-name }}
33
- run: |
34
- set -euo pipefail
35
- OUTPUT_FILE=""
36
- BUNDLE_FILE=""
37
- ITEM_COUNT="0"
38
-
39
- if [ -f "agent-artifact/agent_output.json" ]; then
40
- OUTPUT_FILE="agent-artifact/agent_output.json"
41
- ITEM_COUNT=$(jq '.items | length' "$OUTPUT_FILE")
42
- BUNDLE_FILE=$(ls agent-artifact/aw-*.bundle 2>/dev/null | head -1 || true)
43
- else
44
- echo "::error::Artifact '$ARTIFACT_NAME' contained no agent_output.json. Nothing the agent proposed will be applied."
45
- exit 1
46
- fi
47
-
48
- echo "Artifact '$ARTIFACT_NAME' carries $ITEM_COUNT item(s)."
49
-
50
- echo "output-file=$OUTPUT_FILE" >> "$GITHUB_OUTPUT"
51
- echo "bundle-file=$BUNDLE_FILE" >> "$GITHUB_OUTPUT"
52
- echo "item-count=$ITEM_COUNT" >> "$GITHUB_OUTPUT"
1
+ # Managed by @plainconceptsplatform/workflows. Source: loops/actions/download-agent-output/action.yml. Update with workflows update --force; consumer edits may be overwritten.
2
+ name: Download agent output
3
+ description: Download the agent artifact and expose the output JSON and bundle paths.
4
+ inputs:
5
+ artifact-name:
6
+ description: >-
7
+ Artifact name to download. gh-aw prefixes it with the value it derives from the
8
+ workflow's inputs, so a workflow_call worker must pass the activation job's
9
+ artifact_prefix output followed by "agent", not the bare name.
10
+ required: true
11
+ outputs:
12
+ output-file:
13
+ description: Path to agent_output.json, or empty if not found.
14
+ value: ${{ steps.download.outputs.output-file }}
15
+ bundle-file:
16
+ description: Path to the git bundle, or empty if not found.
17
+ value: ${{ steps.download.outputs.bundle-file }}
18
+ item-count:
19
+ description: Number of items in the agent output.
20
+ value: ${{ steps.download.outputs.item-count }}
21
+ runs:
22
+ using: composite
23
+ steps:
24
+ - name: Download agent artifact
25
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
26
+ with:
27
+ name: ${{ inputs.artifact-name }}
28
+ path: agent-artifact
29
+ - name: Locate output and bundle
30
+ id: download
31
+ shell: bash
32
+ env:
33
+ ARTIFACT_NAME: ${{ inputs.artifact-name }}
34
+ run: |
35
+ set -euo pipefail
36
+ OUTPUT_FILE=""
37
+ BUNDLE_FILE=""
38
+ ITEM_COUNT="0"
39
+
40
+ if [ -f "agent-artifact/agent_output.json" ]; then
41
+ OUTPUT_FILE="agent-artifact/agent_output.json"
42
+ ITEM_COUNT=$(jq '.items | length' "$OUTPUT_FILE")
43
+ BUNDLE_FILE=$(ls agent-artifact/aw-*.bundle 2>/dev/null | head -1 || true)
44
+ else
45
+ echo "::error::Artifact '$ARTIFACT_NAME' contained no agent_output.json. Nothing the agent proposed will be applied."
46
+ exit 1
47
+ fi
48
+
49
+ echo "Artifact '$ARTIFACT_NAME' carries $ITEM_COUNT item(s)."
50
+
51
+ echo "output-file=$OUTPUT_FILE" >> "$GITHUB_OUTPUT"
52
+ echo "bundle-file=$BUNDLE_FILE" >> "$GITHUB_OUTPUT"
53
+ echo "item-count=$ITEM_COUNT" >> "$GITHUB_OUTPUT"