@noir-ai/cli 1.3.0-beta.6 → 1.4.0-beta.2
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/README.md +7 -7
- package/dist/bin.d.ts +30 -2
- package/dist/bin.js +869 -582
- package/dist/bin.js.map +1 -1
- package/dist/chunk-A5W2E3X2.js +33 -0
- package/dist/chunk-A5W2E3X2.js.map +1 -0
- package/dist/{chunk-J2Y3BOVK.js → chunk-SVFQGAOF.js} +32 -8
- package/dist/chunk-SVFQGAOF.js.map +1 -0
- package/dist/{chunk-3QMQXBII.js → chunk-YES5UCU5.js} +648 -40
- package/dist/chunk-YES5UCU5.js.map +1 -0
- package/dist/{create-VK7JX6IB.js → create-7ERBL42K.js} +31 -7
- package/dist/create-7ERBL42K.js.map +1 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.js +5 -4
- package/dist/{output-De3lKbZq.d.ts → output-BNE9htEm.d.ts} +9 -0
- package/dist/sync-SCAF6Z5H.js +82 -0
- package/dist/sync-SCAF6Z5H.js.map +1 -0
- package/dist/tui/chunk-OMF7XZMN.js +99 -0
- package/dist/tui/chunk-OMF7XZMN.js.map +1 -0
- package/dist/tui/chunk-YNEBQJXA.js +1243 -0
- package/dist/tui/chunk-YNEBQJXA.js.map +1 -0
- package/dist/tui/create-U2YJH5QC.js +72 -0
- package/dist/tui/create-U2YJH5QC.js.map +1 -0
- package/dist/tui/index.js +2253 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/sync-VYRXCGK4.js +81 -0
- package/dist/tui/sync-VYRXCGK4.js.map +1 -0
- package/package.json +15 -11
- package/dist/chunk-3QMQXBII.js.map +0 -1
- package/dist/chunk-J2Y3BOVK.js.map +0 -1
- package/dist/chunk-OF4OO5W6.js +0 -190
- package/dist/chunk-OF4OO5W6.js.map +0 -1
- package/dist/create-VK7JX6IB.js.map +0 -1
- package/dist/sync-7XFGCRJN.js +0 -55
- package/dist/sync-7XFGCRJN.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sync.ts"],"sourcesContent":["// `noir sync` — re-emit the runtime subset of the scaffold manifest.\n//\n// Slice S-T2 refactor: delegates to `@noir-ai/create`'s `scaffold({mode:'sync'})`,\n// which emits ONLY the regenerate + managedBlock entries (the always-safe-to-\n// rewrite subset). Per the S-T2 contract notes, this ADOPTS THE ENGINE'S\n// SEMANTICS and retires the predecessor's ad-hoc behavior:\n//\n// - The engine re-emits `.mcp.json` (regenerate) + NOIR.md brief\n// (managedBlock) + CLAUDE.md context/rules blocks + ignore-file blocks.\n// The predecessor's sync re-emitted only CLAUDE.md blocks + ignores and\n// did NOT refresh `.mcp.json`/NOIR.md — the engine is a strict superset\n// here, so a transport/url change is now picked up by `noir sync`.\n// - The engine does NOT seed `.noir/rules/RULES.md` on sync (RULES.md is\n// skipIfExists, owned by init/create). The predecessor seeded it when\n// missing; init now owns all seeds. (Spec-aligned: \"sync re-emits\n// generated/managed content; init owns seeds.\")\n//\n// S10 multi-host: sync resolves the host from `.noir/config.yml` (persisted by\n// `noir init --host <id>` via the config seed's `host: {{host}}` literal) OR\n// from an explicit `--host <id>` override. The resolved adapter drives the\n// manifest + skills emission. Skills emission stays a core sync feature for\n// hosts with a `skillsDir` (claude → `.claude/skills/`; cursor → `.cursor/rules/`\n// as `.mdc`); gemini/agents-md/opencode have no skill concept and the step is\n// skipped. `scaffold({mode:'sync'})` throws when the project isn't initialized\n// (no .noir/project.id), matching the predecessor's `loadProjectInfo` gate.\n\nimport { existsSync } from 'node:fs';\nimport { type HostId, resolveAdapter } from '@noir-ai/adapters';\nimport { loadProjectInfo, paths } from '@noir-ai/core';\nimport { scaffold } from '@noir-ai/create';\nimport { type CompileTarget, emitSkillsToDir } from '@noir-ai/skills';\nimport { buildConflictOpts } from './conflict.js';\n\nexport interface SyncOptions {\n /** S10 `--host <id>` override. When set, takes precedence over the\n * `.noir/config.yml` `host:` field. Useful for re-emitting under a\n * different host without re-init (advanced — the canonical host stays\n * whatever init wrote). */\n host?: HostId;\n /** SP-C: overwrite differing regenerated files without prompting (bypasses\n * the conflict menu). */\n force?: boolean;\n /** SP-D: three-way merge managed regions (preserve hand-edits inside\n * `<!-- noir:* -->` markers across a template update). */\n merge?: boolean;\n}\n\nexport async function sync(root: string, opts: SyncOptions = {}): Promise<void> {\n const host = resolveSyncHost(root, opts);\n\n await scaffold({\n root,\n mode: 'sync',\n host,\n ...buildConflictOpts({ force: opts.force }),\n ...(opts.merge ? { mergeManagedRegions: true } : {}),\n });\n\n const adapter = resolveAdapter(host);\n const skillsDir = adapter.skillsDir?.({ root });\n if (skillsDir === undefined) {\n // N1: standardized wording — same phrase across init/sync/create so logs\n // grep uniformly. (Pre-N1 sync phrased this as \"nothing to sync\".)\n process.stderr.write(`host '${host}' has no skill emitter; skipping skills\\n`);\n return;\n }\n const target: CompileTarget = host;\n const summary = await emitSkillsToDir(skillsDir, { includeIntegrations: true, target });\n const relDir = skillsDir.replace(`${root}/`, '');\n process.stderr.write(\n `Synced ${summary.emitted.length} Noir skills to ${relDir}/ (target: ${target}).\\n`,\n );\n // T2: surface stale-dir pruning so a user can see when a previous Noir\n // version's builtin was removed (the dir was deleted from .claude/skills/).\n // Pure hygiene; never affects correctness of the freshly-emitted pack.\n const pruned = summary.pruned ?? [];\n if (pruned.length > 0) {\n process.stderr.write(\n `Pruned ${pruned.length} stale noir-* skill dir${pruned.length === 1 ? '' : 's'}: ${pruned.join(', ')}\\n`,\n );\n }\n}\n\n/** Resolve the sync host: explicit `--host` override > `.noir/config.yml`\n * `host:` field > `'claude'` (default — preserves the v1.1 regression anchor\n * for projects initialized before S10). The config read is best-effort: if\n * `.noir/config.yml` is absent OR fails to parse, scaffold's own\n * \"not initialized\" gate (no `.noir/project.id`) fires below with the locked\n * error string. */\nfunction resolveSyncHost(root: string, opts: SyncOptions): HostId {\n if (opts.host !== undefined) return opts.host;\n if (!existsSync(paths.config(root))) return 'claude';\n try {\n return loadProjectInf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