@agent-profile/web 0.1.2 → 0.1.5
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 +70 -29
- package/build/client/_app/immutable/assets/{0.BG6jUcBX.css → 0.8hVtEx5X.css} +1 -1
- package/build/client/_app/immutable/assets/0.8hVtEx5X.css.br +0 -0
- package/build/client/_app/immutable/assets/0.8hVtEx5X.css.gz +0 -0
- package/build/client/_app/immutable/assets/9.BsbC-D7w.css +1 -0
- package/build/client/_app/immutable/assets/9.BsbC-D7w.css.br +0 -0
- package/build/client/_app/immutable/assets/9.BsbC-D7w.css.gz +0 -0
- package/build/client/_app/immutable/chunks/6SrQtk22.js +3 -0
- package/build/client/_app/immutable/chunks/6SrQtk22.js.br +0 -0
- package/build/client/_app/immutable/chunks/6SrQtk22.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{D5BQ10GJ.js → B1X0Iqjr.js} +2 -2
- package/build/client/_app/immutable/chunks/B1X0Iqjr.js.br +0 -0
- package/build/client/_app/immutable/chunks/B1X0Iqjr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BN4Ca4cJ.js +1 -0
- package/build/client/_app/immutable/chunks/BN4Ca4cJ.js.br +0 -0
- package/build/client/_app/immutable/chunks/BN4Ca4cJ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BYeYmN2n.js +1 -0
- package/build/client/_app/immutable/chunks/BYeYmN2n.js.br +2 -0
- package/build/client/_app/immutable/chunks/BYeYmN2n.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D0_SwbnT.js +2 -0
- package/build/client/_app/immutable/chunks/D0_SwbnT.js.br +0 -0
- package/build/client/_app/immutable/chunks/D0_SwbnT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DRoN73NW.js +1 -0
- package/build/client/_app/immutable/chunks/DRoN73NW.js.br +2 -0
- package/build/client/_app/immutable/chunks/DRoN73NW.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.B45QQayJ.js +2 -0
- package/build/client/_app/immutable/entry/app.B45QQayJ.js.br +0 -0
- package/build/client/_app/immutable/entry/app.B45QQayJ.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BIlQ_snM.js +1 -0
- package/build/client/_app/immutable/entry/start.BIlQ_snM.js.br +0 -0
- package/build/client/_app/immutable/entry/start.BIlQ_snM.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.JRffyfUR.js +1 -0
- package/build/client/_app/immutable/nodes/0.JRffyfUR.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.JRffyfUR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.56EgwKsF.js +1 -0
- package/build/client/_app/immutable/nodes/1.56EgwKsF.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.56EgwKsF.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{10.BOQgahuX.js → 10.Bhdlxk-S.js} +2 -2
- package/build/client/_app/immutable/nodes/10.Bhdlxk-S.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.Bhdlxk-S.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.DAqRx2TI.js +1 -0
- package/build/client/_app/immutable/nodes/11.DAqRx2TI.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.DAqRx2TI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CI-wpOC8.js +10 -0
- package/build/client/_app/immutable/nodes/2.CI-wpOC8.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CI-wpOC8.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.Bphawycs.js +2 -0
- package/build/client/_app/immutable/nodes/3.Bphawycs.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.Bphawycs.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.BGFkNM65.js +4 -0
- package/build/client/_app/immutable/nodes/4.BGFkNM65.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.BGFkNM65.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.VTs5grF0.js +2 -0
- package/build/client/_app/immutable/nodes/5.VTs5grF0.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.VTs5grF0.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.CndSdLIk.js +5 -0
- package/build/client/_app/immutable/nodes/6.CndSdLIk.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.CndSdLIk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.DpFk4StA.js +4 -0
- package/build/client/_app/immutable/nodes/7.DpFk4StA.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DpFk4StA.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.Y7A99ODL.js +1 -0
- package/build/client/_app/immutable/nodes/8.Y7A99ODL.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.Y7A99ODL.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.DF3LeTGi.js +3 -0
- package/build/client/_app/immutable/nodes/9.DF3LeTGi.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.DF3LeTGi.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/client/marketing.js +105 -0
- package/build/client/marketing.js.br +0 -0
- package/build/client/marketing.js.gz +0 -0
- package/build/server/chunks/{0-u7mEipCH.js → 0-DWEpTDaF.js} +17 -11
- package/build/server/chunks/0-DWEpTDaF.js.map +1 -0
- package/build/server/chunks/{1-BBGjCHyQ.js → 1-B68UkVTE.js} +3 -3
- package/build/server/chunks/{1-BBGjCHyQ.js.map → 1-B68UkVTE.js.map} +1 -1
- package/build/server/chunks/10-D7op0myD.js +9 -0
- package/build/server/chunks/{10-B1aX7ZZ8.js.map → 10-D7op0myD.js.map} +1 -1
- package/build/server/chunks/{11-4z6b2WB8.js → 11-Ms74wtl9.js} +6 -6
- package/build/server/chunks/{11-4z6b2WB8.js.map → 11-Ms74wtl9.js.map} +1 -1
- package/build/server/chunks/2-bmpngDVe.js +21 -0
- package/build/server/chunks/2-bmpngDVe.js.map +1 -0
- package/build/server/chunks/3-BkezOAX7.js +9 -0
- package/build/server/chunks/{3-CLWhM7Et.js.map → 3-BkezOAX7.js.map} +1 -1
- package/build/server/chunks/{4-BehBrXcu.js → 4-CSfQwQwV.js} +6 -6
- package/build/server/chunks/{4-BehBrXcu.js.map → 4-CSfQwQwV.js.map} +1 -1
- package/build/server/chunks/5-D_pZV4fS.js +9 -0
- package/build/server/chunks/{5-C1YtO2Ru.js.map → 5-D_pZV4fS.js.map} +1 -1
- package/build/server/chunks/{6-DJ03bQJy.js → 6-DcbRMrH1.js} +3 -3
- package/build/server/chunks/{6-DJ03bQJy.js.map → 6-DcbRMrH1.js.map} +1 -1
- package/build/server/chunks/{7-CI__yhaj.js → 7-BsMFIBGU.js} +8 -8
- package/build/server/chunks/{7-CI__yhaj.js.map → 7-BsMFIBGU.js.map} +1 -1
- package/build/server/chunks/8-DWleYW_e.js +9 -0
- package/build/server/chunks/{8-BGx10Z6s.js.map → 8-DWleYW_e.js.map} +1 -1
- package/build/server/chunks/9-tHCipeiW.js +67 -0
- package/build/server/chunks/9-tHCipeiW.js.map +1 -0
- package/build/server/chunks/{Badge-BrV_lIru.js → Badge-BYK3z3lr.js} +2 -2
- package/build/server/chunks/{Badge-BrV_lIru.js.map → Badge-BYK3z3lr.js.map} +1 -1
- package/build/server/chunks/{SafetyBadge-BSDbVVMY.js → SafetyBadge-BXNCgLE-.js} +2 -2
- package/build/server/chunks/{SafetyBadge-BSDbVVMY.js.map → SafetyBadge-BXNCgLE-.js.map} +1 -1
- package/build/server/chunks/{_layout.svelte-Cg7oqdVB.js → _layout.svelte-Cv35k3JT.js} +8 -8
- package/build/server/chunks/_layout.svelte-Cv35k3JT.js.map +1 -0
- package/build/server/chunks/{_page.svelte-C8HqSRYY.js → _page.svelte-B-Kaw1RF.js} +2 -2
- package/build/server/chunks/{_page.svelte-C8HqSRYY.js.map → _page.svelte-B-Kaw1RF.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-Bv-w7cKm.js → _page.svelte-BftcSD3f.js} +3 -3
- package/build/server/chunks/{_page.svelte-Bv-w7cKm.js.map → _page.svelte-BftcSD3f.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-DRj4L7XZ.js → _page.svelte-CIEY8g8A.js} +4 -4
- package/build/server/chunks/{_page.svelte-DRj4L7XZ.js.map → _page.svelte-CIEY8g8A.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-DuJcNgye.js → _page.svelte-CUnw0pLx.js} +3 -3
- package/build/server/chunks/{_page.svelte-DuJcNgye.js.map → _page.svelte-CUnw0pLx.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-DXeUSVlF.js → _page.svelte-Cat8tEeF.js} +5 -5
- package/build/server/chunks/{_page.svelte-DXeUSVlF.js.map → _page.svelte-Cat8tEeF.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-BS9xpx67.js → _page.svelte-CmuUQI4Y.js} +112 -54
- package/build/server/chunks/_page.svelte-CmuUQI4Y.js.map +1 -0
- package/build/server/chunks/{_page.svelte-DyYKrY-D.js → _page.svelte-DHNevyzi.js} +4 -4
- package/build/server/chunks/{_page.svelte-DyYKrY-D.js.map → _page.svelte-DHNevyzi.js.map} +1 -1
- package/build/server/chunks/_page.svelte-DLQqGym0.js +435 -0
- package/build/server/chunks/_page.svelte-DLQqGym0.js.map +1 -0
- package/build/server/chunks/{_page.svelte-B0_5f_5-.js → _page.svelte-DZX4Bixr.js} +6 -6
- package/build/server/chunks/{_page.svelte-B0_5f_5-.js.map → _page.svelte-DZX4Bixr.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-r2AHAn4f.js → _page.svelte-DyI46sDh.js} +3 -3
- package/build/server/chunks/{_page.svelte-r2AHAn4f.js.map → _page.svelte-DyI46sDh.js.map} +1 -1
- package/build/server/chunks/_server.ts-5396UuLQ.js +8 -0
- package/build/server/chunks/_server.ts-5396UuLQ.js.map +1 -0
- package/build/server/chunks/_server.ts-BUQYdxPs.js +8 -0
- package/build/server/chunks/_server.ts-BUQYdxPs.js.map +1 -0
- package/build/server/chunks/_server.ts-CvdpZfED.js +8 -0
- package/build/server/chunks/_server.ts-CvdpZfED.js.map +1 -0
- package/build/server/chunks/_server.ts-DHt1bGpF.js +85 -0
- package/build/server/chunks/_server.ts-DHt1bGpF.js.map +1 -0
- package/build/server/chunks/_server.ts-Dq1jAomo.js +43 -0
- package/build/server/chunks/_server.ts-Dq1jAomo.js.map +1 -0
- package/build/server/chunks/_server.ts-sMKRiXFg.js +100 -0
- package/build/server/chunks/_server.ts-sMKRiXFg.js.map +1 -0
- package/build/server/chunks/{client-DRY1rofW.js → client-92HF3fc9.js} +3 -3
- package/build/server/chunks/{client-DRY1rofW.js.map → client-92HF3fc9.js.map} +1 -1
- package/build/server/chunks/{dev-CrqJ3ZR3.js → dev-Duv_-rxF.js} +2 -2
- package/build/server/chunks/{dev-CrqJ3ZR3.js.map → dev-Duv_-rxF.js.map} +1 -1
- package/build/server/chunks/{doctorSummary-CGjSiyKU.js → doctorSummary-Bm0dY6PW.js} +3 -3
- package/build/server/chunks/{doctorSummary-CGjSiyKU.js.map → doctorSummary-Bm0dY6PW.js.map} +1 -1
- package/build/server/chunks/{error.svelte-CvT76GCP.js → error.svelte-BEI8QxGW.js} +5 -5
- package/build/server/chunks/{error.svelte-CvT76GCP.js.map → error.svelte-BEI8QxGW.js.map} +1 -1
- package/build/server/chunks/hooks.server-BKavEpqC.js +81 -0
- package/build/server/chunks/hooks.server-BKavEpqC.js.map +1 -0
- package/build/server/chunks/index-CLnuRv4X.js +134 -0
- package/build/server/chunks/index-CLnuRv4X.js.map +1 -0
- package/build/server/chunks/index-DBqjc0Yf.js +77 -0
- package/build/server/chunks/index-DBqjc0Yf.js.map +1 -0
- package/build/server/chunks/{internal-DDD35M_S.js → internal-DBeni9My.js} +6 -81
- package/build/server/chunks/internal-DBeni9My.js.map +1 -0
- package/build/server/chunks/marketingSeo-Do5o0grg.js +132 -0
- package/build/server/chunks/marketingSeo-Do5o0grg.js.map +1 -0
- package/build/server/chunks/profileApiHelpers-BFzohffv.js +180 -0
- package/build/server/chunks/profileApiHelpers-BFzohffv.js.map +1 -0
- package/build/server/chunks/{projectContext-C4-xYqFg.js → projectContext-Cxsfz84C.js} +409 -44
- package/build/server/chunks/projectContext-Cxsfz84C.js.map +1 -0
- package/build/server/chunks/src2-DNqJAXv6.js +12 -0
- package/build/server/chunks/src2-DNqJAXv6.js.map +1 -0
- package/build/server/chunks/{dist--t-UlYlZ.js → src3-jm480tTA.js} +3 -3
- package/build/server/chunks/src3-jm480tTA.js.map +1 -0
- package/build/server/chunks/tokenStore-DQfTa-N3.js +57 -0
- package/build/server/chunks/tokenStore-DQfTa-N3.js.map +1 -0
- package/build/server/index.js +4593 -4
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +57 -15
- package/build/server/manifest.js.map +1 -1
- package/package.json +10 -7
- package/build/client/_app/immutable/assets/0.BG6jUcBX.css.br +0 -0
- package/build/client/_app/immutable/assets/0.BG6jUcBX.css.gz +0 -0
- package/build/client/_app/immutable/chunks/B-io8J2C.js +0 -1
- package/build/client/_app/immutable/chunks/B-io8J2C.js.br +0 -2
- package/build/client/_app/immutable/chunks/B-io8J2C.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D5BQ10GJ.js.br +0 -0
- package/build/client/_app/immutable/chunks/D5BQ10GJ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DAWBIq3g.js +0 -2
- package/build/client/_app/immutable/chunks/DAWBIq3g.js.br +0 -0
- package/build/client/_app/immutable/chunks/DAWBIq3g.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DCJP-V9E.js +0 -3
- package/build/client/_app/immutable/chunks/DCJP-V9E.js.br +0 -0
- package/build/client/_app/immutable/chunks/DCJP-V9E.js.gz +0 -0
- package/build/client/_app/immutable/chunks/SOrpfga1.js +0 -1
- package/build/client/_app/immutable/chunks/SOrpfga1.js.br +0 -0
- package/build/client/_app/immutable/chunks/SOrpfga1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/rbd2FHQ6.js +0 -1
- package/build/client/_app/immutable/chunks/rbd2FHQ6.js.br +0 -2
- package/build/client/_app/immutable/chunks/rbd2FHQ6.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.wvdb3njx.js +0 -2
- package/build/client/_app/immutable/entry/app.wvdb3njx.js.br +0 -0
- package/build/client/_app/immutable/entry/app.wvdb3njx.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.CYyClicm.js +0 -1
- package/build/client/_app/immutable/entry/start.CYyClicm.js.br +0 -1
- package/build/client/_app/immutable/entry/start.CYyClicm.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.DI161f18.js +0 -1
- package/build/client/_app/immutable/nodes/0.DI161f18.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DI161f18.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CZb1wh8q.js +0 -1
- package/build/client/_app/immutable/nodes/1.CZb1wh8q.js.br +0 -3
- package/build/client/_app/immutable/nodes/1.CZb1wh8q.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.BOQgahuX.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.BOQgahuX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.BjwWla8T.js +0 -1
- package/build/client/_app/immutable/nodes/11.BjwWla8T.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.BjwWla8T.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.BmqkJNGt.js +0 -9
- package/build/client/_app/immutable/nodes/2.BmqkJNGt.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BmqkJNGt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.NnDkXnSG.js +0 -2
- package/build/client/_app/immutable/nodes/3.NnDkXnSG.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.NnDkXnSG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.8sZ5zCiS.js +0 -4
- package/build/client/_app/immutable/nodes/4.8sZ5zCiS.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.8sZ5zCiS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.CSOalQ9R.js +0 -2
- package/build/client/_app/immutable/nodes/5.CSOalQ9R.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.CSOalQ9R.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.BMBuGW7y.js +0 -5
- package/build/client/_app/immutable/nodes/6.BMBuGW7y.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.BMBuGW7y.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.CG2RK2bH.js +0 -4
- package/build/client/_app/immutable/nodes/7.CG2RK2bH.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.CG2RK2bH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.Dzq0LDIw.js +0 -1
- package/build/client/_app/immutable/nodes/8.Dzq0LDIw.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.Dzq0LDIw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.CnkwRoxn.js +0 -5
- package/build/client/_app/immutable/nodes/9.CnkwRoxn.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.CnkwRoxn.js.gz +0 -0
- package/build/server/chunks/0-u7mEipCH.js.map +0 -1
- package/build/server/chunks/10-B1aX7ZZ8.js +0 -9
- package/build/server/chunks/2-CZ6isW8Z.js +0 -9
- package/build/server/chunks/2-CZ6isW8Z.js.map +0 -1
- package/build/server/chunks/3-CLWhM7Et.js +0 -9
- package/build/server/chunks/5-C1YtO2Ru.js +0 -9
- package/build/server/chunks/8-BGx10Z6s.js +0 -9
- package/build/server/chunks/9-LeS-ldcl.js +0 -57
- package/build/server/chunks/9-LeS-ldcl.js.map +0 -1
- package/build/server/chunks/_layout.svelte-Cg7oqdVB.js.map +0 -1
- package/build/server/chunks/_page.svelte-BS9xpx67.js.map +0 -1
- package/build/server/chunks/_page.svelte-DbsvERRq.js +0 -424
- package/build/server/chunks/_page.svelte-DbsvERRq.js.map +0 -1
- package/build/server/chunks/dist--t-UlYlZ.js.map +0 -1
- package/build/server/chunks/hooks.server-BGib69tn.js +0 -38
- package/build/server/chunks/hooks.server-BGib69tn.js.map +0 -1
- package/build/server/chunks/index-XyMIhwom.js +0 -4727
- package/build/server/chunks/index-XyMIhwom.js.map +0 -1
- package/build/server/chunks/internal-DDD35M_S.js.map +0 -1
- package/build/server/chunks/projectContext-C4-xYqFg.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
1
|
+
import fsPromises, { readFile } from 'node:fs/promises';
|
|
4
2
|
import require$$0 from 'process';
|
|
5
3
|
import require$$0$1 from 'buffer';
|
|
6
|
-
import {
|
|
4
|
+
import { TextDecoder } from 'node:util';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { randomBytes, createHash } from 'node:crypto';
|
|
7
7
|
|
|
8
8
|
var ajv = {exports: {}};
|
|
9
9
|
|
|
@@ -13536,8 +13536,10 @@ function requireComposer () {
|
|
|
13536
13536
|
}
|
|
13537
13537
|
}
|
|
13538
13538
|
if (afterDoc) {
|
|
13539
|
-
|
|
13540
|
-
|
|
13539
|
+
for (let i = 0; i < this.errors.length; ++i)
|
|
13540
|
+
doc.errors.push(this.errors[i]);
|
|
13541
|
+
for (let i = 0; i < this.warnings.length; ++i)
|
|
13542
|
+
doc.warnings.push(this.warnings[i]);
|
|
13541
13543
|
}
|
|
13542
13544
|
else {
|
|
13543
13545
|
doc.errors = this.errors;
|
|
@@ -14510,7 +14512,7 @@ function requireLexer () {
|
|
|
14510
14512
|
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
14511
14513
|
this.indentNext = this.indentValue + 1;
|
|
14512
14514
|
this.indentValue += n;
|
|
14513
|
-
return
|
|
14515
|
+
return 'block-start';
|
|
14514
14516
|
}
|
|
14515
14517
|
return 'doc';
|
|
14516
14518
|
}
|
|
@@ -14831,32 +14833,36 @@ function requireLexer () {
|
|
|
14831
14833
|
return 0;
|
|
14832
14834
|
}
|
|
14833
14835
|
*pushIndicators() {
|
|
14834
|
-
|
|
14835
|
-
|
|
14836
|
-
|
|
14837
|
-
|
|
14838
|
-
|
|
14839
|
-
|
|
14840
|
-
|
|
14841
|
-
|
|
14842
|
-
|
|
14843
|
-
|
|
14844
|
-
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
|
|
14854
|
-
|
|
14855
|
-
|
|
14836
|
+
let n = 0;
|
|
14837
|
+
loop: while (true) {
|
|
14838
|
+
switch (this.charAt(0)) {
|
|
14839
|
+
case '!':
|
|
14840
|
+
n += yield* this.pushTag();
|
|
14841
|
+
n += yield* this.pushSpaces(true);
|
|
14842
|
+
continue loop;
|
|
14843
|
+
case '&':
|
|
14844
|
+
n += yield* this.pushUntil(isNotAnchorChar);
|
|
14845
|
+
n += yield* this.pushSpaces(true);
|
|
14846
|
+
continue loop;
|
|
14847
|
+
case '-': // this is an error
|
|
14848
|
+
case '?': // this is an error outside flow collections
|
|
14849
|
+
case ':': {
|
|
14850
|
+
const inFlow = this.flowLevel > 0;
|
|
14851
|
+
const ch1 = this.charAt(1);
|
|
14852
|
+
if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
|
|
14853
|
+
if (!inFlow)
|
|
14854
|
+
this.indentNext = this.indentValue + 1;
|
|
14855
|
+
else if (this.flowKey)
|
|
14856
|
+
this.flowKey = false;
|
|
14857
|
+
n += yield* this.pushCount(1);
|
|
14858
|
+
n += yield* this.pushSpaces(true);
|
|
14859
|
+
continue loop;
|
|
14860
|
+
}
|
|
14856
14861
|
}
|
|
14857
14862
|
}
|
|
14863
|
+
break loop;
|
|
14858
14864
|
}
|
|
14859
|
-
return
|
|
14865
|
+
return n;
|
|
14860
14866
|
}
|
|
14861
14867
|
*pushTag() {
|
|
14862
14868
|
if (this.charAt(1) === '<') {
|
|
@@ -15046,6 +15052,14 @@ function requireParser () {
|
|
|
15046
15052
|
}
|
|
15047
15053
|
return prev.splice(i, prev.length);
|
|
15048
15054
|
}
|
|
15055
|
+
function arrayPushArray(target, source) {
|
|
15056
|
+
// May exhaust call stack with large `source` array
|
|
15057
|
+
if (source.length < 1e5)
|
|
15058
|
+
Array.prototype.push.apply(target, source);
|
|
15059
|
+
else
|
|
15060
|
+
for (let i = 0; i < source.length; ++i)
|
|
15061
|
+
target.push(source[i]);
|
|
15062
|
+
}
|
|
15049
15063
|
function fixFlowSeqItems(fc) {
|
|
15050
15064
|
if (fc.start.type === 'flow-seq-start') {
|
|
15051
15065
|
for (const it of fc.items) {
|
|
@@ -15058,12 +15072,12 @@ function requireParser () {
|
|
|
15058
15072
|
delete it.key;
|
|
15059
15073
|
if (isFlowToken(it.value)) {
|
|
15060
15074
|
if (it.value.end)
|
|
15061
|
-
|
|
15075
|
+
arrayPushArray(it.value.end, it.sep);
|
|
15062
15076
|
else
|
|
15063
15077
|
it.value.end = it.sep;
|
|
15064
15078
|
}
|
|
15065
15079
|
else
|
|
15066
|
-
|
|
15080
|
+
arrayPushArray(it.start, it.sep);
|
|
15067
15081
|
delete it.sep;
|
|
15068
15082
|
}
|
|
15069
15083
|
}
|
|
@@ -15483,7 +15497,7 @@ function requireParser () {
|
|
|
15483
15497
|
const prev = map.items[map.items.length - 2];
|
|
15484
15498
|
const end = prev?.value?.end;
|
|
15485
15499
|
if (Array.isArray(end)) {
|
|
15486
|
-
|
|
15500
|
+
arrayPushArray(end, it.start);
|
|
15487
15501
|
end.push(this.sourceToken);
|
|
15488
15502
|
map.items.pop();
|
|
15489
15503
|
return;
|
|
@@ -15698,7 +15712,7 @@ function requireParser () {
|
|
|
15698
15712
|
const prev = seq.items[seq.items.length - 2];
|
|
15699
15713
|
const end = prev?.value?.end;
|
|
15700
15714
|
if (Array.isArray(end)) {
|
|
15701
|
-
|
|
15715
|
+
arrayPushArray(end, it.start);
|
|
15702
15716
|
end.push(this.sourceToken);
|
|
15703
15717
|
seq.items.pop();
|
|
15704
15718
|
return;
|
|
@@ -16124,8 +16138,183 @@ function requireDist () {
|
|
|
16124
16138
|
|
|
16125
16139
|
var distExports = requireDist();
|
|
16126
16140
|
|
|
16127
|
-
|
|
16128
|
-
|
|
16141
|
+
var ai_profile_schema_default = {
|
|
16142
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
16143
|
+
$id: "https://agent-profile.local/schemas/ai-profile.schema.json",
|
|
16144
|
+
title: "Agent Profile",
|
|
16145
|
+
description: "Version 1 canonical profile for Agent Profile Compiler.",
|
|
16146
|
+
type: "object",
|
|
16147
|
+
additionalProperties: false,
|
|
16148
|
+
required: [
|
|
16149
|
+
"version",
|
|
16150
|
+
"profile",
|
|
16151
|
+
"stack",
|
|
16152
|
+
"clients",
|
|
16153
|
+
"workflow"
|
|
16154
|
+
],
|
|
16155
|
+
properties: {
|
|
16156
|
+
"version": {
|
|
16157
|
+
"type": "integer",
|
|
16158
|
+
"const": 1
|
|
16159
|
+
},
|
|
16160
|
+
"profile": {
|
|
16161
|
+
"type": "object",
|
|
16162
|
+
"additionalProperties": false,
|
|
16163
|
+
"required": ["name", "description"],
|
|
16164
|
+
"properties": {
|
|
16165
|
+
"name": {
|
|
16166
|
+
"type": "string",
|
|
16167
|
+
"minLength": 1,
|
|
16168
|
+
"pattern": "^[a-z0-9][a-z0-9._-]*$"
|
|
16169
|
+
},
|
|
16170
|
+
"description": {
|
|
16171
|
+
"type": "string",
|
|
16172
|
+
"minLength": 1
|
|
16173
|
+
}
|
|
16174
|
+
}
|
|
16175
|
+
},
|
|
16176
|
+
"stack": {
|
|
16177
|
+
"type": "object",
|
|
16178
|
+
"additionalProperties": false,
|
|
16179
|
+
"required": [
|
|
16180
|
+
"languages",
|
|
16181
|
+
"frameworks",
|
|
16182
|
+
"packageManagers",
|
|
16183
|
+
"testing"
|
|
16184
|
+
],
|
|
16185
|
+
"properties": {
|
|
16186
|
+
"languages": { "$ref": "#/definitions/nonEmptySlugArray" },
|
|
16187
|
+
"frameworks": { "$ref": "#/definitions/slugArray" },
|
|
16188
|
+
"packageManagers": { "$ref": "#/definitions/slugArray" },
|
|
16189
|
+
"testing": { "$ref": "#/definitions/slugArray" }
|
|
16190
|
+
}
|
|
16191
|
+
},
|
|
16192
|
+
"clients": {
|
|
16193
|
+
"type": "object",
|
|
16194
|
+
"additionalProperties": false,
|
|
16195
|
+
"required": [
|
|
16196
|
+
"tabnine",
|
|
16197
|
+
"codex",
|
|
16198
|
+
"claude"
|
|
16199
|
+
],
|
|
16200
|
+
"properties": {
|
|
16201
|
+
"tabnine": { "$ref": "#/definitions/client" },
|
|
16202
|
+
"codex": { "$ref": "#/definitions/client" },
|
|
16203
|
+
"claude": { "$ref": "#/definitions/client" }
|
|
16204
|
+
}
|
|
16205
|
+
},
|
|
16206
|
+
"safety": {
|
|
16207
|
+
"type": "object",
|
|
16208
|
+
"additionalProperties": false,
|
|
16209
|
+
"properties": {
|
|
16210
|
+
"mode": { "$ref": "#/definitions/safetyMode" },
|
|
16211
|
+
"requiresSandbox": { "type": "boolean" }
|
|
16212
|
+
}
|
|
16213
|
+
},
|
|
16214
|
+
"workflow": {
|
|
16215
|
+
"type": "object",
|
|
16216
|
+
"additionalProperties": false,
|
|
16217
|
+
"required": [
|
|
16218
|
+
"sdd",
|
|
16219
|
+
"tdd",
|
|
16220
|
+
"finalReview"
|
|
16221
|
+
],
|
|
16222
|
+
"properties": {
|
|
16223
|
+
"sdd": { "type": "boolean" },
|
|
16224
|
+
"tdd": { "type": "boolean" },
|
|
16225
|
+
"finalReview": { "type": "boolean" }
|
|
16226
|
+
}
|
|
16227
|
+
},
|
|
16228
|
+
"permissions": {
|
|
16229
|
+
"type": "object",
|
|
16230
|
+
"additionalProperties": false,
|
|
16231
|
+
"properties": {
|
|
16232
|
+
"filesystem": {
|
|
16233
|
+
"type": "object",
|
|
16234
|
+
"additionalProperties": false,
|
|
16235
|
+
"properties": {
|
|
16236
|
+
"read": { "$ref": "#/definitions/permissionMode" },
|
|
16237
|
+
"write": { "$ref": "#/definitions/permissionMode" }
|
|
16238
|
+
}
|
|
16239
|
+
},
|
|
16240
|
+
"shell": {
|
|
16241
|
+
"type": "object",
|
|
16242
|
+
"additionalProperties": false,
|
|
16243
|
+
"properties": { "run": { "$ref": "#/definitions/permissionMode" } }
|
|
16244
|
+
},
|
|
16245
|
+
"secrets": {
|
|
16246
|
+
"type": "object",
|
|
16247
|
+
"additionalProperties": false,
|
|
16248
|
+
"properties": { "access": {
|
|
16249
|
+
"type": "string",
|
|
16250
|
+
"const": "deny"
|
|
16251
|
+
} }
|
|
16252
|
+
},
|
|
16253
|
+
"dependencies": {
|
|
16254
|
+
"type": "object",
|
|
16255
|
+
"additionalProperties": false,
|
|
16256
|
+
"properties": { "install": { "$ref": "#/definitions/permissionMode" } }
|
|
16257
|
+
},
|
|
16258
|
+
"network": {
|
|
16259
|
+
"type": "object",
|
|
16260
|
+
"additionalProperties": false,
|
|
16261
|
+
"properties": { "external": { "$ref": "#/definitions/permissionMode" } }
|
|
16262
|
+
},
|
|
16263
|
+
"production": {
|
|
16264
|
+
"type": "object",
|
|
16265
|
+
"additionalProperties": false,
|
|
16266
|
+
"properties": { "access": {
|
|
16267
|
+
"type": "string",
|
|
16268
|
+
"const": "deny"
|
|
16269
|
+
} }
|
|
16270
|
+
}
|
|
16271
|
+
}
|
|
16272
|
+
}
|
|
16273
|
+
},
|
|
16274
|
+
definitions: {
|
|
16275
|
+
"client": {
|
|
16276
|
+
"type": "object",
|
|
16277
|
+
"additionalProperties": false,
|
|
16278
|
+
"required": ["enabled"],
|
|
16279
|
+
"properties": { "enabled": { "type": "boolean" } }
|
|
16280
|
+
},
|
|
16281
|
+
"permissionMode": {
|
|
16282
|
+
"type": "string",
|
|
16283
|
+
"enum": [
|
|
16284
|
+
"allow",
|
|
16285
|
+
"ask",
|
|
16286
|
+
"deny"
|
|
16287
|
+
]
|
|
16288
|
+
},
|
|
16289
|
+
"safetyMode": {
|
|
16290
|
+
"type": "string",
|
|
16291
|
+
"enum": [
|
|
16292
|
+
"guarded",
|
|
16293
|
+
"balanced",
|
|
16294
|
+
"autonomous",
|
|
16295
|
+
"plan-only"
|
|
16296
|
+
]
|
|
16297
|
+
},
|
|
16298
|
+
"slug": {
|
|
16299
|
+
"type": "string",
|
|
16300
|
+
"minLength": 1,
|
|
16301
|
+
"pattern": "^[a-z0-9][a-z0-9._-]*$"
|
|
16302
|
+
},
|
|
16303
|
+
"slugArray": {
|
|
16304
|
+
"type": "array",
|
|
16305
|
+
"uniqueItems": true,
|
|
16306
|
+
"items": { "$ref": "#/definitions/slug" }
|
|
16307
|
+
},
|
|
16308
|
+
"nonEmptySlugArray": {
|
|
16309
|
+
"type": "array",
|
|
16310
|
+
"minItems": 1,
|
|
16311
|
+
"uniqueItems": true,
|
|
16312
|
+
"items": { "$ref": "#/definitions/slug" }
|
|
16313
|
+
}
|
|
16314
|
+
}
|
|
16315
|
+
};
|
|
16316
|
+
//#endregion
|
|
16317
|
+
//#region ../../packages/core/src/profile.ts
|
|
16129
16318
|
var compiledValidator;
|
|
16130
16319
|
var DEFAULT_SAFETY = {
|
|
16131
16320
|
mode: "guarded",
|
|
@@ -16227,6 +16416,86 @@ function normalizeSafety(profile) {
|
|
|
16227
16416
|
requiresSandbox: profile.safety?.requiresSandbox ?? DEFAULT_SAFETY.requiresSandbox
|
|
16228
16417
|
};
|
|
16229
16418
|
}
|
|
16419
|
+
/**
|
|
16420
|
+
* Serialize a validated AiProfile to deterministic YAML.
|
|
16421
|
+
*
|
|
16422
|
+
* - UTF-8, single trailing newline.
|
|
16423
|
+
* - Schema field order: version, profile, stack, clients, safety, workflow, permissions.
|
|
16424
|
+
* - Optional safety / permissions omitted when absent on the input object.
|
|
16425
|
+
* - Empty arrays render as [].
|
|
16426
|
+
* - Deterministic: two calls on the same object produce byte-identical output.
|
|
16427
|
+
*/
|
|
16428
|
+
function renderProfileYaml(profile) {
|
|
16429
|
+
const doc = {};
|
|
16430
|
+
doc["version"] = profile.version;
|
|
16431
|
+
doc["profile"] = {
|
|
16432
|
+
name: profile.profile.name,
|
|
16433
|
+
description: profile.profile.description
|
|
16434
|
+
};
|
|
16435
|
+
doc["stack"] = {
|
|
16436
|
+
languages: profile.stack.languages,
|
|
16437
|
+
frameworks: profile.stack.frameworks,
|
|
16438
|
+
packageManagers: profile.stack.packageManagers,
|
|
16439
|
+
testing: profile.stack.testing
|
|
16440
|
+
};
|
|
16441
|
+
doc["clients"] = {
|
|
16442
|
+
tabnine: { enabled: profile.clients.tabnine.enabled },
|
|
16443
|
+
codex: { enabled: profile.clients.codex.enabled },
|
|
16444
|
+
claude: { enabled: profile.clients.claude.enabled }
|
|
16445
|
+
};
|
|
16446
|
+
if (profile.safety !== void 0) {
|
|
16447
|
+
const safety = {};
|
|
16448
|
+
if (profile.safety.mode !== void 0) safety["mode"] = profile.safety.mode;
|
|
16449
|
+
if (profile.safety.requiresSandbox !== void 0) safety["requiresSandbox"] = profile.safety.requiresSandbox;
|
|
16450
|
+
doc["safety"] = safety;
|
|
16451
|
+
}
|
|
16452
|
+
doc["workflow"] = {
|
|
16453
|
+
sdd: profile.workflow.sdd,
|
|
16454
|
+
tdd: profile.workflow.tdd,
|
|
16455
|
+
finalReview: profile.workflow.finalReview
|
|
16456
|
+
};
|
|
16457
|
+
if (profile.permissions !== void 0) doc["permissions"] = buildPermissionsDoc(profile.permissions);
|
|
16458
|
+
return distExports.stringify(doc, {
|
|
16459
|
+
lineWidth: 0,
|
|
16460
|
+
indent: 2,
|
|
16461
|
+
sortMapEntries: false
|
|
16462
|
+
}).replace(/\n+$/, "") + "\n";
|
|
16463
|
+
}
|
|
16464
|
+
function buildPermissionsDoc(p) {
|
|
16465
|
+
const doc = {};
|
|
16466
|
+
if (p.filesystem !== void 0) {
|
|
16467
|
+
const fs = {};
|
|
16468
|
+
if (p.filesystem.read !== void 0) fs["read"] = p.filesystem.read;
|
|
16469
|
+
if (p.filesystem.write !== void 0) fs["write"] = p.filesystem.write;
|
|
16470
|
+
if (Object.keys(fs).length > 0) doc["filesystem"] = fs;
|
|
16471
|
+
}
|
|
16472
|
+
if (p.shell !== void 0) {
|
|
16473
|
+
const sh = {};
|
|
16474
|
+
if (p.shell.run !== void 0) sh["run"] = p.shell.run;
|
|
16475
|
+
if (Object.keys(sh).length > 0) doc["shell"] = sh;
|
|
16476
|
+
}
|
|
16477
|
+
if (p.secrets !== void 0) {
|
|
16478
|
+
const sec = {};
|
|
16479
|
+
if (p.secrets.access !== void 0) sec["access"] = p.secrets.access;
|
|
16480
|
+
if (Object.keys(sec).length > 0) doc["secrets"] = sec;
|
|
16481
|
+
}
|
|
16482
|
+
if (p.dependencies !== void 0) {
|
|
16483
|
+
const dep = {};
|
|
16484
|
+
if (p.dependencies.install !== void 0) dep["install"] = p.dependencies.install;
|
|
16485
|
+
if (Object.keys(dep).length > 0) doc["dependencies"] = dep;
|
|
16486
|
+
}
|
|
16487
|
+
if (p.network !== void 0) {
|
|
16488
|
+
const net = {};
|
|
16489
|
+
if (p.network.external !== void 0) net["external"] = p.network.external;
|
|
16490
|
+
if (Object.keys(net).length > 0) doc["network"] = net;
|
|
16491
|
+
}
|
|
16492
|
+
if (p.production !== void 0) {
|
|
16493
|
+
const prod = {};
|
|
16494
|
+
if (p.production.access !== void 0) prod["access"] = p.production.access;
|
|
16495
|
+
if (Object.keys(prod).length > 0) doc["production"] = prod;
|
|
16496
|
+
}
|
|
16497
|
+
return doc;
|
|
16498
|
+
}
|
|
16230
16499
|
function deriveEffectivePermissions(profile) {
|
|
16231
16500
|
const safety = normalizeSafety(profile);
|
|
16232
16501
|
const permissions = profile.permissions ?? {};
|
|
@@ -16252,7 +16521,7 @@ function getRemoteRefs(schema) {
|
|
|
16252
16521
|
collectRemoteRefs(schema, refs);
|
|
16253
16522
|
return refs.sort();
|
|
16254
16523
|
}
|
|
16255
|
-
function compileProfileSchema(schema =
|
|
16524
|
+
function compileProfileSchema(schema = ai_profile_schema_default) {
|
|
16256
16525
|
assertNoRemoteRefs(schema);
|
|
16257
16526
|
return new ajvExports.Ajv({
|
|
16258
16527
|
allErrors: true,
|
|
@@ -16368,12 +16637,13 @@ function isRecord$1(value) {
|
|
|
16368
16637
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16369
16638
|
}
|
|
16370
16639
|
//#endregion
|
|
16371
|
-
//#region ../../packages/core/
|
|
16640
|
+
//#region ../../packages/core/src/security.ts
|
|
16372
16641
|
function containsSecretLikeLiteral(text) {
|
|
16373
16642
|
return text.includes("SECRET_TOKEN_VALUE") || /-----BEGIN [A-Z ]*PRIVATE KEY-----/u.test(text) || /\b(?:api[_-]?key|token|secret|password)\b\s*[:=]\s*["']?(?!\$)[A-Za-z0-9_./+=-]{10,}/iu.test(text);
|
|
16374
16643
|
}
|
|
16375
|
-
|
|
16376
|
-
|
|
16644
|
+
new TextDecoder("utf-8", { fatal: true });
|
|
16645
|
+
|
|
16646
|
+
//#region ../../packages/compiler/src/shared.ts
|
|
16377
16647
|
var AGENT_PROFILE_COMPILER = {
|
|
16378
16648
|
name: "agent-profile",
|
|
16379
16649
|
version: "0.1.0"
|
|
@@ -16423,7 +16693,7 @@ function compareText(left, right) {
|
|
|
16423
16693
|
return 0;
|
|
16424
16694
|
}
|
|
16425
16695
|
//#endregion
|
|
16426
|
-
//#region ../../packages/compiler/
|
|
16696
|
+
//#region ../../packages/compiler/src/lockfile.ts
|
|
16427
16697
|
function buildLockfile(input) {
|
|
16428
16698
|
return {
|
|
16429
16699
|
version: 1,
|
|
@@ -16658,7 +16928,7 @@ function compareLockOutputs(left, right) {
|
|
|
16658
16928
|
return compareText(left.path, right.path) || compareText(left.target, right.target);
|
|
16659
16929
|
}
|
|
16660
16930
|
//#endregion
|
|
16661
|
-
//#region ../../packages/compiler/
|
|
16931
|
+
//#region ../../packages/compiler/src/compiler.ts
|
|
16662
16932
|
var WORKFLOW_SKILLS = [
|
|
16663
16933
|
{
|
|
16664
16934
|
id: "sdd-change",
|
|
@@ -17227,6 +17497,101 @@ function compareIssues(left, right) {
|
|
|
17227
17497
|
return compareText(left.path, right.path) || compareText(left.code, right.code) || compareText(left.message, right.message);
|
|
17228
17498
|
}
|
|
17229
17499
|
//#endregion
|
|
17500
|
+
//#region ../../packages/compiler/src/write-plan.ts
|
|
17501
|
+
function isContainedBy(rootPath, candidatePath) {
|
|
17502
|
+
const relative = path.relative(rootPath, candidatePath);
|
|
17503
|
+
return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
17504
|
+
}
|
|
17505
|
+
function isNodeError(error) {
|
|
17506
|
+
return error instanceof Error && "code" in error;
|
|
17507
|
+
}
|
|
17508
|
+
var PROFILE_FILENAME$1 = "ai-profile.yaml";
|
|
17509
|
+
var ProfileWriteError = class extends Error {
|
|
17510
|
+
code;
|
|
17511
|
+
constructor(code, message) {
|
|
17512
|
+
super(message);
|
|
17513
|
+
this.code = code;
|
|
17514
|
+
this.name = "ProfileWriteError";
|
|
17515
|
+
}
|
|
17516
|
+
};
|
|
17517
|
+
/**
|
|
17518
|
+
* Atomically write ai-profile.yaml after verifying:
|
|
17519
|
+
* - the target resolves within rootDir (path containment)
|
|
17520
|
+
* - the target is not a symlink
|
|
17521
|
+
* - the current on-disk ETag matches baseEtag (stale-check)
|
|
17522
|
+
*
|
|
17523
|
+
* Writes via temp-file + rename for atomicity.
|
|
17524
|
+
* Returns the new ETag of the written file.
|
|
17525
|
+
*
|
|
17526
|
+
* Phase 8 does NOT create a missing profile; callers must ensure the file
|
|
17527
|
+
* already exists.
|
|
17528
|
+
*/
|
|
17529
|
+
async function writeProfileAtomic(rootDir, candidateBytes, baseEtag) {
|
|
17530
|
+
const rootRealPath = await fsPromises.realpath(path.resolve(rootDir));
|
|
17531
|
+
const targetAbsolute = path.join(rootRealPath, PROFILE_FILENAME$1);
|
|
17532
|
+
if (!isContainedBy(rootRealPath, targetAbsolute)) throw new ProfileWriteError("traversal", "Profile path escapes root.");
|
|
17533
|
+
let targetStat;
|
|
17534
|
+
try {
|
|
17535
|
+
targetStat = await fsPromises.lstat(targetAbsolute);
|
|
17536
|
+
} catch (err) {
|
|
17537
|
+
if (isNodeError(err) && err.code === "ENOENT") throw new ProfileWriteError("not_found", "ai-profile.yaml not found; run agent-profile init --write.");
|
|
17538
|
+
throw err;
|
|
17539
|
+
}
|
|
17540
|
+
if (targetStat.isSymbolicLink()) throw new ProfileWriteError("symlink", "ai-profile.yaml is a symlink; refusing to write.");
|
|
17541
|
+
const currentEtag = computeFileEtag(await fsPromises.readFile(targetAbsolute));
|
|
17542
|
+
if (currentEtag !== baseEtag) throw new ProfileWriteError("stale", "Profile has changed since last read; reload and retry.");
|
|
17543
|
+
const candidateEtag = computeFileEtag(candidateBytes);
|
|
17544
|
+
if (candidateEtag === currentEtag) return {
|
|
17545
|
+
action: "unchanged",
|
|
17546
|
+
bytes: candidateBytes.length,
|
|
17547
|
+
etag: candidateEtag
|
|
17548
|
+
};
|
|
17549
|
+
const tempName = `ai-profile.yaml.tmp-${randomBytes(8).toString("hex")}`;
|
|
17550
|
+
const tempAbsolute = path.join(rootRealPath, tempName);
|
|
17551
|
+
try {
|
|
17552
|
+
const fd = await fsPromises.open(tempAbsolute, "wx", 420);
|
|
17553
|
+
try {
|
|
17554
|
+
await fd.write(candidateBytes);
|
|
17555
|
+
await fd.sync();
|
|
17556
|
+
} finally {
|
|
17557
|
+
await fd.close();
|
|
17558
|
+
}
|
|
17559
|
+
await fsPromises.rename(tempAbsolute, targetAbsolute);
|
|
17560
|
+
await fsyncParentDirectory(rootRealPath);
|
|
17561
|
+
} catch (err) {
|
|
17562
|
+
try {
|
|
17563
|
+
await fsPromises.rm(tempAbsolute, { force: true });
|
|
17564
|
+
} catch {}
|
|
17565
|
+
throw err;
|
|
17566
|
+
}
|
|
17567
|
+
const writtenEtag = computeFileEtag(await fsPromises.readFile(targetAbsolute));
|
|
17568
|
+
if (writtenEtag !== candidateEtag) throw new ProfileWriteError("verify_failed", "Written bytes do not match expected hash.");
|
|
17569
|
+
return {
|
|
17570
|
+
action: "change",
|
|
17571
|
+
bytes: candidateBytes.length,
|
|
17572
|
+
etag: writtenEtag
|
|
17573
|
+
};
|
|
17574
|
+
}
|
|
17575
|
+
async function fsyncParentDirectory(directoryPath) {
|
|
17576
|
+
if (process.platform === "win32") return;
|
|
17577
|
+
let fd;
|
|
17578
|
+
try {
|
|
17579
|
+
fd = await fsPromises.open(directoryPath, "r");
|
|
17580
|
+
await fd.sync();
|
|
17581
|
+
} catch (err) {
|
|
17582
|
+
if (!isNodeError(err) || err.code !== "EINVAL" && err.code !== "EPERM") throw err;
|
|
17583
|
+
} finally {
|
|
17584
|
+
await fd?.close();
|
|
17585
|
+
}
|
|
17586
|
+
}
|
|
17587
|
+
/**
|
|
17588
|
+
* Compute an ETag for a file's bytes. Format: "sha256:<hex>".
|
|
17589
|
+
* Exposed so callers can compute the ETag for GET /api/profile responses.
|
|
17590
|
+
*/
|
|
17591
|
+
function computeFileEtag(bytes) {
|
|
17592
|
+
return "sha256:" + createHash("sha256").update(bytes).digest("hex");
|
|
17593
|
+
}
|
|
17594
|
+
//#endregion
|
|
17230
17595
|
//#region src/lib/server/projectContext.ts
|
|
17231
17596
|
var PROFILE_FILENAME = "ai-profile.yaml";
|
|
17232
17597
|
/**
|
|
@@ -17307,5 +17672,5 @@ function truncatePreview(text, capBytes = 256 * 1024) {
|
|
|
17307
17672
|
};
|
|
17308
17673
|
}
|
|
17309
17674
|
|
|
17310
|
-
export {
|
|
17311
|
-
//# sourceMappingURL=projectContext-
|
|
17675
|
+
export { ProfileWriteError as P, containsSecretLikeLiteral as a, createLockfileFile as b, compileProfile as c, sha256Hex as d, deriveEffectivePermissions as e, computeFileEtag as f, validateProfileValue as g, renderProfileYaml as h, redactIfSecretLike as i, loadProjectContext as l, normalizeSafety as n, parseProfileYaml as p, resolveProjectRoot as r, safeOutputPath as s, truncatePreview as t, validateLockfileText as v, writeProfileAtomic as w };
|
|
17676
|
+
//# sourceMappingURL=projectContext-Cxsfz84C.js.map
|