@hasna/knowledge 0.2.17 → 0.2.19

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
@@ -80,6 +80,11 @@ open-knowledge ingest source file:///absolute/path/to/handbook.md --purpose know
80
80
  # Consume open-files change events and invalidate stale source chunks
81
81
  open-knowledge reindex outbox ./open-files-outbox.jsonl --scope project --json
82
82
 
83
+ # Inspect and refresh the embedding queue after source changes
84
+ open-knowledge reindex status --scope project --json
85
+ open-knowledge reindex enqueue --scope project --json
86
+ open-knowledge reindex embeddings --scope project --fake --json
87
+
83
88
  # Resolve indexed source text and citation evidence through the read-only source boundary
84
89
  open-knowledge source resolve open-files://file/f_123/revision/rev_456 --scope project --json
85
90
 
@@ -102,6 +107,9 @@ open-knowledge search "company wiki policy" --scope project --context --json
102
107
  # Build a citation answer/context draft for a prompt
103
108
  open-knowledge ask "How do we cite handbook policy?" --scope project --json
104
109
  knowledge "How do we cite handbook policy?" --scope project --json
110
+
111
+ # Provider-native web search, safety-gated for real network access
112
+ HASNA_KNOWLEDGE_WEB_SEARCH=1 open-knowledge web search "latest AI SDK web search" --provider openai --json
105
113
  ```
106
114
 
107
115
  ## Commands
@@ -240,11 +248,23 @@ resolver API lands.
240
248
 
241
249
  ### reindex
242
250
  ```bash
251
+ open-knowledge reindex status [--model openai:text-embedding-3-small] [--scope project] [--json]
252
+ open-knowledge reindex enqueue [--model openai:text-embedding-3-small] [--scope project] [--json]
253
+ open-knowledge reindex embeddings [--full] [--limit <n>] [--model openai:text-embedding-3-small] [--scope project] [--json]
243
254
  open-knowledge reindex outbox <file|s3://bucket/key> [--scope project] [--json]
244
255
  ```
245
- Consume open-files JSON or JSONL change events. This invalidates matching
246
- source chunks and embeddings by source ref, revision, or hash, updates
247
- permission/path/delete metadata, and records a local run ledger.
256
+ Inspect and operate index refresh work. `reindex status` reports missing
257
+ embedding rows, stale revisions, queued jobs, and vector counts. `reindex
258
+ enqueue` adds missing source chunks to `reindex_queue` idempotently. `reindex
259
+ embeddings` records an `embedding-refresh` run, indexes missing chunks, and
260
+ marks completed queue rows; `--full` first clears `chunk_embeddings` and
261
+ `vector_index_entries` so the current source catalog is rebuilt from scratch.
262
+
263
+ `reindex outbox` consumes open-files JSON or JSONL change events. This
264
+ invalidates matching source chunks and embeddings by source ref, revision, or
265
+ hash, updates permission/path/delete metadata, and records a local run ledger.
266
+ Outbox inputs can be local files or allowed S3 objects, but raw source files
267
+ remain owned by `open-files`.
248
268
 
249
269
  ### search
250
270
  ```bash
@@ -276,6 +296,18 @@ pack, returns a local citation draft by default, records a run ledger in
276
296
  the flow deterministic for local tests. `--approve-write` records approval
277
297
  intent, but durable wiki writes remain deferred to the wiki compile/write task.
278
298
 
299
+ ### web
300
+ ```bash
301
+ open-knowledge web search <query> [--provider openai|anthropic] [--model provider:model] [--domain <domain>] [--file-results] [--scope project] [--json]
302
+ ```
303
+ Run provider-native hosted web search and return cited web sources. Real network
304
+ search is disabled unless `safety.network.web_search_enabled=true` or
305
+ `HASNA_KNOWLEDGE_WEB_SEARCH=1` is set. OpenAI uses the AI SDK OpenAI
306
+ `tools.webSearch` path; Anthropic uses its provider web-search tool when
307
+ available. `--file-results` stores returned snippets as read-only `web` source
308
+ refs in `knowledge.db` so later local search can cite them. `--fake` returns
309
+ deterministic offline sources for tests.
310
+
279
311
  ### safety
280
312
  ```bash
281
313
  open-knowledge safety status [--scope project] [--json]
@@ -354,11 +386,13 @@ The MCP server exposes item tools (`ok_add`, `ok_list`, `ok_get`, `ok_update`,
354
386
  `ok_import`, `ok_batch`), workspace/storage inspection (`ok_paths`,
355
387
  `ok_storage_status`), provider/embedding tools (`ok_provider_status`,
356
388
  `ok_provider_models`, `ok_embeddings_status`, `ok_embeddings_index`,
357
- `ok_semantic_search`), hybrid retrieval (`ok_search`), and source-ref
358
- parsing/resolution (`ok_parse_source_ref`, `ok_resolve_source`). The
359
- `knowledge_search` MCP tool returns reranked citation context packs for agent
360
- prompts, and `knowledge_ask` runs the same prompt flow exposed by
361
- `open-knowledge ask`.
389
+ `ok_semantic_search`), reindex tools (`ok_reindex_status`,
390
+ `ok_reindex_enqueue`, `ok_reindex_embeddings`), hybrid retrieval (`ok_search`),
391
+ and source-ref parsing/resolution (`ok_parse_source_ref`,
392
+ `ok_resolve_source`). The `knowledge_search` MCP tool returns reranked citation
393
+ context packs for agent prompts, and `knowledge_ask` runs the same prompt flow
394
+ exposed by `open-knowledge ask`. `ok_web_search` exposes safety-gated provider
395
+ web search to MCP clients.
362
396
 
363
397
  ## Source And Artifact Boundary
364
398