@kosuke-ai/kosuke 1.0.99 → 1.0.101

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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.101
4
+
5
+ - Report Personal Free actual sandbox hours and shared capacity, and direct new workspace and capacity purchases to a demo. Existing billing maintenance remains available.
6
+ - Add `kosuke workspaces sandbox-hours get` to read an organization's sandbox hours, funding status and stop state. Staff hour grants remain browser-only.
7
+
8
+ ## 1.0.100
9
+
10
+ - When an integration tool call is rate limited, `kosuke integrations tools call` now says how many seconds to wait before trying again.
11
+
3
12
  ## 1.0.99
4
13
 
5
14
  - `integrations request` and `integrations list --toolkit` take a toolkit slug in any case, such as `SLACK`.
@@ -340,11 +340,13 @@ import { operation as o338 } from './workspaces/get.js';
340
340
  import { operation as o339 } from './workspaces/list.js';
341
341
  import { operation as o340 } from './workspaces/members-list.js';
342
342
  import { operation as o341 } from './workspaces/members-list--all.js';
343
- import { operation as o342 } from './workspaces/sandbox-limit-get.js';
344
- import { operation as o343 } from './workspaces/sandboxes-stop.js';
345
- import { operation as o344 } from './workspaces/timezone-set.js';
346
- import { operation as o345 } from './workspaces/usage-breakdown-get.js';
347
- import { operation as o346 } from './workspaces/usage-get.js';
343
+ import { operation as o342 } from './workspaces/personal-runtime-get.js';
344
+ import { operation as o343 } from './workspaces/sandbox-hours-get.js';
345
+ import { operation as o344 } from './workspaces/sandbox-limit-get.js';
346
+ import { operation as o345 } from './workspaces/sandboxes-stop.js';
347
+ import { operation as o346 } from './workspaces/timezone-set.js';
348
+ import { operation as o347 } from './workspaces/usage-breakdown-get.js';
349
+ import { operation as o348 } from './workspaces/usage-get.js';
348
350
  export const operations = [
349
351
  o0,
350
352
  o1,
@@ -693,4 +695,6 @@ export const operations = [
693
695
  o344,
694
696
  o345,
695
697
  o346,
698
+ o347,
699
+ o348,
696
700
  ];
@@ -0,0 +1,19 @@
1
+ export const operation = {
2
+ "method": "get",
3
+ "path": "/api/organizations/{workspaceId}/personal-runtime",
4
+ "command": [
5
+ "workspaces",
6
+ "personal-runtime",
7
+ "get"
8
+ ],
9
+ "summary": "Read Personal actual runtime balance and shared sandbox capacity.",
10
+ "pathParams": [
11
+ "workspaceId"
12
+ ],
13
+ "query": [],
14
+ "body": null,
15
+ "multipart": null,
16
+ "attachments": false,
17
+ "anonymous": false,
18
+ "agents": "all"
19
+ };
@@ -0,0 +1,19 @@
1
+ export const operation = {
2
+ "method": "get",
3
+ "path": "/api/organizations/{workspaceId}/sandbox-hours",
4
+ "command": [
5
+ "workspaces",
6
+ "sandbox-hours",
7
+ "get"
8
+ ],
9
+ "summary": "Read organization sandbox hours and stop status.",
10
+ "pathParams": [
11
+ "workspaceId"
12
+ ],
13
+ "query": [],
14
+ "body": null,
15
+ "multipart": null,
16
+ "attachments": false,
17
+ "anonymous": false,
18
+ "agents": "all"
19
+ };
@@ -85,6 +85,22 @@ function sentenceOf(error, status) {
85
85
  const said = isRow(error) ? oneLine(error.error, 300) : '';
86
86
  return said || `HTTP ${status}`;
87
87
  }
88
+ /** Seconds the platform asked to wait on a 429, bounded to the minute its budgets run on. */
89
+ function retryAfterOf(error) {
90
+ const value = isRow(error) ? error.retryAfterSeconds : undefined;
91
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < 1)
92
+ return null;
93
+ return Math.min(60, Math.ceil(value));
94
+ }
95
+ /** A 429's sentence: the platform's own, else ours, always ending in how long to wait. */
96
+ function tooManyMessage(error) {
97
+ const seconds = retryAfterOf(error);
98
+ if (seconds === null)
99
+ return 'Too many requests. Try again shortly.';
100
+ const said = isRow(error) ? oneLine(error.error, 300).replace(/\s*Try again\b.*$/, '') : '';
101
+ const wait = `Wait ${seconds} second${seconds === 1 ? '' : 's'} before trying again.`;
102
+ return said ? `${said} ${wait}` : `Too many requests. ${wait}`;
103
+ }
88
104
  /**
89
105
  * Why a request failed, in words the reader can act on. The 4xx sentences are
90
106
  * the platform's own (a Connector Token, a workspace the key is not a member of,
@@ -103,7 +119,7 @@ export function failureOf(status, error, method) {
103
119
  };
104
120
  }
105
121
  if (status === 429) {
106
- return { ok: false, status, message: 'Too many requests. Try again shortly.' };
122
+ return { ok: false, status, message: tooManyMessage(error) };
107
123
  }
108
124
  if (status >= 400 && status < 500) {
109
125
  return { ok: false, status, message: sentenceOf(error, status) };
package/openapi.json CHANGED
@@ -7532,6 +7532,60 @@
7532
7532
  }
7533
7533
  }
7534
7534
  },
7535
+ "/api/organizations/{workspaceId}/personal-runtime": {
7536
+ "get": {
7537
+ "operationId": "workspacesPersonalRuntimeGet",
7538
+ "summary": "Read Personal actual runtime balance and shared sandbox capacity.",
7539
+ "tags": ["workspaces"],
7540
+ "x-kosuke-command": ["workspaces", "personal-runtime", "get"],
7541
+ "x-kosuke-sandbox-token": true,
7542
+ "x-kosuke-cron-token": true,
7543
+ "x-kosuke-sensei-token": true,
7544
+ "parameters": [
7545
+ {
7546
+ "name": "workspaceId",
7547
+ "in": "path",
7548
+ "required": true,
7549
+ "schema": {
7550
+ "type": "string",
7551
+ "minLength": 1
7552
+ }
7553
+ }
7554
+ ],
7555
+ "responses": {
7556
+ "2XX": {
7557
+ "description": "Success envelope",
7558
+ "content": {
7559
+ "application/json": {
7560
+ "schema": {
7561
+ "$ref": "#/components/schemas/ApiSuccess"
7562
+ }
7563
+ }
7564
+ }
7565
+ },
7566
+ "4XX": {
7567
+ "description": "Error envelope",
7568
+ "content": {
7569
+ "application/json": {
7570
+ "schema": {
7571
+ "$ref": "#/components/schemas/ApiError"
7572
+ }
7573
+ }
7574
+ }
7575
+ },
7576
+ "5XX": {
7577
+ "description": "Error envelope",
7578
+ "content": {
7579
+ "application/json": {
7580
+ "schema": {
7581
+ "$ref": "#/components/schemas/ApiError"
7582
+ }
7583
+ }
7584
+ }
7585
+ }
7586
+ }
7587
+ }
7588
+ },
7535
7589
  "/api/organizations/{workspaceId}/plugins": {
7536
7590
  "get": {
7537
7591
  "operationId": "pluginsList",
@@ -8144,6 +8198,60 @@
8144
8198
  }
8145
8199
  }
8146
8200
  },
8201
+ "/api/organizations/{workspaceId}/sandbox-hours": {
8202
+ "get": {
8203
+ "operationId": "workspacesSandboxHoursGet",
8204
+ "summary": "Read organization sandbox hours and stop status.",
8205
+ "tags": ["workspaces"],
8206
+ "x-kosuke-command": ["workspaces", "sandbox-hours", "get"],
8207
+ "x-kosuke-sandbox-token": true,
8208
+ "x-kosuke-cron-token": true,
8209
+ "x-kosuke-sensei-token": true,
8210
+ "parameters": [
8211
+ {
8212
+ "name": "workspaceId",
8213
+ "in": "path",
8214
+ "required": true,
8215
+ "schema": {
8216
+ "type": "string",
8217
+ "minLength": 1
8218
+ }
8219
+ }
8220
+ ],
8221
+ "responses": {
8222
+ "2XX": {
8223
+ "description": "Success envelope",
8224
+ "content": {
8225
+ "application/json": {
8226
+ "schema": {
8227
+ "$ref": "#/components/schemas/ApiSuccess"
8228
+ }
8229
+ }
8230
+ }
8231
+ },
8232
+ "4XX": {
8233
+ "description": "Error envelope",
8234
+ "content": {
8235
+ "application/json": {
8236
+ "schema": {
8237
+ "$ref": "#/components/schemas/ApiError"
8238
+ }
8239
+ }
8240
+ }
8241
+ },
8242
+ "5XX": {
8243
+ "description": "Error envelope",
8244
+ "content": {
8245
+ "application/json": {
8246
+ "schema": {
8247
+ "$ref": "#/components/schemas/ApiError"
8248
+ }
8249
+ }
8250
+ }
8251
+ }
8252
+ }
8253
+ }
8254
+ },
8147
8255
  "/api/organizations/{workspaceId}/sandbox-limit": {
8148
8256
  "get": {
8149
8257
  "operationId": "workspacesSandboxLimitGet",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosuke-ai/kosuke",
3
- "version": "1.0.99",
3
+ "version": "1.0.101",
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,11 @@
43
43
  "minimatch": "^11.0.1"
44
44
  },
45
45
  "kosukeRelease": {
46
- "sourceCommit": "dcb426e4db79560eefab56c13c75b3b631a8f164",
47
- "sourceIdentity": "d3c2fe4195351c286aa6bb9814dca97f27a909bad43471a85b24d2e2b07a09f9",
46
+ "sourceCommit": "86f027d0c3b07f8e747ae3933812a828b698149f",
47
+ "sourceIdentity": "1ef17a9a59ff32b57aff011cd868f3fd1c52b3073ee3dc499a2a2f1954d4eb83",
48
48
  "fragments": [
49
- "integration-names-any-case-t8o77w.json"
49
+ "personal-free-runtime-capacity.json",
50
+ "organization-sandbox-hours-status.json"
50
51
  ]
51
52
  }
52
53
  }