@kosuke-ai/kosuke 1.0.170 → 1.0.171

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.171
4
+
5
+ - New: `kosuke search <text>` finds threads, sessions, tasks, projects, Files, Crons and Sensei cards by title in one call, one short line per match with the ids the next command needs (a task's session, a session's project and task, a file's version). `--kinds`, `--workspace` and `--limit` narrow it, and `--json` prints the whole answer. Each kind reaches what its own list reaches for your key or the agent's token.
6
+
3
7
  ## 1.0.170
4
8
 
5
9
  - Add OpenAI's GPT 6.2 Astra and GPT 6.2 Sol to every model picker, at Low to Max and Ultra, with Fast and Ultrafast, priced at OpenAI's list price. GPT 6.2 Sol (xHigh) is now the OpenAI default, and GPT 6 Astra and GPT 6.1 Sol move to Legacy. Delegated Runs now pick OpenAI models by GPT 6.2's Terminal-Bench 4.0 scores.
package/README.md CHANGED
@@ -48,6 +48,7 @@ reaches with its arguments, one line per command group. `kosuke sensei cards sch
48
48
  the rules of every `sensei cards set` field; `kosuke sensei cards schema blocks` prints one.
49
49
 
50
50
  ```sh
51
+ kosuke search login form # threads, sessions, tasks, projects, Files, Crons, cards by title
51
52
  kosuke find 3323 # a PR number, a session or task id, or title words
52
53
  kosuke sessions get <sessionId> # the project is looked up; <projectId> <sessionId> still works
53
54
  kosuke sessions jobs list --session-id <sessionId>
@@ -55,6 +56,15 @@ kosuke sensei sessions facts get <sessionId>
55
56
  kosuke sensei threads get <threadId> --since <messageId>
56
57
  ```
57
58
 
59
+ `kosuke search <text>` finds any of them by title in one call: one line per row, at most 20
60
+ by default, with its kind, id, title and the ids the next command needs (a task's session and
61
+ workspace, a session's project and task, a file's version, a card's thread). Exact titles come
62
+ first, then titles holding every word (at most 10 distinct words), newest first. `--kinds threads,sessions,tasks,files,crons,cards`
63
+ (and `projects`) narrows what it searches, `--workspace <id>` narrows it to one workspace,
64
+ `--limit` takes up to 100, and `--json` prints the platform's whole answer. A kind that could
65
+ not be read is named on its own line rather than read as no matches. An agent token searches its
66
+ own workspace and finds no Sensei Thread, Personal task or Personal Cron.
67
+
58
68
  A workspace's slug, as an app URL carries it (`/w/kosuke-core-765bebf6/…`), works where a
59
69
  workspace id goes: when the platform refuses it as an id, the CLI looks it up among your
60
70
  workspaces and sends the request again with its id.
@@ -53,6 +53,14 @@ export const HAND_WRITTEN = {
53
53
  agents: 'all',
54
54
  workspace: false,
55
55
  },
56
+ // A member's key, their Sensei and every agent token, each held to what the route reaches for it.
57
+ search: {
58
+ command: ['search'],
59
+ positionals: ['text'],
60
+ flags: ['--kinds', '--workspace', '--limit', '--json'],
61
+ agents: 'all',
62
+ workspace: true,
63
+ },
56
64
  integrationsList: {
57
65
  command: ['integrations', 'list'],
58
66
  positionals: [],
@@ -0,0 +1,169 @@
1
+ import { InvalidArgumentError } from 'commander';
2
+ import { oneLine } from '../integrations/api.js';
3
+ import { leafAt } from '../runtime/attach.js';
4
+ import { execute } from '../runtime/invoke.js';
5
+ import { jsonRequested } from '../runtime/runtime.js';
6
+ import { HAND_WRITTEN } from './hand-written.js';
7
+ /**
8
+ * `kosuke search <text>`: threads, sessions, tasks, projects, Files, Crons and cards by title, in
9
+ * one call. Hand-written for its default output, one short line per row with the ids the next
10
+ * command needs; `--json` prints the platform's whole answer, as the hidden `sensei search` does.
11
+ */
12
+ const SEARCH_PATH = '/api/search';
13
+ /** The kinds the platform searches, as `--kinds` takes them. */
14
+ const KINDS = ['threads', 'sessions', 'tasks', 'projects', 'files', 'crons', 'cards'];
15
+ /** The longest query the platform takes. */
16
+ const MAX_QUERY_CHARS = 200;
17
+ /** The distinct words the platform takes; every one must be in a title. */
18
+ const MAX_QUERY_WORDS = 10;
19
+ const MAX_LIMIT = 100;
20
+ /** A title's width in a line, so 20 rows of any kind stay under about 4 KB. */
21
+ const TITLE_WIDTH = 40;
22
+ /** A Cron's projects named in its line; the rest are counted, and `crons get` lists them. */
23
+ const CRON_PROJECTS_SHOWN = 1;
24
+ function isRow(value) {
25
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
26
+ }
27
+ function kindList(raw) {
28
+ const kinds = [
29
+ ...new Set(raw
30
+ .split(',')
31
+ .map((kind) => kind.trim().toLowerCase())
32
+ .filter(Boolean)),
33
+ ];
34
+ const unknown = kinds.filter((kind) => !KINDS.includes(kind));
35
+ if (kinds.length === 0 || unknown.length > 0) {
36
+ throw new InvalidArgumentError(`Expected a comma list of ${KINDS.join(', ')}.`);
37
+ }
38
+ return kinds;
39
+ }
40
+ function limitNumber(raw) {
41
+ if (!/^\d+$/.test(raw) || Number(raw) < 1 || Number(raw) > MAX_LIMIT) {
42
+ throw new InvalidArgumentError(`Expected a whole number from 1 to ${MAX_LIMIT}.`);
43
+ }
44
+ return Number(raw);
45
+ }
46
+ const text = (value) => typeof value === 'string' && value !== '' ? oneLine(value, 80) : null;
47
+ /** `key=value` for each value the row has. */
48
+ function pairs(entries) {
49
+ return entries.flatMap(([key, value]) => {
50
+ const shown = typeof value === 'number' ? String(value) : text(value);
51
+ return shown === null ? [] : [`${key}=${shown}`];
52
+ });
53
+ }
54
+ /** The workspace a get of this row names: its id, or `personal` for what belongs to none. */
55
+ const workspaceOf = (row) => text(row.workspaceId) ?? 'personal';
56
+ /** What the next command needs from a row, by its kind. */
57
+ function nextIds(row) {
58
+ switch (row.kind) {
59
+ case 'session':
60
+ return pairs([
61
+ ['status', row.status],
62
+ ['project', row.projectId],
63
+ ['task', row.taskId],
64
+ ]);
65
+ case 'task':
66
+ return pairs([
67
+ ['status', row.status],
68
+ ['session', row.sessionId],
69
+ ['workspace', row.workspaceId],
70
+ ]);
71
+ case 'file':
72
+ case 'folder':
73
+ return [
74
+ ...pairs([['version', row.version]]),
75
+ `workspace=${workspaceOf(row)}`,
76
+ ...pairs([['parent', row.parentId]]),
77
+ ];
78
+ case 'cron': {
79
+ const projects = Array.isArray(row.projectIds)
80
+ ? row.projectIds.flatMap((id) => text(id) ?? [])
81
+ : [];
82
+ const shown = projects.slice(0, CRON_PROJECTS_SHOWN).join(',');
83
+ const more = projects.length - CRON_PROJECTS_SHOWN;
84
+ return [
85
+ ...pairs([['status', row.status]]),
86
+ `workspace=${workspaceOf(row)}`,
87
+ ...(shown ? [`projects=${shown}${more > 0 ? `,+${more}` : ''}`] : []),
88
+ ];
89
+ }
90
+ case 'card':
91
+ return pairs([
92
+ ['status', row.status],
93
+ ['thread', row.threadId],
94
+ ['session', row.sessionId],
95
+ ]);
96
+ case 'thread':
97
+ return pairs([['status', row.status]]);
98
+ default:
99
+ return [];
100
+ }
101
+ }
102
+ /** One line per row, then what was cut or could not be read. */
103
+ function renderSearch(data) {
104
+ const answer = isRow(data) ? data : {};
105
+ const rows = Array.isArray(answer.results) ? answer.results.filter(isRow) : [];
106
+ const lines = rows.map((row) => [
107
+ text(row.kind) ?? '?',
108
+ text(row.id) ?? '?',
109
+ JSON.stringify(oneLine(row.title, TITLE_WIDTH)),
110
+ ...nextIds(row),
111
+ ].join(' '));
112
+ if (lines.length === 0)
113
+ lines.push('No matches.');
114
+ if (answer.truncated === true) {
115
+ lines.push('More may match: add words, narrow --kinds or --workspace, or raise --limit.');
116
+ }
117
+ const failed = Array.isArray(answer.failedKinds)
118
+ ? answer.failedKinds.flatMap((kind) => text(kind) ?? [])
119
+ : [];
120
+ if (failed.length > 0) {
121
+ lines.push(`Not searched, they failed: ${failed.join(', ')}. Run it again for them.`);
122
+ }
123
+ return `${lines.join('\n')}\n`;
124
+ }
125
+ export function attachSearchCommand(root, runtime, deps = {}) {
126
+ const { stdout = (line) => process.stdout.write(line), env = process.env } = deps;
127
+ leafAt(root, HAND_WRITTEN.search.command)
128
+ .description('Find threads, sessions, tasks, projects, Files, Crons and cards by title in one call, ' +
129
+ 'exact titles first, then titles holding every word, newest first. One line per row: ' +
130
+ 'kind, id, title and the ids the next command needs. --json prints the whole answer.')
131
+ .argument('<text...>', `Words of the title or name, any case, every one in it: at most ${MAX_QUERY_WORDS} distinct words.`)
132
+ .option('--kinds <list>', `Only these, a comma list of ${KINDS.join(', ')}.`, kindList)
133
+ .option('--workspace <id>', 'Only this workspace; what belongs to no workspace drops out.')
134
+ .option('--limit <n>', `How many rows. Default 20, at most ${MAX_LIMIT}.`, limitNumber)
135
+ .option('--json', "Print the platform's answer as JSON.")
136
+ .addHelpText('after', '\nInside an agent turn the credential decides the workspace, and an agent token held to one\n' +
137
+ 'workspace finds no Sensei Thread, Personal task or Personal Cron.\n' +
138
+ '\nExit codes:\n 0 ok, matches or none\n 1 the platform refused or could not answer')
139
+ .action(async (words, flags, command) => {
140
+ const q = words.join(' ').trim();
141
+ if (q === '' || q.length > MAX_QUERY_CHARS) {
142
+ command.error(`error: the text must be 1 to ${MAX_QUERY_CHARS} characters.`);
143
+ }
144
+ if (new Set(q.toLowerCase().split(/\s+/)).size > MAX_QUERY_WORDS) {
145
+ command.error(`error: the text must hold at most ${MAX_QUERY_WORDS} distinct words.`);
146
+ }
147
+ const outcome = await execute(runtime.client(), {
148
+ method: 'post',
149
+ path: SEARCH_PATH,
150
+ pathParams: {},
151
+ query: {},
152
+ body: {
153
+ kind: 'json',
154
+ value: {
155
+ q,
156
+ ...(flags.kinds ? { kinds: flags.kinds } : {}),
157
+ ...(flags.workspace ? { workspace: flags.workspace } : {}),
158
+ ...(flags.limit ? { limit: flags.limit } : {}),
159
+ },
160
+ },
161
+ });
162
+ // The program's own --json takes the flag wherever it is written, so it is read from there.
163
+ if (!outcome.ok || jsonRequested(command.optsWithGlobals().json, env)) {
164
+ runtime.output(outcome);
165
+ return;
166
+ }
167
+ stdout(renderSearch(isRow(outcome.body) ? outcome.body.data : undefined));
168
+ });
169
+ }
@@ -244,129 +244,130 @@ import { operation as o242 } from './sensei/reels-later-holds-create.js';
244
244
  import { operation as o243 } from './sensei/reels-later-holds-delete.js';
245
245
  import { operation as o244 } from './sensei/reels-later-holds-list.js';
246
246
  import { operation as o245 } from './sensei/repository-cards-create.js';
247
- import { operation as o246 } from './sensei/sessions-assessments-create.js';
248
- import { operation as o247 } from './sensei/sessions-facts-get.js';
249
- import { operation as o248 } from './sensei/suggestions-create.js';
250
- import { operation as o249 } from './sensei/threads-archive.js';
251
- import { operation as o250 } from './sensei/threads-close.js';
252
- import { operation as o251 } from './sensei/threads-create.js';
253
- import { operation as o252 } from './sensei/threads-get.js';
254
- import { operation as o253 } from './sensei/threads-list.js';
255
- import { operation as o254 } from './sensei/threads-move.js';
256
- import { operation as o255 } from './sensei/threads-notes-get.js';
257
- import { operation as o256 } from './sensei/threads-notes-send.js';
258
- import { operation as o257 } from './sensei/threads-search.js';
259
- import { operation as o258 } from './sensei/threads-split.js';
260
- import { operation as o259 } from './sensei/threads-unarchive.js';
261
- import { operation as o260 } from './sensei/tickets-merge.js';
262
- import { operation as o261 } from './sensei/watch-reads-finish.js';
263
- import { operation as o262 } from './sensei/widgets-get.js';
264
- import { operation as o263 } from './sensei/writing-get.js';
265
- import { operation as o264 } from './sensei/writing-set.js';
266
- import { operation as o265 } from './sensei/writing-samples-create.js';
267
- import { operation as o266 } from './sessions/app-stack-start.js';
268
- import { operation as o267 } from './sessions/create.js';
269
- import { operation as o268 } from './sessions/delete.js';
270
- import { operation as o269 } from './sessions/desktop-control-set.js';
271
- import { operation as o270 } from './sessions/desktop-get.js';
272
- import { operation as o271 } from './sessions/desktop-start.js';
273
- import { operation as o272 } from './sessions/diff-comments-create.js';
274
- import { operation as o273 } from './sessions/diff-comments-delete.js';
275
- import { operation as o274 } from './sessions/diff-comments-list.js';
276
- import { operation as o275 } from './sessions/diff-comments-update.js';
277
- import { operation as o276 } from './sessions/diff-commits-list.js';
278
- import { operation as o277 } from './sessions/diff-files-list.js';
279
- import { operation as o278 } from './sessions/diff-patch-get.js';
280
- import { operation as o279 } from './sessions/env-sync.js';
281
- import { operation as o280 } from './sessions/files-attach.js';
282
- import { operation as o281 } from './sessions/files-get.js';
283
- import { operation as o282 } from './sessions/files-list.js';
284
- import { operation as o283 } from './sessions/get.js';
285
- import { operation as o284 } from './sessions/git-state-get.js';
286
- import { operation as o285 } from './sessions/go-ahead-delete.js';
287
- import { operation as o286 } from './sessions/go-ahead-set.js';
288
- import { operation as o287 } from './sessions/jobs-cancel.js';
289
- import { operation as o288 } from './sessions/jobs-get.js';
290
- import { operation as o289 } from './sessions/jobs-list.js';
291
- import { operation as o290 } from './sessions/labels-set.js';
292
- import { operation as o291 } from './sessions/labels-update.js';
293
- import { operation as o292 } from './sessions/list.js';
294
- import { operation as o293 } from './sessions/list--all.js';
295
- import { operation as o294 } from './sessions/mark-read.js';
296
- import { operation as o295 } from './sessions/messages-get.js';
297
- import { operation as o296 } from './sessions/messages-list.js';
298
- import { operation as o297 } from './sessions/prompt-update.js';
299
- import { operation as o298 } from './sessions/qa-runs-finish.js';
300
- import { operation as o299 } from './sessions/qa-runs-fixes-create.js';
301
- import { operation as o300 } from './sessions/qa-runs-get.js';
302
- import { operation as o301 } from './sessions/qa-runs-results-create.js';
303
- import { operation as o302 } from './sessions/qa-runs-start.js';
304
- import { operation as o303 } from './sessions/qa-runs-stop.js';
305
- import { operation as o304 } from './sessions/qa-set.js';
306
- import { operation as o305 } from './sessions/review-set.js';
307
- import { operation as o306 } from './sessions/runtime-commands-run.js';
308
- import { operation as o307 } from './sessions/sandbox-files-get.js';
309
- import { operation as o308 } from './sessions/sandbox-files-list.js';
310
- import { operation as o309 } from './sessions/sandbox-files-set.js';
311
- import { operation as o310 } from './sessions/search.js';
312
- import { operation as o311 } from './sessions/send.js';
313
- import { operation as o312 } from './sessions/start.js';
314
- import { operation as o313 } from './sessions/steer.js';
315
- import { operation as o314 } from './sessions/update.js';
316
- import { operation as o315 } from './skills/create.js';
317
- import { operation as o316 } from './skills/create--personal.js';
318
- import { operation as o317 } from './skills/delete.js';
319
- import { operation as o318 } from './skills/delete--personal.js';
320
- import { operation as o319 } from './skills/get.js';
321
- import { operation as o320 } from './skills/get--personal.js';
322
- import { operation as o321 } from './skills/list.js';
323
- import { operation as o322 } from './skills/list--personal.js';
324
- import { operation as o323 } from './skills/update.js';
325
- import { operation as o324 } from './skills/update--personal.js';
326
- import { operation as o325 } from './tasks/create.js';
327
- import { operation as o326 } from './tasks/create--personal.js';
328
- import { operation as o327 } from './tasks/delete.js';
329
- import { operation as o328 } from './tasks/delete--personal.js';
330
- import { operation as o329 } from './tasks/get.js';
331
- import { operation as o330 } from './tasks/get--personal.js';
332
- import { operation as o331 } from './tasks/labels-list.js';
333
- import { operation as o332 } from './tasks/list.js';
334
- import { operation as o333 } from './tasks/list--all.js';
335
- import { operation as o334 } from './tasks/list--personal.js';
336
- import { operation as o335 } from './tasks/move.js';
337
- import { operation as o336 } from './tasks/move--personal.js';
338
- import { operation as o337 } from './tasks/project-set.js';
339
- import { operation as o338 } from './tasks/start.js';
340
- import { operation as o339 } from './tasks/start--personal.js';
341
- import { operation as o340 } from './tasks/thread-get.js';
342
- import { operation as o341 } from './tasks/thread-get--personal.js';
343
- import { operation as o342 } from './tasks/thread-move.js';
344
- import { operation as o343 } from './tasks/thread-move--personal.js';
345
- import { operation as o344 } from './tasks/update.js';
346
- import { operation as o345 } from './tasks/update--personal.js';
347
- import { operation as o346 } from './user/api-keys-delete.js';
348
- import { operation as o347 } from './user/personal-space-get.js';
349
- import { operation as o348 } from './user/plan-get.js';
350
- import { operation as o349 } from './user/profile-get.js';
351
- import { operation as o350 } from './user/push-devices-create.js';
352
- import { operation as o351 } from './user/push-devices-delete.js';
353
- import { operation as o352 } from './user/settings-get.js';
354
- import { operation as o353 } from './user/settings-update.js';
355
- import { operation as o354 } from './user/usage-get.js';
356
- import { operation as o355 } from './workspaces/credits-get.js';
357
- import { operation as o356 } from './workspaces/get.js';
358
- import { operation as o357 } from './workspaces/list.js';
359
- import { operation as o358 } from './workspaces/members-list.js';
360
- import { operation as o359 } from './workspaces/members-list--all.js';
361
- import { operation as o360 } from './workspaces/memory-get.js';
362
- import { operation as o361 } from './workspaces/memory-set.js';
363
- import { operation as o362 } from './workspaces/personal-runtime-get.js';
364
- import { operation as o363 } from './workspaces/sandbox-hours-get.js';
365
- import { operation as o364 } from './workspaces/sandbox-limit-get.js';
366
- import { operation as o365 } from './workspaces/sandboxes-stop.js';
367
- import { operation as o366 } from './workspaces/timezone-set.js';
368
- import { operation as o367 } from './workspaces/usage-breakdown-get.js';
369
- import { operation as o368 } from './workspaces/usage-get.js';
247
+ import { operation as o246 } from './sensei/search.js';
248
+ import { operation as o247 } from './sensei/sessions-assessments-create.js';
249
+ import { operation as o248 } from './sensei/sessions-facts-get.js';
250
+ import { operation as o249 } from './sensei/suggestions-create.js';
251
+ import { operation as o250 } from './sensei/threads-archive.js';
252
+ import { operation as o251 } from './sensei/threads-close.js';
253
+ import { operation as o252 } from './sensei/threads-create.js';
254
+ import { operation as o253 } from './sensei/threads-get.js';
255
+ import { operation as o254 } from './sensei/threads-list.js';
256
+ import { operation as o255 } from './sensei/threads-move.js';
257
+ import { operation as o256 } from './sensei/threads-notes-get.js';
258
+ import { operation as o257 } from './sensei/threads-notes-send.js';
259
+ import { operation as o258 } from './sensei/threads-search.js';
260
+ import { operation as o259 } from './sensei/threads-split.js';
261
+ import { operation as o260 } from './sensei/threads-unarchive.js';
262
+ import { operation as o261 } from './sensei/tickets-merge.js';
263
+ import { operation as o262 } from './sensei/watch-reads-finish.js';
264
+ import { operation as o263 } from './sensei/widgets-get.js';
265
+ import { operation as o264 } from './sensei/writing-get.js';
266
+ import { operation as o265 } from './sensei/writing-set.js';
267
+ import { operation as o266 } from './sensei/writing-samples-create.js';
268
+ import { operation as o267 } from './sessions/app-stack-start.js';
269
+ import { operation as o268 } from './sessions/create.js';
270
+ import { operation as o269 } from './sessions/delete.js';
271
+ import { operation as o270 } from './sessions/desktop-control-set.js';
272
+ import { operation as o271 } from './sessions/desktop-get.js';
273
+ import { operation as o272 } from './sessions/desktop-start.js';
274
+ import { operation as o273 } from './sessions/diff-comments-create.js';
275
+ import { operation as o274 } from './sessions/diff-comments-delete.js';
276
+ import { operation as o275 } from './sessions/diff-comments-list.js';
277
+ import { operation as o276 } from './sessions/diff-comments-update.js';
278
+ import { operation as o277 } from './sessions/diff-commits-list.js';
279
+ import { operation as o278 } from './sessions/diff-files-list.js';
280
+ import { operation as o279 } from './sessions/diff-patch-get.js';
281
+ import { operation as o280 } from './sessions/env-sync.js';
282
+ import { operation as o281 } from './sessions/files-attach.js';
283
+ import { operation as o282 } from './sessions/files-get.js';
284
+ import { operation as o283 } from './sessions/files-list.js';
285
+ import { operation as o284 } from './sessions/get.js';
286
+ import { operation as o285 } from './sessions/git-state-get.js';
287
+ import { operation as o286 } from './sessions/go-ahead-delete.js';
288
+ import { operation as o287 } from './sessions/go-ahead-set.js';
289
+ import { operation as o288 } from './sessions/jobs-cancel.js';
290
+ import { operation as o289 } from './sessions/jobs-get.js';
291
+ import { operation as o290 } from './sessions/jobs-list.js';
292
+ import { operation as o291 } from './sessions/labels-set.js';
293
+ import { operation as o292 } from './sessions/labels-update.js';
294
+ import { operation as o293 } from './sessions/list.js';
295
+ import { operation as o294 } from './sessions/list--all.js';
296
+ import { operation as o295 } from './sessions/mark-read.js';
297
+ import { operation as o296 } from './sessions/messages-get.js';
298
+ import { operation as o297 } from './sessions/messages-list.js';
299
+ import { operation as o298 } from './sessions/prompt-update.js';
300
+ import { operation as o299 } from './sessions/qa-runs-finish.js';
301
+ import { operation as o300 } from './sessions/qa-runs-fixes-create.js';
302
+ import { operation as o301 } from './sessions/qa-runs-get.js';
303
+ import { operation as o302 } from './sessions/qa-runs-results-create.js';
304
+ import { operation as o303 } from './sessions/qa-runs-start.js';
305
+ import { operation as o304 } from './sessions/qa-runs-stop.js';
306
+ import { operation as o305 } from './sessions/qa-set.js';
307
+ import { operation as o306 } from './sessions/review-set.js';
308
+ import { operation as o307 } from './sessions/runtime-commands-run.js';
309
+ import { operation as o308 } from './sessions/sandbox-files-get.js';
310
+ import { operation as o309 } from './sessions/sandbox-files-list.js';
311
+ import { operation as o310 } from './sessions/sandbox-files-set.js';
312
+ import { operation as o311 } from './sessions/search.js';
313
+ import { operation as o312 } from './sessions/send.js';
314
+ import { operation as o313 } from './sessions/start.js';
315
+ import { operation as o314 } from './sessions/steer.js';
316
+ import { operation as o315 } from './sessions/update.js';
317
+ import { operation as o316 } from './skills/create.js';
318
+ import { operation as o317 } from './skills/create--personal.js';
319
+ import { operation as o318 } from './skills/delete.js';
320
+ import { operation as o319 } from './skills/delete--personal.js';
321
+ import { operation as o320 } from './skills/get.js';
322
+ import { operation as o321 } from './skills/get--personal.js';
323
+ import { operation as o322 } from './skills/list.js';
324
+ import { operation as o323 } from './skills/list--personal.js';
325
+ import { operation as o324 } from './skills/update.js';
326
+ import { operation as o325 } from './skills/update--personal.js';
327
+ import { operation as o326 } from './tasks/create.js';
328
+ import { operation as o327 } from './tasks/create--personal.js';
329
+ import { operation as o328 } from './tasks/delete.js';
330
+ import { operation as o329 } from './tasks/delete--personal.js';
331
+ import { operation as o330 } from './tasks/get.js';
332
+ import { operation as o331 } from './tasks/get--personal.js';
333
+ import { operation as o332 } from './tasks/labels-list.js';
334
+ import { operation as o333 } from './tasks/list.js';
335
+ import { operation as o334 } from './tasks/list--all.js';
336
+ import { operation as o335 } from './tasks/list--personal.js';
337
+ import { operation as o336 } from './tasks/move.js';
338
+ import { operation as o337 } from './tasks/move--personal.js';
339
+ import { operation as o338 } from './tasks/project-set.js';
340
+ import { operation as o339 } from './tasks/start.js';
341
+ import { operation as o340 } from './tasks/start--personal.js';
342
+ import { operation as o341 } from './tasks/thread-get.js';
343
+ import { operation as o342 } from './tasks/thread-get--personal.js';
344
+ import { operation as o343 } from './tasks/thread-move.js';
345
+ import { operation as o344 } from './tasks/thread-move--personal.js';
346
+ import { operation as o345 } from './tasks/update.js';
347
+ import { operation as o346 } from './tasks/update--personal.js';
348
+ import { operation as o347 } from './user/api-keys-delete.js';
349
+ import { operation as o348 } from './user/personal-space-get.js';
350
+ import { operation as o349 } from './user/plan-get.js';
351
+ import { operation as o350 } from './user/profile-get.js';
352
+ import { operation as o351 } from './user/push-devices-create.js';
353
+ import { operation as o352 } from './user/push-devices-delete.js';
354
+ import { operation as o353 } from './user/settings-get.js';
355
+ import { operation as o354 } from './user/settings-update.js';
356
+ import { operation as o355 } from './user/usage-get.js';
357
+ import { operation as o356 } from './workspaces/credits-get.js';
358
+ import { operation as o357 } from './workspaces/get.js';
359
+ import { operation as o358 } from './workspaces/list.js';
360
+ import { operation as o359 } from './workspaces/members-list.js';
361
+ import { operation as o360 } from './workspaces/members-list--all.js';
362
+ import { operation as o361 } from './workspaces/memory-get.js';
363
+ import { operation as o362 } from './workspaces/memory-set.js';
364
+ import { operation as o363 } from './workspaces/personal-runtime-get.js';
365
+ import { operation as o364 } from './workspaces/sandbox-hours-get.js';
366
+ import { operation as o365 } from './workspaces/sandbox-limit-get.js';
367
+ import { operation as o366 } from './workspaces/sandboxes-stop.js';
368
+ import { operation as o367 } from './workspaces/timezone-set.js';
369
+ import { operation as o368 } from './workspaces/usage-breakdown-get.js';
370
+ import { operation as o369 } from './workspaces/usage-get.js';
370
371
  export const operations = [
371
372
  o0,
372
373
  o1,
@@ -737,4 +738,5 @@ export const operations = [
737
738
  o366,
738
739
  o367,
739
740
  o368,
741
+ o369,
740
742
  ];
@@ -0,0 +1,50 @@
1
+ export const operation = {
2
+ "method": "post",
3
+ "path": "/api/search",
4
+ "command": [
5
+ "sensei",
6
+ "search"
7
+ ],
8
+ "hidden": true,
9
+ "summary": "Search your threads, sessions, tasks, projects, Files, Crons and cards by title in one call, across what each kind's own list reaches: one ranked list, exact titles first, then titles holding every word, newest activity first, cut to `limit`. Each row: kind, id, title, workspaceId, projectId, status, url, sessionId, taskId, threadId, version, parentId, projectIds and activityAt, null when the kind has none. `failedKinds` names a kind that could not be read; `truncated` says more may match. An agent token searches its own workspace, without Sensei Threads, Personal tasks or Personal Crons; one acting as the workspace finds no member's own.",
10
+ "pathParams": [],
11
+ "query": [],
12
+ "body": {
13
+ "fields": [
14
+ {
15
+ "name": "q",
16
+ "flag": "q",
17
+ "kind": "string",
18
+ "required": true,
19
+ "description": "Words of a title or name, any case: every word must be in it. At most 10 distinct words; more is refused with 400."
20
+ },
21
+ {
22
+ "name": "kinds",
23
+ "flag": "kinds",
24
+ "kind": "json",
25
+ "required": false,
26
+ "description": "The kinds to search. Every kind when left out.",
27
+ "shape": "(\"threads\"|\"sessions\"|\"tasks\"|\"projects\"|\"files\"|\"crons\"|\"cards\")[]"
28
+ },
29
+ {
30
+ "name": "workspace",
31
+ "flag": "workspace",
32
+ "kind": "string",
33
+ "required": false,
34
+ "description": "Only this workspace, by id; what belongs to no workspace drops out. Refused when you do not reach it."
35
+ },
36
+ {
37
+ "name": "limit",
38
+ "flag": "limit",
39
+ "kind": "integer",
40
+ "required": false,
41
+ "description": "How many rows. 20 when left out."
42
+ }
43
+ ],
44
+ "required": true
45
+ },
46
+ "multipart": null,
47
+ "attachments": false,
48
+ "anonymous": false,
49
+ "agents": "all"
50
+ };
package/dist/program.js CHANGED
@@ -5,6 +5,7 @@ import { attachAuthCommands } from './commands/auth.js';
5
5
  import { attachCardSchemaCommand, attachHelpCommand } from './commands/help.js';
6
6
  import { attachIntegrationsCommands } from './commands/integrations.js';
7
7
  import { attachMergeTrainOrderCommand } from './commands/merge-train-order.js';
8
+ import { attachSearchCommand } from './commands/search.js';
8
9
  import { attachWatchCommand } from './commands/watch.js';
9
10
  import { HAND_WRITTEN } from './commands/hand-written.js';
10
11
  import { operations } from './generated/commands/index.js';
@@ -104,6 +105,8 @@ export function createProgram(options = {}) {
104
105
  // Agent-only: the open merge train run's session saves its order with its sandbox token.
105
106
  if (narrowedTo === null || narrowedTo === 'sandboxToken')
106
107
  attachMergeTrainOrderCommand(program, lazy);
108
+ // Beside the generated, hidden `sensei search`, the raw answer of the same route.
109
+ attachSearchCommand(program, lazy, options.search);
107
110
  // Beside the generated, hidden `integrations tools list|call`, which stay raw passthroughs.
108
111
  attachIntegrationsCommands(program, lazy, options.integrations);
109
112
  // The job stream admits a member's API key only; it closes 4401 on every narrower token.
package/openapi.json CHANGED
@@ -23401,6 +23401,97 @@
23401
23401
  }
23402
23402
  }
23403
23403
  },
23404
+ "/api/search": {
23405
+ "post": {
23406
+ "operationId": "senseiSearch",
23407
+ "summary": "Search your threads, sessions, tasks, projects, Files, Crons and cards by title in one call, across what each kind's own list reaches: one ranked list, exact titles first, then titles holding every word, newest activity first, cut to `limit`. Each row: kind, id, title, workspaceId, projectId, status, url, sessionId, taskId, threadId, version, parentId, projectIds and activityAt, null when the kind has none. `failedKinds` names a kind that could not be read; `truncated` says more may match. An agent token searches its own workspace, without Sensei Threads, Personal tasks or Personal Crons; one acting as the workspace finds no member's own.",
23408
+ "tags": ["sensei"],
23409
+ "x-kosuke-command": ["sensei", "search"],
23410
+ "x-kosuke-hidden": true,
23411
+ "x-kosuke-sandbox-token": true,
23412
+ "x-kosuke-cron-token": true,
23413
+ "x-kosuke-sensei-token": true,
23414
+ "requestBody": {
23415
+ "required": true,
23416
+ "content": {
23417
+ "application/json": {
23418
+ "schema": {
23419
+ "type": "object",
23420
+ "properties": {
23421
+ "q": {
23422
+ "type": "string",
23423
+ "minLength": 1,
23424
+ "maxLength": 200,
23425
+ "description": "Words of a title or name, any case: every word must be in it. At most 10 distinct words; more is refused with 400."
23426
+ },
23427
+ "kinds": {
23428
+ "description": "The kinds to search. Every kind when left out.",
23429
+ "minItems": 1,
23430
+ "type": "array",
23431
+ "items": {
23432
+ "type": "string",
23433
+ "enum": [
23434
+ "threads",
23435
+ "sessions",
23436
+ "tasks",
23437
+ "projects",
23438
+ "files",
23439
+ "crons",
23440
+ "cards"
23441
+ ]
23442
+ }
23443
+ },
23444
+ "workspace": {
23445
+ "description": "Only this workspace, by id; what belongs to no workspace drops out. Refused when you do not reach it.",
23446
+ "type": "string",
23447
+ "minLength": 1
23448
+ },
23449
+ "limit": {
23450
+ "description": "How many rows. 20 when left out.",
23451
+ "type": "integer",
23452
+ "minimum": 1,
23453
+ "maximum": 100
23454
+ }
23455
+ },
23456
+ "required": ["q"]
23457
+ }
23458
+ }
23459
+ }
23460
+ },
23461
+ "responses": {
23462
+ "2XX": {
23463
+ "description": "Success envelope",
23464
+ "content": {
23465
+ "application/json": {
23466
+ "schema": {
23467
+ "$ref": "#/components/schemas/ApiSuccess"
23468
+ }
23469
+ }
23470
+ }
23471
+ },
23472
+ "4XX": {
23473
+ "description": "Error envelope",
23474
+ "content": {
23475
+ "application/json": {
23476
+ "schema": {
23477
+ "$ref": "#/components/schemas/ApiError"
23478
+ }
23479
+ }
23480
+ }
23481
+ },
23482
+ "5XX": {
23483
+ "description": "Error envelope",
23484
+ "content": {
23485
+ "application/json": {
23486
+ "schema": {
23487
+ "$ref": "#/components/schemas/ApiError"
23488
+ }
23489
+ }
23490
+ }
23491
+ }
23492
+ }
23493
+ }
23494
+ },
23404
23495
  "/api/sensei": {
23405
23496
  "get": {
23406
23497
  "operationId": "senseiChatGet",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosuke-ai/kosuke",
3
- "version": "1.0.170",
3
+ "version": "1.0.171",
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": "2657cabaee8a890d0d1b24da40b2bab78ad02ec8",
47
- "sourceIdentity": "98458b5defefe096d78ce5538ae34710d76e091eedbf77836c90d8836c16dd51",
46
+ "sourceCommit": "f7a8efc9a9bf4447d372767a222b6b1728871c04",
47
+ "sourceIdentity": "06fad5ab05f9e1adbed49a32764b5ebff244e7a209a6824e8d73bdc0b980d1d7",
48
48
  "fragments": [
49
- "gpt-6-2-astra-sol-vd39dn.json"
49
+ "kosuke-search-tn48oh.json"
50
50
  ]
51
51
  }
52
52
  }