@yolk-sdk/knowledge 0.0.1-canary.1 → 0.0.1-canary.11

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
@@ -19,6 +19,7 @@ Canary APIs are unstable. Keep all `@yolk-sdk/*` packages on the same version.
19
19
  | `@yolk-sdk/knowledge/representations` | Agent-readable/searchable representations |
20
20
  | `@yolk-sdk/knowledge/chunking` | Search chunker contracts and defaults |
21
21
  | `@yolk-sdk/knowledge/embeddings` | Embedder contract and vector types |
22
+ | `@yolk-sdk/knowledge/errors` | Shared knowledge error types |
22
23
  | `@yolk-sdk/knowledge/extraction` | Loaded source/extractor contract |
23
24
  | `@yolk-sdk/knowledge/ingestion` | Generic search ingestion pipeline |
24
25
  | `@yolk-sdk/knowledge/search` | Search interface, hybrid search, context packing |
@@ -44,11 +45,11 @@ import { searchKnowledge } from '@yolk-sdk/knowledge/search'
44
45
 
45
46
  ## Migration
46
47
 
47
- Search APIs use canonical search naming. Removed APIs are intentionally not backward-compatible.
48
+ Search APIs use canonical search naming. Removed retrieval APIs are intentionally not backward-compatible.
48
49
 
49
50
  | Removed | Use |
50
51
  | --- | --- |
51
- | `@yolk-sdk/knowledge/retrieval` | `@yolk-sdk/knowledge/search` |
52
+ | Retrieval subpath | `@yolk-sdk/knowledge/search` |
52
53
  | `KnowledgeRetriever` | `KnowledgeSearcher` |
53
54
  | `retrieve(input)` | `search(input)` |
54
55
  | `KnowledgeRetrievalError` | `KnowledgeSearchError` |
@@ -63,7 +64,7 @@ Search APIs use canonical search naming. Removed APIs are intentionally not back
63
64
  | Provenance | Source metadata explaining where knowledge came from and how it was produced. |
64
65
  | Link | Typed relationship between knowledge records. |
65
66
  | Context | Model-ready knowledge selected for a run. Built from host policy. |
66
- | Context policy | Host intent for use: `pinned`, `routable`, `searchable`, or `archival`. |
67
+ | Context policy | Host intent for use: `pinned`, `routable`, `searchable`, or `archived`. |
67
68
  | Search index | Searchable corpus built from source documents, chunks, embeddings, and metadata. |
68
69
  | Collection | Named searchable document group with shared embedding and chunking config. |
69
70
  | Document | Source item tracked through search ingestion: pending, processing, ready, or error. |
@@ -89,14 +90,14 @@ Search APIs use canonical search naming. Removed APIs are intentionally not back
89
90
  | `pinned` | Host may inject into model startup context |
90
91
  | `routable` | Host may use for routing/dispatch decisions |
91
92
  | `searchable` | Host may expose through search tools |
92
- | `archival` | Retained but normally omitted from active context/search |
93
+ | `archived` | Retained but normally omitted from active context/search |
93
94
 
94
95
  ## Host responsibilities
95
96
 
96
97
  - Own users, teams, permissions, routing, and product policy.
97
98
  - Implement `KnowledgeStore` and `KnowledgeArtifactStore` with app storage.
98
99
  - Own concrete extraction, embeddings, search ingestion, R2/S3 layout, and DB schema.
99
- - Decide which knowledge is pinned, searchable, routable, or archival.
100
+ - Decide which knowledge is pinned, searchable, routable, or archived.
100
101
 
101
102
  ## Boundaries
102
103
 
@@ -8,7 +8,7 @@ declare const KnowledgeMetadataSchema: Schema.$Record<Schema.String, Schema.Unkn
8
8
  type KnowledgeMetadata = Schema.Schema.Type<typeof KnowledgeMetadataSchema>;
9
9
  declare const KnowledgeRecordRoleSchema: Schema.Literals<readonly ["source", "note", "operating_protocol", "knowledge_map", "compiled_truth", "decision"]>;
10
10
  type KnowledgeRecordRole = Schema.Schema.Type<typeof KnowledgeRecordRoleSchema>;
11
- declare const KnowledgeContextPolicySchema: Schema.Literals<readonly ["pinned", "routable", "searchable", "archival"]>;
11
+ declare const KnowledgeContextPolicySchema: Schema.Literals<readonly ["pinned", "routable", "searchable", "archived"]>;
12
12
  type KnowledgeContextPolicy = Schema.Schema.Type<typeof KnowledgeContextPolicySchema>;
13
13
  declare const KnowledgeLifecycleStatusSchema: Schema.Literals<readonly ["draft", "processing", "ready", "error", "archived", "deleted"]>;
14
14
  type KnowledgeLifecycleStatus = Schema.Schema.Type<typeof KnowledgeLifecycleStatusSchema>;
@@ -22,7 +22,7 @@ declare const KnowledgeRecordSchema: Schema.Struct<{
22
22
  readonly role: Schema.Literals<readonly ["source", "note", "operating_protocol", "knowledge_map", "compiled_truth", "decision"]>;
23
23
  readonly title: Schema.Trimmed;
24
24
  readonly status: Schema.Literals<readonly ["draft", "processing", "ready", "error", "archived", "deleted"]>;
25
- readonly contextPolicy: Schema.Literals<readonly ["pinned", "routable", "searchable", "archival"]>;
25
+ readonly contextPolicy: Schema.Literals<readonly ["pinned", "routable", "searchable", "archived"]>;
26
26
  readonly summary: Schema.optional<Schema.String>;
27
27
  readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
28
28
  readonly createdAt: Schema.DateTimeUtc;
@@ -36,7 +36,7 @@ declare const CreateKnowledgeRecordInputSchema: Schema.Struct<{
36
36
  }>;
37
37
  readonly role: Schema.Literals<readonly ["source", "note", "operating_protocol", "knowledge_map", "compiled_truth", "decision"]>;
38
38
  readonly title: Schema.Trimmed;
39
- readonly contextPolicy: Schema.Literals<readonly ["pinned", "routable", "searchable", "archival"]>;
39
+ readonly contextPolicy: Schema.Literals<readonly ["pinned", "routable", "searchable", "archived"]>;
40
40
  readonly summary: Schema.optional<Schema.String>;
41
41
  readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
42
42
  }>;
@@ -49,7 +49,7 @@ declare const UpdateKnowledgeRecordInputSchema: Schema.Struct<{
49
49
  readonly id: Schema.Trimmed;
50
50
  readonly title: Schema.optional<Schema.Trimmed>;
51
51
  readonly status: Schema.optional<Schema.Literals<readonly ["draft", "processing", "ready", "error", "archived", "deleted"]>>;
52
- readonly contextPolicy: Schema.optional<Schema.Literals<readonly ["pinned", "routable", "searchable", "archival"]>>;
52
+ readonly contextPolicy: Schema.optional<Schema.Literals<readonly ["pinned", "routable", "searchable", "archived"]>>;
53
53
  readonly summary: Schema.optional<Schema.String>;
54
54
  readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
55
55
  }>;
package/dist/records.mjs CHANGED
@@ -16,7 +16,7 @@ const KnowledgeContextPolicySchema = Schema.Literals([
16
16
  "pinned",
17
17
  "routable",
18
18
  "searchable",
19
- "archival"
19
+ "archived"
20
20
  ]);
21
21
  const KnowledgeLifecycleStatusSchema = Schema.Literals([
22
22
  "draft",
@@ -1 +1 @@
1
- {"version":3,"file":"records.mjs","names":[],"sources":["../src/records.ts"],"sourcesContent":["import * as Schema from 'effect/Schema'\n\nexport const NonEmptyTrimmedString = Schema.Trimmed.pipe(Schema.check(Schema.isNonEmpty()))\nexport const NonNegativeInteger = Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0)))\nexport const PositiveInteger = Schema.Int.pipe(Schema.check(Schema.isGreaterThan(0)))\n\nexport const KnowledgeMetadataSchema = Schema.Record(Schema.String, Schema.Unknown)\nexport type KnowledgeMetadata = Schema.Schema.Type<typeof KnowledgeMetadataSchema>\n\nexport const KnowledgeRecordRoleSchema = Schema.Literals([\n 'source',\n 'note',\n 'operating_protocol',\n 'knowledge_map',\n 'compiled_truth',\n 'decision'\n])\nexport type KnowledgeRecordRole = Schema.Schema.Type<typeof KnowledgeRecordRoleSchema>\n\nexport const KnowledgeContextPolicySchema = Schema.Literals([\n 'pinned',\n 'routable',\n 'searchable',\n 'archival'\n])\nexport type KnowledgeContextPolicy = Schema.Schema.Type<typeof KnowledgeContextPolicySchema>\n\nexport const KnowledgeLifecycleStatusSchema = Schema.Literals([\n 'draft',\n 'processing',\n 'ready',\n 'error',\n 'archived',\n 'deleted'\n])\nexport type KnowledgeLifecycleStatus = Schema.Schema.Type<typeof KnowledgeLifecycleStatusSchema>\n\nexport const KnowledgeScopeSchema = Schema.Struct({\n id: NonEmptyTrimmedString,\n kind: Schema.optional(NonEmptyTrimmedString)\n})\nexport type KnowledgeScope = Schema.Schema.Type<typeof KnowledgeScopeSchema>\n\nexport const KnowledgeRecordSchema = Schema.Struct({\n id: NonEmptyTrimmedString,\n role: KnowledgeRecordRoleSchema,\n title: NonEmptyTrimmedString,\n status: KnowledgeLifecycleStatusSchema,\n contextPolicy: KnowledgeContextPolicySchema,\n summary: Schema.optional(Schema.String),\n metadata: Schema.optional(KnowledgeMetadataSchema),\n createdAt: Schema.DateTimeUtc,\n updatedAt: Schema.DateTimeUtc\n})\nexport type KnowledgeRecord = Schema.Schema.Type<typeof KnowledgeRecordSchema>\n\nexport const CreateKnowledgeRecordInputSchema = Schema.Struct({\n scope: KnowledgeScopeSchema,\n role: KnowledgeRecordRoleSchema,\n title: NonEmptyTrimmedString,\n contextPolicy: KnowledgeContextPolicySchema,\n summary: Schema.optional(Schema.String),\n metadata: Schema.optional(KnowledgeMetadataSchema)\n})\nexport type CreateKnowledgeRecordInput = Schema.Schema.Type<typeof CreateKnowledgeRecordInputSchema>\n\nexport const UpdateKnowledgeRecordInputSchema = Schema.Struct({\n scope: KnowledgeScopeSchema,\n id: NonEmptyTrimmedString,\n title: Schema.optional(NonEmptyTrimmedString),\n status: Schema.optional(KnowledgeLifecycleStatusSchema),\n contextPolicy: Schema.optional(KnowledgeContextPolicySchema),\n summary: Schema.optional(Schema.String),\n metadata: Schema.optional(KnowledgeMetadataSchema)\n})\nexport type UpdateKnowledgeRecordInput = Schema.Schema.Type<typeof UpdateKnowledgeRecordInputSchema>\n"],"mappings":";;AAEA,MAAa,wBAAwB,OAAO,QAAQ,KAAK,OAAO,MAAM,OAAO,WAAW,CAAC,CAAC;AAC1F,MAAa,qBAAqB,OAAO,IAAI,KAAK,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC,CAAC;AAChG,MAAa,kBAAkB,OAAO,IAAI,KAAK,OAAO,MAAM,OAAO,cAAc,CAAC,CAAC,CAAC;AAEpF,MAAa,0BAA0B,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAGlF,MAAa,4BAA4B,OAAO,SAAS;CACvD;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAGD,MAAa,+BAA+B,OAAO,SAAS;CAC1D;CACA;CACA;CACA;AACF,CAAC;AAGD,MAAa,iCAAiC,OAAO,SAAS;CAC5D;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAGD,MAAa,uBAAuB,OAAO,OAAO;CAChD,IAAI;CACJ,MAAM,OAAO,SAAS,qBAAqB;AAC7C,CAAC;AAGD,MAAa,wBAAwB,OAAO,OAAO;CACjD,IAAI;CACJ,MAAM;CACN,OAAO;CACP,QAAQ;CACR,eAAe;CACf,SAAS,OAAO,SAAS,OAAO,MAAM;CACtC,UAAU,OAAO,SAAS,uBAAuB;CACjD,WAAW,OAAO;CAClB,WAAW,OAAO;AACpB,CAAC;AAGD,MAAa,mCAAmC,OAAO,OAAO;CAC5D,OAAO;CACP,MAAM;CACN,OAAO;CACP,eAAe;CACf,SAAS,OAAO,SAAS,OAAO,MAAM;CACtC,UAAU,OAAO,SAAS,uBAAuB;AACnD,CAAC;AAGD,MAAa,mCAAmC,OAAO,OAAO;CAC5D,OAAO;CACP,IAAI;CACJ,OAAO,OAAO,SAAS,qBAAqB;CAC5C,QAAQ,OAAO,SAAS,8BAA8B;CACtD,eAAe,OAAO,SAAS,4BAA4B;CAC3D,SAAS,OAAO,SAAS,OAAO,MAAM;CACtC,UAAU,OAAO,SAAS,uBAAuB;AACnD,CAAC"}
1
+ {"version":3,"file":"records.mjs","names":[],"sources":["../src/records.ts"],"sourcesContent":["import * as Schema from 'effect/Schema'\n\nexport const NonEmptyTrimmedString = Schema.Trimmed.pipe(Schema.check(Schema.isNonEmpty()))\nexport const NonNegativeInteger = Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0)))\nexport const PositiveInteger = Schema.Int.pipe(Schema.check(Schema.isGreaterThan(0)))\n\nexport const KnowledgeMetadataSchema = Schema.Record(Schema.String, Schema.Unknown)\nexport type KnowledgeMetadata = Schema.Schema.Type<typeof KnowledgeMetadataSchema>\n\nexport const KnowledgeRecordRoleSchema = Schema.Literals([\n 'source',\n 'note',\n 'operating_protocol',\n 'knowledge_map',\n 'compiled_truth',\n 'decision'\n])\nexport type KnowledgeRecordRole = Schema.Schema.Type<typeof KnowledgeRecordRoleSchema>\n\nexport const KnowledgeContextPolicySchema = Schema.Literals([\n 'pinned',\n 'routable',\n 'searchable',\n 'archived'\n])\nexport type KnowledgeContextPolicy = Schema.Schema.Type<typeof KnowledgeContextPolicySchema>\n\nexport const KnowledgeLifecycleStatusSchema = Schema.Literals([\n 'draft',\n 'processing',\n 'ready',\n 'error',\n 'archived',\n 'deleted'\n])\nexport type KnowledgeLifecycleStatus = Schema.Schema.Type<typeof KnowledgeLifecycleStatusSchema>\n\nexport const KnowledgeScopeSchema = Schema.Struct({\n id: NonEmptyTrimmedString,\n kind: Schema.optional(NonEmptyTrimmedString)\n})\nexport type KnowledgeScope = Schema.Schema.Type<typeof KnowledgeScopeSchema>\n\nexport const KnowledgeRecordSchema = Schema.Struct({\n id: NonEmptyTrimmedString,\n role: KnowledgeRecordRoleSchema,\n title: NonEmptyTrimmedString,\n status: KnowledgeLifecycleStatusSchema,\n contextPolicy: KnowledgeContextPolicySchema,\n summary: Schema.optional(Schema.String),\n metadata: Schema.optional(KnowledgeMetadataSchema),\n createdAt: Schema.DateTimeUtc,\n updatedAt: Schema.DateTimeUtc\n})\nexport type KnowledgeRecord = Schema.Schema.Type<typeof KnowledgeRecordSchema>\n\nexport const CreateKnowledgeRecordInputSchema = Schema.Struct({\n scope: KnowledgeScopeSchema,\n role: KnowledgeRecordRoleSchema,\n title: NonEmptyTrimmedString,\n contextPolicy: KnowledgeContextPolicySchema,\n summary: Schema.optional(Schema.String),\n metadata: Schema.optional(KnowledgeMetadataSchema)\n})\nexport type CreateKnowledgeRecordInput = Schema.Schema.Type<typeof CreateKnowledgeRecordInputSchema>\n\nexport const UpdateKnowledgeRecordInputSchema = Schema.Struct({\n scope: KnowledgeScopeSchema,\n id: NonEmptyTrimmedString,\n title: Schema.optional(NonEmptyTrimmedString),\n status: Schema.optional(KnowledgeLifecycleStatusSchema),\n contextPolicy: Schema.optional(KnowledgeContextPolicySchema),\n summary: Schema.optional(Schema.String),\n metadata: Schema.optional(KnowledgeMetadataSchema)\n})\nexport type UpdateKnowledgeRecordInput = Schema.Schema.Type<typeof UpdateKnowledgeRecordInputSchema>\n"],"mappings":";;AAEA,MAAa,wBAAwB,OAAO,QAAQ,KAAK,OAAO,MAAM,OAAO,WAAW,CAAC,CAAC;AAC1F,MAAa,qBAAqB,OAAO,IAAI,KAAK,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC,CAAC;AAChG,MAAa,kBAAkB,OAAO,IAAI,KAAK,OAAO,MAAM,OAAO,cAAc,CAAC,CAAC,CAAC;AAEpF,MAAa,0BAA0B,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAGlF,MAAa,4BAA4B,OAAO,SAAS;CACvD;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAGD,MAAa,+BAA+B,OAAO,SAAS;CAC1D;CACA;CACA;CACA;AACF,CAAC;AAGD,MAAa,iCAAiC,OAAO,SAAS;CAC5D;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAGD,MAAa,uBAAuB,OAAO,OAAO;CAChD,IAAI;CACJ,MAAM,OAAO,SAAS,qBAAqB;AAC7C,CAAC;AAGD,MAAa,wBAAwB,OAAO,OAAO;CACjD,IAAI;CACJ,MAAM;CACN,OAAO;CACP,QAAQ;CACR,eAAe;CACf,SAAS,OAAO,SAAS,OAAO,MAAM;CACtC,UAAU,OAAO,SAAS,uBAAuB;CACjD,WAAW,OAAO;CAClB,WAAW,OAAO;AACpB,CAAC;AAGD,MAAa,mCAAmC,OAAO,OAAO;CAC5D,OAAO;CACP,MAAM;CACN,OAAO;CACP,eAAe;CACf,SAAS,OAAO,SAAS,OAAO,MAAM;CACtC,UAAU,OAAO,SAAS,uBAAuB;AACnD,CAAC;AAGD,MAAa,mCAAmC,OAAO,OAAO;CAC5D,OAAO;CACP,IAAI;CACJ,OAAO,OAAO,SAAS,qBAAqB;CAC5C,QAAQ,OAAO,SAAS,8BAA8B;CACtD,eAAe,OAAO,SAAS,4BAA4B;CAC3D,SAAS,OAAO,SAAS,OAAO,MAAM;CACtC,UAAU,OAAO,SAAS,uBAAuB;AACnD,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yolk-sdk/knowledge",
3
- "version": "0.0.1-canary.1",
4
- "description": "Domain-free knowledge record, artifact, provenance, and context contracts for Yolk agents.",
3
+ "version": "0.0.1-canary.11",
4
+ "description": "Domain-free knowledge record, artifact, search, provenance, and context contracts for Yolk agents.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -136,7 +136,7 @@
136
136
  "dependencies": {
137
137
  "effect": "4.0.0-beta.65",
138
138
  "gpt-tokenizer": "^3.4.0",
139
- "@yolk-sdk/agent": "^0.0.1-canary.1"
139
+ "@yolk-sdk/agent": "^0.0.1-canary.11"
140
140
  },
141
141
  "scripts": {
142
142
  "build": "tsdown",
package/src/records.ts CHANGED
@@ -21,7 +21,7 @@ export const KnowledgeContextPolicySchema = Schema.Literals([
21
21
  'pinned',
22
22
  'routable',
23
23
  'searchable',
24
- 'archival'
24
+ 'archived'
25
25
  ])
26
26
  export type KnowledgeContextPolicy = Schema.Schema.Type<typeof KnowledgeContextPolicySchema>
27
27