clinkx 1.3.0 → 1.4.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +13 -6
  3. package/clinkx-workflows/dist/child-env.d.ts +3 -0
  4. package/clinkx-workflows/dist/child-env.js +11 -0
  5. package/clinkx-workflows/dist/child-env.js.map +1 -1
  6. package/clinkx-workflows/dist/dashboard/api-routes.d.ts +21 -0
  7. package/clinkx-workflows/dist/dashboard/api-routes.js +27 -0
  8. package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -1
  9. package/clinkx-workflows/dist/dashboard/auth/challenge-store.d.ts +13 -0
  10. package/clinkx-workflows/dist/dashboard/auth/challenge-store.js.map +1 -1
  11. package/clinkx-workflows/dist/dashboard/auth/controller.d.ts +27 -0
  12. package/clinkx-workflows/dist/dashboard/auth/controller.js +262 -23
  13. package/clinkx-workflows/dist/dashboard/auth/controller.js.map +1 -1
  14. package/clinkx-workflows/dist/dashboard/auth/settings-step-up.d.ts +62 -0
  15. package/clinkx-workflows/dist/dashboard/auth/settings-step-up.js +70 -0
  16. package/clinkx-workflows/dist/dashboard/auth/settings-step-up.js.map +1 -0
  17. package/clinkx-workflows/dist/dashboard/request-admission.d.ts +6 -0
  18. package/clinkx-workflows/dist/dashboard/request-admission.js +9 -0
  19. package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -1
  20. package/clinkx-workflows/dist/dashboard/server-factory.js +15 -1
  21. package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -1
  22. package/clinkx-workflows/dist/dashboard/settings-contract.d.ts +1806 -0
  23. package/clinkx-workflows/dist/dashboard/settings-contract.js +630 -0
  24. package/clinkx-workflows/dist/dashboard/settings-contract.js.map +1 -0
  25. package/clinkx-workflows/dist/dashboard/settings-process-reader.d.ts +48 -0
  26. package/clinkx-workflows/dist/dashboard/settings-process-reader.js +195 -0
  27. package/clinkx-workflows/dist/dashboard/settings-process-reader.js.map +1 -0
  28. package/clinkx-workflows/dist/dashboard/settings-routes.d.ts +87 -0
  29. package/clinkx-workflows/dist/dashboard/settings-routes.js +690 -0
  30. package/clinkx-workflows/dist/dashboard/settings-routes.js.map +1 -0
  31. package/clinkx-workflows/dist/dashboard-ui/assets/index-DSOtuS0p.js +122 -0
  32. package/clinkx-workflows/dist/dashboard-ui/assets/style-C5guUjwN.css +1 -0
  33. package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
  34. package/clinkx-workflows/dist/durable-file-core.d.ts +76 -0
  35. package/clinkx-workflows/dist/durable-file-core.js +146 -0
  36. package/clinkx-workflows/dist/durable-file-core.js.map +1 -0
  37. package/clinkx-workflows/dist/durable-file.d.ts +8 -64
  38. package/clinkx-workflows/dist/durable-file.js +14 -137
  39. package/clinkx-workflows/dist/durable-file.js.map +1 -1
  40. package/clinkx-workflows/dist/index.js +68 -2
  41. package/clinkx-workflows/dist/index.js.map +1 -1
  42. package/clinkx-workflows/dist/settings/audit.d.ts +101 -0
  43. package/clinkx-workflows/dist/settings/audit.js +318 -0
  44. package/clinkx-workflows/dist/settings/audit.js.map +1 -0
  45. package/clinkx-workflows/dist/settings/bootstrap.d.ts +35 -0
  46. package/clinkx-workflows/dist/settings/bootstrap.js +52 -0
  47. package/clinkx-workflows/dist/settings/bootstrap.js.map +1 -0
  48. package/clinkx-workflows/dist/settings/codec.d.ts +51 -0
  49. package/clinkx-workflows/dist/settings/codec.js +410 -0
  50. package/clinkx-workflows/dist/settings/codec.js.map +1 -0
  51. package/clinkx-workflows/dist/settings/durable-write.d.ts +48 -0
  52. package/clinkx-workflows/dist/settings/durable-write.js +31 -0
  53. package/clinkx-workflows/dist/settings/durable-write.js.map +1 -0
  54. package/clinkx-workflows/dist/settings/index.d.ts +20 -0
  55. package/clinkx-workflows/dist/settings/index.js +23 -0
  56. package/clinkx-workflows/dist/settings/index.js.map +1 -0
  57. package/clinkx-workflows/dist/settings/loader.d.ts +80 -0
  58. package/clinkx-workflows/dist/settings/loader.js +577 -0
  59. package/clinkx-workflows/dist/settings/loader.js.map +1 -0
  60. package/clinkx-workflows/dist/settings/lock.d.ts +108 -0
  61. package/clinkx-workflows/dist/settings/lock.js +344 -0
  62. package/clinkx-workflows/dist/settings/lock.js.map +1 -0
  63. package/clinkx-workflows/dist/settings/paths.d.ts +65 -0
  64. package/clinkx-workflows/dist/settings/paths.js +173 -0
  65. package/clinkx-workflows/dist/settings/paths.js.map +1 -0
  66. package/clinkx-workflows/dist/settings/process-heartbeat.d.ts +47 -0
  67. package/clinkx-workflows/dist/settings/process-heartbeat.js +305 -0
  68. package/clinkx-workflows/dist/settings/process-heartbeat.js.map +1 -0
  69. package/clinkx-workflows/dist/settings/registry.d.ts +178 -0
  70. package/clinkx-workflows/dist/settings/registry.js +1285 -0
  71. package/clinkx-workflows/dist/settings/registry.js.map +1 -0
  72. package/clinkx-workflows/dist/settings/schema.d.ts +404 -0
  73. package/clinkx-workflows/dist/settings/schema.js +415 -0
  74. package/clinkx-workflows/dist/settings/schema.js.map +1 -0
  75. package/clinkx-workflows/dist/settings/store.d.ts +157 -0
  76. package/clinkx-workflows/dist/settings/store.js +842 -0
  77. package/clinkx-workflows/dist/settings/store.js.map +1 -0
  78. package/clinkx-workflows/dist/stdio-entry.d.ts +2 -0
  79. package/clinkx-workflows/dist/stdio-entry.js +52 -0
  80. package/clinkx-workflows/dist/stdio-entry.js.map +1 -0
  81. package/dist/dashboard-cli.js +50 -1
  82. package/dist/dashboard-cli.js.map +1 -1
  83. package/dist/dashboard-companion/protocol.js +17 -0
  84. package/dist/dashboard-companion/protocol.js.map +1 -1
  85. package/dist/dashboard-gateway/control-plane/contracts.d.ts +38 -38
  86. package/dist/dashboard-gateway/tunnel-http.js +20 -0
  87. package/dist/dashboard-gateway/tunnel-http.js.map +1 -1
  88. package/dist/elaris/config.d.ts +10 -0
  89. package/dist/elaris/config.js +27 -1
  90. package/dist/elaris/config.js.map +1 -1
  91. package/dist/elaris/tools.js +4 -1
  92. package/dist/elaris/tools.js.map +1 -1
  93. package/dist/index.d.ts +0 -31
  94. package/dist/index.js +41 -404
  95. package/dist/index.js.map +1 -1
  96. package/dist/lib.d.ts +17 -0
  97. package/dist/lib.js +17 -0
  98. package/dist/lib.js.map +1 -0
  99. package/dist/progress-report/lock.d.ts +17 -59
  100. package/dist/progress-report/lock.js +25 -329
  101. package/dist/progress-report/lock.js.map +1 -1
  102. package/dist/server.js +75 -4
  103. package/dist/server.js.map +1 -1
  104. package/dist/settings-cli/clients.d.ts +137 -0
  105. package/dist/settings-cli/clients.js +1124 -0
  106. package/dist/settings-cli/clients.js.map +1 -0
  107. package/dist/settings-cli/commands.d.ts +67 -0
  108. package/dist/settings-cli/commands.js +726 -0
  109. package/dist/settings-cli/commands.js.map +1 -0
  110. package/dist/settings-cli/format.d.ts +34 -0
  111. package/dist/settings-cli/format.js +40 -0
  112. package/dist/settings-cli/format.js.map +1 -0
  113. package/dist/settings-cli/main.d.ts +18 -0
  114. package/dist/settings-cli/main.js +256 -0
  115. package/dist/settings-cli/main.js.map +1 -0
  116. package/dist/stdio-main.d.ts +73 -0
  117. package/dist/stdio-main.js +455 -0
  118. package/dist/stdio-main.js.map +1 -0
  119. package/docs/configuration.md +340 -39
  120. package/docs/security.md +150 -6
  121. package/package.json +2 -2
  122. package/clinkx-workflows/dist/dashboard-ui/assets/index-DRId2DVA.js +0 -119
  123. package/clinkx-workflows/dist/dashboard-ui/assets/style-CHAw57y5.css +0 -1
@@ -0,0 +1,137 @@
1
+ import { type SettingDescriptor, type SettingValue } from "../../clinkx-workflows/dist/settings/registry.js";
2
+ import { type SettingsCliContext } from "./commands.js";
3
+ export type ClientKind = "claude" | "codex" | "cursor" | "zcode";
4
+ export declare const CLIENT_KINDS: readonly ClientKind[];
5
+ export interface ClientServerEntry {
6
+ readonly client: ClientKind;
7
+ /** Server name inside the client config (e.g. "clinkx", "clinkx-test"). */
8
+ readonly name: string;
9
+ /** Display location, e.g. `~/.cursor/mcp.json (user)`. */
10
+ readonly location: string;
11
+ readonly command: string;
12
+ readonly args: readonly string[];
13
+ readonly env: Readonly<Record<string, string>>;
14
+ /** Preserved non-command/args/env fields, for rendering the trimmed block. */
15
+ readonly extra: Readonly<Record<string, unknown>>;
16
+ /**
17
+ * Codex only: the original `env_vars` name array from the listing (codex
18
+ * 0.166.0 carries it inside `transport`). Codex rejects an env_vars map, so
19
+ * the trimmed block must render this sequence verbatim, never a map (C4).
20
+ */
21
+ readonly codexEnvVars?: readonly string[];
22
+ }
23
+ export interface ClientScan {
24
+ readonly entries: readonly ClientServerEntry[];
25
+ readonly notes: readonly string[];
26
+ }
27
+ export interface RunCommandResult {
28
+ readonly ok: boolean;
29
+ readonly stdout: string;
30
+ /** Bounded, sanitized reason when !ok. */
31
+ readonly failure?: string;
32
+ }
33
+ export type RunCommand = (command: string, args: readonly string[]) => Promise<RunCommandResult>;
34
+ export interface ClientsDeps {
35
+ readonly home: string;
36
+ readonly runCommand: RunCommand;
37
+ }
38
+ /** True when the launch command/args look like this ClinkX package. */
39
+ export declare function isClinkxLaunch(command: string, args: readonly string[]): boolean;
40
+ export declare function scanClientEntries(deps: ClientsDeps, only?: ClientKind): Promise<ClientScan>;
41
+ export interface EntryVote {
42
+ readonly entry: ClientServerEntry;
43
+ readonly raw: string;
44
+ /** Original env name as spelled in the entry (may be a legacy alias). */
45
+ readonly envName: string;
46
+ }
47
+ /**
48
+ * The env name this entry's Elaris credential indirection points at (L6):
49
+ * `CLINKX_ELARIS_API_KEY_ENV` names the variable holding the Elaris key — the
50
+ * same resolution as `src/elaris/config.ts` (trimmed; empty/unset ignored).
51
+ * The named variable may be an ordinary non-secret registry key, yet for THIS
52
+ * entry its value IS the credential, so it is never printed, voted, written
53
+ * by `--apply`, or classified removable. A SECRET-class target (canonical or
54
+ * legacy alias of one) returns undefined instead: the secret paths already
55
+ * withhold its value, so an entry that writes the documented default
56
+ * `CLINKX_ELARIS_API_KEY_ENV=CLINKX_ELARIS_API_KEY` out explicitly still
57
+ * imports the key into secrets.json and keeps its secret_* trim decision.
58
+ */
59
+ export declare function elarisKeyEnvTarget(entry: ClientServerEntry): string | undefined;
60
+ /**
61
+ * Tally votes per canonical registry key. Within one entry a canonical
62
+ * spelling beats a legacy alias; one entry contributes at most one vote.
63
+ * Missing is not a vote. The credential-indirection target of an entry's
64
+ * `CLINKX_ELARIS_API_KEY_ENV` (per `elarisKeyEnvTarget`; never a secret-class
65
+ * key, whose votes flow through the normal secret path) casts no vote in any
66
+ * spelling — but only when the target is actually SET in that entry (L6b,
67
+ * matching `buildImportPlan`): the direct spelling holds the credential, so a
68
+ * fallback alias vote would both leak a misattribution and misrepresent the
69
+ * entry (the direct spelling shadows it). An unset target withholds nothing.
70
+ */
71
+ export declare function tallyRegistryKeys(entries: readonly ClientServerEntry[]): Map<string, EntryVote[]>;
72
+ export interface MajorityResult {
73
+ readonly value: string;
74
+ readonly count: number;
75
+ /** Every vote cast (voters only; missing is not a vote). */
76
+ readonly all: readonly EntryVote[];
77
+ readonly disagreeing: readonly EntryVote[];
78
+ }
79
+ /** Unique maximum only; a tie is not a majority (never imported). */
80
+ export declare function uniqueMajority(votes: readonly EntryVote[]): MajorityResult | undefined;
81
+ export interface SecretComparisonValues {
82
+ /** key → stored secret value. In-process only; never printed or hashed into output. */
83
+ readonly values: Readonly<Record<string, string>>;
84
+ readonly problem?: string;
85
+ }
86
+ export declare function readSecretValuesForComparison(dir: string): SecretComparisonValues;
87
+ /**
88
+ * Typed equality between a client entry's env spelling and the settings file's
89
+ * value. The env side parses through the consumer grammar mirror, so an entry
90
+ * spelling the consumer would read identically counts as equal.
91
+ */
92
+ export declare function entryMatchesFileValue(descriptor: SettingDescriptor, raw: string, fileValue: SettingValue): boolean;
93
+ export interface ImportPlanItem {
94
+ readonly key: string;
95
+ readonly secret: boolean;
96
+ readonly majority: MajorityResult;
97
+ readonly descriptor: SettingDescriptor;
98
+ /** Set when the majority value failed registry validation (never imported). */
99
+ readonly invalidReason?: string;
100
+ }
101
+ export interface ImportPlan {
102
+ readonly items: readonly ImportPlanItem[];
103
+ readonly ties: readonly {
104
+ readonly key: string;
105
+ readonly votes: readonly EntryVote[];
106
+ }[];
107
+ readonly dead: readonly {
108
+ readonly name: string;
109
+ readonly reason: string;
110
+ readonly entries: readonly string[];
111
+ }[];
112
+ readonly unknown: readonly {
113
+ readonly name: string;
114
+ readonly entries: readonly string[];
115
+ }[];
116
+ readonly envOnly: readonly {
117
+ readonly name: string;
118
+ readonly list: string;
119
+ readonly entries: readonly string[];
120
+ }[];
121
+ /** Names an entry's CLINKX_ELARIS_API_KEY_ENV points at (L6): by name only. */
122
+ readonly withheld: readonly {
123
+ readonly name: string;
124
+ readonly entries: readonly string[];
125
+ }[];
126
+ }
127
+ export declare function buildImportPlan(entries: readonly ClientServerEntry[]): ImportPlan;
128
+ export declare function commandImportClients(ctx: SettingsCliContext, opts: {
129
+ readonly apply: boolean;
130
+ readonly home: string;
131
+ readonly runCommand: RunCommand;
132
+ }): Promise<number>;
133
+ export declare function commandTrimReport(ctx: SettingsCliContext, opts: {
134
+ readonly client: ClientKind;
135
+ readonly home: string;
136
+ readonly runCommand: RunCommand;
137
+ }): Promise<number>;