@goodandready/dsh-github-ops 0.2.8 → 0.2.9
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/lib/index.js +39 -17
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -126,38 +126,47 @@ export function renderToolResult(toolName, value) {
|
|
|
126
126
|
return [{ type: 'text', text }]
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
// Unwrap Volatile boxes before any caller reads a value. A volatile field holds a box
|
|
130
|
+
// rather than its value, and the Loader mutates those boxes in place.
|
|
131
|
+
export function plainConfig(value) {
|
|
132
|
+
if (value === null || typeof value !== 'object') return value
|
|
133
|
+
if (Array.isArray(value)) return value.map(plainConfig)
|
|
134
|
+
if (typeof value.get === 'function') return plainConfig(value.get())
|
|
135
|
+
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, plainConfig(v)]))
|
|
136
|
+
}
|
|
137
|
+
|
|
129
138
|
export const Config = Schema.object({
|
|
130
|
-
tokenEnv: Schema.string().role('credential-ref').default('GITHUB_TOKEN')
|
|
139
|
+
tokenEnv: Schema.string().volatile().role('credential-ref').default('GITHUB_TOKEN')
|
|
131
140
|
.description('Name used to look up access: the DSH credential, then the environment variable, then the gh CLI. The value itself is never stored in settings.'),
|
|
132
|
-
tokenSource: Schema.string().default('auto')
|
|
141
|
+
tokenSource: Schema.string().volatile().default('auto')
|
|
133
142
|
.description('Where access comes from: "auto" tries the DSH credential, then the environment variable, then the gh CLI; pin it to "credentials", "env" or "gh" to use one source only.'),
|
|
134
|
-
defaultRepository: Schema.string().default('')
|
|
143
|
+
defaultRepository: Schema.string().volatile().default('')
|
|
135
144
|
.description('Default repository as "owner/repo"; used when a tool call omits the repository.'),
|
|
136
|
-
baseUrl: Schema.string().default('https://api.github.com')
|
|
145
|
+
baseUrl: Schema.string().volatile().default('https://api.github.com')
|
|
137
146
|
.description('GitHub API base URL; change it for GitHub Enterprise.'),
|
|
138
|
-
timeoutMs: Schema.number().default(30000)
|
|
147
|
+
timeoutMs: Schema.number().volatile().default(30000)
|
|
139
148
|
.description('Per-request timeout in milliseconds.'),
|
|
140
|
-
maxRetries: Schema.number().default(2)
|
|
149
|
+
maxRetries: Schema.number().volatile().default(2)
|
|
141
150
|
.description('Retries for a read (GET/HEAD) on a network failure, a timeout or a 5xx. Writes are never retried automatically.'),
|
|
142
|
-
reviewRulesJson: Schema.string().default('')
|
|
151
|
+
reviewRulesJson: Schema.string().volatile().default('')
|
|
143
152
|
.description('Optional review-rule overrides as JSON: sensitivePaths, sensitiveSeverity, attentionPaths, migrationPaths, testsRequired, sourcePatterns, testPatterns, largeDiffLines.'),
|
|
144
|
-
oauthClientId: Schema.string().default(DEFAULT_CLIENT_ID)
|
|
153
|
+
oauthClientId: Schema.string().volatile().default(DEFAULT_CLIENT_ID)
|
|
145
154
|
.description('OAuth application id used by gh_auth_login. The default is the public GitHub CLI application.'),
|
|
146
|
-
oauthScope: Schema.string().default(DEFAULT_SCOPE)
|
|
155
|
+
oauthScope: Schema.string().volatile().default(DEFAULT_SCOPE)
|
|
147
156
|
.description('OAuth scope requested by gh_auth_login.'),
|
|
148
|
-
oauthClientSecretRef: Schema.string().role('credential-ref').default('')
|
|
157
|
+
oauthClientSecretRef: Schema.string().volatile().role('credential-ref').default('')
|
|
149
158
|
.description('Optional credential holding the OAuth client secret, for apps that require one.'),
|
|
150
|
-
accessFile: Schema.string().default('')
|
|
159
|
+
accessFile: Schema.string().volatile().default('')
|
|
151
160
|
.description('Where gh_auth_login stores its sign-in (default: $DSH_HOME/github-ops-auth.json, mode 0600).'),
|
|
152
|
-
interceptLinks: Schema.boolean().default(false)
|
|
161
|
+
interceptLinks: Schema.boolean().volatile().default(false)
|
|
153
162
|
.description('Let a github.com link clicked in the conversation also select that repository for the Source control tab and the sidebar panel. Off by default: the link always opens in the browser either way.'),
|
|
154
|
-
guidance: Schema.boolean().default(true)
|
|
163
|
+
guidance: Schema.boolean().volatile().default(true)
|
|
155
164
|
.description('Add a short paragraph about this plugin to the system prompt: which tool for which question, when the repository argument can be omitted, and that approvals belong to the host.'),
|
|
156
|
-
guidanceText: Schema.string().default('')
|
|
165
|
+
guidanceText: Schema.string().volatile().default('')
|
|
157
166
|
.description('Replace the default guidance paragraph with your own text.'),
|
|
158
|
-
cacheTtlMs: Schema.number().default(60000)
|
|
167
|
+
cacheTtlMs: Schema.number().volatile().default(60000)
|
|
159
168
|
.description('How long a read stays cached, in milliseconds. A composed report then costs one request set instead of many; writes always go to the network.'),
|
|
160
|
-
reviewJobTimeoutMs: Schema.number().default(120000)
|
|
169
|
+
reviewJobTimeoutMs: Schema.number().volatile().default(120000)
|
|
161
170
|
.description('How long a background review job may run before it is cancelled.'),
|
|
162
171
|
})
|
|
163
172
|
|
|
@@ -167,7 +176,20 @@ export function apply(ctx, rawConfig) {
|
|
|
167
176
|
|
|
168
177
|
ctx.inject(['settings'], (sctx) => {
|
|
169
178
|
try {
|
|
170
|
-
settingsScope =
|
|
179
|
+
settingsScope = {
|
|
180
|
+
get: () => {
|
|
181
|
+
try {
|
|
182
|
+
const row = sctx.settings?.describe?.().find((r) => r && r.ns === name);
|
|
183
|
+
return row?.value ?? config ?? {};
|
|
184
|
+
} catch { return config ?? {}; }
|
|
185
|
+
},
|
|
186
|
+
replace: async (next) => {
|
|
187
|
+
try {
|
|
188
|
+
const row = sctx.settings?.describe?.().find((r) => r && r.ns === name);
|
|
189
|
+
return await sctx.settings?.replace?.(name, next, row?.revision);
|
|
190
|
+
} catch {}
|
|
191
|
+
},
|
|
192
|
+
}
|
|
171
193
|
} catch (err) {
|
|
172
194
|
ctx.logger?.warn?.('[dsh-github-ops] settings namespace unavailable:', err && err.message)
|
|
173
195
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-github-ops",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "GitHub operations for DeepSeek Harness: releases, tags, a guarded generic API pass-through, workflow runs, secrets and sanitized mirror publication.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"@deepseek-ai/dsh-credentials": "^0.1.7-rc.2 || ^0.2.0-rc.1",
|
|
42
42
|
"@deepseek-ai/dsh-settings": "^0.1.7-rc.2 || ^0.2.0-rc.1",
|
|
43
43
|
"@deepseek-ai/dsh-tools": "^0.1.7-rc.2 || ^0.2.0-rc.1",
|
|
44
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
44
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
48
48
|
"@deepseek-ai/dsh-credentials": "^0.1.0-rc.8",
|
|
49
49
|
"@deepseek-ai/dsh-settings": "^0.1.0-rc.8",
|
|
50
50
|
"@deepseek-ai/dsh-tools": "^0.1.0-rc.8",
|
|
51
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
51
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
52
52
|
},
|
|
53
53
|
"repository": {
|
|
54
54
|
"type": "git",
|