@agentknight/sdk 0.9.38 → 0.9.40
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/LICENSE +201 -201
- package/dist/chunks/{acp-adapter-DZ3EE36H.js → acp-adapter-TVAW7EHK.js} +3 -3
- package/dist/chunks/{chunk-6YF3VZLR.js → chunk-6RWWNR37.js} +1 -1
- package/dist/chunks/{chunk-6GVMVE5N.js → chunk-AJ4YL22H.js} +4 -1
- package/dist/chunks/{chunk-4FC2WG64.js → chunk-CVWUKZX7.js} +1 -1
- package/dist/chunks/{chunk-34DUD2Y4.js → chunk-D6HWUCVM.js} +5 -4
- package/dist/chunks/{chunk-GNQC2IS2.js → chunk-OV77TRIH.js} +352 -236
- package/dist/chunks/{chunk-YSJRQ35E.js → chunk-Q3TQPONK.js} +2 -2
- package/dist/chunks/{chunk-SREMK7S4.js → chunk-SDAEMVSD.js} +1 -1
- package/dist/chunks/{chunk-UIM3KQRC.js → chunk-ULJMR33R.js} +10 -8
- package/dist/chunks/{copilot-adapter-USX4UEWH.js → copilot-adapter-KH6NXHGK.js} +141 -62
- package/dist/chunks/{managed-agent-adapter-EMBDKITT.js → managed-agent-adapter-F7U26CH2.js} +21 -6
- package/dist/chunks/{pi-adapter-KT5M7Z6R.js → pi-adapter-G4GQ5ULV.js} +3 -3
- package/dist/index.d.ts +82 -9
- package/dist/index.js +1103 -356
- package/dist/runtime.js +2 -2
- package/package.json +1 -1
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;
|
|
@@ -578,6 +590,18 @@ declare const SessionRemoteStatusSchema: z.ZodObject<{
|
|
|
578
590
|
}, z.core.$strip>;
|
|
579
591
|
type SessionRemoteStatus = z.infer<typeof SessionRemoteStatusSchema>;
|
|
580
592
|
|
|
593
|
+
declare const SessionAvatarPersonaSchema: z.ZodObject<{
|
|
594
|
+
role: z.ZodEnum<{
|
|
595
|
+
default: "default";
|
|
596
|
+
designer: "designer";
|
|
597
|
+
filmmaker: "filmmaker";
|
|
598
|
+
developer: "developer";
|
|
599
|
+
secretary: "secretary";
|
|
600
|
+
}>;
|
|
601
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
602
|
+
}, z.core.$strict>;
|
|
603
|
+
type SessionAvatarPersona = z.infer<typeof SessionAvatarPersonaSchema>;
|
|
604
|
+
|
|
581
605
|
declare const InteractionRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
582
606
|
kind: z.ZodLiteral<"permission">;
|
|
583
607
|
permissionKind: z.ZodString;
|
|
@@ -1190,6 +1214,10 @@ declare const SessionTimelinePageSchema: z.ZodObject<{
|
|
|
1190
1214
|
sha256: z.ZodOptional<z.ZodString>;
|
|
1191
1215
|
imageRef: z.ZodOptional<z.ZodLiteral<"sha256">>;
|
|
1192
1216
|
}, z.core.$strict>>;
|
|
1217
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
1218
|
+
"assistant-message": "assistant-message";
|
|
1219
|
+
"task-completion": "task-completion";
|
|
1220
|
+
}>>;
|
|
1193
1221
|
}, z.core.$strip>>;
|
|
1194
1222
|
userPreview: z.ZodOptional<z.ZodObject<{
|
|
1195
1223
|
id: z.ZodString;
|
|
@@ -1591,6 +1619,20 @@ type AgentModelOption = CopilotModelOption;
|
|
|
1591
1619
|
type AgentPermissionRequest = Readonly<{
|
|
1592
1620
|
kind: string;
|
|
1593
1621
|
}>;
|
|
1622
|
+
declare class TimelinePageBudgetError extends Error {
|
|
1623
|
+
}
|
|
1624
|
+
interface TimelineImageProjection {
|
|
1625
|
+
readonly sessionId: string;
|
|
1626
|
+
readonly referenceItem: (sessionId: string, item: ConversationItem) => ConversationItem;
|
|
1627
|
+
}
|
|
1628
|
+
interface TimelineReadOptions {
|
|
1629
|
+
cursor?: string;
|
|
1630
|
+
pageSize?: number;
|
|
1631
|
+
metadataOnly?: boolean;
|
|
1632
|
+
assistantPreview?: boolean;
|
|
1633
|
+
readOnly?: boolean;
|
|
1634
|
+
imageProjection?: TimelineImageProjection;
|
|
1635
|
+
}
|
|
1594
1636
|
interface AgentSessionConfiguration {
|
|
1595
1637
|
modelId?: string;
|
|
1596
1638
|
agentMode: SessionAgentMode;
|
|
@@ -1687,16 +1729,11 @@ interface CodingAgentAdapter {
|
|
|
1687
1729
|
configureSession(sessionId: string, options: AgentSessionConfigureOptions): Promise<AgentSessionConfiguration>;
|
|
1688
1730
|
getSessionRemoteStatus(sessionId: string): Promise<SessionRemoteStatus>;
|
|
1689
1731
|
setSessionRemote(sessionId: string, enabled: boolean): Promise<SessionRemoteStatus>;
|
|
1690
|
-
readSessionTimelinePage(sessionId: string, options?:
|
|
1691
|
-
cursor?: string;
|
|
1692
|
-
pageSize?: number;
|
|
1693
|
-
metadataOnly?: boolean;
|
|
1694
|
-
assistantPreview?: boolean;
|
|
1695
|
-
}): Promise<SessionTimelinePage>;
|
|
1732
|
+
readSessionTimelinePage(sessionId: string, options?: TimelineReadOptions): Promise<SessionTimelinePage>;
|
|
1696
1733
|
readSessionPlan?(sessionId: string): Promise<ConversationItem>;
|
|
1697
1734
|
watchSession(sessionId: string, watched: boolean): Promise<void>;
|
|
1698
1735
|
setSessionCallbacks(callbacks: CodingAgentSessionCallbacks): void;
|
|
1699
|
-
sendPrompt(sessionId: string, prompt: string, mode: "enqueue" | "immediate", attachments?: readonly PromptImageAttachment[], persistInteractions?: boolean, fileAttachments?: readonly PromptFileAttachment[], operationId?: string): Promise<{
|
|
1736
|
+
sendPrompt(sessionId: string, prompt: string, mode: "enqueue" | "immediate", attachments?: readonly PromptImageAttachment[], persistInteractions?: boolean, fileAttachments?: readonly PromptFileAttachment[], operationId?: string, avatarPersona?: SessionAvatarPersona): Promise<{
|
|
1700
1737
|
messageId: string;
|
|
1701
1738
|
deliveryState: "queued" | "processing";
|
|
1702
1739
|
submittedAt?: string;
|
|
@@ -1737,6 +1774,12 @@ interface AgentSelectionProvider {
|
|
|
1737
1774
|
}
|
|
1738
1775
|
declare function supportsAgentSelection(adapter: CodingAgentAdapter): adapter is CodingAgentAdapter & AgentSelectionProvider;
|
|
1739
1776
|
|
|
1777
|
+
declare const SessionImagesConfigSchema: z.ZodObject<{
|
|
1778
|
+
allowUnencryptedStorage: z.ZodLiteral<true>;
|
|
1779
|
+
storageAccount: z.ZodString;
|
|
1780
|
+
storageContainer: z.ZodString;
|
|
1781
|
+
}, z.core.$strict>;
|
|
1782
|
+
declare const SessionImageRelayUrlSchema: z.ZodPipe<z.ZodURL, z.ZodTransform<string, string>>;
|
|
1740
1783
|
type CodingAgentConfig = {
|
|
1741
1784
|
kind: "managed";
|
|
1742
1785
|
initialSelection?: AgentSelection;
|
|
@@ -1771,6 +1814,8 @@ interface PcAgentConfig {
|
|
|
1771
1814
|
timelineCompressionEnabled?: boolean;
|
|
1772
1815
|
timelineIncrementalEnabled?: boolean;
|
|
1773
1816
|
secureMessagePacketBudget?: number;
|
|
1817
|
+
/** Explicit consent: image bytes are readable by Relay and Azure storage, not end-to-end encrypted. */
|
|
1818
|
+
sessionImages?: z.infer<typeof SessionImagesConfigSchema>;
|
|
1774
1819
|
}
|
|
1775
1820
|
|
|
1776
1821
|
/** Owns a data directory without opening an IPC or HTTP listener. */
|
|
@@ -1951,6 +1996,34 @@ interface Agent {
|
|
|
1951
1996
|
/** Initializes owned state only. The caller explicitly starts and stops the runtime. */
|
|
1952
1997
|
declare function initialize(options: InitializeOptions): Promise<Agent>;
|
|
1953
1998
|
|
|
1999
|
+
declare const UploaderConfigSchema: z.ZodObject<{
|
|
2000
|
+
relayUrl: z.ZodPipe<z.ZodURL, z.ZodTransform<string, string>>;
|
|
2001
|
+
relayToken: z.ZodString;
|
|
2002
|
+
userId: z.ZodString;
|
|
2003
|
+
machineId: z.ZodString;
|
|
2004
|
+
storageAccount: z.ZodString;
|
|
2005
|
+
storageContainer: z.ZodString;
|
|
2006
|
+
}, z.core.$strip>;
|
|
2007
|
+
type SessionImageUploaderConfig = z.input<typeof UploaderConfigSchema>;
|
|
2008
|
+
type Stage = "config" | "source" | "reserve" | "put" | "complete";
|
|
2009
|
+
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";
|
|
2010
|
+
/** Safe to log: never retains a response body, URL, token, or raw transport/schema error. */
|
|
2011
|
+
declare class SessionImageUploadError extends Error {
|
|
2012
|
+
readonly code: SessionImageUploadErrorCode;
|
|
2013
|
+
readonly stage: Stage;
|
|
2014
|
+
readonly status?: number | undefined;
|
|
2015
|
+
constructor(code: SessionImageUploadErrorCode, stage: Stage, status?: number | undefined, cause?: unknown);
|
|
2016
|
+
}
|
|
2017
|
+
/** Uploads already-derived WebP bytes only. Consent and session authorization belong to the caller. */
|
|
2018
|
+
declare class SessionImageUploader {
|
|
2019
|
+
#private;
|
|
2020
|
+
constructor(config: SessionImageUploaderConfig, dependencies?: {
|
|
2021
|
+
fetch?: typeof fetch;
|
|
2022
|
+
});
|
|
2023
|
+
close(): void;
|
|
2024
|
+
upload(sessionId: string, source: Buffer, signal?: AbortSignal, assertCurrent?: () => void): Promise<SessionImageCommitResult>;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
1954
2027
|
declare function assertPiRuntimeSupported(nodeVersion?: string): void;
|
|
1955
2028
|
declare function createCodingAgentAdapter(config: Pick<PcAgentConfig, "codingAgent" | "dataDirectory" | "groupChatEnabled" | "peerChatEnabled">, onDiagnostic?: (message: string) => void, owner?: Pick<AgentSessionCreateOptions, "userId" | "machineId">): Promise<CodingAgentAdapter>;
|
|
1956
2029
|
|
|
@@ -1960,5 +2033,5 @@ interface CodingAgentPresentation {
|
|
|
1960
2033
|
}
|
|
1961
2034
|
declare function codingAgentPresentation(agentId: string): CodingAgentPresentation;
|
|
1962
2035
|
|
|
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 };
|
|
2036
|
+
export { AgentSelectionSchema, CachedPairingProvider, ContentCipher, DataDirectoryLease, DeviceIdentitySchema, PEER_CHAT_TIMEOUT_MS, PeerChatRequestSchema, PeerChatResultSchema, SessionImageRelayUrlSchema, SessionImageUploadError, SessionImageUploader, SessionImagesConfigSchema, TimelinePageBudgetError, assertPiRuntimeSupported, buildPairingUri, codingAgentPresentation, createCodingAgentAdapter, createPersistentContentCipher, generateContentKey, initialize, loadOrCreateContentKey, parseContentKey, requestPairingUri, supportsAgentSelection };
|
|
2037
|
+
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, TimelineImageProjection, TimelineReadOptions };
|