@prompd/core 0.5.0-beta.13 → 0.5.0-beta.15

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.cts CHANGED
@@ -679,6 +679,9 @@ interface PackageStore {
679
679
  writeFile(path: string, content: string): void | Promise<void>;
680
680
  /** Remove a directory and its contents if present, for a clean reinstall. */
681
681
  removeDir?(path: string): void | Promise<void>;
682
+ /** Read a UTF-8 file, or null if absent — used to merge the workspace prompd.json
683
+ * dependency list. When omitted, dependency tracking is skipped (non-fatal). */
684
+ readFile?(path: string): Promise<string | null> | string | null;
682
685
  }
683
686
  interface InstallPackageOptions {
684
687
  /** "@scope/name@version" or "@scope/name" (defaults to latest). */
@@ -719,6 +722,29 @@ interface InstalledPackage {
719
722
  * archives over the size cap.
720
723
  */
721
724
  declare function installPackage(opts: InstallPackageOptions): Promise<InstalledPackage>;
725
+ interface UninstallPackageOptions {
726
+ /** "@scope/name" (a version suffix is accepted but ignored — one install per name). */
727
+ ref: string;
728
+ /** Artifact type — selects the .prompd subdir. */
729
+ type: PackageType;
730
+ /** Install root the caller chose (the open workspace, or '~' for a global install). */
731
+ root: string;
732
+ /** Writable sink for the chosen host; removeDir is required to uninstall. */
733
+ store: PackageStore;
734
+ }
735
+ interface UninstalledPackage {
736
+ name: string;
737
+ scope?: string;
738
+ /** The directory that was removed: <root>/.prompd/<typeDir>/<name>. */
739
+ installedPath: string;
740
+ }
741
+ /**
742
+ * Uninstall an artifact: remove <root>/.prompd/<typeDir>/<name>/ via the injected
743
+ * store. The symmetric inverse of installPackage, sharing the same install-dir
744
+ * computation. Idempotent — removing an absent install is a no-op (the host's
745
+ * removeDir should swallow not-found). Throws if the store can't remove directories.
746
+ */
747
+ declare function uninstallPackage(opts: UninstallPackageOptions): Promise<UninstalledPackage>;
722
748
 
723
749
  /**
724
750
  * Language Mapping Utilities
@@ -3013,4 +3039,4 @@ declare function validateWorkflow(workflow: WorkflowFile): ValidationResult;
3013
3039
  */
3014
3040
  declare function validateWorkflowQuick(workflow: WorkflowFile): Pick<ValidationResult, 'isValid'>;
3015
3041
 
3016
- export { type AgentCheckpointEvent, type AgentCheckpointEventType, type AgentIterationRecord, type AgentNodeData, type AgentTool, AnthropicFormatter, type ApiNodeData, type AsyncFileBackend, BUILTIN_COMMAND_EXECUTABLES, type BaseNodeData, CODE_EXTENSIONS, CONTENT_TYPES, type CallbackNodeData, type ChatAgentCheckpointConfig, type ChatAgentNodeData, type ClaudeCodeNodeData, CodeGenerationStage, type CodeNodeData, type CommandNodeData, CompilationContext, type CompilationDiagnostic, CompilationError, type CompilationOptions, CompilationStage, type CompiledPrompt, CompilerPipeline, type CompilerStage, type CompleteEventData, type ConditionBranch, type ConditionNodeData, type Config, type CustomCommandConfig, type CustomConnectionConfig, type CustomProvider, DEFAULT_SECURITY_CONFIG, DOCKABLE_HANDLES, DOCKABLE_NODE_TYPES, type DatabaseConnectionConfig, type DatabaseQueryNodeData, DependencyResolutionStage, EXTENSION_TO_LANGUAGE, EXTENSION_TO_LANGUAGE_ALIASES, type ErrorEventData, type ErrorHandlerNodeData, type ErrorHandlingConfig, type ExecuteOptions, type ExecutionConfig, type GitHubConnectionConfig, type GuardrailNodeData, type HttpApiConnectionConfig, HybridFileSystem, type IFileSystem, type IPackageResolver, type InstallPackageOptions, type InstalledPackage, type IterationEventData, type JsonSchema, type LLMResponse, LexicalAnalysisStage, type LoopNodeData, MEMORY_OPERATIONS_BY_MODE, MarkdownFormatter, type McpServerConnectionConfig, type McpToolNodeData, MemoryFileSystem, type MemoryNodeData, type MemoryOperation, MemoryPackageResolver, type MergeNodeData, type NodeExecutionState, type NodeExecutionStatus, OpenAIFormatter, type OutputFormatter, type OutputNodeData, PACKAGE_TYPE_DIRS, PROMPD_EXTENSIONS, type PackageAlias, type PackageDownloader, type PackageStore, type PackageType, type ParallelBranch, type ParallelNodeData, ParseError, type ParsedWorkflow, PrompdCompiler, PrompdError, type PrompdFile, PrompdLoader, type PrompdMetadata, type PrompdParameter, PrompdParser, type PromptNodeData, type ProviderConfig, type ProviderNodeData, type RegistryConfig, type ResolvePackageOptions, type ResolvedPackage, type RetryPolicy, type SSHConnectionConfig, type SectionInfo, SectionOverrideProcessor, type SecurityConfig, SecurityError, SemanticAnalysisStage, type SlackConnectionConfig, TOOL_DEPLOY_DIRS, TemplateProcessingStage, type ThinkingEventData, type ToolCallEventData, type ToolCallParserNodeData, type ToolCallRouterNodeData, type ToolNodeData, type TransformerNodeData, type TriggerNodeData, type UserInputNodeData, type UsingPackage, VALID_PACKAGE_TYPES, ValidationError, type ValidationIssue, type ValidationResult, type WebSearchNodeData, type WebSocketConnectionConfig, type WorkflowConnection, type WorkflowConnectionConfig, type WorkflowConnectionStatus, type WorkflowConnectionType, type WorkflowEdge, type WorkflowExecutionError, type WorkflowExecutionState, type WorkflowExecutionStatus, type WorkflowFile, type WorkflowMetadata, type WorkflowNode, type WorkflowNodeData, type WorkflowNodeType, type WorkflowParameter, type WorkflowResult, type WorkflowValidationError, type WorkflowValidationWarning, type WorkflowVariable, basenamePosix, compile, createCoreStages, createEmptyWorkflow, createPrompdEnvironment, createWorkflowNode, dirnamePosix, extname, extractPdpkg, getContentType, getExecutionOrder, getInstallDirForType, getLanguageAliasesForExtension, getLanguageForExtension, installPackage, isAbsolutePosix, isPrompdFile, isValidPackageReference, isValidPackageType, joinPosix, needsFrontmatterProtection, normalizePosix, parsePackageReference, parsePackageReferenceWithPath, parseWorkflow, resolvePackageFile, resolvePosix, serializeWorkflow, stripFilePath, validateWorkflow, validateWorkflowQuick };
3042
+ export { type AgentCheckpointEvent, type AgentCheckpointEventType, type AgentIterationRecord, type AgentNodeData, type AgentTool, AnthropicFormatter, type ApiNodeData, type AsyncFileBackend, BUILTIN_COMMAND_EXECUTABLES, type BaseNodeData, CODE_EXTENSIONS, CONTENT_TYPES, type CallbackNodeData, type ChatAgentCheckpointConfig, type ChatAgentNodeData, type ClaudeCodeNodeData, CodeGenerationStage, type CodeNodeData, type CommandNodeData, CompilationContext, type CompilationDiagnostic, CompilationError, type CompilationOptions, CompilationStage, type CompiledPrompt, CompilerPipeline, type CompilerStage, type CompleteEventData, type ConditionBranch, type ConditionNodeData, type Config, type CustomCommandConfig, type CustomConnectionConfig, type CustomProvider, DEFAULT_SECURITY_CONFIG, DOCKABLE_HANDLES, DOCKABLE_NODE_TYPES, type DatabaseConnectionConfig, type DatabaseQueryNodeData, DependencyResolutionStage, EXTENSION_TO_LANGUAGE, EXTENSION_TO_LANGUAGE_ALIASES, type ErrorEventData, type ErrorHandlerNodeData, type ErrorHandlingConfig, type ExecuteOptions, type ExecutionConfig, type GitHubConnectionConfig, type GuardrailNodeData, type HttpApiConnectionConfig, HybridFileSystem, type IFileSystem, type IPackageResolver, type InstallPackageOptions, type InstalledPackage, type IterationEventData, type JsonSchema, type LLMResponse, LexicalAnalysisStage, type LoopNodeData, MEMORY_OPERATIONS_BY_MODE, MarkdownFormatter, type McpServerConnectionConfig, type McpToolNodeData, MemoryFileSystem, type MemoryNodeData, type MemoryOperation, MemoryPackageResolver, type MergeNodeData, type NodeExecutionState, type NodeExecutionStatus, OpenAIFormatter, type OutputFormatter, type OutputNodeData, PACKAGE_TYPE_DIRS, PROMPD_EXTENSIONS, type PackageAlias, type PackageDownloader, type PackageStore, type PackageType, type ParallelBranch, type ParallelNodeData, ParseError, type ParsedWorkflow, PrompdCompiler, PrompdError, type PrompdFile, PrompdLoader, type PrompdMetadata, type PrompdParameter, PrompdParser, type PromptNodeData, type ProviderConfig, type ProviderNodeData, type RegistryConfig, type ResolvePackageOptions, type ResolvedPackage, type RetryPolicy, type SSHConnectionConfig, type SectionInfo, SectionOverrideProcessor, type SecurityConfig, SecurityError, SemanticAnalysisStage, type SlackConnectionConfig, TOOL_DEPLOY_DIRS, TemplateProcessingStage, type ThinkingEventData, type ToolCallEventData, type ToolCallParserNodeData, type ToolCallRouterNodeData, type ToolNodeData, type TransformerNodeData, type TriggerNodeData, type UninstallPackageOptions, type UninstalledPackage, type UserInputNodeData, type UsingPackage, VALID_PACKAGE_TYPES, ValidationError, type ValidationIssue, type ValidationResult, type WebSearchNodeData, type WebSocketConnectionConfig, type WorkflowConnection, type WorkflowConnectionConfig, type WorkflowConnectionStatus, type WorkflowConnectionType, type WorkflowEdge, type WorkflowExecutionError, type WorkflowExecutionState, type WorkflowExecutionStatus, type WorkflowFile, type WorkflowMetadata, type WorkflowNode, type WorkflowNodeData, type WorkflowNodeType, type WorkflowParameter, type WorkflowResult, type WorkflowValidationError, type WorkflowValidationWarning, type WorkflowVariable, basenamePosix, compile, createCoreStages, createEmptyWorkflow, createPrompdEnvironment, createWorkflowNode, dirnamePosix, extname, extractPdpkg, getContentType, getExecutionOrder, getInstallDirForType, getLanguageAliasesForExtension, getLanguageForExtension, installPackage, isAbsolutePosix, isPrompdFile, isValidPackageReference, isValidPackageType, joinPosix, needsFrontmatterProtection, normalizePosix, parsePackageReference, parsePackageReferenceWithPath, parseWorkflow, resolvePackageFile, resolvePosix, serializeWorkflow, stripFilePath, uninstallPackage, validateWorkflow, validateWorkflowQuick };
package/dist/index.d.ts CHANGED
@@ -679,6 +679,9 @@ interface PackageStore {
679
679
  writeFile(path: string, content: string): void | Promise<void>;
680
680
  /** Remove a directory and its contents if present, for a clean reinstall. */
681
681
  removeDir?(path: string): void | Promise<void>;
682
+ /** Read a UTF-8 file, or null if absent — used to merge the workspace prompd.json
683
+ * dependency list. When omitted, dependency tracking is skipped (non-fatal). */
684
+ readFile?(path: string): Promise<string | null> | string | null;
682
685
  }
683
686
  interface InstallPackageOptions {
684
687
  /** "@scope/name@version" or "@scope/name" (defaults to latest). */
@@ -719,6 +722,29 @@ interface InstalledPackage {
719
722
  * archives over the size cap.
720
723
  */
721
724
  declare function installPackage(opts: InstallPackageOptions): Promise<InstalledPackage>;
725
+ interface UninstallPackageOptions {
726
+ /** "@scope/name" (a version suffix is accepted but ignored — one install per name). */
727
+ ref: string;
728
+ /** Artifact type — selects the .prompd subdir. */
729
+ type: PackageType;
730
+ /** Install root the caller chose (the open workspace, or '~' for a global install). */
731
+ root: string;
732
+ /** Writable sink for the chosen host; removeDir is required to uninstall. */
733
+ store: PackageStore;
734
+ }
735
+ interface UninstalledPackage {
736
+ name: string;
737
+ scope?: string;
738
+ /** The directory that was removed: <root>/.prompd/<typeDir>/<name>. */
739
+ installedPath: string;
740
+ }
741
+ /**
742
+ * Uninstall an artifact: remove <root>/.prompd/<typeDir>/<name>/ via the injected
743
+ * store. The symmetric inverse of installPackage, sharing the same install-dir
744
+ * computation. Idempotent — removing an absent install is a no-op (the host's
745
+ * removeDir should swallow not-found). Throws if the store can't remove directories.
746
+ */
747
+ declare function uninstallPackage(opts: UninstallPackageOptions): Promise<UninstalledPackage>;
722
748
 
723
749
  /**
724
750
  * Language Mapping Utilities
@@ -3013,4 +3039,4 @@ declare function validateWorkflow(workflow: WorkflowFile): ValidationResult;
3013
3039
  */
3014
3040
  declare function validateWorkflowQuick(workflow: WorkflowFile): Pick<ValidationResult, 'isValid'>;
3015
3041
 
3016
- export { type AgentCheckpointEvent, type AgentCheckpointEventType, type AgentIterationRecord, type AgentNodeData, type AgentTool, AnthropicFormatter, type ApiNodeData, type AsyncFileBackend, BUILTIN_COMMAND_EXECUTABLES, type BaseNodeData, CODE_EXTENSIONS, CONTENT_TYPES, type CallbackNodeData, type ChatAgentCheckpointConfig, type ChatAgentNodeData, type ClaudeCodeNodeData, CodeGenerationStage, type CodeNodeData, type CommandNodeData, CompilationContext, type CompilationDiagnostic, CompilationError, type CompilationOptions, CompilationStage, type CompiledPrompt, CompilerPipeline, type CompilerStage, type CompleteEventData, type ConditionBranch, type ConditionNodeData, type Config, type CustomCommandConfig, type CustomConnectionConfig, type CustomProvider, DEFAULT_SECURITY_CONFIG, DOCKABLE_HANDLES, DOCKABLE_NODE_TYPES, type DatabaseConnectionConfig, type DatabaseQueryNodeData, DependencyResolutionStage, EXTENSION_TO_LANGUAGE, EXTENSION_TO_LANGUAGE_ALIASES, type ErrorEventData, type ErrorHandlerNodeData, type ErrorHandlingConfig, type ExecuteOptions, type ExecutionConfig, type GitHubConnectionConfig, type GuardrailNodeData, type HttpApiConnectionConfig, HybridFileSystem, type IFileSystem, type IPackageResolver, type InstallPackageOptions, type InstalledPackage, type IterationEventData, type JsonSchema, type LLMResponse, LexicalAnalysisStage, type LoopNodeData, MEMORY_OPERATIONS_BY_MODE, MarkdownFormatter, type McpServerConnectionConfig, type McpToolNodeData, MemoryFileSystem, type MemoryNodeData, type MemoryOperation, MemoryPackageResolver, type MergeNodeData, type NodeExecutionState, type NodeExecutionStatus, OpenAIFormatter, type OutputFormatter, type OutputNodeData, PACKAGE_TYPE_DIRS, PROMPD_EXTENSIONS, type PackageAlias, type PackageDownloader, type PackageStore, type PackageType, type ParallelBranch, type ParallelNodeData, ParseError, type ParsedWorkflow, PrompdCompiler, PrompdError, type PrompdFile, PrompdLoader, type PrompdMetadata, type PrompdParameter, PrompdParser, type PromptNodeData, type ProviderConfig, type ProviderNodeData, type RegistryConfig, type ResolvePackageOptions, type ResolvedPackage, type RetryPolicy, type SSHConnectionConfig, type SectionInfo, SectionOverrideProcessor, type SecurityConfig, SecurityError, SemanticAnalysisStage, type SlackConnectionConfig, TOOL_DEPLOY_DIRS, TemplateProcessingStage, type ThinkingEventData, type ToolCallEventData, type ToolCallParserNodeData, type ToolCallRouterNodeData, type ToolNodeData, type TransformerNodeData, type TriggerNodeData, type UserInputNodeData, type UsingPackage, VALID_PACKAGE_TYPES, ValidationError, type ValidationIssue, type ValidationResult, type WebSearchNodeData, type WebSocketConnectionConfig, type WorkflowConnection, type WorkflowConnectionConfig, type WorkflowConnectionStatus, type WorkflowConnectionType, type WorkflowEdge, type WorkflowExecutionError, type WorkflowExecutionState, type WorkflowExecutionStatus, type WorkflowFile, type WorkflowMetadata, type WorkflowNode, type WorkflowNodeData, type WorkflowNodeType, type WorkflowParameter, type WorkflowResult, type WorkflowValidationError, type WorkflowValidationWarning, type WorkflowVariable, basenamePosix, compile, createCoreStages, createEmptyWorkflow, createPrompdEnvironment, createWorkflowNode, dirnamePosix, extname, extractPdpkg, getContentType, getExecutionOrder, getInstallDirForType, getLanguageAliasesForExtension, getLanguageForExtension, installPackage, isAbsolutePosix, isPrompdFile, isValidPackageReference, isValidPackageType, joinPosix, needsFrontmatterProtection, normalizePosix, parsePackageReference, parsePackageReferenceWithPath, parseWorkflow, resolvePackageFile, resolvePosix, serializeWorkflow, stripFilePath, validateWorkflow, validateWorkflowQuick };
3042
+ export { type AgentCheckpointEvent, type AgentCheckpointEventType, type AgentIterationRecord, type AgentNodeData, type AgentTool, AnthropicFormatter, type ApiNodeData, type AsyncFileBackend, BUILTIN_COMMAND_EXECUTABLES, type BaseNodeData, CODE_EXTENSIONS, CONTENT_TYPES, type CallbackNodeData, type ChatAgentCheckpointConfig, type ChatAgentNodeData, type ClaudeCodeNodeData, CodeGenerationStage, type CodeNodeData, type CommandNodeData, CompilationContext, type CompilationDiagnostic, CompilationError, type CompilationOptions, CompilationStage, type CompiledPrompt, CompilerPipeline, type CompilerStage, type CompleteEventData, type ConditionBranch, type ConditionNodeData, type Config, type CustomCommandConfig, type CustomConnectionConfig, type CustomProvider, DEFAULT_SECURITY_CONFIG, DOCKABLE_HANDLES, DOCKABLE_NODE_TYPES, type DatabaseConnectionConfig, type DatabaseQueryNodeData, DependencyResolutionStage, EXTENSION_TO_LANGUAGE, EXTENSION_TO_LANGUAGE_ALIASES, type ErrorEventData, type ErrorHandlerNodeData, type ErrorHandlingConfig, type ExecuteOptions, type ExecutionConfig, type GitHubConnectionConfig, type GuardrailNodeData, type HttpApiConnectionConfig, HybridFileSystem, type IFileSystem, type IPackageResolver, type InstallPackageOptions, type InstalledPackage, type IterationEventData, type JsonSchema, type LLMResponse, LexicalAnalysisStage, type LoopNodeData, MEMORY_OPERATIONS_BY_MODE, MarkdownFormatter, type McpServerConnectionConfig, type McpToolNodeData, MemoryFileSystem, type MemoryNodeData, type MemoryOperation, MemoryPackageResolver, type MergeNodeData, type NodeExecutionState, type NodeExecutionStatus, OpenAIFormatter, type OutputFormatter, type OutputNodeData, PACKAGE_TYPE_DIRS, PROMPD_EXTENSIONS, type PackageAlias, type PackageDownloader, type PackageStore, type PackageType, type ParallelBranch, type ParallelNodeData, ParseError, type ParsedWorkflow, PrompdCompiler, PrompdError, type PrompdFile, PrompdLoader, type PrompdMetadata, type PrompdParameter, PrompdParser, type PromptNodeData, type ProviderConfig, type ProviderNodeData, type RegistryConfig, type ResolvePackageOptions, type ResolvedPackage, type RetryPolicy, type SSHConnectionConfig, type SectionInfo, SectionOverrideProcessor, type SecurityConfig, SecurityError, SemanticAnalysisStage, type SlackConnectionConfig, TOOL_DEPLOY_DIRS, TemplateProcessingStage, type ThinkingEventData, type ToolCallEventData, type ToolCallParserNodeData, type ToolCallRouterNodeData, type ToolNodeData, type TransformerNodeData, type TriggerNodeData, type UninstallPackageOptions, type UninstalledPackage, type UserInputNodeData, type UsingPackage, VALID_PACKAGE_TYPES, ValidationError, type ValidationIssue, type ValidationResult, type WebSearchNodeData, type WebSocketConnectionConfig, type WorkflowConnection, type WorkflowConnectionConfig, type WorkflowConnectionStatus, type WorkflowConnectionType, type WorkflowEdge, type WorkflowExecutionError, type WorkflowExecutionState, type WorkflowExecutionStatus, type WorkflowFile, type WorkflowMetadata, type WorkflowNode, type WorkflowNodeData, type WorkflowNodeType, type WorkflowParameter, type WorkflowResult, type WorkflowValidationError, type WorkflowValidationWarning, type WorkflowVariable, basenamePosix, compile, createCoreStages, createEmptyWorkflow, createPrompdEnvironment, createWorkflowNode, dirnamePosix, extname, extractPdpkg, getContentType, getExecutionOrder, getInstallDirForType, getLanguageAliasesForExtension, getLanguageForExtension, installPackage, isAbsolutePosix, isPrompdFile, isValidPackageReference, isValidPackageType, joinPosix, needsFrontmatterProtection, normalizePosix, parsePackageReference, parsePackageReferenceWithPath, parseWorkflow, resolvePackageFile, resolvePosix, serializeWorkflow, stripFilePath, uninstallPackage, validateWorkflow, validateWorkflowQuick };
package/dist/index.js CHANGED
@@ -3357,6 +3357,35 @@ function normalizeSegments(p) {
3357
3357
  }
3358
3358
  return out.join("/");
3359
3359
  }
3360
+ function resolveInstallDir(root, type, name) {
3361
+ return joinPosix3(root, ".prompd", getInstallDirForType(type), name);
3362
+ }
3363
+ async function addWorkspaceDependency(store, root, name, version) {
3364
+ if (!store.readFile) return;
3365
+ const manifestPath = joinPosix3(root, "prompd.json");
3366
+ try {
3367
+ const existing = await store.readFile(manifestPath);
3368
+ const manifest = existing && existing.trim() ? JSON.parse(existing) : {};
3369
+ if (!manifest.dependencies || typeof manifest.dependencies !== "object") manifest.dependencies = {};
3370
+ manifest.dependencies[name] = version;
3371
+ await store.writeFile(manifestPath, JSON.stringify(manifest, null, 2) + "\n");
3372
+ } catch {
3373
+ }
3374
+ }
3375
+ async function removeWorkspaceDependency(store, root, name) {
3376
+ if (!store.readFile) return;
3377
+ const manifestPath = joinPosix3(root, "prompd.json");
3378
+ try {
3379
+ const existing = await store.readFile(manifestPath);
3380
+ if (!existing || !existing.trim()) return;
3381
+ const manifest = JSON.parse(existing);
3382
+ const deps = manifest.dependencies;
3383
+ if (!deps || typeof deps !== "object") return;
3384
+ delete deps[name];
3385
+ await store.writeFile(manifestPath, JSON.stringify(manifest, null, 2) + "\n");
3386
+ } catch {
3387
+ }
3388
+ }
3360
3389
  async function installPackage(opts) {
3361
3390
  const { ref, type, root, store, download } = opts;
3362
3391
  const parsed = parsePackageReference(ref);
@@ -3379,7 +3408,7 @@ async function installPackage(opts) {
3379
3408
  } catch {
3380
3409
  }
3381
3410
  }
3382
- const installedPath = joinPosix3(root, ".prompd", getInstallDirForType(type), name);
3411
+ const installedPath = resolveInstallDir(root, type, name);
3383
3412
  const baseSegments = normalizeSegments(installedPath);
3384
3413
  await store.removeDir?.(installedPath);
3385
3414
  const written = [];
@@ -3392,8 +3421,20 @@ async function installPackage(opts) {
3392
3421
  await store.writeFile(dest, content);
3393
3422
  written.push(rel);
3394
3423
  }
3424
+ await addWorkspaceDependency(store, root, name, version);
3395
3425
  return { name, version, scope: parsed.scope, installedPath, files: written };
3396
3426
  }
3427
+ async function uninstallPackage(opts) {
3428
+ const { ref, type, root, store } = opts;
3429
+ if (!store.removeDir) {
3430
+ throw new Error("Uninstall requires a PackageStore with removeDir.");
3431
+ }
3432
+ const parsed = parsePackageReference(ref);
3433
+ const installedPath = resolveInstallDir(root, type, parsed.name);
3434
+ await store.removeDir(installedPath);
3435
+ await removeWorkspaceDependency(store, root, parsed.name);
3436
+ return { name: parsed.name, scope: parsed.scope, installedPath };
3437
+ }
3397
3438
 
3398
3439
  // src/lib/compiler/index.ts
3399
3440
  function createCoreStages() {
@@ -4788,6 +4829,6 @@ function getExecutionOrder(workflow) {
4788
4829
  return order;
4789
4830
  }
4790
4831
 
4791
- export { AnthropicFormatter, BUILTIN_COMMAND_EXECUTABLES, CODE_EXTENSIONS, CONTENT_TYPES, CodeGenerationStage, CompilationContext, CompilationError, CompilationStage, CompilerPipeline, DEFAULT_SECURITY_CONFIG, DOCKABLE_HANDLES, DOCKABLE_NODE_TYPES, DependencyResolutionStage, EXTENSION_TO_LANGUAGE, EXTENSION_TO_LANGUAGE_ALIASES, HybridFileSystem, LexicalAnalysisStage, MEMORY_OPERATIONS_BY_MODE, MarkdownFormatter, MemoryFileSystem, MemoryPackageResolver, OpenAIFormatter, PACKAGE_TYPE_DIRS, PROMPD_EXTENSIONS, ParseError, PrompdCompiler, PrompdError, PrompdLoader, PrompdParser, SectionOverrideProcessor, SecurityError, SemanticAnalysisStage, TOOL_DEPLOY_DIRS, TemplateProcessingStage, VALID_PACKAGE_TYPES, ValidationError, basenamePosix, compile, createCoreStages, createEmptyWorkflow, createPrompdEnvironment, createWorkflowNode, dirnamePosix, extname, extractPdpkg, getContentType, getExecutionOrder, getInstallDirForType, getLanguageAliasesForExtension, getLanguageForExtension, installPackage, isAbsolutePosix, isPrompdFile, isValidPackageReference, isValidPackageType, joinPosix, needsFrontmatterProtection, normalizePosix, parsePackageReference, parsePackageReferenceWithPath, parseWorkflow, resolvePackageFile, resolvePosix, serializeWorkflow, stripFilePath, validateWorkflow, validateWorkflowQuick };
4832
+ export { AnthropicFormatter, BUILTIN_COMMAND_EXECUTABLES, CODE_EXTENSIONS, CONTENT_TYPES, CodeGenerationStage, CompilationContext, CompilationError, CompilationStage, CompilerPipeline, DEFAULT_SECURITY_CONFIG, DOCKABLE_HANDLES, DOCKABLE_NODE_TYPES, DependencyResolutionStage, EXTENSION_TO_LANGUAGE, EXTENSION_TO_LANGUAGE_ALIASES, HybridFileSystem, LexicalAnalysisStage, MEMORY_OPERATIONS_BY_MODE, MarkdownFormatter, MemoryFileSystem, MemoryPackageResolver, OpenAIFormatter, PACKAGE_TYPE_DIRS, PROMPD_EXTENSIONS, ParseError, PrompdCompiler, PrompdError, PrompdLoader, PrompdParser, SectionOverrideProcessor, SecurityError, SemanticAnalysisStage, TOOL_DEPLOY_DIRS, TemplateProcessingStage, VALID_PACKAGE_TYPES, ValidationError, basenamePosix, compile, createCoreStages, createEmptyWorkflow, createPrompdEnvironment, createWorkflowNode, dirnamePosix, extname, extractPdpkg, getContentType, getExecutionOrder, getInstallDirForType, getLanguageAliasesForExtension, getLanguageForExtension, installPackage, isAbsolutePosix, isPrompdFile, isValidPackageReference, isValidPackageType, joinPosix, needsFrontmatterProtection, normalizePosix, parsePackageReference, parsePackageReferenceWithPath, parseWorkflow, resolvePackageFile, resolvePosix, serializeWorkflow, stripFilePath, uninstallPackage, validateWorkflow, validateWorkflowQuick };
4792
4833
  //# sourceMappingURL=index.js.map
4793
4834
  //# sourceMappingURL=index.js.map