@adhdev/daemon-core 0.9.82-rc.165 → 0.9.82-rc.167

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.
@@ -36,6 +36,12 @@
36
36
  "type": "string",
37
37
  "description": "Regex source matching a single button line. Capture group 1 is the button label. Example: `^[\\s❯>]*\\d+\\.\\s+(.+)$`."
38
38
  },
39
+ "buttonLabelGroup": {
40
+ "type": "integer",
41
+ "minimum": 1,
42
+ "default": 1,
43
+ "description": "Capture group number to use as the button label when `buttonPattern` contains non-label groups such as selected-row markers."
44
+ },
39
45
  "buttonFlags": {
40
46
  "type": "string",
41
47
  "pattern": "^[gimsuy]*$",
@@ -9,7 +9,7 @@
9
9
  * offending field without guessing.
10
10
  *
11
11
  * Validation lives in the SDK layer (not in provider-loader) so dashboards,
12
- * registry workers, and the marketplace publish flow can all reuse the
12
+ * registry workers, and the provider publish flow can all reuse the
13
13
  * same code path and produce identical error messages.
14
14
  */
15
15
 
@@ -2,7 +2,7 @@
2
2
  * Static taint analyzer for extended-tier override JS.
3
3
  *
4
4
  * Goal: classify the override JS shipped with an extended-tier provider into
5
- * one of three risk tiers, so the marketplace + daemon trust prompt can
5
+ * one of three risk tiers, so the dashboard + daemon trust prompt can
6
6
  * surface accurate language to the operator instead of a single generic
7
7
  * "this provider contains JS" warning.
8
8
  *
@@ -525,7 +525,39 @@ export interface AvailableProviderInfo {
525
525
  lastVerification?: MachineProviderCheckResult;
526
526
  /** Provider-declared Repo Mesh coordinator/MCP behavior. */
527
527
  meshCoordinator?: ProviderMeshCoordinatorConfig;
528
- }
528
+ /**
529
+ * Provider trust classification — derived from the on-disk layer the
530
+ * manifest came from and the shape of the manifest. Dashboards use
531
+ * this to render a trust badge and gate activation of
532
+ * `external-untrusted` providers behind a confirm modal.
533
+ */
534
+ trust?: ProviderTrust;
535
+ /** Daemon-side human-readable description of the trust value. */
536
+ trustDescription?: string;
537
+ /** True when activation needs a user-side confirmation step. */
538
+ requiresConfirmation?: boolean;
539
+ /** Which on-disk layer the manifest lives in. */
540
+ sourceLayer?: 'user' | 'upstream' | 'external';
541
+ /** For external providers, the source-name namespace it came from. */
542
+ sourceName?: string | null;
543
+ /** Manifest-declared version, e.g. "1.2.1". */
544
+ providerVersion?: string;
545
+ /** Underlying executable name (CLI/binary providers). */
546
+ binary?: string;
547
+ /** Lifecycle label from the manifest: "Stable", "Beta", … */
548
+ status?: string;
549
+ /** One-line provider description from the manifest. */
550
+ details?: string;
551
+ /** Manifest-declared links: homepage, docs, repo, … */
552
+ links?: Record<string, string>;
553
+ }
554
+
555
+ export type ProviderTrust =
556
+ | 'user-custom'
557
+ | 'trusted'
558
+ | 'trusted-with-scripts'
559
+ | 'external-safe'
560
+ | 'external-untrusted';
529
561
 
530
562
  export interface MachineProviderCheckResult {
531
563
  ok: boolean;
@@ -145,21 +145,56 @@ function buildAvailableProviders(
145
145
  lastDetection?: AvailableProviderInfo['lastDetection'];
146
146
  lastVerification?: AvailableProviderInfo['lastVerification'];
147
147
  meshCoordinator?: AvailableProviderInfo['meshCoordinator'];
148
+ _sourceTrust?: AvailableProviderInfo['trust'];
149
+ _sourceLayer?: AvailableProviderInfo['sourceLayer'];
150
+ _sourceName?: string | null;
151
+ providerVersion?: string;
152
+ binary?: string;
153
+ status?: string;
154
+ details?: string;
155
+ links?: Record<string, string>;
148
156
  }> = providerLoader.getAvailableProviderInfos?.() || providerLoader.getAll();
149
- return providers.map((provider) => ({
150
- type: provider.type,
151
- name: provider.displayName || provider.type,
152
- displayName: provider.displayName || provider.type,
153
- icon: provider.icon || '💻',
154
- category: provider.category,
155
- ...(provider.installed !== undefined ? { installed: provider.installed } : {}),
156
- ...(provider.detectedPath !== undefined ? { detectedPath: provider.detectedPath } : {}),
157
- ...(provider.enabled !== undefined ? { enabled: provider.enabled } : {}),
158
- ...(provider.machineStatus !== undefined ? { machineStatus: provider.machineStatus } : {}),
159
- ...(provider.lastDetection !== undefined ? { lastDetection: provider.lastDetection } : {}),
160
- ...(provider.lastVerification !== undefined ? { lastVerification: provider.lastVerification } : {}),
161
- ...(provider.meshCoordinator !== undefined ? { meshCoordinator: provider.meshCoordinator } : {}),
162
- }));
157
+ // Trust helpers come from daemon-core; resolve them lazily so the
158
+ // status snapshot path stays loadable in older bundles that don't
159
+ // ship provider-trust yet.
160
+ let describeTrust: (trust: AvailableProviderInfo['trust']) => string = () => '';
161
+ let requiresConfirmation: (trust: AvailableProviderInfo['trust']) => boolean = () => false;
162
+ try {
163
+ const mod = require('../providers/provider-trust.js') as typeof import('../providers/provider-trust.js');
164
+ describeTrust = mod.describeTrust as typeof describeTrust;
165
+ requiresConfirmation = mod.requiresConfirmation as typeof requiresConfirmation;
166
+ } catch { /* enrichment only */ }
167
+ return providers.map((provider) => {
168
+ const trust = (provider as any)._sourceTrust as AvailableProviderInfo['trust'] | undefined;
169
+ const sourceLayer = (provider as any)._sourceLayer as AvailableProviderInfo['sourceLayer'] | undefined;
170
+ const sourceName = (provider as any)._sourceName as string | null | undefined;
171
+ return {
172
+ type: provider.type,
173
+ name: provider.displayName || provider.type,
174
+ displayName: provider.displayName || provider.type,
175
+ icon: provider.icon || '💻',
176
+ category: provider.category,
177
+ ...(provider.installed !== undefined ? { installed: provider.installed } : {}),
178
+ ...(provider.detectedPath !== undefined ? { detectedPath: provider.detectedPath } : {}),
179
+ ...(provider.enabled !== undefined ? { enabled: provider.enabled } : {}),
180
+ ...(provider.machineStatus !== undefined ? { machineStatus: provider.machineStatus } : {}),
181
+ ...(provider.lastDetection !== undefined ? { lastDetection: provider.lastDetection } : {}),
182
+ ...(provider.lastVerification !== undefined ? { lastVerification: provider.lastVerification } : {}),
183
+ ...(provider.meshCoordinator !== undefined ? { meshCoordinator: provider.meshCoordinator } : {}),
184
+ ...(trust ? {
185
+ trust,
186
+ trustDescription: describeTrust(trust),
187
+ requiresConfirmation: requiresConfirmation(trust),
188
+ } : {}),
189
+ ...(sourceLayer ? { sourceLayer } : {}),
190
+ ...(sourceName ? { sourceName } : {}),
191
+ ...(provider.providerVersion ? { providerVersion: provider.providerVersion } : {}),
192
+ ...(provider.binary ? { binary: provider.binary } : {}),
193
+ ...(provider.status ? { status: provider.status } : {}),
194
+ ...(provider.details ? { details: provider.details } : {}),
195
+ ...(provider.links ? { links: provider.links } : {}),
196
+ };
197
+ });
163
198
  }
164
199
 
165
200
  export function buildMachineInfo(profile: 'full' | 'live' | 'metadata' = 'full'): MachineInfo {