@maintainer-pro/ai-cli 0.1.8 → 0.1.9

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.cjs CHANGED
@@ -79,7 +79,6 @@ __export(index_exports, {
79
79
  isPathAllowed: () => isPathAllowed,
80
80
  maintainerProHome: () => maintainerProHome,
81
81
  mergeDesiredHostApps: () => mergeDesiredHostApps,
82
- normalizeEnvMaps: () => normalizeEnvMaps,
83
82
  normalizeHostApp: () => normalizeHostApp,
84
83
  normalizeHostApps: () => normalizeHostApps,
85
84
  normalizeIgnorePaths: () => normalizeIgnorePaths,
@@ -2909,26 +2908,9 @@ function normalizeHostApp(raw) {
2909
2908
  row.source
2910
2909
  ) ? row.source : "manual",
2911
2910
  locked: row.locked === true || id === AI_SERVER_APP_ID || role === "ai-server",
2912
- host: role !== "ai-server" && id !== AI_SERVER_APP_ID && row.host === true,
2913
- envMaps: normalizeEnvMaps(row.envMaps)
2911
+ host: role !== "ai-server" && id !== AI_SERVER_APP_ID && row.host === true
2914
2912
  };
2915
2913
  }
2916
- function normalizeEnvMaps(raw) {
2917
- if (!Array.isArray(raw)) return [];
2918
- const seen = /* @__PURE__ */ new Set();
2919
- const out = [];
2920
- for (const item of raw) {
2921
- if (!item || typeof item !== "object") continue;
2922
- const row = item;
2923
- const key = String(row.key || "").trim();
2924
- const sourceAppId = String(row.sourceAppId || "").trim().slice(0, 64);
2925
- if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key) || key.length > 80) continue;
2926
- if (!sourceAppId || seen.has(key)) continue;
2927
- seen.add(key);
2928
- out.push({ key, sourceAppId });
2929
- }
2930
- return out.slice(0, 30);
2931
- }
2932
2914
  function ensureSingleHost(apps) {
2933
2915
  const next = apps.map((app) => ({
2934
2916
  ...app,
@@ -3206,8 +3188,7 @@ function mergeDesiredHostApps(desired, detected) {
3206
3188
  ...app,
3207
3189
  startCommand: app.startCommand || local?.startCommand || null,
3208
3190
  locked: app.locked || app.id === AI_SERVER_APP_ID || app.role === "ai-server",
3209
- host: app.role === "ai-server" || app.id === AI_SERVER_APP_ID ? false : app.host === true || app.host !== false && local?.host === true,
3210
- envMaps: app.envMaps && app.envMaps.length ? app.envMaps : local?.envMaps || []
3191
+ host: app.role === "ai-server" || app.id === AI_SERVER_APP_ID ? false : app.host === true || app.host !== false && local?.host === true
3211
3192
  };
3212
3193
  });
3213
3194
  return ensureAiServerApp(merged);
@@ -3540,7 +3521,6 @@ Return the real local ports and npm script names.`
3540
3521
  isPathAllowed,
3541
3522
  maintainerProHome,
3542
3523
  mergeDesiredHostApps,
3543
- normalizeEnvMaps,
3544
3524
  normalizeHostApp,
3545
3525
  normalizeHostApps,
3546
3526
  normalizeIgnorePaths,
package/dist/index.d.cts CHANGED
@@ -528,10 +528,6 @@ declare const AI_SERVER_APP_ID = "ai-server";
528
528
  declare const AI_SERVER_DEFAULT_PORT = 3100;
529
529
  type HostAppRole = "ai-server" | "ui" | "backend" | "app" | "custom";
530
530
  type HostAppSource = "default" | "env" | "package" | "ai" | "manual";
531
- type HostEnvMap = {
532
- key: string;
533
- sourceAppId: string;
534
- };
535
531
  type HostApp = {
536
532
  id: string;
537
533
  name: string;
@@ -540,9 +536,8 @@ type HostApp = {
540
536
  startCommand?: string | null;
541
537
  source: HostAppSource;
542
538
  locked?: boolean;
543
- /** Share URL / CORS UI — the page the browser opens. */
539
+ /** Share URL — the page the browser opens. */
544
540
  host?: boolean;
545
- envMaps?: HostEnvMap[];
546
541
  };
547
542
  type HostAppsResolveInput = {
548
543
  workspaceDir: string;
@@ -602,7 +597,6 @@ declare function hostAppsCachePath(folder: string, extra?: {
602
597
  }): string;
603
598
  declare function defaultAiServerApp(port?: number): HostApp;
604
599
  declare function normalizeHostApp(raw: unknown): HostApp | null;
605
- declare function normalizeEnvMaps(raw: unknown): HostEnvMap[];
606
600
  declare function ensureSingleHost(apps: HostApp[]): HostApp[];
607
601
  declare function normalizeHostApps(raw: unknown): HostApp[];
608
602
  declare function ensureAiServerApp(apps: HostApp[], preferredPort?: number): HostApp[];
@@ -651,4 +645,4 @@ declare function proposeHostAppsFromConfig(input: ProposeHostAppsInput): Promise
651
645
  */
652
646
  declare function resolveHostApps(input: HostAppsResolveInput): Promise<HostAppsResolveResult>;
653
647
 
654
- export { ACCESS_IGNORE_BEGIN, ACCESS_IGNORE_END, AI_SERVER_APP_ID, AI_SERVER_DEFAULT_PORT, type AiCliProviderId, type AiProvider, type AiResponse, COLLABORATER_DIR, type CachedChatMessage, type CachedConversation, type CallAiOptions, type ChatAttachment, type ChatHandlerOptions, type ChatHandlers, type ChatMessage, type ChatSenderType, type ChatStoreLike, type ChatUser, type ClientContext, DEFAULT_AI_IGNORE_PATHS, HOST_APPS_FILE, type HostApp, type HostAppAlternative, type HostAppRole, type HostAppSource, type HostAppsResolveInput, type HostAppsResolveResult, type HostEnvMap, type LocalStoredMessage, MAINTAINER_PRO_HOME_DIR, type MaintainerProStoreOptions, PROMPT_SECTION, type ParentChainEntry, type ParentChainSource, type PriorConversationOptions, type ProjectDataInput, type ProposeHostAppsInput, type ProviderPreference, type SetupProposal, type SetupProposalConfidence, type SyncedChatStore, type SyncedChatStoreOptions, type SyncedStoreStats, type ToolCall, type ToolSchemaMap, WORKING_PROVIDER, type WorkingTurnEvent, type WorkspaceInspectInput, type WorkspaceInspectResult, type WorkspaceKind, buildClaudeUserPrompt, buildConversationPrompt, buildCursorPrompt, buildPriorConversationsContext, callAi, collectParentChain, commandExists, createAntigravityProvider, createBuiltinProviders, createChatHandler, createClaudeProvider, createCursorProvider, createDefaultSystemPrompt, createInfoLogger, createLocalDirectoryStore, createLogger, createMaintainerProStore, createMaintainerProStoreFromEnv, createSyncedChatStore, createToolValidator, defaultAiServerApp, detectHostAppsFromFiles, ensureAiServerApp, ensureProjectDataDir, ensureSingleHost, formatAccessPolicyPromptSection, formatClientContext, formatParentChainContext, getProviderPreference, hostAppsCachePath, hostAppsFingerprint, inspectAndRepairWorkspace, inspectConfigOnly, isDevMode, isIgnoredRelative, isInsideWorkspace, isPathAllowed, maintainerProHome, mergeDesiredHostApps, normalizeEnvMaps, normalizeHostApp, normalizeHostApps, normalizeIgnorePaths, parentChainForTurn, parseAiResponse, parseIgnorePathsEnv, parsePort, previewText, hostAppsCachePath$1 as projectHostAppsPath, projectIdForFolder, projectUploadsDir, proposeHostAppsFromConfig, providerLabel, readCollaboraterApps, readHostAppsCache, readProjectEnvLayers, renderManagedIgnoreBlock, resolveCliBinary, resolveHostApps, resolveIgnorePaths, resolveLogLevel, resolveProjectDataDir, resolveProvider, sanitizeProjectId, saveChatAttachments, toNextRoute, upsertManagedIgnoreFile, writeCollaboraterApps, writeHostAppsCache };
648
+ export { ACCESS_IGNORE_BEGIN, ACCESS_IGNORE_END, AI_SERVER_APP_ID, AI_SERVER_DEFAULT_PORT, type AiCliProviderId, type AiProvider, type AiResponse, COLLABORATER_DIR, type CachedChatMessage, type CachedConversation, type CallAiOptions, type ChatAttachment, type ChatHandlerOptions, type ChatHandlers, type ChatMessage, type ChatSenderType, type ChatStoreLike, type ChatUser, type ClientContext, DEFAULT_AI_IGNORE_PATHS, HOST_APPS_FILE, type HostApp, type HostAppAlternative, type HostAppRole, type HostAppSource, type HostAppsResolveInput, type HostAppsResolveResult, type LocalStoredMessage, MAINTAINER_PRO_HOME_DIR, type MaintainerProStoreOptions, PROMPT_SECTION, type ParentChainEntry, type ParentChainSource, type PriorConversationOptions, type ProjectDataInput, type ProposeHostAppsInput, type ProviderPreference, type SetupProposal, type SetupProposalConfidence, type SyncedChatStore, type SyncedChatStoreOptions, type SyncedStoreStats, type ToolCall, type ToolSchemaMap, WORKING_PROVIDER, type WorkingTurnEvent, type WorkspaceInspectInput, type WorkspaceInspectResult, type WorkspaceKind, buildClaudeUserPrompt, buildConversationPrompt, buildCursorPrompt, buildPriorConversationsContext, callAi, collectParentChain, commandExists, createAntigravityProvider, createBuiltinProviders, createChatHandler, createClaudeProvider, createCursorProvider, createDefaultSystemPrompt, createInfoLogger, createLocalDirectoryStore, createLogger, createMaintainerProStore, createMaintainerProStoreFromEnv, createSyncedChatStore, createToolValidator, defaultAiServerApp, detectHostAppsFromFiles, ensureAiServerApp, ensureProjectDataDir, ensureSingleHost, formatAccessPolicyPromptSection, formatClientContext, formatParentChainContext, getProviderPreference, hostAppsCachePath, hostAppsFingerprint, inspectAndRepairWorkspace, inspectConfigOnly, isDevMode, isIgnoredRelative, isInsideWorkspace, isPathAllowed, maintainerProHome, mergeDesiredHostApps, normalizeHostApp, normalizeHostApps, normalizeIgnorePaths, parentChainForTurn, parseAiResponse, parseIgnorePathsEnv, parsePort, previewText, hostAppsCachePath$1 as projectHostAppsPath, projectIdForFolder, projectUploadsDir, proposeHostAppsFromConfig, providerLabel, readCollaboraterApps, readHostAppsCache, readProjectEnvLayers, renderManagedIgnoreBlock, resolveCliBinary, resolveHostApps, resolveIgnorePaths, resolveLogLevel, resolveProjectDataDir, resolveProvider, sanitizeProjectId, saveChatAttachments, toNextRoute, upsertManagedIgnoreFile, writeCollaboraterApps, writeHostAppsCache };
package/dist/index.d.ts CHANGED
@@ -528,10 +528,6 @@ declare const AI_SERVER_APP_ID = "ai-server";
528
528
  declare const AI_SERVER_DEFAULT_PORT = 3100;
529
529
  type HostAppRole = "ai-server" | "ui" | "backend" | "app" | "custom";
530
530
  type HostAppSource = "default" | "env" | "package" | "ai" | "manual";
531
- type HostEnvMap = {
532
- key: string;
533
- sourceAppId: string;
534
- };
535
531
  type HostApp = {
536
532
  id: string;
537
533
  name: string;
@@ -540,9 +536,8 @@ type HostApp = {
540
536
  startCommand?: string | null;
541
537
  source: HostAppSource;
542
538
  locked?: boolean;
543
- /** Share URL / CORS UI — the page the browser opens. */
539
+ /** Share URL — the page the browser opens. */
544
540
  host?: boolean;
545
- envMaps?: HostEnvMap[];
546
541
  };
547
542
  type HostAppsResolveInput = {
548
543
  workspaceDir: string;
@@ -602,7 +597,6 @@ declare function hostAppsCachePath(folder: string, extra?: {
602
597
  }): string;
603
598
  declare function defaultAiServerApp(port?: number): HostApp;
604
599
  declare function normalizeHostApp(raw: unknown): HostApp | null;
605
- declare function normalizeEnvMaps(raw: unknown): HostEnvMap[];
606
600
  declare function ensureSingleHost(apps: HostApp[]): HostApp[];
607
601
  declare function normalizeHostApps(raw: unknown): HostApp[];
608
602
  declare function ensureAiServerApp(apps: HostApp[], preferredPort?: number): HostApp[];
@@ -651,4 +645,4 @@ declare function proposeHostAppsFromConfig(input: ProposeHostAppsInput): Promise
651
645
  */
652
646
  declare function resolveHostApps(input: HostAppsResolveInput): Promise<HostAppsResolveResult>;
653
647
 
654
- export { ACCESS_IGNORE_BEGIN, ACCESS_IGNORE_END, AI_SERVER_APP_ID, AI_SERVER_DEFAULT_PORT, type AiCliProviderId, type AiProvider, type AiResponse, COLLABORATER_DIR, type CachedChatMessage, type CachedConversation, type CallAiOptions, type ChatAttachment, type ChatHandlerOptions, type ChatHandlers, type ChatMessage, type ChatSenderType, type ChatStoreLike, type ChatUser, type ClientContext, DEFAULT_AI_IGNORE_PATHS, HOST_APPS_FILE, type HostApp, type HostAppAlternative, type HostAppRole, type HostAppSource, type HostAppsResolveInput, type HostAppsResolveResult, type HostEnvMap, type LocalStoredMessage, MAINTAINER_PRO_HOME_DIR, type MaintainerProStoreOptions, PROMPT_SECTION, type ParentChainEntry, type ParentChainSource, type PriorConversationOptions, type ProjectDataInput, type ProposeHostAppsInput, type ProviderPreference, type SetupProposal, type SetupProposalConfidence, type SyncedChatStore, type SyncedChatStoreOptions, type SyncedStoreStats, type ToolCall, type ToolSchemaMap, WORKING_PROVIDER, type WorkingTurnEvent, type WorkspaceInspectInput, type WorkspaceInspectResult, type WorkspaceKind, buildClaudeUserPrompt, buildConversationPrompt, buildCursorPrompt, buildPriorConversationsContext, callAi, collectParentChain, commandExists, createAntigravityProvider, createBuiltinProviders, createChatHandler, createClaudeProvider, createCursorProvider, createDefaultSystemPrompt, createInfoLogger, createLocalDirectoryStore, createLogger, createMaintainerProStore, createMaintainerProStoreFromEnv, createSyncedChatStore, createToolValidator, defaultAiServerApp, detectHostAppsFromFiles, ensureAiServerApp, ensureProjectDataDir, ensureSingleHost, formatAccessPolicyPromptSection, formatClientContext, formatParentChainContext, getProviderPreference, hostAppsCachePath, hostAppsFingerprint, inspectAndRepairWorkspace, inspectConfigOnly, isDevMode, isIgnoredRelative, isInsideWorkspace, isPathAllowed, maintainerProHome, mergeDesiredHostApps, normalizeEnvMaps, normalizeHostApp, normalizeHostApps, normalizeIgnorePaths, parentChainForTurn, parseAiResponse, parseIgnorePathsEnv, parsePort, previewText, hostAppsCachePath$1 as projectHostAppsPath, projectIdForFolder, projectUploadsDir, proposeHostAppsFromConfig, providerLabel, readCollaboraterApps, readHostAppsCache, readProjectEnvLayers, renderManagedIgnoreBlock, resolveCliBinary, resolveHostApps, resolveIgnorePaths, resolveLogLevel, resolveProjectDataDir, resolveProvider, sanitizeProjectId, saveChatAttachments, toNextRoute, upsertManagedIgnoreFile, writeCollaboraterApps, writeHostAppsCache };
648
+ export { ACCESS_IGNORE_BEGIN, ACCESS_IGNORE_END, AI_SERVER_APP_ID, AI_SERVER_DEFAULT_PORT, type AiCliProviderId, type AiProvider, type AiResponse, COLLABORATER_DIR, type CachedChatMessage, type CachedConversation, type CallAiOptions, type ChatAttachment, type ChatHandlerOptions, type ChatHandlers, type ChatMessage, type ChatSenderType, type ChatStoreLike, type ChatUser, type ClientContext, DEFAULT_AI_IGNORE_PATHS, HOST_APPS_FILE, type HostApp, type HostAppAlternative, type HostAppRole, type HostAppSource, type HostAppsResolveInput, type HostAppsResolveResult, type LocalStoredMessage, MAINTAINER_PRO_HOME_DIR, type MaintainerProStoreOptions, PROMPT_SECTION, type ParentChainEntry, type ParentChainSource, type PriorConversationOptions, type ProjectDataInput, type ProposeHostAppsInput, type ProviderPreference, type SetupProposal, type SetupProposalConfidence, type SyncedChatStore, type SyncedChatStoreOptions, type SyncedStoreStats, type ToolCall, type ToolSchemaMap, WORKING_PROVIDER, type WorkingTurnEvent, type WorkspaceInspectInput, type WorkspaceInspectResult, type WorkspaceKind, buildClaudeUserPrompt, buildConversationPrompt, buildCursorPrompt, buildPriorConversationsContext, callAi, collectParentChain, commandExists, createAntigravityProvider, createBuiltinProviders, createChatHandler, createClaudeProvider, createCursorProvider, createDefaultSystemPrompt, createInfoLogger, createLocalDirectoryStore, createLogger, createMaintainerProStore, createMaintainerProStoreFromEnv, createSyncedChatStore, createToolValidator, defaultAiServerApp, detectHostAppsFromFiles, ensureAiServerApp, ensureProjectDataDir, ensureSingleHost, formatAccessPolicyPromptSection, formatClientContext, formatParentChainContext, getProviderPreference, hostAppsCachePath, hostAppsFingerprint, inspectAndRepairWorkspace, inspectConfigOnly, isDevMode, isIgnoredRelative, isInsideWorkspace, isPathAllowed, maintainerProHome, mergeDesiredHostApps, normalizeHostApp, normalizeHostApps, normalizeIgnorePaths, parentChainForTurn, parseAiResponse, parseIgnorePathsEnv, parsePort, previewText, hostAppsCachePath$1 as projectHostAppsPath, projectIdForFolder, projectUploadsDir, proposeHostAppsFromConfig, providerLabel, readCollaboraterApps, readHostAppsCache, readProjectEnvLayers, renderManagedIgnoreBlock, resolveCliBinary, resolveHostApps, resolveIgnorePaths, resolveLogLevel, resolveProjectDataDir, resolveProvider, sanitizeProjectId, saveChatAttachments, toNextRoute, upsertManagedIgnoreFile, writeCollaboraterApps, writeHostAppsCache };
package/dist/index.js CHANGED
@@ -2795,26 +2795,9 @@ function normalizeHostApp(raw) {
2795
2795
  row.source
2796
2796
  ) ? row.source : "manual",
2797
2797
  locked: row.locked === true || id === AI_SERVER_APP_ID || role === "ai-server",
2798
- host: role !== "ai-server" && id !== AI_SERVER_APP_ID && row.host === true,
2799
- envMaps: normalizeEnvMaps(row.envMaps)
2798
+ host: role !== "ai-server" && id !== AI_SERVER_APP_ID && row.host === true
2800
2799
  };
2801
2800
  }
2802
- function normalizeEnvMaps(raw) {
2803
- if (!Array.isArray(raw)) return [];
2804
- const seen = /* @__PURE__ */ new Set();
2805
- const out = [];
2806
- for (const item of raw) {
2807
- if (!item || typeof item !== "object") continue;
2808
- const row = item;
2809
- const key = String(row.key || "").trim();
2810
- const sourceAppId = String(row.sourceAppId || "").trim().slice(0, 64);
2811
- if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key) || key.length > 80) continue;
2812
- if (!sourceAppId || seen.has(key)) continue;
2813
- seen.add(key);
2814
- out.push({ key, sourceAppId });
2815
- }
2816
- return out.slice(0, 30);
2817
- }
2818
2801
  function ensureSingleHost(apps) {
2819
2802
  const next = apps.map((app) => ({
2820
2803
  ...app,
@@ -3092,8 +3075,7 @@ function mergeDesiredHostApps(desired, detected) {
3092
3075
  ...app,
3093
3076
  startCommand: app.startCommand || local?.startCommand || null,
3094
3077
  locked: app.locked || app.id === AI_SERVER_APP_ID || app.role === "ai-server",
3095
- host: app.role === "ai-server" || app.id === AI_SERVER_APP_ID ? false : app.host === true || app.host !== false && local?.host === true,
3096
- envMaps: app.envMaps && app.envMaps.length ? app.envMaps : local?.envMaps || []
3078
+ host: app.role === "ai-server" || app.id === AI_SERVER_APP_ID ? false : app.host === true || app.host !== false && local?.host === true
3097
3079
  };
3098
3080
  });
3099
3081
  return ensureAiServerApp(merged);
@@ -3425,7 +3407,6 @@ export {
3425
3407
  isPathAllowed,
3426
3408
  maintainerProHome,
3427
3409
  mergeDesiredHostApps,
3428
- normalizeEnvMaps,
3429
3410
  normalizeHostApp,
3430
3411
  normalizeHostApps,
3431
3412
  normalizeIgnorePaths,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maintainer-pro/ai-cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Maintainer Pro server SDK: Claude/Cursor CLI, chat HTTP handlers, and optional SQL persistence",
5
5
  "keywords": [
6
6
  "maintainer-pro",