refactor: depend on SecretStore instead of the VaultStore class (P1.2)

Connectors, the connector SDK and registry, setup-connectors, provider-env,
the LiteLLM runtime config and the sidecar's `vault` decoration only read and
write secrets, so they now take the SecretStore interface. VaultStore is still
constructed in the sidecar and the service startup, and its file format is
unchanged. AGENTS.md now points at the interface.
This commit is contained in:
shumeiko.it
2026-10-24 16:44:28 +02:00
parent 9aae9d6537
commit 4ed21fe519
39 changed files with 84 additions and 84 deletions

View File

@@ -272,9 +272,9 @@ interface AgentPersona {
## 8. Security Constraints (Non-Negotiable)
1. **Secrets** belong in the secret store (`packages/core/src/vault.ts` until P1.2 replaces
it with a `SecretStore` interface) or an untracked local `.env`. Never in git. `.env.example`
holds placeholders only.
1. **Secrets** belong in the secret store (the `SecretStore` interface in
`packages/core/src/secret-store.ts`, implemented by `VaultStore` in `vault.ts`) or an
untracked local `.env`. Never in git. `.env.example` holds placeholders only.
2. **Injection defense.** Call `scanForInjection()` from `injection-scanner.ts` on all
connector and external input.
3. **No eval and no dynamic require.**

View File

@@ -8,7 +8,7 @@
import type { WaggleConnector, ConnectorResult } from './connector-sdk.js';
import { getConnectorCredential } from './connectors/connector-credentials.js';
import type { ToolDefinition } from './tools.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorDefinition, ConnectorHealth } from '@waggle/shared';
export interface AuditLogger {
@@ -25,10 +25,10 @@ interface ConnectorHydration {
export class ConnectorRegistry {
private connectors = new Map<string, WaggleConnector>();
private hydration = new WeakMap<WaggleConnector, ConnectorHydration>();
private vault: VaultStore;
private vault: SecretStore;
private auditLogger?: AuditLogger;
constructor(vault: VaultStore, auditLogger?: AuditLogger) {
constructor(vault: SecretStore, auditLogger?: AuditLogger) {
this.vault = vault;
this.auditLogger = auditLogger;
}

View File

@@ -7,7 +7,7 @@
*/
import type { ConnectorDefinition, ConnectorHealth, ConnectorStatus, ConnectorActionMeta } from '@waggle/shared';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
/** Full action definition with input/output schemas (runtime-only) */
export interface ConnectorAction {
@@ -58,7 +58,7 @@ export interface WaggleConnector {
readonly setupGuide?: string;
/** Initialize connector with vault credentials */
connect(vault: VaultStore): Promise<void>;
connect(vault: SecretStore): Promise<void>;
/** Check if connection is healthy */
healthCheck(): Promise<ConnectorHealth>;
/** Execute an action by name */
@@ -83,7 +83,7 @@ export abstract class BaseConnector implements WaggleConnector {
readonly category?: 'productivity' | 'development' | 'crm' | 'data' | 'communication' | 'storage' | 'integration';
readonly setupGuide?: string;
abstract connect(vault: VaultStore): Promise<void>;
abstract connect(vault: SecretStore): Promise<void>;
abstract healthCheck(): Promise<ConnectorHealth>;
abstract execute(action: string, params: Record<string, unknown>): Promise<ConnectorResult>;

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://api.airtable.com/v0';
@@ -107,7 +107,7 @@ export class AirtableConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://app.asana.com/api/1.0';
@@ -101,7 +101,7 @@ export class AsanaConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://api.bitbucket.org/2.0';
@@ -96,7 +96,7 @@ export class BitbucketConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -9,7 +9,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://backend.composio.dev/api/v1';
@@ -91,7 +91,7 @@ export class ComposioConnector extends BaseConnector {
private apiKey: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.apiKey = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
export class ConfluenceConnector extends BaseConnector {
@@ -90,7 +90,7 @@ export class ConfluenceConnector extends BaseConnector {
private authHeader: string | null = null;
private baseUrl: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
if (!cred) {
this.authHeader = null;

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://discord.com/api/v10';
@@ -94,7 +94,7 @@ export class DiscordConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -6,7 +6,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const RPC_BASE = 'https://api.dropboxapi.com/2';
@@ -89,7 +89,7 @@ export class DropboxConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -6,7 +6,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://api.sendgrid.com/v3';
@@ -72,7 +72,7 @@ export class EmailConnector extends BaseConnector {
private dailyResetDate = new Date().toISOString().slice(0, 10);
private maxDailyEmails = 100;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.apiKey = cred?.value ?? null;

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential, setConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const CALENDAR_API = 'https://www.googleapis.com/calendar/v3';
@@ -92,10 +92,10 @@ export class GoogleCalendarConnector extends BaseConnector {
private expiresAt: string | null = null;
private clientId: string | null = null;
private clientSecret: string | null = null;
private vault: VaultStore | null = null;
private vault: SecretStore | null = null;
private credentialGeneration = 0;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
this.credentialGeneration += 1;
this.vault = vault;
const cred = getConnectorCredential(vault, this.id);

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const DOCS_API = 'https://docs.googleapis.com/v1';
@@ -74,7 +74,7 @@ export class GoogleDocsConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://www.googleapis.com/drive/v3';
@@ -102,7 +102,7 @@ export class GoogleDriveConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://api.github.com';
@@ -126,7 +126,7 @@ export class GitHubConnector extends BaseConnector {
private token: string | null = null;
private baseUrl = API_BASE;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
// Support GitHub Enterprise via connector config

View File

@@ -6,7 +6,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const DEFAULT_API_BASE = 'https://gitlab.com/api/v4';
@@ -108,7 +108,7 @@ export class GitLabConnector extends BaseConnector {
private token: string | null = null;
private baseUrl = DEFAULT_API_BASE;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://gmail.googleapis.com/gmail/v1';
@@ -85,7 +85,7 @@ export class GmailConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://sheets.googleapis.com/v4';
@@ -90,7 +90,7 @@ export class GoogleSheetsConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://api.hubapi.com';
@@ -116,7 +116,7 @@ export class HubSpotConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorDefinition, ConnectorHealth, ConnectorStatus } from '@waggle/shared';
export class JiraConnector extends BaseConnector {
@@ -131,7 +131,7 @@ export class JiraConnector extends BaseConnector {
return super.toDefinition(effectiveStatus);
}
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
if (!cred) {
this.authHeader = null;

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_URL = 'https://api.linear.app/graphql';
@@ -102,7 +102,7 @@ export class LinearConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_URL = 'https://api.monday.com/v2';
@@ -91,7 +91,7 @@ export class MondayConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://graph.microsoft.com/v1.0';
@@ -95,7 +95,7 @@ export class MSTeamsConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://api.notion.com/v1';
@@ -114,7 +114,7 @@ export class NotionConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -10,7 +10,7 @@ import fs from 'node:fs';
import path from 'node:path';
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
function isContained(root: string, candidate: string): boolean {
@@ -105,7 +105,7 @@ export class ObsidianConnector extends BaseConnector {
private vaultPath: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.vaultPath = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://graph.microsoft.com/v1.0';
@@ -83,7 +83,7 @@ export class OneDriveConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -13,7 +13,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://graph.microsoft.com/v1.0';
@@ -125,7 +125,7 @@ export class OneNoteConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://graph.microsoft.com/v1.0';
@@ -117,7 +117,7 @@ export class OutlookConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://api.pipedrive.com/v1';
@@ -118,7 +118,7 @@ export class PipedriveConnector extends BaseConnector {
private apiToken: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.apiToken = cred?.value ?? null;
}

View File

@@ -6,7 +6,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
// ── Minimal shape of the optional `pg` module (only what we use) ──
@@ -90,7 +90,7 @@ export class PostgresConnector extends BaseConnector {
private pgModule: PgModule | null = null;
private client: PgClient | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.connectionString = cred?.value ?? null;

View File

@@ -7,7 +7,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import { safeFetch } from '../url-egress-guard.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorDefinition, ConnectorHealth, ConnectorStatus } from '@waggle/shared';
const API_VERSION = 'v59.0';
@@ -214,7 +214,7 @@ export class SalesforceConnector extends BaseConnector {
return super.toDefinition(effectiveStatus);
}
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://slack.com/api';
@@ -73,7 +73,7 @@ export class SlackConnector extends BaseConnector {
private token: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.token = cred?.value ?? null;
}

View File

@@ -5,7 +5,7 @@
import { BaseConnector, type ConnectorAction, type ConnectorResult } from '../connector-sdk.js';
import { getConnectorCredential } from './connector-credentials.js';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { ConnectorHealth } from '@waggle/shared';
const API_BASE = 'https://api.trello.com/1';
@@ -109,7 +109,7 @@ export class TrelloConnector extends BaseConnector {
private apiKey: string | null = null;
private apiToken: string | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
const cred = getConnectorCredential(vault, this.id);
this.apiToken = cred?.value ?? null;
// API key stored as a separate vault entry

View File

@@ -243,7 +243,7 @@ export class CredentialPool {
/**
* Minimal vault interface — just enough to load keys.
* Matches @waggle/core VaultStore.get() and VaultStore.has().
* Matches SecretStore.get() and SecretStore.has() from @waggle/core.
*/
export interface VaultLike {
get(name: string): { value: string } | null;

View File

@@ -372,7 +372,7 @@ declare module 'fastify' {
traceStore: import('@waggle/core').ExecutionTraceStore;
/** Active behavioral spec — the compiled `BEHAVIORAL_SPEC` baseline. */
activeBehavioralSpec: ReturnType<typeof import('@waggle/agent').buildActiveBehavioralSpec>;
vault: import('@waggle/core').VaultStore;
vault: import('@waggle/core').SecretStore;
embeddingProvider: import('@waggle/core').EmbeddingProviderInstance;
skillHashStore: import('@waggle/core').SkillHashStore;
scheduler: import('./cron.js').LocalScheduler;

View File

@@ -1,6 +1,6 @@
import fs from 'node:fs';
import path from 'node:path';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
import type { FastifyInstance } from 'fastify';
import {
discoverProviderModels,
@@ -108,7 +108,7 @@ export function buildLiteLLMRuntimeConfig(
/** Build the executable router catalog from the same live APIs used by the UI. */
export async function prepareLiteLLMRuntimeConfig(
dataDir: string,
vault: VaultStore,
vault: SecretStore,
discoveryOptions: DiscoveryOptions = {},
): Promise<LiteLLMRuntimeConfigResult> {
const catalogs = new Map<string, DiscoveredProviderModel[]>();

View File

@@ -1,4 +1,4 @@
import { WaggleConfig, type ProviderEntry, type VaultStore } from '@waggle/core';
import { WaggleConfig, type ProviderEntry, type SecretStore } from '@waggle/core';
/** Provider credentials consumed by LiteLLM and provider SDKs. */
export const PROVIDER_ENV_NAMES: Record<string, readonly string[]> = {
@@ -34,7 +34,7 @@ export function applyProviderKeyToEnv(
export function getProviderApiKeys(
providerId: string,
vault: VaultStore | null | undefined,
vault: SecretStore | null | undefined,
): string[] {
const candidates: string[] = [];
try {
@@ -52,13 +52,13 @@ export function getProviderApiKeys(
export function getProviderApiKey(
providerId: string,
vault: VaultStore | null | undefined,
vault: SecretStore | null | undefined,
): string | undefined {
return getProviderApiKeys(providerId, vault)[0];
}
/** Hydrate provider SDK/LiteLLM env before a child process snapshots it. */
export function hydrateProviderEnvFromVault(vault: VaultStore, overwrite = false): number {
export function hydrateProviderEnvFromVault(vault: SecretStore, overwrite = false): number {
let updated = 0;
for (const providerId of Object.keys(PROVIDER_ENV_NAMES)) {
const entry = vault.get(providerId);
@@ -73,7 +73,7 @@ export function hydrateProviderEnvFromVault(vault: VaultStore, overwrite = false
* the vault already holds. Returns the number of keys copied.
*/
export function copyProviderKeysToVault(
vault: VaultStore,
vault: SecretStore,
providers: Readonly<Record<string, ProviderEntry>>,
): number {
let copied = 0;
@@ -90,7 +90,7 @@ export function copyProviderKeysToVault(
}
/** Move legacy config.json secrets before LiteLLM starts, then scrub plaintext. */
export function migrateLegacyProviderKeysToVault(dataDir: string, vault: VaultStore): number {
export function migrateLegacyProviderKeysToVault(dataDir: string, vault: SecretStore): number {
const config = new WaggleConfig(dataDir);
const providers = config.getProviders();
const migrated = copyProviderKeysToVault(vault, providers);

View File

@@ -16,9 +16,9 @@ import {
MSTeamsConnector, OutlookConnector, OneDriveConnector, OneNoteConnector,
ComposioConnector,
} from '@waggle/agent';
import type { VaultStore } from '@waggle/core';
import type { SecretStore } from '@waggle/core';
export function registerConnectors(vault: VaultStore): ConnectorRegistry {
export function registerConnectors(vault: SecretStore): ConnectorRegistry {
const registry = new ConnectorRegistry(vault);
registry.register(new GitHubConnector());
registry.register(new SlackConnector());

View File

@@ -12,7 +12,7 @@ import Fastify from 'fastify';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as os from 'node:os';
import { MindDB, InstallAuditStore, VaultStore } from '@waggle/core';
import { MindDB, InstallAuditStore, VaultStore, type SecretStore } from '@waggle/core';
import {
ConnectorRegistry,
BaseConnector,
@@ -46,7 +46,7 @@ class TestConnector extends BaseConnector {
credentialValue: string | null = null;
connectGate: Promise<void> | null = null;
connectError: Error | null = null;
async connect(vault: VaultStore): Promise<void> {
async connect(vault: SecretStore): Promise<void> {
this.connectCalls += 1;
if (this.connectGate) await this.connectGate;
if (this.connectError) throw this.connectError;