@agentknight/sdk 0.9.38 → 0.9.39

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SECURE_MESSAGE_MAX_CIPHERTEXT_LENGTH
3
- } from "./chunk-GNQC2IS2.js";
3
+ } from "./chunk-E3XCZWRK.js";
4
4
 
5
5
  // src/agent-selection.ts
6
6
  import { z } from "zod";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SessionAssistantPreviewSchema,
3
3
  SessionUserPreviewSchema
4
- } from "./chunk-GNQC2IS2.js";
4
+ } from "./chunk-E3XCZWRK.js";
5
5
 
6
6
  // src/assistant-preview.ts
7
7
  function isContentfulAssistant(item) {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  isContentfulAssistant
3
- } from "./chunk-34DUD2Y4.js";
3
+ } from "./chunk-N4MN54CD.js";
4
4
  import {
5
5
  SessionOperationError
6
- } from "./chunk-6GVMVE5N.js";
6
+ } from "./chunk-BM6T2DLH.js";
7
7
  import {
8
8
  CONVERSATION_SOURCE_ID_LIMIT,
9
9
  SESSION_DIRECTORY_LIST_OPERATION,
@@ -22,7 +22,7 @@ import {
22
22
  WorkbenchInsightsSchema,
23
23
  WorkbenchQueueMutationResultSchema,
24
24
  WorkbenchQueueSnapshotSchema
25
- } from "./chunk-GNQC2IS2.js";
25
+ } from "./chunk-E3XCZWRK.js";
26
26
 
27
27
  // src/operation-diagnostics.ts
28
28
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  IdSchema
3
- } from "./chunk-GNQC2IS2.js";
3
+ } from "./chunk-E3XCZWRK.js";
4
4
 
5
5
  // src/data-directory.ts
6
6
  import { randomUUID } from "node:crypto";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  AgentSessionRenameError,
3
3
  validateSessionName
4
- } from "./chunk-6GVMVE5N.js";
4
+ } from "./chunk-BM6T2DLH.js";
5
5
  import {
6
6
  ConversationItemSchema,
7
7
  GroupChatInfoSchema,
8
8
  GroupChatParticipantSchema,
9
9
  SESSION_TIMELINE_PAGE_SIZE,
10
10
  SessionSummarySchema
11
- } from "./chunk-GNQC2IS2.js";
11
+ } from "./chunk-E3XCZWRK.js";
12
12
 
13
13
  // src/group-chat.ts
14
14
  import { createHash, randomUUID } from "node:crypto";
@@ -18,24 +18,24 @@ import {
18
18
  recordTimelineSyncDiagnostic,
19
19
  resolveGitProjectIdentity,
20
20
  sanitizeGitRemoteUrl
21
- } from "./chunk-UIM3KQRC.js";
21
+ } from "./chunk-QGPX4UDW.js";
22
22
  import {
23
23
  assertMainSessionId,
24
24
  isResearchSessionId
25
- } from "./chunk-SREMK7S4.js";
25
+ } from "./chunk-45FBONW3.js";
26
26
  import {
27
27
  GroupChatError,
28
28
  GroupChatMessageSchema,
29
29
  GroupChatRuntime
30
- } from "./chunk-YSJRQ35E.js";
30
+ } from "./chunk-VCNYBWYE.js";
31
31
  import {
32
32
  isContentfulAssistant
33
- } from "./chunk-34DUD2Y4.js";
33
+ } from "./chunk-N4MN54CD.js";
34
34
  import {
35
35
  AgentSessionRenameError,
36
36
  SessionOperationError,
37
37
  validateSessionName
38
- } from "./chunk-6GVMVE5N.js";
38
+ } from "./chunk-BM6T2DLH.js";
39
39
  import {
40
40
  ConversationItemSchema,
41
41
  CopilotModelOptionSchema,
@@ -55,7 +55,7 @@ import {
55
55
  WorkbenchScheduleEntrySchema,
56
56
  WorkbenchScheduleProposalSchema,
57
57
  WorkbenchScheduleSnapshotSchema
58
- } from "./chunk-GNQC2IS2.js";
58
+ } from "./chunk-E3XCZWRK.js";
59
59
 
60
60
  // src/copilot-adapter.ts
61
61
  import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  AgentSelectionSchema,
3
3
  assertSelectionSnapshotFits
4
- } from "./chunk-6YF3VZLR.js";
4
+ } from "./chunk-KPRPUIXR.js";
5
5
  import {
6
6
  isResearchSessionId
7
- } from "./chunk-SREMK7S4.js";
7
+ } from "./chunk-45FBONW3.js";
8
8
  import {
9
9
  GroupChatError
10
- } from "./chunk-YSJRQ35E.js";
10
+ } from "./chunk-VCNYBWYE.js";
11
11
  import {
12
12
  AgentModelListingError,
13
13
  AgentSessionRenameError,
@@ -15,11 +15,11 @@ import {
15
15
  UnsupportedAgentOperationError,
16
16
  captureWorkbenchAccess,
17
17
  validateSessionName
18
- } from "./chunk-6GVMVE5N.js";
18
+ } from "./chunk-BM6T2DLH.js";
19
19
  import {
20
20
  InteractionResponseSchema,
21
21
  SessionSummarySchema
22
- } from "./chunk-GNQC2IS2.js";
22
+ } from "./chunk-E3XCZWRK.js";
23
23
 
24
24
  // src/managed-agent-adapter.ts
25
25
  import { createHash, randomUUID } from "node:crypto";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  latestPreviewItems
3
- } from "./chunk-34DUD2Y4.js";
3
+ } from "./chunk-N4MN54CD.js";
4
4
  import {
5
5
  AgentSessionRenameError,
6
6
  UnsupportedAgentOperationError,
7
7
  validateSessionName
8
- } from "./chunk-6GVMVE5N.js";
8
+ } from "./chunk-BM6T2DLH.js";
9
9
  import {
10
10
  InteractionRequestSchema,
11
11
  REASONING_EFFORTS,
12
12
  SESSION_TIMELINE_PAGE_SIZE
13
- } from "./chunk-GNQC2IS2.js";
13
+ } from "./chunk-E3XCZWRK.js";
14
14
 
15
15
  // src/pi-adapter.ts
16
16
  import { createHash as createHash2, randomUUID } from "node:crypto";
package/dist/index.d.ts CHANGED
@@ -444,6 +444,18 @@ declare const SessionGitProjectSchema: z.ZodObject<{
444
444
  }, z.core.$strict>;
445
445
  type SessionGitProject = z.infer<typeof SessionGitProjectSchema>;
446
446
 
447
+ declare const SessionImageCommitResultSchema: z.ZodObject<{
448
+ imageId: z.ZodUUID;
449
+ machineId: z.ZodString;
450
+ sessionId: z.ZodString;
451
+ sizeBytes: z.ZodNumber;
452
+ width: z.ZodNumber;
453
+ height: z.ZodNumber;
454
+ sha256: z.ZodString;
455
+ expiresAt: z.ZodNumber;
456
+ }, z.core.$strict>;
457
+ type SessionImageCommitResult = z.infer<typeof SessionImageCommitResultSchema>;
458
+
447
459
  declare const SessionSummarySchema: z.ZodObject<{
448
460
  userId: z.ZodString;
449
461
  sessionId: z.ZodString;
@@ -1737,6 +1749,12 @@ interface AgentSelectionProvider {
1737
1749
  }
1738
1750
  declare function supportsAgentSelection(adapter: CodingAgentAdapter): adapter is CodingAgentAdapter & AgentSelectionProvider;
1739
1751
 
1752
+ declare const SessionImagesConfigSchema: z.ZodObject<{
1753
+ allowUnencryptedStorage: z.ZodLiteral<true>;
1754
+ storageAccount: z.ZodString;
1755
+ storageContainer: z.ZodString;
1756
+ }, z.core.$strict>;
1757
+ declare const SessionImageRelayUrlSchema: z.ZodPipe<z.ZodURL, z.ZodTransform<string, string>>;
1740
1758
  type CodingAgentConfig = {
1741
1759
  kind: "managed";
1742
1760
  initialSelection?: AgentSelection;
@@ -1771,6 +1789,8 @@ interface PcAgentConfig {
1771
1789
  timelineCompressionEnabled?: boolean;
1772
1790
  timelineIncrementalEnabled?: boolean;
1773
1791
  secureMessagePacketBudget?: number;
1792
+ /** Explicit consent: image bytes are readable by Relay and Azure storage, not end-to-end encrypted. */
1793
+ sessionImages?: z.infer<typeof SessionImagesConfigSchema>;
1774
1794
  }
1775
1795
 
1776
1796
  /** Owns a data directory without opening an IPC or HTTP listener. */
@@ -1951,6 +1971,34 @@ interface Agent {
1951
1971
  /** Initializes owned state only. The caller explicitly starts and stops the runtime. */
1952
1972
  declare function initialize(options: InitializeOptions): Promise<Agent>;
1953
1973
 
1974
+ declare const UploaderConfigSchema: z.ZodObject<{
1975
+ relayUrl: z.ZodPipe<z.ZodURL, z.ZodTransform<string, string>>;
1976
+ relayToken: z.ZodString;
1977
+ userId: z.ZodString;
1978
+ machineId: z.ZodString;
1979
+ storageAccount: z.ZodString;
1980
+ storageContainer: z.ZodString;
1981
+ }, z.core.$strip>;
1982
+ type SessionImageUploaderConfig = z.input<typeof UploaderConfigSchema>;
1983
+ type Stage = "config" | "source" | "reserve" | "put" | "complete";
1984
+ type SessionImageUploadErrorCode = "IMAGE_CONFIG_INVALID" | "IMAGE_CONTENT_INVALID" | "IMAGE_CAPACITY_EXCEEDED" | "IMAGE_UPLOADER_CLOSED" | "IMAGE_ABORTED" | "IMAGE_TIMEOUT" | "IMAGE_NETWORK_ERROR" | "IMAGE_HTTP_ERROR" | "IMAGE_RESPONSE_INVALID" | "IMAGE_RESPONSE_TOO_LARGE" | "IMAGE_UPLOAD_TARGET_INVALID" | "IMAGE_UPLOAD_EXPIRED" | "IMAGE_COMMIT_MISMATCH" | "IMAGE_COMPLETION_FAILED" | "IMAGE_ACCESS_REVOKED";
1985
+ /** Safe to log: never retains a response body, URL, token, or raw transport/schema error. */
1986
+ declare class SessionImageUploadError extends Error {
1987
+ readonly code: SessionImageUploadErrorCode;
1988
+ readonly stage: Stage;
1989
+ readonly status?: number | undefined;
1990
+ constructor(code: SessionImageUploadErrorCode, stage: Stage, status?: number | undefined, cause?: unknown);
1991
+ }
1992
+ /** Uploads already-derived WebP bytes only. Consent and session authorization belong to the caller. */
1993
+ declare class SessionImageUploader {
1994
+ #private;
1995
+ constructor(config: SessionImageUploaderConfig, dependencies?: {
1996
+ fetch?: typeof fetch;
1997
+ });
1998
+ close(): void;
1999
+ upload(sessionId: string, source: Buffer, signal?: AbortSignal, assertCurrent?: () => void): Promise<SessionImageCommitResult>;
2000
+ }
2001
+
1954
2002
  declare function assertPiRuntimeSupported(nodeVersion?: string): void;
1955
2003
  declare function createCodingAgentAdapter(config: Pick<PcAgentConfig, "codingAgent" | "dataDirectory" | "groupChatEnabled" | "peerChatEnabled">, onDiagnostic?: (message: string) => void, owner?: Pick<AgentSessionCreateOptions, "userId" | "machineId">): Promise<CodingAgentAdapter>;
1956
2004
 
@@ -1960,5 +2008,5 @@ interface CodingAgentPresentation {
1960
2008
  }
1961
2009
  declare function codingAgentPresentation(agentId: string): CodingAgentPresentation;
1962
2010
 
1963
- export { AgentSelectionSchema, CachedPairingProvider, ContentCipher, DataDirectoryLease, DeviceIdentitySchema, PEER_CHAT_TIMEOUT_MS, PeerChatRequestSchema, PeerChatResultSchema, assertPiRuntimeSupported, buildPairingUri, codingAgentPresentation, createCodingAgentAdapter, createPersistentContentCipher, generateContentKey, initialize, loadOrCreateContentKey, parseContentKey, requestPairingUri, supportsAgentSelection };
1964
- export type { Agent, AgentSelection, AgentSelectionProvider, AgentSessionConfiguration, AgentSessionConfigureOptions, AgentSessionCreateOptions, CodingAgentAdapter, CodingAgentConfig, CodingAgentId, CodingAgentSessionCallbacks, ContentKeyMaterial, DeviceIdentity, InitializeOptions, PairingProvider, PairingTicket, PcAgentConfig, PeerChatRequest, PeerChatResult, RelayRegistrationStatus, RelaySocket, RelaySocketFactory, SelectableAgent };
2011
+ export { AgentSelectionSchema, CachedPairingProvider, ContentCipher, DataDirectoryLease, DeviceIdentitySchema, PEER_CHAT_TIMEOUT_MS, PeerChatRequestSchema, PeerChatResultSchema, SessionImageRelayUrlSchema, SessionImageUploadError, SessionImageUploader, SessionImagesConfigSchema, assertPiRuntimeSupported, buildPairingUri, codingAgentPresentation, createCodingAgentAdapter, createPersistentContentCipher, generateContentKey, initialize, loadOrCreateContentKey, parseContentKey, requestPairingUri, supportsAgentSelection };
2012
+ export type { Agent, AgentSelection, AgentSelectionProvider, AgentSessionConfiguration, AgentSessionConfigureOptions, AgentSessionCreateOptions, CodingAgentAdapter, CodingAgentConfig, CodingAgentId, CodingAgentSessionCallbacks, ContentKeyMaterial, DeviceIdentity, InitializeOptions, PairingProvider, PairingTicket, PcAgentConfig, PeerChatRequest, PeerChatResult, RelayRegistrationStatus, RelaySocket, RelaySocketFactory, SelectableAgent, SessionImageUploadErrorCode, SessionImageUploaderConfig };