@wirecat/mail-cli 0.38.0 → 0.39.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/CHANGELOG.md +27 -0
- package/README.md +9 -7
- package/contracts/wirecat.json +63 -2
- package/dist/bin/mail.js +11 -11
- package/dist/bundle/{chunk-HIKPVWCL.js → chunk-BXH2YUBR.js} +32 -5
- package/dist/bundle/mail.js +4 -166
- package/dist/bundle/program-ZSF2VJI6.js +17329 -0
- package/dist/commands/account-remove.js +1 -2
- package/dist/commands/account.js +1 -1
- package/dist/commands/attachments.js +1 -2
- package/dist/commands/context.js +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/drafts-send.js +1 -2
- package/dist/commands/drafts.js +1 -2
- package/dist/commands/export.js +1 -2
- package/dist/commands/folders.js +1 -2
- package/dist/commands/import.js +1 -1
- package/dist/commands/messages.js +1 -1
- package/dist/commands/organising.js +1 -2
- package/dist/commands/read.js +2 -4
- package/dist/commands/restore.js +1 -1
- package/dist/commands/rules.js +1 -2
- package/dist/commands/send.js +1 -2
- package/dist/commands/session-start.js +1 -1
- package/dist/commands/session.js +1 -1
- package/dist/commands/stats.js +1 -1
- package/dist/commands/status.js +3 -5
- package/dist/commands/sync.js +1 -1
- package/dist/commands/tags.js +1 -2
- package/dist/config.js +1 -1
- package/dist/identity.js +26 -0
- package/dist/mail/changes.js +3 -2
- package/dist/mail/cleanup.js +3 -2
- package/dist/mail/domain-age.js +1 -1
- package/dist/mail/memo-trash.js +47 -0
- package/dist/mail/organise.js +1 -1
- package/dist/mail/save.js +1 -1
- package/dist/mail/send.js +1 -1
- package/dist/oauth.js +1 -3
- package/dist/profile.js +1 -1
- package/dist/program.js +1 -2
- package/dist/providers.js +4 -4
- package/dist/store.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/dist/bin/mail.d.ts +0 -3
- package/dist/bin/mail.d.ts.map +0 -1
- package/dist/bin/mail.js.map +0 -1
- package/dist/bundle/agent-U43CYLAP.js +0 -41
- package/dist/bundle/all-profiles-OCUZMXMI.js +0 -320
- package/dist/bundle/anthropic-CABWJABQ.js +0 -90
- package/dist/bundle/app-server-TTWPIGWG.js +0 -257
- package/dist/bundle/bun-F4M4KCNA.js +0 -169
- package/dist/bundle/bun-sqlite-YKYG25CR.js +0 -75
- package/dist/bundle/chunk-24UGTK32.js +0 -185
- package/dist/bundle/chunk-2HDXD6LM.js +0 -615
- package/dist/bundle/chunk-2SQLHBDP.js +0 -54
- package/dist/bundle/chunk-2YO3PLOE.js +0 -2843
- package/dist/bundle/chunk-3TYER5IK.js +0 -80
- package/dist/bundle/chunk-4FXDUXZP.js +0 -192
- package/dist/bundle/chunk-5ICUC66S.js +0 -76
- package/dist/bundle/chunk-725OPCHI.js +0 -4070
- package/dist/bundle/chunk-77YTUOKN.js +0 -1255
- package/dist/bundle/chunk-7ECP5ZQR.js +0 -2
- package/dist/bundle/chunk-7EJWHADX.js +0 -323
- package/dist/bundle/chunk-7KO5FSAW.js +0 -64
- package/dist/bundle/chunk-A3KNH3Q4.js +0 -353
- package/dist/bundle/chunk-AGO3OVKW.js +0 -40856
- package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
- package/dist/bundle/chunk-BA5B5ZF4.js +0 -12177
- package/dist/bundle/chunk-C4PUDTGD.js +0 -106
- package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
- package/dist/bundle/chunk-CJJFOT7W.js +0 -52
- package/dist/bundle/chunk-CLTFTGBP.js +0 -560
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DKGKPJA3.js +0 -3752
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-DYCE72XB.js +0 -794
- package/dist/bundle/chunk-EDWY73H7.js +0 -133
- package/dist/bundle/chunk-EJQAP6A6.js +0 -1007
- package/dist/bundle/chunk-ESNZL7SB.js +0 -330
- package/dist/bundle/chunk-FFER7KJI.js +0 -407
- package/dist/bundle/chunk-FTH6WGYO.js +0 -24
- package/dist/bundle/chunk-FWGNDKJK.js +0 -195
- package/dist/bundle/chunk-G46PNDWL.js +0 -58
- package/dist/bundle/chunk-G5HG7ZWQ.js +0 -1169
- package/dist/bundle/chunk-G6NY7LFB.js +0 -230
- package/dist/bundle/chunk-GMWKNWWY.js +0 -388
- package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
- package/dist/bundle/chunk-HFDDVGDH.js +0 -9512
- package/dist/bundle/chunk-HFRH5YJ6.js +0 -86
- package/dist/bundle/chunk-HI6MTNID.js +0 -338
- package/dist/bundle/chunk-HO4JGD4Q.js +0 -16
- package/dist/bundle/chunk-HTQTIKWP.js +0 -928
- package/dist/bundle/chunk-HUAHLO6N.js +0 -29
- package/dist/bundle/chunk-HYUUAH2N.js +0 -188
- package/dist/bundle/chunk-I4AWLFYH.js +0 -377
- package/dist/bundle/chunk-I4PZOWYG.js +0 -334
- package/dist/bundle/chunk-IDCZ4LWS.js +0 -150
- package/dist/bundle/chunk-ISQ23VKV.js +0 -123
- package/dist/bundle/chunk-KLRCTMES.js +0 -100
- package/dist/bundle/chunk-KP5JDYY6.js +0 -2669
- package/dist/bundle/chunk-KYRYD4CR.js +0 -38
- package/dist/bundle/chunk-LB2CF3GG.js +0 -730
- package/dist/bundle/chunk-LC7ZD2RW.js +0 -92
- package/dist/bundle/chunk-M65NILSA.js +0 -259
- package/dist/bundle/chunk-NQFG7AES.js +0 -364
- package/dist/bundle/chunk-OAO3JKQD.js +0 -463
- package/dist/bundle/chunk-OEEWVKJX.js +0 -53
- package/dist/bundle/chunk-OVHC7OV4.js +0 -218
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-PT4VLN3K.js +0 -161
- package/dist/bundle/chunk-QETNCUWB.js +0 -1703
- package/dist/bundle/chunk-QK3Z7BCC.js +0 -95
- package/dist/bundle/chunk-QWF3TFW4.js +0 -1342
- package/dist/bundle/chunk-RHEDE7D4.js +0 -80
- package/dist/bundle/chunk-RI5YZ23Y.js +0 -1068
- package/dist/bundle/chunk-ROUZN6UQ.js +0 -1997
- package/dist/bundle/chunk-RQD7CAGF.js +0 -288
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-SBLHQAH3.js +0 -360
- package/dist/bundle/chunk-SXLIADMY.js +0 -52
- package/dist/bundle/chunk-SYCM6SQ5.js +0 -2470
- package/dist/bundle/chunk-T3W4V4A6.js +0 -63
- package/dist/bundle/chunk-TCT5D2X2.js +0 -6848
- package/dist/bundle/chunk-TES7MB6I.js +0 -82
- package/dist/bundle/chunk-TQDSBLQB.js +0 -2
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-UGFMQWAZ.js +0 -1044
- package/dist/bundle/chunk-VA6PHTMV.js +0 -690
- package/dist/bundle/chunk-VK24UQSD.js +0 -142
- package/dist/bundle/chunk-VUHH4MQW.js +0 -73464
- package/dist/bundle/chunk-W3BOR6AT.js +0 -2333
- package/dist/bundle/chunk-WA53OJ7V.js +0 -160
- package/dist/bundle/chunk-XGVMQMTS.js +0 -1197
- package/dist/bundle/chunk-XQUUANA2.js +0 -24600
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YP4FYLFI.js +0 -170
- package/dist/bundle/chunk-ZDBWBCEO.js +0 -108
- package/dist/bundle/chunk-ZKVUAH5N.js +0 -274
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/command-contract-V2WIL6RL.js +0 -40
- package/dist/bundle/command-server-entry-ZC5YF4EC.js +0 -169
- package/dist/bundle/decode-NXAGEUAD.js +0 -296
- package/dist/bundle/dispatch-USKS7J74.js +0 -411
- package/dist/bundle/dist-HFUVURJG.js +0 -7577
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/dist-XN2CRP3U.js +0 -318
- package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
- package/dist/bundle/embed-3P3LSM2O.js +0 -37
- package/dist/bundle/embedder-2SANUF2X.js +0 -110
- package/dist/bundle/failure-D4FGOIWF.js +0 -24
- package/dist/bundle/first-run-HEZKQLJL.js +0 -28
- package/dist/bundle/first-screen-7TQZ4I6X.js +0 -41
- package/dist/bundle/instructions-4H7UREH2.js +0 -11
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-HF2NL4PU.js +0 -26
- package/dist/bundle/meeting-model-B7RVFB7L.js +0 -24
- package/dist/bundle/meeting-semantic-YQTL7YVQ.js +0 -21
- package/dist/bundle/node-KM3CUABH.js +0 -2340
- package/dist/bundle/node-P3PUHKYH.js +0 -176
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-OFHTCHJH.js +0 -73
- package/dist/bundle/oauth-IVB5RP7T.js +0 -19
- package/dist/bundle/open-KDGDLCWV.js +0 -22
- package/dist/bundle/openai-NVUBKA7Z.js +0 -237
- package/dist/bundle/process-AFIXYXWL.js +0 -91
- package/dist/bundle/program-JQ7EFODJ.js +0 -47008
- package/dist/bundle/prompt-QG7FC2SA.js +0 -16
- package/dist/bundle/public-FBD7MQUM.js +0 -204
- package/dist/bundle/recognize-ZBR5KNID.js +0 -25
- package/dist/bundle/remote-QOTHNO2M.js +0 -30
- package/dist/bundle/rerank-JD2NIUW6.js +0 -51
- package/dist/bundle/serve-QZT3FKK7.js +0 -198
- package/dist/bundle/server-M6JJ7IKS.js +0 -219
- package/dist/bundle/server-TAMXMWK6.js +0 -87
- package/dist/bundle/sqlite-runtime-N2PY7C7J.js +0 -19
- package/dist/bundle/state-OGRUMU7P.js +0 -35
- package/dist/bundle/store-7UE63OQR.js +0 -313
- package/dist/bundle/store-DGJKE4ZJ.js +0 -186
- package/dist/bundle/store-maintenance-command-WIDKMZLK.js +0 -74
- package/dist/bundle/surface-LTEEEZU4.js +0 -73
- package/dist/commands/account-remove.d.ts +0 -3
- package/dist/commands/account-remove.d.ts.map +0 -1
- package/dist/commands/account-remove.js.map +0 -1
- package/dist/commands/account.d.ts +0 -3
- package/dist/commands/account.d.ts.map +0 -1
- package/dist/commands/account.js.map +0 -1
- package/dist/commands/attachments.d.ts +0 -3
- package/dist/commands/attachments.d.ts.map +0 -1
- package/dist/commands/attachments.js.map +0 -1
- package/dist/commands/context.d.ts +0 -79
- package/dist/commands/context.d.ts.map +0 -1
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -68
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/drafts-send.d.ts +0 -7
- package/dist/commands/drafts-send.d.ts.map +0 -1
- package/dist/commands/drafts-send.js.map +0 -1
- package/dist/commands/drafts.d.ts +0 -3
- package/dist/commands/drafts.d.ts.map +0 -1
- package/dist/commands/drafts.js.map +0 -1
- package/dist/commands/export.d.ts +0 -3
- package/dist/commands/export.d.ts.map +0 -1
- package/dist/commands/export.js.map +0 -1
- package/dist/commands/folders.d.ts +0 -3
- package/dist/commands/folders.d.ts.map +0 -1
- package/dist/commands/folders.js.map +0 -1
- package/dist/commands/import.d.ts +0 -3
- package/dist/commands/import.d.ts.map +0 -1
- package/dist/commands/import.js.map +0 -1
- package/dist/commands/login.d.ts +0 -5
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/mailbox.d.ts +0 -17
- package/dist/commands/mailbox.d.ts.map +0 -1
- package/dist/commands/mailbox.js.map +0 -1
- package/dist/commands/messages.d.ts +0 -4
- package/dist/commands/messages.d.ts.map +0 -1
- package/dist/commands/messages.js.map +0 -1
- package/dist/commands/organising.d.ts +0 -98
- package/dist/commands/organising.d.ts.map +0 -1
- package/dist/commands/organising.js.map +0 -1
- package/dist/commands/read.d.ts +0 -6
- package/dist/commands/read.d.ts.map +0 -1
- package/dist/commands/read.js.map +0 -1
- package/dist/commands/restore.d.ts +0 -3
- package/dist/commands/restore.d.ts.map +0 -1
- package/dist/commands/restore.js.map +0 -1
- package/dist/commands/rules.d.ts +0 -3
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js.map +0 -1
- package/dist/commands/send.d.ts +0 -51
- package/dist/commands/send.d.ts.map +0 -1
- package/dist/commands/send.js.map +0 -1
- package/dist/commands/server-search.d.ts +0 -8
- package/dist/commands/server-search.d.ts.map +0 -1
- package/dist/commands/server-search.js.map +0 -1
- package/dist/commands/session-start.d.ts +0 -3
- package/dist/commands/session-start.d.ts.map +0 -1
- package/dist/commands/session-start.js.map +0 -1
- package/dist/commands/session.d.ts +0 -3
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -3
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -11
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/tags.d.ts +0 -3
- package/dist/commands/tags.d.ts.map +0 -1
- package/dist/commands/tags.js.map +0 -1
- package/dist/commands/words.d.ts +0 -8
- package/dist/commands/words.d.ts.map +0 -1
- package/dist/commands/words.js.map +0 -1
- package/dist/config.d.ts +0 -239
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/discovery.d.ts +0 -31
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js.map +0 -1
- package/dist/export/format.d.ts +0 -19
- package/dist/export/format.d.ts.map +0 -1
- package/dist/export/format.js.map +0 -1
- package/dist/export/journal.d.ts +0 -34
- package/dist/export/journal.d.ts.map +0 -1
- package/dist/export/journal.js.map +0 -1
- package/dist/export/write.d.ts +0 -14
- package/dist/export/write.d.ts.map +0 -1
- package/dist/export/write.js.map +0 -1
- package/dist/identity.d.ts +0 -7
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js.map +0 -1
- package/dist/mail/backend.d.ts +0 -138
- package/dist/mail/backend.d.ts.map +0 -1
- package/dist/mail/backend.js.map +0 -1
- package/dist/mail/changes.d.ts +0 -99
- package/dist/mail/changes.d.ts.map +0 -1
- package/dist/mail/changes.js.map +0 -1
- package/dist/mail/cleanup.d.ts +0 -41
- package/dist/mail/cleanup.d.ts.map +0 -1
- package/dist/mail/cleanup.js.map +0 -1
- package/dist/mail/compose.d.ts +0 -75
- package/dist/mail/compose.d.ts.map +0 -1
- package/dist/mail/compose.js.map +0 -1
- package/dist/mail/domain-age.d.ts +0 -29
- package/dist/mail/domain-age.d.ts.map +0 -1
- package/dist/mail/domain-age.js.map +0 -1
- package/dist/mail/drafts.d.ts +0 -54
- package/dist/mail/drafts.d.ts.map +0 -1
- package/dist/mail/drafts.js.map +0 -1
- package/dist/mail/imap/account.d.ts +0 -5
- package/dist/mail/imap/account.d.ts.map +0 -1
- package/dist/mail/imap/account.js.map +0 -1
- package/dist/mail/imap/connection.d.ts +0 -72
- package/dist/mail/imap/connection.d.ts.map +0 -1
- package/dist/mail/imap/connection.js.map +0 -1
- package/dist/mail/imap/errors.d.ts +0 -11
- package/dist/mail/imap/errors.d.ts.map +0 -1
- package/dist/mail/imap/errors.js.map +0 -1
- package/dist/mail/imap/index.d.ts +0 -7
- package/dist/mail/imap/index.d.ts.map +0 -1
- package/dist/mail/imap/index.js.map +0 -1
- package/dist/mail/imap/messages.d.ts +0 -17
- package/dist/mail/imap/messages.d.ts.map +0 -1
- package/dist/mail/imap/messages.js.map +0 -1
- package/dist/mail/imap/read.d.ts +0 -7
- package/dist/mail/imap/read.d.ts.map +0 -1
- package/dist/mail/imap/read.js.map +0 -1
- package/dist/mail/imap/search.d.ts +0 -19
- package/dist/mail/imap/search.d.ts.map +0 -1
- package/dist/mail/imap/search.js.map +0 -1
- package/dist/mail/imap/write.d.ts +0 -5
- package/dist/mail/imap/write.d.ts.map +0 -1
- package/dist/mail/imap/write.js.map +0 -1
- package/dist/mail/locate.d.ts +0 -32
- package/dist/mail/locate.d.ts.map +0 -1
- package/dist/mail/locate.js.map +0 -1
- package/dist/mail/mbox.d.ts +0 -9
- package/dist/mail/mbox.d.ts.map +0 -1
- package/dist/mail/mbox.js.map +0 -1
- package/dist/mail/organise.d.ts +0 -101
- package/dist/mail/organise.d.ts.map +0 -1
- package/dist/mail/organise.js.map +0 -1
- package/dist/mail/restore.d.ts +0 -22
- package/dist/mail/restore.d.ts.map +0 -1
- package/dist/mail/restore.js.map +0 -1
- package/dist/mail/rethread.d.ts +0 -14
- package/dist/mail/rethread.d.ts.map +0 -1
- package/dist/mail/rethread.js.map +0 -1
- package/dist/mail/rules/apply.d.ts +0 -48
- package/dist/mail/rules/apply.d.ts.map +0 -1
- package/dist/mail/rules/apply.js.map +0 -1
- package/dist/mail/rules/file.d.ts +0 -9
- package/dist/mail/rules/file.d.ts.map +0 -1
- package/dist/mail/rules/file.js.map +0 -1
- package/dist/mail/rules/filters.d.ts +0 -11
- package/dist/mail/rules/filters.d.ts.map +0 -1
- package/dist/mail/rules/filters.js.map +0 -1
- package/dist/mail/rules/folders.d.ts +0 -11
- package/dist/mail/rules/folders.d.ts.map +0 -1
- package/dist/mail/rules/folders.js.map +0 -1
- package/dist/mail/rules/query.d.ts +0 -16
- package/dist/mail/rules/query.d.ts.map +0 -1
- package/dist/mail/rules/query.js.map +0 -1
- package/dist/mail/rules/store.d.ts +0 -9
- package/dist/mail/rules/store.d.ts.map +0 -1
- package/dist/mail/rules/store.js.map +0 -1
- package/dist/mail/save.d.ts +0 -9
- package/dist/mail/save.d.ts.map +0 -1
- package/dist/mail/save.js.map +0 -1
- package/dist/mail/send-as.d.ts +0 -21
- package/dist/mail/send-as.d.ts.map +0 -1
- package/dist/mail/send-as.js.map +0 -1
- package/dist/mail/send.d.ts +0 -76
- package/dist/mail/send.d.ts.map +0 -1
- package/dist/mail/send.js.map +0 -1
- package/dist/mail/smtp.d.ts +0 -4
- package/dist/mail/smtp.d.ts.map +0 -1
- package/dist/mail/smtp.js.map +0 -1
- package/dist/oauth.d.ts +0 -75
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js.map +0 -1
- package/dist/profile.d.ts +0 -20
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js.map +0 -1
- package/dist/program.d.ts +0 -6
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js.map +0 -1
- package/dist/providers.d.ts +0 -255
- package/dist/providers.d.ts.map +0 -1
- package/dist/providers.js.map +0 -1
- package/dist/reasons.d.ts +0 -9
- package/dist/reasons.d.ts.map +0 -1
- package/dist/reasons.js.map +0 -1
- package/dist/secret.d.ts +0 -31
- package/dist/secret.d.ts.map +0 -1
- package/dist/secret.js.map +0 -1
- package/dist/store.d.ts +0 -12
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/wcat.d.ts +0 -3
- package/dist/wcat.d.ts.map +0 -1
- package/dist/wcat.js.map +0 -1
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
isCliFailure
|
|
5
|
-
} from "./chunk-3TYER5IK.js";
|
|
6
|
-
import {
|
|
7
|
-
secretNamed,
|
|
8
|
-
withoutSecrets
|
|
9
|
-
} from "./chunk-LC7ZD2RW.js";
|
|
10
|
-
import {
|
|
11
|
-
isContentKey
|
|
12
|
-
} from "./chunk-2YO3PLOE.js";
|
|
13
|
-
import {
|
|
14
|
-
__name
|
|
15
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
16
|
-
|
|
17
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
18
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
19
|
-
import { createHash } from "node:crypto";
|
|
20
|
-
|
|
21
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
22
|
-
import { homedir } from "node:os";
|
|
23
|
-
|
|
24
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/runs/events.js
|
|
25
|
-
var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
|
|
26
|
-
var renderEvent = /* @__PURE__ */ __name((event) => {
|
|
27
|
-
if (event.event === "store")
|
|
28
|
-
return `${MARK.store} ${event.operation.padEnd(16)} ${event.table} ${event.op} ${event.n}`;
|
|
29
|
-
if (event.event === "progress")
|
|
30
|
-
return `${MARK.progress} ${event.operation.padEnd(16)} ${Object.entries(event.counts).map(([field, count]) => `${count} ${field}`).join(" ")}`;
|
|
31
|
-
if (event.event === "warning") {
|
|
32
|
-
const counts = Object.entries(event.counts ?? {}).map(([field, count]) => `${count} ${field}`);
|
|
33
|
-
return [`${MARK.warning} ${(event.operation ?? "").padEnd(16)} ${event.code}`, ...counts, event.detail].filter(Boolean).join(" ");
|
|
34
|
-
}
|
|
35
|
-
const parts = [];
|
|
36
|
-
if (event.event === "cache") {
|
|
37
|
-
parts.push(event.reason);
|
|
38
|
-
if (event.ageMs !== void 0)
|
|
39
|
-
parts.push(`cached ${age(event.ageMs)}`);
|
|
40
|
-
} else {
|
|
41
|
-
if (event.opcode !== void 0)
|
|
42
|
-
parts.push(`op ${event.opcode}`, `seq ${event.seq}`);
|
|
43
|
-
if (event.method !== void 0 || event.endpointTemplate !== void 0)
|
|
44
|
-
parts.push([event.method, event.endpointTemplate].filter(Boolean).join(" "));
|
|
45
|
-
if (event.status !== void 0)
|
|
46
|
-
parts.push(`${event.status}`);
|
|
47
|
-
if (event.attempt !== void 0 && event.attempt > 1)
|
|
48
|
-
parts.push(`attempt ${event.attempt}`);
|
|
49
|
-
if (event.waitMs !== void 0)
|
|
50
|
-
parts.push(`waited ${age(event.waitMs)}`);
|
|
51
|
-
}
|
|
52
|
-
if (event.ids)
|
|
53
|
-
for (const [name, value] of Object.entries(event.ids))
|
|
54
|
-
parts.push(`${name} ${value}`);
|
|
55
|
-
if (event.event !== "cache") {
|
|
56
|
-
if (event.durationMs !== void 0)
|
|
57
|
-
parts.push(`${event.durationMs}ms`);
|
|
58
|
-
if (event.bytes !== void 0)
|
|
59
|
-
parts.push(size(event.bytes));
|
|
60
|
-
}
|
|
61
|
-
if (event.counts)
|
|
62
|
-
for (const [field, count] of Object.entries(event.counts))
|
|
63
|
-
parts.push(`${count} ${field}`);
|
|
64
|
-
if (event.event !== "cache") {
|
|
65
|
-
if (event.errorCode)
|
|
66
|
-
parts.push(event.errorCode);
|
|
67
|
-
if (event.providerError)
|
|
68
|
-
parts.push(event.providerError);
|
|
69
|
-
}
|
|
70
|
-
return `${MARK[event.event]} ${event.operation.padEnd(16)} ${parts.join(" ")}`.trimEnd();
|
|
71
|
-
}, "renderEvent");
|
|
72
|
-
var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!", store: "+", progress: "\u2026" };
|
|
73
|
-
var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
|
|
74
|
-
var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
|
|
75
|
-
|
|
76
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
77
|
-
var MESSAGE_AT_MOST = 500;
|
|
78
|
-
var CAUSES_AT_MOST = 5;
|
|
79
|
-
var FRAMES_AT_MOST = 15;
|
|
80
|
-
var errorDetailOf = /* @__PURE__ */ __name((error, response) => {
|
|
81
|
-
const details = isCliFailure(error) ? { ...error.details } : {};
|
|
82
|
-
const thrown = error instanceof Error ? error : void 0;
|
|
83
|
-
const code = isCliFailure(error) ? error.code : codeOf(error);
|
|
84
|
-
const reason = typeof details.reason === "string" ? details.reason : void 0;
|
|
85
|
-
const causeCode = typeof details.cause_code === "string" && /^[A-Za-z0-9_.-]{1,40}$/.test(details.cause_code) ? details.cause_code : void 0;
|
|
86
|
-
const message = thrown ? redactText(thrown.message) : void 0;
|
|
87
|
-
const operation = stringOf(details.operation) ?? response?.operation;
|
|
88
|
-
const status = numberOf(details.status) ?? response?.status;
|
|
89
|
-
const method = stringOf(details.method) ?? response?.method;
|
|
90
|
-
const endpoint = stringOf(details.endpoint) ?? response?.endpointTemplate;
|
|
91
|
-
const key = providerErrorKey(details.provider_error) ?? providerErrorKey(response?.providerError);
|
|
92
|
-
const protocol = key !== void 0 && method === void 0 && endpoint === void 0;
|
|
93
|
-
const http = method !== void 0 || endpoint !== void 0 || status !== void 0 && !protocol ? {
|
|
94
|
-
...method === void 0 ? {} : { method: method.toUpperCase().slice(0, 16) },
|
|
95
|
-
...endpoint === void 0 ? {} : { endpoint_template: endpointTemplate(endpoint) },
|
|
96
|
-
...status === void 0 ? {} : { status }
|
|
97
|
-
} : void 0;
|
|
98
|
-
const causes = causesOf(thrown?.cause ?? details.cause);
|
|
99
|
-
const stack = framesOf(thrown);
|
|
100
|
-
return {
|
|
101
|
-
class: classOf(error),
|
|
102
|
-
...code === void 0 ? {} : { code },
|
|
103
|
-
...reason === void 0 ? {} : { reason },
|
|
104
|
-
...causeCode === void 0 ? {} : { cause_code: causeCode },
|
|
105
|
-
...message ? { message } : {},
|
|
106
|
-
...operation === void 0 ? {} : { operation },
|
|
107
|
-
...http ? { http } : {},
|
|
108
|
-
...key === void 0 ? {} : { provider: { key, ...protocol && status !== void 0 ? { code: status } : {} } },
|
|
109
|
-
...causes.length > 0 ? { causes } : {},
|
|
110
|
-
...stack.length > 0 ? { stack } : {}
|
|
111
|
-
};
|
|
112
|
-
}, "errorDetailOf");
|
|
113
|
-
var stringOf = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value.trim() : void 0, "stringOf");
|
|
114
|
-
var numberOf = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isInteger(value) ? value : void 0, "numberOf");
|
|
115
|
-
var classOf = /* @__PURE__ */ __name((error) => {
|
|
116
|
-
if (!(error instanceof Error))
|
|
117
|
-
return error === null ? "null" : typeof error;
|
|
118
|
-
const constructed = error.constructor?.name;
|
|
119
|
-
return constructed && constructed !== "Error" && constructed !== error.name ? constructed : error.name;
|
|
120
|
-
}, "classOf");
|
|
121
|
-
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
122
|
-
const code = error?.code;
|
|
123
|
-
return typeof code === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(code) ? code : void 0;
|
|
124
|
-
}, "codeOf");
|
|
125
|
-
var causesOf = /* @__PURE__ */ __name((first) => {
|
|
126
|
-
const causes = [];
|
|
127
|
-
const seen = /* @__PURE__ */ new Set();
|
|
128
|
-
for (let cause = first; cause !== void 0 && cause !== null && causes.length < CAUSES_AT_MOST; ) {
|
|
129
|
-
if (seen.has(cause))
|
|
130
|
-
break;
|
|
131
|
-
seen.add(cause);
|
|
132
|
-
const message = cause instanceof Error ? redactText(cause.message) : void 0;
|
|
133
|
-
causes.push({ class: classOf(cause), ...message ? { message } : {} });
|
|
134
|
-
cause = cause instanceof Error ? cause.cause : void 0;
|
|
135
|
-
}
|
|
136
|
-
return causes;
|
|
137
|
-
}, "causesOf");
|
|
138
|
-
var framesOf = /* @__PURE__ */ __name((error, limit = FRAMES_AT_MOST) => {
|
|
139
|
-
const stack = error instanceof Error && typeof error.stack === "string" ? error.stack : "";
|
|
140
|
-
return stack.split("\n").filter((line) => line.trimStart().startsWith("at ")).flatMap((line) => {
|
|
141
|
-
const match = /^\s*at (?:async )?(?:(.+?) \()?(.+?):(\d+):\d+\)?$/.exec(line);
|
|
142
|
-
if (!match)
|
|
143
|
-
return [];
|
|
144
|
-
const [, fn, path = "", lineNumber] = match;
|
|
145
|
-
if (path.startsWith("node:"))
|
|
146
|
-
return [];
|
|
147
|
-
return [`${fn ?? "<anonymous>"} ${fileOf(path)}:${lineNumber}`];
|
|
148
|
-
}).slice(0, limit);
|
|
149
|
-
}, "framesOf");
|
|
150
|
-
var fileOf = /* @__PURE__ */ __name((path) => {
|
|
151
|
-
const plain = path.replace(/^file:\/\//, "");
|
|
152
|
-
const packaged = /\/node_modules\/((?:@[^/]+\/)?[^/]+\/.+)$/.exec(plain)?.[1];
|
|
153
|
-
if (packaged)
|
|
154
|
-
return packaged.replace(/\/(?:dist|src)\//, "/");
|
|
155
|
-
return /(?:^|\/)(?:dist|src)\/(.+)$/.exec(plain)?.[1] ?? plain.split("/").at(-1) ?? "?";
|
|
156
|
-
}, "fileOf");
|
|
157
|
-
var endpointTemplate = /* @__PURE__ */ __name((raw) => {
|
|
158
|
-
const trimmed = raw.trim().split(/[?#]/)[0] ?? "";
|
|
159
|
-
const origin = /^[a-z][a-z0-9+.-]*:\/\/(?:[^@/]*@)?([^/]*)/i.exec(trimmed);
|
|
160
|
-
const path = origin ? trimmed.slice(origin[0].length) : trimmed;
|
|
161
|
-
const scheme = origin ? `${trimmed.slice(0, trimmed.indexOf("://"))}://${origin[1]}` : "";
|
|
162
|
-
const parts = path.split("/");
|
|
163
|
-
const segments = parts.map((segment, at) => {
|
|
164
|
-
if (segment === "" || /^[:{].+/.test(segment))
|
|
165
|
-
return segment;
|
|
166
|
-
if (at >= 2 && parts[at - 2] === "rest" && /^\d+$/.test(parts[at - 1] ?? ""))
|
|
167
|
-
return ":token";
|
|
168
|
-
if (/^bot\d+:/.test(segment) || /^\d{6,}:[\w-]{20,}$/.test(segment))
|
|
169
|
-
return ":token";
|
|
170
|
-
if (/^-?\d+$/.test(segment) || /^[0-9a-f-]{16,}$/i.test(segment))
|
|
171
|
-
return ":id";
|
|
172
|
-
if (!/^[A-Za-z0-9._~-]{1,40}$/.test(segment))
|
|
173
|
-
return ":value";
|
|
174
|
-
return segment;
|
|
175
|
-
});
|
|
176
|
-
return `${scheme}${segments.join("/")}`.slice(0, 300);
|
|
177
|
-
}, "endpointTemplate");
|
|
178
|
-
var INTERNATIONAL_PHONE = /\+\d[\d\s()-]{6,}\d/.source;
|
|
179
|
-
var BARE_PHONE = /(^|[^\w-])\d{11,15}\b/.source;
|
|
180
|
-
var MESSENGER_ID = /\b\d+(?:-\d+)?(?::\d+)?@(?:s\.whatsapp\.net|g\.us|c\.us|lid|broadcast|newsletter)\b/g;
|
|
181
|
-
var redactText = /* @__PURE__ */ __name((text) => {
|
|
182
|
-
const home = homedir();
|
|
183
|
-
let out = home && home !== "/" ? text.split(home).join("~") : text;
|
|
184
|
-
out = withoutSecrets(out.replace(/"[^"\n]*"|“[^”\n]*”|«[^»\n]*»/g, '"[redacted]"')).replace(/\b(bearer|basic|token|key|password|secret)(\s*[:=]\s*|\s+)[^\s'"]+/gi, "$1$2[redacted]").replace(MESSENGER_ID, "[id]").replace(/[\w.+-]+@[\w-]+\.[\w.-]+/g, "[email]").replace(new RegExp(INTERNATIONAL_PHONE, "g"), "[number]").replace(new RegExp(BARE_PHONE, "g"), "$1[number]").replace(/\bbot\d+:[\w-]+/g, "bot[token]").replace(/\b\d{6,}:[\w-]{20,}\b/g, "[token]").replace(/(\?|&)[^\s#]*/g, "$1[redacted]").replace(/\b[A-Za-z0-9_-]{40,}\b/g, "[redacted]");
|
|
185
|
-
return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
|
|
186
|
-
}, "redactText");
|
|
187
|
-
|
|
188
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
189
|
-
var REDACTED = "[redacted]";
|
|
190
|
-
var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
|
|
191
|
-
if (!record)
|
|
192
|
-
return false;
|
|
193
|
-
if (fromFlag)
|
|
194
|
-
return true;
|
|
195
|
-
if (persistent)
|
|
196
|
-
return false;
|
|
197
|
-
return caller !== void 0 || viaOf(env) !== "desktop";
|
|
198
|
-
}, "keepsSuccess");
|
|
199
|
-
var calls = new AsyncLocalStorage();
|
|
200
|
-
var withCaller = /* @__PURE__ */ __name((caller, work) => calls.run(caller, work), "withCaller");
|
|
201
|
-
var currentCaller = /* @__PURE__ */ __name(() => calls.getStore(), "currentCaller");
|
|
202
|
-
var clientHash = /* @__PURE__ */ __name((id) => createHash("sha256").update(id).digest("hex").slice(0, 8), "clientHash");
|
|
203
|
-
var viaOf = /* @__PURE__ */ __name((env) => env.WIRECAT_CALLER?.trim() === "desktop" ? "desktop" : "cli", "viaOf");
|
|
204
|
-
var agentOf = /* @__PURE__ */ __name((env) => {
|
|
205
|
-
const named = env.AI_AGENT?.trim().split("_")[0];
|
|
206
|
-
const kind = (named && plainWord(named) ? named.toLowerCase() : void 0) ?? (env.CLAUDECODE ? "claude-code" : void 0) ?? (env.CODEX_THREAD_ID || env.CODEX_SESSION_ID || env.CODEX_SANDBOX ? "codex" : void 0) ?? (env.GEMINI_CLI ? "gemini-cli" : void 0) ?? (env.OPENCODE ? "opencode" : void 0) ?? (env.CURSOR_AGENT ? "cursor" : void 0) ?? // Only `exec` is the agent's own command: OpenClaw also sets `tui-local` for what the owner types in its TUI.
|
|
207
|
-
(env.OPENCLAW_SHELL?.trim() === "exec" ? "openclaw" : void 0);
|
|
208
|
-
if (!kind)
|
|
209
|
-
return void 0;
|
|
210
|
-
const session = sessionOf(kind, env);
|
|
211
|
-
return {
|
|
212
|
-
kind,
|
|
213
|
-
session_id: session && SESSION.test(session) ? session : null,
|
|
214
|
-
// OpenClaw passes the sender and chat ids of a chat-started run in this variable; only its presence is kept.
|
|
215
|
-
...kind === "openclaw" && env.OPENCLAW_CHANNEL_CONTEXT?.trim() ? { from_chat: true } : {}
|
|
216
|
-
};
|
|
217
|
-
}, "agentOf");
|
|
218
|
-
var SESSION = /^[A-Za-z0-9._:-]{1,128}$/;
|
|
219
|
-
var SESSION_VARIABLE = {
|
|
220
|
-
"claude-code": "CLAUDE_CODE_SESSION_ID",
|
|
221
|
-
codex: "CODEX_THREAD_ID",
|
|
222
|
-
opencode: "OPENCODE_SESSION_ID",
|
|
223
|
-
"hermes-agent": "HERMES_SESSION_ID"
|
|
224
|
-
};
|
|
225
|
-
var sessionOf = /* @__PURE__ */ __name((kind, env) => {
|
|
226
|
-
const variable = SESSION_VARIABLE[kind];
|
|
227
|
-
return (variable === void 0 ? void 0 : env[variable]?.trim()) || void 0;
|
|
228
|
-
}, "sessionOf");
|
|
229
|
-
var plainWord = /* @__PURE__ */ __name((word) => /^[A-Za-z][A-Za-z0-9.-]{0,39}$/.test(word), "plainWord");
|
|
230
|
-
var secretInputs = /* @__PURE__ */ new WeakSet();
|
|
231
|
-
var secretInput = /* @__PURE__ */ __name((input) => {
|
|
232
|
-
secretInputs.add(input);
|
|
233
|
-
return input;
|
|
234
|
-
}, "secretInput");
|
|
235
|
-
var secretShaped = /* @__PURE__ */ __name((word) => /:\/\/[^/@\s:]+:[^/@\s]+@/.test(word) || /(^|[^A-Za-z0-9_-])[A-Za-z0-9_-]{40,}($|[^A-Za-z0-9_-])/.test(word), "secretShaped");
|
|
236
|
-
var withoutPhones = /* @__PURE__ */ __name((word) => word.replace(new RegExp(INTERNATIONAL_PHONE, "g"), REDACTED).replace(new RegExp(BARE_PHONE, "g"), `$1${REDACTED}`), "withoutPhones");
|
|
237
|
-
var maskArgv = /* @__PURE__ */ __name((program, words, { keep = false } = {}) => {
|
|
238
|
-
const argv = [];
|
|
239
|
-
let unknownCommand;
|
|
240
|
-
let current = program;
|
|
241
|
-
let positional = 0;
|
|
242
|
-
let profileSeen = false;
|
|
243
|
-
let lost = false;
|
|
244
|
-
const raw = /* @__PURE__ */ __name((word) => keep && !secretShaped(word) ? withoutPhones(withoutSecrets(word, REDACTED)) : REDACTED, "raw");
|
|
245
|
-
const keptValue = /* @__PURE__ */ __name((name, value, input) => keep ? input && secretInputs.has(input) || secretNamed(name) ? REDACTED : raw(value) : maskedValue(name, value, input?.argChoices), "keptValue");
|
|
246
|
-
const optionFor = /* @__PURE__ */ __name((flag) => {
|
|
247
|
-
for (let at = current; at; at = at.parent) {
|
|
248
|
-
const found = at.options.find((option) => option.long === flag || option.short === flag);
|
|
249
|
-
if (found)
|
|
250
|
-
return found;
|
|
251
|
-
}
|
|
252
|
-
return void 0;
|
|
253
|
-
}, "optionFor");
|
|
254
|
-
for (let at = 0; at < words.length; at++) {
|
|
255
|
-
const word = words[at];
|
|
256
|
-
if (word === "--") {
|
|
257
|
-
argv.push("--");
|
|
258
|
-
for (let after = at + 1; after < words.length; after++)
|
|
259
|
-
argv.push(raw(words[after]));
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
if (word.startsWith("-") && word.length > 1 && !NUMBER.test(word)) {
|
|
263
|
-
const equals = word.indexOf("=");
|
|
264
|
-
const flag = equals > 0 ? word.slice(0, equals) : word;
|
|
265
|
-
if (!/^--?[A-Za-z0-9][A-Za-z0-9-]*$/.test(flag)) {
|
|
266
|
-
argv.push(raw(word));
|
|
267
|
-
continue;
|
|
268
|
-
}
|
|
269
|
-
const option = optionFor(flag);
|
|
270
|
-
const name = option?.attributeName() ?? flag.replace(/^-+/, "");
|
|
271
|
-
if (equals > 0) {
|
|
272
|
-
argv.push(`${flag}=${keptValue(name, word.slice(equals + 1), option)}`);
|
|
273
|
-
continue;
|
|
274
|
-
}
|
|
275
|
-
argv.push(flag);
|
|
276
|
-
if (!option && keep && secretNamed(name) && words[at + 1] !== void 0 && !words[at + 1]?.startsWith("-")) {
|
|
277
|
-
at += 1;
|
|
278
|
-
argv.push(REDACTED);
|
|
279
|
-
continue;
|
|
280
|
-
}
|
|
281
|
-
if (!option || !(option.required || option.optional))
|
|
282
|
-
continue;
|
|
283
|
-
const takes = /* @__PURE__ */ __name((next) => next !== void 0 && (option.required || !next.startsWith("-") || NUMBER.test(next)), "takes");
|
|
284
|
-
if (takes(words[at + 1])) {
|
|
285
|
-
at += 1;
|
|
286
|
-
argv.push(keptValue(name, words[at], option));
|
|
287
|
-
while (option.variadic && words[at + 1] !== void 0 && !words[at + 1].startsWith("-")) {
|
|
288
|
-
at += 1;
|
|
289
|
-
argv.push(keptValue(name, words[at], option));
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
continue;
|
|
293
|
-
}
|
|
294
|
-
if (!lost && positional === 0) {
|
|
295
|
-
const sub = current.commands.find((one) => one.name() === word || one.aliases().includes(word));
|
|
296
|
-
if (sub) {
|
|
297
|
-
argv.push(word);
|
|
298
|
-
current = sub;
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
|
-
if (current === program && !profileSeen) {
|
|
302
|
-
profileSeen = true;
|
|
303
|
-
argv.push(keep ? raw(word) : PROFILE.test(word) && withoutPhones(withoutSecrets(word)) === word ? word : REDACTED);
|
|
304
|
-
continue;
|
|
305
|
-
}
|
|
306
|
-
if (current.commands.length > 0 && current.registeredArguments.length === 0) {
|
|
307
|
-
lost = true;
|
|
308
|
-
unknownCommand = commandLike(word);
|
|
309
|
-
argv.push(keep ? raw(word) : unknownCommand);
|
|
310
|
-
continue;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const declared = lost ? void 0 : current.registeredArguments;
|
|
314
|
-
const argument = declared?.[Math.min(positional, declared.length - 1)];
|
|
315
|
-
positional += 1;
|
|
316
|
-
argv.push(secretInputs.has(current) ? REDACTED : argument ? keptValue(argument.name(), word, argument) : raw(word));
|
|
317
|
-
}
|
|
318
|
-
return { argv, ...unknownCommand === void 0 ? {} : { unknownCommand } };
|
|
319
|
-
}, "maskArgv");
|
|
320
|
-
var NUMBER = /^-?\d+(\.\d+)?$/;
|
|
321
|
-
var PROFILE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
322
|
-
var commandLike = /* @__PURE__ */ __name((word) => /^[a-z][a-z0-9-]{0,31}$/i.test(word) && withoutSecrets(word) === word ? word : REDACTED, "commandLike");
|
|
323
|
-
var maskedValue = /* @__PURE__ */ __name((name, value, choices) => {
|
|
324
|
-
if (isContentKey(name))
|
|
325
|
-
return REDACTED;
|
|
326
|
-
if (name === "profile")
|
|
327
|
-
return PROFILE.test(value) ? value : REDACTED;
|
|
328
|
-
if (name === "json" || name === "fields")
|
|
329
|
-
return /^[a-z0-9_.,]{1,200}$/.test(value) ? value : REDACTED;
|
|
330
|
-
if (choices?.includes(value))
|
|
331
|
-
return value;
|
|
332
|
-
return safeShape(value) ? value : REDACTED;
|
|
333
|
-
}, "maskedValue");
|
|
334
|
-
var safeShape = /* @__PURE__ */ __name((value) => NUMBER.test(value) && !/^\d{11,}$/.test(value) || /^\d+(ms|s|m|h|d|w)$/.test(value) || /^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/.test(value) || value === "true" || value === "false", "safeShape");
|
|
335
|
-
var runContextOf = /* @__PURE__ */ __name(({ bin, command, program, argv, env, recordInput = false, caller }) => {
|
|
336
|
-
const masked = program && argv ? maskArgv(program, argv, { keep: recordInput === true }) : void 0;
|
|
337
|
-
const ifFailed = program && argv && recordInput === "failed" ? maskArgv(program, argv, { keep: true }) : void 0;
|
|
338
|
-
const agent = caller ? caller.agent : agentOf(env);
|
|
339
|
-
return {
|
|
340
|
-
cliCommand: command ? `${bin} ${command}` : bin,
|
|
341
|
-
...masked ? { argv: masked.argv } : {},
|
|
342
|
-
...ifFailed ? { argvIfFailed: ifFailed.argv } : {},
|
|
343
|
-
...masked?.unknownCommand === void 0 ? {} : { unknownCommand: masked.unknownCommand },
|
|
344
|
-
...agent ? { agent } : {},
|
|
345
|
-
via: caller?.via ?? viaOf(env),
|
|
346
|
-
...caller?.mcp ? { mcp: caller.mcp } : {}
|
|
347
|
-
};
|
|
348
|
-
}, "runContextOf");
|
|
349
|
-
|
|
350
|
-
export {
|
|
351
|
-
providerErrorKey,
|
|
352
|
-
renderEvent,
|
|
353
|
-
errorDetailOf,
|
|
354
|
-
framesOf,
|
|
355
|
-
endpointTemplate,
|
|
356
|
-
keepsSuccess,
|
|
357
|
-
withCaller,
|
|
358
|
-
currentCaller,
|
|
359
|
-
clientHash,
|
|
360
|
-
agentOf,
|
|
361
|
-
secretInput,
|
|
362
|
-
maskArgv,
|
|
363
|
-
runContextOf
|
|
364
|
-
};
|