@islamihab/kds 0.7.0 → 0.8.0

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 (2) hide show
  1. package/index.js +16 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -14611,7 +14611,7 @@ import { join } from "path";
14611
14611
  // package.json
14612
14612
  var package_default = {
14613
14613
  name: "cli",
14614
- version: "0.7.0",
14614
+ version: "0.8.0",
14615
14615
  private: true,
14616
14616
  type: "module",
14617
14617
  bin: {
@@ -18436,6 +18436,7 @@ var comment = command({
18436
18436
  });
18437
18437
 
18438
18438
  // src/lib/agents.ts
18439
+ var agentConfigurationForActor = (actor) => AGENT_CONFIGURATION_OPTIONS.find((entry) => AGENT_HARNESS_LABELS[entry.harness] === actor.harness && entry.model === actor.model)?.id;
18439
18440
  var agentConfigurationLegacyNote = () => {
18440
18441
  const legacy = AGENT_CONFIGURATION_OPTIONS.filter((entry) => entry.lifecycle === "legacy");
18441
18442
  return legacy.length === 0 ? "" : ` (legacy: ${legacy.map((entry) => entry.id).join(", ")})`;
@@ -18910,18 +18911,30 @@ ready_for_agent is informational, and --ready belongs only to an explicit hand-o
18910
18911
  id: exports_external.string().describe("Issue identifier, number, or URL")
18911
18912
  },
18912
18913
  options: {
18913
- ready: exports_external.boolean().default(false).describe("Also route the issue to ready_for_agent")
18914
+ ready: exports_external.boolean().default(false).describe("Also route the issue to ready_for_agent, assigning the running agent when it is identifiable")
18914
18915
  },
18915
18916
  run: async ({ positionals: { id }, options: { ready } }) => {
18916
18917
  const client3 = await backendClient();
18917
18918
  const issue2 = await resolveIssue(client3, id);
18918
18919
  const { branch } = await client3.mutation(api2.issues.start, { id: issue2._id });
18920
+ let assigned;
18921
+ if (ready) {
18922
+ const actor = await agentClaim();
18923
+ const configurationId = actor && agentConfigurationForActor(actor);
18924
+ if (configurationId && configurationId !== issue2.agentConfigurationId) {
18925
+ await client3.mutation(api2.issues.setAgentConfiguration, {
18926
+ id: issue2._id,
18927
+ agentConfigurationId: configurationId
18928
+ });
18929
+ assigned = configurationId;
18930
+ }
18931
+ }
18919
18932
  if (ready && issue2.disposition !== "ready_for_agent") {
18920
18933
  await client3.mutation(api2.issues.route, { id: issue2._id, disposition: "ready_for_agent" });
18921
18934
  }
18922
18935
  console.log(`Started ${issue2.identifier}: in_progress, branch ${branch}`);
18923
18936
  if (ready) {
18924
- console.log("Routed to ready_for_agent.");
18937
+ console.log(`Routed to ready_for_agent${assigned ? `, assigned ${agentConfiguration(assigned).label}` : ""}.`);
18925
18938
  } else if (issue2.disposition !== "ready_for_agent" && await agentClaim()) {
18926
18939
  console.log(`Note: disposition is ${issue2.disposition}. Pass --ready if this hand-off was intended.`);
18927
18940
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@islamihab/kds",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Command-line client for Kai Dev Studio",
5
5
  "license": "MIT",
6
6
  "publishConfig": {