agentix-cli 0.204.0 → 0.206.0
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/dist/{App-FQRHQT5J.js → App-JDW5V4HT.js} +2 -2
- package/dist/{ChatApp-WBCGSGJM.js → ChatApp-SNM2PORO.js} +2 -2
- package/dist/{absorb-eval-3IU37HZQ.js → absorb-eval-WDAV4AI2.js} +2 -2
- package/dist/{adapter-URFSOOFE.js → adapter-C47BTKT6.js} +2 -2
- package/dist/{agent-P7XUCP3A.js → agent-EVMKJXJO.js} +2 -2
- package/dist/{board-dashboard-AVUFPO5X.js → board-dashboard-EUWXJNDW.js} +403 -416
- package/dist/board-dashboard-EUWXJNDW.js.map +1 -0
- package/dist/{chunk-WKR2OSCH.js → chunk-245IOYDJ.js} +2 -2
- package/dist/{chunk-FOWRNDMJ.js → chunk-2LJZHKTY.js} +2 -2
- package/dist/{chunk-P65XGEB7.js → chunk-2P3SHT5I.js} +2 -2
- package/dist/{chunk-JUSQMQ7L.js → chunk-2VSK6FAR.js} +2 -2
- package/dist/chunk-2YDG5CSS.js +2 -0
- package/dist/chunk-2YDG5CSS.js.map +1 -0
- package/dist/{chunk-EANSYWBQ.js → chunk-3B5HSNOF.js} +334 -326
- package/dist/chunk-3B5HSNOF.js.map +1 -0
- package/dist/{chunk-T7WY5BSJ.js → chunk-5STGF4MI.js} +40 -40
- package/dist/chunk-5STGF4MI.js.map +1 -0
- package/dist/chunk-BED4R5CS.js +12 -0
- package/dist/chunk-BED4R5CS.js.map +1 -0
- package/dist/{chunk-JKT5EFXT.js → chunk-CXFVIDJV.js} +2 -2
- package/dist/{chunk-ZPCSPEGO.js → chunk-CZVCT5ZV.js} +2 -2
- package/dist/{chunk-Y2D6FQBL.js → chunk-DOO4MUTS.js} +2 -2
- package/dist/{chunk-RIBANO2H.js → chunk-DUCYRNCT.js} +3 -3
- package/dist/chunk-DUCYRNCT.js.map +1 -0
- package/dist/{chunk-HX4R7RPR.js → chunk-DV42WUMD.js} +2 -2
- package/dist/{chunk-CAYY2IEV.js → chunk-EFGAPAYZ.js} +2 -2
- package/dist/chunk-EJFPXG6I.js +969 -0
- package/dist/chunk-EJFPXG6I.js.map +1 -0
- package/dist/{chunk-MAQFWGFT.js → chunk-ERVJLPS4.js} +2 -2
- package/dist/{chunk-IAR5F3T5.js → chunk-IDGEDPRJ.js} +2 -2
- package/dist/chunk-IFNXMUEG.js +115 -0
- package/dist/chunk-IFNXMUEG.js.map +1 -0
- package/dist/{chunk-SLX3OHEW.js → chunk-IU63JGY3.js} +2 -2
- package/dist/{chunk-7QW4RECS.js → chunk-JSCVOB4G.js} +2 -2
- package/dist/{chunk-RUNCUVAH.js → chunk-JT5PIBCM.js} +2 -2
- package/dist/{chunk-EQPMQSJE.js → chunk-KRHVM26D.js} +2 -2
- package/dist/{chunk-5VD2J4JN.js → chunk-MF46BC7J.js} +2 -2
- package/dist/{chunk-VGYW3Q7F.js → chunk-OLKYIKAZ.js} +2 -2
- package/dist/{chunk-RB7M2NPU.js → chunk-PQUK6XEW.js} +2 -2
- package/dist/{chunk-PSOE356C.js → chunk-PQX2VJUA.js} +2 -2
- package/dist/{chunk-TV5BDCQA.js → chunk-PTZNM2JU.js} +2 -2
- package/dist/{chunk-M4VYHPDS.js → chunk-PW3WG6JT.js} +2 -2
- package/dist/{chunk-EMWSFITR.js → chunk-QASIUKZJ.js} +2 -2
- package/dist/{chunk-N6NZBAWR.js → chunk-RXX4MYFL.js} +2 -2
- package/dist/{chunk-C2VZHIIX.js → chunk-S5A7QZVQ.js} +2 -2
- package/dist/{chunk-CJI26AJC.js → chunk-SKCOIP5R.js} +3 -3
- package/dist/{chunk-BIYEGA7Q.js → chunk-TH2W2545.js} +2 -2
- package/dist/{chunk-V3FSKTDF.js → chunk-UGRMFQAG.js} +2 -2
- package/dist/{chunk-Y4YOYOCG.js → chunk-USFOOYPM.js} +2 -2
- package/dist/{chunk-WIGH5WMP.js → chunk-V5LRR5I5.js} +9 -9
- package/dist/{chunk-QOEO27LF.js → chunk-WJMYBRM5.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-EOQLSAUW.js → client-WN7YI7DE.js} +2 -2
- package/dist/{config-SZZQFIJF.js → config-QUXKGIZX.js} +2 -2
- package/dist/{config-mutate-66VDWR46.js → config-mutate-HJH24ITC.js} +2 -2
- package/dist/{config-mutator-OILDQCAJ.js → config-mutator-OLLQR3ZD.js} +2 -2
- package/dist/{connect-AJKMRKXC.js → connect-OOPPXAOD.js} +2 -2
- package/dist/{contributions-LRQCDZCQ.js → contributions-LL7B4BP3.js} +2 -2
- package/dist/daemon-api-QCBFGT7S.js +2 -0
- package/dist/daemon-api-QCBFGT7S.js.map +1 -0
- package/dist/{doctor-EDZO7BUJ.js → doctor-X75KLAFA.js} +2 -2
- package/dist/{enrich-NIUEEGPA.js → enrich-MZMIQ3SV.js} +2 -2
- package/dist/{event-levels-D6QSANGF.js → event-levels-PCFARGKL.js} +2 -2
- package/dist/{follow-up-tool-QOO2TIQS.js → follow-up-tool-I2HTKMP4.js} +2 -2
- package/dist/{grants-3UVDASRI.js → grants-2MNWGCSH.js} +2 -2
- package/dist/{hub-6TKU6CHO.js → hub-7ASBN76I.js} +2 -2
- package/dist/index.d.ts +52 -40
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/org-tool-JCGGJJU6.js +2 -0
- package/dist/org-tool-JCGGJJU6.js.map +1 -0
- package/dist/{program-OFN6YQRH.js → program-NCFW4EEP.js} +238 -238
- package/dist/program-NCFW4EEP.js.map +1 -0
- package/dist/{promote-D3KYLUBD.js → promote-NSPUPPHB.js} +2 -2
- package/dist/providers-D6IUAHQJ.js +2 -0
- package/dist/{query-D2TQ2PUO.js → query-VW63IHDI.js} +2 -2
- package/dist/{query-settings-ILDX3HDF.js → query-settings-RS7DJI4H.js} +2 -2
- package/dist/{registry-N3BY3HSI.js → registry-6KREAROB.js} +2 -2
- package/dist/{request-planner-CVCG5XQR.js → request-planner-HZWQIRZO.js} +2 -2
- package/dist/resolve-LOYZUE2D.js +2 -0
- package/dist/{review-candidates-CKUN4PSY.js → review-candidates-2TXOUASP.js} +2 -2
- package/dist/{routing-OCIRGUKK.js → routing-ZV4VSZDV.js} +2 -2
- package/dist/{rules-A5ES57QT.js → rules-FBOLGE2S.js} +2 -2
- package/dist/schedule-tool-D357NLXS.js +2 -0
- package/dist/{scheduler-D2Z7RSEE.js → scheduler-SAID6RKQ.js} +2 -2
- package/dist/{seat-Z3E2FLDA.js → seat-XHBWBSTS.js} +2 -2
- package/dist/{select-J4ES7Q67.js → select-QUCTTAH3.js} +2 -2
- package/dist/{set-enabled-S22TICYC.js → set-enabled-CGMXLFC6.js} +2 -2
- package/dist/{sprint-tool-NDF47EKV.js → sprint-tool-SWRYSX3Q.js} +2 -2
- package/dist/status-PVYFTNX2.js +2 -0
- package/dist/{tool-6NZIUXI7.js → tool-6G63ZQW4.js} +2 -2
- package/dist/{tool-RCCMOMEY.js → tool-DA25L4ND.js} +2 -2
- package/dist/{tool-52JRXZVA.js → tool-ELGOVIM5.js} +2 -2
- package/dist/{tool-Z2OVFGWW.js → tool-MMH2JNP7.js} +2 -2
- package/dist/{wiki-HQKFZZSX.js → wiki-4ZL4QXA7.js} +2 -2
- package/dist/wiki-enrich-N5MUKDVW.js +2 -0
- package/dist/workspace-setup-QXFJRNSK.js +2 -0
- package/package.json +1 -1
- package/dist/board-dashboard-AVUFPO5X.js.map +0 -1
- package/dist/chunk-B6VASQHD.js +0 -2
- package/dist/chunk-B6VASQHD.js.map +0 -1
- package/dist/chunk-EANSYWBQ.js.map +0 -1
- package/dist/chunk-FCDMB2JA.js +0 -936
- package/dist/chunk-FCDMB2JA.js.map +0 -1
- package/dist/chunk-GDHSJH3T.js +0 -111
- package/dist/chunk-GDHSJH3T.js.map +0 -1
- package/dist/chunk-RIBANO2H.js.map +0 -1
- package/dist/chunk-T7WY5BSJ.js.map +0 -1
- package/dist/chunk-XPZSEDE3.js +0 -12
- package/dist/chunk-XPZSEDE3.js.map +0 -1
- package/dist/daemon-api-OVCXY4QC.js +0 -2
- package/dist/daemon-api-OVCXY4QC.js.map +0 -1
- package/dist/program-OFN6YQRH.js.map +0 -1
- package/dist/providers-AHLCB6R5.js +0 -2
- package/dist/resolve-JKXYBZ6R.js +0 -2
- package/dist/schedule-tool-YFMRYTEO.js +0 -2
- package/dist/status-PKHYFGZK.js +0 -2
- package/dist/wiki-enrich-7SZ5W2LF.js +0 -2
- package/dist/workspace-setup-W5UO2WZI.js +0 -2
- /package/dist/{App-FQRHQT5J.js.map → App-JDW5V4HT.js.map} +0 -0
- /package/dist/{ChatApp-WBCGSGJM.js.map → ChatApp-SNM2PORO.js.map} +0 -0
- /package/dist/{absorb-eval-3IU37HZQ.js.map → absorb-eval-WDAV4AI2.js.map} +0 -0
- /package/dist/{adapter-URFSOOFE.js.map → adapter-C47BTKT6.js.map} +0 -0
- /package/dist/{agent-P7XUCP3A.js.map → agent-EVMKJXJO.js.map} +0 -0
- /package/dist/{chunk-WKR2OSCH.js.map → chunk-245IOYDJ.js.map} +0 -0
- /package/dist/{chunk-FOWRNDMJ.js.map → chunk-2LJZHKTY.js.map} +0 -0
- /package/dist/{chunk-P65XGEB7.js.map → chunk-2P3SHT5I.js.map} +0 -0
- /package/dist/{chunk-JUSQMQ7L.js.map → chunk-2VSK6FAR.js.map} +0 -0
- /package/dist/{chunk-JKT5EFXT.js.map → chunk-CXFVIDJV.js.map} +0 -0
- /package/dist/{chunk-ZPCSPEGO.js.map → chunk-CZVCT5ZV.js.map} +0 -0
- /package/dist/{chunk-Y2D6FQBL.js.map → chunk-DOO4MUTS.js.map} +0 -0
- /package/dist/{chunk-HX4R7RPR.js.map → chunk-DV42WUMD.js.map} +0 -0
- /package/dist/{chunk-CAYY2IEV.js.map → chunk-EFGAPAYZ.js.map} +0 -0
- /package/dist/{chunk-MAQFWGFT.js.map → chunk-ERVJLPS4.js.map} +0 -0
- /package/dist/{chunk-IAR5F3T5.js.map → chunk-IDGEDPRJ.js.map} +0 -0
- /package/dist/{chunk-SLX3OHEW.js.map → chunk-IU63JGY3.js.map} +0 -0
- /package/dist/{chunk-7QW4RECS.js.map → chunk-JSCVOB4G.js.map} +0 -0
- /package/dist/{chunk-RUNCUVAH.js.map → chunk-JT5PIBCM.js.map} +0 -0
- /package/dist/{chunk-EQPMQSJE.js.map → chunk-KRHVM26D.js.map} +0 -0
- /package/dist/{chunk-5VD2J4JN.js.map → chunk-MF46BC7J.js.map} +0 -0
- /package/dist/{chunk-VGYW3Q7F.js.map → chunk-OLKYIKAZ.js.map} +0 -0
- /package/dist/{chunk-RB7M2NPU.js.map → chunk-PQUK6XEW.js.map} +0 -0
- /package/dist/{chunk-PSOE356C.js.map → chunk-PQX2VJUA.js.map} +0 -0
- /package/dist/{chunk-TV5BDCQA.js.map → chunk-PTZNM2JU.js.map} +0 -0
- /package/dist/{chunk-M4VYHPDS.js.map → chunk-PW3WG6JT.js.map} +0 -0
- /package/dist/{chunk-EMWSFITR.js.map → chunk-QASIUKZJ.js.map} +0 -0
- /package/dist/{chunk-N6NZBAWR.js.map → chunk-RXX4MYFL.js.map} +0 -0
- /package/dist/{chunk-C2VZHIIX.js.map → chunk-S5A7QZVQ.js.map} +0 -0
- /package/dist/{chunk-CJI26AJC.js.map → chunk-SKCOIP5R.js.map} +0 -0
- /package/dist/{chunk-BIYEGA7Q.js.map → chunk-TH2W2545.js.map} +0 -0
- /package/dist/{chunk-V3FSKTDF.js.map → chunk-UGRMFQAG.js.map} +0 -0
- /package/dist/{chunk-Y4YOYOCG.js.map → chunk-USFOOYPM.js.map} +0 -0
- /package/dist/{chunk-WIGH5WMP.js.map → chunk-V5LRR5I5.js.map} +0 -0
- /package/dist/{chunk-QOEO27LF.js.map → chunk-WJMYBRM5.js.map} +0 -0
- /package/dist/{client-EOQLSAUW.js.map → client-WN7YI7DE.js.map} +0 -0
- /package/dist/{config-SZZQFIJF.js.map → config-QUXKGIZX.js.map} +0 -0
- /package/dist/{config-mutate-66VDWR46.js.map → config-mutate-HJH24ITC.js.map} +0 -0
- /package/dist/{config-mutator-OILDQCAJ.js.map → config-mutator-OLLQR3ZD.js.map} +0 -0
- /package/dist/{connect-AJKMRKXC.js.map → connect-OOPPXAOD.js.map} +0 -0
- /package/dist/{contributions-LRQCDZCQ.js.map → contributions-LL7B4BP3.js.map} +0 -0
- /package/dist/{doctor-EDZO7BUJ.js.map → doctor-X75KLAFA.js.map} +0 -0
- /package/dist/{enrich-NIUEEGPA.js.map → enrich-MZMIQ3SV.js.map} +0 -0
- /package/dist/{event-levels-D6QSANGF.js.map → event-levels-PCFARGKL.js.map} +0 -0
- /package/dist/{follow-up-tool-QOO2TIQS.js.map → follow-up-tool-I2HTKMP4.js.map} +0 -0
- /package/dist/{grants-3UVDASRI.js.map → grants-2MNWGCSH.js.map} +0 -0
- /package/dist/{hub-6TKU6CHO.js.map → hub-7ASBN76I.js.map} +0 -0
- /package/dist/{promote-D3KYLUBD.js.map → promote-NSPUPPHB.js.map} +0 -0
- /package/dist/{providers-AHLCB6R5.js.map → providers-D6IUAHQJ.js.map} +0 -0
- /package/dist/{query-D2TQ2PUO.js.map → query-VW63IHDI.js.map} +0 -0
- /package/dist/{query-settings-ILDX3HDF.js.map → query-settings-RS7DJI4H.js.map} +0 -0
- /package/dist/{registry-N3BY3HSI.js.map → registry-6KREAROB.js.map} +0 -0
- /package/dist/{request-planner-CVCG5XQR.js.map → request-planner-HZWQIRZO.js.map} +0 -0
- /package/dist/{resolve-JKXYBZ6R.js.map → resolve-LOYZUE2D.js.map} +0 -0
- /package/dist/{review-candidates-CKUN4PSY.js.map → review-candidates-2TXOUASP.js.map} +0 -0
- /package/dist/{routing-OCIRGUKK.js.map → routing-ZV4VSZDV.js.map} +0 -0
- /package/dist/{rules-A5ES57QT.js.map → rules-FBOLGE2S.js.map} +0 -0
- /package/dist/{schedule-tool-YFMRYTEO.js.map → schedule-tool-D357NLXS.js.map} +0 -0
- /package/dist/{scheduler-D2Z7RSEE.js.map → scheduler-SAID6RKQ.js.map} +0 -0
- /package/dist/{seat-Z3E2FLDA.js.map → seat-XHBWBSTS.js.map} +0 -0
- /package/dist/{select-J4ES7Q67.js.map → select-QUCTTAH3.js.map} +0 -0
- /package/dist/{set-enabled-S22TICYC.js.map → set-enabled-CGMXLFC6.js.map} +0 -0
- /package/dist/{sprint-tool-NDF47EKV.js.map → sprint-tool-SWRYSX3Q.js.map} +0 -0
- /package/dist/{status-PKHYFGZK.js.map → status-PVYFTNX2.js.map} +0 -0
- /package/dist/{tool-6NZIUXI7.js.map → tool-6G63ZQW4.js.map} +0 -0
- /package/dist/{tool-RCCMOMEY.js.map → tool-DA25L4ND.js.map} +0 -0
- /package/dist/{tool-52JRXZVA.js.map → tool-ELGOVIM5.js.map} +0 -0
- /package/dist/{tool-Z2OVFGWW.js.map → tool-MMH2JNP7.js.map} +0 -0
- /package/dist/{wiki-HQKFZZSX.js.map → wiki-4ZL4QXA7.js.map} +0 -0
- /package/dist/{wiki-enrich-7SZ5W2LF.js.map → wiki-enrich-N5MUKDVW.js.map} +0 -0
- /package/dist/{workspace-setup-W5UO2WZI.js.map → workspace-setup-QXFJRNSK.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as rt,b as ot,c as st,d as x,e as A,f as v}from"./chunk-72SZI2UW.js";import{a as ne,b as et}from"./chunk-FCPTN6NF.js";import{a as Te,b as ht}from"./chunk-MCI3DIWW.js";import{o as we,p as Ze}from"./chunk-DCIYOPJF.js";import{Qb as tt,Rb as nt}from"./chunk-
|
|
1
|
+
import{a as rt,b as ot,c as st,d as x,e as A,f as v}from"./chunk-72SZI2UW.js";import{a as ne,b as et}from"./chunk-FCPTN6NF.js";import{a as Te,b as ht}from"./chunk-MCI3DIWW.js";import{o as we,p as Ze}from"./chunk-DCIYOPJF.js";import{Qb as tt,Rb as nt}from"./chunk-DUCYRNCT.js";import{a as it,b as at,c as ct,d as ut,e as lt,f as dt,g as pt,h as mt,i as bt,j as ft,k as gt,l as yt}from"./chunk-RGDKHYY2.js";import{a as E,b as We,c as he}from"./chunk-QIJLFPWE.js";function R(e,t){$.set(e,t),X.delete(e)}function D(e){let t=X.get(e);if(t)return t;let r=$.get(e);if(!r){let o=Ee();throw new Error(`unknown decision backend "${e}"`+(o.length>0?` \u2014 registered: ${o.join(", ")}`:" \u2014 none registered"))}let n=r();return X.set(e,n),n}function Ee(){return[...$.keys()].sort()}function wt(){$.clear(),X.clear()}var $,X,C=E(()=>{"use strict";$=new Map,X=new Map});import Tt from"better-sqlite3";import{createHash as Et}from"crypto";import{mkdirSync as kt}from"fs";import{dirname as St,resolve as xt}from"path";function Q(e){if(e.type==="noul"){let r=e.noul,n={yes:r,no:1-r},o=r>=.5?"yes":"no",s=Math.abs(r-.5)*2;return{predicted:o,confidence:s,probabilities:n,topLabel:o,topProb:Math.max(r,1-r),expectedScore:null,pMax:Math.max(r,1-r),negEntropy:s}}if(e.type==="choice")return{predicted:e.choice,confidence:e.confidence,probabilities:{...e.probabilities},topLabel:e.choice,topProb:e.probabilities[e.choice]??0,expectedScore:null,pMax:e.pMax,negEntropy:e.negEntropy};let t=String(Math.round(e.score));return{predicted:t,confidence:e.confidence,probabilities:{...e.probabilities},topLabel:t,topProb:e.probabilities[t]??0,expectedScore:e.score,pMax:e.pMax,negEntropy:e.negEntropy}}function At(e){if(typeof e!="string"||e.length===0)return{};try{let t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Rt(e){e.exec("CREATE TABLE IF NOT EXISTS schema_version (v INTEGER PRIMARY KEY);");let t=e.prepare("SELECT MAX(v) AS v FROM schema_version").get().v??0;t<1&&vt(e),t<2&&Ot(e),t<3&&_t(e)}function _t(e){e.exec(`
|
|
2
2
|
ALTER TABLE decision_calls ADD COLUMN features_json TEXT;
|
|
3
3
|
INSERT INTO schema_version (v) VALUES (3);
|
|
4
4
|
`)}function Ot(e){e.exec(`
|
|
@@ -111,4 +111,4 @@ import{a as rt,b as ot,c as st,d as x,e as A,f as v}from"./chunk-72SZI2UW.js";im
|
|
|
111
111
|
`)}if(!m)throw new Error(`local decision backend could not get a valid answer after ${f+1} attempt(s): ${w}`);let M={},L=!1;for(let[k,q]of Object.entries(s.questions)){let S=_(q,m[k],{normalize:e.normalizeProbabilities??!0});M[k]=S.answer,S.repaired&&(L=!0)}return{model:a,answers:M,usage:h,meta:{backend:"local",structureMode:c,answerMode:"probabilities",repaired:L,retries:f,stateTruncated:l.truncated,latencyMs:Date.now()-i}}}finally{b()}}}}async function Jt(e,t,r,n,o){if(!e.generateRaw)throw new Error(`provider "${e.name}" has no generateRaw(); use structureMode "text"`);let s=[{role:"user",content:r},...n?[{role:"user",content:n}]:[]],i=await e.generateRaw(s,J,[{name:F,description:"Report a probability distribution for every question.",input_schema:se(t)}],{...o,toolChoice:{type:"tool",name:F}}),a=i.content.find(c=>c.type==="tool_use"&&c.name===F),u=a&&a.type==="tool_use"?a.input:null;return{answers:Be(u),usage:{inputTokens:i.usage.input_tokens,outputTokens:i.usage.output_tokens}}}async function Gt(e,t,r,n,o){let s=[r,ae(t)].join(`
|
|
112
112
|
`),i=[{role:"system",content:J},{role:"user",content:s},...n?[{role:"user",content:n}]:[]],a=await e.generate(i,o);return{answers:Be(Te(a.content??"")),usage:{inputTokens:0,outputTokens:a.tokensUsed??0}}}function Be(e){if(e&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(t.answers&&typeof t.answers=="object")return t.answers}return e}function Yt(e,t){return e!=="auto"?e:t.generateRaw&&me[t.name]?.structuredOutput?"tool":"text"}function Kt(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(new Error(`decision timed out after ${t}ms`)),t),o=()=>r.abort(e?.reason);return e&&(e.aborted?o():e.addEventListener("abort",o,{once:!0})),{signal:r.signal,dispose:()=>{clearTimeout(n),e?.removeEventListener("abort",o)}}}var Xt,$t,Vt,Fe,zt,be=E(()=>{"use strict";Ze();Ue();ht();j();Y();v();z();Xt="claude-code",$t="claude-haiku-4-5-20251001",Vt=24e3,Fe=2e3,zt=3e4});import{readFileSync as Ht}from"fs";import{homedir as Wt}from"os";import{join as Zt}from"path";function N(e={}){let t=(e.baseUrl??en).replace(/\/+$/,""),r=e.path??"/classifier",n=e.name??"simple-jev",o=e.maxStateChars??nn,s=e.maxChoiceOptions??rn,i={probabilitySource:e.probabilitySource??"logits",calibratedProbabilities:!1,maxChoiceOptions:s,maxStateChars:o,parallelQuestions:!0,images:!1};return{name:n,capabilities:i,async decide(a){A(a.questions),cn(a.questions,s);let u=Date.now(),c=a.model??e.model;if(!c)throw new Error("simple-jev backend needs a model id");let l=G(a.state,o),p=e.fetchImpl??fetch,{signal:g,dispose:d}=un(a.abortSignal,a.timeoutMs??e.timeoutMs??tn);try{let b={"Content-Type":"application/json"},h=an(e.apiKeyEnv,e.apiKeyFile);h&&(b.Authorization=`Bearer ${h}`);let T=await qe(p(`${t}${r}`,{method:"POST",headers:b,body:JSON.stringify({model:c,state:l.text,questions:sn(a.questions)}),signal:g}),g);if(!T.ok){let k=await T.text().catch(()=>"");throw new Error(`${n} ${T.status}: ${k.slice(0,300)}`)}let f=await qe(T.json(),g),m=P(a.questions).safeParse(f.answers);if(!m.success)throw new Error(`${n} returned a response that does not match the requested questions (contract drift, not a model slip \u2014 retrying will not help):
|
|
113
113
|
${U(m.error)}`);let w=m.data,M={},L=!1;for(let[k,q]of Object.entries(a.questions)){let S=_(q,w[k]);M[k]=S.answer,S.repaired&&(L=!0)}return{model:f.model??c,answers:M,usage:{inputTokens:f.usage?.input_tokens??0,outputTokens:f.usage?.output_tokens??0},meta:{backend:n,structureMode:i.probabilitySource==="native"?"native":"logprobs",answerMode:"probabilities",repaired:L,retries:0,stateTruncated:l.truncated,latencyMs:Date.now()-u}}}finally{d()}}}}function sn(e){let t={};for(let[r,n]of Object.entries(e))t[r]=n.instructions?n:{...n,instructions:on[n.type]};return t}function an(e,t){let r=e?process.env[e]:void 0;if(r)return r;if(!t)return;let n=t.startsWith("~/")?Zt(Wt(),t.slice(2)):t;if(!Z.has(n))try{let o=Ht(n,"utf-8").trim();Z.set(n,o.length>0?o:null)}catch{Z.set(n,null)}return Z.get(n)??void 0}function cn(e,t){for(let[r,n]of Object.entries(e))if(n.type==="choice"){let o=Object.keys(n.criteria).length;if(o>t)throw new Error(`question "${r}": accepts at most ${t} choice options, got ${o}`)}else if(n.type==="score"&&n.criteria.length>t)throw new Error(`question "${r}": accepts at most ${t} score levels, got ${n.criteria.length}`)}function qe(e,t){return t.aborted?Promise.reject(t.reason??new Error("aborted")):new Promise((r,n)=>{let o=()=>n(t.reason??new Error("aborted"));t.addEventListener("abort",o,{once:!0}),e.then(s=>{t.removeEventListener("abort",o),r(s)},s=>{t.removeEventListener("abort",o),n(s)})})}function un(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(new Error(`decision timed out after ${t}ms`)),t),o=()=>r.abort(e?.reason);return e&&(e.aborted?o():e.addEventListener("abort",o,{once:!0})),{signal:r.signal,dispose:()=>{clearTimeout(n),e?.removeEventListener("abort",o)}}}var en,tn,nn,rn,on,Z,fe=E(()=>{"use strict";j();v();z();Y();en="http://127.0.0.1:8000/v1",tn=3e4,nn=6e3,rn=50;on={choice:"Which option best fits?",score:"Which level best fits?",noul:"Is this true of the state?"};Z=new Map});var Xe={};We(Xe,{DEFAULT_SEAT_TIMEOUT_MS:()=>Ve,DecisionStore:()=>I,MAX_CHOICE_OPTIONS:()=>MAX_CHOICE_OPTIONS,SYSTEM_PROMPT:()=>J,TOOL_NAME:()=>F,UNCERTAINTY_HIGH:()=>Ce,UNCERTAINTY_LOW:()=>De,_resetDecisionBackendsForTesting:()=>wt,agreement:()=>it,answerView:()=>Q,applyRecalibrator:()=>ue,applyTemperature:()=>mt,askSeat:()=>yn,band:()=>Ie,bootstrapInterval:()=>ft,brier:()=>lt,buildDesign:()=>ve,calibrationReport:()=>gt,choice:()=>ot,compareCalibrators:()=>It,confidenceFor:()=>re,configureDecisions:()=>pn,configuredSeatTimeout:()=>dn,coverageCurve:()=>pt,createLocalDecisionBackend:()=>W,createMockDecisionBackend:()=>H,createSimpleJevBackend:()=>N,decisionsRuntime:()=>bn,describeIssues:()=>U,ece:()=>ct,expectedScore:()=>Ae,finalizeAnswer:()=>_,fitLogistic:()=>Ne,fitRecalibrator:()=>B,fitTemperature:()=>bt,getDecisionBackend:()=>D,getSeatMode:()=>Je,labelSeatCall:()=>fn,labelsOf:()=>x,listDecisionBackends:()=>Ee,logLoss:()=>dt,logit:()=>le,mce:()=>ut,measureConsistency:()=>Ut,normalizeDistribution:()=>Se,normalizedNegEntropy:()=>oe,noul:()=>rt,pMax:()=>xe,parseSeatMode:()=>ge,rawAnswerSchema:()=>Re,rawAnswersSchema:()=>P,recordSeatOutcome:()=>gn,registerBuiltinDecisionBackends:()=>ln,registerDecisionBackend:()=>R,reliabilityBins:()=>at,renderQuestions:()=>_e,renderShapeInstructions:()=>ae,renderState:()=>G,renderUserPrompt:()=>ie,resetDecisionsRuntime:()=>mn,score:()=>st,seatEnvVar:()=>ze,sigmoid:()=>de,toolInputSchema:()=>se,validateQuestions:()=>A,withUid:()=>Qe});function ln(e={},t={},r={},n={}){R("mock",()=>H()),R("local",()=>W(e)),R("simple-jev",()=>N(t)),R("jev",()=>N({name:"jev",baseUrl:"https://openrouter.ai/api/alpha",path:"/decisions",model:"jev-latest",apiKeyEnv:"OPENROUTER_API_KEY",apiKeyFile:"~/.agentx/openrouter-key.txt",probabilitySource:"native",maxChoiceOptions:255,maxStateChars:9e4,...r})),R("typesafe",()=>N({name:"typesafe",baseUrl:"https://api.typesafe.ai/v1",path:"/systemone",model:"jev-latest",apiKeyEnv:"TYPESAFE_API_KEY",apiKeyFile:"~/.agentx/typesafe-key.txt",probabilitySource:"native",maxChoiceOptions:255,maxStateChars:9e4,...n}))}var $e=E(()=>{"use strict";ke();v();j();z();C();Y();V();yt();Me();je();Ge();pe();be();fe();C();pe();be();fe()});function dn(e){return Ke(),y.seats[e]?.timeoutMs}function pn(e){y={...ye,...y,...e},ee=!0}function mn(){y={...ye,seats:{}},ee=!1}function Ke(){if(!ee){ee=!0;try{let{loadDaemonConfig:e}=(nt(),he(tt)),t=e()?.decisions;if(!t?.enabled)return;let{registerBuiltinDecisionBackends:r}=($e(),he(Xe)),n=t.backends??{};r(n.local,n.simpleJev,n.jev,n.typesafe);let o=null;try{o=new I({path:t.dbPath})}catch{}y={enabled:!0,defaultBackend:t.defaultBackend,store:o,seats:Object.fromEntries(Object.entries(t.seats??{}).map(([s,i])=>[s,{...i,redactState:t.redactState,keepStateRows:t.keepStateRows}]))}}catch{}}}function bn(){return y}function ge(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return hn.includes(t)?t:null}function ze(e){return`AGENTX_DECISION_SEAT_${e.toUpperCase().replace(/[^A-Z0-9]+/g,"_")}`}function Je(e,t=process.env){Ke();let r=ge(t[ze(e)]);return r||(y.enabled?ge(y.seats[e]?.mode)??"off":"off")}function fn(e,t,r,n={}){if(!(!e||!y.store))try{y.store.label(e,t,r,n)}catch{}}function gn(e,t,r=!1){if(!(!e||!y.store))try{y.store.recordOutcome(e,t,r)}catch{}}async function yn(e,t,r,n={}){let o=Je(e);if(o==="off")return null;let s=y.seats[e]??{mode:o},i=n.backend??s.backend??y.defaultBackend,a=Date.now();try{let c=await D(i).decide({state:t,questions:r,model:n.model??s.model,abortSignal:n.signal,timeoutMs:n.timeoutMs??s.timeoutMs??(y.seats[e]?Ve:void 0)}),l=wn(e,o,t,r,c,n,s);return{answers:c.answers,callId:l,mode:o}}catch(u){return Tn(e,o,t,r,i,n,s,a,u),En(e,i,u),null}}function wn(e,t,r,n,o,s,i){if(!y.store)return null;try{return y.store.recordCall({seat:e,mode:t,backend:o.meta.backend,model:o.model,meta:o.meta,state:r,questions:n,answers:o.answers,usage:o.usage,incumbent:He(s.incumbent),links:s.links,features:s.features,keepState:!i.redactState})}catch{return null}}function Tn(e,t,r,n,o,s,i,a,u){if(y.store)try{y.store.recordCall({seat:e,mode:t,backend:o,model:s.model??i.model??"unknown",meta:{structureMode:"text",answerMode:"probabilities",retries:0,stateTruncated:!1,latencyMs:Date.now()-a},state:r,questions:n,answers:{},incumbent:He(s.incumbent),links:s.links,features:s.features,error:String(u?.message??u).slice(0,500),keepState:!i.redactState})}catch{}}function He(e){if(!e)return;let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]={value:n});return t}function En(e,t,r){let n=Date.now();n-Ye<6e4||(Ye=n,console.warn(`[decisions] seat "${e}" on backend "${t}" failed: ${r?.message??r}`))}var Ve,ye,y,ee,hn,Ye,Ge=E(()=>{C();V();Ve=1e4;ye={enabled:!1,defaultBackend:"local",seats:{},store:null},y={...ye},ee=!1;hn=["off","shadow","active"];Ye=0});export{D as a,Ee as b,C as c,I as d,V as e,It as f,Me as g,Ut as h,je as i,me as j,Xn as k,Ue as l,ln as m,$e as n,Ve as o,dn as p,pn as q,mn as r,bn as s,ge as t,ze as u,Je as v,fn as w,gn as x,yn as y,Ge as z};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-245IOYDJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as d,g as h,h as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as d,g as h,h as u}from"./chunk-JSCVOB4G.js";function b(l,r,a,s={}){let i=(s.now??Date.now)(),n=[],p=u(r,s.env??process.env);p.ok||n.push(p.reason);let o=h(l,r,s);if(!o.ok)return n.push(o.reason),{connected:!1,refreshes:!1,missingScopes:[],problems:n};let t=o.grant,g=!!t.refreshToken&&a.oauth.refresh!=="none",e=g?void 0:t.expiresAt;e&&e<=i?n.push(`the token expired on ${new Date(e).toISOString().slice(0,10)}: connect again`):e&&e-i<7*864e5&&n.push(`the token expires on ${new Date(e).toISOString().slice(0,10)}: connect again before then`);let f=new Set(t.scopes.length?t.scopes:d(r)),c=f.size?a.oauth.scopes.filter(m=>!f.has(m)):[];return c.length&&n.push(`not granted: ${c.join(", ")}. Connect again and allow them`),{connected:!e||e>i,store:o.source,expiresAt:e,refreshes:g,connectedAt:t.connectedAt||void 0,missingScopes:c,problems:n}}export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2LJZHKTY.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{Fb as b,Gb as k,Jb as x,Rb as S}from"./chunk-
|
|
1
|
+
import{Fb as b,Gb as k,Jb as x,Rb as S}from"./chunk-DUCYRNCT.js";S();import{readFileSync as w,writeFileSync as v,existsSync as P}from"fs";import{resolve as d}from"path";function O(r){if(r)return d(r);let e=[d(process.cwd(),"agentx.json"),d(process.cwd(),".agentx/config.json")];for(let n of e)if(P(n))return n;return e[0]}function R(r){return JSON.parse(JSON.stringify(r))}async function C(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/reload`,{method:"POST",signal:AbortSignal.timeout(3e3)});return e.ok?{ok:!0}:{ok:!1,reason:`HTTP ${e.status}`}}catch(e){return{ok:!1,reason:e?.cause?.code||e?.message||"unreachable"}}}async function N(r,e={}){let{validate:n=!0,dryRun:t=!1,reload:s=!0,configPath:l,daemonUrl:c}=e,o=O(l);if(!P(o))return{success:!1,path:o,error:`Config not found at ${o}. Run \`agentx init\` first.`};let g;try{g=w(o,"utf-8")}catch(a){return{success:!1,path:o,error:`Cannot read ${o}: ${a.message}`}}let p;try{p=JSON.parse(g)}catch(a){return{success:!1,path:o,error:`Invalid JSON in ${o}: ${a.message}`}}let i=R(p);try{await r(i)}catch(a){return{success:!1,path:o,error:`Mutator threw: ${a.message}`}}if(n){let a=k(i),u=b.safeParse(a);if(!u.success){let f=u.error.issues.map($=>` ${$.path.join(".")||"<root>"}: ${$.message}`).join(`
|
|
2
2
|
`);return{success:!1,path:o,error:`Validation failed:
|
|
3
3
|
${f}`,after:i}}let m=x(u.data);if(m.length)return{success:!1,path:o,error:`Validation failed:
|
|
4
4
|
${m.map(f=>` ${f}`).join(`
|
|
5
5
|
`)}`,after:i}}if(t)return{success:!0,path:o,after:i,dryRun:!0};try{v(o,JSON.stringify(i,null,2)+`
|
|
6
6
|
`)}catch(a){return{success:!1,path:o,error:`Write failed: ${a.message}`,after:i}}let h=!1,y;if(s){let a=c||M(i),u=await C(a);u.ok?h=!0:y=u.reason}return{success:!0,path:o,after:i,reloaded:h,reloadSkipped:y}}function M(r){let e=r?.node?.bind;if(!e)return"http://127.0.0.1:18800";let[n,t]=e.split(":");return`http://${n==="0.0.0.0"||n==="::"?"127.0.0.1":n}:${t}`}function A(r,e,n){let t=e.split("."),s=r;for(let l=0;l<t.length-1;l++){let c=t[l];(s[c]===void 0||s[c]===null)&&(s[c]={}),s=s[c]}s[t[t.length-1]]=n}function F(r,e){let n=e.split("."),t=r;for(let s of n){if(t==null)return;t=t[s]}return t}function U(r,e){let n=e.split("."),t=r;for(let s=0;s<n.length-1;s++){if(t==null)return;t=t[n[s]]}t!=null&&delete t[n[n.length-1]]}export{O as a,N as b,A as c,F as d,U as e};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-2P3SHT5I.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Hb as m,Rb as b}from"./chunk-
|
|
1
|
+
import{Hb as m,Rb as b}from"./chunk-DUCYRNCT.js";b();function w(t){let e=typeof t.node=="string"?t.node:"",n=typeof t.token=="string"?t.token:"";if(!e||!n)try{let o=m(t.config);e||(e=o.dashboard?.daemonUrl||""),n||(n=o.dashboard?.token||"")}catch{}return e||(e="http://localhost:18800"),{baseUrl:e.replace(/\/+$/,""),token:n}}async function d(t,e,n){let o={Accept:"application/json"};t.token&&(o.Authorization=`Bearer ${t.token}`);let r=await fetch(`${t.baseUrl}${e}`,{headers:o,signal:n});if(!r.ok)throw new Error(`GET ${e} \u2192 HTTP ${r.status}`);return await r.json()}function R(t,e){return d(t,"/agents",e)}async function S(t,e){return(await d(t,"/api/processes",e)).processes??[]}function P(t,e){return d(t,"/crons",e)}async function h(t,e,n,o){let r={Accept:"application/json","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}${e}`,{method:"POST",headers:r,body:JSON.stringify(n),signal:o}),a=await s.text(),i;try{i=a?JSON.parse(a):{}}catch{i={raw:a}}if(!s.ok)throw new Error(i?.error||`POST ${e} \u2192 HTTP ${s.status}`);return i}function A(t,e,n="tui"){return h(t,"/api/processes/kill",{...e,reason:n})}function C(t,e,n,o){return h(t,"/task",{agent:e,message:n,context:o??{channel:"tui",chatId:"tui:operator"}})}async function $(t,e,n,o={}){let r={Accept:"text/event-stream","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}/task`,{method:"POST",headers:r,body:JSON.stringify({agent:e,message:n,stream:!0,context:{channel:o.channel??"chat-cli",chatId:o.chatId??"chat-cli:operator"}}),signal:o.signal});if(!s.ok||!s.body){let g=await s.text().catch(()=>"");throw new Error(`POST /task (stream) \u2192 HTTP ${s.status}${g?`: ${g.slice(0,200)}`:""}`)}let a=s.body.getReader(),i=new TextDecoder,u={content:""},c="";try{for(;;){let{done:g,value:p}=await a.read();if(g)break;c+=i.decode(p,{stream:!0});let l;for(;(l=c.indexOf(`
|
|
2
2
|
|
|
3
3
|
`))>=0;){let k=c.slice(0,l);c=c.slice(l+2);let f=x(k);f&&T(f,o,u)}}}finally{try{a.releaseLock()}catch{}}return u}function T(t,e,n){let{event:o,data:r}=t;switch(o){case"text":r?.text&&(n.content+=r.text,e.onText?.(r.text));break;case"thinking":r?.text&&e.onThinking?.(r.text);break;case"tool":e.onTool?.(r);break;case"done":typeof r?.content=="string"&&(n.content=r.content),n.usage=r?.usage,n.duration=r?.duration;break;case"error":n.error=r?.error,n.errorKind=r?.errorKind;break}}function x(t){let e="message",n="";for(let r of t.split(`
|
|
4
4
|
`))r.startsWith("event: ")?e=r.slice(7).trim():r.startsWith("data: ")&&(n=r.slice(6));if(!n)return null;let o;try{o=JSON.parse(n)}catch{o=n}return{event:e,data:o}}export{w as a,R as b,S as c,P as d,A as e,C as f,$ as g};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-2VSK6FAR.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as g}from"./chunk-JLBRNYKY.js";import{createHash as A}from"crypto";var f="v24.0",y=`https://graph.facebook.com/${f}`,m=/[0-9]{1,30}/,I=/[0-9]{1,30}_[0-9]{1,30}/,w=/[0-9]{4}-[0-9]{2}-[0-9]{2}|[0-9]{9,11}/,U=["page_media_view","page_total_media_view_unique","page_follows","page_daily_follows","page_daily_follows_unique","page_daily_unfollows_unique","page_post_engagements","page_video_views","page_video_view_time","monetization_approximate_earnings","page_daily_video_ad_break_earnings"],x=["post_media_view","post_total_media_view_unique","post_reactions_by_type_total","post_clicks","post_video_views"],M=["views","reach","total_interactions","accounts_engaged","likes","comments","shares","saves","replies","follows_and_unfollows","profile_links_taps","follower_count","follower_demographics","engaged_audience_demographics"],C=["views","reach","total_interactions","likes","comments","shares","saved","profile_visits","follows","ig_reels_avg_watch_time","ig_reels_video_view_total_time"],O=["pages_show_list","pages_read_engagement","read_insights","instagram_basic","instagram_manage_insights"],D=new Set(["page_insights","page_posts","post_insights"]);async function v(t,e,a,i){let o=new URL(y+e);for(let[c,r]of Object.entries(a))o.searchParams.set(c,r);let s=await t(o.toString(),{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${i}`},signal:AbortSignal.timeout(15e3),redirect:"error"}),n=await s.text(),d;try{d=JSON.parse(n)}catch{d={}}if(!s.ok){let c=d?.error?.message||`HTTP ${s.status}`;throw new Error(g(String(c)).split(i).join("[redacted]"))}return d}async function Y(t,e){let a=new URL(`${y}/oauth/access_token`);a.searchParams.set("grant_type","fb_exchange_token"),a.searchParams.set("client_id",e.clientId),a.searchParams.set("client_secret",e.clientSecret),a.searchParams.set("fb_exchange_token",t.accessToken);let i=await e.fetch(a.toString(),{method:"GET",headers:{Accept:"application/json"},signal:AbortSignal.timeout(15e3),redirect:"error"}),o=await i.text(),s;try{s=JSON.parse(o)}catch{s={}}if(!i.ok||typeof s?.access_token!="string"||!s.access_token){let r=s?.error?.message||`HTTP ${i.status}`;throw new Error(`Meta refused the long-lived token swap: ${g(String(r))}`)}let n=Number(s.expires_in),d=s.access_token,c=t.scopes;try{let r=await v(e.fetch,"/me/permissions",{},d);Array.isArray(r?.data)&&(c=r.data.filter(l=>l?.status==="granted"&&typeof l.permission=="string").map(l=>l.permission))}catch(r){e.warn?.(`Could not read the granted permissions from Meta (${g(String(r?.message??r))}). Recorded the permissions asked for instead, so a declined one will not show in doctor.`)}return{accessToken:d,expiresAt:Number.isFinite(n)&&n>0?e.now+n*1e3:void 0,scopes:c,connectedAt:t.connectedAt}}var G=60*6e4,N=200,u=new Map;function q(t,e){if(e.page_id)return e.page_id;if(t==="post_insights"&&e.post_id)return e.post_id.split("_")[0]}async function $(t){if(!D.has(t.read))return t.token;let e=q(t.read,t.values);if(!e||!/^[0-9]{1,30}$/.test(e))throw new Error("this read needs a Page id (run the `pages` read to list them)");let a=A("sha256").update(t.token).digest("hex").slice(0,32)+":"+e,i=u.get(a);if(i&&i.until>t.now)return i.token;let o;try{o=await v(t.fetch,`/${e}`,{fields:"access_token"},t.token)}catch(n){throw new Error(`couldn't get a token for Page ${e}: ${n?.message??n}`)}let s=typeof o?.access_token=="string"?o.access_token:"";if(!s)throw new Error(`the account that signed in does not manage Page ${e}, or did not grant pages_read_engagement for it. Run the \`pages\` read to see the Pages it manages`);return u.size>=N&&u.delete(u.keys().next().value),u.set(a,{token:s,until:t.now+G}),s}var _={description:"Start: YYYY-MM-DD or a Unix time",pattern:w},h={description:"End: YYYY-MM-DD or a Unix time",pattern:w},P={kind:"meta",title:"Meta (Facebook and Instagram)",baseUrl:y,oauth:{authorizeUrl:`https://www.facebook.com/${f}/dialog/oauth`,tokenUrl:`${y}/oauth/access_token`,scopes:O,scopeSeparator:",",pkce:!1,refresh:"none",afterConnect:Y},readToken:$,reads:{pages:{description:"The Facebook Pages the signed-in account manages, with each Page's linked Instagram professional account. Use it to find page_id and ig_user_id.",path:"/me/accounts",params:{limit:{description:"How many Pages (1-100)",pattern:/[1-9][0-9]?|100/,default:"25"}},fixedQuery:{fields:"id,name,category,instagram_business_account{id,username}"},scopes:["pages_show_list"]},page_insights:{description:"Facebook Page totals: views, unique viewers, follows, engagement, video, and earnings for a monetised Page.",path:"/{page_id}/insights",params:{page_id:{description:"Facebook Page id (from the `pages` read, or metadata.page_id)",required:!0,fromMetadata:!0,pattern:m},metric:{description:"Comma-separated metrics",required:!0,list:!0,enum:U},period:{description:"Granularity",enum:["day","week","days_28","month","lifetime","total_over_range"],default:"day"},since:_,until:h},scopes:["read_insights","pages_read_engagement"]},page_posts:{description:"Recent posts of a Facebook Page (id, time, link). Use it to find post_id.",path:"/{page_id}/posts",params:{page_id:{description:"Facebook Page id",required:!0,fromMetadata:!0,pattern:m},limit:{description:"How many posts (1-100)",pattern:/[1-9][0-9]?|100/,default:"25"},since:_,until:h},fixedQuery:{fields:"id,created_time,permalink_url,status_type"},scopes:["pages_read_engagement"]},post_insights:{description:"Totals for one Facebook Page post: views, unique viewers, reactions, clicks, video views.",path:"/{post_id}/insights",params:{post_id:{description:"Post id, <page id>_<post id> (from `page_posts`)",required:!0,pattern:I},metric:{description:"Comma-separated metrics",required:!0,list:!0,enum:x}},scopes:["read_insights","pages_read_engagement"]},ig_account_insights:{description:"Instagram professional account totals: views, reach, interactions, followers, and audience demographics.",path:"/{ig_user_id}/insights",params:{ig_user_id:{description:"Instagram account id (from the `pages` read, or metadata.ig_user_id)",required:!0,fromMetadata:!0,pattern:m},metric:{description:"Comma-separated metrics",required:!0,list:!0,enum:M},period:{description:"Granularity",enum:["day","lifetime"],default:"day"},metric_type:{description:"total_value (one number) or time_series (per day)",enum:["total_value","time_series"]},breakdown:{description:"Split the totals (demographics and some totals only)",enum:["age","city","country","gender","media_product_type","follow_type","contact_button_type"]},timeframe:{description:"Window for demographics",enum:["this_week","this_month","prev_month","last_14_days","last_30_days","last_90_days"]},since:_,until:h},scopes:["instagram_basic","instagram_manage_insights"]},ig_media:{description:"Recent posts, reels and stories of an Instagram professional account (id, type, time, link, likes, comments). Use it to find media_id.",path:"/{ig_user_id}/media",params:{ig_user_id:{description:"Instagram account id",required:!0,fromMetadata:!0,pattern:m},limit:{description:"How many items (1-100)",pattern:/[1-9][0-9]?|100/,default:"25"},since:_,until:h},fixedQuery:{fields:"id,media_type,media_product_type,timestamp,permalink,like_count,comments_count"},scopes:["instagram_basic"]},ig_media_insights:{description:"Totals for one Instagram post or reel: views, reach, interactions, saves, shares, and reel watch time.",path:"/{media_id}/insights",params:{media_id:{description:"Instagram media id (from `ig_media`)",required:!0,pattern:m},metric:{description:"Comma-separated metrics",required:!0,list:!0,enum:C}},scopes:["instagram_basic","instagram_manage_insights"]}}};var B="https://www.googleapis.com/youtube/v3",k="https://youtubeanalytics.googleapis.com/v2",p=["https://www.googleapis.com/auth/youtube.readonly","https://www.googleapis.com/auth/yt-analytics.readonly"],T="https://www.googleapis.com/auth/yt-analytics-monetary.readonly",F=["views","engagedViews","redViews","estimatedMinutesWatched","estimatedRedMinutesWatched","averageViewDuration","averageViewPercentage","likes","dislikes","comments","shares","subscribersGained","subscribersLost","videosAddedToPlaylists","videosRemovedFromPlaylists","cardClicks","cardImpressions","cardClickRate","viewerPercentage"],z=["estimatedRevenue","estimatedAdRevenue","grossRevenue","estimatedRedPartnerRevenue","monetizedPlaybacks","playbackBasedCpm","adImpressions","cpm"],L=["day","month","video","playlist","country","province","ageGroup","gender","deviceType","operatingSystem","insightTrafficSourceType","insightPlaybackLocationType","subscribedStatus","youtubeProduct","creatorContentType","sharingService","liveOrOnDemand"],H=/[A-Za-z0-9_-]{11}/,V=/UU[A-Za-z0-9_-]{22}/,S=/[0-9]{4}-[0-9]{2}-[0-9]{2}/,Z=/[A-Za-z0-9_-]{1,100}/,b="(video==[A-Za-z0-9_-]{11}|country==[A-Z]{2}|subscribedStatus==(SUBSCRIBED|UNSUBSCRIBED)|creatorContentType==[A-Z_]{1,30})",Q=new RegExp(`${b}(;${b}){0,3}`);function E(t){return{startDate:{description:"First day, YYYY-MM-DD",required:!0,pattern:S},endDate:{description:"Last day, YYYY-MM-DD",required:!0,pattern:S},metrics:{description:"Comma-separated metrics",required:!0,list:!0,enum:t},dimensions:{description:"Comma-separated dimensions, e.g. day, video, country, ageGroup,gender",list:!0,enum:L},filters:{description:"e.g. video==<id>, country==US, creatorContentType==SHORTS; join several with ;",pattern:Q},sort:{description:"Comma-separated; a leading - sorts descending, e.g. -views",list:!0,pattern:/-?[A-Za-z]{1,40}/},maxResults:{description:"Rows (1-200), needed with the video dimension",pattern:/[1-9][0-9]?|1[0-9]{2}|200/}}}var R={kind:"youtube",title:"YouTube",baseUrl:B,oauth:{authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:p,optionalScopes:{revenue:[T]},authorizeParams:{access_type:"offline",prompt:"consent"}},reads:{channel:{description:"The channel that signed in: title, subscriber, view and video counts, and its uploads playlist id (contentDetails.relatedPlaylists.uploads).",path:"/channels",params:{part:{description:"Comma-separated parts",list:!0,enum:["snippet","statistics","contentDetails","brandingSettings","status","topicDetails"],default:"snippet,statistics,contentDetails"}},fixedQuery:{mine:"true"},scopes:[p[0]]},uploads:{description:"Recent uploads of the channel (video id, title, publish time). Use it to find video ids.",path:"/playlistItems",params:{playlistId:{description:"Uploads playlist id, UU\u2026 (from the `channel` read, or metadata.playlistId)",required:!0,fromMetadata:!0,pattern:V},maxResults:{description:"How many items (1-50)",pattern:/[1-9]|[1-4][0-9]|50/,default:"25"},pageToken:{description:"nextPageToken from the previous answer",pattern:Z}},fixedQuery:{part:"snippet,contentDetails"},scopes:[p[0]]},videos:{description:"Details and public counts (views, likes, comments) for up to 50 videos, plus duration and privacy status.",path:"/videos",params:{id:{description:"Comma-separated video ids (from `uploads`)",required:!0,list:!0,pattern:H},part:{description:"Comma-separated parts",list:!0,enum:["snippet","statistics","contentDetails","status"],default:"snippet,statistics,contentDetails"}},scopes:[p[0]]},report:{description:"YouTube Analytics for the channel: views, watch time, engagement, subscribers, and audience (viewerPercentage by ageGroup,gender). Split by day, video, country, traffic source, device or Shorts (creatorContentType).",baseUrl:k,path:"/reports",params:E(F),fixedQuery:{ids:"channel==MINE"},scopes:[p[1]]},revenue_report:{description:"Estimated revenue, ad revenue, CPM and monetized playbacks. Needs `connect --with revenue` and a Partner Program channel; otherwise YouTube answers 403.",baseUrl:k,path:"/reports",params:{...E(z),currency:{description:"ISO 4217 currency, e.g. USD",pattern:/[A-Z]{3}/}},fixedQuery:{ids:"channel==MINE"},scopes:[p[1],T]}}};var j={meta:P,youtube:R};function se(t,e=j){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:null}export{j as a,se as b};
|
|
2
|
+
//# sourceMappingURL=chunk-2YDG5CSS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/integrations/providers/meta.ts","../src/integrations/providers/youtube.ts","../src/integrations/providers/index.ts"],"sourcesContent":["import { createHash } from \"crypto\"\nimport { safeProviderText } from \"../oauth\"\nimport type { OAuthGrant, ProviderContext, ProviderSpec, ReadTokenRequest } from \"./types\"\n\n// --- Meta: Facebook Page and Instagram professional account insights (#1696 P2a) ---\n//\n// Sign-in: Facebook Login for Business on the owner's own Meta app. The code\n// gives a short-lived user token (about an hour). afterConnect swaps it for\n// a long-lived one (about 60 days) and records the permissions the owner\n// actually granted (Meta does not list them in the token answer). Meta has\n// no refresh token: the owner connects again before the expiry doctor shows.\n//\n// Reads:\n// - Instagram reads use the user token, as Meta's Instagram API with\n// Facebook Login expects.\n// - Facebook Page reads need a Page token. readToken derives it from the\n// user token (GET /{page_id}?fields=access_token), keeps it in memory\n// only, and fails with a clear message when the person who signed in\n// does not manage that Page.\n//\n// Metric names: current names only. page_impressions*, page_fans* and the\n// Instagram `impressions` metric are gone (replaced by *_media_view and\n// `views`), so they are not offered. Names are allow-listed: Meta answers\n// 400 for a metric it does not know, and the agent sees that answer.\n\nexport const META_GRAPH_VERSION = \"v24.0\"\nconst GRAPH = `https://graph.facebook.com/${META_GRAPH_VERSION}`\n\nconst NUMERIC_ID = /[0-9]{1,30}/\n/** A Page post id: <page id>_<post id>. */\nconst POST_ID = /[0-9]{1,30}_[0-9]{1,30}/\n/** YYYY-MM-DD or a Unix timestamp, the two forms Graph accepts for since/until. */\nconst DAY_OR_UNIX = /[0-9]{4}-[0-9]{2}-[0-9]{2}|[0-9]{9,11}/\n\nexport const META_PAGE_METRICS = [\n \"page_media_view\",\n \"page_total_media_view_unique\",\n \"page_follows\",\n \"page_daily_follows\",\n \"page_daily_follows_unique\",\n \"page_daily_unfollows_unique\",\n \"page_post_engagements\",\n \"page_video_views\",\n \"page_video_view_time\",\n // Earnings: answered only for a monetised Page.\n \"monetization_approximate_earnings\",\n \"page_daily_video_ad_break_earnings\",\n] as const\n\nexport const META_POST_METRICS = [\n \"post_media_view\",\n \"post_total_media_view_unique\",\n \"post_reactions_by_type_total\",\n \"post_clicks\",\n \"post_video_views\",\n] as const\n\nexport const META_IG_ACCOUNT_METRICS = [\n \"views\",\n \"reach\",\n \"total_interactions\",\n \"accounts_engaged\",\n \"likes\",\n \"comments\",\n \"shares\",\n \"saves\",\n \"replies\",\n \"follows_and_unfollows\",\n \"profile_links_taps\",\n \"follower_count\",\n \"follower_demographics\",\n \"engaged_audience_demographics\",\n] as const\n\nexport const META_IG_MEDIA_METRICS = [\n \"views\",\n \"reach\",\n \"total_interactions\",\n \"likes\",\n \"comments\",\n \"shares\",\n \"saved\",\n \"profile_visits\",\n \"follows\",\n \"ig_reels_avg_watch_time\",\n \"ig_reels_video_view_total_time\",\n] as const\n\nexport const META_SCOPES = [\n \"pages_show_list\",\n \"pages_read_engagement\",\n \"read_insights\",\n \"instagram_basic\",\n \"instagram_manage_insights\",\n]\n\n/** Reads that must be sent with a Page token instead of the user token. */\nconst PAGE_TOKEN_READS = new Set([\"page_insights\", \"page_posts\", \"post_insights\"])\n\nasync function graphGet(f: typeof fetch, path: string, query: Record<string, string>, token: string): Promise<any> {\n const u = new URL(GRAPH + path)\n for (const [k, v] of Object.entries(query)) u.searchParams.set(k, v)\n const res = await f(u.toString(), {\n method: \"GET\",\n headers: { Accept: \"application/json\", Authorization: `Bearer ${token}` },\n signal: AbortSignal.timeout(15_000),\n redirect: \"error\",\n })\n const text = await res.text()\n let data: any\n try { data = JSON.parse(text) } catch { data = {} }\n if (!res.ok) {\n const why = data?.error?.message || `HTTP ${res.status}`\n throw new Error(safeProviderText(String(why)).split(token).join(\"[redacted]\"))\n }\n return data\n}\n\n/** Swap the short-lived user token for a long-lived one and record the\n * permissions the owner granted. */\nexport async function metaAfterConnect(grant: OAuthGrant, ctx: ProviderContext): Promise<OAuthGrant> {\n const u = new URL(`${GRAPH}/oauth/access_token`)\n u.searchParams.set(\"grant_type\", \"fb_exchange_token\")\n u.searchParams.set(\"client_id\", ctx.clientId)\n u.searchParams.set(\"client_secret\", ctx.clientSecret)\n u.searchParams.set(\"fb_exchange_token\", grant.accessToken)\n const res = await ctx.fetch(u.toString(), { method: \"GET\", headers: { Accept: \"application/json\" }, signal: AbortSignal.timeout(15_000), redirect: \"error\" })\n const text = await res.text()\n let data: any\n try { data = JSON.parse(text) } catch { data = {} }\n if (!res.ok || typeof data?.access_token !== \"string\" || !data.access_token) {\n const why = data?.error?.message || `HTTP ${res.status}`\n throw new Error(`Meta refused the long-lived token swap: ${safeProviderText(String(why))}`)\n }\n const expiresIn = Number(data.expires_in)\n const accessToken: string = data.access_token\n let scopes = grant.scopes\n try {\n const perms = await graphGet(ctx.fetch, \"/me/permissions\", {}, accessToken)\n if (Array.isArray(perms?.data)) {\n scopes = perms.data.filter((p: any) => p?.status === \"granted\" && typeof p.permission === \"string\").map((p: any) => p.permission)\n }\n } catch (e: any) {\n // Keep the scopes asked for; doctor then cannot flag a declined one, so say so.\n ctx.warn?.(`Could not read the granted permissions from Meta (${safeProviderText(String(e?.message ?? e))}). Recorded the permissions asked for instead, so a declined one will not show in doctor.`)\n }\n return {\n accessToken,\n expiresAt: Number.isFinite(expiresIn) && expiresIn > 0 ? ctx.now + expiresIn * 1000 : undefined,\n scopes,\n connectedAt: grant.connectedAt,\n }\n}\n\n// Page tokens, in memory only. Keyed on a hash of the user token so a\n// reconnect (new user token) never reuses a Page token from the old one.\nconst PAGE_TOKEN_TTL_MS = 60 * 60_000\nconst PAGE_TOKEN_MAX = 200\nconst pageTokens = new Map<string, { token: string; until: number }>()\n\n/** Forget derived Page tokens (tests). Disconnect runs in the CLI, not the\n * daemon that holds this cache; entries left there are keyed on the old\n * token's hash, so they are never used again and expire within an hour. */\nexport function clearMetaPageTokens(): void { pageTokens.clear() }\n\n/** The Page a read is about: page_id, or the first part of a post id. */\nexport function pageIdFor(read: string, values: Readonly<Record<string, string>>): string | undefined {\n if (values.page_id) return values.page_id\n if (read === \"post_insights\" && values.post_id) return values.post_id.split(\"_\")[0]\n return undefined\n}\n\nexport async function metaReadToken(req: ReadTokenRequest): Promise<string> {\n if (!PAGE_TOKEN_READS.has(req.read)) return req.token\n const pageId = pageIdFor(req.read, req.values)\n if (!pageId || !/^[0-9]{1,30}$/.test(pageId)) throw new Error(\"this read needs a Page id (run the `pages` read to list them)\")\n const key = createHash(\"sha256\").update(req.token).digest(\"hex\").slice(0, 32) + \":\" + pageId\n const hit = pageTokens.get(key)\n if (hit && hit.until > req.now) return hit.token\n let data: any\n try {\n data = await graphGet(req.fetch, `/${pageId}`, { fields: \"access_token\" }, req.token)\n } catch (e: any) {\n throw new Error(`couldn't get a token for Page ${pageId}: ${e?.message ?? e}`)\n }\n const token = typeof data?.access_token === \"string\" ? data.access_token : \"\"\n if (!token) throw new Error(`the account that signed in does not manage Page ${pageId}, or did not grant pages_read_engagement for it. Run the \\`pages\\` read to see the Pages it manages`)\n if (pageTokens.size >= PAGE_TOKEN_MAX) pageTokens.delete(pageTokens.keys().next().value as string)\n pageTokens.set(key, { token, until: req.now + PAGE_TOKEN_TTL_MS })\n return token\n}\n\nconst since = { description: \"Start: YYYY-MM-DD or a Unix time\", pattern: DAY_OR_UNIX }\nconst until = { description: \"End: YYYY-MM-DD or a Unix time\", pattern: DAY_OR_UNIX }\n\nexport const META: ProviderSpec = {\n kind: \"meta\",\n title: \"Meta (Facebook and Instagram)\",\n baseUrl: GRAPH,\n oauth: {\n authorizeUrl: `https://www.facebook.com/${META_GRAPH_VERSION}/dialog/oauth`,\n tokenUrl: `${GRAPH}/oauth/access_token`,\n scopes: META_SCOPES,\n scopeSeparator: \",\",\n // The app secret is sent with the code; Meta's manual login flow does\n // not need PKCE for a confidential client.\n pkce: false,\n refresh: \"none\",\n afterConnect: metaAfterConnect,\n },\n readToken: metaReadToken,\n reads: {\n pages: {\n description: \"The Facebook Pages the signed-in account manages, with each Page's linked Instagram professional account. Use it to find page_id and ig_user_id.\",\n path: \"/me/accounts\",\n params: {\n limit: { description: \"How many Pages (1-100)\", pattern: /[1-9][0-9]?|100/, default: \"25\" },\n },\n fixedQuery: { fields: \"id,name,category,instagram_business_account{id,username}\" },\n scopes: [\"pages_show_list\"],\n },\n page_insights: {\n description: \"Facebook Page totals: views, unique viewers, follows, engagement, video, and earnings for a monetised Page.\",\n path: \"/{page_id}/insights\",\n params: {\n page_id: { description: \"Facebook Page id (from the `pages` read, or metadata.page_id)\", required: true, fromMetadata: true, pattern: NUMERIC_ID },\n metric: { description: \"Comma-separated metrics\", required: true, list: true, enum: META_PAGE_METRICS },\n period: { description: \"Granularity\", enum: [\"day\", \"week\", \"days_28\", \"month\", \"lifetime\", \"total_over_range\"], default: \"day\" },\n since,\n until,\n },\n scopes: [\"read_insights\", \"pages_read_engagement\"],\n },\n page_posts: {\n description: \"Recent posts of a Facebook Page (id, time, link). Use it to find post_id.\",\n path: \"/{page_id}/posts\",\n params: {\n page_id: { description: \"Facebook Page id\", required: true, fromMetadata: true, pattern: NUMERIC_ID },\n limit: { description: \"How many posts (1-100)\", pattern: /[1-9][0-9]?|100/, default: \"25\" },\n since,\n until,\n },\n fixedQuery: { fields: \"id,created_time,permalink_url,status_type\" },\n scopes: [\"pages_read_engagement\"],\n },\n post_insights: {\n description: \"Totals for one Facebook Page post: views, unique viewers, reactions, clicks, video views.\",\n path: \"/{post_id}/insights\",\n params: {\n post_id: { description: \"Post id, <page id>_<post id> (from `page_posts`)\", required: true, pattern: POST_ID },\n metric: { description: \"Comma-separated metrics\", required: true, list: true, enum: META_POST_METRICS },\n },\n scopes: [\"read_insights\", \"pages_read_engagement\"],\n },\n ig_account_insights: {\n description: \"Instagram professional account totals: views, reach, interactions, followers, and audience demographics.\",\n path: \"/{ig_user_id}/insights\",\n params: {\n ig_user_id: { description: \"Instagram account id (from the `pages` read, or metadata.ig_user_id)\", required: true, fromMetadata: true, pattern: NUMERIC_ID },\n metric: { description: \"Comma-separated metrics\", required: true, list: true, enum: META_IG_ACCOUNT_METRICS },\n period: { description: \"Granularity\", enum: [\"day\", \"lifetime\"], default: \"day\" },\n metric_type: { description: \"total_value (one number) or time_series (per day)\", enum: [\"total_value\", \"time_series\"] },\n breakdown: { description: \"Split the totals (demographics and some totals only)\", enum: [\"age\", \"city\", \"country\", \"gender\", \"media_product_type\", \"follow_type\", \"contact_button_type\"] },\n timeframe: { description: \"Window for demographics\", enum: [\"this_week\", \"this_month\", \"prev_month\", \"last_14_days\", \"last_30_days\", \"last_90_days\"] },\n since,\n until,\n },\n scopes: [\"instagram_basic\", \"instagram_manage_insights\"],\n },\n ig_media: {\n description: \"Recent posts, reels and stories of an Instagram professional account (id, type, time, link, likes, comments). Use it to find media_id.\",\n path: \"/{ig_user_id}/media\",\n params: {\n ig_user_id: { description: \"Instagram account id\", required: true, fromMetadata: true, pattern: NUMERIC_ID },\n limit: { description: \"How many items (1-100)\", pattern: /[1-9][0-9]?|100/, default: \"25\" },\n since,\n until,\n },\n fixedQuery: { fields: \"id,media_type,media_product_type,timestamp,permalink,like_count,comments_count\" },\n scopes: [\"instagram_basic\"],\n },\n ig_media_insights: {\n description: \"Totals for one Instagram post or reel: views, reach, interactions, saves, shares, and reel watch time.\",\n path: \"/{media_id}/insights\",\n params: {\n media_id: { description: \"Instagram media id (from `ig_media`)\", required: true, pattern: NUMERIC_ID },\n metric: { description: \"Comma-separated metrics\", required: true, list: true, enum: META_IG_MEDIA_METRICS },\n },\n scopes: [\"instagram_basic\", \"instagram_manage_insights\"],\n },\n },\n}\n","import type { ParamSpec, ProviderSpec } from \"./types\"\n\n// --- YouTube: channel, uploads and YouTube Analytics reports (#1696 P2b) ---\n//\n// Sign-in: Google OAuth on the owner's own Google Cloud project, with PKCE\n// and `access_type=offline` + `prompt=consent`, so a refresh token comes\n// back on every connect. Access tokens last about an hour and are refreshed\n// at use time by the layer. In the \"Testing\" publishing status Google ends\n// refresh tokens after 7 days; doctor then shows \"connect again\".\n//\n// Reads:\n// - Data API v3 (www.googleapis.com/youtube/v3): the signed-in channel,\n// its uploads playlist, and video details. `mine=true` is fixed, so an\n// agent reads only the channel that signed in.\n// - Analytics API v2 (youtubeanalytics.googleapis.com/v2/reports):\n// `ids=channel==MINE` is fixed. Revenue metrics are a separate read\n// that needs the monetary scope (`connect --with revenue`); Google\n// answers 403 for it unless the channel is in the Partner Program.\n//\n// Impressions and click-through rate are not in the Analytics API (only in\n// the bulk Reporting API), so they are not offered here.\n\nconst DATA_API = \"https://www.googleapis.com/youtube/v3\"\nconst ANALYTICS_API = \"https://youtubeanalytics.googleapis.com/v2\"\n\nexport const YOUTUBE_SCOPES = [\n \"https://www.googleapis.com/auth/youtube.readonly\",\n \"https://www.googleapis.com/auth/yt-analytics.readonly\",\n]\nexport const YOUTUBE_REVENUE_SCOPE = \"https://www.googleapis.com/auth/yt-analytics-monetary.readonly\"\n\nexport const YOUTUBE_METRICS = [\n \"views\",\n \"engagedViews\",\n \"redViews\",\n \"estimatedMinutesWatched\",\n \"estimatedRedMinutesWatched\",\n \"averageViewDuration\",\n \"averageViewPercentage\",\n \"likes\",\n \"dislikes\",\n \"comments\",\n \"shares\",\n \"subscribersGained\",\n \"subscribersLost\",\n \"videosAddedToPlaylists\",\n \"videosRemovedFromPlaylists\",\n \"cardClicks\",\n \"cardImpressions\",\n \"cardClickRate\",\n // Demographics: with the ageGroup and/or gender dimension only.\n \"viewerPercentage\",\n] as const\n\nexport const YOUTUBE_REVENUE_METRICS = [\n \"estimatedRevenue\",\n \"estimatedAdRevenue\",\n \"grossRevenue\",\n \"estimatedRedPartnerRevenue\",\n \"monetizedPlaybacks\",\n \"playbackBasedCpm\",\n \"adImpressions\",\n \"cpm\",\n] as const\n\nexport const YOUTUBE_DIMENSIONS = [\n \"day\",\n \"month\",\n \"video\",\n \"playlist\",\n \"country\",\n \"province\",\n \"ageGroup\",\n \"gender\",\n \"deviceType\",\n \"operatingSystem\",\n \"insightTrafficSourceType\",\n \"insightPlaybackLocationType\",\n \"subscribedStatus\",\n \"youtubeProduct\",\n \"creatorContentType\",\n \"sharingService\",\n \"liveOrOnDemand\",\n] as const\n\nconst VIDEO_ID = /[A-Za-z0-9_-]{11}/\n/** The uploads playlist of a channel: UU + the channel id's tail. */\nconst UPLOADS_PLAYLIST = /UU[A-Za-z0-9_-]{22}/\nconst DAY = /[0-9]{4}-[0-9]{2}-[0-9]{2}/\nconst PAGE_TOKEN = /[A-Za-z0-9_-]{1,100}/\n/** Report filters: video, country, subscribed status, creator content type,\n * joined with `;` as the Analytics API expects. */\nconst FILTER = \"(video==[A-Za-z0-9_-]{11}|country==[A-Z]{2}|subscribedStatus==(SUBSCRIBED|UNSUBSCRIBED)|creatorContentType==[A-Z_]{1,30})\"\nconst FILTERS = new RegExp(`${FILTER}(;${FILTER}){0,3}`)\n\nfunction reportParams(metrics: readonly string[]): Record<string, ParamSpec> {\n return {\n startDate: { description: \"First day, YYYY-MM-DD\", required: true, pattern: DAY },\n endDate: { description: \"Last day, YYYY-MM-DD\", required: true, pattern: DAY },\n metrics: { description: \"Comma-separated metrics\", required: true, list: true, enum: metrics },\n dimensions: { description: \"Comma-separated dimensions, e.g. day, video, country, ageGroup,gender\", list: true, enum: YOUTUBE_DIMENSIONS },\n filters: { description: \"e.g. video==<id>, country==US, creatorContentType==SHORTS; join several with ;\", pattern: FILTERS },\n sort: { description: \"Comma-separated; a leading - sorts descending, e.g. -views\", list: true, pattern: /-?[A-Za-z]{1,40}/ },\n maxResults: { description: \"Rows (1-200), needed with the video dimension\", pattern: /[1-9][0-9]?|1[0-9]{2}|200/ },\n }\n}\n\nexport const YOUTUBE: ProviderSpec = {\n kind: \"youtube\",\n title: \"YouTube\",\n baseUrl: DATA_API,\n oauth: {\n authorizeUrl: \"https://accounts.google.com/o/oauth2/v2/auth\",\n tokenUrl: \"https://oauth2.googleapis.com/token\",\n scopes: YOUTUBE_SCOPES,\n optionalScopes: { revenue: [YOUTUBE_REVENUE_SCOPE] },\n // Without these Google sends a refresh token only on the first consent.\n authorizeParams: { access_type: \"offline\", prompt: \"consent\" },\n },\n reads: {\n channel: {\n description: \"The channel that signed in: title, subscriber, view and video counts, and its uploads playlist id (contentDetails.relatedPlaylists.uploads).\",\n path: \"/channels\",\n params: {\n part: { description: \"Comma-separated parts\", list: true, enum: [\"snippet\", \"statistics\", \"contentDetails\", \"brandingSettings\", \"status\", \"topicDetails\"], default: \"snippet,statistics,contentDetails\" },\n },\n fixedQuery: { mine: \"true\" },\n scopes: [YOUTUBE_SCOPES[0]],\n },\n uploads: {\n description: \"Recent uploads of the channel (video id, title, publish time). Use it to find video ids.\",\n path: \"/playlistItems\",\n params: {\n playlistId: { description: \"Uploads playlist id, UU… (from the `channel` read, or metadata.playlistId)\", required: true, fromMetadata: true, pattern: UPLOADS_PLAYLIST },\n maxResults: { description: \"How many items (1-50)\", pattern: /[1-9]|[1-4][0-9]|50/, default: \"25\" },\n pageToken: { description: \"nextPageToken from the previous answer\", pattern: PAGE_TOKEN },\n },\n fixedQuery: { part: \"snippet,contentDetails\" },\n scopes: [YOUTUBE_SCOPES[0]],\n },\n videos: {\n description: \"Details and public counts (views, likes, comments) for up to 50 videos, plus duration and privacy status.\",\n path: \"/videos\",\n params: {\n id: { description: \"Comma-separated video ids (from `uploads`)\", required: true, list: true, pattern: VIDEO_ID },\n part: { description: \"Comma-separated parts\", list: true, enum: [\"snippet\", \"statistics\", \"contentDetails\", \"status\"], default: \"snippet,statistics,contentDetails\" },\n },\n scopes: [YOUTUBE_SCOPES[0]],\n },\n report: {\n description: \"YouTube Analytics for the channel: views, watch time, engagement, subscribers, and audience (viewerPercentage by ageGroup,gender). Split by day, video, country, traffic source, device or Shorts (creatorContentType).\",\n baseUrl: ANALYTICS_API,\n path: \"/reports\",\n params: reportParams(YOUTUBE_METRICS),\n fixedQuery: { ids: \"channel==MINE\" },\n scopes: [YOUTUBE_SCOPES[1]],\n },\n revenue_report: {\n description: \"Estimated revenue, ad revenue, CPM and monetized playbacks. Needs `connect --with revenue` and a Partner Program channel; otherwise YouTube answers 403.\",\n baseUrl: ANALYTICS_API,\n path: \"/reports\",\n params: {\n ...reportParams(YOUTUBE_REVENUE_METRICS),\n currency: { description: \"ISO 4217 currency, e.g. USD\", pattern: /[A-Z]{3}/ },\n },\n fixedQuery: { ids: \"channel==MINE\" },\n scopes: [YOUTUBE_SCOPES[1], YOUTUBE_REVENUE_SCOPE],\n },\n },\n}\n","import type { ProviderSpec } from \"./types\"\nimport { META } from \"./meta\"\nimport { YOUTUBE } from \"./youtube\"\n\n// --- Registry of built-in provider specs ---\n//\n// One spec per outside API (#1696). Meta (Facebook Pages and Instagram)\n// is `./meta.ts`; YouTube (Data API and Analytics) is `./youtube.ts`.\n\nexport type ProviderRegistry = Readonly<Record<string, ProviderSpec>>\n\nexport const BUILTIN_PROVIDERS: ProviderRegistry = { meta: META, youtube: YOUTUBE }\n\nexport function providerFor(kind: string, providers: ProviderRegistry = BUILTIN_PROVIDERS): ProviderSpec | null {\n return Object.prototype.hasOwnProperty.call(providers, kind) ? providers[kind] : null\n}\n\nexport type { ProviderSpec, ReadSpec, ParamSpec, OAuthSpec, OAuthGrant, ProviderContext, ReadTokenRequest } from \"./types\"\n"],"mappings":"wCAAA,OAAS,cAAAA,MAAkB,SAyBpB,IAAMC,EAAqB,QAC5BC,EAAQ,8BAA8BD,IAEtCE,EAAa,cAEbC,EAAU,0BAEVC,EAAc,yCAEPC,EAAoB,CAC/B,kBACA,+BACA,eACA,qBACA,4BACA,8BACA,wBACA,mBACA,uBAEA,oCACA,oCACF,EAEaC,EAAoB,CAC/B,kBACA,+BACA,+BACA,cACA,kBACF,EAEaC,EAA0B,CACrC,QACA,QACA,qBACA,mBACA,QACA,WACA,SACA,QACA,UACA,wBACA,qBACA,iBACA,wBACA,+BACF,EAEaC,EAAwB,CACnC,QACA,QACA,qBACA,QACA,WACA,SACA,QACA,iBACA,UACA,0BACA,gCACF,EAEaC,EAAc,CACzB,kBACA,wBACA,gBACA,kBACA,2BACF,EAGMC,EAAmB,IAAI,IAAI,CAAC,gBAAiB,aAAc,eAAe,CAAC,EAEjF,eAAeC,EAASC,EAAiBC,EAAcC,EAA+BC,EAA6B,CACjH,IAAMC,EAAI,IAAI,IAAIf,EAAQY,CAAI,EAC9B,OAAW,CAACI,EAAGC,CAAC,IAAK,OAAO,QAAQJ,CAAK,EAAGE,EAAE,aAAa,IAAIC,EAAGC,CAAC,EACnE,IAAMC,EAAM,MAAMP,EAAEI,EAAE,SAAS,EAAG,CAChC,OAAQ,MACR,QAAS,CAAE,OAAQ,mBAAoB,cAAe,UAAUD,GAAQ,EACxE,OAAQ,YAAY,QAAQ,IAAM,EAClC,SAAU,OACZ,CAAC,EACKK,EAAO,MAAMD,EAAI,KAAK,EACxBE,EACJ,GAAI,CAAEA,EAAO,KAAK,MAAMD,CAAI,CAAE,MAAE,CAAQC,EAAO,CAAC,CAAE,CAClD,GAAI,CAACF,EAAI,GAAI,CACX,IAAMG,EAAMD,GAAM,OAAO,SAAW,QAAQF,EAAI,SAChD,MAAM,IAAI,MA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CAAQ,EAE3E,SAASC,GAAYC,EAAcC,EAA8BL,EAAwC,CAC9G,OAAO,OAAO,UAAU,eAAe,KAAKK,EAAWD,CAAI,EAAIC,EAAUD,CAAI,EAAI,IACnF","names":["createHash","META_GRAPH_VERSION","GRAPH","NUMERIC_ID","POST_ID","DAY_OR_UNIX","META_PAGE_METRICS","META_POST_METRICS","META_IG_ACCOUNT_METRICS","META_IG_MEDIA_METRICS","META_SCOPES","PAGE_TOKEN_READS","graphGet","f","path","query","token","u","k","v","res","text","data","why","safeProviderText","metaAfterConnect","grant","ctx","expiresIn","accessToken","scopes","perms","p","e","PAGE_TOKEN_TTL_MS","PAGE_TOKEN_MAX","pageTokens","pageIdFor","read","values","metaReadToken","req","PAGE_TOKEN_READS","pageId","key","createHash","hit","pageTokens","data","graphGet","e","token","PAGE_TOKEN_MAX","PAGE_TOKEN_TTL_MS","since","DAY_OR_UNIX","until","META","GRAPH","META_GRAPH_VERSION","META_SCOPES","metaAfterConnect","NUMERIC_ID","META_PAGE_METRICS","POST_ID","META_POST_METRICS","META_IG_ACCOUNT_METRICS","META_IG_MEDIA_METRICS","DATA_API","ANALYTICS_API","YOUTUBE_SCOPES","YOUTUBE_REVENUE_SCOPE","YOUTUBE_METRICS","YOUTUBE_REVENUE_METRICS","YOUTUBE_DIMENSIONS","VIDEO_ID","UPLOADS_PLAYLIST","DAY","PAGE_TOKEN","FILTER","FILTERS","reportParams","metrics","YOUTUBE","BUILTIN_PROVIDERS","META","YOUTUBE","providerFor","kind","providers"]}
|