@oss-autopilot/core 3.42.5 → 3.44.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-pre-action.js +8 -3
- package/dist/cli-registry.js +428 -27
- package/dist/cli.bundle.cjs +212 -156
- package/dist/commands/check-integration.js +5 -1
- package/dist/commands/cleanup.d.ts +80 -0
- package/dist/commands/cleanup.js +334 -0
- package/dist/commands/comments.d.ts +14 -1
- package/dist/commands/comments.js +17 -5
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +63 -6
- package/dist/commands/daily-dismiss-filter.d.ts +7 -0
- package/dist/commands/daily-dismiss-filter.js +17 -1
- package/dist/commands/daily-ledger.d.ts +150 -0
- package/dist/commands/daily-ledger.js +248 -0
- package/dist/commands/daily-recent-prs.d.ts +26 -0
- package/dist/commands/daily-recent-prs.js +55 -0
- package/dist/commands/daily-render.d.ts +2 -1
- package/dist/commands/daily-render.js +4 -1
- package/dist/commands/daily.d.ts +5 -1
- package/dist/commands/daily.js +83 -93
- package/dist/commands/dashboard-cache.d.ts +2 -0
- package/dist/commands/dashboard-cache.js +33 -8
- package/dist/commands/dashboard-data.js +113 -69
- package/dist/commands/dashboard-gist-sync.js +3 -1
- package/dist/commands/dashboard-lifecycle.d.ts +36 -8
- package/dist/commands/dashboard-lifecycle.js +132 -39
- package/dist/commands/dashboard-process.d.ts +49 -1
- package/dist/commands/dashboard-process.js +111 -12
- package/dist/commands/dashboard-server.js +89 -23
- package/dist/commands/detect-formatters.js +1 -0
- package/dist/commands/dismiss.js +11 -7
- package/dist/commands/doctor.d.ts +15 -1
- package/dist/commands/doctor.js +66 -5
- package/dist/commands/draft.d.ts +77 -0
- package/dist/commands/draft.js +218 -0
- package/dist/commands/eval.js +1 -0
- package/dist/commands/fork-prune.d.ts +58 -0
- package/dist/commands/fork-prune.js +247 -0
- package/dist/commands/guidelines.d.ts +69 -2
- package/dist/commands/guidelines.js +158 -14
- package/dist/commands/index.d.ts +29 -4
- package/dist/commands/index.js +20 -3
- package/dist/commands/issue-thread.d.ts +46 -0
- package/dist/commands/issue-thread.js +123 -0
- package/dist/commands/ledger-backfill.d.ts +9 -0
- package/dist/commands/ledger-backfill.js +44 -1
- package/dist/commands/list-mark-done.d.ts +2 -1
- package/dist/commands/list-mark-done.js +3 -1
- package/dist/commands/list-move-tier.d.ts +2 -1
- package/dist/commands/list-move-tier.js +3 -1
- package/dist/commands/local-repos.js +10 -5
- package/dist/commands/locate-issue-list.d.ts +40 -17
- package/dist/commands/locate-issue-list.js +148 -88
- package/dist/commands/move.js +7 -1
- package/dist/commands/overnight-handoff.d.ts +17 -7
- package/dist/commands/overnight-handoff.js +36 -14
- package/dist/commands/overnight-push-prep.d.ts +14 -8
- package/dist/commands/overnight-push-prep.js +107 -35
- package/dist/commands/overnight-tool-rules.d.ts +54 -0
- package/dist/commands/overnight-tool-rules.js +217 -0
- package/dist/commands/overnight.d.ts +5 -6
- package/dist/commands/overnight.js +61 -140
- package/dist/commands/parse-list.js +7 -1
- package/dist/commands/policy.d.ts +90 -0
- package/dist/commands/policy.js +276 -0
- package/dist/commands/pr-create.d.ts +48 -0
- package/dist/commands/pr-create.js +200 -0
- package/dist/commands/pr-preflight.d.ts +69 -0
- package/dist/commands/pr-preflight.js +348 -0
- package/dist/commands/repo-vet.d.ts +9 -0
- package/dist/commands/repo-vet.js +36 -11
- package/dist/commands/scout-bridge.js +18 -8
- package/dist/commands/search.js +7 -0
- package/dist/commands/setup.d.ts +3 -3
- package/dist/commands/setup.js +160 -48
- package/dist/commands/skip-add.js +10 -1
- package/dist/commands/startup.d.ts +12 -3
- package/dist/commands/startup.js +82 -49
- package/dist/commands/state-cmd.d.ts +2 -0
- package/dist/commands/state-cmd.js +5 -1
- package/dist/commands/stats.js +1 -0
- package/dist/commands/status.js +6 -0
- package/dist/commands/strategy.js +1 -0
- package/dist/commands/validation.d.ts +5 -0
- package/dist/commands/validation.js +5 -0
- package/dist/commands/vet-list.d.ts +6 -0
- package/dist/commands/vet-list.js +26 -1
- package/dist/commands/vet.d.ts +20 -0
- package/dist/commands/vet.js +133 -2
- package/dist/commands/work.d.ts +4 -0
- package/dist/commands/work.js +34 -11
- package/dist/core/__fixtures__/prompt-injection-payloads.js +31 -0
- package/dist/core/anti-llm-policy.d.ts +3 -0
- package/dist/core/anti-llm-policy.js +3 -0
- package/dist/core/auth.js +2 -0
- package/dist/core/ci-analysis.d.ts +7 -2
- package/dist/core/ci-analysis.js +76 -21
- package/dist/core/commit-date.d.ts +45 -0
- package/dist/core/commit-date.js +45 -0
- package/dist/core/compliance-score.d.ts +3 -0
- package/dist/core/compliance-score.js +13 -9
- package/dist/core/config-registry.d.ts +27 -2
- package/dist/core/config-registry.js +94 -7
- package/dist/core/contributing.d.ts +2 -3
- package/dist/core/contributing.js +2 -3
- package/dist/core/daily-logic.d.ts +30 -5
- package/dist/core/daily-logic.js +68 -19
- package/dist/core/errors.d.ts +37 -3
- package/dist/core/errors.js +54 -5
- package/dist/core/fork-prune.d.ts +149 -0
- package/dist/core/fork-prune.js +333 -0
- package/dist/core/gist-health.d.ts +15 -3
- package/dist/core/gist-health.js +8 -0
- package/dist/core/gist-state-store.d.ts +24 -4
- package/dist/core/gist-state-store.js +98 -51
- package/dist/core/github-stats.d.ts +110 -16
- package/dist/core/github-stats.js +295 -110
- package/dist/core/http-cache.d.ts +0 -10
- package/dist/core/http-cache.js +0 -19
- package/dist/core/index.d.ts +13 -6
- package/dist/core/index.js +16 -6
- package/dist/core/issue-conversation.d.ts +8 -2
- package/dist/core/issue-conversation.js +31 -12
- package/dist/core/local-config.d.ts +95 -0
- package/dist/core/local-config.js +270 -0
- package/dist/core/merged-pr-notes.d.ts +2 -2
- package/dist/core/pacing.d.ts +41 -0
- package/dist/core/pacing.js +115 -0
- package/dist/core/pagination.d.ts +55 -0
- package/dist/core/pagination.js +59 -0
- package/dist/core/paths.d.ts +7 -0
- package/dist/core/paths.js +9 -0
- package/dist/core/pr-assembly.d.ts +2 -0
- package/dist/core/pr-assembly.js +6 -2
- package/dist/core/pr-graphql.d.ts +53 -4
- package/dist/core/pr-graphql.js +87 -14
- package/dist/core/pr-monitor.d.ts +35 -12
- package/dist/core/pr-monitor.js +110 -26
- package/dist/core/pr-preflight.d.ts +154 -0
- package/dist/core/pr-preflight.js +753 -0
- package/dist/core/pr-quality-rubric.d.ts +0 -6
- package/dist/core/pr-quality-rubric.js +0 -8
- package/dist/core/pr-template.d.ts +2 -0
- package/dist/core/pr-template.js +5 -1
- package/dist/core/prose-script.d.ts +72 -0
- package/dist/core/prose-script.js +223 -0
- package/dist/core/repo-policy.d.ts +111 -0
- package/dist/core/repo-policy.js +428 -0
- package/dist/core/repo-score-manager.d.ts +66 -0
- package/dist/core/repo-score-manager.js +140 -1
- package/dist/core/review-analysis.d.ts +49 -21
- package/dist/core/review-analysis.js +89 -15
- package/dist/core/reviewed-prs-fetch.js +11 -29
- package/dist/core/reviewed-prs.js +8 -15
- package/dist/core/stale-data.d.ts +78 -0
- package/dist/core/stale-data.js +153 -0
- package/dist/core/state-persistence.d.ts +62 -27
- package/dist/core/state-persistence.js +338 -119
- package/dist/core/state-schema.d.ts +152 -210
- package/dist/core/state-schema.js +232 -80
- package/dist/core/state.d.ts +81 -8
- package/dist/core/state.js +239 -46
- package/dist/core/status-determination.js +32 -12
- package/dist/core/strategy.js +3 -1
- package/dist/core/types.d.ts +22 -1
- package/dist/core/types.js +1 -0
- package/dist/core/untrusted-content.d.ts +30 -11
- package/dist/core/untrusted-content.js +95 -42
- package/dist/core/urls.d.ts +33 -0
- package/dist/core/urls.js +94 -0
- package/dist/dashboard/assets/chart-panel-B-nLVgzQ.js +3 -0
- package/dist/dashboard/assets/index-5IvMGokL.js +55 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/formatters/json.d.ts +432 -10
- package/dist/formatters/json.js +156 -1
- package/package.json +6 -6
- package/dist/core/ci-enforced-tools.d.ts +0 -35
- package/dist/core/ci-enforced-tools.js +0 -109
- package/dist/core/comment-decision.d.ts +0 -79
- package/dist/core/comment-decision.js +0 -82
- package/dist/core/extraction-categories.d.ts +0 -55
- package/dist/core/extraction-categories.js +0 -108
- package/dist/core/follow-up-history.d.ts +0 -40
- package/dist/core/follow-up-history.js +0 -71
- package/dist/core/issue-effort.d.ts +0 -29
- package/dist/core/issue-effort.js +0 -47
- package/dist/core/maintainer-hints.d.ts +0 -23
- package/dist/core/maintainer-hints.js +0 -36
- package/dist/core/workflow-state.d.ts +0 -56
- package/dist/core/workflow-state.js +0 -101
- package/dist/dashboard/assets/chart-panel-DPKNBUts.js +0 -3
- package/dist/dashboard/assets/index-B25bZOYX.js +0 -55
|
@@ -6,16 +6,20 @@
|
|
|
6
6
|
import { AgentState } from './types.js';
|
|
7
7
|
/**
|
|
8
8
|
* Acquire an advisory file lock using exclusive-create (`wx` flag).
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
9
|
+
* A held lock is retried for about a second; a stale one (see
|
|
10
|
+
* {@link readStaleLock}) is taken over through an atomic rename.
|
|
11
|
+
* @returns The lock content written, for {@link releaseLock} and for
|
|
12
|
+
* re-checking ownership before the write the lock protects.
|
|
13
|
+
* @throws StateLockTimeoutError (a ConcurrencyError) if the lock is still
|
|
14
|
+
* held after the wait. Nothing has been written at that point.
|
|
12
15
|
*/
|
|
13
|
-
export declare function acquireLock(lockPath: string):
|
|
16
|
+
export declare function acquireLock(lockPath: string): string;
|
|
14
17
|
/**
|
|
15
|
-
* Release an advisory file lock, but only if
|
|
16
|
-
*
|
|
18
|
+
* Release an advisory file lock, but only if it still holds `held`, the
|
|
19
|
+
* content {@link acquireLock} returned. A missing lock is ignored; any other
|
|
20
|
+
* failure is warned about, never thrown (this runs in a `finally`).
|
|
17
21
|
*/
|
|
18
|
-
export declare function releaseLock(lockPath: string): void;
|
|
22
|
+
export declare function releaseLock(lockPath: string, held: string): void;
|
|
19
23
|
/**
|
|
20
24
|
* Write data to `filePath` atomically by first writing to a temporary file
|
|
21
25
|
* in the same directory and then renaming. Rename is atomic on POSIX filesystems,
|
|
@@ -61,12 +65,31 @@ export interface LoadRecoveryInfo {
|
|
|
61
65
|
reason: string;
|
|
62
66
|
}
|
|
63
67
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
68
|
+
* What saveState's compare-and-swap and reloadStateIfChanged compare (#2006).
|
|
69
|
+
* mtime alone misses two writes in one timestamp quantum (whole seconds on
|
|
70
|
+
* FAT and some network or synced mounts). Every write here is an atomic
|
|
71
|
+
* rename, which usually lands on a new inode; size catches in-place writers.
|
|
72
|
+
* Where the file system synthesizes or reuses inode numbers (FAT/vfat, cifs
|
|
73
|
+
* with noserverino, FUSE without use_ino, ext4 reusing a freed inode), or
|
|
74
|
+
* reports `ino` as 0 on both sides, the check degrades to mtime + size.
|
|
75
|
+
* `ino` is the decimal string of a bigint stat: a 64-bit NTFS file ID does
|
|
76
|
+
* not fit a double, and two IDs that round to the same number would match.
|
|
77
|
+
*/
|
|
78
|
+
export interface StateFileIdentity {
|
|
79
|
+
mtimeMs: number;
|
|
80
|
+
ino: string;
|
|
81
|
+
size: number;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Result of {@link loadState}: the loaded state, the file's identity for
|
|
85
|
+
* change detection, and (only when the main file was rejected) recovery
|
|
86
|
+
* details. `fileId` is null only when there was no state file to take a
|
|
87
|
+
* baseline from. Fresh state that replaces a rejected file keeps the
|
|
88
|
+
* rejected file's identity, so an intervening valid write is not clobbered.
|
|
66
89
|
*/
|
|
67
90
|
export interface LoadStateResult {
|
|
68
91
|
state: AgentState;
|
|
69
|
-
|
|
92
|
+
fileId: StateFileIdentity | null;
|
|
70
93
|
recovery?: LoadRecoveryInfo;
|
|
71
94
|
}
|
|
72
95
|
/**
|
|
@@ -77,39 +100,51 @@ export interface LoadStateResult {
|
|
|
77
100
|
* dropped silently. `source` names the copy in the warning.
|
|
78
101
|
*/
|
|
79
102
|
export declare function warnMalformedWorkClaims(raw: unknown, state: AgentState, source: string): void;
|
|
103
|
+
/**
|
|
104
|
+
* Refuse stored state whose schema version is above this release's. Treating
|
|
105
|
+
* it as invalid would restore an older backup (or fresh state) over newer
|
|
106
|
+
* data. `source` names the copy in the message.
|
|
107
|
+
*/
|
|
108
|
+
export declare function assertNotNewerVersion(raw: unknown, source: string): void;
|
|
80
109
|
/**
|
|
81
110
|
* Load state from file, or create initial state if none exists.
|
|
82
111
|
* If the main state file is corrupted, attempts to restore from the most recent backup.
|
|
83
112
|
* Performs migration from legacy ./data/ location if needed.
|
|
84
|
-
* @returns Object with the loaded state, the file's
|
|
113
|
+
* @returns Object with the loaded state, the file's identity (for change detection),
|
|
85
114
|
* and recovery details when the main file was rejected.
|
|
86
|
-
* @throws Error when the state file exists but cannot be read due to a
|
|
87
|
-
*
|
|
88
|
-
*
|
|
115
|
+
* @throws Error when the state file exists but cannot be read due to a file
|
|
116
|
+
* system error (EACCES/EPERM get guidance, others are rethrown as they are)
|
|
117
|
+
* or was written by a newer release. Neither is corruption, so
|
|
118
|
+
* restore-or-fresh would mask it and risk clobbering data. No file is touched.
|
|
89
119
|
*/
|
|
90
120
|
export declare function loadState(): LoadStateResult;
|
|
91
121
|
/**
|
|
92
122
|
* Persist state to disk, creating a timestamped backup of the previous
|
|
93
123
|
* state file first. Retains at most 10 backup files.
|
|
94
124
|
*
|
|
95
|
-
* When `
|
|
96
|
-
*
|
|
97
|
-
* the caller last loaded
|
|
98
|
-
* overwriting. This prevents the classic
|
|
99
|
-
* race across processes (see
|
|
100
|
-
*
|
|
125
|
+
* When `expected` is provided (non-null), implements optimistic
|
|
126
|
+
* compare-and-swap: if the on-disk file's identity (mtime, inode, size)
|
|
127
|
+
* differs from the one the caller last loaded or saved, throws
|
|
128
|
+
* `ConcurrencyError` instead of overwriting. This prevents the classic
|
|
129
|
+
* read-modify-write lost-update race across processes (see issues #1030,
|
|
130
|
+
* #2006). Pass `null` to disable the check (no file at load).
|
|
101
131
|
*
|
|
102
132
|
* The check runs *inside* the advisory lock so the compare-and-swap is
|
|
103
133
|
* atomic with respect to the write.
|
|
104
134
|
*
|
|
105
|
-
* @returns The file's
|
|
106
|
-
* @throws ConcurrencyError when `
|
|
107
|
-
*
|
|
135
|
+
* @returns The file's identity after writing (for change detection).
|
|
136
|
+
* @throws ConcurrencyError when `expected` is provided and the on-disk
|
|
137
|
+
* identity no longer matches, or the file cannot be stat'ed.
|
|
108
138
|
*/
|
|
109
|
-
export declare function saveState(state: Readonly<AgentState>,
|
|
139
|
+
export declare function saveState(state: Readonly<AgentState>, expected?: StateFileIdentity | null): StateFileIdentity;
|
|
110
140
|
/**
|
|
111
141
|
* Re-read state from disk if the file has been modified since the last load/save.
|
|
112
|
-
*
|
|
113
|
-
*
|
|
142
|
+
* Compares file identity (single statSync call) to avoid unnecessary JSON parsing;
|
|
143
|
+
* a null baseline always reloads.
|
|
144
|
+
* @returns The new state and identity if reloaded, or null if no change detected
|
|
145
|
+
* (or the file is gone).
|
|
146
|
+
* @throws What {@link loadState} throws, after one retry for transient
|
|
147
|
+
* resource errors: a newer-version state file or a persistent file system
|
|
148
|
+
* error must reach the caller, not be served as stale state.
|
|
114
149
|
*/
|
|
115
|
-
export declare function reloadStateIfChanged(
|
|
150
|
+
export declare function reloadStateIfChanged(lastLoaded: StateFileIdentity | null): LoadStateResult | null;
|