@rpamis/comet 0.4.0-beta.19 → 0.4.0-beta.20

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.
Files changed (71) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +3 -0
  3. package/assets/manifest.json +1 -1
  4. package/assets/skills/comet/scripts/comet-hook-router.mjs +10 -10
  5. package/assets/skills/comet-archive/SKILL.md +0 -1
  6. package/assets/skills/comet-archive/agents/openai.yaml +1 -1
  7. package/assets/skills/comet-build/SKILL.md +0 -1
  8. package/assets/skills/comet-build/agents/openai.yaml +1 -1
  9. package/assets/skills/comet-design/SKILL.md +0 -1
  10. package/assets/skills/comet-design/agents/openai.yaml +1 -1
  11. package/assets/skills/comet-hotfix/SKILL.md +0 -1
  12. package/assets/skills/comet-hotfix/agents/openai.yaml +1 -1
  13. package/assets/skills/comet-native/SKILL.md +1 -1
  14. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +56 -56
  15. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +77 -77
  16. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +11 -11
  17. package/assets/skills/comet-native/scripts/comet-native-init.mjs +3 -3
  18. package/assets/skills/comet-native/scripts/comet-native-new.mjs +55 -55
  19. package/assets/skills/comet-native/scripts/comet-native-next.mjs +54 -54
  20. package/assets/skills/comet-native/scripts/comet-native-root.mjs +6 -6
  21. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +91 -91
  22. package/assets/skills/comet-native/scripts/comet-native-select.mjs +63 -63
  23. package/assets/skills/comet-native/scripts/comet-native-show.mjs +45 -45
  24. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +42 -42
  25. package/assets/skills/comet-native/scripts/comet-native-status.mjs +67 -67
  26. package/assets/skills/comet-open/SKILL.md +0 -1
  27. package/assets/skills/comet-open/agents/openai.yaml +1 -1
  28. package/assets/skills/comet-tweak/SKILL.md +0 -1
  29. package/assets/skills/comet-tweak/agents/openai.yaml +1 -1
  30. package/assets/skills/comet-verify/SKILL.md +0 -1
  31. package/assets/skills/comet-verify/agents/openai.yaml +1 -1
  32. package/assets/skills-zh/comet-archive/SKILL.md +0 -1
  33. package/assets/skills-zh/comet-archive/agents/openai.yaml +1 -1
  34. package/assets/skills-zh/comet-build/SKILL.md +0 -1
  35. package/assets/skills-zh/comet-build/agents/openai.yaml +1 -1
  36. package/assets/skills-zh/comet-design/SKILL.md +0 -1
  37. package/assets/skills-zh/comet-design/agents/openai.yaml +1 -1
  38. package/assets/skills-zh/comet-hotfix/SKILL.md +0 -1
  39. package/assets/skills-zh/comet-hotfix/agents/openai.yaml +1 -1
  40. package/assets/skills-zh/comet-native/SKILL.md +1 -1
  41. package/assets/skills-zh/comet-open/SKILL.md +0 -1
  42. package/assets/skills-zh/comet-open/agents/openai.yaml +1 -1
  43. package/assets/skills-zh/comet-tweak/SKILL.md +0 -1
  44. package/assets/skills-zh/comet-tweak/agents/openai.yaml +1 -1
  45. package/assets/skills-zh/comet-verify/SKILL.md +0 -1
  46. package/assets/skills-zh/comet-verify/agents/openai.yaml +1 -1
  47. package/dist/app/commands/doctor.d.ts.map +1 -1
  48. package/dist/app/commands/doctor.js +43 -24
  49. package/dist/app/commands/doctor.js.map +1 -1
  50. package/dist/app/commands/init.d.ts.map +1 -1
  51. package/dist/app/commands/init.js +32 -18
  52. package/dist/app/commands/init.js.map +1 -1
  53. package/dist/domains/comet-native/native-change.d.ts +0 -1
  54. package/dist/domains/comet-native/native-change.d.ts.map +1 -1
  55. package/dist/domains/comet-native/native-change.js +2 -2
  56. package/dist/domains/comet-native/native-change.js.map +1 -1
  57. package/dist/domains/comet-native/native-cli-help.js +1 -1
  58. package/dist/domains/comet-native/native-cli-help.js.map +1 -1
  59. package/dist/domains/comet-native/native-next-command.js +3 -3
  60. package/dist/domains/comet-native/native-next-command.js.map +1 -1
  61. package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -1
  62. package/dist/domains/comet-native/native-portable-continuation.js +23 -0
  63. package/dist/domains/comet-native/native-portable-continuation.js.map +1 -1
  64. package/dist/domains/comet-native/native-portable-runtime.js +1 -1
  65. package/dist/domains/comet-native/native-portable-runtime.js.map +1 -1
  66. package/dist/domains/dashboard/web/index.html +14 -14
  67. package/dist/domains/integrations/codegraph.d.ts +24 -2
  68. package/dist/domains/integrations/codegraph.d.ts.map +1 -1
  69. package/dist/domains/integrations/codegraph.js +307 -1
  70. package/dist/domains/integrations/codegraph.js.map +1 -1
  71. package/package.json +1 -1
@@ -165,14 +165,14 @@ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.pus
165
165
  `:`
166
166
  `}function Lp(t){return t.match(/[^\r\n]*(?:\r\n|\n|\r|$)/gu)?.filter(Boolean)??[]}function Mp(t){return t.replace(/(?:\r\n|\n|\r)$/u,"")}function Fp(t){let e=[],i=!1;for(let r of Lp(t)){let n=Mp(r);if(n===Hc){if(i)throw new Error("Comet .gitignore managed block is malformed");i=!0;continue}if(n===Dc){if(!i)throw new Error("Comet .gitignore managed block is malformed");i=!1;continue}i||e.push(r)}if(i)throw new Error("Comet .gitignore managed block is incomplete");return e.join("")}function Bc(t){let e=Bp(t),i=Fp(t);return i.length>0&&!/(?:\r\n|\n|\r)$/u.test(i)&&(i+=e),i+[Hc,"!/.comet/","/.comet/*","!/.comet/config.yaml",Dc,""].join(e)}async function ma(t){let e=Dp.resolve(t),i=await ie(e,Jt,{label:"project .gitignore",expected:"file"}),r="",n=new Uint8Array;i.exists&&(n=(await Q(e,Jt,Oc,{label:"project .gitignore"})).bytes,r=Buffer.from(n).toString("utf8"));let a=Bc(r);a!==r&&(await He(i.target,a,{containedRoot:e,exclusive:!i.exists,beforeCommit:i.exists?async()=>{if(!(await Q(e,Jt,Oc,{label:"project .gitignore"})).bytes.equals(n))throw new Error("Project .gitignore changed before commit; rerun initialization")}:async()=>{if((await ie(e,Jt,{label:"project .gitignore",expected:"file"})).exists)throw new Error("Project .gitignore was created before commit; rerun initialization")}}),await ie(e,Jt,{label:"project .gitignore",expected:"file"}),await Hp.access(i.target))}import Xt from"path";import{realpathSync as mv}from"fs";import{execFileSync as Vp}from"child_process";import ur from"path";function va(t,e){return Vp("git",["-C",t,...e],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:1e4,windowsHide:!0}).trim()}function qp(t,e){let i=ur.normalize(t),r=ur.normalize(e);return process.platform==="win32"?i.toLowerCase()===r.toLowerCase():i===r}function et(t){try{let e=ur.resolve(va(t,["rev-parse","--show-toplevel"])),r=va(t,["worktree","list","--porcelain","-z"]).split("\0").find(o=>o.startsWith("worktree ")),n=r?ur.resolve(r.slice(9)):e,a=null;try{a=va(t,["symbolic-ref","--quiet","--short","HEAD"])||null}catch{}return{isGitWorktree:!0,isSecondaryWorktree:!qp(e,n),currentWorktreeRoot:e,primaryWorktreeRoot:n,currentBranch:a}}catch{return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}}var el=it(Ye(),1);var wa=1024*1024;import{AsyncLocalStorage as Wp}from"async_hooks";var sy=16*1024;var cy=new Wp;import{createHash as zp}from"crypto";function U(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function Jp(t,e){e.has(t)&&U("cyclic structures are not supported"),e.add(t);try{let i=Object.keys(t);for(let r=0;r<t.length;r+=1)Object.prototype.hasOwnProperty.call(t,r)||U("sparse arrays are not supported");return(i.length!==t.length||i.some((r,n)=>r!==String(n)))&&U("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&U("symbol properties are not supported"),`[${t.map(r=>ya(r,e)).join(",")}]`}finally{e.delete(t)}}function Gp(t,e){let i=Object.getPrototypeOf(t);i!==Object.prototype&&i!==null&&U("only plain objects are supported"),e.has(t)&&U("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&U("symbol properties are not supported"),e.add(t);try{let r=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=r[o];return(!s||!("value"in s))&&U("accessor properties are not supported"),`${JSON.stringify(o)}:${ya(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function ya(t,e){if(t===null)return"null";switch(typeof t){case"boolean":return t?"true":"false";case"string":return JSON.stringify(t);case"number":return Number.isFinite(t)||U("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?Jp(t,e):Gp(t,e);case"bigint":case"function":case"symbol":case"undefined":return U(`${typeof t} values are not supported`)}return U("unsupported value type")}function Na(t){return ya(t,new Set)}function V(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return zp("sha256").update(`${t}
167
167
  ${Na(e)}`).digest("hex")}var hy=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),Lc=Object.freeze({maxCriteria:1024});var Mc=it(Ye(),1);var Wc="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",Hy=new RegExp(`^portable-archive-(${Wc})\\.json$`,"u"),Dy=new RegExp(`^portable-migration-(${Wc})\\.json$`,"u");import{TextDecoder as am}from"util";var Ky=256*1024,Yy=1024*1024,Xy=16*1024;var Qy=64*1024*1024;var Zy=new am("utf-8",{fatal:!0});import{createHash as sm}from"crypto";function q(t){return sm("sha256").update(t).digest("hex")}var kN={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024};var SN=8*1024*1024;var EN=64*1024,PN=64*1024;var xN={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},CN={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024};var RN=(1n<<256n)-1n;var pm=it(Ye(),1);var mm=null;function vm(t,e){let i=t;for(let r of e)i+="\0"+(typeof r=="string"?r:JSON.stringify(r));return i}function Kc(t,e){return(...i)=>{let r=mm;if(r===null)return e(...i);let n=vm(`async:${t}`,i),a=r.entries.get(n);if(a)return a.value;let o=e(...i).catch(s=>{throw r.entries.delete(n),s});return r.entries.set(n,{value:o}),o}}var zN=Kc("hookWritePolicy",async t=>(await aa(t))?.hook??{allow_paths:[]});var Hb=256*1024;var Kb={runStateBytes:256*1024,trajectoryBytes:8*1024*1024,trajectoryEvents:4096,trajectoryEventBytes:256*1024,checkpointBytes:256*1024,pendingActionBytes:256*1024,contextBytes:1024*1024,artifactsBytes:1024*1024};var uk=16*1024,dk=process.platform;var tl=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],Ok=new Set(tl),bm=new Set([...tl,"minimum_runtime_version","revision"]),Hk=new Set([...bm,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]);var fr=class extends Error{constructor(i,r,n){super(`Native change ${i} revision conflict: expected ${r}, actual ${n}`);this.change=i;this.expectedRevision=r;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},Gt=class extends Error{constructor(i,r){super(`Native working directory already contains active change${r.length===1?"":"s"} ${r.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=i;this.activeChanges=r;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},hr=class extends Error{constructor(i,r,n,a,o,s=null,c=null){super(`Native change ${i} baseline is incomplete (${r} omitted entr${r===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=i;this.omittedCount=r;this.omittedByReason=n;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},Dk=["# Outcome","","# Scope","","# Non-goals","","# Acceptance examples","","# Constraints and invariants","","# Decisions","","# Open questions","","# Verification expectations",""].join(`
168
- `);var Bk=256*1024;var Sm=["Outcome","Scope","Non-goals","Acceptance examples"],Wk=[...Sm,"Constraints and invariants","Decisions","Open questions","Verification expectations"];var Em=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});var il=1024*1024;var nl="scoped-text-safety",Pm=1,xm=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var Cm="comet.native.checker-policy.v1";var sS=V(Cm,{policy:nl,version:Pm,limits:xm,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var Rm=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],cS=new Set(Rm);var Tm=il,PS=3*Tm;var al={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},jm=q("comet-native-runtime:v3:scope-reopen"),QS=[{skillVersion:"3",skillHash:q("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:q("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:q("comet-native-runtime:v1")}];var sl=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],IE=new Set(sl),Mm=new Set([...sl,"minimum_runtime_version","revision"]),jE=new Set([...Mm,"operation"]),$E=512*1024,Fm=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),OE=new Set([...Fm,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);var LE={maxAcceptanceCriteria:Lc.maxCriteria};var WE={maxSpecs:64,maxFileBytes:wa,maxTotalBytes:4*1024*1024};import{execFile as Qm}from"node:child_process";import{promisify as Zm}from"node:util";var JE=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ");var rP={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var EP=512*1024;var Yt=class extends Error{recovery;constructor(e,i){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=i}};var GP=64*1024;var UP=3600*1e3;var KP=Zm(Qm);var pr=class extends Error{details;constructor(e){let i=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(r=>`${r.ref}${r.acceptanceId?`[${r.acceptanceId}]`:""} -> ${r.mismatches.join("; ")}`).join(" | ")}`;super(i),this.name="NativeVerificationReceiptBindingError",this.details=e}};var $x={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var Jx=16*1024*1024,Gx=256*1024,Ux=16*1024;var Zx=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});var iC=16*1024;var cv=it(Ye(),1);var nC=8*1024*1024;var UR=16*1024;var LA=16*1024*1024,mr=class extends Error{constructor(i,r,n,a){super(`Canonical spec conflict for ${i}: expected ${r??"(missing)"}, actual ${n??"(missing)"}`);this.capability=i;this.expectedHash=r;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},vr=class extends Error{constructor(i,r=i.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${i.findingCodes.join(", ")}`){super(r);this.preflight=i;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};var gr=class extends Error{constructor(i,r,n){super(i,n);this.preparation=r;this.name="NativeWorkspacePreparationError"}preparation};var ul=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--help Show help without requiring an initialized project."],Sa=Object.freeze({"":{usage:"comet native <command> [options]",purpose:"Create, inspect, recover, and archive portable Native changes through Runtime-enforced, skill-coordinated steps.",subcommands:["init Initialize Native project configuration.","root show Inspect the configured artifact root.","root move <artifact-root> Move the configured artifact root.","new <change-name> Create a change and prepare its workspace.","spec remove Record a complete capability removal intent.","show <change-name> Read formal artifacts and portable state.","status [<change-name>] Discover stable boundaries and Runner actions.","select <change-name> Select a change in its bound workspace.","next <change-name> Confirm or recover a stable workflow boundary.","archive <change-name> Preview and execute Archive plus workspace finish.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:ul,output:"Human-readable text by default; use --json for a structured command envelope.",examples:["comet native status --json","comet native status my-change --details --json","comet native next --help"]},init:{usage:"comet native init [--root <artifact-root>] [--language en|zh-CN]",purpose:"Create or normalize .comet/config.yaml and the configured Native directories.",options:["--root <artifact-root> Project-relative artifact root; defaults to docs.","--language en|zh-CN Language for newly generated Native artifacts."],output:"The resolved project configuration and Native paths.",examples:["comet native init --root docs --language zh-CN"]},root:{usage:"comet native root <show|move> [arguments]",purpose:"Inspect or transactionally move the configured Native artifact root.",subcommands:["show Print the configured artifact root and resolved paths.","move <artifact-root> Move Native artifacts and update project configuration."],output:"The current root projection or the completed move result.",examples:["comet native root show","comet native root move artifacts/native"]},"root show":{usage:"comet native root show",purpose:"Print the configured Native artifact root and resolved paths.",output:"The configured artifact root and resolved Native paths."},"root move":{usage:"comet native root move <artifact-root>",purpose:"Transactionally move Native artifacts and update project configuration.",output:"The source, destination, and committed root-move transaction result.",examples:["comet native root move artifacts/native"]},new:{usage:"comet native new <change-name> [--language en|zh-CN] [--isolation current|branch|worktree] [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]",purpose:"Create a portable Native change and prepare the requested branch or linked worktree.",options:["--language en|zh-CN Artifact language; defaults to project configuration.","--isolation <kind> current, branch, or worktree; defaults to current.","--change-branch <branch> Change branch; defaults to comet/<change-name>.","--target-branch <branch> Local base branch; defaults to the current branch.","--worktree-path <path> Worktree directory; defaults to .worktrees/<change-name>."],output:"The portable state, workspace preparation result, and continuation with the next Runner action.",examples:["comet native new session-timeout --language zh-CN","comet native new session-timeout --isolation branch --target-branch main","comet native new session-timeout --isolation worktree --target-branch main"]},spec:{usage:"comet native spec remove <change-name> <capability>",purpose:"Record a capability removal; create and modify intents use complete proposed Spec files.",subcommands:["remove <change-name> <capability> Record a capability removal."],output:"The updated portable state and continuation."},"spec remove":{usage:"comet native spec remove <change-name> <capability>",purpose:"Record removal of a capability in the complete target specification.",output:"The updated portable state and continuation with the next Runner action."},show:{usage:"comet native show <change-name>",purpose:"Read formal artifacts and portable state for one Native change.",output:"The portable state, brief, complete proposed Specs, and continuation; legacy state is reported as migration-required."},status:{usage:"comet native status [<change-name>] [--cursor <token>] [--details]",purpose:"Discover portable stable boundaries, parent child readiness, or the exact next Runner action.",options:["--cursor <token> Continue a status-list page.","--details Include acceptance, Spec, workspace, and report details."],output:"A v2 status page or one portable Loop projection with local execution availability and continuation.runnerAction; parent changes also expose children and readyChildren.",examples:["comet native status --json","comet native status session-timeout --details --json"]},select:{usage:"comet native select <change-name>",purpose:"Select one Native change after validating its workspace binding.",output:"The selected change record."},next:{usage:`comet native next <change-name> --summary <text> [--confirmed|--accept-result|--revise-implementation|--revise-requirements|--retry-verifier|--resolve-verifier-blocker]
169
- comet native next <change-name> --runner-input <json-file>`,purpose:"Confirm or recover an Agent boundary, advance parent child changes, or use one skill-coordinated JSON bridge for Builder handoff, check-plan dispatch, and Verifier response/error.",options:["--summary <text> Required transition or recovery summary.","--confirmed Confirm Shape or an explicitly degraded verifier-unavailable fallback before Archive.","--accept-result Accept the current skill-coordinated Verify result and make it archive-ready.","--revise-implementation Keep confirmed requirements unchanged and return Verify to Build for implementation revision.","--revise-requirements Return Verify to Shape when user-visible goals or acceptance criteria must change.","--retry-verifier Retry a blocked Verifier execution when the continuation allows it.","--resolve-verifier-blocker Resolve a semantic Verifier blocker without changing the candidate, then dispatch a new attempt.","--expected-state-version <n> Continuation-issued guard that rejects stale public transition decisions.","--expected-action <action> Continuation-issued guard that binds the public transition decision to its intended action.","--runner-input <file> Skill-coordinated JSON: builder-handoff, dispatch-verifier, verifier-response, verifier-execution-error, or verifier-unavailable. Identity/provider/execution/candidate fields are rejected."," builder-handoff fields: kind, summary, addressed_acceptance_ids, checks, known_limits."," dispatch-verifier fields: kind, checks (an explicitly resolved plan; [] is allowed)."," verifier-response fields: kind, response (request-checks or final-result)."," verifier-execution-error fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch."," verifier-unavailable fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch; accepted only after the explicit Runtime check plan completed and passed."],output:"The portable state, explicit skill-coordinated label, Runtime-owned check results, complete verifierDispatch, bounded request-check response, continuation.runnerAction, and machine-readable continuation.inputOptions. This generic bridge is not trusted identity attestation: a passing result waits for explicit user confirmation before Archive.",examples:['comet native next session-timeout --summary "Shape confirmed" --confirmed','comet native next session-timeout --summary "Current result accepted" --accept-result','comet native next session-timeout --summary "Implementation needs revision" --revise-implementation','comet native next session-timeout --summary "Acceptance criteria changed" --revise-requirements','comet native next session-timeout --summary "Retry verifier infrastructure" --retry-verifier','comet native next session-timeout --summary "Retry semantic verification" --resolve-verifier-blocker',"comet native next session-timeout --runner-input <temporary-json-file>"]},archive:{usage:`comet native archive <change-name> --dry-run [--finish merge|push|pull-request|keep]
168
+ `);var Sm=["Outcome","Scope","Non-goals","Acceptance examples"],qk=[...Sm,"Constraints and invariants","Decisions","Open questions","Verification expectations"];var Em=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});var il=1024*1024;var nl="scoped-text-safety",Pm=1,xm=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var Cm="comet.native.checker-policy.v1";var oS=V(Cm,{policy:nl,version:Pm,limits:xm,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var Rm=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],sS=new Set(Rm);var Tm=il,ES=3*Tm;var al={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},jm=q("comet-native-runtime:v3:scope-reopen"),XS=[{skillVersion:"3",skillHash:q("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:q("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:q("comet-native-runtime:v1")}];var sl=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],TE=new Set(sl),Mm=new Set([...sl,"minimum_runtime_version","revision"]),IE=new Set([...Mm,"operation"]),jE=512*1024,Fm=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),$E=new Set([...Fm,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);var BE={maxAcceptanceCriteria:Lc.maxCriteria};var qE={maxSpecs:64,maxFileBytes:wa,maxTotalBytes:4*1024*1024};import{execFile as Qm}from"node:child_process";import{promisify as Zm}from"node:util";var zE=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ");var iP={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var SP=512*1024;var Yt=class extends Error{recovery;constructor(e,i){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=i}};var JP=64*1024;var GP=3600*1e3;var UP=Zm(Qm);var pr=class extends Error{details;constructor(e){let i=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(r=>`${r.ref}${r.acceptanceId?`[${r.acceptanceId}]`:""} -> ${r.mismatches.join("; ")}`).join(" | ")}`;super(i),this.name="NativeVerificationReceiptBindingError",this.details=e}};var jx={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var zx=16*1024*1024,Jx=256*1024,Gx=16*1024;var Qx=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});var tC=16*1024;var cv=it(Ye(),1);var rC=8*1024*1024;var GR=16*1024;var BA=16*1024*1024,mr=class extends Error{constructor(i,r,n,a){super(`Canonical spec conflict for ${i}: expected ${r??"(missing)"}, actual ${n??"(missing)"}`);this.capability=i;this.expectedHash=r;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},vr=class extends Error{constructor(i,r=i.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${i.findingCodes.join(", ")}`){super(r);this.preflight=i;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};var gr=class extends Error{constructor(i,r,n){super(i,n);this.preparation=r;this.name="NativeWorkspacePreparationError"}preparation};var ul=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--help Show help without requiring an initialized project."],Sa=Object.freeze({"":{usage:"comet native <command> [options]",purpose:"Create, inspect, recover, and archive portable Native changes through Runtime-enforced, skill-coordinated steps.",subcommands:["init Initialize Native project configuration.","root show Inspect the configured artifact root.","root move <artifact-root> Move the configured artifact root.","new <change-name> Create a change and prepare its workspace.","spec remove Record a complete capability removal intent.","show <change-name> Read formal artifacts and portable state.","status [<change-name>] Discover stable boundaries and Runner actions.","select <change-name> Select a change in its bound workspace.","next <change-name> Confirm or recover a stable workflow boundary.","archive <change-name> Preview and execute Archive plus workspace finish.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:ul,output:"Human-readable text by default; use --json for a structured command envelope.",examples:["comet native status --json","comet native status my-change --details --json","comet native next --help"]},init:{usage:"comet native init [--root <artifact-root>] [--language en|zh-CN]",purpose:"Create or normalize .comet/config.yaml and the configured Native directories.",options:["--root <artifact-root> Project-relative artifact root; defaults to docs.","--language en|zh-CN Language for newly generated Native artifacts."],output:"The resolved project configuration and Native paths.",examples:["comet native init --root docs --language zh-CN"]},root:{usage:"comet native root <show|move> [arguments]",purpose:"Inspect or transactionally move the configured Native artifact root.",subcommands:["show Print the configured artifact root and resolved paths.","move <artifact-root> Move Native artifacts and update project configuration."],output:"The current root projection or the completed move result.",examples:["comet native root show","comet native root move artifacts/native"]},"root show":{usage:"comet native root show",purpose:"Print the configured Native artifact root and resolved paths.",output:"The configured artifact root and resolved Native paths."},"root move":{usage:"comet native root move <artifact-root>",purpose:"Transactionally move Native artifacts and update project configuration.",output:"The source, destination, and committed root-move transaction result.",examples:["comet native root move artifacts/native"]},new:{usage:"comet native new <change-name> [--language en|zh-CN] [--isolation current|branch|worktree] [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]",purpose:"Create a portable Native change and prepare the requested branch or linked worktree.",options:["--language en|zh-CN Artifact language; defaults to project configuration.","--isolation <kind> current, branch, or worktree; defaults to current.","--change-branch <branch> Change branch; defaults to comet/<change-name>.","--target-branch <branch> Local base branch; defaults to the current branch.","--worktree-path <path> Worktree directory; defaults to .worktrees/<change-name>."],output:"The portable state, workspace preparation result, and continuation with the next Runner action.",examples:["comet native new session-timeout --language zh-CN","comet native new session-timeout --isolation branch --target-branch main","comet native new session-timeout --isolation worktree --target-branch main"]},spec:{usage:"comet native spec remove <change-name> <capability>",purpose:"Record a capability removal; create and modify intents use complete proposed Spec files.",subcommands:["remove <change-name> <capability> Record a capability removal."],output:"The updated portable state and continuation."},"spec remove":{usage:"comet native spec remove <change-name> <capability>",purpose:"Record removal of a capability in the complete target specification.",output:"The updated portable state and continuation with the next Runner action."},show:{usage:"comet native show <change-name>",purpose:"Read formal artifacts and portable state for one Native change.",output:"The portable state, brief, complete proposed Specs, and continuation; legacy state is reported as migration-required."},status:{usage:"comet native status [<change-name>] [--cursor <token>] [--details]",purpose:"Discover portable stable boundaries, parent child readiness, or the exact next Runner action.",options:["--cursor <token> Continue a status-list page.","--details Include acceptance, Spec, workspace, and report details."],output:"A v2 status page or one portable Loop projection with local execution availability and continuation.runnerAction; parent changes also expose children and readyChildren.",examples:["comet native status --json","comet native status session-timeout --details --json"]},select:{usage:"comet native select <change-name>",purpose:"Select one Native change after validating its workspace binding.",output:"The selected change record."},next:{usage:`comet native next <change-name> --summary <text> [--confirmed|--accept-result|--revise-implementation|--revise-requirements|--retry-verifier|--resolve-verifier-blocker]
169
+ comet native next <change-name> --runner-input <json-file>`,purpose:"Confirm or recover an Agent boundary, advance parent child changes, or use one skill-coordinated JSON bridge for Builder handoff, check-plan dispatch, and Verifier response/error.",options:["--summary <text> Required transition or recovery summary.","--confirmed Confirm Shape or an explicitly degraded verifier-unavailable fallback before Archive.","--accept-result Accept the current skill-coordinated Verify result and make it archive-ready.","--revise-implementation Keep confirmed requirements unchanged and return Verify to Build for implementation revision.","--revise-requirements Return Verify or Archive to Shape when user-visible goals or acceptance criteria must change.","--retry-verifier Retry a blocked Verifier execution when the continuation allows it.","--resolve-verifier-blocker Resolve a semantic Verifier blocker without changing the candidate, then dispatch a new attempt.","--expected-state-version <n> Continuation-issued guard that rejects stale public transition decisions.","--expected-action <action> Continuation-issued guard that binds the public transition decision to its intended action.","--runner-input <file> Skill-coordinated JSON: builder-handoff, dispatch-verifier, verifier-response, verifier-execution-error, or verifier-unavailable. Identity/provider/execution/candidate fields are rejected."," builder-handoff fields: kind, summary, addressed_acceptance_ids, checks, known_limits."," dispatch-verifier fields: kind, checks (an explicitly resolved plan; [] is allowed)."," verifier-response fields: kind, response (request-checks or final-result)."," verifier-execution-error fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch."," verifier-unavailable fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch; accepted only after the explicit Runtime check plan completed and passed."],output:"The portable state, explicit skill-coordinated label, Runtime-owned check results, complete verifierDispatch, bounded request-check response, continuation.runnerAction, and machine-readable continuation.inputOptions. This generic bridge is not trusted identity attestation: a passing result waits for explicit user confirmation before Archive.",examples:['comet native next session-timeout --summary "Shape confirmed" --confirmed','comet native next session-timeout --summary "Current result accepted" --accept-result','comet native next session-timeout --summary "Implementation needs revision" --revise-implementation','comet native next session-timeout --summary "Acceptance criteria changed" --revise-requirements','comet native next session-timeout --summary "Retry verifier infrastructure" --retry-verifier','comet native next session-timeout --summary "Retry semantic verification" --resolve-verifier-blocker',"comet native next session-timeout --runner-input <temporary-json-file>"]},archive:{usage:`comet native archive <change-name> --dry-run [--finish merge|push|pull-request|keep]
170
170
  comet native archive <change-name> [--confirmed] [--serial-first <current-change>]`,purpose:"Preview or execute deterministic Archive after the portable state reaches archive-ready.",options:["--dry-run Inspect readiness without rerunning verification.","--finish <action> Persist merge, push, pull-request, or keep for an isolated workspace.","--serial-first <current-change> During execution only, confirm that this change archives before detected capability peers; the value must equal <change-name>.","--confirmed Confirm Archive when project policy requires it."],output:"Readiness plus continuation, or the completed Archive transaction and workspace finish result; Archive does not repeat verification."},doctor:{usage:"comet native doctor [<change-name>] [--repair]",purpose:"Inspect portable state, migrate a legacy active change, or rebuild its local execution overlay.",options:["--repair Apply deterministic migration or rebuild from the portable stable boundary."],output:"Health, migration or recovery details, and the continuation with the next Runner action."}});function ka(t,e){return`${t}:
171
171
  ${e.map(i=>` ${i}`).join(`
172
172
  `)}`}function fv(t){let e=t.filter(r=>r!=="--help");if(e.length===0)return"";let i=e.slice(0,2).join(" ");return Sa[i]||e.length>1&&Sa[e[0]]?.subcommands?i:e[0]}function hv(t=[]){let e=fv(t),i=Sa[e];if(!i)throw new Error(`Unknown Native help topic: ${e}`);let r=[`Usage: ${i.usage}`,"",i.purpose];i.subcommands&&r.push("",ka("Commands",i.subcommands));let n=e===""?i.options:[...i.options??[],...ul];return n&&n.length>0&&r.push("",ka("Options",n)),r.push("",`Output:
173
173
  ${i.output}`),i.examples&&r.push("",ka("Examples",i.examples)),e===""&&r.push("","Run `comet native <command> --help` for command-specific details."),{topic:e,usage:`${r.join(`
174
174
  `)}
175
- `}}var pv=hv().usage;var f_=10*1024*1024,Ce=class extends Error{};function fl(t,e){let i=t.flatMap((r,n)=>r===e?[n]:[]);if(i.length>1)throw new Ce(`${e} may only be provided once`);return i.length===0?!1:(t.splice(i[0],1),!0)}function Qt(t,e){let i=t.flatMap((a,o)=>a===e?[o]:[]);if(i.length>1)throw new Ce(`${e} may only be provided once`);if(i.length===0)return;let r=i[0],n=t[r+1];if(n===void 0||n.startsWith("--"))throw new Ce(`${e} requires a value`);return t.splice(r,2),n}function hl(t){if(t.length>0)throw new Ce(`Unexpected argument: ${t[0]}`)}function pl(t,e="en"){let i=Qt(t,"--language")??e;if(i!=="en"&&i!=="zh-CN")throw new Ce("--language must be en or zh-CN");return i}function Ea(t,e){let i=Xt.normalize(dl(t)),r=Xt.normalize(dl(e));return process.platform==="win32"?i.toLowerCase()===r.toLowerCase():i===r}function dl(t){let e=Xt.resolve(t);try{return mv.native(e)}catch{return e}}function vv(t){let e=Xt.resolve(t),i=et(process.cwd());if(!i.isSecondaryWorktree||i.currentWorktreeRoot===null||i.primaryWorktreeRoot===null)return e;let r=et(e);return!r.isGitWorktree||r.currentWorktreeRoot===null||r.primaryWorktreeRoot===null||!Ea(i.primaryWorktreeRoot,r.primaryWorktreeRoot)||Ea(i.currentWorktreeRoot,r.currentWorktreeRoot)?e:Ea(process.cwd(),i.currentWorktreeRoot)?Xt.resolve(process.cwd()):i.currentWorktreeRoot}async function ml(t){return t?vv(t):pa(process.cwd())}function vl(t,e,i){return{command:t,exitCode:0,data:e,text:i??JSON.stringify(e,null,2)+`
175
+ `}}var pv=hv().usage;var d_=10*1024*1024,Ce=class extends Error{};function fl(t,e){let i=t.flatMap((r,n)=>r===e?[n]:[]);if(i.length>1)throw new Ce(`${e} may only be provided once`);return i.length===0?!1:(t.splice(i[0],1),!0)}function Qt(t,e){let i=t.flatMap((a,o)=>a===e?[o]:[]);if(i.length>1)throw new Ce(`${e} may only be provided once`);if(i.length===0)return;let r=i[0],n=t[r+1];if(n===void 0||n.startsWith("--"))throw new Ce(`${e} requires a value`);return t.splice(r,2),n}function hl(t){if(t.length>0)throw new Ce(`Unexpected argument: ${t[0]}`)}function pl(t,e="en"){let i=Qt(t,"--language")??e;if(i!=="en"&&i!=="zh-CN")throw new Ce("--language must be en or zh-CN");return i}function Ea(t,e){let i=Xt.normalize(dl(t)),r=Xt.normalize(dl(e));return process.platform==="win32"?i.toLowerCase()===r.toLowerCase():i===r}function dl(t){let e=Xt.resolve(t);try{return mv.native(e)}catch{return e}}function vv(t){let e=Xt.resolve(t),i=et(process.cwd());if(!i.isSecondaryWorktree||i.currentWorktreeRoot===null||i.primaryWorktreeRoot===null)return e;let r=et(e);return!r.isGitWorktree||r.currentWorktreeRoot===null||r.primaryWorktreeRoot===null||!Ea(i.primaryWorktreeRoot,r.primaryWorktreeRoot)||Ea(i.currentWorktreeRoot,r.currentWorktreeRoot)?e:Ea(process.cwd(),i.currentWorktreeRoot)?Xt.resolve(process.cwd()):i.currentWorktreeRoot}async function ml(t){return t?vv(t):pa(process.cwd())}function vl(t,e,i){return{command:t,exitCode:0,data:e,text:i??JSON.stringify(e,null,2)+`
176
176
  `}}function gl(t,e){if(e instanceof Ce)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof mr)return{command:t,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof vr)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof fr)return{command:t,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof Gt)return{command:t,exitCode:73,data:{requestedIsolation:e.requestedIsolation,activeChanges:e.activeChanges,requiredAction:"create-native-worktree"},error:{code:"workspace-isolation-required",message:e.message}};if(e instanceof gr)return{command:t,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof hr)return{command:t,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof pr)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof Yt)return{command:t,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let i=e.code;if(i&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(i))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let r=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:r?73:65,error:{code:r?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function wl(t,e){return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
177
177
  `}:t.error?{exitCode:t.exitCode,stderr:t.error.message}:{exitCode:t.exitCode,stdout:t.text}}async function yl(t,e){let i=Qt(t,"--root"),r=await ae(e),n=pl(t,r?.native.language??"en");if(hl(t),r?.native.pending_root_move)throw new Error(`Native root move ${r.native.pending_root_move.id} is incomplete`);let a=Wt(i??r?.native.artifact_root??"docs");if(r&&i&&r.native.artifact_root!==a)throw new Error(`Configured Native artifact root is ${r.native.artifact_root}; refusing conflicting root ${a}`);let o=r?{...r,native:{...r.native,language:n,snapshot:{...r.native.snapshot,exclude:jc(r.native.snapshot.exclude)}}}:$c(a,n),s=await De(e,o.native.artifact_root);return await Ic(s),await ma(e),await zt(e,o),vl("init",{projectRoot:e,artifactRoot:o.native.artifact_root,nativeRoot:s.nativeRoot,language:n},`Initialized Comet Native at ${s.nativeRoot}
178
178
  `)}function gv(t){return{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`