@doist/twist-cli 2.34.0 → 2.35.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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## [2.35.0](https://github.com/Doist/twist-cli/compare/v2.34.0...v2.35.0) (2026-04-29)
2
+
3
+ ### Features
4
+
5
+ - add mentions command and search pagination ([#197](https://github.com/Doist/twist-cli/issues/197)) ([0fe72bf](https://github.com/Doist/twist-cli/commit/0fe72bf7bf80bf4627df29f6c1ba9d1df61fb6c1))
6
+
1
7
  ## [2.34.0](https://github.com/Doist/twist-cli/compare/v2.33.0...v2.34.0) (2026-04-27)
2
8
 
3
9
  ### Features
package/README.md CHANGED
@@ -100,6 +100,8 @@ tw auth logout # remove saved token
100
100
  ```bash
101
101
  tw inbox # inbox threads
102
102
  tw inbox --unread # unread threads only
103
+ tw mentions # content mentioning you
104
+ tw mentions --since 2026-04-01 --all --json
103
105
  tw thread view <ref> # view thread with comments
104
106
  tw thread view <ref> --comment 123 # view a specific comment
105
107
  tw thread reply <ref> # reply to a thread
@@ -109,6 +111,7 @@ tw conversation unread # list unread conversations
109
111
  tw conversation view <ref> # view conversation messages
110
112
  tw msg view <ref> # view a conversation message
111
113
  tw search "keyword" # search across workspace
114
+ tw search "keyword" --all # fetch all result pages
112
115
  tw react thread <ref> 👍 # add reaction
113
116
  tw away # show away status
114
117
  tw away set vacation 2026-03-20 # set away until date
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerMentionsCommand(program: Command): void;
3
+ //# sourceMappingURL=mentions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../src/commands/mentions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAoBnC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoB9D"}
@@ -0,0 +1,23 @@
1
+ import { addSharedSearchOptions, printSearchResults, runSearch, } from '../lib/search-helpers.js';
2
+ async function mentions(workspaceRef, options) {
3
+ const { workspaceId, response } = await runSearch(workspaceRef, {
4
+ ...options,
5
+ mentionSelf: true,
6
+ });
7
+ printSearchResults(workspaceId, response, options);
8
+ }
9
+ export function registerMentionsCommand(program) {
10
+ const command = addSharedSearchOptions(program
11
+ .command('mentions [workspace-ref]')
12
+ .description('Show content mentioning the current user'), {
13
+ limitDescription: 'Max results per page (default: 50)',
14
+ });
15
+ command
16
+ .addHelpText('after', `
17
+ Examples:
18
+ tw mentions
19
+ tw mentions --since 2026-04-01 --all
20
+ tw mentions --type threads --json`)
21
+ .action(mentions);
22
+ }
23
+ //# sourceMappingURL=mentions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mentions.js","sourceRoot":"","sources":["../../src/commands/mentions.ts"],"names":[],"mappings":"AACA,OAAO,EACH,sBAAsB,EACtB,kBAAkB,EAClB,SAAS,GAEZ,MAAM,0BAA0B,CAAA;AAEjC,KAAK,UAAU,QAAQ,CACnB,YAAgC,EAChC,OAA4B;IAE5B,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,MAAM,SAAS,CAAC,YAAY,EAAE;QAC5D,GAAG,OAAO;QACV,WAAW,EAAE,IAAI;KACpB,CAAC,CAAA;IAEF,kBAAkB,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;AACtD,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACpD,MAAM,OAAO,GAAG,sBAAsB,CAClC,OAAO;SACF,OAAO,CAAC,0BAA0B,CAAC;SACnC,WAAW,CAAC,0CAA0C,CAAC,EAC5D;QACI,gBAAgB,EAAE,oCAAoC;KACzD,CACJ,CAAA;IAED,OAAO;SACF,WAAW,CACR,OAAO,EACP;;;;oCAIwB,CAC3B;SACA,MAAM,CAAC,QAAQ,CAAC,CAAA;AACzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAA;AA8L3C,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiC5D"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA2BnC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB5D"}
@@ -1,152 +1,30 @@
1
- import { getFullTwistURL } from '@doist/twist-sdk';
2
- import { Option } from 'commander';
3
- import { getCurrentWorkspaceId } from '../lib/api.js';
4
- import { withCaseInsensitiveChoices } from '../lib/completion.js';
5
- import { formatRelativeDate } from '../lib/dates.js';
6
- import { CliError } from '../lib/errors.js';
7
- import { includePrivateChannels } from '../lib/global-args.js';
8
- import { colors, formatJson } from '../lib/output.js';
9
- import { getPublicChannelIds } from '../lib/public-channels.js';
10
- import { resolveChannelId, resolveConversationId, resolveUserRefs, resolveWorkspaceRef, } from '../lib/refs.js';
11
- import { extendedSearch } from '../lib/search-api.js';
12
- function resolveNumericRefs(refs, entityType, resolver) {
13
- if (!refs)
14
- return undefined;
15
- return refs.split(',').map((raw) => {
16
- const ref = raw.trim();
17
- if (!ref) {
18
- throw new CliError('INVALID_REF', `Invalid ${entityType} reference list: found empty value`);
19
- }
20
- return resolver(ref);
21
- });
22
- }
1
+ import { addSharedSearchOptions, printSearchResults, runSearch, } from '../lib/search-helpers.js';
23
2
  async function search(query, workspaceRef, options) {
24
- if (workspaceRef && options.workspace) {
25
- throw new CliError('CONFLICTING_OPTIONS', 'Cannot specify workspace both as argument and --workspace flag');
26
- }
27
- let workspaceId;
28
- const ref = workspaceRef || options.workspace;
29
- if (ref) {
30
- const workspace = await resolveWorkspaceRef(ref);
31
- workspaceId = workspace.id;
32
- }
33
- else {
34
- workspaceId = await getCurrentWorkspaceId();
35
- }
36
- const limit = options.limit ? parseInt(options.limit, 10) : 50;
37
- const channelIds = resolveNumericRefs(options.channel, 'channel', resolveChannelId);
38
- const authorIds = options.author
39
- ? await resolveUserRefs(options.author, workspaceId)
40
- : undefined;
41
- const toUserIds = options.to ? await resolveUserRefs(options.to, workspaceId) : undefined;
42
- const conversationIds = resolveNumericRefs(options.conversation, 'conversation', resolveConversationId);
43
- const response = await extendedSearch({
44
- workspaceId,
3
+ const { workspaceId, response } = await runSearch(workspaceRef, {
4
+ ...options,
45
5
  query: options.titleOnly ? undefined : query,
46
6
  title: options.titleOnly ? query : undefined,
47
- type: options.type,
48
- channelIds,
49
- conversationIds,
50
- authorIds,
51
- toUserIds,
52
7
  mentionSelf: options.mentionMe,
53
- dateFrom: options.since,
54
- dateTo: options.until,
55
- limit,
56
- cursor: options.cursor,
57
8
  });
58
- if (!includePrivateChannels()) {
59
- const publicIds = await getPublicChannelIds(workspaceId);
60
- response.items = response.items.filter((item) => !item.channelId || publicIds.has(item.channelId));
61
- }
62
- if (response.items.length === 0) {
63
- if (response.hasMore && response.nextCursorMark) {
64
- console.log('No public results on this page.');
65
- console.log(colors.timestamp(`More results available. Use --cursor ${response.nextCursorMark}`));
66
- }
67
- else {
68
- console.log('No results found.');
69
- }
70
- return;
71
- }
72
- if (options.json) {
73
- const output = {
74
- results: response.items.map((r) => ({
75
- ...r,
76
- url: buildSearchResultUrl(workspaceId, r),
77
- })),
78
- nextCursor: response.nextCursorMark || null,
79
- };
80
- console.log(formatJson(output, undefined, options.full));
81
- return;
82
- }
83
- if (options.ndjson) {
84
- for (const r of response.items) {
85
- console.log(JSON.stringify({ ...r, url: buildSearchResultUrl(workspaceId, r) }));
86
- }
87
- if (response.nextCursorMark) {
88
- console.log(JSON.stringify({ _meta: true, nextCursor: response.nextCursorMark }));
89
- }
90
- return;
91
- }
92
- for (const result of response.items) {
93
- const type = colors.channel(`[${result.type}]`);
94
- const title = result.title || result.snippet.slice(0, 50);
95
- const time = colors.timestamp(formatRelativeDate(result.snippetLastUpdated));
96
- console.log(`${type} ${title}`);
97
- console.log(` ${colors.timestamp(result.snippet.slice(0, 100))}`);
98
- console.log(` ${time} ${colors.url(buildSearchResultUrl(workspaceId, result))}`);
99
- console.log('');
100
- }
101
- if (response.hasMore) {
102
- console.log(colors.timestamp(`More results available. Use --cursor ${response.nextCursorMark}`));
103
- }
104
- }
105
- function buildSearchResultUrl(workspaceId, result) {
106
- if (result.type === 'thread' && result.threadId && result.channelId) {
107
- return getFullTwistURL({
108
- workspaceId,
109
- channelId: result.channelId,
110
- threadId: result.threadId,
111
- });
112
- }
113
- if (result.type === 'comment' && result.threadId && result.channelId && result.commentId) {
114
- return getFullTwistURL({
115
- workspaceId,
116
- channelId: result.channelId,
117
- threadId: result.threadId,
118
- commentId: result.commentId,
119
- });
120
- }
121
- if (result.type === 'message' && result.conversationId) {
122
- return getFullTwistURL({ workspaceId, conversationId: result.conversationId });
123
- }
124
- return `https://twist.com/a/${workspaceId}`;
9
+ printSearchResults(workspaceId, response, options);
125
10
  }
126
11
  export function registerSearchCommand(program) {
127
- program
12
+ const command = addSharedSearchOptions(program
128
13
  .command('search <query> [workspace-ref]')
129
- .description('Search content across a workspace')
130
- .option('--workspace <ref>', 'Workspace ID or name')
131
- .option('--channel <channel-refs>', 'Filter by channels (comma-separated refs)')
132
- .option('--author <user-refs>', 'Filter by author (comma-separated IDs)')
133
- .option('--to <user-refs>', 'Messages sent TO user (comma-separated IDs)')
134
- .addOption(withCaseInsensitiveChoices(new Option('--type <type>', 'Filter: threads, messages, or all'), ['threads', 'messages', 'all']))
135
- .option('--title-only', 'Search in thread titles only')
136
- .option('--conversation <refs>', 'Limit to conversations (comma-separated refs)')
137
- .option('--mention-me', 'Only results mentioning current user')
138
- .option('--since <date>', 'Content from date')
139
- .option('--until <date>', 'Content until date')
140
- .option('--limit <n>', 'Max results (default: 50)')
141
- .option('--cursor <cursor>', 'Pagination cursor')
142
- .option('--json', 'Output as JSON')
143
- .option('--ndjson', 'Output as newline-delimited JSON')
144
- .option('--full', 'Include all fields in JSON output')
14
+ .description('Search content across a workspace'), {
15
+ addUniqueFilters: (command) => {
16
+ command
17
+ .option('--title-only', 'Search in thread titles only')
18
+ .option('--mention-me', 'Only results mentioning current user');
19
+ },
20
+ });
21
+ command
145
22
  .addHelpText('after', `
146
23
  Examples:
147
24
  tw search "deployment issue"
148
25
  tw search "bug report" --type threads --channel id:12345
149
- tw search "API" --author id:5678 --since 2025-01-01 --json`)
26
+ tw search "API" --author id:5678 --since 2025-01-01 --json
27
+ tw search "incident" --all --json`)
150
28
  .action(search);
151
29
  }
152
30
  //# sourceMappingURL=search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAmB,MAAM,sBAAsB,CAAA;AAEtE,SAAS,kBAAkB,CACvB,IAAwB,EACxB,UAAkB,EAClB,QAAiC;IAEjC,IAAI,CA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,CAAA;AACvB,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ const loadConversationCommand = async () => (await import('./commands/conversati
14
14
  const loadMsgCommand = async () => (await import('./commands/msg/index.js')).registerMsgCommand;
15
15
  const loadCommentCommand = async () => (await import('./commands/comment/index.js')).registerCommentCommand;
16
16
  const loadSearchCommand = async () => (await import('./commands/search.js')).registerSearchCommand;
17
+ const loadMentionsCommand = async () => (await import('./commands/mentions.js')).registerMentionsCommand;
17
18
  const loadReactCommand = async () => (await import('./commands/react.js')).registerReactCommand;
18
19
  const loadAuthCommand = async () => (await import('./commands/auth/index.js')).registerAuthCommand;
19
20
  const loadSkillCommand = async () => (await import('./commands/skill/index.js')).registerSkillCommand;
@@ -37,6 +38,7 @@ const commands = {
37
38
  msg: ['Conversation message operations (view, update, delete)', loadMsgCommand],
38
39
  comment: ['Thread comment operations (view, update, delete)', loadCommentCommand],
39
40
  search: ['Search content across a workspace', loadSearchCommand],
41
+ mentions: ['Show content mentioning the current user', loadMentionsCommand],
40
42
  away: ['Manage away status', loadAwayCommand],
41
43
  react: ['Add an emoji reaction (target-type: thread, comment, message)', loadReactCommand],
42
44
  unreact: ['Remove an emoji reaction (target-type: thread, comment, message)', loadReactCommand],
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEtE,MAAM,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Options } from './options.js';
3
+ import { type ExtendedSearchResponse, type SearchType } from './search-api.js';
4
+ export type SharedSearchOptions = PaginatedViewOptions & {
5
+ workspace?: string;
6
+ channel?: string;
7
+ author?: string;
8
+ to?: string;
9
+ type?: SearchType;
10
+ conversation?: string;
11
+ cursor?: string;
12
+ all?: boolean;
13
+ };
14
+ type SearchRequestOptions = SharedSearchOptions & {
15
+ query?: string;
16
+ title?: string;
17
+ mentionSelf?: boolean;
18
+ };
19
+ interface SearchRunResult {
20
+ workspaceId: number;
21
+ response: ExtendedSearchResponse;
22
+ }
23
+ type SharedSearchOptionConfig = {
24
+ addUniqueFilters?: (command: Command) => void;
25
+ limitDescription?: string;
26
+ };
27
+ export declare function addSharedSearchOptions<T extends Command>(command: T, config?: SharedSearchOptionConfig): T;
28
+ export declare function runSearch(workspaceRef: string | undefined, options: SearchRequestOptions): Promise<SearchRunResult>;
29
+ type SearchOutputOptions = Pick<SharedSearchOptions, 'all' | 'json' | 'ndjson' | 'full'>;
30
+ export declare function printSearchResults(workspaceId: number, response: ExtendedSearchResponse, options: SearchOutputOptions): void;
31
+ export {};
32
+ //# sourceMappingURL=search-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-helpers.d.ts","sourceRoot":"","sources":["../../src/lib/search-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAA;AAM3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AASxD,OAAO,EAGH,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EAClB,MAAM,iBAAiB,CAAA;AAoBxB,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG;IACrD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,KAAK,oBAAoB,GAAG,mBAAmB,GAAG;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,UAAU,eAAe;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,sBAAsB,CAAA;CACnC;AAED,KAAK,wBAAwB,GAAG;IAC5B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,OAAO,EACpD,OAAO,EAAE,CAAC,EACV,MAAM,GAAE,wBAA6B,GACtC,CAAC,CA2BH;AAmGD,wBAAsB,SAAS,CAC3B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,EAAE,oBAAoB,GAC9B,OAAO,CAAC,eAAe,CAAC,CAQ1B;AAiCD,KAAK,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAA;AAExF,wBAAgB,kBAAkB,CAC9B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,sBAAsB,EAChC,OAAO,EAAE,mBAAmB,GAC7B,IAAI,CA4DN"}
@@ -0,0 +1,183 @@
1
+ import { getFullTwistURL } from '@doist/twist-sdk';
2
+ import { Option } from 'commander';
3
+ import { getCurrentWorkspaceId } from './api.js';
4
+ import { withCaseInsensitiveChoices } from './completion.js';
5
+ import { formatRelativeDate } from './dates.js';
6
+ import { CliError } from './errors.js';
7
+ import { includePrivateChannels } from './global-args.js';
8
+ import { colors, formatJson } from './output.js';
9
+ import { getPublicChannelIds } from './public-channels.js';
10
+ import { resolveChannelId, resolveConversationId, resolveUserRefs, resolveWorkspaceRef, } from './refs.js';
11
+ import { extendedSearch, } from './search-api.js';
12
+ function resolveNumericRefs(refs, entityType, resolver) {
13
+ if (!refs)
14
+ return undefined;
15
+ return refs.split(',').map((raw) => {
16
+ const ref = raw.trim();
17
+ if (!ref) {
18
+ throw new CliError('INVALID_REF', `Invalid ${entityType} reference list: found empty value`);
19
+ }
20
+ return resolver(ref);
21
+ });
22
+ }
23
+ export function addSharedSearchOptions(command, config = {}) {
24
+ const limitDescription = config.limitDescription ?? 'Max results (default: 50)';
25
+ command
26
+ .option('--workspace <ref>', 'Workspace ID or name')
27
+ .option('--channel <channel-refs>', 'Filter by channels (comma-separated refs)')
28
+ .option('--author <user-refs>', 'Filter by author (comma-separated refs)')
29
+ .option('--to <user-refs>', 'Messages sent to user (comma-separated refs)')
30
+ .addOption(withCaseInsensitiveChoices(new Option('--type <type>', 'Filter: threads, messages, or all'), ['threads', 'messages', 'all']));
31
+ config.addUniqueFilters?.(command);
32
+ return command
33
+ .option('--conversation <refs>', 'Limit to conversations (comma-separated refs)')
34
+ .option('--since <date>', 'Content from date')
35
+ .option('--until <date>', 'Content until date')
36
+ .option('--limit <n>', limitDescription)
37
+ .option('--cursor <cursor>', 'Pagination cursor')
38
+ .option('--all', 'Fetch all pages of results')
39
+ .option('--json', 'Output as JSON')
40
+ .option('--ndjson', 'Output as newline-delimited JSON')
41
+ .option('--full', 'Include all fields in JSON output');
42
+ }
43
+ async function resolveWorkspaceId(workspaceRef, workspaceOption) {
44
+ if (workspaceRef && workspaceOption) {
45
+ throw new CliError('CONFLICTING_OPTIONS', 'Cannot specify workspace both as argument and --workspace flag');
46
+ }
47
+ const ref = workspaceRef || workspaceOption;
48
+ if (!ref) {
49
+ return getCurrentWorkspaceId();
50
+ }
51
+ const workspace = await resolveWorkspaceRef(ref);
52
+ return workspace.id;
53
+ }
54
+ async function buildSearchParams(workspaceId, options) {
55
+ const limit = options.limit ? parseInt(options.limit, 10) : 50;
56
+ const channelIds = resolveNumericRefs(options.channel, 'channel', resolveChannelId);
57
+ const authorIds = options.author
58
+ ? await resolveUserRefs(options.author, workspaceId)
59
+ : undefined;
60
+ const toUserIds = options.to ? await resolveUserRefs(options.to, workspaceId) : undefined;
61
+ const conversationIds = resolveNumericRefs(options.conversation, 'conversation', resolveConversationId);
62
+ return {
63
+ workspaceId,
64
+ query: options.query,
65
+ title: options.title,
66
+ type: options.type,
67
+ channelIds,
68
+ conversationIds,
69
+ authorIds,
70
+ toUserIds,
71
+ mentionSelf: options.mentionSelf,
72
+ dateFrom: options.since,
73
+ dateTo: options.until,
74
+ limit,
75
+ cursor: options.cursor,
76
+ };
77
+ }
78
+ async function fetchSearchPages(params, all = false) {
79
+ if (!all) {
80
+ return extendedSearch(params);
81
+ }
82
+ const items = [];
83
+ let cursor = params.cursor;
84
+ let hasMore = false;
85
+ let isPlanRestricted = false;
86
+ do {
87
+ const response = await extendedSearch({ ...params, cursor });
88
+ items.push(...response.items);
89
+ cursor = response.nextCursorMark;
90
+ hasMore = response.hasMore;
91
+ isPlanRestricted = isPlanRestricted || response.isPlanRestricted;
92
+ } while (hasMore && cursor);
93
+ return {
94
+ items,
95
+ hasMore: false,
96
+ isPlanRestricted,
97
+ };
98
+ }
99
+ async function filterVisibleSearchResults(workspaceId, response) {
100
+ if (includePrivateChannels()) {
101
+ return response;
102
+ }
103
+ const publicIds = await getPublicChannelIds(workspaceId);
104
+ return {
105
+ ...response,
106
+ items: response.items.filter((item) => !item.channelId || publicIds.has(item.channelId)),
107
+ };
108
+ }
109
+ export async function runSearch(workspaceRef, options) {
110
+ const workspaceId = await resolveWorkspaceId(workspaceRef, options.workspace);
111
+ const params = await buildSearchParams(workspaceId, options);
112
+ const response = await fetchSearchPages(params, options.all);
113
+ return {
114
+ workspaceId,
115
+ response: await filterVisibleSearchResults(workspaceId, response),
116
+ };
117
+ }
118
+ function buildSearchResultUrl(workspaceId, result) {
119
+ if (result.type === 'thread' && result.threadId && result.channelId) {
120
+ return getFullTwistURL({
121
+ workspaceId,
122
+ channelId: result.channelId,
123
+ threadId: result.threadId,
124
+ });
125
+ }
126
+ if (result.type === 'comment' && result.threadId && result.channelId && result.commentId) {
127
+ return getFullTwistURL({
128
+ workspaceId,
129
+ channelId: result.channelId,
130
+ threadId: result.threadId,
131
+ commentId: result.commentId,
132
+ });
133
+ }
134
+ if (result.type === 'message' && result.conversationId) {
135
+ return getFullTwistURL({ workspaceId, conversationId: result.conversationId });
136
+ }
137
+ return `https://twist.com/a/${workspaceId}`;
138
+ }
139
+ export function printSearchResults(workspaceId, response, options) {
140
+ const resultsWithUrls = response.items.map((result) => ({
141
+ ...result,
142
+ url: buildSearchResultUrl(workspaceId, result),
143
+ }));
144
+ if (options.json) {
145
+ console.log(formatJson({
146
+ results: resultsWithUrls,
147
+ nextCursor: response.nextCursorMark || null,
148
+ }, undefined, options.full));
149
+ return;
150
+ }
151
+ if (options.ndjson) {
152
+ for (const result of resultsWithUrls) {
153
+ console.log(JSON.stringify(result));
154
+ }
155
+ if (resultsWithUrls.length === 0 || response.nextCursorMark) {
156
+ console.log(JSON.stringify({ _meta: true, nextCursor: response.nextCursorMark || null }));
157
+ }
158
+ return;
159
+ }
160
+ if (resultsWithUrls.length === 0) {
161
+ if (!options.all && response.hasMore && response.nextCursorMark) {
162
+ console.log('No public results on this page.');
163
+ console.log(colors.timestamp(`More results available. Use --cursor ${response.nextCursorMark}`));
164
+ }
165
+ else {
166
+ console.log('No results found.');
167
+ }
168
+ return;
169
+ }
170
+ for (const result of resultsWithUrls) {
171
+ const type = colors.channel(`[${result.type}]`);
172
+ const title = result.title || result.snippet.slice(0, 50);
173
+ const time = colors.timestamp(formatRelativeDate(result.snippetLastUpdated));
174
+ console.log(`${type} ${title}`);
175
+ console.log(` ${colors.timestamp(result.snippet.slice(0, 100))}`);
176
+ console.log(` ${time} ${colors.url(result.url)}`);
177
+ console.log('');
178
+ }
179
+ if (!options.all && response.hasMore) {
180
+ console.log(colors.timestamp(`More results available. Use --cursor ${response.nextCursorMark}`));
181
+ }
182
+ }
183
+ //# sourceMappingURL=search-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-helpers.js","sourceRoot":"","sources":["../../src/lib/search-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAqB,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACtB,MAAM,WAAW,CAAA;AAClB,OAAO,EACH,cAAc,GAIjB,MAAM,iBAAiB,CAAA;AAExB,SAAS,kBAAkB,CACvB,IAAwB,EACxB,UAAkB,EAClB,QAAiC;IAEjC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAA;IAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;QACtB,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,MAAM,IAAI,QAAQ,CACd,aAAa,EACb,WAAW,UAAU,oCAAoC,CAC5D,CAAA;QACL,CAAC;QACD,OAAO,QAAQ,CAAC,GAAG,C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ACJ,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QACpC,CAAC;QACD,OAAM;IACV,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,CAAA;QAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAA;QAE5E,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAA;QAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QAClE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACnD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACnB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACnC,OAAO,CAAC,GAAG,CACP,MAAM,CAAC,SAAS,CAAC,wCAAwC,QAAQ,CAAC,cAAc,EAAE,CAAC,CACtF,CAAA;IACL,CAAC;AACL,CAAC"}
@@ -1,8 +1,8 @@
1
1
  export declare const SKILL_NAME = "twist-cli";
2
- export declare const SKILL_DESCRIPTION = "Twist messaging CLI. View and respond to inbox threads, channel threads, direct messages, and group conversations; search, react, archive, mute, and manage workspaces. Use when the user mentions Twist, asks about their inbox, threads, DMs, channels, or wants to read or send Twist messages.";
2
+ export declare const SKILL_DESCRIPTION = "Twist messaging CLI. View and respond to inbox threads, channel threads, direct messages, mentions, and group conversations; search, react, archive, mute, and manage workspaces. Use when the user mentions Twist, asks about their inbox, mentions, threads, DMs, channels, or wants to read or send Twist messages.";
3
3
  export declare const SKILL_AUTHOR = "Doist";
4
4
  export declare const SKILL_LICENSE = "MIT";
5
5
  export declare const SKILL_VERSION: string;
6
- export declare const SKILL_CONTENT = "# Twist CLI (tw)\n\nAccess Twist messaging via the `tw` CLI. Use when the user asks about their Twist workspaces, threads, messages, or wants to interact with Twist in any way.\n\n## Setup\n\n```bash\ntw auth login # OAuth login (opens browser, read-write)\ntw auth login --read-only # OAuth login with read-only scope\ntw auth token # Save API token manually (prompts securely; scope unknown, assumed write-capable)\ntw auth status # Verify authentication + show mode\ntw auth status --json # JSON output: { id, email, name }\ntw auth logout # Remove saved token and auth metadata\ntw workspaces # List available workspaces\ntw workspace use <ref> # Set current workspace\ntw completion install # Install shell completions\ntw config view # Show the current CLI configuration file (token masked)\ntw config set <key> <value> # Set a user preference (e.g. unarchive-new-threads true)\ntw doctor # Diagnose CLI setup and environment issues\ntw update # Update CLI to latest version\ntw changelog # Show recent changelog entries\n```\n\nStored auth uses the system credential manager when available. If secure storage is unavailable, `tw` warns and falls back to `~/.config/twist-cli/config.json`. `TWIST_API_TOKEN` always takes priority over the stored token, and legacy plaintext config tokens are migrated automatically when secure storage is available.\n\nIn read-only mode (`tw auth login --read-only`), commands that modify Twist data (reply, archive, react, delete, etc.) are blocked by the CLI. Externally provided tokens (`TWIST_API_TOKEN` or `tw auth token`) are treated as unknown scope and assumed write-capable.\n\n## View by URL\n\n```bash\ntw view <url> # View any Twist entity by URL\n```\n\nRoutes automatically based on URL structure:\n- Message URL \u2192 `tw msg view`\n- Conversation URL \u2192 `tw conversation view`\n- Thread+comment URL \u2192 `tw thread view` (comment ID extracted from URL)\n- Thread URL \u2192 `tw thread view`\n\nAll target command flags pass through (e.g. `--json`, `--raw`, `--full`).\n\n## Inbox\n\n```bash\ntw inbox # Show inbox threads\ntw inbox --unread # Only unread threads\ntw inbox --archive-filter all # Show active + done threads\ntw inbox --archive-filter archived # Show only done threads\ntw inbox --channel <filter> # Filter by channel name (fuzzy)\ntw inbox --since <date> # Filter by date (ISO format)\ntw inbox --limit <n> # Max items (default: 50)\n```\n\n## Threads\n\n```bash\ntw thread <thread-ref> # View thread (shorthand for view)\ntw thread view <thread-ref> # View thread with comments\ntw thread view <ref> --comment <id> # View a specific comment\ntw thread view <url-with-/c/id> # Comment ID extracted from URL\ntw thread view <ref> --unread # Show only unread comments\ntw thread view <ref> --context 3 # Include 3 read comments before unread\ntw thread view <ref> --limit 20 # Limit number of comments\ntw thread view <ref> --since <date> # Comments newer than date\ntw thread view <ref> --raw # Show raw markdown\ntw thread create <channel-ref> \"Title\" \"content\" # Create a new thread\ntw thread create <channel-ref> \"Title\" \"content\" --json # Create and return as JSON\ntw thread create <channel-ref> \"Title\" \"content\" --json --full # Include all thread fields\ntw thread create <channel-ref> \"Title\" \"content\" --notify 123,456 # Notify specific users\ntw thread create <channel-ref> \"Title\" \"content\" --unarchive # Land thread in author's Inbox (overrides default Twist auto-archive)\ntw thread create <channel-ref> \"Title\" \"content\" --no-unarchive # Force archive even when userSettings.unarchiveNewThreads=true\ntw thread create <channel-ref> \"Title\" \"content\" --dry-run # Preview without posting\ntw thread reply <ref> \"content\" # Post a comment (notifies EVERYONE_IN_THREAD by default)\ntw thread reply <ref> \"content\" --notify EVERYONE # Notify all workspace members\ntw thread reply <ref> \"content\" --notify 123,id:456 # Notify specific user IDs\ntw thread reply <ref> \"content\" --json # Post and return comment as JSON\ntw thread reply <ref> \"content\" --json --full # Include all comment fields\ntw thread reply <ref> \"content\" --close # Reply and close the thread\ntw thread reply <ref> \"content\" --reopen # Reply and reopen a closed thread\ntw thread done <ref> # Archive thread (mark done)\ntw thread done <ref> --json # Archive and return status as JSON\ntw thread mute <ref> # Mute thread for 60 minutes (default)\ntw thread mute <ref> --minutes 480 # Mute for custom duration\ntw thread mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntw thread mute <ref> --json --full # Mute and return full thread as JSON\ntw thread unmute <ref> # Unmute a muted thread\ntw thread unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\ntw thread delete <ref> # Preview thread deletion (requires --yes to execute)\ntw thread delete <ref> --yes # Permanently delete a thread\ntw thread delete <ref> --yes --json # Delete and return status as JSON\ntw thread rename <ref> \"New title\" # Rename a thread (change its title)\ntw thread rename <ref> \"New title\" --json # Rename and return { id, title } as JSON\ntw thread rename <ref> \"New title\" --json --full # Rename and return full thread as JSON\ntw thread update <ref> \"New body\" # Update a thread's body (the first post)\necho \"New body\" | tw thread update <ref> # Update body from stdin\ntw thread update <ref> \"New body\" --dry-run # Preview without updating\ntw thread update <ref> \"New body\" --json # Update and return { id, content } as JSON\ntw thread update <ref> \"New body\" --json --full # Update and return full thread as JSON\n```\n\nDefault `--notify` for reply is EVERYONE_IN_THREAD, which may notify more people than intended. Before posting, confirm with the user whether specific people should be notified instead (via `--notify <user-ids>`). Options: EVERYONE, EVERYONE_IN_THREAD, or comma-separated ID refs.\n\n`--notify` automatically resolves IDs: group IDs are routed to the `groups` API field, user IDs to `recipients`. No special syntax needed.\n\n## Thread Comments\n\n```bash\ntw comment <comment-ref> # View a comment (shorthand for view)\ntw comment view <comment-ref> # View a single thread comment\ntw comment view <comment-ref> --raw # Show raw markdown\ntw comment view <comment-ref> --json # Output as JSON\ntw comment view <comment-ref> --ndjson # Output as newline-delimited JSON\ntw comment view <comment-ref> --json --full # Include all fields in JSON output\ntw comment update <comment-ref> \"new content\" # Update a thread comment\ntw comment update <comment-ref> \"content\" --json # Update and return updated comment as JSON\ntw comment update <comment-ref> \"content\" --json --full # Include all comment fields\ntw comment delete <comment-ref> # Delete a thread comment\ntw comment delete <comment-ref> --json # Delete and return status as JSON\n```\n\n## Conversations (DMs/Groups)\n\n```bash\ntw conversation unread # List unread conversations\ntw conversation <conversation-ref> # View conversation (shorthand for view)\ntw conversation view <conversation-ref> # View conversation messages\ntw conversation with <user-ref> # Find your 1:1 DM with a user\ntw conversation with <user-ref> --snippet # Include the latest message preview\ntw conversation with <user-ref> --include-groups # List any conversations with that user\ntw conversation reply <ref> \"content\" # Send a message\ntw conversation reply <ref> \"content\" --json # Send and return message as JSON\ntw conversation reply <ref> \"content\" --json --full # Include all message fields\ntw conversation done <ref> # Archive conversation\ntw conversation done <ref> --json # Archive and return status as JSON\ntw conversation mute <ref> # Mute conversation for 60 minutes (default)\ntw conversation mute <ref> --minutes 480 # Mute for custom duration\ntw conversation mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntw conversation mute <ref> --json --full # Mute and return full conversation as JSON\ntw conversation unmute <ref> # Unmute a muted conversation\ntw conversation unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\n```\n\nAlias: `tw convo` works the same as `tw conversation`.\n\n## Conversation Messages\n\n```bash\ntw msg <message-ref> # View a message (shorthand for view)\ntw msg view <message-ref> # View a single conversation message\ntw msg update <ref> \"content\" # Edit a conversation message\ntw msg update <ref> \"content\" --json # Edit and return updated message as JSON\ntw msg update <ref> \"content\" --json --full # Include all message fields\ntw msg delete <ref> # Delete a conversation message\ntw msg delete <ref> --json # Delete and return status as JSON\n```\n\nAlias: `tw message` works the same as `tw msg`.\n\n## Search\n\n```bash\ntw search \"query\" # Search content\ntw search \"query\" --type threads # Filter: threads, messages, or all\ntw search \"query\" --author <ref> # Filter by author\ntw search \"query\" --to <ref> # Messages sent to user\ntw search \"query\" --title-only # Search thread titles only\ntw search \"query\" --mention-me # Results mentioning current user\ntw search \"query\" --conversation <refs> # Limit to conversations (comma-separated refs)\ntw search \"query\" --since <date> # Content from date\ntw search \"query\" --until <date> # Content until date\ntw search \"query\" --channel <refs> # Filter by channel refs (comma-separated)\ntw search \"query\" --limit <n> # Max results (default: 50)\ntw search \"query\" --cursor <cur> # Pagination cursor\n```\n\n## Users, Channels & Groups\n\n```bash\ntw user # Show current user info\ntw user --json # JSON output\ntw user --json --full # Include all fields in JSON output\ntw users # List workspace users\ntw users --search <text> # Filter by name/email\ntw channels # List active joined workspace channels (alias of: tw channel list)\ntw channels --state all # Include archived joined channels too\ntw channels --scope discoverable # Active public channels you can see but have not joined\ntw channels --scope public --state all --json # All visible public channels, with joined status\ntw channel threads <channel-ref> # List threads in a channel (fuzzy name, id:, numeric ID, or URL)\ntw channel threads \"general\" --unread # Only unread threads\ntw channel threads <ref> --archive-filter all # Include archived threads (active|archived|all)\ntw channel threads <ref> --since 2026-01-01 # Filter by last-updated date (ISO)\ntw channel threads <ref> --limit 20 # Max threads per page (default: 50)\ntw channel threads <ref> --limit 20 --cursor <cursor-from-prev> # Paginate\ntw channel threads <ref> --json # { results, nextCursor } with isUnread + url\ntw groups # List workspace groups\ntw groups --search \"frontend\" # Filter groups by name (case-insensitive)\ntw groups --json # JSON output\ntw groups --json --full # Include all fields in JSON output\n```\n\nIf a channel is not found in `tw channels`, widen with broader listings such as `tw channels --scope public`, then `tw channels --scope public --state all`. Check `tw channels --help` for other available filters.\n\n`tw channel threads` returns every thread in the channel; pagination filters (`--limit`, `--cursor`, `--since`, `--until`, `--unread`) are applied client-side after fetch. `--archive-filter` is applied server-side. Results are sorted newest-first by last activity. In `--json` / `--ndjson`, the response includes a `nextCursor` string (opaque) you can pass via `--cursor` to fetch the next page; NDJSON emits the cursor as a final `{ \"_meta\": true, \"nextCursor\": \"...\" }` line.\n\n## Away Status\n\n```bash\ntw away # Show current away status\ntw away set <type> [until] # Set away (type: vacation, parental, sickleave, other)\ntw away set vacation 2026-03-20 # Away until March 20\ntw away set vacation 2026-03-20 --from 2026-03-15 # Custom start date\ntw away clear # Clear away status\n```\n\n## Reactions\n\n```bash\ntw react thread <ref> \uD83D\uDC4D # Add reaction to thread\ntw react comment <ref> +1 # Add reaction (shortcode)\ntw react message <ref> heart # Add reaction to DM message\ntw react thread <ref> \uD83D\uDC4D --json # Output result as JSON\ntw unreact thread <ref> \uD83D\uDC4D # Remove reaction\ntw unreact thread <ref> \uD83D\uDC4D --json # Output result as JSON\n```\n\nSupported shortcodes: +1, -1, heart, tada, smile, laughing, thinking, fire, check, x, eyes, pray, clap, rocket, wave\n\n## Shell Completions\n\n```bash\ntw completion install # Install tab completions (prompts for shell)\ntw completion install bash # Install for specific shell\ntw completion install zsh\ntw completion install fish\ntw completion uninstall # Remove completions\n```\n\n### Diagnostics\n\n```bash\ntw doctor # Run local + network diagnostics\ntw doctor --offline # Skip Twist and npm network checks\ntw doctor --json # JSON output with per-check results\n```\n\n### Configuration\n\n```bash\ntw config view # Pretty-printed config, token masked, labels actual token source\ntw config view --json # Raw JSON, token masked\ntw config view --show-token # Include the full token\ntw config set unarchive-new-threads true # Persist: always unarchive new threads so they land in your Inbox\ntw config set unarchive-new-threads false # Persist: keep Twist's default (thread auto-archived for author)\n```\n\nUser preferences are stored under `userSettings` in the config file. Currently supported keys: `unarchive-new-threads`. The flag on `tw thread create` (`--unarchive` / `--no-unarchive`) overrides this default per-invocation.\n\n### Update\n\n```bash\ntw update # Update CLI to latest version\ntw update --check # Check for updates without installing, show channel\ntw update --channel # Show current update channel\ntw update switch --stable # Switch to stable release channel\ntw update switch --pre-release # Switch to pre-release (next) channel\n```\n\n### Changelog\n```bash\ntw changelog # Show last 5 versions\ntw changelog -n 3 # Show last 3 versions\ntw changelog --count 10 # Show last 10 versions\n```\n\n## Global Options\n\n```bash\n--no-spinner # Disable loading animations\n--progress-jsonl # Machine-readable progress events (JSONL to stderr)\n--accessible # Add text labels to color-coded output (also: TW_ACCESSIBLE=1)\n--non-interactive # Disable interactive prompts (auto-detected when stdin is not a TTY)\n--interactive # Force interactive mode even when stdin is not a TTY\n```\n\n## Output Formats\n\nAll list/view commands support:\n\n```bash\n--json # Output as JSON\n--ndjson # Output as newline-delimited JSON (for streaming)\n--full # Include all fields (default shows essential fields only)\n```\n\n## Dry Run\n\nMutating commands accept `--dry-run` to preview the operation without making the change. Where a command performs pre-flight validation (e.g. fetching the target thread to check channel access or ownership), those checks still run in dry-run \u2014 only the mutating write is skipped. Commands that have no pre-flight validation parse the reference and print the preview without hitting the API. The preview is structured:\n\n```\n[dry-run] Would <action>:\n <Key>: <resolved value>\n ...\nRun without --dry-run to execute.\n```\n\n## Reference System\n\nCommands accept flexible references:\n- **Numeric IDs**: `123` or `id:123`\n- **Twist URLs**: Full `https://twist.com/...` URLs (parsed automatically)\n- **Fuzzy names**: For workspaces/users - `\"My Workspace\"` or partial matches\n\n## Piping Content\n\nCommands that accept content (`thread create`, `thread reply`, `comment update`, `conversation reply`, `msg update`) auto-detect piped stdin:\n\n```bash\ncat notes.md | tw thread reply <ref>\ntw thread create <channel-ref> \"Title\" < body.md\necho \"Quick reply\" | tw conversation reply <ref>\n```\n\nIf no content argument is provided and no stdin is piped, the CLI opens `$EDITOR` for interactive input. In non-TTY environments (e.g. when called by an agent or in a pipeline), the editor is automatically skipped and the command fails fast with an actionable error message. Use `--non-interactive` to force this behavior even in a TTY, or `--interactive` to override auto-detection.\n\n## Common Workflows\n\n**View by URL (auto-routes to the right command):**\n```bash\ntw view https://twist.com/a/1585/ch/100/t/200 # View thread\ntw view https://twist.com/a/1585/ch/100/t/200/c/300 # View comment\ntw view https://twist.com/a/1585/msg/400 # View conversation\ntw view https://twist.com/a/1585/msg/400/m/500 --json # View message as JSON\n```\n\n**Check inbox and respond:**\n```bash\ntw inbox --unread --json\ntw thread view <id> --unread\ntw thread reply <id> \"Thanks, I'll look into this.\"\ntw thread done <id>\n```\n\n**Search and review:**\n```bash\ntw search \"deployment\" --type threads --json\ntw thread view <thread-id>\n```\n\n**Check DMs:**\n```bash\ntw conversation unread --json\ntw conversation view <conversation-id>\ntw conversation with \"Alice Example\"\ntw conversation reply <id> \"Got it, thanks!\"\n```\n";
6
+ export declare const SKILL_CONTENT = "# Twist CLI (tw)\n\nAccess Twist messaging via the `tw` CLI. Use when the user asks about their Twist workspaces, threads, messages, or wants to interact with Twist in any way.\n\n## Setup\n\n```bash\ntw auth login # OAuth login (opens browser, read-write)\ntw auth login --read-only # OAuth login with read-only scope\ntw auth token # Save API token manually (prompts securely; scope unknown, assumed write-capable)\ntw auth status # Verify authentication + show mode\ntw auth status --json # JSON output: { id, email, name }\ntw auth logout # Remove saved token and auth metadata\ntw workspaces # List available workspaces\ntw workspace use <ref> # Set current workspace\ntw completion install # Install shell completions\ntw config view # Show the current CLI configuration file (token masked)\ntw config set <key> <value> # Set a user preference (e.g. unarchive-new-threads true)\ntw doctor # Diagnose CLI setup and environment issues\ntw update # Update CLI to latest version\ntw changelog # Show recent changelog entries\n```\n\nStored auth uses the system credential manager when available. If secure storage is unavailable, `tw` warns and falls back to `~/.config/twist-cli/config.json`. `TWIST_API_TOKEN` always takes priority over the stored token, and legacy plaintext config tokens are migrated automatically when secure storage is available.\n\nIn read-only mode (`tw auth login --read-only`), commands that modify Twist data (reply, archive, react, delete, etc.) are blocked by the CLI. Externally provided tokens (`TWIST_API_TOKEN` or `tw auth token`) are treated as unknown scope and assumed write-capable.\n\n## View by URL\n\n```bash\ntw view <url> # View any Twist entity by URL\n```\n\nRoutes automatically based on URL structure:\n- Message URL \u2192 `tw msg view`\n- Conversation URL \u2192 `tw conversation view`\n- Thread+comment URL \u2192 `tw thread view` (comment ID extracted from URL)\n- Thread URL \u2192 `tw thread view`\n\nAll target command flags pass through (e.g. `--json`, `--raw`, `--full`).\n\n## Inbox\n\n```bash\ntw inbox # Show inbox threads\ntw inbox --unread # Only unread threads\ntw inbox --archive-filter all # Show active + done threads\ntw inbox --archive-filter archived # Show only done threads\ntw inbox --channel <filter> # Filter by channel name (fuzzy)\ntw inbox --since <date> # Filter by date (ISO format)\ntw inbox --limit <n> # Max items (default: 50)\n```\n\n## Threads\n\n```bash\ntw thread <thread-ref> # View thread (shorthand for view)\ntw thread view <thread-ref> # View thread with comments\ntw thread view <ref> --comment <id> # View a specific comment\ntw thread view <url-with-/c/id> # Comment ID extracted from URL\ntw thread view <ref> --unread # Show only unread comments\ntw thread view <ref> --context 3 # Include 3 read comments before unread\ntw thread view <ref> --limit 20 # Limit number of comments\ntw thread view <ref> --since <date> # Comments newer than date\ntw thread view <ref> --raw # Show raw markdown\ntw thread create <channel-ref> \"Title\" \"content\" # Create a new thread\ntw thread create <channel-ref> \"Title\" \"content\" --json # Create and return as JSON\ntw thread create <channel-ref> \"Title\" \"content\" --json --full # Include all thread fields\ntw thread create <channel-ref> \"Title\" \"content\" --notify 123,456 # Notify specific users\ntw thread create <channel-ref> \"Title\" \"content\" --unarchive # Land thread in author's Inbox (overrides default Twist auto-archive)\ntw thread create <channel-ref> \"Title\" \"content\" --no-unarchive # Force archive even when userSettings.unarchiveNewThreads=true\ntw thread create <channel-ref> \"Title\" \"content\" --dry-run # Preview without posting\ntw thread reply <ref> \"content\" # Post a comment (notifies EVERYONE_IN_THREAD by default)\ntw thread reply <ref> \"content\" --notify EVERYONE # Notify all workspace members\ntw thread reply <ref> \"content\" --notify 123,id:456 # Notify specific user IDs\ntw thread reply <ref> \"content\" --json # Post and return comment as JSON\ntw thread reply <ref> \"content\" --json --full # Include all comment fields\ntw thread reply <ref> \"content\" --close # Reply and close the thread\ntw thread reply <ref> \"content\" --reopen # Reply and reopen a closed thread\ntw thread done <ref> # Archive thread (mark done)\ntw thread done <ref> --json # Archive and return status as JSON\ntw thread mute <ref> # Mute thread for 60 minutes (default)\ntw thread mute <ref> --minutes 480 # Mute for custom duration\ntw thread mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntw thread mute <ref> --json --full # Mute and return full thread as JSON\ntw thread unmute <ref> # Unmute a muted thread\ntw thread unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\ntw thread delete <ref> # Preview thread deletion (requires --yes to execute)\ntw thread delete <ref> --yes # Permanently delete a thread\ntw thread delete <ref> --yes --json # Delete and return status as JSON\ntw thread rename <ref> \"New title\" # Rename a thread (change its title)\ntw thread rename <ref> \"New title\" --json # Rename and return { id, title } as JSON\ntw thread rename <ref> \"New title\" --json --full # Rename and return full thread as JSON\ntw thread update <ref> \"New body\" # Update a thread's body (the first post)\necho \"New body\" | tw thread update <ref> # Update body from stdin\ntw thread update <ref> \"New body\" --dry-run # Preview without updating\ntw thread update <ref> \"New body\" --json # Update and return { id, content } as JSON\ntw thread update <ref> \"New body\" --json --full # Update and return full thread as JSON\n```\n\nDefault `--notify` for reply is EVERYONE_IN_THREAD, which may notify more people than intended. Before posting, confirm with the user whether specific people should be notified instead (via `--notify <user-ids>`). Options: EVERYONE, EVERYONE_IN_THREAD, or comma-separated ID refs.\n\n`--notify` automatically resolves IDs: group IDs are routed to the `groups` API field, user IDs to `recipients`. No special syntax needed.\n\n## Thread Comments\n\n```bash\ntw comment <comment-ref> # View a comment (shorthand for view)\ntw comment view <comment-ref> # View a single thread comment\ntw comment view <comment-ref> --raw # Show raw markdown\ntw comment view <comment-ref> --json # Output as JSON\ntw comment view <comment-ref> --ndjson # Output as newline-delimited JSON\ntw comment view <comment-ref> --json --full # Include all fields in JSON output\ntw comment update <comment-ref> \"new content\" # Update a thread comment\ntw comment update <comment-ref> \"content\" --json # Update and return updated comment as JSON\ntw comment update <comment-ref> \"content\" --json --full # Include all comment fields\ntw comment delete <comment-ref> # Delete a thread comment\ntw comment delete <comment-ref> --json # Delete and return status as JSON\n```\n\n## Conversations (DMs/Groups)\n\n```bash\ntw conversation unread # List unread conversations\ntw conversation <conversation-ref> # View conversation (shorthand for view)\ntw conversation view <conversation-ref> # View conversation messages\ntw conversation with <user-ref> # Find your 1:1 DM with a user\ntw conversation with <user-ref> --snippet # Include the latest message preview\ntw conversation with <user-ref> --include-groups # List any conversations with that user\ntw conversation reply <ref> \"content\" # Send a message\ntw conversation reply <ref> \"content\" --json # Send and return message as JSON\ntw conversation reply <ref> \"content\" --json --full # Include all message fields\ntw conversation done <ref> # Archive conversation\ntw conversation done <ref> --json # Archive and return status as JSON\ntw conversation mute <ref> # Mute conversation for 60 minutes (default)\ntw conversation mute <ref> --minutes 480 # Mute for custom duration\ntw conversation mute <ref> --json # Mute and return { id, mutedUntil } as JSON\ntw conversation mute <ref> --json --full # Mute and return full conversation as JSON\ntw conversation unmute <ref> # Unmute a muted conversation\ntw conversation unmute <ref> --json # Unmute and return { id, mutedUntil } as JSON\n```\n\nAlias: `tw convo` works the same as `tw conversation`.\n\n## Conversation Messages\n\n```bash\ntw msg <message-ref> # View a message (shorthand for view)\ntw msg view <message-ref> # View a single conversation message\ntw msg update <ref> \"content\" # Edit a conversation message\ntw msg update <ref> \"content\" --json # Edit and return updated message as JSON\ntw msg update <ref> \"content\" --json --full # Include all message fields\ntw msg delete <ref> # Delete a conversation message\ntw msg delete <ref> --json # Delete and return status as JSON\n```\n\nAlias: `tw message` works the same as `tw msg`.\n\n## Search\n\n```bash\ntw mentions # Show content mentioning current user\ntw mentions --since 2026-04-01 --all # Fetch every mention since a date\ntw mentions --type threads --json # Limit mentions to threads\ntw search \"query\" # Search content\ntw search \"query\" --type threads # Filter: threads, messages, or all\ntw search \"query\" --author <ref> # Filter by author\ntw search \"query\" --to <ref> # Messages sent to user\ntw search \"query\" --title-only # Search thread titles only\ntw search \"query\" --mention-me # Results mentioning current user\ntw search \"query\" --conversation <refs> # Limit to conversations (comma-separated refs)\ntw search \"query\" --since <date> # Content from date\ntw search \"query\" --until <date> # Content until date\ntw search \"query\" --channel <refs> # Filter by channel refs (comma-separated)\ntw search \"query\" --limit <n> # Max results (default: 50)\ntw search \"query\" --cursor <cur> # Pagination cursor\ntw search \"query\" --all # Fetch all result pages\n```\n\n## Users, Channels & Groups\n\n```bash\ntw user # Show current user info\ntw user --json # JSON output\ntw user --json --full # Include all fields in JSON output\ntw users # List workspace users\ntw users --search <text> # Filter by name/email\ntw channels # List active joined workspace channels (alias of: tw channel list)\ntw channels --state all # Include archived joined channels too\ntw channels --scope discoverable # Active public channels you can see but have not joined\ntw channels --scope public --state all --json # All visible public channels, with joined status\ntw channel threads <channel-ref> # List threads in a channel (fuzzy name, id:, numeric ID, or URL)\ntw channel threads \"general\" --unread # Only unread threads\ntw channel threads <ref> --archive-filter all # Include archived threads (active|archived|all)\ntw channel threads <ref> --since 2026-01-01 # Filter by last-updated date (ISO)\ntw channel threads <ref> --limit 20 # Max threads per page (default: 50)\ntw channel threads <ref> --limit 20 --cursor <cursor-from-prev> # Paginate\ntw channel threads <ref> --json # { results, nextCursor } with isUnread + url\ntw groups # List workspace groups\ntw groups --search \"frontend\" # Filter groups by name (case-insensitive)\ntw groups --json # JSON output\ntw groups --json --full # Include all fields in JSON output\n```\n\nIf a channel is not found in `tw channels`, widen with broader listings such as `tw channels --scope public`, then `tw channels --scope public --state all`. Check `tw channels --help` for other available filters.\n\n`tw channel threads` returns every thread in the channel; pagination filters (`--limit`, `--cursor`, `--since`, `--until`, `--unread`) are applied client-side after fetch. `--archive-filter` is applied server-side. Results are sorted newest-first by last activity. In `--json` / `--ndjson`, the response includes a `nextCursor` string (opaque) you can pass via `--cursor` to fetch the next page; NDJSON emits the cursor as a final `{ \"_meta\": true, \"nextCursor\": \"...\" }` line.\n\n## Away Status\n\n```bash\ntw away # Show current away status\ntw away set <type> [until] # Set away (type: vacation, parental, sickleave, other)\ntw away set vacation 2026-03-20 # Away until March 20\ntw away set vacation 2026-03-20 --from 2026-03-15 # Custom start date\ntw away clear # Clear away status\n```\n\n## Reactions\n\n```bash\ntw react thread <ref> \uD83D\uDC4D # Add reaction to thread\ntw react comment <ref> +1 # Add reaction (shortcode)\ntw react message <ref> heart # Add reaction to DM message\ntw react thread <ref> \uD83D\uDC4D --json # Output result as JSON\ntw unreact thread <ref> \uD83D\uDC4D # Remove reaction\ntw unreact thread <ref> \uD83D\uDC4D --json # Output result as JSON\n```\n\nSupported shortcodes: +1, -1, heart, tada, smile, laughing, thinking, fire, check, x, eyes, pray, clap, rocket, wave\n\n## Shell Completions\n\n```bash\ntw completion install # Install tab completions (prompts for shell)\ntw completion install bash # Install for specific shell\ntw completion install zsh\ntw completion install fish\ntw completion uninstall # Remove completions\n```\n\n### Diagnostics\n\n```bash\ntw doctor # Run local + network diagnostics\ntw doctor --offline # Skip Twist and npm network checks\ntw doctor --json # JSON output with per-check results\n```\n\n### Configuration\n\n```bash\ntw config view # Pretty-printed config, token masked, labels actual token source\ntw config view --json # Raw JSON, token masked\ntw config view --show-token # Include the full token\ntw config set unarchive-new-threads true # Persist: always unarchive new threads so they land in your Inbox\ntw config set unarchive-new-threads false # Persist: keep Twist's default (thread auto-archived for author)\n```\n\nUser preferences are stored under `userSettings` in the config file. Currently supported keys: `unarchive-new-threads`. The flag on `tw thread create` (`--unarchive` / `--no-unarchive`) overrides this default per-invocation.\n\n### Update\n\n```bash\ntw update # Update CLI to latest version\ntw update --check # Check for updates without installing, show channel\ntw update --channel # Show current update channel\ntw update switch --stable # Switch to stable release channel\ntw update switch --pre-release # Switch to pre-release (next) channel\n```\n\n### Changelog\n```bash\ntw changelog # Show last 5 versions\ntw changelog -n 3 # Show last 3 versions\ntw changelog --count 10 # Show last 10 versions\n```\n\n## Global Options\n\n```bash\n--no-spinner # Disable loading animations\n--progress-jsonl # Machine-readable progress events (JSONL to stderr)\n--accessible # Add text labels to color-coded output (also: TW_ACCESSIBLE=1)\n--non-interactive # Disable interactive prompts (auto-detected when stdin is not a TTY)\n--interactive # Force interactive mode even when stdin is not a TTY\n```\n\n## Output Formats\n\nAll list/view commands support:\n\n```bash\n--json # Output as JSON\n--ndjson # Output as newline-delimited JSON (for streaming)\n--full # Include all fields (default shows essential fields only)\n```\n\n## Dry Run\n\nMutating commands accept `--dry-run` to preview the operation without making the change. Where a command performs pre-flight validation (e.g. fetching the target thread to check channel access or ownership), those checks still run in dry-run \u2014 only the mutating write is skipped. Commands that have no pre-flight validation parse the reference and print the preview without hitting the API. The preview is structured:\n\n```\n[dry-run] Would <action>:\n <Key>: <resolved value>\n ...\nRun without --dry-run to execute.\n```\n\n## Reference System\n\nCommands accept flexible references:\n- **Numeric IDs**: `123` or `id:123`\n- **Twist URLs**: Full `https://twist.com/...` URLs (parsed automatically)\n- **Fuzzy names**: For workspaces/users - `\"My Workspace\"` or partial matches\n\n## Piping Content\n\nCommands that accept content (`thread create`, `thread reply`, `comment update`, `conversation reply`, `msg update`) auto-detect piped stdin:\n\n```bash\ncat notes.md | tw thread reply <ref>\ntw thread create <channel-ref> \"Title\" < body.md\necho \"Quick reply\" | tw conversation reply <ref>\n```\n\nIf no content argument is provided and no stdin is piped, the CLI opens `$EDITOR` for interactive input. In non-TTY environments (e.g. when called by an agent or in a pipeline), the editor is automatically skipped and the command fails fast with an actionable error message. Use `--non-interactive` to force this behavior even in a TTY, or `--interactive` to override auto-detection.\n\n## Common Workflows\n\n**View by URL (auto-routes to the right command):**\n```bash\ntw view https://twist.com/a/1585/ch/100/t/200 # View thread\ntw view https://twist.com/a/1585/ch/100/t/200/c/300 # View comment\ntw view https://twist.com/a/1585/msg/400 # View conversation\ntw view https://twist.com/a/1585/msg/400/m/500 --json # View message as JSON\n```\n\n**Check inbox and respond:**\n```bash\ntw inbox --unread --json\ntw thread view <id> --unread\ntw thread reply <id> \"Thanks, I'll look into this.\"\ntw thread done <id>\n```\n\n**Search and review:**\n```bash\ntw mentions --since 2026-04-01 --all --json\ntw search \"deployment\" --type threads --json\ntw thread view <thread-id>\n```\n\n**Check DMs:**\n```bash\ntw conversation unread --json\ntw conversation view <conversation-id>\ntw conversation with \"Alice Example\"\ntw conversation reply <id> \"Got it, thanks!\"\n```\n";
7
7
  export declare const SKILL_FILE_CONTENT: string;
8
8
  //# sourceMappingURL=content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,cAAc,CAAA;AAErC,eAAO,MAAM,iBAAiB,uSAC0Q,CAAA;AAExS,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,aAAa,QAAsB,CAAA;AAEhD,eAAO,MAAM,aAAa,k5jBAmWzB,CAAA;AAED,eAAO,MAAM,kBAAkB,QASd,CAAA"}
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,cAAc,CAAA;AAErC,eAAO,MAAM,iBAAiB,2TAC8R,CAAA;AAE5T,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,aAAa,QAAsB,CAAA;AAEhD,eAAO,MAAM,aAAa,6skBAwWzB,CAAA;AAED,eAAO,MAAM,kBAAkB,QASd,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import packageJson from '../../../package.json' with { type: 'json' };
2
2
  export const SKILL_NAME = 'twist-cli';
3
- export const SKILL_DESCRIPTION = 'Twist messaging CLI. View and respond to inbox threads, channel threads, direct messages, and group conversations; search, react, archive, mute, and manage workspaces. Use when the user mentions Twist, asks about their inbox, threads, DMs, channels, or wants to read or send Twist messages.';
3
+ export const SKILL_DESCRIPTION = 'Twist messaging CLI. View and respond to inbox threads, channel threads, direct messages, mentions, and group conversations; search, react, archive, mute, and manage workspaces. Use when the user mentions Twist, asks about their inbox, mentions, threads, DMs, channels, or wants to read or send Twist messages.';
4
4
  export const SKILL_AUTHOR = 'Doist';
5
5
  export const SKILL_LICENSE = 'MIT';
6
6
  export const SKILL_VERSION = packageJson.version;
@@ -165,6 +165,9 @@ Alias: \`tw message\` works the same as \`tw msg\`.
165
165
  ## Search
166
166
 
167
167
  \`\`\`bash
168
+ tw mentions # Show content mentioning current user
169
+ tw mentions --since 2026-04-01 --all # Fetch every mention since a date
170
+ tw mentions --type threads --json # Limit mentions to threads
168
171
  tw search "query" # Search content
169
172
  tw search "query" --type threads # Filter: threads, messages, or all
170
173
  tw search "query" --author <ref> # Filter by author
@@ -177,6 +180,7 @@ tw search "query" --until <date> # Content until date
177
180
  tw search "query" --channel <refs> # Filter by channel refs (comma-separated)
178
181
  tw search "query" --limit <n> # Max results (default: 50)
179
182
  tw search "query" --cursor <cur> # Pagination cursor
183
+ tw search "query" --all # Fetch all result pages
180
184
  \`\`\`
181
185
 
182
186
  ## Users, Channels & Groups
@@ -348,6 +352,7 @@ tw thread done <id>
348
352
 
349
353
  **Search and review:**
350
354
  \`\`\`bash
355
+ tw mentions --since 2026-04-01 --all --json
351
356
  tw search "deployment" --type threads --json
352
357
  tw thread view <thread-id>
353
358
  \`\`\`
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAA;AAErC,MAAM,CAAC,MAAM,iBAAiB,GAC1B,oSAAoS,CAAA;AAExS,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAA;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmW5B,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;QAC1B,UAAU;eACH,IAAI,CAAC,SAAS,C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
1
  {
2
2
  "name": "@doist/twist-cli",
3
- "version": "2.34.0",
3
+ "version": "2.35.0",
4
4
  "description": "TypeScript CLI for Twist",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -67,7 +67,7 @@
67
67
  "conventional-changelog-conventionalcommits": "9.3.1",
68
68
  "lefthook": "2.1.6",
69
69
  "oxfmt": "0.46.0",
70
- "oxlint": "1.60.0",
70
+ "oxlint": "1.61.0",
71
71
  "semantic-release": "25.0.3",
72
72
  "typescript": "6.0.3",
73
73
  "vitest": "4.1.5"