@doist/comms-cli 0.0.1 → 1.0.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 +8 -0
- package/README.md +165 -29
- package/dist/commands/account/index.d.ts +3 -0
- package/dist/commands/account/index.d.ts.map +1 -0
- package/dist/commands/account/index.js +104 -0
- package/dist/commands/account/index.js.map +1 -0
- package/dist/commands/auth/helpers.d.ts +22 -0
- package/dist/commands/auth/helpers.d.ts.map +1 -0
- package/dist/commands/auth/helpers.js +29 -0
- package/dist/commands/auth/helpers.js.map +1 -0
- package/dist/commands/auth/index.d.ts +3 -0
- package/dist/commands/auth/index.d.ts.map +1 -0
- package/dist/commands/auth/index.js +32 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/auth/login.d.ts +4 -0
- package/dist/commands/auth/login.d.ts.map +1 -0
- package/dist/commands/auth/login.js +29 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.d.ts +11 -0
- package/dist/commands/auth/logout.d.ts.map +1 -0
- package/dist/commands/auth/logout.js +16 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/auth/status.d.ts +16 -0
- package/dist/commands/auth/status.d.ts.map +1 -0
- package/dist/commands/auth/status.js +102 -0
- package/dist/commands/auth/status.js.map +1 -0
- package/dist/commands/auth/store-wrap.d.ts +4 -0
- package/dist/commands/auth/store-wrap.d.ts.map +1 -0
- package/dist/commands/auth/store-wrap.js +24 -0
- package/dist/commands/auth/store-wrap.js.map +1 -0
- package/dist/commands/auth/token.d.ts +2 -0
- package/dist/commands/auth/token.d.ts.map +1 -0
- package/dist/commands/auth/token.js +56 -0
- package/dist/commands/auth/token.js.map +1 -0
- package/dist/commands/changelog.d.ts +3 -0
- package/dist/commands/changelog.d.ts.map +1 -0
- package/dist/commands/changelog.js +16 -0
- package/dist/commands/changelog.js.map +1 -0
- package/dist/commands/channel/create.d.ts +11 -0
- package/dist/commands/channel/create.d.ts.map +1 -0
- package/dist/commands/channel/create.js +35 -0
- package/dist/commands/channel/create.js.map +1 -0
- package/dist/commands/channel/helpers.d.ts +9 -0
- package/dist/commands/channel/helpers.d.ts.map +1 -0
- package/dist/commands/channel/helpers.js +51 -0
- package/dist/commands/channel/helpers.js.map +1 -0
- package/dist/commands/channel/index.d.ts +3 -0
- package/dist/commands/channel/index.d.ts.map +1 -0
- package/dist/commands/channel/index.js +104 -0
- package/dist/commands/channel/index.js.map +1 -0
- package/dist/commands/channel/list.d.ts +8 -0
- package/dist/commands/channel/list.d.ts.map +1 -0
- package/dist/commands/channel/list.js +144 -0
- package/dist/commands/channel/list.js.map +1 -0
- package/dist/commands/channel/threads.d.ts +11 -0
- package/dist/commands/channel/threads.d.ts.map +1 -0
- package/dist/commands/channel/threads.js +100 -0
- package/dist/commands/channel/threads.js.map +1 -0
- package/dist/commands/channel/update.d.ts +12 -0
- package/dist/commands/channel/update.d.ts.map +1 -0
- package/dist/commands/channel/update.js +84 -0
- package/dist/commands/channel/update.js.map +1 -0
- package/dist/commands/comment/delete.d.ts +5 -0
- package/dist/commands/comment/delete.d.ts.map +1 -0
- package/dist/commands/comment/delete.js +33 -0
- package/dist/commands/comment/delete.js.map +1 -0
- package/dist/commands/comment/index.d.ts +3 -0
- package/dist/commands/comment/index.d.ts.map +1 -0
- package/dist/commands/comment/index.js +49 -0
- package/dist/commands/comment/index.js.map +1 -0
- package/dist/commands/comment/update.d.ts +5 -0
- package/dist/commands/comment/update.d.ts.map +1 -0
- package/dist/commands/comment/update.js +37 -0
- package/dist/commands/comment/update.js.map +1 -0
- package/dist/commands/comment/view.d.ts +3 -0
- package/dist/commands/comment/view.d.ts.map +1 -0
- package/dist/commands/comment/view.js +31 -0
- package/dist/commands/comment/view.js.map +1 -0
- package/dist/commands/completion/helpers.d.ts +14 -0
- package/dist/commands/completion/helpers.d.ts.map +1 -0
- package/dist/commands/completion/helpers.js +37 -0
- package/dist/commands/completion/helpers.js.map +1 -0
- package/dist/commands/completion/index.d.ts +3 -0
- package/dist/commands/completion/index.d.ts.map +1 -0
- package/dist/commands/completion/index.js +22 -0
- package/dist/commands/completion/index.js.map +1 -0
- package/dist/commands/completion/install.d.ts +2 -0
- package/dist/commands/completion/install.d.ts.map +1 -0
- package/dist/commands/completion/install.js +19 -0
- package/dist/commands/completion/install.js.map +1 -0
- package/dist/commands/completion/server.d.ts +3 -0
- package/dist/commands/completion/server.d.ts.map +1 -0
- package/dist/commands/completion/server.js +35 -0
- package/dist/commands/completion/server.js.map +1 -0
- package/dist/commands/completion/uninstall.d.ts +2 -0
- package/dist/commands/completion/uninstall.d.ts.map +1 -0
- package/dist/commands/completion/uninstall.js +19 -0
- package/dist/commands/completion/uninstall.js.map +1 -0
- package/dist/commands/config/index.d.ts +3 -0
- package/dist/commands/config/index.d.ts.map +1 -0
- package/dist/commands/config/index.js +29 -0
- package/dist/commands/config/index.js.map +1 -0
- package/dist/commands/config/set.d.ts +3 -0
- package/dist/commands/config/set.d.ts.map +1 -0
- package/dist/commands/config/set.js +41 -0
- package/dist/commands/config/set.js.map +1 -0
- package/dist/commands/config/view.d.ts +6 -0
- package/dist/commands/config/view.d.ts.map +1 -0
- package/dist/commands/config/view.js +121 -0
- package/dist/commands/config/view.js.map +1 -0
- package/dist/commands/conversation/done.d.ts +3 -0
- package/dist/commands/conversation/done.d.ts.map +1 -0
- package/dist/commands/conversation/done.js +23 -0
- package/dist/commands/conversation/done.js.map +1 -0
- package/dist/commands/conversation/helpers.d.ts +28 -0
- package/dist/commands/conversation/helpers.d.ts.map +1 -0
- package/dist/commands/conversation/helpers.js +119 -0
- package/dist/commands/conversation/helpers.js.map +1 -0
- package/dist/commands/conversation/index.d.ts +3 -0
- package/dist/commands/conversation/index.d.ts.map +1 -0
- package/dist/commands/conversation/index.js +107 -0
- package/dist/commands/conversation/index.js.map +1 -0
- package/dist/commands/conversation/mute.d.ts +3 -0
- package/dist/commands/conversation/mute.d.ts.map +1 -0
- package/dist/commands/conversation/mute.js +30 -0
- package/dist/commands/conversation/mute.js.map +1 -0
- package/dist/commands/conversation/reply.d.ts +3 -0
- package/dist/commands/conversation/reply.d.ts.map +1 -0
- package/dist/commands/conversation/reply.js +37 -0
- package/dist/commands/conversation/reply.js.map +1 -0
- package/dist/commands/conversation/unmute.d.ts +3 -0
- package/dist/commands/conversation/unmute.d.ts.map +1 -0
- package/dist/commands/conversation/unmute.js +28 -0
- package/dist/commands/conversation/unmute.js.map +1 -0
- package/dist/commands/conversation/unread.d.ts +3 -0
- package/dist/commands/conversation/unread.d.ts.map +1 -0
- package/dist/commands/conversation/unread.js +56 -0
- package/dist/commands/conversation/unread.js.map +1 -0
- package/dist/commands/conversation/view.d.ts +3 -0
- package/dist/commands/conversation/view.d.ts.map +1 -0
- package/dist/commands/conversation/view.js +77 -0
- package/dist/commands/conversation/view.js.map +1 -0
- package/dist/commands/conversation/with.d.ts +3 -0
- package/dist/commands/conversation/with.d.ts.map +1 -0
- package/dist/commands/conversation/with.js +48 -0
- package/dist/commands/conversation/with.js.map +1 -0
- package/dist/commands/doctor.d.ts +9 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +325 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/groups/create.d.ts +8 -0
- package/dist/commands/groups/create.d.ts.map +1 -0
- package/dist/commands/groups/create.js +27 -0
- package/dist/commands/groups/create.js.map +1 -0
- package/dist/commands/groups/delete.d.ts +7 -0
- package/dist/commands/groups/delete.d.ts.map +1 -0
- package/dist/commands/groups/delete.js +30 -0
- package/dist/commands/groups/delete.js.map +1 -0
- package/dist/commands/groups/index.d.ts +3 -0
- package/dist/commands/groups/index.d.ts.map +1 -0
- package/dist/commands/groups/index.js +98 -0
- package/dist/commands/groups/index.js.map +1 -0
- package/dist/commands/groups/list.d.ts +7 -0
- package/dist/commands/groups/list.d.ts.map +1 -0
- package/dist/commands/groups/list.js +42 -0
- package/dist/commands/groups/list.js.map +1 -0
- package/dist/commands/groups/members.d.ts +4 -0
- package/dist/commands/groups/members.d.ts.map +1 -0
- package/dist/commands/groups/members.js +90 -0
- package/dist/commands/groups/members.js.map +1 -0
- package/dist/commands/groups/rename.d.ts +3 -0
- package/dist/commands/groups/rename.d.ts.map +1 -0
- package/dist/commands/groups/rename.js +28 -0
- package/dist/commands/groups/rename.js.map +1 -0
- package/dist/commands/groups/view.d.ts +7 -0
- package/dist/commands/groups/view.d.ts.map +1 -0
- package/dist/commands/groups/view.js +52 -0
- package/dist/commands/groups/view.js.map +1 -0
- package/dist/commands/inbox.d.ts +3 -0
- package/dist/commands/inbox.d.ts.map +1 -0
- package/dist/commands/inbox.js +147 -0
- package/dist/commands/inbox.js.map +1 -0
- package/dist/commands/mentions.d.ts +3 -0
- package/dist/commands/mentions.d.ts.map +1 -0
- package/dist/commands/mentions.js +23 -0
- package/dist/commands/mentions.js.map +1 -0
- package/dist/commands/msg/delete.d.ts +5 -0
- package/dist/commands/msg/delete.d.ts.map +1 -0
- package/dist/commands/msg/delete.js +31 -0
- package/dist/commands/msg/delete.js.map +1 -0
- package/dist/commands/msg/index.d.ts +3 -0
- package/dist/commands/msg/index.d.ts.map +1 -0
- package/dist/commands/msg/index.js +47 -0
- package/dist/commands/msg/index.js.map +1 -0
- package/dist/commands/msg/update.d.ts +5 -0
- package/dist/commands/msg/update.d.ts.map +1 -0
- package/dist/commands/msg/update.js +37 -0
- package/dist/commands/msg/update.js.map +1 -0
- package/dist/commands/msg/view.d.ts +3 -0
- package/dist/commands/msg/view.d.ts.map +1 -0
- package/dist/commands/msg/view.js +31 -0
- package/dist/commands/msg/view.js.map +1 -0
- package/dist/commands/react.d.ts +3 -0
- package/dist/commands/react.d.ts.map +1 -0
- package/dist/commands/react.js +149 -0
- package/dist/commands/react.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +30 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/skill/index.d.ts +3 -0
- package/dist/commands/skill/index.d.ts.map +1 -0
- package/dist/commands/skill/index.js +29 -0
- package/dist/commands/skill/index.js.map +1 -0
- package/dist/commands/skill/install.d.ts +3 -0
- package/dist/commands/skill/install.d.ts.map +1 -0
- package/dist/commands/skill/install.js +16 -0
- package/dist/commands/skill/install.js.map +1 -0
- package/dist/commands/skill/list.d.ts +6 -0
- package/dist/commands/skill/list.d.ts.map +1 -0
- package/dist/commands/skill/list.js +22 -0
- package/dist/commands/skill/list.js.map +1 -0
- package/dist/commands/skill/uninstall.d.ts +3 -0
- package/dist/commands/skill/uninstall.d.ts.map +1 -0
- package/dist/commands/skill/uninstall.js +15 -0
- package/dist/commands/skill/uninstall.js.map +1 -0
- package/dist/commands/skill/update.d.ts +3 -0
- package/dist/commands/skill/update.d.ts.map +1 -0
- package/dist/commands/skill/update.js +37 -0
- package/dist/commands/skill/update.js.map +1 -0
- package/dist/commands/thread/create.d.ts +8 -0
- package/dist/commands/thread/create.d.ts.map +1 -0
- package/dist/commands/thread/create.js +70 -0
- package/dist/commands/thread/create.js.map +1 -0
- package/dist/commands/thread/delete.d.ts +7 -0
- package/dist/commands/thread/delete.d.ts.map +1 -0
- package/dist/commands/thread/delete.js +38 -0
- package/dist/commands/thread/delete.js.map +1 -0
- package/dist/commands/thread/helpers.d.ts +24 -0
- package/dist/commands/thread/helpers.d.ts.map +1 -0
- package/dist/commands/thread/helpers.js +45 -0
- package/dist/commands/thread/helpers.js.map +1 -0
- package/dist/commands/thread/index.d.ts +3 -0
- package/dist/commands/thread/index.d.ts.map +1 -0
- package/dist/commands/thread/index.js +134 -0
- package/dist/commands/thread/index.js.map +1 -0
- package/dist/commands/thread/mutate.d.ts +5 -0
- package/dist/commands/thread/mutate.d.ts.map +1 -0
- package/dist/commands/thread/mutate.js +23 -0
- package/dist/commands/thread/mutate.js.map +1 -0
- package/dist/commands/thread/mute.d.ts +8 -0
- package/dist/commands/thread/mute.d.ts.map +1 -0
- package/dist/commands/thread/mute.js +63 -0
- package/dist/commands/thread/mute.js.map +1 -0
- package/dist/commands/thread/rename.d.ts +3 -0
- package/dist/commands/thread/rename.d.ts.map +1 -0
- package/dist/commands/thread/rename.js +29 -0
- package/dist/commands/thread/rename.js.map +1 -0
- package/dist/commands/thread/reply.d.ts +9 -0
- package/dist/commands/thread/reply.d.ts.map +1 -0
- package/dist/commands/thread/reply.js +85 -0
- package/dist/commands/thread/reply.js.map +1 -0
- package/dist/commands/thread/update.d.ts +5 -0
- package/dist/commands/thread/update.d.ts.map +1 -0
- package/dist/commands/thread/update.js +45 -0
- package/dist/commands/thread/update.js.map +1 -0
- package/dist/commands/thread/view.d.ts +9 -0
- package/dist/commands/thread/view.d.ts.map +1 -0
- package/dist/commands/thread/view.js +171 -0
- package/dist/commands/thread/view.js.map +1 -0
- package/dist/commands/update/index.d.ts +3 -0
- package/dist/commands/update/index.d.ts.map +1 -0
- package/dist/commands/update/index.js +14 -0
- package/dist/commands/update/index.js.map +1 -0
- package/dist/commands/user.d.ts +3 -0
- package/dist/commands/user.d.ts.map +1 -0
- package/dist/commands/user.js +90 -0
- package/dist/commands/user.js.map +1 -0
- package/dist/commands/view.d.ts +3 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +68 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/commands/workspace.d.ts +3 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +56 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +190 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +35 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +306 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/auth-constants.d.ts +3 -0
- package/dist/lib/auth-constants.d.ts.map +1 -0
- package/dist/lib/auth-constants.js +3 -0
- package/dist/lib/auth-constants.js.map +1 -0
- package/dist/lib/auth-pages.d.ts +3 -0
- package/dist/lib/auth-pages.d.ts.map +1 -0
- package/dist/lib/auth-pages.js +707 -0
- package/dist/lib/auth-pages.js.map +1 -0
- package/dist/lib/auth-provider.d.ts +74 -0
- package/dist/lib/auth-provider.d.ts.map +1 -0
- package/dist/lib/auth-provider.js +238 -0
- package/dist/lib/auth-provider.js.map +1 -0
- package/dist/lib/auth.d.ts +39 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +57 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/comms-account.d.ts +22 -0
- package/dist/lib/comms-account.d.ts.map +1 -0
- package/dist/lib/comms-account.js +23 -0
- package/dist/lib/comms-account.js.map +1 -0
- package/dist/lib/completion.d.ts +31 -0
- package/dist/lib/completion.d.ts.map +1 -0
- package/dist/lib/completion.js +173 -0
- package/dist/lib/completion.js.map +1 -0
- package/dist/lib/config.d.ts +61 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +184 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/dates.d.ts +3 -0
- package/dist/lib/dates.d.ts.map +1 -0
- package/dist/lib/dates.js +44 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/errors.d.ts +28 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +34 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/global-args.d.ts +52 -0
- package/dist/lib/global-args.d.ts.map +1 -0
- package/dist/lib/global-args.js +124 -0
- package/dist/lib/global-args.js.map +1 -0
- package/dist/lib/input.d.ts +3 -0
- package/dist/lib/input.d.ts.map +1 -0
- package/dist/lib/input.js +80 -0
- package/dist/lib/input.js.map +1 -0
- package/dist/lib/markdown.d.ts +3 -0
- package/dist/lib/markdown.d.ts.map +1 -0
- package/dist/lib/markdown.js +15 -0
- package/dist/lib/markdown.js.map +1 -0
- package/dist/lib/options.d.ts +16 -0
- package/dist/lib/options.d.ts.map +1 -0
- package/dist/lib/options.js +2 -0
- package/dist/lib/options.js.map +1 -0
- package/dist/lib/output.d.ts +41 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +184 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/permissions.d.ts +4 -0
- package/dist/lib/permissions.d.ts.map +1 -0
- package/dist/lib/permissions.js +41 -0
- package/dist/lib/permissions.js.map +1 -0
- package/dist/lib/progress.d.ts +29 -0
- package/dist/lib/progress.d.ts.map +1 -0
- package/dist/lib/progress.js +86 -0
- package/dist/lib/progress.js.map +1 -0
- package/dist/lib/public-channels.d.ts +4 -0
- package/dist/lib/public-channels.d.ts.map +1 -0
- package/dist/lib/public-channels.js +32 -0
- package/dist/lib/public-channels.js.map +1 -0
- package/dist/lib/refs.d.ts +62 -0
- package/dist/lib/refs.d.ts.map +1 -0
- package/dist/lib/refs.js +378 -0
- package/dist/lib/refs.js.map +1 -0
- package/dist/lib/search-api.d.ts +25 -0
- package/dist/lib/search-api.d.ts.map +1 -0
- package/dist/lib/search-api.js +93 -0
- package/dist/lib/search-api.js.map +1 -0
- package/dist/lib/search-helpers.d.ts +32 -0
- package/dist/lib/search-helpers.d.ts.map +1 -0
- package/dist/lib/search-helpers.js +183 -0
- package/dist/lib/search-helpers.js.map +1 -0
- package/dist/lib/skills/content.d.ts +8 -0
- package/dist/lib/skills/content.d.ts.map +1 -0
- package/dist/lib/skills/content.js +410 -0
- package/dist/lib/skills/content.js.map +1 -0
- package/dist/lib/skills/create-installer.d.ts +9 -0
- package/dist/lib/skills/create-installer.d.ts.map +1 -0
- package/dist/lib/skills/create-installer.js +65 -0
- package/dist/lib/skills/create-installer.js.map +1 -0
- package/dist/lib/skills/index.d.ts +7 -0
- package/dist/lib/skills/index.d.ts.map +1 -0
- package/dist/lib/skills/index.js +54 -0
- package/dist/lib/skills/index.js.map +1 -0
- package/dist/lib/skills/types.d.ts +30 -0
- package/dist/lib/skills/types.d.ts.map +1 -0
- package/dist/lib/skills/types.js +2 -0
- package/dist/lib/skills/types.js.map +1 -0
- package/dist/lib/skills/update-installed.d.ts +9 -0
- package/dist/lib/skills/update-installed.d.ts.map +1 -0
- package/dist/lib/skills/update-installed.js +20 -0
- package/dist/lib/skills/update-installed.js.map +1 -0
- package/dist/lib/spinner.d.ts +3 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +10 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/threads.d.ts +4 -0
- package/dist/lib/threads.d.ts.map +1 -0
- package/dist/lib/threads.js +6 -0
- package/dist/lib/threads.js.map +1 -0
- package/dist/lib/update.d.ts +13 -0
- package/dist/lib/update.d.ts.map +1 -0
- package/dist/lib/update.js +23 -0
- package/dist/lib/update.js.map +1 -0
- package/dist/lib/user-records.d.ts +15 -0
- package/dist/lib/user-records.d.ts.map +1 -0
- package/dist/lib/user-records.js +84 -0
- package/dist/lib/user-records.js.map +1 -0
- package/dist/lib/validation.d.ts +2 -0
- package/dist/lib/validation.d.ts.map +1 -0
- package/dist/lib/validation.js +7 -0
- package/dist/lib/validation.js.map +1 -0
- package/dist/postinstall.d.ts +2 -0
- package/dist/postinstall.d.ts.map +1 -0
- package/dist/postinstall.js +4 -0
- package/dist/postinstall.js.map +1 -0
- package/package.json +77 -8
- package/scripts/check-skill-sync.js +40 -0
- package/scripts/postinstall.js +12 -0
- package/scripts/sync-skill.js +29 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set argChoices on an option without enabling Commander's built-in
|
|
3
|
+
* validation. The choices are surfaced for shell completions but the
|
|
4
|
+
* option still accepts any value at parse time.
|
|
5
|
+
*/
|
|
6
|
+
export function withUnvalidatedChoices(opt, values) {
|
|
7
|
+
opt.argChoices = values;
|
|
8
|
+
return opt;
|
|
9
|
+
}
|
|
10
|
+
export function withCaseInsensitiveChoices(opt, values) {
|
|
11
|
+
opt.choices(values);
|
|
12
|
+
// choices() sets parseArg internally. Assert so we catch upstream changes.
|
|
13
|
+
const original = opt.parseArg;
|
|
14
|
+
if (!original) {
|
|
15
|
+
throw new Error('Expected Commander choices() to set parseArg');
|
|
16
|
+
}
|
|
17
|
+
opt.parseArg = (arg, prev) => original(arg.toLowerCase(), prev);
|
|
18
|
+
return opt;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse COMP_LINE into words, stripping the binary name and the
|
|
22
|
+
* 'completion-server' token that tabtab injects.
|
|
23
|
+
*
|
|
24
|
+
* FIXME: This splits on whitespace and does not handle quoted arguments.
|
|
25
|
+
* This is acceptable for command/flag traversal. It can be improved once
|
|
26
|
+
* tabtab exposes shell-provided tokenized words.
|
|
27
|
+
*/
|
|
28
|
+
export function parseCompLine(compLine) {
|
|
29
|
+
const words = compLine.split(/\s+/).slice(1); // remove binary name (tdc)
|
|
30
|
+
if (words[0] === 'completion-server')
|
|
31
|
+
words.shift();
|
|
32
|
+
return words;
|
|
33
|
+
}
|
|
34
|
+
/** Names to exclude from completion results (internal commands) */
|
|
35
|
+
const HIDDEN_COMMAND_NAMES = new Set(['completion-server']);
|
|
36
|
+
/**
|
|
37
|
+
* Check if a Commander Option expects a value argument (not a boolean flag).
|
|
38
|
+
*/
|
|
39
|
+
function optionExpectsValue(opt) {
|
|
40
|
+
// required means <value>, optional means [value] — both expect a value
|
|
41
|
+
return opt.required || opt.optional;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Find an option by its long or short flag in a command.
|
|
45
|
+
*/
|
|
46
|
+
function findOption(cmd, flag) {
|
|
47
|
+
return cmd.options.find((o) => o.long === flag || o.short === flag);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get completions for the current command line context.
|
|
51
|
+
*
|
|
52
|
+
* @param program - The root Commander program with all commands registered
|
|
53
|
+
* @param words - The words on the command line (excluding the binary name)
|
|
54
|
+
* @param current - The current word being typed (may be empty string)
|
|
55
|
+
* @returns Array of completion items
|
|
56
|
+
*/
|
|
57
|
+
export function getCompletions(program, words, current) {
|
|
58
|
+
let activeCmd = program;
|
|
59
|
+
let seenDoubleDash = false;
|
|
60
|
+
const usedOptions = new Set();
|
|
61
|
+
// Walk the words to find the active command context
|
|
62
|
+
let i = 0;
|
|
63
|
+
while (i < words.length) {
|
|
64
|
+
const word = words[i];
|
|
65
|
+
// If we hit the current word (last position), stop walking
|
|
66
|
+
if (i === words.length - 1 && word === current) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
if (word === '--') {
|
|
70
|
+
seenDoubleDash = true;
|
|
71
|
+
i++;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (!seenDoubleDash && word.startsWith('-')) {
|
|
75
|
+
// Handle --flag=value syntax
|
|
76
|
+
const eqIdx = word.indexOf('=');
|
|
77
|
+
const flag = eqIdx > 0 ? word.slice(0, eqIdx) : word;
|
|
78
|
+
usedOptions.add(flag);
|
|
79
|
+
// If this option expects a value and no = was used, consume the next word
|
|
80
|
+
if (eqIdx < 0) {
|
|
81
|
+
const opt = findOption(activeCmd, flag);
|
|
82
|
+
if (opt && optionExpectsValue(opt)) {
|
|
83
|
+
i++; // skip the value word
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
i++;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
// Try to descend into a subcommand
|
|
90
|
+
const sub = activeCmd.commands.find((c) => c.name() === word || c.aliases().includes(word));
|
|
91
|
+
if (sub) {
|
|
92
|
+
activeCmd = sub;
|
|
93
|
+
usedOptions.clear();
|
|
94
|
+
}
|
|
95
|
+
i++;
|
|
96
|
+
}
|
|
97
|
+
// Check if previous word was an option expecting a value
|
|
98
|
+
if (words.length >= 2) {
|
|
99
|
+
const prevWord = words[words.length - 2];
|
|
100
|
+
if (prevWord?.startsWith('-') && prevWord !== '--') {
|
|
101
|
+
const eqIdx = prevWord.indexOf('=');
|
|
102
|
+
const flag = eqIdx > 0 ? prevWord.slice(0, eqIdx) : prevWord;
|
|
103
|
+
const opt = findOption(activeCmd, flag);
|
|
104
|
+
if (opt && optionExpectsValue(opt) && eqIdx < 0) {
|
|
105
|
+
const enumValues = opt.argChoices;
|
|
106
|
+
if (enumValues) {
|
|
107
|
+
return enumValues.filter((v) => v.startsWith(current)).map((v) => ({ name: v }));
|
|
108
|
+
}
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Handle --flag=<TAB> — suggest values after =
|
|
114
|
+
if (current.includes('=')) {
|
|
115
|
+
const eqIdx = current.indexOf('=');
|
|
116
|
+
const flag = current.slice(0, eqIdx);
|
|
117
|
+
const partial = current.slice(eqIdx + 1);
|
|
118
|
+
const opt = findOption(activeCmd, flag);
|
|
119
|
+
if (opt) {
|
|
120
|
+
const enumValues = opt.argChoices;
|
|
121
|
+
if (enumValues) {
|
|
122
|
+
return enumValues
|
|
123
|
+
.filter((v) => v.startsWith(partial))
|
|
124
|
+
.map((v) => ({ name: `${flag}=${v}` }));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
// After --, everything is positional — no more commands or options
|
|
130
|
+
if (seenDoubleDash) {
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
133
|
+
// If current word starts with -, suggest options
|
|
134
|
+
if (current.startsWith('-')) {
|
|
135
|
+
return getOptionCompletions(activeCmd, current, usedOptions);
|
|
136
|
+
}
|
|
137
|
+
// Suggest subcommands, and if there are none, suggest options instead
|
|
138
|
+
const subcommands = getSubcommandCompletions(activeCmd, current);
|
|
139
|
+
if (subcommands.length > 0) {
|
|
140
|
+
return subcommands;
|
|
141
|
+
}
|
|
142
|
+
return getOptionCompletions(activeCmd, current, usedOptions);
|
|
143
|
+
}
|
|
144
|
+
function getSubcommandCompletions(cmd, prefix) {
|
|
145
|
+
return cmd.commands
|
|
146
|
+
.filter((c) => !c._hidden &&
|
|
147
|
+
!HIDDEN_COMMAND_NAMES.has(c.name()))
|
|
148
|
+
.filter((c) => c.name().startsWith(prefix))
|
|
149
|
+
.map((c) => ({
|
|
150
|
+
name: c.name(),
|
|
151
|
+
description: c.description(),
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
function getOptionCompletions(cmd, prefix, usedOptions) {
|
|
155
|
+
return cmd.options
|
|
156
|
+
.filter((o) => {
|
|
157
|
+
if (!o.long)
|
|
158
|
+
return false;
|
|
159
|
+
if (o.hidden)
|
|
160
|
+
return false;
|
|
161
|
+
// Exclude already-used options
|
|
162
|
+
if (usedOptions.has(o.long))
|
|
163
|
+
return false;
|
|
164
|
+
if (o.short && usedOptions.has(o.short))
|
|
165
|
+
return false;
|
|
166
|
+
return o.long.startsWith(prefix);
|
|
167
|
+
})
|
|
168
|
+
.map((o) => ({
|
|
169
|
+
name: o.long,
|
|
170
|
+
description: o.description,
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/lib/completion.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,MAAgB;IAChE,GAAG,CAAC,UAAU,GAAG,MAAM,CAAA;IACvB,OAAO,GAAG,CAAA;AACd,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,GAAW,EAAE,MAAgB;IACpE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAEnB,2EAA2E;IAC3E,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAA;IAC7B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACnE,CAAC;IAED,GAAG,CAAC,QAAQ,GAAG,CAAI,GAAW,EAAE,IAAO,EAAK,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAA;IAChF,OAAO,GAAG,CAAA;AACd,CAAC;AAED;;;;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CAAC;QAClB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;QACd,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE;KAC/B,CAAC,CAAC,CAAA;AACX,CAAC;AAED,SAAS,oBAAoB,CACzB,GAAY,EACZ,MAAc,EACd,WAAwB;IAExB,OAAO,GAAG,CAAC,OAAO;SACb,MAAM,CAAC,CAAC,CAAS,EAAE,EAAE;QAClB,IAAI,CAAC,CAAC,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QACzB,IAAI,CAAC,CAAC,MAAM;YAAE,OAAO,KAAK,CAAA;QAC1B,+BAA+B;QAC/B,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAA;QACzC,IAAI,CAAC,CAAC,KAAK,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAA;QACrD,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;IACpC,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC;QACjB,IAAI,EAAE,CAAC,CAAC,IAAc;QACtB,WAAW,EAAE,CAAC,CAAC,WAAW;KAC7B,CAAC,CAAC,CAAA;AACX,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the canonical config path lazily. Computing on each call (instead of
|
|
3
|
+
* caching at module load) keeps the path responsive to vitest's `vi.doMock`
|
|
4
|
+
* for `node:os` — which only reliably reaches cli-core's compiled `homedir()`
|
|
5
|
+
* call after the mock has been set up by the test, not at import time.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getConfigPath(): string;
|
|
8
|
+
export type AuthMode = 'read-only' | 'read-write' | 'unknown';
|
|
9
|
+
export type UpdateChannel = 'stable' | 'pre-release';
|
|
10
|
+
export declare const UPDATE_CHANNELS: ReadonlySet<UpdateChannel>;
|
|
11
|
+
export interface UserSettings {
|
|
12
|
+
unarchiveNewThreads?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One row of the `users[]` array. `id` is the stringified numeric Comms user
|
|
16
|
+
* id. `token` is a plaintext fallback persisted only when the keyring is
|
|
17
|
+
* unavailable at write time.
|
|
18
|
+
*/
|
|
19
|
+
export type StoredUser = {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
authMode?: AuthMode;
|
|
23
|
+
authScope?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
};
|
|
26
|
+
export interface Config {
|
|
27
|
+
users?: StoredUser[];
|
|
28
|
+
defaultUserId?: string;
|
|
29
|
+
currentWorkspace?: number;
|
|
30
|
+
updateChannel?: UpdateChannel;
|
|
31
|
+
userSettings?: UserSettings;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Thin wrapper around cli-core's lenient `readConfig`. Returns `{}` when the
|
|
35
|
+
* file is missing, unreadable, or invalid — runtime code paths treat "no
|
|
36
|
+
* config" and "empty config" the same. Use `readConfigStrict` for inspection
|
|
37
|
+
* commands that need to distinguish failure modes.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getConfig(): Promise<Config>;
|
|
40
|
+
export type StrictReadResult = {
|
|
41
|
+
state: 'missing';
|
|
42
|
+
} | {
|
|
43
|
+
state: 'present';
|
|
44
|
+
config: Config;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Read and parse the config file strictly — for inspection commands that need
|
|
48
|
+
* to distinguish "missing" from "present but broken". `getConfig` deliberately
|
|
49
|
+
* swallows errors for runtime code paths; this one surfaces them.
|
|
50
|
+
*/
|
|
51
|
+
export declare function readConfigStrict(): Promise<StrictReadResult>;
|
|
52
|
+
/** Thin wrapper around cli-core's `writeConfig`. */
|
|
53
|
+
export declare function setConfig(config: Config): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Atomic partial-write wrapper around cli-core's `updateConfig`. Preserves
|
|
56
|
+
* cli-core's read-merge-write atomicity so two concurrent `tdc` processes
|
|
57
|
+
* can't lose each other's updates.
|
|
58
|
+
*/
|
|
59
|
+
export declare function updateConfig(updates: Partial<Config>): Promise<void>;
|
|
60
|
+
export declare function validateConfigForDoctor(config: Record<string, unknown>): string[];
|
|
61
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,CAAA;AAC7D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,aAAa,CAAA;AAuBpD,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,aAAa,CAAsC,CAAA;AAE7F,MAAM,WAAW,YAAY;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,WAAW,MAAM;IACnB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAA;CAC9B;AAyBD;;;;;GAKG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAGjD;AAED,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1F;;;;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAkClE;AAED,oDAAoD;AACpD,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7D;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAiGjF"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { getConfigPath as getConfigPathCore, readConfig as readConfigCore, readConfigStrict as readConfigStrictCore, updateConfig as updateConfigCore, writeConfig as writeConfigCore, } from '@doist/cli-core';
|
|
2
|
+
import { CliError } from './errors.js';
|
|
3
|
+
const APP_NAME = 'comms-cli';
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the canonical config path lazily. Computing on each call (instead of
|
|
6
|
+
* caching at module load) keeps the path responsive to vitest's `vi.doMock`
|
|
7
|
+
* for `node:os` — which only reliably reaches cli-core's compiled `homedir()`
|
|
8
|
+
* call after the mock has been set up by the test, not at import time.
|
|
9
|
+
*/
|
|
10
|
+
export function getConfigPath() {
|
|
11
|
+
return getConfigPathCore(APP_NAME);
|
|
12
|
+
}
|
|
13
|
+
const KNOWN_CONFIG_KEYS = new Set([
|
|
14
|
+
'currentWorkspace',
|
|
15
|
+
// cli-core's update command writes the channel under `update_channel`;
|
|
16
|
+
// the in-memory `Config` exposes it as `updateChannel`.
|
|
17
|
+
'update_channel',
|
|
18
|
+
'userSettings',
|
|
19
|
+
'users',
|
|
20
|
+
'defaultUserId',
|
|
21
|
+
]);
|
|
22
|
+
const KNOWN_STORED_USER_KEYS = new Set([
|
|
23
|
+
'id',
|
|
24
|
+
'name',
|
|
25
|
+
'authMode',
|
|
26
|
+
'authScope',
|
|
27
|
+
'token',
|
|
28
|
+
]);
|
|
29
|
+
const KNOWN_USER_SETTINGS_KEYS = new Set(['unarchiveNewThreads']);
|
|
30
|
+
const AUTH_MODES = new Set(['read-only', 'read-write', 'unknown']);
|
|
31
|
+
export const UPDATE_CHANNELS = new Set(['stable', 'pre-release']);
|
|
32
|
+
/**
|
|
33
|
+
* Read-seam translation: cli-core's update command writes the channel under
|
|
34
|
+
* `update_channel` (snake_case); we expose it as `updateChannel` (camelCase)
|
|
35
|
+
* to keep the in-memory shape idiomatic TS. Non-object inputs are returned
|
|
36
|
+
* untouched so the downstream cast doesn't blow up.
|
|
37
|
+
*/
|
|
38
|
+
function fromDiskShape(raw) {
|
|
39
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
const record = raw;
|
|
43
|
+
if (!('update_channel' in record))
|
|
44
|
+
return record;
|
|
45
|
+
const { update_channel, ...rest } = record;
|
|
46
|
+
return update_channel === undefined ? rest : { ...rest, updateChannel: update_channel };
|
|
47
|
+
}
|
|
48
|
+
/** Write-seam translation: camelCase `updateChannel` → snake_case `update_channel` on disk. */
|
|
49
|
+
function toDiskShape(config) {
|
|
50
|
+
const { updateChannel, ...rest } = config;
|
|
51
|
+
if (updateChannel === undefined)
|
|
52
|
+
return rest;
|
|
53
|
+
return { ...rest, update_channel: updateChannel };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Thin wrapper around cli-core's lenient `readConfig`. Returns `{}` when the
|
|
57
|
+
* file is missing, unreadable, or invalid — runtime code paths treat "no
|
|
58
|
+
* config" and "empty config" the same. Use `readConfigStrict` for inspection
|
|
59
|
+
* commands that need to distinguish failure modes.
|
|
60
|
+
*/
|
|
61
|
+
export async function getConfig() {
|
|
62
|
+
const raw = await readConfigCore(getConfigPath());
|
|
63
|
+
return fromDiskShape(raw);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Read and parse the config file strictly — for inspection commands that need
|
|
67
|
+
* to distinguish "missing" from "present but broken". `getConfig` deliberately
|
|
68
|
+
* swallows errors for runtime code paths; this one surfaces them.
|
|
69
|
+
*/
|
|
70
|
+
export async function readConfigStrict() {
|
|
71
|
+
const path = getConfigPath();
|
|
72
|
+
const result = await readConfigStrictCore(path);
|
|
73
|
+
switch (result.state) {
|
|
74
|
+
case 'missing':
|
|
75
|
+
return { state: 'missing' };
|
|
76
|
+
case 'present':
|
|
77
|
+
return {
|
|
78
|
+
state: 'present',
|
|
79
|
+
config: fromDiskShape(result.config),
|
|
80
|
+
};
|
|
81
|
+
case 'read-failed':
|
|
82
|
+
throw new CliError('CONFIG_READ_FAILED', `Could not read config file ${path}: ${result.error.message}`, ['Check file permissions, or run `tdc doctor` to diagnose']);
|
|
83
|
+
case 'invalid-json':
|
|
84
|
+
throw new CliError('CONFIG_INVALID_JSON', `Config file at ${path} is not valid JSON: ${result.error.message}`, [
|
|
85
|
+
'Fix the JSON by hand, or delete the file and re-authenticate with `tdc auth login`',
|
|
86
|
+
]);
|
|
87
|
+
case 'invalid-shape':
|
|
88
|
+
throw new CliError('CONFIG_INVALID_SHAPE', `Config file at ${path} must contain a JSON object (got ${result.actual})`, [
|
|
89
|
+
'Fix the JSON by hand, or delete the file and re-authenticate with `tdc auth login`',
|
|
90
|
+
]);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** Thin wrapper around cli-core's `writeConfig`. */
|
|
94
|
+
export async function setConfig(config) {
|
|
95
|
+
await writeConfigCore(getConfigPath(), toDiskShape(config));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Atomic partial-write wrapper around cli-core's `updateConfig`. Preserves
|
|
99
|
+
* cli-core's read-merge-write atomicity so two concurrent `tdc` processes
|
|
100
|
+
* can't lose each other's updates.
|
|
101
|
+
*/
|
|
102
|
+
export async function updateConfig(updates) {
|
|
103
|
+
await updateConfigCore(getConfigPath(), toDiskShape(updates));
|
|
104
|
+
}
|
|
105
|
+
export function validateConfigForDoctor(config) {
|
|
106
|
+
const issues = [];
|
|
107
|
+
for (const key of Object.keys(config)) {
|
|
108
|
+
if (!KNOWN_CONFIG_KEYS.has(key)) {
|
|
109
|
+
issues.push(`contains unrecognized key "${key}"`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (config.currentWorkspace !== undefined &&
|
|
113
|
+
(!Number.isInteger(config.currentWorkspace) || Number(config.currentWorkspace) <= 0)) {
|
|
114
|
+
issues.push('currentWorkspace must be a positive integer');
|
|
115
|
+
}
|
|
116
|
+
if (config.update_channel !== undefined &&
|
|
117
|
+
(typeof config.update_channel !== 'string' ||
|
|
118
|
+
!UPDATE_CHANNELS.has(config.update_channel))) {
|
|
119
|
+
issues.push('update_channel must be one of: stable, pre-release');
|
|
120
|
+
}
|
|
121
|
+
if (config.defaultUserId !== undefined && typeof config.defaultUserId !== 'string') {
|
|
122
|
+
issues.push('defaultUserId must be a string');
|
|
123
|
+
}
|
|
124
|
+
if (config.users !== undefined) {
|
|
125
|
+
if (!Array.isArray(config.users)) {
|
|
126
|
+
issues.push('users must be an array');
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
for (let i = 0; i < config.users.length; i++) {
|
|
130
|
+
const user = config.users[i];
|
|
131
|
+
if (user === null || typeof user !== 'object' || Array.isArray(user)) {
|
|
132
|
+
issues.push(`users[${i}] must be an object`);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const userRecord = user;
|
|
136
|
+
for (const key of Object.keys(userRecord)) {
|
|
137
|
+
if (!KNOWN_STORED_USER_KEYS.has(key)) {
|
|
138
|
+
issues.push(`users[${i}] contains unrecognized key "${key}"`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (typeof userRecord.id !== 'string') {
|
|
142
|
+
issues.push(`users[${i}].id must be a string`);
|
|
143
|
+
}
|
|
144
|
+
if (typeof userRecord.name !== 'string') {
|
|
145
|
+
issues.push(`users[${i}].name must be a string`);
|
|
146
|
+
}
|
|
147
|
+
if (userRecord.authMode !== undefined &&
|
|
148
|
+
(typeof userRecord.authMode !== 'string' ||
|
|
149
|
+
!AUTH_MODES.has(userRecord.authMode))) {
|
|
150
|
+
issues.push(`users[${i}].authMode must be one of: read-only, read-write, unknown`);
|
|
151
|
+
}
|
|
152
|
+
if (userRecord.authScope !== undefined &&
|
|
153
|
+
typeof userRecord.authScope !== 'string') {
|
|
154
|
+
issues.push(`users[${i}].authScope must be a string`);
|
|
155
|
+
}
|
|
156
|
+
if (userRecord.token !== undefined && typeof userRecord.token !== 'string') {
|
|
157
|
+
issues.push(`users[${i}].token must be a string`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (config.userSettings !== undefined) {
|
|
163
|
+
const userSettings = config.userSettings;
|
|
164
|
+
if (userSettings === null ||
|
|
165
|
+
typeof userSettings !== 'object' ||
|
|
166
|
+
Array.isArray(userSettings)) {
|
|
167
|
+
issues.push('userSettings must be an object');
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
const settingsRecord = userSettings;
|
|
171
|
+
for (const key of Object.keys(settingsRecord)) {
|
|
172
|
+
if (!KNOWN_USER_SETTINGS_KEYS.has(key)) {
|
|
173
|
+
issues.push(`userSettings contains unrecognized key "${key}"`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (settingsRecord.unarchiveNewThreads !== undefined &&
|
|
177
|
+
typeof settingsRecord.unarchiveNewThreads !== 'boolean') {
|
|
178
|
+
issues.push('userSettings.unarchiveNewThreads must be a boolean');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return issues;
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources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AAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBACrC,MAAM,CAAC,IAAI,CAAC,2CAA2C,GAAG,GAAG,CAAC,CAAA;gBAClE,CAAC;YACL,CAAC;YACD,IACI,cAAc,CAAC,mBAAmB,KAAK,SAAS;gBAChD,OAAO,cAAc,CAAC,mBAAmB,KAAK,SAAS,EACzD,CAAC;gBACC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAA;YACrE,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../src/lib/dates.ts"],"names":[],"mappings":"AAKA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAiC9D;AAaD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAGtD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const SECOND = 1000;
|
|
2
|
+
const MINUTE = 60 * SECOND;
|
|
3
|
+
const HOUR = 60 * MINUTE;
|
|
4
|
+
const DAY = 24 * HOUR;
|
|
5
|
+
export function formatRelativeDate(date) {
|
|
6
|
+
const d = typeof date === 'string' ? new Date(date) : date;
|
|
7
|
+
const now = new Date();
|
|
8
|
+
const diff = now.getTime() - d.getTime();
|
|
9
|
+
if (diff < 0) {
|
|
10
|
+
return formatAbsoluteDate(d);
|
|
11
|
+
}
|
|
12
|
+
if (diff < MINUTE) {
|
|
13
|
+
return 'just now';
|
|
14
|
+
}
|
|
15
|
+
if (diff < HOUR) {
|
|
16
|
+
const mins = Math.floor(diff / MINUTE);
|
|
17
|
+
return `${mins} minute${mins === 1 ? '' : 's'} ago`;
|
|
18
|
+
}
|
|
19
|
+
if (diff < DAY) {
|
|
20
|
+
const hours = Math.floor(diff / HOUR);
|
|
21
|
+
return `${hours} hour${hours === 1 ? '' : 's'} ago`;
|
|
22
|
+
}
|
|
23
|
+
if (diff < 2 * DAY) {
|
|
24
|
+
return 'yesterday';
|
|
25
|
+
}
|
|
26
|
+
if (diff < 7 * DAY) {
|
|
27
|
+
const days = Math.floor(diff / DAY);
|
|
28
|
+
return `${days} days ago`;
|
|
29
|
+
}
|
|
30
|
+
return formatAbsoluteDate(d);
|
|
31
|
+
}
|
|
32
|
+
function formatAbsoluteDate(date) {
|
|
33
|
+
const now = new Date();
|
|
34
|
+
const sameYear = date.getFullYear() === now.getFullYear();
|
|
35
|
+
if (sameYear) {
|
|
36
|
+
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
|
|
37
|
+
}
|
|
38
|
+
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
|
|
39
|
+
}
|
|
40
|
+
export function parseDate(dateStr) {
|
|
41
|
+
const d = new Date(dateStr);
|
|
42
|
+
return Number.isNaN(d.getTime()) ? null : d;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=dates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.js","sourceRoot":"","sources":["../../src/lib/dates.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,IAAI,CAAA;AACnB,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,CAAA;AAC1B,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,CAAA;AACxB,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,CAAA;AAErB,MAAM,UAAU,kBAAkB,CAAC,IAAmB;IAClD,MAAM,CAAC,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC1D,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;IACtB,MAAM,IAAI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AE,CAAC;QACX,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAA;IAC/E,CAAC;IAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAChG,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAe;IACrC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA;IAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/C,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CliError as BaseCliError, type CliErrorCode, type ErrorType } from '@doist/cli-core';
|
|
2
|
+
export { BaseCliError };
|
|
3
|
+
export type { ErrorType } from '@doist/cli-core';
|
|
4
|
+
/**
|
|
5
|
+
* Known error codes used across the CLI.
|
|
6
|
+
* This union provides intellisense suggestions while still accepting any string,
|
|
7
|
+
* allowing dynamic codes and future additions.
|
|
8
|
+
*/
|
|
9
|
+
export type ErrorCode = 'AUTH_FAILED' | 'INSUFFICIENT_SCOPE' | 'INVALID_TOKEN' | 'NO_TOKEN' | 'READ_ONLY' | 'CONFLICTING_OPTIONS' | 'INVALID_CURSOR' | 'INVALID_DATE' | 'INVALID_ID' | 'INVALID_MINUTES' | 'INVALID_REF' | 'INVALID_SCOPE' | 'INVALID_STATE' | 'INVALID_TYPE' | 'INVALID_URL' | 'INVALID_VALUE' | 'MISSING_CONTENT' | 'MISSING_YES_FLAG' | 'UNKNOWN_KEY' | 'INVALID_NAME' | 'MISSING_USERS' | 'ACCOUNT_NOT_FOUND' | 'CHANNEL_NOT_FOUND' | 'GROUP_NOT_FOUND' | 'NOT_FOUND' | 'USER_NOT_FOUND' | 'WORKSPACE_NOT_FOUND' | 'AMBIGUOUS_CHANNEL' | 'AMBIGUOUS_GROUP' | 'AMBIGUOUS_USER' | 'AMBIGUOUS_WORKSPACE' | 'ALREADY_INSTALLED' | 'BATCH_FAILED' | 'FILE_READ_ERROR' | 'NOT_CREATOR' | 'NOT_INSTALLED' | 'UNKNOWN_AGENT' | 'API_ERROR' | 'INTERNAL_ERROR' | 'CONFIG_READ_FAILED' | 'CONFIG_INVALID_JSON' | 'CONFIG_INVALID_SHAPE' | (string & {});
|
|
10
|
+
/**
|
|
11
|
+
* Check whether an error is a Comms API 403 "Insufficient scope" response.
|
|
12
|
+
* Works with any error shaped like CommsRequestError (httpStatusCode + responseData).
|
|
13
|
+
*/
|
|
14
|
+
export declare function isInsufficientScope(error: unknown): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Comms-flavoured CliError that preserves the historical positional
|
|
17
|
+
* `(code, message, hints?, type?)` signature used across hundreds of call
|
|
18
|
+
* sites. Internally it forwards to the cli-core options-object form.
|
|
19
|
+
*
|
|
20
|
+
* `code` accepts the local Comms `ErrorCode` union plus any cli-core
|
|
21
|
+
* canonical code (`CliErrorCode`), so call sites like
|
|
22
|
+
* `new CliError('CONFIG_READ_FAILED', …)` still type-check without
|
|
23
|
+
* `CONFIG_*` having to live in the local union.
|
|
24
|
+
*/
|
|
25
|
+
export declare class CliError extends BaseCliError<ErrorCode> {
|
|
26
|
+
constructor(code: ErrorCode | CliErrorCode, message: string, hints?: string[], type?: ErrorType);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE7F,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAEf,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,UAAU,GACV,WAAW,GAEX,qBAAqB,GACrB,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,eAAe,GACf,cAAc,GACd,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,kBAAkB,GAClB,aAAa,GACb,cAAc,GACd,eAAe,GAEf,mBAAmB,GACnB,mBAAmB,GACnB,iBAAiB,GACjB,WAAW,GACX,gBAAgB,GAChB,qBAAqB,GAErB,mBAAmB,GACnB,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,GAErB,mBAAmB,GACnB,cAAc,GACd,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,eAAe,GAEf,WAAW,GACX,gBAAgB,GAEhB,oBAAoB,GACpB,qBAAqB,GACrB,sBAAsB,GAEtB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEnB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAkB3D;AAED;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,YAAY,CAAC,SAAS,CAAC;gBAE7C,IAAI,EAAE,SAAS,GAAG,YAAY,EAC9B,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,IAAI,GAAE,SAAmB;CAIhC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CliError as BaseCliError } from '@doist/cli-core';
|
|
2
|
+
export { BaseCliError };
|
|
3
|
+
/**
|
|
4
|
+
* Check whether an error is a Comms API 403 "Insufficient scope" response.
|
|
5
|
+
* Works with any error shaped like CommsRequestError (httpStatusCode + responseData).
|
|
6
|
+
*/
|
|
7
|
+
export function isInsufficientScope(error) {
|
|
8
|
+
if (typeof error !== 'object' ||
|
|
9
|
+
error === null ||
|
|
10
|
+
!('httpStatusCode' in error) ||
|
|
11
|
+
!('responseData' in error)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const { httpStatusCode, responseData } = error;
|
|
15
|
+
return (httpStatusCode === 403 &&
|
|
16
|
+
typeof responseData?.error_string === 'string' &&
|
|
17
|
+
responseData.error_string.includes('Insufficient scope'));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Comms-flavoured CliError that preserves the historical positional
|
|
21
|
+
* `(code, message, hints?, type?)` signature used across hundreds of call
|
|
22
|
+
* sites. Internally it forwards to the cli-core options-object form.
|
|
23
|
+
*
|
|
24
|
+
* `code` accepts the local Comms `ErrorCode` union plus any cli-core
|
|
25
|
+
* canonical code (`CliErrorCode`), so call sites like
|
|
26
|
+
* `new CliError('CONFIG_READ_FAILED', …)` still type-check without
|
|
27
|
+
* `CONFIG_*` having to live in the local union.
|
|
28
|
+
*/
|
|
29
|
+
export class CliError extends BaseCliError {
|
|
30
|
+
constructor(code, message, hints, type = 'error') {
|
|
31
|
+
super(code, message, { hints, type });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAqC,MAAM,iBAAiB,CAAA;AAE7F,OAAO,EAAE,YAAY,EAAE,CAAA;AA6DvB;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAC9C,IACI,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,CAAC,gBAAgB,IAAI,KAAK,CAAC;QAC5B,CAAC,CAAC,cAAc,IAAI,KAAK,CAAC,EAC5B,CAAC;QACC,OAAO,KAAK,CAAA;IAChB,CAAC;IACD,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,KAGxC,CAAA;IACD,OAAO,CACH,cAAc,KAAK,GAAG;QACtB,OAAO,YAAY,EAAE,YAAY,KAAK,QAAQ;QAC9C,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAC3D,CAAA;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,QAAS,SAAQ,YAAuB;IACjD,YACI,IAA8B,EAC9B,OAAe,EACf,KAAgB,EAChB,OAAkB,OAAO;QAEzB,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACzC,CAAC;CACJ"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-CLI extension of `@doist/cli-core`'s global-args parser.
|
|
3
|
+
*
|
|
4
|
+
* Layers comms's `--include-private-channels`, `--non-interactive`,
|
|
5
|
+
* `--interactive`, and the `--progress-jsonl <path>` space form on top of
|
|
6
|
+
* the subset of cli-core's canonical shape that comms actually registers
|
|
7
|
+
* with Commander (`--json`, `--ndjson`, `--accessible`, `--no-spinner`,
|
|
8
|
+
* `--progress-jsonl[=path]`).
|
|
9
|
+
*
|
|
10
|
+
* cli-core's parser also surfaces `quiet` and `verbose` from argv, but
|
|
11
|
+
* comms does not register `--quiet` or `--verbose` globally (Commander
|
|
12
|
+
* would reject them) — so we drop them from the exported shape to avoid
|
|
13
|
+
* the type/API leak where helpers believe the binary supports them.
|
|
14
|
+
*/
|
|
15
|
+
import { type GlobalArgs as CoreGlobalArgs } from '@doist/cli-core';
|
|
16
|
+
type CommsSpecificFlags = {
|
|
17
|
+
/** Bare/string/false — see `CommsLocalFlags.progressJsonl` for semantics. */
|
|
18
|
+
progressJsonl: string | true | false;
|
|
19
|
+
/** Resolved path for `--progress-jsonl` (any form). `undefined` when bare or absent. */
|
|
20
|
+
progressJsonlPath: string | undefined;
|
|
21
|
+
includePrivateChannels: boolean;
|
|
22
|
+
nonInteractive: boolean;
|
|
23
|
+
interactive: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Public shape exposed to comms callers. Drops cli-core's `quiet` and
|
|
27
|
+
* `verbose` because comms does not register `--quiet` / `--verbose` with
|
|
28
|
+
* Commander — exposing them in the type would lie about what the binary
|
|
29
|
+
* supports.
|
|
30
|
+
*/
|
|
31
|
+
export type GlobalArgs = Pick<CoreGlobalArgs, 'json' | 'ndjson' | 'accessible' | 'noSpinner' | 'user'> & CommsSpecificFlags;
|
|
32
|
+
/**
|
|
33
|
+
* Parse well-known global flags from an argv array. Pure — pass an explicit
|
|
34
|
+
* array for testing, or omit to read `process.argv`. Returns the narrowed
|
|
35
|
+
* comms surface; cli-core's `quiet` and `verbose` are intentionally
|
|
36
|
+
* dropped (see {@link GlobalArgs}).
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseGlobalArgs(argv?: string[]): GlobalArgs;
|
|
39
|
+
/** Clear the cached parse result. Call in test teardown. */
|
|
40
|
+
export declare const resetGlobalArgs: () => void;
|
|
41
|
+
export declare function isJsonMode(): boolean;
|
|
42
|
+
export declare function isNdjsonMode(): boolean;
|
|
43
|
+
/** Pre-subcommand `tdc --user <ref>` (see `stripUserFlag` in `src/index.ts`). */
|
|
44
|
+
export declare function getRequestedUserRef(): string | undefined;
|
|
45
|
+
export declare function isNonInteractive(): boolean;
|
|
46
|
+
export declare function includePrivateChannels(): boolean;
|
|
47
|
+
export declare function isProgressJsonlEnabled(): boolean;
|
|
48
|
+
export declare function getProgressJsonlPath(): string | undefined;
|
|
49
|
+
export declare const isAccessible: () => boolean;
|
|
50
|
+
export declare const shouldDisableSpinner: () => boolean;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=global-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-args.d.ts","sourceRoot":"","sources":["../../src/lib/global-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAIH,KAAK,UAAU,IAAI,cAAc,EAEpC,MAAM,iBAAiB,CAAA;AAExB,KAAK,kBAAkB,GAAG;IACtB,6EAA6E;IAC7E,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAA;IACpC,wFAAwF;IACxF,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,sBAAsB,EAAE,OAAO,CAAA;IAC/B,cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;CACvB,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,CACzB,cAAc,EACd,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,MAAM,CAC1D,GACG,kBAAkB,CAAA;AA+EtB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAG3D;AAID,4DAA4D;AAC5D,eAAO,MAAM,eAAe,YAAc,CAAA;AAM1C,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,SAAS,CAExD;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAK1C;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAMhD;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,SAAS,CAEzD;AAED,eAAO,MAAM,YAAY,eAGvB,CAAA;AAEF,eAAO,MAAM,oBAAoB,eAI/B,CAAA"}
|