@xi4z/dsh-utils 0.5.0 → 0.7.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/README.md +99 -104
- package/cordis.patch.yml +36 -37
- package/lib/index.d.ts +5 -63
- package/lib/index.js +6 -859
- package/lib/index.js.map +1 -1
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +10 -46
- package/src/index.ts +6 -927
- package/client.js +0 -2330
- package/lib/ui-host.d.ts +0 -96
- package/lib/ui-host.js +0 -970
- package/lib/ui-host.js.map +0 -1
- package/packages/approval-policy/lib/index.d.ts +0 -297
- package/packages/approval-policy/lib/index.js +0 -425
- package/packages/approval-policy/lib/index.js.map +0 -1
- package/packages/approval-policy/locale/en.json +0 -6
- package/packages/approval-policy/locale/zh.json +0 -6
- package/packages/notify/lib/index.d.ts +0 -290
- package/packages/notify/lib/index.js +0 -915
- package/packages/notify/lib/index.js.map +0 -1
- package/packages/notify/locale/en.json +0 -6
- package/packages/notify/locale/zh.json +0 -6
- package/packages/skill-panel/lib/index.d.ts +0 -49
- package/packages/skill-panel/lib/index.js +0 -420
- package/packages/skill-panel/lib/index.js.map +0 -1
- package/packages/skill-panel/locale/en.json +0 -6
- package/packages/skill-panel/locale/zh.json +0 -6
- package/packages/utils-agents/lib/git.d.ts +0 -87
- package/packages/utils-agents/lib/git.js +0 -403
- package/packages/utils-agents/lib/git.js.map +0 -1
- package/packages/utils-agents/lib/global-repo.d.ts +0 -57
- package/packages/utils-agents/lib/global-repo.js +0 -301
- package/packages/utils-agents/lib/global-repo.js.map +0 -1
- package/packages/utils-agents/lib/index.d.ts +0 -80
- package/packages/utils-agents/lib/index.js +0 -435
- package/packages/utils-agents/lib/index.js.map +0 -1
- package/packages/utils-agents/lib/legacy.d.ts +0 -30
- package/packages/utils-agents/lib/legacy.js +0 -141
- package/packages/utils-agents/lib/legacy.js.map +0 -1
- package/packages/utils-agents/lib/native.d.ts +0 -74
- package/packages/utils-agents/lib/native.js +0 -232
- package/packages/utils-agents/lib/native.js.map +0 -1
- package/packages/utils-agents/lib/presets.d.ts +0 -34
- package/packages/utils-agents/lib/presets.js +0 -312
- package/packages/utils-agents/lib/presets.js.map +0 -1
- package/packages/utils-agents/lib/shared.d.ts +0 -105
- package/packages/utils-agents/lib/shared.js +0 -507
- package/packages/utils-agents/lib/shared.js.map +0 -1
- package/packages/utils-agents/lib/update.d.ts +0 -129
- package/packages/utils-agents/lib/update.js +0 -507
- package/packages/utils-agents/lib/update.js.map +0 -1
- package/packages/utils-agents/lib/util.d.ts +0 -215
- package/packages/utils-agents/lib/util.js +0 -475
- package/packages/utils-agents/lib/util.js.map +0 -1
- package/packages/utils-agents/locale/en.json +0 -6
- package/packages/utils-agents/locale/zh.json +0 -6
- package/skills/dsh-approval-policy-config/SKILL.md +0 -96
- package/src/ui-host.ts +0 -1073
package/lib/ui-host.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `dsh-utils` main component (`utils-main`), repository-sync half.
|
|
3
|
-
*
|
|
4
|
-
* `src/index.ts` applies this module, so the `utils-main` row owns both halves:
|
|
5
|
-
* recursive `SKILL.md` discovery and the JSON routes behind the skill-repository
|
|
6
|
-
* panel. The browser half is this package's `client.js`, served from the same
|
|
7
|
-
* package-root row.
|
|
8
|
-
*
|
|
9
|
-
* The panel configures one Git repository (URL, branch, target directory, and an
|
|
10
|
-
* optional deploy key). A sync clones a missing target or fast-forwards an
|
|
11
|
-
* existing checkout of the same branch, then initializes submodules on a
|
|
12
|
-
* best-effort basis; the target's nested `SKILL.md` files are picked up by
|
|
13
|
-
* this component's discovery provider. Nothing is ever pushed.
|
|
14
|
-
*
|
|
15
|
-
* Routes and durable state keep the `dsh-utils-ui` names (the API paths, the
|
|
16
|
-
* panel tab, and `$DSH_HOME/storages/dsh-utils-ui.json` plus an optional
|
|
17
|
-
* `.deploy-key`) so a profile that mounted the former standalone UI host keeps
|
|
18
|
-
* its saved settings after the merge. Both files are written atomically with
|
|
19
|
-
* mode 600. The key's content never reaches a response, a log line, or a git
|
|
20
|
-
* argument vector: git only ever receives its path through `GIT_SSH_COMMAND`.
|
|
21
|
-
* Every command runs through `execFile` (never a shell) with terminal prompts
|
|
22
|
-
* disabled and a bounded timeout.
|
|
23
|
-
*
|
|
24
|
-
* @module dsh-utils/ui-host
|
|
25
|
-
*/
|
|
26
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
27
|
-
/** Exact Connection routes owned by the sync panel. */
|
|
28
|
-
export declare const ROUTE_PATHS: {
|
|
29
|
-
readonly status: "/api/dsh-utils-ui/status";
|
|
30
|
-
readonly config: "/api/dsh-utils-ui/config";
|
|
31
|
-
readonly key: "/api/dsh-utils-ui/key";
|
|
32
|
-
readonly sync: "/api/dsh-utils-ui/sync";
|
|
33
|
-
};
|
|
34
|
-
/** GET: repository settings, target state, last sync. */
|
|
35
|
-
export declare const STATUS_PATH: "/api/dsh-utils-ui/status";
|
|
36
|
-
/** POST: replace the repository settings. */
|
|
37
|
-
export declare const CONFIG_PATH: "/api/dsh-utils-ui/config";
|
|
38
|
-
/** POST: store or clear the deploy key. */
|
|
39
|
-
export declare const KEY_PATH: "/api/dsh-utils-ui/key";
|
|
40
|
-
/** POST: clone or fast-forward the target. */
|
|
41
|
-
export declare const SYNC_PATH: "/api/dsh-utils-ui/sync";
|
|
42
|
-
/** Default repository: the public upstream of this machine's skill collection. */
|
|
43
|
-
export declare const DEFAULT_REPO_URL = "https://github.com/xi4z/skills";
|
|
44
|
-
/** Default branch: the Agent branch of that repository. */
|
|
45
|
-
export declare const DEFAULT_BRANCH = "Agent";
|
|
46
|
-
/** One recorded sync attempt, persisted as lastSync. */
|
|
47
|
-
export interface SyncRecord {
|
|
48
|
-
readonly at: string;
|
|
49
|
-
readonly ok: boolean;
|
|
50
|
-
readonly commit: string;
|
|
51
|
-
readonly skills: number;
|
|
52
|
-
readonly message: string;
|
|
53
|
-
}
|
|
54
|
-
/** The durable panel configuration and the last sync outcome. */
|
|
55
|
-
export interface SyncState {
|
|
56
|
-
repoUrl: string;
|
|
57
|
-
branch: string;
|
|
58
|
-
keyPath: string;
|
|
59
|
-
targetDir: string;
|
|
60
|
-
recurseSubmodules: boolean;
|
|
61
|
-
lastSync: SyncRecord | null;
|
|
62
|
-
}
|
|
63
|
-
/** Where the SSH identity comes from, as the panel displays it. */
|
|
64
|
-
export type KeySource = 'path' | 'stored' | 'none';
|
|
65
|
-
/** How a repository URL is addressed. */
|
|
66
|
-
export type RepoKind = 'https' | 'http' | 'ssh' | 'scp' | 'file' | 'path';
|
|
67
|
-
/** One parsed repository URL: normalized fields plus a comparison key. */
|
|
68
|
-
export interface ParsedRepo {
|
|
69
|
-
readonly kind: RepoKind;
|
|
70
|
-
readonly raw: string;
|
|
71
|
-
readonly isSsh: boolean;
|
|
72
|
-
readonly host: string | undefined;
|
|
73
|
-
readonly path: string;
|
|
74
|
-
readonly canonical: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Activate the host half: register the four panel routes when this deployment
|
|
78
|
-
* provides a Connection. A non-web host simply has no routes.
|
|
79
|
-
* @param ctx - host Cordis context.
|
|
80
|
-
*/
|
|
81
|
-
export declare function applyUiHost(ctx: Context): void;
|
|
82
|
-
/**
|
|
83
|
-
* Pick the URL git should actually use. With a deploy key present, an HTTPS URL
|
|
84
|
-
* on a well-known host becomes its SSH form; every other URL is used verbatim.
|
|
85
|
-
* @param repoUrl - configured repository URL.
|
|
86
|
-
* @param hasKey - whether an SSH identity is available.
|
|
87
|
-
* @returns the URL passed to git.
|
|
88
|
-
*/
|
|
89
|
-
export declare function cloneUrlFor(repoUrl: string, hasKey: boolean): string;
|
|
90
|
-
/**
|
|
91
|
-
* Canonical comparison key for a repository URL, tolerant of the common .git
|
|
92
|
-
* suffix, scheme (https vs ssh), host case, and trailing slashes.
|
|
93
|
-
* @param raw - any repository URL.
|
|
94
|
-
* @returns the canonical form; unparseable input falls back to a lowercased trim.
|
|
95
|
-
*/
|
|
96
|
-
export declare function canonicalRepoUrl(raw: string): string;
|