@agentknight/sdk 0.9.57 → 0.9.61

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 (23) hide show
  1. package/dist/chunks/{acp-adapter-WYDK3PLS.js → acp-adapter-MBYKOCA2.js} +4 -4
  2. package/dist/chunks/{chunk-OOCAIULD.js → chunk-3AMFPDE5.js} +435 -21
  3. package/dist/chunks/{chunk-3LEPYV7Y.js → chunk-7CNBPLNE.js} +2 -2
  4. package/dist/chunks/{chunk-7ZYBES47.js → chunk-7OGTK7KB.js} +1 -1
  5. package/dist/chunks/{chunk-WPVH7HKC.js → chunk-A4YCCQ3I.js} +1 -1
  6. package/dist/chunks/{chunk-EDZPP6SJ.js → chunk-ALUQLM54.js} +2 -3
  7. package/dist/chunks/{chunk-USI66MEF.js → chunk-CHKNC6PD.js} +3 -2
  8. package/dist/chunks/{chunk-ZLKFFKAX.js → chunk-CM5LVXVL.js} +4 -3
  9. package/dist/chunks/{chunk-IPJWNGNK.js → chunk-H4SHMWQ6.js} +1 -1
  10. package/dist/chunks/{chunk-KBI5IWPR.js → chunk-P2PH5KMV.js} +842 -557
  11. package/dist/chunks/{chunk-DAKDVZ7X.js → chunk-SIFCCGXF.js} +7 -5
  12. package/dist/chunks/{chunk-LT5ULDVT.js → chunk-ZNQ2I5EF.js} +1 -1
  13. package/dist/chunks/{claude-adapter-GCH36EZ6.js → claude-adapter-D3JWXMNX.js} +209 -59
  14. package/dist/chunks/{codex-adapter-CXD4SVCE.js → codex-adapter-655KHW7H.js} +4 -4
  15. package/dist/chunks/{copilot-adapter-SYFGOAGE.js → copilot-adapter-EZUXHBE3.js} +155 -25
  16. package/dist/chunks/{managed-agent-adapter-ODCNYYO6.js → managed-agent-adapter-BOJNEJ75.js} +25 -7
  17. package/dist/chunks/{pi-adapter-XLY46UDL.js → pi-adapter-LAD5GOCP.js} +4 -4
  18. package/dist/configuration.js +4 -4
  19. package/dist/index.d.ts +142 -1
  20. package/dist/index.js +1487 -578
  21. package/dist/runtime.js +2 -2
  22. package/dist/session-analytics-worker.js +162 -51
  23. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -449,6 +449,7 @@ declare const A2aRelayRequestSchema: z.ZodObject<{
449
449
  endpointUrl: z.ZodURL;
450
450
  kind: z.ZodEnum<{
451
451
  card: "card";
452
+ encrypted: "encrypted";
452
453
  rpc: "rpc";
453
454
  }>;
454
455
  body: z.ZodString;
@@ -458,6 +459,7 @@ type A2aRelayRequest = z.infer<typeof A2aRelayRequestSchema>;
458
459
  declare const A2aRelayResponseSchema: z.ZodObject<{
459
460
  status: z.ZodNumber;
460
461
  body: z.ZodString;
462
+ encrypted: z.ZodOptional<z.ZodLiteral<true>>;
461
463
  }, z.core.$strict>;
462
464
  type A2aRelayResponse = z.infer<typeof A2aRelayResponseSchema>;
463
465
 
@@ -482,6 +484,14 @@ interface V2ServerToClientEvents {
482
484
  "protocol.error": (payload: ProtocolError) => void;
483
485
  }
484
486
 
487
+ declare const EncryptedGroupCreateSchema: z.ZodObject<{
488
+ groupId: z.ZodUUID;
489
+ peerMachineId: z.ZodString;
490
+ peerSessionId: z.ZodString;
491
+ peerTitle: z.ZodString;
492
+ }, z.core.$strict>;
493
+ type EncryptedGroupCreate = z.infer<typeof EncryptedGroupCreateSchema>;
494
+
485
495
  declare const SessionGitProjectSchema: z.ZodObject<{
486
496
  localRepositoryKey: z.ZodString;
487
497
  worktreeRoot: z.ZodString;
@@ -561,6 +571,11 @@ declare const AgentConfigurationChangeSchema: z.ZodObject<{
561
571
  value: z.ZodString;
562
572
  }, z.core.$strict>;
563
573
  type AgentConfigurationChange = z.infer<typeof AgentConfigurationChangeSchema>;
574
+ declare const SessionContextTierSchema: z.ZodEnum<{
575
+ default: "default";
576
+ long_context: "long_context";
577
+ }>;
578
+ type SessionContextTier = z.infer<typeof SessionContextTierSchema>;
564
579
  declare const CopilotModelOptionSchema: z.ZodObject<{
565
580
  id: z.ZodString;
566
581
  name: z.ZodString;
@@ -579,6 +594,13 @@ declare const CopilotModelOptionSchema: z.ZodObject<{
579
594
  medium: "medium";
580
595
  xhigh: "xhigh";
581
596
  }>>;
597
+ contextTiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
598
+ id: z.ZodEnum<{
599
+ default: "default";
600
+ long_context: "long_context";
601
+ }>;
602
+ maxPromptTokens: z.ZodOptional<z.ZodNumber>;
603
+ }, z.core.$strict>>>;
582
604
  creation: z.ZodOptional<z.ZodObject<{
583
605
  agentId: z.ZodString;
584
606
  agentName: z.ZodString;
@@ -1431,9 +1453,78 @@ declare const WorkbenchInsightsSchema: z.ZodObject<{
1431
1453
  systemTokens: z.ZodOptional<z.ZodNumber>;
1432
1454
  conversationTokens: z.ZodOptional<z.ZodNumber>;
1433
1455
  toolTokens: z.ZodOptional<z.ZodNumber>;
1456
+ displayLimit: z.ZodOptional<z.ZodNumber>;
1457
+ compactionThreshold: z.ZodOptional<z.ZodNumber>;
1434
1458
  }, z.core.$strict>>;
1435
1459
  canCompact: z.ZodBoolean;
1436
1460
  compactUnavailableReason: z.ZodOptional<z.ZodString>;
1461
+ composition: z.ZodOptional<z.ZodArray<z.ZodObject<{
1462
+ kind: z.ZodString;
1463
+ count: z.ZodNumber;
1464
+ }, z.core.$strict>>>;
1465
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
1466
+ id: z.ZodString;
1467
+ kind: z.ZodString;
1468
+ label: z.ZodString;
1469
+ tokens: z.ZodNumber;
1470
+ parentId: z.ZodOptional<z.ZodString>;
1471
+ }, z.core.$strict>>>;
1472
+ sourcesTruncated: z.ZodOptional<z.ZodBoolean>;
1473
+ heaviestMessages: z.ZodOptional<z.ZodArray<z.ZodObject<{
1474
+ id: z.ZodString;
1475
+ kind: z.ZodString;
1476
+ label: z.ZodString;
1477
+ tokens: z.ZodNumber;
1478
+ parentId: z.ZodOptional<z.ZodString>;
1479
+ }, z.core.$strict>>>;
1480
+ compactionCount: z.ZodOptional<z.ZodNumber>;
1481
+ telemetry: z.ZodOptional<z.ZodObject<{
1482
+ since: z.ZodISODateTime;
1483
+ observedSince: z.ZodISODateTime;
1484
+ dropped: z.ZodNumber;
1485
+ gapSince: z.ZodOptional<z.ZodISODateTime>;
1486
+ truncated: z.ZodBoolean;
1487
+ samples: z.ZodArray<z.ZodObject<{
1488
+ id: z.ZodString;
1489
+ timestamp: z.ZodISODateTime;
1490
+ tokens: z.ZodNumber;
1491
+ limit: z.ZodNumber;
1492
+ messages: z.ZodNumber;
1493
+ }, z.core.$strict>>;
1494
+ compactions: z.ZodArray<z.ZodObject<{
1495
+ id: z.ZodString;
1496
+ timestamp: z.ZodISODateTime;
1497
+ success: z.ZodBoolean;
1498
+ before: z.ZodOptional<z.ZodNumber>;
1499
+ after: z.ZodOptional<z.ZodNumber>;
1500
+ removed: z.ZodOptional<z.ZodNumber>;
1501
+ messagesRemoved: z.ZodOptional<z.ZodNumber>;
1502
+ trigger: z.ZodOptional<z.ZodString>;
1503
+ basis: z.ZodOptional<z.ZodString>;
1504
+ durationMs: z.ZodOptional<z.ZodNumber>;
1505
+ inputTokens: z.ZodOptional<z.ZodNumber>;
1506
+ outputTokens: z.ZodOptional<z.ZodNumber>;
1507
+ }, z.core.$strict>>;
1508
+ calls: z.ZodArray<z.ZodObject<{
1509
+ id: z.ZodString;
1510
+ timestamp: z.ZodISODateTime;
1511
+ model: z.ZodString;
1512
+ agentId: z.ZodOptional<z.ZodString>;
1513
+ input: z.ZodOptional<z.ZodNumber>;
1514
+ output: z.ZodOptional<z.ZodNumber>;
1515
+ cache: z.ZodOptional<z.ZodNumber>;
1516
+ requestBytes: z.ZodOptional<z.ZodNumber>;
1517
+ wireBytes: z.ZodOptional<z.ZodNumber>;
1518
+ durationMs: z.ZodOptional<z.ZodNumber>;
1519
+ firstOutputMs: z.ZodOptional<z.ZodNumber>;
1520
+ }, z.core.$strict>>;
1521
+ }, z.core.$strict>>;
1522
+ storage: z.ZodOptional<z.ZodObject<{
1523
+ bytes: z.ZodNumber;
1524
+ files: z.ZodNumber;
1525
+ sampledAt: z.ZodISODateTime;
1526
+ partial: z.ZodBoolean;
1527
+ }, z.core.$strict>>;
1437
1528
  }, z.core.$strict>;
1438
1529
  type WorkbenchInsights = z.infer<typeof WorkbenchInsightsSchema>;
1439
1530
  declare const WorkbenchCompactResultSchema: z.ZodObject<{
@@ -1442,6 +1533,44 @@ declare const WorkbenchCompactResultSchema: z.ZodObject<{
1442
1533
  messagesRemoved: z.ZodNumber;
1443
1534
  }, z.core.$strict>;
1444
1535
  type WorkbenchCompactResult = z.infer<typeof WorkbenchCompactResultSchema>;
1536
+ declare const WorkbenchReasoningRequestSchema: z.ZodObject<{
1537
+ cursor: z.ZodOptional<z.ZodString>;
1538
+ }, z.core.$strict>;
1539
+ declare const WorkbenchReasoningPageSchema: z.ZodObject<{
1540
+ blocks: z.ZodArray<z.ZodObject<{
1541
+ id: z.ZodString;
1542
+ timestamp: z.ZodISODateTime;
1543
+ agentId: z.ZodOptional<z.ZodString>;
1544
+ content: z.ZodString;
1545
+ truncated: z.ZodBoolean;
1546
+ }, z.core.$strict>>;
1547
+ cursor: z.ZodString;
1548
+ hasMore: z.ZodBoolean;
1549
+ nodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1550
+ id: z.ZodString;
1551
+ timestamp: z.ZodISODateTime;
1552
+ agentId: z.ZodOptional<z.ZodString>;
1553
+ content: z.ZodString;
1554
+ truncated: z.ZodBoolean;
1555
+ kind: z.ZodEnum<{
1556
+ compaction: "compaction";
1557
+ plan: "plan";
1558
+ rationale: "rationale";
1559
+ response: "response";
1560
+ subagent: "subagent";
1561
+ tool: "tool";
1562
+ }>;
1563
+ title: z.ZodString;
1564
+ status: z.ZodEnum<{
1565
+ completed: "completed";
1566
+ failed: "failed";
1567
+ recorded: "recorded";
1568
+ started: "started";
1569
+ }>;
1570
+ }, z.core.$strict>>>;
1571
+ }, z.core.$strict>;
1572
+ type WorkbenchReasoningRequest = z.infer<typeof WorkbenchReasoningRequestSchema>;
1573
+ type WorkbenchReasoningPage = z.infer<typeof WorkbenchReasoningPageSchema>;
1445
1574
 
1446
1575
  declare const SessionAnalyticsRequestSchema: z.ZodObject<{
1447
1576
  since: z.ZodISODateTime;
@@ -1709,6 +1838,7 @@ interface WorkbenchSchedules {
1709
1838
  }
1710
1839
 
1711
1840
  interface WorkbenchRuntime {
1841
+ reasoning?(sessionId: string, request: WorkbenchReasoningRequest): Promise<WorkbenchReasoningPage>;
1712
1842
  analytics?(sessionId: string, request: SessionAnalyticsRequest): Promise<SessionAnalyticsResult>;
1713
1843
  readonly schedules?: WorkbenchSchedules;
1714
1844
  ask(sessionId: string, question: string): Promise<WorkbenchAskResult>;
@@ -1744,6 +1874,7 @@ interface AgentSessionConfiguration {
1744
1874
  modelId?: string;
1745
1875
  agentMode: SessionAgentMode;
1746
1876
  reasoningEffort: CurrentReasoningEffort;
1877
+ contextTier?: SessionContextTier;
1747
1878
  configOptions?: AgentConfigurationOption[];
1748
1879
  }
1749
1880
  interface AgentSessionCreateOptions {
@@ -1758,6 +1889,7 @@ interface AgentSessionConfigureOptions {
1758
1889
  modelId?: string;
1759
1890
  agentMode?: SessionAgentMode;
1760
1891
  reasoningEffort?: SessionReasoningEffort;
1892
+ contextTier?: SessionContextTier;
1761
1893
  configOption?: AgentConfigurationChange;
1762
1894
  }
1763
1895
  interface PeerTurnOptions {
@@ -1802,6 +1934,7 @@ interface CodingAgentAdapter {
1802
1934
  readonly sdkVersion: string;
1803
1935
  readonly agentModes: readonly SessionAgentMode[];
1804
1936
  readonly supportsReasoningEffort: boolean;
1937
+ readonly supportsContextTier?: boolean;
1805
1938
  readonly supportsSessionListUpdates?: boolean;
1806
1939
  readonly supportsAssistantPreview?: boolean;
1807
1940
  readonly supportsSessionDelete?: boolean;
@@ -1815,12 +1948,14 @@ interface CodingAgentAdapter {
1815
1948
  listSessions(userId: string, machineId: string): Promise<SessionSummary[]>;
1816
1949
  getSessionDirectoryMetadata?(sessionId: string): Promise<{
1817
1950
  workingDirectory?: string;
1951
+ sessionStateDirectory?: string;
1818
1952
  } | undefined>;
1819
1953
  getSessionProjectIdentity?(sessionId: string): Promise<SessionGitProject | undefined>;
1820
1954
  listModels(sessionId?: string): Promise<AgentModelOption[]>;
1821
1955
  getSessionCapabilities?(sessionId?: string): {
1822
1956
  readonly agentModes: readonly SessionAgentMode[];
1823
1957
  readonly supportsReasoningEffort: boolean;
1958
+ readonly supportsContextTier?: boolean;
1824
1959
  readonly supportsFileAttachments?: boolean;
1825
1960
  readonly agentName?: string;
1826
1961
  readonly supportsPlanRead?: boolean;
@@ -1830,7 +1965,9 @@ interface CodingAgentAdapter {
1830
1965
  getSessionEnvironment(sessionId: string): Promise<SessionEnvironmentInfo>;
1831
1966
  createSession(options: AgentSessionCreateOptions): Promise<SessionSummary>;
1832
1967
  createGroupChat?(sourceSessionId: string, peerSessionId: string, requestId: string, assertAccess?: () => void): Promise<SessionSummary>;
1968
+ createEncryptedGroupChat?(sourceSessionId: string, request: EncryptedGroupCreate, assertAccess: () => void): Promise<SessionSummary>;
1833
1969
  runPeerTurn?(sessionId: string, prompt: string, options: PeerTurnOptions): Promise<string>;
1970
+ assertPeerSession?(sessionId: string): void;
1834
1971
  deleteSession?(sessionId: string): Promise<void>;
1835
1972
  renameSession?(sessionId: string, name: string, assertAccess?: () => void): Promise<string>;
1836
1973
  configureSession(sessionId: string, options: AgentSessionConfigureOptions): Promise<AgentSessionConfiguration>;
@@ -1904,6 +2041,7 @@ type CodingAgentConfig = {
1904
2041
  initialSelection?: AgentSelection;
1905
2042
  piDirectory?: string;
1906
2043
  codexCommand?: string;
2044
+ claudeCommand?: string;
1907
2045
  acp?: {
1908
2046
  command: string;
1909
2047
  args: string[];
@@ -1918,6 +2056,7 @@ type CodingAgentConfig = {
1918
2056
  command?: string;
1919
2057
  } | {
1920
2058
  kind: "claude";
2059
+ command?: string;
1921
2060
  } | {
1922
2061
  kind: "acp";
1923
2062
  command: string;
@@ -1976,13 +2115,14 @@ interface ContentCipherOptions {
1976
2115
  readonly randomBytes?: (size: number) => Buffer;
1977
2116
  readonly createMessageId?: () => string;
1978
2117
  readonly replayWindowMs?: number;
2118
+ readonly rejectReplayOverflow?: boolean;
1979
2119
  readonly processedMessages?: ReadonlyMap<string, number>;
1980
2120
  readonly persistProcessedMessages?: (processedMessages: ReadonlyMap<string, number>) => void;
1981
2121
  }
1982
2122
  declare function parseContentKey(encoded: string): ContentKeyMaterial;
1983
2123
  declare function generateContentKey(): ContentKeyMaterial;
1984
2124
  declare function loadOrCreateContentKey(dataDirectory: string): Promise<ContentKeyMaterial>;
1985
- declare function createPersistentContentCipher(dataDirectory: string, key: ContentKeyMaterial): Promise<ContentCipher>;
2125
+ declare function createPersistentContentCipher(dataDirectory: string, key: ContentKeyMaterial, options?: Pick<ContentCipherOptions, "rejectReplayOverflow">): Promise<ContentCipher>;
1986
2126
  declare class ContentCipher {
1987
2127
  #private;
1988
2128
  constructor(key: ContentKeyMaterial, options?: ContentCipherOptions);
@@ -2029,6 +2169,7 @@ declare const PeerChatRequestSchema: z.ZodObject<{
2029
2169
  targetMachineId: z.ZodString;
2030
2170
  targetSessionId: z.ZodString;
2031
2171
  prompt: z.ZodString;
2172
+ encryptedGroupId: z.ZodOptional<z.ZodUUID>;
2032
2173
  }, z.core.$strip>;
2033
2174
  type PeerChatRequest = z.infer<typeof PeerChatRequestSchema>;
2034
2175
  declare const PeerChatResultSchema: z.ZodObject<{