@fortemi/core 2026.5.0 → 2026.5.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 +103 -39
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# @fortemi/core
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
**Headless browser knowledge-management core powered by PGlite, typed repositories, and agent tool helpers**
|
|
6
|
+
|
|
7
|
+
Local PostgreSQL-compatible storage, migrations, note/search repositories, capability orchestration, Knowledge Shards, and bridge-ready tool metadata for browser applications.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @fortemi/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/@fortemi/core)
|
|
14
|
+
[](https://www.npmjs.com/package/@fortemi/core)
|
|
15
|
+
[](https://github.com/Fortemi/fortemi-react/blob/main/LICENSE)
|
|
16
|
+
[](https://nodejs.org)
|
|
17
|
+
[](https://www.typescriptlang.org)
|
|
18
|
+
|
|
19
|
+
[**Install**](#installation) · [**Quick Start**](#quick-start) · [**Surface**](#what-you-get) · [**Tools**](#tool-surface) · [**Docs**](#documentation) · [**License**](#license)
|
|
4
20
|
|
|
5
|
-
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## What @fortemi/core Is
|
|
26
|
+
|
|
27
|
+
`@fortemi/core` is the headless Fortemi runtime for browser applications. It provides a PGlite-backed archive, repository classes, migrations, eventing, capability management, Knowledge Shard import/export, and tool helpers that can be called from UI code or bridge adapters.
|
|
28
|
+
|
|
29
|
+
Use `@fortemi/core` directly when you are building your own UI, integrating Fortemi into a non-React host, or wiring agent/tool calls against an existing browser database context.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
6
32
|
|
|
7
33
|
```bash
|
|
8
34
|
pnpm add @fortemi/core
|
|
@@ -10,57 +36,95 @@ pnpm add @fortemi/core
|
|
|
10
36
|
npm install @fortemi/core
|
|
11
37
|
```
|
|
12
38
|
|
|
13
|
-
|
|
39
|
+
Runtime dependencies installed with the package:
|
|
14
40
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
41
|
+
| Dependency | Purpose |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `@electric-sql/pglite` | PostgreSQL compiled to WASM, plus pgvector |
|
|
44
|
+
| `@noble/hashes` | SHA hashing for content and integrity checks |
|
|
45
|
+
| `fflate` | Tar/gzip handling for Knowledge Shards |
|
|
46
|
+
| `uuid` | UUIDv7 identifiers |
|
|
47
|
+
| `zod` | Runtime input validation for tool helpers |
|
|
20
48
|
|
|
21
|
-
## Quick
|
|
49
|
+
## Quick Start
|
|
22
50
|
|
|
23
51
|
```ts
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
52
|
+
import {
|
|
53
|
+
ArchiveManager,
|
|
54
|
+
NotesRepository,
|
|
55
|
+
SearchRepository,
|
|
56
|
+
TypedEventBus,
|
|
57
|
+
registerServiceWorker,
|
|
58
|
+
} from '@fortemi/core'
|
|
59
|
+
|
|
60
|
+
const events = new TypedEventBus()
|
|
61
|
+
const archiveManager = new ArchiveManager('opfs', events)
|
|
62
|
+
const db = await archiveManager.open('default')
|
|
63
|
+
|
|
64
|
+
const notes = new NotesRepository(db, events)
|
|
65
|
+
const search = new SearchRepository(db)
|
|
66
|
+
|
|
67
|
+
const note = await notes.create({
|
|
35
68
|
title: 'Hello',
|
|
36
|
-
|
|
37
|
-
})
|
|
69
|
+
content: 'First note in the local archive.',
|
|
70
|
+
})
|
|
38
71
|
|
|
39
|
-
|
|
40
|
-
const results = await core.search.query({ text: 'hello' });
|
|
72
|
+
const results = await search.search('hello')
|
|
41
73
|
|
|
42
|
-
// Optional:
|
|
43
|
-
await registerServiceWorker()
|
|
74
|
+
// Optional: register standalone service-worker routes.
|
|
75
|
+
await registerServiceWorker()
|
|
44
76
|
```
|
|
45
77
|
|
|
46
|
-
## What
|
|
78
|
+
## What You Get
|
|
47
79
|
|
|
48
80
|
| Surface | Description |
|
|
49
81
|
|---|---|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
58
|
-
|
|
82
|
+
| PGlite archive | `opfs`, `idb`, and `memory` persistence modes with migrations on open |
|
|
83
|
+
| Repositories | Notes, search, tags, collections, links, SKOS concepts, and attachments |
|
|
84
|
+
| Event bus | Typed subscriptions for note, job, archive, and capability events |
|
|
85
|
+
| Capability system | Embeddings, local LLM, GPU detection, local-provider discovery, fallback routing |
|
|
86
|
+
| Job queue | Server-compatible background workflow for revisions, titles, embeddings, concepts, and links |
|
|
87
|
+
| Knowledge Shards | Tar.gz import/export with checksums and JSON format parity |
|
|
88
|
+
| Service-worker helpers | Route registration primitives for standalone browser integration |
|
|
89
|
+
|
|
90
|
+
## Tool Surface
|
|
91
|
+
|
|
92
|
+
`FortemiToolManifest` registers 10 bridge-visible Mnemos tools:
|
|
93
|
+
|
|
94
|
+
`capture_knowledge`, `manage_note`, `search`, `get_note`, `list_notes`, `manage_tags`, `manage_collections`, `manage_links`, `manage_archive`, `manage_capabilities`.
|
|
95
|
+
|
|
96
|
+
The package also exports 11 direct helper functions from `@fortemi/core`, including `manageAttachments` for attachment metadata and blob operations.
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import { fortemiManifest } from '@fortemi/core'
|
|
100
|
+
|
|
101
|
+
const capabilities = fortemiManifest.toPlinyCapabilities()
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Browser Storage
|
|
105
|
+
|
|
106
|
+
| Mode | Storage | Best for |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `opfs` | Origin Private File System access-handle pool | Chrome and Edge production apps |
|
|
109
|
+
| `idb` | IndexedDB-backed PGlite data directory | Firefox and broad compatibility |
|
|
110
|
+
| `memory` | In-memory database | Tests, demos, restricted browser contexts |
|
|
111
|
+
|
|
112
|
+
## React Bindings
|
|
113
|
+
|
|
114
|
+
For React applications, install `@fortemi/react`. It wraps `@fortemi/core` with `FortemiProvider`, context access, and 21 hooks.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pnpm add @fortemi/react @fortemi/core react
|
|
118
|
+
```
|
|
59
119
|
|
|
60
|
-
##
|
|
120
|
+
## Documentation
|
|
61
121
|
|
|
62
|
-
|
|
122
|
+
- [Repository API](https://github.com/Fortemi/fortemi-react/blob/main/docs/api-reference.md#repositories)
|
|
123
|
+
- [Integration guide](https://github.com/Fortemi/fortemi-react/blob/main/docs/integration.md)
|
|
124
|
+
- [Search guide](https://github.com/Fortemi/fortemi-react/blob/main/docs/search.md)
|
|
125
|
+
- [Extending Fortemi](https://github.com/Fortemi/fortemi-react/blob/main/docs/extending.md)
|
|
126
|
+
- [Supply-chain controls](https://github.com/Fortemi/fortemi-react/blob/main/docs/security/supply-chain.md)
|
|
63
127
|
|
|
64
128
|
## License
|
|
65
129
|
|
|
66
|
-
|
|
130
|
+
AGPL-3.0-only. See [LICENSE](https://github.com/Fortemi/fortemi-react/blob/main/LICENSE).
|
package/dist/index.d.ts
CHANGED
|
@@ -2370,6 +2370,6 @@ declare function exportShard(db: DatabaseClient, options?: ExportOptions): Promi
|
|
|
2370
2370
|
*/
|
|
2371
2371
|
declare function importShard(db: DatabaseClient, data: Uint8Array | ArrayBuffer, options?: ImportOptions): Promise<ImportResult>;
|
|
2372
2372
|
|
|
2373
|
-
declare const VERSION = "2026.5.
|
|
2373
|
+
declare const VERSION = "2026.5.2";
|
|
2374
2374
|
|
|
2375
2375
|
export { type ArchiveInfo, ArchiveManager, type AttachInput, type AttachmentBlobRow, type AttachmentRow, AttachmentsRepository, type BlobStore, type BrowserNoteExport, CURRENT_SHARD_VERSION, type CapabilityInfo, CapabilityManager, type CapabilityName, type CapabilityState, type CaptureKnowledgeInput, CaptureKnowledgeInputSchema, type CaptureKnowledgeResult, type CollectionCreateInput, type CollectionRow, CollectionsRepository, type CompletionRequest, type CompletionResponse, type ConditionResult, type ConflictStrategy, type CooldownConfig, type CooldownEvent, type CspDirectiveName, type CspDirectives, type CspViolationReport, type DatabaseClient, type DiscoveredProvider, type DiscoveryOptions, type EmbedFunction, type EmbedRequest, type EmbedResponse, type EnqueueJobInput, type ErrorCategory, type EventMap, type ExportOptions, type FallbackEvent, FallbackRouter, type FallbackRouterConfig, type FortemiConfig, type FortemiCore, type FortemiToolDefinition, FortemiToolManifest, type GetNoteInput, GetNoteInputSchema, type GpuCapabilities, type IDisposable, type ImportCounts, type ImportOptions, type ImportResult, type InferenceCapabilities, type InferenceProvider, JOB_CAPABILITIES, JOB_PRIORITIES, type JobQueueOptions, JobQueueWorker, type JobStatus, type JobType, LOCAL_ENDPOINTS, type LinkRow, LinksRepository, type ListNotesInput, ListNotesInputSchema, type LlmCapabilityOptions, type LlmCompleteFn, type LoadedPluginScript, type LocalEndpoint, type ManageArchiveInput, ManageArchiveInputSchema, type ManageArchiveResult, type ManageAttachmentsInput, ManageAttachmentsInputSchema, type ManageAttachmentsResult, type ManageCapabilitiesInput, ManageCapabilitiesInputSchema, type ManageCapabilitiesResult, type ManageCollectionsInput, ManageCollectionsInputSchema, type ManageCollectionsResult, type ManageLinksInput, ManageLinksInputSchema, type ManageLinksResult, type ManageNoteInput, ManageNoteInputSchema, type ManageNoteResult, type ManageTagsInput, ManageTagsInputSchema, type ManageTagsResult, MemoryBlobStore, type Migration, MigrationRunner, type ModelCategory, type ModelFitResult, type ModelInfo, type NoteCreateInput, type NoteFull, type NoteListOptions, type NoteRevision, type NoteSummary, type NoteUpdateInput, NotesRepository, OpenAICompatibleProvider, type OpenAIProviderConfig, PGliteStorageBackend, PGliteStorageBackendFactory, PGliteWorkerClient, type PaginatedResult, type PersistenceMode, type PlinyCapability, type PluginCspOptions, type PluginScriptDescriptor, type PluginScriptPolicy, type ProbeResult, type ProbeStatus, type ProviderCapabilities, ProviderRegistry, type ProviderTier, type QueryExecutor, type QueryResult, type RecommendedTier, type RouteHandler, SHARD_FORMAT, type SWRegistrationResult, type SearchFacets, type SearchInput, SearchInputSchema, type SearchOptions, SearchRepository, type SearchResponse, type SearchResult, type ShardCollection, type ShardComponent, type ShardEmbedding, type ShardEmbeddingSet, type ShardEmbeddingSetMember, type ShardLink, type ShardManifest, type ShardNote, type ShardTag, type SkosConcept, type SkosRelation, SkosRepository, type SkosScheme, type StorageBackend, type StorageBackendFactory, type StorageOpenRequest, type StorageTopology, type StreamChunk, TagsRepository, TransactionProxy, TypedEventBus, VERSION, type VramTier, type WorkerRequest, type WorkerResponse, aiRevisionHandler, allMigrations, appendPluginScript, buildNoteConditions, buildPluginCsp, captureKnowledge, chunkText, classifyError, classifyModel, collectionFromShard, collectionToShard, computeHash, computeSri, conceptTaggingHandler, cosineSimilarity, createBlobStore, createCspReportHandler, createFortemi, createLegacyProvider, createPGliteInstance, createRoutes, defaultStorageBackendFactory, detectGpuCapabilities, detectInferenceCapabilities, discoverLocalProviders, embeddingFromShard, embeddingGenerationHandler, embeddingSetFromShard, embeddingSetMemberToShard, embeddingSetToShard, embeddingToShard, enqueueFullWorkflow, enqueueJob, enqueueNoteCreationJobs, estimateModelFit, estimateVramMB, estimateVramTier, exportShard, fetchPluginScript, fortemiManifest, generateId, getEmbedFunction, getJobQueueStatus, getLlmFunction, getNote, importShard, isPluginScriptAllowed, linkFromShard, linkToShard, linkingHandler, listNotes, manageArchive, manageAttachments, manageCapabilities, manageCollections, manageLinks, manageNote, manageTags, matchRoute, noteFromShard, noteToShard, packTarGz, parseCspReport, registerLlmCapability, registerSemanticCapability, registerServiceWorker, searchTool, selectLlmModel, setEmbedFunction, setLlmFunction, sha256Hex, suggestTags, tagsFromShard, tagsToShard, titleGenerationHandler, unpackTarGz, unregisterLlmCapability, unregisterSemanticCapability, validateChecksums, verifySri };
|
package/dist/index.js
CHANGED
|
@@ -5131,7 +5131,7 @@ function parseJsonArray(data) {
|
|
|
5131
5131
|
}
|
|
5132
5132
|
|
|
5133
5133
|
// src/index.ts
|
|
5134
|
-
var VERSION = "2026.5.
|
|
5134
|
+
var VERSION = "2026.5.2";
|
|
5135
5135
|
|
|
5136
5136
|
export { ArchiveManager, AttachmentsRepository, CURRENT_SHARD_VERSION, CapabilityManager, CaptureKnowledgeInputSchema, CollectionsRepository, FallbackRouter, FortemiToolManifest, GetNoteInputSchema, JOB_CAPABILITIES, JOB_PRIORITIES, JobQueueWorker, LOCAL_ENDPOINTS, LinksRepository, ListNotesInputSchema, ManageArchiveInputSchema, ManageAttachmentsInputSchema, ManageCapabilitiesInputSchema, ManageCollectionsInputSchema, ManageLinksInputSchema, ManageNoteInputSchema, ManageTagsInputSchema, MemoryBlobStore, MigrationRunner, NotesRepository, OpenAICompatibleProvider, PGliteStorageBackend, PGliteStorageBackendFactory, PGliteWorkerClient, ProviderRegistry, SHARD_FORMAT, SearchInputSchema, SearchRepository, SkosRepository, TagsRepository, TransactionProxy, TypedEventBus, VERSION, aiRevisionHandler, allMigrations, appendPluginScript, buildNoteConditions, buildPluginCsp, captureKnowledge, chunkText, classifyError, classifyModel, collectionFromShard, collectionToShard, computeHash, computeSri, conceptTaggingHandler, cosineSimilarity, createBlobStore, createCspReportHandler, createFortemi, createLegacyProvider, createPGliteInstance, createRoutes, defaultStorageBackendFactory, detectGpuCapabilities, detectInferenceCapabilities, discoverLocalProviders, embeddingFromShard, embeddingGenerationHandler, embeddingSetFromShard, embeddingSetMemberToShard, embeddingSetToShard, embeddingToShard, enqueueFullWorkflow, enqueueJob, enqueueNoteCreationJobs, estimateModelFit, estimateVramMB, estimateVramTier, exportShard, fetchPluginScript, fortemiManifest, generateId, getEmbedFunction, getJobQueueStatus, getLlmFunction, getNote, importShard, isPluginScriptAllowed, linkFromShard, linkToShard, linkingHandler, listNotes, manageArchive, manageAttachments, manageCapabilities, manageCollections, manageLinks, manageNote, manageTags, matchRoute, noteFromShard, noteToShard, packTarGz, parseCspReport, registerLlmCapability, registerSemanticCapability, registerServiceWorker, searchTool, selectLlmModel, setEmbedFunction, setLlmFunction, sha256Hex, suggestTags, tagsFromShard, tagsToShard, titleGenerationHandler, unpackTarGz, unregisterLlmCapability, unregisterSemanticCapability, validateChecksums, verifySri };
|
|
5137
5137
|
//# sourceMappingURL=index.js.map
|