@goodandready/dsh-kanban 0.1.27 → 0.1.28
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/client.js +3 -0
- package/lib/gitea.js +4 -4
- package/lib/index.js +4 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -3651,6 +3651,9 @@ window.__ModuleLoader__.load({
|
|
|
3651
3651
|
function registerFirst(ctx, candidates, component) {
|
|
3652
3652
|
for (const entry of candidates) {
|
|
3653
3653
|
try {
|
|
3654
|
+
if (typeof ctx.slots?.has === 'function' && !ctx.slots.has(entry.name)) {
|
|
3655
|
+
continue
|
|
3656
|
+
}
|
|
3654
3657
|
let ok = false
|
|
3655
3658
|
ctx.slots.inject(entry.name, () => {
|
|
3656
3659
|
ctx.slots.register(entry, component)
|
package/lib/gitea.js
CHANGED
|
@@ -79,10 +79,10 @@ export function createGiteaClient({ getConfig, resolveToken, fetchImpl = fetch,
|
|
|
79
79
|
async function request(method, path, body) {
|
|
80
80
|
const config = getConfig()
|
|
81
81
|
const baseUrl = normalizeBaseUrl(config?.giteaUrl)
|
|
82
|
-
if (baseUrl === '') throw Object.assign(new Error('
|
|
82
|
+
if (baseUrl === '') throw Object.assign(new Error('Gitea URL is not configured'), { code: 'unconfigured' })
|
|
83
83
|
|
|
84
84
|
const token = await resolveToken(config?.giteaTokenRef)
|
|
85
|
-
if (!token) throw Object.assign(new Error('
|
|
85
|
+
if (!token) throw Object.assign(new Error('Gitea credential token is not configured'), { code: 'unconfigured' })
|
|
86
86
|
|
|
87
87
|
const controller = new AbortController()
|
|
88
88
|
const timer = setTimeout(() => controller.abort(), timeoutMs)
|
|
@@ -104,7 +104,7 @@ export function createGiteaClient({ getConfig, resolveToken, fetchImpl = fetch,
|
|
|
104
104
|
try { payload = text.trim() === '' ? null : JSON.parse(text) } catch { payload = null }
|
|
105
105
|
if (!res.ok) {
|
|
106
106
|
// Тело ответа наружу не выносим: в нём может быть эхо заголовков.
|
|
107
|
-
throw Object.assign(new Error(`Gitea
|
|
107
|
+
throw Object.assign(new Error(`Gitea HTTP error ${res.status}`), { code: 'http', status: res.status })
|
|
108
108
|
}
|
|
109
109
|
return payload
|
|
110
110
|
} finally {
|
|
@@ -116,7 +116,7 @@ export function createGiteaClient({ getConfig, resolveToken, fetchImpl = fetch,
|
|
|
116
116
|
const o = safeSegment(owner)
|
|
117
117
|
const r = safeSegment(repo)
|
|
118
118
|
if (o === undefined || r === undefined) {
|
|
119
|
-
throw Object.assign(new Error('
|
|
119
|
+
throw Object.assign(new Error('Invalid owner or repository segment'), { code: 'bad-segment' })
|
|
120
120
|
}
|
|
121
121
|
return `/repos/${o}/${r}${suffix}`
|
|
122
122
|
}
|
package/lib/index.js
CHANGED
|
@@ -76,9 +76,12 @@ export const Config = z.object(Object.fromEntries(
|
|
|
76
76
|
Object.entries(CONFIG_DEFAULTS).map(([field, fallback]) => {
|
|
77
77
|
// Узел схемы выбирается по типу умолчания. Пропустить здесь булево значит
|
|
78
78
|
// объявить его строкой — и плагин не загрузится вовсе с «invalid config».
|
|
79
|
-
|
|
79
|
+
let node = typeof fallback === 'number' ? z.number()
|
|
80
80
|
: typeof fallback === 'boolean' ? z.boolean()
|
|
81
81
|
: z.string()
|
|
82
|
+
if (field === 'giteaTokenRef' || field === 'webhookSecretRef') {
|
|
83
|
+
node = node.role('credential-ref')
|
|
84
|
+
}
|
|
82
85
|
return [field, node.default(fallback).description(CONFIG_HINTS[field] ?? '')]
|
|
83
86
|
}),
|
|
84
87
|
))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-kanban",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"description": "Visual Kanban board for DeepSeek Harness: Gitea-backed tasks, workflow columns, and a dedicated agent session per task.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|