@oss-autopilot/core 1.9.0 → 1.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.bundle.cjs +61 -61
- package/dist/commands/comments.js +11 -0
- package/dist/commands/config.js +0 -9
- package/dist/commands/daily.js +25 -2
- package/dist/commands/setup.d.ts +0 -1
- package/dist/commands/setup.js +0 -26
- package/dist/core/gist-state-store.d.ts +169 -0
- package/dist/core/gist-state-store.js +424 -0
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.js +2 -1
- package/dist/core/state-persistence.d.ts +14 -2
- package/dist/core/state-persistence.js +46 -12
- package/dist/core/state-schema.d.ts +17 -42
- package/dist/core/state-schema.js +10 -19
- package/dist/core/state.d.ts +38 -29
- package/dist/core/state.js +121 -53
- package/dist/core/types.d.ts +2 -2
- package/dist/core/types.js +2 -2
- package/dist/core/utils.d.ts +30 -0
- package/dist/core/utils.js +36 -0
- package/package.json +1 -1
package/dist/core/utils.js
CHANGED
|
@@ -88,6 +88,42 @@ export function getCacheDir() {
|
|
|
88
88
|
}
|
|
89
89
|
return dir;
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns the path to the local Gist ID file (`~/.oss-autopilot/gist-id`).
|
|
93
|
+
*
|
|
94
|
+
* This file stores the GitHub Gist ID used by the Gist-based persistence layer,
|
|
95
|
+
* avoiding a search-by-description API call on every session.
|
|
96
|
+
*
|
|
97
|
+
* Implicitly creates the data directory via {@link getDataDir} if it does not exist.
|
|
98
|
+
*
|
|
99
|
+
* @returns Absolute path to `gist-id`
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const gistIdPath = getGistIdPath();
|
|
103
|
+
* // "/Users/you/.oss-autopilot/gist-id"
|
|
104
|
+
*/
|
|
105
|
+
export function getGistIdPath() {
|
|
106
|
+
const dir = getDataDir();
|
|
107
|
+
return path.join(dir, 'gist-id');
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Returns the path to the local state cache file (`~/.oss-autopilot/state-cache.json`).
|
|
111
|
+
*
|
|
112
|
+
* This file is a write-through cache of the Gist-hosted state, used as a fallback
|
|
113
|
+
* when the GitHub API is unreachable (degraded mode).
|
|
114
|
+
*
|
|
115
|
+
* Implicitly creates the data directory via {@link getDataDir} if it does not exist.
|
|
116
|
+
*
|
|
117
|
+
* @returns Absolute path to `state-cache.json`
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* const cachePath = getStateCachePath();
|
|
121
|
+
* // "/Users/you/.oss-autopilot/state-cache.json"
|
|
122
|
+
*/
|
|
123
|
+
export function getStateCachePath() {
|
|
124
|
+
const dir = getDataDir();
|
|
125
|
+
return path.join(dir, 'state-cache.json');
|
|
126
|
+
}
|
|
91
127
|
// Validation patterns for GitHub owner and repo names
|
|
92
128
|
const OWNER_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
93
129
|
const REPO_PATTERN = /^[a-zA-Z0-9_.-]+$/;
|