opencode-swarm 7.8.1 → 7.10.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/dist/cli/index.js +1099 -738
- package/dist/commands/archive.error-handling.test.d.ts +9 -0
- package/dist/commands/benchmark.error-handling.test.d.ts +7 -0
- package/dist/commands/dark-matter.error-handling.test.d.ts +1 -0
- package/dist/commands/handoff.error-handling.adversarial.test.d.ts +1 -0
- package/dist/commands/handoff.error-handling.test.d.ts +1 -0
- package/dist/commands/index.not-found.adversarial.test.d.ts +12 -0
- package/dist/commands/index.not-found.test.d.ts +11 -0
- package/dist/commands/registration-parity.test.d.ts +1 -0
- package/dist/commands/registry.find-similar.adversarial.test.d.ts +1 -0
- package/dist/commands/registry.find-similar.test.d.ts +1 -0
- package/dist/commands/simulate.report-write.adversarial.test.d.ts +1 -0
- package/dist/commands/simulate.report-write.test.d.ts +1 -0
- package/dist/git/branch.d.ts +19 -0
- package/dist/index.js +3262 -2893
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for archive.ts graceful handling of corrupt evidence files (Task 1.6)
|
|
3
|
+
*
|
|
4
|
+
* Verifies that the try/catch in handleArchiveCommand's dry-run loop
|
|
5
|
+
* catches exceptions from loadEvidence and skips corrupt/unreadable files.
|
|
6
|
+
*
|
|
7
|
+
* Uses real filesystem operations like existing archive tests.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adversarial security tests for command-not-found UX in createSwarmCommandHandler.
|
|
3
|
+
*
|
|
4
|
+
* Attack vectors covered:
|
|
5
|
+
* 1. Very long command name (10000+ chars) — does it hang or crash?
|
|
6
|
+
* 2. Command with special characters (script injection, shell injection, template literals)
|
|
7
|
+
* 3. Command with newlines/embedded control chars — does it break output format?
|
|
8
|
+
* 4. Command with unicode/emoji — handled gracefully?
|
|
9
|
+
* 5. Extremely deep tokens array (1000 elements) — does findSimilarCommands handle it?
|
|
10
|
+
* 6. Null bytes in command name
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for command-not-found UX improvement in createSwarmCommandHandler.
|
|
3
|
+
*
|
|
4
|
+
* Covers:
|
|
5
|
+
* - Unknown single-word command shows "Command not found" + suggestions + footer
|
|
6
|
+
* - Unknown compound command shows header with command name
|
|
7
|
+
* - Empty tokens (empty array) → returns buildHelpText() output
|
|
8
|
+
* - Command with no similar matches → shows header + footer only (no "Did you mean" section)
|
|
9
|
+
* - Multiple similar commands returned → all shown with bullet format
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/git/branch.d.ts
CHANGED
|
@@ -76,6 +76,24 @@ declare function detectDefaultRemoteBranch(cwd: string): string | null;
|
|
|
76
76
|
export declare function resetToRemoteBranch(cwd: string, options?: {
|
|
77
77
|
pruneBranches?: boolean;
|
|
78
78
|
}): ResetToRemoteBranchResult;
|
|
79
|
+
export interface ResetToMainAfterMergeResult {
|
|
80
|
+
success: boolean;
|
|
81
|
+
targetBranch: string;
|
|
82
|
+
previousBranch: string;
|
|
83
|
+
message: string;
|
|
84
|
+
branchDeleted: boolean;
|
|
85
|
+
changesDiscarded: boolean;
|
|
86
|
+
warnings: string[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Aggressive git reset for post-merge cleanup.
|
|
90
|
+
* Handles the common scenario: feature branch PR merged, local has uncommitted artifacts.
|
|
91
|
+
* Steps: detect default branch → safety check → fetch → checkout → discard changes → reset → delete branch.
|
|
92
|
+
* Safety guard: refuses if current branch has commits not on any remote tracking branch.
|
|
93
|
+
*/
|
|
94
|
+
export declare function resetToMainAfterMerge(cwd: string, options?: {
|
|
95
|
+
pruneBranches?: boolean;
|
|
96
|
+
}): ResetToMainAfterMergeResult;
|
|
79
97
|
/**
|
|
80
98
|
* DI seam for testability. Contains all test-mocked exports.
|
|
81
99
|
* Internal calls should use _internals.fn() instead of fn() directly.
|
|
@@ -85,5 +103,6 @@ export declare const _internals: {
|
|
|
85
103
|
detectDefaultRemoteBranch: typeof detectDefaultRemoteBranch;
|
|
86
104
|
getDefaultBaseBranch: typeof getDefaultBaseBranch;
|
|
87
105
|
resetToRemoteBranch: typeof resetToRemoteBranch;
|
|
106
|
+
resetToMainAfterMerge: typeof resetToMainAfterMerge;
|
|
88
107
|
};
|
|
89
108
|
export {};
|