@kosuke-ai/kosuke 1.0.49 → 1.0.50

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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.50
4
+
5
+ - No change you will notice: internal code comments in the CLI were updated.
6
+ - Describe Device Requests as lasting the Turn that asked: a later Turn files a new request.
7
+
3
8
  ## 1.0.49
4
9
 
5
10
  - A message now takes up to 20 files instead of 10. The iOS photo picker lets you choose up to 20 photos at once, and the CLI's `--attach` accepts up to 20 files per request. Photos chosen in the iOS photo picker are no longer lost when the app wrongly decided the picker had not opened.
@@ -297,6 +297,7 @@ function coverageLine(sessions) {
297
297
  : [];
298
298
  return `Workspaces covered: ${names.length ? names.join(', ') : 'none'}.`;
299
299
  }
300
+ /** @internal */
300
301
  export function planSummary(options) {
301
302
  const { sessions, apiUrl, now, workspace, peek = false } = options;
302
303
  const scope = workspace ? ` --workspace ${workspace}` : '';
@@ -338,7 +339,10 @@ export function planSummary(options) {
338
339
  scope,
339
340
  };
340
341
  }
341
- /** The whole digest, once `activity` answered the plan's `activityQuery`. */
342
+ /**
343
+ * The whole digest, once `activity` answered the plan's `activityQuery`.
344
+ * @internal
345
+ */
342
346
  export function renderSummary(plan, activity) {
343
347
  const lines = [...plan.head];
344
348
  // Every event the read returned is printed: without a peek, each is already marked seen.
@@ -90,4 +90,5 @@ export const HAND_WRITTEN = {
90
90
  workspace: true,
91
91
  },
92
92
  };
93
+ /** @internal */
93
94
  export const HAND_WRITTEN_COMMANDS = Object.values(HAND_WRITTEN);
@@ -6,7 +6,7 @@ export const operation = {
6
6
  "requests",
7
7
  "create"
8
8
  ],
9
- "summary": "From a Chat Session: ask to use a personal Mac from devices list, with the reason its owner reads on a card in this session's chat. A workspace device needs no request: it answers approved at once with grantId null, and no one is asked. The owner approves a personal Mac once per session: after that, asking again answers approved at once. Answers status pending or approved. Check devices list again for the answer; it expires after 30 minutes without an answer. While it is pending, go on with other work; when it is declined or expires, go on without it and say so. Once approved it stays approved for the rest of the session: pass --device-id on every mac command. One session at a time uses the device: on MAC_BUSY, wait with devices locks create, and run devices locks delete once done.",
9
+ "summary": "From a Chat Session: ask to use a personal Mac from devices list, with the reason its owner reads on a card in this session's chat. A workspace device needs no request: it answers approved at once with grantId null, and no one is asked. The owner approves a personal Mac for the Turn that asked: asking again in that Turn answers approved at once, and a later Turn asks again, with a new card for the owner. Answers status pending or approved. Check devices list again for the answer; it expires after 30 minutes without an answer, or when this Turn ends. While it is pending, go on with other work; when it is declined or expires, go on without it and say so. Once approved it lasts until this Turn ends: pass --device-id on every mac command; after that, mac commands on it are refused. One session at a time uses the device: on MAC_BUSY, wait with devices locks create, and run devices locks delete once done.",
10
10
  "pathParams": [
11
11
  "deviceId"
12
12
  ],
@@ -6,7 +6,7 @@ export const operation = {
6
6
  "device-requests",
7
7
  "list"
8
8
  ],
9
- "summary": "List the Device Requests of a Chat Session, oldest first, as you would see them on its cards: id, device, kind, owner, reason, status (pending, approved, declined, expired, withdrawn or closed), who asked and who answered, when, canApprove, whether you may answer it, and occupiedBy, session or sensei when someone else uses the device while it is pending. A request past its 30 minutes reads expired.",
9
+ "summary": "List the Device Requests of a Chat Session, oldest first, as you would see them on its cards: id, device, kind, owner, reason, status (pending, approved, declined, expired, withdrawn or closed), who asked and who answered, when, canApprove, whether you may answer it, and occupiedBy, session or sensei when someone else uses the device while it is pending. A request past its 30 minutes reads expired, and so does a request or approval once the Turn that asked for it ended.",
10
10
  "pathParams": [],
11
11
  "query": [
12
12
  {
@@ -30,7 +30,7 @@ export const operation = {
30
30
  "flag": "decision",
31
31
  "kind": "string",
32
32
  "required": true,
33
- "description": "approve lets the session use the device until it ends; decline refuses it.",
33
+ "description": "approve lets the session use the device until the Turn that asked ends; decline refuses it.",
34
34
  "choices": [
35
35
  "approve",
36
36
  "decline"
package/dist/program.js CHANGED
@@ -14,6 +14,7 @@ import { version } from './runtime/version.js';
14
14
  * The command tree: the commands `commands/hand-written.ts` lists by hand, everything else
15
15
  * from the generated descriptors, one leaf per command over its forms. Global flags are read
16
16
  * before any subcommand runs, so the runtime the subcommands share is built once, from them.
17
+ * @internal
17
18
  */
18
19
  export function createProgram(options = {}) {
19
20
  const program = new Command('kosuke')
@@ -5,6 +5,7 @@
5
5
  * decides which commands the tree shows.
6
6
  *
7
7
  * Imports nothing, so the generator can load it on plain node.
8
+ * @internal
8
9
  */
9
10
  export const AGENT_TOKENS = [
10
11
  // Wire contract with `src/lib/auth/sandbox-agent-token.ts`: a chat sandbox's own Turn.
@@ -21,7 +22,10 @@ export function agentTokenOf(key) {
21
22
  const found = AGENT_TOKENS.find(({ prefixes }) => prefixes.some((prefix) => key.startsWith(prefix)));
22
23
  return found?.token ?? null;
23
24
  }
24
- /** The descriptor value for the agent tokens the document grants an operation. */
25
+ /**
26
+ * The descriptor value for the agent tokens the document grants an operation.
27
+ * @internal
28
+ */
25
29
  export function agentReach(granted) {
26
30
  const tokens = AGENT_TOKENS.map(({ token }) => token).filter((token) => granted.includes(token));
27
31
  if (tokens.length === 0)
@@ -360,11 +360,17 @@ function jsonParser(raw) {
360
360
  function collect(value, previous) {
361
361
  return [...(previous ?? []), value];
362
362
  }
363
- /** commander stores `--exclude-archived` as `excludeArchived`. */
363
+ /**
364
+ * commander stores `--exclude-archived` as `excludeArchived`.
365
+ * @internal
366
+ */
364
367
  export function optionKey(flag) {
365
368
  return flag.replace(/-([a-z0-9])/g, (_, letter) => letter.toUpperCase());
366
369
  }
367
- /** `projectId` reads as `Project id`; `env-vars` as `Env vars`. */
370
+ /**
371
+ * `projectId` reads as `Project id`; `env-vars` as `Env vars`.
372
+ * @internal
373
+ */
368
374
  export function humanize(name) {
369
375
  const words = name
370
376
  .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
package/openapi.json CHANGED
@@ -961,7 +961,7 @@
961
961
  "/api/devices/{deviceId}/requests": {
962
962
  "post": {
963
963
  "operationId": "devicesRequestsCreate",
964
- "summary": "From a Chat Session: ask to use a personal Mac from devices list, with the reason its owner reads on a card in this session's chat. A workspace device needs no request: it answers approved at once with grantId null, and no one is asked. The owner approves a personal Mac once per session: after that, asking again answers approved at once. Answers status pending or approved. Check devices list again for the answer; it expires after 30 minutes without an answer. While it is pending, go on with other work; when it is declined or expires, go on without it and say so. Once approved it stays approved for the rest of the session: pass --device-id on every mac command. One session at a time uses the device: on MAC_BUSY, wait with devices locks create, and run devices locks delete once done.",
964
+ "summary": "From a Chat Session: ask to use a personal Mac from devices list, with the reason its owner reads on a card in this session's chat. A workspace device needs no request: it answers approved at once with grantId null, and no one is asked. The owner approves a personal Mac for the Turn that asked: asking again in that Turn answers approved at once, and a later Turn asks again, with a new card for the owner. Answers status pending or approved. Check devices list again for the answer; it expires after 30 minutes without an answer, or when this Turn ends. While it is pending, go on with other work; when it is declined or expires, go on without it and say so. Once approved it lasts until this Turn ends: pass --device-id on every mac command; after that, mac commands on it are refused. One session at a time uses the device: on MAC_BUSY, wait with devices locks create, and run devices locks delete once done.",
965
965
  "tags": ["devices"],
966
966
  "x-kosuke-command": ["devices", "requests", "create"],
967
967
  "x-kosuke-sandbox-token": true,
@@ -23314,7 +23314,7 @@
23314
23314
  "/api/sensei/device-requests": {
23315
23315
  "get": {
23316
23316
  "operationId": "senseiDeviceRequestsList",
23317
- "summary": "List the Device Requests of a Chat Session, oldest first, as you would see them on its cards: id, device, kind, owner, reason, status (pending, approved, declined, expired, withdrawn or closed), who asked and who answered, when, canApprove, whether you may answer it, and occupiedBy, session or sensei when someone else uses the device while it is pending. A request past its 30 minutes reads expired.",
23317
+ "summary": "List the Device Requests of a Chat Session, oldest first, as you would see them on its cards: id, device, kind, owner, reason, status (pending, approved, declined, expired, withdrawn or closed), who asked and who answered, when, canApprove, whether you may answer it, and occupiedBy, session or sensei when someone else uses the device while it is pending. A request past its 30 minutes reads expired, and so does a request or approval once the Turn that asked for it ended.",
23318
23318
  "tags": ["sensei"],
23319
23319
  "x-kosuke-command": ["sensei", "device-requests", "list"],
23320
23320
  "x-kosuke-sandbox-token": true,
@@ -23397,7 +23397,7 @@
23397
23397
  "decision": {
23398
23398
  "type": "string",
23399
23399
  "enum": ["approve", "decline"],
23400
- "description": "approve lets the session use the device until it ends; decline refuses it."
23400
+ "description": "approve lets the session use the device until the Turn that asked ends; decline refuses it."
23401
23401
  }
23402
23402
  },
23403
23403
  "required": ["sessionId", "requestId", "decision"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosuke-ai/kosuke",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "Kosuke platform CLI. The client customers install to drive app.kosuke.ai from their own machine.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,10 +40,11 @@
40
40
  "vitest": "^4.1.12"
41
41
  },
42
42
  "kosukeRelease": {
43
- "sourceCommit": "2fece35c238337316974c0ce32615f1fbe682fd9",
44
- "sourceIdentity": "c8c7c09262763d928f5e07b05b602a9a543c07b30c74e04325e18080ab6e3716",
43
+ "sourceCommit": "783c56f80b3c75df5f129ad9ef32d5f2cf0e7a92",
44
+ "sourceIdentity": "97a8761f0d47f9900bc37d7da2fb71dd14fc32222a97ec5d248c32986cd63bcd",
45
45
  "fragments": [
46
- "twenty-files-per-message-r7k2qd.json"
46
+ "cli-internal-marks-3q4y00.json",
47
+ "device-approval-per-turn-23f44b.json"
47
48
  ]
48
49
  }
49
50
  }