@xi4z/dsh-utils 0.5.0 → 0.7.1

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.
Files changed (59) hide show
  1. package/README.md +258 -314
  2. package/cordis.patch.yml +36 -37
  3. package/lib/index.d.ts +5 -63
  4. package/lib/index.js +6 -859
  5. package/lib/index.js.map +1 -1
  6. package/locale/en.json +1 -1
  7. package/locale/zh.json +1 -1
  8. package/package.json +10 -46
  9. package/src/index.ts +6 -927
  10. package/client.js +0 -2330
  11. package/lib/ui-host.d.ts +0 -96
  12. package/lib/ui-host.js +0 -970
  13. package/lib/ui-host.js.map +0 -1
  14. package/packages/approval-policy/lib/index.d.ts +0 -297
  15. package/packages/approval-policy/lib/index.js +0 -425
  16. package/packages/approval-policy/lib/index.js.map +0 -1
  17. package/packages/approval-policy/locale/en.json +0 -6
  18. package/packages/approval-policy/locale/zh.json +0 -6
  19. package/packages/notify/lib/index.d.ts +0 -290
  20. package/packages/notify/lib/index.js +0 -915
  21. package/packages/notify/lib/index.js.map +0 -1
  22. package/packages/notify/locale/en.json +0 -6
  23. package/packages/notify/locale/zh.json +0 -6
  24. package/packages/skill-panel/lib/index.d.ts +0 -49
  25. package/packages/skill-panel/lib/index.js +0 -420
  26. package/packages/skill-panel/lib/index.js.map +0 -1
  27. package/packages/skill-panel/locale/en.json +0 -6
  28. package/packages/skill-panel/locale/zh.json +0 -6
  29. package/packages/utils-agents/lib/git.d.ts +0 -87
  30. package/packages/utils-agents/lib/git.js +0 -403
  31. package/packages/utils-agents/lib/git.js.map +0 -1
  32. package/packages/utils-agents/lib/global-repo.d.ts +0 -57
  33. package/packages/utils-agents/lib/global-repo.js +0 -301
  34. package/packages/utils-agents/lib/global-repo.js.map +0 -1
  35. package/packages/utils-agents/lib/index.d.ts +0 -80
  36. package/packages/utils-agents/lib/index.js +0 -435
  37. package/packages/utils-agents/lib/index.js.map +0 -1
  38. package/packages/utils-agents/lib/legacy.d.ts +0 -30
  39. package/packages/utils-agents/lib/legacy.js +0 -141
  40. package/packages/utils-agents/lib/legacy.js.map +0 -1
  41. package/packages/utils-agents/lib/native.d.ts +0 -74
  42. package/packages/utils-agents/lib/native.js +0 -232
  43. package/packages/utils-agents/lib/native.js.map +0 -1
  44. package/packages/utils-agents/lib/presets.d.ts +0 -34
  45. package/packages/utils-agents/lib/presets.js +0 -312
  46. package/packages/utils-agents/lib/presets.js.map +0 -1
  47. package/packages/utils-agents/lib/shared.d.ts +0 -105
  48. package/packages/utils-agents/lib/shared.js +0 -507
  49. package/packages/utils-agents/lib/shared.js.map +0 -1
  50. package/packages/utils-agents/lib/update.d.ts +0 -129
  51. package/packages/utils-agents/lib/update.js +0 -507
  52. package/packages/utils-agents/lib/update.js.map +0 -1
  53. package/packages/utils-agents/lib/util.d.ts +0 -215
  54. package/packages/utils-agents/lib/util.js +0 -475
  55. package/packages/utils-agents/lib/util.js.map +0 -1
  56. package/packages/utils-agents/locale/en.json +0 -6
  57. package/packages/utils-agents/locale/zh.json +0 -6
  58. package/skills/dsh-approval-policy-config/SKILL.md +0 -96
  59. 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;