@guildai/cli 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/agent/chat.js +10 -7
- package/dist/commands/agent/clone.js +2 -0
- package/dist/commands/agent/fork.js +3 -0
- package/dist/commands/agent/init.js +58 -44
- package/dist/commands/agent/list.js +5 -4
- package/dist/commands/agent/logs.d.ts +3 -0
- package/dist/commands/agent/logs.js +62 -0
- package/dist/commands/agent/owners.js +3 -3
- package/dist/commands/agent/pull.js +8 -12
- package/dist/commands/agent/save.js +5 -6
- package/dist/commands/agent/search.js +5 -4
- package/dist/commands/agent/test.js +9 -6
- package/dist/commands/agent/update.js +9 -1
- package/dist/commands/agent/versions.js +5 -4
- package/dist/commands/agent/workspaces.js +5 -4
- package/dist/commands/auth/login.js +1 -3
- package/dist/commands/chat.d.ts +9 -0
- package/dist/commands/chat.js +136 -32
- package/dist/commands/config/get.js +4 -4
- package/dist/commands/config/list.js +2 -3
- package/dist/commands/config/path.js +2 -3
- package/dist/commands/config/set.js +12 -12
- package/dist/commands/credentials/endpoint-list.js +5 -4
- package/dist/commands/credentials/list.js +5 -4
- package/dist/commands/credentials/policy-list.js +5 -4
- package/dist/commands/doctor.js +5 -5
- package/dist/commands/integration/connect.js +2 -2
- package/dist/commands/integration/create.js +2 -2
- package/dist/commands/integration/get.js +2 -2
- package/dist/commands/integration/list.js +5 -4
- package/dist/commands/integration/operation/create.js +4 -4
- package/dist/commands/integration/operation/list.js +5 -4
- package/dist/commands/integration/update.js +2 -2
- package/dist/commands/integration/version/build.js +2 -2
- package/dist/commands/integration/version/create.js +2 -2
- package/dist/commands/integration/version/get.js +2 -2
- package/dist/commands/integration/version/list.js +5 -4
- package/dist/commands/integration/version/publish.js +2 -2
- package/dist/commands/integration/version/test.js +2 -2
- package/dist/commands/job/get.js +2 -2
- package/dist/commands/session/create.js +1 -1
- package/dist/commands/session/events.js +3 -2
- package/dist/commands/session/list.js +5 -4
- package/dist/commands/session/tasks.js +5 -4
- package/dist/commands/setup.d.ts +16 -0
- package/dist/commands/setup.js +76 -46
- package/dist/commands/trigger/list.js +5 -4
- package/dist/commands/trigger/sessions.js +3 -2
- package/dist/commands/workspace/agent/list.js +5 -4
- package/dist/commands/workspace/context/list.js +5 -4
- package/dist/commands/workspace/list.js +5 -4
- package/dist/index.js +15 -4
- package/dist/lib/api-types.d.ts +4 -0
- package/dist/lib/api-types.js +4 -0
- package/dist/lib/auth.d.ts +1 -1
- package/dist/lib/auth.js +2 -2
- package/dist/lib/output-mode.d.ts +9 -2
- package/dist/lib/output-mode.js +23 -2
- package/dist/lib/output.d.ts +7 -1
- package/dist/lib/output.js +36 -5
- package/dist/lib/owner-helpers.d.ts +3 -0
- package/dist/lib/owner-helpers.js +17 -10
- package/dist/lib/session-events.d.ts +13 -2
- package/dist/lib/session-events.js +15 -1
- package/dist/lib/session-polling.js +9 -3
- package/dist/lib/session-resume.d.ts +15 -1
- package/dist/lib/session-resume.js +149 -16
- package/dist/lib/splash.js +3 -2
- package/dist/lib/stdin.d.ts +5 -1
- package/dist/lib/stdin.js +8 -1
- package/dist/lib/version-helpers.js +24 -8
- package/package.json +1 -1
|
@@ -4,15 +4,16 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
5
5
|
import { getAuthToken } from '../../lib/auth.js';
|
|
6
6
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
7
|
-
import {
|
|
7
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
8
8
|
import { createOutputWriter, formatPoliciesTable } from '../../lib/output.js';
|
|
9
|
+
import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
|
|
9
10
|
export function createCredentialsPolicyListCommand() {
|
|
10
11
|
const cmd = new Command('list');
|
|
11
12
|
cmd
|
|
12
13
|
.description('List policies for a credential')
|
|
13
14
|
.argument('<credential-id>', 'Credential ID')
|
|
14
|
-
.option('--limit <number>',
|
|
15
|
-
.option('--offset <number>', 'Offset for pagination', '0')
|
|
15
|
+
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
16
|
+
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
16
17
|
.action(async (credentialId, options) => {
|
|
17
18
|
const output = createOutputWriter();
|
|
18
19
|
try {
|
|
@@ -26,7 +27,7 @@ export function createCredentialsPolicyListCommand() {
|
|
|
26
27
|
params.append('limit', options.limit);
|
|
27
28
|
params.append('offset', options.offset);
|
|
28
29
|
const response = await client.get(`/credentials/${credentialId}/policies?${params.toString()}`);
|
|
29
|
-
if (
|
|
30
|
+
if (isMachineReadable()) {
|
|
30
31
|
console.log(JSON.stringify(response, null, 2));
|
|
31
32
|
}
|
|
32
33
|
else {
|
package/dist/commands/doctor.js
CHANGED
|
@@ -6,7 +6,7 @@ import axios from 'axios';
|
|
|
6
6
|
import { getAuthToken } from '../lib/auth.js';
|
|
7
7
|
import { getGuildcoreUrl } from '../lib/config.js';
|
|
8
8
|
import { loadGlobalConfig, isAgentDirectory, getGlobalConfigPath, loadLocalConfig, } from '../lib/guild-config.js';
|
|
9
|
-
import {
|
|
9
|
+
import { isMachineReadable } from '../lib/output-mode.js';
|
|
10
10
|
import { createOutputWriter } from '../lib/output.js';
|
|
11
11
|
async function checkAuth() {
|
|
12
12
|
const token = await getAuthToken();
|
|
@@ -178,9 +178,9 @@ export function createDoctorCommand() {
|
|
|
178
178
|
const cmd = new Command('doctor');
|
|
179
179
|
cmd.description('Check CLI setup and diagnose issues').action(async () => {
|
|
180
180
|
const output = createOutputWriter();
|
|
181
|
-
const
|
|
181
|
+
const jsonMode = isMachineReadable();
|
|
182
182
|
const checks = [];
|
|
183
|
-
if (
|
|
183
|
+
if (!jsonMode) {
|
|
184
184
|
output.progress('\nChecking Guild CLI setup...\n');
|
|
185
185
|
}
|
|
186
186
|
const runners = [
|
|
@@ -195,7 +195,7 @@ export function createDoctorCommand() {
|
|
|
195
195
|
for (const runner of runners) {
|
|
196
196
|
const result = await runner();
|
|
197
197
|
checks.push(result);
|
|
198
|
-
if (
|
|
198
|
+
if (!jsonMode) {
|
|
199
199
|
const icon = result.status === 'pass'
|
|
200
200
|
? chalk.green('✓')
|
|
201
201
|
: result.status === 'fail'
|
|
@@ -212,7 +212,7 @@ export function createDoctorCommand() {
|
|
|
212
212
|
const passed = checks.filter((c) => c.status === 'pass').length;
|
|
213
213
|
const failed = checks.filter((c) => c.status === 'fail').length;
|
|
214
214
|
const skipped = checks.filter((c) => c.status === 'skip').length;
|
|
215
|
-
if (
|
|
215
|
+
if (jsonMode) {
|
|
216
216
|
output.data({ checks, passed, failed, skipped });
|
|
217
217
|
}
|
|
218
218
|
else {
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../lib/output.js';
|
|
10
10
|
import { isInteractive } from '../../lib/stdin.js';
|
|
11
11
|
export function createIntegrationConnectCommand() {
|
|
@@ -54,7 +54,7 @@ export function createIntegrationConnectCommand() {
|
|
|
54
54
|
params.append('auth_config_id', integration.auth_config.id);
|
|
55
55
|
params.append('owner_id', options.owner);
|
|
56
56
|
const credential = await client.post(`/credentials/api-key?${params.toString()}`, { tokens: { token: apiKey } });
|
|
57
|
-
if (
|
|
57
|
+
if (isMachineReadable()) {
|
|
58
58
|
output.data(credential);
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../lib/output.js';
|
|
10
10
|
import { resolveOwnerId } from '../../lib/owner-helpers.js';
|
|
11
11
|
import { isInteractive } from '../../lib/stdin.js';
|
|
@@ -280,7 +280,7 @@ export function createIntegrationCreateCommand() {
|
|
|
280
280
|
body.webhook_config = webhookConfig;
|
|
281
281
|
}
|
|
282
282
|
const response = await client.post(`/accounts/${owner.name}/integrations`, body);
|
|
283
|
-
if (
|
|
283
|
+
if (isMachineReadable()) {
|
|
284
284
|
output.data(response);
|
|
285
285
|
}
|
|
286
286
|
else {
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../lib/output.js';
|
|
10
10
|
function formatDate(dateStr) {
|
|
11
11
|
return new Date(dateStr).toLocaleString('en-US', {
|
|
@@ -77,7 +77,7 @@ export function createIntegrationGetCommand() {
|
|
|
77
77
|
}
|
|
78
78
|
const client = new GuildAPIClient();
|
|
79
79
|
const response = await client.get(`/integrations/${identifier}`);
|
|
80
|
-
if (
|
|
80
|
+
if (isMachineReadable()) {
|
|
81
81
|
output.data(response);
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
@@ -4,8 +4,9 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
5
5
|
import { getAuthToken } from '../../lib/auth.js';
|
|
6
6
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
7
|
-
import {
|
|
7
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
8
8
|
import { createOutputWriter, formatIntegrationTable } from '../../lib/output.js';
|
|
9
|
+
import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
|
|
9
10
|
const SORT_MAP = {
|
|
10
11
|
updated: 'updated_at',
|
|
11
12
|
newest: 'created_at',
|
|
@@ -18,8 +19,8 @@ export function createIntegrationListCommand() {
|
|
|
18
19
|
.option('--search <query>', 'Search integrations by name or description')
|
|
19
20
|
.option('--sort <field>', 'Sort by: updated, newest, name (default: updated)', 'updated')
|
|
20
21
|
.option('--published', 'Only show integrations with at least one published version')
|
|
21
|
-
.option('--limit <number>',
|
|
22
|
-
.option('--offset <number>', 'Offset for pagination', '0')
|
|
22
|
+
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
23
|
+
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
23
24
|
.action(async (options) => {
|
|
24
25
|
const output = createOutputWriter();
|
|
25
26
|
try {
|
|
@@ -43,7 +44,7 @@ export function createIntegrationListCommand() {
|
|
|
43
44
|
params.append('sort_by', sortField);
|
|
44
45
|
}
|
|
45
46
|
const response = await client.get(`/integrations?${params.toString()}`);
|
|
46
|
-
if (
|
|
47
|
+
if (isMachineReadable()) {
|
|
47
48
|
output.data(response);
|
|
48
49
|
}
|
|
49
50
|
else {
|
|
@@ -6,7 +6,7 @@ import { readFileSync, existsSync } from 'fs';
|
|
|
6
6
|
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
7
7
|
import { getAuthToken } from '../../../lib/auth.js';
|
|
8
8
|
import { handleAxiosError } from '../../../lib/errors.js';
|
|
9
|
-
import {
|
|
9
|
+
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
10
10
|
import { createOutputWriter } from '../../../lib/output.js';
|
|
11
11
|
import { resolveVersionId } from '../../../lib/integration-helpers.js';
|
|
12
12
|
import { isInteractive } from '../../../lib/stdin.js';
|
|
@@ -43,13 +43,13 @@ export function createIntegrationOperationCreateCommand() {
|
|
|
43
43
|
}
|
|
44
44
|
const content = readFileSync(options.openapi, 'utf-8');
|
|
45
45
|
const response = await client.post(`/integration_versions/${versionId}/endpoint_generators`, { type: 'openapi', content });
|
|
46
|
-
if (
|
|
46
|
+
if (isMachineReadable()) {
|
|
47
47
|
output.data(response);
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
50
|
console.log(chalk.green('OpenAPI operation generation triggered'));
|
|
51
51
|
console.log();
|
|
52
|
-
console.log(
|
|
52
|
+
console.log(`Operations will be generated asynchronously. Use 'guild integration operation list ${identifier}' to check results.`);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
@@ -138,7 +138,7 @@ export function createIntegrationOperationCreateCommand() {
|
|
|
138
138
|
body.output_body_type = JSON.parse(readFileSync(options.outputBodySchema, 'utf-8'));
|
|
139
139
|
}
|
|
140
140
|
const response = await client.post(`/integration_versions/${versionId}/endpoints`, body);
|
|
141
|
-
if (
|
|
141
|
+
if (isMachineReadable()) {
|
|
142
142
|
output.data(response);
|
|
143
143
|
}
|
|
144
144
|
else {
|
|
@@ -5,18 +5,19 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../../lib/output.js';
|
|
10
10
|
import { resolveVersionId } from '../../../lib/integration-helpers.js';
|
|
11
11
|
import { Table } from '../../../lib/table.js';
|
|
12
|
+
import { DEFAULT_PAGE_LIMIT_LARGE } from '../../../lib/api-types.js';
|
|
12
13
|
export function createIntegrationOperationListCommand() {
|
|
13
14
|
const cmd = new Command('list');
|
|
14
15
|
cmd
|
|
15
16
|
.description('List operations for an integration version')
|
|
16
17
|
.argument('<id_or_name>', 'Integration ID or name (owner~name)')
|
|
17
18
|
.option('--version-number <semver>', 'Specific version, e.g. 1.0.0')
|
|
18
|
-
.option('--limit <number>',
|
|
19
|
-
.option('--offset <number>', 'Offset for pagination', '0')
|
|
19
|
+
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT_LARGE})`, String(DEFAULT_PAGE_LIMIT_LARGE))
|
|
20
|
+
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
20
21
|
.action(async (identifier, options) => {
|
|
21
22
|
const output = createOutputWriter();
|
|
22
23
|
try {
|
|
@@ -31,7 +32,7 @@ export function createIntegrationOperationListCommand() {
|
|
|
31
32
|
params.append('limit', options.limit);
|
|
32
33
|
params.append('offset', options.offset);
|
|
33
34
|
const response = await client.get(`/integration_versions/${versionId}/endpoints?${params.toString()}`);
|
|
34
|
-
if (
|
|
35
|
+
if (isMachineReadable()) {
|
|
35
36
|
output.data(response);
|
|
36
37
|
}
|
|
37
38
|
else {
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../lib/output.js';
|
|
10
10
|
function formatUpdatedIntegration(integration) {
|
|
11
11
|
console.log(chalk.green('Integration updated successfully'));
|
|
@@ -121,7 +121,7 @@ export function createIntegrationUpdateCommand() {
|
|
|
121
121
|
process.exit(1);
|
|
122
122
|
}
|
|
123
123
|
const response = await client.patch(`/integrations/${identifier}`, body);
|
|
124
|
-
if (
|
|
124
|
+
if (isMachineReadable()) {
|
|
125
125
|
output.data(response);
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../../lib/output.js';
|
|
10
10
|
import { createSpinner } from '../../../lib/progress.js';
|
|
11
11
|
import { resolveLatestDraftId } from '../../../lib/integration-helpers.js';
|
|
@@ -36,7 +36,7 @@ export function createIntegrationVersionBuildCommand() {
|
|
|
36
36
|
const buildResponse = await client.post(`/integration_versions/${versionId}/build`, {
|
|
37
37
|
version_number: options.versionNumber,
|
|
38
38
|
});
|
|
39
|
-
if (
|
|
39
|
+
if (isMachineReadable()) {
|
|
40
40
|
output.data(buildResponse);
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../../lib/output.js';
|
|
10
10
|
export function createIntegrationVersionCreateCommand() {
|
|
11
11
|
const cmd = new Command('create');
|
|
@@ -22,7 +22,7 @@ export function createIntegrationVersionCreateCommand() {
|
|
|
22
22
|
}
|
|
23
23
|
const client = new GuildAPIClient();
|
|
24
24
|
const response = await client.post(`/integrations/${identifier}/versions`, {});
|
|
25
|
-
if (
|
|
25
|
+
if (isMachineReadable()) {
|
|
26
26
|
output.data(response);
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../../lib/output.js';
|
|
10
10
|
import { resolveVersionId } from '../../../lib/integration-helpers.js';
|
|
11
11
|
function formatDate(dateStr) {
|
|
@@ -46,7 +46,7 @@ export function createIntegrationVersionGetCommand() {
|
|
|
46
46
|
const client = new GuildAPIClient();
|
|
47
47
|
const versionId = await resolveVersionId(client, identifier, options.versionNumber);
|
|
48
48
|
const response = await client.get(`/integration_versions/${versionId}`);
|
|
49
|
-
if (
|
|
49
|
+
if (isMachineReadable()) {
|
|
50
50
|
output.data(response);
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
@@ -4,15 +4,16 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
5
5
|
import { getAuthToken } from '../../../lib/auth.js';
|
|
6
6
|
import { handleAxiosError } from '../../../lib/errors.js';
|
|
7
|
-
import {
|
|
7
|
+
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
8
8
|
import { createOutputWriter, formatIntegrationVersionTable, } from '../../../lib/output.js';
|
|
9
|
+
import { DEFAULT_PAGE_LIMIT } from '../../../lib/api-types.js';
|
|
9
10
|
export function createIntegrationVersionListCommand() {
|
|
10
11
|
const cmd = new Command('list');
|
|
11
12
|
cmd
|
|
12
13
|
.description('List integration versions')
|
|
13
14
|
.argument('<id_or_name>', 'Integration ID or name')
|
|
14
|
-
.option('--limit <number>',
|
|
15
|
-
.option('--offset <number>', 'Offset for pagination', '0')
|
|
15
|
+
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
16
|
+
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
16
17
|
.action(async (identifier, options) => {
|
|
17
18
|
const output = createOutputWriter();
|
|
18
19
|
try {
|
|
@@ -26,7 +27,7 @@ export function createIntegrationVersionListCommand() {
|
|
|
26
27
|
params.append('limit', options.limit);
|
|
27
28
|
params.append('offset', options.offset);
|
|
28
29
|
const response = await client.get(`/integrations/${identifier}/versions?${params.toString()}`);
|
|
29
|
-
if (
|
|
30
|
+
if (isMachineReadable()) {
|
|
30
31
|
output.data(response);
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../../lib/output.js';
|
|
10
10
|
import { createSpinner } from '../../../lib/progress.js';
|
|
11
11
|
import { resolveVersionId } from '../../../lib/integration-helpers.js';
|
|
@@ -38,7 +38,7 @@ export function createIntegrationVersionPublishCommand() {
|
|
|
38
38
|
const currentVersion = await client.get(`/integration_versions/${versionId}`);
|
|
39
39
|
const versionDisplay = currentVersion.version_number || versionId;
|
|
40
40
|
const publishResponse = await client.post(`/integration_versions/${versionId}/publish`, {});
|
|
41
|
-
if (
|
|
41
|
+
if (isMachineReadable()) {
|
|
42
42
|
output.data(publishResponse);
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
6
6
|
import { getAuthToken } from '../../../lib/auth.js';
|
|
7
7
|
import { handleAxiosError } from '../../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter } from '../../../lib/output.js';
|
|
10
10
|
import { resolveVersionId } from '../../../lib/integration-helpers.js';
|
|
11
11
|
function parseJsonFlag(value, flagName) {
|
|
@@ -60,7 +60,7 @@ export function createIntegrationVersionTestCommand() {
|
|
|
60
60
|
body.credential_id = creds.items[0].id;
|
|
61
61
|
}
|
|
62
62
|
const response = await client.post(`/integration_versions/${versionId}/test`, body);
|
|
63
|
-
if (
|
|
63
|
+
if (isMachineReadable()) {
|
|
64
64
|
output.data(response);
|
|
65
65
|
}
|
|
66
66
|
else {
|
package/dist/commands/job/get.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
5
5
|
import { getAuthToken } from '../../lib/auth.js';
|
|
6
6
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
7
|
-
import {
|
|
7
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
8
8
|
import { createOutputWriter, formatJobStepTable } from '../../lib/output.js';
|
|
9
9
|
export function createJobGetCommand() {
|
|
10
10
|
const cmd = new Command('get');
|
|
@@ -24,7 +24,7 @@ export function createJobGetCommand() {
|
|
|
24
24
|
client.get(`/jobs/${jobId}`),
|
|
25
25
|
client.get(`/jobs/${jobId}/steps`),
|
|
26
26
|
]);
|
|
27
|
-
if (
|
|
27
|
+
if (isMachineReadable()) {
|
|
28
28
|
console.log(JSON.stringify({ ...job, steps: stepsResponse.steps }, null, 2));
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
@@ -11,7 +11,7 @@ export function createSessionCreateCommand() {
|
|
|
11
11
|
cmd
|
|
12
12
|
.description('Create a new session')
|
|
13
13
|
.option('--workspace <id>', 'Workspace ID or name (e.g., owner~workspace-name)')
|
|
14
|
-
.option('--type <type>', 'Session type: chat or agent_test', 'chat')
|
|
14
|
+
.option('--type <type>', 'Session type: chat or agent_test (default: chat)', 'chat')
|
|
15
15
|
.option('--prompt <text>', 'Initial prompt (required for chat sessions)')
|
|
16
16
|
.option('--agent <identifier>', 'Agent identifier, e.g., owner~agent-name')
|
|
17
17
|
.action(async (options) => {
|
|
@@ -4,6 +4,7 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
5
5
|
import { getAuthToken } from '../../lib/auth.js';
|
|
6
6
|
import { parseEventFilter, DEFAULT_EVENT_TYPES, USER_EVENT_TYPES, SYSTEM_EVENT_TYPES, } from '../../lib/event-filter.js';
|
|
7
|
+
import { DEFAULT_PAGE_LIMIT_LARGE } from '../../lib/api-types.js';
|
|
7
8
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
8
9
|
import { createOutputWriter } from '../../lib/output.js';
|
|
9
10
|
export function createSessionEventsCommand() {
|
|
@@ -12,8 +13,8 @@ export function createSessionEventsCommand() {
|
|
|
12
13
|
.description('List events in a session')
|
|
13
14
|
.argument('<session-id>', 'Session ID')
|
|
14
15
|
.option('--events <types>', 'Event types to show (default: user). Shorthands: none, user, system, all, or comma-separated type names')
|
|
15
|
-
.option('--limit <number>',
|
|
16
|
-
.option('--offset <number>', 'Offset for pagination', '0')
|
|
16
|
+
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT_LARGE})`, String(DEFAULT_PAGE_LIMIT_LARGE))
|
|
17
|
+
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
17
18
|
.addHelpText('after', [
|
|
18
19
|
'',
|
|
19
20
|
'Available event types:',
|
|
@@ -5,16 +5,17 @@ import { GuildAPIClient } from '../../lib/api-client.js';
|
|
|
5
5
|
import { getAuthToken } from '../../lib/auth.js';
|
|
6
6
|
import { getWorkspaceId } from '../../lib/guild-config.js';
|
|
7
7
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
9
9
|
import { createOutputWriter, formatSessionTable } from '../../lib/output.js';
|
|
10
|
+
import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
|
|
10
11
|
export function createSessionListCommand() {
|
|
11
12
|
const cmd = new Command('list');
|
|
12
13
|
cmd
|
|
13
14
|
.description('List sessions in a workspace')
|
|
14
15
|
.option('--workspace <id>', 'Workspace ID or name (e.g., owner~workspace-name)')
|
|
15
16
|
.option('--type <type>', 'Filter by session type: chat, webhook, time, agent_test')
|
|
16
|
-
.option('--limit <number>',
|
|
17
|
-
.option('--offset <number>', 'Offset for pagination', '0')
|
|
17
|
+
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
18
|
+
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
18
19
|
.action(async (options) => {
|
|
19
20
|
const output = createOutputWriter();
|
|
20
21
|
try {
|
|
@@ -40,7 +41,7 @@ export function createSessionListCommand() {
|
|
|
40
41
|
params.append('types', options.type.toLowerCase());
|
|
41
42
|
}
|
|
42
43
|
const response = await client.get(`/workspaces/${workspaceId}/sessions?${params.toString()}`);
|
|
43
|
-
if (
|
|
44
|
+
if (isMachineReadable()) {
|
|
44
45
|
console.log(JSON.stringify(response, null, 2));
|
|
45
46
|
}
|
|
46
47
|
else {
|
|
@@ -4,15 +4,16 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
5
5
|
import { getAuthToken } from '../../lib/auth.js';
|
|
6
6
|
import { handleAxiosError } from '../../lib/errors.js';
|
|
7
|
-
import {
|
|
7
|
+
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
8
8
|
import { createOutputWriter, formatTaskTable } from '../../lib/output.js';
|
|
9
|
+
import { DEFAULT_PAGE_LIMIT_LARGE } from '../../lib/api-types.js';
|
|
9
10
|
export function createSessionTasksCommand() {
|
|
10
11
|
const cmd = new Command('tasks');
|
|
11
12
|
cmd
|
|
12
13
|
.description('List tasks in a session')
|
|
13
14
|
.argument('<session-id>', 'Session ID')
|
|
14
|
-
.option('--limit <number>',
|
|
15
|
-
.option('--offset <number>', 'Offset for pagination', '0')
|
|
15
|
+
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT_LARGE})`, String(DEFAULT_PAGE_LIMIT_LARGE))
|
|
16
|
+
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
16
17
|
.action(async (sessionId, options) => {
|
|
17
18
|
const output = createOutputWriter();
|
|
18
19
|
try {
|
|
@@ -26,7 +27,7 @@ export function createSessionTasksCommand() {
|
|
|
26
27
|
params.append('limit', options.limit);
|
|
27
28
|
params.append('offset', options.offset);
|
|
28
29
|
const response = await client.get(`/sessions/${sessionId}/tasks?${params.toString()}`);
|
|
29
|
-
if (
|
|
30
|
+
if (isMachineReadable()) {
|
|
30
31
|
console.log(JSON.stringify(response, null, 2));
|
|
31
32
|
}
|
|
32
33
|
else {
|
package/dist/commands/setup.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Run setup in a target directory. Exported so init/clone can call it.
|
|
4
|
+
* When called with `quiet: true`, suppresses progress output (used as a
|
|
5
|
+
* post-init/clone step where the caller handles its own progress UI).
|
|
6
|
+
*/
|
|
7
|
+
export declare function runSetup(targetDir: string, options?: {
|
|
8
|
+
force?: boolean;
|
|
9
|
+
claudeMd?: boolean;
|
|
10
|
+
codex?: boolean;
|
|
11
|
+
agentsMd?: boolean;
|
|
12
|
+
mcp?: boolean;
|
|
13
|
+
quiet?: boolean;
|
|
14
|
+
}): Promise<{
|
|
15
|
+
filesCreated: number;
|
|
16
|
+
filesSkipped: number;
|
|
17
|
+
}>;
|
|
2
18
|
export declare function createSetupCommand(): Command;
|
|
3
19
|
//# sourceMappingURL=setup.d.ts.map
|