@kosuke-ai/kosuke 1.0.66 → 1.0.68
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 +10 -0
- package/README.md +11 -0
- package/dist/commands/hand-written.js +15 -0
- package/dist/commands/integrations-request.js +128 -0
- package/dist/commands/integrations-shared.js +45 -0
- package/dist/commands/integrations.js +12 -44
- package/dist/generated/commands/index.js +271 -265
- package/dist/generated/commands/integrations/tools-request.js +87 -0
- package/dist/generated/commands/projects/batch-merging-get.js +1 -1
- package/dist/generated/commands/projects/batch-merging-set.js +1 -1
- package/dist/generated/commands/user/settings-get.js +17 -0
- package/dist/generated/commands/user/settings-update.js +37 -0
- package/dist/integrations/api.js +13 -1
- package/dist/integrations/render.js +24 -6
- package/openapi.json +233 -2
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.68
|
|
4
|
+
|
|
5
|
+
- `kosuke integrations list` prints the platform's line naming integrations you can still connect, even when none is connected yet.
|
|
6
|
+
- Add `kosuke user settings get` and `kosuke user settings update` to read and set your timezone and its source.
|
|
7
|
+
- `kosuke projects batch-merging get` reports `mode` alone and no longer shows `enabled`, whose `false` meant the merge train and read as off. `set --enabled` and `--no-enabled` still work.
|
|
8
|
+
|
|
9
|
+
## 1.0.67
|
|
10
|
+
|
|
11
|
+
- Add `kosuke integrations request` to send one request to a Composio toolkit's own API through your connection, for an action no listed tool does; `integrations list --toolkit` says whether a toolkit takes them and its API base URL.
|
|
12
|
+
|
|
3
13
|
## 1.0.66
|
|
4
14
|
|
|
5
15
|
- Remove `--needs-you` and `--viewer` from `sessions list`, and the `needsYouReason` field from its rows: what waits on you is a Sensei card, which `kosuke sensei cards list` lists. An older CLI that still sends them gets the plain list. `agent summary get` no longer prints a Needs You section.
|
package/README.md
CHANGED
|
@@ -203,6 +203,7 @@ kosuke integrations list --workspace <id> --toolkit gmail # that toolkit's to
|
|
|
203
203
|
kosuke integrations tools get <tool> --workspace <id> # one tool's input schema
|
|
204
204
|
kosuke integrations call <tool> --workspace <id> --account notion-personal --args '{"query":"roadmap"}'
|
|
205
205
|
kosuke integrations call youtube_upload_video --workspace <id> --args-file video.json --file videoFilePath=./clip.mp4
|
|
206
|
+
kosuke integrations request googlecalendar --workspace <id> --method GET --path /calendars/primary --purpose "read the calendar colors"
|
|
206
207
|
```
|
|
207
208
|
|
|
208
209
|
`list` with no filter prints each toolkit's connections (alias, scope, label,
|
|
@@ -217,6 +218,16 @@ reference: `--file <argument>=<path>` uploads the local file and fills it in,
|
|
|
217
218
|
once per file, and a file inside a list or object names its path, such as
|
|
218
219
|
`attachment.0`. The file goes straight to storage, up to 5 GiB.
|
|
219
220
|
|
|
221
|
+
`request` is for an action no listed tool does: it sends one GET, POST, PUT or
|
|
222
|
+
PATCH to a Composio toolkit's own API through your connection, and Composio adds
|
|
223
|
+
the credentials on the server. `--path` is relative to the API base URL that
|
|
224
|
+
`list --toolkit <slug>` prints, with `--query name=value` and `--body-file <json>`
|
|
225
|
+
beside it. `--purpose` is required: one line on what no listed tool does, with no
|
|
226
|
+
names, emails or event titles, stored with the usage row. It is refused before any
|
|
227
|
+
vendor call for Kosuke's own integrations, toolkits limited to their reviewed
|
|
228
|
+
tools, DELETE and a path that is not plainly relative. A write that gets no answer
|
|
229
|
+
exits 1 and is never sent again: its outcome is unknown.
|
|
230
|
+
|
|
220
231
|
With an API key, `--workspace` is required (you must belong to it), and `call`
|
|
221
232
|
runs only your own personal connections. Inside an agent's turn the credential
|
|
222
233
|
decides the workspace and the flag is optional. A Connector Token is refused.
|
|
@@ -74,6 +74,21 @@ export const HAND_WRITTEN = {
|
|
|
74
74
|
agents: 'all',
|
|
75
75
|
workspace: true,
|
|
76
76
|
},
|
|
77
|
+
integrationsRequest: {
|
|
78
|
+
command: ['integrations', 'request'],
|
|
79
|
+
positionals: ['toolkit'],
|
|
80
|
+
flags: [
|
|
81
|
+
'--method',
|
|
82
|
+
'--path',
|
|
83
|
+
'--purpose',
|
|
84
|
+
'--query',
|
|
85
|
+
'--body-file',
|
|
86
|
+
'--account',
|
|
87
|
+
'--workspace',
|
|
88
|
+
],
|
|
89
|
+
agents: 'all',
|
|
90
|
+
workspace: true,
|
|
91
|
+
},
|
|
77
92
|
sessionsJobsWatch: {
|
|
78
93
|
command: ['sessions', 'jobs', 'watch'],
|
|
79
94
|
positionals: ['projectId', 'sessionId', 'jobId'],
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { InvalidArgumentError } from 'commander';
|
|
2
|
+
import { leafAt } from '../runtime/attach.js';
|
|
3
|
+
import { failureOf, isRow, transportFailure, UNKNOWN_OUTCOME, } from '../integrations/api.js';
|
|
4
|
+
import { HAND_WRITTEN } from './hand-written.js';
|
|
5
|
+
import { accountText, CALL_TIMEOUT_MS, DELEGATED_RUN_HEADER, delegatedRunOf, toolkitSlug, UsageError, WORKSPACE_HELP, workspaceFor, } from './integrations-shared.js';
|
|
6
|
+
/**
|
|
7
|
+
* `kosuke integrations request`: one request to a Composio toolkit's own API, for an action no
|
|
8
|
+
* listed tool does. The platform judges the method and the path, so what it refuses still shows on
|
|
9
|
+
* Admin's Missing actions; only what it could not read stops here.
|
|
10
|
+
*/
|
|
11
|
+
const REQUESTS_PATH = '/api/agent-integrations/requests';
|
|
12
|
+
const MAX_PATH_CHARS = 2048;
|
|
13
|
+
const MAX_PURPOSE_CHARS = 120;
|
|
14
|
+
function methodWord(raw) {
|
|
15
|
+
if (raw === undefined)
|
|
16
|
+
throw new UsageError('--method is required: GET, POST, PUT or PATCH.');
|
|
17
|
+
if (!/^[A-Za-z]{1,16}$/.test(raw))
|
|
18
|
+
throw new UsageError('--method: GET, POST, PUT or PATCH.');
|
|
19
|
+
return raw.toUpperCase();
|
|
20
|
+
}
|
|
21
|
+
function pathText(raw) {
|
|
22
|
+
if (raw === undefined)
|
|
23
|
+
throw new UsageError('--path is required.');
|
|
24
|
+
if (raw === '' || raw.startsWith('--') || raw.length > MAX_PATH_CHARS) {
|
|
25
|
+
throw new UsageError(`--path: a path relative to the toolkit's API base URL, up to ${MAX_PATH_CHARS} characters.`);
|
|
26
|
+
}
|
|
27
|
+
return raw;
|
|
28
|
+
}
|
|
29
|
+
function queryPair(raw, previous = []) {
|
|
30
|
+
const at = raw.indexOf('=');
|
|
31
|
+
if (at < 1)
|
|
32
|
+
throw new InvalidArgumentError('Expected name=value.');
|
|
33
|
+
return [...previous, [raw.slice(0, at), raw.slice(at + 1)]];
|
|
34
|
+
}
|
|
35
|
+
function purposeText(raw) {
|
|
36
|
+
if (raw === undefined) {
|
|
37
|
+
throw new UsageError('--purpose is required: one line on what the member wanted that no listed tool does.');
|
|
38
|
+
}
|
|
39
|
+
if (raw.trim() === '' || raw.startsWith('--') || raw.length > MAX_PURPOSE_CHARS) {
|
|
40
|
+
throw new UsageError(`--purpose: one line of 1 to ${MAX_PURPOSE_CHARS} characters.`);
|
|
41
|
+
}
|
|
42
|
+
return raw;
|
|
43
|
+
}
|
|
44
|
+
export function attachIntegrationsRequest(root, runtime, { guarded, fail, report, readStdin, readText, callTimeoutMs, env, }) {
|
|
45
|
+
leafAt(root, HAND_WRITTEN.integrationsRequest.command)
|
|
46
|
+
.description("Send one request straight to a Composio toolkit's own API through your connection, for an " +
|
|
47
|
+
'action no listed tool does, and print its answer. Composio adds the credentials on the ' +
|
|
48
|
+
'server, so no token is needed or shown. The connection it ran on is named on stderr. ' +
|
|
49
|
+
'A refusal or a vendor error exits 1.')
|
|
50
|
+
.argument('<toolkit>', 'The toolkit, as `list` prints it, such as googlecalendar.', toolkitSlug)
|
|
51
|
+
// Required, but checked in the action: commander's own refusal exits 1, not the usage exit 2.
|
|
52
|
+
.option('--method <method>', 'Required. GET, POST, PUT or PATCH. GET is a read.')
|
|
53
|
+
.option('--path <path>', "Required. Relative to the toolkit's API base URL, which `list --toolkit <slug>` prints. It " +
|
|
54
|
+
'starts with /, with no %, no .. and no empty segment.')
|
|
55
|
+
.option('--purpose <text>', 'Required. One line on what the member wanted that no listed tool does, with no names, emails ' +
|
|
56
|
+
'or event titles. It is stored with the usage row.')
|
|
57
|
+
.option('--query <name=value>', 'A query parameter. Repeat it for several.', queryPair)
|
|
58
|
+
.option('--body-file <path>', 'Read a JSON object to send as the body, or - for stdin.')
|
|
59
|
+
.option('--account <account>', 'The connection to run on: an alias, id or scope:label. Needed when you have several.', accountText)
|
|
60
|
+
.option('--workspace <id>', WORKSPACE_HELP)
|
|
61
|
+
.addHelpText('after', '\nUse a listed tool when one does the action: this is for what none does. POST, PUT and PATCH\n' +
|
|
62
|
+
'are writes and pass the same checks as a listed write tool. DELETE is refused, and so are\n' +
|
|
63
|
+
'toolkits limited to their reviewed tools; `list --toolkit <slug>` says which.\n' +
|
|
64
|
+
'\nWith an API key, a request runs only on your own personal connections.\n' +
|
|
65
|
+
`\nA request waits up to ${CALL_TIMEOUT_MS / 1000} s for its answer. A write that gets no answer is never sent\n` +
|
|
66
|
+
'again: its outcome is unknown, so read the current state first.\n' +
|
|
67
|
+
'\nExit codes:\n 0 the vendor answered with a success\n 1 refused, the vendor reported an error, or the outcome of a write is unknown\n 2 usage error: --method, --path, --purpose or --workspace missing or unusable, or a body that is not a JSON object')
|
|
68
|
+
.action(guarded(async (toolkit, flags) => {
|
|
69
|
+
const method = methodWord(flags.method);
|
|
70
|
+
const path = pathText(flags.path);
|
|
71
|
+
const purpose = purposeText(flags.purpose);
|
|
72
|
+
const body = flags.bodyFile === undefined ? undefined : await readBody(flags.bodyFile);
|
|
73
|
+
const client = runtime.client({ answerTimeoutMs: callTimeoutMs });
|
|
74
|
+
const workspace = workspaceFor(runtime, flags.workspace);
|
|
75
|
+
const delegatedRun = delegatedRunOf(env);
|
|
76
|
+
// A GET changes nothing, so a lost answer is plain; anything else may have landed.
|
|
77
|
+
const read = method === 'GET';
|
|
78
|
+
const verb = read ? 'GET' : 'POST';
|
|
79
|
+
let data;
|
|
80
|
+
try {
|
|
81
|
+
const result = await client.POST(REQUESTS_PATH, {
|
|
82
|
+
params: { query: workspace ? { workspace } : {} },
|
|
83
|
+
...(delegatedRun && { headers: { [DELEGATED_RUN_HEADER]: delegatedRun } }),
|
|
84
|
+
body: {
|
|
85
|
+
toolkit,
|
|
86
|
+
// Checked by the server, which records what it refuses.
|
|
87
|
+
method: method,
|
|
88
|
+
path,
|
|
89
|
+
purpose,
|
|
90
|
+
...(flags.query ? { query: flags.query } : {}),
|
|
91
|
+
...(body ? { body } : {}),
|
|
92
|
+
...(flags.account ? { account: flags.account } : {}),
|
|
93
|
+
},
|
|
94
|
+
signal: AbortSignal.timeout(callTimeoutMs),
|
|
95
|
+
});
|
|
96
|
+
if (!result.response.ok) {
|
|
97
|
+
if (!read && result.response.status >= 500)
|
|
98
|
+
return fail(UNKNOWN_OUTCOME);
|
|
99
|
+
return fail(failureOf(result.response.status, result.error, verb));
|
|
100
|
+
}
|
|
101
|
+
data = isRow(result.data) ? result.data.data : undefined;
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
return fail(transportFailure(error, verb));
|
|
105
|
+
}
|
|
106
|
+
report(`${toolkit} requests`, flags.account, data);
|
|
107
|
+
}));
|
|
108
|
+
/** Reads `--body-file`, or stdin for `-`: a JSON object, since that is all a body may be. */
|
|
109
|
+
async function readBody(path) {
|
|
110
|
+
let text;
|
|
111
|
+
try {
|
|
112
|
+
text = path === '-' ? await readStdin() : await readText(path);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
throw new UsageError(`Could not read the body file ${path}.`);
|
|
116
|
+
}
|
|
117
|
+
let parsed;
|
|
118
|
+
try {
|
|
119
|
+
parsed = JSON.parse(text);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
throw new UsageError('The body is not valid JSON.');
|
|
123
|
+
}
|
|
124
|
+
if (!isRow(parsed))
|
|
125
|
+
throw new UsageError('The body must be a JSON object.');
|
|
126
|
+
return parsed;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { InvalidArgumentError } from 'commander';
|
|
2
|
+
import { isTurnToken } from '../runtime/credentials.js';
|
|
3
|
+
/** What `kosuke integrations call` and `kosuke integrations request` share. */
|
|
4
|
+
/**
|
|
5
|
+
* One value for every call: the execute route's `maxDuration`, the longest the platform lets
|
|
6
|
+
* one run. The platform decides from the tool and the account where a call runs, so the CLI cannot
|
|
7
|
+
* give the others a shorter wait. They end sooner on the platform's side, a Composio read at its
|
|
8
|
+
* 60 s budget, and wait no longer than their answer takes.
|
|
9
|
+
*/
|
|
10
|
+
export const CALL_TIMEOUT_MS = 330_000;
|
|
11
|
+
const TOOLKIT_PATTERN = /^[a-z0-9_]{1,64}$/;
|
|
12
|
+
const MAX_ACCOUNT_CHARS = 100;
|
|
13
|
+
/** The header a call made by a Delegated Run carries, so the platform counts it as a delegate's. */
|
|
14
|
+
export const DELEGATED_RUN_HEADER = 'x-kosuke-delegated-run';
|
|
15
|
+
/** The Delegated Run this process runs in, set by the sandbox for a full-access run, or null. */
|
|
16
|
+
export function delegatedRunOf(env) {
|
|
17
|
+
const value = env.KOSUKE_DELEGATED_RUN_ID?.trim();
|
|
18
|
+
return value && /^[A-Za-z0-9_-]{1,64}$/.test(value) ? value : null;
|
|
19
|
+
}
|
|
20
|
+
/** Wrong flags or arguments, found before any request. */
|
|
21
|
+
export class UsageError extends Error {
|
|
22
|
+
}
|
|
23
|
+
export function toolkitSlug(raw) {
|
|
24
|
+
if (!TOOLKIT_PATTERN.test(raw)) {
|
|
25
|
+
throw new InvalidArgumentError('Expected a toolkit slug such as gmail, as `list` prints it.');
|
|
26
|
+
}
|
|
27
|
+
return raw;
|
|
28
|
+
}
|
|
29
|
+
export function accountText(raw) {
|
|
30
|
+
// A flag swallowed as the value (`--account --args`) shows as a leading dash.
|
|
31
|
+
if (raw.trim() === '' || raw.startsWith('-') || raw.length > MAX_ACCOUNT_CHARS) {
|
|
32
|
+
throw new InvalidArgumentError(`Expected an alias, a connection id or scope:label, up to ${MAX_ACCOUNT_CHARS} characters.`);
|
|
33
|
+
}
|
|
34
|
+
return raw;
|
|
35
|
+
}
|
|
36
|
+
export const WORKSPACE_HELP = 'The workspace to use. Required with an API key, which is refused when you are not a member of it. ' +
|
|
37
|
+
'Inside an agent turn the credential decides, and this is optional.';
|
|
38
|
+
/** A turn's token decides its workspace; a member's API key has to name one. */
|
|
39
|
+
export function workspaceFor(runtime, given) {
|
|
40
|
+
if (given)
|
|
41
|
+
return given;
|
|
42
|
+
if (isTurnToken(runtime.credentials().apiKey))
|
|
43
|
+
return undefined;
|
|
44
|
+
throw new UsageError('--workspace <id> is required with an API key. `kosuke workspaces list` shows the ids.');
|
|
45
|
+
}
|
|
@@ -2,13 +2,14 @@ import { readFile } from 'node:fs/promises';
|
|
|
2
2
|
import { InvalidArgumentError } from 'commander';
|
|
3
3
|
import { leafAt } from '../runtime/attach.js';
|
|
4
4
|
import { HAND_WRITTEN } from './hand-written.js';
|
|
5
|
-
import {
|
|
5
|
+
import { attachIntegrationsRequest } from './integrations-request.js';
|
|
6
|
+
import { accountText, CALL_TIMEOUT_MS, DELEGATED_RUN_HEADER, delegatedRunOf, toolkitSlug, UsageError, WORKSPACE_HELP, workspaceFor, } from './integrations-shared.js';
|
|
6
7
|
import { jsonRequested } from '../runtime/runtime.js';
|
|
7
8
|
import { connectionOf, failureOf, isRow, oneLine, readOverview, rowsOf, TOOLS_PATH, transportFailure, } from '../integrations/api.js';
|
|
8
9
|
import { FILE_UPLOAD_PATH, fileSize, MAX_FILE_BYTES, md5Of, mimetypeOf, parseFileArgument, putFile, setAt, uploadName, } from '../integrations/file-upload.js';
|
|
9
10
|
import { choiceLines, renderOverview } from '../integrations/render.js';
|
|
10
11
|
/**
|
|
11
|
-
* `kosuke integrations list|call` and `kosuke integrations tools get`: the connected tools,
|
|
12
|
+
* `kosuke integrations list|call|request` and `kosuke integrations tools get`: the connected tools,
|
|
12
13
|
* listed and run from a laptop or an agent's shell. Hand-written because the output is text
|
|
13
14
|
* and the exit code says whether the tool worked, which the generated, hidden
|
|
14
15
|
* `integrations tools list` and `integrations tools call` (raw JSON passthroughs, kept
|
|
@@ -19,55 +20,23 @@ import { choiceLines, renderOverview } from '../integrations/render.js';
|
|
|
19
20
|
*/
|
|
20
21
|
const EXECUTE_PATH = '/api/agent-integrations/execute';
|
|
21
22
|
const READ_TIMEOUT_MS = 30_000;
|
|
22
|
-
/**
|
|
23
|
-
* One value for every call: the execute route's `maxDuration`, the longest the platform lets
|
|
24
|
-
* one run. The platform decides from the tool and the account where a call runs, so the CLI cannot
|
|
25
|
-
* give the others a shorter wait. They end sooner on the platform's side, a Composio read at its
|
|
26
|
-
* 60 s budget, and wait no longer than their answer takes.
|
|
27
|
-
*/
|
|
28
|
-
const CALL_TIMEOUT_MS = 330_000;
|
|
29
23
|
/** One file's PUT to storage; the storage URL lets an upload start for an hour. */
|
|
30
24
|
const UPLOAD_TIMEOUT_MS = 60 * 60_000;
|
|
31
25
|
const EXIT_FAILED = 1;
|
|
32
26
|
const EXIT_USAGE = 2;
|
|
33
|
-
const TOOLKIT_PATTERN = /^[a-z0-9_]{1,64}$/;
|
|
34
27
|
const MAX_SEARCH_CHARS = 100;
|
|
35
|
-
const MAX_ACCOUNT_CHARS = 100;
|
|
36
|
-
/** The header a call made by a Delegated Run carries, so the platform counts it as a delegate's. */
|
|
37
|
-
const DELEGATED_RUN_HEADER = 'x-kosuke-delegated-run';
|
|
38
|
-
/** The Delegated Run this process runs in, set by the sandbox for a full-access run, or null. */
|
|
39
|
-
function delegatedRunOf(env) {
|
|
40
|
-
const value = env.KOSUKE_DELEGATED_RUN_ID?.trim();
|
|
41
|
-
return value && /^[A-Za-z0-9_-]{1,64}$/.test(value) ? value : null;
|
|
42
|
-
}
|
|
43
|
-
/** Wrong flags or arguments, found before any request. */
|
|
44
|
-
class UsageError extends Error {
|
|
45
|
-
}
|
|
46
28
|
async function readAllStdin() {
|
|
47
29
|
const chunks = [];
|
|
48
30
|
for await (const chunk of process.stdin)
|
|
49
31
|
chunks.push(Buffer.from(chunk));
|
|
50
32
|
return Buffer.concat(chunks).toString('utf8');
|
|
51
33
|
}
|
|
52
|
-
function toolkitSlug(raw) {
|
|
53
|
-
if (!TOOLKIT_PATTERN.test(raw)) {
|
|
54
|
-
throw new InvalidArgumentError('Expected a toolkit slug such as gmail, as `list` prints it.');
|
|
55
|
-
}
|
|
56
|
-
return raw;
|
|
57
|
-
}
|
|
58
34
|
function searchText(raw) {
|
|
59
35
|
if (raw.trim() === '' || raw.length > MAX_SEARCH_CHARS) {
|
|
60
36
|
throw new InvalidArgumentError(`Expected 1 to ${MAX_SEARCH_CHARS} characters.`);
|
|
61
37
|
}
|
|
62
38
|
return raw;
|
|
63
39
|
}
|
|
64
|
-
function accountText(raw) {
|
|
65
|
-
// A flag swallowed as the value (`--account --args`) shows as a leading dash.
|
|
66
|
-
if (raw.trim() === '' || raw.startsWith('-') || raw.length > MAX_ACCOUNT_CHARS) {
|
|
67
|
-
throw new InvalidArgumentError(`Expected an alias, a connection id or scope:label, up to ${MAX_ACCOUNT_CHARS} characters.`);
|
|
68
|
-
}
|
|
69
|
-
return raw;
|
|
70
|
-
}
|
|
71
40
|
function fileArguments(raw, previous = []) {
|
|
72
41
|
const parsed = parseFileArgument(raw);
|
|
73
42
|
if (!parsed) {
|
|
@@ -81,16 +50,6 @@ function limitNumber(raw) {
|
|
|
81
50
|
}
|
|
82
51
|
return Number(raw);
|
|
83
52
|
}
|
|
84
|
-
const WORKSPACE_HELP = 'The workspace to use. Required with an API key, which is refused when you are not a member of it. ' +
|
|
85
|
-
'Inside an agent turn the credential decides, and this is optional.';
|
|
86
|
-
/** A turn's token decides its workspace; a member's API key has to name one. */
|
|
87
|
-
function workspaceFor(runtime, given) {
|
|
88
|
-
if (given)
|
|
89
|
-
return given;
|
|
90
|
-
if (isTurnToken(runtime.credentials().apiKey))
|
|
91
|
-
return undefined;
|
|
92
|
-
throw new UsageError('--workspace <id> is required with an API key. `kosuke workspaces list` shows the ids.');
|
|
93
|
-
}
|
|
94
53
|
/** The 409 that asks for `--account`: its choices, one per line. */
|
|
95
54
|
function accountChoiceText(error, tool, given) {
|
|
96
55
|
if (!isRow(error))
|
|
@@ -302,6 +261,15 @@ export function attachIntegrationsCommands(root, runtime, deps = {}) {
|
|
|
302
261
|
}
|
|
303
262
|
report(name, flags.account, data);
|
|
304
263
|
}));
|
|
264
|
+
attachIntegrationsRequest(root, runtime, {
|
|
265
|
+
guarded,
|
|
266
|
+
fail,
|
|
267
|
+
report,
|
|
268
|
+
readStdin,
|
|
269
|
+
readText,
|
|
270
|
+
callTimeoutMs,
|
|
271
|
+
env,
|
|
272
|
+
});
|
|
305
273
|
/**
|
|
306
274
|
* Reserves one file's upload, sends the file to storage and answers its reference, or reports
|
|
307
275
|
* the failure and answers null. Nothing is called yet, so a failure here changes nothing.
|