@linxin666/dsh-client-ui-task-board 0.4.3 → 0.4.4
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/README.i18n.yaml +2 -2
- package/README.md +17 -10
- package/README.zh.md +17 -10
- package/lib/client.js +1350 -552
- package/lib/client.js.map +1 -1
- package/lib/index.js +655 -134
- package/lib/types/client/board/TaskForm.d.ts +19 -1
- package/lib/types/client/board/preset-label.d.ts +22 -0
- package/lib/types/client/host-api.d.ts +24 -1
- package/lib/types/client/locales.d.ts +38 -2
- package/lib/types/client/schedule-zone.d.ts +47 -0
- package/lib/types/core/controller.d.ts +1 -0
- package/lib/types/core/degraded-reason.d.ts +46 -0
- package/lib/types/core/package-name.d.ts +9 -0
- package/lib/types/core/schedule.d.ts +95 -20
- package/lib/types/core/subtask.d.ts +30 -11
- package/lib/types/core/tasks.d.ts +26 -2
- package/lib/types/core/use-cases/task-create.d.ts +2 -1
- package/lib/types/core/use-cases/task-schedule.d.ts +8 -4
- package/lib/types/core/use-cases/task-update.d.ts +1 -1
- package/lib/types/host-ledger.d.ts +56 -4
- package/lib/types/host-runner.d.ts +76 -3
- package/lib/types/host-service.d.ts +26 -0
- package/lib/types/protocol.d.ts +9 -3
- package/package.json +25 -25
- package/src/client/board/LinkSubtaskModal.tsx +21 -11
- package/src/client/board/NewTaskModal.tsx +271 -150
- package/src/client/board/TaskCard.tsx +24 -5
- package/src/client/board/TaskDetail.tsx +83 -33
- package/src/client/board/TaskForm.tsx +48 -3
- package/src/client/board/preset-label.ts +44 -0
- package/src/client/board.module.css +114 -5
- package/src/client/host-api.ts +109 -6
- package/src/client/index.ts +5 -1
- package/src/client/locales.ts +82 -8
- package/src/client/schedule-zone.ts +135 -0
- package/src/core/controller.ts +7 -2
- package/src/core/degraded-reason.ts +81 -0
- package/src/core/package-name.ts +9 -0
- package/src/core/schedule.ts +211 -55
- package/src/core/store.ts +10 -1
- package/src/core/subtask.ts +77 -22
- package/src/core/tasks.ts +38 -4
- package/src/core/use-cases/task-create.ts +14 -2
- package/src/core/use-cases/task-schedule.ts +17 -6
- package/src/core/use-cases/task-update.ts +4 -1
- package/src/host/agent-tools.ts +40 -8
- package/src/host-ledger.ts +203 -23
- package/src/host-runner.ts +164 -14
- package/src/host-service.ts +94 -17
- package/src/protocol.ts +27 -8
- package/lib/types/host/run-guarded.d.ts +0 -39
- package/src/host/run-guarded.ts +0 -76
package/src/host/run-guarded.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Generated by scripts/sync-shared.mjs from shared/host/run-guarded.ts. Do not edit this copy; edit the shared source and run "node scripts/sync-shared.mjs".
|
|
2
|
-
/**
|
|
3
|
-
* Async-boundary guard shared by the plugin family's Host halves: every
|
|
4
|
-
* fire-and-forget promise chain and callback the host runtime does not own
|
|
5
|
-
* (route handlers, timers, event listeners, spawned work) funnels through
|
|
6
|
-
* these helpers. The dsh host installs a process-level fail-loud guard that
|
|
7
|
-
* turns ANY unhandled promise rejection into a whole-process exit — one
|
|
8
|
-
* plugin's stray rejection would otherwise take every plugin down. These
|
|
9
|
-
* helpers exist so that failure mode is structurally impossible in family
|
|
10
|
-
* code: the rejection becomes a logged error at the plugin boundary instead.
|
|
11
|
-
*
|
|
12
|
-
* Complements the aggregate's shell isolation (packages/dsh-web-all): the
|
|
13
|
-
* shell contains import/activation failures at boot; runGuarded contains
|
|
14
|
-
* run-time failures after activation.
|
|
15
|
-
* @module dsh-web-shared/host/run-guarded
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/** Format one failure line for logging. */
|
|
19
|
-
function formatFailure(label: string, error: unknown): Error {
|
|
20
|
-
return new Error(`[${label}] unhandled async failure: ${error instanceof Error ? error.stack ?? error.message : String(error)}`)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Run one async operation, logging (never propagating) a rejection. Use for
|
|
25
|
-
* promises whose lifecycle the caller does not await: spawned work, retry
|
|
26
|
-
* loops, background flushes. Returns the original promise so callers can
|
|
27
|
-
* still chain when they want to.
|
|
28
|
-
* @param promise - the work to shield; any thenable.
|
|
29
|
-
* @param label - log prefix naming the work site.
|
|
30
|
-
* @param log - error sink; defaults to console.error.
|
|
31
|
-
* @returns the input promise (rejection already consumed).
|
|
32
|
-
*/
|
|
33
|
-
export function runGuarded<T>(promise: PromiseLike<T>, label: string, log: (error: unknown) => void = console.error): PromiseLike<T> {
|
|
34
|
-
void Promise.resolve(promise).catch(error => {
|
|
35
|
-
log(formatFailure(label, error))
|
|
36
|
-
})
|
|
37
|
-
return promise
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Wrap one callback so every invocation is individually guarded: a rejection
|
|
42
|
-
* inside one call is logged and swallowed instead of escaping into whatever
|
|
43
|
-
* infrastructure invoked the callback (HTTP server, EventEmitter, interval).
|
|
44
|
-
* Sync throws are caught identically; a returned promise is replaced by
|
|
45
|
-
* `undefined` after guarding (callers that need the original rejection should
|
|
46
|
-
* await inside their own try/catch instead).
|
|
47
|
-
* @param label - log prefix naming the callback site.
|
|
48
|
-
* @param handler - the work to guard.
|
|
49
|
-
* @param log - error sink; defaults to console.error.
|
|
50
|
-
* @returns a wrapped callback with the same parameter list.
|
|
51
|
-
*/
|
|
52
|
-
export function guardedHandler<A extends unknown[]>(
|
|
53
|
-
label: string,
|
|
54
|
-
handler: (...args: A) => unknown,
|
|
55
|
-
log: (error: unknown) => void = console.error,
|
|
56
|
-
): (...args: A) => unknown {
|
|
57
|
-
return (...args: A) => {
|
|
58
|
-
try {
|
|
59
|
-
const result = handler(...args)
|
|
60
|
-
if (isPromiseLike(result)) {
|
|
61
|
-
void Promise.resolve(result).catch(error => {
|
|
62
|
-
log(formatFailure(label, error))
|
|
63
|
-
})
|
|
64
|
-
return undefined
|
|
65
|
-
}
|
|
66
|
-
return result
|
|
67
|
-
} catch (error) {
|
|
68
|
-
log(formatFailure(label, error))
|
|
69
|
-
return undefined
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function isPromiseLike(value: unknown): value is PromiseLike<unknown> {
|
|
75
|
-
return typeof value === 'object' && value !== null && typeof (value as PromiseLike<unknown>).then === 'function'
|
|
76
|
-
}
|