opkg 0.9.2 → 0.9.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/package.json +3 -1
- package/packages/cli/dist/add-U44SL3OR.js +624 -0
- package/packages/cli/dist/add-U44SL3OR.js.map +7 -0
- package/packages/cli/dist/chunk-4B5HJLP2.js +48 -0
- package/packages/cli/dist/chunk-4B5HJLP2.js.map +7 -0
- package/packages/cli/dist/chunk-BROJ6OUT.js +631 -0
- package/packages/cli/dist/chunk-BROJ6OUT.js.map +7 -0
- package/packages/cli/dist/chunk-CVA64SXK.js +1136 -0
- package/packages/cli/dist/chunk-CVA64SXK.js.map +7 -0
- package/packages/cli/dist/chunk-D6LEPODL.js +413 -0
- package/packages/cli/dist/chunk-D6LEPODL.js.map +7 -0
- package/packages/cli/dist/chunk-HTYHJA3B.js +61 -0
- package/packages/cli/dist/chunk-HTYHJA3B.js.map +7 -0
- package/packages/cli/dist/chunk-KI7FDU3H.js +99 -0
- package/packages/cli/dist/chunk-KI7FDU3H.js.map +7 -0
- package/packages/cli/dist/chunk-PSQXKAL4.js +371 -0
- package/packages/cli/dist/chunk-PSQXKAL4.js.map +7 -0
- package/packages/cli/dist/chunk-PUDRKDVZ.js +1419 -0
- package/packages/cli/dist/chunk-PUDRKDVZ.js.map +7 -0
- package/packages/cli/dist/chunk-U7FW7SXX.js +568 -0
- package/packages/cli/dist/chunk-U7FW7SXX.js.map +7 -0
- package/packages/cli/dist/configure-3AZUMDJZ.js +107 -0
- package/packages/cli/dist/configure-3AZUMDJZ.js.map +7 -0
- package/packages/cli/dist/index.js +15 -15
- package/packages/cli/dist/install-EZNWMLJR.js +7581 -0
- package/packages/cli/dist/install-EZNWMLJR.js.map +7 -0
- package/packages/cli/dist/list-XR7RSJFS.js +327 -0
- package/packages/cli/dist/list-XR7RSJFS.js.map +7 -0
- package/packages/cli/dist/login-NRKHXZKM.js +150 -0
- package/packages/cli/dist/login-NRKHXZKM.js.map +7 -0
- package/packages/cli/dist/logout-SYHXCVCQ.js +40 -0
- package/packages/cli/dist/logout-SYHXCVCQ.js.map +7 -0
- package/packages/cli/dist/new-F46OSD72.js +277 -0
- package/packages/cli/dist/new-F46OSD72.js.map +7 -0
- package/packages/cli/dist/publish-4H43PCSG.js +619 -0
- package/packages/cli/dist/publish-4H43PCSG.js.map +7 -0
- package/packages/cli/dist/remove-BD52BHR2.js +542 -0
- package/packages/cli/dist/remove-BD52BHR2.js.map +7 -0
- package/packages/cli/dist/save-N3QWF2WN.js +1728 -0
- package/packages/cli/dist/save-N3QWF2WN.js.map +7 -0
- package/packages/cli/dist/search-ABROK3UO.js +157 -0
- package/packages/cli/dist/search-ABROK3UO.js.map +7 -0
- package/packages/cli/dist/set-NGM2FIKF.js +251 -0
- package/packages/cli/dist/set-NGM2FIKF.js.map +7 -0
- package/packages/cli/dist/uninstall-Q3CP4UN5.js +539 -0
- package/packages/cli/dist/uninstall-Q3CP4UN5.js.map +7 -0
- package/packages/cli/dist/unpublish-VBTNTMS5.js +245 -0
- package/packages/cli/dist/unpublish-VBTNTMS5.js.map +7 -0
- package/packages/cli/dist/view-MXRBMXOG.js +488 -0
- package/packages/cli/dist/view-MXRBMXOG.js.map +7 -0
- package/packages/cli/package.json +2 -0
- package/packages/core/dist/core/install/conflicts/file-conflict-resolver.d.ts +5 -4
- package/packages/core/dist/core/install/conflicts/file-conflict-resolver.d.ts.map +1 -1
- package/packages/core/dist/core/install/conflicts/file-conflict-resolver.js +6 -5
- package/packages/core/dist/core/install/conflicts/file-conflict-resolver.js.map +1 -1
- package/packages/core/dist/core/install/install-reporting.js +1 -1
- package/packages/core/dist/core/install/install-reporting.js.map +1 -1
- package/packages/core/dist/core/install/list-handler.d.ts.map +1 -1
- package/packages/core/dist/core/install/list-handler.js +7 -0
- package/packages/core/dist/core/install/list-handler.js.map +1 -1
- package/packages/core/dist/core/install/marketplace-handler.d.ts.map +1 -1
- package/packages/core/dist/core/install/marketplace-handler.js.map +1 -1
- package/packages/core/dist/core/install/operations/conflict-handler.d.ts +2 -1
- package/packages/core/dist/core/install/operations/conflict-handler.d.ts.map +1 -1
- package/packages/core/dist/core/install/operations/conflict-handler.js +2 -2
- package/packages/core/dist/core/install/operations/conflict-handler.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/orchestrator.d.ts.map +1 -1
- package/packages/core/dist/core/install/orchestrator/orchestrator.js +22 -14
- package/packages/core/dist/core/install/orchestrator/orchestrator.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/git-strategy.d.ts +1 -0
- package/packages/core/dist/core/install/orchestrator/strategies/git-strategy.d.ts.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/git-strategy.js +11 -24
- package/packages/core/dist/core/install/orchestrator/strategies/git-strategy.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/path-strategy.d.ts +2 -0
- package/packages/core/dist/core/install/orchestrator/strategies/path-strategy.d.ts.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/path-strategy.js +14 -14
- package/packages/core/dist/core/install/orchestrator/strategies/path-strategy.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/registry-strategy.d.ts +7 -0
- package/packages/core/dist/core/install/orchestrator/strategies/registry-strategy.d.ts.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/registry-strategy.js +28 -0
- package/packages/core/dist/core/install/orchestrator/strategies/registry-strategy.js.map +1 -1
- package/packages/core/dist/core/install/platform-resolution.d.ts +3 -0
- package/packages/core/dist/core/install/platform-resolution.d.ts.map +1 -1
- package/packages/core/dist/core/install/platform-resolution.js +5 -2
- package/packages/core/dist/core/install/platform-resolution.js.map +1 -1
- package/packages/core/dist/core/install/preprocessing/context-population.d.ts +18 -0
- package/packages/core/dist/core/install/preprocessing/context-population.d.ts.map +1 -0
- package/packages/core/dist/core/install/preprocessing/context-population.js +36 -0
- package/packages/core/dist/core/install/preprocessing/context-population.js.map +1 -0
- package/packages/core/dist/core/install/preprocessing/convenience-preprocessor.d.ts +23 -0
- package/packages/core/dist/core/install/preprocessing/convenience-preprocessor.d.ts.map +1 -1
- package/packages/core/dist/core/install/preprocessing/convenience-preprocessor.js +44 -0
- package/packages/core/dist/core/install/preprocessing/convenience-preprocessor.js.map +1 -1
- package/packages/core/dist/core/install/sources/path-source.d.ts.map +1 -1
- package/packages/core/dist/core/install/sources/path-source.js +8 -0
- package/packages/core/dist/core/install/sources/path-source.js.map +1 -1
- package/packages/core/dist/core/install/unified/context-builders.d.ts +5 -0
- package/packages/core/dist/core/install/unified/context-builders.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/context-builders.js +13 -0
- package/packages/core/dist/core/install/unified/context-builders.js.map +1 -1
- package/packages/core/dist/core/install/unified/context-helpers.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/context-helpers.js +5 -0
- package/packages/core/dist/core/install/unified/context-helpers.js.map +1 -1
- package/packages/core/dist/core/install/unified/context.d.ts +6 -0
- package/packages/core/dist/core/install/unified/context.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/multi-context-pipeline.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/multi-context-pipeline.js +0 -2
- package/packages/core/dist/core/install/unified/multi-context-pipeline.js.map +1 -1
- package/packages/core/dist/core/install/unified/phases/conflicts.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/phases/conflicts.js +1 -1
- package/packages/core/dist/core/install/unified/phases/conflicts.js.map +1 -1
- package/packages/core/dist/core/install/unified/phases/execute.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/phases/execute.js +2 -1
- package/packages/core/dist/core/install/unified/phases/execute.js.map +1 -1
- package/packages/core/dist/core/install/unified/phases/report.js +1 -1
- package/packages/core/dist/core/install/unified/phases/report.js.map +1 -1
- package/packages/core/dist/core/install/unified/pipeline.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/pipeline.js +5 -2
- package/packages/core/dist/core/install/unified/pipeline.js.map +1 -1
- package/packages/core/dist/core/ports/resolve.d.ts +0 -13
- package/packages/core/dist/core/ports/resolve.d.ts.map +1 -1
- package/packages/core/dist/core/ports/resolve.js +0 -28
- package/packages/core/dist/core/ports/resolve.js.map +1 -1
- package/packages/core/dist/core/remove/removal-confirmation.d.ts +4 -1
- package/packages/core/dist/core/remove/removal-confirmation.d.ts.map +1 -1
- package/packages/core/dist/core/remove/removal-confirmation.js +5 -4
- package/packages/core/dist/core/remove/removal-confirmation.js.map +1 -1
- package/packages/core/dist/core/remove/remove-from-source-pipeline.d.ts.map +1 -1
- package/packages/core/dist/core/remove/remove-from-source-pipeline.js +1 -10
- package/packages/core/dist/core/remove/remove-from-source-pipeline.js.map +1 -1
- package/packages/core/dist/core/uninstall/uninstall-executor.js +1 -1
- package/packages/core/dist/core/uninstall/uninstall-executor.js.map +1 -1
- package/packages/core/dist/core/uninstall/uninstall-reporter.d.ts +2 -2
- package/packages/core/dist/core/uninstall/uninstall-reporter.d.ts.map +1 -1
- package/packages/core/dist/core/uninstall/uninstall-reporter.js +4 -4
- package/packages/core/dist/core/uninstall/uninstall-reporter.js.map +1 -1
- package/packages/core/dist/index.d.ts +1 -1
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/types/execution-context.d.ts +24 -10
- package/packages/core/dist/types/execution-context.d.ts.map +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/commands/add.ts", "../../core/src/core/add/add-to-source-pipeline.ts", "../../core/src/core/add/source-collector.ts", "../../core/src/core/add/add-conflict-handler.ts", "../../core/src/core/add/add-orchestrator.ts", "../../core/src/core/add/add-input-classifier.ts", "../../core/src/core/add/add-dependency-flow.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Add Command (CLI layer)\n *\n * Thin shell over core/add/ pipelines.\n * Handles CLI arg parsing, interactive file selection, and display formatting.\n */\n\nimport type { Command } from 'commander';\nimport { join, relative } from 'path';\n\nimport { runAddToSourcePipelineBatch, type AddToSourceResult } from '@opkg/core/core/add/add-to-source-pipeline.js';\nimport { processAddResource, type AddResourceResult } from '@opkg/core/core/add/add-orchestrator.js';\nimport { formatPathForDisplay, getTreeConnector } from '@opkg/core/utils/formatters.js';\nimport { interactiveFileSelect } from '../utils/interactive-file-selector.js';\nimport { expandDirectorySelections, hasDirectorySelections } from '@opkg/core/utils/expand-directory-selections.js';\nimport { createCliExecutionContext } from '../cli/context.js';\nimport { resolveMutableSource } from '@opkg/core/core/source-resolution/resolve-mutable-source.js';\nimport { buildWorkspacePackageContext } from '@opkg/core/utils/workspace-package-context.js';\nimport { createInteractionPolicy, PromptTier } from '@opkg/core/core/interaction-policy.js';\nimport { resolveOutput } from '@opkg/core/core/ports/resolve.js';\n\n// ---------------------------------------------------------------------------\n// Display helpers (CLI-specific)\n// ---------------------------------------------------------------------------\n\nfunction displayAddResults(data: AddToSourceResult, out: ReturnType<typeof resolveOutput>, interactive: boolean, skipHeader = false): void {\n const { filesAdded, packageName: resolvedName, addedFilePaths, isWorkspaceRoot, sourcePath } = data;\n const target = isWorkspaceRoot ? 'workspace package' : resolvedName;\n\n if (interactive && !skipHeader) {\n const pkgLabel = isWorkspaceRoot ? 'workspace package' : resolvedName;\n const displayPath = formatPathForDisplay(sourcePath, process.cwd());\n out.info(`To: ${pkgLabel} (${displayPath})`);\n }\n\n if (filesAdded > 0) {\n const count = filesAdded === 1 ? '1 file' : `${filesAdded} files`;\n if (interactive) {\n out.success(`Added ${count} to ${target}`);\n } else {\n const displayPath = formatPathForDisplay(sourcePath, process.cwd());\n out.success(`Added ${count} to ${target} (${displayPath})`);\n }\n const sortedFiles = [...(addedFilePaths || [])].sort((a, b) => a.localeCompare(b));\n const relPaths = sortedFiles.map((f) => relative(sourcePath, f).replace(/\\\\/g, '/'));\n\n if (interactive) {\n const maxDisplay = 10;\n const displayPaths = relPaths.slice(0, maxDisplay);\n const more = relPaths.length > maxDisplay ? `\\n... and ${relPaths.length - maxDisplay} more` : '';\n out.note(displayPaths.join('\\n') + more, 'Added files');\n } else {\n for (let i = 0; i < relPaths.length; i++) {\n const connector = getTreeConnector(i === relPaths.length - 1);\n out.message(` ${connector}${relPaths[i]}`);\n }\n }\n } else {\n out.success(`No new files added to ${target}`);\n }\n}\n\nfunction displayDependencyResult(depResult: AddResourceResult & { kind: 'dependency' }, out: ReturnType<typeof resolveOutput>, interactive: boolean): void {\n const { result: dep, classification } = depResult;\n const displayPath = formatPathForDisplay(dep.targetManifest, process.cwd());\n\n if (interactive) {\n // Interactive mode: keep existing clack-based display\n const header = `To: ${dep.packageName} (${displayPath})`;\n out.info(header);\n if (dep.wasAutoDetected) {\n out.info(`Detected package at ${classification.localPath} \u2014 adding as dependency.`);\n out.message('To copy files instead, use --copy.');\n }\n const versionSuffix = classification.version ? `@${classification.version}` : '';\n out.success(`Added ${dep.packageName}${versionSuffix} to ${dep.section}`);\n } else {\n // Non-interactive: clean tree format\n // \u2713 Added to dependencies (.openpackage/openpackage.yml)\n // \u2514\u2500\u2500 essentials@1.2.0\n out.success(`Added to ${dep.section} (${displayPath})`);\n const versionSuffix = classification.version ? `@${classification.version}` : '';\n const connector = getTreeConnector(true);\n out.message(` ${connector}${dep.packageName}${versionSuffix}`);\n if (dep.wasAutoDetected) {\n out.message(' Detected local package \u2014 use --copy to copy files instead.');\n }\n }\n}\n\nfunction displayResult(result: AddResourceResult, out: ReturnType<typeof resolveOutput>, interactive: boolean, resourceSpec: string): void {\n switch (result.kind) {\n case 'dependency':\n displayDependencyResult(result, out, interactive);\n break;\n case 'workspace-resource':\n if (result.result.data) {\n out.info(`Resolved \"${resourceSpec}\" from installed workspace resources.`);\n displayAddResults(result.result.data, out, interactive);\n }\n break;\n case 'copy':\n if (result.result.data) {\n displayAddResults(result.result.data, out, interactive);\n }\n break;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Command setup\n// ---------------------------------------------------------------------------\n\nexport async function setupAddCommand(args: any[]): Promise<void> {\n const [resource, options, command] = args as [string | undefined, any, Command];\n const cwd = process.cwd();\n const programOpts = command.parent?.opts() || {};\n const interactive = !resource;\n\n const execContext = await createCliExecutionContext({\n global: false,\n cwd: programOpts.cwd,\n interactive,\n outputMode: interactive ? 'rich' : 'plain',\n });\n\n const policy = createInteractionPolicy({ interactive, force: options.force });\n execContext.interactionPolicy = policy;\n const out = resolveOutput(execContext);\n\n if (!resource) {\n // Interactive file selector path\n if (!policy.canPrompt(PromptTier.OptionalMenu)) {\n throw new Error(\n '<resource-spec> argument is required in non-interactive mode.\\n' +\n 'Usage: opkg add <resource-spec> [options]'\n );\n }\n\n let pkgLabel: string;\n let sourcePath: string;\n if (options.to) {\n const source = await resolveMutableSource({ cwd, packageName: options.to });\n pkgLabel = source.packageName;\n sourcePath = source.absolutePath;\n } else {\n const context = await buildWorkspacePackageContext(cwd);\n pkgLabel = 'workspace package';\n sourcePath = context.packageRootDir;\n }\n out.step(`To: ${pkgLabel} (${formatPathForDisplay(sourcePath, cwd)})`);\n out.connector();\n\n const selectedFiles = await interactiveFileSelect({ cwd, includeDirs: true });\n if (!selectedFiles || selectedFiles.length === 0) return;\n\n let filesToProcess: string[];\n if (hasDirectorySelections(selectedFiles)) {\n filesToProcess = await expandDirectorySelections(selectedFiles, cwd);\n out.info(`Found ${filesToProcess.length} total file${filesToProcess.length === 1 ? '' : 's'} to add`);\n } else {\n filesToProcess = selectedFiles;\n }\n\n const absPaths = filesToProcess.map((f) => join(cwd, f));\n const result = await runAddToSourcePipelineBatch(options.to, absPaths, cwd, { ...options, execContext });\n if (!result.success) throw new Error(result.error || 'Add operation failed');\n if (result.data) displayAddResults(result.data, out, interactive, true);\n return;\n }\n\n // Non-interactive: delegate to core orchestrator\n const result = await processAddResource(resource, options, cwd, execContext);\n displayResult(result, out, interactive, resource);\n}\n", "import { resolve as resolvePath, join } from 'path';\n\nimport type { CommandResult } from '../../types/index.js';\nimport type { ExecutionContext } from '../../types/execution-context.js';\nimport { FILE_PATTERNS } from '../../constants/index.js';\nimport { resolveMutableSource } from '../source-resolution/resolve-mutable-source.js';\nimport { assertMutableSourceOrThrow } from '../source-mutability.js';\nimport { collectSourceEntries, type SourceEntry } from './source-collector.js';\nimport { copyFilesWithConflictResolution } from './add-conflict-handler.js';\nimport type { PackageContext } from '../package-context.js';\nimport { parsePackageYml } from '../../utils/package-yml.js';\nimport { exists } from '../../utils/fs.js';\nimport { logger } from '../../utils/logger.js';\nimport { resolveSourceOperationArguments } from '../../utils/source-operation-arguments.js';\nimport { buildWorkspacePackageContext } from '../workspace-package-context.js';\n\nexport interface AddToSourceOptions {\n platformSpecific?: boolean;\n force?: boolean;\n execContext?: ExecutionContext;\n}\n\nexport interface AddToSourceResult {\n packageName: string;\n filesAdded: number;\n sourcePath: string;\n sourceType: 'workspace' | 'global';\n isWorkspaceRoot: boolean;\n addedFilePaths: string[];\n}\n\nexport async function runAddToSourcePipeline(\n packageName: string | undefined,\n pathArg: string | undefined,\n options: AddToSourceOptions = {}\n): Promise<CommandResult<AddToSourceResult>> {\n const cwd = process.cwd();\n\n // Resolve arguments: packageName from --to option, pathArg is required\n const { resolvedPackageName, resolvedPath } = await resolveSourceOperationArguments(\n cwd,\n packageName,\n pathArg,\n { command: 'add', checkWorkspaceRoot: false }\n );\n\n const absInputPath = resolvePath(cwd, resolvedPath);\n if (!(await exists(absInputPath))) {\n return { success: false, error: `Path not found: ${resolvedPath}` };\n }\n\n // Build package context (workspace root or mutable package source)\n let packageContext: Pick<PackageContext, 'name' | 'version' | 'config' | 'packageYmlPath' | 'packageRootDir' | 'packageFilesDir'>;\n let sourceType: 'workspace' | 'global';\n const isWorkspaceRoot = resolvedPackageName === null;\n \n if (isWorkspaceRoot) {\n // No package name: add to workspace root (.openpackage/)\n try {\n packageContext = await buildWorkspacePackageContext(cwd);\n sourceType = 'workspace';\n \n logger.info('Adding files to workspace package', {\n sourcePath: packageContext.packageRootDir,\n inputPath: resolvedPath\n });\n } catch (error) {\n return { \n success: false, \n error: error instanceof Error ? error.message : String(error) \n };\n }\n } else {\n // Package name provided: resolve mutable source\n let source;\n try {\n source = await resolveMutableSource({ cwd, packageName: resolvedPackageName });\n } catch (error) {\n return { success: false, error: error instanceof Error ? error.message : String(error) };\n }\n \n // Additional safety check\n assertMutableSourceOrThrow(source.absolutePath, { packageName: source.packageName, command: 'add' });\n\n packageContext = await buildPackageContextFromSource(source);\n sourceType = source.absolutePath.includes(`${cwd}/.openpackage/packages/`) \n ? 'workspace' as const\n : 'global' as const;\n \n logger.info('Adding files to package source', {\n packageName: source.packageName,\n sourcePath: source.absolutePath,\n sourceType: source.sourceType,\n inputPath: resolvedPath\n });\n }\n\n // Collect entries - source-collector now handles flow-based mapping\n const entries = await collectSourceEntries(absInputPath, cwd);\n\n const changed = await copyFilesWithConflictResolution(packageContext, entries, options);\n\n logger.info('Files copied to package source', {\n packageName: packageContext.name,\n filesAdded: changed.length\n });\n\n // Build array of added file paths (package-root-relative paths)\n const addedFilePaths = changed.map(file => join(packageContext.packageRootDir, file.path));\n\n return {\n success: true,\n data: {\n packageName: packageContext.name,\n filesAdded: changed.length,\n sourcePath: packageContext.packageRootDir,\n sourceType,\n isWorkspaceRoot,\n addedFilePaths\n }\n };\n}\n\n/**\n * Run add pipeline for multiple paths as a single batch (one copy pass, one result).\n * Used when interactive selection yields multiple files.\n */\nexport async function runAddToSourcePipelineBatch(\n packageName: string | undefined,\n absPaths: string[],\n cwd: string,\n options: AddToSourceOptions = {}\n): Promise<CommandResult<AddToSourceResult>> {\n let packageContext: Pick<PackageContext, 'name' | 'version' | 'config' | 'packageYmlPath' | 'packageRootDir' | 'packageFilesDir'>;\n let sourceType: 'workspace' | 'global';\n const isWorkspaceRoot = !packageName;\n\n if (isWorkspaceRoot) {\n try {\n packageContext = await buildWorkspacePackageContext(cwd);\n sourceType = 'workspace';\n } catch (error) {\n return { success: false, error: error instanceof Error ? error.message : String(error) };\n }\n } else {\n let source;\n try {\n source = await resolveMutableSource({ cwd, packageName });\n assertMutableSourceOrThrow(source.absolutePath, { packageName: source.packageName, command: 'add' });\n packageContext = await buildPackageContextFromSource(source);\n sourceType = source.absolutePath.includes(`${cwd}/.openpackage/packages/`) ? 'workspace' : 'global';\n } catch (error) {\n return { success: false, error: error instanceof Error ? error.message : String(error) };\n }\n }\n\n const allEntries: SourceEntry[] = [];\n const seenRegistryPaths = new Set<string>();\n\n for (const absPath of absPaths) {\n if (!(await exists(absPath))) {\n return { success: false, error: `Path not found: ${absPath}` };\n }\n try {\n const entries = await collectSourceEntries(absPath, cwd);\n for (const entry of entries) {\n if (!seenRegistryPaths.has(entry.registryPath)) {\n seenRegistryPaths.add(entry.registryPath);\n allEntries.push(entry);\n }\n }\n } catch (error) {\n return { success: false, error: error instanceof Error ? error.message : String(error) };\n }\n }\n\n if (allEntries.length === 0) {\n return { success: true, data: { packageName: packageContext.name, filesAdded: 0, sourcePath: packageContext.packageRootDir, sourceType, isWorkspaceRoot, addedFilePaths: [] } };\n }\n\n const changed = await copyFilesWithConflictResolution(packageContext, allEntries, options);\n const addedFilePaths = changed.map(f => join(packageContext.packageRootDir, f.path));\n\n return {\n success: true,\n data: {\n packageName: packageContext.name,\n filesAdded: changed.length,\n sourcePath: packageContext.packageRootDir,\n sourceType,\n isWorkspaceRoot,\n addedFilePaths\n }\n };\n}\n\n/**\n * Build context for workspace root package at .openpackage/\n * Creates the workspace manifest if it doesn't exist.\n */\ntype AddContext = Pick<PackageContext, 'name' | 'version' | 'config' | 'packageYmlPath' | 'packageRootDir' | 'packageFilesDir'>;\n\n/**\n * Build add context from a resolved mutable source.\n */\nasync function buildPackageContextFromSource(\n source: Awaited<ReturnType<typeof resolveMutableSource>>\n): Promise<AddContext> {\n const packageYmlPath = join(source.absolutePath, FILE_PATTERNS.OPENPACKAGE_YML);\n const config = await parsePackageYml(packageYmlPath);\n\n return {\n name: source.packageName,\n version: config.version,\n config,\n packageYmlPath,\n packageRootDir: source.absolutePath,\n packageFilesDir: source.absolutePath\n };\n}\n\n\n\n\n", "import { relative, basename } from 'path';\nimport { realpathSync } from 'fs';\n\nimport { DIR_PATTERNS } from '../../constants/index.js';\nimport { isDirectory, isFile, walkFiles } from '../../utils/fs.js';\nimport { normalizePathForProcessing } from '../../utils/path-normalization.js';\nimport { mapWorkspaceFileToUniversal } from '../platform/platform-mapper.js';\nimport { isPlatformRootFile } from '../platform/platform-utils.js';\nimport type { Flow } from '../../types/flows.js';\n\nexport interface SourceEntry {\n sourcePath: string;\n registryPath: string;\n flow?: Flow;\n}\n\n/**\n * Collect source entries from a workspace path for adding to a package source.\n * Uses IMPORT flows (workspace \u2192 package direction) to map files correctly.\n */\nexport async function collectSourceEntries(resolvedPath: string, cwd: string): Promise<SourceEntry[]> {\n const entries: SourceEntry[] = [];\n\n if (await isDirectory(resolvedPath)) {\n for await (const filePath of walkFiles(resolvedPath)) {\n const entry = deriveSourceEntry(filePath, cwd);\n if (!entry) {\n throw new Error(`Unsupported file inside directory: ${relative(cwd, filePath)}`);\n }\n entries.push(entry);\n }\n return entries;\n }\n\n if (await isFile(resolvedPath)) {\n const entry = deriveSourceEntry(resolvedPath, cwd);\n if (!entry) {\n throw new Error(`Unsupported file: ${relative(cwd, resolvedPath)}`);\n }\n entries.push(entry);\n return entries;\n }\n\n throw new Error(`Unsupported path type: ${resolvedPath}`);\n}\n\n/**\n * Derive a source entry from an absolute file path.\n * Uses IMPORT flows to map workspace files to their universal package paths.\n * \n * Flow-based mapping:\n * 1. Try to match against platform IMPORT flows (workspace \u2192 package)\n * 2. Check if it's a platform root file (AGENTS.md, CLAUDE.md, etc.)\n * 3. Otherwise, treat as root-level content (stored at package root)\n */\nfunction deriveSourceEntry(absFilePath: string, cwd: string): SourceEntry | null {\n // Resolve symlinks to ensure consistent path comparison\n const realFilePath = realpathSync(absFilePath);\n const realCwd = realpathSync(cwd);\n const relativePath = relative(realCwd, realFilePath);\n const normalizedRelPath = normalizePathForProcessing(relativePath);\n\n // 1. Try to map using platform IMPORT flows (workspace \u2192 package direction)\n const mapping = mapWorkspaceFileToUniversal(absFilePath, cwd);\n if (mapping) {\n // Successfully mapped via import flow\n // Construct registry path: subdir/relPath (e.g., \"commands/test.md\")\n const registryPath = [mapping.subdir, mapping.relPath].filter(Boolean).join('/');\n return {\n sourcePath: absFilePath,\n registryPath,\n flow: mapping.flow\n };\n }\n\n // 2. Check if this is a platform root file (e.g., AGENTS.md, CLAUDE.md)\n const fileName = basename(normalizedRelPath);\n if (fileName && isPlatformRootFile(fileName) && !normalizedRelPath.includes('/')) {\n // Root files: stored at package root with no prefix\n return {\n sourcePath: absFilePath,\n registryPath: fileName\n };\n }\n\n // 3. All other files: treat as root-level content\n // These are non-platform-specific files stored at package root under root/\n return {\n sourcePath: absFilePath,\n registryPath: `root/${normalizedRelPath}`\n };\n}\n\n", "import { basename, dirname, extname, join, relative as pathRelative } from 'path';\n\nimport type { PackageFile } from '../../types/index.js';\nimport { ensureDir, exists, readTextFile, writeTextFile } from '../../utils/fs.js';\nimport { UserCancellationError } from '../../utils/errors.js';\nimport { logger } from '../../utils/logger.js';\nimport type { SourceEntry } from './source-collector.js';\nimport type { PackageContext } from '../package-context.js';\nimport { PromptTier } from '../../core/interaction-policy.js';\nimport type { PromptPort } from '../ports/prompt.js';\nimport { resolvePrompt, resolveOutput } from '../ports/resolve.js';\nimport { applyMapPipeline, createMapContext, splitMapPipeline } from '../flows/map-pipeline/index.js';\nimport { defaultTransformRegistry } from '../flows/flow-transforms.js';\nimport { parseMarkdownDocument, serializeMarkdownDocument } from '../flows/markdown.js';\n\ntype ConflictDecision = 'keep-existing' | 'overwrite';\n\n/**\n * Resolve the target path for a registry path.\n * Registry paths are package-root-relative (universal subdirs already at root)\n */\nfunction resolveTargetPath(packageContext: Pick<PackageContext, 'packageRootDir'>, registryPath: string): string {\n return join(packageContext.packageRootDir, registryPath);\n}\n\nfunction transformMarkdownWithFlowMap(\n raw: string,\n entry: SourceEntry,\n workspaceRoot: string\n): { transformed: boolean; output: string } {\n const flow = entry.flow;\n if (!flow?.map || flow.map.length === 0) {\n return { transformed: false, output: raw };\n }\n\n // Only transform markdown for now (the reported regression is agent markdown frontmatter)\n if (!['.md', '.mdc'].includes(extname(entry.sourcePath).toLowerCase())) {\n return { transformed: false, output: raw };\n }\n\n // Parse markdown frontmatter leniently: if frontmatter is invalid, treat as plain markdown\n const parsed = parseMarkdownDocument(raw, { lenient: true });\n if (!parsed.frontmatter) {\n return { transformed: false, output: raw };\n }\n\n // Apply flow.map to frontmatter, same as flow executor does for markdown\n const mapContext = createMapContext({\n filename: basename(entry.sourcePath, extname(entry.sourcePath)),\n dirname: basename(dirname(entry.sourcePath)),\n path: pathRelative(workspaceRoot, entry.sourcePath).replace(/\\\\/g, '/'),\n ext: extname(entry.sourcePath),\n });\n\n // Split schema vs pipe ops (match flow-executor semantics)\n const { schemaOps, pipeOps } = splitMapPipeline(flow.map);\n\n let nextFrontmatter = parsed.frontmatter;\n if (schemaOps.length > 0) {\n nextFrontmatter = applyMapPipeline(nextFrontmatter, schemaOps as any, mapContext, defaultTransformRegistry);\n }\n if (pipeOps.length > 0) {\n nextFrontmatter = applyMapPipeline(nextFrontmatter, pipeOps as any, mapContext, defaultTransformRegistry);\n }\n\n const output = serializeMarkdownDocument({ frontmatter: nextFrontmatter, body: parsed.body });\n return { transformed: true, output };\n}\n\nexport interface CopyFilesWithConflictResolutionOptions {\n force?: boolean;\n execContext?: { interactionPolicy?: { canPrompt(tier: PromptTier): boolean }; prompt?: PromptPort };\n prompt?: PromptPort;\n}\n\nexport async function copyFilesWithConflictResolution(\n packageContext: Pick<PackageContext, 'name' | 'packageRootDir'>,\n entries: SourceEntry[],\n options: CopyFilesWithConflictResolutionOptions = {}\n): Promise<PackageFile[]> {\n const changedFiles: PackageFile[] = [];\n const { name } = packageContext;\n const policy = options.execContext?.interactionPolicy;\n const forceOverwrite = options.force ?? false;\n\n for (const entry of entries) {\n // Resolve target path based on registry path format\n const destination = resolveTargetPath(packageContext, entry.registryPath);\n\n const sourceContent = await readTextFile(entry.sourcePath);\n const transformed = transformMarkdownWithFlowMap(sourceContent, entry, process.cwd());\n const contentToWrite = transformed.output;\n const destExists = await exists(destination);\n\n if (destExists) {\n const existingContent = await readTextFile(destination).catch(() => '');\n\n if (existingContent === contentToWrite) {\n logger.debug(`Skipping unchanged file: ${entry.registryPath}`);\n continue;\n }\n\n let decision: ConflictDecision;\n if (forceOverwrite) {\n decision = 'overwrite';\n } else if (policy?.canPrompt(PromptTier.Confirmation)) {\n const effectivePrompt = options.prompt ?? options.execContext?.prompt;\n decision = await promptConflictDecision(name, entry.registryPath, effectivePrompt);\n } else {\n resolveOutput().warn(`Skipping '${entry.registryPath}' (already exists). Use --force to overwrite.`);\n continue;\n }\n\n if (decision === 'keep-existing') {\n logger.debug(`Kept existing file for ${entry.registryPath}`);\n continue;\n }\n }\n\n await ensureDir(dirname(destination));\n await writeTextFile(destination, contentToWrite);\n\n changedFiles.push({\n path: entry.registryPath,\n content: contentToWrite,\n encoding: 'utf8'\n });\n }\n\n return changedFiles;\n}\n\nasync function promptConflictDecision(packageName: string, registryPath: string, prompt?: PromptPort): Promise<ConflictDecision> {\n const p = prompt ?? resolvePrompt();\n const decision = await p.select<ConflictDecision | 'cancel'>(\n `File '${registryPath}' already exists in package '${packageName}'. Choose how to proceed:`,\n [\n { title: 'Keep existing file (skip)', value: 'keep-existing' },\n { title: 'Replace with workspace file', value: 'overwrite' },\n { title: 'Cancel operation', value: 'cancel' }\n ]\n );\n\n if (decision === 'cancel') {\n throw new UserCancellationError();\n }\n\n return decision as ConflictDecision;\n}\n\n", "/**\n * Add Orchestrator\n *\n * Core orchestration logic for the `add` command.\n * Classifies input, dispatches to the correct pipeline (dependency, workspace-resource, copy),\n * and returns typed results. No terminal-UI dependencies.\n */\n\nimport { join, resolve } from 'path';\n\nimport type { ExecutionContext } from '../../types/execution-context.js';\nimport type { CommandResult } from '../../types/index.js';\nimport { classifyAddInput, type AddInputClassification, type AddClassifyOptions } from './add-input-classifier.js';\nimport { runAddDependencyFlow, type AddDependencyResult, type AddDependencyOptions } from './add-dependency-flow.js';\nimport { runAddToSourcePipeline, runAddToSourcePipelineBatch, type AddToSourceResult, type AddToSourceOptions } from './add-to-source-pipeline.js';\nimport { exists } from '../../utils/fs.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type AddResourceResult =\n | { kind: 'dependency'; result: AddDependencyResult; classification: AddInputClassification }\n | { kind: 'copy'; result: CommandResult<AddToSourceResult> }\n | { kind: 'workspace-resource'; result: CommandResult<AddToSourceResult> };\n\nexport interface ProcessAddResourceOptions {\n copy?: boolean;\n dev?: boolean;\n to?: string;\n platformSpecific?: boolean;\n force?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Orchestration\n// ---------------------------------------------------------------------------\n\n/** Check if input looks like a bare name (could be registry or local path) */\nfunction isBareNameInput(input: string): boolean {\n return (\n !input.startsWith('./') &&\n !input.startsWith('../') &&\n !input.startsWith('/') &&\n !input.startsWith('~') &&\n !input.endsWith('/')\n );\n}\n\n/**\n * Process a single resource spec through the add pipeline.\n * Classifies the input and dispatches to the appropriate flow\n * (dependency, workspace-resource, or copy).\n *\n * Returns a typed discriminated union so the caller (CLI or GUI)\n * can render the result however it chooses.\n */\nexport async function processAddResource(\n resourceSpec: string,\n options: ProcessAddResourceOptions,\n cwd: string,\n execContext: ExecutionContext\n): Promise<AddResourceResult> {\n const classification = await classifyAddInput(resourceSpec, cwd, {\n copy: options.copy,\n dev: options.dev,\n });\n\n if (classification.mode === 'dependency') {\n if (options.platformSpecific) {\n throw new Error('--platform-specific can only be used with --copy or when adding files');\n }\n try {\n const result = await runAddDependencyFlow(classification, {\n dev: options.dev,\n to: options.to,\n });\n return { kind: 'dependency', result, classification };\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n if (isBareNameInput(resourceSpec)) {\n const localPath = resolve(cwd, resourceSpec);\n if (await exists(localPath)) {\n throw new Error(\n `${msg}\\n\\nA local path './${resourceSpec}' exists \u2014 did you mean:\\n opkg add ./${resourceSpec}`\n );\n }\n }\n throw error;\n }\n }\n\n if (classification.mode === 'workspace-resource') {\n if (options.dev) {\n throw new Error('--dev can only be used when adding a dependency, not when copying files');\n }\n const resource = classification.resolvedResource!;\n const absPath = resource.sourcePath || join(execContext.targetDir, resource.targetFiles[0]);\n\n const result = await runAddToSourcePipeline(options.to, absPath, { ...options, execContext });\n if (!result.success) {\n throw new Error(result.error || 'Add operation failed');\n }\n return { kind: 'workspace-resource', result };\n }\n\n // copy mode\n if (options.dev) {\n throw new Error('--dev can only be used when adding a dependency, not when copying files');\n }\n const result = await runAddToSourcePipeline(options.to, classification.copySourcePath!, { ...options, execContext });\n if (!result.success) {\n throw new Error(result.error || 'Add operation failed');\n }\n return { kind: 'copy', result };\n}\n", "import { join, basename, resolve } from 'path';\n\nimport { exists, isDirectory } from '../../utils/fs.js';\nimport { classifyInputBase, type BaseInputClassification } from '../install/input-classifier-base.js';\nimport { ValidationError } from '../../utils/errors.js';\nimport { logger } from '../../utils/logger.js';\nimport { isValidPackageDirectory } from '../package-context.js';\nimport { detectPluginType } from '../install/plugin-detector.js';\nimport { parsePackageYml } from '../../utils/package-yml.js';\n\nexport type AddMode = 'dependency' | 'copy' | 'workspace-resource';\n\nexport interface AddInputClassification {\n mode: AddMode;\n packageName?: string;\n version?: string;\n gitUrl?: string;\n gitRef?: string;\n gitPath?: string;\n localPath?: string;\n resourcePath?: string;\n copySourcePath?: string;\n /** Resolved workspace resource (for workspace-resource mode) */\n resolvedResource?: import('../resources/resource-builder.js').ResolvedResource;\n}\n\nexport interface AddClassifyOptions {\n copy?: boolean;\n dev?: boolean;\n}\n\n/**\n * Classify add command input to determine mode (dependency vs. copy) and extract metadata.\n *\n * Disambiguation layers (in order):\n * 1. --copy flag \u2192 force copy mode\n * 2. Trailing slash \u2192 local directory (strip /, resolve, require exists+isDirectory)\n * 3. Bare name with file extension \u2192 local file (require exists)\n * 4. Base classifier \u2192 registry, git, explicit paths\n *\n * @param input - User input string\n * @param cwd - Current working directory\n * @param options - Add-specific options (--copy, --dev)\n * @returns Add classification with mode and metadata\n */\nexport async function classifyAddInput(\n input: string,\n cwd: string,\n options: AddClassifyOptions\n): Promise<AddInputClassification> {\n // Layer 0: Handle --copy flag first (force copy mode)\n if (options.copy) {\n return handleCopyMode(input, cwd);\n }\n\n // Layer 1: Trailing slash \u2192 local directory (unambiguous dir intent)\n if (input.endsWith('/')) {\n const stripped = input.replace(/\\/+$/, '');\n const resolvedPath = resolve(cwd, stripped);\n if (await exists(resolvedPath)) {\n if (await isDirectory(resolvedPath)) {\n const localPathSpec = await buildLocalPathSpec(resolvedPath);\n return enrichWithAddMode(localPathSpec);\n }\n throw new ValidationError(\n `Path '${input}' is not a directory. Trailing slash indicates directory intent.`\n );\n }\n throw new ValidationError(`Directory not found: ${input}`);\n }\n\n // Layer 2: Bare name with file extension \u2192 local file (unambiguous file intent)\n if (isBareNameWithExtension(input)) {\n const resolvedPath = resolve(cwd, input);\n if (await exists(resolvedPath)) {\n return { mode: 'copy', copySourcePath: resolvedPath };\n }\n throw new ValidationError(`File not found: ${input}`);\n }\n\n // Layer 3: Use base classifier (registry, git, explicit paths)\n const base = await classifyInputBase(input, cwd);\n return enrichWithAddMode(base);\n}\n\n/** Check if input is a bare name with a file-extension-like suffix (e.g. README.md, config.json) */\nfunction isBareNameWithExtension(input: string): boolean {\n if (input.startsWith('./') || input.startsWith('../') || input.startsWith('/') || input.startsWith('~')) {\n return false;\n }\n if (input.includes('@') || input.includes('/')) {\n return false;\n }\n // Exclude tarballs \u2014 they are packages, not content files\n if (input.endsWith('.tgz') || input.endsWith('.tar.gz')) {\n return false;\n }\n const lastDot = input.lastIndexOf('.');\n if (lastDot <= 0) return false;\n const ext = input.slice(lastDot + 1);\n return ext.length >= 1 && ext.length <= 8 && /^[a-zA-Z0-9]+$/.test(ext);\n}\n\n/** Build a LocalPathInputSpec from an absolute path (for trailing-slash and local-path enrichment) */\nasync function buildLocalPathSpec(absolutePath: string): Promise<BaseInputClassification> {\n const isValid = await isValidPackageDirectory(absolutePath);\n const pluginResult = await detectPluginType(absolutePath);\n\n let packageName: string | undefined;\n if (isValid || pluginResult.isPlugin) {\n try {\n const manifestPath = join(absolutePath, 'openpackage.yml');\n if (await exists(manifestPath)) {\n const config = await parsePackageYml(manifestPath);\n packageName = config.name ?? basename(absolutePath);\n }\n } catch {\n packageName = basename(absolutePath);\n }\n }\n\n return {\n type: 'local-path',\n absolutePath,\n isDirectory: true,\n packageName,\n isValidPackage: isValid || pluginResult.isPlugin\n };\n}\n\n/**\n * Handle --copy mode (force copy regardless of input type).\n * Accepts any input that resolves to an existing local path (including package directories).\n */\nasync function handleCopyMode(\n input: string,\n cwd: string\n): Promise<AddInputClassification> {\n const resolvedAbsPath = resolve(cwd, input);\n if (!(await exists(resolvedAbsPath))) {\n throw new ValidationError(\n `Path not found: ${input}\\n--copy requires an existing local path.`\n );\n }\n return { mode: 'copy', copySourcePath: resolvedAbsPath };\n}\n\n/**\n * Enrich base classification with add-specific mode determination\n */\nfunction enrichWithAddMode(\n base: BaseInputClassification\n): AddInputClassification {\n switch (base.type) {\n case 'bulk':\n throw new ValidationError('Add command requires an input argument');\n\n case 'git':\n return {\n mode: 'dependency',\n packageName: base.derivedName!,\n gitUrl: base.gitUrl,\n gitRef: base.gitRef,\n gitPath: base.gitPath\n };\n\n case 'local-path': {\n // Tarballs (.tgz, .tar.gz) \u2192 path dependency\n if (\n base.absolutePath.endsWith('.tgz') ||\n base.absolutePath.endsWith('.tar.gz')\n ) {\n return {\n mode: 'dependency',\n packageName: base.packageName ?? basename(base.absolutePath).replace(/\\.(tgz|tar\\.gz)$/, ''),\n localPath: base.absolutePath\n };\n }\n\n // Determine if dependency or copy based on package validity\n if (base.isValidPackage) {\n logger.debug('Classified local directory as dependency', {\n packageName: base.packageName,\n absolutePath: base.absolutePath\n });\n return {\n mode: 'dependency',\n packageName: base.packageName!,\n localPath: base.absolutePath\n };\n }\n\n // Not a valid package - copy mode\n return {\n mode: 'copy',\n copySourcePath: base.absolutePath\n };\n }\n\n case 'registry':\n return {\n mode: 'dependency',\n packageName: base.packageName,\n version: base.version,\n resourcePath: base.registryPath\n };\n }\n}\n", "import { join } from 'path';\n\nimport type { AddInputClassification } from './add-input-classifier.js';\nimport type { PackageDependency } from '../../types/index.js';\nimport { resolveMutableSource } from '../source-resolution/resolve-mutable-source.js';\nimport { addPackageToYml, ensureLocalOpenPackageStructure, createWorkspacePackageYml } from '../package-management.js';\nimport { parsePackageYml, writePackageYml } from '../../utils/package-yml.js';\nimport { normalizePackageName, arePackageNamesEquivalent } from '../../utils/package-name.js';\nimport { formatPathForYaml } from '../../utils/path-resolution.js';\nimport { getLocalPackageYmlPath } from '../../utils/paths.js';\nimport { exists } from '../../utils/fs.js';\nimport { FILE_PATTERNS } from '../../constants/index.js';\nimport { logger } from '../../utils/logger.js';\n\nexport interface AddDependencyOptions {\n dev?: boolean;\n to?: string;\n}\n\nexport interface AddDependencyResult {\n packageName: string;\n targetManifest: string;\n section: 'dependencies' | 'dev-dependencies';\n isLocalPath: boolean;\n wasAutoDetected: boolean;\n}\n\nexport async function runAddDependencyFlow(\n classification: AddInputClassification,\n options: AddDependencyOptions\n): Promise<AddDependencyResult> {\n const cwd = process.cwd();\n const isDev = options.dev ?? false;\n const section = isDev ? 'dev-dependencies' : 'dependencies';\n const packageName = classification.packageName!;\n const isLocalPath = !!classification.localPath;\n\n const localPath = classification.localPath\n ? formatPathForYaml(classification.localPath, cwd)\n : undefined;\n\n let gitUrl: string | undefined;\n if (classification.gitUrl) {\n gitUrl = classification.gitRef\n ? `${classification.gitUrl}#${classification.gitRef}`\n : classification.gitUrl;\n }\n\n const gitPath = classification.gitPath || classification.resourcePath;\n\n if (options.to) {\n const source = await resolveMutableSource({ cwd, packageName: options.to });\n const manifestPath = join(source.absolutePath, FILE_PATTERNS.OPENPACKAGE_YML);\n\n await addDependencyToManifest(manifestPath, packageName, {\n version: classification.version,\n path: localPath,\n url: gitUrl,\n gitPath,\n isDev,\n });\n\n logger.info(`Added ${packageName} to ${manifestPath} [${section}]`);\n\n return {\n packageName,\n targetManifest: manifestPath,\n section,\n isLocalPath,\n wasAutoDetected: isLocalPath,\n };\n }\n\n const packageYmlPath = getLocalPackageYmlPath(cwd);\n if (!(await exists(packageYmlPath))) {\n await ensureLocalOpenPackageStructure(cwd);\n await createWorkspacePackageYml(cwd);\n }\n\n await addPackageToYml(\n cwd,\n packageName,\n classification.version,\n isDev,\n undefined,\n true, // silent \u2014 CLI layer handles display\n localPath,\n classification.gitUrl,\n classification.gitRef,\n gitPath,\n undefined\n );\n\n logger.info(`Added ${packageName} to workspace manifest [${section}]`);\n\n return {\n packageName,\n targetManifest: packageYmlPath,\n section,\n isLocalPath,\n wasAutoDetected: isLocalPath,\n };\n}\n\nasync function addDependencyToManifest(\n manifestPath: string,\n packageName: string,\n options: {\n version?: string;\n path?: string;\n url?: string;\n gitPath?: string;\n isDev: boolean;\n }\n): Promise<void> {\n const config = await parsePackageYml(manifestPath);\n if (!config.dependencies) config.dependencies = [];\n if (!config['dev-dependencies']) config['dev-dependencies'] = [];\n\n const normalized = normalizePackageName(packageName);\n\n const dependency: PackageDependency = {\n name: normalized,\n ...(options.url ? { url: options.url } : {}),\n ...(options.path && !options.url ? { path: options.path } : {}),\n ...(options.version && !options.url && !options.path ? { version: options.version } : {}),\n ...(options.gitPath && options.url ? { path: options.gitPath } : {}),\n };\n\n const targetKey = options.isDev ? 'dev-dependencies' : 'dependencies';\n const otherKey = options.isDev ? 'dependencies' : 'dev-dependencies';\n\n const otherArr = config[otherKey]!;\n const otherIdx = otherArr.findIndex(d => arePackageNamesEquivalent(d.name, normalized));\n if (otherIdx >= 0) {\n otherArr.splice(otherIdx, 1);\n }\n\n const targetArr = config[targetKey]!;\n const existingIdx = targetArr.findIndex(d => arePackageNamesEquivalent(d.name, normalized));\n if (existingIdx >= 0) {\n targetArr[existingIdx] = dependency;\n } else {\n targetArr.push(dependency);\n }\n\n await writePackageYml(manifestPath, config);\n}\n"],
|
|
5
|
+
"mapp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AU;AAEd,QAAM,gBAAgB,MAAM,sBAAsB,EAAE,KAAK,aAAa,GAAK,CAAC;AAC5E,QAAI,CAAC,iBAAiB,cAAc,WAAW,EAAG;AAElD,QAAI;AACJ,IAAI,uBAAuB,aAAa,KACtC,iBAAiB,MAAM,0BAA0B,eAAe,GAAG,GACnE,IAAI,KAAK,SAAS,eAAe,MAAM,cAAc,eAAe,WAAW,IAAI,KAAK,GAAG,SAAS,KAEpG,iBAAiB;AAGnB,QAAM,WAAW,eAAe,IAAI,CAAC,MAAMC,MAAK,KAAK,CAAC,CAAC,GACjDC,UAAS,MAAM,4BAA4B,QAAQ,IAAI,UAAU,KAAK,EAAE,GAAG,SAAS,YAAY,CAAC;AACvG,QAAI,CAACA,QAAO,QAAS,OAAM,IAAI,MAAMA,QAAO,SAAS,sBAAsB;AAC3E,IAAIA,QAAO,QAAM,kBAAkBA,QAAO,MAAM,KAAK,aAAa,EAAI;AACtE;AAAA,EACF;AAGA,MAAM,SAAS,MAAM,mBAAmB,UAAU,SAAS,KAAK,WAAW;AAC3E,gBAAc,QAAQ,KAAK,aAAa,QAAQ;AAClD;",
|
|
6
|
+
"names": ["join", "relative", "join", "basename", "basename", "join", "join", "resolve", "join", "basename", "join", "basename", "join", "join", "resolve", "join", "result", "relative", "join", "result"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
consoleOutput,
|
|
4
|
+
normalizePathWithTilde
|
|
5
|
+
} from "./chunk-BROJ6OUT.js";
|
|
6
|
+
|
|
7
|
+
// ../core/src/utils/formatters.ts
|
|
8
|
+
import { relative, isAbsolute } from "path";
|
|
9
|
+
function formatPathForDisplay(path, cwd = process.cwd()) {
|
|
10
|
+
if (path.startsWith("~") || !isAbsolute(path))
|
|
11
|
+
return path;
|
|
12
|
+
let relativePath = relative(cwd, path);
|
|
13
|
+
if (relativePath && !relativePath.startsWith(".."))
|
|
14
|
+
return relativePath;
|
|
15
|
+
let tildePath = normalizePathWithTilde(path);
|
|
16
|
+
return tildePath.startsWith("~") ? tildePath : path;
|
|
17
|
+
}
|
|
18
|
+
function getTreeConnector(isLast) {
|
|
19
|
+
return isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
20
|
+
}
|
|
21
|
+
function formatFileCount(count, type = "files") {
|
|
22
|
+
return `${count} ${count === 1 ? type.slice(0, -1) : type}`;
|
|
23
|
+
}
|
|
24
|
+
function formatFileSize(bytes) {
|
|
25
|
+
let mb = bytes / 1048576;
|
|
26
|
+
return mb >= 1 ? `${mb.toFixed(2)}MB` : `${(bytes / 1024).toFixed(2)}KB`;
|
|
27
|
+
}
|
|
28
|
+
function formatScopeTag(scope) {
|
|
29
|
+
return scope === "global" ? " [global]" : "";
|
|
30
|
+
}
|
|
31
|
+
function formatScopeBadge(scopes) {
|
|
32
|
+
return typeof scopes == "string" ? scopes === "global" ? "[global]" : "" : scopes.has("global") ? "[global]" : "";
|
|
33
|
+
}
|
|
34
|
+
function displayPackageConfig(packageConfig, path, isExisting = !1, output) {
|
|
35
|
+
let out = output ?? consoleOutput, action = isExisting ? "already exists" : "created", displayPath = formatPathForDisplay(path);
|
|
36
|
+
out.success(`${displayPath} ${action}`), out.message(` Name: ${packageConfig.name}`), packageConfig.version && out.message(` Version: ${packageConfig.version}`), packageConfig.description && out.message(` Description: ${packageConfig.description}`), packageConfig.keywords && packageConfig.keywords.length > 0 && out.message(` Keywords: ${packageConfig.keywords.join(", ")}`), packageConfig.private && out.message(" Private: Yes");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
formatPathForDisplay,
|
|
41
|
+
getTreeConnector,
|
|
42
|
+
formatFileCount,
|
|
43
|
+
formatFileSize,
|
|
44
|
+
formatScopeTag,
|
|
45
|
+
formatScopeBadge,
|
|
46
|
+
displayPackageConfig
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=chunk-4B5HJLP2.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../core/src/utils/formatters.ts"],
|
|
4
|
+
"sourcesContent": ["import { PackageYml } from '../types/index.js';\nimport { relative, isAbsolute } from 'path';\nimport { normalizePathWithTilde } from './home-directory.js';\nimport type { OutputPort } from '../core/ports/output.js';\nimport { consoleOutput } from '../core/ports/console-output.js';\n\n/**\n * Formatting utilities for consistent display across commands\n */\n\n/**\n * Format a file system path for display to the user.\n * \n * This function provides a unified way to display paths across all commands:\n * - Uses tilde notation (~) for paths under home directory (e.g., ~/.claude/..., ~/.config/..., ~/.openpackage/...)\n * - Uses relative paths from cwd for paths in the workspace\n * - Falls back to absolute path for other cases\n * \n * @param path - The path to format (can be absolute or relative)\n * @param cwd - Current working directory (defaults to process.cwd())\n * @returns Formatted path string for display\n * \n * @example\n * formatPathForDisplay('/Users/user/.openpackage/packages/my-pkg') // => '~/.openpackage/packages/my-pkg'\n * formatPathForDisplay('/Users/user/.claude/agents/x.md') // => '~/.claude/agents/x.md'\n * formatPathForDisplay('/Users/user/workspace/file.txt', '/Users/user/workspace') // => 'file.txt'\n * formatPathForDisplay('./relative/path.txt') // => './relative/path.txt'\n */\nexport function formatPathForDisplay(path: string, cwd: string = process.cwd()): string {\n // If path is already in tilde notation, return as-is\n if (path.startsWith('~')) {\n return path;\n }\n \n // If path is relative, return as-is\n if (!isAbsolute(path)) {\n return path;\n }\n \n // Try relative path from cwd first (paths in workspace take precedence)\n const relativePath = relative(cwd, path);\n if (relativePath && !relativePath.startsWith('..')) {\n // Only use relative path if it's within cwd (doesn't start with ..)\n return relativePath;\n }\n \n // Use tilde notation for any path under home directory (~/.claude, ~/.config, ~/.cursor, ~/.openpackage, etc.)\n const tildePath = normalizePathWithTilde(path);\n if (tildePath.startsWith('~')) {\n return tildePath;\n }\n \n // Fall back to absolute path\n return path;\n}\n\n/**\n * Interface for package table entries\n */\nexport interface PackageTableEntry {\n name: string;\n version: string;\n description?: string;\n status?: string;\n type?: string;\n available?: string;\n}\n\n/**\n * Format and display an extended package table with status information (used by list command)\n */\nexport function displayExtendedPackageTable(packages: PackageTableEntry[], output?: OutputPort): void {\n const out = output ?? consoleOutput;\n if (packages.length === 0) {\n out.message('No packages found.');\n return;\n }\n \n // Table header\n out.message('FORMULA'.padEnd(20) + 'INSTALLED'.padEnd(12) + 'STATUS'.padEnd(15) + 'TYPE'.padEnd(15) + 'AVAILABLE');\n out.message('-------'.padEnd(20) + '---------'.padEnd(12) + '------'.padEnd(15) + '----'.padEnd(15) + '---------');\n \n // Display each package\n for (const pkg of packages) {\n const name = pkg.name.padEnd(20);\n const version = pkg.version.padEnd(12);\n const status = (pkg.status || '').padEnd(15);\n const type = (pkg.type || '').padEnd(15);\n const available = (pkg.available || '-').padEnd(9);\n \n out.message(`${name}${version}${status}${type}${available}`);\n }\n \n out.message('');\n out.message(`Total: ${packages.length} packages`);\n}\n\n/**\n * Generic table formatter for custom column layouts\n */\nexport function displayCustomTable<T>(\n items: T[],\n columns: Array<{\n header: string;\n width: number;\n accessor: (item: T) => string;\n }>,\n title?: string,\n output?: OutputPort\n): void {\n const out = output ?? consoleOutput;\n if (title) {\n out.message(title);\n out.message('');\n }\n \n if (items.length === 0) {\n out.message('No items found.');\n return;\n }\n \n // Build header\n const headerLine = columns.map(col => col.header.padEnd(col.width)).join('');\n const separatorLine = columns.map(col => '-'.repeat(col.header.length).padEnd(col.width)).join('');\n \n out.message(headerLine);\n out.message(separatorLine);\n \n // Display rows\n for (const item of items) {\n const row = columns.map(col => col.accessor(item).padEnd(col.width)).join('');\n out.message(row);\n }\n \n out.message('');\n out.message(`Total: ${items.length} items`);\n}\n\n/**\n * Format project summary line\n */\nexport function formatProjectSummary(name: string, version: string): string {\n return `${name}@${version}`;\n}\n\n/**\n * Format tree connector symbols\n */\nexport function getTreeConnector(isLast: boolean): string {\n return isLast ? '\u2514\u2500\u2500 ' : '\u251C\u2500\u2500 ';\n}\n\n/**\n * Format tree prefix for nested items\n */\nexport function getTreePrefix(prefix: string, isLast: boolean): string {\n return prefix + (isLast ? ' ' : '\u2502 ');\n}\n\n/**\n * Format status with appropriate emoji\n */\nexport function formatStatus(status: string): string {\n switch (status.toLowerCase()) {\n case 'installed':\n return '\u2705 installed';\n case 'missing':\n return '\u274C missing';\n case 'outdated':\n return '\u26A0\uFE0F outdated';\n case 'dependency-mismatch':\n return '\uD83D\uDD04 mismatch';\n default:\n return status;\n }\n}\n\n/**\n * Format file count with appropriate description\n */\nexport function formatFileCount(count: number, type: string = 'files'): string {\n return `${count} ${count === 1 ? type.slice(0, -1) : type}`;\n}\n\n/**\n * Format dependency list for display\n */\nexport function formatDependencyList(dependencies: Array<{ name: string; version: string }>): string[] {\n return dependencies.map(dep => `${dep.name}@${dep.version}`);\n}\n\n/**\n * Format file size in appropriate units (KB or MB)\n */\nexport function formatFileSize(bytes: number): string {\n const mb = bytes / (1024 * 1024);\n if (mb >= 1) {\n return `${mb.toFixed(2)}MB`;\n }\n const kb = bytes / 1024;\n return `${kb.toFixed(2)}KB`;\n}\n\n/**\n * Format a single scope as a tag.\n * Only [global] is shown \u2014 [project] is the default context and omitted to reduce noise.\n */\nexport function formatScopeTag(scope: string): string {\n return scope === 'global' ? ' [global]' : '';\n}\n\n/**\n * Format one or more scopes as a badge.\n * Only [global] is shown \u2014 [project] is the default context and omitted to reduce noise.\n */\nexport function formatScopeBadge(scopes: Set<string> | string): string {\n if (typeof scopes === 'string') {\n return scopes === 'global' ? '[global]' : '';\n }\n const hasGlobal = scopes.has('global');\n return hasGlobal ? '[global]' : '';\n}\n\n/**\n * Display package configuration details in a consistent format\n */\nexport function displayPackageConfig(packageConfig: PackageYml, path: string, isExisting: boolean = false, output?: OutputPort): void {\n const out = output ?? consoleOutput;\n const action = isExisting ? 'already exists' : 'created';\n const displayPath = formatPathForDisplay(path);\n \n out.success(`${displayPath} ${action}`);\n\n out.message(` Name: ${packageConfig.name}`);\n if (packageConfig.version) {\n out.message(` Version: ${packageConfig.version}`);\n }\n if (packageConfig.description) {\n out.message(` Description: ${packageConfig.description}`);\n }\n if (packageConfig.keywords && packageConfig.keywords.length > 0) {\n out.message(` Keywords: ${packageConfig.keywords.join(', ')}`);\n }\n if (packageConfig.private) {\n out.message(` Private: Yes`);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;AACA,SAAS,UAAU,kBAAkB;AA2B9B,SAAS,qBAAqB,MAAc,MAAc,QAAQ,IAAI,GAAW;AAOtF,MALI,KAAK,WAAW,GAAG,KAKnB,CAAC,WAAW,IAAI;AAClB,WAAO;AAIT,MAAM,eAAe,SAAS,KAAK,IAAI;AACvC,MAAI,gBAAgB,CAAC,aAAa,WAAW,IAAI;AAE/C,WAAO;AAIT,MAAM,YAAY,uBAAuB,IAAI;AAC7C,SAAI,UAAU,WAAW,GAAG,IACnB,YAIF;AACT;AA8FO,SAAS,iBAAiB,QAAyB;AACxD,SAAO,SAAS,wBAAS;AAC3B;AA8BO,SAAS,gBAAgB,OAAe,OAAe,SAAiB;AAC7E,SAAO,GAAG,KAAK,IAAI,UAAU,IAAI,KAAK,MAAM,GAAG,EAAE,IAAI,IAAI;AAC3D;AAYO,SAAS,eAAe,OAAuB;AACpD,MAAM,KAAK,QAAS;AACpB,SAAI,MAAM,IACD,GAAG,GAAG,QAAQ,CAAC,CAAC,OAGlB,IADI,QAAQ,MACN,QAAQ,CAAC,CAAC;AACzB;AAMO,SAAS,eAAe,OAAuB;AACpD,SAAO,UAAU,WAAW,cAAc;AAC5C;AAMO,SAAS,iBAAiB,QAAsC;AACrE,SAAI,OAAO,UAAW,WACb,WAAW,WAAW,aAAa,KAE1B,OAAO,IAAI,QAAQ,IAClB,aAAa;AAClC;AAKO,SAAS,qBAAqB,eAA2B,MAAc,aAAsB,IAAO,QAA2B;AACpI,MAAM,MAAM,UAAU,eAChB,SAAS,aAAa,mBAAmB,WACzC,cAAc,qBAAqB,IAAI;AAE7C,MAAI,QAAQ,GAAG,WAAW,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