@adhdev/daemon-core 0.9.82-rc.456 → 0.9.82-rc.458

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.
@@ -26,4 +26,23 @@ export type OssCloneSyncAction = 'noop' | 'advance' | 'skip_rewind' | 'skip_dive
26
26
  export declare function decideOssCloneSync(ossCtx: GitRepoIdentity, worktreeOssSha: string, sourceSha: string, rg: (ctx: GitRepoIdentity, argv: string[], opts?: {
27
27
  timeoutMs?: number;
28
28
  }) => Promise<unknown>): Promise<OssCloneSyncAction>;
29
+ /**
30
+ * Sync every registered submodule of a freshly-cloned worktree to its clone source
31
+ * node's working submodule HEAD, applying decideOssCloneSync's origin-tip-priority
32
+ * rewind guard per submodule.
33
+ *
34
+ * Generic over the submodule set: the paths come from `.gitmodules` via
35
+ * getRegisteredSubmodulePaths, so this operates identically over EVERY registered
36
+ * submodule (oss, adhdev-providers, …) instead of a hardcoded 'oss' literal. In a
37
+ * repo whose only synced submodule is `oss` the emitted git commands are byte-identical
38
+ * to the original oss-only path.
39
+ *
40
+ * Best-effort by design: a failure on one submodule is logged and skipped; it never
41
+ * blocks the other submodules or the clone. A submodule is only ever advanced to a
42
+ * STRICTLY-NEWER source SHA — the fresh (origin/main-derived) worktree tip is never
43
+ * rewound onto a behind/diverged source.
44
+ */
45
+ export declare function syncClonedWorktreeSubmodules(worktreePath: string, sourceWorkspace: string, rg: (ctx: GitRepoIdentity, argv: string[], opts?: {
46
+ timeoutMs?: number;
47
+ }) => Promise<unknown>): Promise<void>;
29
48
  export declare const meshCrudHandlers: Record<string, MedFamilyHandler>;
@@ -71,6 +71,20 @@ export interface ADHDevConfig {
71
71
  disableUpstream?: boolean;
72
72
  providerSourceMode?: ProviderSourceMode;
73
73
  providerDir?: string;
74
+ /**
75
+ * Optional provider registry base URL override (for example a self-hosted
76
+ * registry). Highest-priority source in the registry resolver, ahead of the
77
+ * `ADHDEV_REGISTRY_URL` env var and the vendor default. See
78
+ * `config/registry-resolver.ts`.
79
+ */
80
+ registryUrl?: string;
81
+ /**
82
+ * Optional provider tarball (archive) URL override so self-hosters can point
83
+ * the daemon at their own provider mirror instead of the vendor GitHub repo.
84
+ * Highest-priority source, ahead of `ADHDEV_PROVIDER_TARBALL_URL` and the
85
+ * vendor default. See `config/registry-resolver.ts`.
86
+ */
87
+ providerTarballUrl?: string;
74
88
  /** Preferred daemon update channel. Defaults to stable/latest. */
75
89
  updateChannel?: ReleaseChannel;
76
90
  /**
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Registry / provider-distribution URL resolver.
3
+ *
4
+ * Single source of truth for the ADHDev provider *registry* base URL and the
5
+ * provider *tarball* (GitHub) URL. Self-hosters can repoint both away from the
6
+ * vendor defaults so the daemon never phones home to `api.adhf.dev` /
7
+ * `github.com/vilmire/adhdev-providers`.
8
+ *
9
+ * Resolution priority (highest first):
10
+ * 1. Explicit config field — `config.registryUrl` / `config.providerTarballUrl`
11
+ * 2. Environment variable — `ADHDEV_REGISTRY_URL` / `ADHDEV_PROVIDER_TARBALL_URL`
12
+ * 3. Vendor default — existing URLs (unchanged for default users)
13
+ *
14
+ * Default users get byte-identical behavior: the vendor defaults equal the
15
+ * literals these functions replaced.
16
+ */
17
+ /** Vendor default registry base URL (no trailing slash). */
18
+ export declare const DEFAULT_REGISTRY_BASE_URL = "https://api.adhf.dev/api/v1/registry";
19
+ /** Vendor default provider tarball URL (GitHub main branch archive). */
20
+ export declare const DEFAULT_PROVIDER_TARBALL_URL = "https://github.com/vilmire/adhdev-providers/archive/refs/heads/main.tar.gz";
21
+ /** Env var that overrides the registry base URL. */
22
+ export declare const REGISTRY_URL_ENV_VAR = "ADHDEV_REGISTRY_URL";
23
+ /** Env var that overrides the provider tarball URL. */
24
+ export declare const PROVIDER_TARBALL_URL_ENV_VAR = "ADHDEV_PROVIDER_TARBALL_URL";
25
+ /**
26
+ * Resolve the provider registry base URL.
27
+ *
28
+ * @param configuredUrl explicit config value (config.registryUrl); highest priority.
29
+ * @param env process env source (defaults to process.env; injectable for tests).
30
+ * @returns the resolved base URL with any trailing slash stripped, so callers
31
+ * can safely append `/providers`, `/providers/<type>`, etc.
32
+ */
33
+ export declare function resolveRegistryBaseUrl(configuredUrl?: string | null, env?: NodeJS.ProcessEnv): string;
34
+ /**
35
+ * Resolve the provider tarball (archive) URL.
36
+ *
37
+ * @param configuredUrl explicit config value (config.providerTarballUrl); highest priority.
38
+ * @param env process env source (defaults to process.env; injectable for tests).
39
+ */
40
+ export declare function resolveProviderTarballUrl(configuredUrl?: string | null, env?: NodeJS.ProcessEnv): string;
41
+ /** Parsed tarball request target for callers that issue raw hostname/path requests. */
42
+ export interface TarballRequestTarget {
43
+ /** Full resolved tarball URL. */
44
+ url: string;
45
+ /** Hostname component (e.g. `github.com`). */
46
+ hostname: string;
47
+ /** Path component including any query string (e.g. `/vilmire/...tar.gz`). */
48
+ path: string;
49
+ }
50
+ /**
51
+ * Resolve the provider tarball URL and split it into `{ url, hostname, path }`
52
+ * for callers that build raw `https.request` options (e.g. HEAD ETag probes).
53
+ */
54
+ export declare function resolveProviderTarballTarget(configuredUrl?: string | null, env?: NodeJS.ProcessEnv): TarballRequestTarget;
package/dist/index.d.ts CHANGED
@@ -106,7 +106,7 @@ export type { ManagedStatus } from './status/normalize.js';
106
106
  export type { StatusSnapshotOptions, StatusSnapshot } from './status/snapshot.js';
107
107
  export { LOG, installGlobalInterceptor, setLogLevel, getLogLevel, getRecentLogs, getDaemonLogDir, getCurrentDaemonLogPath, } from './logging/logger.js';
108
108
  export type { ScopedLogger, LogLevel, LogEntry } from './logging/logger.js';
109
- export { resolveDebugRuntimeConfig, setDebugRuntimeConfig, getDebugRuntimeConfig, resetDebugRuntimeConfig, shouldCollectTraceCategory, } from './logging/debug-config.js';
109
+ export { resolveDebugRuntimeConfig, setDebugRuntimeConfig, getDebugRuntimeConfig, resetDebugRuntimeConfig, shouldCollectTraceCategory, isAlwaysOnTraceCategory, ALWAYS_ON_TRACE_CATEGORIES, } from './logging/debug-config.js';
110
110
  export type { DebugRuntimeOptions, DebugRuntimeConfig } from './logging/debug-config.js';
111
111
  export { createDebugTraceStore, configureDebugTraceStore, recordDebugTrace, getRecentDebugTrace, clearDebugTrace, createInteractionId, } from './logging/debug-trace.js';
112
112
  export type { DebugTraceEvent, DebugTraceEntry, DebugTraceQuery, DebugTraceStore, DebugTraceLevel } from './logging/debug-trace.js';