dispach 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -36
- package/dist/APEv2Parser-ysjr6adv.js +5 -0
- package/dist/{FlacParser-bf8y3e0w.js.map → APEv2Parser-ysjr6adv.js.map} +1 -1
- package/dist/{AiffParser-tbx3xkmk.js → AiffParser-9hj6fpmy.js} +3 -3
- package/dist/{AiffParser-tbx3xkmk.js.map → AiffParser-9hj6fpmy.js.map} +1 -1
- package/dist/App-2f72vhjv.js +11 -0
- package/dist/{App-hjn867nc.js.map → App-2f72vhjv.js.map} +3 -3
- package/dist/{AsfParser-d784ak3y.js → AsfParser-7emspn04.js} +3 -3
- package/dist/{AsfParser-d784ak3y.js.map → AsfParser-7emspn04.js.map} +1 -1
- package/dist/{ConfigEditor-g7eb2wsm.js → ConfigEditor-vk7vxaa6.js} +3 -3
- package/dist/{ConfigEditor-g7eb2wsm.js.map → ConfigEditor-vk7vxaa6.js.map} +1 -1
- package/dist/{DsdiffParser-vxnfx80c.js → DsdiffParser-dz88pnnr.js} +3 -3
- package/dist/{DsdiffParser-vxnfx80c.js.map → DsdiffParser-dz88pnnr.js.map} +1 -1
- package/dist/{DsfParser-0xsh0zzk.js → DsfParser-qgh63tbs.js} +3 -3
- package/dist/{DsfParser-0xsh0zzk.js.map → DsfParser-qgh63tbs.js.map} +1 -1
- package/dist/FlacParser-drm5wq0p.js +5 -0
- package/dist/{APEv2Parser-9wqew3zv.js.map → FlacParser-drm5wq0p.js.map} +1 -1
- package/dist/{KeyProbe-w8c37s9q.js → KeyProbe-5anphmb7.js} +3 -3
- package/dist/{KeyProbe-w8c37s9q.js.map → KeyProbe-5anphmb7.js.map} +1 -1
- package/dist/{MP4Parser-tq7r7wd4.js → MP4Parser-yr7p3z12.js} +3 -3
- package/dist/{MP4Parser-tq7r7wd4.js.map → MP4Parser-yr7p3z12.js.map} +1 -1
- package/dist/{MatroskaParser-a79gsmzb.js → MatroskaParser-jkbsbsk3.js} +3 -3
- package/dist/{MatroskaParser-a79gsmzb.js.map → MatroskaParser-jkbsbsk3.js.map} +1 -1
- package/dist/{MpegParser-zs61b3wq.js → MpegParser-t93vwnew.js} +3 -3
- package/dist/{MpegParser-zs61b3wq.js.map → MpegParser-t93vwnew.js.map} +1 -1
- package/dist/{MusepackParser-bp8dm6nz.js → MusepackParser-6e8kbh2d.js} +3 -3
- package/dist/{MusepackParser-bp8dm6nz.js.map → MusepackParser-6e8kbh2d.js.map} +1 -1
- package/dist/OggParser-ggcypmag.js +5 -0
- package/dist/{OggParser-7pxr1sn9.js.map → OggParser-ggcypmag.js.map} +1 -1
- package/dist/Picker-j7txnm7w.js +5 -0
- package/dist/{Picker-b09hr4tk.js.map → Picker-j7txnm7w.js.map} +1 -1
- package/dist/SessionPicker-hpv2ncsb.js +5 -0
- package/dist/{SessionPicker-wtfxwdxg.js.map → SessionPicker-hpv2ncsb.js.map} +3 -3
- package/dist/SkillBrowser-qc542n71.js +5 -0
- package/dist/{SkillBrowser-p9ht63c7.js.map → SkillBrowser-qc542n71.js.map} +1 -1
- package/dist/{WavPackParser-gpf3r92t.js → WavPackParser-jw9stzqp.js} +3 -3
- package/dist/{WavPackParser-gpf3r92t.js.map → WavPackParser-jw9stzqp.js.map} +1 -1
- package/dist/{WaveParser-3kcak550.js → WaveParser-epmncs9w.js} +3 -3
- package/dist/{WaveParser-3kcak550.js.map → WaveParser-epmncs9w.js.map} +1 -1
- package/dist/WizardApp-pgzcz9zq.js +5 -0
- package/dist/{WizardApp-494018sk.js.map → WizardApp-pgzcz9zq.js.map} +3 -3
- package/dist/{channels-yhdvxxrb.js → channels-m8nambmm.js} +14 -14
- package/dist/{channels-yhdvxxrb.js.map → channels-m8nambmm.js.map} +1 -1
- package/dist/client.d.ts +285 -1
- package/dist/client.js +11 -11
- package/dist/client.js.map +5 -5
- package/dist/components/App.d.ts.map +1 -1
- package/dist/{config-g0ybmm4t.js → config-hmgrqgf2.js} +17 -17
- package/dist/{config-g0ybmm4t.js.map → config-hmgrqgf2.js.map} +1 -1
- package/dist/{credential-pkme1sfe.js → credential-nkb2ya59.js} +5 -5
- package/dist/{credential-pkme1sfe.js.map → credential-nkb2ya59.js.map} +1 -1
- package/dist/{index-q8b1fc3k.js → index-0444sh6x.js} +4 -4
- package/dist/{index-q8b1fc3k.js.map → index-0444sh6x.js.map} +1 -1
- package/dist/{index-ec101x93.js → index-095hrkyr.js} +6 -6
- package/dist/{index-ec101x93.js.map → index-095hrkyr.js.map} +1 -1
- package/dist/index-1mbdz3f7.js +12 -0
- package/dist/{index-3fgq1acj.js.map → index-1mbdz3f7.js.map} +3 -3
- package/dist/index-1x8mzvz7.js +6 -0
- package/dist/{index-f056wkb4.js.map → index-1x8mzvz7.js.map} +1 -1
- package/dist/{index-633eqxry.js → index-22fzzn7z.js} +7 -7
- package/dist/{index-633eqxry.js.map → index-22fzzn7z.js.map} +1 -1
- package/dist/index-2bsardvh.js +5 -0
- package/dist/{index-9dmgk6d3.js.map → index-2bsardvh.js.map} +2 -2
- package/dist/{index-thmq816c.js → index-2zjh5zd5.js} +4 -4
- package/dist/{index-thmq816c.js.map → index-2zjh5zd5.js.map} +1 -1
- package/dist/{index-ad5c9t83.js → index-308y9xt0.js} +4 -4
- package/dist/{index-ad5c9t83.js.map → index-308y9xt0.js.map} +1 -1
- package/dist/{index-t6xnecdx.js → index-323jvr1g.js} +4 -4
- package/dist/{index-t6xnecdx.js.map → index-323jvr1g.js.map} +1 -1
- package/dist/{index-mn34kj95.js → index-3826kf9t.js} +5 -5
- package/dist/{index-mn34kj95.js.map → index-3826kf9t.js.map} +1 -1
- package/dist/index-38gs9anh.js +9 -0
- package/dist/{index-akv6e7ge.js.map → index-38gs9anh.js.map} +1 -1
- package/dist/index-3c5jt6by.js +5 -0
- package/dist/{index-3b3h8kyh.js.map → index-3c5jt6by.js.map} +2 -2
- package/dist/{index-a6mtqkth.js → index-3vzf253k.js} +7 -7
- package/dist/{index-a6mtqkth.js.map → index-3vzf253k.js.map} +1 -1
- package/dist/{index-5m9wydxb.js → index-42e29zs4.js} +4 -4
- package/dist/{index-5m9wydxb.js.map → index-42e29zs4.js.map} +1 -1
- package/dist/{index-v7mz396x.js → index-4fj1k64j.js} +4 -4
- package/dist/{index-v7mz396x.js.map → index-4fj1k64j.js.map} +1 -1
- package/dist/{index-s2tzq27a.js → index-51x0n5z0.js} +5 -5
- package/dist/{index-s2tzq27a.js.map → index-51x0n5z0.js.map} +1 -1
- package/dist/index-836hc2h1.js +6 -0
- package/dist/{index-xa9crtzq.js.map → index-836hc2h1.js.map} +2 -2
- package/dist/index-8edck2pr.js +6 -0
- package/dist/{index-7gsbzvnc.js.map → index-8edck2pr.js.map} +1 -1
- package/dist/index-8tmv33mr.js +6 -0
- package/dist/{index-vw2hf4d8.js.map → index-8tmv33mr.js.map} +1 -1
- package/dist/index-9t4dz145.js +8 -0
- package/dist/{index-0mz7wpbw.js.map → index-9t4dz145.js.map} +2 -2
- package/dist/{index-81vj1bxe.js → index-bqdkm3de.js} +4 -4
- package/dist/{index-81vj1bxe.js.map → index-bqdkm3de.js.map} +1 -1
- package/dist/index-djeqvfms.js +74 -0
- package/dist/index-djeqvfms.js.map +13 -0
- package/dist/{index-307qmvb0.js → index-dpcm1j62.js} +28 -28
- package/dist/{index-307qmvb0.js.map → index-dpcm1j62.js.map} +1 -1
- package/dist/index-dv9pdjy4.js +429 -0
- package/dist/index-dv9pdjy4.js.map +12 -0
- package/dist/{index-j20k6k0m.js → index-dzy19wtf.js} +4 -4
- package/dist/{index-j20k6k0m.js.map → index-dzy19wtf.js.map} +1 -1
- package/dist/{index-9qv87rq7.js → index-eztfverw.js} +7 -7
- package/dist/{index-9qv87rq7.js.map → index-eztfverw.js.map} +1 -1
- package/dist/{index-myg5enf5.js → index-fbsrhcga.js} +4 -4
- package/dist/{index-myg5enf5.js.map → index-fbsrhcga.js.map} +1 -1
- package/dist/{index-6r9h7ftn.js → index-fxpmx6cr.js} +117 -117
- package/dist/index-fxpmx6cr.js.map +21 -0
- package/dist/{index-ye2yb3xf.js → index-hgm2gchq.js} +6 -6
- package/dist/{index-ye2yb3xf.js.map → index-hgm2gchq.js.map} +1 -1
- package/dist/index-hpvfqq6r.js +1252 -0
- package/dist/{index-26ejkp8q.js.map → index-hpvfqq6r.js.map} +30 -26
- package/dist/{index-y34s71qe.js → index-hrwakb11.js} +3 -3
- package/dist/{index-y34s71qe.js.map → index-hrwakb11.js.map} +1 -1
- package/dist/{index-qh82wtpa.js → index-jc4kmfwa.js} +4 -4
- package/dist/{index-qh82wtpa.js.map → index-jc4kmfwa.js.map} +1 -1
- package/dist/{index-twcgf73h.js → index-jff5q27j.js} +4 -4
- package/dist/{index-twcgf73h.js.map → index-jff5q27j.js.map} +1 -1
- package/dist/index-k8e9f466.js +110 -0
- package/dist/index-k8e9f466.js.map +13 -0
- package/dist/{index-trx9xb59.js → index-m6fqx0ch.js} +7 -7
- package/dist/{index-trx9xb59.js.map → index-m6fqx0ch.js.map} +1 -1
- package/dist/{index-ac2wzspd.js → index-mjfv7k5w.js} +4 -4
- package/dist/{index-ac2wzspd.js.map → index-mjfv7k5w.js.map} +1 -1
- package/dist/index-nvc24414.js +6 -0
- package/dist/{index-1f1erzfx.js.map → index-nvc24414.js.map} +1 -1
- package/dist/index-nxhqf597.js +6 -0
- package/dist/{index-w97gprre.js.map → index-nxhqf597.js.map} +1 -1
- package/dist/{index-jh2az41t.js → index-p6ya59m6.js} +5 -5
- package/dist/{index-jh2az41t.js.map → index-p6ya59m6.js.map} +1 -1
- package/dist/{index-psk6q25h.js → index-pqw1n1pv.js} +4 -4
- package/dist/{index-psk6q25h.js.map → index-pqw1n1pv.js.map} +1 -1
- package/dist/{index-6c4p19m1.js → index-pszmnhgq.js} +2 -2
- package/dist/index-qgsdgbk8.js +5 -0
- package/dist/{index-wk6andxq.js.map → index-qgsdgbk8.js.map} +2 -2
- package/dist/index-qv6ktepc.js +6 -0
- package/dist/index-qv6ktepc.js.map +10 -0
- package/dist/{index-pdsey1ab.js → index-ry6a4bqh.js} +62 -62
- package/dist/{index-pdsey1ab.js.map → index-ry6a4bqh.js.map} +1 -1
- package/dist/{index-x9z2xnct.js → index-sh44ymqz.js} +5 -5
- package/dist/{index-x9z2xnct.js.map → index-sh44ymqz.js.map} +1 -1
- package/dist/{index-zg89tq04.js → index-snz49ndn.js} +4 -4
- package/dist/{index-zg89tq04.js.map → index-snz49ndn.js.map} +1 -1
- package/dist/{index-zjphh8ch.js → index-xg7s813b.js} +4 -4
- package/dist/{index-zjphh8ch.js.map → index-xg7s813b.js.map} +1 -1
- package/dist/{index-gqaa06yh.js → index-y7dxq4a4.js} +9 -9
- package/dist/{index-gqaa06yh.js.map → index-y7dxq4a4.js.map} +1 -1
- package/dist/index-ytxbw8py.js +63 -0
- package/dist/{index-0pddq849.js.map → index-ytxbw8py.js.map} +2 -2
- package/dist/index-yw3fby4n.js +6 -0
- package/dist/{index-4emtktc0.js.map → index-yw3fby4n.js.map} +2 -2
- package/dist/{index-skkddg44.js → index-zw6wyas6.js} +4 -4
- package/dist/{index-skkddg44.js.map → index-zw6wyas6.js.map} +1 -1
- package/dist/index.js +304 -288
- package/dist/index.js.map +15 -12
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/agent-template.d.ts +5 -0
- package/dist/lib/agent-template.d.ts.map +1 -1
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/init-flow.d.ts +7 -30
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/owner.d.ts +49 -0
- package/dist/lib/owner.d.ts.map +1 -0
- package/dist/lib/presets.d.ts +44 -0
- package/dist/lib/presets.d.ts.map +1 -0
- package/dist/lib/provision.d.ts +8 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/lib/relay-client.d.ts +17 -0
- package/dist/lib/relay-client.d.ts.map +1 -0
- package/dist/lib/schema.d.ts +2 -0
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/sessions-view.d.ts +2 -0
- package/dist/lib/sessions-view.d.ts.map +1 -1
- package/dist/lib/source.d.ts +25 -0
- package/dist/lib/source.d.ts.map +1 -1
- package/dist/lib/types.d.ts +8 -2
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/wizard.d.ts.map +1 -1
- package/dist/owner.d.ts +16 -0
- package/dist/owner.d.ts.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/transcript.d.ts.map +1 -1
- package/dist/{web-f6869dy2.js → web-gfv0mzgs.js} +7 -7
- package/dist/{web-f6869dy2.js.map → web-gfv0mzgs.js.map} +1 -1
- package/dist/wire.d.ts +50 -0
- package/dist/wire.js +5 -5
- package/dist/wire.js.map +4 -4
- package/dist/wrapper-f662ny3r.js +5 -0
- package/dist/{wrapper-52c0vacs.js.map → wrapper-f662ny3r.js.map} +1 -1
- package/package.json +4 -1
- package/dist/APEv2Parser-9wqew3zv.js +0 -5
- package/dist/App-hjn867nc.js +0 -11
- package/dist/FlacParser-bf8y3e0w.js +0 -5
- package/dist/OggParser-7pxr1sn9.js +0 -5
- package/dist/Picker-b09hr4tk.js +0 -5
- package/dist/SessionPicker-wtfxwdxg.js +0 -5
- package/dist/SkillBrowser-p9ht63c7.js +0 -5
- package/dist/WizardApp-494018sk.js +0 -5
- package/dist/index-0mz7wpbw.js +0 -8
- package/dist/index-0pddq849.js +0 -63
- package/dist/index-1f1erzfx.js +0 -6
- package/dist/index-26ejkp8q.js +0 -1194
- package/dist/index-3b3h8kyh.js +0 -5
- package/dist/index-3fgq1acj.js +0 -12
- package/dist/index-4emtktc0.js +0 -6
- package/dist/index-4t3p7vm9.js +0 -6
- package/dist/index-4t3p7vm9.js.map +0 -10
- package/dist/index-6r9h7ftn.js.map +0 -21
- package/dist/index-7gsbzvnc.js +0 -6
- package/dist/index-94k4mh6s.js +0 -96
- package/dist/index-94k4mh6s.js.map +0 -13
- package/dist/index-9dmgk6d3.js +0 -5
- package/dist/index-akv6e7ge.js +0 -9
- package/dist/index-f056wkb4.js +0 -6
- package/dist/index-s57ztjhq.js +0 -74
- package/dist/index-s57ztjhq.js.map +0 -13
- package/dist/index-vw2hf4d8.js +0 -6
- package/dist/index-w97gprre.js +0 -6
- package/dist/index-wk6andxq.js +0 -5
- package/dist/index-xa9crtzq.js +0 -6
- package/dist/index-z0dgxd7d.js +0 -429
- package/dist/index-z0dgxd7d.js.map +0 -11
- package/dist/wrapper-52c0vacs.js +0 -5
- /package/dist/{index-6c4p19m1.js.map → index-pszmnhgq.js.map} +0 -0
package/dist/index-9dmgk6d3.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{Te,le,V,He,X,gt,yt,K,ct,Xe,Ce,WA,$e,lt,Qt,zA,ZA}from"./index-0pddq849.js";var{awsEndpointFunctions:Us,emitWarningIfUnsupportedVersion:ws,createDefaultUserAgentProvider:Hs,NODE_APP_ID_CONFIG_OPTIONS:js,getAwsRegionExtensionConfiguration:zs,resolveAwsRegionExtensionConfiguration:Bs,resolveUserAgentConfig:qs,resolveHostHeaderConfig:Ks,getUserAgentPlugin:Js,getHostHeaderPlugin:Zs,getLoggerPlugin:Qs,getRecursionDetectionPlugin:Ws}=Ce(),{resolveEventStreamConfig:Xs,getEventStreamPlugin:Ys}=WA(),{getHttpAuthSchemeEndpointRuleSetPlugin:en,DefaultIdentityProviderConfig:tn,getHttpSigningPlugin:sn,createPaginator:nn}=Xe(),{normalizeProvider:Ke,getSmithyContext:on,ServiceException:rn,NoOpLogger:an,emitWarningIfUnsupportedVersion:cn,loadConfigsForDefaultMode:pn,getDefaultExtensionConfiguration:un,resolveDefaultRuntimeConfig:ln,Client:Je,makeBuilder:dn,createAggregatedClient:Sn}=le(),{Command:xn}=le();var Ri=xn,Di=Je;var{resolveDefaultsModeConfig:hn,loadConfig:L,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:En,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:mn,NODE_REGION_CONFIG_OPTIONS:_n,NODE_REGION_CONFIG_FILE_OPTIONS:gn,resolveRegionConfig:vn}=V(),{BinaryDecisionDiagram:Ln,EndpointCache:Tn,decideEndpoint:yn,customEndpointFunctions:In,resolveEndpointConfig:$n,getEndpointPlugin:On}=He(),{eventStreamSerdeProvider:fn,resolveEventStreamSerdeConfig:Pn}=yt(),{parseUrl:An,getHttpHandlerExtensionConfiguration:Cn,resolveHttpHandlerRuntimeConfig:Nn,getContentLengthPlugin:kn}=K(),{DEFAULT_RETRY_MODE:Rn,NODE_RETRY_MODE_CONFIG_OPTIONS:Dn,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:bn,resolveRetryConfig:Fn,getRetryPlugin:Mn}=ct(),{TypeRegistry:Ze,getSchemaSerdePlugin:Gn}=Te(),{resolveAwsSdkSigV4Config:Vn,AwsSdkSigV4Signer:Un,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:wn}=$e(),{defaultProvider:Hn}=zA(),{eventStreamPayloadHandlerProvider:jn}=ZA(),{toUtf8:zn,fromUtf8:Bn,sdkStreamMixin:qn,toBase64:Kn,fromBase64:Jn,calculateBodyLength:Zn}=X(),{streamCollector:Qn,NodeHttp2Handler:Wn}=lt(),{AwsRestJsonProtocol:Xn}=Qt(),{Sha256:Yn}=gt(),eo=async(e,s,p)=>({operation:on(s).operation,region:await Ke(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function to(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"polly",region:e.region},propertiesExtractor:(s,p)=>({signingProperties:{config:s,context:p}})}}var so=(e)=>{let s=[];switch(e.operation){default:s.push(to(e))}return s},no=(e)=>{let s=Vn(e);return Object.assign(s,{authSchemePreference:Ke(e.authSchemePreference??[])})},oo=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"polly"}),ro={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},io="3.1140.0",ao={version:io},f="ref",T=-1,A=!0,Me="isSet",Qe="PartitionResult",C="booleanEquals",Ge="getAttr",Ve={[f]:"Endpoint"},Ue={[f]:Qe},O={},we=[{[f]:"Region"}],je={conditions:[[Me,[Ve]],[Me,we],["aws.partition",we,Qe],[C,[{[f]:"UseFIPS"},A]],[C,[{[f]:"UseDualStack"},A]],[C,[{fn:Ge,argv:[Ue,"supportsDualStack"]},A]],[C,[{fn:Ge,argv:[Ue,"supportsFIPS"]},A]]],results:[[T],[T,"Invalid Configuration: FIPS and custom endpoint are not supported"],[T,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[Ve,O],["https://polly-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",O],[T,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://polly-fips.{Region}.{PartitionResult#dnsSuffix}",O],[T,"FIPS is enabled but this partition does not support FIPS"],["https://polly.{Region}.{PartitionResult#dualStackDnsSuffix}",O],[T,"DualStack is enabled but this partition does not support DualStack"],["https://polly.{Region}.{PartitionResult#dnsSuffix}",O],[T,"Invalid Configuration: Missing Region"]]},co=2,l=1e8,po=new Int32Array([-1,1,-1,0,12,3,1,4,l+11,2,5,l+11,3,8,6,4,7,l+10,5,l+8,l+9,4,10,9,6,l+6,l+7,5,11,l+5,6,l+4,l+5,3,l+1,13,4,l+2,l+3]),uo=Ln.from(po,co,je.conditions,je.results),lo=new Tn({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),So=(e,s={})=>lo.get(e,()=>yn(uo,{endpointParams:e,logger:s.logger}));In.aws=Us;class n extends rn{constructor(e){super(e);Object.setPrototypeOf(this,n.prototype)}}class N extends n{name="LexiconNotFoundException";$fault="client";constructor(e){super({name:"LexiconNotFoundException",$fault:"client",...e});Object.setPrototypeOf(this,N.prototype)}}class k extends n{name="ServiceFailureException";$fault="server";constructor(e){super({name:"ServiceFailureException",$fault:"server",...e});Object.setPrototypeOf(this,k.prototype)}}class R extends n{name="InvalidNextTokenException";$fault="client";constructor(e){super({name:"InvalidNextTokenException",$fault:"client",...e});Object.setPrototypeOf(this,R.prototype)}}class D extends n{name="EngineNotSupportedException";$fault="client";constructor(e){super({name:"EngineNotSupportedException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype)}}class b extends n{name="InvalidTaskIdException";$fault="client";constructor(e){super({name:"InvalidTaskIdException",$fault:"client",...e});Object.setPrototypeOf(this,b.prototype)}}class F extends n{name="SynthesisTaskNotFoundException";$fault="client";constructor(e){super({name:"SynthesisTaskNotFoundException",$fault:"client",...e});Object.setPrototypeOf(this,F.prototype)}}class M extends n{name="InvalidLexiconException";$fault="client";constructor(e){super({name:"InvalidLexiconException",$fault:"client",...e});Object.setPrototypeOf(this,M.prototype)}}class G extends n{name="InvalidS3BucketException";$fault="client";constructor(e){super({name:"InvalidS3BucketException",$fault:"client",...e});Object.setPrototypeOf(this,G.prototype)}}class U extends n{name="InvalidS3KeyException";$fault="client";constructor(e){super({name:"InvalidS3KeyException",$fault:"client",...e});Object.setPrototypeOf(this,U.prototype)}}class w extends n{name="InvalidSampleRateException";$fault="client";constructor(e){super({name:"InvalidSampleRateException",$fault:"client",...e});Object.setPrototypeOf(this,w.prototype)}}class H extends n{name="InvalidSnsTopicArnException";$fault="client";constructor(e){super({name:"InvalidSnsTopicArnException",$fault:"client",...e});Object.setPrototypeOf(this,H.prototype)}}class j extends n{name="InvalidSsmlException";$fault="client";constructor(e){super({name:"InvalidSsmlException",$fault:"client",...e});Object.setPrototypeOf(this,j.prototype)}}class z extends n{name="LanguageNotSupportedException";$fault="client";constructor(e){super({name:"LanguageNotSupportedException",$fault:"client",...e});Object.setPrototypeOf(this,z.prototype)}}class B extends n{name="LexiconSizeExceededException";$fault="client";constructor(e){super({name:"LexiconSizeExceededException",$fault:"client",...e});Object.setPrototypeOf(this,B.prototype)}}class q extends n{name="MarksNotSupportedForFormatException";$fault="client";constructor(e){super({name:"MarksNotSupportedForFormatException",$fault:"client",...e});Object.setPrototypeOf(this,q.prototype)}}class J extends n{name="MaxLexemeLengthExceededException";$fault="client";constructor(e){super({name:"MaxLexemeLengthExceededException",$fault:"client",...e});Object.setPrototypeOf(this,J.prototype)}}class Z extends n{name="MaxLexiconsNumberExceededException";$fault="client";constructor(e){super({name:"MaxLexiconsNumberExceededException",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype)}}class Q extends n{name="UnsupportedPlsAlphabetException";$fault="client";constructor(e){super({name:"UnsupportedPlsAlphabetException",$fault:"client",...e});Object.setPrototypeOf(this,Q.prototype)}}class W extends n{name="UnsupportedPlsLanguageException";$fault="client";constructor(e){super({name:"UnsupportedPlsLanguageException",$fault:"client",...e});Object.setPrototypeOf(this,W.prototype)}}class Y extends n{name="ServiceQuotaExceededException";$fault="client";quotaCode;serviceCode;constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e});Object.setPrototypeOf(this,Y.prototype),this.quotaCode=e.quotaCode,this.serviceCode=e.serviceCode}}class ee extends n{name="ThrottlingException";$fault="client";throttlingReasons;constructor(e){super({name:"ThrottlingException",$fault:"client",...e});Object.setPrototypeOf(this,ee.prototype),this.throttlingReasons=e.throttlingReasons}}class te extends n{name="ValidationException";$fault="client";reason;fields;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,te.prototype),this.reason=e.reason,this.fields=e.fields}}class se extends n{name="SsmlMarksNotSupportedForTextTypeException";$fault="client";constructor(e){super({name:"SsmlMarksNotSupportedForTextTypeException",$fault:"client",...e});Object.setPrototypeOf(this,se.prototype)}}class ne extends n{name="TextLengthExceededException";$fault="client";constructor(e){super({name:"TextLengthExceededException",$fault:"client",...e});Object.setPrototypeOf(this,ne.prototype)}}var xo="Alphabet",ho="AudioChunk",We="AudioEvent",Eo="AdditionalLanguageCodes",Ye="AudioStream",mo="ActionStream",_o="Attributes",et="Content",tt="CloseStreamEvent",go="CreationTime",vo="Content-Type",Lo="ContentType",To="DeleteLexicon",yo="DeleteLexiconInput",Io="DeleteLexiconOutput",$o="DescribeVoices",Oo="DescribeVoicesInput",fo="DescribeVoicesOutput",y="Engine",Po="EngineNotSupportedException",Ao="EventStream",Co="Force",st="FlushStreamConfiguration",No="Gender",ko="GetLexicon",Ro="GetLexiconInput",Do="GetLexiconOutput",bo="GetSpeechSynthesisTask",Fo="GetSpeechSynthesisTaskInput",Mo="GetSpeechSynthesisTaskOutput",Go="Id",ze="IncludeAdditionalLanguageCodes",Vo="InvalidLexiconException",Uo="InvalidNextTokenException",wo="InvalidS3BucketException",Ho="InvalidSsmlException",jo="InvalidS3KeyException",zo="InvalidSampleRateException",Bo="InvalidSnsTopicArnException",qo="InvalidTaskIdException",nt="Lexicon",ot="LexiconAttributes",Ko="LexiconArn",Jo="LexiconContent",v="LanguageCode",Zo="LexemesCount",Qo="LexiconDescription",Wo="LexiconDescriptionList",Xo="ListLexicons",Yo="ListLexiconsInput",er="ListLexiconsOutput",tr="LastModified",oe="LexiconNames",sr="LexiconNotFoundException",nr="LanguageNotSupportedException",or="LanguageName",rr="LexiconSizeExceededException",ir="ListSpeechSynthesisTasks",ar="ListSpeechSynthesisTasksInput",cr="ListSpeechSynthesisTasksOutput",pr="Lexicons",ur="MaxLexemeLengthExceededException",lr="MaxLexiconsNumberExceededException",dr="MarksNotSupportedForFormatException",Be="MaxResults",I="Name",E="NextToken",re="OutputFormat",Sr="OutputS3BucketName",xr="OutputS3KeyPrefix",hr="OutputUri",Er="PutLexicon",mr="PutLexiconInput",_r="PutLexiconOutput",xe="RequestCharacters",gr="Size",rt="StreamClosedEvent",vr="SupportedEngines",it="ServiceFailureException",Lr="SsmlMarksNotSupportedForTextTypeException",he="SpeechMarkTypes",at="ServiceQuotaExceededException",ie="SampleRate",Tr="SynthesizeSpeech",yr="SynthesizeSpeechInput",Ir="SynthesizeSpeechOutput",$r="StartSpeechSynthesisStream",Or="StartSpeechSynthesisStreamActionStream",fr="StartSpeechSynthesisStreamEventStream",Pr="StartSpeechSynthesisStreamInput",Ar="StartSpeechSynthesisStreamOutput",Cr="StartSpeechSynthesisTask",Nr="StartSpeechSynthesisTaskInput",kr="StartSpeechSynthesisTaskOutput",Ee="SynthesisTask",pt="SnsTopicArn",Rr="SynthesisTaskNotFoundException",ut="SynthesisTasks",qe="Status",me="Text",dt="ThrottlingException",St="TextEvent",xt="TaskId",Dr="TextLengthExceededException",br="ThrottlingReason",Fr="ThrottlingReasonList",Mr="TaskStatus",Gr="TaskStatusReason",ae="TextType",Vr="UnsupportedPlsAlphabetException",Ur="UnsupportedPlsLanguageException",wr="Voices",ht="ValidationException",Hr="ValidationExceptionField",jr="ValidationExceptionFieldList",ce="VoiceId",zr="VoiceList",Br="Voice",qr="awsQueryError",c="client",i="error",Kr="eventPayload",Jr="fields",S="http",a="httpError",_="httpHeader",g="httpQuery",o="message",Zr="name",Qr="quotaCode",Et="reason",Wr="resource",mt="smithy.ts.sdk.synthetic.com.amazonaws.polly",Xr="serviceCode",Yr="server",_e="streaming",ei="throttlingReasons",ti="x-amzn-Engine",si="x-amzn-LanguageCode",ni="x-amzn-LexiconNames",oi="x-amzn-OutputFormat",ri="x-amzn-RequestCharacters",ii="x-amzn-SampleRate",ai="x-amzn-VoiceId",t="com.amazonaws.polly",_t=new Ze(mt),vt=[-3,mt,"PollyServiceException",0,[],[]];_t.registerError(vt,n);var r=new Ze(t),Lt=[-3,t,Po,{[i]:c,[a]:400},[o],[0]];r.registerError(Lt,D);var Tt=[-3,t,Vo,{[i]:c,[a]:400},[o],[0]];r.registerError(Tt,M);var It=[-3,t,Uo,{[i]:c,[a]:400},[o],[0]];r.registerError(It,R);var $t=[-3,t,wo,{[i]:c,[a]:400},[o],[0]];r.registerError($t,G);var Ot=[-3,t,jo,{[i]:c,[a]:400},[o],[0]];r.registerError(Ot,U);var ft=[-3,t,zo,{[i]:c,[a]:400},[o],[0]];r.registerError(ft,w);var Pt=[-3,t,Bo,{[i]:c,[a]:400},[o],[0]];r.registerError(Pt,H);var At=[-3,t,Ho,{[i]:c,[a]:400},[o],[0]];r.registerError(At,j);var Ct=[-3,t,qo,{[i]:c,[a]:400},[o],[0]];r.registerError(Ct,b);var Nt=[-3,t,nr,{[i]:c,[a]:400},[o],[0]];r.registerError(Nt,z);var kt=[-3,t,sr,{[i]:c,[a]:404},[o],[0]];r.registerError(kt,N);var Rt=[-3,t,rr,{[i]:c,[a]:400},[o],[0]];r.registerError(Rt,B);var Dt=[-3,t,dr,{[i]:c,[a]:400},[o],[0]];r.registerError(Dt,q);var bt=[-3,t,ur,{[i]:c,[a]:400},[o],[0]];r.registerError(bt,J);var Ft=[-3,t,lr,{[i]:c,[a]:400},[o],[0]];r.registerError(Ft,Z);var ge=[-3,t,it,{[i]:Yr,[a]:500},[o],[0]];r.registerError(ge,k);var ve=[-3,t,at,{[i]:c,[a]:402},[o,Qr,Xr],[0,0,0],3];r.registerError(ve,Y);var Mt=[-3,t,Lr,{[i]:c,[a]:400},[o],[0]];r.registerError(Mt,se);var Gt=[-3,t,Rr,{[i]:c,[a]:400},[o],[0]];r.registerError(Gt,F);var Vt=[-3,t,Dr,{[i]:c,[a]:400},[o],[0]];r.registerError(Vt,ne);var Le=[-3,t,dt,{[qr]:["Throttling",400],[i]:c,[a]:400},[o,ei],[0,()=>li]];r.registerError(Le,ee);var Ut=[-3,t,Vr,{[i]:c,[a]:400},[o],[0]];r.registerError(Ut,Q);var wt=[-3,t,Ur,{[i]:c,[a]:400},[o],[0]];r.registerError(wt,W);var ye=[-3,t,ht,{[i]:c,[a]:400},[o,Et,Jr],[0,0,()=>di],2];r.registerError(ye,te);var Ht=[_t,r],ci=[0,t,Ye,{[_e]:1},42],jt=[0,t,Jo,8,0],zt=[3,t,We,0,[ho],[[21,{[Kr]:1}]]],Bt=[3,t,tt,0,[],[]],qt=[3,t,yo,0,[I],[[0,1]],1],Kt=[3,t,Io,0,[],[]],Jt=[3,t,Oo,0,[y,v,ze,E],[[0,{[g]:y}],[0,{[g]:v}],[2,{[g]:ze}],[0,{[g]:E}]]],Zt=[3,t,fo,0,[wr,E],[()=>Si,0]],Wt=[3,t,st,0,[Co],[2]],Xt=[3,t,Ro,0,[I],[[0,1]],1],Yt=[3,t,Do,0,[nt,ot],[[()=>ss,0],()=>Ie]],es=[3,t,Fo,0,[xt],[[0,1]],1],ts=[3,t,Mo,0,[Ee],[()=>pe]],ss=[3,t,nt,0,[et,I],[[()=>jt,0],0]],Ie=[3,t,ot,0,[xo,v,tr,Ko,Zo,gr],[0,0,4,0,1,1]],ns=[3,t,Qo,0,[I,_o],[0,()=>Ie]],os=[3,t,Yo,0,[E],[[0,{[g]:E}]]],rs=[3,t,er,0,[pr,E],[()=>pi,0]],is=[3,t,ar,0,[Be,E,qe],[[1,{[g]:Be}],[0,{[g]:E}],[0,{[g]:qe}]]],as=[3,t,cr,0,[E,ut],[0,()=>ui]],cs=[3,t,mr,0,[I,et],[[0,1],[()=>jt,0]],2],ps=[3,t,_r,0,[],[]],us=[3,t,Pr,0,[y,re,ce,v,oe,ie,mo],[[0,{[_]:ti}],[0,{[_]:oi}],[0,{[_]:ai}],[0,{[_]:si}],[64,{[_]:ni}],[0,{[_]:ii}],[()=>Ls,16]],3],ls=[3,t,Ar,0,[Ao],[[()=>Ts,16]]],ds=[3,t,Nr,0,[re,Sr,me,ce,y,v,oe,xr,ie,pt,he,ae],[0,0,0,0,0,0,64,0,0,0,64,0],4],Ss=[3,t,kr,0,[Ee],[()=>pe]],xs=[3,t,rt,0,[xe],[1]],pe=[3,t,Ee,0,[y,xt,Mr,Gr,hr,go,xe,pt,oe,re,ie,he,ae,ce,v],[0,0,0,0,0,4,1,0,64,0,0,64,0,0,0]],hs=[3,t,yr,0,[re,me,ce,y,v,oe,ie,he,ae],[0,0,0,0,0,64,0,64,0],3],Es=[3,t,Ir,0,[Ye,Lo,xe],[[()=>ci,16],[0,{[_]:vo}],[1,{[_]:ri}]]],ms=[3,t,St,0,[me,ae,st],[0,0,()=>Wt],1],_s=[3,t,br,0,[Et,Wr],[0,0]],gs=[3,t,Hr,0,[Zr,o],[0,0],2],vs=[3,t,Br,0,[No,Go,v,or,I,Eo,vr],[0,0,0,0,0,64,64]],pi=[1,t,Wo,0,()=>ns],ui=[1,t,ut,0,()=>pe],li=[1,t,Fr,0,()=>_s],di=[1,t,jr,0,()=>gs],Si=[1,t,zr,0,()=>vs],Ls=[4,t,Or,{[_e]:1},[St,tt],[()=>ms,()=>Bt]],Ts=[4,t,fr,{[_e]:1},[We,rt,ht,at,it,dt],[[()=>zt,0],()=>xs,[()=>ye,0],[()=>ve,0],[()=>ge,0],[()=>Le,0]]],ys=[9,t,To,{[S]:["DELETE","/v1/lexicons/{Name}",200]},()=>qt,()=>Kt],Is=[9,t,$o,{[S]:["GET","/v1/voices",200]},()=>Jt,()=>Zt],$s=[9,t,ko,{[S]:["GET","/v1/lexicons/{Name}",200]},()=>Xt,()=>Yt],Os=[9,t,bo,{[S]:["GET","/v1/synthesisTasks/{TaskId}",200]},()=>es,()=>ts],fs=[9,t,Xo,{[S]:["GET","/v1/lexicons",200]},()=>os,()=>rs],Ps=[9,t,ir,{[S]:["GET","/v1/synthesisTasks",200]},()=>is,()=>as],As=[9,t,Er,{[S]:["PUT","/v1/lexicons/{Name}",200]},()=>cs,()=>ps],Cs=[9,t,$r,{[S]:["POST","/v1/synthesisStream",200]},()=>us,()=>ls],Ns=[9,t,Cr,{[S]:["POST","/v1/synthesisTasks",200]},()=>ds,()=>Ss],ks=[9,t,Tr,{[S]:["POST","/v1/speech",200]},()=>hs,()=>Es],xi=(e)=>({apiVersion:"2016-06-10",base64Decoder:e?.base64Decoder??Jn,base64Encoder:e?.base64Encoder??Kn,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??So,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??so,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Un}],logger:e?.logger??new an,protocol:e?.protocol??Xn,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.polly",errorTypeRegistries:Ht,xmlNamespace:"http://polly.amazonaws.com/doc/v1",version:"2016-06-10",serviceTarget:"Parrot_v1"},sdkStreamMixin:e?.sdkStreamMixin??qn,serviceId:e?.serviceId??"Polly",sha256:e?.sha256??Yn,urlParser:e?.urlParser??An,utf8Decoder:e?.utf8Decoder??Bn,utf8Encoder:e?.utf8Encoder??zn}),hi=(e)=>{cn(process.version);let s=hn(e),p=()=>s().then(pn),d=xi(e);ws(process.version);let u={profile:e?.profile,logger:d.logger};return{...d,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??L(wn,u),bodyLengthChecker:e?.bodyLengthChecker??Zn,credentialDefaultProvider:e?.credentialDefaultProvider??Hn,defaultUserAgentProvider:e?.defaultUserAgentProvider??Hs({serviceId:d.serviceId,clientVersion:ao.version}),eventStreamPayloadHandlerProvider:e?.eventStreamPayloadHandlerProvider??jn,eventStreamSerdeProvider:e?.eventStreamSerdeProvider??fn,maxAttempts:e?.maxAttempts??L(bn,e),region:e?.region??L(_n,{...gn,...u}),requestHandler:Wn.create(e?.requestHandler??(async()=>({...await p(),disableConcurrentStreams:!0}))),retryMode:e?.retryMode??L({...Dn,default:async()=>(await p()).retryMode||Rn},e),streamCollector:e?.streamCollector??Qn,useDualstackEndpoint:e?.useDualstackEndpoint??L(mn,u),useFipsEndpoint:e?.useFipsEndpoint??L(En,u),userAgentAppId:e?.userAgentAppId??L(js,u)}},Ei=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:p,credentials:d}=e;return{setHttpAuthScheme(u){let P=s.findIndex((Se)=>Se.schemeId===u.schemeId);if(P===-1)s.push(u);else s.splice(P,1,u)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(u){p=u},httpAuthSchemeProvider(){return p},setCredentials(u){d=u},credentials(){return d}}},mi=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),_i=(e,s)=>{let p=Object.assign(zs(e),un(e),Cn(e),Ei(e));return s.forEach((d)=>d.configure(p)),Object.assign(e,Bs(p),ln(p),Nn(p),mi(p))};class ue extends Je{config;constructor(...[e]){let s=hi(e||{});super(s);this.initConfig=s;let p=oo(s),d=qs(p),u=Fn(d),P=vn(u),Se=Ks(P),Ds=$n(Se),bs=Pn(Ds),Fs=no(bs),Ms=Xs(Fs),Gs=_i(Ms,e?.extensions||[]);this.config=Gs,this.middlewareStack.use(Gn(this.config)),this.middlewareStack.use(Js(this.config)),this.middlewareStack.use(Mn(this.config)),this.middlewareStack.use(kn(this.config)),this.middlewareStack.use(Zs(this.config)),this.middlewareStack.use(Qs(this.config)),this.middlewareStack.use(Ws(this.config)),this.middlewareStack.use(en(this.config,{httpAuthSchemeParametersProvider:eo,identityProviderConfigProvider:async(Vs)=>new tn({"aws.auth#sigv4":Vs.credentials})})),this.middlewareStack.use(sn(this.config))}destroy(){super.destroy()}}var x=dn(ro,"Parrot_v1","PollyClient",On),h={},m=(e,s,p,d)=>[],gi=(e,s,p,d)=>[Ys(p)];class Oe extends x(h,m,"DeleteLexicon",ys){}class fe extends x(h,m,"DescribeVoices",Is){}class Pe extends x(h,m,"GetLexicon",$s){}class Ae extends x(h,m,"GetSpeechSynthesisTask",Os){}class Ne extends x(h,m,"ListLexicons",fs){}class de extends x(h,m,"ListSpeechSynthesisTasks",Ps){}class ke extends x(h,m,"PutLexicon",As){}class Re extends x(h,gi,"StartSpeechSynthesisStream",Cs){}class De extends x(h,m,"StartSpeechSynthesisTask",Ns){}class be extends x(h,m,"SynthesizeSpeech",ks){}var Rs=nn(ue,de,"NextToken","NextToken","MaxResults"),vi={DeleteLexiconCommand:Oe,DescribeVoicesCommand:fe,GetLexiconCommand:Pe,GetSpeechSynthesisTaskCommand:Ae,ListLexiconsCommand:Ne,ListSpeechSynthesisTasksCommand:de,PutLexiconCommand:ke,StartSpeechSynthesisStreamCommand:Re,StartSpeechSynthesisTaskCommand:De,SynthesizeSpeechCommand:be},Li={paginateListSpeechSynthesisTasks:Rs};class Fe extends ue{}Sn(vi,Fe,{paginators:Li});var Ti={GENERATIVE:"generative",LONG_FORM:"long-form",NEURAL:"neural",STANDARD:"standard"},yi={ar_AE:"ar-AE",arb:"arb",ca_ES:"ca-ES",cmn_CN:"cmn-CN",cs_CZ:"cs-CZ",cy_GB:"cy-GB",da_DK:"da-DK",de_AT:"de-AT",de_CH:"de-CH",de_DE:"de-DE",en_AU:"en-AU",en_GB:"en-GB",en_GB_WLS:"en-GB-WLS",en_IE:"en-IE",en_IN:"en-IN",en_NZ:"en-NZ",en_SG:"en-SG",en_US:"en-US",en_ZA:"en-ZA",es_ES:"es-ES",es_MX:"es-MX",es_US:"es-US",fi_FI:"fi-FI",fr_BE:"fr-BE",fr_CA:"fr-CA",fr_FR:"fr-FR",hi_IN:"hi-IN",is_IS:"is-IS",it_IT:"it-IT",ja_JP:"ja-JP",ko_KR:"ko-KR",nb_NO:"nb-NO",nl_BE:"nl-BE",nl_NL:"nl-NL",pl_PL:"pl-PL",pt_BR:"pt-BR",pt_PT:"pt-PT",ro_RO:"ro-RO",ru_RU:"ru-RU",sv_SE:"sv-SE",tr_TR:"tr-TR",yue_CN:"yue-CN"},Ii={Female:"Female",Male:"Male"},$i={Aditi:"Aditi",Adriano:"Adriano",Ambre:"Ambre",Amy:"Amy",Andres:"Andres",Aria:"Aria",Arlet:"Arlet",Arthur:"Arthur",Astrid:"Astrid",Ayanda:"Ayanda",Beatrice:"Beatrice",Bianca:"Bianca",Brian:"Brian",Burcu:"Burcu",Camila:"Camila",Carla:"Carla",Carmen:"Carmen",Celine:"Celine",Chantal:"Chantal",Conchita:"Conchita",Cristiano:"Cristiano",Daniel:"Daniel",Danielle:"Danielle",Dora:"Dora",Elin:"Elin",Emma:"Emma",Enrique:"Enrique",Ewa:"Ewa",Filiz:"Filiz",Florian:"Florian",Gabrielle:"Gabrielle",Geraint:"Geraint",Giorgio:"Giorgio",Gregory:"Gregory",Gwyneth:"Gwyneth",Hala:"Hala",Hannah:"Hannah",Hans:"Hans",Hiujin:"Hiujin",Ida:"Ida",Ines:"Ines",Isabelle:"Isabelle",Ivy:"Ivy",Jacek:"Jacek",Jan:"Jan",Jasmine:"Jasmine",Jihye:"Jihye",Jitka:"Jitka",Joanna:"Joanna",Joey:"Joey",Justin:"Justin",Kajal:"Kajal",Karl:"Karl",Kazuha:"Kazuha",Kendra:"Kendra",Kevin:"Kevin",Kimberly:"Kimberly",Laura:"Laura",Lea:"Lea",Lennart:"Lennart",Liam:"Liam",Lisa:"Lisa",Liv:"Liv",Lorenzo:"Lorenzo",Lotte:"Lotte",Lucia:"Lucia",Lupe:"Lupe",Mads:"Mads",Maja:"Maja",Marlene:"Marlene",Mathieu:"Mathieu",Matthew:"Matthew",Maxim:"Maxim",Mia:"Mia",Miguel:"Miguel",Mizuki:"Mizuki",Naja:"Naja",Niamh:"Niamh",Nicole:"Nicole",Ola:"Ola",Olivia:"Olivia",Pedro:"Pedro",Penelope:"Penelope",Raveena:"Raveena",Remi:"Remi",Ricardo:"Ricardo",Ruben:"Ruben",Russell:"Russell",Ruth:"Ruth",Sabrina:"Sabrina",Salli:"Salli",Seoyeon:"Seoyeon",Sergio:"Sergio",Sofie:"Sofie",Stephen:"Stephen",Suvi:"Suvi",Takumi:"Takumi",Tatyana:"Tatyana",Thiago:"Thiago",Tiffany:"Tiffany",Tomoko:"Tomoko",Vicki:"Vicki",Vitoria:"Vitoria",Zayd:"Zayd",Zeina:"Zeina",Zhiyu:"Zhiyu"},Oi={ALAW:"alaw",JSON:"json",MP3:"mp3",MULAW:"mulaw",OGG_OPUS:"ogg_opus",OGG_VORBIS:"ogg_vorbis",PCM:"pcm"},fi={SENTENCE:"sentence",SSML:"ssml",VISEME:"viseme",WORD:"word"},Pi={COMPLETED:"completed",FAILED:"failed",IN_PROGRESS:"inProgress",SCHEDULED:"scheduled"},Ai={SSML:"ssml",TEXT:"text"},Ci={INPUT_STREAM_INBOUND_EVENT_TIMEOUT:"input-stream-inbound-event-timeout",INPUT_STREAM_TIMEOUT:"input-stream-timeout"},Ni={POLLY:"polly"},ki={FIELD_VALIDATION_FAILED:"fieldValidationFailed",INVALID_INBOUND_EVENT:"invalidInboundEvent",OTHER:"other",UNSUPPORTED_OPERATION:"unsupportedOperation"};var bi=zt,Fi=Bt,Mi=ys,Gi=Oe,Vi=qt,Ui=Kt,wi=Is,Hi=fe,ji=Jt,zi=Zt,Bi=Ti,qi=D,Ki=Lt,Ji=Wt,Zi=Ii,Qi=$s,Wi=Pe,Xi=Xt,Yi=Yt,ea=Os,ta=Ae,sa=es,na=ts,oa=M,ra=Tt,ia=R,aa=It,ca=G,pa=$t,ua=U,la=Ot,da=w,Sa=ft,xa=H,ha=Pt,Ea=j,ma=At,_a=b,ga=Ct,va=yi,La=z,Ta=Nt,ya=ss,Ia=Ie,$a=ns,Oa=N,fa=kt,Pa=B,Aa=Rt,Ca=fs,Na=Ne,ka=os,Ra=rs,Da=Ps,ba=de,Fa=is,Ma=as,Ga=q,Va=Dt,Ua=J,wa=bt,Ha=Z,ja=Ft,za=Oi,Ba=Fe,qa=ue,Ka=n,Ja=vt,Za=As,Qa=ke,Wa=cs,Xa=ps,Ya=Ci,ec=Ni,tc=k,sc=ge,nc=Y,oc=ve,rc=fi,ic=se,ac=Mt,cc=Cs,pc=Ls,uc=Re,lc=Ts,dc=us,Sc=ls,xc=Ns,hc=De,Ec=ds,mc=Ss,_c=xs,gc=pe,vc=F,Lc=Gt,Tc=ks,yc=be,Ic=hs,$c=Es,Oc=Pi,fc=ms,Pc=ne,Ac=Vt,Cc=Ai,Nc=ee,kc=Le,Rc=_s,Dc=Q,bc=Ut,Fc=W,Mc=wt,Gc=te,Vc=ye,Uc=gs,wc=ki,Hc=vs,jc=$i,zc=Ht,Bc=Rs;export{Ri as $Command,Di as __Client,bi as AudioEvent$,Fi as CloseStreamEvent$,Mi as DeleteLexicon$,Gi as DeleteLexiconCommand,Vi as DeleteLexiconInput$,Ui as DeleteLexiconOutput$,wi as DescribeVoices$,Hi as DescribeVoicesCommand,ji as DescribeVoicesInput$,zi as DescribeVoicesOutput$,Bi as Engine,qi as EngineNotSupportedException,Ki as EngineNotSupportedException$,Ji as FlushStreamConfiguration$,Zi as Gender,Qi as GetLexicon$,Wi as GetLexiconCommand,Xi as GetLexiconInput$,Yi as GetLexiconOutput$,ea as GetSpeechSynthesisTask$,ta as GetSpeechSynthesisTaskCommand,sa as GetSpeechSynthesisTaskInput$,na as GetSpeechSynthesisTaskOutput$,oa as InvalidLexiconException,ra as InvalidLexiconException$,ia as InvalidNextTokenException,aa as InvalidNextTokenException$,ca as InvalidS3BucketException,pa as InvalidS3BucketException$,ua as InvalidS3KeyException,la as InvalidS3KeyException$,da as InvalidSampleRateException,Sa as InvalidSampleRateException$,xa as InvalidSnsTopicArnException,ha as InvalidSnsTopicArnException$,Ea as InvalidSsmlException,ma as InvalidSsmlException$,_a as InvalidTaskIdException,ga as InvalidTaskIdException$,va as LanguageCode,La as LanguageNotSupportedException,Ta as LanguageNotSupportedException$,ya as Lexicon$,Ia as LexiconAttributes$,$a as LexiconDescription$,Oa as LexiconNotFoundException,fa as LexiconNotFoundException$,Pa as LexiconSizeExceededException,Aa as LexiconSizeExceededException$,Ca as ListLexicons$,Na as ListLexiconsCommand,ka as ListLexiconsInput$,Ra as ListLexiconsOutput$,Da as ListSpeechSynthesisTasks$,ba as ListSpeechSynthesisTasksCommand,Fa as ListSpeechSynthesisTasksInput$,Ma as ListSpeechSynthesisTasksOutput$,Ga as MarksNotSupportedForFormatException,Va as MarksNotSupportedForFormatException$,Ua as MaxLexemeLengthExceededException,wa as MaxLexemeLengthExceededException$,Ha as MaxLexiconsNumberExceededException,ja as MaxLexiconsNumberExceededException$,za as OutputFormat,Ba as Polly,qa as PollyClient,Ka as PollyServiceException,Ja as PollyServiceException$,Za as PutLexicon$,Qa as PutLexiconCommand,Wa as PutLexiconInput$,Xa as PutLexiconOutput$,Ya as QuotaCode,ec as ServiceCode,tc as ServiceFailureException,sc as ServiceFailureException$,nc as ServiceQuotaExceededException,oc as ServiceQuotaExceededException$,rc as SpeechMarkType,ic as SsmlMarksNotSupportedForTextTypeException,ac as SsmlMarksNotSupportedForTextTypeException$,cc as StartSpeechSynthesisStream$,pc as StartSpeechSynthesisStreamActionStream$,uc as StartSpeechSynthesisStreamCommand,lc as StartSpeechSynthesisStreamEventStream$,dc as StartSpeechSynthesisStreamInput$,Sc as StartSpeechSynthesisStreamOutput$,xc as StartSpeechSynthesisTask$,hc as StartSpeechSynthesisTaskCommand,Ec as StartSpeechSynthesisTaskInput$,mc as StartSpeechSynthesisTaskOutput$,_c as StreamClosedEvent$,gc as SynthesisTask$,vc as SynthesisTaskNotFoundException,Lc as SynthesisTaskNotFoundException$,Tc as SynthesizeSpeech$,yc as SynthesizeSpeechCommand,Ic as SynthesizeSpeechInput$,$c as SynthesizeSpeechOutput$,Oc as TaskStatus,fc as TextEvent$,Pc as TextLengthExceededException,Ac as TextLengthExceededException$,Cc as TextType,Nc as ThrottlingException,kc as ThrottlingException$,Rc as ThrottlingReason$,Dc as UnsupportedPlsAlphabetException,bc as UnsupportedPlsAlphabetException$,Fc as UnsupportedPlsLanguageException,Mc as UnsupportedPlsLanguageException$,Gc as ValidationException,Vc as ValidationException$,Uc as ValidationExceptionField$,wc as ValidationExceptionReason,Hc as Voice$,jc as VoiceId,zc as errorTypeRegistries,Bc as paginateListSpeechSynthesisTasks};
|
|
3
|
-
|
|
4
|
-
//# debugId=39ED795F4FD3C25D64756E2164756E21
|
|
5
|
-
//# sourceMappingURL=index-9dmgk6d3.js.map
|
package/dist/index-akv6e7ge.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{Xs}from"./index-j20k6k0m.js";import{oa,Ro,ia,sa,u,ua}from"./index-vw2hf4d8.js";function p(){return{out:process.stdout,in:process.stdin}}var n=[],i=!1,s=!1,o=!1,a=!1,c=!1,d=!1,l=!1;function Ao(){o=!0}function St(){o=!0,a=!0}function gs(){o=!0,c=!0}function cs(){o=!0,d=!0}function U(e){n.push(e)}function ls(){l=!0}function qe(e=p()){if(s||!o)return;if(s=!0,e.in.isTTY===!0&&e.in.setRawMode!==void 0)e.in.setRawMode(!1);if(e.out.isTTY!==!0)return;if(e.out.write(`${Ro}${oa}`),c)e.out.write(Xs);if(d)e.out.write(sa);if(a)e.out.write(ia)}async function Et(e=process.stdout){if(e.writableEnded===!0||e.destroyed===!0)return;await new Promise((r)=>{e.write("",()=>r())})}async function E(){for(let e of[...n].reverse())try{await e()}catch(r){process.stderr.write(`warning: cleanup failed: ${r instanceof Error?r.message:String(r)}
|
|
3
|
-
`)}n.length=0}async function m(e){await E(),qe(),process.exitCode=e,await Et()}async function gr(e){await m(e),process.exit(e)}function Is(){if(i)return;i=!0,process.on("exit",()=>qe()),process.on("SIGTERM",()=>{if(l)return;gr(ua)});let e=(r)=>(t)=>{qe();let f=t instanceof Error?t.stack??t.message:String(t);process.stderr.write(`
|
|
4
|
-
${r}: ${f}
|
|
5
|
-
`),gr(u)};process.on("uncaughtException",e("uncaught exception")),process.on("unhandledRejection",e("unhandled rejection"));for(let r of[process.stdout,process.stderr])r.on("error",(t)=>{if(t.code==="EPIPE"||t.code==="ERR_STREAM_DESTROYED")return;e("output error")(t)})}
|
|
6
|
-
export{Ao,St,gs,cs,U,ls,qe,Et,gr,Is};
|
|
7
|
-
|
|
8
|
-
//# debugId=275EFC2B5DA05FE164756E2164756E21
|
|
9
|
-
//# sourceMappingURL=index-akv6e7ge.js.map
|
package/dist/index-f056wkb4.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{i,Ei,na}from"./index-j20k6k0m.js";import{Text as e}from"ink";import{useEffect as a,useState as c}from"react";import{jsx as f,jsxs as l}from"react/jsx-runtime";function tt({label:r}){let[t,n]=c(0);return a(()=>{let o=setInterval(()=>n((p)=>(p+1)%Ei.length),na);return()=>clearInterval(o)},[]),l(e,{children:[f(e,{color:i.accent,children:Ei[t]})," ",r]})}
|
|
3
|
-
export{tt};
|
|
4
|
-
|
|
5
|
-
//# debugId=F0688CF6FC1DDF6764756E2164756E21
|
|
6
|
-
//# sourceMappingURL=index-f056wkb4.js.map
|
package/dist/index-s57ztjhq.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{n,s,L,Ue,C,r,ft,x,b,pt,Gs,bt,Ot,ae,W}from"./index-26ejkp8q.js";var bn="dispach",vn="Dispach",Tn=1;function me(e,t){return{slug:e,name:t,envPrefix:`${e.toUpperCase()}_`,stateDir:`.${e}`,apiVersion:`${e}/v${Tn}`,packageScope:`@${e}`}}var X=me(bn,vn),G=`${X.envPrefix}BRAND`,Pe=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;function Fe(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function je(e){if(e===void 0)return X;let t=e.trim();if(t==="")throw Error(`${G} is set but empty. hint: unset ${G} entirely to use the default brand — an empty value `+'is treated as a mistake rather than as "no override", because a declared-but-unset variable is usually a container passing through a name it never assigned.');if(!Pe.test(t))throw Error(`${G}="${t}" is not a usable brand slug. hint: the slug becomes an env var prefix, a dot-directory, an npm scope, and the `+"manifest apiVersion, so it must be lowercase alphanumeric with inner hyphens — "+"e.g. acme or acme-run.");if(t===X.slug)return X;return me(t,Fe(t))}var re=je(process.env[G]);function _n(e,t){let i=Array.from({length:t.length+1},(o,a)=>a);for(let o=1;o<=e.length;o+=1){let a=[o];for(let d=1;d<=t.length;d+=1){let l=(i[d-1]??0)+(e[o-1]===t[d-1]?0:1),c=(a[d-1]??0)+1,u=(i[d]??0)+1;a.push(Math.min(l,c,u))}i=a}return i[t.length]??Math.max(e.length,t.length)}function Yt(e,t){let i,o=Number.POSITIVE_INFINITY;for(let a of t){let d=_n(e,a);if(d<o)o=d,i=a}return i!==void 0&&o<=Math.max(2,Math.floor(e.length/3))?i:void 0}var We=Symbol.for("dispach.HarnessError");function R(e){return typeof e==="object"&&e!==null&&We in e}class ee extends Error{static ERROR_NAME="HarnessError";code;hint;field;details;constructor(e){super(e.message,e.cause===void 0?void 0:{cause:e.cause});if(this.name=new.target.ERROR_NAME??"HarnessError",this[We]=!0,this.code=e.code,this.hint=e.hint,this.field=e.field,e.detail!==void 0)this.detail=e.detail;this.details=e.details??[]}toDetail(){return{code:this.code,message:this.message,hint:this.hint,...this.field===void 0?{}:{field:this.field},...this.detail===void 0?{}:{detail:this.detail}}}format(){let e=[`${this.code}: ${this.message}`];if(this.field!==void 0)e.push(` field: ${this.field}`);if(e.push(` hint: ${this.hint}`),this.detail!==void 0)e.push(` detail: ${this.detail}`);if(this.details.length===1)return e.join(`
|
|
3
|
-
`);for(let t of this.details){if(e.push(""),e.push(` ${t.code}: ${t.message}`),t.field!==void 0)e.push(` field: ${t.field}`);e.push(` hint: ${t.hint}`)}return e.join(`
|
|
4
|
-
`)}}class h extends ee{static ERROR_NAME="ConfigError"}class rt extends ee{static ERROR_NAME="ModelError";status;retryAfterSeconds;constructor(e){super(e);this.status=e.status,this.retryAfterSeconds=e.retryAfterSeconds}}class S extends ee{static ERROR_NAME="ToolError"}function Be(e,t){return new h({code:"tools_provider_alias_conflict",message:`The manifest sets tools.providers (${e.join(", ")}) and also the deprecated tools.provider${t===void 0?"Config":` (${t})`}.`,hint:`Keep tools.providers and delete the other two. Merging them would give the scalar a position in the map that nobody wrote, and provider order decides which one wins a slug collision${t===void 0?"":` — move ${t}'s settings into tools.providers.${t}`}.`,field:"tools.provider"})}function He(){return new h({code:"workspace_alias_conflict",message:"The manifest sets both context.files and context.static.",hint:"context.files is the deprecated alias for context.static and resolves against the manifest directory, while context.static resolves against context.workspace. Merging them would produce an order nobody wrote and paths nobody can predict from reading the manifest, so pick one — context.static.",field:"context.files"})}function Ke(e,t){return new S({code:"workspace_not_editable",message:`${e} is declared editable: ${t}, so it cannot be written to.`,hint:"Point the write at a volatile file whose frontmatter allows it (editable: append or replace), or change that file's frontmatter. Read-only identity is deliberate — it is the most effective known mitigation for persona drift, so this refuses rather than silently doing nothing."})}function Xe(){return new S({code:"memory_forget_arguments",message:"memory_forget needs either `query` or `ids`, not both and not neither.",hint:"Call it with `query` first to see what matches, show the person, then call it again with the `ids` they confirm."})}function qe(){return new S({code:"memory_forget_unavailable",message:"Memory cannot be changed from here: nothing runs turns in this context.",hint:"memory_forget works inside a turn of a running agent."})}function Ye(){return new S({code:"artifact_unavailable",message:"This runtime has no artifact store, so a compacted observation cannot be read back.",hint:"artifact_read only works inside a session backed by a store. If you are seeing a compaction pointer without one, the pointer was written by a different process — report the text of the pointer rather than guessing at what it replaced."})}function ze(e){return new S({code:"artifact_not_found",message:`No compacted observation is stored under ${JSON.stringify(e)} in this conversation.`,hint:"Copy the id exactly from the pointer in the conversation — it is not guessable and it is scoped to this conversation. If the pointer came from a session you have since switched away from, the observation is not reachable from here."})}function E(e,t,i,o="images"){return new ee({code:e,message:t,hint:i,field:o})}function Ve(e,t,i,o){return new h({code:"schedule_tool_unknown",message:`Schedule "${e}" allows ${t.join(", ")}, which ${t.length===1?"names":"name"} nothing this agent has.`,hint:`A schedule can only narrow the agent's own tools: name a pinned or local slug, a tag: annotation, or *. Available: ${i.join(", ")||"none"}. Refused rather than ignored, because a run with fewer tools than its author wrote fails quietly turns later.`,field:o})}class cr{runtimeId;#n=new Map;#e=new Map;#t=0;#s;#i;constructor(e){this.runtimeId=e.runtimeId,this.#i=e.now??(()=>new Date().toISOString()),this.#s=e.onHandlerError??((t,i)=>{console.error(`event handler threw while handling ${i.type}:`,t)})}on(e,t,i={}){if(e==="*"){let d=this.#e.has(t),l=i.chunks===!0,c=d?this.#e.get(t)??!1:!1;if(this.#e.set(t,l||c),!d&&l)this.#t+=1;else if(d&&l&&!c)this.#t+=1;return()=>{if(!this.#e.has(t))return;if(this.#e.get(t)===!0)this.#t-=1;this.#e.delete(t)}}let o=this.#n.get(e);if(o===void 0)o=new Set,this.#n.set(e,o);let a=!o.has(t);if(o.add(t),a&&e==="model.chunk")this.#t+=1;return()=>{if(o?.delete(t)===!0&&e==="model.chunk")this.#t-=1}}once(e,t,i={}){let o=this.on(e,(a)=>{o(),t(a)},i);return o}next(e,t,i={}){return new Promise((o,a)=>{let d=this.on(e,(c)=>{d(),t?.removeEventListener("abort",l),o(c)},i),l=()=>{d(),a(t?.reason??Error("aborted"))};t?.addEventListener("abort",l,{once:!0})})}get chunkSubscribers(){return this.#t}emit(e,t,i={}){if(e==="model.chunk"&&this.#t===0)return;let o={v:1,ts:this.#i(),runtimeId:this.runtimeId,...i.agentId===void 0?{}:{agentId:i.agentId},...i.sessionKey===void 0?{}:{sessionKey:i.sessionKey},...i.turnId===void 0?{}:{turnId:i.turnId},...i.stepId===void 0?{}:{stepId:i.stepId},...i.parentTurnId===void 0?{}:{parentTurnId:i.parentTurnId},...i.parentSessionKey===void 0?{}:{parentSessionKey:i.parentSessionKey},type:e,data:t};this.#o(o)}#o(e){let t=e.type==="model.chunk",i=this.#n.get(e.type);if(i!==void 0)for(let o of[...i])this.#r(o,e);for(let[o,a]of[...this.#e]){if(t&&!a)continue;this.#r(o,e)}}#r(e,t){try{e(t)}catch(i){this.#s(i,t)}}}var Ge="0.2.1",En=/^(\d+)\.(\d+)\.(\d+)$/,kn=/^(\d+)(?:\.(\d+))?(?:\.(\d+))?$/;function An(e){let t=En.exec(e.trim());if(t===null)return;return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3])}}function Sn(e){let t=/^(\d+\.\d+\.\d+)(?:-[0-9A-Za-z.-]+)?$/.exec(e.trim());return t===null?void 0:An(t[1]??"")}function $n(e){let t=kn.exec(e.trim());if(t===null)return;let[,i,o,a]=t;return{version:{major:Number(i),minor:Number(o??0),patch:Number(a??0)},specified:a!==void 0?3:o!==void 0?2:1}}function N(e,t){if(e.major!==t.major)return e.major-t.major;if(e.minor!==t.minor)return e.minor-t.minor;return e.patch-t.patch}function Nn(e){if(e.major!==0)return{major:e.major+1,minor:0,patch:0};if(e.minor!==0)return{major:0,minor:e.minor+1,patch:0};return{major:0,minor:0,patch:e.patch+1}}function In(e,t){if(t===1)return{major:e.major+1,minor:0,patch:0};return{major:e.major,minor:e.minor+1,patch:0}}function Rn(e,t){if(t==="*"||t==="x"||t==="X")return!0;let i=/^(>=|<=|>|<|=|\^|~)?\s*(\S.*)$/.exec(t);if(i===null)return;let o=$n(i[2]??"");if(o===void 0)return;let{version:a,specified:d}=o;switch(i[1]){case"^":return N(e,a)>=0&&N(e,Nn(a))<0;case"~":return N(e,a)>=0&&N(e,In(a,d))<0;case">=":return N(e,a)>=0;case"<=":return N(e,a)<=0;case">":return N(e,a)>0;case"<":return N(e,a)<0;default:if(d===3)return N(e,a)===0;if(d===2)return e.major===a.major&&e.minor===a.minor;return e.major===a.major}}function lr(e,t){let i=Sn(e);if(i===void 0)return;let o=t.split("||"),a=!1;for(let d of o){let l=d.trim().split(/\s+/).filter((u)=>u!=="");if(l.length===0)return;let c=!0;for(let u of l){let f=Rn(i,u);if(f===void 0)return;if(!f)c=!1}if(a=!0,c)return!0}return a?!1:void 0}var Ir=200;var xn="What I already know, carried from before this conversation and kept current. "+"Not a transcript — these are standing facts about the person I work for and my own working notes. "+"If they ask what I know or remember about them, this is the answer.";var k=(e)=>String.fromCharCode(e),P=k(27),st=k(7),On=new RegExp(`${P}\\[[0-?]*[ -/]*[@-~]`,"g"),Ln=new RegExp(`${P}\\][\\s\\S]*?(?:${st}|${P}\\\\|$)`,"g"),Mn=new RegExp(`${P}[P^_X][\\s\\S]*?(?:${P}\\\\|${st}|$)`,"g"),Dn=new RegExp(`${P}[@-Z\\\\-_0-9=><]?`,"g"),Cn=new RegExp(`[${k(128)}-${k(159)}]`,"g"),Un=new RegExp(`[${k(0)}-${k(8)}${k(11)}${k(12)}${k(14)}-${k(31)}${k(127)}]`,"g");function jt(e){return e.replace(/\r\n/g,`
|
|
5
|
-
`).replace(/\r/g,`
|
|
6
|
-
`).replace(Ln,"").replace(Mn,"").replace(On,"").replace(Dn,"").replace(Cn,"").replace(Un,"")}function it(e){return e==="untrusted"?"obu":"obs"}function ot(e){return e.startsWith(`${it("untrusted")}_`)?"untrusted":"trusted"}var Pn=3.8;function at(e){if(e==="")return 0;let t=0;for(let i=0;i<e.length;i+=1)if(e.charCodeAt(i)===10)t+=1;return Math.ceil(e.length/Pn)+t}var Jt=["runtime.ready","store.ready","runtime.stopping","agent.loaded","agent.disposed","agent.reloaded","agent.warning","plugin.loaded","plugin.slow","approval.requested","approval.resolved","handoff.start","handoff.result","turn.start","context.assembled","context.dropped","context.pressure","compaction.stage","context.reset","phase.changed","model.call","model.chunk","model.retry","model.fallback","model.result","media.result","tool.usage","tool.call","tool.result","tool.gated","tool.repair","tools.refreshed","agent.tools.refreshed","agent.channel.status","agent.channel.error","agent.channel.rejected","delivery.sent","delivery.retry","delivery.failed","delivery.uncertain","runtime.released","schedules.reconciled","schedule.fired","schedule.skipped","schedule.deferred","schedule.error","conversation.message","conversation.skipped","action.deferred","action.decided","agent.assigned","memory.read","memory.recalled","memory.forgotten","turn.end","error"],Fn=/\r\n\r\n|\n\n|\r\r/;function Je(e){let t=[],i,o,a;for(let d of e.split(/\r\n|\n|\r/)){if(d===""||d.startsWith(":"))continue;let l=d.indexOf(":"),c=l===-1?d:d.slice(0,l),u=l===-1?"":d.slice(l+1);if(u.startsWith(" "))u=u.slice(1);switch(c){case"data":t.push(u);break;case"event":i=u;break;case"id":o=u;break;case"retry":{let f=Number.parseInt(u,10);if(Number.isFinite(f))a=f;break}default:break}}if(t.length===0&&i===void 0)return;return{...i===void 0?{}:{event:i},data:t.join(`
|
|
7
|
-
`),...o===void 0?{}:{id:o},...a===void 0?{}:{retry:a}}}async function*ur(e){let t=new TextDecoder,i="";for await(let o of e){i+=typeof o==="string"?o:t.decode(o,{stream:!0});while(!0){let a=Fn.exec(i);if(a===null)break;let d=i.slice(0,a.index);i=i.slice(a.index+a[0].length);let l=Je(d);if(l!==void 0)yield l}}if(i+=t.decode(),i.trim()!==""){let o=Je(i);if(o!==void 0)yield o}}function dr(){return{push:(e)=>e,endStep:()=>"",end:()=>""}}var dt=["anyOf","oneOf","allOf","not","$ref"],jn=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","pattern","minItems","maxItems"],Wn=new Set(["string","number","integer","boolean","array","object"]),Bn=new Set(["string","number","integer","boolean"]);function Hn(e){let t=e.anyOf??e.oneOf,i=Array.isArray(t)?t.map((a)=>{let d=O(a);if(d===void 0)return;return Object.keys(d).filter((c)=>c!=="type"&&c!=="description"&&c!=="title").length===0?d.type:void 0}):Array.isArray(e.type)?e.type:[];if(t!==void 0&&!Array.isArray(t))return;let o=i.filter((a)=>a!=="null");if(o.length<2)return;if(!o.every((a)=>typeof a==="string"&&Bn.has(a)))return;return[...new Set(o)]}function O(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)?e:void 0}function Kn(e){let t=[];for(let i of jn){let o=e[i];if(o===void 0||o===null)continue;if(typeof o==="object")continue;t.push(`${i} ${String(o)}`)}return t.join(", ")}function Ze(e){let t=typeof e.description==="string"?e.description.trim():"",i=Kn(e);if(t===""&&i==="")return;if(i==="")return t;return t===""?i:`${t} (${i})`}function lt(e){return Array.isArray(e)?e.filter((t)=>typeof t==="string"):[]}function Xn(e){let t=e.anyOf??e.oneOf;if(!Array.isArray(t)||t.length!==2)return e;let i=(c)=>O(c)?.type==="null",o=t.find((c)=>!i(c));if(!t.some(i)||O(o)===void 0)return e;let{anyOf:a,oneOf:d,...l}=e;return{...O(o),...l}}function Gn(e){if(!Array.isArray(e))return e;let t=e.filter((i)=>i!=="null");return t.length===1?t[0]:e}function ct(e,t,i){let o=Xn(e),a=Hn(o),d=a===void 0?o:(({anyOf:p,oneOf:y,...w})=>w)(o);for(let p of dt)if(d[p]!==void 0)throw i.unsupported(t,p);if(a!==void 0){let p=Ze(d);return{type:a,...p===void 0?{}:{description:p},...d.default===void 0||d.default===null?{}:{default:d.default}}}let l=Gn(d.type);if(Array.isArray(l))throw i.unsupported(t,"type: []");let c=typeof l==="string"&&Wn.has(l)?l:i.untyped??"string",u=Ze(d),f=Array.isArray(d.enum)?d.enum.filter((p)=>typeof p==="string"||typeof p==="number"||typeof p==="boolean"):void 0,g=c==="array"?O(d.items):void 0,m=c==="object"?O(d.properties):void 0;return{type:c,...u===void 0?{}:{description:u},...f===void 0||f.length===0?{}:{enum:f},...g===void 0?{}:{items:ct(g,`${t}[]`,i)},...m===void 0?{}:{properties:ut(m,t,i),required:lt(d.required)},...d.default===void 0||d.default===null?{}:{default:d.default}}}function ut(e,t,i){let o={};for(let[a,d]of Object.entries(e)){let l=O(d);if(l===void 0)continue;o[a]=ct(l,t===""?a:`${t}.${a}`,i)}return o}function no(e,t){if(e===void 0)return{type:"object",properties:{}};for(let d of dt)if(e[d]!==void 0)throw t.unsupported(t.rootPath??"parameters",d);let i=O(e.properties)??{},o=lt(e.required),a=ut(i,"",t);return{type:"object",properties:a,...o.length===0?{}:{required:o.filter((d)=>(d in a))}}}var ht="<<<",mt=">>>",q=/^\s*(?:(?:[-*+]|\d+[.)])\s+)?(?:<\s*)?action\s*:(.+)$/i,qn=/^\s*(?:[-*+]\s+|\d+[.)]\s+)?([A-Za-z_][\w.-]*?)\s*:(.*)$/,we=/^\s*`{3,}\s*(?:[\w+-]+\s*)?$/,pe=/^\s*end\s*$/i,Yn=/^\s*<\s*action\s*>\s*$/i,Qe=/^\s*<\s*\/\s*action\s*>\s*$/i,zn=/^\s*<\/?\s*[A-Za-z_][\w.:-]*\s*(?:\/\s*)?>\s*$/;function et(e){let t=(e??"").trim();return t.endsWith(">")?t.slice(0,-1).trimEnd():t}function ge(e){return tt(tt(Vn(e,"`'\"*<"),"`'\"*>"),".,;:").trim()}function Vn(e,t){let i=0;while(i<e.length&&t.includes(e[i]??""))i+=1;return e.slice(i)}function tt(e,t){let i=e.length;while(i>0&&t.includes(e[i-1]??""))i-=1;return e.slice(0,i)}function gt(e,t,i){let o=e.fields.get(t);if(o===void 0)e.fields.set(t,[i]);else o.push(i)}function yt(e){if(e.block===void 0||e.heredocKey===void 0)return;let t=[...e.heredocLines];if(t[t.length-1]==="")t.pop();gt(e.block,e.heredocKey,t.join(`
|
|
8
|
-
`)),e.block.wrapped.add(e.heredocKey),e.heredocKey=void 0,e.heredocLines=[]}function U(e){if(yt(e),e.block!==void 0)e.blocks.push(e.block);e.block=void 0,e.openKey=void 0,e.awaitingSlug=!1}function nt(){return{block:void 0,openKey:void 0,severedKey:void 0,severedPending:void 0,heredocKey:void 0,heredocLines:[],justClosed:!1,awaitingSlug:!1,text:[],blocks:[]}}function Jn(e,t,i){let o=t.trim();if(e.heredocKey!==void 0){if(o===mt){yt(e);return}if(pe.test(o)){U(e),e.justClosed=!0;return}if(q.test(t)){U(e);let l=q.exec(t),c=ge(et(l?.[1]));if(c!=="")e.block={slug:c,fields:new Map,wrapped:new Set,severed:new Set};return}e.heredocLines.push(t);return}let a=q.exec(t);if(a!==null){let l=ge(et(a[1]));if(U(e),l==="")return;e.block={slug:l,fields:new Map,wrapped:new Set,severed:new Set};return}if(Yn.test(t)){U(e),e.awaitingSlug=!0;return}if(e.awaitingSlug){if(o==="")return;if(Qe.test(t)){e.awaitingSlug=!1;return}let l=ge(o);if(e.awaitingSlug=!1,l!=="")e.block={slug:l,fields:new Map,wrapped:new Set,severed:new Set};return}if(Qe.test(t)){if(e.block!==void 0)U(e),e.justClosed=!0;return}if(zn.test(t))return;if(e.block===void 0){if(we.test(t)&&(e.justClosed||i())){e.justClosed=!1;return}if(pe.test(o)&&e.severedPending!==void 0){e.severedPending.block.severed.add(e.severedPending.key),e.severedPending=void 0;return}if(q.test(t))e.severedPending=void 0;if(e.text.push(t),o!=="")e.justClosed=!1;return}if(o===""){if(e.openKey!==void 0)e.severedKey=e.openKey;e.openKey=void 0;return}if(pe.test(o)){e.severedKey=void 0,U(e),e.justClosed=!0;return}if(we.test(t))return;let d=qn.exec(t);if(d!==null){let l=(d[1]??"").trim(),c=(d[2]??"").trim();if(e.severedKey=void 0,c===ht)e.heredocKey=l,e.heredocLines=[],e.openKey=void 0;else gt(e.block,l,c),e.openKey=l;return}if(e.openKey!==void 0){let l=e.block.fields.get(e.openKey),c=l?.[l.length-1];if(l!==void 0&&c!==void 0)l[l.length-1]=c===""?o:`${c}
|
|
9
|
-
${o}`;return}if(e.severedKey!==void 0)e.severedPending={block:e.block,key:e.severedKey},e.severedKey=void 0;U(e),e.text.push(t)}function Zn(e){if(/^\s*(?:(?:[-*+]|\d+[.)]?)\s*)?$/.test(e))return!0;let t=e.replace(/^\s*(?:[-*+]\s+|\d+[.)]\s+)?/,"").toLowerCase(),i=t.startsWith("<")?t.slice(1):t;if("action:".startsWith(i)||i.startsWith("action:"))return!0;if(/^<\/?$/.test(t)||/^<\/?[a-z_][\w.:-]*>?$/.test(t))return!0;return/^`{1,3}[\w+-]*$/.test(t)}function ye(e){return e.endsWith("\r")?e.slice(0,-1):e}function Er(){let e=nt(),t="",i=0,o,a="",d=!1,l=(m)=>{if(m==="")return"";if(m.trim()==="")return a+=m,"";let p=a+m;if(a="",d)return p;return d=!0,p.replace(/^\s+/,"")},c=(m,p)=>{let y=e.text.length;return Jn(e,m,()=>p!==void 0&&q.test(p)),e.text.length>y?m:void 0},u=(m,p,y)=>{let w=c(m,p);if(w===void 0)return"";return l(w.slice(y))+l(`
|
|
10
|
-
`)},f=(m)=>{if(o===void 0)return"";let p=o;return o=void 0,u(p,m,0)};return{push(m){let p="";t+=m;let y=t.indexOf(`
|
|
11
|
-
`);while(y!==-1){let v=ye(t.slice(0,y));if(t=t.slice(y+1),p+=f(v),e.block===void 0&&we.test(v)&&!e.justClosed)o=v;else p+=u(v,void 0,i);i=0,y=t.indexOf(`
|
|
12
|
-
`)}let w=ye(t);if(e.block===void 0&&!e.awaitingSlug&&o===void 0&&!Zn(w))p+=l(w.slice(i)),i=w.length;return p},endStep(){let m=g();return a=`
|
|
13
|
-
|
|
14
|
-
`,e=nt(),m},end:g};function g(){let m=f(void 0),p=ye(t);if(p!==""){let y=c(p,void 0);if(y!==void 0)m+=l(y.slice(i))}return t="",i=0,o=void 0,m}}var po=`# Tools
|
|
15
|
-
|
|
16
|
-
To use a tool, write an ACTION block. Start each line at the left margin, exactly like this:
|
|
17
|
-
|
|
18
|
-
ACTION: weather_lookup
|
|
19
|
-
city: Lisbon
|
|
20
|
-
units: celsius
|
|
21
|
-
END
|
|
22
|
-
|
|
23
|
-
That block is an example of the shape only. Your own tools are listed below — take the tool name and
|
|
24
|
-
every field name from that list, spelled exactly as it is written there.
|
|
25
|
-
|
|
26
|
-
Rules for a block:
|
|
27
|
-
- One field per line, written as \`name: value\`, where \`name\` is one of that tool's own field names.
|
|
28
|
-
- For a value spanning several lines, open it with \`${ht}\` and close it with \`${mt}\` alone on its own line.
|
|
29
|
-
- Finish every block with \`END\` alone on its own line.
|
|
30
|
-
- Several blocks are allowed. They run in the order you write them.
|
|
31
|
-
- Use only the tools listed below, only their listed fields, and always give every required field.
|
|
32
|
-
|
|
33
|
-
Anything you write outside a block is shown to the person you are talking to, so keep explanations
|
|
34
|
-
short and keep them out of the block. When no tool fits, simply reply — never invent a tool, and
|
|
35
|
-
never guess a value for a required field you have not been given.`;import{readFile as ss,realpath as wt,stat as is}from"node:fs/promises";import{isAbsolute as rs,resolve as be,sep as vt}from"node:path";import{basename as gd,isAbsolute as zt,resolve as Vt}from"node:path";import{appendFile as It,mkdir as vi,readFile as Ti}from"node:fs/promises";import{join as Rt}from"node:path";import{appendFile as sn,mkdir as _i,readFile as Ei,writeFile as ki}from"node:fs/promises";import{join as Ai}from"node:path";import{readFile as Wi,writeFile as Bi}from"node:fs/promises";import{dirname as Hi}from"node:path";import{isDeepStrictEqual as Ki}from"node:util";import{existsSync as gn,readdirSync as Kr,readFileSync as Y,rmSync as Ut,writeFileSync as ie}from"node:fs";import{isAbsolute as Xr,join as he,resolve as Gr}from"node:path";var Qn=`${re.slug}_`,es="0123456789abcdefghjkmnpqrstvwxyz",ts=32;function Cr(){let e=new Uint8Array(ts);crypto.getRandomValues(e);let t="";for(let i of e)t+=es[i&31]??"0";return`${Qn}${t}`}async function fr(e){let t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return[...new Uint8Array(t)].map((i)=>i.toString(16).padStart(2,"0")).join("")}var pr=64,ns=new RegExp("[\\u0000-\\u001f\\u007f]");function ds(e){if(e.trim()==="")return"A key label cannot be empty.";if(e.length>pr)return`A key label is at most ${pr} characters; this one is ${e.length}.`;if(ns.test(e))return"A key label cannot contain control characters, including newlines and tabs.";return}function Yr(e){let t=`${e.channel}:${e.peerId}`;return e.thread===void 0||e.thread===""?t:`${t}:${e.thread}`}var oo=3932160,Tt=5;function Ft(e){let t=(a)=>e[a]??-1;if(t(0)===137&&t(1)===80&&t(2)===78&&t(3)===71)return"image/png";if(t(0)===255&&t(1)===216&&t(2)===255)return"image/jpeg";if(t(0)===71&&t(1)===73&&t(2)===70&&t(3)===56)return"image/gif";let i=t(0)===82&&t(1)===73&&t(2)===70&&t(3)===70,o=t(8)===87&&t(9)===69&&t(10)===66&&t(11)===80;if(i&&o)return"image/webp";return}var os=/^[A-Za-z0-9+/]+={0,2}$/;async function Es(e,t){if(t.length>Tt)throw E("image_count_exceeded",`${t.length} images were sent with one message; at most ${Tt} are.`,"Send the rest in a following message.");let i=[];for(let[o,a]of t.entries())i.push(await as(e,a,`images[${o}]`));return i}async function as(e,t,i){if(t.path!==void 0&&t.data!==void 0)throw E("image_source_ambiguous","An image named both a path and inline data.",'Send one: { "path": "files/…/shot.png" }, or { "data": "<base64>", "mediaType": "image/png" }.',i);if(t.path!==void 0)return await ls(e,t.path,i);if(t.data!==void 0)return cs(t.data,t.mediaType,i);throw E("image_source_missing","An image named neither a path nor data.",`Send { "path": "files/…/shot.png" } (relative to the agent's directory), or { "data": "<base64>", "mediaType": "image/png" }.`,i)}async function ls(e,t,i){if(t.trim()===""||rs(t))throw E("image_path_invalid",`The image path "${t}" is not relative to the agent's directory.`,"Name the file relative to the agent's directory, e.g. files/<conversation>/shot.png.",i);let o=be(e,t),a=be(e);if(o!==a&&!o.startsWith(`${a}${vt}`))throw _t(t,i);let d,l;try{l=await wt(e),d=await wt(be(e,t))}catch{throw E("image_not_found",`No file at "${t}" in the agent's directory.`,"Save the image inside the agent's directory first, then name it relative to that directory.",i)}if(d!==l&&!d.startsWith(`${l}${vt}`))throw _t(t,i);let c=await is(d);if(!c.isFile())throw E("image_not_found",`"${t}" is not a file.`,"Name an image file, not a directory.",i);if(c.size>oo)throw Wt(t,c.size,i);let u=new Uint8Array(await ss(d)),f=Ft(u);if(f===void 0)throw Bt(t,i);return{mediaType:f,data:Buffer.from(u).toString("base64"),ref:t}}function cs(e,t,i){let o=e.replace(/\s+/g,"");if(o===""||o.length%4!==0||!os.test(o))throw E("image_data_invalid","The image's data is not base64.",`Send the file's bytes base64-encoded, with no "data:" prefix.`,i);let{mediaType:a}=us(new Uint8Array(Buffer.from(o,"base64")),"upload",i);if(t!==void 0&&t!==a)throw E("image_media_type_mismatch",`The image was declared ${t} and its bytes are ${a}.`,"Leave mediaType out, or send the type the file really is.",i);return{mediaType:a,data:o,ref:"upload"}}function us(e,t,i="image"){if(e.length>oo)throw Wt(t,e.length,i);let o=Ft(e);if(o===void 0)throw Bt(t,i);return{mediaType:o,data:Buffer.from(e).toString("base64"),ref:t}}function _t(e,t){return E("image_path_invalid",`The image path "${e}" leads outside the agent's directory.`,"Images are read from inside the agent's directory only. Copy the file there first.",t)}function Wt(e,t,i){return E("image_too_large",`"${e}" is ${t} bytes; an image may be at most ${oo}.`,"Resize or compress it first.",i)}function Bt(e,t){return E("image_unsupported",`"${e}" is not a PNG, JPEG, GIF or WebP image.`,"Convert it to one of those formats first.",t)}var gs="session:";function Ht(e){return e.startsWith(gs)}var vs="scope:";function Kt(e){return e.startsWith(vs)}var Et="0123456789abcdefghijklmnopqrstuvwxyz";function ks(e){let t=new Uint8Array(e);crypto.getRandomValues(t);let i="";for(let o of t)i+=Et[o%Et.length];return i}function xe(e,t){return`${e}_${t.toString(36)}${ks(8)}`}function ro(e=Date.now()){return xe("t",e)}function Cs(e=Date.now()){return xe("r",e)}function fs(e=Date.now()){return xe("k",e)}var kt="phase_set",Xt="*",At="tag:";function ps(e){let t=Object.keys(e);return t.find((o)=>e[o]?.entry===!0)??t[0]}function St(e){return e.toLowerCase().replace(/[\s_.-]+/g,"")}function Gt(e,t){if(e===Xt)return!0;if(e.startsWith(At)){let i=e.slice(At.length).toLowerCase();return t.tags.some((o)=>o.toLowerCase()===i)}return St(e)===St(t.slug)}function As(e,t){return e.filter((i)=>!t.some((o)=>Gt(i,o)))}function $s(e,t){let i=e[t];if(i===void 0)return[Xt];return i.allow.includes(kt)?i.allow:[...i.allow,kt]}function jr(e){return e!==void 0&&Object.keys(e).length>1}function hs(e,t){return Object.keys(e).filter((i)=>$s(e,i).some((o)=>Gt(o,t)))}var oA=["user","agent"];function Jr(e,t=""){let i="",o=0;for(;;){let a=e.indexOf("<!--",o);if(a===-1)break;let d=e.indexOf("-->",a+4);if(d===-1)break;i+=e.slice(o,a)+t,o=d+3}return i+e.slice(o)}function io(e){let t=e.length;while(t>0&&e[t-1]==="/")t-=1;return e.slice(0,t)}var Is=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/,xs=/\n{3,}/g;function Ls(e){let t=Is.exec(e);return t===null||t===void 0?e:e.slice(t[0].length)}function Us(e){return Jr(e).replace(xs,`
|
|
36
|
-
|
|
37
|
-
`).trim()}var Z={static:2000,volatile:3500,reminder:500,total:6000};function Ps(e){let t=e.files.filter((d)=>d.tier==="volatile");if(t.length===0)return;let i=(d)=>d.editable==="append"||d.editable==="replace",o=t.find((d)=>i(d)&&d.eviction==="oldest")??t.find(i);if(o!==void 0)return{path:o.path,name:o.name,mode:o.editable==="replace"?"replace":"append",budget:o.budget,eviction:o.eviction};let a=t[0];if(a===void 0)return;return{name:a.name,mode:"refused",reason:a.editable}}function Q(e){return e.names.map((t,i)=>({name:t,path:zt(t)?t:Vt(e.base,t),tier:e.tier,field:`${e.field}[${i}]`}))}function Bs(e,t){let i=e.files??[],o=e.static??[];if(i.length>0&&o.length>0)throw He();let a=zt(e.workspace)?e.workspace:Vt(t,e.workspace),d=[],l=[];if(i.length>0)d.push(...Q({base:t,names:i,tier:"static",field:"context.files"})),l.push({code:"context_files_deprecated",message:`context.files is deprecated; its ${i.length} file(s) were loaded as the static tier.`,hint:"Move them to context.static and set context.workspace to the directory holding them. The tier lists say which files are cache-stable, which the agent may write to, and which sit after the conversation history — none of which an ordered array can express.",field:"context.files"});if(d.push(...Q({base:a,names:o,tier:"static",field:"context.static"})),d.push(...Q({base:a,names:e.volatile??[],tier:"volatile",field:"context.volatile"})),e.reminder!==void 0)d.push(...Q({base:a,names:[e.reminder],tier:"reminder",field:"context.reminder"}));return{refs:d,warnings:l}}var _=n().min(1),Fs=r({delimiters:b(["xml","markdown","plain"]).optional(),intensity:b(["emphatic","neutral","soft"]).optional(),examplesIn:b(["system","user"]).optional(),skillsIn:b(["system","user"]).optional()}).strict(),js=r({nativeTools:L().optional(),strictSchema:L().optional(),thinking:b(["none","anthropic","openai","deepseek"]).optional(),promptCache:b(["none","anthropic","openai","bedrock"]).optional(),parallelToolCalls:L().optional(),contextWindow:s().int().positive().optional(),maxOutput:s().int().positive().optional(),vision:L().optional(),promptStyle:Fs.optional()}).strict(),$t="chat-completions",Zt=r({id:n().min(1),api:n().min(1).optional(),options:x(n(),Ue()).optional(),baseUrl:n().min(1).optional(),apiKeyEnv:n().min(1).optional(),temperature:s().min(0).max(2).optional(),topP:s().min(0).max(1).optional(),maxTokens:s().int().positive().optional(),reasoningEffort:b(["none","minimal","low","medium","high","xhigh","max"]).optional(),headers:x(n(),n()).optional(),streamUsage:L().optional(),capabilities:js.optional()}).strict();function Qt(e,t){if((e.api??$t)===$t&&e.baseUrl===void 0)t.addIssue({code:"custom",path:["baseUrl"],message:"baseUrl is required for the chat-completions transport"})}var Ws=Zt.superRefine(Qt),te=Zt.extend({fallbacks:C(Ws).min(1).optional()}).superRefine(Qt),Hs=r({main:te,selector:te.optional(),compactor:te.optional()}).catchall(te),Ks=r({snip:s().default(0.6),micro:s().default(0.7),collapse:s().default(0.8),reset:s().default(0.88),trim:s().default(0.95)}).strict(),Xs=r({static:s().int().positive().default(Z.static),volatile:s().int().positive().default(Z.volatile),reminder:s().int().positive().default(Z.reminder),total:s().int().positive().default(Z.total)}).strict(),qs=r({perRuleSuccess:s().gt(0).lte(1).default(0.9),reliabilityTarget:s().gt(0).lt(1).default(0.8),onExceed:b(["fail","warn"]).default("fail")}).strict(),Ys=r({file:n().min(1),requires:r({contextWindow:n().min(1).optional(),class:b(["frontier","small"]).optional()}).strict().optional(),onUnmet:b(["distill","omit","fail"]).default("distill"),distilled:n().min(1).optional()}).strict(),zs=r({dir:n().min(1),maxActive:s().int().nonnegative().default(2),budget:s().int().positive().default(600)}).strict(),Vs=r({window:s().int().positive().optional(),reserveOutput:s().int().positive().default(4096),observationMaxTokens:s().int().positive().optional(),modelIdentity:b(["shown","hidden"]).default("shown"),files:C(n().min(1)).default([]),workspace:n().min(1).default("./workspace"),static:C(n().min(1)).default([]),volatile:C(n().min(1)).default([]),reminder:n().min(1).optional(),budgets:Xs.prefault({}),rules:qs.prefault({}),soul:Ys.optional(),compactionNotice:L().optional(),thresholds:Ks.prefault({})}).strict(),Js=r({max:s().int().positive().default(24),reserveWrite:s().int().nonnegative().default(6)}).strict(),Zs=r({onMutate:b(["refuse","confirm","allow"]).default("refuse")}).strict(),ei=r({mode:b(["ask","allow","deny"]).default("allow"),allow:C(n().min(1)).default([]),deny:C(n().min(1)).default([]),onNoApprover:b(["deny","allow"]).default("deny")}).strict(),ti=r({dialect:b(["nlt","native"]).default("nlt"),providers:x(_,x(n(),Ue())).default({}),provider:_.optional(),providerConfig:x(n(),Ue()).default({}),budget:Js.prefault({}),pinned:C(n().min(1)).default([]),search:r({enabled:L().default(!1)}).strict().prefault({}),local:C(n().min(1)).default([]),untrusted:Zs.prefault({}),policy:ei.prefault({}),eventDetail:b(["none","redacted"]).default("none")}).strict(),ni=r({allow:C(n().min(1)),entry:L().optional()}).strict(),si=r({dir:n().min(1).default("./skills"),maxActive:s().int().nonnegative().default(1),threshold:s().default(0.35),trusted:C(n().min(1)).optional()}).strict(),ii=r({retriever:n().min(1).default("fts5"),dir:n().min(1).default("./memory"),maxActive:s().int().nonnegative().default(5),threshold:s().default(0.2),budget:s().int().positive().default(2000),includeHistory:L().default(!0)}).strict(),ri=r({type:_,id:_,allowFrom:C(n().min(1)).optional(),enabled:L().default(!0),role:_.optional()}).passthrough(),en=r({channel:_,to:n().min(1)}).strict(),oi=r({default:_.optional(),reply:b(["all","final"]).default("all"),targets:x(n(),en).default({})}).strict(),de=Gs(()=>r({type:b(["string","number","integer","boolean","array","object"]),description:n().optional(),enum:C(ft([n(),s(),L()])).optional(),items:de.optional(),properties:x(n(),de).optional(),required:C(n()).optional()})),tn=r({id:_,manifest:n().min(1),task:n().min(1),artifact:r({type:pt("object"),properties:x(n(),de),required:C(n()).optional()}).strict()}).strict(),ai=r({members:C(tn).min(1)}).strict(),di=r({name:_,task:n().min(1),tools:C(n().min(1)).min(1),route:r({tools:C(n().min(1)).min(1)}).strict(),artifact:tn.shape.artifact.optional(),model:n().min(1).optional(),maxSteps:s().int().positive().optional(),timeoutMs:s().int().positive().optional()}).strict(),ve={provider:n().min(1),model:n().min(1).optional(),baseUrl:n().min(1).optional(),apiKeyEnv:n().min(1).optional(),options:x(n(),Ue()).optional()},li=r({transcription:r({...ve,timeoutMs:s().int().positive().default(60000),maxBytes:s().int().positive().default(26214400)}).strict().optional(),speech:r({...ve,timeoutMs:s().int().positive().default(60000),maxCharacters:s().int().positive().default(3000)}).strict().optional(),image:r({...ve,timeoutMs:s().int().positive().default(120000),size:n().regex(/^[0-9]+x[0-9]+$/).default("1024x1024")}).strict().optional()}).strict(),ci=r({enabled:L().default(!1),escalateAfterMs:s().int().nonnegative().default(0)}).strict(),ui=r({offer:r({task:n().min(1),artifact:r({type:pt("object"),properties:x(n(),de),required:C(n()).optional()}).strict()}).strict().optional(),to:ft([pt("*"),C(_).min(1)]).optional()}).strict(),nn=r({id:_,kind:b(["cron","every","at"]),expr:n().min(1),task:n().min(1),deliver:ft([pt("none"),en]),session:n().min(1).default("isolated"),role:_.optional(),tools:r({allow:C(n().min(1)).min(1)}).strict().optional(),timeoutMs:s().int().positive().optional(),maxSteps:s().int().positive().optional(),enabled:L().default(!0),timezone:n().min(1).optional()}).strict(),hi=ft([n().min(1),r({spec:n().min(1),config:x(n(),Ue()).default({})}).strict()]),fi=r({identicalCalls:s().int().min(2).default(3),sameTool:s().int().min(2).optional()}).strict(),mi=r({maxSteps:s().int().positive().default(40),noProgress:fi.prefault({}),turnTimeoutMs:s().int().positive().default(1800000),toolTimeoutMs:s().int().positive().default(120000),maxParallelTools:s().int().positive().default(4),maxConcurrentTurns:s().int().positive().optional(),reloadHoldMs:s().int().nonnegative().default(30000),maxHops:s().int().nonnegative().default(4),tokens:r({max:s().int().positive(),windowMs:s().int().positive()}).strict().optional()}).strict(),pi=r({enabled:L().default(!1),port:s().int().min(1).max(65535).default(7420),host:n().min(1).default("127.0.0.1"),tokenEnv:n().min(1).default(`${re.envPrefix}API_TOKEN`),allowedOrigins:C(n().min(1)).default([]),allowedHosts:C(n().min(1)).default([])}).strict(),qr=r({apiVersion:n().min(1),id:_.refine((e)=>!e.startsWith("~"),{message:"An agent id may not start with `~`; that prefix is reserved for shared memory scopes."}),name:n().min(1).optional(),extends:n().min(1).optional(),model:Hs,context:Vs.prefault({}),tools:ti.prefault({}),phases:x(n(),ni).optional(),skills:si.optional(),knowledge:zs.optional(),memory:ii.optional(),channels:C(ri).default([]),delivery:oi.optional(),schedules:C(nn).default([]),team:ai.optional(),subagents:C(di).optional(),media:li.optional(),standIn:ci.optional(),delegation:ui.optional(),plugins:C(hi).default([]),limits:mi.prefault({}),server:pi.prefault({})}).strict(),H=["main","selector","compactor"];function gi(e){return H.includes(e)}function le(e){return Object.keys(e).filter((t)=>!gi(t))}var yi={nativeTools:!1,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,contextWindow:8192,maxOutput:4096},Te={nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,maxOutput:5000},_e={vision:!0,nativeTools:!0,strictSchema:!1,thinking:"anthropic",promptCache:"none",parallelToolCalls:!0},Ee="Thinking blocks must be replayed with tool results or multi-step reasoning degrades silently. Prompt caching is unavailable on Anthropic's OpenAI-compatible endpoint; through OpenRouter the chat-completions transport sends cache_control itself (`sendsCacheControl`).",wd=[{pattern:"gpt-4o*",capabilities:{vision:!0,nativeTools:!0,strictSchema:!0,thinking:"none",promptCache:"openai",parallelToolCalls:!0,contextWindow:128000,maxOutput:16384}},{pattern:"gpt-4.1*",capabilities:{vision:!0,nativeTools:!0,strictSchema:!0,thinking:"none",promptCache:"openai",parallelToolCalls:!0,contextWindow:1e6,maxOutput:32768}},{pattern:"gpt-4-turbo*",capabilities:{nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!0,contextWindow:128000,maxOutput:4096}},{pattern:"gpt-3.5*",capabilities:{nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!0,contextWindow:16385,maxOutput:4096}},{pattern:"gpt-6*",capabilities:{vision:!0,nativeTools:!0,strictSchema:!0,thinking:"openai",promptCache:"openai",parallelToolCalls:!0,contextWindow:1050000,maxOutput:128000},note:"Window and output are reported figures, unverified here. Run `model probe` or override if your endpoint says otherwise."},{pattern:"gpt-5*",capabilities:{vision:!0,nativeTools:!0,strictSchema:!0,thinking:"openai",promptCache:"openai",parallelToolCalls:!0,contextWindow:200000,maxOutput:32768},note:"Deliberately conservative on window and output. Override if your endpoint serves more."},{pattern:"o1*",capabilities:{nativeTools:!0,strictSchema:!0,thinking:"openai",promptCache:"openai",parallelToolCalls:!1,contextWindow:200000,maxOutput:1e5}},{pattern:"o3*",capabilities:{nativeTools:!0,strictSchema:!0,thinking:"openai",promptCache:"openai",parallelToolCalls:!1,contextWindow:200000,maxOutput:1e5}},{pattern:"o4*",capabilities:{nativeTools:!0,strictSchema:!0,thinking:"openai",promptCache:"openai",parallelToolCalls:!1,contextWindow:200000,maxOutput:1e5}},...["claude-fable-5*","claude-opus-5*","claude-opus-4-8*","claude-opus-4-7*","claude-opus-4-6*","claude-sonnet-5*","claude-sonnet-4-6*","claude-haiku-5*"].map((e)=>({pattern:e,capabilities:{..._e,contextWindow:1e6,maxOutput:128000},note:Ee})),{pattern:"claude-haiku-*",family:!0,capabilities:{..._e,contextWindow:200000,maxOutput:64000},note:Ee},{pattern:"claude-*",family:!0,capabilities:{..._e,contextWindow:200000,maxOutput:8192},note:Ee},{pattern:"nova-micro*",capabilities:{...Te,contextWindow:128000}},{pattern:"nova-lite*",capabilities:{...Te,contextWindow:300000,vision:!0}},{pattern:"nova-pro*",capabilities:{...Te,contextWindow:300000,vision:!0}},{pattern:"gemini*",family:!0,capabilities:{vision:!0,nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!0,contextWindow:1e6,maxOutput:8192}},{pattern:"glm-5.3*",capabilities:{nativeTools:!0,strictSchema:!1,thinking:"deepseek",promptCache:"none",parallelToolCalls:!1,contextWindow:1048576,maxOutput:131072},note:"Reasoning is billed to the output budget, like the deepseek rows.",verified:"2026-10-21 via OpenRouter, provider z-ai/fp8"},{pattern:"qwen/qwen3.5*",capabilities:{nativeTools:!0,strictSchema:!1,thinking:"deepseek",promptCache:"none",parallelToolCalls:!1,contextWindow:262144,maxOutput:8192},note:"Reasoning is billed to the output budget, so context.reserveOutput must cover reasoning plus the reply.",verified:"2026-10-23 via OpenRouter, provider deepinfra/bf16 (published context_length 262,144)"},{pattern:"qwen3.5*",capabilities:{nativeTools:!0,strictSchema:!1,thinking:"deepseek",promptCache:"none",parallelToolCalls:!1,contextWindow:32768,maxOutput:8192},note:"Served locally by Ollama, which reports no token usage unless model.<role>.streamUsage is set — token figures come from the estimator until it is. Reasoning is billed to the output budget, so context.reserveOutput must cover reasoning plus the reply.",verified:"2026-08-13 against qwen3.5:9b on localhost:11434/v1"},{pattern:"qwen*",family:!0,capabilities:{nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,contextWindow:32768,maxOutput:8192}},{pattern:"llama*",family:!0,capabilities:{nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,contextWindow:128000,maxOutput:4096}},{pattern:"mistral*",family:!0,capabilities:{nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,contextWindow:32768,maxOutput:8192}},{pattern:"mixtral*",family:!0,capabilities:{nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,contextWindow:32768,maxOutput:8192}},{pattern:"deepseek-v4-pro*",capabilities:{nativeTools:!0,strictSchema:!1,thinking:"deepseek",promptCache:"none",parallelToolCalls:!1,contextWindow:393216,maxOutput:393216},note:"Reasoning tokens are billed to the output budget. With max_tokens=16 this model returned empty content and finish_reason=length; context.reserveOutput must cover reasoning plus the reply.",verified:"2026-08-12 against api.deepseek.com/v1"},{pattern:"deepseek-v4-flash*",capabilities:{nativeTools:!0,strictSchema:!1,thinking:"deepseek",promptCache:"none",parallelToolCalls:!1,contextWindow:1048576,maxOutput:393216},verified:"2026-08-12 against api.deepseek.com/v1 (reasoning confirmed). Measured 2026-08-25 by `model probe --window`: contextWindow 1048576 as a ceiling — the endpoint refused a 1048576-token prompt and named that number; maxOutput 393216 from a refusal naming the range [1, 393216]; automatic prompt caching confirmed at 1024 of 1115 prompt tokens with no breakpoints sent, which is why promptCache stays `none` (it describes the runtime's job, not the provider's behaviour)."},{pattern:"deepseek-v4*",family:!0,capabilities:{nativeTools:!0,strictSchema:!1,thinking:"deepseek",promptCache:"none",parallelToolCalls:!1,contextWindow:393216,maxOutput:393216},note:"Family fallback for v4 ids this registry has not seen. Assumes reasoning, because both measured v4 models emit it."},{pattern:"deepseek-reasoner*",capabilities:{nativeTools:!1,strictSchema:!1,thinking:"deepseek",promptCache:"none",parallelToolCalls:!1,contextWindow:65536,maxOutput:8192},note:"Not served by the account this registry was tested against. Numbers are from provider documentation and are deliberately low — override them if your endpoint serves this id."},{pattern:"deepseek-chat*",capabilities:{nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!0,contextWindow:65536,maxOutput:8192},note:"Unverified, from provider documentation."},{pattern:"deepseek-r1*",capabilities:{nativeTools:!1,strictSchema:!1,thinking:"deepseek",promptCache:"none",parallelToolCalls:!1,contextWindow:65536,maxOutput:8192},note:"The open-weight name for the reasoner, used by self-hosted and Ollama deployments."},{pattern:"deepseek*",family:!0,capabilities:{nativeTools:!0,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,contextWindow:65536,maxOutput:8192}},{pattern:"gemma*",family:!0,capabilities:{nativeTools:!1,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,contextWindow:8192,maxOutput:4096}},{pattern:"phi*",family:!0,capabilities:{nativeTools:!1,strictSchema:!1,thinking:"none",promptCache:"none",parallelToolCalls:!1,contextWindow:16384,maxOutput:4096}},{pattern:"*",capabilities:yi}];var ys={attempts:3,baseDelayMs:400,maxDelayMs:8000};var Nt=/^(?:timeout\s+\S+|time|nice(?:\s+-n\s+\S+)?|stdbuf(?:\s+-\S+)*|command|builtin)\s+/i;function wi(e){let t=e.trim();for(let i=0;i<4&&Nt.test(t);i+=1)t=t.replace(Nt,"").trim();return t}var bi=/&&|\|\||;|\||&|\n/;function Qs(e){return e.split(bi).map((t)=>wi(t)).filter((t)=>t!=="")}var Si=/^(?:[-*+]|\d+[.)])[ \t]+\S/,$i=/\*\*(\d{4})-(\d{2})-\d{2}T/;function $e(e){let t=[],i=-1,o=(a)=>{if(i===-1)return;t.push({start:i,end:a,text:e.slice(i,a).join(`
|
|
38
|
-
`).trimEnd()}),i=-1};for(let a=0;a<e.length;a+=1){let d=e[a]??"";if(Si.test(d)){o(a),i=a;continue}if(i===-1)continue;if(d.trim()===""||/^[ \t]/.test(d))continue;o(a)}return o(e.length),t}function Ne(e){return at(Us(Ls(e)))}function Ni(e,t){let i=$i.exec(e);if(i!==null)return`${i[1]}-${i[2]}.md`;let o=t.getUTCFullYear(),a=`${t.getUTCMonth()+1}`.padStart(2,"0");return`${o}-${a}.md`}function Ii(e,t){let i=e.split(/\r?\n/),o=$e(i),a=[],d=o,l=e,c=Ne(l);while(c>t&&d.length>1){let u=d[0];if(u===void 0)break;a.push(u),d=d.slice(1),l=Ri(i,a),c=Ne(l)}if(c<=t)return{evict:a,remaining:l,tokens:c};return{evict:a,remaining:l,tokens:c,shortfall:d.length<=1?`${c} tokens remain against a ${t}-token budget with one note left, so eviction cannot help`:`${c} tokens remain against a ${t}-token budget`}}function Ri(e,t){let i=new Set;for(let o of t)for(let a=o.start;a<o.end;a+=1)i.add(a);return e.filter((o,a)=>!i.has(a)).join(`
|
|
39
|
-
`).replace(/\n{3,}/g,`
|
|
40
|
-
|
|
41
|
-
`)}async function xi(e){let t=e.tags.length===0?"":` _(${e.tags.join(", ")})_`,i=`
|
|
42
|
-
- **${e.now.toISOString()}**${t} ${e.text}
|
|
43
|
-
`;return await sn(e.path,i,"utf8"),await rn(e)}async function rn(e){let t=await Ei(e.path,"utf8"),i=Ii(t,e.budget);if(i.evict.length===0)return{file:e.name,evicted:0,archives:[],...i.shortfall===void 0?{}:{shortfall:i.shortfall}};let o=new Map;for(let a of i.evict){let d=Ni(a.text,e.now);o.set(d,[...o.get(d)??[],a.text])}await _i(e.archiveDir,{recursive:!0});for(let[a,d]of o)await sn(Ai(e.archiveDir,a),`${d.join(`
|
|
44
|
-
`)}
|
|
45
|
-
`,"utf8");return await ki(e.path,i.remaining,"utf8"),{file:e.name,evicted:i.evict.length,archives:[...o.keys()].sort(),...i.shortfall===void 0?{}:{shortfall:i.shortfall}}}var ue="local",xt="memory",Lt="notes.md",Oi={spec:{slug:"now",provider:ue,summary:"Reports the current date and time.",whenToUse:"you need today's date or the current time — including to work out what 'tomorrow' or 'in three hours' means",whenNotToUse:"the person already told you the date or time; use theirs rather than replacing it with the clock",mutating:!1,tags:["read","time"],parameters:{type:"object",properties:{timezone:{type:"string",description:"IANA name such as Europe/London. Defaults to UTC."},format:{type:"string",description:"iso for a machine-readable timestamp, human for a readable one",enum:["iso","human"],default:"iso"}}}},handler(e,t){let i=t.now(),o=typeof e.timezone==="string"&&e.timezone!==""?e.timezone:"UTC";if(e.format==="human")return`${new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"short",timeZone:o}).format(i)} (${o})`;if(o==="UTC")return i.toISOString();return`${Li(i,o)} (${o})`}};function Li(e,t){let i=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZoneName:"longOffset"}).formatToParts(e),o=(d)=>i.find((l)=>l.type===d)?.value??"",a=o("timeZoneName").replace("GMT","");return`${o("year")}-${o("month")}-${o("day")}T${o("hour")}:${o("minute")}:${o("second")}${a===""?"Z":a}`}var Mi={spec:{slug:"memory_write",provider:ue,summary:"Saves a short note for later recall.",whenToUse:"the person tells you something durable about themselves or their work that later conversations should know",whenNotToUse:"for anything already in this conversation, for secrets or credentials, or to store your own reasoning",mutating:!0,tags:["write","memory"],parameters:{type:"object",properties:{text:{type:"string",description:"The note, in one or two sentences."},tags:{type:"array",items:{type:"string"},description:"Optional labels."}},required:["text"]}},async handler(e,t){let i=typeof e.text==="string"?e.text.trim():"",o=Array.isArray(e.tags)?e.tags.map((f)=>String(f)):[],a=t.now().toISOString(),d=o.length===0?"":` _(${o.join(", ")})_`,l=`
|
|
46
|
-
- **${a}**${d} ${i}
|
|
47
|
-
`;if(t.writeNote!==void 0)return await t.writeNote(o.length===0?i:`${i} (${o.join(", ")})`);let c=t.writeTarget;if(c?.mode==="refused")throw Ke(c.name,c.reason??"none");if(c?.path!==void 0){if(c.budget!==void 0&&t.memoryDir!==void 0&&c.eviction==="oldest"){let f=await xi({path:c.path,name:c.name,budget:c.budget,archiveDir:t.memoryDir,text:i,tags:o,now:t.now()});if(f.shortfall!==void 0)return`Saved to ${f.file}, but it is still over budget: ${f.shortfall}. Ask the person to raise the budget or shorten the file — the agent will not load until they do.`;if(f.evicted===0)return`Saved to ${f.file}.`;return`Saved to ${f.file}. Moved ${f.evicted} older ${f.evicted===1?"note":"notes"} into ${f.archives.join(", ")}, still searchable.`}if(await It(c.path,l,"utf8"),c.budget!==void 0){let f=Ne(await Ti(c.path,"utf8"))-c.budget;if(f>0)return`Saved to ${c.name}, which is now ${f} tokens over its ${c.budget}-token budget. The agent will not load until that is fixed: add \`eviction: oldest\` to its frontmatter so older notes move to the memory directory, or raise the budget.`}return`Saved to ${c.name}.`}let u=Rt(t.dir,xt);return await vi(u,{recursive:!0}),await It(Rt(u,Lt),l,"utf8"),`Saved to ${xt}/${Lt}.`}},Di=1200,Ci=Di*3,Ui={spec:{slug:"artifact_read",provider:ue,summary:"Reads back a tool result that compaction replaced with a pointer.",whenToUse:"a compaction marker in this conversation names an id, and you need the tool result it replaced",whenNotToUse:"for anything still written out in the conversation, or to explore — every id comes from a marker, so there is nothing to browse",mutating:!1,tags:["read","context"],parameters:{type:"object",properties:{id:{type:"string",description:"The id printed inside the compaction marker, copied character for character."},from:{type:"integer",description:"Character offset to continue from. Omit for the beginning; a truncated reply says the number to pass."}},required:["id"]}},async handler(e,t){let i=typeof e.id==="string"?e.id.trim():"",o=typeof e.from==="number"&&e.from>0?Math.floor(e.from):0;if(t.readArtifact===void 0)throw Ye();let a=await t.readArtifact(i);if(a===void 0)throw ze(i);let d=a.slug===void 0?"observation":`${a.slug} observation`,l=a.content.slice(o,o+Ci),c=o+l.length,u=`Compacted ${d}, ${a.tokens} tokens${o===0?"":`, from character ${o}`}:`;if(c>=a.content.length)return`${u}
|
|
48
|
-
${l}`;return`${u}
|
|
49
|
-
${l}
|
|
50
|
-
|
|
51
|
-
[cut here — ${a.content.length-c} characters remain; continue with artifact_read(id, from: ${c})]`},trustOf:(e)=>ot(typeof e.id==="string"?e.id.trim():"")};var Pi=30,Fi={spec:{slug:"memory_forget",provider:ue,summary:"Finds and deletes saved notes, and what was said in past conversations.",whenToUse:"the person asks you to forget something you noted. Call it with `query` first, show the person what matched, then call it with the `ids` they confirm",whenNotToUse:"to tidy notes nobody asked you to remove, or with `ids` you have not shown the person",mutating:!0,tags:["write","memory"],parameters:{type:"object",properties:{query:{type:"string",description:"Words every matching note or past message contains, case-insensitive. Lists matches; deletes nothing."},ids:{type:"array",items:{type:"string"},description:"Ids from a previous listing (notes and conversation messages). Deletes exactly these."}}}},async handler(e,t){let i=typeof e.query==="string"?e.query.trim():"",o=Array.isArray(e.ids)?e.ids.map((u)=>String(u).trim()).filter((u)=>u!==""):[];if(i===""===(o.length===0))throw Xe();if(t.forgetMemory===void 0)throw qe();let a=(u)=>u==="space"?"the team's shared memory":"your notes";if(i!==""){let u=await t.forgetMemory({query:i});if(u.notes.length===0)return`No note in ${a(u.scope)} contains "${i}".`;let f=u.notes.slice(0,Pi),g=u.notes.length>f.length?`
|
|
52
|
-
${u.notes.length-f.length} more match; use more words to narrow it down.`:"";return[`${u.notes.length} ${u.notes.length===1?"note":"notes"} in ${a(u.scope)} ${u.notes.length===1?"matches":"match"}. Nothing is deleted yet: show these to the person, then call memory_forget with the ids they confirm.`,...f.map((m)=>`- ${m.id} (${m.source}): ${m.text}`)].join(`
|
|
53
|
-
`)+g}let d=await t.forgetMemory({ids:o}),l=d.notes.length===0?`Nothing was deleted from ${a(d.scope)}.`:`Deleted ${d.notes.length} ${d.notes.length===1?"note":"notes"} from ${a(d.scope)}; they will not be recalled again.`,c=d.missing.length===0?"":` No note has ${d.missing.length===1?"the id":"the ids"} ${d.missing.join(", ")}: already gone, or not yours to delete here.`;return l+c}},ji=[Oi,Mi,Fi,Ui],Ed=ji.map((e)=>e.spec.slug);class qt extends ee{static ERROR_NAME="MediaError"}function ke(e,t,i,o){let a=i.get(t.provider);if(a===void 0)throw new h({code:"media_provider_unknown",message:`${e}.provider is "${t.provider}", and no media provider by that name is registered. Registered: ${[...i.keys()].sort().join(", ")}.`,hint:t.provider==="aws"?"Amazon Transcribe and Nova Canvas come from the media-aws plugin, which the CLI and the image include. An embedder calling the runtime directly passes it in `builtInPlugins`.":'Use "openai" for any endpoint speaking the OpenAI audio and image routes, or add the plugin that provides this one.',field:`${e}.provider`});let d=t.options;if(a.optionsSchema!==void 0&&t.options!==void 0){let f=a.optionsSchema.safeParse(t.options);if(!f.success)throw new h({code:"media_provider_options_invalid",message:`${e}.options are not valid for the ${t.provider} provider: ${f.error.issues?.[0]?.message??"invalid"}.`,hint:`See the ${t.provider} media provider's documentation for the fields it takes.`,field:`${e}.options`});d=f.data}let l=a.create({field:e,config:t,options:d,env:o.env,...o.fetch===void 0?{}:{fetch:o.fetch}}),[c,u]=e==="media.transcription"?[l.transcribe,"transcribe audio"]:e==="media.speech"?[l.synthesize,"speak text"]:[l.generateImage,"generate images"];if(c===void 0)throw new h({code:"media_provider_incapable",message:`The ${t.provider} media provider does not ${u}.`,hint:"Name a provider that does in this section; the two sections may name different providers.",field:`${e}.provider`});return l}var Xi={"audio/ogg":"ogg","audio/opus":"ogg","audio/mpeg":"mp3","audio/mp4":"m4a","audio/x-m4a":"m4a","audio/aac":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/webm":"webm","audio/flac":"flac"};function Gi(e){return Xi[e.split(";")[0]?.trim().toLowerCase()??""]??"ogg"}async function ne(e,t,i){let o=(await e.text().catch(()=>"")).slice(0,300);return new qt({code:"media_provider_refused",message:`${t} was refused (${e.status}): ${o}`,hint:e.status===401||e.status===403?`Check the key in the env var ${i}.apiKeyEnv names, and that it may use this model.`:"The provider's own words are above.",field:i})}var qi={create(e){let{config:t,field:i}=e,o=io(t.baseUrl??"https://api.openai.com/v1"),a=t.apiKeyEnv??"OPENAI_API_KEY",d=e.env[a];if(d===void 0||d==="")throw new h({code:"media_key_missing",message:`${i} needs ${a}, which is not set.`,hint:`Put the endpoint's key in ${a}, in the environment or the .env beside the manifest, or name another variable with ${i}.apiKeyEnv.`,field:`${i}.apiKeyEnv`});let l=e.fetch??((u,f)=>fetch(u,f)),c=`Bearer ${d}`;return{async transcribe(u,f){let g=new FormData;g.set("file",new Blob([u.bytes],{type:u.mimeType}),`voice.${Gi(u.mimeType)}`),g.set("model",t.model??"whisper-1");let m=await l(`${o}/audio/transcriptions`,{method:"POST",headers:{authorization:c},body:g,signal:f});if(!m.ok)throw await ne(m,"The transcription",i);let p=await m.json();return{text:typeof p.text==="string"?p.text:"",...typeof p.duration==="number"?{durationS:p.duration}:{}}},async synthesize(u,f){let g=t.options??{},m=await l(`${o}/audio/speech`,{method:"POST",headers:{authorization:c,"content-type":"application/json"},body:JSON.stringify({model:t.model??"gpt-4o-mini-tts",voice:typeof g.voice==="string"?g.voice:"alloy",input:u.text,response_format:"opus"}),signal:f});if(!m.ok)throw await ne(m,"The speech request",i);return{bytes:new Uint8Array(await m.arrayBuffer()),mimeType:"audio/ogg; codecs=opus",characters:u.text.length}},async generateImage(u,f){let g=await l(`${o}/images/generations`,{method:"POST",headers:{authorization:c,"content-type":"application/json"},body:JSON.stringify({model:t.model??"gpt-image-1",prompt:u.prompt,size:u.size,n:1}),signal:f});if(!g.ok)throw await ne(g,"The image request",i);let p=(await g.json()).data?.[0];if(p?.b64_json!==void 0)return{bytes:Buffer.from(p.b64_json,"base64"),mimeType:"image/png"};if(p?.url!==void 0){let y=await l(p.url,{signal:f});if(!y.ok)throw await ne(y,"Downloading the image",i);return{bytes:new Uint8Array(await y.arrayBuffer()),mimeType:y.headers.get("content-type")??"image/png"}}throw new qt({code:"media_provider_empty",message:"The image endpoint answered with no image.",hint:"Some endpoints return an empty list for a refused prompt. Rephrasing it is usually what works.",field:i})}}}},Yi=new Map([["openai",qi]]);function zi(e,t){let i=new Map([...Yi,...t.providers??[]]),o=e.media?.transcription,a=e.media?.image,d=e.media?.speech;return{...d===void 0?{}:{speech:{config:d,provider:ke("media.speech",d,i,t)}},...o===void 0?{}:{transcription:{config:o,provider:ke("media.transcription",o,i,t)}},...a===void 0?{}:{image:{config:a,provider:ke("media.image",a,i,t)}}}}function on(e){let t=e.providers??{},i=Object.keys(t),o=e.provider,a=e.providerConfig??{};if(i.length>0&&(o!==void 0||Object.keys(a).length>0))throw Be(i,o);if(o!==void 0)return{selections:[{id:o,config:a,legacy:!0}],warnings:[{code:"tools_provider_deprecated",message:`tools.provider is deprecated; "${o}" was loaded as tools.providers.${o}.`,hint:`Rewrite it as:
|
|
54
|
-
tools:
|
|
55
|
-
providers:
|
|
56
|
-
${o}: { … the contents of providerConfig … }
|
|
57
|
-
The scalar permits exactly one provider, which is why an agent could not have the shell and the web at the same time. It still works and will keep working for now; nothing about the resolved catalogue changes.`,field:"tools.provider"}]};let d=i.map((l)=>({id:l,config:t[l]??{},legacy:!1}));if(Object.keys(a).length>0)return{selections:d,warnings:[{code:"tools_provider_config_orphaned",message:`tools.providerConfig has ${Object.keys(a).length} setting(s) and no tools.provider names a provider to apply them to, so they do nothing.`,hint:"Move them into the matching tools.providers.<id> block and delete tools.providerConfig. Reported rather than ignored: a configuration that looks applied and is not is worse than one that fails.",field:"tools.providerConfig"}]};return{selections:d,warnings:[]}}var Mt=new Map;function an(e){let t=Mt.get(e);if(t!==void 0)return t;let i;try{i=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch(o){throw new h({code:"schedule_timezone_unknown",message:`"${e}" is not a timezone this runtime recognises.`,hint:"Use an IANA name such as Asia/Dhaka, Europe/London or America/Sao_Paulo — not an abbreviation like BST and not a UTC offset. Omit the field to use the TZ environment variable, then UTC.",field:"timezone",cause:o})}return Mt.set(e,i),i}function Vi(e){an(e)}function ce(e,t){let i=an(e).formatToParts(new Date(t)),o=(c)=>{let u=i.find((f)=>f.type===c);return u===void 0?0:Number(u.value)},a=o("year"),d=o("month"),l=o("day");return{year:a,month:d,day:l,hour:o("hour"),minute:o("minute"),second:o("second"),weekday:new Date(Date.UTC(a,d-1,l)).getUTCDay()}}function Ji(e,t){return ce(e,t)}function Dt(e,t){let i=ce(e,t);return Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,i.second)-(t-t%1000)}function Zi(e,t){let i=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second),o=i-Dt(e,i);o=i-Dt(e,o);let a=ce(e,o);if(!(a.year===t.year&&a.month===t.month&&a.day===t.day&&a.hour===t.hour&&a.minute===t.minute&&a.second===t.second))return;let l=o-3600000,c=ce(e,l);return c.year===t.year&&c.month===t.month&&c.day===t.day&&c.hour===t.hour&&c.minute===t.minute&&c.second===t.second?l:o}function Qi(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}var er=1462,dn=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],tr=["sun","mon","tue","wed","thu","fri","sat"],F={second:{min:0,max:59,label:"second"},minute:{min:0,max:59,label:"minute"},hour:{min:0,max:23,label:"hour"},dayOfMonth:{min:1,max:31,label:"day of month"},month:{min:1,max:12,names:dn,label:"month"},dayOfWeek:{min:0,max:7,names:tr,label:"day of week"}};function M(e,t,i,o){throw new h({code:"schedule_cron_malformed",message:`"${e}" is not a valid cron expression: ${t}`,hint:i,field:o})}function Ae(e,t,i,o){let a=t.names?.indexOf(e.toLowerCase());if(a!==void 0&&a!==-1)return a+(t.names===dn?1:0);if(!/^\d+$/.test(e))M(i,`"${e}" is not a ${t.label}.`,t.names===void 0?`The ${t.label} field takes numbers ${t.min}-${t.max}, ranges, steps and comma lists.`:`The ${t.label} field takes ${t.min}-${t.max} or a name (${t.names.slice(0,3).join(", ")}…).`,o);let d=Number(e);if(d<t.min||d>t.max)M(i,`${d} is outside the ${t.label} range ${t.min}-${t.max}.`,`Check the field order: ${t.label==="second"?"second minute hour day-of-month month day-of-week":"minute hour day-of-month month day-of-week"}.`,o);return d}function j(e,t,i,o){let a=new Set,d=!0;for(let l of e.split(",")){let c=l.trim();if(c==="")M(i,"an empty entry in a comma list.","Remove the stray comma.",o);let[u="",f]=c.split("/",2),g=f===void 0?1:Number(f);if(f!==void 0&&(!/^\d+$/.test(f)||g<1))M(i,`"${f}" is not a step.`,"A step is a whole number above zero, as in */15.",o);let m,p;if(u==="*"){if(m=t.min,p=t.max,g===1)d=!1}else if(u.includes("-")){let[y="",w=""]=u.split("-",2);if(m=Ae(y,t,i,o),p=Ae(w,t,i,o),m>p)M(i,`the range ${u} runs backwards.`,"Write the lower bound first, or use a comma list to wrap around.",o)}else m=Ae(u,t,i,o),p=f===void 0?m:t.max;for(let y=m;y<=p;y+=g)a.add(y)}if(a.size===0)M(i,"it matches nothing.","Every field must admit at least one value.",o);return{values:a,restricted:d}}function nr(e,t){let i=e.trim();if(i.startsWith("@"))M(i,"macros are not supported.",'Write the fields out — @daily is "0 0 * * *", @hourly is "0 * * * *", @weekly is "0 0 * * 0". For a plain interval use kind: every with an expression like 24h.',t);let o=i.split(/\s+/).filter((I)=>I!=="");if(o.length!==5&&o.length!==6)M(i,`it has ${o.length} field${o.length===1?"":"s"}, not 5 or 6.`,"Five fields are minute hour day-of-month month day-of-week. A sixth leading field is seconds.",t);let a=o.length===6,[d,l,c,u,f,g]=a?o:["0",...o],m=j(d??"0",F.second,i,t),p=j(l??"",F.minute,i,t),y=j(c??"",F.hour,i,t),w=j(u??"",F.dayOfMonth,i,t),v=j(f??"",F.month,i,t),T=j(g??"",F.dayOfWeek,i,t),A=new Set;for(let I of T.values)A.add(I===7?0:I);return{seconds:m.values,minutes:p.values,hours:y.values,daysOfMonth:w.values,months:v.values,daysOfWeek:A,domRestricted:w.restricted,dowRestricted:T.restricted,source:i}}function sr(e,t,i){let o=e.daysOfMonth.has(t),a=e.daysOfWeek.has(i);if(e.domRestricted&&e.dowRestricted)return o||a;if(e.domRestricted)return o;if(e.dowRestricted)return a;return!0}function Ct(e,t,i,o){let a=new Date(Date.UTC(e,t-1,i+o));return[a.getUTCFullYear(),a.getUTCMonth()+1,a.getUTCDate()]}function ir(e,t,i){return new Date(Date.UTC(e,t-1,i)).getUTCDay()}function z(e,t,i){let o=Ji(i,t+1000),a=new Date(Date.UTC(o.year,o.month-1,o.day+er)),[d,l,c]=[o.year,o.month,o.day],u=!0;while(Date.UTC(d,l-1,c)<=a.getTime()){if(!e.months.has(l)){[d,l,c]=l===12?[d+1,1,1]:[d,l+1,1],u=!1;continue}if(!sr(e,c,ir(d,l,c))){[d,l,c]=Ct(d,l,c,1),u=!1;continue}for(let f of[...e.hours].sort((g,m)=>g-m)){if(u&&f<o.hour)continue;for(let g of[...e.minutes].sort((m,p)=>m-p)){if(u&&f===o.hour&&g<o.minute)continue;for(let m of[...e.seconds].sort((p,y)=>p-y)){if(u&&f===o.hour&&g===o.minute&&m<o.second)continue;let p=Zi(i,{year:d,month:l,day:c,hour:f,minute:g,second:m});if(p!==void 0)return p}}}[d,l,c]=Ct(d,l,c,1),u=!1}return}var rr=/^(\d+)(s|m|h|d)$/,or={s:1000,m:60000,h:3600000,d:86400000},ar=1000,mr=315360000000;function gr(e,t){let i=rr.exec(e.trim());if(i===null)throw new h({code:"schedule_duration_malformed",message:`"${e}" is not a duration.`,hint:"A duration is a whole number and one unit: 90s, 15m, 2h, 7d. There is no combined form — write 90m rather than 1h30m.",field:t});let o=Number(i[1]),a=i[2]??"",d=o*(or[a]??0);if(d<ar)throw new h({code:"schedule_duration_too_small",message:`"${e}" is under the one-second minimum.`,hint:"An interval below a second is a busy loop rather than a schedule. If the intent is to run continuously, a schedule is the wrong mechanism.",field:t});if(d>mr)throw new h({code:"schedule_duration_too_large",message:`"${e}" is over the ten-year maximum.`,hint:"An interval this long is almost always a unit typo — check whether d was meant where h was written.",field:t});return{ms:d,source:e.trim()}}var yr=315360000000,wr=900000,Se=1000;function ln(e){let t=e.timezone??Qi();Vi(t);let i=e.expr.trim();if(e.kind==="cron"){let a=nr(i,e.field);if(z(a,e.now,t)===void 0)throw new h({code:"schedule_cron_unsatisfiable",message:`"${i}" never matches a real date.`,hint:"The expression parses but names a day that does not occur — 30 February, or a weekday-and-date pair that never coincide. Checked over four years, so a leap-year schedule like 0 3 29 2 * is accepted.",field:e.field});return{kind:"cron",spec:a,zone:t,source:i}}if(e.kind==="every")return{kind:"every",every:gr(i,e.field),zone:t,source:i};let o=Date.parse(i);if(Number.isNaN(o))throw new h({code:"schedule_at_malformed",message:`"${i}" is not an ISO 8601 instant.`,hint:"Write a full timestamp with an offset, as in 2026-12-25T09:00:00+06:00 or 2026-12-25T03:00:00Z. A bare date has no time of day.",field:e.field});if(o>e.now+yr)throw new h({code:"schedule_at_too_far",message:`${i} is more than ten years away.`,hint:"A one-shot this far out is almost always a year typo. Ten years is the documented bound.",field:e.field});return{kind:"at",at:o,zone:t,source:i}}function br(e){let t=2166136261;for(let i=0;i<e.length;i+=1)t^=e.charCodeAt(i),t=Math.imul(t,16777619)>>>0;return t}function vr(e,t){if(t===void 0||t<=0)return 0;let i=Math.min(Math.floor(t/10),wr);return i<=0?0:br(e)%i}function Tr(e,t){if(e.kind==="every")return e.every.ms;if(e.kind==="at")return;let i=z(e.spec,t,e.zone);if(i===void 0)return;let o=z(e.spec,i,e.zone);return o===void 0?void 0:o-i}function _r(e,t,i,o,a={}){if(e.kind==="at"){if(a.consumed===!0)return{runAt:void 0,anchor:void 0,missed:0,missedCapped:!1,late:!1};if(e.at<=o)return{runAt:o,anchor:e.at,missed:0,missedCapped:!1,late:!0};return{runAt:e.at,anchor:e.at,missed:0,missedCapped:!1,late:!1}}let d=vr(t,Tr(e,i));if(e.kind==="every"){let f=o-i,g=f<=0?0:Math.floor(f/e.every.ms),m=Math.min(g,Se),p=g+1,y=i+p*e.every.ms;return{runAt:y+d,anchor:y,missed:m,missedCapped:g>Se,late:!1}}let l=i,c=0,u=!1;for(;;){let f=z(e.spec,l,e.zone);if(f===void 0)return{runAt:void 0,anchor:void 0,missed:c,missedCapped:u,late:!1};if(f+d>o)return{runAt:f+d,anchor:f,missed:c,missedCapped:u,late:!1};if(l=f,c+=1,c>=Se){u=!0;let g=z(e.spec,o,e.zone);return{runAt:g===void 0?void 0:g+d,anchor:g,missed:c,missedCapped:!0,late:!1}}}}function kr(e,t,i){let o=[],a=Array.isArray(e.schedules)?e.schedules:[],d=new Set((Array.isArray(e.channels)?e.channels:[]).map((f)=>f!==null&&typeof f==="object"&&!Array.isArray(f)?f.id:void 0).filter((f)=>typeof f==="string")),l=new Set([...H,...le(t.model)]),c=new Set,u=new Set;for(let[f,g]of a.entries()){if(g===null||typeof g!=="object"||Array.isArray(g))continue;let m=g,p=typeof m.id==="string"?m.id:`[${f}]`;if(u.has(p))o.push({code:"schedule_id_duplicate",message:`Two schedules share the id "${p}".`,hint:"A schedule id is the key reconciliation matches on and the segment of its session key, so it must be unique within an agent.",field:`schedules[${f}].id`});u.add(p);let y=m.deliver;if(y===void 0)o.push({code:"schedule_missing_delivery",message:`Schedule "${p}" has no delivery target.`,hint:'Set deliver to { channel, to }, or the literal "none" to return results only via the event stream.',field:`schedules[${f}].deliver`});else if(y!=="none"&&typeof y==="object"&&!Array.isArray(y)){let T=y.channel;if(typeof T==="string"&&!d.has(T))o.push({code:"schedule_delivery_channel_unknown",message:`Schedule "${p}" delivers to "${T}", which is not a channel id on this agent.${d.size===0?" The agent declares no channels.":` Declared: ${[...d].join(", ")}.`}`,hint:`A delivery target names a channel's id, not its type. Use deliver: "none" to return results through the event stream instead.`,field:`schedules[${f}].deliver.channel`})}let w=m.role;if(typeof w==="string"){if(c.add(w),!l.has(w))o.push({code:"schedule_role_unknown",message:`Schedule "${p}" names the model role "${w}", which is not declared under model:. Declared: ${[...l].join(", ")}.`,hint:"Add the role under model:, or point the schedule at one of the declared roles. Omit role entirely to use main.",field:`schedules[${f}].role`})}let v=t.schedules[f];if(v!==void 0)try{ln({id:v.id,kind:v.kind,expr:v.expr,timezone:v.timezone,now:i,field:`schedules[${f}].expr`})}catch(T){if(!(T instanceof ee))throw T;o.push(T.toDetail())}}for(let f of t.subagents??[])c.add(f.model??"subagent");for(let f of le(t.model)){if(c.has(f))continue;if(Yt(f,H)===void 0)continue;o.push({code:"model_role_unreferenced",message:`model.${f} is declared but no schedule names it, so nothing will ever use it.`,hint:`If "${f}" was meant to be one of ${H.join(", ")}, it is misspelled — and the misspelled one is silently falling back to main. Otherwise point a schedule at it with role: ${f}, or remove it.`,field:`model.${f}`})}return o}function Ar(e){let t=[],i=new Set([...e.tools.pinned,...e.tools.local]),o=new Set([...H,...le(e.model)]),a=new Set,d=new Map;for(let[l,c]of(e.subagents??[]).entries()){let u=`subagents[${l}]`;if(a.has(c.name))t.push({code:"subagent_name_duplicate",message:`Two subagents are called "${c.name}".`,hint:"Give each subagent its own name: it is how events, sessions and usage rows say which child ran.",field:`${u}.name`});a.add(c.name);let f=c.tools.filter((g)=>!i.has(g));if(f.length>0)t.push({code:"subagent_tool_not_pinned",message:`Subagent "${c.name}" lists ${f.join(", ")}, which this agent does not pin.`,hint:"A subagent may only use tools its parent has, so it can never act with more authority than the parent. Add the slug to tools.pinned (or tools.local), or remove it from the subagent.",field:`${u}.tools`});for(let g of c.route.tools){if(!c.tools.includes(g))t.push({code:"subagent_route_outside_tools",message:`Subagent "${c.name}" routes ${g} but does not list it under tools, so it could not make the call it is handed.`,hint:`Add ${g} to subagents[${l}].tools.`,field:`${u}.route.tools`});let m=d.get(g);if(m!==void 0&&m!==c.name)t.push({code:"subagent_route_duplicate",message:`${g} is routed to both "${m}" and "${c.name}".`,hint:"A routed call runs exactly one child. Route the slug from one subagent only.",field:`${u}.route.tools`});d.set(g,c.name)}if(c.model!==void 0&&!o.has(c.model))t.push({code:"subagent_role_unknown",message:`Subagent "${c.name}" names the model role "${c.model}", which is not declared under model:. Declared: ${[...o].join(", ")}.`,hint:"Add the role under model:, or remove model: from the subagent to use model.subagent (or main).",field:`${u}.model`})}return t}function Sr(e){let t=new Set([...H,...le(e.model)]);return(e.channels??[]).flatMap((i,o)=>i.role===void 0||t.has(i.role)?[]:[{code:"channel_role_unknown",message:`Channel "${i.id}" names the model role "${i.role}", which is not declared under model:. Declared: ${[...t].join(", ")}.`,hint:"Add the role under model:, or point the channel at one of the declared roles. Omit role to run its turns on main.",field:`channels[${o}].role`}])}function cn(e){if(typeof e!=="string")return String(e);let t=/^[A-Za-z0-9_./@~-]+$/.test(e),i=/^[A-Za-z0-9_./]/.test(e);if(!t||!i)return JSON.stringify(e);try{return ae(e)===e?e:JSON.stringify(e)}catch{return JSON.stringify(e)}}function V(e){return e.length-e.trimStart().length}function Oe(e){let t=e.trim();return t===""||t.startsWith("#")}function Le(e,t,i,o){let a=new RegExp(`^\\s{${i}}${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*:`);for(let d=o;d<e.length;d+=1){let l=e[d]??"";if(Oe(l))continue;if(V(l)<i)return;if(V(l)===i&&a.test(l))return d}return}function se(e,t,i){let o=t;for(let a=t+1;a<e.length;a+=1){let d=e[a]??"";if(Oe(d))continue;if(V(d)<=i)break;o=a}return o}function $r(e){let t;for(let i=0;i<e.length;i+=1){let o=e[i];if(t!==void 0){if(o===t)t=void 0;continue}if(o==='"'||o==="'"){t=o;continue}if(o!=="#"||i===0||!/\s/.test(e[i-1]??""))continue;let a=i;while(a>0&&/\s/.test(e[a-1]??""))a-=1;return e.slice(a)}return""}function Me(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function K(e,t,i){let o=" ".repeat(i);if(Array.isArray(t)){if(t.length===0)return[`${o}${e}: []`];return[`${o}${e}:`,...t.flatMap((a)=>Nr(a,i+2))]}if(Me(t)){let a=Object.entries(t);if(a.length===0)return[`${o}${e}: {}`];return[`${o}${e}:`,...a.flatMap(([d,l])=>K(d,l,i+2))]}return[`${o}${e}: ${cn(t)}`]}function Nr(e,t){let i=" ".repeat(t);if(!Me(e))return[`${i}- ${cn(e)}`];let o=Object.entries(e);if(o.length===0)return[`${i}- {}`];let a=o.flatMap(([c,u])=>K(c,u,t+2)),[d,...l]=a;return[`${i}- ${(d??"").trimStart()}`,...l]}function un(e,t){let i=0,o=0,a,d=0;for(;d<t.length-1;d+=1){let l=Le(e,t[d]??"",o,i);if(l===void 0)break;a=l,i=l+1;let c=e.slice(l+1).find((u)=>!Oe(u)&&V(u)>o);if(c===void 0)return;o=V(c)}return{searchFrom:i,indent:o,parent:a,depth:d}}function hn(e,t){if(t.length===0)return;let i=e.split(`
|
|
58
|
-
`),o=un(i,t);if(o===void 0)return;if(o.depth<t.length-1)return e;let a=Le(i,t[t.length-1]??"",o.indent,o.searchFrom);if(a===void 0)return e;let d=se(i,a,o.indent),l=[...i.slice(0,a),...i.slice(d+1)].join(`
|
|
59
|
-
`),c=t.slice(0,-1);if(c.length>0&&W(l).getIn([...c])==null)return hn(l,c)??l;return l}function Rr(e,t,i){if(t.length===0)return;let o=e.split(`
|
|
60
|
-
`),a=un(o,t);if(a===void 0)return;let{searchFrom:d,indent:l,parent:c,depth:u}=a;if(u<t.length-1){if(c===void 0)return;let p=se(o,c,l-1)+1;return[...o.slice(0,p),...fn(t.slice(u),i,l),...o.slice(p)].join(`
|
|
61
|
-
`)}let f=t[t.length-1]??"",g=Le(o,f,l,d);if(g!==void 0){let p=o[g]??"",y=Array.isArray(i)||Me(i)?"":$r(p),w=se(o,g,l),v=K(f,i,l);if(y!=="")v[0]=`${v[0]}${y}`;return[...o.slice(0,g),...v,...o.slice(w+1)].join(`
|
|
62
|
-
`)}if(c===void 0)return;let m=se(o,c,l-1)+1;return[...o.slice(0,m),...K(f,i,l),...o.slice(m)].join(`
|
|
63
|
-
`)}function fn(e,t,i){let[o,...a]=e;if(o===void 0)return[];if(a.length===0)return K(o,t,i);return[`${" ".repeat(i)}${o}:`,...fn(a,t,i+xr)]}var xr=2;function Or(e,t,i){let o=e.split(`
|
|
64
|
-
`),a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(`^#\\s*${a}\\s*:`),l=o.findIndex((f)=>d.test(f));if(l===-1)return;let c=l;while(/^#\s{2,}\S/.test(o[c+1]??""))c+=1;let u=/^#\s*Phase \d/.test(o[l-1]??"")?l-1:l;return[...o.slice(0,u),...K(t,i,0),...o.slice(c+1)].join(`
|
|
65
|
-
`)}function Lr(e,t){let i=[...t.path],o=i.join("."),a=De(W(e),i),d=t.remove===!0?hn(e,i):Rr(e,i,t.value)??t.fallback?.(e)??(i.length===1?Or(e,i[0]??"",t.value):void 0),l;if(d===void 0){let m=W(e);if(t.remove===!0)m.deleteIn(i);else m.setIn(i,t.value);l=String(m)}else l=d;let c=W(l);if(c.errors.length>0)throw B(o,`the result is not valid YAML — ${c.errors[0]?.message??"unparseable"}`);let u=qr.safeParse(c.toJS());if(!u.success){let m=u.error.issues[0];throw B(o,`${m?.path.join(".")??o}: ${m?.message??"does not fit the schema"}`)}let g=kr(c.toJS(),u.data,Date.now())[0]??Sr(u.data)[0]??Ar(u.data)[0];if(g!==void 0)throw B(o,`${g.message} ${g.hint}`);try{on(u.data.tools)}catch(m){throw B(o,m instanceof Error?m.message:"the providers block does not resolve")}return{next:l,before:a,reflowed:d===void 0,manifest:u.data}}async function ms(e){let{edits:t}=await Vr(e.file,[e]);return t[0]}async function Vr(e,t){let i;try{i=await Wi(e,"utf8")}catch(d){throw Dr(e,d)}let o=Mr(i,e,t),a=o.next!==i;if(a)await Bi(e,o.next,"utf8");return{edits:o.edits,written:a}}function Mr(e,t,i){let o=e,a=[];for(let d of i){let l={...d,file:t},c=Lr(o,l),u=!Ki(c.before,De(W(c.next),l.path));if(u)Ur(l,c.manifest),Pr(l,c.manifest),o=c.next;a.push({before:c.before,after:l.remove===!0?void 0:l.value,reflowed:u&&c.reflowed,manifest:c.manifest,changed:u})}return{next:o,edits:a}}function so(e){let t=e.trim();if(t==="")return"";let i=W(t);if(i.errors.length>0)throw new ee({code:"manifest_value_unreadable",message:`Cannot read ${JSON.stringify(e)} as a value.`,hint:'A bare word, a number, true or false, a list as ["a", "b"], or a map as {k: v}. Quote anything containing a colon or a "#".'});return i.toJS()}function Ss(e,t){return De(W(e),t)}function ws(e){return W(e).toJS()}function De(e,t){let i=e.getIn([...t],!1);if(i===void 0||i===null)return;return bt(i)||Ot(i)?i.toJS(e):i}function Dr(e,t){return new ee({code:"manifest_edit_unreadable",message:`Cannot read the manifest at ${e} to change it.`,hint:"Check the path and file permissions. Nothing was written.",cause:t})}function Ur(e,t){let i=e.providers;if(i===void 0||!e.path.join(".").startsWith("tools.provider"))return;for(let o of on(t.tools).selections){let a=i[o.id];if(a===void 0)throw B(e.path.join("."),`no tool provider called "${o.id}" is available here. Available: ${Object.keys(i).join(", ")||"(none)"}.`);let d;try{d=a({dir:Hi(e.file),env:{},config:o.config,agentId:t.id})}catch(l){if(R(l))throw l;throw B(e.path.join("."),`the ${o.id} provider refused its config: ${l instanceof Error?l.message:String(l)}`)}d.stop?.()}}function Pr(e,t){if(e.mediaProviders===void 0||e.path[0]!=="media")return;for(let i of["transcription","image","speech"]){let o=t.media?.[i];if(o===void 0)continue;try{zi({...t,media:{[i]:o}},{env:{},providers:new Map(Object.entries(e.mediaProviders))})}catch(a){if(R(a)&&a.code==="media_key_missing")continue;throw a}}}function B(e,t){return new ee({code:"manifest_edit_invalid",message:`Setting ${e} would make the manifest invalid: ${t}`,hint:"Nothing was written. Check the value's shape — a list is [a, b], a map is {k: v} — against the field this path names."})}var rA=[{path:"tools.local",means:"built-in tools: now, memory_write, memory_forget, artifact_read",agentListed:!0},{path:"tools.providers",means:"where tools come from, as a map — {system: {}} for shell and files, {web: {backend: tavily, apiKeyEnv: TAVILY_API_KEY}} for the internet. Several at once",toAgent:"A writeRoots key inside is refused",agentListed:!0},{path:"tools.pinned",means:"the tools from those providers this agent may call",agentListed:!0},{path:"tools.policy.allow",means:'rules permitting a call: "exec", or narrower like "exec(git *)". Also what lets a mutating tool run in a turn that has read untrusted content',agentListed:!0},{path:"tools.policy.deny",means:"rules refusing a call. Beats any allow rule",toAgent:"Replacing these is refused: it is the one edit whose only purpose is to remove a restriction someone set",agentListed:!0,confirm:"Deny rules are the restrictions that beat every allow rule. Replacing them removes whatever was deliberately put out of reach."},{path:"tools.policy.mode",means:"allow | ask | deny — for calls no rule mentions",agentListed:!0},{path:"tools.untrusted.onMutate",means:"refuse | confirm | allow — what happens when a tool that changes something is asked for in a turn that has read outside content",toAgent:'Cannot be set to "allow"',agentListed:!0,confirm:'Setting this to "allow" turns off the check that stops text from outside the conversation driving a tool that changes things. A fetched page that says "now delete the backups" would be acted on.'},{path:"tools.dialect",means:"nlt | native — how tool calls are written",agentListed:!0},{path:"model.main.id",means:"the model this agent runs on",agentListed:!0},{path:"model.main.temperature",means:"0 to 2",agentListed:!0},{path:"model.main.maxTokens",means:"the most one reply may generate; unset lets the endpoint decide",agentListed:!1},{path:"tools.budget.max",means:"how many tools the model is shown at once, built-ins included",agentListed:!1},{path:"model.main.reasoningEffort",means:"none | minimal | low | medium | high | xhigh | max — how hard a reasoning model thinks",agentListed:!1},{path:"model.main",means:"the main model as a whole role, {api, id, baseUrl or options, apiKeyEnv, capabilities, ...}; replaces it in one write",agentListed:!1},{path:"model.<role>",means:"a named model role, {id, api or baseUrl, apiKeyEnv, ...}; a schedule or message runs on it with role: <name>",agentListed:!1},{path:"limits.maxSteps",means:"tool calls allowed in one turn",agentListed:!0},{path:"limits.toolTimeoutMs",means:"how long any single tool may take",agentListed:!0},...["static","volatile","reminder","total"].map((e)=>({path:`context.budgets.${e}`,means:`token budget for the ${e==="total"?"whole workspace":`${e} tier`}; a file over it stops the agent loading`,agentListed:!1})),{path:"limits.noProgress",means:"when a turn is stopped for going nowhere, as a map: {identicalCalls: <n, default 3>, sameTool: <n, off when absent>}",agentListed:!1},{path:"limits.noProgress.sameTool",means:"stop a turn after this many calls in a row to one tool, whatever the arguments. Absent, off",agentListed:!1},{path:"context.modelIdentity",means:"shown or hidden: whether the agent can see which model it runs on (hidden keeps tuning settable)",agentListed:!1},{path:"context.window",means:"the token budget for a whole request; unset uses the model's known window",agentListed:!1},{path:"context.observationMaxTokens",means:"how much of a tool's output reaches the model",agentListed:!0},{path:"tools.eventDetail",means:"none | redacted — whether tool events carry the call's arguments and output",agentListed:!1},{path:"context.rules.onExceed",means:"fail | warn — whether too many counted rules in the workspace refuses the load",agentListed:!1},{path:"channels",means:"how people reach this agent, as a list — [{type: telegram, id: tg, tokenEnv: TELEGRAM_BOT_TOKEN, mode: longpoll}]. The token goes in the .env",toAgent:"The token itself goes in the .env, which only a person can write. allowFrom is refused here: who may talk to you is not yours to decide",agentListed:!0},{path:"delivery",means:"where a reply goes when a turn has no origin — {default: tg}. Names a channel id, not a channel type",agentListed:!0},{path:"delivery.reply",means:"channel replies: all (every step's text, default) or final (the last step's only)",agentListed:!0},{path:"schedules",means:'what runs unattended, as a list — [{id, kind: cron|every|at, expr, task, deliver}]. expr is a 5- or 6-field cron, a duration like 15m, or an ISO instant; deliver is {channel, to} or the literal "none"',toAgent:"Only `serve` fires these; under `run` they are validated and listed and no timer starts. deliver.to is the address a reply is *sent* to — on Telegram the numeric chat id, never an @handle, which addresses a channel and not a person. It is the id inbound messages arrive on, so read it off your own session keys (tg:<id>); allowFrom holds handles and confers nothing here. Set role to name a model other than main. The whole list is replaced, so read it first",agentListed:!0},{path:"media",means:"voice notes, spoken replies and images: {transcription, speech, image}, each {provider: openai|aws, model, apiKeyEnv, options}",toAgent:"image adds image_generate after a restart; filling in the key variable is the person's",agentListed:!0},{path:"server.enabled",means:"true | false — serve the HTTP API on 127.0.0.1",toAgent:"host and tokenEnv are refused: binding anywhere reachable is not yours to decide",agentListed:!0},{path:"server.port",means:"port for the HTTP API",agentListed:!0},{path:"channels[].allowFrom",means:"who may talk to this agent through a channel. Empty or absent refuses everyone — a bot that is connected, healthy and answering nobody is almost always this",agentListed:!1,via:"config allow"},{path:"server.host",means:"the address the HTTP API binds. 127.0.0.1 is local only; anything else is reachable from the network",agentListed:!1},{path:"server.tokenEnv",means:"the env var holding the bearer token the API requires. Without it the API is unauthenticated",agentListed:!1},{path:"delegation.offer",means:`what this agent takes on when another member's agent asks it, as a map: {task: "<one line>", artifact: {type: object, properties: {...}, required: [...]}}. The agents whose delegation.to names this one are reloaded so their roster shows it`,agentListed:!1},{path:"delegation.to",means:`the other members' agents this one may ask, by id, or "*" for every agent that offers. A peer ask is one hop: the asked agent answers, and cannot ask onward`,agentListed:!1},{path:"subagents",means:"children that run routed tool calls in their own context, as a list of {name, task, tools, route: {tools}, model?, maxSteps?, timeoutMs?}. Each tool must be pinned, and each routed slug belongs to one child",agentListed:!1},{path:"skills.trusted",means:"the skills whose scripts may run, by name. A skill not listed is still used for its steps, and its scripts are documentation only. Absent, every skill's scripts run",agentListed:!1},{path:"tools.providers.<id>.writeRoots",means:"the directories a file tool may write to, for that provider. Nothing outside them is writable — and this binds file tools only, never exec, which carries its target inside a shell string",agentListed:!1}];function ao(e){return rA.find((t)=>t.path===e)}var Fr=/^model\.([A-Za-z][\w-]*)$/;function go(e){let t=ao(e);if(t!==void 0)return kA.includes(t.path)?t:void 0;let i=Fr.exec(e)?.[1];return i===void 0||i==="main"?void 0:ao("model.<role>")}var Wr=rA.filter((e)=>e.agentListed).map((e)=>e.path),kA=rA.filter((e)=>e.via===void 0&&!e.path.includes("<")&&!e.path.includes("[")).map((e)=>e.path);var mn={kind:"public"};function pn(e){let t=e.split(".");if(t.length!==4)return;let i=[];for(let o of t){if(o.length===0||o.length>3||!/^[0-9]+$/.test(o))return;if(o.length>1&&o.startsWith("0"))return;let a=Number(o);if(a>255)return;i.push(a)}return i}function Br(e){let t=e.split("%")[0]??"";if(t==="")return;if(!/^[0-9a-fA-F:.]+$/.test(t))return;let i=t.split("::");if(i.length>2)return;let o=(c)=>{if(c==="")return[];let u=c.split(":"),f=[];for(let g=0;g<u.length;g+=1){let m=u[g]??"";if(m.includes(".")){if(g!==u.length-1)return;let y=pn(m);if(y===void 0)return;f.push(...y);continue}if(m.length===0||m.length>4)return;let p=Number.parseInt(m,16);if(Number.isNaN(p))return;f.push(p>>8&255,p&255)}return f};if(i.length===1){let c=o(t);return c!==void 0&&c.length===16?c:void 0}let a=o(i[0]??""),d=o(i[1]??"");if(a===void 0||d===void 0)return;let l=16-a.length-d.length;if(l<0)return;return[...a,...Array(l).fill(0),...d]}function Ie(e){let[t=0,i=0,o=0,a=0]=e;if(t===0)return{kind:"unspecified",range:"0.0.0.0/8"};if(t===127)return{kind:"loopback",range:"127.0.0.0/8"};if(t===10)return{kind:"private",range:"10.0.0.0/8"};if(t===172&&i>=16&&i<=31)return{kind:"private",range:"172.16.0.0/12"};if(t===192&&i===168)return{kind:"private",range:"192.168.0.0/16"};if(t===100&&i>=64&&i<=127)return{kind:"cgnat",range:"100.64.0.0/10"};if(t===169&&i===254)return{kind:"link-local",range:"169.254.0.0/16"};if(t===192&&i===0&&o===0)return{kind:"reserved",range:"192.0.0.0/24"};if(t===192&&i===0&&o===2)return{kind:"reserved",range:"192.0.2.0/24 (TEST-NET-1)"};if(t===198&&(i===18||i===19))return{kind:"reserved",range:"198.18.0.0/15"};if(t===198&&i===51&&o===100)return{kind:"reserved",range:"198.51.100.0/24 (TEST-NET-2)"};if(t===203&&i===0&&o===113)return{kind:"reserved",range:"203.0.113.0/24 (TEST-NET-3)"};if(t>=224&&t<=239)return{kind:"multicast",range:"224.0.0.0/4"};if(t===255&&i===255&&o===255&&a===255)return{kind:"reserved",range:"255.255.255.255"};if(t>=240)return{kind:"reserved",range:"240.0.0.0/4"};return mn}function Hr(e){if(e.length!==16)return{kind:"reserved",range:"unparseable"};if(e.slice(0,10).every((d)=>d===0)&&e[10]===255&&e[11]===255)return Ie(e.slice(12));if(e[0]===0&&e[1]===100&&e[2]===255&&e[3]===155&&e.slice(4,12).every((d)=>d===0))return Ie(e.slice(12));if(e.every((d)=>d===0))return{kind:"unspecified",range:"::"};if(e.slice(0,15).every((d)=>d===0)&&e[15]===1)return{kind:"loopback",range:"::1"};let o=e[0]??0,a=e[1]??0;if((o&254)===252)return{kind:"private",range:"fc00::/7"};if(o===254&&(a&192)===128)return{kind:"link-local",range:"fe80::/10"};if(o===255)return{kind:"multicast",range:"ff00::/8"};if(o===32&&a===1&&e[2]===13&&e[3]===184)return{kind:"reserved",range:"2001:db8::/32"};return mn}function hr(e){let t=e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e,i=pn(t);if(i!==void 0)return Ie(i);let o=Br(t);if(o!==void 0)return Hr(o);return}var zr=["agent","model","day","sender"];var Ld=["Summarise the conversation above for your own future reference. You are writing notes to yourself, not a report for a person.","","The person's own requests are preserved verbatim below your summary, so do not restate them.","Keep: decisions taken and why, facts established by tool results, and anything still outstanding.","Drop: pleasantries, your own reasoning, and anything already superseded.","Write plain prose under 300 words. No headings, no preamble, no closing summary.","End with one line naming what this summary does not cover, so a later step knows to ask rather than assume."].join(`
|
|
66
|
-
`);var Re=1,oe=["MEMORY.md","memory/","knowledge/"],yn=/^[^/\\.][^/\\]*\.md$/;function D(e,t,i,o){return new ee({code:e,message:t,hint:i,...o===void 0?{}:{field:o}})}function wn(e){let t=Ps(e.workspace),i=(o)=>Xr(o)?o:Gr(e.dir,o);return{...t?.path===void 0||t.mode==="refused"?{}:{carried:{path:t.path,name:t.name,...t.budget===void 0?{}:{budget:t.budget},...t.eviction===void 0?{}:{eviction:t.eviction}}},...e.manifest.memory===void 0?{}:{memoryDir:i(e.manifest.memory.dir)},...e.manifest.knowledge===void 0?{}:{knowledgeDir:i(e.manifest.knowledge.dir)}}}function Ce(e){if(e===void 0)return[];try{return Kr(e).filter((t)=>yn.test(t)&&!Ht(t)&&!Kt(t)).sort()}catch{return[]}}function Ds(e){if(e===void 0||e.length===0)return oe;return e.map((t,i)=>{let o=oe.find((a)=>a===t);if(o===void 0)throw D("bundle_path_not_allowed",`"${t}" is not something a bundle can carry.`,`A bundle carries ${oe.join(", ")} and nothing else — never the manifest, secrets or skills.`,`paths.${i}`);return o})}function bs(e,t=oe,i=new Date){let o=wn(e),a=[];if(t.includes("MEMORY.md")&&o.carried!==void 0&&gn(o.carried.path))a.push({path:"MEMORY.md",content:Y(o.carried.path,"utf8")});for(let[d,l]of[["memory/",o.memoryDir],["knowledge/",o.knowledgeDir]]){if(!t.includes(d)||l===void 0)continue;for(let c of Ce(l))a.push({path:`${d}${c}`,content:Y(he(l,c),"utf8")})}return{version:Re,agentId:e.id,exportedAt:i.toISOString(),files:a}}function Qr(e,t,i){let o=`files.${t}.path`;if(e.path==="MEMORY.md"){if(i.carried===void 0)throw D("bundle_memory_not_writable","This agent has no writable memory file to merge MEMORY.md into.","Give a volatile workspace file `editable: append` or `replace`, or export without MEMORY.md.",o);return{abs:i.carried.path,kind:"carried"}}let a=e.path.indexOf("/"),d=e.path.slice(0,a+1),l=e.path.slice(a+1);if(!(d==="memory/"||d==="knowledge/")||!yn.test(l)||Ht(l)||Kt(l))throw D("bundle_path_not_allowed",`"${e.path}" is not a path a bundle can carry.`,"A bundle carries MEMORY.md, memory/<name>.md and knowledge/<name>.md — one level, markdown only, never the manifest, secrets or skills.",o);let u=d==="memory/"?i.memoryDir:i.knowledgeDir;if(u===void 0)throw D(d==="memory/"?"bundle_no_memory":"bundle_no_knowledge",`This agent has no ${d==="memory/"?"memory":"knowledge"} block, so "${e.path}" has nowhere to go.`,`Add a \`${d==="memory/"?"memory":"knowledge"}:\` block to the manifest, or export without ${d}.`,o);return{abs:he(u,l),kind:d==="memory/"?"memory":"knowledge"}}function eo(e,t){let i=new Set($e(e.split(/\r?\n/)).map((o)=>o.text));return $e(t.split(/\r?\n/)).map((o)=>o.text).filter((o)=>!i.has(o))}async function Os(e){let t=e.now??new Date,i=e.mode??"skip",o=lo(e.bundle),a=wn(e.agent),d=o.map((w,v)=>({file:w,...Qr(w,v,a)})),l=new Map,c=(w)=>{if(!l.has(w))l.set(w,gn(w)?Y(w,"utf8"):void 0)};for(let w of d)c(w.abs);for(let w of Ce(a.memoryDir))c(he(a.memoryDir??"",w));if(a.carried!==void 0)c(a.carried.path);let u=[],f=[],g=[],m=[],p=0,y=!1;try{for(let{file:T,abs:A,kind:I}of d){let J=l.get(A);if(I==="knowledge"){if(J===T.content||J!==void 0&&i==="skip"){g.push(T.path);continue}ie(A,T.content,"utf8"),(J===void 0?u:m).push(T.path),y=!0;continue}if(J===void 0){ie(A,T.content,"utf8"),u.push(T.path),y||=I==="carried";continue}let fe=eo(Y(A,"utf8"),T.content);if(fe.length===0){g.push(T.path);continue}ie(A,`${Y(A,"utf8").trimEnd()}
|
|
67
|
-
|
|
68
|
-
${fe.join(`
|
|
69
|
-
`)}
|
|
70
|
-
`,"utf8"),f.push({path:T.path,notes:fe.length}),y||=I==="carried"}let w=a.carried;if(y&&w?.eviction==="oldest"&&w.budget!==void 0&&a.memoryDir!==void 0)p=(await rn({path:w.path,name:w.name,budget:w.budget,archiveDir:a.memoryDir,now:t})).evicted;let v=y?await e.reload():"none";return{added:u,merged:f,skipped:g,overwritten:m,evicted:p,reload:v}}catch(w){if(to(l,a.memoryDir),!R(w))throw w;throw new ee({code:"bundle_import_refused",message:`Nothing was imported: the agent would not load with this bundle. ${w.message}`,hint:w.hint,...w.field===void 0?{}:{field:w.field}})}}function to(e,t){for(let[i,o]of e)if(o===void 0)Ut(i,{force:!0});else ie(i,o,"utf8");for(let i of Ce(t)){let o=he(t??"",i);if(!e.has(o))Ut(o,{force:!0})}}function lo(e){let t=typeof e==="object"&&e!==null?e:{};if(t.version!==Re)throw D("bundle_version_unsupported",`This bundle is version ${JSON.stringify(t.version)}; this build reads version ${Re}.`,"Export the bundle again with GET /v1/agents/:id/export on a build that matches.","version");if(!Array.isArray(t.files))throw D("bundle_files_invalid","A bundle needs a `files` list.",'Send the body GET /v1/agents/:id/export returned: { "version": 1, "files": [{ "path", "content" }] }.',"files");let i=new Set;return t.files.map((o,a)=>{let d=typeof o==="object"&&o!==null?o:{};if(typeof d.path!=="string"||typeof d.content!=="string")throw D("bundle_files_invalid",`files.${a} needs a string \`path\` and a string \`content\`.`,"Each entry is { path, content }, as an export writes it.",`files.${a}`);if(i.has(d.path))throw D("bundle_files_invalid",`"${d.path}" appears twice.`,"A bundle names each path once.",`files.${a}.path`);return i.add(d.path),{path:d.path,content:d.content}})}var Pt="agent:";function Zr(e){return e.startsWith(Pt)?e.slice(Pt.length):void 0}var Cd=(()=>{let e=Symbol.for(`${re.slug}.liveRuntimes`),t=globalThis;return t[e]??=new Set,t[e]})();var co="id, session_key, turn_id, role, content, tool_calls, tool_call_id, origin, tainted, created_at",Ud=co.split(", ").map((e)=>`m.${e}`).join(", ");function Ns(){let e=new Uint8Array(24);return crypto.getRandomValues(e),`whsec_${Buffer.from(e).toString("base64")}`}function Ms(e){return e!=="model.chunk"}var uo="schedule";function Ts(e,t,i){if(e.startsWith("shared:")){let o=e.slice(7);if(o!=="")return o}return Yr({channel:uo,peerId:t,thread:i})}function Rs(e){let t=nn.safeParse(e.body);if(!t.success){let u=t.error.issues[0];throw new h({code:"schedule_invalid",message:`Schedule rejected: ${u?.path.join(".")??"body"} ${u?.message??"is invalid"}.`,hint:"A schedule needs id, kind (cron|every|at), expr, task and deliver. See docs/02-SPEC-MANIFEST.md.",...u?.path.length===void 0||u.path.length===0?{}:{field:u.path.join(".")}})}let i=t.data;if(i.deliver!=="none"){if(!e.channelIds.includes(i.deliver.channel))throw new h({code:"schedule_delivery_channel_unknown",message:`Schedule "${i.id}" delivers to "${i.deliver.channel}", which is not a channel id on this agent.${e.channelIds.length===0?" The agent declares no channels.":` Declared: ${e.channelIds.join(", ")}.`}`,hint:`A delivery target names a channel's id, not its type. Use deliver: "none" to return results through the event stream instead.`,field:"deliver.channel"})}if(i.role!==void 0&&!e.roleNames.includes(i.role))throw new h({code:"schedule_role_unknown",message:`Schedule "${i.id}" names the model role "${i.role}", which is not declared under model:. Declared: ${e.roleNames.join(", ")}.`,hint:"Add the role under model: in the manifest, or point the schedule at one of the declared roles. Omit role entirely to use main.",field:"role"});let o=i.tools?.allow;if(o!==void 0&&e.toolSpecs!==void 0){let u=As(o,e.toolSpecs);if(u.length>0)throw Ve(i.id,u,e.toolSpecs.map((f)=>f.slug),"tools.allow")}let a=ln({id:i.id,kind:i.kind,expr:i.expr,timezone:i.timezone,now:e.now,field:"expr"}),d=new Date(e.now).toISOString(),l=_r(a,i.id,e.now,e.now),c=i.deliver==="none"?void 0:i.deliver;return{agentId:e.agentId,id:i.id,kind:i.kind,expr:i.expr,...i.timezone===void 0?{}:{timezone:i.timezone},task:i.task,...c===void 0?{}:{deliverChannel:c.channel,deliverTo:c.to},sessionMode:i.session,...i.role===void 0?{}:{role:i.role},toolsAllow:i.tools?.allow,timeoutMs:i.timeoutMs,maxSteps:i.maxSteps,enabled:i.enabled,origin:e.origin,anchorAt:l.anchor===void 0?d:new Date(l.anchor).toISOString(),nextRunAt:l.runAt===void 0?void 0:new Date(l.runAt).toISOString(),sourcePath:"",now:d}}function _s(e){return{...e.role===void 0?{}:{role:e.role},...e.toolsAllow===void 0?{}:{toolsAllow:e.toolsAllow},...e.maxSteps===void 0?{}:{maxSteps:e.maxSteps},...e.timeoutMs===void 0?{}:{timeoutMs:e.timeoutMs}}}var Pd=new Set("a an and are as at be but by do does for from had has have he her his i if in is it its me my not of on or our she that the their them then there they this to was we were what when which who will with you your would could should im ive dont its ill".split(" "));
|
|
71
|
-
export{re,Yt,R,ee,h,rt,S,cr,Ge,lr,Ir,jt,Jt,ur,dr,no,Er,Cr,fr,pr,ds,Yr,oo,Es,ro,Cs,fs,ps,jr,hs,oA,Jr,io,Bs,qr,ys,Qs,qt,ms,Vr,so,Ss,ws,rA,ao,go,Wr,kA,hr,zr,Ds,bs,Os,Zr,Ns,Ms,Ts,Rs,_s};
|
|
72
|
-
|
|
73
|
-
//# debugId=9E60D063EE86CF9964756E2164756E21
|
|
74
|
-
//# sourceMappingURL=index-s57ztjhq.js.map
|