@bradygaster/squad-sdk 0.8.20 → 0.8.21

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 (105) hide show
  1. package/README.md +296 -296
  2. package/dist/adapter/client.js +1 -1
  3. package/dist/adapter/client.js.map +1 -1
  4. package/dist/agents/charter-compiler.d.ts +4 -0
  5. package/dist/agents/charter-compiler.d.ts.map +1 -1
  6. package/dist/agents/charter-compiler.js +8 -0
  7. package/dist/agents/charter-compiler.js.map +1 -1
  8. package/dist/agents/history-shadow.js +30 -30
  9. package/dist/agents/index.js +1 -1
  10. package/dist/agents/index.js.map +1 -1
  11. package/dist/agents/lifecycle.js +1 -1
  12. package/dist/agents/lifecycle.js.map +1 -1
  13. package/dist/build/github-dist.js +42 -42
  14. package/dist/builders/index.d.ts +156 -0
  15. package/dist/builders/index.d.ts.map +1 -0
  16. package/dist/builders/index.js +404 -0
  17. package/dist/builders/index.js.map +1 -0
  18. package/dist/builders/types.d.ts +187 -0
  19. package/dist/builders/types.d.ts.map +1 -0
  20. package/dist/builders/types.js +12 -0
  21. package/dist/builders/types.js.map +1 -0
  22. package/dist/config/init.d.ts +5 -21
  23. package/dist/config/init.d.ts.map +1 -1
  24. package/dist/config/init.js +270 -182
  25. package/dist/config/init.js.map +1 -1
  26. package/dist/coordinator/coordinator.js +1 -1
  27. package/dist/coordinator/coordinator.js.map +1 -1
  28. package/dist/coordinator/index.js +1 -1
  29. package/dist/coordinator/index.js.map +1 -1
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +3 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/runtime/otel-api.d.ts +38 -0
  35. package/dist/runtime/otel-api.d.ts.map +1 -0
  36. package/dist/runtime/otel-api.js +94 -0
  37. package/dist/runtime/otel-api.js.map +1 -0
  38. package/dist/runtime/otel-bridge.js +1 -1
  39. package/dist/runtime/otel-bridge.js.map +1 -1
  40. package/dist/runtime/otel.d.ts +1 -1
  41. package/dist/runtime/otel.d.ts.map +1 -1
  42. package/dist/runtime/otel.js +28 -12
  43. package/dist/runtime/otel.js.map +1 -1
  44. package/dist/runtime/squad-observer.js +1 -1
  45. package/dist/runtime/squad-observer.js.map +1 -1
  46. package/dist/sharing/consult.js +78 -78
  47. package/dist/streams/filter.d.ts +33 -0
  48. package/dist/streams/filter.d.ts.map +1 -0
  49. package/dist/streams/filter.js +29 -0
  50. package/dist/streams/filter.js.map +1 -0
  51. package/dist/streams/index.d.ts +9 -0
  52. package/dist/streams/index.d.ts.map +1 -0
  53. package/dist/streams/index.js +9 -0
  54. package/dist/streams/index.js.map +1 -0
  55. package/dist/streams/resolver.d.ts +40 -0
  56. package/dist/streams/resolver.d.ts.map +1 -0
  57. package/dist/streams/resolver.js +162 -0
  58. package/dist/streams/resolver.js.map +1 -0
  59. package/dist/streams/types.d.ts +44 -0
  60. package/dist/streams/types.d.ts.map +1 -0
  61. package/dist/streams/types.js +10 -0
  62. package/dist/streams/types.js.map +1 -0
  63. package/dist/tools/index.js +1 -1
  64. package/dist/tools/index.js.map +1 -1
  65. package/dist/types.d.ts +20 -0
  66. package/dist/types.d.ts.map +1 -1
  67. package/package.json +12 -11
  68. package/templates/casting-history.json +4 -4
  69. package/templates/casting-policy.json +35 -35
  70. package/templates/casting-registry.json +3 -3
  71. package/templates/ceremonies.md +41 -41
  72. package/templates/charter.md +53 -53
  73. package/templates/constraint-tracking.md +38 -38
  74. package/templates/copilot-instructions.md +46 -46
  75. package/templates/history.md +10 -10
  76. package/templates/identity/now.md +9 -9
  77. package/templates/identity/wisdom.md +15 -15
  78. package/templates/mcp-config.md +98 -98
  79. package/templates/multi-agent-format.md +28 -28
  80. package/templates/orchestration-log.md +27 -27
  81. package/templates/plugin-marketplace.md +49 -49
  82. package/templates/raw-agent-output.md +37 -37
  83. package/templates/roster.md +60 -60
  84. package/templates/routing.md +54 -54
  85. package/templates/run-output.md +50 -50
  86. package/templates/scribe-charter.md +119 -119
  87. package/templates/skill.md +24 -24
  88. package/templates/skills/project-conventions/SKILL.md +56 -56
  89. package/templates/squad.agent.md +1146 -1146
  90. package/templates/workflows/squad-ci.yml +24 -24
  91. package/templates/workflows/squad-docs.yml +50 -50
  92. package/templates/workflows/squad-heartbeat.yml +316 -316
  93. package/templates/workflows/squad-insider-release.yml +61 -61
  94. package/templates/workflows/squad-issue-assign.yml +161 -161
  95. package/templates/workflows/squad-label-enforce.yml +181 -181
  96. package/templates/workflows/squad-preview.yml +55 -55
  97. package/templates/workflows/squad-promote.yml +120 -120
  98. package/templates/workflows/squad-release.yml +77 -77
  99. package/templates/workflows/squad-triage.yml +260 -260
  100. package/templates/workflows/sync-squad-labels.yml +169 -169
  101. package/dist/runtime/event-bus-otel-bridge.d.ts +0 -19
  102. package/dist/runtime/event-bus-otel-bridge.d.ts.map +0 -1
  103. package/dist/runtime/event-bus-otel-bridge.js +0 -61
  104. package/dist/runtime/event-bus-otel-bridge.js.map +0 -1
  105. package/templates/workflows/squad-main-guard.yml +0 -129
@@ -1,61 +1,61 @@
1
- name: Squad Insider Release
2
-
3
- on:
4
- push:
5
- branches: [insider]
6
-
7
- permissions:
8
- contents: write
9
-
10
- jobs:
11
- release:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- with:
16
- fetch-depth: 0
17
-
18
- - uses: actions/setup-node@v4
19
- with:
20
- node-version: 22
21
-
22
- - name: Run tests
23
- run: node --test test/*.test.js
24
-
25
- - name: Read version from package.json
26
- id: version
27
- run: |
28
- VERSION=$(node -e "console.log(require('./package.json').version)")
29
- SHORT_SHA=$(git rev-parse --short HEAD)
30
- INSIDER_VERSION="${VERSION}-insider+${SHORT_SHA}"
31
- INSIDER_TAG="v${INSIDER_VERSION}"
32
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
33
- echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
34
- echo "insider_version=$INSIDER_VERSION" >> "$GITHUB_OUTPUT"
35
- echo "insider_tag=$INSIDER_TAG" >> "$GITHUB_OUTPUT"
36
- echo "📦 Base Version: $VERSION (Short SHA: $SHORT_SHA)"
37
- echo "🏷️ Insider Version: $INSIDER_VERSION"
38
- echo "🔖 Insider Tag: $INSIDER_TAG"
39
-
40
- - name: Create git tag
41
- run: |
42
- git config user.name "github-actions[bot]"
43
- git config user.email "github-actions[bot]@users.noreply.github.com"
44
- git tag -a "${{ steps.version.outputs.insider_tag }}" -m "Insider Release ${{ steps.version.outputs.insider_tag }}"
45
- git push origin "${{ steps.version.outputs.insider_tag }}"
46
-
47
- - name: Create GitHub Release
48
- env:
49
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50
- run: |
51
- gh release create "${{ steps.version.outputs.insider_tag }}" \
52
- --title "${{ steps.version.outputs.insider_tag }}" \
53
- --notes "This is an insider/development build of Squad. Install with:\`\`\`bash\nnpx github:bradygaster/squad#${{ steps.version.outputs.insider_tag }}\n\`\`\`\n\n**Note:** Insider builds may be unstable and are intended for early adopters and testing only." \
54
- --prerelease
55
-
56
- - name: Verify release
57
- env:
58
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59
- run: |
60
- gh release view "${{ steps.version.outputs.insider_tag }}"
61
- echo "✅ Insider Release ${{ steps.version.outputs.insider_tag }} created and verified."
1
+ name: Squad Insider Release
2
+
3
+ on:
4
+ push:
5
+ branches: [insider]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ release:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 22
21
+
22
+ - name: Run tests
23
+ run: node --test test/*.test.js
24
+
25
+ - name: Read version from package.json
26
+ id: version
27
+ run: |
28
+ VERSION=$(node -e "console.log(require('./package.json').version)")
29
+ SHORT_SHA=$(git rev-parse --short HEAD)
30
+ INSIDER_VERSION="${VERSION}-insider+${SHORT_SHA}"
31
+ INSIDER_TAG="v${INSIDER_VERSION}"
32
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
33
+ echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
34
+ echo "insider_version=$INSIDER_VERSION" >> "$GITHUB_OUTPUT"
35
+ echo "insider_tag=$INSIDER_TAG" >> "$GITHUB_OUTPUT"
36
+ echo "📦 Base Version: $VERSION (Short SHA: $SHORT_SHA)"
37
+ echo "🏷️ Insider Version: $INSIDER_VERSION"
38
+ echo "🔖 Insider Tag: $INSIDER_TAG"
39
+
40
+ - name: Create git tag
41
+ run: |
42
+ git config user.name "github-actions[bot]"
43
+ git config user.email "github-actions[bot]@users.noreply.github.com"
44
+ git tag -a "${{ steps.version.outputs.insider_tag }}" -m "Insider Release ${{ steps.version.outputs.insider_tag }}"
45
+ git push origin "${{ steps.version.outputs.insider_tag }}"
46
+
47
+ - name: Create GitHub Release
48
+ env:
49
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50
+ run: |
51
+ gh release create "${{ steps.version.outputs.insider_tag }}" \
52
+ --title "${{ steps.version.outputs.insider_tag }}" \
53
+ --notes "This is an insider/development build of Squad. Install with:\`\`\`bash\nnpx github:bradygaster/squad#${{ steps.version.outputs.insider_tag }}\n\`\`\`\n\n**Note:** Insider builds may be unstable and are intended for early adopters and testing only." \
54
+ --prerelease
55
+
56
+ - name: Verify release
57
+ env:
58
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59
+ run: |
60
+ gh release view "${{ steps.version.outputs.insider_tag }}"
61
+ echo "✅ Insider Release ${{ steps.version.outputs.insider_tag }} created and verified."
@@ -1,161 +1,161 @@
1
- name: Squad Issue Assign
2
-
3
- on:
4
- issues:
5
- types: [labeled]
6
-
7
- permissions:
8
- issues: write
9
- contents: read
10
-
11
- jobs:
12
- assign-work:
13
- # Only trigger on squad:{member} labels (not the base "squad" label)
14
- if: startsWith(github.event.label.name, 'squad:')
15
- runs-on: ubuntu-latest
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - name: Identify assigned member and trigger work
20
- uses: actions/github-script@v7
21
- with:
22
- script: |
23
- const fs = require('fs');
24
- const issue = context.payload.issue;
25
- const label = context.payload.label.name;
26
-
27
- // Extract member name from label (e.g., "squad:ripley" → "ripley")
28
- const memberName = label.replace('squad:', '').toLowerCase();
29
-
30
- // Read team roster — check .squad/ first, fall back to .ai-team/
31
- let teamFile = '.squad/team.md';
32
- if (!fs.existsSync(teamFile)) {
33
- teamFile = '.ai-team/team.md';
34
- }
35
- if (!fs.existsSync(teamFile)) {
36
- core.warning('No .squad/team.md or .ai-team/team.md found — cannot assign work');
37
- return;
38
- }
39
-
40
- const content = fs.readFileSync(teamFile, 'utf8');
41
- const lines = content.split('\n');
42
-
43
- // Check if this is a coding agent assignment
44
- const isCopilotAssignment = memberName === 'copilot';
45
-
46
- let assignedMember = null;
47
- if (isCopilotAssignment) {
48
- assignedMember = { name: '@copilot', role: 'Coding Agent' };
49
- } else {
50
- let inMembersTable = false;
51
- for (const line of lines) {
52
- if (line.match(/^##\s+(Members|Team Roster)/i)) {
53
- inMembersTable = true;
54
- continue;
55
- }
56
- if (inMembersTable && line.startsWith('## ')) {
57
- break;
58
- }
59
- if (inMembersTable && line.startsWith('|') && !line.includes('---') && !line.includes('Name')) {
60
- const cells = line.split('|').map(c => c.trim()).filter(Boolean);
61
- if (cells.length >= 2 && cells[0].toLowerCase() === memberName) {
62
- assignedMember = { name: cells[0], role: cells[1] };
63
- break;
64
- }
65
- }
66
- }
67
- }
68
-
69
- if (!assignedMember) {
70
- core.warning(`No member found matching label "${label}"`);
71
- await github.rest.issues.createComment({
72
- owner: context.repo.owner,
73
- repo: context.repo.repo,
74
- issue_number: issue.number,
75
- body: `⚠️ No squad member found matching label \`${label}\`. Check \`.squad/team.md\` (or \`.ai-team/team.md\`) for valid member names.`
76
- });
77
- return;
78
- }
79
-
80
- // Post assignment acknowledgment
81
- let comment;
82
- if (isCopilotAssignment) {
83
- comment = [
84
- `### 🤖 Routed to @copilot (Coding Agent)`,
85
- '',
86
- `**Issue:** #${issue.number} — ${issue.title}`,
87
- '',
88
- `@copilot has been assigned and will pick this up automatically.`,
89
- '',
90
- `> The coding agent will create a \`copilot/*\` branch and open a draft PR.`,
91
- `> Review the PR as you would any team member's work.`,
92
- ].join('\n');
93
- } else {
94
- comment = [
95
- `### 📋 Assigned to ${assignedMember.name} (${assignedMember.role})`,
96
- '',
97
- `**Issue:** #${issue.number} — ${issue.title}`,
98
- '',
99
- `${assignedMember.name} will pick this up in the next Copilot session.`,
100
- '',
101
- `> **For Copilot coding agent:** If enabled, this issue will be worked automatically.`,
102
- `> Otherwise, start a Copilot session and say:`,
103
- `> \`${assignedMember.name}, work on issue #${issue.number}\``,
104
- ].join('\n');
105
- }
106
-
107
- await github.rest.issues.createComment({
108
- owner: context.repo.owner,
109
- repo: context.repo.repo,
110
- issue_number: issue.number,
111
- body: comment
112
- });
113
-
114
- core.info(`Issue #${issue.number} assigned to ${assignedMember.name} (${assignedMember.role})`);
115
-
116
- # Separate step: assign @copilot using PAT (required for coding agent)
117
- - name: Assign @copilot coding agent
118
- if: github.event.label.name == 'squad:copilot'
119
- uses: actions/github-script@v7
120
- with:
121
- github-token: ${{ secrets.COPILOT_ASSIGN_TOKEN }}
122
- script: |
123
- const owner = context.repo.owner;
124
- const repo = context.repo.repo;
125
- const issue_number = context.payload.issue.number;
126
-
127
- // Get the default branch name (main, master, etc.)
128
- const { data: repoData } = await github.rest.repos.get({ owner, repo });
129
- const baseBranch = repoData.default_branch;
130
-
131
- try {
132
- await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/assignees', {
133
- owner,
134
- repo,
135
- issue_number,
136
- assignees: ['copilot-swe-agent[bot]'],
137
- agent_assignment: {
138
- target_repo: `${owner}/${repo}`,
139
- base_branch: baseBranch,
140
- custom_instructions: '',
141
- custom_agent: '',
142
- model: ''
143
- },
144
- headers: {
145
- 'X-GitHub-Api-Version': '2022-11-28'
146
- }
147
- });
148
- core.info(`Assigned copilot-swe-agent to issue #${issue_number} (base: ${baseBranch})`);
149
- } catch (err) {
150
- core.warning(`Assignment with agent_assignment failed: ${err.message}`);
151
- // Fallback: try without agent_assignment
152
- try {
153
- await github.rest.issues.addAssignees({
154
- owner, repo, issue_number,
155
- assignees: ['copilot-swe-agent']
156
- });
157
- core.info(`Fallback assigned copilot-swe-agent to issue #${issue_number}`);
158
- } catch (err2) {
159
- core.warning(`Fallback also failed: ${err2.message}`);
160
- }
161
- }
1
+ name: Squad Issue Assign
2
+
3
+ on:
4
+ issues:
5
+ types: [labeled]
6
+
7
+ permissions:
8
+ issues: write
9
+ contents: read
10
+
11
+ jobs:
12
+ assign-work:
13
+ # Only trigger on squad:{member} labels (not the base "squad" label)
14
+ if: startsWith(github.event.label.name, 'squad:')
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Identify assigned member and trigger work
20
+ uses: actions/github-script@v7
21
+ with:
22
+ script: |
23
+ const fs = require('fs');
24
+ const issue = context.payload.issue;
25
+ const label = context.payload.label.name;
26
+
27
+ // Extract member name from label (e.g., "squad:ripley" → "ripley")
28
+ const memberName = label.replace('squad:', '').toLowerCase();
29
+
30
+ // Read team roster — check .squad/ first, fall back to .ai-team/
31
+ let teamFile = '.squad/team.md';
32
+ if (!fs.existsSync(teamFile)) {
33
+ teamFile = '.ai-team/team.md';
34
+ }
35
+ if (!fs.existsSync(teamFile)) {
36
+ core.warning('No .squad/team.md or .ai-team/team.md found — cannot assign work');
37
+ return;
38
+ }
39
+
40
+ const content = fs.readFileSync(teamFile, 'utf8');
41
+ const lines = content.split('\n');
42
+
43
+ // Check if this is a coding agent assignment
44
+ const isCopilotAssignment = memberName === 'copilot';
45
+
46
+ let assignedMember = null;
47
+ if (isCopilotAssignment) {
48
+ assignedMember = { name: '@copilot', role: 'Coding Agent' };
49
+ } else {
50
+ let inMembersTable = false;
51
+ for (const line of lines) {
52
+ if (line.match(/^##\s+(Members|Team Roster)/i)) {
53
+ inMembersTable = true;
54
+ continue;
55
+ }
56
+ if (inMembersTable && line.startsWith('## ')) {
57
+ break;
58
+ }
59
+ if (inMembersTable && line.startsWith('|') && !line.includes('---') && !line.includes('Name')) {
60
+ const cells = line.split('|').map(c => c.trim()).filter(Boolean);
61
+ if (cells.length >= 2 && cells[0].toLowerCase() === memberName) {
62
+ assignedMember = { name: cells[0], role: cells[1] };
63
+ break;
64
+ }
65
+ }
66
+ }
67
+ }
68
+
69
+ if (!assignedMember) {
70
+ core.warning(`No member found matching label "${label}"`);
71
+ await github.rest.issues.createComment({
72
+ owner: context.repo.owner,
73
+ repo: context.repo.repo,
74
+ issue_number: issue.number,
75
+ body: `⚠️ No squad member found matching label \`${label}\`. Check \`.squad/team.md\` (or \`.ai-team/team.md\`) for valid member names.`
76
+ });
77
+ return;
78
+ }
79
+
80
+ // Post assignment acknowledgment
81
+ let comment;
82
+ if (isCopilotAssignment) {
83
+ comment = [
84
+ `### 🤖 Routed to @copilot (Coding Agent)`,
85
+ '',
86
+ `**Issue:** #${issue.number} — ${issue.title}`,
87
+ '',
88
+ `@copilot has been assigned and will pick this up automatically.`,
89
+ '',
90
+ `> The coding agent will create a \`copilot/*\` branch and open a draft PR.`,
91
+ `> Review the PR as you would any team member's work.`,
92
+ ].join('\n');
93
+ } else {
94
+ comment = [
95
+ `### 📋 Assigned to ${assignedMember.name} (${assignedMember.role})`,
96
+ '',
97
+ `**Issue:** #${issue.number} — ${issue.title}`,
98
+ '',
99
+ `${assignedMember.name} will pick this up in the next Copilot session.`,
100
+ '',
101
+ `> **For Copilot coding agent:** If enabled, this issue will be worked automatically.`,
102
+ `> Otherwise, start a Copilot session and say:`,
103
+ `> \`${assignedMember.name}, work on issue #${issue.number}\``,
104
+ ].join('\n');
105
+ }
106
+
107
+ await github.rest.issues.createComment({
108
+ owner: context.repo.owner,
109
+ repo: context.repo.repo,
110
+ issue_number: issue.number,
111
+ body: comment
112
+ });
113
+
114
+ core.info(`Issue #${issue.number} assigned to ${assignedMember.name} (${assignedMember.role})`);
115
+
116
+ # Separate step: assign @copilot using PAT (required for coding agent)
117
+ - name: Assign @copilot coding agent
118
+ if: github.event.label.name == 'squad:copilot'
119
+ uses: actions/github-script@v7
120
+ with:
121
+ github-token: ${{ secrets.COPILOT_ASSIGN_TOKEN }}
122
+ script: |
123
+ const owner = context.repo.owner;
124
+ const repo = context.repo.repo;
125
+ const issue_number = context.payload.issue.number;
126
+
127
+ // Get the default branch name (main, master, etc.)
128
+ const { data: repoData } = await github.rest.repos.get({ owner, repo });
129
+ const baseBranch = repoData.default_branch;
130
+
131
+ try {
132
+ await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/assignees', {
133
+ owner,
134
+ repo,
135
+ issue_number,
136
+ assignees: ['copilot-swe-agent[bot]'],
137
+ agent_assignment: {
138
+ target_repo: `${owner}/${repo}`,
139
+ base_branch: baseBranch,
140
+ custom_instructions: '',
141
+ custom_agent: '',
142
+ model: ''
143
+ },
144
+ headers: {
145
+ 'X-GitHub-Api-Version': '2022-11-28'
146
+ }
147
+ });
148
+ core.info(`Assigned copilot-swe-agent to issue #${issue_number} (base: ${baseBranch})`);
149
+ } catch (err) {
150
+ core.warning(`Assignment with agent_assignment failed: ${err.message}`);
151
+ // Fallback: try without agent_assignment
152
+ try {
153
+ await github.rest.issues.addAssignees({
154
+ owner, repo, issue_number,
155
+ assignees: ['copilot-swe-agent']
156
+ });
157
+ core.info(`Fallback assigned copilot-swe-agent to issue #${issue_number}`);
158
+ } catch (err2) {
159
+ core.warning(`Fallback also failed: ${err2.message}`);
160
+ }
161
+ }