@agentknight/sdk 0.9.42 → 0.9.43

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.
@@ -18,25 +18,25 @@ import {
18
18
  recordTimelineSyncDiagnostic,
19
19
  resolveGitProjectIdentity,
20
20
  sanitizeGitRemoteUrl
21
- } from "./chunk-SHOE7YAU.js";
21
+ } from "./chunk-CWJENQ3O.js";
22
22
  import {
23
23
  assertMainSessionId,
24
24
  isResearchSessionId
25
- } from "./chunk-J52FWJU4.js";
25
+ } from "./chunk-NYSZHHBS.js";
26
26
  import {
27
27
  GroupChatError,
28
28
  GroupChatMessageSchema,
29
29
  GroupChatRuntime
30
- } from "./chunk-VDC4G7ZG.js";
30
+ } from "./chunk-C2VUD77E.js";
31
31
  import {
32
32
  isContentfulAssistant
33
- } from "./chunk-RBULXS7T.js";
33
+ } from "./chunk-DB3EAMYS.js";
34
34
  import {
35
35
  AgentSessionRenameError,
36
36
  SessionOperationError,
37
37
  TimelinePageBudgetError,
38
38
  validateSessionName
39
- } from "./chunk-LQIW4ARE.js";
39
+ } from "./chunk-ULM5KUJ7.js";
40
40
  import {
41
41
  ConversationItemSchema,
42
42
  CopilotModelOptionSchema,
@@ -57,7 +57,7 @@ import {
57
57
  WorkbenchScheduleEntrySchema,
58
58
  WorkbenchScheduleProposalSchema,
59
59
  WorkbenchScheduleSnapshotSchema
60
- } from "./chunk-QTBB2U7G.js";
60
+ } from "./chunk-7QOBDG6R.js";
61
61
 
62
62
  // src/copilot-adapter.ts
63
63
  import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
@@ -2781,10 +2781,10 @@ function permissionSessionApproval(request) {
2781
2781
  }
2782
2782
  };
2783
2783
  }
2784
- if (request.kind === "factory" && request.canPersistApproval && request.approvalKey.trim()) {
2784
+ if (request.kind === "workflow" && request.canPersistApproval && request.approvalKey.trim()) {
2785
2785
  return {
2786
2786
  kind: "approve-for-session",
2787
- approval: { kind: "factory", approvalKey: request.approvalKey }
2787
+ approval: { kind: "workflow", approvalKey: request.approvalKey }
2788
2788
  };
2789
2789
  }
2790
2790
  if (request.kind === "url" && URL.canParse(request.url)) {
@@ -3557,7 +3557,7 @@ var McpAuthCoordinator = class {
3557
3557
  const staticConfig = event.data.staticClientConfig;
3558
3558
  const result = await oauth.login({
3559
3559
  serverName,
3560
- clientName: "BluePaw",
3560
+ clientName: "AgentKnight",
3561
3561
  ...event.data.reason === "reauth" || event.data.reason === "upscope" ? { forceReauth: true } : {},
3562
3562
  ...staticConfig?.clientId === void 0 ? {} : { clientId: staticConfig.clientId },
3563
3563
  ...staticConfig?.clientSecret === void 0 ? {} : { clientSecret: staticConfig.clientSecret },
@@ -1,32 +1,34 @@
1
1
  import {
2
2
  AgentSelectionSchema,
3
3
  assertSelectionSnapshotFits
4
- } from "./chunk-ASHXZ46V.js";
4
+ } from "./chunk-YZ2GB3DD.js";
5
5
  import {
6
6
  isResearchSessionId
7
- } from "./chunk-J52FWJU4.js";
7
+ } from "./chunk-NYSZHHBS.js";
8
8
  import {
9
9
  GroupChatError
10
- } from "./chunk-VDC4G7ZG.js";
10
+ } from "./chunk-C2VUD77E.js";
11
11
  import {
12
12
  AgentModelListingError,
13
13
  AgentSessionRenameError,
14
+ CODING_AGENT_IDS,
14
15
  SessionOperationError,
15
16
  UnsupportedAgentOperationError,
16
17
  captureWorkbenchAccess,
17
18
  validateSessionName
18
- } from "./chunk-LQIW4ARE.js";
19
+ } from "./chunk-ULM5KUJ7.js";
19
20
  import {
20
21
  InteractionResponseSchema,
21
22
  SessionSummarySchema
22
- } from "./chunk-QTBB2U7G.js";
23
+ } from "./chunk-7QOBDG6R.js";
23
24
 
24
25
  // src/managed-agent-adapter.ts
25
26
  import { createHash, randomUUID } from "node:crypto";
26
27
  import { mkdir, open, readFile, rename, rm } from "node:fs/promises";
27
28
  import { join } from "node:path";
28
29
  import { z } from "zod";
29
- var ManagedSessionIdSchema = z.string().regex(/^managed:(copilot|pi|acp):session:[a-f0-9]{64}$/);
30
+ var managedSessionIdPattern = new RegExp(`^managed:(${CODING_AGENT_IDS.join("|")}):session:[a-f0-9]{64}$`);
31
+ var ManagedSessionIdSchema = z.string().regex(managedSessionIdPattern);
30
32
  var StoredSelectionSchema = AgentSelectionSchema.extend({ version: z.literal(1) });
31
33
  var LegacySelectionSchema = AgentSelectionSchema.extend({
32
34
  sessionIds: z.array(ManagedSessionIdSchema).max(2e3).refine((ids) => new Set(ids).size === ids.length, "Duplicate managed session selection")
@@ -108,7 +110,7 @@ var ManagedCodingAgentAdapter = class {
108
110
  this.#localOwner = SessionSummarySchema.pick({ userId: true, machineId: true }).parse(options.owner);
109
111
  const ids = /* @__PURE__ */ new Set();
110
112
  this.#providers = options.candidates.map((candidate) => {
111
- if (!["copilot", "pi", "acp"].includes(candidate.id) || ids.has(candidate.id)) {
113
+ if (!CODING_AGENT_IDS.includes(candidate.id) || ids.has(candidate.id)) {
112
114
  throw new Error(`Invalid or duplicate managed agent: ${candidate.id}`);
113
115
  }
114
116
  ids.add(candidate.id);
@@ -833,7 +835,7 @@ var ManagedCodingAgentAdapter = class {
833
835
  return join(this.#directory, "managed-session-deletions.json");
834
836
  }
835
837
  #owner(id) {
836
- const match = /^managed:(copilot|pi|acp):session:[a-f0-9]{64}$/.exec(id);
838
+ const match = managedSessionIdPattern.exec(id);
837
839
  return match ? this.#providers.find((provider) => provider.candidate.id === match[1]) : void 0;
838
840
  }
839
841
  #validateSelection(input) {
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  latestPreviewItems
3
- } from "./chunk-RBULXS7T.js";
3
+ } from "./chunk-DB3EAMYS.js";
4
4
  import {
5
5
  AgentSessionRenameError,
6
6
  UnsupportedAgentOperationError,
7
7
  validateSessionName
8
- } from "./chunk-LQIW4ARE.js";
8
+ } from "./chunk-ULM5KUJ7.js";
9
9
  import {
10
10
  InteractionRequestSchema,
11
11
  REASONING_EFFORTS,
12
12
  SESSION_TIMELINE_PAGE_SIZE
13
- } from "./chunk-QTBB2U7G.js";
13
+ } from "./chunk-7QOBDG6R.js";
14
14
 
15
15
  // src/pi-adapter.ts
16
16
  import { createHash as createHash2, randomUUID } from "node:crypto";