@kosuke-ai/kosuke 1.0.95 → 1.0.96

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.96
4
+
5
+ - Add `kosuke projects merge-agent order set` for the open merge train run's own session only, with its sandbox agent token; no API key reaches it. It saves the order the train merges pull requests in, with each one's group and reason. `kosuke projects merge-agent get` now returns it as `trainOrder`.
6
+
3
7
  ## 1.0.95
4
8
 
5
9
  - `kosuke preview get --services wait|restart` checks or restarts the services of a running main sandbox.
@@ -96,6 +96,14 @@ export const HAND_WRITTEN = {
96
96
  agents: 'none',
97
97
  workspace: false,
98
98
  },
99
+ // Agent-only, so no operation generates it: the open merge train run's session saves its order.
100
+ projectsMergeAgentOrderSet: {
101
+ command: ['projects', 'merge-agent', 'order', 'set'],
102
+ positionals: ['projectId'],
103
+ flags: ['--entries'],
104
+ agents: ['sandboxToken'],
105
+ workspace: true,
106
+ },
99
107
  // lint-gate-exempt command-names: the capability probe ksb runs by fixed argv
100
108
  // (skill-marker-capability.ts), so an older ksb finds markers on a newer CLI.
101
109
  sessionsSkillRuns: {
@@ -0,0 +1,43 @@
1
+ import { Argument, Option } from 'commander';
2
+ import { leafAt } from '../runtime/attach.js';
3
+ import { setAfterHelp } from '../runtime/help.js';
4
+ import { execute } from '../runtime/invoke.js';
5
+ import { jsonParser } from '../runtime/option-parsers.js';
6
+ import { HAND_WRITTEN } from './hand-written.js';
7
+ /**
8
+ * `kosuke projects merge-agent order set`: the open merge train run's session saves the order it
9
+ * merges pull requests in. Hand-written because the operation is agent-only, so the generated
10
+ * tree, which describes what a member's key reaches, leaves it out. It prints the platform's
11
+ * answer as a generated command does, and a refusal exits 1 with the server's error.
12
+ */
13
+ // The entry and reason fields of the route's body, which the merge-train skill sends to `--help`.
14
+ const ENTRY_HELP = `Entries, in merge order, the first is Next:
15
+ {sessionId, pullRequestNumber, group: ready|waiting|conflict, reason}
16
+ Reason kinds and their fields:
17
+ member by: who asked, or null
18
+ ready openedAt: when its pull request opened, or null
19
+ age-guard openedAt: when it opened, over 24 hours ago; waitingOn: checks|qa|review or null
20
+ waiting on: checks|qa|review
21
+ conflict-synced syncedAt: when the run sent its session the sync, or null
22
+ conflict-overlap aheadPullRequestNumber: the pull request ahead it overlaps; files: the files both change
23
+ Times are ISO 8601 with an offset.`;
24
+ export function attachMergeTrainOrderCommand(root, runtime) {
25
+ const leaf = leafAt(root, HAND_WRITTEN.projectsMergeAgentOrderSet.command)
26
+ .description("The open merge train run's own session only: save the order it merges pull requests in, " +
27
+ 'each with its group and the reason it sits there, replacing the order before. Members ' +
28
+ 'read it in `kosuke projects merge-agent get` (trainOrder) while the run is open.')
29
+ .addArgument(new Argument('<projectId>', 'Project id'))
30
+ .addOption(new Option('--entries <value>', 'The entries, as JSON.')
31
+ .argParser(jsonParser)
32
+ .makeOptionMandatory());
33
+ setAfterHelp(leaf, () => `\n${ENTRY_HELP}`);
34
+ leaf.action(async (projectId, options) => {
35
+ runtime.output(await execute(runtime.client(), {
36
+ method: 'post',
37
+ path: '/api/projects/{projectId}/merge-agent/order',
38
+ pathParams: { projectId },
39
+ query: {},
40
+ body: { kind: 'json', value: { entries: options.entries } },
41
+ }));
42
+ });
43
+ }
@@ -6,7 +6,7 @@ export const operation = {
6
6
  "merge-agent",
7
7
  "get"
8
8
  ],
9
- "summary": "Read the project's Merge agent: its mode (train, batch, or off, where a new project starts), the base and whether it has GitHub's merge queue, the model the next run starts on (null: the Default Model), the go-ahead pull requests waiting for the next run with their QA, recorded head, stored review decision and state word (merged, ejected, in-batch, waiting, failed or ready, the one the Tasks board shows), the Batch the queue is split by (its CI, review, QA, members and ejections, each with its state word), and the open run and the last ten earlier runs, each with the model and effort its session runs on. `kosuke projects merge-agent runs list` lists every run. --live false reads Sensei's own data only: no GitHub call, and GitHub's facts (what the Batch pull request still needs, the merge queue) are null.",
9
+ "summary": "Read the project's Merge agent: its mode (train, batch, or off, where a new project starts), the base and whether it has GitHub's merge queue, the model the next run starts on (null: the Default Model), the go-ahead pull requests waiting for the next run with their QA, recorded head, stored review decision and state word (merged, ejected, in-batch, waiting, failed or ready, the one the Tasks board shows), the Batch the queue is split by (its CI, review, QA, members and ejections, each with its state word), the merge train's order as its open run saved it (trainOrder: each waiting pull request's place, group and reason, else null), and the open run and the last ten earlier runs, each with the model and effort its session runs on. `kosuke projects merge-agent runs list` lists every run. --live false reads Sensei's own data only: no GitHub call, and GitHub's facts (what the Batch pull request still needs, the merge queue) are null.",
10
10
  "pathParams": [
11
11
  "projectId"
12
12
  ],
package/dist/program.js CHANGED
@@ -4,6 +4,7 @@ import { attachAgentCommands } from './commands/agent.js';
4
4
  import { attachAuthCommands } from './commands/auth.js';
5
5
  import { attachCardSchemaCommand, attachHelpCommand } from './commands/help.js';
6
6
  import { attachIntegrationsCommands } from './commands/integrations.js';
7
+ import { attachMergeTrainOrderCommand } from './commands/merge-train-order.js';
7
8
  import { attachWatchCommand } from './commands/watch.js';
8
9
  import { operations } from './generated/commands/index.js';
9
10
  import { attachCommand } from './runtime/attach.js';
@@ -64,6 +65,9 @@ export function createProgram(options = {}) {
64
65
  attachAgentCommands(program, lazy, options.agent);
65
66
  if (narrowedTo === null || narrowedTo === 'sandboxToken')
66
67
  attachSkillMarkerCommands(program, options.process);
68
+ // Agent-only: the open merge train run's session saves its order with its sandbox token.
69
+ if (narrowedTo === null || narrowedTo === 'sandboxToken')
70
+ attachMergeTrainOrderCommand(program, lazy);
67
71
  // Beside the generated, hidden `integrations tools list|call`, which stay raw passthroughs.
68
72
  attachIntegrationsCommands(program, lazy, options.integrations);
69
73
  // The job stream admits a member's API key only; it closes 4401 on every narrower token.
package/openapi.json CHANGED
@@ -18119,7 +18119,7 @@
18119
18119
  "/api/projects/{projectId}/merge-agent": {
18120
18120
  "get": {
18121
18121
  "operationId": "projectsMergeAgentGet",
18122
- "summary": "Read the project's Merge agent: its mode (train, batch, or off, where a new project starts), the base and whether it has GitHub's merge queue, the model the next run starts on (null: the Default Model), the go-ahead pull requests waiting for the next run with their QA, recorded head, stored review decision and state word (merged, ejected, in-batch, waiting, failed or ready, the one the Tasks board shows), the Batch the queue is split by (its CI, review, QA, members and ejections, each with its state word), and the open run and the last ten earlier runs, each with the model and effort its session runs on. `kosuke projects merge-agent runs list` lists every run. --live false reads Sensei's own data only: no GitHub call, and GitHub's facts (what the Batch pull request still needs, the merge queue) are null.",
18122
+ "summary": "Read the project's Merge agent: its mode (train, batch, or off, where a new project starts), the base and whether it has GitHub's merge queue, the model the next run starts on (null: the Default Model), the go-ahead pull requests waiting for the next run with their QA, recorded head, stored review decision and state word (merged, ejected, in-batch, waiting, failed or ready, the one the Tasks board shows), the Batch the queue is split by (its CI, review, QA, members and ejections, each with its state word), the merge train's order as its open run saved it (trainOrder: each waiting pull request's place, group and reason, else null), and the open run and the last ten earlier runs, each with the model and effort its session runs on. `kosuke projects merge-agent runs list` lists every run. --live false reads Sensei's own data only: no GitHub call, and GitHub's facts (what the Batch pull request still needs, the merge queue) are null.",
18123
18123
  "tags": ["projects"],
18124
18124
  "x-kosuke-command": ["projects", "merge-agent", "get"],
18125
18125
  "x-kosuke-sandbox-token": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosuke-ai/kosuke",
3
- "version": "1.0.95",
3
+ "version": "1.0.96",
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": "41769726c5c5a7d1b0c42f5c13b95613e9dbd473",
47
- "sourceIdentity": "7af2b754d1cb7e5b29ab552caa9afd3ec5bee762622f6c705f8849cf683360d7",
46
+ "sourceCommit": "80cf55bf1deb740fb4a0bc3dca808b95362f1141",
47
+ "sourceIdentity": "c3779657d3558a6e82bb289cfdb5ea4c5b77a7949f2f7daa72f97764d6971711",
48
48
  "fragments": [
49
- "main-preview-services-neh2c9.json"
49
+ "merge-train-order-set-q7r2kd.json"
50
50
  ]
51
51
  }
52
52
  }