@kosuke-ai/kosuke 1.0.5 → 1.0.7

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/generated/commands/devices/list.js +1 -1
  3. package/dist/generated/commands/devices/request.js +1 -1
  4. package/dist/generated/commands/index.js +184 -188
  5. package/dist/generated/commands/integrations/tools.js +1 -1
  6. package/dist/generated/commands/personal-tasks/create.js +1 -1
  7. package/dist/generated/commands/personal-tasks/move.js +1 -1
  8. package/dist/generated/commands/personal-tasks/start.js +2 -1
  9. package/dist/generated/commands/projects/create.js +1 -1
  10. package/dist/generated/commands/projects/skills.js +1 -1
  11. package/dist/generated/commands/projects/switch-workflow.js +1 -1
  12. package/dist/generated/commands/sensei/memory-get.js +1 -1
  13. package/dist/generated/commands/sensei/memory-put.js +0 -2
  14. package/dist/generated/commands/sensei/messages-send.js +1 -1
  15. package/dist/generated/commands/sensei/suggest.js +1 -1
  16. package/dist/generated/commands/sensei/thread-move.js +1 -1
  17. package/dist/generated/commands/sensei/thread-split.js +1 -1
  18. package/dist/generated/commands/sessions/artifacts-get.js +1 -1
  19. package/dist/generated/commands/sessions/create.js +1 -1
  20. package/dist/generated/commands/sessions/edit-prompt.js +1 -1
  21. package/dist/generated/commands/sessions/send.js +1 -1
  22. package/dist/generated/commands/sessions/steer.js +1 -1
  23. package/dist/generated/commands/sessions/update.js +1 -1
  24. package/dist/generated/commands/tasks/all.js +3 -2
  25. package/dist/generated/commands/tasks/create.js +5 -3
  26. package/dist/generated/commands/tasks/list.js +3 -2
  27. package/dist/generated/commands/tasks/start.js +3 -2
  28. package/dist/generated/commands/tasks/update.js +4 -2
  29. package/dist/generated/commands/user/crons-create.js +1 -1
  30. package/dist/runtime/agent-tokens.js +2 -8
  31. package/dist/runtime/attach.js +8 -41
  32. package/openapi.json +38 -149
  33. package/package.json +6 -4
  34. package/dist/generated/commands/sensei/reels-proposals.js +0 -25
  35. package/dist/generated/commands/sensei/reels-skips.js +0 -33
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "sessions",
6
6
  "create"
7
7
  ],
8
- "summary": "Start a chat session, or file a backlog one with status=backlog. Title or content is required; a backlog session needs content. Attachments ride along as multipart. From a sandbox or a Cron Run, only status=backlog, and reason is required: one line on why the ticket exists. From a Cron Run, Kosuke files it and is its Assignee, and a model the workspace cannot run falls back to the Cron's: model says which one it will run on.",
8
+ "summary": "Start a chat session, or file a backlog one with status=backlog. Title or content is required; a backlog session needs content. Attachments ride along as multipart. From a sandbox or a Cron Run, only status=backlog, and reason is required: one line on why the ticket exists. From a Cron Run, Kosuke files it and is its Assignee, and a model the workspace cannot run falls back to the Cron's: model says which one it will run on. A backlog session answers shareUrl, the link to give for it.",
9
9
  "pathParams": [
10
10
  "projectId"
11
11
  ],
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "sessions",
6
6
  "edit-prompt"
7
7
  ],
8
- "summary": "Rewrite the saved prompt of a backlog session, keeping or replacing its attachments. Multipart only. With ifRevision, the promptRevision `sessions get` gave, it is refused with 409 TICKET_EDITED when the prompt changed since; Sensei and a Cron Run must pass it.",
8
+ "summary": "Rewrite the saved prompt of a backlog session, keeping or replacing its attachments. Multipart only. With ifRevision, the promptRevision `sessions get` gave, it is refused with 409 TICKET_EDITED when the prompt changed since; Sensei and a Cron Run must pass it. Send the whole new description, and only for a new goal; an agent rewrites only a ticket it filed unless the member asked.",
9
9
  "pathParams": [
10
10
  "projectId",
11
11
  "sessionId"
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "sessions",
6
6
  "send"
7
7
  ],
8
- "summary": "Send a message: starts a turn, or waits Up next while one is running. To steer the running turn with it, steer the Queued Message it becomes. Attachments ride along as multipart.",
8
+ "summary": "Send a message: starts a turn, or waits Up next while one is running. To steer the running turn with it, steer the Queued Message it becomes. Attachments ride along as multipart. Use it over steer only for attachments, a message that runs a skill, or text over 10,000 characters.",
9
9
  "pathParams": [
10
10
  "projectId",
11
11
  "sessionId"
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "sessions",
6
6
  "steer"
7
7
  ],
8
- "summary": "Send a message and steer it into your running turn. Answers delivery steer, queued (the turn could not take it), job (no turn was running) or refused (the turn was stopped).",
8
+ "summary": "Send a message and steer it into your running turn. Answers delivery steer, queued (the turn could not take it), job (no turn was running) or refused (the turn was stopped). Use it for plain text up to 10,000 characters; on queued or refused, say where the message is.",
9
9
  "pathParams": [
10
10
  "projectId",
11
11
  "sessionId"
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "sessions",
6
6
  "update"
7
7
  ],
8
- "summary": "Change title, status, model, Auto, Assignee, priority, Sandbox size (sandboxSize) or App stack (appStack). Which changes are legal depends on the current status; the handler decides. sandboxSize and appStack change only while the session is in the Backlog: once it started they are fixed, and 409 SANDBOX_SETTINGS_LOCKED refuses them.",
8
+ "summary": "Change title, status, model, Auto, Assignee, priority, Sandbox size (sandboxSize) or App stack (appStack). Which changes are legal depends on the current status; the handler decides. sandboxSize and appStack change only while the session is in the Backlog: once it started they are fixed, and 409 SANDBOX_SETTINGS_LOCKED refuses them. A sandbox or a Cron Run may change only the title and priority of a Backlog session it filed.",
9
9
  "pathParams": [
10
10
  "projectId",
11
11
  "sessionId"
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "tasks",
6
6
  "all"
7
7
  ],
8
- "summary": "List tasks across your workspaces. Agent credentials stay in their workspace. includeOpenCount counts Todo and In progress with the same filters, independent of status and cursor.",
8
+ "summary": "List tasks across your workspaces. Agent credentials stay in their workspace. includeOpenCount counts Todo and In progress with the same filters, independent of status and cursor. Before you file or propose a ticket, read the open ones (--status todo,in_progress --include-prompt, following meta.pagination.nextCursor with --cursor) and judge overlap by meaning, not title words: work another task or session already covers gets no new ticket.",
9
9
  "pathParams": [],
10
10
  "query": [
11
11
  {
@@ -85,7 +85,8 @@ export const operation = {
85
85
  "name": "includePrompt",
86
86
  "flag": "include-prompt",
87
87
  "kind": "boolean",
88
- "required": false
88
+ "required": false,
89
+ "description": "Adds each task's prompt: a Todo task's description, or its first message after Start, cut at 4,000 characters (promptTruncated). Read `tasks get` for a cut or empty one."
89
90
  },
90
91
  {
91
92
  "name": "includeOpenCount",
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "tasks",
6
6
  "create"
7
7
  ],
8
- "summary": "File a task. A hint files into that project; YOLO returns a Backlog item.",
8
+ "summary": "File a task. A hint files into that project; YOLO returns a Backlog item. From Sensei, ownerId is the member, or the teammate they name; leave sandboxSize to the member, who changes it in the task's Properties. Answers shareUrl: link the task's title to it.",
9
9
  "pathParams": [
10
10
  "workspaceId"
11
11
  ],
@@ -106,7 +106,8 @@ export const operation = {
106
106
  "name": "description",
107
107
  "flag": "description",
108
108
  "kind": "string",
109
- "required": true
109
+ "required": true,
110
+ "description": "Markdown someone with none of your context can act on: the goal, why it matters, the limits, what done contains, and what the repository does not hold (a log line, an error, a URL). Resolve every \"it\" and @mention; keep the member's decisions and scope; leave out empty sections."
110
111
  },
111
112
  {
112
113
  "name": "hintProjectId",
@@ -235,7 +236,8 @@ export const operation = {
235
236
  "name": "description",
236
237
  "flag": "description",
237
238
  "kind": "string",
238
- "required": true
239
+ "required": true,
240
+ "description": "Markdown someone with none of your context can act on: the goal, why it matters, the limits, what done contains, and what the repository does not hold (a log line, an error, a URL). Resolve every \"it\" and @mention; keep the member's decisions and scope; leave out empty sections."
239
241
  },
240
242
  {
241
243
  "name": "hintProjectId",
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "tasks",
6
6
  "list"
7
7
  ],
8
- "summary": "List tasks in one workspace.",
8
+ "summary": "List tasks in one workspace. Before you file or propose a ticket, read the open ones (--status todo,in_progress --include-prompt, following meta.pagination.nextCursor with --cursor) and judge overlap by meaning, not title words: work another task or session already covers gets no new ticket.",
9
9
  "pathParams": [
10
10
  "workspaceId"
11
11
  ],
@@ -87,7 +87,8 @@ export const operation = {
87
87
  "name": "includePrompt",
88
88
  "flag": "include-prompt",
89
89
  "kind": "boolean",
90
- "required": false
90
+ "required": false,
91
+ "description": "Adds each task's prompt: a Todo task's description, or its first message after Start, cut at 4,000 characters (promptTruncated). Read `tasks get` for a cut or empty one."
91
92
  },
92
93
  {
93
94
  "name": "includeOpenCount",
@@ -5,7 +5,7 @@ export const operation = {
5
5
  "tasks",
6
6
  "start"
7
7
  ],
8
- "summary": "Start a Todo task. Members and Sensei only. sandboxSize and appStack set the task's Sandbox size and App stack as it starts; absent keeps what the task holds.",
8
+ "summary": "Start a Todo task. Members and Sensei only. sandboxSize and appStack set the task's Sandbox size and App stack as it starts; absent keeps what the task holds. The member's ask to start is the yes: start without reading back credits or sandboxes. A refusal leaves it in the Backlog: say what Kosuke answered and do not retry.",
9
9
  "pathParams": [
10
10
  "workspaceId",
11
11
  "taskId"
@@ -32,7 +32,8 @@ export const operation = {
32
32
  "name": "prompt",
33
33
  "flag": "prompt",
34
34
  "kind": "string",
35
- "required": false
35
+ "required": false,
36
+ "description": "Other text for the first message. The description stays as it is."
36
37
  },
37
38
  {
38
39
  "name": "sandboxSize",
@@ -124,13 +124,15 @@ export const operation = {
124
124
  "name": "description",
125
125
  "flag": "description",
126
126
  "kind": "string",
127
- "required": false
127
+ "required": false,
128
+ "description": "The whole new description, only when the goal changed: never because the task starts."
128
129
  },
129
130
  {
130
131
  "name": "ifRevision",
131
132
  "flag": "if-revision",
132
133
  "kind": "string",
133
- "required": false
134
+ "required": false,
135
+ "description": "The descriptionRevision `tasks get` printed. Sensei and a Cron Run must pass it with description; a changed task answers 409 TASK_CONFLICT, so read it again and reconcile."
134
136
  },
135
137
  {
136
138
  "name": "hintProjectId",
@@ -6,7 +6,7 @@ export const operation = {
6
6
  "crons",
7
7
  "create"
8
8
  ],
9
- "summary": "Create a Personal Cron, enabled, with you as its owner. A Personal Cron belongs to you and no workspace: with Personal Repositories or Apps it runs in its own sandbox; without, in its Sensei Thread. Repository runs use your own Subscriptions; thread runs use your Subscriptions or Kosuke free when you hold none. Kosuke free cannot run a Cron with repositories yet. The crontab is read in the cron's own timezone, and may not fire more often than every 15 minutes. The model is an encoded id such as anthropic:opus__xhigh; repositories require an explicit Model from any released Provider on one of your Subscriptions. Changing to Free while you hold a Subscription, or to a personal Model without one, is refused. Without repositories, null or left out runs on the thread’s model. From your Sensei it is refused with 409 CRON_ALREADY_EXISTS when you have a Personal Cron by that name.",
9
+ "summary": "Create a Personal Cron, enabled, with you as its owner. A Personal Cron belongs to you and no workspace: with Personal Repositories or Apps it runs in its own sandbox; without, in its Sensei Thread. Repository runs use your own Subscriptions; thread runs use your Subscriptions or Kosuke free when you hold none. Kosuke free cannot run a Cron with repositories yet. The crontab is read in the cron's own timezone, and may not fire more often than every 15 minutes. The model is an encoded id such as anthropic:opus__xhigh; repositories require an explicit Model from any released Provider on one of your Subscriptions. Changing to Free while you hold a Subscription, or to a personal Model without one, is refused. Without repositories, null or left out runs on the thread’s model. From your Sensei it is refused with 409 CRON_ALREADY_EXISTS when you have a Personal Cron by that name: update that one instead. From Sensei, create or change one only when the member asks. To move a workspace Cron here, read it and recreate it with its timezone (its model only when the member's own Subscription runs it); the member deletes the workspace one in the app.",
10
10
  "pathParams": [],
11
11
  "query": [],
12
12
  "body": {
@@ -11,14 +11,8 @@ export const AGENT_TOKENS = [
11
11
  { token: 'sandboxToken', prefixes: ['kosuke_sbx_'], extension: 'x-kosuke-sandbox-token' },
12
12
  // Wire contract with `src/lib/auth/cron-token.ts`: one Cron Run.
13
13
  { token: 'cronToken', prefixes: ['kosuke_crn_'], extension: 'x-kosuke-cron-token' },
14
- // Wire contract with `src/lib/auth/sensei-token.ts`: a Sensei Chat's Turn. A token minted
15
- // before the Sensei rename carries `kosuke_lead_` until it expires; drop that prefix one
16
- // release after the rename.
17
- {
18
- token: 'senseiToken',
19
- prefixes: ['kosuke_sensei_', 'kosuke_lead_'],
20
- extension: 'x-kosuke-sensei-token',
21
- },
14
+ // Wire contract with `src/lib/auth/sensei-token.ts`: a Sensei Chat's Turn.
15
+ { token: 'senseiToken', prefixes: ['kosuke_sensei_'], extension: 'x-kosuke-sensei-token' },
22
16
  ];
23
17
  /** The agent token a key is, by its prefix; null for a member's own key or none. */
24
18
  export function agentTokenOf(key) {
@@ -7,36 +7,12 @@ import { buildRequest, execute, readWholeBody, UsageError } from './invoke.js';
7
7
  * the contract's summary, verbatim.
8
8
  */
9
9
  export function attachOperation(root, operation, runtime) {
10
- const leaf = attachLeaf(root, operation.command, operation, runtime, { hidden: false });
11
- const name = operation.command.join(' ');
12
- for (const [alias, target] of COMMAND_ALIASES) {
13
- if (target === name) {
14
- attachLeaf(root, alias.split(' '), operation, runtime, {
15
- hidden: true,
16
- workspaceArgument: true,
17
- });
18
- }
19
- }
20
- return leaf;
10
+ return attachLeaf(root, operation.command, operation, runtime);
21
11
  }
22
- // Alias: Sensei's commands from when it was a workspace's, `kosuke workspaces sensei-* <id>`,
23
- // and the Lead's names for them, which an older sandbox's Sensei prompt still runs; remove the
24
- // Lead's one release after the Sensei rename, Sensei's one release after Sensei moved to the
25
- // person. The workspace they take goes to `--workspace` where the command reads one.
26
- const COMMAND_ALIASES = new Map([
27
- ['cards', 'sensei cards'],
28
- ['merge', 'sensei merge'],
29
- ['notifications open', 'sensei notifications open'],
30
- ].flatMap(([old, target]) => [
31
- [`workspaces sensei-${old}`, target],
32
- [`workspaces lead-${old}`, target],
33
- ]));
34
- function attachLeaf(root, path, operation, runtime, { hidden, workspaceArgument = false }) {
35
- const parent = groupFor(root, path.slice(0, -1), { hidden });
36
- const leaf = parent.command(path[path.length - 1], { hidden });
12
+ function attachLeaf(root, path, operation, runtime) {
13
+ const parent = groupFor(root, path.slice(0, -1));
14
+ const leaf = parent.command(path[path.length - 1]);
37
15
  leaf.description(operation.summary);
38
- if (workspaceArgument)
39
- leaf.addArgument(new Argument('<workspaceId>', 'Workspace id'));
40
16
  for (const name of operation.pathParams) {
41
17
  leaf.addArgument(new Argument(`<${name}>`, humanize(name)));
42
18
  }
@@ -63,17 +39,10 @@ function attachLeaf(root, path, operation, runtime, { hidden, workspaceArgument
63
39
  }
64
40
  leaf.action(async (...args) => {
65
41
  const options = args[args.length - 2];
66
- const offset = workspaceArgument ? 1 : 0;
67
- const positionals = args.slice(offset, offset + operation.pathParams.length);
68
- const workspace = workspaceArgument ? args[0] : undefined;
42
+ const positionals = args.slice(0, operation.pathParams.length);
69
43
  const input = {
70
44
  pathParams: Object.fromEntries(operation.pathParams.map((name, i) => [name, positionals[i]])),
71
- fields: Object.fromEntries(fields.map((field) => {
72
- const given = options[optionKey(field.flag)];
73
- // The old command's workspace filters a read that takes one; a write names its own.
74
- const value = given ?? (field.name === 'workspace' ? workspace : undefined);
75
- return [field.name, value];
76
- })),
45
+ fields: Object.fromEntries(fields.map((field) => [field.name, options[optionKey(field.flag)]])),
77
46
  wholeBody: readWholeBody({
78
47
  body: options.body,
79
48
  bodyFile: options.bodyFile,
@@ -98,13 +67,11 @@ function attachLeaf(root, path, operation, runtime, { hidden, workspaceArgument
98
67
  });
99
68
  return leaf;
100
69
  }
101
- /** A group created here is hidden when asked; one that already exists keeps what it is. */
102
- export function groupFor(root, path, { hidden = false } = {}) {
70
+ export function groupFor(root, path) {
103
71
  let current = root;
104
72
  for (const segment of path) {
105
73
  const existing = current.commands.find((command) => command.name() === segment);
106
- current =
107
- existing ?? current.command(segment, { hidden }).description(`${humanize(segment)} commands`);
74
+ current = existing ?? current.command(segment).description(`${humanize(segment)} commands`);
108
75
  }
109
76
  return current;
110
77
  }