@gitpagedocs/tools 0.0.1 → 0.0.2

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/README.md CHANGED
@@ -7,7 +7,7 @@ The **shared business-logic core** of the [Git Page Docs](../README.md) monorepo
7
7
  | Module | Responsibility |
8
8
  |---|---|
9
9
  | `ai/` | 14-provider AI system — data-driven `PROVIDER_CATALOG`, registry + factory (no switch chains), 5 family adapters (OpenAI-compatible, Anthropic, Gemini, Ollama, Cohere), SSE/NDJSON streaming, legacy↔catalog id mapping |
10
- | `security/` | `EncryptedCredentialVault` (AES-256-GCM), `SessionPasswordGate`, plaintext migration; web + file storage adapters |
10
+ | `security/` | `EncryptedCredentialVault` (AES-256-GCM, PBKDF2-HMAC-SHA-256 key derivation), `SessionPasswordGate`, plaintext migration; `WebStorageVaultStorage` (site `localStorage` vault) + `FileVaultStorage` (the CLI `.gitpagedocsvault` file) adapters |
11
11
  | `crypto/` | `NodeCryptoService` + `WebCryptoService` (SHA-256, PBKDF2, AES-256-GCM, masking, secure wipe); `deriveDocAccessKeys` / `verifyDocAccess` (double-hash documentation password gate shared by the CLI `password` command and the frontend gate) |
12
12
  | `cache/` | `MemoryCache`, `FileCache`, `WebStorageCache` (Strategy over one `Cache` port) |
13
13
  | `config/` | `GitPageDocsConfigLoader` (`.json` / `.js` / `.ts`) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitpagedocs/tools",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "description": "Shared business-logic core for Git Page Docs (consumed by frontend, cli and mcp). Ships TypeScript source; consume via tsx or a TS-aware bundler.",
6
6
  "main": "./src/index.ts",
package/src/ai/catalog.ts CHANGED
@@ -71,11 +71,11 @@ export const PROVIDER_CATALOG: Readonly<Record<AiProviderId, ProviderSpec>> = {
71
71
  envVars: ["GEMINI_API_KEY", "GOOGLE_API_KEY"],
72
72
  label: "Google Gemini",
73
73
  family: "gemini",
74
- defaultModel: "gemini-2.0-flash",
74
+ defaultModel: "gemini-2.5-flash",
75
75
  baseUrl: "https://generativelanguage.googleapis.com/v1beta/models",
76
76
  auth: "query-key",
77
77
  capabilities: VISION_AUDIO,
78
- models: models("gemini-2.0-flash", "gemini-1.5-pro", "gemini-1.5-flash"),
78
+ models: models("gemini-2.5-flash", "gemini-2.5-pro", "gemini-2.0-flash"),
79
79
  },
80
80
  openrouter: {
81
81
  id: "openrouter",
@@ -60,7 +60,9 @@ export function securityNoteSection(): string {
60
60
  return [
61
61
  "### API key handling",
62
62
  "",
63
- "- API keys are stored **encrypted at rest** (AES-256-GCM) behind a local password — never in plaintext.",
63
+ "- API keys are stored **encrypted at rest** (AES-256-GCM, key derived with PBKDF2-HMAC-SHA-256) behind a local password — never in plaintext.",
64
+ "- Site: the `/ai` console and the chat drawer keep the vault in `localStorage`; the drawer locks itself after `site.AiChatAutoLockSeconds` idle seconds (default 30) and asks for the password again.",
65
+ "- CLI: `gitpagedocs ai` / `gitpagedocs chat` seal the key in `.gitpagedocsvault` next to `.gitpagedocsconfig`; the vault password is created on first use and asked on every run (`GITPAGEDOCS_VAULT_PASSWORD` for non-interactive runs).",
64
66
  "- The password gates sensitive operations and is held only in memory for the session.",
65
67
  "- Keys are **never logged** (the logger redacts secrets) and are sent only to the AI provider you select.",
66
68
  "- To report a vulnerability, open a security advisory or issue on the repository.",
@@ -74,8 +76,11 @@ export const CLI_COMMANDS: readonly CommandDoc[] = [
74
76
  { name: "provider [id]", summary: "list AI providers or show one" },
75
77
  { name: "models [provider]", summary: "list catalog models" },
76
78
  { name: "ai", summary: "interactive AI docs generator (writes pages in the gitpagedocs pattern)" },
79
+ { name: "chat [question]", summary: "streaming AI chat in the terminal (REPL on a TTY; one-shot with a question or piped stdin)" },
77
80
  { name: "document[:repo|:file|:folder]", summary: "generate documentation with AI in the gitpagedocs pattern" },
78
81
  { name: "password", summary: "set a documentation access password (writes the public key to config.json)" },
82
+ { name: "config clear", summary: "delete the stored .gitpagedocsconfig and the encrypted key vault" },
83
+ { name: "docs", summary: "refresh the managed regions of README, CONTRIBUTING and SECURITY" },
79
84
  { name: "deploy | pages", summary: "configure GitHub Pages via Actions and push" },
80
85
  { name: "doctor", summary: "diagnose the environment" },
81
86
  { name: "mcp start", summary: "start the MCP server over stdio" },