@agentknight/sdk 0.9.36 → 0.9.37

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.
@@ -888,7 +888,6 @@ var SessionConnections = class {
888
888
  reloadSession(sessionId, options = {}) {
889
889
  assertMainSessionId(sessionId);
890
890
  const explicit = options.activate === true || options.resumeForSend === true;
891
- this.ports.assertCanResume?.(sessionId, explicit);
892
891
  this.ports.owned(sessionId);
893
892
  const runtime = this.#sessionRuntimes.getOrCreate(sessionId);
894
893
  const inProgress = runtime.connection.reload;
@@ -905,14 +904,14 @@ var SessionConnections = class {
905
904
  this.ports.resetMetadata(sessionId);
906
905
  const reloaded = (async () => {
907
906
  if (previous === void 0 && explicit) {
908
- const sendReadySession = await this.resumeSession(sessionId, false, explicit, options.beforeResume);
907
+ const sendReadySession = await this.resumeSession(sessionId, false, options.beforeResume);
909
908
  if (runtime.connection.generation !== generation) {
910
909
  throw new Error("Copilot session connection was replaced");
911
910
  }
912
911
  runtime.connection.sendReady = true;
913
912
  return sendReadySession;
914
913
  }
915
- const staleSession = previous === void 0 ? await this.resumeSession(sessionId, true, explicit, options.beforeResume) : await previous;
914
+ const staleSession = previous === void 0 ? await this.resumeSession(sessionId, true, options.beforeResume) : await previous;
916
915
  if (runtime.connection.generation !== generation) {
917
916
  throw new Error("Copilot session connection was replaced");
918
917
  }
@@ -931,7 +930,6 @@ var SessionConnections = class {
931
930
  const resumed = await this.resumeSession(
932
931
  sessionId,
933
932
  options.resumeForSend !== true,
934
- explicit,
935
933
  options.beforeResume
936
934
  );
937
935
  if (runtime.connection.generation !== generation) {
@@ -973,11 +971,9 @@ var SessionConnections = class {
973
971
  );
974
972
  return reloaded;
975
973
  }
976
- async resumeSession(sessionId, suppressResumeEvent = true, explicit = false, beforeResume) {
974
+ async resumeSession(sessionId, suppressResumeEvent = true, beforeResume) {
977
975
  assertMainSessionId(sessionId);
978
- this.ports.assertCanResume?.(sessionId, explicit);
979
976
  await this.ports.runtime().awaitRuntime();
980
- this.ports.assertCanResume?.(sessionId, explicit);
981
977
  const restoreFailures = this.#restoreFailures;
982
978
  const rejected = restoreFailures.get(sessionId);
983
979
  if (suppressResumeEvent && rejected !== void 0 && rejected.until > Date.now()) {
@@ -1112,7 +1108,7 @@ var SessionConnections = class {
1112
1108
  }
1113
1109
  }
1114
1110
  canRefreshSessionConnection(sessionId) {
1115
- if (this.ports.allowsPassiveResume?.() === false) return false;
1111
+ if (this.ports.canRefreshSession?.(sessionId) === false) return false;
1116
1112
  const runtime = this.#sessionRuntimes.peek(sessionId);
1117
1113
  return runtime?.activity.activeRootTurn !== true && runtime?.activity.busy !== true && (runtime?.connection.sendInProgressCount ?? 0) === 0;
1118
1114
  }
@@ -3824,7 +3820,7 @@ var GithubCopilotAdapter = class {
3824
3820
  this.#mcpAuth.clear();
3825
3821
  },
3826
3822
  restoreWatched: (sessionId) => {
3827
- if (this.#sessions.peek(sessionId)?.watched && this.#schedules === void 0) {
3823
+ if (this.#sessions.peek(sessionId)?.watched) {
3828
3824
  this.#sessions.reloadSession(sessionId, { preserveTimelineState: true });
3829
3825
  }
3830
3826
  }
@@ -3912,12 +3908,7 @@ var GithubCopilotAdapter = class {
3912
3908
  isGroup: (sessionId) => this.#groups?.has(sessionId) === true,
3913
3909
  isDeleted: (sessionId) => this.#deletingSessions.has(sessionId) || this.#deletedSessions.has(sessionId),
3914
3910
  assertOriginalAction: (sessionId) => this.#assertOriginalGroupAction(sessionId),
3915
- assertCanResume: (_sessionId, explicit) => {
3916
- if (this.#schedules !== void 0 && !explicit) {
3917
- throw new SessionOperationError("SCHEDULE_NEEDS_RESUME", "Continue the session before activating its native runtime");
3918
- }
3919
- },
3920
- allowsPassiveResume: () => this.#schedules === void 0,
3911
+ canRefreshSession: (sessionId) => this.#schedules?.hasPlans(sessionId) !== true,
3921
3912
  owned: (sessionId) => {
3922
3913
  this.#upgradeSessionIds.add(sessionId);
3923
3914
  this.#upgradeRevision += 1;
@@ -4970,7 +4961,6 @@ var GithubCopilotAdapter = class {
4970
4961
  if (watched) {
4971
4962
  const runtime = this.#sessions.getOrCreate(sessionId);
4972
4963
  this.#projection.watch(sessionId);
4973
- if (this.#schedules !== void 0 && this.#sessions.current(sessionId) === void 0) return;
4974
4964
  try {
4975
4965
  await this.#sessions.readWithRecovery(
4976
4966
  sessionId,
package/dist/index.js CHANGED
@@ -314,7 +314,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
314
314
  });
315
315
  }
316
316
  case "copilot": {
317
- const { GithubCopilotAdapter } = await import("./chunks/copilot-adapter-ULOIFWJ3.js");
317
+ const { GithubCopilotAdapter } = await import("./chunks/copilot-adapter-KM6RMGFR.js");
318
318
  if (owner !== void 0) {
319
319
  return new GithubCopilotAdapter(void 0, void 0, void 0, {
320
320
  dataDirectory: config.dataDirectory,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentknight/sdk",
3
- "version": "0.9.36",
3
+ "version": "0.9.37",
4
4
  "description": "AgentKnight runtime SDK for local and remote coding sessions",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -49,8 +49,8 @@
49
49
  "esbuild": "0.28.2",
50
50
  "rollup": "4.63.1",
51
51
  "rollup-plugin-dts": "6.3.0",
52
- "@agentknight/protocol": "0.1.0",
53
- "@agentknight/shared": "0.1.0"
52
+ "@agentknight/shared": "0.1.0",
53
+ "@agentknight/protocol": "0.1.0"
54
54
  },
55
55
  "optionalDependencies": {
56
56
  "@earendil-works/pi-ai": "0.85.1",