@aipt/cli 0.1.24 → 0.1.25
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 +11 -7
- package/dist/application-runner.js +14 -14
- package/dist/application.js +1 -1
- package/dist/chunk.js +1 -1
- package/dist/package-releases/aipt--cli/0.1.24/release.json +29 -0
- package/dist/package-releases/aipt--cli/0.1.25/release.json +29 -0
- package/dist/package-releases/aipt--idp-setup/0.1.2/release.json +31 -0
- package/docs/bootstrap.md +1 -1
- package/docs/engineering-workflow.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/vibe-coding-guide.md +2 -2
- package/documentation-manifest.json +5 -5
- package/package.json +3 -3
package/dist/application.js
CHANGED
|
@@ -42,7 +42,7 @@ ${r}`;if(n===0){let l=e.source.replace(/\n*$/g,"");return`${l}${l.length===0?"":
|
|
|
42
42
|
`),await c.sync()}finally{await c.close()}return await Ui(`${o}.tmp`,o),await this.resymbolicate(t.releaseId),s}async resymbolicate(t){let r=await Jf(ve.join(this.releases(),t)).catch(()=>[]),n=[];for(let a of r)try{n.push(JSON.parse(await ta(ve.join(this.releases(),t,a),"utf8")))}catch{}for(let a of(await this.all()).filter(i=>i.releaseId===t&&i.state==="map-missing")){let i=!1,o=a.error.frames.map(l=>{let p=n.find(m=>new URL(l.file,"http://local").pathname.endsWith(`/${m.registration.asset}`));if(!p||l.line===void 0||l.column===void 0)return l;try{let m=Bf(new zf(p.map),{line:l.line,column:Math.max(0,l.column-1)});return m.source===null||m.line===null||m.column===null?l:(i=!0,{...l,source:m.source.replace(/^file:\/\//,""),sourceLine:m.line,sourceColumn:m.column+1})}catch{return l}});if(!i)continue;let s={...a,error:{...a.error,frames:o},state:"symbolicated"},c=ve.join(this.directory(),`${a.eventId}.json`),d=await qi(`${c}.tmp`,"w",384);try{await d.writeFile(`${E(s)}
|
|
43
43
|
`),await d.sync()}finally{await d.close()}await Ui(`${c}.tmp`,c)}}};var Ue=(e,t,r,n,a)=>({code:e,severity:t,fact:r,message:n,...a===void 0?{}:{action:a}});async function na(e){if(e.lock.capabilities.length===0||e.lock.capabilities.some(r=>r.evidenceIds.length===0))return[Ue("EVIDENCE_INVALID","critical","evidence","\u5DF2\u9A8C\u8BC1\u9501\u7F3A\u5C11\u5B8C\u6574\u8BC1\u636E\u5F15\u7528\u3002","\u91CD\u65B0\u8FD0\u884C\u9A8C\u8BC1\uFF1B\u82E5\u4E8B\u52A1\u672A\u5B8C\u6210\uFF0C\u5148\u6267\u884C\u5B89\u5168\u6062\u590D\u3002")];for(let r of e.lock.capabilities)for(let n of r.evidenceIds)try{let a=$n(JSON.parse(await Kf(Yc.join(e.projectRoot,".dyyto","evidence",`${n}.json`),"utf8")));if(a.evidenceId!==n||a.capabilityId!==r.capabilityId||a.capabilityVersion!==r.version||a.capabilityIntegrity!==r.integrity||a.projectStateDigest!==r.projectStateDigest||a.result!=="passed")return[Ue("EVIDENCE_INVALID","critical","evidence","\u91C7\u7528\u8BC1\u636E\u4E0E\u5DF2\u9A8C\u8BC1\u9501\u7684\u8EAB\u4EFD\u6216\u5DE5\u7A0B\u72B6\u6001\u4E0D\u4E00\u81F4\u3002","\u91CD\u65B0\u8FD0\u884C\u9A8C\u8BC1\uFF1B\u82E5\u73B0\u573A\u5DF2\u53D8\u5316\uFF0C\u5148\u68C0\u67E5\u5E76\u91CD\u65B0\u89C4\u5212\u3002")]}catch{return[Ue("EVIDENCE_INVALID","critical","evidence","\u91C7\u7528\u8BC1\u636E\u7F3A\u5931\u3001\u635F\u574F\u6216\u4E0D\u7B26\u5408\u5951\u7EA6\u3002","\u91CD\u65B0\u8FD0\u884C\u9A8C\u8BC1\uFF1B\u82E5\u4E8B\u52A1\u672A\u5B8C\u6210\uFF0C\u5148\u6267\u884C\u5B89\u5168\u6062\u590D\u3002")]}let t=e.lock.capabilities.reduce((r,n)=>r+n.evidenceIds.length,0);return[Ue("EVIDENCE_VALID","info","evidence",`\u5DF2\u6838\u9A8C ${e.lock.capabilities.length} \u9879\u80FD\u529B\u7684 ${t} \u6761\u91C7\u7528\u8BC1\u636E\u3002`)]}function Hc(e){return e==="adopted"?[]:e==="planned"?[Ue("ADOPTION_PLANNED","warning","lock","\u80FD\u529B\u91C7\u7528\u4ECD\u5904\u4E8E\u8BA1\u5212\u9636\u6BB5\u3002","\u5BA1\u9605\u5E76\u6279\u51C6\u7CBE\u786E Plan\u3002")]:e==="applied-unverified"?[Ue("VERIFICATION_REQUIRED","warning","evidence","\u53D8\u66F4\u5DF2\u5E94\u7528\u4F46\u5C1A\u672A\u5F62\u6210\u9A8C\u8BC1\u8BC1\u636E\u3002","\u8FD0\u884C\u9A8C\u8BC1\u5E76\u63D0\u4EA4\u91C7\u7528\u9501\u3002")]:e==="drifted"?[Ue("REPOSITORY_DRIFT","warning","repository","\u5DE5\u7A0B\u73B0\u573A\u4E0E\u5DF2\u9501\u5B9A\u4E8B\u5B9E\u4E0D\u4E00\u81F4\u3002","\u68C0\u67E5\u5DEE\u5F02\u5E76\u91CD\u65B0\u89C4\u5212\uFF0C\u5E73\u53F0\u4E0D\u4F1A\u8986\u76D6\u7528\u6237\u4FEE\u6539\u3002")]:e==="recovery-required"?[Ue("RECOVERY_REQUIRED","critical","recovery","\u68C0\u6D4B\u5230\u672A\u5B8C\u6210\u7684\u6301\u4E45\u5316\u4E8B\u52A1\u3002","\u5148\u6267\u884C\u5B89\u5168\u6062\u590D\uFF0C\u518D\u7EE7\u7EED\u5176\u4ED6\u64CD\u4F5C\u3002")]:[Ue("FACT_INVALID","critical","manifest","\u5DE5\u7A0B\u5355\u5143\u4E8B\u5B9E\u65E0\u6CD5\u5B89\u5168\u8BFB\u53D6\u3002","\u4FEE\u590D\u8BE5\u5355\u5143\u7684 Manifest \u6216\u5143\u6570\u636E\u540E\u91CD\u65B0\u8BCA\u65AD\u3002")]}async function Yf(e){try{let r=JSON.parse(await Kf(Yc.join(e.workspaceRoot,".dyyto","observability","config.json"),"utf8"));if(!Array.isArray(r.applications)||!r.applications.includes(e.applicationId))return[Ue("OBSERVABILITY_NOT_CONFIGURED","warning","repository","\u5F53\u524D Web \u5E94\u7528\u5C1A\u672A\u914D\u7F6E\u8FD0\u884C\u65F6\u9519\u8BEF\u91C7\u96C6\u3002","\u767B\u8BB0\u5E94\u7528 Origin\uFF0C\u5E76\u542F\u52A8\u672C\u5730\u91C7\u96C6\u7AEF\u3002")]}catch{return[Ue("OBSERVABILITY_NOT_CONFIGURED","warning","repository","\u5F53\u524D Web \u5E94\u7528\u5C1A\u672A\u914D\u7F6E\u8FD0\u884C\u65F6\u9519\u8BEF\u91C7\u96C6\u3002","\u767B\u8BB0\u5E94\u7528 Origin\uFF0C\u5E76\u542F\u52A8\u672C\u5730\u91C7\u96C6\u7AEF\u3002")]}await new yr(e.workspaceRoot).list({applicationId:e.applicationId});let t=(await gE(Yc.join(e.workspaceRoot,".dyyto","observability","quarantine")).catch(()=>[])).length;return t>0?[Ue("OBSERVABILITY_STORE_DAMAGED","critical","repository",`\u8FD0\u884C\u65F6\u9519\u8BEF\u672C\u5730\u5B58\u50A8\u5DF2\u9694\u79BB ${t} \u6761\u635F\u574F\u8BB0\u5F55\uFF0C\u5065\u5EB7\u4E8B\u4EF6\u4ECD\u53EF\u67E5\u8BE2\u3002`,"\u68C0\u67E5\u672C\u673A\u78C1\u76D8\u72B6\u6001\uFF0C\u5E76\u663E\u5F0F\u5904\u7406\u9694\u79BB\u8BB0\u5F55\u3002")]:[Ue("OBSERVABILITY_CONFIGURED","info","repository","\u8FD0\u884C\u65F6\u9519\u8BEF\u91C7\u96C6\u914D\u7F6E\u4E0E\u672C\u5730\u5B58\u50A8\u53EF\u8BFB\u53D6\u3002")]}function Hf(e){let t=e.units.map(n=>{let a=n.findings.some(i=>i.severity==="critical")?"blocked":n.findings.some(i=>i.severity==="warning")?"attention":"healthy";return{...n,status:a}}),r={total:t.length,healthy:t.filter(n=>n.status==="healthy").length,attention:t.filter(n=>n.status==="attention").length,blocked:t.filter(n=>n.status==="blocked").length};return{schemaVersion:1,workspace:e.workspace,generatedAt:e.generatedAt,status:r.blocked>0?"blocked":r.attention>0?"attention":"healthy",summary:r,units:t}}import{readFile as aa,realpath as Xf}from"node:fs/promises";import wr from"node:path";var ae=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Zf(e){let t=await Xf(wr.resolve(e.projectRoot)),r=W(e.manifest),n=e.release.release,a=e.currentLock.capabilities.find(m=>m.capabilityId===n.capabilityId&&m.version===n.version);if(!a||a.packageAdoption!==void 0)throw new ae("CAPABILITY_RELEASE_VERSION_UNSUPPORTED","Asset-only removal requires an adopted Capability without package ownership");let i=W({...r,capabilities:r.capabilities.filter(m=>m.capabilityId!==n.capabilityId)}),o=Buffer.from(`${JSON.stringify(i,null,2)}
|
|
44
44
|
`),s=await ia(t,"project-capabilities.json");if(!s.exists||s.digest===void 0)throw new ae("CAPABILITY_DEPENDENCY_UNSATISFIED","Project manifest is unavailable");let c=[{path:"project-capabilities.json",kind:"replace",ownership:"owned-file",baseDigest:s.digest,desiredDigest:v(o)},...a.assets.map(m=>({path:m.path,kind:"remove",ownership:m.ownership??"owned-file",baseDigest:m.digest}))],d=await Promise.all(c.map(m=>ia(t,m.path))),l={schemaVersion:1,capabilityId:n.capabilityId,version:n.version,integrity:n.integrity,assets:a.assets.map(m=>({path:m.path,ownership:m.ownership??"owned-file",desiredDigest:m.digest})),verifiers:n.verifiers.map(m=>({id:m.id,kind:"file-digest"}))};return{plan:Ne({action:"remove",capability:l,changes:c,observedAssets:d,generatedAt:e.generatedAt,expiresAt:e.expiresAt}),manifest:i,desiredContents:new Map([["project-capabilities.json",o]]),transactionRoot:t,removedSources:[]}}async function ia(e,t){try{let r=await aa(wr.join(e,...t.split("/")));return{path:t,exists:!0,digest:v(r)}}catch(r){if(r.code==="ENOENT")return{path:t,exists:!1};throw r}}async function Xc(e){if(e.release.release.schemaVersion===2&&e.release.release.packageSources.length>0&&e.packageSource===void 0)throw new ae("CAPABILITY_RELEASE_VERSION_UNSUPPORTED","Capability Release v2 requires verified package source facts");let t=await Xf(wr.resolve(e.projectRoot)),r=W(e.manifest),n=e.release.release,a=e.packageSource?.topology,i=a?.transactionRoot??t,o=k=>a?.mode==="pnpm-shared-lockfile"?`${a.unitRelativeRoot}/${k}`:k;if(n.kind!=="engineering-feature"||n.consumerProfile!=="any-project")throw new ae("CAPABILITY_KIND_UNSUPPORTED","Only an addable engineering feature can use this lifecycle");if(r.capabilities.some(k=>k.capabilityId===n.capabilityId))throw new ae("CAPABILITY_ALREADY_SELECTED","The capability is already selected by this project");let s=r.profile?.id,c=s==="typescript-library"?"blank-typescript-library":s,d=n.dependencies?.profiles??[],l=e.currentLock.capabilities.find(k=>k.consumerProfile===c);if(c===void 0||!d.includes(c)||l===void 0)throw new ae("CAPABILITY_DEPENDENCY_UNSATISFIED","The project profile does not satisfy this capability dependency");if((n.dependencies?.capabilities??[]).some(k=>!r.capabilities.some(S=>S.capabilityId===k)||!e.currentLock.capabilities.some(S=>S.capabilityId===k)))throw new ae("CAPABILITY_DEPENDENCY_UNSATISFIED","A required project capability is not adopted and verified");let m=W({...r,capabilities:[...r.capabilities,{capabilityId:n.capabilityId,version:n.version}]}),u=o("project-capabilities.json"),f=Buffer.from(`${JSON.stringify(m,null,2)}
|
|
45
|
-
`),g=await ia(i,u);if(!g.exists||g.digest===void 0)throw new ae("CAPABILITY_DEPENDENCY_UNSATISFIED","The project manifest is unavailable");let h=[{path:u,kind:"replace",ownership:"owned-file",baseDigest:g.digest,desiredDigest:v(f)}],w=new Map([[u,f]]),_;if(n.schemaVersion===2&&n.packageSources.length>0){if(e.packageSource===void 0)throw new ae("CAPABILITY_RELEASE_VERSION_UNSUPPORTED","Capability Release v2 requires verified package source facts");let k;try{k=await aa(wr.join(t,"package.json"))}catch{throw new ae("CAPABILITY_PACKAGE_SOURCE_INVALID","\u9879\u76EE package.json \u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u751F\u6210\u5305\u91C7\u7528\u8BA1\u5212")}try{let S=e.packageSource.currentLockfile??await aa(wr.join(t,"pnpm-lock.yaml")).catch(re=>re.code==="ENOENT"?void 0:Promise.reject(re)),O=e.packageSource.topology??{schemaVersion:1,mode:"standalone",transactionRoot:t,unitRoot:t,unitRelativeRoot:".",unitImporterId:".",lockfilePath:"pnpm-lock.yaml"},ie=O.mode==="pnpm-shared-lockfile",$={mode:O.mode,unitRelativeRoot:O.unitRelativeRoot,unitImporterId:O.unitImporterId,lockfilePath:O.lockfilePath,...O.workspaceManifestPath?{workspaceManifestPath:O.workspaceManifestPath,workspaceManifestDigest:O.workspaceManifestDigest}:{}},P={registryConfigs:e.packageSource.registryConfigs,endpointBindings:e.packageSource.endpointBindings,receipts:e.packageSource.receipts,inspections:e.packageSource.inspections};if(ie&&(!e.packageSource.resolutionEvidence||!e.packageSource.resolutionWorkerReleaseId))throw new Y("PACKAGE_SOURCE_POLICY_VIOLATION");let K=ie?(e.packageChannel==="development"?Di:Ni)({release:n,...P,consumerProfile:c,packageJson:k,currentLockfile:S,generatedAt:e.generatedAt,expiresAt:e.expiresAt,topology:$,preservedImporterDigests:e.packageSource.preservedImporterDigests??[],resolutionEvidence:e.packageSource.resolutionEvidence,resolutionWorkerReleaseId:e.packageSource.resolutionWorkerReleaseId}):(e.packageChannel==="development"?Pi:Ri)({release:n,...P,lockResolution:e.packageSource.lockResolution,consumerProfile:c,packageJson:k,...S===void 0?{}:{currentLockfile:S},generatedAt:e.generatedAt,expiresAt:e.expiresAt});_=_i(K),h.push({path:o("package.json"),kind:"replace",ownership:"owned-file",baseDigest:K.packageJsonPreimageDigest,desiredDigest:K.desiredPackageJsonDigest}),w.set(o("package.json"),K.desiredPackageJson),h.push({path:O.lockfilePath,kind:S===void 0?"create":"replace",ownership:"owned-file",...S===void 0?{}:{baseDigest:v(S)},desiredDigest:K.desiredLockfileDigest}),w.set(O.lockfilePath,K.desiredLockfile)}catch(S){throw S instanceof Y?new ae("CAPABILITY_PACKAGE_SOURCE_INVALID",S.code):S}}for(let k of n.assets){let S=e.release.contents.get(k.path);if(S===void 0)throw new ae("CAPABILITY_KIND_UNSUPPORTED","Capability asset content is unavailable");let O=k.renderer==="application-config-contract-v1"?Si(r):k.renderer==="application-config-binding-v1"?ji(r):S;if(k.ownership==="managed-region"){if(k.regionId===void 0)throw new ae("CAPABILITY_KIND_UNSUPPORTED","Managed region identity is unavailable");let ie;try{ie=await aa(wr.join(t,...k.path.split("/")))}catch{throw new ae("CAPABILITY_DEPENDENCY_UNSATISFIED","The managed shared file is unavailable")}let $=Buffer.from(hu({source:ie.toString("utf8"),regionId:k.regionId,content:Buffer.from(O).toString("utf8")}));h.push({path:o(k.path),kind:"merge",ownership:"managed-region",regionId:k.regionId,baseDigest:v(ie),desiredDigest:v($)}),w.set(o(k.path),$)}else{let ie=await ia(t,k.path);if(k.ownership==="seed-file"&&ie.exists){let $=await aa(wr.join(t,...k.path.split("/")));h.push({path:o(k.path),kind:"create",ownership:"seed-file",desiredDigest:v($)}),w.set(o(k.path),$)}else h.push({path:o(k.path),kind:"create",ownership:k.ownership,desiredDigest:v(O)}),w.set(o(k.path),O)}}let b=await Promise.all(h.map(k=>ia(i,k.path))),A={schemaVersion:1,capabilityId:n.capabilityId,version:n.version,integrity:n.integrity,assets:h.filter(k=>k.path!==u&&k.path!==a?.lockfilePath).map(k=>({path:a?.mode==="pnpm-shared-lockfile"?k.path.slice(a.unitRelativeRoot.length+1):k.path,ownership:k.ownership,desiredDigest:k.desiredDigest})),verifiers:n.verifiers.map(k=>({id:k.id,kind:"file-digest"}))};return{plan:Ne({action:"adopt",capability:A,changes:h,observedAssets:b,generatedAt:e.generatedAt,expiresAt:e.expiresAt,..._===void 0?{}:{packageAdoption:_}}),manifest:m,desiredContents:w,transactionRoot:i,dependency:{profile:c,satisfied:!0}}}var Qf=Ir(rr(),1);var hE={$id:"https://schemas.dyyto.dev/platform/solution-catalog-entry-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","solutionId","version","integrity","title","summary","maturity","members","integration","exit"],properties:{schemaVersion:{const:1},solutionId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:dt},title:{type:"string",minLength:1,maxLength:80},summary:{type:"string",minLength:1,maxLength:240},maturity:{enum:["guided","automated"]},members:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["capabilityId","version","role","required"],properties:{capabilityId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128},role:{type:"string",minLength:1,maxLength:80},required:{type:"boolean"}}}},integration:{type:"object",additionalProperties:!1,required:["prerequisites","steps","verification","result"],properties:{prerequisites:{type:"array",minItems:1,maxItems:16,items:{type:"string",minLength:1,maxLength:200}},steps:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["label","command"],properties:{label:{type:"string",minLength:1,maxLength:80},command:{type:"string",minLength:1,maxLength:2e3}}}},verification:{type:"array",minItems:1,maxItems:32,items:{type:"string",minLength:1,maxLength:1e3}},result:{type:"string",minLength:1,maxLength:400}}},exit:{type:"object",additionalProperties:!1,required:["summary"],properties:{summary:{type:"string",minLength:1,maxLength:400}}}}},eD=new Qf.Ajv2020({allErrors:!0,strict:!0}).compile(hE);var am=Ir(rr(),1);import{readFile as yE,realpath as wE}from"node:fs/promises";import em from"node:path";var tm="^[a-z0-9]+(?:[.-][a-z0-9]+)*$",rm="^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[^\\u0000]+$",vE={$id:"https://schemas.dyyto.dev/platform/example-recipe-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","recipeId","version","integrity","title","locale","rootProfile","capabilities","expectedEntrypoint","verifiers","manualAcceptance","cleanup"],properties:{schemaVersion:{const:1},recipeId:{type:"string",pattern:tm},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:dt},title:{type:"string",minLength:1,maxLength:80},locale:{const:"zh-CN"},rootProfile:{type:"object",additionalProperties:!1,required:["capabilityId","version"],properties:{capabilityId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128}}},capabilities:{type:"array",minItems:1,maxItems:16,items:{type:"object",additionalProperties:!1,required:["capabilityId","version","channel"],properties:{capabilityId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128},channel:{const:"development"}}}},expectedEntrypoint:{type:"string",pattern:rm,maxLength:240},verifiers:{type:"array",minItems:1,maxItems:16,uniqueItems:!0,items:{type:"string",pattern:tm}},manualAcceptance:{type:"array",minItems:1,maxItems:32,items:{type:"string",minLength:1,maxLength:240}},cleanup:{type:"object",additionalProperties:!1,required:["ownedStateDirectories"],properties:{ownedStateDirectories:{type:"array",maxItems:8,uniqueItems:!0,items:{type:"string",pattern:rm,maxLength:240}}}}}},nm=new am.Ajv2020({allErrors:!0,strict:!0}).compile(vE),vr=class extends Error{code;issues;constructor(t,r=[]){super(t),this.code=t,this.issues=r}};function IE(e){return v(E(e))}function bE(e){if(!nm(e))throw new vr("EXAMPLE_RECIPE_INVALID",nm.errors??[]);let t=e,r=[t.rootProfile.capabilityId,...t.capabilities.map(n=>n.capabilityId)];if(new Set(r).size!==r.length||t.capabilities.some(n=>n.version.includes("workspace:")||n.capabilityId.includes("ai-education-poc")))throw new vr("EXAMPLE_RECIPE_INVALID");return t}async function im(e){let t=await wE(em.resolve(e)),r;try{r=bE(JSON.parse(await yE(em.join(t,"recipe.json"),"utf8")))}catch(i){throw i instanceof vr?i:new vr("EXAMPLE_RECIPE_INVALID")}let{integrity:n,...a}=r;if(IE(a)!==n)throw new vr("EXAMPLE_RECIPE_INTEGRITY_MISMATCH");return r}var cm=Ir(rr(),1);import{readFile as kE,realpath as _E}from"node:fs/promises";import om from"node:path";var EE={$id:"https://schemas.dyyto.dev/platform/engineering-template-release-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","templateId","version","integrity","title","summary","status","profile","parameters","commands","technology","support","integration","metrics"],properties:{schemaVersion:{const:1},templateId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:dt},title:{type:"string",minLength:1,maxLength:80},summary:{type:"string",minLength:1,maxLength:240},status:{enum:["candidate","recommended","deprecated"]},profile:{type:"object",additionalProperties:!1,required:["id","capability"],properties:{id:{type:"string",pattern:H},capability:{type:"string",pattern:`${H.slice(1,-1)}@[0-9]+\\.[0-9]+\\.[0-9]+$`}}},parameters:{type:"array",minItems:0,maxItems:32,items:{type:"object",additionalProperties:!1,required:["id","required","description"],properties:{id:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$"},required:{type:"boolean"},description:{type:"string",minLength:1,maxLength:160}}}},commands:{type:"object",minProperties:1,additionalProperties:!1,properties:{dev:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},build:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},test:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},package:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"}}},technology:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["id","version","policy","verifiedAt","rationale","alternative","exit"],properties:{id:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:64},policy:{enum:["recommended","allowed"]},verifiedAt:{type:"string",format:"date"},rationale:{type:"string",minLength:1,maxLength:240},alternative:{type:"string",minLength:1,maxLength:160},exit:{type:"string",minLength:1,maxLength:240}}}},support:{type:"object",additionalProperties:!1,required:["owner","tier","supportedFrom","supportedUntil","upgradeCadence","eolNoticeDays"],properties:{owner:{type:"string",pattern:H},tier:{const:"production"},supportedFrom:{type:"string",format:"date"},supportedUntil:{type:"string",format:"date"},upgradeCadence:{type:"string",minLength:1,maxLength:80},eolNoticeDays:{type:"integer",minimum:30,maximum:730}}},integration:{type:"object",additionalProperties:!1,required:["prerequisites","createCommand","result"],properties:{prerequisites:{type:"array",minItems:1,maxItems:16,items:{type:"string",minLength:1,maxLength:200}},createCommand:{type:"string",minLength:1,maxLength:2e3},result:{type:"string",minLength:1,maxLength:400}}},metrics:{type:"array",minItems:1,uniqueItems:!0,items:{enum:["time-to-green-build","time-to-first-business-commit","manual-engineering-edits","upgrade-conflicts"]}}}},sm=new cm.Ajv2020({allErrors:!0,strict:!0,formats:{date:/^\d{4}-\d{2}-\d{2}$/}}).compile(EE),At=class extends Error{code;issues;constructor(t,r=[]){super(t),this.code=t,this.issues=r}};function AE(e){return v(E(e))}function RE(e){if(!sm(e))throw new At("TEMPLATE_INVALID",sm.errors??[]);let t=e;if(new Set(t.parameters.map(r=>r.id)).size!==t.parameters.length||new Set(t.technology.map(r=>r.id)).size!==t.technology.length)throw new At("TEMPLATE_INVALID");if(Date.parse(t.support.supportedUntil)<=Date.parse(t.support.supportedFrom))throw new At("TEMPLATE_INVALID");return t}async function oa(e,t=new Date){let r=await _E(om.resolve(e)),n;try{n=RE(JSON.parse(await kE(om.join(r,"template.json"),"utf8")))}catch(o){throw o instanceof At?o:new At("TEMPLATE_INVALID")}let{integrity:a,...i}=n;if(AE(i)!==a)throw new At("TEMPLATE_INTEGRITY_MISMATCH");if(n.status==="recommended"&&Date.parse(n.support.supportedUntil)<t.getTime())throw new At("TEMPLATE_SUPPORT_EXPIRED");return n}import{readFile as lm}from"node:fs/promises";import dm from"node:path";var PE=/^[A-Z][A-Z0-9_]*$/u,NE=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|PASSWORD|PRIVATE_KEY|DATABASE_URL|POSTGRES_URL)$/u;function DE(e){let t=new Map;for(let r of e.split(/\r?\n/u)){let n=/^([A-Z][A-Z0-9_]*)=(.*)$/u.exec(r.trim());if(!n||!PE.test(n[1]))continue;let a=n[1],i=n[2].trim();t.set(a,{name:a,requirement:i.length===0?"conditional":"optional",secret:NE.test(a),configured:!1,source:".env.example",configuredSource:null})}return[...t.values()]}async function pm(e){let t=await lm(dm.join(e.projectRoot,".env.example"),"utf8").then(()=>".env.example").catch(()=>null),r=t?await lm(dm.join(e.projectRoot,t),"utf8"):"",n=await $i({projectRoot:e.projectRoot}).catch(()=>null);return{commands:["dev","build","test","package"].flatMap(i=>e.commands[i]?[{id:i,script:e.commands[i],mode:i==="dev"?"managed-process":"foreground-task"}]:[]),environment:n?n.entries.map(i=>({name:i.name,requirement:i.required?"conditional":"optional",secret:i.kind!=="value",configured:i.configured,source:"application-config-contract",configuredSource:"APP_CONFIG_DIR",display:i.display,...i.fingerprint?{fingerprint:i.fingerprint}:{}})):DE(r),environmentExample:t,productionValidation:{contract:!0,live:["provider-read","oss-write-read-delete"]}}}var um={change:new Set(["plan","apply","upgrade","recover","baseline-next","add-package","add-application","add-feature"]),quality:new Set(["inspect","verify","doctor","maintenance","test","build"]),delivery:new Set(["package","delivery-plan","delivery-apply","delivery-inspect"])},fm=new Set(["queued","running","succeeded","failed","outcome-unknown","cancelled"]);function mm(e,t){if(!um[t.plane]||t.state&&!fm.has(t.state)||t.limit!==void 0&&(!Number.isSafeInteger(t.limit)||t.limit<1||t.limit>200))throw new Error("OPERATION_FILTER_INVALID");let r=um[t.plane],n=t.from?Date.parse(t.from):null,a=t.to?Date.parse(t.to):null;if(n!==null&&Number.isNaN(n)||a!==null&&Number.isNaN(a)||n!==null&&a!==null&&n>a)throw new Error("OPERATION_FILTER_INVALID");let i=e.filter(d=>r.has(d.operation)),o=[...new Map(i.map(d=>[d.projectId,{id:d.projectId,name:d.projectName}])).values()].sort((d,l)=>d.name.localeCompare(l.name)),s=i.filter(d=>(!t.projectId||d.projectId===t.projectId)&&(!t.state||d.state===t.state)&&(!t.kind||d.operation===t.kind)&&(n===null||Date.parse(d.createdAt)>=n)&&(a===null||Date.parse(d.createdAt)<=a)).sort((d,l)=>l.updatedAt.localeCompare(d.updatedAt)),c={total:s.length,running:s.filter(d=>d.state==="running"||d.state==="queued").length,succeeded:s.filter(d=>d.state==="succeeded").length,attention:s.filter(d=>d.state==="failed"||d.state==="outcome-unknown").length};return Object.freeze({schemaVersion:1,plane:t.plane,summary:Object.freeze(c),facets:Object.freeze({projects:Object.freeze(o),states:Object.freeze([...fm]),kinds:Object.freeze([...r])}),items:Object.freeze(s.slice(0,t.limit??50).map(Object.freeze)),hasMore:s.length>(t.limit??50)})}var sa=class extends Error{code;constructor(t,r){super(r),this.code=t}},Qc=/^sha256:[a-f0-9]{64}$/u,SE=/^sha512-[A-Za-z0-9+/]{86}==$/u,jE=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u,$E=/^(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?$/u,OE=/[\u0000-\u001f\u007f]/u;function Xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function Zr(e,t){let r=Object.keys(e).sort(),n=[...t].sort();return r.length===n.length&&r.every((a,i)=>a===n[i])}function Rt(e,t=500){return typeof e=="string"&&e.length>0&&e.length<=t&&!OE.test(e)}function Zc(e){return Rt(e,500)&&!e.startsWith("/")&&!e.startsWith("../")&&!e.includes("/../")&&!e.includes("\\")}function gm(e,t=128){return Array.isArray(e)&&e.length<=t&&e.every(r=>Rt(r,500))&&e.every((r,n)=>n===0||e[n-1]<r)}function CE(e){return e===null?!0:!Xr(e)||!Zr(e,["fileName","digest","integrity","fileCount","unpackedBytes"])?!1:Zc(e.fileName)&&Qc.test(String(e.digest))&&SE.test(String(e.integrity))&&Number.isSafeInteger(e.fileCount)&&Number(e.fileCount)>0&&Number.isSafeInteger(e.unpackedBytes)&&Number(e.unpackedBytes)>0}function TE(e){if(!Xr(e)||!Zr(e,["schemaVersion","kind","packageName","version","title","summary","maturity","source","artifact","compatibility","exports","documentation","consumerEvidence"])||e.schemaVersion!==1||e.kind!=="PackageRelease"||!jE.test(e.packageName)||!$E.test(e.version)||!Rt(e.title,120)||!Rt(e.summary,1e3)||!["candidate","stable","deprecated"].includes(e.maturity)||!Xr(e.source)||!Zr(e.source,["repository","path","revision","treeDigest"])||!Rt(e.source.repository)||!Zc(e.source.path)||!Rt(e.source.revision,200)||!Qc.test(String(e.source.treeDigest))||!CE(e.artifact)||!Xr(e.compatibility)||!Zr(e.compatibility,["node","packageManager"])||!Rt(e.compatibility.node,100)||!Rt(e.compatibility.packageManager,100)||!gm(e.exports)||!gm(e.consumerEvidence)||!Xr(e.documentation))return!1;let t=e.documentation.knowledgeRef===void 0?["readme"]:["readme","knowledgeRef"];return!Zr(e.documentation,t)||!Zc(e.documentation.readme)||e.documentation.knowledgeRef!==void 0&&!Rt(e.documentation.knowledgeRef,500)?!1:e.artifact!==null||e.maturity!=="stable"}function xE(e){let t={schemaVersion:1,kind:"PackageRelease",...e,source:Object.freeze({...e.source}),artifact:e.artifact===null?null:Object.freeze({...e.artifact}),compatibility:Object.freeze({...e.compatibility}),exports:Object.freeze([...e.exports]),documentation:Object.freeze({...e.documentation}),consumerEvidence:Object.freeze([...e.consumerEvidence])};if(!TE(t))throw new sa("PACKAGE_RELEASE_INVALID","PackageRelease \u5185\u5BB9\u65E0\u6548");return Object.freeze({...t,releaseDigest:v(E(t))})}function hm(e){if(!Xr(e)||!Zr(e,["schemaVersion","kind","packageName","version","title","summary","maturity","source","artifact","compatibility","exports","documentation","consumerEvidence","releaseDigest"])||!Qc.test(String(e.releaseDigest)))throw new sa("PACKAGE_RELEASE_INVALID","PackageRelease \u7ED3\u6784\u65E0\u6548");let{releaseDigest:t,schemaVersion:r,kind:n,...a}=e,i=xE(a);if(i.releaseDigest!==t)throw new sa("PACKAGE_RELEASE_MODIFIED","PackageRelease \u5DF2\u88AB\u4FEE\u6539");return i}import{lstat as LE,readFile as VE,realpath as ME}from"node:fs/promises";import ym from"node:path";async function wm(e){let t=await ME(ym.resolve(e.projectRoot)),r=new Set(e.excludeCapabilityIds??[]),n=new Map,a=[...e.lock.capabilities].sort((o,s)=>o.committedAt.localeCompare(s.committedAt)||o.capabilityId.localeCompare(s.capabilityId));for(let o of a)if(!r.has(o.capabilityId))for(let s of o.assets){let c=s.ownership??"owned-file",d=`${s.path}\0`;if(c==="managed-region")n.delete(d);else for(let p of n.keys())p.startsWith(d)&&n.delete(p);let l=c==="managed-region"?`${d}${s.regionId??""}`:d;n.set(l,{capabilityId:o.capabilityId,path:s.path,digest:s.digest,ownership:c,...s.regionId===void 0?{}:{regionId:s.regionId}})}let i=[];for(let o of[...n.values()].sort((s,c)=>s.path.localeCompare(c.path)||(s.regionId??"").localeCompare(c.regionId??"")||s.capabilityId.localeCompare(c.capabilityId))){let s=ym.join(t,...o.path.split("/")),d=await LE(s).then(async l=>{if(!l.isFile()||l.isSymbolicLink())return;let p=await VE(s);if(o.ownership!=="managed-region")return v(p);if(o.regionId!==void 0)try{return v(Xa(p.toString("utf8"),o.regionId))}catch{return}}).catch(l=>l.code==="ENOENT"?void 0:Promise.reject(l))===o.digest;i.push({capabilityId:o.capabilityId,path:o.path,kind:"create",ownership:o.ownership,...o.regionId===void 0?{}:{regionId:o.regionId},desiredDigest:o.digest,disposition:d?"noop":"conflict",...d?{}:{conflictCode:"BASE_DIGEST_MISMATCH"}})}return i}var el="0.1.24",ca={DEPENDENCIES_NOT_INSTALLED:4,VERIFIER_RUNTIME_INVALID:4},qE=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/u;function vm(e,t){return typeof e=="string"&&e.length>0&&e.length<=t&&!qE.test(e)}function UE(e){let t={schemaVersion:1,kind:"dyyto-cli-domain-error",code:e.code,message:e.message,exitCode:ca[e.code],...e.nextStep===void 0?{}:{nextStep:e.nextStep}},r=FE(t);if(r===null)throw new TypeError("CLI domain error input is invalid");return r}function FE(e){try{if(typeof e!="object"||e===null||Object.getPrototypeOf(e)!==Object.prototype)return null;let t=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(t).some(s=>typeof s=="symbol"))return null;let r=Object.keys(t).sort(),n="nextStep"in t?["code","exitCode","kind","message","nextStep","schemaVersion"]:["code","exitCode","kind","message","schemaVersion"];if(r.length!==n.length||r.some((s,c)=>s!==n[c])||Object.values(t).some(s=>!("value"in s)))return null;let a=s=>t[s]?.value,i=a("code");if(a("schemaVersion")!==1||a("kind")!=="dyyto-cli-domain-error"||typeof i!="string"||!(i in ca)||a("exitCode")!==ca[i]||!vm(a("message"),500))return null;let o=a("nextStep");return o!==void 0&&!vm(o,500)?null:Object.freeze({schemaVersion:1,kind:"dyyto-cli-domain-error",code:i,message:a("message"),exitCode:4,...o===void 0?{}:{nextStep:o}})}catch{return null}}var Ce=class extends Error{code;exitCode;nextStep;domainError;constructor(t){super(t.message),this.name="CliError",this.code=t.code,this.exitCode=t.exitCode,this.nextStep=t.nextStep,this.domainError=t.code in ca&&t.exitCode===ca[t.code]?UE({code:t.code,message:t.message,...t.nextStep===void 0?{}:{nextStep:t.nextStep}}):void 0}};var Im=`Dyyto Engineering Platform CLI
|
|
45
|
+
`),g=await ia(i,u);if(!g.exists||g.digest===void 0)throw new ae("CAPABILITY_DEPENDENCY_UNSATISFIED","The project manifest is unavailable");let h=[{path:u,kind:"replace",ownership:"owned-file",baseDigest:g.digest,desiredDigest:v(f)}],w=new Map([[u,f]]),_;if(n.schemaVersion===2&&n.packageSources.length>0){if(e.packageSource===void 0)throw new ae("CAPABILITY_RELEASE_VERSION_UNSUPPORTED","Capability Release v2 requires verified package source facts");let k;try{k=await aa(wr.join(t,"package.json"))}catch{throw new ae("CAPABILITY_PACKAGE_SOURCE_INVALID","\u9879\u76EE package.json \u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u751F\u6210\u5305\u91C7\u7528\u8BA1\u5212")}try{let S=e.packageSource.currentLockfile??await aa(wr.join(t,"pnpm-lock.yaml")).catch(re=>re.code==="ENOENT"?void 0:Promise.reject(re)),O=e.packageSource.topology??{schemaVersion:1,mode:"standalone",transactionRoot:t,unitRoot:t,unitRelativeRoot:".",unitImporterId:".",lockfilePath:"pnpm-lock.yaml"},ie=O.mode==="pnpm-shared-lockfile",$={mode:O.mode,unitRelativeRoot:O.unitRelativeRoot,unitImporterId:O.unitImporterId,lockfilePath:O.lockfilePath,...O.workspaceManifestPath?{workspaceManifestPath:O.workspaceManifestPath,workspaceManifestDigest:O.workspaceManifestDigest}:{}},P={registryConfigs:e.packageSource.registryConfigs,endpointBindings:e.packageSource.endpointBindings,receipts:e.packageSource.receipts,inspections:e.packageSource.inspections};if(ie&&(!e.packageSource.resolutionEvidence||!e.packageSource.resolutionWorkerReleaseId))throw new Y("PACKAGE_SOURCE_POLICY_VIOLATION");let K=ie?(e.packageChannel==="development"?Di:Ni)({release:n,...P,consumerProfile:c,packageJson:k,currentLockfile:S,generatedAt:e.generatedAt,expiresAt:e.expiresAt,topology:$,preservedImporterDigests:e.packageSource.preservedImporterDigests??[],resolutionEvidence:e.packageSource.resolutionEvidence,resolutionWorkerReleaseId:e.packageSource.resolutionWorkerReleaseId}):(e.packageChannel==="development"?Pi:Ri)({release:n,...P,lockResolution:e.packageSource.lockResolution,consumerProfile:c,packageJson:k,...S===void 0?{}:{currentLockfile:S},generatedAt:e.generatedAt,expiresAt:e.expiresAt});_=_i(K),h.push({path:o("package.json"),kind:"replace",ownership:"owned-file",baseDigest:K.packageJsonPreimageDigest,desiredDigest:K.desiredPackageJsonDigest}),w.set(o("package.json"),K.desiredPackageJson),h.push({path:O.lockfilePath,kind:S===void 0?"create":"replace",ownership:"owned-file",...S===void 0?{}:{baseDigest:v(S)},desiredDigest:K.desiredLockfileDigest}),w.set(O.lockfilePath,K.desiredLockfile)}catch(S){throw S instanceof Y?new ae("CAPABILITY_PACKAGE_SOURCE_INVALID",S.code):S}}for(let k of n.assets){let S=e.release.contents.get(k.path);if(S===void 0)throw new ae("CAPABILITY_KIND_UNSUPPORTED","Capability asset content is unavailable");let O=k.renderer==="application-config-contract-v1"?Si(r):k.renderer==="application-config-binding-v1"?ji(r):S;if(k.ownership==="managed-region"){if(k.regionId===void 0)throw new ae("CAPABILITY_KIND_UNSUPPORTED","Managed region identity is unavailable");let ie;try{ie=await aa(wr.join(t,...k.path.split("/")))}catch{throw new ae("CAPABILITY_DEPENDENCY_UNSATISFIED","The managed shared file is unavailable")}let $=Buffer.from(hu({source:ie.toString("utf8"),regionId:k.regionId,content:Buffer.from(O).toString("utf8")}));h.push({path:o(k.path),kind:"merge",ownership:"managed-region",regionId:k.regionId,baseDigest:v(ie),desiredDigest:v($)}),w.set(o(k.path),$)}else{let ie=await ia(t,k.path);if(k.ownership==="seed-file"&&ie.exists){let $=await aa(wr.join(t,...k.path.split("/")));h.push({path:o(k.path),kind:"create",ownership:"seed-file",desiredDigest:v($)}),w.set(o(k.path),$)}else h.push({path:o(k.path),kind:"create",ownership:k.ownership,desiredDigest:v(O)}),w.set(o(k.path),O)}}let b=await Promise.all(h.map(k=>ia(i,k.path))),A={schemaVersion:1,capabilityId:n.capabilityId,version:n.version,integrity:n.integrity,assets:h.filter(k=>k.path!==u&&k.path!==a?.lockfilePath).map(k=>({path:a?.mode==="pnpm-shared-lockfile"?k.path.slice(a.unitRelativeRoot.length+1):k.path,ownership:k.ownership,desiredDigest:k.desiredDigest})),verifiers:n.verifiers.map(k=>({id:k.id,kind:"file-digest"}))};return{plan:Ne({action:"adopt",capability:A,changes:h,observedAssets:b,generatedAt:e.generatedAt,expiresAt:e.expiresAt,..._===void 0?{}:{packageAdoption:_}}),manifest:m,desiredContents:w,transactionRoot:i,dependency:{profile:c,satisfied:!0}}}var Qf=Ir(rr(),1);var hE={$id:"https://schemas.dyyto.dev/platform/solution-catalog-entry-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","solutionId","version","integrity","title","summary","maturity","members","integration","exit"],properties:{schemaVersion:{const:1},solutionId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:dt},title:{type:"string",minLength:1,maxLength:80},summary:{type:"string",minLength:1,maxLength:240},maturity:{enum:["guided","automated"]},members:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["capabilityId","version","role","required"],properties:{capabilityId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128},role:{type:"string",minLength:1,maxLength:80},required:{type:"boolean"}}}},integration:{type:"object",additionalProperties:!1,required:["prerequisites","steps","verification","result"],properties:{prerequisites:{type:"array",minItems:1,maxItems:16,items:{type:"string",minLength:1,maxLength:200}},steps:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["label","command"],properties:{label:{type:"string",minLength:1,maxLength:80},command:{type:"string",minLength:1,maxLength:2e3}}}},verification:{type:"array",minItems:1,maxItems:32,items:{type:"string",minLength:1,maxLength:1e3}},result:{type:"string",minLength:1,maxLength:400}}},exit:{type:"object",additionalProperties:!1,required:["summary"],properties:{summary:{type:"string",minLength:1,maxLength:400}}}}},eD=new Qf.Ajv2020({allErrors:!0,strict:!0}).compile(hE);var am=Ir(rr(),1);import{readFile as yE,realpath as wE}from"node:fs/promises";import em from"node:path";var tm="^[a-z0-9]+(?:[.-][a-z0-9]+)*$",rm="^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[^\\u0000]+$",vE={$id:"https://schemas.dyyto.dev/platform/example-recipe-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","recipeId","version","integrity","title","locale","rootProfile","capabilities","expectedEntrypoint","verifiers","manualAcceptance","cleanup"],properties:{schemaVersion:{const:1},recipeId:{type:"string",pattern:tm},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:dt},title:{type:"string",minLength:1,maxLength:80},locale:{const:"zh-CN"},rootProfile:{type:"object",additionalProperties:!1,required:["capabilityId","version"],properties:{capabilityId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128}}},capabilities:{type:"array",minItems:1,maxItems:16,items:{type:"object",additionalProperties:!1,required:["capabilityId","version","channel"],properties:{capabilityId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128},channel:{const:"development"}}}},expectedEntrypoint:{type:"string",pattern:rm,maxLength:240},verifiers:{type:"array",minItems:1,maxItems:16,uniqueItems:!0,items:{type:"string",pattern:tm}},manualAcceptance:{type:"array",minItems:1,maxItems:32,items:{type:"string",minLength:1,maxLength:240}},cleanup:{type:"object",additionalProperties:!1,required:["ownedStateDirectories"],properties:{ownedStateDirectories:{type:"array",maxItems:8,uniqueItems:!0,items:{type:"string",pattern:rm,maxLength:240}}}}}},nm=new am.Ajv2020({allErrors:!0,strict:!0}).compile(vE),vr=class extends Error{code;issues;constructor(t,r=[]){super(t),this.code=t,this.issues=r}};function IE(e){return v(E(e))}function bE(e){if(!nm(e))throw new vr("EXAMPLE_RECIPE_INVALID",nm.errors??[]);let t=e,r=[t.rootProfile.capabilityId,...t.capabilities.map(n=>n.capabilityId)];if(new Set(r).size!==r.length||t.capabilities.some(n=>n.version.includes("workspace:")||n.capabilityId.includes("ai-education-poc")))throw new vr("EXAMPLE_RECIPE_INVALID");return t}async function im(e){let t=await wE(em.resolve(e)),r;try{r=bE(JSON.parse(await yE(em.join(t,"recipe.json"),"utf8")))}catch(i){throw i instanceof vr?i:new vr("EXAMPLE_RECIPE_INVALID")}let{integrity:n,...a}=r;if(IE(a)!==n)throw new vr("EXAMPLE_RECIPE_INTEGRITY_MISMATCH");return r}var cm=Ir(rr(),1);import{readFile as kE,realpath as _E}from"node:fs/promises";import om from"node:path";var EE={$id:"https://schemas.dyyto.dev/platform/engineering-template-release-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","templateId","version","integrity","title","summary","status","profile","parameters","commands","technology","support","integration","metrics"],properties:{schemaVersion:{const:1},templateId:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:dt},title:{type:"string",minLength:1,maxLength:80},summary:{type:"string",minLength:1,maxLength:240},status:{enum:["candidate","recommended","deprecated"]},profile:{type:"object",additionalProperties:!1,required:["id","capability"],properties:{id:{type:"string",pattern:H},capability:{type:"string",pattern:`${H.slice(1,-1)}@[0-9]+\\.[0-9]+\\.[0-9]+$`}}},parameters:{type:"array",minItems:0,maxItems:32,items:{type:"object",additionalProperties:!1,required:["id","required","description"],properties:{id:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$"},required:{type:"boolean"},description:{type:"string",minLength:1,maxLength:160}}}},commands:{type:"object",minProperties:1,additionalProperties:!1,properties:{dev:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},build:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},test:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},package:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"}}},technology:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["id","version","policy","verifiedAt","rationale","alternative","exit"],properties:{id:{type:"string",pattern:H},version:{type:"string",minLength:1,maxLength:64},policy:{enum:["recommended","allowed"]},verifiedAt:{type:"string",format:"date"},rationale:{type:"string",minLength:1,maxLength:240},alternative:{type:"string",minLength:1,maxLength:160},exit:{type:"string",minLength:1,maxLength:240}}}},support:{type:"object",additionalProperties:!1,required:["owner","tier","supportedFrom","supportedUntil","upgradeCadence","eolNoticeDays"],properties:{owner:{type:"string",pattern:H},tier:{const:"production"},supportedFrom:{type:"string",format:"date"},supportedUntil:{type:"string",format:"date"},upgradeCadence:{type:"string",minLength:1,maxLength:80},eolNoticeDays:{type:"integer",minimum:30,maximum:730}}},integration:{type:"object",additionalProperties:!1,required:["prerequisites","createCommand","result"],properties:{prerequisites:{type:"array",minItems:1,maxItems:16,items:{type:"string",minLength:1,maxLength:200}},createCommand:{type:"string",minLength:1,maxLength:2e3},result:{type:"string",minLength:1,maxLength:400}}},metrics:{type:"array",minItems:1,uniqueItems:!0,items:{enum:["time-to-green-build","time-to-first-business-commit","manual-engineering-edits","upgrade-conflicts"]}}}},sm=new cm.Ajv2020({allErrors:!0,strict:!0,formats:{date:/^\d{4}-\d{2}-\d{2}$/}}).compile(EE),At=class extends Error{code;issues;constructor(t,r=[]){super(t),this.code=t,this.issues=r}};function AE(e){return v(E(e))}function RE(e){if(!sm(e))throw new At("TEMPLATE_INVALID",sm.errors??[]);let t=e;if(new Set(t.parameters.map(r=>r.id)).size!==t.parameters.length||new Set(t.technology.map(r=>r.id)).size!==t.technology.length)throw new At("TEMPLATE_INVALID");if(Date.parse(t.support.supportedUntil)<=Date.parse(t.support.supportedFrom))throw new At("TEMPLATE_INVALID");return t}async function oa(e,t=new Date){let r=await _E(om.resolve(e)),n;try{n=RE(JSON.parse(await kE(om.join(r,"template.json"),"utf8")))}catch(o){throw o instanceof At?o:new At("TEMPLATE_INVALID")}let{integrity:a,...i}=n;if(AE(i)!==a)throw new At("TEMPLATE_INTEGRITY_MISMATCH");if(n.status==="recommended"&&Date.parse(n.support.supportedUntil)<t.getTime())throw new At("TEMPLATE_SUPPORT_EXPIRED");return n}import{readFile as lm}from"node:fs/promises";import dm from"node:path";var PE=/^[A-Z][A-Z0-9_]*$/u,NE=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|PASSWORD|PRIVATE_KEY|DATABASE_URL|POSTGRES_URL)$/u;function DE(e){let t=new Map;for(let r of e.split(/\r?\n/u)){let n=/^([A-Z][A-Z0-9_]*)=(.*)$/u.exec(r.trim());if(!n||!PE.test(n[1]))continue;let a=n[1],i=n[2].trim();t.set(a,{name:a,requirement:i.length===0?"conditional":"optional",secret:NE.test(a),configured:!1,source:".env.example",configuredSource:null})}return[...t.values()]}async function pm(e){let t=await lm(dm.join(e.projectRoot,".env.example"),"utf8").then(()=>".env.example").catch(()=>null),r=t?await lm(dm.join(e.projectRoot,t),"utf8"):"",n=await $i({projectRoot:e.projectRoot}).catch(()=>null);return{commands:["dev","build","test","package"].flatMap(i=>e.commands[i]?[{id:i,script:e.commands[i],mode:i==="dev"?"managed-process":"foreground-task"}]:[]),environment:n?n.entries.map(i=>({name:i.name,requirement:i.required?"conditional":"optional",secret:i.kind!=="value",configured:i.configured,source:"application-config-contract",configuredSource:"APP_CONFIG_DIR",display:i.display,...i.fingerprint?{fingerprint:i.fingerprint}:{}})):DE(r),environmentExample:t,productionValidation:{contract:!0,live:["provider-read","oss-write-read-delete"]}}}var um={change:new Set(["plan","apply","upgrade","recover","baseline-next","add-package","add-application","add-feature"]),quality:new Set(["inspect","verify","doctor","maintenance","test","build"]),delivery:new Set(["package","delivery-plan","delivery-apply","delivery-inspect"])},fm=new Set(["queued","running","succeeded","failed","outcome-unknown","cancelled"]);function mm(e,t){if(!um[t.plane]||t.state&&!fm.has(t.state)||t.limit!==void 0&&(!Number.isSafeInteger(t.limit)||t.limit<1||t.limit>200))throw new Error("OPERATION_FILTER_INVALID");let r=um[t.plane],n=t.from?Date.parse(t.from):null,a=t.to?Date.parse(t.to):null;if(n!==null&&Number.isNaN(n)||a!==null&&Number.isNaN(a)||n!==null&&a!==null&&n>a)throw new Error("OPERATION_FILTER_INVALID");let i=e.filter(d=>r.has(d.operation)),o=[...new Map(i.map(d=>[d.projectId,{id:d.projectId,name:d.projectName}])).values()].sort((d,l)=>d.name.localeCompare(l.name)),s=i.filter(d=>(!t.projectId||d.projectId===t.projectId)&&(!t.state||d.state===t.state)&&(!t.kind||d.operation===t.kind)&&(n===null||Date.parse(d.createdAt)>=n)&&(a===null||Date.parse(d.createdAt)<=a)).sort((d,l)=>l.updatedAt.localeCompare(d.updatedAt)),c={total:s.length,running:s.filter(d=>d.state==="running"||d.state==="queued").length,succeeded:s.filter(d=>d.state==="succeeded").length,attention:s.filter(d=>d.state==="failed"||d.state==="outcome-unknown").length};return Object.freeze({schemaVersion:1,plane:t.plane,summary:Object.freeze(c),facets:Object.freeze({projects:Object.freeze(o),states:Object.freeze([...fm]),kinds:Object.freeze([...r])}),items:Object.freeze(s.slice(0,t.limit??50).map(Object.freeze)),hasMore:s.length>(t.limit??50)})}var sa=class extends Error{code;constructor(t,r){super(r),this.code=t}},Qc=/^sha256:[a-f0-9]{64}$/u,SE=/^sha512-[A-Za-z0-9+/]{86}==$/u,jE=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u,$E=/^(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?$/u,OE=/[\u0000-\u001f\u007f]/u;function Xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function Zr(e,t){let r=Object.keys(e).sort(),n=[...t].sort();return r.length===n.length&&r.every((a,i)=>a===n[i])}function Rt(e,t=500){return typeof e=="string"&&e.length>0&&e.length<=t&&!OE.test(e)}function Zc(e){return Rt(e,500)&&!e.startsWith("/")&&!e.startsWith("../")&&!e.includes("/../")&&!e.includes("\\")}function gm(e,t=128){return Array.isArray(e)&&e.length<=t&&e.every(r=>Rt(r,500))&&e.every((r,n)=>n===0||e[n-1]<r)}function CE(e){return e===null?!0:!Xr(e)||!Zr(e,["fileName","digest","integrity","fileCount","unpackedBytes"])?!1:Zc(e.fileName)&&Qc.test(String(e.digest))&&SE.test(String(e.integrity))&&Number.isSafeInteger(e.fileCount)&&Number(e.fileCount)>0&&Number.isSafeInteger(e.unpackedBytes)&&Number(e.unpackedBytes)>0}function TE(e){if(!Xr(e)||!Zr(e,["schemaVersion","kind","packageName","version","title","summary","maturity","source","artifact","compatibility","exports","documentation","consumerEvidence"])||e.schemaVersion!==1||e.kind!=="PackageRelease"||!jE.test(e.packageName)||!$E.test(e.version)||!Rt(e.title,120)||!Rt(e.summary,1e3)||!["candidate","stable","deprecated"].includes(e.maturity)||!Xr(e.source)||!Zr(e.source,["repository","path","revision","treeDigest"])||!Rt(e.source.repository)||!Zc(e.source.path)||!Rt(e.source.revision,200)||!Qc.test(String(e.source.treeDigest))||!CE(e.artifact)||!Xr(e.compatibility)||!Zr(e.compatibility,["node","packageManager"])||!Rt(e.compatibility.node,100)||!Rt(e.compatibility.packageManager,100)||!gm(e.exports)||!gm(e.consumerEvidence)||!Xr(e.documentation))return!1;let t=e.documentation.knowledgeRef===void 0?["readme"]:["readme","knowledgeRef"];return!Zr(e.documentation,t)||!Zc(e.documentation.readme)||e.documentation.knowledgeRef!==void 0&&!Rt(e.documentation.knowledgeRef,500)?!1:e.artifact!==null||e.maturity!=="stable"}function xE(e){let t={schemaVersion:1,kind:"PackageRelease",...e,source:Object.freeze({...e.source}),artifact:e.artifact===null?null:Object.freeze({...e.artifact}),compatibility:Object.freeze({...e.compatibility}),exports:Object.freeze([...e.exports]),documentation:Object.freeze({...e.documentation}),consumerEvidence:Object.freeze([...e.consumerEvidence])};if(!TE(t))throw new sa("PACKAGE_RELEASE_INVALID","PackageRelease \u5185\u5BB9\u65E0\u6548");return Object.freeze({...t,releaseDigest:v(E(t))})}function hm(e){if(!Xr(e)||!Zr(e,["schemaVersion","kind","packageName","version","title","summary","maturity","source","artifact","compatibility","exports","documentation","consumerEvidence","releaseDigest"])||!Qc.test(String(e.releaseDigest)))throw new sa("PACKAGE_RELEASE_INVALID","PackageRelease \u7ED3\u6784\u65E0\u6548");let{releaseDigest:t,schemaVersion:r,kind:n,...a}=e,i=xE(a);if(i.releaseDigest!==t)throw new sa("PACKAGE_RELEASE_MODIFIED","PackageRelease \u5DF2\u88AB\u4FEE\u6539");return i}import{lstat as LE,readFile as VE,realpath as ME}from"node:fs/promises";import ym from"node:path";async function wm(e){let t=await ME(ym.resolve(e.projectRoot)),r=new Set(e.excludeCapabilityIds??[]),n=new Map,a=[...e.lock.capabilities].sort((o,s)=>o.committedAt.localeCompare(s.committedAt)||o.capabilityId.localeCompare(s.capabilityId));for(let o of a)if(!r.has(o.capabilityId))for(let s of o.assets){let c=s.ownership??"owned-file",d=`${s.path}\0`;if(c==="managed-region")n.delete(d);else for(let p of n.keys())p.startsWith(d)&&n.delete(p);let l=c==="managed-region"?`${d}${s.regionId??""}`:d;n.set(l,{capabilityId:o.capabilityId,path:s.path,digest:s.digest,ownership:c,...s.regionId===void 0?{}:{regionId:s.regionId}})}let i=[];for(let o of[...n.values()].sort((s,c)=>s.path.localeCompare(c.path)||(s.regionId??"").localeCompare(c.regionId??"")||s.capabilityId.localeCompare(c.capabilityId))){let s=ym.join(t,...o.path.split("/")),d=await LE(s).then(async l=>{if(!l.isFile()||l.isSymbolicLink())return;let p=await VE(s);if(o.ownership!=="managed-region")return v(p);if(o.regionId!==void 0)try{return v(Xa(p.toString("utf8"),o.regionId))}catch{return}}).catch(l=>l.code==="ENOENT"?void 0:Promise.reject(l))===o.digest;i.push({capabilityId:o.capabilityId,path:o.path,kind:"create",ownership:o.ownership,...o.regionId===void 0?{}:{regionId:o.regionId},desiredDigest:o.digest,disposition:d?"noop":"conflict",...d?{}:{conflictCode:"BASE_DIGEST_MISMATCH"}})}return i}var el="0.1.25",ca={DEPENDENCIES_NOT_INSTALLED:4,VERIFIER_RUNTIME_INVALID:4},qE=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/u;function vm(e,t){return typeof e=="string"&&e.length>0&&e.length<=t&&!qE.test(e)}function UE(e){let t={schemaVersion:1,kind:"dyyto-cli-domain-error",code:e.code,message:e.message,exitCode:ca[e.code],...e.nextStep===void 0?{}:{nextStep:e.nextStep}},r=FE(t);if(r===null)throw new TypeError("CLI domain error input is invalid");return r}function FE(e){try{if(typeof e!="object"||e===null||Object.getPrototypeOf(e)!==Object.prototype)return null;let t=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(t).some(s=>typeof s=="symbol"))return null;let r=Object.keys(t).sort(),n="nextStep"in t?["code","exitCode","kind","message","nextStep","schemaVersion"]:["code","exitCode","kind","message","schemaVersion"];if(r.length!==n.length||r.some((s,c)=>s!==n[c])||Object.values(t).some(s=>!("value"in s)))return null;let a=s=>t[s]?.value,i=a("code");if(a("schemaVersion")!==1||a("kind")!=="dyyto-cli-domain-error"||typeof i!="string"||!(i in ca)||a("exitCode")!==ca[i]||!vm(a("message"),500))return null;let o=a("nextStep");return o!==void 0&&!vm(o,500)?null:Object.freeze({schemaVersion:1,kind:"dyyto-cli-domain-error",code:i,message:a("message"),exitCode:4,...o===void 0?{}:{nextStep:o}})}catch{return null}}var Ce=class extends Error{code;exitCode;nextStep;domainError;constructor(t){super(t.message),this.name="CliError",this.code=t.code,this.exitCode=t.exitCode,this.nextStep=t.nextStep,this.domainError=t.code in ca&&t.exitCode===ca[t.code]?UE({code:t.code,message:t.message,...t.nextStep===void 0?{}:{nextStep:t.nextStep}}):void 0}};var Im=`Dyyto Engineering Platform CLI
|
|
46
46
|
|
|
47
47
|
Usage:
|
|
48
48
|
dyyto <command> [options]
|
package/dist/chunk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var h=Object.create;var y=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var O=(e,n)=>()=>{try{return n||e((n={exports:{}}).exports,n),n.exports}catch(t){throw n=0,t}};var v=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of w(n))!b.call(e,o)&&o!==t&&y(e,o,{get:()=>n[o],enumerable:!(r=C(n,o))||r.enumerable});return e};var N=(e,n,t)=>(t=e!=null?h(E(e)):{},v(n||!e||!e.__esModule?y(t,"default",{value:e,enumerable:!0}):t,e));var F="0.1.
|
|
1
|
+
var h=Object.create;var y=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var O=(e,n)=>()=>{try{return n||e((n={exports:{}}).exports,n),n.exports}catch(t){throw n=0,t}};var v=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of w(n))!b.call(e,o)&&o!==t&&y(e,o,{get:()=>n[o],enumerable:!(r=C(n,o))||r.enumerable});return e};var N=(e,n,t)=>(t=e!=null?h(E(e)):{},v(n||!e||!e.__esModule?y(t,"default",{value:e,enumerable:!0}):t,e));var F="0.1.25",c={DEPENDENCIES_NOT_INSTALLED:4,VERIFIER_RUNTIME_INVALID:4},D=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/u;function f(e,n){return typeof e=="string"&&e.length>0&&e.length<=n&&!D.test(e)}function S(e){let n={schemaVersion:1,kind:"dyyto-cli-domain-error",code:e.code,message:e.message,exitCode:c[e.code],...e.nextStep===void 0?{}:{nextStep:e.nextStep}},t=m(n);if(t===null)throw new TypeError("CLI domain error input is invalid");return t}function m(e){try{if(typeof e!="object"||e===null||Object.getPrototypeOf(e)!==Object.prototype)return null;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(i=>typeof i=="symbol"))return null;let t=Object.keys(n).sort(),r="nextStep"in n?["code","exitCode","kind","message","nextStep","schemaVersion"]:["code","exitCode","kind","message","schemaVersion"];if(t.length!==r.length||t.some((i,k)=>i!==r[k])||Object.values(n).some(i=>!("value"in i)))return null;let o=i=>n[i]?.value,a=o("code");if(o("schemaVersion")!==1||o("kind")!=="dyyto-cli-domain-error"||typeof a!="string"||!(a in c)||o("exitCode")!==c[a]||!f(o("message"),500))return null;let d=o("nextStep");return d!==void 0&&!f(d,500)?null:Object.freeze({schemaVersion:1,kind:"dyyto-cli-domain-error",code:a,message:o("message"),exitCode:4,...d===void 0?{}:{nextStep:d}})}catch{return null}}function T(e){if(e instanceof l&&e.domainError!==void 0)return e.domainError;try{if(typeof e!="object"||e===null)return null;let n=Object.getOwnPropertyDescriptor(e,"domainError");return n!==void 0&&"value"in n?m(n.value):null}catch{return null}}var l=class extends Error{code;exitCode;nextStep;domainError;constructor(n){super(n.message),this.name="CliError",this.code=n.code,this.exitCode=n.exitCode,this.nextStep=n.nextStep,this.domainError=n.code in c&&n.exitCode===c[n.code]?S({code:n.code,message:n.message,...n.nextStep===void 0?{}:{nextStep:n.nextStep}}):void 0}};var z=`Dyyto Engineering Platform CLI
|
|
2
2
|
|
|
3
3
|
Usage:
|
|
4
4
|
dyyto <command> [options]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"kind": "PackageRelease",
|
|
4
|
+
"packageName": "@aipt/cli",
|
|
5
|
+
"version": "0.1.24",
|
|
6
|
+
"title": "Dyyto CLI",
|
|
7
|
+
"summary": "Dyyto 无服务工程能力目录、规划、应用与验证 CLI。",
|
|
8
|
+
"maturity": "candidate",
|
|
9
|
+
"source": {
|
|
10
|
+
"repository": "urn:idp:repository:dyyto",
|
|
11
|
+
"path": "apps/cli",
|
|
12
|
+
"revision": "working-tree",
|
|
13
|
+
"treeDigest": "sha256:d3b4a0eb0fc9672160da15eb84831a8ffeae4c672c165e20f9b1576abf4f3575"
|
|
14
|
+
},
|
|
15
|
+
"artifact": null,
|
|
16
|
+
"compatibility": {
|
|
17
|
+
"node": ">=24.18.0 <25",
|
|
18
|
+
"packageManager": "pnpm@11.21.0"
|
|
19
|
+
},
|
|
20
|
+
"exports": [],
|
|
21
|
+
"documentation": {
|
|
22
|
+
"readme": "apps/cli/README.md",
|
|
23
|
+
"knowledgeRef": "tech://engineering-capabilities/dyyto/cli"
|
|
24
|
+
},
|
|
25
|
+
"consumerEvidence": [
|
|
26
|
+
"apps/cli/src/distribution.test.ts"
|
|
27
|
+
],
|
|
28
|
+
"releaseDigest": "sha256:70c472ea5112cd5f97a24062b2e4e26acf5bb3a54859b6894265718097c7a115"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"kind": "PackageRelease",
|
|
4
|
+
"packageName": "@aipt/cli",
|
|
5
|
+
"version": "0.1.25",
|
|
6
|
+
"title": "Dyyto CLI",
|
|
7
|
+
"summary": "Dyyto 无服务工程能力目录、规划、应用与验证 CLI。",
|
|
8
|
+
"maturity": "candidate",
|
|
9
|
+
"source": {
|
|
10
|
+
"repository": "urn:idp:repository:dyyto",
|
|
11
|
+
"path": "apps/cli",
|
|
12
|
+
"revision": "working-tree",
|
|
13
|
+
"treeDigest": "sha256:3c1d5ad6d2ae983dcc2d4557a3943b658e24ebd6dd5f088c4d1fa39e22b57199"
|
|
14
|
+
},
|
|
15
|
+
"artifact": null,
|
|
16
|
+
"compatibility": {
|
|
17
|
+
"node": ">=24.18.0 <25",
|
|
18
|
+
"packageManager": "pnpm@11.21.0"
|
|
19
|
+
},
|
|
20
|
+
"exports": [],
|
|
21
|
+
"documentation": {
|
|
22
|
+
"readme": "apps/cli/README.md",
|
|
23
|
+
"knowledgeRef": "tech://engineering-capabilities/dyyto/cli"
|
|
24
|
+
},
|
|
25
|
+
"consumerEvidence": [
|
|
26
|
+
"apps/cli/src/distribution.test.ts"
|
|
27
|
+
],
|
|
28
|
+
"releaseDigest": "sha256:37a3aed38e46335e8149af858eedd328b95031227af222eb4dc83fd0db2a781d"
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"kind": "PackageRelease",
|
|
4
|
+
"packageName": "@aipt/idp-setup",
|
|
5
|
+
"version": "0.1.2",
|
|
6
|
+
"title": "IDP Sources Setup CLI",
|
|
7
|
+
"summary": "IDP Sources 本地工程环境与外部 Config Dir 初始化 CLI。",
|
|
8
|
+
"maturity": "candidate",
|
|
9
|
+
"source": {
|
|
10
|
+
"repository": "urn:idp:repository:dyyto",
|
|
11
|
+
"path": "apps/idp-setup",
|
|
12
|
+
"revision": "working-tree",
|
|
13
|
+
"treeDigest": "sha256:5de76e5fbdebf1692bf6d092129513daf8f35a619ae990fd73c5895ab3864554"
|
|
14
|
+
},
|
|
15
|
+
"artifact": null,
|
|
16
|
+
"compatibility": {
|
|
17
|
+
"node": ">=22.14.0",
|
|
18
|
+
"packageManager": "pnpm@11.21.0"
|
|
19
|
+
},
|
|
20
|
+
"exports": [],
|
|
21
|
+
"documentation": {
|
|
22
|
+
"readme": "apps/idp-setup/README.md",
|
|
23
|
+
"knowledgeRef": "tech://engineering-capabilities/idp/setup"
|
|
24
|
+
},
|
|
25
|
+
"consumerEvidence": [
|
|
26
|
+
"apps/idp-setup/test/distribution.test.mjs",
|
|
27
|
+
"apps/idp-setup/test/idp-setup.test.mjs",
|
|
28
|
+
"tooling/idp-setup.test.mjs"
|
|
29
|
+
],
|
|
30
|
+
"releaseDigest": "sha256:065f2f3387d4b37faaa0f50a0f83992dbca79d8f558b1718799b9312ab60cdae"
|
|
31
|
+
}
|
package/docs/bootstrap.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# Bootstrap
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
每台机器先执行一次 `corepack pnpm dlx @aipt/idp-setup@0.1.2 init --root <Sources绝对目录>`,由它生成并持久化 `sources.env`、建立稳定 `PNPM_HOME`、安装精确工具链。每个工作区或独立项目执行一次 `idp-setup bootstrap --project <绝对目录>`,统一完成 Dyyto 工程纳管和可部署 Application Config Dir 初始化。直接使用 `dyyto bootstrap` 是高级入口,要求环境已有绝对 `PNPM_HOME`;离线环境可使用 `--skip-tool-install`。
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# Dyyto 工程开发工作流
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本地开发每台机器先用 `idp-setup init --root <Sources绝对目录>` 建立路径、Shell 环境和精确工具链;每个工作区或独立项目用 `idp-setup bootstrap --project <绝对目录>` 完成工程纳管和应用配置初始化。随后编码前运行 `dyyto context` 与 `dyyto doctor`。Workspace Root、独立项目、Package 和 Application 都通过 Catalog、Plan、Apply、Verify 演进;配置、密钥与证书只存在于仓库外 Config Dir。
|
package/docs/troubleshooting.md
CHANGED
|
@@ -9,4 +9,4 @@ idp --version --json
|
|
|
9
9
|
idpctl --version --json
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
项目应以 `.dyyto/toolchain.lock.json` 为准。版本不一致时重新执行 `
|
|
12
|
+
项目应以 `.dyyto/toolchain.lock.json` 为准。版本不一致时重新执行 `idp-setup init --root <Sources绝对路径>` 和 `idp-setup bootstrap --project <绝对路径>`,随后执行 `hash -r` 清除 shell 命令缓存。
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
业务项目只保留短入口规则,不复制平台规范全文。首次接入执行:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
corepack pnpm dlx @aipt/idp-setup@0.1.
|
|
6
|
+
corepack pnpm dlx @aipt/idp-setup@0.1.2 init --root /absolute/sources
|
|
7
7
|
source /absolute/sources/config/idp/generated/sources.env
|
|
8
|
-
|
|
8
|
+
idp-setup bootstrap --project "$PWD"
|
|
9
9
|
# 审阅输出的不可变 Plan 后,用输出中的 plan 文件和 planId 执行 apply
|
|
10
10
|
dyyto context --project "$PWD"
|
|
11
11
|
dyyto doctor --project "$PWD"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": "@aipt/cli",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.25",
|
|
5
5
|
"documents": [
|
|
6
|
-
{ "id": "bootstrap", "path": "docs/bootstrap.md", "digest": "sha256:
|
|
6
|
+
{ "id": "bootstrap", "path": "docs/bootstrap.md", "digest": "sha256:4f3b48c1977db32badf725d3fed3161053d5f56f730cddb29c41c5d816b9c201" },
|
|
7
7
|
{ "id": "agent-integration", "path": "docs/agent-integration.md", "digest": "sha256:6b3e9425bd5caf233971bc27dc2ef765bd1e9b92a049d3a394e075ed80c0863f" },
|
|
8
|
-
{ "id": "engineering-workflow", "path": "docs/engineering-workflow.md", "digest": "sha256:
|
|
9
|
-
{ "id": "vibe-coding-guide", "path": "docs/vibe-coding-guide.md", "digest": "sha256:
|
|
8
|
+
{ "id": "engineering-workflow", "path": "docs/engineering-workflow.md", "digest": "sha256:2f3072966d33b97b69c528b9db8ecb0dee0b6d1a36e2841f15b535ec2c802abb" },
|
|
9
|
+
{ "id": "vibe-coding-guide", "path": "docs/vibe-coding-guide.md", "digest": "sha256:3c2f41dc06278340c66718a57d5c8ca064ad0aea0494750a46a6eaa4923ab3e7" },
|
|
10
10
|
{ "id": "dyyto-command-reference", "path": "docs/command-reference.md", "digest": "sha256:6b2ab66dd71e2c2528529314e1f2bee24633ba4455af629e505742add31a1f88" },
|
|
11
|
-
{ "id": "toolchain-troubleshooting", "path": "docs/troubleshooting.md", "digest": "sha256:
|
|
11
|
+
{ "id": "toolchain-troubleshooting", "path": "docs/troubleshooting.md", "digest": "sha256:2040de770d2c2bd81eea709185e913afd6d6cf4c78f1e30c82e6bcb42b066de9" }
|
|
12
12
|
]
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aipt/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "Dyyto 无服务工程能力目录、规划、应用与验证 CLI。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"esbuild": "0.28.2",
|
|
31
|
+
"@aipt/object-store": "0.1.0",
|
|
31
32
|
"@aipt/page-definition": "0.1.0",
|
|
32
|
-
"@aipt/page-host-gateway": "0.1.0",
|
|
33
33
|
"@aipt/platform-kernel": "0.1.7",
|
|
34
|
-
"@aipt/
|
|
34
|
+
"@aipt/page-host-gateway": "0.1.0"
|
|
35
35
|
},
|
|
36
36
|
"idpPackageRelease": {
|
|
37
37
|
"title": "Dyyto CLI",
|