@magnusekdahl/parallix 1.2.0 → 1.3.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/index.js +190 -185
- package/lib/agents/agents.js +737 -838
- package/lib/agents/agents.ts +930 -0
- package/lib/agents/claude-telemetry.js +149 -154
- package/lib/agents/claude-telemetry.ts +233 -0
- package/lib/agents/claude.js +121 -131
- package/lib/agents/claude.ts +156 -0
- package/lib/agents/codex-telemetry.js +176 -164
- package/lib/agents/codex-telemetry.ts +205 -0
- package/lib/agents/codex.js +168 -201
- package/lib/agents/codex.ts +236 -0
- package/lib/agents/limit-hit.js +216 -226
- package/lib/agents/limit-hit.ts +262 -0
- package/lib/agents/mistral-telemetry.js +7 -10
- package/lib/agents/mistral-telemetry.ts +44 -0
- package/lib/agents/mistral.js +40 -58
- package/lib/agents/mistral.ts +84 -0
- package/lib/agents/opencode-export.js +126 -127
- package/lib/agents/opencode-export.ts +160 -0
- package/lib/agents/opencode-telemetry.js +282 -261
- package/lib/agents/opencode-telemetry.ts +350 -0
- package/lib/agents/opencode.js +263 -305
- package/lib/agents/opencode.ts +370 -0
- package/lib/agents/stage-telemetry.js +23 -24
- package/lib/agents/stage-telemetry.ts +47 -0
- package/lib/commands/active.js +502 -579
- package/lib/commands/active.ts +665 -0
- package/lib/commands/checkpoint.js +98 -74
- package/lib/commands/checkpoint.ts +79 -0
- package/lib/commands/config.js +61 -31
- package/lib/commands/config.ts +47 -0
- package/lib/commands/coverage-gate.js +271 -246
- package/lib/commands/coverage-gate.ts +362 -0
- package/lib/commands/diff.js +140 -119
- package/lib/commands/diff.ts +125 -0
- package/lib/commands/draft.js +770 -923
- package/lib/commands/draft.ts +1021 -0
- package/lib/commands/handoff.js +588 -608
- package/lib/commands/handoff.ts +694 -0
- package/lib/commands/integrate.js +1332 -1463
- package/lib/commands/integrate.ts +1688 -0
- package/lib/commands/mission-start.js +279 -237
- package/lib/commands/mission-start.ts +263 -0
- package/lib/commands/rebase.js +606 -582
- package/lib/commands/rebase.ts +635 -0
- package/lib/commands/repair-handoff.js +181 -179
- package/lib/commands/repair-handoff.ts +228 -0
- package/lib/commands/resolve-conflict.js +121 -102
- package/lib/commands/resolve-conflict.ts +112 -0
- package/lib/commands/review.js +3 -4
- package/lib/commands/review.ts +14 -0
- package/lib/commands/setup-review.js +4 -5
- package/lib/commands/setup-review.ts +14 -0
- package/lib/commands/setup.js +3 -3
- package/lib/commands/setup.ts +2 -0
- package/lib/commands/stats-backfill.js +394 -359
- package/lib/commands/stats-backfill.ts +418 -0
- package/lib/commands/stats.js +1424 -1665
- package/lib/commands/stats.ts +2186 -0
- package/lib/commands/status.js +219 -200
- package/lib/commands/status.ts +219 -0
- package/lib/commands/verify.js +3 -1
- package/lib/commands/verify.ts +2 -0
- package/lib/core/fmt.js +140 -211
- package/lib/core/fmt.ts +189 -0
- package/lib/core/git.js +121 -102
- package/lib/core/git.ts +146 -0
- package/lib/core/gitignore.js +59 -106
- package/lib/core/gitignore.ts +103 -0
- package/lib/core/mission-utils.js +833 -875
- package/lib/core/mission-utils.ts +998 -0
- package/lib/core/nels.js +112 -127
- package/lib/core/nels.ts +189 -0
- package/lib/core/persistent-data-migration.js +247 -205
- package/lib/core/persistent-data-migration.ts +255 -0
- package/lib/core/product-config.js +400 -476
- package/lib/core/product-config.ts +518 -0
- package/lib/core/runtime-matrix.js +41 -87
- package/lib/core/runtime-matrix.ts +84 -0
- package/lib/core/spawn-tee.js +152 -192
- package/lib/core/spawn-tee.ts +202 -0
- package/lib/core/state-map.js +92 -92
- package/lib/core/state-map.ts +115 -0
- package/lib/core/storage.js +101 -129
- package/lib/core/storage.ts +182 -0
- package/lib/core/subagent-limit.js +15 -16
- package/lib/core/subagent-limit.ts +25 -0
- package/lib/core/verification.js +148 -138
- package/lib/core/verification.ts +200 -0
- package/lib/index.js +142 -59
- package/lib/index.ts +134 -0
- package/lib/review/rebase.js +142 -145
- package/lib/review/rebase.ts +188 -0
- package/lib/review/review-adapter.js +99 -87
- package/lib/review/review-adapter.ts +198 -0
- package/lib/review/review-artifacts.js +486 -629
- package/lib/review/review-artifacts.ts +622 -0
- package/lib/review/review-commands.js +1220 -1373
- package/lib/review/review-commands.ts +1579 -0
- package/lib/review/review-events.js +544 -886
- package/lib/review/review-events.ts +954 -0
- package/lib/review/review-loop.js +945 -1020
- package/lib/review/review-loop.ts +1174 -0
- package/lib/review/review-polling.js +86 -115
- package/lib/review/review-polling.ts +194 -0
- package/lib/review/review-prompts.js +154 -189
- package/lib/review/review-prompts.ts +182 -0
- package/lib/review/review-state.js +246 -225
- package/lib/review/review-state.ts +353 -0
- package/lib/review/review.js +63 -84
- package/lib/review/review.ts +138 -0
- package/lib/tools/backlog.js +694 -680
- package/lib/tools/backlog.ts +835 -0
- package/lib/tools/forgejo.js +1270 -1405
- package/lib/tools/forgejo.ts +1793 -0
- package/lib/tools/gatekeeper.js +106 -96
- package/lib/tools/gatekeeper.ts +124 -0
- package/lib/tools/redgreen.js +200 -181
- package/lib/tools/redgreen.ts +221 -0
- package/lib/tools/sessions.js +58 -52
- package/lib/tools/sessions.ts +81 -0
- package/lib/tools/setup-review.js +902 -975
- package/lib/tools/setup-review.ts +1152 -0
- package/package.json +7 -5
- package/prompts/draft.md +1 -0
- package/prompts/portfolio.md +1 -1
- package/px.js +226 -210
package/lib/core/gitignore.js
CHANGED
|
@@ -1,112 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* committed to version control.
|
|
8
|
-
*/
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
6
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
7
|
const WORKFLOW_ENTRIES = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
'.workflow/',
|
|
9
|
+
'.sessions/',
|
|
10
|
+
'.forgejo-local/',
|
|
11
|
+
'workflow/.cache/',
|
|
12
|
+
'workflow/.sessions/',
|
|
13
|
+
'workflow/config/agents.local.json',
|
|
14
|
+
'agents.local.json',
|
|
17
15
|
];
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Ensure that a repository's .gitignore contains all workflow-generated paths.
|
|
21
|
-
*
|
|
22
|
-
* Handles:
|
|
23
|
-
* - Missing .gitignore: creates one with all 7 entries
|
|
24
|
-
* - Existing .gitignore: appends only missing entries, skips duplicates
|
|
25
|
-
* - Symlinked .gitignore: skips modification, logs warning
|
|
26
|
-
* - Non-git directories: skips gracefully without crashing
|
|
27
|
-
*
|
|
28
|
-
* @param {string} rootDir - Path to the repository root
|
|
29
|
-
* @param {object} options - Injected dependencies
|
|
30
|
-
* @param {Function} [options.existsSyncFn] - fs.existsSync replacement
|
|
31
|
-
* @param {Function} [options.lstatSyncFn] - fs.lstatSync replacement
|
|
32
|
-
* @param {Function} [options.readFileSyncFn] - fs.readFileSync replacement
|
|
33
|
-
* @param {Function} [options.writeFileSyncFn] - fs.writeFileSync replacement
|
|
34
|
-
* @param {Function} [options.logFn] - Logger function
|
|
35
|
-
* @returns {{ ok: boolean, created: boolean, appended: number, skipped: boolean, reason?: string }}
|
|
36
|
-
*/
|
|
37
16
|
function ensureWorkflowGitignore(rootDir, options = {}) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} = options;
|
|
45
|
-
|
|
46
|
-
const gitignorePath = path.join(rootDir, '.gitignore');
|
|
47
|
-
const gitDirPath = path.join(rootDir, '.git');
|
|
48
|
-
|
|
49
|
-
// Check if this is a git repository
|
|
50
|
-
if (!existsSyncFn(gitDirPath)) {
|
|
51
|
-
logFn(`[gitignore] Skipping ${rootDir}: not a git repository (no .git directory)`);
|
|
52
|
-
return { ok: true, created: false, appended: 0, skipped: true, reason: 'not-a-git-repo' };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Check if .gitignore exists
|
|
56
|
-
if (!existsSyncFn(gitignorePath)) {
|
|
57
|
-
// Create new .gitignore with all entries
|
|
58
|
-
const content = WORKFLOW_ENTRIES.join('\n') + '\n';
|
|
59
|
-
writeFileSyncFn(gitignorePath, content, 'utf8');
|
|
60
|
-
logFn(`[gitignore] Created ${gitignorePath} with ${WORKFLOW_ENTRIES.length} entries`);
|
|
61
|
-
return { ok: true, created: true, appended: WORKFLOW_ENTRIES.length, skipped: false };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// .gitignore exists - check for symlink
|
|
65
|
-
try {
|
|
66
|
-
const stat = lstatSyncFn(gitignorePath);
|
|
67
|
-
if (stat.isSymbolicLink()) {
|
|
68
|
-
logFn(`[gitignore] Skipping ${gitignorePath}: symbolic link, not modifying`);
|
|
69
|
-
return { ok: true, created: false, appended: 0, skipped: true, reason: 'symlink' };
|
|
17
|
+
const { existsSyncFn = node_fs_1.default.existsSync, lstatSyncFn = node_fs_1.default.lstatSync, readFileSyncFn = node_fs_1.default.readFileSync, writeFileSyncFn = node_fs_1.default.writeFileSync, logFn = () => { }, } = options;
|
|
18
|
+
const gitignorePath = node_path_1.default.join(rootDir, '.gitignore');
|
|
19
|
+
const gitDirPath = node_path_1.default.join(rootDir, '.git');
|
|
20
|
+
if (!existsSyncFn(gitDirPath)) {
|
|
21
|
+
logFn(`[gitignore] Skipping ${rootDir}: not a git repository (no .git directory)`);
|
|
22
|
+
return { ok: true, created: false, appended: 0, skipped: true, reason: 'not-a-git-repo' };
|
|
70
23
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
24
|
+
if (!existsSyncFn(gitignorePath)) {
|
|
25
|
+
const content = [...WORKFLOW_ENTRIES].join('\n') + '\n';
|
|
26
|
+
writeFileSyncFn(gitignorePath, content, 'utf8');
|
|
27
|
+
logFn(`[gitignore] Created ${gitignorePath} with ${WORKFLOW_ENTRIES.length} entries`);
|
|
28
|
+
return { ok: true, created: true, appended: WORKFLOW_ENTRIES.length, skipped: false };
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const stat = lstatSyncFn(gitignorePath);
|
|
32
|
+
if (stat.isSymbolicLink()) {
|
|
33
|
+
logFn(`[gitignore] Skipping ${gitignorePath}: symbolic link, not modifying`);
|
|
34
|
+
return { ok: true, created: false, appended: 0, skipped: true, reason: 'symlink' };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (_err) {
|
|
38
|
+
// If we can't stat, fall through to read
|
|
39
|
+
}
|
|
40
|
+
let existingContent;
|
|
41
|
+
try {
|
|
42
|
+
existingContent = readFileSyncFn(gitignorePath, 'utf8');
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
46
|
+
logFn(`[gitignore] Could not read ${gitignorePath}: ${message}`);
|
|
47
|
+
return { ok: false, created: false, appended: 0, skipped: false, reason: `read-error: ${message}` };
|
|
48
|
+
}
|
|
49
|
+
const existingLines = existingContent.split(/\r?\n/);
|
|
50
|
+
const existingEntries = new Set(existingLines
|
|
51
|
+
.map((line) => line.trim())
|
|
52
|
+
.filter((line) => line.length > 0 && !line.startsWith('#')));
|
|
53
|
+
const missingEntries = WORKFLOW_ENTRIES.filter(entry => !existingEntries.has(entry));
|
|
54
|
+
if (missingEntries.length === 0) {
|
|
55
|
+
logFn(`[gitignore] ${gitignorePath} already contains all ${WORKFLOW_ENTRIES.length} workflow entries`);
|
|
56
|
+
return { ok: true, created: false, appended: 0, skipped: false };
|
|
57
|
+
}
|
|
58
|
+
const newContent = existingContent + '\n' + [...missingEntries].join('\n') + '\n';
|
|
59
|
+
writeFileSyncFn(gitignorePath, newContent, 'utf8');
|
|
60
|
+
logFn(`[gitignore] Appended ${missingEntries.length} missing entries to ${gitignorePath}`);
|
|
61
|
+
return { ok: true, created: false, appended: missingEntries.length, skipped: false };
|
|
108
62
|
}
|
|
109
|
-
|
|
63
|
+
ensureWorkflowGitignore.WORKFLOW_ENTRIES = WORKFLOW_ENTRIES;
|
|
64
|
+
ensureWorkflowGitignore.ensureWorkflowGitignore = ensureWorkflowGitignore;
|
|
110
65
|
module.exports = ensureWorkflowGitignore;
|
|
111
|
-
module.exports.ensureWorkflowGitignore = ensureWorkflowGitignore;
|
|
112
|
-
module.exports.WORKFLOW_ENTRIES = WORKFLOW_ENTRIES;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
const WORKFLOW_ENTRIES = [
|
|
5
|
+
'.workflow/',
|
|
6
|
+
'.sessions/',
|
|
7
|
+
'.forgejo-local/',
|
|
8
|
+
'workflow/.cache/',
|
|
9
|
+
'workflow/.sessions/',
|
|
10
|
+
'workflow/config/agents.local.json',
|
|
11
|
+
'agents.local.json',
|
|
12
|
+
] as const;
|
|
13
|
+
|
|
14
|
+
interface GitignoreResult {
|
|
15
|
+
ok: boolean;
|
|
16
|
+
created: boolean;
|
|
17
|
+
appended: number;
|
|
18
|
+
skipped: boolean;
|
|
19
|
+
reason?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface EnsureOptions {
|
|
23
|
+
existsSyncFn?: typeof fs.existsSync;
|
|
24
|
+
lstatSyncFn?: typeof fs.lstatSync;
|
|
25
|
+
readFileSyncFn?: typeof fs.readFileSync;
|
|
26
|
+
writeFileSyncFn?: typeof fs.writeFileSync;
|
|
27
|
+
logFn?: (msg: string) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type EnsureWorkflowGitignoreFn = {
|
|
31
|
+
(rootDir: string, options?: EnsureOptions): GitignoreResult;
|
|
32
|
+
WORKFLOW_ENTRIES: typeof WORKFLOW_ENTRIES;
|
|
33
|
+
ensureWorkflowGitignore: EnsureWorkflowGitignoreFn;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function ensureWorkflowGitignore(rootDir: string, options: EnsureOptions = {}): GitignoreResult {
|
|
37
|
+
const {
|
|
38
|
+
existsSyncFn = fs.existsSync,
|
|
39
|
+
lstatSyncFn = fs.lstatSync,
|
|
40
|
+
readFileSyncFn = fs.readFileSync,
|
|
41
|
+
writeFileSyncFn = fs.writeFileSync,
|
|
42
|
+
logFn = () => {},
|
|
43
|
+
} = options;
|
|
44
|
+
|
|
45
|
+
const gitignorePath = path.join(rootDir, '.gitignore');
|
|
46
|
+
const gitDirPath = path.join(rootDir, '.git');
|
|
47
|
+
|
|
48
|
+
if (!existsSyncFn(gitDirPath)) {
|
|
49
|
+
logFn(`[gitignore] Skipping ${rootDir}: not a git repository (no .git directory)`);
|
|
50
|
+
return { ok: true, created: false, appended: 0, skipped: true, reason: 'not-a-git-repo' };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!existsSyncFn(gitignorePath)) {
|
|
54
|
+
const content = [...WORKFLOW_ENTRIES].join('\n') + '\n';
|
|
55
|
+
writeFileSyncFn(gitignorePath, content, 'utf8');
|
|
56
|
+
logFn(`[gitignore] Created ${gitignorePath} with ${WORKFLOW_ENTRIES.length} entries`);
|
|
57
|
+
return { ok: true, created: true, appended: WORKFLOW_ENTRIES.length, skipped: false };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
const stat = lstatSyncFn(gitignorePath);
|
|
62
|
+
if (stat.isSymbolicLink()) {
|
|
63
|
+
logFn(`[gitignore] Skipping ${gitignorePath}: symbolic link, not modifying`);
|
|
64
|
+
return { ok: true, created: false, appended: 0, skipped: true, reason: 'symlink' };
|
|
65
|
+
}
|
|
66
|
+
} catch (_err: unknown) {
|
|
67
|
+
// If we can't stat, fall through to read
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
let existingContent: string;
|
|
71
|
+
try {
|
|
72
|
+
existingContent = readFileSyncFn(gitignorePath, 'utf8');
|
|
73
|
+
} catch (err: unknown) {
|
|
74
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
75
|
+
logFn(`[gitignore] Could not read ${gitignorePath}: ${message}`);
|
|
76
|
+
return { ok: false, created: false, appended: 0, skipped: false, reason: `read-error: ${message}` };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const existingLines = existingContent.split(/\r?\n/);
|
|
80
|
+
const existingEntries = new Set(
|
|
81
|
+
existingLines
|
|
82
|
+
.map((line: string) => line.trim())
|
|
83
|
+
.filter((line: string) => line.length > 0 && !line.startsWith('#'))
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const missingEntries = WORKFLOW_ENTRIES.filter(entry => !existingEntries.has(entry));
|
|
87
|
+
|
|
88
|
+
if (missingEntries.length === 0) {
|
|
89
|
+
logFn(`[gitignore] ${gitignorePath} already contains all ${WORKFLOW_ENTRIES.length} workflow entries`);
|
|
90
|
+
return { ok: true, created: false, appended: 0, skipped: false };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const newContent = existingContent + '\n' + [...missingEntries].join('\n') + '\n';
|
|
94
|
+
writeFileSyncFn(gitignorePath, newContent, 'utf8');
|
|
95
|
+
logFn(`[gitignore] Appended ${missingEntries.length} missing entries to ${gitignorePath}`);
|
|
96
|
+
|
|
97
|
+
return { ok: true, created: false, appended: missingEntries.length, skipped: false };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
(ensureWorkflowGitignore as EnsureWorkflowGitignoreFn).WORKFLOW_ENTRIES = WORKFLOW_ENTRIES;
|
|
101
|
+
(ensureWorkflowGitignore as EnsureWorkflowGitignoreFn).ensureWorkflowGitignore = ensureWorkflowGitignore as EnsureWorkflowGitignoreFn;
|
|
102
|
+
|
|
103
|
+
export = ensureWorkflowGitignore;
|