@nextclaw/kernel 0.10.3 → 0.12.0

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/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { ListMessagesOptions, ListSessionsOptions, NcpAgentConversationStateMana
5
5
  import { LocalAssetStore } from "@nextclaw/ncp-agent-runtime";
6
6
  import { AgentRunSendIngressPayload, AppEventEmitOptions, AppEventEnvelope, AppEventHandler, AppEventKey, Contribution as Contribution$1, Disposer, Disposer as Disposer$1, EventBus, EventBus as EventBus$1, EventBusOptions, InboxDelivery, InboxDeliveryContentType, InboxDeliveryListView, InboxDeliverySource, InboxDeliveryStateAction, Ingress, Ingress as Ingress$1, IngressContext, IngressEnvelope, IngressHandler, Key, RuntimeModelSelectionMode, SystemObjectReferenceGroupDescriptor, SystemObjectReferenceItem, SystemObjectReferenceListView, SystemObjectResolvedReference, TypedKey, Unsubscribe, Unsubscribe as Unsubscribe$1, createTypedKey, eventKeys, ingressKeys } from "@nextclaw/shared";
7
7
  import { AgentSessionRecord, ChatTarget, NcpReplyInput, RuntimeFactoryParams } from "@nextclaw/ncp-toolkit";
8
- import { AppInstallProgressHandler, AppNativeArtifactTarget, AppPlatformTargetService, AppRollbackResult, AppRuntimeIsolation, AppRuntimeProfile, AppStorageContext, AppStorageUsage, AppUninstallResult, AppUpdateResult } from "@nextclaw/app-runtime";
8
+ import { AppInstallProgressHandler, AppNativeArtifactTarget, AppPermissions, AppPlatformTargetService, AppRollbackResult, AppRuntimeIsolation, AppRuntimeProfile, AppStorageContext, AppStorageUsage, AppUninstallResult, AppUpdateResult } from "@nextclaw/app-runtime";
9
9
  import * as _$_nextclaw_mcp0 from "@nextclaw/mcp";
10
10
  import { McpCatalogFilter, McpCatalogFilter as McpCatalogFilter$1, McpRegistryService, McpServerRecord, McpServerRecord as McpServerRecord$1, McpToolCatalogEntry, McpToolCatalogEntry as McpToolCatalogEntry$1 } from "@nextclaw/mcp";
11
11
 
@@ -1116,6 +1116,7 @@ type AppPackageComponentSource = {
1116
1116
  storage: AppStorageContext;
1117
1117
  runtimeProfile: AppRuntimeProfile;
1118
1118
  isolation: AppRuntimeIsolation;
1119
+ permissions: AppPermissions;
1119
1120
  };
1120
1121
  type AppPackageUnavailableDiagnostic = {
1121
1122
  appId: string;
@@ -1212,10 +1213,12 @@ type AppPackageConflict = {
1212
1213
  componentKind: AppPackageComponentKind;
1213
1214
  conflictingSource: string;
1214
1215
  };
1216
+ type AppPackageUninstallRollback = () => Promise<void>;
1215
1217
  type AppPackageRuntimeHooks = {
1216
1218
  assertCanActivate: (sources: AppPackageComponentSource[]) => Promise<void>;
1219
+ afterActivate: (sources: AppPackageComponentSource[]) => Promise<void>;
1217
1220
  beforeDeactivate: (sources: AppPackageComponentSource[]) => Promise<void>;
1218
- beforeUninstall: (sources: AppPackageComponentSource[]) => Promise<void>;
1221
+ beforeUninstall: (sources: AppPackageComponentSource[]) => Promise<AppPackageUninstallRollback | void>;
1219
1222
  };
1220
1223
  type AppPackageErrorCode = "APP_PACKAGE_CONFLICT" | "APP_PACKAGE_INCOMPATIBLE" | "APP_PACKAGE_NOT_FOUND" | "APP_PACKAGE_OPERATION_FAILED";
1221
1224
  declare class AppPackageError extends Error {
@@ -1233,6 +1236,7 @@ declare class AppPackageManager {
1233
1236
  private readonly operationManager;
1234
1237
  private readonly platformTargetService;
1235
1238
  private readonly presentationService;
1239
+ private readonly runtimeActivationService;
1236
1240
  private readonly registryService;
1237
1241
  private runtimeHooks;
1238
1242
  private builtInBootstrapPromise;
@@ -1362,131 +1366,703 @@ declare class AppDataManager {
1362
1366
  private isMissingFileError;
1363
1367
  }
1364
1368
  //#endregion
1365
- //#region src/features/observation/types/observation.types.d.ts
1366
- type JsonValue = NcpJsonValue;
1367
- type ObservationCapabilityDescriptor = {
1368
- extensionId: string;
1369
- kind: "context" | "events";
1370
- title: string;
1371
- description?: string;
1372
- configSchema?: Record<string, unknown>;
1373
- replay?: "supported" | "unsupported";
1369
+ //#region src/features/capability-grants/types/capability-grant.types.d.ts
1370
+ type CapabilityGrantSubject = {
1371
+ type: string;
1372
+ id: string;
1374
1373
  };
1375
- type ObservationTarget = {
1376
- sessionId: string;
1377
- agentId: string;
1374
+ type CapabilityGrantResource = {
1375
+ type: string;
1376
+ target: unknown;
1378
1377
  };
1379
- type ObservationEvent = {
1380
- eventId: string;
1381
- eventType: string;
1382
- occurredAt: string;
1383
- observedAt: string;
1384
- cursor?: string;
1385
- dedupeKey?: string;
1386
- causationId?: string;
1387
- correlationId?: string;
1388
- payload: JsonValue;
1389
- sourceRefs?: string[];
1378
+ type CapabilityGrantRequest = {
1379
+ subject: CapabilityGrantSubject;
1380
+ resource: CapabilityGrantResource;
1381
+ access: string[];
1382
+ declarationFingerprint: string;
1390
1383
  };
1391
- type ObservationRelationshipStatus = "active" | "paused" | "degraded" | "expired" | "broken";
1392
- type ContextBinding = {
1393
- bindingId: string;
1394
- extensionId: string;
1395
- config: JsonValue;
1396
- target: ObservationTarget;
1397
- projection: {
1398
- maxChars?: number;
1399
- maxItems?: number;
1400
- };
1401
- status: ObservationRelationshipStatus;
1402
- statusReason?: string;
1403
- createdAt: string;
1404
- expiresAt?: string;
1405
- lastReadAt?: string;
1384
+ type CapabilityGrant = CapabilityGrantRequest & {
1385
+ grantedAt: string;
1386
+ lastUsedAt?: string;
1406
1387
  };
1407
- type JsonPointer = string;
1408
- type TypedPredicate = {
1409
- op: "exists";
1410
- path: JsonPointer;
1411
- } | {
1412
- op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "contains";
1413
- path: JsonPointer;
1414
- value: JsonValue;
1388
+ type CapabilityGrantFilter = {
1389
+ subject?: Partial<CapabilityGrantSubject>;
1390
+ resourceType?: string;
1391
+ target?: unknown;
1392
+ access?: string[];
1393
+ };
1394
+ type CapabilityGrantDecision = {
1395
+ granted: true;
1396
+ grant: CapabilityGrant;
1415
1397
  } | {
1416
- op: "and";
1417
- args: TypedPredicate[];
1398
+ granted: false;
1399
+ reason: "authorization_required";
1400
+ };
1401
+ //#endregion
1402
+ //#region src/features/capability-grants/managers/capability-grant.manager.d.ts
1403
+ type CapabilityGrantListener = (grants: CapabilityGrant[]) => void | Promise<void>;
1404
+ type CapabilityGrantRevocationListener = CapabilityGrantListener;
1405
+ declare class CapabilityGrantManager {
1406
+ private readonly store;
1407
+ private readonly grantListeners;
1408
+ private readonly revocationListeners;
1409
+ constructor(storePath: string);
1410
+ check: (request: CapabilityGrantRequest) => Promise<CapabilityGrantDecision>;
1411
+ require: (request: CapabilityGrantRequest) => Promise<CapabilityGrant>;
1412
+ grant: (request: CapabilityGrantRequest, grantedAt?: string) => Promise<CapabilityGrant>;
1413
+ list: (filter?: CapabilityGrantFilter) => Promise<CapabilityGrant[]>;
1414
+ revoke: (filter: CapabilityGrantFilter) => Promise<CapabilityGrant[]>;
1415
+ revokeMatching: (matches: (grant: CapabilityGrant) => boolean) => Promise<CapabilityGrant[]>;
1416
+ import: (grants: CapabilityGrant[]) => Promise<void>;
1417
+ replace: (grants: CapabilityGrant[]) => Promise<void>;
1418
+ onGranted: (listener: CapabilityGrantListener) => (() => void);
1419
+ onRevoked: (listener: CapabilityGrantRevocationListener) => (() => void);
1420
+ }
1421
+ //#endregion
1422
+ //#region src/features/capability-grants/services/capability-grant-legacy-migration.service.d.ts
1423
+ declare class CapabilityGrantLegacyMigrationService {
1424
+ private readonly params;
1425
+ private readonly sources;
1426
+ constructor(params: {
1427
+ capabilityGrantManager: CapabilityGrantManager;
1428
+ markerPath: string;
1429
+ validateGrant: (grant: CapabilityGrant) => Promise<boolean>;
1430
+ workspacePath: string;
1431
+ });
1432
+ migrate: () => Promise<void>;
1433
+ private readSources;
1434
+ private assertImported;
1435
+ private restore;
1436
+ }
1437
+ //#endregion
1438
+ //#region src/features/capability-grants/stores/capability-grant.store.d.ts
1439
+ declare class CapabilityGrantStore {
1440
+ private readonly storePath;
1441
+ private writeQueue;
1442
+ constructor(storePath: string);
1443
+ read: () => Promise<CapabilityGrant[]>;
1444
+ replace: (grants: CapabilityGrant[]) => Promise<void>;
1445
+ mutateGrants: (update: (grants: CapabilityGrant[]) => CapabilityGrant[]) => Promise<CapabilityGrant[]>;
1446
+ private mutate;
1447
+ private load;
1448
+ private save;
1449
+ }
1450
+ //#endregion
1451
+ //#region src/features/capability-grants/utils/capability-grant.utils.d.ts
1452
+ declare function normalizeCapabilityGrantRequest(request: CapabilityGrantRequest): CapabilityGrantRequest;
1453
+ declare function createCapabilityDeclarationFingerprint(value: unknown): string;
1454
+ declare function getCapabilityGrantKey(request: CapabilityGrantRequest): string;
1455
+ declare function capabilityGrantCovers(grant: CapabilityGrant, request: CapabilityGrantRequest): boolean;
1456
+ declare function matchesCapabilityGrantFilter(grant: CapabilityGrant, filter: CapabilityGrantFilter): boolean;
1457
+ //#endregion
1458
+ //#region src/types/service-app.types.d.ts
1459
+ type ServiceAppProtocol = "mcp" | "wasi-component";
1460
+ type ServiceActionRisk = "read" | "write" | "external" | "dangerous";
1461
+ type ServiceAppRuntimeStatus = "idle" | "starting" | "running" | "failed" | "stopped";
1462
+ type ServiceAppManifestAction = {
1463
+ risk?: ServiceActionRisk;
1464
+ title?: string;
1465
+ description?: string;
1466
+ inputSchema?: Record<string, unknown>;
1467
+ timeoutMs?: number;
1468
+ };
1469
+ type ServiceAppLifecycle = {
1470
+ mode: "action";
1418
1471
  } | {
1419
- op: "or";
1420
- args: TypedPredicate[];
1472
+ mode: "resident";
1473
+ eventIntervalMs: number;
1421
1474
  } | {
1422
- op: "not";
1423
- arg: TypedPredicate;
1475
+ mode: "provider";
1424
1476
  };
1425
- type EventAdmissionPolicy = {
1426
- predicate?: TypedPredicate;
1427
- dedupe?: {
1428
- key: JsonPointer;
1429
- window?: string;
1430
- };
1477
+ type ServiceAppManifest = {
1478
+ id: string;
1479
+ title: string;
1480
+ description?: string;
1481
+ enabled: boolean;
1482
+ protocol: ServiceAppProtocol;
1483
+ command?: string;
1484
+ args?: string[];
1485
+ componentEntry?: string;
1486
+ providerIds?: string[];
1487
+ lifecycle?: ServiceAppLifecycle;
1488
+ actions: Record<string, ServiceAppManifestAction>;
1431
1489
  };
1432
- type EventSubscriptionBudget = {
1433
- maxPending: number;
1434
- maxDeliveriesPerWindow?: number;
1435
- window?: string;
1490
+ type ServiceAppRecord = {
1491
+ id: string;
1492
+ title: string;
1493
+ description?: string;
1494
+ dirPath: string;
1495
+ manifestPath: string;
1496
+ command?: string;
1497
+ args?: string[];
1498
+ cwd: string;
1499
+ enabled: boolean;
1500
+ protocol: ServiceAppProtocol;
1501
+ status: ServiceAppRuntimeStatus;
1502
+ lastError?: string;
1503
+ lastStartedAt?: string;
1504
+ lastReadyAt?: string;
1505
+ lastFailedAt?: string;
1506
+ sourceKind?: "workspace" | "package";
1507
+ packageId?: string;
1508
+ packageVersion?: string;
1509
+ packageDirectory?: string;
1510
+ dataDirectory?: string;
1511
+ instanceId?: string;
1512
+ storage?: AppStorageContext;
1513
+ isolation?: AppRuntimeIsolation;
1514
+ runtimeProfile?: AppRuntimeProfile;
1515
+ permissions?: AppPermissions;
1516
+ componentPath?: string;
1517
+ providerIds?: string[];
1518
+ lifecycle?: ServiceAppLifecycle;
1436
1519
  };
1437
- type EventSubscription = {
1438
- subscriptionId: string;
1439
- extensionId: string;
1440
- config: JsonValue;
1441
- target: ObservationTarget;
1442
- admission: EventAdmissionPolicy;
1443
- delivery: "queue" | "prefer-steer";
1444
- budget: EventSubscriptionBudget;
1445
- cursor?: string;
1446
- status: ObservationRelationshipStatus;
1447
- statusReason?: string;
1448
- createdAt: string;
1449
- expiresAt?: string;
1450
- suppressedCount?: number;
1451
- lastSuppressedAt?: string;
1452
- lastSuppressionReason?: "predicate" | "dedupe" | "max_pending" | "rate_limit";
1453
- lastGapAt?: string;
1454
- gapReason?: "replay_unsupported";
1520
+ type ServiceActionGrantState = "granted" | "not-granted" | "not-declared";
1521
+ type ServiceActionRuntimeState = "matched" | "missing" | "undeclared";
1522
+ type ServiceAction = {
1523
+ id: string;
1524
+ appId: string;
1525
+ name: string;
1526
+ title?: string;
1527
+ description?: string;
1528
+ inputSchema?: Record<string, unknown>;
1529
+ risk: ServiceActionRisk;
1530
+ runtimeState?: ServiceActionRuntimeState;
1531
+ grantState?: ServiceActionGrantState;
1455
1532
  };
1456
- type EventDelivery = {
1457
- deliveryId: string;
1458
- subscriptionId: string;
1459
- eventId: string;
1460
- event: ObservationEvent;
1461
- dedupeValue?: string;
1462
- targetSessionId: string;
1463
- requestedDelivery: "queue" | "prefer-steer";
1464
- resolvedDelivery?: NcpResolvedInputDelivery;
1465
- status: "pending" | "submitted" | "materialized" | "failed";
1466
- ingressIdempotencyKey: string;
1467
- messageId: string;
1533
+ type PanelServiceActionCaller = {
1534
+ surface: "panel-app";
1535
+ appId: string;
1536
+ };
1537
+ type AgentServiceActionCaller = {
1538
+ surface: "agent";
1539
+ agentId: string;
1540
+ };
1541
+ type ServiceActionCaller = PanelServiceActionCaller | AgentServiceActionCaller;
1542
+ type ServiceActionGrant = {
1543
+ caller: ServiceActionCaller;
1544
+ actionId: string;
1545
+ risk: ServiceActionRisk;
1546
+ grantedAt: string;
1547
+ };
1548
+ type ServiceActionInvokeRequest = {
1549
+ caller: ServiceActionCaller;
1550
+ declaredActions?: string[];
1551
+ input?: Record<string, unknown>;
1552
+ };
1553
+ type ServiceActionInvokeResult = {
1554
+ actionId: string;
1555
+ result: unknown;
1556
+ };
1557
+ type ServiceActionGrantRequest = {
1558
+ caller: ServiceActionCaller;
1559
+ declaredActions?: string[];
1560
+ };
1561
+ //#endregion
1562
+ //#region src/types/panel-app.types.d.ts
1563
+ type PanelAppEntry = {
1564
+ id: string;
1565
+ appId: string;
1566
+ fileName: string;
1567
+ kind: "single-file" | "folder";
1568
+ title: string;
1569
+ description?: string;
1570
+ icon?: string;
1571
+ contentPath: string;
1468
1572
  createdAt: string;
1469
1573
  updatedAt: string;
1470
- failure?: {
1471
- code: string;
1574
+ sizeBytes: number;
1575
+ favorite: boolean;
1576
+ mainSidebar: boolean;
1577
+ mainSidebarOrder?: number;
1578
+ clientDeclared: boolean;
1579
+ clientGranted: boolean;
1580
+ lastOpenedAt?: string;
1581
+ openCount: number;
1582
+ sourceKind: "workspace" | "package";
1583
+ packageId?: string;
1584
+ packageVersion?: string;
1585
+ };
1586
+ type PanelAppList = {
1587
+ workspacePath: string;
1588
+ panelsPath: string;
1589
+ entries: PanelAppEntry[];
1590
+ unavailablePackages: Array<{
1591
+ appId: string;
1472
1592
  message: string;
1473
- };
1593
+ }>;
1474
1594
  };
1475
- type ObservationState = {
1476
- bindings: ContextBinding[];
1477
- subscriptions: EventSubscription[];
1478
- deliveries: EventDelivery[];
1595
+ type PanelAppContent = {
1596
+ id: string;
1597
+ appId: string;
1598
+ fileName: string;
1599
+ html: string;
1600
+ contentType: "text/html; charset=utf-8";
1601
+ capabilities: string[];
1602
+ clientDeclared: boolean;
1603
+ clientGranted: boolean;
1604
+ serviceActions: string[];
1479
1605
  };
1480
- type ObservationRef = {
1481
- kind: "context_binding";
1606
+ type PanelAppDeleteResult = {
1607
+ deleted: true;
1608
+ fileName: string;
1482
1609
  id: string;
1483
- } | {
1484
- kind: "event_subscription";
1610
+ };
1611
+ type PanelAppBridgeSession = {
1485
1612
  id: string;
1613
+ token: string;
1614
+ appId: string;
1615
+ caller: PanelServiceActionCaller;
1616
+ declaredCapabilities: string[];
1617
+ declaredActions: string[];
1618
+ clientDeclared: boolean;
1619
+ createdAt: string;
1620
+ expiresAt: string;
1486
1621
  };
1487
- type BindContextInput = {
1488
- extensionId: string;
1489
- config: JsonValue;
1622
+ type PanelAppErrorCode = "AGENT_OBJECT_REQUEST_FAILED" | "AGENT_OBJECT_RESULT_NOT_SUBMITTED" | "AGENT_OBJECT_RESULT_SCHEMA_INVALID" | "AGENT_OBJECT_RESULT_TIMEOUT" | "AUTHORIZATION_REQUIRED" | "PANEL_APP_AGENT_REQUEST_INVALID" | "PANEL_APP_ASSET_TOKEN_EXPIRED" | "PANEL_APP_ASSET_TOKEN_INVALID" | "PANEL_APP_BRIDGE_SESSION_NOT_FOUND" | "PANEL_APP_CAPABILITY_NOT_DECLARED" | "PANEL_APP_CLIENT_NOT_DECLARED" | "PANEL_APP_INVALID_ASSET_PATH" | "PANEL_APP_INVALID_ID" | "PANEL_APP_INVALID_SOURCE_PATH" | "PANEL_APP_MANIFEST_INVALID" | "PANEL_APP_MANAGED_SOURCE" | "PANEL_APP_NOT_FOUND" | "PANEL_APP_READ_FAILED";
1623
+ declare class PanelAppError extends Error {
1624
+ readonly code: PanelAppErrorCode;
1625
+ constructor(code: PanelAppErrorCode, message: string);
1626
+ }
1627
+ declare function isPanelAppError(error: unknown): error is PanelAppError;
1628
+ declare const PANEL_APP_AGENT_CAPABILITIES: readonly ["agent:send", "agent:generateObject"];
1629
+ type PanelAppAgentCapability = typeof PANEL_APP_AGENT_CAPABILITIES[number];
1630
+ declare function isPanelAppAgentCapability(value: unknown): value is PanelAppAgentCapability;
1631
+ type PanelAppClientGrant = {
1632
+ appId: string;
1633
+ grantedAt: string;
1634
+ };
1635
+ type PanelAppCapabilityGrantCaller = {
1636
+ surface: "panel-app";
1637
+ appId: string;
1638
+ };
1639
+ type PanelAppCapabilityGrant = {
1640
+ caller: PanelAppCapabilityGrantCaller;
1641
+ capability: PanelAppAgentCapability;
1642
+ grantedAt: string;
1643
+ };
1644
+ type PanelAppAgentSendPayload = {
1645
+ sessionId?: string;
1646
+ peerId?: string;
1647
+ content: NcpMessagePart[];
1648
+ message?: never;
1649
+ metadata?: Record<string, unknown>;
1650
+ } | {
1651
+ sessionId?: string;
1652
+ peerId?: string;
1653
+ message: NcpMessage$1 | (Omit<NcpMessage$1, "sessionId"> & {
1654
+ sessionId?: string;
1655
+ });
1656
+ content?: never;
1657
+ metadata?: Record<string, unknown>;
1658
+ };
1659
+ type PanelAppAgentSendRequest = {
1660
+ payload: PanelAppAgentSendPayload;
1661
+ };
1662
+ type PanelAppAgentSendResult = NcpRunHandle;
1663
+ type PanelAppAgentRunClient = {
1664
+ send: (input: AgentRunSendIngressPayload) => Promise<NcpRunHandle>;
1665
+ sendAndStreamEvents: (input: AgentRunSendIngressPayload) => AsyncGenerator<NcpEndpointEvent$1>;
1666
+ };
1667
+ type PanelAppAgentGenerateObjectInput = {
1668
+ peerId: string;
1669
+ prompt: string;
1670
+ context?: unknown;
1671
+ schema: Record<string, unknown>;
1672
+ title?: string;
1673
+ timeoutMs?: number;
1674
+ };
1675
+ type PanelAppAgentGenerateObjectRequest = {
1676
+ input: PanelAppAgentGenerateObjectInput;
1677
+ };
1678
+ type PanelAppAgentGenerateObjectResult = {
1679
+ result: unknown;
1680
+ };
1681
+ //#endregion
1682
+ //#region src/features/capability-grants/utils/capability-grant-resource.utils.d.ts
1683
+ declare function createPanelAppClientGrantRequest(appId: string): CapabilityGrantRequest;
1684
+ declare function createPanelAppAgentGrantRequest(caller: PanelServiceActionCaller, capability: PanelAppAgentCapability): CapabilityGrantRequest;
1685
+ declare function createServiceActionGrantRequest(caller: ServiceActionCaller, action: ServiceAction): CapabilityGrantRequest;
1686
+ declare function readServiceActionTargetId(target: unknown): string | null;
1687
+ //#endregion
1688
+ //#region src/features/desktop-host/types/desktop-host.types.d.ts
1689
+ declare const DESKTOP_HOST_PROTOCOL_VERSION: 1;
1690
+ declare const DESKTOP_HOST_ACCESS: readonly ["ui.read", "ui.observe", "ui.write", "screen.capture-window", "input.keyboard", "input.pointer"];
1691
+ type DesktopHostAccess = typeof DESKTOP_HOST_ACCESS[number];
1692
+ type DesktopApplicationTarget = {
1693
+ applicationId: string;
1694
+ };
1695
+ type ResolvedDesktopApplicationTarget = {
1696
+ platform: "darwin";
1697
+ applicationId: string;
1698
+ bundleId: string;
1699
+ } | {
1700
+ platform: "win32";
1701
+ applicationId: string;
1702
+ appUserModelId?: string;
1703
+ executableIdentity?: string;
1704
+ } | {
1705
+ platform: "linux";
1706
+ applicationId: string;
1707
+ desktopFileId?: string;
1708
+ executableIdentity?: string;
1709
+ };
1710
+ type DesktopHostCaller = {
1711
+ extensionId?: string;
1712
+ agentId?: string;
1713
+ sessionId?: string;
1714
+ agentRunId?: string;
1715
+ subscriptionId?: string;
1716
+ };
1717
+ type DesktopHostMethod = "host.hello" | "host.status" | "host.application.resolve" | "host.permissions.get" | "host.permissions.request" | "host.permissions.openSettings" | "host.ui.snapshot" | "host.ui.action" | "host.ui.observe" | "host.ui.unobserve" | "host.screen.captureWindow" | "host.input.click" | "host.input.typeText" | "host.input.pressKey";
1718
+ type DesktopHostRequest = {
1719
+ protocolVersion: typeof DESKTOP_HOST_PROTOCOL_VERSION;
1720
+ requestId: string;
1721
+ token: string;
1722
+ method: DesktopHostMethod;
1723
+ caller: DesktopHostCaller;
1724
+ payload: unknown;
1725
+ };
1726
+ type DesktopHostResponse = {
1727
+ protocolVersion: typeof DESKTOP_HOST_PROTOCOL_VERSION;
1728
+ requestId: string;
1729
+ ok: boolean;
1730
+ result?: unknown;
1731
+ error?: DesktopCapabilityError;
1732
+ };
1733
+ type DesktopHostEvent = {
1734
+ protocolVersion: typeof DESKTOP_HOST_PROTOCOL_VERSION;
1735
+ type: "host.event";
1736
+ watchId: string;
1737
+ event: unknown;
1738
+ };
1739
+ type DesktopHostStatus = {
1740
+ online: boolean;
1741
+ platform?: NodeJS.Platform;
1742
+ protocolVersion?: number;
1743
+ supportedAccess: DesktopHostAccess[];
1744
+ supportedOperations: DesktopHostMethod[];
1745
+ permissions: {
1746
+ accessibility: "granted" | "not_granted" | "not_supported" | "unknown";
1747
+ screenCapture: "granted" | "not_granted" | "not_supported" | "unknown";
1748
+ };
1749
+ };
1750
+ type DesktopCapabilityErrorCode = "desktop_host_unavailable" | "desktop_host_protocol_mismatch" | "unsupported_platform" | "permission_not_granted" | "capability_not_declared" | "authorization_required" | "authorization_denied" | "target_not_running" | "window_not_found" | "element_not_found" | "stale_target" | "operation_not_supported" | "payload_limit_exceeded" | "host_operation_failed";
1751
+ type DesktopCapabilityError = {
1752
+ code: DesktopCapabilityErrorCode;
1753
+ message: string;
1754
+ recovery?: {
1755
+ action: "open_settings" | "start_desktop" | "show_authorization" | "refresh_target" | "update_desktop";
1756
+ };
1757
+ request?: unknown;
1758
+ };
1759
+ type DesktopHostCapabilityDeclaration = {
1760
+ access: DesktopHostAccess[];
1761
+ };
1762
+ type DesktopHostManifest = {
1763
+ id: string;
1764
+ contributes?: {
1765
+ hostCapabilities?: {
1766
+ desktopAutomation?: DesktopHostCapabilityDeclaration;
1767
+ };
1768
+ };
1769
+ };
1770
+ //#endregion
1771
+ //#region src/features/desktop-host/services/desktop-host.service.d.ts
1772
+ type DesktopHostEventListener = (event: DesktopHostEvent) => void;
1773
+ /**
1774
+ * The Kernel-facing boundary for the local desktop host. A runtime host owns
1775
+ * its platform implementation; the Kernel owns grants and caller identity.
1776
+ */
1777
+ type DesktopHost = {
1778
+ status: () => Promise<DesktopHostStatus>;
1779
+ invoke: <T>(method: DesktopHostMethod, payload: Record<string, unknown>, caller: DesktopHostCaller) => Promise<T>;
1780
+ onEvent: (listener: DesktopHostEventListener) => () => void;
1781
+ dispose: () => Promise<void>;
1782
+ };
1783
+ declare function createDesktopHostError(error: DesktopCapabilityError): Error;
1784
+ /** Used by short-lived Kernel entry points which do not own a local host. */
1785
+ declare class UnavailableDesktopHost implements DesktopHost {
1786
+ status: () => Promise<DesktopHostStatus>;
1787
+ invoke: <T>() => Promise<T>;
1788
+ onEvent: () => (() => void);
1789
+ dispose: () => Promise<void>;
1790
+ }
1791
+ //#endregion
1792
+ //#region src/features/desktop-host/managers/desktop-host-capability.manager.d.ts
1793
+ declare class DesktopHostCapabilityManager {
1794
+ private readonly options;
1795
+ private readonly watches;
1796
+ private readonly removeEventListener;
1797
+ private readonly removeGrantListener;
1798
+ private readonly removeRevocationListener;
1799
+ constructor(options: {
1800
+ capabilityGrantManager: CapabilityGrantManager;
1801
+ host: DesktopHost;
1802
+ findManifest: (extensionId: string) => DesktopHostManifest;
1803
+ hasAgent?: (agentId: string) => boolean;
1804
+ onAuthorizationRequired?: (input: {
1805
+ applicationId: string;
1806
+ caller: DesktopHostCaller;
1807
+ request: CapabilityGrantRequest;
1808
+ }) => void;
1809
+ onEvent?: (input: {
1810
+ extensionId: string;
1811
+ generation: string;
1812
+ watchId: string;
1813
+ event: unknown;
1814
+ }) => void;
1815
+ onObservationAuthorizationRevoked?: (input: {
1816
+ extensionId: string;
1817
+ subscriptionId: string;
1818
+ }) => Promise<void>;
1819
+ onObservationAuthorizationGranted?: (input: {
1820
+ extensionId: string;
1821
+ }) => Promise<void>;
1822
+ });
1823
+ status: () => Promise<DesktopHostStatus>;
1824
+ getPermissions: () => Promise<DesktopHostStatus["permissions"]>;
1825
+ requestPermissions: () => Promise<DesktopHostStatus["permissions"]>;
1826
+ openPermissionSettings: () => Promise<{
1827
+ opened: boolean;
1828
+ }>;
1829
+ grantAccess: (request: CapabilityGrantRequest) => Promise<CapabilityGrant>;
1830
+ invoke: <T>(input: {
1831
+ extensionId: string;
1832
+ generation: string;
1833
+ method: DesktopHostMethod;
1834
+ payload: Record<string, unknown>;
1835
+ caller?: Omit<DesktopHostCaller, "extensionId">;
1836
+ }) => Promise<T>;
1837
+ private invokeUnscopedExtensionMethod;
1838
+ invokeAgent: <T>(input: {
1839
+ agentId: string;
1840
+ sessionId: string;
1841
+ agentRunId?: string;
1842
+ source?: "legacy-tool" | "desktop";
1843
+ method: "host.status" | "host.ui.snapshot" | "host.screen.captureWindow" | "host.ui.action" | "host.input.click" | "host.input.typeText" | "host.input.pressKey";
1844
+ payload: Record<string, unknown>;
1845
+ }) => Promise<T>;
1846
+ releaseExtensionWatches: (extensionId: string, generation?: string) => Promise<void>;
1847
+ private validateGrantRequest;
1848
+ private removeWatch;
1849
+ private requireGrant;
1850
+ private requireAgentGrant;
1851
+ private requireKnownAgent;
1852
+ stop: () => Promise<void>;
1853
+ dispose: () => Promise<void>;
1854
+ private releaseAllWatches;
1855
+ }
1856
+ //#endregion
1857
+ //#region src/features/desktop-host/services/desktop-node-repl.service.d.ts
1858
+ /**
1859
+ * Codex-style code entry point: a session-scoped REPL worker receives a small
1860
+ * desktop SDK and no host Node.js capabilities. The SDK still delegates every
1861
+ * operation to the normal state, grant, and audit owners.
1862
+ */
1863
+ declare class DesktopNodeReplService {
1864
+ private readonly sessionState;
1865
+ private readonly workers;
1866
+ constructor(sessionState: DesktopSessionStateService);
1867
+ execute: (input: DesktopSessionCaller & {
1868
+ code: unknown;
1869
+ signal?: AbortSignal;
1870
+ }) => Promise<unknown>;
1871
+ dispose: () => void;
1872
+ private getOrCreateWorker;
1873
+ private handleWorkerMessage;
1874
+ private invokeDesktop;
1875
+ private resolve;
1876
+ private reject;
1877
+ private scheduleIdleStop;
1878
+ private stopWorker;
1879
+ }
1880
+ //#endregion
1881
+ //#region src/features/desktop-host/services/desktop-session-state.service.d.ts
1882
+ type DesktopSessionCaller = {
1883
+ agentId: string;
1884
+ sessionId: string;
1885
+ agentRunId?: string;
1886
+ };
1887
+ type DesktopSnapshotOptions = {
1888
+ target: {
1889
+ applicationId: string;
1890
+ };
1891
+ source?: "accessibility" | "screen" | "both";
1892
+ detail?: "low" | "high";
1893
+ maxDepth?: number;
1894
+ maxNodes?: number;
1895
+ };
1896
+ /** Owns short-lived AX element references for one Agent session. */
1897
+ declare class DesktopSessionStateService {
1898
+ private readonly manager;
1899
+ private readonly statesBySession;
1900
+ constructor(manager: DesktopHostCapabilityManager);
1901
+ snapshot: (caller: DesktopSessionCaller, options: DesktopSnapshotOptions) => Promise<unknown>;
1902
+ setValue: (caller: DesktopSessionCaller, input: {
1903
+ target: {
1904
+ applicationId: string;
1905
+ };
1906
+ stateId: string;
1907
+ elementIndex: number;
1908
+ value: string;
1909
+ }) => Promise<unknown>;
1910
+ click: (caller: DesktopSessionCaller, input: {
1911
+ target: {
1912
+ applicationId: string;
1913
+ };
1914
+ stateId: string;
1915
+ elementIndex?: number;
1916
+ coordinate?: {
1917
+ x: number;
1918
+ y: number;
1919
+ };
1920
+ }) => Promise<unknown>;
1921
+ typeText: (caller: DesktopSessionCaller, input: {
1922
+ target: {
1923
+ applicationId: string;
1924
+ };
1925
+ stateId: string;
1926
+ text: string;
1927
+ }) => Promise<unknown>;
1928
+ pressKey: (caller: DesktopSessionCaller, input: {
1929
+ target: {
1930
+ applicationId: string;
1931
+ };
1932
+ stateId: string;
1933
+ key: string;
1934
+ modifiers?: string[];
1935
+ }) => Promise<unknown>;
1936
+ private perform;
1937
+ private remember;
1938
+ private sessionStates;
1939
+ }
1940
+ //#endregion
1941
+ //#region src/features/observation/types/observation.types.d.ts
1942
+ type JsonValue = NcpJsonValue;
1943
+ type ObservationCapabilityDescriptor = {
1944
+ extensionId: string;
1945
+ kind: "context" | "events";
1946
+ title: string;
1947
+ description?: string;
1948
+ configSchema?: Record<string, unknown>;
1949
+ replay?: "supported" | "unsupported";
1950
+ };
1951
+ type ObservationTarget = {
1952
+ sessionId: string;
1953
+ agentId: string;
1954
+ };
1955
+ type ObservationEvent = {
1956
+ eventId: string;
1957
+ eventType: string;
1958
+ occurredAt: string;
1959
+ observedAt: string;
1960
+ cursor?: string;
1961
+ dedupeKey?: string;
1962
+ causationId?: string;
1963
+ correlationId?: string;
1964
+ payload: JsonValue;
1965
+ sourceRefs?: string[];
1966
+ };
1967
+ type ObservationRelationshipStatus = "active" | "paused" | "degraded" | "expired" | "broken";
1968
+ type ContextBinding = {
1969
+ bindingId: string;
1970
+ extensionId: string;
1971
+ config: JsonValue;
1972
+ target: ObservationTarget;
1973
+ projection: {
1974
+ maxChars?: number;
1975
+ maxItems?: number;
1976
+ };
1977
+ status: ObservationRelationshipStatus;
1978
+ statusReason?: string;
1979
+ createdAt: string;
1980
+ expiresAt?: string;
1981
+ lastReadAt?: string;
1982
+ };
1983
+ type JsonPointer = string;
1984
+ type TypedPredicate = {
1985
+ op: "exists";
1986
+ path: JsonPointer;
1987
+ } | {
1988
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "contains";
1989
+ path: JsonPointer;
1990
+ value: JsonValue;
1991
+ } | {
1992
+ op: "and";
1993
+ args: TypedPredicate[];
1994
+ } | {
1995
+ op: "or";
1996
+ args: TypedPredicate[];
1997
+ } | {
1998
+ op: "not";
1999
+ arg: TypedPredicate;
2000
+ };
2001
+ type EventAdmissionPolicy = {
2002
+ predicate?: TypedPredicate;
2003
+ dedupe?: {
2004
+ key: JsonPointer;
2005
+ window?: string;
2006
+ };
2007
+ };
2008
+ type EventSubscriptionBudget = {
2009
+ maxPending: number;
2010
+ maxDeliveriesPerWindow?: number;
2011
+ window?: string;
2012
+ };
2013
+ type EventSubscription = {
2014
+ subscriptionId: string;
2015
+ extensionId: string;
2016
+ config: JsonValue;
2017
+ target: ObservationTarget;
2018
+ admission: EventAdmissionPolicy;
2019
+ delivery: "queue" | "prefer-steer";
2020
+ budget: EventSubscriptionBudget;
2021
+ cursor?: string;
2022
+ status: ObservationRelationshipStatus;
2023
+ statusReason?: string;
2024
+ createdAt: string;
2025
+ expiresAt?: string;
2026
+ suppressedCount?: number;
2027
+ lastSuppressedAt?: string;
2028
+ lastSuppressionReason?: "predicate" | "dedupe" | "max_pending" | "rate_limit";
2029
+ lastGapAt?: string;
2030
+ gapReason?: "replay_unsupported";
2031
+ };
2032
+ type EventDelivery = {
2033
+ deliveryId: string;
2034
+ subscriptionId: string;
2035
+ eventId: string;
2036
+ event: ObservationEvent;
2037
+ dedupeValue?: string;
2038
+ targetSessionId: string;
2039
+ requestedDelivery: "queue" | "prefer-steer";
2040
+ resolvedDelivery?: NcpResolvedInputDelivery;
2041
+ status: "pending" | "submitted" | "materialized" | "failed";
2042
+ ingressIdempotencyKey: string;
2043
+ messageId: string;
2044
+ createdAt: string;
2045
+ updatedAt: string;
2046
+ failure?: {
2047
+ code: string;
2048
+ message: string;
2049
+ };
2050
+ };
2051
+ type ObservationState = {
2052
+ bindings: ContextBinding[];
2053
+ subscriptions: EventSubscription[];
2054
+ deliveries: EventDelivery[];
2055
+ };
2056
+ type ObservationRef = {
2057
+ kind: "context_binding";
2058
+ id: string;
2059
+ } | {
2060
+ kind: "event_subscription";
2061
+ id: string;
2062
+ };
2063
+ type BindContextInput = {
2064
+ extensionId: string;
2065
+ config: JsonValue;
1490
2066
  targetSessionId: string;
1491
2067
  projection?: {
1492
2068
  maxChars?: number;
@@ -1564,6 +2140,13 @@ declare class ObservationManager {
1564
2140
  }>;
1565
2141
  onExtensionObservationRuntimeExited: (extensionId: string) => void;
1566
2142
  onExtensionObservationRuntimeReady: (extensionId: string) => Promise<void>;
2143
+ onDesktopObservationAuthorizationRevoked: (input: {
2144
+ extensionId: string;
2145
+ subscriptionId: string;
2146
+ }) => Promise<void>;
2147
+ onDesktopObservationAuthorizationGranted: (input: {
2148
+ extensionId: string;
2149
+ }) => Promise<void>;
1567
2150
  buildContextTail: (input: BuildContextTailInput) => Promise<ObservationContextTail | undefined>;
1568
2151
  discoverObservations: (input?: {
1569
2152
  query?: string;
@@ -1640,6 +2223,11 @@ type ExtensionManifest = {
1640
2223
  replay?: "supported" | "unsupported";
1641
2224
  };
1642
2225
  };
2226
+ hostCapabilities?: {
2227
+ desktopAutomation?: {
2228
+ access: Array<"ui.read" | "ui.observe" | "ui.write" | "screen.capture-window" | "input.keyboard" | "input.pointer">;
2229
+ };
2230
+ };
1643
2231
  channels?: Array<{
1644
2232
  id: string;
1645
2233
  name?: string;
@@ -1719,6 +2307,9 @@ type ExtensionManagerOptions = {
1719
2307
  messageBus: Pick<MessageBus, "publishInbound">;
1720
2308
  sessionManager: SessionManager;
1721
2309
  observations: ObservationManager;
2310
+ capabilityGrantManager: CapabilityGrantManager;
2311
+ desktopHost: DesktopHost;
2312
+ hasAgent: (agentId: string) => boolean;
1722
2313
  };
1723
2314
  type ExtensionLoadParams = {
1724
2315
  config?: Config;
@@ -1742,9 +2333,11 @@ declare class ExtensionManager {
1742
2333
  endpoint: string | null;
1743
2334
  }) => Promise<void>;
1744
2335
  stop: () => Promise<void>;
2336
+ dispose: () => Promise<void>;
1745
2337
  getExtensionRegistry: () => ExtensionRegistry;
1746
2338
  getChannelBindings: () => ExtensionChannelBinding[];
1747
2339
  getUiMetadata: () => ExtensionUiMetadata[];
2340
+ getDesktopHost: () => DesktopHostCapabilityManager;
1748
2341
  getRuntimeStatus: () => ExtensionRuntimeStatus[];
1749
2342
  getManifests: () => ExtensionManifest[];
1750
2343
  authenticateEventStreamCredential: (input: {
@@ -1826,359 +2419,155 @@ type LlmUsageStats = {
1826
2419
  value: string;
1827
2420
  count: number;
1828
2421
  }>;
1829
- models: Array<{
1830
- value: string;
1831
- count: number;
1832
- }>;
1833
- };
1834
- type LlmUsageManagerOptions = {
1835
- store?: LlmUsageStore;
1836
- };
1837
- declare class LlmUsageManager {
1838
- private readonly store;
1839
- constructor(options?: LlmUsageManagerOptions);
1840
- get snapshotPath(): string;
1841
- get historyPath(): string;
1842
- observeProviderManager: (providerManager: LlmProviderRuntime, source: string) => LlmProviderRuntime;
1843
- record: (params: {
1844
- observedAt?: string;
1845
- source: string;
1846
- model?: string | null;
1847
- usage: Record<string, number>;
1848
- }) => LlmUsageRecord | null;
1849
- getSnapshot: () => LlmUsageRecord | null;
1850
- getHistory: (limit?: string | number) => LlmUsageRecord[];
1851
- resolveHistoryLimit: (value?: string | number) => number;
1852
- getStats: () => LlmUsageStats;
1853
- private readonly bumpCounter;
1854
- private readonly toSortedCounts;
1855
- }
1856
- //#endregion
1857
- //#region src/managers/inbox-delivery.manager.d.ts
1858
- declare const MAX_INBOX_DELIVERY_CONTENT_LENGTH: number;
1859
- type CreateInboxDeliveryInput = {
1860
- title: string;
1861
- summary?: string | null;
1862
- content: string;
1863
- contentType: InboxDeliveryContentType;
1864
- source: InboxDeliverySource;
1865
- };
1866
- type InboxDeliveryManagerOptions = {
1867
- eventBus: Pick<EventBus$1, "emit">;
1868
- storePath: string;
1869
- };
1870
- type InboxDeliveryErrorCode = "INBOX_DELIVERY_INVALID_CONTENT" | "INBOX_DELIVERY_INVALID_SUMMARY" | "INBOX_DELIVERY_INVALID_TITLE" | "INBOX_DELIVERY_NOT_FOUND";
1871
- declare class InboxDeliveryError extends Error {
1872
- readonly code: InboxDeliveryErrorCode;
1873
- constructor(code: InboxDeliveryErrorCode, message: string);
1874
- }
1875
- declare function isInboxDeliveryError(error: unknown): error is InboxDeliveryError;
1876
- declare class InboxDeliveryManager {
1877
- private readonly options;
1878
- private readonly store;
1879
- private writeQueue;
1880
- constructor(options: InboxDeliveryManagerOptions);
1881
- listDeliveries: () => Promise<InboxDeliveryListView>;
1882
- getDelivery: (deliveryId: string) => Promise<InboxDelivery | null>;
1883
- createDelivery: (input: CreateInboxDeliveryInput) => Promise<InboxDelivery>;
1884
- updateDeliveryState: (deliveryId: string, action: InboxDeliveryStateAction) => Promise<InboxDelivery>;
1885
- deleteDelivery: (deliveryId: string) => Promise<boolean>;
1886
- private applyStateAction;
1887
- private normalizeRequiredText;
1888
- private normalizeOptionalText;
1889
- private notFound;
1890
- private publishChange;
1891
- private mutate;
1892
- }
1893
- //#endregion
1894
- //#region src/managers/system-object-reference.manager.d.ts
1895
- type SystemObjectReferenceSnapshotSource = {
1896
- item: SystemObjectReferenceItem;
1897
- content: string;
1898
- fileName: string;
1899
- mimeType: string;
1900
- };
1901
- type SystemObjectReferenceProvider = {
1902
- group: SystemObjectReferenceGroupDescriptor;
1903
- list: () => Promise<readonly SystemObjectReferenceItem[]> | readonly SystemObjectReferenceItem[];
1904
- resolve: (objectId: string) => Promise<SystemObjectReferenceSnapshotSource | null> | SystemObjectReferenceSnapshotSource | null;
1905
- };
1906
- type SystemObjectReferenceErrorCode = "SYSTEM_OBJECT_INVALID_REFERENCE" | "SYSTEM_OBJECT_NOT_FOUND" | "SYSTEM_OBJECT_PROVIDER_CONTRACT";
1907
- declare class SystemObjectReferenceError extends Error {
1908
- readonly code: SystemObjectReferenceErrorCode;
1909
- constructor(code: SystemObjectReferenceErrorCode, message: string);
1910
- }
1911
- declare function isSystemObjectReferenceError(error: unknown): error is SystemObjectReferenceError;
1912
- declare class SystemObjectReferenceManager {
1913
- private readonly assetStore;
1914
- private readonly providers;
1915
- private readonly resolvedCache;
1916
- constructor(assetStore: Pick<LocalAssetStore, "putBytes" | "statRecord">, providers?: readonly SystemObjectReferenceProvider[]);
1917
- registerProvider: (provider: SystemObjectReferenceProvider) => (() => void);
1918
- listReferences: (params?: {
1919
- query?: string;
1920
- limit?: number;
1921
- objectType?: string;
1922
- }) => Promise<SystemObjectReferenceListView>;
1923
- resolveReference: (uri: string) => Promise<SystemObjectResolvedReference>;
1924
- private assertSnapshotContract;
1925
- private assertListItemContract;
1926
- }
1927
- declare function createInboxDeliverySystemObjectProvider(manager: Pick<InboxDeliveryManager, "getDelivery" | "listDeliveries">): SystemObjectReferenceProvider;
1928
- declare function createCronJobSystemObjectProvider(automation: Pick<AutomationManager, "listJobs">): SystemObjectReferenceProvider;
1929
- //#endregion
1930
- //#region src/managers/mcp.manager.d.ts
1931
- declare class McpManager {
1932
- private baseConfig;
1933
- private currentMcpConfig;
1934
- private readonly contributedServers;
1935
- private readonly mcpLifecycleManager;
1936
- private readonly mcpRegistryService;
1937
- private readonly toolRegistryAdapter;
1938
- private warmupPromise;
1939
- constructor(getConfig: () => Config);
1940
- listToolsForRun: (params: {
1941
- agentId: string;
1942
- }) => ReadonlyArray<NcpTool$1>;
1943
- registerServer: (name: string, definition: McpServerDefinition$1) => Promise<() => Promise<void>>;
1944
- listServers: () => _$_nextclaw_mcp0.McpServerRecord[];
1945
- listTools: (filter?: McpCatalogFilter$1) => _$_nextclaw_mcp0.McpToolCatalogEntry[];
1946
- callTool: (params: Parameters<McpRegistryService["callTool"]>[0]) => Promise<unknown>;
1947
- start: () => void;
1948
- applyConfig: (config: Config) => Promise<void>;
1949
- dispose: () => Promise<void>;
1950
- private buildEffectiveConfig;
1951
- private prewarmEnabledServersSafely;
1952
- }
1953
- //#endregion
1954
- //#region src/managers/session-context-compaction.manager.d.ts
1955
- type SessionContextCompactionErrorCode = "CONTEXT_COMPACTION_UNSUPPORTED" | "NOTHING_TO_COMPACT" | "SESSION_BUSY" | "SESSION_NOT_FOUND";
1956
- declare class SessionContextCompactionError extends Error {
1957
- readonly code: SessionContextCompactionErrorCode;
1958
- constructor(code: SessionContextCompactionErrorCode, message: string);
1959
- }
1960
- declare function isSessionContextCompactionError(error: unknown): error is SessionContextCompactionError;
1961
- type SessionContextCompactionResult = {
1962
- compacted: true;
1963
- sessionId: string;
1964
- };
1965
- declare class SessionContextCompactionManager {
1966
- private readonly agentRuntimeManager;
1967
- private readonly eventBus;
1968
- private readonly sessionManager;
1969
- private readonly sessionRunManager;
1970
- constructor(agentRuntimeManager: AgentRuntimeManager, eventBus: EventBus$1, sessionManager: SessionManager, sessionRunManager: SessionRunManager);
1971
- compact: (requestedSessionId: string) => Promise<SessionContextCompactionResult>;
1972
- }
1973
- //#endregion
1974
- //#region src/stores/panel-app-state.store.d.ts
1975
- type PanelAppPreferencesUpdate = {
1976
- favorite?: boolean;
1977
- mainSidebar?: boolean;
1978
- };
1979
- //#endregion
1980
- //#region src/stores/panel-app-client-grant.store.d.ts
1981
- type PanelAppClientGrant = {
1982
- appId: string;
1983
- grantedAt: string;
1984
- };
1985
- //#endregion
1986
- //#region src/types/service-app.types.d.ts
1987
- type ServiceAppProtocol = "mcp";
1988
- type ServiceActionRisk = "read" | "write" | "external" | "dangerous";
1989
- type ServiceAppRuntimeStatus = "idle" | "starting" | "running" | "failed" | "stopped";
1990
- type ServiceAppManifestAction = {
1991
- risk?: ServiceActionRisk;
1992
- title?: string;
1993
- description?: string;
1994
- inputSchema?: Record<string, unknown>;
1995
- };
1996
- type ServiceAppManifest = {
1997
- id: string;
1998
- title: string;
1999
- description?: string;
2000
- enabled: boolean;
2001
- protocol: ServiceAppProtocol;
2002
- command: string;
2003
- args: string[];
2004
- actions: Record<string, ServiceAppManifestAction>;
2005
- };
2006
- type ServiceAppRecord = {
2007
- id: string;
2008
- title: string;
2009
- description?: string;
2010
- dirPath: string;
2011
- manifestPath: string;
2012
- command?: string;
2013
- args?: string[];
2014
- cwd: string;
2015
- enabled: boolean;
2016
- protocol: ServiceAppProtocol;
2017
- status: ServiceAppRuntimeStatus;
2018
- lastError?: string;
2019
- lastStartedAt?: string;
2020
- lastReadyAt?: string;
2021
- lastFailedAt?: string;
2022
- sourceKind?: "workspace" | "package";
2023
- packageId?: string;
2024
- packageVersion?: string;
2025
- packageDirectory?: string;
2026
- dataDirectory?: string;
2027
- instanceId?: string;
2028
- storage?: AppStorageContext;
2029
- isolation?: AppRuntimeIsolation;
2030
- };
2031
- type ServiceActionGrantState = "granted" | "not-granted" | "not-declared";
2032
- type ServiceActionRuntimeState = "matched" | "missing" | "undeclared";
2033
- type ServiceAction = {
2034
- id: string;
2035
- appId: string;
2036
- name: string;
2037
- title?: string;
2038
- description?: string;
2039
- inputSchema?: Record<string, unknown>;
2040
- risk: ServiceActionRisk;
2041
- runtimeState?: ServiceActionRuntimeState;
2042
- grantState?: ServiceActionGrantState;
2043
- };
2044
- type ServiceActionCaller = {
2045
- surface: "panel-app";
2046
- appId: string;
2047
- };
2048
- type ServiceActionGrant = {
2049
- caller: ServiceActionCaller;
2050
- actionId: string;
2051
- risk: ServiceActionRisk;
2052
- grantedAt: string;
2053
- };
2054
- type ServiceActionInvokeRequest = {
2055
- caller: ServiceActionCaller;
2056
- declaredActions: string[];
2057
- input?: Record<string, unknown>;
2058
- };
2059
- type ServiceActionInvokeResult = {
2060
- actionId: string;
2061
- result: unknown;
2062
- };
2063
- type ServiceActionGrantRequest = {
2064
- caller: ServiceActionCaller;
2065
- declaredActions: string[];
2066
- };
2067
- //#endregion
2068
- //#region src/types/panel-app.types.d.ts
2069
- type PanelAppEntry = {
2070
- id: string;
2071
- appId: string;
2072
- fileName: string;
2073
- kind: "single-file" | "folder";
2074
- title: string;
2075
- description?: string;
2076
- icon?: string;
2077
- contentPath: string;
2078
- createdAt: string;
2079
- updatedAt: string;
2080
- sizeBytes: number;
2081
- favorite: boolean;
2082
- mainSidebar: boolean;
2083
- mainSidebarOrder?: number;
2084
- clientDeclared: boolean;
2085
- clientGranted: boolean;
2086
- lastOpenedAt?: string;
2087
- openCount: number;
2088
- sourceKind: "workspace" | "package";
2089
- packageId?: string;
2090
- packageVersion?: string;
2091
- };
2092
- type PanelAppList = {
2093
- workspacePath: string;
2094
- panelsPath: string;
2095
- entries: PanelAppEntry[];
2096
- unavailablePackages: Array<{
2097
- appId: string;
2098
- message: string;
2099
- }>;
2100
- };
2101
- type PanelAppContent = {
2102
- id: string;
2103
- appId: string;
2104
- fileName: string;
2105
- html: string;
2106
- contentType: "text/html; charset=utf-8";
2107
- capabilities: string[];
2108
- clientDeclared: boolean;
2109
- clientGranted: boolean;
2110
- serviceActions: string[];
2111
- };
2112
- type PanelAppDeleteResult = {
2113
- deleted: true;
2114
- fileName: string;
2115
- id: string;
2116
- };
2117
- type PanelAppBridgeSession = {
2118
- id: string;
2119
- token: string;
2120
- appId: string;
2121
- caller: ServiceActionCaller;
2122
- declaredCapabilities: string[];
2123
- declaredActions: string[];
2124
- clientDeclared: boolean;
2125
- createdAt: string;
2126
- expiresAt: string;
2127
- };
2128
- type PanelAppErrorCode = "AGENT_OBJECT_REQUEST_FAILED" | "AGENT_OBJECT_RESULT_NOT_SUBMITTED" | "AGENT_OBJECT_RESULT_SCHEMA_INVALID" | "AGENT_OBJECT_RESULT_TIMEOUT" | "AUTHORIZATION_REQUIRED" | "PANEL_APP_AGENT_REQUEST_INVALID" | "PANEL_APP_ASSET_TOKEN_EXPIRED" | "PANEL_APP_ASSET_TOKEN_INVALID" | "PANEL_APP_BRIDGE_SESSION_NOT_FOUND" | "PANEL_APP_CAPABILITY_NOT_DECLARED" | "PANEL_APP_CLIENT_NOT_DECLARED" | "PANEL_APP_INVALID_ASSET_PATH" | "PANEL_APP_INVALID_ID" | "PANEL_APP_INVALID_SOURCE_PATH" | "PANEL_APP_MANIFEST_INVALID" | "PANEL_APP_MANAGED_SOURCE" | "PANEL_APP_NOT_FOUND" | "PANEL_APP_READ_FAILED";
2129
- declare class PanelAppError extends Error {
2130
- readonly code: PanelAppErrorCode;
2131
- constructor(code: PanelAppErrorCode, message: string);
2132
- }
2133
- declare function isPanelAppError(error: unknown): error is PanelAppError;
2134
- declare const PANEL_APP_AGENT_CAPABILITIES: readonly ["agent:send", "agent:generateObject"];
2135
- type PanelAppAgentCapability = typeof PANEL_APP_AGENT_CAPABILITIES[number];
2136
- declare function isPanelAppAgentCapability(value: unknown): value is PanelAppAgentCapability;
2137
- type PanelAppCapabilityGrantCaller = {
2138
- surface: "panel-app";
2139
- appId: string;
2422
+ models: Array<{
2423
+ value: string;
2424
+ count: number;
2425
+ }>;
2140
2426
  };
2141
- type PanelAppCapabilityGrant = {
2142
- caller: PanelAppCapabilityGrantCaller;
2143
- capability: PanelAppAgentCapability;
2144
- grantedAt: string;
2427
+ type LlmUsageManagerOptions = {
2428
+ store?: LlmUsageStore;
2145
2429
  };
2146
- type PanelAppAgentSendPayload = {
2147
- sessionId?: string;
2148
- peerId?: string;
2149
- content: NcpMessagePart[];
2150
- message?: never;
2151
- metadata?: Record<string, unknown>;
2152
- } | {
2153
- sessionId?: string;
2154
- peerId?: string;
2155
- message: NcpMessage$1 | (Omit<NcpMessage$1, "sessionId"> & {
2156
- sessionId?: string;
2157
- });
2158
- content?: never;
2159
- metadata?: Record<string, unknown>;
2430
+ declare class LlmUsageManager {
2431
+ private readonly store;
2432
+ constructor(options?: LlmUsageManagerOptions);
2433
+ get snapshotPath(): string;
2434
+ get historyPath(): string;
2435
+ observeProviderManager: (providerManager: LlmProviderRuntime, source: string) => LlmProviderRuntime;
2436
+ record: (params: {
2437
+ observedAt?: string;
2438
+ source: string;
2439
+ model?: string | null;
2440
+ usage: Record<string, number>;
2441
+ }) => LlmUsageRecord | null;
2442
+ getSnapshot: () => LlmUsageRecord | null;
2443
+ getHistory: (limit?: string | number) => LlmUsageRecord[];
2444
+ resolveHistoryLimit: (value?: string | number) => number;
2445
+ getStats: () => LlmUsageStats;
2446
+ private readonly bumpCounter;
2447
+ private readonly toSortedCounts;
2448
+ }
2449
+ //#endregion
2450
+ //#region src/managers/inbox-delivery.manager.d.ts
2451
+ declare const MAX_INBOX_DELIVERY_CONTENT_LENGTH: number;
2452
+ type CreateInboxDeliveryInput = {
2453
+ title: string;
2454
+ summary?: string | null;
2455
+ content: string;
2456
+ contentType: InboxDeliveryContentType;
2457
+ source: InboxDeliverySource;
2160
2458
  };
2161
- type PanelAppAgentSendRequest = {
2162
- payload: PanelAppAgentSendPayload;
2459
+ type InboxDeliveryManagerOptions = {
2460
+ eventBus: Pick<EventBus$1, "emit">;
2461
+ storePath: string;
2163
2462
  };
2164
- type PanelAppAgentSendResult = NcpRunHandle;
2165
- type PanelAppAgentRunClient = {
2166
- send: (input: AgentRunSendIngressPayload) => Promise<NcpRunHandle>;
2167
- sendAndStreamEvents: (input: AgentRunSendIngressPayload) => AsyncGenerator<NcpEndpointEvent$1>;
2463
+ type InboxDeliveryErrorCode = "INBOX_DELIVERY_INVALID_CONTENT" | "INBOX_DELIVERY_INVALID_SUMMARY" | "INBOX_DELIVERY_INVALID_TITLE" | "INBOX_DELIVERY_NOT_FOUND";
2464
+ declare class InboxDeliveryError extends Error {
2465
+ readonly code: InboxDeliveryErrorCode;
2466
+ constructor(code: InboxDeliveryErrorCode, message: string);
2467
+ }
2468
+ declare function isInboxDeliveryError(error: unknown): error is InboxDeliveryError;
2469
+ declare class InboxDeliveryManager {
2470
+ private readonly options;
2471
+ private readonly store;
2472
+ private writeQueue;
2473
+ constructor(options: InboxDeliveryManagerOptions);
2474
+ listDeliveries: () => Promise<InboxDeliveryListView>;
2475
+ getDelivery: (deliveryId: string) => Promise<InboxDelivery | null>;
2476
+ createDelivery: (input: CreateInboxDeliveryInput) => Promise<InboxDelivery>;
2477
+ updateDeliveryState: (deliveryId: string, action: InboxDeliveryStateAction) => Promise<InboxDelivery>;
2478
+ deleteDelivery: (deliveryId: string) => Promise<boolean>;
2479
+ private applyStateAction;
2480
+ private normalizeRequiredText;
2481
+ private normalizeOptionalText;
2482
+ private notFound;
2483
+ private publishChange;
2484
+ private mutate;
2485
+ }
2486
+ //#endregion
2487
+ //#region src/managers/system-object-reference.manager.d.ts
2488
+ type SystemObjectReferenceSnapshotSource = {
2489
+ item: SystemObjectReferenceItem;
2490
+ content: string;
2491
+ fileName: string;
2492
+ mimeType: string;
2168
2493
  };
2169
- type PanelAppAgentGenerateObjectInput = {
2170
- peerId: string;
2171
- prompt: string;
2172
- context?: unknown;
2173
- schema: Record<string, unknown>;
2174
- title?: string;
2175
- timeoutMs?: number;
2494
+ type SystemObjectReferenceProvider = {
2495
+ group: SystemObjectReferenceGroupDescriptor;
2496
+ list: () => Promise<readonly SystemObjectReferenceItem[]> | readonly SystemObjectReferenceItem[];
2497
+ resolve: (objectId: string) => Promise<SystemObjectReferenceSnapshotSource | null> | SystemObjectReferenceSnapshotSource | null;
2176
2498
  };
2177
- type PanelAppAgentGenerateObjectRequest = {
2178
- input: PanelAppAgentGenerateObjectInput;
2499
+ type SystemObjectReferenceErrorCode = "SYSTEM_OBJECT_INVALID_REFERENCE" | "SYSTEM_OBJECT_NOT_FOUND" | "SYSTEM_OBJECT_PROVIDER_CONTRACT";
2500
+ declare class SystemObjectReferenceError extends Error {
2501
+ readonly code: SystemObjectReferenceErrorCode;
2502
+ constructor(code: SystemObjectReferenceErrorCode, message: string);
2503
+ }
2504
+ declare function isSystemObjectReferenceError(error: unknown): error is SystemObjectReferenceError;
2505
+ declare class SystemObjectReferenceManager {
2506
+ private readonly assetStore;
2507
+ private readonly providers;
2508
+ private readonly resolvedCache;
2509
+ constructor(assetStore: Pick<LocalAssetStore, "putBytes" | "statRecord">, providers?: readonly SystemObjectReferenceProvider[]);
2510
+ registerProvider: (provider: SystemObjectReferenceProvider) => (() => void);
2511
+ listReferences: (params?: {
2512
+ query?: string;
2513
+ limit?: number;
2514
+ objectType?: string;
2515
+ }) => Promise<SystemObjectReferenceListView>;
2516
+ resolveReference: (uri: string) => Promise<SystemObjectResolvedReference>;
2517
+ private assertSnapshotContract;
2518
+ private assertListItemContract;
2519
+ }
2520
+ declare function createInboxDeliverySystemObjectProvider(manager: Pick<InboxDeliveryManager, "getDelivery" | "listDeliveries">): SystemObjectReferenceProvider;
2521
+ declare function createCronJobSystemObjectProvider(automation: Pick<AutomationManager, "listJobs">): SystemObjectReferenceProvider;
2522
+ //#endregion
2523
+ //#region src/managers/mcp.manager.d.ts
2524
+ declare class McpManager {
2525
+ private baseConfig;
2526
+ private currentMcpConfig;
2527
+ private readonly contributedServers;
2528
+ private readonly mcpLifecycleManager;
2529
+ private readonly mcpRegistryService;
2530
+ private readonly toolRegistryAdapter;
2531
+ private warmupPromise;
2532
+ constructor(getConfig: () => Config);
2533
+ listToolsForRun: (params: {
2534
+ agentId: string;
2535
+ }) => ReadonlyArray<NcpTool$1>;
2536
+ registerServer: (name: string, definition: McpServerDefinition$1) => Promise<() => Promise<void>>;
2537
+ listServers: () => _$_nextclaw_mcp0.McpServerRecord[];
2538
+ listTools: (filter?: McpCatalogFilter$1) => _$_nextclaw_mcp0.McpToolCatalogEntry[];
2539
+ callTool: (params: Parameters<McpRegistryService["callTool"]>[0]) => Promise<unknown>;
2540
+ start: () => void;
2541
+ applyConfig: (config: Config) => Promise<void>;
2542
+ dispose: () => Promise<void>;
2543
+ private buildEffectiveConfig;
2544
+ private prewarmEnabledServersSafely;
2545
+ }
2546
+ //#endregion
2547
+ //#region src/managers/session-context-compaction.manager.d.ts
2548
+ type SessionContextCompactionErrorCode = "CONTEXT_COMPACTION_UNSUPPORTED" | "NOTHING_TO_COMPACT" | "SESSION_BUSY" | "SESSION_NOT_FOUND";
2549
+ declare class SessionContextCompactionError extends Error {
2550
+ readonly code: SessionContextCompactionErrorCode;
2551
+ constructor(code: SessionContextCompactionErrorCode, message: string);
2552
+ }
2553
+ declare function isSessionContextCompactionError(error: unknown): error is SessionContextCompactionError;
2554
+ type SessionContextCompactionResult = {
2555
+ compacted: true;
2556
+ sessionId: string;
2179
2557
  };
2180
- type PanelAppAgentGenerateObjectResult = {
2181
- result: unknown;
2558
+ declare class SessionContextCompactionManager {
2559
+ private readonly agentRuntimeManager;
2560
+ private readonly eventBus;
2561
+ private readonly sessionManager;
2562
+ private readonly sessionRunManager;
2563
+ constructor(agentRuntimeManager: AgentRuntimeManager, eventBus: EventBus$1, sessionManager: SessionManager, sessionRunManager: SessionRunManager);
2564
+ compact: (requestedSessionId: string) => Promise<SessionContextCompactionResult>;
2565
+ }
2566
+ //#endregion
2567
+ //#region src/stores/panel-app-state.store.d.ts
2568
+ type PanelAppPreferencesUpdate = {
2569
+ favorite?: boolean;
2570
+ mainSidebar?: boolean;
2182
2571
  };
2183
2572
  //#endregion
2184
2573
  //#region src/utils/panel-app-source.utils.d.ts
@@ -2198,6 +2587,7 @@ declare class PanelAppManager {
2198
2587
  private readonly sourceService;
2199
2588
  private readonly packageStateManager;
2200
2589
  private readonly entryPresenter;
2590
+ private readonly removalService;
2201
2591
  constructor(params: {
2202
2592
  agentRunClient?: PanelAppAgentRunClient;
2203
2593
  configManager: ConfigManager;
@@ -2205,6 +2595,7 @@ declare class PanelAppManager {
2205
2595
  ingress?: Ingress$1;
2206
2596
  listPackageComponentSources?: () => Promise<AppPackageComponentSource[]>;
2207
2597
  listPackageComponentDiagnostics?: () => Promise<AppPackageUnavailableDiagnostic[]>;
2598
+ capabilityGrantManager: CapabilityGrantManager;
2208
2599
  });
2209
2600
  listPanelApps: () => Promise<PanelAppList>;
2210
2601
  getPanelAppContent: (id: string, sourcePath?: string) => Promise<PanelAppContent>;
@@ -2222,6 +2613,7 @@ declare class PanelAppManager {
2222
2613
  }) => Promise<PanelAppBridgeSession>;
2223
2614
  grantPanelAppClient: (appId: string) => Promise<PanelAppClientGrant>;
2224
2615
  revokePanelAppClient: (appId: string) => Promise<void>;
2616
+ matchesCapabilityGrant: (grant: CapabilityGrant) => Promise<boolean>;
2225
2617
  resolvePanelAppBridgeSession: (token: string) => PanelAppBridgeSession;
2226
2618
  deletePanelAppBridgeSession: (token: string) => void;
2227
2619
  sendAgentMessage: (bridgeSessionToken: string, payload: PanelAppAgentSendPayload) => Promise<PanelAppAgentSendResult>;
@@ -2234,14 +2626,14 @@ declare class PanelAppManager {
2234
2626
  private getPanelsPath;
2235
2627
  private createAssetBaseHref;
2236
2628
  private createStateStore;
2237
- private createCapabilityGrantStore;
2238
- private createClientGrantStore;
2239
2629
  private resolvePanelAppFileName;
2240
2630
  assertCanActivatePackageComponents: (components: AppPackageComponentSource[]) => Promise<void>;
2241
2631
  deactivatePackageComponents: (components: AppPackageComponentSource[]) => void;
2242
- removePackageComponentState: (components: AppPackageComponentSource[]) => Promise<void>;
2632
+ preparePackageComponentDeactivation: (components: AppPackageComponentSource[]) => (() => Promise<void>);
2633
+ removePackageComponentState: (components: AppPackageComponentSource[]) => Promise<() => Promise<void>>;
2243
2634
  private deleteExpiredBridgeSessions;
2244
2635
  private deleteBridgeSessionsByPanelAppId;
2636
+ private suspendBridgeSessionsByPanelAppId;
2245
2637
  private isPanelAppClientGranted;
2246
2638
  private isMissingFileError;
2247
2639
  }
@@ -2277,45 +2669,35 @@ declare class PreferenceManager {
2277
2669
  private isPlainRecord;
2278
2670
  }
2279
2671
  //#endregion
2280
- //#region src/services/mcp-service-app-runtime.service.d.ts
2281
- type RuntimeState = {
2282
- status: ServiceAppRuntimeStatus;
2283
- lastError?: string;
2284
- lastStartedAt?: string;
2285
- lastReadyAt?: string;
2286
- lastFailedAt?: string;
2672
+ //#region src/services/service-app-runtime.service.d.ts
2673
+ type RuntimeCall = {
2674
+ app: ServiceAppRecord;
2675
+ manifest: ServiceAppManifest;
2287
2676
  };
2288
- declare class McpServiceAppRuntimeService {
2289
- private readonly params;
2290
- private readonly lifecycleManager;
2291
- private readonly states;
2677
+ declare class ServiceAppRuntimeService {
2678
+ private readonly mcp;
2679
+ private readonly portable;
2680
+ private readonly protocols;
2292
2681
  constructor(params: {
2293
2682
  getConfig: () => Config;
2683
+ portableServiceRunnerPath?: string;
2294
2684
  });
2295
- getStatus: (appId: string) => RuntimeState;
2296
- listActions: ({
2297
- app,
2298
- manifest
2299
- }: {
2300
- app: ServiceAppRecord;
2301
- manifest: ServiceAppManifest;
2302
- }) => Promise<ServiceAction[]>;
2303
- invokeAction: ({
2304
- app,
2305
- manifest,
2306
- actionName,
2307
- input
2308
- }: {
2309
- app: ServiceAppRecord;
2310
- manifest: ServiceAppManifest;
2685
+ getStatus: (appId: string) => {
2686
+ status: ServiceAppRuntimeStatus;
2687
+ lastError?: string;
2688
+ lastStartedAt?: string;
2689
+ lastReadyAt?: string;
2690
+ lastFailedAt?: string;
2691
+ };
2692
+ start: (call: RuntimeCall) => Promise<void>;
2693
+ listActions: (call: RuntimeCall) => Promise<ServiceAction[]>;
2694
+ invokeAction: (call: RuntimeCall & {
2311
2695
  actionName: string;
2312
2696
  input: Record<string, unknown>;
2313
2697
  }) => Promise<unknown>;
2698
+ stop: (appId: string) => Promise<void>;
2314
2699
  restart: (appId: string) => Promise<void>;
2315
2700
  dispose: () => Promise<void>;
2316
- private toMcpServerRecord;
2317
- private createAppRuntimeEnv;
2318
- private toServiceAction;
2319
2701
  }
2320
2702
  //#endregion
2321
2703
  //#region src/services/service-app-record.service.d.ts
@@ -2356,11 +2738,17 @@ declare class ServiceAppManager {
2356
2738
  private readonly removalService;
2357
2739
  private readonly runtimeService;
2358
2740
  private readonly recordService;
2741
+ private readonly actionGrants;
2742
+ private readonly packageRuntime;
2743
+ private readonly lifecycleService;
2359
2744
  private reconciliationDiagnostics;
2360
2745
  constructor(params: {
2361
2746
  configManager: ConfigManager;
2362
2747
  runtimeService?: ServiceAppRuntime;
2363
2748
  listPackageComponentSources?: () => Promise<AppPackageComponentSource[]>;
2749
+ capabilityGrantManager: CapabilityGrantManager;
2750
+ hasAgent?: (agentId: string) => boolean;
2751
+ portableServiceRunnerPath?: string;
2364
2752
  });
2365
2753
  start: () => Promise<void>;
2366
2754
  listServiceApps: () => Promise<ServiceAppList>;
@@ -2376,30 +2764,30 @@ declare class ServiceAppManager {
2376
2764
  grantServiceActions: (actionIds: readonly string[], request: ServiceActionGrantRequest) => Promise<ServiceActionGrant[]>;
2377
2765
  listServiceActionGrants: () => Promise<ServiceActionGrant[]>;
2378
2766
  revokeServiceAction: (caller: ServiceActionCaller, actionId: string) => Promise<void>;
2767
+ matchesCapabilityGrant: (grant: CapabilityGrant) => Promise<boolean>;
2379
2768
  restartServiceApp: (appId: string) => Promise<ServiceAppRecord>;
2380
2769
  listWorkspaceDataOwners: () => Promise<WorkspaceServiceDataOwner[]>;
2381
2770
  deleteServiceApp: (appId: string, purgeData?: boolean) => Promise<ServiceAppDeleteResult>;
2382
2771
  dispose: () => Promise<void>;
2383
2772
  assertCanActivatePackageComponents: (components: AppPackageComponentSource[]) => Promise<void>;
2773
+ activatePackageComponents: (components: AppPackageComponentSource[]) => Promise<void>;
2384
2774
  deactivatePackageComponents: (components: AppPackageComponentSource[]) => Promise<void>;
2385
- removePackageComponentGrants: (components: AppPackageComponentSource[]) => Promise<void>;
2775
+ preparePackageComponentDeactivation: (components: AppPackageComponentSource[]) => Promise<() => Promise<void>>;
2776
+ removePackageComponentGrants: (components: AppPackageComponentSource[]) => Promise<() => Promise<void>>;
2386
2777
  private withGrantState;
2387
2778
  private requireServiceAction;
2388
2779
  private requireServiceAppForAction;
2389
2780
  private requireServiceApp;
2390
2781
  private listValidServiceApps;
2391
- private assertCaller;
2392
- private assertDeclaredAction;
2393
2782
  private normalizeActionIds;
2394
2783
  private getWorkspacePath;
2395
2784
  private getServiceAppsPath;
2396
2785
  private getServiceAppLockPath;
2397
- private createGrantStore;
2398
2786
  private listPackageComponentSources;
2399
2787
  private listServiceAppDirNames;
2400
2788
  private isMissingFileError;
2401
2789
  }
2402
- type ServiceAppRuntime = Pick<McpServiceAppRuntimeService, "dispose" | "getStatus" | "invokeAction" | "listActions" | "restart">; //# sourceMappingURL=service-app.manager.d.ts.map
2790
+ type ServiceAppRuntime = Pick<ServiceAppRuntimeService, "dispose" | "getStatus" | "invokeAction" | "listActions" | "restart" | "stop"> & Pick<Partial<ServiceAppRuntimeService>, "start">; //# sourceMappingURL=service-app.manager.d.ts.map
2403
2791
  //#endregion
2404
2792
  //#region src/utils/skill-frontmatter.utils.d.ts
2405
2793
  type LocalizedTextMap = Record<string, string>;
@@ -2510,13 +2898,29 @@ declare function dispatchAgentRuntimeSessionRequest(input: {
2510
2898
  }): Promise<void>;
2511
2899
  declare function createAgentRuntimeSessionRequestDispatcher(options: AgentRuntimeSessionRequestDispatcherOptions): SessionRequestDispatcher;
2512
2900
  //#endregion
2901
+ //#region src/features/feature-controls/types/feature-controls.types.d.ts
2902
+ type ProductFeatureControls = {
2903
+ desktopAutomation: {
2904
+ available: boolean;
2905
+ };
2906
+ };
2907
+ //#endregion
2908
+ //#region src/features/feature-controls/services/feature-controls.service.d.ts
2909
+ declare class FeatureControlsService {
2910
+ private readonly desktopHost;
2911
+ constructor(desktopHost: DesktopHost);
2912
+ get: () => Promise<ProductFeatureControls>;
2913
+ }
2914
+ //#endregion
2513
2915
  //#region src/app/nextclaw-kernel.d.ts
2514
2916
  type NextclawKernelOptions = {
2515
2917
  homeDir?: string;
2516
2918
  configPath?: string;
2517
2919
  builtInAppsDirectory?: string;
2920
+ portableServiceRunnerPath?: string;
2518
2921
  productVersion?: string;
2519
2922
  productActivitySink?: ProductActivitySink;
2923
+ desktopHost?: DesktopHost;
2520
2924
  };
2521
2925
  type NextclawKernelRuntimeControl<TGatewayInput, TUiInput, TStartInput> = {
2522
2926
  gateway: (input: TGatewayInput) => Promise<void>;
@@ -2569,12 +2973,14 @@ declare class NextclawKernel {
2569
2973
  readonly toolProviderManager: ToolProviderManager;
2570
2974
  readonly agentRunRequestManager: AgentRunRequestManager;
2571
2975
  readonly observations: ObservationManager;
2976
+ readonly capabilityGrants: CapabilityGrantManager;
2977
+ readonly featureControls: FeatureControlsService;
2978
+ private readonly capabilityGrantLegacyMigration;
2572
2979
  private readonly ncpAgentSessionJournalStore;
2573
2980
  private readonly contributions;
2574
2981
  private gatewayController;
2575
2982
  constructor(options?: NextclawKernelOptions);
2576
- private createContributions;
2577
- private installAppPackageRuntimeHooks;
2983
+ private createCapabilityGrantLegacyMigration;
2578
2984
  listSessionTypes: (params?: AgentRuntimeSessionTypeDescribeParams) => Promise<{
2579
2985
  defaultType: string;
2580
2986
  options: AgentRuntimeSessionTypeOption[];
@@ -2801,6 +3207,7 @@ type NextclawHarnessOptions = {
2801
3207
  homeDir?: string;
2802
3208
  configPath?: string;
2803
3209
  builtInAppsDirectory?: string;
3210
+ portableServiceRunnerPath?: string;
2804
3211
  productVersion?: string;
2805
3212
  productActivitySink?: {
2806
3213
  record: (signal: {
@@ -3004,6 +3411,48 @@ declare class PanelAppAssetTokenService {
3004
3411
  private parseClaims;
3005
3412
  }
3006
3413
  //#endregion
3414
+ //#region src/services/mcp-service-app-runtime.service.d.ts
3415
+ type RuntimeState = {
3416
+ status: ServiceAppRuntimeStatus;
3417
+ lastError?: string;
3418
+ lastStartedAt?: string;
3419
+ lastReadyAt?: string;
3420
+ lastFailedAt?: string;
3421
+ };
3422
+ declare class McpServiceAppRuntimeService {
3423
+ private readonly params;
3424
+ private readonly lifecycleManager;
3425
+ private readonly states;
3426
+ constructor(params: {
3427
+ getConfig: () => Config;
3428
+ });
3429
+ getStatus: (appId: string) => RuntimeState;
3430
+ listActions: ({
3431
+ app,
3432
+ manifest
3433
+ }: {
3434
+ app: ServiceAppRecord;
3435
+ manifest: ServiceAppManifest;
3436
+ }) => Promise<ServiceAction[]>;
3437
+ invokeAction: ({
3438
+ app,
3439
+ manifest,
3440
+ actionName,
3441
+ input
3442
+ }: {
3443
+ app: ServiceAppRecord;
3444
+ manifest: ServiceAppManifest;
3445
+ actionName: string;
3446
+ input: Record<string, unknown>;
3447
+ }) => Promise<unknown>;
3448
+ stop: (appId: string) => Promise<void>;
3449
+ restart: (appId: string) => Promise<void>;
3450
+ dispose: () => Promise<void>;
3451
+ private toMcpServerRecord;
3452
+ private createAppRuntimeEnv;
3453
+ private toServiceAction;
3454
+ }
3455
+ //#endregion
3007
3456
  //#region src/services/command-registry.service.d.ts
3008
3457
  type CommandOptionType = "string" | "boolean" | "number";
3009
3458
  type CommandOption = {
@@ -3277,5 +3726,5 @@ declare function resolveLegacyEventType(message: SessionMessage): string;
3277
3726
  declare function getUiContentParamsBootstrapScript(): string;
3278
3727
  declare function injectUiContentParamsBootstrap(html: string): string;
3279
3728
  //#endregion
3280
- export { AUTOMATIC_UPDATE_CHECK_INTERVAL_MS, AccessLoginResult, AccessManager, AccessManagerOptions, AccessPasswordStatus, AccessPrincipal, AccessRole, AccessSessionRecord, AccessSessionState, AgentManager, AgentManagerOptions, AgentRunClient, type AgentRunReply, type AgentRunReplyOptions, AgentRunSession, type AgentRunStreamOptions, type AgentRuntimeEntry, type AgentRuntimeProviderRegistration, AgentRuntimeSessionRequestDispatcherOptions, type AgentRuntimeSessionTypeCatalog, type AgentRuntimeSessionTypeDescribeParams, AgentRuntimeSessionTypeIcon, type AgentRuntimeSessionTypeOption, AgentRuntimeSessionTypeProvider, AppDataDeleteResult, AppDataDiagnostic, AppDataEntry, AppDataError, AppDataErrorCode, AppDataLifecycle, AppDataList, AppDataManager, AppDataSource, type AppEventEmitOptions, type AppEventEnvelope, type AppEventHandler, type AppEventKey, AppPackageComponentKind, AppPackageComponentSource, AppPackageComponentSourceList, AppPackageComponentView, AppPackageConflict, AppPackageError, AppPackageErrorCode, AppPackageHostTarget, AppPackageList, AppPackageManager, AppPackageOperationAction, AppPackageOperationInput, AppPackageOperationList, AppPackageOperationResult, AppPackageOperationStatus, AppPackageOperationView, AppPackageRuntimeHooks, AppPackageUnavailableDiagnostic, AppPackageView, type AssetApi, AutomationManager, AutomationManagerOptions, BindContextInput, type BuildAgentRunSendPayloadParams, BuildContextTailInput, BuiltinNarpRuntimeProviderService, CONTEXT_COMPACTION_CONTINUATION_TEXT, CONTEXT_COMPACTION_PROJECTION_KIND, CONTEXT_COMPACTION_PROJECTION_METADATA_KEY, CONTEXT_COMPACTION_SYSTEM_PREAMBLE, CONTEXT_COMPACTION_TIMELINE_KIND, ChannelManager, ChannelReplyRouterDispatchParams, CommandRegistry, ConfigManager, ConfigManagerOptions, ConfigManagerRuntimeHooks, ConfigMutationResult, ContextBinding, type ContextBlock, ContextCompactionJournalRecoveryService, ContextCompactionModelProjection, ContextCompactionPreflightBeginResult, ContextCompactionPreflightResult, ContextCompactionPreflightService, ContextCompactionTimelineCheckpoint, ContextCompactionTrigger, type ContextProvider, type ContextProviderRequest, Contribution, CreateAgentRunSessionParams, CreateInboxDeliveryInput, CreateProjectInput, DEFAULT_AGENT_RUNTIME_ENTRY_ID, DEFAULT_SERVICE_ACTION_RISK, DirectPromptDispatchExecution, DirectPromptDispatchParams, DirectPromptDispatchResult, type Disposer, EventAdmissionPolicy, EventBus, type EventBusOptions, EventDelivery, EventSubscription, EventSubscriptionBudget, ExtensionLoadProgress, ExtensionLoadResult, ExtensionManager, type ExtensionRuntimeStatus, GatewayInboundLoopRuntime, GatewayInboundProcessor, type IContextRegistry, type IKernel, type IMcpRegistry, type IModelRegistry, type INextclawAgent, type INextclawAgentRegistry, type INextclawAgentSessions, type INextclawContributionRegistry, type INextclawHarness, type INextclawRun, type INextclawSession, type INextclawSessionRegistry, type IRuntimeRegistry, type IToolRegistry, InboxDeliveryError, InboxDeliveryErrorCode, InboxDeliveryManager, InboxDeliveryManagerOptions, Ingress, type IngressContext, type IngressEnvelope, type IngressHandler, InstallationKind, InstalledSkillDetail, InstalledSkillSummary, InstalledSkillsList, JsonPointer, JsonValue, type Key, type LLMResponse, type LLMStreamEvent, type LearningLoopRuntimeConfig, LlmProviderManager, LlmProviderRuntime, LlmUsageManager, LlmUsageManagerOptions, LlmUsageRecord, LlmUsageSnapshot, LlmUsageStats, LlmUsageStore, LlmUsageStoreOptions, LlmUsageSummary, LocalizedTextMap, MAX_INBOX_DELIVERY_CONTENT_LENGTH, type McpCatalogFilter, McpManager, type McpServerDefinition, type McpServerRecord, McpServiceAppRuntimeService, type McpToolCallInput, type McpToolCatalogEntry, type ModelChatInput, NARP_HTTP_RUNTIME_KIND, NARP_STDIO_RUNTIME_KIND, NEXTCLAW_TIMELINE_KIND_METADATA_KEY, NcpAgentSessionJournalStore, type NcpEndpointEvent, type NcpMessage, type NcpTool, type NextclawAgentDefinition, type NextclawContributionDescriptor, NextclawHarness, NextclawHarnessError, type NextclawHarnessErrorCode, type NextclawHarnessOptions, NextclawKernel, NextclawKernelOptions, NextclawNcpResolvedAgentProfile, NextclawNcpResolvedRunContext, NextclawNcpRunContextResolveParams, type NextclawRunStatus, type NextclawSessionCreateInput, type NextclawSessionRunInput, type NextclawTaskInput, type NextclawTaskResult, ObservationCapabilityDescriptor, ObservationContextTail, ObservationEvent, ObservationEventAdmissionDecision, ObservationExtensionRuntime, ObservationManager, ObservationManagerOptions, ObservationRef, ObservationRelationshipStatus, ObservationState, ObservationTarget, PANEL_APP_AGENT_CAPABILITIES, PROJECT_TEMPLATE_IDS, PROVIDER_MODEL_CATALOG_REFRESH_INTERVAL_MS, PanelAppAgentCapability, PanelAppAgentGenerateObjectInput, PanelAppAgentGenerateObjectRequest, PanelAppAgentGenerateObjectResult, PanelAppAgentRunClient, PanelAppAgentSendPayload, PanelAppAgentSendRequest, PanelAppAgentSendResult, PanelAppAssetTokenService, PanelAppBridgeSession, PanelAppCapabilityGrant, PanelAppCapabilityGrantCaller, type PanelAppClientGrant, PanelAppContent, PanelAppDeleteResult, PanelAppEntry, PanelAppError, PanelAppErrorCode, PanelAppList, PanelAppManager, type PanelAppPreferencesUpdate, PreferenceEntry, PreferenceError, PreferenceErrorCode, PreferenceJsonValue, PreferenceManager, PreferenceManagerOptions, ProductActivityKind, ProductActivitySignal, ProductActivitySink, ProductActivitySource, ProjectError, ProjectErrorCode, ProjectManager, ProjectManagerOptions, ProjectRecord, ProjectTemplate, ProjectTemplateId, type ProviderCatalogPlugin, ProviderManagerNcpLLMApi, ProviderModelCatalogEntry, ProviderModelCatalogManager, ProviderModelCatalogSnapshot, ProviderModelsDiscoverInput, type ProviderSpec, ResolvedAgentProfile, SERVICE_APP_MANIFEST_FILE_NAME, ServiceAction, ServiceActionCaller, ServiceActionGrant, ServiceActionGrantRequest, ServiceActionGrantState, ServiceActionInvokeRequest, ServiceActionInvokeResult, ServiceActionRisk, ServiceActionRuntimeState, ServiceAppDeleteResult, ServiceAppError, type ServiceAppErrorCode, ServiceAppList, ServiceAppManager, ServiceAppManifest, ServiceAppManifestAction, ServiceAppProtocol, ServiceAppRecord, ServiceAppRuntimeStatus, SessionContextCompactionError, SessionContextCompactionErrorCode, SessionContextCompactionManager, SessionContextCompactionResult, SessionManager, SessionManagerOptions, SessionMessageCursorError, SessionMessagePage, SessionModelTokenUsage, type SessionPendingInput, type SessionQueuedInput, SessionRequestManager, SessionRequestManagerOptions, SessionSettingsError, SessionSettingsPatch, type SessionSteerQueuedInputResult, SessionTokenUsageStatus, SessionTokenUsageSummary, SessionTokenUsageTotals, SkillFrontmatter, type SkillInfo, SkillManager, type SkillScope, SubscribeEventsInput, SystemObjectReferenceError, SystemObjectReferenceErrorCode, SystemObjectReferenceManager, SystemObjectReferenceProvider, SystemObjectReferenceSnapshotSource, type TypedKey, TypedPredicate, UnsignedUpdateManifest, type Unsubscribe, UpdateBlockReason, UpdateHostKind, UpdateManifest, UpdateManifestReader, UpdateProgress, UpdateSnapshot, UpdateStatus, type WorkspaceServiceDataOwner, assertObservationJsonValue, assertObservationPredicate, buildAgentRunSendPayload, buildContextCompactionModelProjection, buildContextCompactionTimelineNcpMessage, buildLlmUsageSummary, buildLocalizedTextMap, buildNextclawNcpRunContext, buildObservationEventModelMessage, buildServiceActionId, createAgentRuntimeSessionRequestDispatcher, createAssetTools, createContextCompactionMessageId, createContextWindowSignature, createCronJobSystemObjectProvider, createInboxDeliverySystemObjectProvider, createLlmUsageRecord, createTypedKey, describeAgentRuntimeSessionTypes, dispatchAgentRuntimeSessionRequest, dispatchChannelReplyRoute, dispatchPromptOverNcp, dispatchPromptOverNcpResult, evaluateObservationEventAdmission, eventKeys, getAutomaticUpdateCheckDelay, getServiceActionName, getServiceAppManifestPath, getUiContentParamsBootstrapScript, getUnsignedUpdateManifest, hasLlmUsageTelemetry, ingressKeys, injectUiContentParamsBootstrap, isAppDataError, isAppPackageError, isContextCompactionProjectionMessage, isContextCompactionTimelineMessage, isContextWindowSnapshot, isInboxDeliveryError, isPanelAppAgentCapability, isPanelAppError, isPreferenceError, isProjectError, isReplyCapableChannel, isServiceAppError, isSessionContextCompactionError, isSessionMessageCursorError, isSessionSettingsError, isSystemObjectReferenceError, listExtensionChannelIds, listServiceAppManifestActions, matchesObservationPredicate, mergeServiceAppRuntimeActions, normalizeAgentRuntimeSessionTypeIcon, normalizeLlmUsageModel, normalizeOptionalString, parseObservationDuration, parseServiceAppManifest, parseSkillFrontmatter, readContextCompactionCheckpoint, readContextWindowEventSessionId, readJsonPointer, readLatestContextCompactionCheckpoint, readLearningLoopRuntimeConfig, readMetadataModel, readMetadataThinking, readServiceAppManifest, resolveAgentRuntimeEntries, resolveAutomaticUpdateCheckIntervalMs, resolveChannelReplyRoute, resolveEffectiveModel, resolveLegacyEventType, resolveSessionChannelContext, runGatewayInboundLoop, runNextclawTask, sanitizeLlmUsage, serializeContextTail, serializeUnsignedUpdateManifest, shouldRefreshContextWindowDuringStream, shouldRefreshContextWindowImmediately, startPromptOverNcpExecution, stripSkillFrontmatter, syncSessionThinkingPreference, toBoundedJson, toNcpMessages, waitForAgentRuntimeSessionReply };
3729
+ export { AUTOMATIC_UPDATE_CHECK_INTERVAL_MS, AccessLoginResult, AccessManager, AccessManagerOptions, AccessPasswordStatus, AccessPrincipal, AccessRole, AccessSessionRecord, AccessSessionState, AgentManager, AgentManagerOptions, AgentRunClient, type AgentRunReply, type AgentRunReplyOptions, AgentRunSession, type AgentRunStreamOptions, type AgentRuntimeEntry, type AgentRuntimeProviderRegistration, AgentRuntimeSessionRequestDispatcherOptions, type AgentRuntimeSessionTypeCatalog, type AgentRuntimeSessionTypeDescribeParams, AgentRuntimeSessionTypeIcon, type AgentRuntimeSessionTypeOption, AgentRuntimeSessionTypeProvider, AgentServiceActionCaller, AppDataDeleteResult, AppDataDiagnostic, AppDataEntry, AppDataError, AppDataErrorCode, AppDataLifecycle, AppDataList, AppDataManager, AppDataSource, type AppEventEmitOptions, type AppEventEnvelope, type AppEventHandler, type AppEventKey, AppPackageComponentKind, AppPackageComponentSource, AppPackageComponentSourceList, AppPackageComponentView, AppPackageConflict, AppPackageError, AppPackageErrorCode, AppPackageHostTarget, AppPackageList, AppPackageManager, AppPackageOperationAction, AppPackageOperationInput, AppPackageOperationList, AppPackageOperationResult, AppPackageOperationStatus, AppPackageOperationView, AppPackageRuntimeHooks, AppPackageUnavailableDiagnostic, AppPackageUninstallRollback, AppPackageView, type AssetApi, AutomationManager, AutomationManagerOptions, BindContextInput, type BuildAgentRunSendPayloadParams, BuildContextTailInput, BuiltinNarpRuntimeProviderService, CONTEXT_COMPACTION_CONTINUATION_TEXT, CONTEXT_COMPACTION_PROJECTION_KIND, CONTEXT_COMPACTION_PROJECTION_METADATA_KEY, CONTEXT_COMPACTION_SYSTEM_PREAMBLE, CONTEXT_COMPACTION_TIMELINE_KIND, CapabilityGrant, CapabilityGrantDecision, CapabilityGrantFilter, CapabilityGrantLegacyMigrationService, CapabilityGrantListener, CapabilityGrantManager, CapabilityGrantRequest, CapabilityGrantResource, CapabilityGrantRevocationListener, CapabilityGrantStore, CapabilityGrantSubject, ChannelManager, ChannelReplyRouterDispatchParams, CommandRegistry, ConfigManager, ConfigManagerOptions, ConfigManagerRuntimeHooks, ConfigMutationResult, ContextBinding, type ContextBlock, ContextCompactionJournalRecoveryService, ContextCompactionModelProjection, ContextCompactionPreflightBeginResult, ContextCompactionPreflightResult, ContextCompactionPreflightService, ContextCompactionTimelineCheckpoint, ContextCompactionTrigger, type ContextProvider, type ContextProviderRequest, Contribution, CreateAgentRunSessionParams, CreateInboxDeliveryInput, CreateProjectInput, DEFAULT_AGENT_RUNTIME_ENTRY_ID, DEFAULT_SERVICE_ACTION_RISK, DESKTOP_HOST_ACCESS, DESKTOP_HOST_PROTOCOL_VERSION, DesktopApplicationTarget, DesktopCapabilityError, DesktopCapabilityErrorCode, DesktopHost, DesktopHostAccess, DesktopHostCaller, DesktopHostCapabilityDeclaration, DesktopHostCapabilityManager, DesktopHostEvent, DesktopHostEventListener, DesktopHostManifest, DesktopHostMethod, DesktopHostRequest, DesktopHostResponse, DesktopHostStatus, DesktopNodeReplService, DesktopSessionCaller, DesktopSessionStateService, DesktopSnapshotOptions, DirectPromptDispatchExecution, DirectPromptDispatchParams, DirectPromptDispatchResult, type Disposer, EventAdmissionPolicy, EventBus, type EventBusOptions, EventDelivery, EventSubscription, EventSubscriptionBudget, ExtensionLoadProgress, ExtensionLoadResult, ExtensionManager, type ExtensionRuntimeStatus, FeatureControlsService, GatewayInboundLoopRuntime, GatewayInboundProcessor, type IContextRegistry, type IKernel, type IMcpRegistry, type IModelRegistry, type INextclawAgent, type INextclawAgentRegistry, type INextclawAgentSessions, type INextclawContributionRegistry, type INextclawHarness, type INextclawRun, type INextclawSession, type INextclawSessionRegistry, type IRuntimeRegistry, type IToolRegistry, InboxDeliveryError, InboxDeliveryErrorCode, InboxDeliveryManager, InboxDeliveryManagerOptions, Ingress, type IngressContext, type IngressEnvelope, type IngressHandler, InstallationKind, InstalledSkillDetail, InstalledSkillSummary, InstalledSkillsList, JsonPointer, JsonValue, type Key, type LLMResponse, type LLMStreamEvent, type LearningLoopRuntimeConfig, LlmProviderManager, LlmProviderRuntime, LlmUsageManager, LlmUsageManagerOptions, LlmUsageRecord, LlmUsageSnapshot, LlmUsageStats, LlmUsageStore, LlmUsageStoreOptions, LlmUsageSummary, LocalizedTextMap, MAX_INBOX_DELIVERY_CONTENT_LENGTH, type McpCatalogFilter, McpManager, type McpServerDefinition, type McpServerRecord, McpServiceAppRuntimeService, type McpToolCallInput, type McpToolCatalogEntry, type ModelChatInput, NARP_HTTP_RUNTIME_KIND, NARP_STDIO_RUNTIME_KIND, NEXTCLAW_TIMELINE_KIND_METADATA_KEY, NcpAgentSessionJournalStore, type NcpEndpointEvent, type NcpMessage, type NcpTool, type NextclawAgentDefinition, type NextclawContributionDescriptor, NextclawHarness, NextclawHarnessError, type NextclawHarnessErrorCode, type NextclawHarnessOptions, NextclawKernel, NextclawKernelOptions, NextclawNcpResolvedAgentProfile, NextclawNcpResolvedRunContext, NextclawNcpRunContextResolveParams, type NextclawRunStatus, type NextclawSessionCreateInput, type NextclawSessionRunInput, type NextclawTaskInput, type NextclawTaskResult, ObservationCapabilityDescriptor, ObservationContextTail, ObservationEvent, ObservationEventAdmissionDecision, ObservationExtensionRuntime, ObservationManager, ObservationManagerOptions, ObservationRef, ObservationRelationshipStatus, ObservationState, ObservationTarget, PANEL_APP_AGENT_CAPABILITIES, PROJECT_TEMPLATE_IDS, PROVIDER_MODEL_CATALOG_REFRESH_INTERVAL_MS, PanelAppAgentCapability, PanelAppAgentGenerateObjectInput, PanelAppAgentGenerateObjectRequest, PanelAppAgentGenerateObjectResult, PanelAppAgentRunClient, PanelAppAgentSendPayload, PanelAppAgentSendRequest, PanelAppAgentSendResult, PanelAppAssetTokenService, PanelAppBridgeSession, PanelAppCapabilityGrant, PanelAppCapabilityGrantCaller, PanelAppClientGrant, PanelAppContent, PanelAppDeleteResult, PanelAppEntry, PanelAppError, PanelAppErrorCode, PanelAppList, PanelAppManager, type PanelAppPreferencesUpdate, PanelServiceActionCaller, PreferenceEntry, PreferenceError, PreferenceErrorCode, PreferenceJsonValue, PreferenceManager, PreferenceManagerOptions, ProductActivityKind, ProductActivitySignal, ProductActivitySink, ProductActivitySource, type ProductFeatureControls, ProjectError, ProjectErrorCode, ProjectManager, ProjectManagerOptions, ProjectRecord, ProjectTemplate, ProjectTemplateId, type ProviderCatalogPlugin, ProviderManagerNcpLLMApi, ProviderModelCatalogEntry, ProviderModelCatalogManager, ProviderModelCatalogSnapshot, ProviderModelsDiscoverInput, type ProviderSpec, ResolvedAgentProfile, ResolvedDesktopApplicationTarget, SERVICE_APP_MANIFEST_FILE_NAME, ServiceAction, ServiceActionCaller, ServiceActionGrant, ServiceActionGrantRequest, ServiceActionGrantState, ServiceActionInvokeRequest, ServiceActionInvokeResult, ServiceActionRisk, ServiceActionRuntimeState, ServiceAppDeleteResult, ServiceAppError, type ServiceAppErrorCode, ServiceAppLifecycle, ServiceAppList, ServiceAppManager, ServiceAppManifest, ServiceAppManifestAction, ServiceAppProtocol, ServiceAppRecord, ServiceAppRuntimeService, ServiceAppRuntimeStatus, SessionContextCompactionError, SessionContextCompactionErrorCode, SessionContextCompactionManager, SessionContextCompactionResult, SessionManager, SessionManagerOptions, SessionMessageCursorError, SessionMessagePage, SessionModelTokenUsage, type SessionPendingInput, type SessionQueuedInput, SessionRequestManager, SessionRequestManagerOptions, SessionSettingsError, SessionSettingsPatch, type SessionSteerQueuedInputResult, SessionTokenUsageStatus, SessionTokenUsageSummary, SessionTokenUsageTotals, SkillFrontmatter, type SkillInfo, SkillManager, type SkillScope, SubscribeEventsInput, SystemObjectReferenceError, SystemObjectReferenceErrorCode, SystemObjectReferenceManager, SystemObjectReferenceProvider, SystemObjectReferenceSnapshotSource, type TypedKey, TypedPredicate, UnavailableDesktopHost, UnsignedUpdateManifest, type Unsubscribe, UpdateBlockReason, UpdateHostKind, UpdateManifest, UpdateManifestReader, UpdateProgress, UpdateSnapshot, UpdateStatus, type WorkspaceServiceDataOwner, assertObservationJsonValue, assertObservationPredicate, buildAgentRunSendPayload, buildContextCompactionModelProjection, buildContextCompactionTimelineNcpMessage, buildLlmUsageSummary, buildLocalizedTextMap, buildNextclawNcpRunContext, buildObservationEventModelMessage, buildServiceActionId, capabilityGrantCovers, createAgentRuntimeSessionRequestDispatcher, createAssetTools, createCapabilityDeclarationFingerprint, createContextCompactionMessageId, createContextWindowSignature, createCronJobSystemObjectProvider, createDesktopHostError, createInboxDeliverySystemObjectProvider, createLlmUsageRecord, createPanelAppAgentGrantRequest, createPanelAppClientGrantRequest, createServiceActionGrantRequest, createTypedKey, describeAgentRuntimeSessionTypes, dispatchAgentRuntimeSessionRequest, dispatchChannelReplyRoute, dispatchPromptOverNcp, dispatchPromptOverNcpResult, evaluateObservationEventAdmission, eventKeys, getAutomaticUpdateCheckDelay, getCapabilityGrantKey, getServiceActionName, getServiceAppManifestPath, getUiContentParamsBootstrapScript, getUnsignedUpdateManifest, hasLlmUsageTelemetry, ingressKeys, injectUiContentParamsBootstrap, isAppDataError, isAppPackageError, isContextCompactionProjectionMessage, isContextCompactionTimelineMessage, isContextWindowSnapshot, isInboxDeliveryError, isPanelAppAgentCapability, isPanelAppError, isPreferenceError, isProjectError, isReplyCapableChannel, isServiceAppError, isSessionContextCompactionError, isSessionMessageCursorError, isSessionSettingsError, isSystemObjectReferenceError, listExtensionChannelIds, listServiceAppManifestActions, matchesCapabilityGrantFilter, matchesObservationPredicate, mergeServiceAppRuntimeActions, normalizeAgentRuntimeSessionTypeIcon, normalizeCapabilityGrantRequest, normalizeLlmUsageModel, normalizeOptionalString, parseObservationDuration, parseServiceAppManifest, parseSkillFrontmatter, readContextCompactionCheckpoint, readContextWindowEventSessionId, readJsonPointer, readLatestContextCompactionCheckpoint, readLearningLoopRuntimeConfig, readMetadataModel, readMetadataThinking, readServiceActionTargetId, readServiceAppManifest, resolveAgentRuntimeEntries, resolveAutomaticUpdateCheckIntervalMs, resolveChannelReplyRoute, resolveEffectiveModel, resolveLegacyEventType, resolveSessionChannelContext, runGatewayInboundLoop, runNextclawTask, sanitizeLlmUsage, serializeContextTail, serializeUnsignedUpdateManifest, shouldRefreshContextWindowDuringStream, shouldRefreshContextWindowImmediately, startPromptOverNcpExecution, stripSkillFrontmatter, syncSessionThinkingPreference, toBoundedJson, toNcpMessages, waitForAgentRuntimeSessionReply };
3281
3730
  //# sourceMappingURL=index.d.ts.map