@alfe.ai/claude-code-host 0.1.13 → 0.1.14

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.cts CHANGED
@@ -48,12 +48,18 @@ declare class AgentApiTransport {
48
48
  * @param extra.retry Whether to retry once on transient failures. Safe reads
49
49
  * (GET/HEAD/OPTIONS) default to true; mutations default to false. Set true
50
50
  * only when the endpoint's server-side contract is explicitly idempotent.
51
+ * @param extra.retryStatuses Narrow the HTTP statuses that trigger the retry
52
+ * (default 500/502/503/504). Network errors and timeouts are always retried
53
+ * when `retry` is on. Pass a subset when a status in the default set is a
54
+ * deterministic answer for this endpoint (e.g. a 502 that means "upstream
55
+ * denied", which a retry cannot change).
51
56
  * @param extra.signal Optional caller cancellation combined with the client's
52
57
  * own timeout budget. Aborting either signal cancels the request.
53
58
  */
54
59
  request<T>(path: string, options?: RequestInit, extra?: {
55
60
  timeoutMs?: number;
56
61
  retry?: boolean;
62
+ retryStatuses?: ReadonlySet<number>;
57
63
  signal?: AbortSignal;
58
64
  }): Promise<T>;
59
65
  }
@@ -82,7 +88,37 @@ interface ConnectProviderAccounts {
82
88
  provider: string;
83
89
  accounts: ConnectProviderAccount[];
84
90
  }
91
+ /**
92
+ * One AWS CLI profile an agent may use (`GET /agent/connect/aws/accounts`).
93
+ * `roleArn` is null for a connection's Direct identity. Carries no secret
94
+ * material; sessions are minted per call via `getAwsSession`.
95
+ */
96
+ interface AwsProfile {
97
+ profile: string;
98
+ roleArn: string | null;
99
+ accountId: string;
100
+ region: string;
101
+ label: string | null;
102
+ connectionId: string;
103
+ accountIdentifier: string;
104
+ displayName: string | null;
105
+ connectedAt: string;
106
+ }
107
+ /** AWS CLI `credential_process` output (Version 1), as minted by Connect. */
108
+ interface AwsSessionCredentials {
109
+ Version: 1;
110
+ AccessKeyId: string;
111
+ SecretAccessKey: string;
112
+ SessionToken: string;
113
+ /** ISO 8601 expiry. */
114
+ Expiration: string;
115
+ }
85
116
  declare class ConnectCredentialsApi extends ApiBase {
117
+ /** Platform application identity for private, local Telegram login. Never expose this to tools. */
118
+ telegramGetApplication(): Promise<{
119
+ apiId: number;
120
+ apiHash: string;
121
+ }>;
86
122
  /**
87
123
  * Discover all active Connections visible to this agent for one provider.
88
124
  * Preserve the provider-specific credential projection without guessing a
@@ -476,7 +512,9 @@ declare class ConnectCredentialsApi extends ApiBase {
476
512
  * endpoint walks the agent's full visible scope chain to find a matching
477
513
  * connection (works for inherited team/project Microsoft connections).
478
514
  */
479
- refreshMicrosoftAccountToken(accountIdentifier: string): Promise<{
515
+ refreshMicrosoftAccountToken(accountIdentifier: string, options?: {
516
+ connectionId?: string;
517
+ }): Promise<{
480
518
  accessToken: string;
481
519
  accessTokenExpiresAt: string;
482
520
  expiresAt: string;
@@ -691,12 +729,33 @@ declare class ConnectCredentialsApi extends ApiBase {
691
729
  * the fresh `accessJwt`) — callers typically ignore it and re-fetch via
692
730
  * `getSocialAccounts` for a consistent shape.
693
731
  */
694
- refreshSocialAccount(provider: string, accountIdentifier: string): Promise<{
732
+ refreshSocialAccount(provider: string, accountIdentifier: string, options?: {
733
+ connectionId?: string;
734
+ }): Promise<{
695
735
  accountIdentifier: string;
696
736
  accessToken: string;
697
737
  accessTokenExpiresAt: string;
698
738
  expiresAt: string;
699
739
  }>;
740
+ /**
741
+ * List the AWS CLI profiles visible to this agent across every in-scope AWS
742
+ * connection. Each entry names the `connectionId` + `profile` pair that
743
+ * {@link getAwsSession} mints a session for. Fields are selected explicitly;
744
+ * the wire row is never spread.
745
+ */
746
+ getAwsProfiles(): Promise<AwsProfile[]>;
747
+ /**
748
+ * Mint short-lived AWS session credentials for one profile of one AWS
749
+ * connection, in the AWS CLI `credential_process` (Version 1) shape. The
750
+ * server re-checks scope + active status on every call (403 otherwise; 404
751
+ * for an unknown profile; 403 `aws_access_denied` when AWS denies the
752
+ * assume, 502 on older servers). Minting has no persistent side effect, so
753
+ * one retry is safe, but only on genuinely transient failures (500/503/504
754
+ * and network errors): a denial is deterministic and a retry just doubles
755
+ * the latency of every failing `aws` call. The response is secret material:
756
+ * never log it.
757
+ */
758
+ getAwsSession(connectionId: string, profile: string): Promise<AwsSessionCredentials>;
700
759
  }
701
760
  //# sourceMappingURL=connect-credentials.d.ts.map
702
761
  //#endregion
@@ -1392,17 +1451,34 @@ declare class IdentityApi extends ApiBase {
1392
1451
  platformId: string;
1393
1452
  kind?: "user" | "agent" | "service" | "bot" | "workspace";
1394
1453
  displayName?: string;
1454
+ /**
1455
+ * Provider `email` only: the sender address, matched read-only against an
1456
+ * existing identity's verified email contact. Ignored for other providers.
1457
+ */
1458
+ email?: string;
1459
+ /**
1460
+ * Provider `email` only: `true` when this agent verified the sender
1461
+ * (SPF/DKIM/DMARC). Unverified email senders are never matched to an
1462
+ * identity. Ignored for other providers.
1463
+ */
1464
+ emailVerified?: boolean;
1395
1465
  }): Promise<{
1396
1466
  identityId: string | null;
1397
1467
  status: string;
1398
1468
  created?: boolean;
1399
1469
  reason?: string;
1400
1470
  /**
1401
- * Flattened auriclabs permission strings for the resolved identity
1402
- * (scope-prefixed where applicable). Empty array on miss / org service
1403
- * outage — the runtime gate fails closed in that case.
1471
+ * Flattened auriclabs permission strings that apply at the calling
1472
+ * agent's own scope (`agent:<agentId>`, plus unscoped entries). A sender
1473
+ * with no identity still receives the tenant's `principalKind="all"`
1474
+ * grants. Empty when nothing applies, or when `permissionsUnavailable`.
1404
1475
  */
1405
1476
  permissions: string[];
1477
+ /**
1478
+ * `true` when the org service could not resolve permissions. The empty
1479
+ * `permissions` is then an outage, not a denial: retry rather than deny.
1480
+ */
1481
+ permissionsUnavailable?: boolean;
1406
1482
  }>;
1407
1483
  searchIdentities(args?: {
1408
1484
  q?: string;
@@ -1632,6 +1708,48 @@ declare class WebhooksApi extends ApiBase {
1632
1708
  }
1633
1709
  //# sourceMappingURL=webhooks.d.ts.map
1634
1710
  //#endregion
1711
+ //#region src/domains/wallet.d.ts
1712
+ interface AgentWalletAccount {
1713
+ connectionId: string;
1714
+ chainType: "ethereum" | "solana";
1715
+ address: string;
1716
+ }
1717
+ type AgentWalletTransferStatus = "pending_approval" | "processing" | "succeeded" | "rejected" | "failed";
1718
+ interface AgentWalletTransfer {
1719
+ requestId: string;
1720
+ agentId: string;
1721
+ connectionId: string;
1722
+ chainType: "ethereum" | "solana";
1723
+ network: string;
1724
+ fromAddress: string;
1725
+ toAddress: string;
1726
+ amount: string;
1727
+ reason?: string;
1728
+ status: AgentWalletTransferStatus;
1729
+ providerStatus?: string;
1730
+ providerActionId?: string;
1731
+ failureReason?: string;
1732
+ billingStatus: "unmetered" | "metered" | "failed";
1733
+ createdAt: string;
1734
+ updatedAt: string;
1735
+ decidedAt?: string;
1736
+ }
1737
+ declare class WalletApi extends ApiBase {
1738
+ listWalletAccounts(): Promise<AgentWalletAccount[]>;
1739
+ /** Create a proposal only; a human approves it in the Alfe dashboard. */
1740
+ requestWalletTransfer(input: {
1741
+ connectionId: string;
1742
+ chainType: "ethereum" | "solana";
1743
+ network: "ethereum" | "base" | "arbitrum" | "optimism" | "solana";
1744
+ fromAddress: string;
1745
+ toAddress: string;
1746
+ amount: string;
1747
+ reason?: string;
1748
+ }): Promise<AgentWalletTransfer>;
1749
+ getWalletTransfer(requestId: string): Promise<AgentWalletTransfer>;
1750
+ }
1751
+ //# sourceMappingURL=wallet.d.ts.map
1752
+ //#endregion
1635
1753
  //#region src/domains/chat.d.ts
1636
1754
  declare class ChatApi extends ApiBase {
1637
1755
  ensureDirectConversation(identityId: string): Promise<{
@@ -2003,7 +2121,7 @@ declare class TeamsApi extends ApiBase {
2003
2121
 
2004
2122
  //#endregion
2005
2123
  //#region src/index.d.ts
2006
- interface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi, WebhooksApi {}
2124
+ interface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi, WebhooksApi, WalletApi {}
2007
2125
  declare class AgentApiClient extends ApiBase {
2008
2126
  constructor(config: AgentApiClientConfig);
2009
2127
  }
package/dist/index.d.ts CHANGED
@@ -48,12 +48,18 @@ declare class AgentApiTransport {
48
48
  * @param extra.retry Whether to retry once on transient failures. Safe reads
49
49
  * (GET/HEAD/OPTIONS) default to true; mutations default to false. Set true
50
50
  * only when the endpoint's server-side contract is explicitly idempotent.
51
+ * @param extra.retryStatuses Narrow the HTTP statuses that trigger the retry
52
+ * (default 500/502/503/504). Network errors and timeouts are always retried
53
+ * when `retry` is on. Pass a subset when a status in the default set is a
54
+ * deterministic answer for this endpoint (e.g. a 502 that means "upstream
55
+ * denied", which a retry cannot change).
51
56
  * @param extra.signal Optional caller cancellation combined with the client's
52
57
  * own timeout budget. Aborting either signal cancels the request.
53
58
  */
54
59
  request<T>(path: string, options?: RequestInit, extra?: {
55
60
  timeoutMs?: number;
56
61
  retry?: boolean;
62
+ retryStatuses?: ReadonlySet<number>;
57
63
  signal?: AbortSignal;
58
64
  }): Promise<T>;
59
65
  }
@@ -82,7 +88,37 @@ interface ConnectProviderAccounts {
82
88
  provider: string;
83
89
  accounts: ConnectProviderAccount[];
84
90
  }
91
+ /**
92
+ * One AWS CLI profile an agent may use (`GET /agent/connect/aws/accounts`).
93
+ * `roleArn` is null for a connection's Direct identity. Carries no secret
94
+ * material; sessions are minted per call via `getAwsSession`.
95
+ */
96
+ interface AwsProfile {
97
+ profile: string;
98
+ roleArn: string | null;
99
+ accountId: string;
100
+ region: string;
101
+ label: string | null;
102
+ connectionId: string;
103
+ accountIdentifier: string;
104
+ displayName: string | null;
105
+ connectedAt: string;
106
+ }
107
+ /** AWS CLI `credential_process` output (Version 1), as minted by Connect. */
108
+ interface AwsSessionCredentials {
109
+ Version: 1;
110
+ AccessKeyId: string;
111
+ SecretAccessKey: string;
112
+ SessionToken: string;
113
+ /** ISO 8601 expiry. */
114
+ Expiration: string;
115
+ }
85
116
  declare class ConnectCredentialsApi extends ApiBase {
117
+ /** Platform application identity for private, local Telegram login. Never expose this to tools. */
118
+ telegramGetApplication(): Promise<{
119
+ apiId: number;
120
+ apiHash: string;
121
+ }>;
86
122
  /**
87
123
  * Discover all active Connections visible to this agent for one provider.
88
124
  * Preserve the provider-specific credential projection without guessing a
@@ -476,7 +512,9 @@ declare class ConnectCredentialsApi extends ApiBase {
476
512
  * endpoint walks the agent's full visible scope chain to find a matching
477
513
  * connection (works for inherited team/project Microsoft connections).
478
514
  */
479
- refreshMicrosoftAccountToken(accountIdentifier: string): Promise<{
515
+ refreshMicrosoftAccountToken(accountIdentifier: string, options?: {
516
+ connectionId?: string;
517
+ }): Promise<{
480
518
  accessToken: string;
481
519
  accessTokenExpiresAt: string;
482
520
  expiresAt: string;
@@ -691,12 +729,33 @@ declare class ConnectCredentialsApi extends ApiBase {
691
729
  * the fresh `accessJwt`) — callers typically ignore it and re-fetch via
692
730
  * `getSocialAccounts` for a consistent shape.
693
731
  */
694
- refreshSocialAccount(provider: string, accountIdentifier: string): Promise<{
732
+ refreshSocialAccount(provider: string, accountIdentifier: string, options?: {
733
+ connectionId?: string;
734
+ }): Promise<{
695
735
  accountIdentifier: string;
696
736
  accessToken: string;
697
737
  accessTokenExpiresAt: string;
698
738
  expiresAt: string;
699
739
  }>;
740
+ /**
741
+ * List the AWS CLI profiles visible to this agent across every in-scope AWS
742
+ * connection. Each entry names the `connectionId` + `profile` pair that
743
+ * {@link getAwsSession} mints a session for. Fields are selected explicitly;
744
+ * the wire row is never spread.
745
+ */
746
+ getAwsProfiles(): Promise<AwsProfile[]>;
747
+ /**
748
+ * Mint short-lived AWS session credentials for one profile of one AWS
749
+ * connection, in the AWS CLI `credential_process` (Version 1) shape. The
750
+ * server re-checks scope + active status on every call (403 otherwise; 404
751
+ * for an unknown profile; 403 `aws_access_denied` when AWS denies the
752
+ * assume, 502 on older servers). Minting has no persistent side effect, so
753
+ * one retry is safe, but only on genuinely transient failures (500/503/504
754
+ * and network errors): a denial is deterministic and a retry just doubles
755
+ * the latency of every failing `aws` call. The response is secret material:
756
+ * never log it.
757
+ */
758
+ getAwsSession(connectionId: string, profile: string): Promise<AwsSessionCredentials>;
700
759
  }
701
760
  //# sourceMappingURL=connect-credentials.d.ts.map
702
761
  //#endregion
@@ -1392,17 +1451,34 @@ declare class IdentityApi extends ApiBase {
1392
1451
  platformId: string;
1393
1452
  kind?: "user" | "agent" | "service" | "bot" | "workspace";
1394
1453
  displayName?: string;
1454
+ /**
1455
+ * Provider `email` only: the sender address, matched read-only against an
1456
+ * existing identity's verified email contact. Ignored for other providers.
1457
+ */
1458
+ email?: string;
1459
+ /**
1460
+ * Provider `email` only: `true` when this agent verified the sender
1461
+ * (SPF/DKIM/DMARC). Unverified email senders are never matched to an
1462
+ * identity. Ignored for other providers.
1463
+ */
1464
+ emailVerified?: boolean;
1395
1465
  }): Promise<{
1396
1466
  identityId: string | null;
1397
1467
  status: string;
1398
1468
  created?: boolean;
1399
1469
  reason?: string;
1400
1470
  /**
1401
- * Flattened auriclabs permission strings for the resolved identity
1402
- * (scope-prefixed where applicable). Empty array on miss / org service
1403
- * outage — the runtime gate fails closed in that case.
1471
+ * Flattened auriclabs permission strings that apply at the calling
1472
+ * agent's own scope (`agent:<agentId>`, plus unscoped entries). A sender
1473
+ * with no identity still receives the tenant's `principalKind="all"`
1474
+ * grants. Empty when nothing applies, or when `permissionsUnavailable`.
1404
1475
  */
1405
1476
  permissions: string[];
1477
+ /**
1478
+ * `true` when the org service could not resolve permissions. The empty
1479
+ * `permissions` is then an outage, not a denial: retry rather than deny.
1480
+ */
1481
+ permissionsUnavailable?: boolean;
1406
1482
  }>;
1407
1483
  searchIdentities(args?: {
1408
1484
  q?: string;
@@ -1632,6 +1708,48 @@ declare class WebhooksApi extends ApiBase {
1632
1708
  }
1633
1709
  //# sourceMappingURL=webhooks.d.ts.map
1634
1710
  //#endregion
1711
+ //#region src/domains/wallet.d.ts
1712
+ interface AgentWalletAccount {
1713
+ connectionId: string;
1714
+ chainType: "ethereum" | "solana";
1715
+ address: string;
1716
+ }
1717
+ type AgentWalletTransferStatus = "pending_approval" | "processing" | "succeeded" | "rejected" | "failed";
1718
+ interface AgentWalletTransfer {
1719
+ requestId: string;
1720
+ agentId: string;
1721
+ connectionId: string;
1722
+ chainType: "ethereum" | "solana";
1723
+ network: string;
1724
+ fromAddress: string;
1725
+ toAddress: string;
1726
+ amount: string;
1727
+ reason?: string;
1728
+ status: AgentWalletTransferStatus;
1729
+ providerStatus?: string;
1730
+ providerActionId?: string;
1731
+ failureReason?: string;
1732
+ billingStatus: "unmetered" | "metered" | "failed";
1733
+ createdAt: string;
1734
+ updatedAt: string;
1735
+ decidedAt?: string;
1736
+ }
1737
+ declare class WalletApi extends ApiBase {
1738
+ listWalletAccounts(): Promise<AgentWalletAccount[]>;
1739
+ /** Create a proposal only; a human approves it in the Alfe dashboard. */
1740
+ requestWalletTransfer(input: {
1741
+ connectionId: string;
1742
+ chainType: "ethereum" | "solana";
1743
+ network: "ethereum" | "base" | "arbitrum" | "optimism" | "solana";
1744
+ fromAddress: string;
1745
+ toAddress: string;
1746
+ amount: string;
1747
+ reason?: string;
1748
+ }): Promise<AgentWalletTransfer>;
1749
+ getWalletTransfer(requestId: string): Promise<AgentWalletTransfer>;
1750
+ }
1751
+ //# sourceMappingURL=wallet.d.ts.map
1752
+ //#endregion
1635
1753
  //#region src/domains/chat.d.ts
1636
1754
  declare class ChatApi extends ApiBase {
1637
1755
  ensureDirectConversation(identityId: string): Promise<{
@@ -2003,7 +2121,7 @@ declare class TeamsApi extends ApiBase {
2003
2121
 
2004
2122
  //#endregion
2005
2123
  //#region src/index.d.ts
2006
- interface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi, WebhooksApi {}
2124
+ interface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi, WebhooksApi, WalletApi {}
2007
2125
  declare class AgentApiClient extends ApiBase {
2008
2126
  constructor(config: AgentApiClientConfig);
2009
2127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/claude-code-host",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Chat bridge that makes a self-hosted Claude Code agent reachable from Alfe chat on the user's Claude subscription",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "dist"
20
20
  ],
21
21
  "dependencies": {
22
- "@alfe.ai/agent-api-client": "^0.19.0",
22
+ "@alfe.ai/agent-api-client": "^0.20.0",
23
23
  "@alfe.ai/chat": "^0.0.19",
24
24
  "@alfe.ai/config": "^0.4.1"
25
25
  },