@doist/twist-cli 2.40.0 → 2.41.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 +6 -0
- package/dist/commands/account/current.d.ts +4 -0
- package/dist/commands/account/current.d.ts.map +1 -0
- package/dist/commands/account/current.js +46 -0
- package/dist/commands/account/current.js.map +1 -0
- package/dist/commands/account/helpers.d.ts +8 -0
- package/dist/commands/account/helpers.d.ts.map +1 -0
- package/dist/commands/account/helpers.js +18 -0
- package/dist/commands/account/helpers.js.map +1 -0
- 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 +30 -0
- package/dist/commands/account/index.js.map +1 -0
- package/dist/commands/account/list.d.ts +4 -0
- package/dist/commands/account/list.d.ts.map +1 -0
- package/dist/commands/account/list.js +30 -0
- package/dist/commands/account/list.js.map +1 -0
- package/dist/commands/account/remove.d.ts +4 -0
- package/dist/commands/account/remove.d.ts.map +1 -0
- package/dist/commands/account/remove.js +18 -0
- package/dist/commands/account/remove.js.map +1 -0
- package/dist/commands/account/use.d.ts +4 -0
- package/dist/commands/account/use.d.ts.map +1 -0
- package/dist/commands/account/use.js +13 -0
- package/dist/commands/account/use.js.map +1 -0
- package/dist/commands/auth/store-wrap.d.ts.map +1 -1
- package/dist/commands/auth/store-wrap.js +8 -10
- package/dist/commands/auth/store-wrap.js.map +1 -1
- package/dist/commands/config/view.d.ts.map +1 -1
- package/dist/commands/config/view.js +17 -1
- package/dist/commands/config/view.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-provider.d.ts +15 -0
- package/dist/lib/auth-provider.d.ts.map +1 -1
- package/dist/lib/auth-provider.js +30 -0
- package/dist/lib/auth-provider.js.map +1 -1
- package/dist/lib/errors.d.ts +1 -1
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/skills/content.d.ts +1 -1
- package/dist/lib/skills/content.d.ts.map +1 -1
- package/dist/lib/skills/content.js +3 -0
- package/dist/lib/skills/content.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [2.41.0](https://github.com/Doist/twist-cli/compare/v2.40.0...v2.41.0) (2026-05-17)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **auth:** tw account commands + multi-account config view ([#233](https://github.com/Doist/twist-cli/issues/233)) ([5a3741f](https://github.com/Doist/twist-cli/commit/5a3741f63ae0c69a09e32727a162d4a24b710662))
|
|
6
|
+
|
|
1
7
|
## [2.40.0](https://github.com/Doist/twist-cli/compare/v2.39.0...v2.40.0) (2026-05-17)
|
|
2
8
|
|
|
3
9
|
### Features
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"current.d.ts","sourceRoot":"","sources":["../../../src/commands/account/current.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEvD,wBAAsB,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA6ChG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { emitView } from '@doist/cli-core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { isLegacyAuthActive } from '../../lib/auth-provider.js';
|
|
4
|
+
import { TOKEN_ENV_VAR } from '../../lib/auth.js';
|
|
5
|
+
import { CliError } from '../../lib/errors.js';
|
|
6
|
+
export async function currentAccount(options, store) {
|
|
7
|
+
if (process.env[TOKEN_ENV_VAR]) {
|
|
8
|
+
emitView(options, { source: 'env' }, () => [
|
|
9
|
+
`Active token sourced from environment variable ${TOKEN_ENV_VAR} (no stored account).`,
|
|
10
|
+
]);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const snapshot = await store.active();
|
|
14
|
+
if (!snapshot) {
|
|
15
|
+
throw new CliError('NO_TOKEN', 'No stored account is currently active.', [
|
|
16
|
+
'Run: tw auth login',
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
const { account } = snapshot;
|
|
20
|
+
// Snapshot can still be the v1 legacy fallback when migration is
|
|
21
|
+
// inconclusive — even when id/label are populated from the old flat
|
|
22
|
+
// `authUserId` / `authUserName` fields. Treat that as legacy too.
|
|
23
|
+
if (!account.id || !account.label || (await isLegacyAuthActive())) {
|
|
24
|
+
emitView(options, { source: 'legacy' }, () => [
|
|
25
|
+
'Active token is a legacy single-user session (pre-multi-account).',
|
|
26
|
+
chalk.dim('Run `tw auth status` while online to migrate it into the v2 store.'),
|
|
27
|
+
]);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
emitView(options, {
|
|
31
|
+
id: account.id,
|
|
32
|
+
label: account.label,
|
|
33
|
+
authMode: account.authMode,
|
|
34
|
+
authScope: account.authScope || undefined,
|
|
35
|
+
source: 'config',
|
|
36
|
+
}, () => {
|
|
37
|
+
const lines = [
|
|
38
|
+
`Active account: ${chalk.dim(`id:${account.id}`)} ${account.label}`,
|
|
39
|
+
` Mode: ${account.authMode}`,
|
|
40
|
+
];
|
|
41
|
+
if (account.authScope)
|
|
42
|
+
lines.push(` Scope: ${account.authScope}`);
|
|
43
|
+
return lines;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=current.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"current.js","sourceRoot":"","sources":["../../../src/commands/account/current.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAwB,MAAM,4BAA4B,CAAA;AACrF,OAAO,EA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,KAAK,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,KAAK,EAAE;YACpE,YAAY,OAAO,CAAC,QAAQ,EAAE;SACjC,CAAA;QACD,IAAI,OAAO,CAAC,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,SAAS,EAAE,CAAC,CAAA;QAClE,OAAO,KAAK,CAAA;IAChB,CAAC,CACJ,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account-management commands operate against the v2 user-records store.
|
|
3
|
+
* When `migrateLegacyAuth` couldn't complete (typically offline), the v2
|
|
4
|
+
* store is empty and `ACCOUNT_NOT_FOUND` would be misleading — fail with
|
|
5
|
+
* a dedicated envelope so callers get an actionable hint.
|
|
6
|
+
*/
|
|
7
|
+
export declare function assertV2Available(): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/commands/account/helpers.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAYvD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isLegacyAuthActive } from '../../lib/auth-provider.js';
|
|
2
|
+
import { CliError } from '../../lib/errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Account-management commands operate against the v2 user-records store.
|
|
5
|
+
* When `migrateLegacyAuth` couldn't complete (typically offline), the v2
|
|
6
|
+
* store is empty and `ACCOUNT_NOT_FOUND` would be misleading — fail with
|
|
7
|
+
* a dedicated envelope so callers get an actionable hint.
|
|
8
|
+
*/
|
|
9
|
+
export async function assertV2Available() {
|
|
10
|
+
if (await isLegacyAuthActive()) {
|
|
11
|
+
throw new CliError('AUTH_MIGRATION_PENDING', 'Cannot manage accounts while the legacy single-user token is still active. ' +
|
|
12
|
+
'The CLI could not complete the v1 → v2 auth migration (usually because Twist was unreachable).', [
|
|
13
|
+
'Run `tw auth status` while online to finish the migration',
|
|
14
|
+
'Or run `tw auth logout` followed by `tw auth login` to start fresh',
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/commands/account/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACnC,IAAI,MAAM,kBAAkB,EAAE,EAAE,CAAC;QAC7B,MAAM,IAAI,QAAQ,CACd,wBAAwB,EACxB,6EAA6E;YACzE,gGAAgG,EACpG;YACI,2DAA2D;YAC3D,oEAAoE;SACvE,CACJ,CAAA;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAcnC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkC7D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createTwistTokenStore } from '../../lib/auth-provider.js';
|
|
2
|
+
import { currentAccount } from './current.js';
|
|
3
|
+
import { listAccounts } from './list.js';
|
|
4
|
+
import { removeAccount } from './remove.js';
|
|
5
|
+
import { useAccount } from './use.js';
|
|
6
|
+
function withJsonFlags(cmd) {
|
|
7
|
+
return cmd
|
|
8
|
+
.option('--json', 'Output as JSON')
|
|
9
|
+
.option('--ndjson', 'Output as newline-delimited JSON');
|
|
10
|
+
}
|
|
11
|
+
export function registerAccountCommand(program) {
|
|
12
|
+
const account = program.command('account').description('Manage stored CLI accounts');
|
|
13
|
+
const store = createTwistTokenStore();
|
|
14
|
+
withJsonFlags(account.command('list', { isDefault: true }).description('List stored CLI accounts')).action((options) => listAccounts(options, store));
|
|
15
|
+
withJsonFlags(account
|
|
16
|
+
.command('current')
|
|
17
|
+
.description('Show the currently active account (honours TWIST_API_TOKEN)')).action((options) => currentAccount(options, store));
|
|
18
|
+
withJsonFlags(account
|
|
19
|
+
.command('use <ref>')
|
|
20
|
+
.description('Set the default stored account (id, id:<n>, or display name)')).action((ref, options) => useAccount(ref, options, store));
|
|
21
|
+
withJsonFlags(account
|
|
22
|
+
.command('remove <ref>')
|
|
23
|
+
.description('Remove a stored account (clears keyring + config entry)')).action((ref, options) => removeAccount(ref, options, store));
|
|
24
|
+
account.addHelpText('after', `
|
|
25
|
+
Examples:
|
|
26
|
+
tw account # list stored accounts (default subcommand)
|
|
27
|
+
tw account use "Alan Grant" # pin Alan as the default account (id, id:N, or name)
|
|
28
|
+
tw account remove id:42 # forget id:42 (clears keyring + config entry)`);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/account/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,SAAS,aAAa,CAAC,GAAY;IAC/B,OAAO,GAAG;SACL,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,UAAU,EAAE,kCAAkC,CAA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OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAIvD,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B9F"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { formatJson, formatNdjson } from '../../lib/output.js';
|
|
3
|
+
import { assertV2Available } from './helpers.js';
|
|
4
|
+
export async function listAccounts(options, store) {
|
|
5
|
+
await assertV2Available();
|
|
6
|
+
const records = await store.list();
|
|
7
|
+
const rows = records.map(({ account, isDefault }) => ({
|
|
8
|
+
id: account.id,
|
|
9
|
+
label: account.label,
|
|
10
|
+
isDefault,
|
|
11
|
+
}));
|
|
12
|
+
if (options.json)
|
|
13
|
+
return console.log(formatJson(rows));
|
|
14
|
+
if (options.ndjson)
|
|
15
|
+
return console.log(formatNdjson(rows));
|
|
16
|
+
if (rows.length === 0) {
|
|
17
|
+
console.log('No stored accounts. Run `tw auth login` to add one.');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
console.log(`Stored accounts (${rows.length}):`);
|
|
21
|
+
for (const row of rows) {
|
|
22
|
+
const marker = row.isDefault ? chalk.green('*') : ' ';
|
|
23
|
+
console.log(` ${marker} ${chalk.dim(`id:${row.id}`)} ${row.label}`);
|
|
24
|
+
}
|
|
25
|
+
const defaultRow = rows.find((r) => r.isDefault);
|
|
26
|
+
if (defaultRow) {
|
|
27
|
+
console.log(`Default: ${chalk.dim(`id:${defaultRow.id}`)} ${defaultRow.label}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/account/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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CAAA;IACzE,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAChD,IAAI,UAAU,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,GAAG,CAAC,MAAM,UAAU,CAAC,EAAE,EAAE,CAAC,KAAK,UAAU,CAAC,KAAK,EAAE,CAAC,CAAA;IACpF,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type TwistTokenStore } from '../../lib/auth-provider.js';
|
|
2
|
+
import type { ViewOptions } from '../../lib/options.js';
|
|
3
|
+
export declare function removeAccount(ref: string, options: ViewOptions, store: TwistTokenStore): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/commands/account/remove.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAIvD,wBAAsB,aAAa,CAC/B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { emitView } from '@doist/cli-core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { findAccountInStore } from '../../lib/auth-provider.js';
|
|
4
|
+
import { logTokenStorageResult } from '../auth/helpers.js';
|
|
5
|
+
import { assertV2Available } from './helpers.js';
|
|
6
|
+
export async function removeAccount(ref, options, store) {
|
|
7
|
+
await assertV2Available();
|
|
8
|
+
const account = await findAccountInStore(store, ref);
|
|
9
|
+
await store.clear(account.id);
|
|
10
|
+
emitView(options, { id: account.id, label: account.label, removed: true }, () => [
|
|
11
|
+
`✓ Removed account ${chalk.dim(`id:${account.id}`)} ${account.label}`,
|
|
12
|
+
]);
|
|
13
|
+
const clearResult = store.getLastClearResult();
|
|
14
|
+
if (clearResult) {
|
|
15
|
+
logTokenStorageResult(clearResult, 'Stored token removed from the system credential manager', options.json || options.ndjson);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/commands/account/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAwB,MAAM,4BAA4B,CAAA;AAErF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,GAAW,EACX,OAAoB,EACpB,KAAsB;IAEtB,MAAM,iBAAiB,EAAE,CAAA;IACzB,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACpD,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAE7B,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC;QAC7E,qBAAqB,KAAK,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,KAAK,EAAE;KACzE,CAAC,CAAA;IAEF,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAA;IAC9C,IAAI,WAAW,EAAE,CAAC;QACd,qBAAqB,CACjB,WAAW,EACX,yDAAyD,EACzD,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,CACjC,CAAA;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/commands/account/use.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGvD,wBAAsB,UAAU,CAC5B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { emitView } from '@doist/cli-core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { findAccountInStore } from '../../lib/auth-provider.js';
|
|
4
|
+
import { assertV2Available } from './helpers.js';
|
|
5
|
+
export async function useAccount(ref, options, store) {
|
|
6
|
+
await assertV2Available();
|
|
7
|
+
const account = await findAccountInStore(store, ref);
|
|
8
|
+
await store.setDefault(account.id);
|
|
9
|
+
emitView(options, { id: account.id, label: account.label, isDefault: true }, () => [
|
|
10
|
+
`✓ Default account set to ${chalk.dim(`id:${account.id}`)} ${account.label}`,
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=use.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/commands/account/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAwB,MAAM,4BAA4B,CAAA;AAErF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC5B,GAAW,EACX,OAAoB,EACpB,KAAsB;IAEtB,MAAM,iBAAiB,EAAE,CAAA;IACzB,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACpD,MAAM,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAElC,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC;QAC/E,4BAA4B,KAAK,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,KAAK,EAAE;KAChF,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-wrap.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/store-wrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"store-wrap.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/store-wrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAYrF,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,eAAe,EACtB,YAAY,EAAE,UAAU,GAAG,SAAS,GACrC,eAAe,CAYjB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CliError } from '../../lib/errors.js';
|
|
1
|
+
import { findAccountInStore } from '../../lib/auth-provider.js';
|
|
3
2
|
// Bridge the global `tw --user <ref>` (stripped by `src/index.ts`) into
|
|
4
3
|
// cli-core's attachers, which only see per-command `--user`. Explicit ref
|
|
5
4
|
// passed by commander wins over the captured global ref.
|
|
@@ -7,20 +6,19 @@ import { CliError } from '../../lib/errors.js';
|
|
|
7
6
|
// `active()` passes the substituted ref straight through — cli-core's
|
|
8
7
|
// `KeyringTokenStore.active` returns `null` on a miss, which the attachers
|
|
9
8
|
// surface via `onNotAuthenticated` (status / token view). `clear()` does the
|
|
10
|
-
// extra existence check first
|
|
11
|
-
// is a silent no-op on a non-matching ref and
|
|
12
|
-
// `tw --user <wrong> auth logout` print `✓ Logged out`.
|
|
9
|
+
// extra existence check first via `findAccountInStore`, because cli-core's
|
|
10
|
+
// `KeyringTokenStore.clear` is a silent no-op on a non-matching ref and
|
|
11
|
+
// would otherwise let `tw --user <wrong> auth logout` print `✓ Logged out`.
|
|
13
12
|
export function withUserRefAware(store, requestedRef) {
|
|
14
13
|
return Object.assign(Object.create(store), {
|
|
15
14
|
active: (ref) => store.active(ref ?? requestedRef),
|
|
16
15
|
clear: async (ref) => {
|
|
17
16
|
if (ref === undefined && requestedRef !== undefined) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
const account = await findAccountInStore(store, requestedRef);
|
|
18
|
+
await store.clear(account.id);
|
|
19
|
+
return;
|
|
22
20
|
}
|
|
23
|
-
await store.clear(ref
|
|
21
|
+
await store.clear(ref);
|
|
24
22
|
},
|
|
25
23
|
});
|
|
26
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-wrap.js","sourceRoot":"","sources":["../../../src/commands/auth/store-wrap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"store-wrap.js","sourceRoot":"","sources":["../../../src/commands/auth/store-wrap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAwB,MAAM,4BAA4B,CAAA;AAErF,wEAAwE;AACxE,0EAA0E;AAC1E,yDAAyD;AACzD,EAAE;AACF,sEAAsE;AACtE,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,wEAAwE;AACxE,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAC5B,KAAsB,EACtB,YAAoC;IAEpC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAoB,EAAE;QAC1D,MAAM,EAAE,CAAC,GAAgB,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,YAAY,CAAC;QAC/D,KAAK,EAAE,KAAK,EAAE,GAAgB,EAAE,EAAE;YAC9B,IAAI,GAAG,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;gBAClD,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;gBAC7D,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;gBAC7B,OAAM;YACV,CAAC;YACD,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC1B,CAAC;KACJ,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/commands/config/view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/commands/config/view.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB;AAuHD,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B1E"}
|
|
@@ -2,6 +2,7 @@ import { SecureStoreUnavailableError } from '@doist/cli-core/auth';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { NoTokenError, probeApiToken, SECURE_STORE_DESCRIPTION, TOKEN_ENV_VAR, } from '../../lib/auth.js';
|
|
4
4
|
import { getConfigPath, readConfigStrict } from '../../lib/config.js';
|
|
5
|
+
import { getDefaultUserRecord } from '../../lib/user-records.js';
|
|
5
6
|
function maskToken(token) {
|
|
6
7
|
if (token.length < 5)
|
|
7
8
|
return '****';
|
|
@@ -58,6 +59,18 @@ function formatConfigView(config, token, showToken, configMissing) {
|
|
|
58
59
|
const headerSuffix = configMissing ? ` ${chalk.dim('(not created yet)')}` : '';
|
|
59
60
|
lines.push(`${chalk.dim('Config file:')} ${getConfigPath()}${headerSuffix}`);
|
|
60
61
|
lines.push('');
|
|
62
|
+
const users = config.users ?? [];
|
|
63
|
+
if (users.length > 0) {
|
|
64
|
+
// Mirror runtime first-user fallback so the marker reflects the
|
|
65
|
+
// account the CLI would actually use.
|
|
66
|
+
const defaultId = getDefaultUserRecord(config)?.account.id;
|
|
67
|
+
lines.push(chalk.bold(`Authenticated accounts (${users.length})`));
|
|
68
|
+
for (const user of users) {
|
|
69
|
+
const marker = user.id === defaultId ? chalk.green('*') : ' ';
|
|
70
|
+
lines.push(` ${marker} ${chalk.dim(`id:${user.id}`)} ${user.name}`);
|
|
71
|
+
}
|
|
72
|
+
lines.push('');
|
|
73
|
+
}
|
|
61
74
|
// When a token is present, its metadata is the ground truth for the active
|
|
62
75
|
// mode/scope — this matters most for env-sourced tokens, whose scope the CLI
|
|
63
76
|
// does not know and where config.auth* may be stale from an unrelated
|
|
@@ -72,7 +85,7 @@ function formatConfigView(config, token, showToken, configMissing) {
|
|
|
72
85
|
const scopeDisplay = effectiveMode === 'unknown' && effectiveScope === undefined
|
|
73
86
|
? 'unknown'
|
|
74
87
|
: formatValue(effectiveScope);
|
|
75
|
-
lines.push(chalk.bold('Authentication'));
|
|
88
|
+
lines.push(chalk.bold('Authentication (active)'));
|
|
76
89
|
lines.push(` Token: ${renderTokenLine(token, showToken)}`);
|
|
77
90
|
lines.push(` Mode: ${formatValue(effectiveMode)}`);
|
|
78
91
|
lines.push(` Scope: ${scopeDisplay}`);
|
|
@@ -95,6 +108,9 @@ export async function viewConfig(options) {
|
|
|
95
108
|
if (output.token && !options.showToken) {
|
|
96
109
|
output.token = maskToken(output.token);
|
|
97
110
|
}
|
|
111
|
+
if (output.users && !options.showToken) {
|
|
112
|
+
output.users = output.users.map((user) => user.token ? { ...user, token: maskToken(user.token) } : user);
|
|
113
|
+
}
|
|
98
114
|
console.log(JSON.stringify(output, null, 2));
|
|
99
115
|
return;
|
|
100
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/commands/config/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEH,YAAY,EACZ,aAAa,EACb,wBAAwB,EACxB,aAAa,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAe,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/commands/config/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEH,YAAY,EACZ,aAAa,EACb,wBAAwB,EACxB,aAAa,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAe,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAYhE,SAAS,SAAS,CAAC,KAAa;IAC5B,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,MAAM,CAAA;IACnC,OAAO,QAAQ,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACpC,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAmC;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AC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACrC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAChE,CAAA;QACL,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QAC5C,OAAM;IACV,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAA;IAExC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACxD,OAAO,CAAC,GAAG,CACP,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,aAAa,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CACtF,CAAA;QACD,OAAM;IACV,CAAC;IAED,OAAO,CAAC,GAAG,CACP,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,IAAI,KAAK,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CACxF,CAAA;AACL,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ const loadChangelogCommand = async () => (await import('./commands/changelog.js'
|
|
|
28
28
|
const loadGroupsCommand = async () => (await import('./commands/groups/index.js')).registerGroupsCommand;
|
|
29
29
|
const loadDoctorCommand = async () => (await import('./commands/doctor.js')).registerDoctorCommand;
|
|
30
30
|
const loadConfigCommand = async () => (await import('./commands/config/index.js')).registerConfigCommand;
|
|
31
|
+
const loadAccountCommand = async () => (await import('./commands/account/index.js')).registerAccountCommand;
|
|
31
32
|
const commands = {
|
|
32
33
|
workspaces: ['List all workspaces', loadWorkspaceCommand],
|
|
33
34
|
workspace: ['Manage workspace', loadWorkspaceCommand],
|
|
@@ -45,6 +46,7 @@ const commands = {
|
|
|
45
46
|
react: ['Add an emoji reaction (target-type: thread, comment, message)', loadReactCommand],
|
|
46
47
|
unreact: ['Remove an emoji reaction (target-type: thread, comment, message)', loadReactCommand],
|
|
47
48
|
auth: ['Manage authentication', loadAuthCommand],
|
|
49
|
+
account: ['Manage stored CLI accounts (list, current, use, remove)', loadAccountCommand],
|
|
48
50
|
skill: ['Manage agent skill integrations', loadSkillCommand],
|
|
49
51
|
view: ['View a Twist entity by URL', loadViewCommand],
|
|
50
52
|
completion: ['Manage shell completions', loadCompletionCommand],
|
|
@@ -147,6 +149,7 @@ else {
|
|
|
147
149
|
'completion',
|
|
148
150
|
'doctor',
|
|
149
151
|
'auth',
|
|
152
|
+
'account',
|
|
150
153
|
'config',
|
|
151
154
|
'skill',
|
|
152
155
|
]);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEtE,MAAM,oBAAoB,GAAG,KAAK,IAAI,EAAE,CACpC,CAAC,MAAM,MAAM,CAAC,yBA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AC,QAAQ,GAAG,CAAC,CAAA;AACxB,CAAC,CAAC;KACD,OAAO,CAAC,GAAG,EAAE;IACV,gBAAgB,EAAE,CAAA;AACtB,CAAC,CAAC,CAAA"}
|
|
@@ -25,6 +25,21 @@ export declare function createTwistAuthProvider(): AuthProvider<TwistAccount>;
|
|
|
25
25
|
* the numeric forms. Broader than cli-core's default strict-equality matcher.
|
|
26
26
|
*/
|
|
27
27
|
export declare function matchTwistAccount(account: TwistAccount, ref: AccountRef): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* True when the v2 store is empty but a legacy v1 token snapshot is still
|
|
30
|
+
* the only thing keeping the CLI authenticated — typically because
|
|
31
|
+
* `migrateLegacyAuth` couldn't reach the Twist API to identify the account
|
|
32
|
+
* (`MigrateSkipReason: 'identify-failed'`). Account-management commands
|
|
33
|
+
* use this to fail with a dedicated `AUTH_MIGRATION_PENDING` envelope
|
|
34
|
+
* instead of a misleading `ACCOUNT_NOT_FOUND`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isLegacyAuthActive(): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve a `ref` against the v2 store, returning the canonical account.
|
|
39
|
+
* Throws `ACCOUNT_NOT_FOUND` on a miss. Shared between the `tw account ...`
|
|
40
|
+
* commands and `withUserRefAware` so the same hint reaches every caller.
|
|
41
|
+
*/
|
|
42
|
+
export declare function findAccountInStore(store: TwistTokenStore, ref: AccountRef): Promise<TwistAccount>;
|
|
28
43
|
/**
|
|
29
44
|
* `TWIST_API_TOKEN` short-circuits `active()` only when no explicit ref is
|
|
30
45
|
* supplied — cli-core's `KeyringTokenStore` doesn't know about the env var,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EAKjB,KAAK,iBAAiB,EAEzB,MAAM,s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C,CAAA;AAKlE,eAAO,MAAM,iBAAiB,UAkB7B,CAAA;AAED,eAAO,MAAM,gBAAgB,UAW5B,CAAA;AAID;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAA;AAsE7D,wBAAgB,uBAAuB,IAAI,YAAY,CAAC,YAAY,CAAC,CAsHpE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAKjF;AA8ED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAK3D;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACpC,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,UAAU,GAChB,OAAO,CAAC,YAAY,CAAC,CASvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,CAkDvD;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,KAAK,GAAG,cAAc,GAAG,aAAa,CAAC,CAQ5F"}
|
|
@@ -257,6 +257,36 @@ function ensureMigrated() {
|
|
|
257
257
|
}
|
|
258
258
|
return migrationPromise;
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* True when the v2 store is empty but a legacy v1 token snapshot is still
|
|
262
|
+
* the only thing keeping the CLI authenticated — typically because
|
|
263
|
+
* `migrateLegacyAuth` couldn't reach the Twist API to identify the account
|
|
264
|
+
* (`MigrateSkipReason: 'identify-failed'`). Account-management commands
|
|
265
|
+
* use this to fail with a dedicated `AUTH_MIGRATION_PENDING` envelope
|
|
266
|
+
* instead of a misleading `ACCOUNT_NOT_FOUND`.
|
|
267
|
+
*/
|
|
268
|
+
export async function isLegacyAuthActive() {
|
|
269
|
+
const result = await ensureMigrated();
|
|
270
|
+
if (result !== null && migrationIsConclusive(result))
|
|
271
|
+
return false;
|
|
272
|
+
const legacy = await readLegacyTokenSnapshot();
|
|
273
|
+
return legacy !== null;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Resolve a `ref` against the v2 store, returning the canonical account.
|
|
277
|
+
* Throws `ACCOUNT_NOT_FOUND` on a miss. Shared between the `tw account ...`
|
|
278
|
+
* commands and `withUserRefAware` so the same hint reaches every caller.
|
|
279
|
+
*/
|
|
280
|
+
export async function findAccountInStore(store, ref) {
|
|
281
|
+
const records = await store.list();
|
|
282
|
+
const match = records.find(({ account }) => matchTwistAccount(account, ref));
|
|
283
|
+
if (!match) {
|
|
284
|
+
throw new CliError('ACCOUNT_NOT_FOUND', `No stored account matches "${ref}".`, [
|
|
285
|
+
'Run: tw account list',
|
|
286
|
+
]);
|
|
287
|
+
}
|
|
288
|
+
return match.account;
|
|
289
|
+
}
|
|
260
290
|
/**
|
|
261
291
|
* `TWIST_API_TOKEN` short-circuits `active()` only when no explicit ref is
|
|
262
292
|
* supplied — cli-core's `KeyringTokenStore` doesn't know about the env var,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider.js","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GAGnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAClF,OAAO,EAAiB,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CA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AAK,CAAA;IAC5C,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAA;IAChC,MAAM,MAAM,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,MAAM,EAAE,aAAa;QAAE,OAAO,aAAa,CAAA;IAC/C,IAAI,MAAM;QAAE,OAAO,cAAc,CAAA;IACjC,IAAI,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE;QAAE,OAAO,aAAa,CAAA;IAC9C,OAAO,cAAc,CAAA;AACzB,CAAC"}
|
package/dist/lib/errors.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type { ErrorType } from '@doist/cli-core';
|
|
|
6
6
|
* This union provides intellisense suggestions while still accepting any string,
|
|
7
7
|
* allowing dynamic codes and future additions.
|
|
8
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 & {});
|
|
9
|
+
export type ErrorCode = 'AUTH_FAILED' | 'AUTH_MIGRATION_PENDING' | '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
10
|
/**
|
|
11
11
|
* Check whether an error is a Twist API 403 "Insufficient scope" response.
|
|
12
12
|
* Works with any error shaped like TwistRequestError (httpStatusCode + responseData).
|
package/dist/lib/errors.d.ts.map
CHANGED
|
@@ -1 +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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;AACH,MAAM,MAAM,SAAS,GAEf,aAAa,GACb,wBAAwB,GACxB,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"}
|
package/dist/lib/errors.js.map
CHANGED
|
@@ -1 +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;
|
|
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;AA8DvB;;;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"}
|
|
@@ -3,6 +3,6 @@ export declare const SKILL_DESCRIPTION = "Twist messaging CLI. View and respond
|
|
|
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 login --callback-port <n># Override the local OAuth callback port (default 8766)\ntw auth login --json # Emit a JSON envelope for scripted / agent use\ntw auth login --ndjson # Emit an NDJSON envelope for scripted / agent use\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 # Full status payload as JSON (--ndjson also supported)\ntw auth status --user <ref> # Target a specific stored account (id, id:<n>, or display name)\ntw --user <ref> auth <status|logout|token view> # Equivalent to passing --user after the subcommand; other commands accept the flag but ignore it\ntw auth logout # Remove saved token and auth metadata\ntw auth logout --json # Emits `{\"ok\": true}` (--ndjson is silent)\ntw auth logout --user <ref> # Target a specific stored account; mismatched ref errors with ACCOUNT_NOT_FOUND\ntw auth token view # Print the saved token to stdout (pipe-safe; refuses if TWIST_API_TOKEN is set)\ntw auth token view --user <ref> # Print the saved token for a specific stored account\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\ntw groups view <group-ref> # Show group with member details\ntw groups view <ref> --json # JSON output with id, name, workspaceId, members\ntw groups view <ref> --json --full # Include all fields in JSON output\ntw groups create \"Name\" # Create a new group\ntw groups create \"Name\" --users alice@doist.com,bob@doist.com # Create with members\ntw groups create \"Name\" --json # Output created group as JSON\ntw groups rename <group-ref> \"New name\" # Rename a group\ntw groups rename <ref> \"Name\" --json # Output renamed group as JSON\ntw groups delete <group-ref> --yes # Delete a group (requires --yes)\ntw groups delete <ref> --dry-run # Preview deletion\ntw groups add-user <group-ref> user1 user2 # Add users to a group\ntw groups add-user <ref> a@d.com,b@d.com # Comma-separated refs\ntw groups add-user <ref> id:123 --json # Output result as JSON\ntw groups remove-user <group-ref> user1 user2 # Remove users from a group\ntw groups remove-user <ref> id:123,id:456 # Comma-separated ID refs\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 --check --json # Same, JSON envelope\ntw update --check --ndjson # Same, newline-delimited JSON envelope\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\ntw update switch --pre-release --json # Same, JSON envelope\ntw update switch --pre-release --ndjson # Same, newline-delimited JSON envelope\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--progress-jsonl=<path> # Same, but write events to <path> instead of stderr\n--progress-jsonl <path> # Same as above (space-separated form also accepted)\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";
|
|
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 login --callback-port <n># Override the local OAuth callback port (default 8766)\ntw auth login --json # Emit a JSON envelope for scripted / agent use\ntw auth login --ndjson # Emit an NDJSON envelope for scripted / agent use\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 # Full status payload as JSON (--ndjson also supported)\ntw auth status --user <ref> # Target a specific stored account (id, id:<n>, or display name)\ntw --user <ref> auth <status|logout|token view> # Equivalent to passing --user after the subcommand; other commands accept the flag but ignore it\ntw auth logout # Remove saved token and auth metadata\ntw auth logout --json # Emits `{\"ok\": true}` (--ndjson is silent)\ntw auth logout --user <ref> # Target a specific stored account; mismatched ref errors with ACCOUNT_NOT_FOUND\ntw auth token view # Print the saved token to stdout (pipe-safe; refuses if TWIST_API_TOKEN is set)\ntw auth token view --user <ref> # Print the saved token for a specific stored account\ntw account [list|current|use <ref>|remove <ref>] # Manage stored accounts; all support --json/--ndjson\n # current's payload is {id, label, authMode, authScope, source:\"config\"} | {source:\"env\"} | {source:\"legacy\"}\ntw auth login # Re-running auth login with a different OAuth grant adds a NEW account; default stays pinned unless none was set\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\ntw groups view <group-ref> # Show group with member details\ntw groups view <ref> --json # JSON output with id, name, workspaceId, members\ntw groups view <ref> --json --full # Include all fields in JSON output\ntw groups create \"Name\" # Create a new group\ntw groups create \"Name\" --users alice@doist.com,bob@doist.com # Create with members\ntw groups create \"Name\" --json # Output created group as JSON\ntw groups rename <group-ref> \"New name\" # Rename a group\ntw groups rename <ref> \"Name\" --json # Output renamed group as JSON\ntw groups delete <group-ref> --yes # Delete a group (requires --yes)\ntw groups delete <ref> --dry-run # Preview deletion\ntw groups add-user <group-ref> user1 user2 # Add users to a group\ntw groups add-user <ref> a@d.com,b@d.com # Comma-separated refs\ntw groups add-user <ref> id:123 --json # Output result as JSON\ntw groups remove-user <group-ref> user1 user2 # Remove users from a group\ntw groups remove-user <ref> id:123,id:456 # Comma-separated ID refs\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 --check --json # Same, JSON envelope\ntw update --check --ndjson # Same, newline-delimited JSON envelope\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\ntw update switch --pre-release --json # Same, JSON envelope\ntw update switch --pre-release --ndjson # Same, newline-delimited JSON envelope\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--progress-jsonl=<path> # Same, but write events to <path> instead of stderr\n--progress-jsonl <path> # Same as above (space-separated form also accepted)\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,2TAC8R,CAAA;AAE5T,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,aAAa,QAAsB,CAAA;AAEhD,eAAO,MAAM,aAAa,
|
|
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,ogqBAyYzB,CAAA;AAED,eAAO,MAAM,kBAAkB,QASd,CAAA"}
|
|
@@ -26,6 +26,9 @@ tw auth logout --json # Emits \`{"ok": true}\` (--ndjson is silent)
|
|
|
26
26
|
tw auth logout --user <ref> # Target a specific stored account; mismatched ref errors with ACCOUNT_NOT_FOUND
|
|
27
27
|
tw auth token view # Print the saved token to stdout (pipe-safe; refuses if TWIST_API_TOKEN is set)
|
|
28
28
|
tw auth token view --user <ref> # Print the saved token for a specific stored account
|
|
29
|
+
tw account [list|current|use <ref>|remove <ref>] # Manage stored accounts; all support --json/--ndjson
|
|
30
|
+
# current's payload is {id, label, authMode, authScope, source:"config"} | {source:"env"} | {source:"legacy"}
|
|
31
|
+
tw auth login # Re-running auth login with a different OAuth grant adds a NEW account; default stays pinned unless none was set
|
|
29
32
|
tw workspaces # List available workspaces
|
|
30
33
|
tw workspace use <ref> # Set current workspace
|
|
31
34
|
tw completion install # Install shell completions
|
|
@@ -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,wTAAwT,CAAA;AAE5T,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
|
|
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,wTAAwT,CAAA;AAE5T,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAA;AAEnC,MAAM,CAAC,MAAM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