@bradygaster/squad-sdk 0.10.0 → 0.11.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/CHANGELOG.md +344 -0
- package/dist/adapter/client.d.ts +1 -1
- package/dist/adapter/client.d.ts.map +1 -1
- package/dist/adapter/client.js +20 -11
- package/dist/adapter/client.js.map +1 -1
- package/dist/adapter/types.d.ts +5 -1
- package/dist/adapter/types.d.ts.map +1 -1
- package/dist/agents/charter-compiler.d.ts +6 -0
- package/dist/agents/charter-compiler.d.ts.map +1 -1
- package/dist/agents/charter-compiler.js +23 -0
- package/dist/agents/charter-compiler.js.map +1 -1
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/lifecycle.d.ts +3 -0
- package/dist/agents/lifecycle.d.ts.map +1 -1
- package/dist/agents/lifecycle.js +16 -6
- package/dist/agents/lifecycle.js.map +1 -1
- package/dist/agents/onboarding.d.ts.map +1 -1
- package/dist/agents/onboarding.js +63 -18
- package/dist/agents/onboarding.js.map +1 -1
- package/dist/builders/index.d.ts.map +1 -1
- package/dist/builders/index.js +7 -0
- package/dist/builders/index.js.map +1 -1
- package/dist/builders/types.d.ts +5 -0
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/client/event-bus.d.ts +1 -1
- package/dist/client/event-bus.d.ts.map +1 -1
- package/dist/client/event-bus.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/config/gitignore-state.d.ts +31 -0
- package/dist/config/gitignore-state.d.ts.map +1 -0
- package/dist/config/gitignore-state.js +74 -0
- package/dist/config/gitignore-state.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/init.d.ts +18 -0
- package/dist/config/init.d.ts.map +1 -1
- package/dist/config/init.js +184 -10
- package/dist/config/init.js.map +1 -1
- package/dist/config/models.d.ts +89 -0
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +297 -0
- package/dist/config/models.js.map +1 -1
- package/dist/config/routing.d.ts.map +1 -1
- package/dist/config/routing.js +24 -1
- package/dist/config/routing.js.map +1 -1
- package/dist/config/schema.d.ts +3 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/coordinator/direct-response.d.ts.map +1 -1
- package/dist/coordinator/direct-response.js +4 -0
- package/dist/coordinator/direct-response.js.map +1 -1
- package/dist/coordinator/fan-out.d.ts +12 -4
- package/dist/coordinator/fan-out.d.ts.map +1 -1
- package/dist/coordinator/fan-out.js +155 -15
- package/dist/coordinator/fan-out.js.map +1 -1
- package/dist/coordinator/index.d.ts +1 -0
- package/dist/coordinator/index.d.ts.map +1 -1
- package/dist/coordinator/index.js +2 -0
- package/dist/coordinator/index.js.map +1 -1
- package/dist/coordinator/spawn-backend.d.ts +181 -0
- package/dist/coordinator/spawn-backend.d.ts.map +1 -0
- package/dist/coordinator/spawn-backend.js +254 -0
- package/dist/coordinator/spawn-backend.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/platform/comms-teams.d.ts +2 -1
- package/dist/platform/comms-teams.d.ts.map +1 -1
- package/dist/platform/comms-teams.js +12 -7
- package/dist/platform/comms-teams.js.map +1 -1
- package/dist/presets/index.d.ts +27 -0
- package/dist/presets/index.d.ts.map +1 -1
- package/dist/presets/index.js +309 -0
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/scaffold.d.ts +27 -0
- package/dist/presets/scaffold.d.ts.map +1 -0
- package/dist/presets/scaffold.js +377 -0
- package/dist/presets/scaffold.js.map +1 -0
- package/dist/ralph/capabilities.d.ts +5 -2
- package/dist/ralph/capabilities.d.ts.map +1 -1
- package/dist/ralph/capabilities.js +10 -4
- package/dist/ralph/capabilities.js.map +1 -1
- package/dist/resolution.d.ts.map +1 -1
- package/dist/resolution.js +8 -0
- package/dist/resolution.js.map +1 -1
- package/dist/runtime/cross-squad.d.ts +47 -0
- package/dist/runtime/cross-squad.d.ts.map +1 -1
- package/dist/runtime/cross-squad.js +79 -2
- package/dist/runtime/cross-squad.js.map +1 -1
- package/dist/runtime/otel.js +6 -6
- package/dist/runtime/otel.js.map +1 -1
- package/dist/runtime/squad-observer.d.ts +2 -0
- package/dist/runtime/squad-observer.d.ts.map +1 -1
- package/dist/runtime/squad-observer.js +65 -4
- package/dist/runtime/squad-observer.js.map +1 -1
- package/dist/sharing/consult.d.ts +5 -1
- package/dist/sharing/consult.d.ts.map +1 -1
- package/dist/sharing/consult.js +5 -1
- package/dist/sharing/consult.js.map +1 -1
- package/dist/skills/handler-types.d.ts +1 -1
- package/dist/skills/handler-types.js +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +20 -8
- package/dist/tools/index.js.map +1 -1
- package/package.json +17 -16
- package/templates/casting-reference.md +18 -0
- package/templates/fact-checker-charter.md +83 -0
- package/templates/fact-checker-policy.md +104 -0
- package/templates/skills/cli-wiring/SKILL.md +2 -2
- package/templates/skills/coordinator-init-mode/SKILL.md +83 -0
- package/templates/skills/coordinator-response-mode/SKILL.md +97 -0
- package/templates/skills/coordinator-source-of-truth/SKILL.md +45 -0
- package/templates/skills/cross-squad/SKILL.md +66 -6
- package/templates/skills/cross-squad-communication/SKILL.md +399 -0
- package/templates/skills/init-mode/SKILL.md +4 -4
- package/templates/skills/personal-squad/SKILL.md +3 -2
- package/templates/skills/release-process/SKILL.md +2 -2
- package/templates/skills/squad/SKILL.md +299 -0
- package/templates/skills/squad-commands/SKILL.md +303 -0
- package/templates/skills/squad-help/SKILL.md +97 -0
- package/templates/skills/squad-version-check/SKILL.md +169 -0
- package/templates/skills/tiered-memory/SKILL.md +31 -44
- package/templates/spawn-reference.md +57 -2
- package/templates/squad.agent.md.template +204 -180
- package/templates/workflows/squad-heartbeat.yml +2 -5
- package/templates/workflows/squad-issue-assign.yml +3 -7
- package/templates/workflows/squad-triage.yml +3 -11
- package/templates/workflows/sync-squad-labels.yml +2 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/builders/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/builders/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAMhE,kEAAkE;AAClE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,+DAA+D;AAC/D,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAMpC;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IAEnC,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;CACpC;AAED,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC/B,mEAAmE;IACnE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEhC,gDAAgD;IAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAMD,oEAAoE;AACpE,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,eAAe,CAAC;IAElD,kEAAkE;IAClE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AAE,CAAC;CAC9C"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* to observe all agent sessions from a single subscription point.
|
|
6
6
|
* Decouples event producers (sessions) from consumers (coordinator, Ralph, UI).
|
|
7
7
|
*/
|
|
8
|
-
export type SquadEventType = 'session.created' | 'session.destroyed' | 'session.status_changed' | 'session.message' | 'session.tool_call' | 'session.error' | 'agent.milestone' | 'coordinator.routing' | 'pool.health';
|
|
8
|
+
export type SquadEventType = 'session.created' | 'session.destroyed' | 'session.status_changed' | 'session.message' | 'session.tool_call' | 'session.error' | 'session.spawn_fallback' | 'agent.milestone' | 'coordinator.routing' | 'pool.health';
|
|
9
9
|
export interface SquadEvent {
|
|
10
10
|
type: SquadEventType;
|
|
11
11
|
sessionId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../src/client/event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,mBAAmB,GACnB,wBAAwB,GACxB,iBAAiB,GACjB,mBAAmB,GACnB,eAAe,GACf,iBAAiB,GACjB,qBAAqB,GACrB,aAAa,CAAC;AAElB,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAIvE,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAqD;IACrE,OAAO,CAAC,WAAW,CAAgC;IAEnD,yCAAyC;IACzC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,IAAI;IAY3D,8BAA8B;IAC9B,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,IAAI;IAOxC,gDAAgD;IAC1C,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB5C,0BAA0B;IAC1B,KAAK,IAAI,IAAI;CAId"}
|
|
1
|
+
{"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../src/client/event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,mBAAmB,GACnB,wBAAwB,GACxB,iBAAiB,GACjB,mBAAmB,GACnB,eAAe,GACf,wBAAwB,GACxB,iBAAiB,GACjB,qBAAqB,GACrB,aAAa,CAAC;AAElB,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAIvE,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAqD;IACrE,OAAO,CAAC,WAAW,CAAgC;IAEnD,yCAAyC;IACzC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,IAAI;IAY3D,8BAA8B;IAC9B,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,IAAI;IAOxC,gDAAgD;IAC1C,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB5C,0BAA0B;IAC1B,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../src/client/event-bus.ts"],"names":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,OAAO,CAAC,KAAK,CAAC,CAAC;YAC9B,IAAI,MAAM,YAAY,OAAO;gBAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACvC,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;YAC9B,IAAI,MAAM,YAAY,OAAO;gBAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;QAED,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;IAED,0BAA0B;IAC1B,KAAK;QACH,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export declare class SquadClientWithPool {
|
|
|
81
81
|
/** Send a ping to verify connectivity */
|
|
82
82
|
ping(message?: string): Promise<{
|
|
83
83
|
message: string;
|
|
84
|
-
timestamp:
|
|
84
|
+
timestamp: string;
|
|
85
85
|
protocolVersion?: number;
|
|
86
86
|
}>;
|
|
87
87
|
/** Get CLI status information */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for managing the squad-state .gitignore marker block.
|
|
3
|
+
*
|
|
4
|
+
* When the state backend is 'two-layer' or 'orphan', .squad/decisions.md
|
|
5
|
+
* and .squad/agents/history.md are owned by the squad-state orphan branch.
|
|
6
|
+
* Adding them to .gitignore prevents accidental staging via git add .,
|
|
7
|
+
* git add -A, IDE "stage all", or git commit -am -- defense-in-depth
|
|
8
|
+
* complement to the pre-commit hook installed by squad upgrade --state-backend.
|
|
9
|
+
*
|
|
10
|
+
* The block is delimited by marker comments so it can be reliably added and
|
|
11
|
+
* removed without touching unrelated .gitignore content.
|
|
12
|
+
*/
|
|
13
|
+
import type { StorageProvider } from '../storage/index.js';
|
|
14
|
+
export declare const SQUAD_STATE_GITIGNORE_OPEN_MARKER = "# Squad: state owned by squad-state branch (two-layer/orphan backend)";
|
|
15
|
+
export declare const SQUAD_STATE_GITIGNORE_CLOSE_MARKER = "# /Squad: state owned by squad-state branch";
|
|
16
|
+
/**
|
|
17
|
+
* Append the squad-state marker block to .gitignore if not already present.
|
|
18
|
+
*
|
|
19
|
+
* Idempotent: if the opening marker already exists in the file, this is a
|
|
20
|
+
* no-op. Returns true if the block was added, false if it was already present.
|
|
21
|
+
*/
|
|
22
|
+
export declare function addSquadStateGitignoreBlock(gitignorePath: string, storage: StorageProvider): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Remove the squad-state marker block from .gitignore if present.
|
|
25
|
+
*
|
|
26
|
+
* Finds the opening and closing marker lines and removes all lines between
|
|
27
|
+
* them (inclusive), plus one leading blank line in what follows if present.
|
|
28
|
+
* Returns true if the block was removed, false if it was not present.
|
|
29
|
+
*/
|
|
30
|
+
export declare function removeSquadStateGitignoreBlock(gitignorePath: string, storage: StorageProvider): boolean;
|
|
31
|
+
//# sourceMappingURL=gitignore-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore-state.d.ts","sourceRoot":"","sources":["../../src/config/gitignore-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,eAAO,MAAM,iCAAiC,0EAC2B,CAAC;AAC1E,eAAO,MAAM,kCAAkC,gDACA,CAAC;AAQhD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,eAAe,GACvB,OAAO,CAaT;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,eAAe,GACvB,OAAO,CAkCT"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for managing the squad-state .gitignore marker block.
|
|
3
|
+
*
|
|
4
|
+
* When the state backend is 'two-layer' or 'orphan', .squad/decisions.md
|
|
5
|
+
* and .squad/agents/history.md are owned by the squad-state orphan branch.
|
|
6
|
+
* Adding them to .gitignore prevents accidental staging via git add .,
|
|
7
|
+
* git add -A, IDE "stage all", or git commit -am -- defense-in-depth
|
|
8
|
+
* complement to the pre-commit hook installed by squad upgrade --state-backend.
|
|
9
|
+
*
|
|
10
|
+
* The block is delimited by marker comments so it can be reliably added and
|
|
11
|
+
* removed without touching unrelated .gitignore content.
|
|
12
|
+
*/
|
|
13
|
+
export const SQUAD_STATE_GITIGNORE_OPEN_MARKER = '# Squad: state owned by squad-state branch (two-layer/orphan backend)';
|
|
14
|
+
export const SQUAD_STATE_GITIGNORE_CLOSE_MARKER = '# /Squad: state owned by squad-state branch';
|
|
15
|
+
const SQUAD_STATE_GITIGNORE_BLOCK = SQUAD_STATE_GITIGNORE_OPEN_MARKER + '\n' +
|
|
16
|
+
'.squad/decisions.md\n' +
|
|
17
|
+
'.squad/agents/*/history.md\n' +
|
|
18
|
+
SQUAD_STATE_GITIGNORE_CLOSE_MARKER + '\n';
|
|
19
|
+
/**
|
|
20
|
+
* Append the squad-state marker block to .gitignore if not already present.
|
|
21
|
+
*
|
|
22
|
+
* Idempotent: if the opening marker already exists in the file, this is a
|
|
23
|
+
* no-op. Returns true if the block was added, false if it was already present.
|
|
24
|
+
*/
|
|
25
|
+
export function addSquadStateGitignoreBlock(gitignorePath, storage) {
|
|
26
|
+
let content = '';
|
|
27
|
+
if (storage.existsSync(gitignorePath)) {
|
|
28
|
+
content = storage.readSync(gitignorePath) ?? '';
|
|
29
|
+
}
|
|
30
|
+
if (content.includes(SQUAD_STATE_GITIGNORE_OPEN_MARKER)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
const prefix = content.length > 0 && !content.endsWith('\n') ? '\n' : '';
|
|
34
|
+
storage.writeSync(gitignorePath, content + prefix + SQUAD_STATE_GITIGNORE_BLOCK);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Remove the squad-state marker block from .gitignore if present.
|
|
39
|
+
*
|
|
40
|
+
* Finds the opening and closing marker lines and removes all lines between
|
|
41
|
+
* them (inclusive), plus one leading blank line in what follows if present.
|
|
42
|
+
* Returns true if the block was removed, false if it was not present.
|
|
43
|
+
*/
|
|
44
|
+
export function removeSquadStateGitignoreBlock(gitignorePath, storage) {
|
|
45
|
+
if (!storage.existsSync(gitignorePath)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const content = storage.readSync(gitignorePath) ?? '';
|
|
49
|
+
if (!content.includes(SQUAD_STATE_GITIGNORE_OPEN_MARKER)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
const lines = content.split('\n');
|
|
53
|
+
const openIdx = lines.findIndex((l) => l === SQUAD_STATE_GITIGNORE_OPEN_MARKER);
|
|
54
|
+
if (openIdx === -1)
|
|
55
|
+
return false;
|
|
56
|
+
// Find the closing marker starting from the opening marker
|
|
57
|
+
let closeIdx = -1;
|
|
58
|
+
for (let i = openIdx + 1; i < lines.length; i++) {
|
|
59
|
+
if (lines[i] === SQUAD_STATE_GITIGNORE_CLOSE_MARKER) {
|
|
60
|
+
closeIdx = i;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// If no closing marker found, remove from opening marker to end
|
|
65
|
+
const endIdx = closeIdx !== -1 ? closeIdx : lines.length - 1;
|
|
66
|
+
const before = lines.slice(0, openIdx);
|
|
67
|
+
const after = lines.slice(endIdx + 1);
|
|
68
|
+
// Rejoin: before-lines + after-lines (including trailing empty string if present,
|
|
69
|
+
// which preserves a trailing newline from the original file content)
|
|
70
|
+
const newContent = [...before, ...after].join('\n');
|
|
71
|
+
storage.writeSync(gitignorePath, newContent);
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=gitignore-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore-state.js","sourceRoot":"","sources":["../../src/config/gitignore-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,MAAM,CAAC,MAAM,iCAAiC,GAC5C,uEAAuE,CAAC;AAC1E,MAAM,CAAC,MAAM,kCAAkC,GAC7C,6CAA6C,CAAC;AAEhD,MAAM,2BAA2B,GAC/B,iCAAiC,GAAG,IAAI;IACxC,uBAAuB;IACvB,8BAA8B;IAC9B,kCAAkC,GAAG,IAAI,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,aAAqB,EACrB,OAAwB;IAExB,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACtC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAClD,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE,OAAO,GAAG,MAAM,GAAG,2BAA2B,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC5C,aAAqB,EACrB,OAAwB;IAExB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,OAAO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/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
package/dist/config/index.js
CHANGED
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
package/dist/config/init.d.ts
CHANGED
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { StorageProvider } from '../storage/index.js';
|
|
11
11
|
import type { SubSquadDefinition } from '../streams/types.js';
|
|
12
|
+
/**
|
|
13
|
+
* The curated built-in skills shipped on init.
|
|
14
|
+
* Only these skills are installed — not the full templates/skills/ directory.
|
|
15
|
+
*
|
|
16
|
+
* Drift policy: every entry MUST have a corresponding directory under
|
|
17
|
+
* packages/squad-sdk/templates/skills/. The install loop (below) throws on
|
|
18
|
+
* missing source dirs instead of silently skipping — see bradygaster/squad#1289
|
|
19
|
+
* for the prior silent-skip bug that shipped two missing skills in v0.10.0.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MANIFEST_SKILL_NAMES: readonly ["squad-conventions", "error-recovery", "secret-handling", "git-workflow", "session-recovery", "reviewer-protocol", "test-discipline", "agent-collaboration", "squad", "squad-version-check", "squad-help", "cross-squad-communication", "tiered-memory", "iterative-retrieval", "reflect", "cross-squad", "coordinator-source-of-truth", "coordinator-response-mode", "coordinator-init-mode"];
|
|
12
22
|
/**
|
|
13
23
|
* Get the SDK templates directory path.
|
|
14
24
|
*/
|
|
@@ -73,6 +83,14 @@ export interface InitOptions {
|
|
|
73
83
|
areaPath?: string;
|
|
74
84
|
iterationPath?: string;
|
|
75
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* State backend to use for this project.
|
|
88
|
+
* When 'orphan' or 'two-layer', adds a marker-delimited block to .gitignore
|
|
89
|
+
* so .squad/decisions.md and .squad/agents/*\/history.md are not accidentally
|
|
90
|
+
* staged into the working-tree commit graph.
|
|
91
|
+
* When 'local' (or undefined), removes the marker block if present.
|
|
92
|
+
*/
|
|
93
|
+
stateBackend?: 'local' | 'orphan' | 'two-layer' | 'external' | string;
|
|
76
94
|
}
|
|
77
95
|
/**
|
|
78
96
|
* Initialization result.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/config/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/config/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAU9D;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,0YAoBvB,CAAC;AAMX;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,eAAyC,GAAG,MAAM,GAAG,IAAI,CAiBpG;AA0BD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,QAAQ,EAAE,MAAM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AAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;CACvE;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mDAAmD;IACnD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AA2bD,KAAK,aAAa,GAAG,cAAc,GAAG,mBAAmB,GAAG,MAAM,CAAC;AA8HnE,wBAAsB,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,eAAyC,GAAG,OAAO,CAAC,UAAU,CAAC,CAqzB7H;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,eAAyC,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjI"}
|
package/dist/config/init.js
CHANGED
|
@@ -14,14 +14,20 @@ import { execFileSync } from 'node:child_process';
|
|
|
14
14
|
import { MODELS } from '../runtime/constants.js';
|
|
15
15
|
import { getRoleById } from '../roles/index.js';
|
|
16
16
|
import { ensureMemoryGovernanceDefaults } from '../memory/index.js';
|
|
17
|
+
import { addSquadStateGitignoreBlock, removeSquadStateGitignoreBlock } from './gitignore-state.js';
|
|
17
18
|
// ============================================================================
|
|
18
19
|
// Manifest-Curated Skills (must stay in sync with TEMPLATE_MANIFEST in CLI)
|
|
19
20
|
// ============================================================================
|
|
20
21
|
/**
|
|
21
22
|
* The curated built-in skills shipped on init.
|
|
22
23
|
* Only these skills are installed — not the full templates/skills/ directory.
|
|
24
|
+
*
|
|
25
|
+
* Drift policy: every entry MUST have a corresponding directory under
|
|
26
|
+
* packages/squad-sdk/templates/skills/. The install loop (below) throws on
|
|
27
|
+
* missing source dirs instead of silently skipping — see bradygaster/squad#1289
|
|
28
|
+
* for the prior silent-skip bug that shipped two missing skills in v0.10.0.
|
|
23
29
|
*/
|
|
24
|
-
const MANIFEST_SKILL_NAMES = [
|
|
30
|
+
export const MANIFEST_SKILL_NAMES = [
|
|
25
31
|
'squad-conventions',
|
|
26
32
|
'error-recovery',
|
|
27
33
|
'secret-handling',
|
|
@@ -30,8 +36,17 @@ const MANIFEST_SKILL_NAMES = [
|
|
|
30
36
|
'reviewer-protocol',
|
|
31
37
|
'test-discipline',
|
|
32
38
|
'agent-collaboration',
|
|
33
|
-
'squad
|
|
39
|
+
'squad',
|
|
34
40
|
'squad-version-check',
|
|
41
|
+
'squad-help',
|
|
42
|
+
'cross-squad-communication',
|
|
43
|
+
'tiered-memory',
|
|
44
|
+
'iterative-retrieval',
|
|
45
|
+
'reflect',
|
|
46
|
+
'cross-squad',
|
|
47
|
+
'coordinator-source-of-truth',
|
|
48
|
+
'coordinator-response-mode',
|
|
49
|
+
'coordinator-init-mode',
|
|
35
50
|
];
|
|
36
51
|
// ============================================================================
|
|
37
52
|
// Template Resolution
|
|
@@ -624,7 +639,7 @@ export async function initSquad(options, storage = new FSStorageProvider()) {
|
|
|
624
639
|
join(squadDir, 'decisions'),
|
|
625
640
|
join(squadDir, 'decisions', 'inbox'),
|
|
626
641
|
join(squadDir, 'memory'),
|
|
627
|
-
join(teamRoot, '.
|
|
642
|
+
join(teamRoot, '.github', 'skills'),
|
|
628
643
|
join(squadDir, 'plugins'),
|
|
629
644
|
join(squadDir, 'identity'),
|
|
630
645
|
join(squadDir, 'orchestration-log'),
|
|
@@ -728,6 +743,71 @@ export async function initSquad(options, storage = new FSStorageProvider()) {
|
|
|
728
743
|
skippedFiles.push(toRelativePath(raiAuditTrailPath));
|
|
729
744
|
}
|
|
730
745
|
// -------------------------------------------------------------------------
|
|
746
|
+
// Seed .squad/fact-checker/ files (policy and audit trail)
|
|
747
|
+
//
|
|
748
|
+
// Mirrors the Rai pattern above. Fact Checker is an always-on built-in
|
|
749
|
+
// (per bradygaster/squad#789 + #1254 — single agent, dual operating mode:
|
|
750
|
+
// Verification + Devil's Advocate) and gets its own state dir so its
|
|
751
|
+
// policy + audit trail are first-class artifacts the coordinator can
|
|
752
|
+
// reference, not embedded inside the agent's charter file.
|
|
753
|
+
//
|
|
754
|
+
// See bradygaster/squad#1299 for the design rationale.
|
|
755
|
+
// -------------------------------------------------------------------------
|
|
756
|
+
const factCheckerDir = join(squadDir, 'fact-checker');
|
|
757
|
+
const factCheckerPolicyPath = join(factCheckerDir, 'policy.md');
|
|
758
|
+
if (!storage.existsSync(factCheckerPolicyPath)) {
|
|
759
|
+
const templateSrc = templatesDir ? join(templatesDir, 'fact-checker-policy.md') : null;
|
|
760
|
+
if (templateSrc && storage.existsSync(templateSrc)) {
|
|
761
|
+
storage.copySync(templateSrc, factCheckerPolicyPath);
|
|
762
|
+
}
|
|
763
|
+
else {
|
|
764
|
+
// Minimal fallback if the template was stripped from the install (e.g.,
|
|
765
|
+
// pre-1299 squad-sdk). The full template at
|
|
766
|
+
// .squad-templates/fact-checker-policy.md is the canonical source.
|
|
767
|
+
const factCheckerPolicyFallback = `# Fact Checker Policy
|
|
768
|
+
|
|
769
|
+
> Verification & devil's-advocate methodology for this project.
|
|
770
|
+
|
|
771
|
+
## Verification Mode
|
|
772
|
+
|
|
773
|
+
Check claims about URLs, package names, API endpoints, file paths, function signatures, quoted text, and cross-references to team decisions. Issue one of:
|
|
774
|
+
|
|
775
|
+
- ✅ Verified — confirmed via source
|
|
776
|
+
- ⚠️ Unverified — plausible but could not confirm (flag, do not block)
|
|
777
|
+
- ❌ Contradicted — evidence contradicts the claim (**blocking** at Pre-Ship)
|
|
778
|
+
- 🔍 Needs Investigation — beyond current scope
|
|
779
|
+
|
|
780
|
+
## Devil's Advocate Mode
|
|
781
|
+
|
|
782
|
+
Produce briefs that include: steelman of the opposition, load-bearing assumptions, pre-mortem in 30 days, alternative approach, risk acceptance.
|
|
783
|
+
|
|
784
|
+
## Hard Rules
|
|
785
|
+
|
|
786
|
+
- Never cite a URL/package/API without verifying it exists
|
|
787
|
+
- Never invent measurement data or "production results"
|
|
788
|
+
- Never fabricate a counter-hypothesis
|
|
789
|
+
- Never block on opinion — only on ❌ Contradicted findings
|
|
790
|
+
|
|
791
|
+
## Audit Trail
|
|
792
|
+
|
|
793
|
+
All findings logged to \`.squad/fact-checker/audit-trail.md\` (append-only, succinct — verdict + citation, never raw source).
|
|
794
|
+
`;
|
|
795
|
+
await storage.write(factCheckerPolicyPath, factCheckerPolicyFallback);
|
|
796
|
+
}
|
|
797
|
+
createdFiles.push(toRelativePath(factCheckerPolicyPath));
|
|
798
|
+
}
|
|
799
|
+
else {
|
|
800
|
+
skippedFiles.push(toRelativePath(factCheckerPolicyPath));
|
|
801
|
+
}
|
|
802
|
+
const factCheckerAuditTrailPath = join(factCheckerDir, 'audit-trail.md');
|
|
803
|
+
if (!storage.existsSync(factCheckerAuditTrailPath)) {
|
|
804
|
+
await storage.write(factCheckerAuditTrailPath, '# Fact Checker Audit Trail\n\n> Append-only evidence log. Entries are succinct — verdict + citation, never raw source material.\n\n<!-- Fact Checker appends findings below -->\n');
|
|
805
|
+
createdFiles.push(toRelativePath(factCheckerAuditTrailPath));
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
skippedFiles.push(toRelativePath(factCheckerAuditTrailPath));
|
|
809
|
+
}
|
|
810
|
+
// -------------------------------------------------------------------------
|
|
731
811
|
// Create .squad/config.json for squad settings
|
|
732
812
|
// -------------------------------------------------------------------------
|
|
733
813
|
const squadConfigPath = join(squadDir, 'config.json');
|
|
@@ -827,8 +907,50 @@ export async function initSquad(options, storage = new FSStorageProvider()) {
|
|
|
827
907
|
const agentDir = join(agentsDir, agent.name);
|
|
828
908
|
agentDirs.push(agentDir);
|
|
829
909
|
// Create charter.md
|
|
910
|
+
//
|
|
911
|
+
// Built-in always-on agents (Rai, fact-checker) ship with rich
|
|
912
|
+
// charter templates at `templates/{role}-charter.md`. If a template
|
|
913
|
+
// exists for this agent's role, use that instead of the generic
|
|
914
|
+
// role-based stub — this gives the agent its full operating manual
|
|
915
|
+
// (verdict protocol, audit-trail rules, dual-mode declarations) from
|
|
916
|
+
// day one of `squad init`, matching the behavior of `squad upgrade`'s
|
|
917
|
+
// `ensureBuiltinAgents` path. See bradygaster/squad#1299.
|
|
830
918
|
const charterPath = join(agentDir, 'charter.md');
|
|
831
|
-
|
|
919
|
+
let charterContent = null;
|
|
920
|
+
if (templatesDir) {
|
|
921
|
+
// Lookup priority: exact role / name first, then their lowercase
|
|
922
|
+
// variants. This is needed because rich-charter files in `templates/`
|
|
923
|
+
// are stored lowercase-hyphenated (`rai-charter.md`,
|
|
924
|
+
// `fact-checker-charter.md`) while agent specs may use mixed case
|
|
925
|
+
// (e.g. role/name = "Rai"). On case-sensitive filesystems (Linux CI)
|
|
926
|
+
// the mixed-case lookup misses without the toLowerCase() fallback,
|
|
927
|
+
// and the agent silently falls back to the 478-byte generic stub —
|
|
928
|
+
// exactly the regression #1299 was fixing. Each candidate is only
|
|
929
|
+
// added if non-empty to avoid `-charter.md` lookups from blank names.
|
|
930
|
+
const seen = new Set();
|
|
931
|
+
const candidates = [];
|
|
932
|
+
for (const key of [agent.role, agent.name, agent.role?.toLowerCase(), agent.name?.toLowerCase()]) {
|
|
933
|
+
if (!key)
|
|
934
|
+
continue;
|
|
935
|
+
const filename = `${key}-charter.md`;
|
|
936
|
+
if (seen.has(filename))
|
|
937
|
+
continue;
|
|
938
|
+
seen.add(filename);
|
|
939
|
+
candidates.push(join(templatesDir, filename));
|
|
940
|
+
}
|
|
941
|
+
for (const candidate of candidates) {
|
|
942
|
+
if (storage.existsSync(candidate)) {
|
|
943
|
+
charterContent = storage.readSync(candidate) ?? null;
|
|
944
|
+
if (charterContent)
|
|
945
|
+
break;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
if (charterContent === null) {
|
|
950
|
+
// Fall back to the generic role-based charter for user-defined agents
|
|
951
|
+
// that don't have a rich template (everyone except Rai + fact-checker).
|
|
952
|
+
charterContent = generateCharter(agent, projectName, projectDescription);
|
|
953
|
+
}
|
|
832
954
|
await writeIfNotExists(charterPath, charterContent);
|
|
833
955
|
// Create history.md
|
|
834
956
|
const historyPath = join(agentDir, 'history.md');
|
|
@@ -938,24 +1060,60 @@ ${projectDescription ? `- **Description:** ${projectDescription}\n` : ''}- **Cre
|
|
|
938
1060
|
}
|
|
939
1061
|
// -------------------------------------------------------------------------
|
|
940
1062
|
// Copy starter skills
|
|
1063
|
+
//
|
|
1064
|
+
// Skills live at `.github/skills/{name}/SKILL.md` — Copilot CLI's canonical
|
|
1065
|
+
// custom-skills location (used by Copilot's own /skills loader and
|
|
1066
|
+
// referenced by the CLI's built-in agent prompts at sdk/index.js:2246,
|
|
1067
|
+
// 2252, 2595). Earlier versions of Squad installed to `.copilot/skills/`;
|
|
1068
|
+
// `squad upgrade` migrates any leftover manifest skills to the new
|
|
1069
|
+
// location (see upgrade.ts).
|
|
1070
|
+
//
|
|
1071
|
+
// bradygaster/squad#1126 (canonical issue; PR #1304) — adopt the canonical
|
|
1072
|
+
// .github/skills/ path.
|
|
941
1073
|
// -------------------------------------------------------------------------
|
|
942
|
-
const skillsDir = join(teamRoot, '.
|
|
1074
|
+
const skillsDir = join(teamRoot, '.github', 'skills');
|
|
943
1075
|
if (templatesDir && storage.existsSync(join(templatesDir, 'skills'))) {
|
|
944
1076
|
const skillsSrc = join(templatesDir, 'skills');
|
|
945
1077
|
const existingSkills = storage.existsSync(skillsDir) ? storage.listSync(skillsDir) : [];
|
|
946
1078
|
if (existingSkills.length === 0) {
|
|
1079
|
+
// Pre-check drift BEFORE writing any skill file so a manifest/template
|
|
1080
|
+
// mismatch fails atomically with no partial install left on disk. The
|
|
1081
|
+
// earlier shape ran the copy loop first and threw at the end — users
|
|
1082
|
+
// saw 8 of 10 skills appear, then an error, with no clean rollback.
|
|
1083
|
+
const missing = [];
|
|
1084
|
+
for (const skillName of MANIFEST_SKILL_NAMES) {
|
|
1085
|
+
if (!storage.existsSync(join(skillsSrc, skillName))) {
|
|
1086
|
+
missing.push(skillName);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
if (missing.length > 0) {
|
|
1090
|
+
// Manifest/templates drift — fail loudly so v0.10.0-style silent-skip
|
|
1091
|
+
// regressions (#1289) cannot reach users. End-users see this when an
|
|
1092
|
+
// installed @bradygaster/squad-sdk ships with its templates dir
|
|
1093
|
+
// missing skills the SDK code knows about — almost always a packaging
|
|
1094
|
+
// bug. The fix is to upgrade to a non-broken SDK version
|
|
1095
|
+
// (`squad upgrade`); the dev-facing sync-skill-templates.mjs script
|
|
1096
|
+
// is referenced only as the contributor-side root cause.
|
|
1097
|
+
throw new Error(`Skill template drift in installed @bradygaster/squad-sdk: ` +
|
|
1098
|
+
`MANIFEST_SKILL_NAMES references ${missing.length} skill(s) ` +
|
|
1099
|
+
`missing from the SDK templates dir (${skillsSrc}): ${missing.join(', ')}. ` +
|
|
1100
|
+
`This is a packaging bug — try \`squad upgrade\` or reinstall the SDK; ` +
|
|
1101
|
+
`if it persists, please report it at https://github.com/bradygaster/squad/issues. ` +
|
|
1102
|
+
`(Contributors: re-run \`node scripts/sync-skill-templates.mjs\` from the repo root before packaging.)`);
|
|
1103
|
+
}
|
|
947
1104
|
storage.mkdirSync(skillsDir, { recursive: true });
|
|
948
1105
|
for (const skillName of MANIFEST_SKILL_NAMES) {
|
|
949
1106
|
const srcSkill = join(skillsSrc, skillName);
|
|
950
|
-
|
|
951
|
-
copyRecursiveSync(srcSkill, join(skillsDir, skillName), storage);
|
|
952
|
-
}
|
|
1107
|
+
copyRecursiveSync(srcSkill, join(skillsDir, skillName), storage);
|
|
953
1108
|
}
|
|
954
|
-
createdFiles.push('.
|
|
1109
|
+
createdFiles.push('.github/skills');
|
|
955
1110
|
}
|
|
956
1111
|
}
|
|
957
1112
|
// -------------------------------------------------------------------------
|
|
958
1113
|
// Create .gitattributes for merge drivers
|
|
1114
|
+
// Append-only mutable state files use union merge to handle concurrent appends.
|
|
1115
|
+
// Note: .squad/casting/* files are identity (not mutable) so they don't need
|
|
1116
|
+
// union merge and are NOT listed here.
|
|
959
1117
|
// -------------------------------------------------------------------------
|
|
960
1118
|
const gitattributesPath = join(teamRoot, '.gitattributes');
|
|
961
1119
|
const unionRules = [
|
|
@@ -964,6 +1122,7 @@ ${projectDescription ? `- **Description:** ${projectDescription}\n` : ''}- **Cre
|
|
|
964
1122
|
'.squad/log/** merge=union',
|
|
965
1123
|
'.squad/orchestration-log/** merge=union',
|
|
966
1124
|
'.squad/rai/audit-trail.md merge=union',
|
|
1125
|
+
'.squad/fact-checker/audit-trail.md merge=union',
|
|
967
1126
|
];
|
|
968
1127
|
let existingAttrs = '';
|
|
969
1128
|
if (storage.existsSync(gitattributesPath)) {
|
|
@@ -981,6 +1140,10 @@ ${projectDescription ? `- **Description:** ${projectDescription}\n` : ''}- **Cre
|
|
|
981
1140
|
// Create .gitignore entries for runtime state (logs, inbox, sessions)
|
|
982
1141
|
// These paths are written during normal squad operation but should not be
|
|
983
1142
|
// committed to version control (they are runtime state).
|
|
1143
|
+
//
|
|
1144
|
+
// Note: .squad/casting/* is AUTHORITATIVE IDENTITY (team-defined agent
|
|
1145
|
+
// universe, persistent name registry, history). It belongs on 'main', not
|
|
1146
|
+
// on the squad-state orphan branch. Do NOT add casting/* to ignoreEntries.
|
|
984
1147
|
// -------------------------------------------------------------------------
|
|
985
1148
|
const gitignorePath = join(teamRoot, '.gitignore');
|
|
986
1149
|
const ignoreEntries = [
|
|
@@ -999,13 +1162,24 @@ ${projectDescription ? `- **Description:** ${projectDescription}\n` : ''}- **Cre
|
|
|
999
1162
|
if (missingIgnore.length > 0) {
|
|
1000
1163
|
const block = (existingIgnore && !existingIgnore.endsWith('\n') ? '\n' : '')
|
|
1001
1164
|
+ '# Squad: ignore runtime state (logs, inbox, sessions)\n'
|
|
1165
|
+
+ '# Note: .squad/casting/* is identity and MUST be committed to main, not ignored\n'
|
|
1002
1166
|
+ missingIgnore.join('\n') + '\n';
|
|
1003
1167
|
await storage.append(gitignorePath, block);
|
|
1004
1168
|
createdFiles.push(toRelativePath(gitignorePath));
|
|
1005
1169
|
}
|
|
1006
1170
|
// -------------------------------------------------------------------------
|
|
1007
|
-
//
|
|
1171
|
+
// Conditionally add/remove squad-state .gitignore block
|
|
1172
|
+
// When stateBackend is 'orphan' or 'two-layer', .squad/decisions.md and
|
|
1173
|
+
// .squad/agents/*/history.md are owned by the squad-state branch — add a
|
|
1174
|
+
// marker-delimited block so `git add .` cannot accidentally stage them.
|
|
1175
|
+
// When stateBackend is 'local' (or undefined), remove the block if present.
|
|
1008
1176
|
// -------------------------------------------------------------------------
|
|
1177
|
+
if (options.stateBackend === 'orphan' || options.stateBackend === 'two-layer') {
|
|
1178
|
+
addSquadStateGitignoreBlock(gitignorePath, storage);
|
|
1179
|
+
}
|
|
1180
|
+
else {
|
|
1181
|
+
removeSquadStateGitignoreBlock(gitignorePath, storage);
|
|
1182
|
+
}
|
|
1009
1183
|
let isGitHub = true;
|
|
1010
1184
|
try {
|
|
1011
1185
|
const remoteUrl = execFileSync('git', ['remote', 'get-url', 'origin'], { cwd: teamRoot, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|