diff --git a/AGENTS.md b/AGENTS.md index 77d9ad7..35f7016 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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.** diff --git a/packages/agent/src/connector-registry.ts b/packages/agent/src/connector-registry.ts index af8c842..2469bf0 100644 --- a/packages/agent/src/connector-registry.ts +++ b/packages/agent/src/connector-registry.ts @@ -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(); private hydration = new WeakMap(); - 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; } diff --git a/packages/agent/src/connector-sdk.ts b/packages/agent/src/connector-sdk.ts index 20e5cff..359a3f7 100644 --- a/packages/agent/src/connector-sdk.ts +++ b/packages/agent/src/connector-sdk.ts @@ -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; + connect(vault: SecretStore): Promise; /** Check if connection is healthy */ healthCheck(): Promise; /** 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; + abstract connect(vault: SecretStore): Promise; abstract healthCheck(): Promise; abstract execute(action: string, params: Record): Promise; diff --git a/packages/agent/src/connectors/airtable-connector.ts b/packages/agent/src/connectors/airtable-connector.ts index e73c323..243ba2a 100644 --- a/packages/agent/src/connectors/airtable-connector.ts +++ b/packages/agent/src/connectors/airtable-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/asana-connector.ts b/packages/agent/src/connectors/asana-connector.ts index 3c576ef..c022bba 100644 --- a/packages/agent/src/connectors/asana-connector.ts +++ b/packages/agent/src/connectors/asana-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/bitbucket-connector.ts b/packages/agent/src/connectors/bitbucket-connector.ts index 9ff0bcb..9839d24 100644 --- a/packages/agent/src/connectors/bitbucket-connector.ts +++ b/packages/agent/src/connectors/bitbucket-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/composio-connector.ts b/packages/agent/src/connectors/composio-connector.ts index e3a99d4..dc42480 100644 --- a/packages/agent/src/connectors/composio-connector.ts +++ b/packages/agent/src/connectors/composio-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.apiKey = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/confluence-connector.ts b/packages/agent/src/connectors/confluence-connector.ts index 276fcea..1edd72c 100644 --- a/packages/agent/src/connectors/confluence-connector.ts +++ b/packages/agent/src/connectors/confluence-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); if (!cred) { this.authHeader = null; diff --git a/packages/agent/src/connectors/discord-connector.ts b/packages/agent/src/connectors/discord-connector.ts index 315fdd0..871b084 100644 --- a/packages/agent/src/connectors/discord-connector.ts +++ b/packages/agent/src/connectors/discord-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/dropbox-connector.ts b/packages/agent/src/connectors/dropbox-connector.ts index e3e5fea..b340487 100644 --- a/packages/agent/src/connectors/dropbox-connector.ts +++ b/packages/agent/src/connectors/dropbox-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/email-connector.ts b/packages/agent/src/connectors/email-connector.ts index fccfa90..d5e3545 100644 --- a/packages/agent/src/connectors/email-connector.ts +++ b/packages/agent/src/connectors/email-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.apiKey = cred?.value ?? null; diff --git a/packages/agent/src/connectors/gcal-connector.ts b/packages/agent/src/connectors/gcal-connector.ts index d9a9c05..a2b7a61 100644 --- a/packages/agent/src/connectors/gcal-connector.ts +++ b/packages/agent/src/connectors/gcal-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { this.credentialGeneration += 1; this.vault = vault; const cred = getConnectorCredential(vault, this.id); diff --git a/packages/agent/src/connectors/gdocs-connector.ts b/packages/agent/src/connectors/gdocs-connector.ts index f63f1db..b3f10b7 100644 --- a/packages/agent/src/connectors/gdocs-connector.ts +++ b/packages/agent/src/connectors/gdocs-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/gdrive-connector.ts b/packages/agent/src/connectors/gdrive-connector.ts index 5aa49dc..9cd74d4 100644 --- a/packages/agent/src/connectors/gdrive-connector.ts +++ b/packages/agent/src/connectors/gdrive-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/github-connector.ts b/packages/agent/src/connectors/github-connector.ts index c9a60bf..b6c9082 100644 --- a/packages/agent/src/connectors/github-connector.ts +++ b/packages/agent/src/connectors/github-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; // Support GitHub Enterprise via connector config diff --git a/packages/agent/src/connectors/gitlab-connector.ts b/packages/agent/src/connectors/gitlab-connector.ts index 73c6680..27c4b3a 100644 --- a/packages/agent/src/connectors/gitlab-connector.ts +++ b/packages/agent/src/connectors/gitlab-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; diff --git a/packages/agent/src/connectors/gmail-connector.ts b/packages/agent/src/connectors/gmail-connector.ts index 3eb46fa..d2c761a 100644 --- a/packages/agent/src/connectors/gmail-connector.ts +++ b/packages/agent/src/connectors/gmail-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/gsheets-connector.ts b/packages/agent/src/connectors/gsheets-connector.ts index 7e5bda1..93fd6f4 100644 --- a/packages/agent/src/connectors/gsheets-connector.ts +++ b/packages/agent/src/connectors/gsheets-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/hubspot-connector.ts b/packages/agent/src/connectors/hubspot-connector.ts index 16f196e..199416c 100644 --- a/packages/agent/src/connectors/hubspot-connector.ts +++ b/packages/agent/src/connectors/hubspot-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/jira-connector.ts b/packages/agent/src/connectors/jira-connector.ts index 5aa6247..ccb2252 100644 --- a/packages/agent/src/connectors/jira-connector.ts +++ b/packages/agent/src/connectors/jira-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); if (!cred) { this.authHeader = null; diff --git a/packages/agent/src/connectors/linear-connector.ts b/packages/agent/src/connectors/linear-connector.ts index 7826007..df413e7 100644 --- a/packages/agent/src/connectors/linear-connector.ts +++ b/packages/agent/src/connectors/linear-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/monday-connector.ts b/packages/agent/src/connectors/monday-connector.ts index 3d5babd..2ffe1a4 100644 --- a/packages/agent/src/connectors/monday-connector.ts +++ b/packages/agent/src/connectors/monday-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/ms-teams-connector.ts b/packages/agent/src/connectors/ms-teams-connector.ts index 4a32d3c..94f3ac3 100644 --- a/packages/agent/src/connectors/ms-teams-connector.ts +++ b/packages/agent/src/connectors/ms-teams-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/notion-connector.ts b/packages/agent/src/connectors/notion-connector.ts index 136a372..63ec9a0 100644 --- a/packages/agent/src/connectors/notion-connector.ts +++ b/packages/agent/src/connectors/notion-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/obsidian-connector.ts b/packages/agent/src/connectors/obsidian-connector.ts index c4ad1a1..92a1313 100644 --- a/packages/agent/src/connectors/obsidian-connector.ts +++ b/packages/agent/src/connectors/obsidian-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.vaultPath = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/onedrive-connector.ts b/packages/agent/src/connectors/onedrive-connector.ts index d4ea5e9..9ed9a89 100644 --- a/packages/agent/src/connectors/onedrive-connector.ts +++ b/packages/agent/src/connectors/onedrive-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/onenote-connector.ts b/packages/agent/src/connectors/onenote-connector.ts index 64ab47e..3182eaf 100644 --- a/packages/agent/src/connectors/onenote-connector.ts +++ b/packages/agent/src/connectors/onenote-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/outlook-connector.ts b/packages/agent/src/connectors/outlook-connector.ts index 50134c4..c09c967 100644 --- a/packages/agent/src/connectors/outlook-connector.ts +++ b/packages/agent/src/connectors/outlook-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/pipedrive-connector.ts b/packages/agent/src/connectors/pipedrive-connector.ts index dfb91e2..109c933 100644 --- a/packages/agent/src/connectors/pipedrive-connector.ts +++ b/packages/agent/src/connectors/pipedrive-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.apiToken = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/postgres-connector.ts b/packages/agent/src/connectors/postgres-connector.ts index 4536b8f..bd9ca3d 100644 --- a/packages/agent/src/connectors/postgres-connector.ts +++ b/packages/agent/src/connectors/postgres-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.connectionString = cred?.value ?? null; diff --git a/packages/agent/src/connectors/salesforce-connector.ts b/packages/agent/src/connectors/salesforce-connector.ts index 5441f28..f868f10 100644 --- a/packages/agent/src/connectors/salesforce-connector.ts +++ b/packages/agent/src/connectors/salesforce-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; diff --git a/packages/agent/src/connectors/slack-connector.ts b/packages/agent/src/connectors/slack-connector.ts index 2cc71eb..bfe0b9e 100644 --- a/packages/agent/src/connectors/slack-connector.ts +++ b/packages/agent/src/connectors/slack-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.token = cred?.value ?? null; } diff --git a/packages/agent/src/connectors/trello-connector.ts b/packages/agent/src/connectors/trello-connector.ts index 7dab5e4..1ed48d0 100644 --- a/packages/agent/src/connectors/trello-connector.ts +++ b/packages/agent/src/connectors/trello-connector.ts @@ -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 { + async connect(vault: SecretStore): Promise { const cred = getConnectorCredential(vault, this.id); this.apiToken = cred?.value ?? null; // API key stored as a separate vault entry diff --git a/packages/agent/src/credential-pool.ts b/packages/agent/src/credential-pool.ts index 9ee3010..d64aa67 100644 --- a/packages/agent/src/credential-pool.ts +++ b/packages/agent/src/credential-pool.ts @@ -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; diff --git a/packages/server/src/local/index.ts b/packages/server/src/local/index.ts index 4d5360f..19ab756 100644 --- a/packages/server/src/local/index.ts +++ b/packages/server/src/local/index.ts @@ -372,7 +372,7 @@ declare module 'fastify' { traceStore: import('@waggle/core').ExecutionTraceStore; /** Active behavioral spec — the compiled `BEHAVIORAL_SPEC` baseline. */ activeBehavioralSpec: ReturnType; - 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; diff --git a/packages/server/src/local/litellm-runtime-config.ts b/packages/server/src/local/litellm-runtime-config.ts index f9b1f55..8567270 100644 --- a/packages/server/src/local/litellm-runtime-config.ts +++ b/packages/server/src/local/litellm-runtime-config.ts @@ -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 { const catalogs = new Map(); diff --git a/packages/server/src/local/provider-env.ts b/packages/server/src/local/provider-env.ts index 1aa51b7..851f118 100644 --- a/packages/server/src/local/provider-env.ts +++ b/packages/server/src/local/provider-env.ts @@ -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 = { @@ -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>, ): 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); diff --git a/packages/server/src/local/setup-connectors.ts b/packages/server/src/local/setup-connectors.ts index 5181f03..80788c8 100644 --- a/packages/server/src/local/setup-connectors.ts +++ b/packages/server/src/local/setup-connectors.ts @@ -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()); diff --git a/packages/server/tests/local/connectors-phase4.test.ts b/packages/server/tests/local/connectors-phase4.test.ts index 9e33753..df726a9 100644 --- a/packages/server/tests/local/connectors-phase4.test.ts +++ b/packages/server/tests/local/connectors-phase4.test.ts @@ -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 | null = null; connectError: Error | null = null; - async connect(vault: VaultStore): Promise { + async connect(vault: SecretStore): Promise { this.connectCalls += 1; if (this.connectGate) await this.connectGate; if (this.connectError) throw this.connectError;