@kosuke-ai/kosuke 1.0.56 → 1.0.58

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.58
4
+
5
+ - `kosuke activity list` accepts the `main_checks_failed` and `main_checks_passed` kinds: CI failing and recovering on the repository's default branch.
6
+
7
+ ## 1.0.57
8
+
9
+ - `kosuke integrations tools call` labels a call made inside a Delegated Run, so integration usage counts it as a delegate's.
10
+
3
11
  ## 1.0.56
4
12
 
5
13
  - Kosuke is now called Sensei wherever the apps show its name. The Mac app shows Sensei in its menus, About panel, window and menu bar, with the Sensei icon in the Dock and menu bar, and in its permission prompts, notifications and messages; its widgets are named Sensei. The iPhone and Apple Watch apps' messages say Sensei, and the CLI's help, descriptions and README name Sensei. Only the displayed name and icons change: the kosuke command, the @kosuke-ai/kosuke package, KOSUKE_ variables, kosuke:// links, app identifiers, update channels and the app's file names and data locations are kept.
@@ -32,6 +32,13 @@ const EXIT_USAGE = 2;
32
32
  const TOOLKIT_PATTERN = /^[a-z0-9_]{1,64}$/;
33
33
  const MAX_SEARCH_CHARS = 100;
34
34
  const MAX_ACCOUNT_CHARS = 100;
35
+ /** The header a call made by a Delegated Run carries, so the platform counts it as a delegate's. */
36
+ const DELEGATED_RUN_HEADER = 'x-kosuke-delegated-run';
37
+ /** The Delegated Run this process runs in, set by the sandbox for a full-access run, or null. */
38
+ function delegatedRunOf(env) {
39
+ const value = env.KOSUKE_DELEGATED_RUN_ID?.trim();
40
+ return value && /^[A-Za-z0-9_-]{1,64}$/.test(value) ? value : null;
41
+ }
35
42
  /** Wrong flags or arguments, found before any request. */
36
43
  class UsageError extends Error {
37
44
  }
@@ -150,7 +157,7 @@ function uploadOf(answer) {
150
157
  export function attachIntegrationsCommands(root, runtime, deps = {}) {
151
158
  const { stdout = (text) => process.stdout.write(text), stderr = (text) => process.stderr.write(text), exit = (code) => {
152
159
  process.exitCode = code;
153
- }, readStdin = readAllStdin, readFile: readText = (path) => readFile(path, 'utf8'), readTimeoutMs = READ_TIMEOUT_MS, callTimeoutMs = CALL_TIMEOUT_MS, uploadFetch = (input, init) => globalThis.fetch(input, init), } = deps;
160
+ }, readStdin = readAllStdin, readFile: readText = (path) => readFile(path, 'utf8'), readTimeoutMs = READ_TIMEOUT_MS, callTimeoutMs = CALL_TIMEOUT_MS, uploadFetch = (input, init) => globalThis.fetch(input, init), env = process.env, } = deps;
154
161
  const fail = (failure, code = EXIT_FAILED) => {
155
162
  stderr(`${typeof failure === 'string' ? failure : failure.message}\n`);
156
163
  exit(code);
@@ -270,10 +277,12 @@ export function attachIntegrationsCommands(root, runtime, deps = {}) {
270
277
  throw new UsageError(`--file ${file.at.join('.')} does not fit the arguments: something else is already there.`);
271
278
  }
272
279
  }
280
+ const delegatedRun = delegatedRunOf(env);
273
281
  let data;
274
282
  try {
275
283
  const result = await client.POST(EXECUTE_PATH, {
276
284
  params: { query: workspace ? { workspace } : {} },
285
+ ...(delegatedRun && { headers: { [DELEGATED_RUN_HEADER]: delegatedRun } }),
277
286
  body: {
278
287
  name,
279
288
  arguments: toolArguments,
@@ -48,7 +48,7 @@ export const operation = {
48
48
  "flag": "kind",
49
49
  "kind": "string",
50
50
  "required": false,
51
- "description": "Comma-separated kinds (job_awaiting_response, pr_checks_failed, pr_checks_passed, pr_merged, branch_behind, pr_stale, cron_run_succeeded, cron_run_failed, deployed, recovery_deploy_started, workspace_device_disconnected, session_started, session_message_sent, session_archived, session_deleted, session_assigned, session_status_changed, session_priority_changed, cron_created, cron_updated, cron_deleted, member_invited, member_removed, member_role_changed, integration_custom_tool_saved, integration_custom_tool_enabled, integration_custom_tool_disabled, integration_custom_tool_deleted, integration_custom_tool_restored), or 'change' for every Change and 'action' for every Member Action."
51
+ "description": "Comma-separated kinds (job_awaiting_response, pr_checks_failed, pr_checks_passed, main_checks_failed, main_checks_passed, pr_merged, branch_behind, pr_stale, cron_run_succeeded, cron_run_failed, deployed, recovery_deploy_started, workspace_device_disconnected, session_started, session_message_sent, session_archived, session_deleted, session_assigned, session_status_changed, session_priority_changed, cron_created, cron_updated, cron_deleted, member_invited, member_removed, member_role_changed, integration_custom_tool_saved, integration_custom_tool_enabled, integration_custom_tool_disabled, integration_custom_tool_deleted, integration_custom_tool_restored), or 'change' for every Change and 'action' for every Member Action."
52
52
  },
53
53
  {
54
54
  "name": "limit",
package/openapi.json CHANGED
@@ -77,9 +77,9 @@
77
77
  "name": "kind",
78
78
  "in": "query",
79
79
  "required": false,
80
- "description": "Comma-separated kinds (job_awaiting_response, pr_checks_failed, pr_checks_passed, pr_merged, branch_behind, pr_stale, cron_run_succeeded, cron_run_failed, deployed, recovery_deploy_started, workspace_device_disconnected, session_started, session_message_sent, session_archived, session_deleted, session_assigned, session_status_changed, session_priority_changed, cron_created, cron_updated, cron_deleted, member_invited, member_removed, member_role_changed, integration_custom_tool_saved, integration_custom_tool_enabled, integration_custom_tool_disabled, integration_custom_tool_deleted, integration_custom_tool_restored), or 'change' for every Change and 'action' for every Member Action.",
80
+ "description": "Comma-separated kinds (job_awaiting_response, pr_checks_failed, pr_checks_passed, main_checks_failed, main_checks_passed, pr_merged, branch_behind, pr_stale, cron_run_succeeded, cron_run_failed, deployed, recovery_deploy_started, workspace_device_disconnected, session_started, session_message_sent, session_archived, session_deleted, session_assigned, session_status_changed, session_priority_changed, cron_created, cron_updated, cron_deleted, member_invited, member_removed, member_role_changed, integration_custom_tool_saved, integration_custom_tool_enabled, integration_custom_tool_disabled, integration_custom_tool_deleted, integration_custom_tool_restored), or 'change' for every Change and 'action' for every Member Action.",
81
81
  "schema": {
82
- "description": "Comma-separated kinds (job_awaiting_response, pr_checks_failed, pr_checks_passed, pr_merged, branch_behind, pr_stale, cron_run_succeeded, cron_run_failed, deployed, recovery_deploy_started, workspace_device_disconnected, session_started, session_message_sent, session_archived, session_deleted, session_assigned, session_status_changed, session_priority_changed, cron_created, cron_updated, cron_deleted, member_invited, member_removed, member_role_changed, integration_custom_tool_saved, integration_custom_tool_enabled, integration_custom_tool_disabled, integration_custom_tool_deleted, integration_custom_tool_restored), or 'change' for every Change and 'action' for every Member Action.",
82
+ "description": "Comma-separated kinds (job_awaiting_response, pr_checks_failed, pr_checks_passed, main_checks_failed, main_checks_passed, pr_merged, branch_behind, pr_stale, cron_run_succeeded, cron_run_failed, deployed, recovery_deploy_started, workspace_device_disconnected, session_started, session_message_sent, session_archived, session_deleted, session_assigned, session_status_changed, session_priority_changed, cron_created, cron_updated, cron_deleted, member_invited, member_removed, member_role_changed, integration_custom_tool_saved, integration_custom_tool_enabled, integration_custom_tool_disabled, integration_custom_tool_deleted, integration_custom_tool_restored), or 'change' for every Change and 'action' for every Member Action.",
83
83
  "type": "string"
84
84
  }
85
85
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosuke-ai/kosuke",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
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": "84e1ab3e386158287da89a91a359dc34b3565933",
47
- "sourceIdentity": "4522f281cae758eef4c17efeaf30444a9f2484a629849327490c75b73b39a58b",
46
+ "sourceCommit": "33ad2e6b1b05389e2e7198fdd4ca6b684f940f41",
47
+ "sourceIdentity": "c96efaf0baf9f4a5d880ab579c43bce4570c3c044327adfbfe24d8a4105335c3",
48
48
  "fragments": [
49
- "sensei-rebrand-ngxbd9.json"
49
+ "main-checks-activity-0n8ppi.json"
50
50
  ]
51
51
  }
52
52
  }