@kosuke-ai/kosuke 1.0.160 → 1.0.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/commands/integrations-shared.js +9 -0
- package/dist/commands/integrations.js +2 -2
- package/dist/commands/skill-runs.js +2 -0
- package/dist/generated/commands/integrations/tools-list.js +1 -1
- package/dist/generated/commands/user/push-devices-create.js +22 -1
- package/dist/runtime/client-header.js +34 -0
- package/dist/runtime/client.js +2 -0
- package/openapi.json +25 -4
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.162
|
|
4
|
+
|
|
5
|
+
- Every Kosuke app now tells the server which version and build it is and what it runs on: the CLI, the Mac app, the iPhone app and the Watch send an `X-Kosuke-Client` header such as `mac/0.1.109 (macOS 15.1.1; MacBookPro18,3; arm64)`, and the Mac, iPhone and Watch also report their OS version and model when they register.
|
|
6
|
+
|
|
7
|
+
## 1.0.161
|
|
8
|
+
|
|
9
|
+
- `kosuke integrations list --toolkit` takes an MCP server's toolkit, such as `mcp-deepwiki`: the tools of an MCP server you or a workspace admin added in Settings, Integrations.
|
|
10
|
+
|
|
3
11
|
## 1.0.160
|
|
4
12
|
|
|
5
13
|
- Mac: the installer window is named Sensei, like the app. iPhone: Home cards show their question options and a prototype beside its questions, screenshots in a card's messages, Slack messages as Slack rows with More under the text, a visible close button on every sheet, the ticket row at the normal inset, "N more conversations" opening the older ones, picture-less items as file rows, a visible full-screen button on QA films, and the Later counter unclipped. CLI: `sensei delegates start --model` runs a delegate on another model.
|
|
@@ -27,6 +27,15 @@ export function toolkitSlug(raw) {
|
|
|
27
27
|
// Slugs are lower case; `SLACK` names the same toolkit, as `SLACK_SEND_MESSAGE` names its tool.
|
|
28
28
|
return raw.toLowerCase();
|
|
29
29
|
}
|
|
30
|
+
// A member's MCP server is listed as its own toolkit, `mcp-<name>`, which takes no direct request.
|
|
31
|
+
const LISTED_TOOLKIT_PATTERN = /^[a-z0-9_-]{1,64}$/i;
|
|
32
|
+
/** A toolkit `list --toolkit` narrows to: a slug, or an MCP server's `mcp-<name>`. */
|
|
33
|
+
export function listedToolkitSlug(raw) {
|
|
34
|
+
if (!LISTED_TOOLKIT_PATTERN.test(raw)) {
|
|
35
|
+
throw new InvalidArgumentError('Expected a toolkit slug such as gmail or mcp-deepwiki, as `list` prints it.');
|
|
36
|
+
}
|
|
37
|
+
return raw.toLowerCase();
|
|
38
|
+
}
|
|
30
39
|
export function accountText(raw) {
|
|
31
40
|
// A flag swallowed as the value (`--account --args`) shows as a leading dash.
|
|
32
41
|
if (raw.trim() === '' || raw.startsWith('-') || raw.length > MAX_ACCOUNT_CHARS) {
|
|
@@ -4,7 +4,7 @@ import { InvalidArgumentError } from 'commander';
|
|
|
4
4
|
import { leafAt } from '../runtime/attach.js';
|
|
5
5
|
import { HAND_WRITTEN } from './hand-written.js';
|
|
6
6
|
import { attachIntegrationsRequest } from './integrations-request.js';
|
|
7
|
-
import { accountText, CALL_TIMEOUT_MS, DELEGATED_RUN_HEADER, delegatedRunOf,
|
|
7
|
+
import { accountText, CALL_TIMEOUT_MS, DELEGATED_RUN_HEADER, delegatedRunOf, listedToolkitSlug, UsageError, WORKSPACE_HELP, workspaceFor, } from './integrations-shared.js';
|
|
8
8
|
import { jsonRequested } from '../runtime/runtime.js';
|
|
9
9
|
import { connectionOf, failureOf, isRow, oneLine, readOverview, rowsOf, TOOLS_PATH, transportFailure, } from '../integrations/api.js';
|
|
10
10
|
import { FILE_UPLOAD_PATH, fileSize, MAX_FILE_BYTES, md5Of, mimetypeOf, parseFileArgument, putFile, setAt, uploadName, } from '../integrations/file-upload.js';
|
|
@@ -191,7 +191,7 @@ export function attachIntegrationsCommands(root, runtime, deps = {}) {
|
|
|
191
191
|
'--search list the matching tools. A cut list says "N of M" and how to narrow it. Scope ' +
|
|
192
192
|
"workspace is the workspace's own connection, the Personal space's included; scope " +
|
|
193
193
|
'personal is your own account, reached in every workspace.')
|
|
194
|
-
.option('--toolkit <slug>', 'Only this toolkit, such as gmail.',
|
|
194
|
+
.option('--toolkit <slug>', 'Only this toolkit, such as gmail.', listedToolkitSlug)
|
|
195
195
|
.option('--search <text>', 'Only tools whose name or description mention the text.', searchText)
|
|
196
196
|
.option('--account <account>', 'Only what one connection offers: an alias, id or scope:label.', accountText)
|
|
197
197
|
.option('--limit <n>', 'How many tools to list with --toolkit or --search. Default 40, at most 100.', limitNumber)
|
|
@@ -3,6 +3,7 @@ import { appendFile, lstat, readFile } from 'node:fs/promises';
|
|
|
3
3
|
import { isAbsolute } from 'node:path';
|
|
4
4
|
import { agentTokenOf } from '../runtime/agent-tokens.js';
|
|
5
5
|
import { groupFor, leafAt } from '../runtime/attach.js';
|
|
6
|
+
import { CLIENT_HEADER, clientHeader } from '../runtime/client-header.js';
|
|
6
7
|
import { OWN_TEXT } from '../runtime/help.js';
|
|
7
8
|
import { HAND_WRITTEN } from './hand-written.js';
|
|
8
9
|
const FLAGS = new Set([
|
|
@@ -191,6 +192,7 @@ export async function runSkillMarkerCommand(argv, options = {}) {
|
|
|
191
192
|
headers: {
|
|
192
193
|
authorization: `Bearer ${env.KOSUKE_API_KEY}`,
|
|
193
194
|
'content-type': 'application/json',
|
|
195
|
+
[CLIENT_HEADER]: clientHeader,
|
|
194
196
|
},
|
|
195
197
|
body: JSON.stringify(marker),
|
|
196
198
|
signal: controller.signal,
|
|
@@ -33,7 +33,7 @@ export const operation = {
|
|
|
33
33
|
"flag": "toolkit",
|
|
34
34
|
"kind": "string",
|
|
35
35
|
"required": false,
|
|
36
|
-
"description": "Only this toolkit, by slug, such as gmail."
|
|
36
|
+
"description": "Only this toolkit, by slug, such as gmail or mcp-deepwiki."
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"name": "search",
|
|
@@ -6,7 +6,7 @@ export const operation = {
|
|
|
6
6
|
"push-devices",
|
|
7
7
|
"create"
|
|
8
8
|
],
|
|
9
|
-
"summary": "Register an iPhone or Apple Watch for push notifications with its hex APNs device token, the app bundle id it was issued to and its APNs environment. A token already registered moves to you. The Watch also sends its installationId and a generation it raises on every registration; one older than the registration already held for that installation answers 409. Both apps send their appVersion, which decides the notification categories they are sent. Called by the Sensei iOS and Watch apps; answers 204.",
|
|
9
|
+
"summary": "Register an iPhone or Apple Watch for push notifications with its hex APNs device token, the app bundle id it was issued to and its APNs environment. A token already registered moves to you. The Watch also sends its installationId and a generation it raises on every registration; one older than the registration already held for that installation answers 409. Both apps send their appVersion, which decides the notification categories they are sent, and may send their osVersion, model and build, kept on the device; one that does not read is left out, never refused. Called by the Sensei iOS and Watch apps; answers 204.",
|
|
10
10
|
"pathParams": [],
|
|
11
11
|
"query": [],
|
|
12
12
|
"body": {
|
|
@@ -66,6 +66,27 @@ export const operation = {
|
|
|
66
66
|
"flag": "app-version",
|
|
67
67
|
"kind": "string",
|
|
68
68
|
"required": false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "osVersion",
|
|
72
|
+
"flag": "os-version",
|
|
73
|
+
"kind": "string",
|
|
74
|
+
"required": false,
|
|
75
|
+
"description": "The OS version, such as 18.1."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "model",
|
|
79
|
+
"flag": "model",
|
|
80
|
+
"kind": "string",
|
|
81
|
+
"required": false,
|
|
82
|
+
"description": "The machine identifier, such as iPhone16,2 or Watch7,1."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "build",
|
|
86
|
+
"flag": "build",
|
|
87
|
+
"kind": "string",
|
|
88
|
+
"required": false,
|
|
89
|
+
"description": "The build's CFBundleVersion, such as 212."
|
|
69
90
|
}
|
|
70
91
|
],
|
|
71
92
|
"required": true
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { release } from 'node:os';
|
|
2
|
+
import { version } from './version.js';
|
|
3
|
+
/** The header every Kosuke client sends, so the platform knows which app, at which version, on which OS. */
|
|
4
|
+
export const CLIENT_HEADER = 'X-Kosuke-Client';
|
|
5
|
+
/** The arch tokens the platform reads as an arch when it is the only item after the OS. */
|
|
6
|
+
const KNOWN_ARCHES = new Set(['arm64', 'aarch64', 'x86_64', 'x64', 'ia32', 'arm']);
|
|
7
|
+
/** `value` kept to `allowed` characters (others become `_`) and `max` long; null when empty. */
|
|
8
|
+
function token(value, allowed, max) {
|
|
9
|
+
const kept = value.replace(allowed, '_').slice(0, max);
|
|
10
|
+
return kept ? kept : null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `cli/<version> (<platform> <osRelease>; <arch>)`, e.g. `cli/10.26.0 (darwin 24.1.0; arm64)`.
|
|
14
|
+
* Each part is reduced to the characters the platform accepts rather than sent raw; a part that
|
|
15
|
+
* is left empty is dropped, and an arch the platform would not read as one is left out.
|
|
16
|
+
*/
|
|
17
|
+
function clientHeaderValue(info) {
|
|
18
|
+
const product = `cli/${token(info.version, /[^0-9A-Za-z._-]/g, 64) ?? '0'}`;
|
|
19
|
+
// process.platform is letters and digits (`win32`).
|
|
20
|
+
const os = token(info.platform, /[^A-Za-z0-9]/g, 32);
|
|
21
|
+
if (!os)
|
|
22
|
+
return product;
|
|
23
|
+
const osVersion = token(info.osRelease, /[^0-9A-Za-z._-]/g, 32);
|
|
24
|
+
const arch = KNOWN_ARCHES.has(info.arch) ? info.arch : null;
|
|
25
|
+
const system = [osVersion ? `${os} ${osVersion}` : os, ...(arch ? [arch] : [])].join('; ');
|
|
26
|
+
return `${product} (${system})`;
|
|
27
|
+
}
|
|
28
|
+
/** This CLI's header value, on this machine. */
|
|
29
|
+
export const clientHeader = clientHeaderValue({
|
|
30
|
+
version,
|
|
31
|
+
platform: process.platform,
|
|
32
|
+
osRelease: release(),
|
|
33
|
+
arch: process.arch,
|
|
34
|
+
});
|
package/dist/runtime/client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import createClient, {} from 'openapi-fetch';
|
|
2
|
+
import { CLIENT_HEADER, clientHeader } from './client-header.js';
|
|
2
3
|
import { version } from './version.js';
|
|
3
4
|
const MAX_ATTEMPTS = 3;
|
|
4
5
|
// A few hundred ms, growing: this sits in front of a human or agent waiting
|
|
@@ -202,6 +203,7 @@ export function createApiClient({ apiUrl, apiKey, fetch, answerTimeoutMs, }) {
|
|
|
202
203
|
headers: {
|
|
203
204
|
...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}),
|
|
204
205
|
'User-Agent': `@kosuke-ai/kosuke/${version}`,
|
|
206
|
+
[CLIENT_HEADER]: clientHeader,
|
|
205
207
|
},
|
|
206
208
|
fetch: withIntegrationCap(withTransportRetry(answerTimeoutMs === undefined ? base : withAnswerTimeout(base, answerTimeoutMs))),
|
|
207
209
|
});
|
package/openapi.json
CHANGED
|
@@ -499,11 +499,11 @@
|
|
|
499
499
|
"name": "toolkit",
|
|
500
500
|
"in": "query",
|
|
501
501
|
"required": false,
|
|
502
|
-
"description": "Only this toolkit, by slug, such as gmail.",
|
|
502
|
+
"description": "Only this toolkit, by slug, such as gmail or mcp-deepwiki.",
|
|
503
503
|
"schema": {
|
|
504
|
-
"description": "Only this toolkit, by slug, such as gmail.",
|
|
504
|
+
"description": "Only this toolkit, by slug, such as gmail or mcp-deepwiki.",
|
|
505
505
|
"type": "string",
|
|
506
|
-
"pattern": "^[a-z0-9_]{1,64}$"
|
|
506
|
+
"pattern": "^[a-z0-9_-]{1,64}$"
|
|
507
507
|
}
|
|
508
508
|
},
|
|
509
509
|
{
|
|
@@ -23210,7 +23210,7 @@
|
|
|
23210
23210
|
"/api/push/devices": {
|
|
23211
23211
|
"post": {
|
|
23212
23212
|
"operationId": "userPushDevicesCreate",
|
|
23213
|
-
"summary": "Register an iPhone or Apple Watch for push notifications with its hex APNs device token, the app bundle id it was issued to and its APNs environment. A token already registered moves to you. The Watch also sends its installationId and a generation it raises on every registration; one older than the registration already held for that installation answers 409. Both apps send their appVersion, which decides the notification categories they are sent. Called by the Sensei iOS and Watch apps; answers 204.",
|
|
23213
|
+
"summary": "Register an iPhone or Apple Watch for push notifications with its hex APNs device token, the app bundle id it was issued to and its APNs environment. A token already registered moves to you. The Watch also sends its installationId and a generation it raises on every registration; one older than the registration already held for that installation answers 409. Both apps send their appVersion, which decides the notification categories they are sent, and may send their osVersion, model and build, kept on the device; one that does not read is left out, never refused. Called by the Sensei iOS and Watch apps; answers 204.",
|
|
23214
23214
|
"tags": ["user"],
|
|
23215
23215
|
"x-kosuke-command": ["user", "push-devices", "create"],
|
|
23216
23216
|
"x-kosuke-sandbox-token": true,
|
|
@@ -23259,6 +23259,27 @@
|
|
|
23259
23259
|
"appVersion": {
|
|
23260
23260
|
"type": "string",
|
|
23261
23261
|
"pattern": "^\\d{1,6}(\\.\\d{1,6}){0,3}$"
|
|
23262
|
+
},
|
|
23263
|
+
"osVersion": {
|
|
23264
|
+
"description": "The OS version, such as 18.1.",
|
|
23265
|
+
"type": "string",
|
|
23266
|
+
"minLength": 1,
|
|
23267
|
+
"maxLength": 32,
|
|
23268
|
+
"pattern": "^[0-9A-Za-z._-]+$"
|
|
23269
|
+
},
|
|
23270
|
+
"model": {
|
|
23271
|
+
"description": "The machine identifier, such as iPhone16,2 or Watch7,1.",
|
|
23272
|
+
"type": "string",
|
|
23273
|
+
"minLength": 1,
|
|
23274
|
+
"maxLength": 64,
|
|
23275
|
+
"pattern": "^[A-Za-z0-9,._-]+$"
|
|
23276
|
+
},
|
|
23277
|
+
"build": {
|
|
23278
|
+
"description": "The build's CFBundleVersion, such as 212.",
|
|
23279
|
+
"type": "string",
|
|
23280
|
+
"minLength": 1,
|
|
23281
|
+
"maxLength": 64,
|
|
23282
|
+
"pattern": "^[0-9A-Za-z._-]+$"
|
|
23262
23283
|
}
|
|
23263
23284
|
},
|
|
23264
23285
|
"required": ["token", "platform", "bundleId", "environment"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosuke-ai/kosuke",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.162",
|
|
4
4
|
"description": "Sensei platform CLI. The client customers install to drive app.kosuke.ai from their own machine.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"minimatch": "^11.0.1"
|
|
44
44
|
},
|
|
45
45
|
"kosukeRelease": {
|
|
46
|
-
"sourceCommit": "
|
|
47
|
-
"sourceIdentity": "
|
|
46
|
+
"sourceCommit": "589a3b275171b184b2e8b7bf16ed858138faf8c4",
|
|
47
|
+
"sourceIdentity": "5091abaf88aa449901897bdd1a59050f8bd322fb0ee16814a7924064fddb8e9c",
|
|
48
48
|
"fragments": [
|
|
49
|
-
"
|
|
49
|
+
"client-version-header-x49q1x.json"
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
}
|