@serviceme/devtools-core 0.3.1 → 0.3.3

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/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _serviceme_devtools_protocol from '@serviceme/devtools-protocol';
2
2
  import { AgentMarketplaceEntry, AgentMutationRequest, AgentPermissionSummary, CopilotDoctorResult, CopilotPromptOptions, CopilotPromptResult, EnvironmentCheckResult, KnownEnvironmentTool, ToolCheckResult, ServiceMeImageValidationResult, ServiceMeImageInfo, ServiceMeImageCompressOptions, ServiceMeImageCompressResult, JsonSortOptions, JsonValidationResult, AgentToolRiskLevel, AgentToolPermission, ServiceMeProjectExtractTemplateInput, ServiceMeProjectExtractTemplateResult, ServiceMeProjectInstallDepsResult, ServiceMeProjectMakeScriptsExecutableResult, ServiceMeProjectGitInitResult, ServiceMeProjectScaffoldPruneResult, TaskExecutionStatus, ScheduledTaskType, TaskPayload, TaskWorkspaceRef, ScheduledTasksConfig, ScheduledTask, TaskExecutionLog, TaskStartedEventParams, TaskOutputEventParams, TaskCompletedEventParams, TaskFailedEventParams, TaskCancelledEventParams, TaskExecutionSnapshot, RunningTaskInfo, SkillMarketplaceEntry, SkillMutationRequest } from '@serviceme/devtools-protocol';
3
3
  import * as fs from 'node:fs/promises';
4
- export { AccessCheckResult, AccessControl, AccessControlOptions, AuthCore, AuthCoreOptions, AuthStateManager, AuthStateManagerOptions, CancellationCheck, DeviceFlowUiCallback, GitHubAuthProvider, GitHubAuthProviderConfig, IAuthProvider, IAuthProviderSession, IAuthProviderUserInfo, InMemoryKeychainAuthTokenStore, KeyValueStore, KeychainAccountKey, KeychainAuthTokenStore, KeychainTokenEnvelope, KeychainTokenMetadata, KeychainUnavailableError, MicrosoftAuthProvider, MicrosoftProviderNotHostedError, OrgMembershipFetcher, ProviderRegistry, buildGitHubLocalEmail, isGitHubLocalEmail, resolvePrimaryEmail } from './auth.mjs';
4
+ export { A as AccessCheckResult, a as AccessControl, b as AccessControlOptions, c as AuthCore, d as AuthCoreOptions, e as AuthStateManager, f as AuthStateManagerOptions, C as CancellationCheck, D as DeviceFlowUiCallback, G as GitHubAuthProvider, g as GitHubAuthProviderConfig, I as IAuthProvider, h as IAuthProviderSession, i as IAuthProviderUserInfo, j as InMemoryKeychainAuthTokenStore, K as KeyValueStore, k as KeychainAccountKey, l as KeychainAuthTokenStore, m as KeychainTokenEnvelope, n as KeychainTokenMetadata, o as KeychainUnavailableError, M as MicrosoftAuthProvider, p as MicrosoftProviderNotHostedError, O as OrgMembershipFetcher, P as ProviderRegistry, S as ServiceMeLogger, q as buildGitHubLocalEmail, r as createConsoleLogger, s as isGitHubLocalEmail, t as noopLogger, u as resolvePrimaryEmail } from './index-87-_JvQi.mjs';
5
5
  export { AtomicWriteResult, BuildSignedHeadersParams, DEVICE_JSON_SCHEMA_VERSION, DeviceAuthHeaders, DeviceCore, DeviceCoreOptions, DeviceReenrollRequiresAuthError, DeviceRequestSignatureParams, DeviceSecretVersionMismatchError, DeviceSignedHeaders, EnrollRequestFn, EnrollResponse, Enroller, EnrollerOptions, FsIdentityFileBackend, IdentityFileBackend, IdentityStore, IdentityStoreHooks, IdentityStoreOptions, PersistedDeviceIdentity, buildSignedHeaders, createDeviceRequestSignature, deriveInstallationId, fingerprintSource, randomInstallationId } from './device.mjs';
6
6
  import { c as SkillKind, b as SkillFile } from './types-B9gk3dXH.mjs';
7
7
  import { G as GitClient, P as PullResult } from './index-GAigCT0j.mjs';
@@ -262,6 +262,7 @@ declare class EnvironmentInspector {
262
262
  checkEnvironment(): Promise<EnvironmentCheckResult>;
263
263
  checkTool(toolName: KnownEnvironmentTool): Promise<ToolCheckResult>;
264
264
  private getToolPath;
265
+ private getToolPathFromLoginShell;
265
266
  /**
266
267
  * On Windows, prefer the `.cmd` shim for npm/pnpm/nrm. nvm4w registers
267
268
  * BOTH an extensionless entry (pointing to node.exe) and a `<tool>.cmd`
@@ -270,6 +271,7 @@ declare class EnvironmentInspector {
270
271
  */
271
272
  private getToolShimPath;
272
273
  private getToolVersion;
274
+ private shouldUsePosixLoginShellFallback;
273
275
  private checkNvm;
274
276
  private checkNuget;
275
277
  private getVersionInvocation;
@@ -298,15 +300,6 @@ interface JsonTools {
298
300
  }
299
301
  declare function createJsonTools(): JsonTools;
300
302
 
301
- interface ServiceMeLogger {
302
- debug(message: string, ...args: unknown[]): void;
303
- info(message: string, ...args: unknown[]): void;
304
- warn(message: string, ...args: unknown[]): void;
305
- error(message: string, ...args: unknown[]): void;
306
- }
307
- declare const noopLogger: ServiceMeLogger;
308
- declare function createConsoleLogger(prefix?: string): ServiceMeLogger;
309
-
310
303
  /**
311
304
  * SERVICEME user home directory helpers.
312
305
  *
@@ -326,6 +319,8 @@ declare const DRAFTS_SUBDIR = "drafts";
326
319
  declare const SKILL_DRAFTS_SUBDIR = "skills";
327
320
  declare const AGENT_DRAFTS_SUBDIR = "agents";
328
321
  declare const REPOS_CONFIG_FILENAME = "repos.json";
322
+ /** rev.20 — r7 BYOM Server Proxy toggle self-state (read by ext + CLI + server). */
323
+ declare const SERVER_PROXY_GLOBAL_FILENAME = "server-proxy.json";
329
324
  /**
330
325
  * Repo id regex — used to validate any `repoId` argument before it is joined
331
326
  * into a filesystem path. Keeps path traversal attempts out and gives us a
@@ -410,6 +405,18 @@ declare function getSchedulerLogPath(): string;
410
405
  declare function getMigrationFailuresPath(): string;
411
406
  /** `~/.serviceme/known-workspaces.json` — workspace list the extension has seen. */
412
407
  declare function getKnownWorkspacesPath(): string;
408
+ /**
409
+ * `~/.serviceme/server-proxy.json` — r7 BYOM Server Proxy toggle
410
+ * self-state. Written by the extension's `ProxyConfigService`, readable
411
+ * by the CLI / Server so they can decide whether to route traffic
412
+ * through the corporate proxy without booting VS Code.
413
+ *
414
+ * Lives under user-level `~/.serviceme/` (not under a workspace) because
415
+ * the toggle is a *user preference* — the same human enabling it on
416
+ * machine A should be able to rely on it on machine B after sync, not
417
+ * have it disappear when they switch repos.
418
+ */
419
+ declare function getServerProxyGlobalPath(): string;
413
420
  /** Layout constants for the Phase 5 client-side state files. The server
414
421
  * already has the corresponding routes (`/api/v1/auth/...`,
415
422
  * `/api/v1/device/...`, etc.) — the client just needs the on-disk
@@ -431,6 +438,71 @@ declare function getMachineIdPath(): string;
431
438
  /** `~/.serviceme/profiles.json` — cached projection of server-side profile rows; refresh on demand. */
432
439
  declare function getProfilesJsonPath(): string;
433
440
 
441
+ /** On-disk shape for `~/.serviceme/server-proxy.json`. */
442
+ interface ServerProxyGlobalState {
443
+ /** Whether the user has previously enabled Server Proxy. */
444
+ enabled: boolean;
445
+ /** Last server URL we toggled ON with. Used for re-toggling and UI hint. */
446
+ lastServerUrl: string | undefined;
447
+ /**
448
+ * rev.21 — explicit opt-in to enable Server Proxy even when
449
+ * `http.proxySupport === "override"`. `override` mode forces ALL
450
+ * extensions to route through `http.proxy`; defaulting to `false`
451
+ * keeps the legacy defensive guard against accidental global
452
+ * hijack. Power users (e.g. corp environments that WANT all
453
+ * extensions including GitHub Copilot Chat to route through the
454
+ * corp tunnel) can flip this on via the Webview's "Allow under
455
+ * proxySupport=override" affordance.
456
+ *
457
+ * Note: stored in the global file alongside `enabled` because
458
+ * this is *our* self-flag — it has nothing to do with VS Code's
459
+ * `http.*` schema.
460
+ */
461
+ allowOverride: boolean;
462
+ /** ISO 8601 timestamp of the most recent write. Diagnostic only. */
463
+ updatedAt: string;
464
+ }
465
+ /**
466
+ * Patch semantics (mirrors `vscode.workspace.getConfiguration().update(...)`):
467
+ * - Field omitted / `undefined` → leave the existing value alone.
468
+ * - Field set to `null` → explicitly clear the field.
469
+ *
470
+ * Only `lastServerUrl` distinguishes "leave alone" from "clear"; `enabled`
471
+ * and `allowOverride` are plain `boolean | undefined` because boolean is
472
+ * the natural unit (false = "the user disabled it").
473
+ */
474
+ interface ServerProxyGlobalPatch {
475
+ enabled?: boolean;
476
+ allowOverride?: boolean;
477
+ lastServerUrl?: string | null;
478
+ }
479
+ /**
480
+ * Reads the global config file. Returns `null` if the file does not
481
+ * exist (first-run case) — does NOT throw. Throws on parse errors or
482
+ * permission issues, so callers can surface those to the user.
483
+ */
484
+ declare function readServerProxyGlobal(): Promise<ServerProxyGlobalState | null>;
485
+ /**
486
+ * Merges a partial patch into the existing state and writes back
487
+ * atomically. Creates `~/.serviceme/` if missing.
488
+ *
489
+ * Returns the post-write state. Throws on IO/JSON errors.
490
+ */
491
+ declare function writeServerProxyGlobal(patch: ServerProxyGlobalPatch): Promise<ServerProxyGlobalState>;
492
+ /**
493
+ * Best-effort migration of a legacy `enabled` flag (typically read from
494
+ * VS Code's `settings.json` at `serverProxy.enabled`) into the global
495
+ * config file.
496
+ *
497
+ * Reads via the provided accessor (so tests can stub it), writes the
498
+ * global flag if present, then **clears** the legacy flag via the
499
+ * provided writer — never silently leaves the migration half-done.
500
+ *
501
+ * Returns the migrated state, or `null` if no migration was needed
502
+ * (legacy flag absent OR global config already up to date).
503
+ */
504
+ declare function migrateLegacyServerProxyEnabled(readLegacy: () => boolean | undefined, clearLegacy: () => Promise<void>): Promise<ServerProxyGlobalState | null>;
505
+
434
506
  declare const TOOL_RISK_MAP: Record<string, AgentToolRiskLevel>;
435
507
  declare function parseAgentToolPermissions(content: string): AgentToolPermission[];
436
508
 
@@ -1850,4 +1922,4 @@ declare class SkillStore {
1850
1922
  declare const unzipFile: (zipPath: string, dest: string) => Promise<void>;
1851
1923
  declare const moveFiles: (sourceDir: string, destDir: string, overwrite?: boolean) => Promise<void>;
1852
1924
 
1853
- export { AGENT_DRAFTS_SUBDIR, type AddUserRepoInput, type AddUserRepoResult, type AgentCatalog, AgentCatalogClient, type AgentCatalogClientOptions, type AgentDownloadFile, type AgentInstallScope, type AgentMutateResult, AgentReconciler, type AgentReconcilerDependencies, AgentStore, type AgentStoreFileSystem, type AgentStoreOptions, type AgentsStateFile, type AnyRepoConfig, type AppendLogInput, type BootstrapPhase5Result, CACHE_SUBDIR, CREDENTIALS_CONFIG_FILENAME, CannotRemoveDefaultRepoError, type CreateTaskInput, FIXED_ADDED_AT as DEFAULT_REPO_FIXED_ADDED_AT, DEFAULT_REPO_ID, DEVICE_JSON_FILENAME, DRAFTS_SUBDIR, DaemonLogger, type DefaultRepoConfig, type DraftDetail, DraftNotFoundError, type DraftSummary, DraftsError, DraftsStore, type EditTaskInput, EnvironmentInspector, type EnvironmentInspectorOptions, type ExecutorResult, type FsWatcherCallbacks, type FsWatcherHandle, GitClient, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type InstalledAgent, InvalidDraftError, InvalidRepoUrlError, type IsoTimestamp, type JsonTools, KNOWN_WORKSPACES_FILENAME, type LoadResult, MACHINE_ID_FILENAME, MIGRATION_FAILURES_FILENAME, type MigrateToGlobalOptions, type MigrationResult, type OutputEventCallback, PROFILES_JSON_FILENAME, PidManager, type ProbeError, type ProbeOptions, type ProbeResult, ProjectTools, REPOS_CONFIG_FILENAME, REPOS_SUBDIR, RepoAlreadyExistsError, RepoCloneConflictError, type RepoConfig, RepoManager, RepoManagerError, type RepoManagerOptions, RepoNotFoundError, RepoNotInStoreError, type RepoSource, type ReposFile, type ReposFileInput, ReposLoader, type ReposLoaderFileSystem, type ReposLoaderOptions, ReposStore, type ReposStoreChange, type ReposStoreFileSystem, type ReposStoreListener, type ReposStoreOptions, SAFE_REPO_ID_PATTERN, SCHEDULED_TASKS_CONFIG_FILENAME, SCHEDULED_TASKS_LOG_FILENAME, SCHEDULER_LOCK_FILENAME, SCHEDULER_LOG_FILENAME, SCHEDULER_PID_FILENAME, SERVICEME_DIR_NAME, SERVICEME_HOME_ENV, SKILL_DRAFTS_SUBDIR, type SaveDraftOptions, SchedulerDaemon, SchedulerDaemonV2, type SchedulerDaemonV2Options, type ServiceMeLogger, ShellExecutor, type SkillCatalog, SkillCatalogClient, type SkillCatalogClientOptions, type SkillDownloadFile, type SkillMutateResult, SkillReconciler, type SkillReconcilerDependencies, SkillStore, type SkillStoreFileSystem, type SkillStoreOptions, type StreamingExecutorHandle, type StreamingTaskExecutor, type SyncReport, type SyncStatus, TOOLBOX_JSON_FILENAME, TOOL_RISK_MAP, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, type UserRepoConfig, WorkspaceProbe, repoSchema as anyRepoConfigSchema, assertSafeRepoId, bootstrapDefaults, bootstrapPhase5Placeholders, buildDefaultReposFile, copilotDoctor, copilotPrompt, createConsoleLogger, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, createReposStore, defaultRepoSchema as defaultRepoConfigSchema, ensureDefaultsInstalled, generateDraftId, getAgentDraftsDir, getAllDefaultRepoConfigs, getCacheDir, getCredentialsConfigPath, getDefaultRepoConfig, getDeviceJsonPath, getDraftsDir, getExecutor, getHomeDir, getHomePlatform, getKnownWorkspacesPath, getMachineIdPath, getMigrationFailuresPath, getProfilesJsonPath, getRepoCacheDir, getRepoDir, getReposConfigPath, getReposDir, getScheduledTasksConfigPath, getScheduledTasksLogPath, getSchedulerLockPath, getSchedulerLogPath, getSchedulerPidPath, getServicemeHome, getSkillDraftsDir, getToolboxJsonPath, isCopilotAuthenticated, isDefaultRepo, isStreamingTaskExecutor, isUserRepo, matchesCron, migrateToGlobal, moveFiles, narrowRepoConfig, noopLogger, parseAgentToolPermissions, parseIntervalMs, reposFileSchema, resetUserHomeOverrides, resolveDraftDir, resolveTaskExecutionPayload, setUserHomeOverrides, unzipFile, userRepoSchema as userRepoConfigSchema, validateReposFile, validateTaskPayload };
1925
+ export { AGENT_DRAFTS_SUBDIR, type AddUserRepoInput, type AddUserRepoResult, type AgentCatalog, AgentCatalogClient, type AgentCatalogClientOptions, type AgentDownloadFile, type AgentInstallScope, type AgentMutateResult, AgentReconciler, type AgentReconcilerDependencies, AgentStore, type AgentStoreFileSystem, type AgentStoreOptions, type AgentsStateFile, type AnyRepoConfig, type AppendLogInput, type BootstrapPhase5Result, CACHE_SUBDIR, CREDENTIALS_CONFIG_FILENAME, CannotRemoveDefaultRepoError, type CreateTaskInput, FIXED_ADDED_AT as DEFAULT_REPO_FIXED_ADDED_AT, DEFAULT_REPO_ID, DEVICE_JSON_FILENAME, DRAFTS_SUBDIR, DaemonLogger, type DefaultRepoConfig, type DraftDetail, DraftNotFoundError, type DraftSummary, DraftsError, DraftsStore, type EditTaskInput, EnvironmentInspector, type EnvironmentInspectorOptions, type ExecutorResult, type FsWatcherCallbacks, type FsWatcherHandle, GitClient, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type InstalledAgent, InvalidDraftError, InvalidRepoUrlError, type IsoTimestamp, type JsonTools, KNOWN_WORKSPACES_FILENAME, type LoadResult, MACHINE_ID_FILENAME, MIGRATION_FAILURES_FILENAME, type MigrateToGlobalOptions, type MigrationResult, type OutputEventCallback, PROFILES_JSON_FILENAME, PidManager, type ProbeError, type ProbeOptions, type ProbeResult, ProjectTools, REPOS_CONFIG_FILENAME, REPOS_SUBDIR, RepoAlreadyExistsError, RepoCloneConflictError, type RepoConfig, RepoManager, RepoManagerError, type RepoManagerOptions, RepoNotFoundError, RepoNotInStoreError, type RepoSource, type ReposFile, type ReposFileInput, ReposLoader, type ReposLoaderFileSystem, type ReposLoaderOptions, ReposStore, type ReposStoreChange, type ReposStoreFileSystem, type ReposStoreListener, type ReposStoreOptions, SAFE_REPO_ID_PATTERN, SCHEDULED_TASKS_CONFIG_FILENAME, SCHEDULED_TASKS_LOG_FILENAME, SCHEDULER_LOCK_FILENAME, SCHEDULER_LOG_FILENAME, SCHEDULER_PID_FILENAME, SERVER_PROXY_GLOBAL_FILENAME, SERVICEME_DIR_NAME, SERVICEME_HOME_ENV, SKILL_DRAFTS_SUBDIR, type SaveDraftOptions, SchedulerDaemon, SchedulerDaemonV2, type SchedulerDaemonV2Options, type ServerProxyGlobalPatch, type ServerProxyGlobalState, ShellExecutor, type SkillCatalog, SkillCatalogClient, type SkillCatalogClientOptions, type SkillDownloadFile, type SkillMutateResult, SkillReconciler, type SkillReconcilerDependencies, SkillStore, type SkillStoreFileSystem, type SkillStoreOptions, type StreamingExecutorHandle, type StreamingTaskExecutor, type SyncReport, type SyncStatus, TOOLBOX_JSON_FILENAME, TOOL_RISK_MAP, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, type UserRepoConfig, WorkspaceProbe, repoSchema as anyRepoConfigSchema, assertSafeRepoId, bootstrapDefaults, bootstrapPhase5Placeholders, buildDefaultReposFile, copilotDoctor, copilotPrompt, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, createReposStore, defaultRepoSchema as defaultRepoConfigSchema, ensureDefaultsInstalled, generateDraftId, getAgentDraftsDir, getAllDefaultRepoConfigs, getCacheDir, getCredentialsConfigPath, getDefaultRepoConfig, getDeviceJsonPath, getDraftsDir, getExecutor, getHomeDir, getHomePlatform, getKnownWorkspacesPath, getMachineIdPath, getMigrationFailuresPath, getProfilesJsonPath, getRepoCacheDir, getRepoDir, getReposConfigPath, getReposDir, getScheduledTasksConfigPath, getScheduledTasksLogPath, getSchedulerLockPath, getSchedulerLogPath, getSchedulerPidPath, getServerProxyGlobalPath, getServicemeHome, getSkillDraftsDir, getToolboxJsonPath, isCopilotAuthenticated, isDefaultRepo, isStreamingTaskExecutor, isUserRepo, matchesCron, migrateLegacyServerProxyEnabled, migrateToGlobal, moveFiles, narrowRepoConfig, parseAgentToolPermissions, parseIntervalMs, readServerProxyGlobal, reposFileSchema, resetUserHomeOverrides, resolveDraftDir, resolveTaskExecutionPayload, setUserHomeOverrides, unzipFile, userRepoSchema as userRepoConfigSchema, validateReposFile, validateTaskPayload, writeServerProxyGlobal };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _serviceme_devtools_protocol from '@serviceme/devtools-protocol';
2
2
  import { AgentMarketplaceEntry, AgentMutationRequest, AgentPermissionSummary, CopilotDoctorResult, CopilotPromptOptions, CopilotPromptResult, EnvironmentCheckResult, KnownEnvironmentTool, ToolCheckResult, ServiceMeImageValidationResult, ServiceMeImageInfo, ServiceMeImageCompressOptions, ServiceMeImageCompressResult, JsonSortOptions, JsonValidationResult, AgentToolRiskLevel, AgentToolPermission, ServiceMeProjectExtractTemplateInput, ServiceMeProjectExtractTemplateResult, ServiceMeProjectInstallDepsResult, ServiceMeProjectMakeScriptsExecutableResult, ServiceMeProjectGitInitResult, ServiceMeProjectScaffoldPruneResult, TaskExecutionStatus, ScheduledTaskType, TaskPayload, TaskWorkspaceRef, ScheduledTasksConfig, ScheduledTask, TaskExecutionLog, TaskStartedEventParams, TaskOutputEventParams, TaskCompletedEventParams, TaskFailedEventParams, TaskCancelledEventParams, TaskExecutionSnapshot, RunningTaskInfo, SkillMarketplaceEntry, SkillMutationRequest } from '@serviceme/devtools-protocol';
3
3
  import * as fs from 'node:fs/promises';
4
- export { AccessCheckResult, AccessControl, AccessControlOptions, AuthCore, AuthCoreOptions, AuthStateManager, AuthStateManagerOptions, CancellationCheck, DeviceFlowUiCallback, GitHubAuthProvider, GitHubAuthProviderConfig, IAuthProvider, IAuthProviderSession, IAuthProviderUserInfo, InMemoryKeychainAuthTokenStore, KeyValueStore, KeychainAccountKey, KeychainAuthTokenStore, KeychainTokenEnvelope, KeychainTokenMetadata, KeychainUnavailableError, MicrosoftAuthProvider, MicrosoftProviderNotHostedError, OrgMembershipFetcher, ProviderRegistry, buildGitHubLocalEmail, isGitHubLocalEmail, resolvePrimaryEmail } from './auth.js';
4
+ export { A as AccessCheckResult, a as AccessControl, b as AccessControlOptions, c as AuthCore, d as AuthCoreOptions, e as AuthStateManager, f as AuthStateManagerOptions, C as CancellationCheck, D as DeviceFlowUiCallback, G as GitHubAuthProvider, g as GitHubAuthProviderConfig, I as IAuthProvider, h as IAuthProviderSession, i as IAuthProviderUserInfo, j as InMemoryKeychainAuthTokenStore, K as KeyValueStore, k as KeychainAccountKey, l as KeychainAuthTokenStore, m as KeychainTokenEnvelope, n as KeychainTokenMetadata, o as KeychainUnavailableError, M as MicrosoftAuthProvider, p as MicrosoftProviderNotHostedError, O as OrgMembershipFetcher, P as ProviderRegistry, S as ServiceMeLogger, q as buildGitHubLocalEmail, r as createConsoleLogger, s as isGitHubLocalEmail, t as noopLogger, u as resolvePrimaryEmail } from './index-87-_JvQi.js';
5
5
  export { AtomicWriteResult, BuildSignedHeadersParams, DEVICE_JSON_SCHEMA_VERSION, DeviceAuthHeaders, DeviceCore, DeviceCoreOptions, DeviceReenrollRequiresAuthError, DeviceRequestSignatureParams, DeviceSecretVersionMismatchError, DeviceSignedHeaders, EnrollRequestFn, EnrollResponse, Enroller, EnrollerOptions, FsIdentityFileBackend, IdentityFileBackend, IdentityStore, IdentityStoreHooks, IdentityStoreOptions, PersistedDeviceIdentity, buildSignedHeaders, createDeviceRequestSignature, deriveInstallationId, fingerprintSource, randomInstallationId } from './device.js';
6
6
  import { c as SkillKind, b as SkillFile } from './types-B9gk3dXH.js';
7
7
  import { G as GitClient, P as PullResult } from './index-BmxS1A9G.js';
@@ -262,6 +262,7 @@ declare class EnvironmentInspector {
262
262
  checkEnvironment(): Promise<EnvironmentCheckResult>;
263
263
  checkTool(toolName: KnownEnvironmentTool): Promise<ToolCheckResult>;
264
264
  private getToolPath;
265
+ private getToolPathFromLoginShell;
265
266
  /**
266
267
  * On Windows, prefer the `.cmd` shim for npm/pnpm/nrm. nvm4w registers
267
268
  * BOTH an extensionless entry (pointing to node.exe) and a `<tool>.cmd`
@@ -270,6 +271,7 @@ declare class EnvironmentInspector {
270
271
  */
271
272
  private getToolShimPath;
272
273
  private getToolVersion;
274
+ private shouldUsePosixLoginShellFallback;
273
275
  private checkNvm;
274
276
  private checkNuget;
275
277
  private getVersionInvocation;
@@ -298,15 +300,6 @@ interface JsonTools {
298
300
  }
299
301
  declare function createJsonTools(): JsonTools;
300
302
 
301
- interface ServiceMeLogger {
302
- debug(message: string, ...args: unknown[]): void;
303
- info(message: string, ...args: unknown[]): void;
304
- warn(message: string, ...args: unknown[]): void;
305
- error(message: string, ...args: unknown[]): void;
306
- }
307
- declare const noopLogger: ServiceMeLogger;
308
- declare function createConsoleLogger(prefix?: string): ServiceMeLogger;
309
-
310
303
  /**
311
304
  * SERVICEME user home directory helpers.
312
305
  *
@@ -326,6 +319,8 @@ declare const DRAFTS_SUBDIR = "drafts";
326
319
  declare const SKILL_DRAFTS_SUBDIR = "skills";
327
320
  declare const AGENT_DRAFTS_SUBDIR = "agents";
328
321
  declare const REPOS_CONFIG_FILENAME = "repos.json";
322
+ /** rev.20 — r7 BYOM Server Proxy toggle self-state (read by ext + CLI + server). */
323
+ declare const SERVER_PROXY_GLOBAL_FILENAME = "server-proxy.json";
329
324
  /**
330
325
  * Repo id regex — used to validate any `repoId` argument before it is joined
331
326
  * into a filesystem path. Keeps path traversal attempts out and gives us a
@@ -410,6 +405,18 @@ declare function getSchedulerLogPath(): string;
410
405
  declare function getMigrationFailuresPath(): string;
411
406
  /** `~/.serviceme/known-workspaces.json` — workspace list the extension has seen. */
412
407
  declare function getKnownWorkspacesPath(): string;
408
+ /**
409
+ * `~/.serviceme/server-proxy.json` — r7 BYOM Server Proxy toggle
410
+ * self-state. Written by the extension's `ProxyConfigService`, readable
411
+ * by the CLI / Server so they can decide whether to route traffic
412
+ * through the corporate proxy without booting VS Code.
413
+ *
414
+ * Lives under user-level `~/.serviceme/` (not under a workspace) because
415
+ * the toggle is a *user preference* — the same human enabling it on
416
+ * machine A should be able to rely on it on machine B after sync, not
417
+ * have it disappear when they switch repos.
418
+ */
419
+ declare function getServerProxyGlobalPath(): string;
413
420
  /** Layout constants for the Phase 5 client-side state files. The server
414
421
  * already has the corresponding routes (`/api/v1/auth/...`,
415
422
  * `/api/v1/device/...`, etc.) — the client just needs the on-disk
@@ -431,6 +438,71 @@ declare function getMachineIdPath(): string;
431
438
  /** `~/.serviceme/profiles.json` — cached projection of server-side profile rows; refresh on demand. */
432
439
  declare function getProfilesJsonPath(): string;
433
440
 
441
+ /** On-disk shape for `~/.serviceme/server-proxy.json`. */
442
+ interface ServerProxyGlobalState {
443
+ /** Whether the user has previously enabled Server Proxy. */
444
+ enabled: boolean;
445
+ /** Last server URL we toggled ON with. Used for re-toggling and UI hint. */
446
+ lastServerUrl: string | undefined;
447
+ /**
448
+ * rev.21 — explicit opt-in to enable Server Proxy even when
449
+ * `http.proxySupport === "override"`. `override` mode forces ALL
450
+ * extensions to route through `http.proxy`; defaulting to `false`
451
+ * keeps the legacy defensive guard against accidental global
452
+ * hijack. Power users (e.g. corp environments that WANT all
453
+ * extensions including GitHub Copilot Chat to route through the
454
+ * corp tunnel) can flip this on via the Webview's "Allow under
455
+ * proxySupport=override" affordance.
456
+ *
457
+ * Note: stored in the global file alongside `enabled` because
458
+ * this is *our* self-flag — it has nothing to do with VS Code's
459
+ * `http.*` schema.
460
+ */
461
+ allowOverride: boolean;
462
+ /** ISO 8601 timestamp of the most recent write. Diagnostic only. */
463
+ updatedAt: string;
464
+ }
465
+ /**
466
+ * Patch semantics (mirrors `vscode.workspace.getConfiguration().update(...)`):
467
+ * - Field omitted / `undefined` → leave the existing value alone.
468
+ * - Field set to `null` → explicitly clear the field.
469
+ *
470
+ * Only `lastServerUrl` distinguishes "leave alone" from "clear"; `enabled`
471
+ * and `allowOverride` are plain `boolean | undefined` because boolean is
472
+ * the natural unit (false = "the user disabled it").
473
+ */
474
+ interface ServerProxyGlobalPatch {
475
+ enabled?: boolean;
476
+ allowOverride?: boolean;
477
+ lastServerUrl?: string | null;
478
+ }
479
+ /**
480
+ * Reads the global config file. Returns `null` if the file does not
481
+ * exist (first-run case) — does NOT throw. Throws on parse errors or
482
+ * permission issues, so callers can surface those to the user.
483
+ */
484
+ declare function readServerProxyGlobal(): Promise<ServerProxyGlobalState | null>;
485
+ /**
486
+ * Merges a partial patch into the existing state and writes back
487
+ * atomically. Creates `~/.serviceme/` if missing.
488
+ *
489
+ * Returns the post-write state. Throws on IO/JSON errors.
490
+ */
491
+ declare function writeServerProxyGlobal(patch: ServerProxyGlobalPatch): Promise<ServerProxyGlobalState>;
492
+ /**
493
+ * Best-effort migration of a legacy `enabled` flag (typically read from
494
+ * VS Code's `settings.json` at `serverProxy.enabled`) into the global
495
+ * config file.
496
+ *
497
+ * Reads via the provided accessor (so tests can stub it), writes the
498
+ * global flag if present, then **clears** the legacy flag via the
499
+ * provided writer — never silently leaves the migration half-done.
500
+ *
501
+ * Returns the migrated state, or `null` if no migration was needed
502
+ * (legacy flag absent OR global config already up to date).
503
+ */
504
+ declare function migrateLegacyServerProxyEnabled(readLegacy: () => boolean | undefined, clearLegacy: () => Promise<void>): Promise<ServerProxyGlobalState | null>;
505
+
434
506
  declare const TOOL_RISK_MAP: Record<string, AgentToolRiskLevel>;
435
507
  declare function parseAgentToolPermissions(content: string): AgentToolPermission[];
436
508
 
@@ -1850,4 +1922,4 @@ declare class SkillStore {
1850
1922
  declare const unzipFile: (zipPath: string, dest: string) => Promise<void>;
1851
1923
  declare const moveFiles: (sourceDir: string, destDir: string, overwrite?: boolean) => Promise<void>;
1852
1924
 
1853
- export { AGENT_DRAFTS_SUBDIR, type AddUserRepoInput, type AddUserRepoResult, type AgentCatalog, AgentCatalogClient, type AgentCatalogClientOptions, type AgentDownloadFile, type AgentInstallScope, type AgentMutateResult, AgentReconciler, type AgentReconcilerDependencies, AgentStore, type AgentStoreFileSystem, type AgentStoreOptions, type AgentsStateFile, type AnyRepoConfig, type AppendLogInput, type BootstrapPhase5Result, CACHE_SUBDIR, CREDENTIALS_CONFIG_FILENAME, CannotRemoveDefaultRepoError, type CreateTaskInput, FIXED_ADDED_AT as DEFAULT_REPO_FIXED_ADDED_AT, DEFAULT_REPO_ID, DEVICE_JSON_FILENAME, DRAFTS_SUBDIR, DaemonLogger, type DefaultRepoConfig, type DraftDetail, DraftNotFoundError, type DraftSummary, DraftsError, DraftsStore, type EditTaskInput, EnvironmentInspector, type EnvironmentInspectorOptions, type ExecutorResult, type FsWatcherCallbacks, type FsWatcherHandle, GitClient, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type InstalledAgent, InvalidDraftError, InvalidRepoUrlError, type IsoTimestamp, type JsonTools, KNOWN_WORKSPACES_FILENAME, type LoadResult, MACHINE_ID_FILENAME, MIGRATION_FAILURES_FILENAME, type MigrateToGlobalOptions, type MigrationResult, type OutputEventCallback, PROFILES_JSON_FILENAME, PidManager, type ProbeError, type ProbeOptions, type ProbeResult, ProjectTools, REPOS_CONFIG_FILENAME, REPOS_SUBDIR, RepoAlreadyExistsError, RepoCloneConflictError, type RepoConfig, RepoManager, RepoManagerError, type RepoManagerOptions, RepoNotFoundError, RepoNotInStoreError, type RepoSource, type ReposFile, type ReposFileInput, ReposLoader, type ReposLoaderFileSystem, type ReposLoaderOptions, ReposStore, type ReposStoreChange, type ReposStoreFileSystem, type ReposStoreListener, type ReposStoreOptions, SAFE_REPO_ID_PATTERN, SCHEDULED_TASKS_CONFIG_FILENAME, SCHEDULED_TASKS_LOG_FILENAME, SCHEDULER_LOCK_FILENAME, SCHEDULER_LOG_FILENAME, SCHEDULER_PID_FILENAME, SERVICEME_DIR_NAME, SERVICEME_HOME_ENV, SKILL_DRAFTS_SUBDIR, type SaveDraftOptions, SchedulerDaemon, SchedulerDaemonV2, type SchedulerDaemonV2Options, type ServiceMeLogger, ShellExecutor, type SkillCatalog, SkillCatalogClient, type SkillCatalogClientOptions, type SkillDownloadFile, type SkillMutateResult, SkillReconciler, type SkillReconcilerDependencies, SkillStore, type SkillStoreFileSystem, type SkillStoreOptions, type StreamingExecutorHandle, type StreamingTaskExecutor, type SyncReport, type SyncStatus, TOOLBOX_JSON_FILENAME, TOOL_RISK_MAP, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, type UserRepoConfig, WorkspaceProbe, repoSchema as anyRepoConfigSchema, assertSafeRepoId, bootstrapDefaults, bootstrapPhase5Placeholders, buildDefaultReposFile, copilotDoctor, copilotPrompt, createConsoleLogger, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, createReposStore, defaultRepoSchema as defaultRepoConfigSchema, ensureDefaultsInstalled, generateDraftId, getAgentDraftsDir, getAllDefaultRepoConfigs, getCacheDir, getCredentialsConfigPath, getDefaultRepoConfig, getDeviceJsonPath, getDraftsDir, getExecutor, getHomeDir, getHomePlatform, getKnownWorkspacesPath, getMachineIdPath, getMigrationFailuresPath, getProfilesJsonPath, getRepoCacheDir, getRepoDir, getReposConfigPath, getReposDir, getScheduledTasksConfigPath, getScheduledTasksLogPath, getSchedulerLockPath, getSchedulerLogPath, getSchedulerPidPath, getServicemeHome, getSkillDraftsDir, getToolboxJsonPath, isCopilotAuthenticated, isDefaultRepo, isStreamingTaskExecutor, isUserRepo, matchesCron, migrateToGlobal, moveFiles, narrowRepoConfig, noopLogger, parseAgentToolPermissions, parseIntervalMs, reposFileSchema, resetUserHomeOverrides, resolveDraftDir, resolveTaskExecutionPayload, setUserHomeOverrides, unzipFile, userRepoSchema as userRepoConfigSchema, validateReposFile, validateTaskPayload };
1925
+ export { AGENT_DRAFTS_SUBDIR, type AddUserRepoInput, type AddUserRepoResult, type AgentCatalog, AgentCatalogClient, type AgentCatalogClientOptions, type AgentDownloadFile, type AgentInstallScope, type AgentMutateResult, AgentReconciler, type AgentReconcilerDependencies, AgentStore, type AgentStoreFileSystem, type AgentStoreOptions, type AgentsStateFile, type AnyRepoConfig, type AppendLogInput, type BootstrapPhase5Result, CACHE_SUBDIR, CREDENTIALS_CONFIG_FILENAME, CannotRemoveDefaultRepoError, type CreateTaskInput, FIXED_ADDED_AT as DEFAULT_REPO_FIXED_ADDED_AT, DEFAULT_REPO_ID, DEVICE_JSON_FILENAME, DRAFTS_SUBDIR, DaemonLogger, type DefaultRepoConfig, type DraftDetail, DraftNotFoundError, type DraftSummary, DraftsError, DraftsStore, type EditTaskInput, EnvironmentInspector, type EnvironmentInspectorOptions, type ExecutorResult, type FsWatcherCallbacks, type FsWatcherHandle, GitClient, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type InstalledAgent, InvalidDraftError, InvalidRepoUrlError, type IsoTimestamp, type JsonTools, KNOWN_WORKSPACES_FILENAME, type LoadResult, MACHINE_ID_FILENAME, MIGRATION_FAILURES_FILENAME, type MigrateToGlobalOptions, type MigrationResult, type OutputEventCallback, PROFILES_JSON_FILENAME, PidManager, type ProbeError, type ProbeOptions, type ProbeResult, ProjectTools, REPOS_CONFIG_FILENAME, REPOS_SUBDIR, RepoAlreadyExistsError, RepoCloneConflictError, type RepoConfig, RepoManager, RepoManagerError, type RepoManagerOptions, RepoNotFoundError, RepoNotInStoreError, type RepoSource, type ReposFile, type ReposFileInput, ReposLoader, type ReposLoaderFileSystem, type ReposLoaderOptions, ReposStore, type ReposStoreChange, type ReposStoreFileSystem, type ReposStoreListener, type ReposStoreOptions, SAFE_REPO_ID_PATTERN, SCHEDULED_TASKS_CONFIG_FILENAME, SCHEDULED_TASKS_LOG_FILENAME, SCHEDULER_LOCK_FILENAME, SCHEDULER_LOG_FILENAME, SCHEDULER_PID_FILENAME, SERVER_PROXY_GLOBAL_FILENAME, SERVICEME_DIR_NAME, SERVICEME_HOME_ENV, SKILL_DRAFTS_SUBDIR, type SaveDraftOptions, SchedulerDaemon, SchedulerDaemonV2, type SchedulerDaemonV2Options, type ServerProxyGlobalPatch, type ServerProxyGlobalState, ShellExecutor, type SkillCatalog, SkillCatalogClient, type SkillCatalogClientOptions, type SkillDownloadFile, type SkillMutateResult, SkillReconciler, type SkillReconcilerDependencies, SkillStore, type SkillStoreFileSystem, type SkillStoreOptions, type StreamingExecutorHandle, type StreamingTaskExecutor, type SyncReport, type SyncStatus, TOOLBOX_JSON_FILENAME, TOOL_RISK_MAP, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, type UserRepoConfig, WorkspaceProbe, repoSchema as anyRepoConfigSchema, assertSafeRepoId, bootstrapDefaults, bootstrapPhase5Placeholders, buildDefaultReposFile, copilotDoctor, copilotPrompt, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, createReposStore, defaultRepoSchema as defaultRepoConfigSchema, ensureDefaultsInstalled, generateDraftId, getAgentDraftsDir, getAllDefaultRepoConfigs, getCacheDir, getCredentialsConfigPath, getDefaultRepoConfig, getDeviceJsonPath, getDraftsDir, getExecutor, getHomeDir, getHomePlatform, getKnownWorkspacesPath, getMachineIdPath, getMigrationFailuresPath, getProfilesJsonPath, getRepoCacheDir, getRepoDir, getReposConfigPath, getReposDir, getScheduledTasksConfigPath, getScheduledTasksLogPath, getSchedulerLockPath, getSchedulerLogPath, getSchedulerPidPath, getServerProxyGlobalPath, getServicemeHome, getSkillDraftsDir, getToolboxJsonPath, isCopilotAuthenticated, isDefaultRepo, isStreamingTaskExecutor, isUserRepo, matchesCron, migrateLegacyServerProxyEnabled, migrateToGlobal, moveFiles, narrowRepoConfig, parseAgentToolPermissions, parseIntervalMs, readServerProxyGlobal, reposFileSchema, resetUserHomeOverrides, resolveDraftDir, resolveTaskExecutionPayload, setUserHomeOverrides, unzipFile, userRepoSchema as userRepoConfigSchema, validateReposFile, validateTaskPayload, writeServerProxyGlobal };