@bradygaster/squad-cli 0.6.2 → 0.8.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 +77 -77
- package/dist/cli/commands/copilot.d.ts +13 -0
- package/dist/cli/commands/copilot.d.ts.map +1 -0
- package/dist/cli/commands/copilot.js +86 -0
- package/dist/cli/commands/copilot.js.map +1 -0
- package/dist/cli/commands/export.d.ts +9 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +89 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/import.d.ts +9 -0
- package/dist/cli/commands/import.d.ts.map +1 -0
- package/dist/cli/commands/import.js +116 -0
- package/dist/cli/commands/import.js.map +1 -0
- package/dist/cli/commands/plugin.d.ts +14 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +134 -0
- package/dist/cli/commands/plugin.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +8 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +178 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/copilot-install.d.ts +73 -0
- package/dist/cli/copilot-install.d.ts.map +1 -0
- package/dist/cli/copilot-install.js +117 -0
- package/dist/cli/copilot-install.js.map +1 -0
- package/dist/cli/core/detect-squad-dir.d.ts +13 -0
- package/dist/cli/core/detect-squad-dir.d.ts.map +1 -0
- package/dist/cli/core/detect-squad-dir.js +21 -0
- package/dist/cli/core/detect-squad-dir.js.map +1 -0
- package/dist/cli/core/email-scrub.d.ts +10 -0
- package/dist/cli/core/email-scrub.d.ts.map +1 -0
- package/dist/cli/core/email-scrub.js +103 -0
- package/dist/cli/core/email-scrub.js.map +1 -0
- package/dist/cli/core/errors.d.ts +17 -0
- package/dist/cli/core/errors.d.ts.map +1 -0
- package/dist/cli/core/errors.js +22 -0
- package/dist/cli/core/errors.js.map +1 -0
- package/dist/cli/core/gh-cli.d.ts +41 -0
- package/dist/cli/core/gh-cli.d.ts.map +1 -0
- package/dist/cli/core/gh-cli.js +67 -0
- package/dist/cli/core/gh-cli.js.map +1 -0
- package/dist/cli/core/history-split.d.ts +9 -0
- package/dist/cli/core/history-split.d.ts.map +1 -0
- package/dist/cli/core/history-split.js +65 -0
- package/dist/cli/core/history-split.js.map +1 -0
- package/dist/cli/core/init.d.ts +9 -0
- package/dist/cli/core/init.d.ts.map +1 -0
- package/dist/cli/core/init.js +296 -0
- package/dist/cli/core/init.js.map +1 -0
- package/dist/cli/core/migrate-directory.d.ts +11 -0
- package/dist/cli/core/migrate-directory.d.ts.map +1 -0
- package/dist/cli/core/migrate-directory.js +71 -0
- package/dist/cli/core/migrate-directory.js.map +1 -0
- package/dist/cli/core/migrations.d.ts +11 -0
- package/dist/cli/core/migrations.d.ts.map +1 -0
- package/dist/cli/core/migrations.js +78 -0
- package/dist/cli/core/migrations.js.map +1 -0
- package/dist/cli/core/output.d.ts +34 -0
- package/dist/cli/core/output.d.ts.map +1 -0
- package/dist/cli/core/output.js +47 -0
- package/dist/cli/core/output.js.map +1 -0
- package/dist/cli/core/project-type.d.ts +9 -0
- package/dist/cli/core/project-type.d.ts.map +1 -0
- package/dist/cli/core/project-type.js +29 -0
- package/dist/cli/core/project-type.js.map +1 -0
- package/dist/cli/core/team-md.d.ts +28 -0
- package/dist/cli/core/team-md.d.ts.map +1 -0
- package/dist/cli/core/team-md.js +91 -0
- package/dist/cli/core/team-md.js.map +1 -0
- package/dist/cli/core/templates.d.ts +30 -0
- package/dist/cli/core/templates.d.ts.map +1 -0
- package/dist/cli/core/templates.js +247 -0
- package/dist/cli/core/templates.js.map +1 -0
- package/dist/cli/core/upgrade.d.ts +20 -0
- package/dist/cli/core/upgrade.d.ts.map +1 -0
- package/dist/cli/core/upgrade.js +399 -0
- package/dist/cli/core/upgrade.js.map +1 -0
- package/dist/cli/core/version.d.ts +18 -0
- package/dist/cli/core/version.d.ts.map +1 -0
- package/dist/cli/core/version.js +61 -0
- package/dist/cli/core/version.js.map +1 -0
- package/dist/cli/core/workflows.d.ts +10 -0
- package/dist/cli/core/workflows.d.ts.map +1 -0
- package/dist/cli/core/workflows.js +155 -0
- package/dist/cli/core/workflows.js.map +1 -0
- package/dist/cli/index.d.ts +26 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +26 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/shell/autocomplete.d.ts +12 -0
- package/dist/cli/shell/autocomplete.d.ts.map +1 -0
- package/dist/cli/shell/autocomplete.js +39 -0
- package/dist/cli/shell/autocomplete.js.map +1 -0
- package/dist/cli/shell/commands.d.ts +19 -0
- package/dist/cli/shell/commands.d.ts.map +1 -0
- package/dist/cli/shell/commands.js +87 -0
- package/dist/cli/shell/commands.js.map +1 -0
- package/dist/cli/shell/components/AgentPanel.d.ts +8 -0
- package/dist/cli/shell/components/AgentPanel.d.ts.map +1 -0
- package/dist/cli/shell/components/AgentPanel.js +17 -0
- package/dist/cli/shell/components/AgentPanel.js.map +1 -0
- package/dist/cli/shell/components/InputPrompt.d.ts +9 -0
- package/dist/cli/shell/components/InputPrompt.d.ts.map +1 -0
- package/dist/cli/shell/components/InputPrompt.js +50 -0
- package/dist/cli/shell/components/InputPrompt.js.map +1 -0
- package/dist/cli/shell/components/MessageStream.d.ts +13 -0
- package/dist/cli/shell/components/MessageStream.d.ts.map +1 -0
- package/dist/cli/shell/components/MessageStream.js +7 -0
- package/dist/cli/shell/components/MessageStream.js.map +1 -0
- package/dist/cli/shell/components/index.d.ts +4 -0
- package/dist/cli/shell/components/index.d.ts.map +1 -0
- package/dist/cli/shell/components/index.js +4 -0
- package/dist/cli/shell/components/index.js.map +1 -0
- package/dist/cli/shell/coordinator.d.ts +32 -0
- package/dist/cli/shell/coordinator.d.ts.map +1 -0
- package/dist/cli/shell/coordinator.js +113 -0
- package/dist/cli/shell/coordinator.js.map +1 -0
- package/dist/cli/shell/index.d.ts +28 -0
- package/dist/cli/shell/index.d.ts.map +1 -0
- package/dist/cli/shell/index.js +66 -0
- package/dist/cli/shell/index.js.map +1 -0
- package/dist/cli/shell/lifecycle.d.ts +52 -0
- package/dist/cli/shell/lifecycle.d.ts.map +1 -0
- package/dist/cli/shell/lifecycle.js +168 -0
- package/dist/cli/shell/lifecycle.js.map +1 -0
- package/dist/cli/shell/memory.d.ts +36 -0
- package/dist/cli/shell/memory.d.ts.map +1 -0
- package/dist/cli/shell/memory.js +53 -0
- package/dist/cli/shell/memory.js.map +1 -0
- package/dist/cli/shell/render.d.ts +22 -0
- package/dist/cli/shell/render.d.ts.map +1 -0
- package/dist/cli/shell/render.js +44 -0
- package/dist/cli/shell/render.js.map +1 -0
- package/dist/cli/shell/router.d.ts +17 -0
- package/dist/cli/shell/router.d.ts.map +1 -0
- package/dist/cli/shell/router.js +55 -0
- package/dist/cli/shell/router.js.map +1 -0
- package/dist/cli/shell/sessions.d.ts +15 -0
- package/dist/cli/shell/sessions.d.ts.map +1 -0
- package/dist/cli/shell/sessions.js +37 -0
- package/dist/cli/shell/sessions.js.map +1 -0
- package/dist/cli/shell/spawn.d.ts +47 -0
- package/dist/cli/shell/spawn.d.ts.map +1 -0
- package/dist/cli/shell/spawn.js +77 -0
- package/dist/cli/shell/spawn.js.map +1 -0
- package/dist/cli/shell/stream-bridge.d.ts +60 -0
- package/dist/cli/shell/stream-bridge.d.ts.map +1 -0
- package/dist/cli/shell/stream-bridge.js +98 -0
- package/dist/cli/shell/stream-bridge.js.map +1 -0
- package/dist/cli/shell/terminal.d.ts +30 -0
- package/dist/cli/shell/terminal.d.ts.map +1 -0
- package/dist/cli/shell/terminal.js +34 -0
- package/dist/cli/shell/terminal.js.map +1 -0
- package/dist/cli/shell/types.d.ts +21 -0
- package/dist/cli/shell/types.d.ts.map +1 -0
- package/dist/cli/shell/types.js +5 -0
- package/dist/cli/shell/types.js.map +1 -0
- package/dist/cli/upgrade.d.ts +141 -0
- package/dist/cli/upgrade.d.ts.map +1 -0
- package/dist/cli/upgrade.js +226 -0
- package/dist/cli/upgrade.js.map +1 -0
- package/dist/cli-entry.d.ts +10 -0
- package/dist/cli-entry.d.ts.map +1 -0
- package/dist/cli-entry.js +213 -0
- package/dist/cli-entry.js.map +1 -0
- package/package.json +44 -34
- package/templates/casting-history.json +4 -0
- package/templates/casting-policy.json +35 -0
- package/templates/casting-registry.json +3 -0
- package/templates/ceremonies.md +41 -0
- package/templates/charter.md +53 -0
- package/templates/constraint-tracking.md +38 -0
- package/templates/copilot-instructions.md +46 -0
- package/templates/history.md +10 -0
- package/templates/identity/now.md +9 -0
- package/templates/identity/wisdom.md +15 -0
- package/templates/mcp-config.md +90 -0
- package/templates/multi-agent-format.md +28 -0
- package/templates/orchestration-log.md +27 -0
- package/templates/plugin-marketplace.md +49 -0
- package/templates/raw-agent-output.md +37 -0
- package/templates/roster.md +60 -0
- package/templates/routing.md +54 -0
- package/templates/run-output.md +50 -0
- package/templates/scribe-charter.md +119 -0
- package/templates/skill.md +24 -0
- package/templates/skills/squad-conventions/SKILL.md +69 -0
- package/templates/squad.agent.md +1146 -0
- package/templates/workflows/squad-ci.yml +24 -0
- package/templates/workflows/squad-docs.yml +50 -0
- package/templates/workflows/squad-heartbeat.yml +315 -0
- package/templates/workflows/squad-insider-release.yml +61 -0
- package/templates/workflows/squad-issue-assign.yml +161 -0
- package/templates/workflows/squad-label-enforce.yml +181 -0
- package/templates/workflows/squad-main-guard.yml +129 -0
- package/templates/workflows/squad-preview.yml +55 -0
- package/templates/workflows/squad-promote.yml +121 -0
- package/templates/workflows/squad-release.yml +77 -0
- package/templates/workflows/squad-triage.yml +260 -0
- package/templates/workflows/sync-squad-labels.yml +169 -0
package/README.md
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
# @bradygaster/squad-cli
|
|
2
|
-
|
|
3
|
-
The programmable multi-agent CLI for GitHub Copilot. Build an AI team, assign roles, and let them work your repo.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Global (recommended)
|
|
9
|
-
npm install -g @bradygaster/squad-cli
|
|
10
|
-
|
|
11
|
-
# Project-local
|
|
12
|
-
npm install --save-dev @bradygaster/squad-cli
|
|
13
|
-
|
|
14
|
-
# One-shot (no install)
|
|
15
|
-
npx @bradygaster/squad-cli
|
|
16
|
-
|
|
17
|
-
# Insider channel (pre-release builds)
|
|
18
|
-
npm install -g @bradygaster/squad-cli@insider
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Quick Start
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
# 1. Initialize Squad in your repo
|
|
25
|
-
squad init
|
|
26
|
-
|
|
27
|
-
# 2. Create your first agent
|
|
28
|
-
squad hire --name aria --role "frontend engineer"
|
|
29
|
-
|
|
30
|
-
# 3. Launch the interactive shell
|
|
31
|
-
squad
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
That's it. You have a working AI team.
|
|
35
|
-
|
|
36
|
-
## Commands
|
|
37
|
-
|
|
38
|
-
| Command | Description |
|
|
39
|
-
|---------|-------------|
|
|
40
|
-
| `squad` | Launch interactive shell |
|
|
41
|
-
| `squad init` | Initialize Squad in current repo. `--global` for a personal squad. |
|
|
42
|
-
| `squad upgrade` | Update Squad-owned files. `--global`, `--migrate-directory` |
|
|
43
|
-
| `squad status` | Show which squad is active (repo vs personal) and why |
|
|
44
|
-
| `squad triage` | Scan for work and categorize issues |
|
|
45
|
-
| `squad loop` | Continuous work loop. `--filter <pattern>`, `--interval <seconds>` |
|
|
46
|
-
| `squad hire` | Team creation wizard. `--name <name>`, `--role <role>` |
|
|
47
|
-
| `squad copilot` | Add/remove @copilot coding agent. `--off`, `--auto-assign` |
|
|
48
|
-
| `squad plugin` | Manage plugin marketplaces (add/remove/list/browse) |
|
|
49
|
-
| `squad export` | Export squad to JSON snapshot. `--out <path>` |
|
|
50
|
-
| `squad import <file>` | Import squad from export file. `--force` to overwrite |
|
|
51
|
-
| `squad scrub-emails` | Remove email addresses from Squad state files |
|
|
52
|
-
| `squad help` | Show help |
|
|
53
|
-
|
|
54
|
-
## Interactive Shell
|
|
55
|
-
|
|
56
|
-
Running `squad` with no arguments launches a REPL where you talk directly to your team.
|
|
57
|
-
|
|
58
|
-
- **Slash commands:** `/status`, `/history`, `/agents`, `/clear`, `/help`, `/quit`
|
|
59
|
-
- **@mentions:** Route messages to a specific agent (e.g. `@aria fix the login bug`)
|
|
60
|
-
- **Tab completion:** Agents and commands auto-complete
|
|
61
|
-
|
|
62
|
-
The shell coordinates work across agents, streams responses in real time, and keeps a session history.
|
|
63
|
-
|
|
64
|
-
## Requirements
|
|
65
|
-
|
|
66
|
-
- **Node.js ≥ 20**
|
|
67
|
-
- **GitHub CLI** (`gh`) — required for issue/PR operations and the work loop
|
|
68
|
-
- **GitHub Copilot** — provides the AI backend for agent orchestration
|
|
69
|
-
|
|
70
|
-
## Links
|
|
71
|
-
|
|
72
|
-
- **SDK:** [@bradygaster/squad-sdk](https://www.npmjs.com/package/@bradygaster/squad-sdk)
|
|
73
|
-
- **Issues:** [github.com/bradygaster/squad-pr/issues](https://github.com/bradygaster/squad-pr/issues)
|
|
74
|
-
|
|
75
|
-
## License
|
|
76
|
-
|
|
77
|
-
See [LICENSE](https://github.com/bradygaster/squad-pr/blob/main/LICENSE) in the repository root.
|
|
1
|
+
# @bradygaster/squad-cli
|
|
2
|
+
|
|
3
|
+
The programmable multi-agent CLI for GitHub Copilot. Build an AI team, assign roles, and let them work your repo.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Global (recommended)
|
|
9
|
+
npm install -g @bradygaster/squad-cli
|
|
10
|
+
|
|
11
|
+
# Project-local
|
|
12
|
+
npm install --save-dev @bradygaster/squad-cli
|
|
13
|
+
|
|
14
|
+
# One-shot (no install)
|
|
15
|
+
npx @bradygaster/squad-cli
|
|
16
|
+
|
|
17
|
+
# Insider channel (pre-release builds)
|
|
18
|
+
npm install -g @bradygaster/squad-cli@insider
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 1. Initialize Squad in your repo
|
|
25
|
+
squad init
|
|
26
|
+
|
|
27
|
+
# 2. Create your first agent
|
|
28
|
+
squad hire --name aria --role "frontend engineer"
|
|
29
|
+
|
|
30
|
+
# 3. Launch the interactive shell
|
|
31
|
+
squad
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
That's it. You have a working AI team.
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
| Command | Description |
|
|
39
|
+
|---------|-------------|
|
|
40
|
+
| `squad` | Launch interactive shell |
|
|
41
|
+
| `squad init` | Initialize Squad in current repo. `--global` for a personal squad. |
|
|
42
|
+
| `squad upgrade` | Update Squad-owned files. `--global`, `--migrate-directory` |
|
|
43
|
+
| `squad status` | Show which squad is active (repo vs personal) and why |
|
|
44
|
+
| `squad triage` | Scan for work and categorize issues |
|
|
45
|
+
| `squad loop` | Continuous work loop. `--filter <pattern>`, `--interval <seconds>` |
|
|
46
|
+
| `squad hire` | Team creation wizard. `--name <name>`, `--role <role>` |
|
|
47
|
+
| `squad copilot` | Add/remove @copilot coding agent. `--off`, `--auto-assign` |
|
|
48
|
+
| `squad plugin` | Manage plugin marketplaces (add/remove/list/browse) |
|
|
49
|
+
| `squad export` | Export squad to JSON snapshot. `--out <path>` |
|
|
50
|
+
| `squad import <file>` | Import squad from export file. `--force` to overwrite |
|
|
51
|
+
| `squad scrub-emails` | Remove email addresses from Squad state files |
|
|
52
|
+
| `squad help` | Show help |
|
|
53
|
+
|
|
54
|
+
## Interactive Shell
|
|
55
|
+
|
|
56
|
+
Running `squad` with no arguments launches a REPL where you talk directly to your team.
|
|
57
|
+
|
|
58
|
+
- **Slash commands:** `/status`, `/history`, `/agents`, `/clear`, `/help`, `/quit`
|
|
59
|
+
- **@mentions:** Route messages to a specific agent (e.g. `@aria fix the login bug`)
|
|
60
|
+
- **Tab completion:** Agents and commands auto-complete
|
|
61
|
+
|
|
62
|
+
The shell coordinates work across agents, streams responses in real time, and keeps a session history.
|
|
63
|
+
|
|
64
|
+
## Requirements
|
|
65
|
+
|
|
66
|
+
- **Node.js ≥ 20**
|
|
67
|
+
- **GitHub CLI** (`gh`) — required for issue/PR operations and the work loop
|
|
68
|
+
- **GitHub Copilot** — provides the AI backend for agent orchestration
|
|
69
|
+
|
|
70
|
+
## Links
|
|
71
|
+
|
|
72
|
+
- **SDK:** [@bradygaster/squad-sdk](https://www.npmjs.com/package/@bradygaster/squad-sdk)
|
|
73
|
+
- **Issues:** [github.com/bradygaster/squad-pr/issues](https://github.com/bradygaster/squad-pr/issues)
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
See [LICENSE](https://github.com/bradygaster/squad-pr/blob/main/LICENSE) in the repository root.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copilot agent CLI command — add/remove/auto-assign
|
|
3
|
+
* Port from beta index.js lines 598-713
|
|
4
|
+
*/
|
|
5
|
+
export interface CopilotFlags {
|
|
6
|
+
off?: boolean;
|
|
7
|
+
autoAssign?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Run copilot command
|
|
11
|
+
*/
|
|
12
|
+
export declare function runCopilot(dest: string, flags: CopilotFlags): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=copilot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/copilot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAkFjF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copilot agent CLI command — add/remove/auto-assign
|
|
3
|
+
* Port from beta index.js lines 598-713
|
|
4
|
+
*/
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { success, BOLD, RESET, DIM } from '../core/output.js';
|
|
8
|
+
import { detectSquadDir } from '../core/detect-squad-dir.js';
|
|
9
|
+
import { readTeamMd, writeTeamMd, hasCopilot, insertCopilotSection, removeCopilotSection, setAutoAssign } from '../core/team-md.js';
|
|
10
|
+
/**
|
|
11
|
+
* Run copilot command
|
|
12
|
+
*/
|
|
13
|
+
export async function runCopilot(dest, flags) {
|
|
14
|
+
const squadDirInfo = detectSquadDir(dest);
|
|
15
|
+
const squadDir = squadDirInfo.path;
|
|
16
|
+
// Ensure squad directory exists
|
|
17
|
+
if (!fs.existsSync(squadDir)) {
|
|
18
|
+
throw new Error('No squad found — run init first, then add the copilot agent.');
|
|
19
|
+
}
|
|
20
|
+
let content = readTeamMd(squadDir);
|
|
21
|
+
const copilotExists = hasCopilot(content);
|
|
22
|
+
// Remove copilot
|
|
23
|
+
if (flags.off) {
|
|
24
|
+
if (!copilotExists) {
|
|
25
|
+
console.log(`${DIM}Copilot coding agent is not on the team — nothing to remove${RESET}`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Remove the Coding Agent section
|
|
29
|
+
content = removeCopilotSection(content);
|
|
30
|
+
writeTeamMd(squadDir, content);
|
|
31
|
+
success('Removed @copilot from the team roster');
|
|
32
|
+
// Remove copilot-instructions.md
|
|
33
|
+
const instructionsDest = path.join(dest, '.github', 'copilot-instructions.md');
|
|
34
|
+
if (fs.existsSync(instructionsDest)) {
|
|
35
|
+
fs.unlinkSync(instructionsDest);
|
|
36
|
+
success('Removed .github/copilot-instructions.md');
|
|
37
|
+
}
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Enable auto-assign (copilot already exists)
|
|
41
|
+
if (copilotExists) {
|
|
42
|
+
if (flags.autoAssign) {
|
|
43
|
+
content = setAutoAssign(content, true);
|
|
44
|
+
writeTeamMd(squadDir, content);
|
|
45
|
+
success('Enabled @copilot auto-assign');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
console.log(`${DIM}@copilot is already on the team${RESET}`);
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// Add copilot
|
|
53
|
+
content = insertCopilotSection(content, flags.autoAssign);
|
|
54
|
+
writeTeamMd(squadDir, content);
|
|
55
|
+
success('Added @copilot (Coding Agent) to team roster');
|
|
56
|
+
if (flags.autoAssign) {
|
|
57
|
+
success('Auto-assign enabled — squad-labeled issues will be assigned to @copilot');
|
|
58
|
+
}
|
|
59
|
+
// Copy copilot-instructions.md from templates
|
|
60
|
+
// Templates are at the root of the package (../../../templates from dist/cli/commands/)
|
|
61
|
+
const currentFileUrl = new URL(import.meta.url);
|
|
62
|
+
const currentFilePath = currentFileUrl.pathname.startsWith('/') && process.platform === 'win32'
|
|
63
|
+
? currentFileUrl.pathname.substring(1) // Remove leading / on Windows
|
|
64
|
+
: currentFileUrl.pathname;
|
|
65
|
+
const templatesSrc = path.resolve(path.dirname(currentFilePath), '..', '..', '..', 'templates');
|
|
66
|
+
const instructionsSrc = path.join(templatesSrc, 'copilot-instructions.md');
|
|
67
|
+
const instructionsDest = path.join(dest, '.github', 'copilot-instructions.md');
|
|
68
|
+
if (fs.existsSync(instructionsSrc)) {
|
|
69
|
+
fs.mkdirSync(path.dirname(instructionsDest), { recursive: true });
|
|
70
|
+
fs.copyFileSync(instructionsSrc, instructionsDest);
|
|
71
|
+
success('.github/copilot-instructions.md');
|
|
72
|
+
}
|
|
73
|
+
// Output guidance
|
|
74
|
+
console.log();
|
|
75
|
+
console.log(`${BOLD}@copilot is on the team.${RESET}`);
|
|
76
|
+
console.log(`The coding agent will pick up issues matching its capability profile.`);
|
|
77
|
+
if (!flags.autoAssign) {
|
|
78
|
+
console.log(`Run with ${BOLD}--auto-assign${RESET} to auto-assign @copilot on squad-labeled issues.`);
|
|
79
|
+
}
|
|
80
|
+
console.log();
|
|
81
|
+
console.log(`${BOLD}Required:${RESET} Add a classic PAT (repo scope) as a repo secret for auto-assignment:`);
|
|
82
|
+
console.log(` 1. Create token: ${DIM}https://github.com/settings/tokens/new${RESET}`);
|
|
83
|
+
console.log(` 2. Set secret: ${DIM}gh secret set COPILOT_ASSIGN_TOKEN${RESET}`);
|
|
84
|
+
console.log();
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=copilot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/cli/commands/copilot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAmB,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAO5B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY,EAAE,KAAmB;IAChE,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC;IAEnC,gCAAgC;IAChC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IAED,IAAI,OAAO,GAAG,UAAU,CA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,CAAC,uEAAuE,CAAC,CAAC;IACrF,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,gBAAgB,KAAK,mDAAmD,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,YAAY,KAAK,uEAAuE,CAAC,CAAC;IAC7G,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,yCAAyC,KAAK,EAAE,CAAC,CAAC;IACxF,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,qCAAqC,KAAK,EAAE,CAAC,CAAC;IACpF,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/export.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4E7E"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export command — port from beta CLI
|
|
3
|
+
* Exports squad to squad-export.json
|
|
4
|
+
*/
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { detectSquadDir } from '../core/detect-squad-dir.js';
|
|
8
|
+
import { success, warn } from '../core/output.js';
|
|
9
|
+
import { fatal } from '../core/errors.js';
|
|
10
|
+
/**
|
|
11
|
+
* Export squad to JSON
|
|
12
|
+
*/
|
|
13
|
+
export async function runExport(dest, outPath) {
|
|
14
|
+
const squadInfo = detectSquadDir(dest);
|
|
15
|
+
const teamMd = path.join(squadInfo.path, 'team.md');
|
|
16
|
+
if (!fs.existsSync(teamMd)) {
|
|
17
|
+
fatal('No squad found — run init first');
|
|
18
|
+
}
|
|
19
|
+
const manifest = {
|
|
20
|
+
version: '1.0',
|
|
21
|
+
exported_at: new Date().toISOString(),
|
|
22
|
+
squad_version: '0.6.0',
|
|
23
|
+
casting: {},
|
|
24
|
+
agents: {},
|
|
25
|
+
skills: []
|
|
26
|
+
};
|
|
27
|
+
// Read casting state
|
|
28
|
+
const castingDir = path.join(squadInfo.path, 'casting');
|
|
29
|
+
for (const file of ['registry.json', 'policy.json', 'history.json']) {
|
|
30
|
+
const filePath = path.join(castingDir, file);
|
|
31
|
+
try {
|
|
32
|
+
if (fs.existsSync(filePath)) {
|
|
33
|
+
manifest.casting[file.replace('.json', '')] = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
console.error(`Warning: could not read casting/${file}: ${err.message}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// Read agents
|
|
41
|
+
const agentsDir = path.join(squadInfo.path, 'agents');
|
|
42
|
+
try {
|
|
43
|
+
if (fs.existsSync(agentsDir)) {
|
|
44
|
+
for (const entry of fs.readdirSync(agentsDir)) {
|
|
45
|
+
const agentDir = path.join(agentsDir, entry);
|
|
46
|
+
if (!fs.statSync(agentDir).isDirectory())
|
|
47
|
+
continue;
|
|
48
|
+
const agent = {};
|
|
49
|
+
const charterPath = path.join(agentDir, 'charter.md');
|
|
50
|
+
const historyPath = path.join(agentDir, 'history.md');
|
|
51
|
+
if (fs.existsSync(charterPath))
|
|
52
|
+
agent.charter = fs.readFileSync(charterPath, 'utf8');
|
|
53
|
+
if (fs.existsSync(historyPath))
|
|
54
|
+
agent.history = fs.readFileSync(historyPath, 'utf8');
|
|
55
|
+
manifest.agents[entry] = agent;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
console.error(`Warning: could not read agents: ${err.message}`);
|
|
61
|
+
}
|
|
62
|
+
// Read skills
|
|
63
|
+
const skillsDir = path.join(squadInfo.path, 'skills');
|
|
64
|
+
try {
|
|
65
|
+
if (fs.existsSync(skillsDir)) {
|
|
66
|
+
for (const entry of fs.readdirSync(skillsDir)) {
|
|
67
|
+
const skillFile = path.join(skillsDir, entry, 'SKILL.md');
|
|
68
|
+
if (fs.existsSync(skillFile)) {
|
|
69
|
+
manifest.skills.push(fs.readFileSync(skillFile, 'utf8'));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
console.error(`Warning: could not read skills: ${err.message}`);
|
|
76
|
+
}
|
|
77
|
+
// Determine output path
|
|
78
|
+
const finalOutPath = outPath || path.join(dest, 'squad-export.json');
|
|
79
|
+
try {
|
|
80
|
+
fs.writeFileSync(finalOutPath, JSON.stringify(manifest, null, 2) + '\n');
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
fatal(`Failed to write export file: ${err.message}`);
|
|
84
|
+
}
|
|
85
|
+
const displayPath = path.relative(dest, finalOutPath) || path.basename(finalOutPath);
|
|
86
|
+
success(`Exported squad to ${displayPath}`);
|
|
87
|
+
warn('Review agent histories before sharing — they may contain project-specific information');
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/cli/commands/export.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAW1C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY,EAAE,OAAgB;IA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from JSON
|
|
7
|
+
*/
|
|
8
|
+
export declare function runImport(dest: string, importPath: string, force: boolean): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/import.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAsH/F"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import command — port from beta CLI
|
|
3
|
+
* Imports squad from squad-export.json
|
|
4
|
+
*/
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { detectSquadDir } from '../core/detect-squad-dir.js';
|
|
8
|
+
import { success, warn, info } from '../core/output.js';
|
|
9
|
+
import { fatal } from '../core/errors.js';
|
|
10
|
+
import { splitHistory } from '../core/history-split.js';
|
|
11
|
+
/**
|
|
12
|
+
* Import squad from JSON
|
|
13
|
+
*/
|
|
14
|
+
export async function runImport(dest, importPath, force) {
|
|
15
|
+
const resolvedPath = path.resolve(importPath);
|
|
16
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
17
|
+
fatal(`Import file not found: ${importPath}`);
|
|
18
|
+
}
|
|
19
|
+
let manifest;
|
|
20
|
+
try {
|
|
21
|
+
manifest = JSON.parse(fs.readFileSync(resolvedPath, 'utf8'));
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
fatal(`Invalid JSON in import file: ${err.message}`);
|
|
25
|
+
}
|
|
26
|
+
// Validate manifest
|
|
27
|
+
if (manifest.version !== '1.0') {
|
|
28
|
+
fatal(`Unsupported export version: ${manifest.version || 'missing'} (expected 1.0)`);
|
|
29
|
+
}
|
|
30
|
+
if (!manifest.agents || typeof manifest.agents !== 'object') {
|
|
31
|
+
fatal('Invalid export file: missing or invalid "agents" field');
|
|
32
|
+
}
|
|
33
|
+
if (!manifest.casting || typeof manifest.casting !== 'object') {
|
|
34
|
+
fatal('Invalid export file: missing or invalid "casting" field');
|
|
35
|
+
}
|
|
36
|
+
if (!Array.isArray(manifest.skills)) {
|
|
37
|
+
fatal('Invalid export file: missing or invalid "skills" field');
|
|
38
|
+
}
|
|
39
|
+
const squadInfo = detectSquadDir(dest);
|
|
40
|
+
const squadDir = squadInfo.path;
|
|
41
|
+
// Conflict detection
|
|
42
|
+
if (fs.existsSync(squadDir)) {
|
|
43
|
+
if (!force) {
|
|
44
|
+
fatal('A squad already exists here. Use --force to replace (current squad will be archived).');
|
|
45
|
+
}
|
|
46
|
+
// Archive existing squad
|
|
47
|
+
const ts = new Date().toISOString().replace(/:/g, '-').replace(/\./g, '-');
|
|
48
|
+
const archiveDir = path.join(dest, `${squadInfo.name}-archive-${ts}`);
|
|
49
|
+
fs.renameSync(squadDir, archiveDir);
|
|
50
|
+
info(`Archived existing squad to ${path.basename(archiveDir)}`);
|
|
51
|
+
}
|
|
52
|
+
// Create directory structure
|
|
53
|
+
fs.mkdirSync(path.join(squadDir, 'casting'), { recursive: true });
|
|
54
|
+
fs.mkdirSync(path.join(squadDir, 'decisions', 'inbox'), { recursive: true });
|
|
55
|
+
fs.mkdirSync(path.join(squadDir, 'orchestration-log'), { recursive: true });
|
|
56
|
+
fs.mkdirSync(path.join(squadDir, 'log'), { recursive: true });
|
|
57
|
+
fs.mkdirSync(path.join(squadDir, 'skills'), { recursive: true });
|
|
58
|
+
// Write empty project-specific files
|
|
59
|
+
fs.writeFileSync(path.join(squadDir, 'decisions.md'), '');
|
|
60
|
+
fs.writeFileSync(path.join(squadDir, 'team.md'), '');
|
|
61
|
+
// Write casting state
|
|
62
|
+
for (const [key, value] of Object.entries(manifest.casting)) {
|
|
63
|
+
fs.writeFileSync(path.join(squadDir, 'casting', `${key}.json`), JSON.stringify(value, null, 2) + '\n');
|
|
64
|
+
}
|
|
65
|
+
// Determine source project name from filename
|
|
66
|
+
const sourceProject = path.basename(resolvedPath, '.json');
|
|
67
|
+
const importDate = new Date().toISOString();
|
|
68
|
+
// Write agents
|
|
69
|
+
const agentNames = Object.keys(manifest.agents);
|
|
70
|
+
for (const name of agentNames) {
|
|
71
|
+
const agent = manifest.agents[name];
|
|
72
|
+
const agentDir = path.join(squadDir, 'agents', name);
|
|
73
|
+
fs.mkdirSync(agentDir, { recursive: true });
|
|
74
|
+
if (agent.charter) {
|
|
75
|
+
fs.writeFileSync(path.join(agentDir, 'charter.md'), agent.charter);
|
|
76
|
+
}
|
|
77
|
+
// History split: separate portable knowledge from project learnings
|
|
78
|
+
let historyContent = '';
|
|
79
|
+
if (agent.history) {
|
|
80
|
+
historyContent = splitHistory(agent.history, sourceProject);
|
|
81
|
+
}
|
|
82
|
+
historyContent = `📌 Imported from ${sourceProject} on ${importDate}. Portable knowledge carried over; project learnings from previous project preserved below.\n\n` + historyContent;
|
|
83
|
+
fs.writeFileSync(path.join(agentDir, 'history.md'), historyContent);
|
|
84
|
+
}
|
|
85
|
+
// Write skills
|
|
86
|
+
for (const skillContent of manifest.skills) {
|
|
87
|
+
const nameMatch = skillContent.match(/^name:\s*["']?(.+?)["']?\s*$/m);
|
|
88
|
+
const skillName = nameMatch
|
|
89
|
+
? nameMatch[1].trim().toLowerCase().replace(/\s+/g, '-')
|
|
90
|
+
: `skill-${manifest.skills.indexOf(skillContent)}`;
|
|
91
|
+
const skillDir = path.join(squadDir, 'skills', skillName);
|
|
92
|
+
fs.mkdirSync(skillDir, { recursive: true });
|
|
93
|
+
fs.writeFileSync(path.join(skillDir, 'SKILL.md'), skillContent);
|
|
94
|
+
}
|
|
95
|
+
// Determine universe for messaging
|
|
96
|
+
let universe = 'unknown';
|
|
97
|
+
if (manifest.casting.policy && typeof manifest.casting.policy === 'object') {
|
|
98
|
+
const policy = manifest.casting.policy;
|
|
99
|
+
if (policy.universe) {
|
|
100
|
+
universe = String(policy.universe);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Output
|
|
104
|
+
success(`Imported squad from ${path.basename(resolvedPath)}`);
|
|
105
|
+
info(` ${agentNames.length} agents: ${agentNames.join(', ')}`);
|
|
106
|
+
info(` ${manifest.skills.length} skills imported`);
|
|
107
|
+
info(` Casting: ${universe} universe preserved`);
|
|
108
|
+
console.log();
|
|
109
|
+
warn('Project-specific learnings are marked in agent histories — review if needed');
|
|
110
|
+
console.log();
|
|
111
|
+
info('Next steps:');
|
|
112
|
+
info(' 1. Open Copilot and select Squad');
|
|
113
|
+
info(' 2. Tell the team about this project — they\'ll adapt');
|
|
114
|
+
console.log();
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../src/cli/commands/import.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAWxD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY,EAAE,UAAkB,EAAE,KAAc;IAC9E,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,KAAK,CAAC,0BAA0B,UAAU,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,QAAwB,CAAC;IAC7B,IAAI,CAA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AAC;IAC9D,IAAI,CAAC,KAAK,UAAU,CAAC,MAAM,YAAY,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChE,IAAI,CAAC,KAAK,QAAQ,CAAC,MAAM,CAAC,MAAM,kBAAkB,CAAC,CAAC;IACpD,IAAI,CAAC,cAAc,QAAQ,qBAAqB,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,IAAI,CAAC,6EAA6E,CAAC,CAAC;IACpF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,IAAI,CAAC,aAAa,CAAC,CAAC;IACpB,IAAI,CAAC,oCAAoC,CAAC,CAAC;IAC3C,IAAI,CAAC,wDAAwD,CAAC,CAAC;IAC/D,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin marketplace commands — add/remove/list/browse
|
|
3
|
+
* Port from beta index.js lines 716-833
|
|
4
|
+
*/
|
|
5
|
+
export interface Marketplace {
|
|
6
|
+
name: string;
|
|
7
|
+
source: string;
|
|
8
|
+
added_at: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MarketplacesRegistry {
|
|
11
|
+
marketplaces: Marketplace[];
|
|
12
|
+
}
|
|
13
|
+
export declare function runPlugin(dest: string, args: string[]): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAID,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgJ3E"}
|