@redaksjon/context 0.0.7-dev.20260214203706.6baccc8 → 0.0.7-dev.20260215052741.1bc1d6d
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/dist/discovery/discovery.d.ts +14 -0
- package/dist/discovery/discovery.d.ts.map +1 -0
- package/dist/discovery/index.d.ts +4 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/overcontext-discovery.d.ts +12 -0
- package/dist/discovery/overcontext-discovery.d.ts.map +1 -0
- package/dist/discovery/types.d.ts +21 -0
- package/dist/discovery/types.d.ts.map +1 -0
- package/dist/helpers.d.ts +31 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/index.cjs +26 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/index10.cjs +7 -13
- package/dist/index10.cjs.map +1 -1
- package/dist/index10.js +7 -13
- package/dist/index10.js.map +1 -1
- package/dist/index11.cjs +112 -0
- package/dist/index11.cjs.map +1 -0
- package/dist/index11.js +102 -0
- package/dist/index11.js.map +1 -0
- package/dist/index12.cjs +56 -0
- package/dist/index12.cjs.map +1 -0
- package/dist/index12.js +48 -0
- package/dist/index12.js.map +1 -0
- package/dist/index13.cjs +16 -0
- package/dist/index13.cjs.map +1 -0
- package/dist/index13.js +12 -0
- package/dist/index13.js.map +1 -0
- package/dist/index14.cjs +29 -0
- package/dist/index14.cjs.map +1 -0
- package/dist/index14.js +25 -0
- package/dist/index14.js.map +1 -0
- package/dist/index15.cjs +41 -0
- package/dist/index15.cjs.map +1 -0
- package/dist/index15.js +35 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.cjs +28 -0
- package/dist/index16.cjs.map +1 -0
- package/dist/index16.js +24 -0
- package/dist/index16.js.map +1 -0
- package/dist/index2.cjs +7 -7
- package/dist/index2.js +8 -8
- package/dist/index4.cjs +126 -15
- package/dist/index4.cjs.map +1 -1
- package/dist/index4.js +126 -15
- package/dist/index4.js.map +1 -1
- package/dist/index5.cjs +158 -101
- package/dist/index5.cjs.map +1 -1
- package/dist/index5.js +140 -96
- package/dist/index5.js.map +1 -1
- package/dist/index6.cjs +172 -46
- package/dist/index6.cjs.map +1 -1
- package/dist/index6.js +154 -45
- package/dist/index6.js.map +1 -1
- package/dist/index7.cjs +106 -8
- package/dist/index7.cjs.map +1 -1
- package/dist/index7.js +85 -9
- package/dist/index7.js.map +1 -1
- package/dist/index8.cjs +30 -22
- package/dist/index8.cjs.map +1 -1
- package/dist/index8.js +30 -22
- package/dist/index8.js.map +1 -1
- package/dist/index9.cjs +77 -35
- package/dist/index9.cjs.map +1 -1
- package/dist/index9.js +71 -33
- package/dist/index9.js.map +1 -1
- package/dist/runtime/context.d.ts +40 -0
- package/dist/runtime/context.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/storage/adapter.d.ts +20 -0
- package/dist/storage/adapter.d.ts.map +1 -0
- package/dist/storage/index.d.ts +3 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/storage.d.ts +14 -0
- package/dist/storage/storage.d.ts.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContextDiscoveryOptions, DiscoveredContextDir, HierarchicalContextResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Discover configuration directories by walking up the directory tree
|
|
4
|
+
*/
|
|
5
|
+
export declare const discoverConfigDirectories: (options: ContextDiscoveryOptions) => Promise<DiscoveredContextDir[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Load and merge hierarchical configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare const loadHierarchicalConfig: (options: ContextDiscoveryOptions) => Promise<HierarchicalContextResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Deep merge utility (similar to Cardigantime's implementation)
|
|
12
|
+
*/
|
|
13
|
+
export declare function deepMerge<T extends Record<string, unknown>>(target: T, source: T): T;
|
|
14
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/discovery/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEnG;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAClC,SAAS,uBAAuB,KACjC,OAAO,CAAC,oBAAoB,EAAE,CAoChC,CAAC;AA8DF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAC/B,SAAS,uBAAuB,KACjC,OAAO,CAAC,yBAAyB,CAkDnC,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAsCpF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/discovery/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AAExB,OAAO,EACH,yBAAyB,EACzB,sBAAsB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContextDiscoveryOptions, DiscoveredContextDir, HierarchicalContextResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Discover configuration directories by walking up the directory tree.
|
|
4
|
+
* Wrapper around overcontext's discovery.
|
|
5
|
+
*/
|
|
6
|
+
export declare const discoverConfigDirectories: (options: ContextDiscoveryOptions) => Promise<DiscoveredContextDir[]>;
|
|
7
|
+
/**
|
|
8
|
+
* Load and merge hierarchical configuration.
|
|
9
|
+
* Wrapper around overcontext's discovery.
|
|
10
|
+
*/
|
|
11
|
+
export declare const loadHierarchicalConfig: (options: ContextDiscoveryOptions) => Promise<HierarchicalContextResult>;
|
|
12
|
+
//# sourceMappingURL=overcontext-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overcontext-discovery.d.ts","sourceRoot":"","sources":["../../src/discovery/overcontext-discovery.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EAC5B,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GAClC,SAAS,uBAAuB,KACjC,OAAO,CAAC,oBAAoB,EAAE,CAWhC,CAAC;AA8DF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAC/B,SAAS,uBAAuB,KACjC,OAAO,CAAC,yBAAyB,CAiDnC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery Types
|
|
3
|
+
*
|
|
4
|
+
* Types for hierarchical configuration discovery.
|
|
5
|
+
*/
|
|
6
|
+
export interface ContextDiscoveryOptions {
|
|
7
|
+
configDirName: string;
|
|
8
|
+
configFileName: string;
|
|
9
|
+
maxLevels?: number;
|
|
10
|
+
startingDir?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DiscoveredContextDir {
|
|
13
|
+
path: string;
|
|
14
|
+
level: number;
|
|
15
|
+
}
|
|
16
|
+
export interface HierarchicalContextResult {
|
|
17
|
+
config: Record<string, unknown>;
|
|
18
|
+
discoveredDirs: DiscoveredContextDir[];
|
|
19
|
+
contextDirs: string[];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/discovery/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,EAAE,oBAAoB,EAAE,CAAC;IACvC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Term, Project } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if a term is associated with a given project.
|
|
4
|
+
*/
|
|
5
|
+
export declare const isTermAssociatedWithProject: (term: Term, projectId: string) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Add a project association to a term.
|
|
8
|
+
*/
|
|
9
|
+
export declare const addProjectToTerm: (term: Term, projectId: string) => Term;
|
|
10
|
+
/**
|
|
11
|
+
* Remove a project association from a term.
|
|
12
|
+
*/
|
|
13
|
+
export declare const removeProjectFromTerm: (term: Term, projectId: string) => Term;
|
|
14
|
+
/**
|
|
15
|
+
* Check if projectA is a parent of projectB.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isParentProject: (projectA: Project, projectB: Project) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Check if projectA is a child of projectB.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isChildProject: (projectA: Project, projectB: Project) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Check if two projects are siblings.
|
|
24
|
+
*/
|
|
25
|
+
export declare const areSiblingProjects: (projectA: Project, projectB: Project) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Get relationship distance between two projects.
|
|
28
|
+
* Returns: 0 = same, 1 = parent/child, 2 = siblings/cousins, -1 = unrelated
|
|
29
|
+
*/
|
|
30
|
+
export declare const getProjectRelationshipDistance: (projectA: Project, projectB: Project) => number;
|
|
31
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,IAAI,EAAE,WAAW,MAAM,KAAG,OAE3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,EAAE,WAAW,MAAM,KAAG,IAUhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,IAAI,EAAE,WAAW,MAAM,KAAG,IAOrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAWtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAWrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAgBzE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,MAkBrF,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -4,13 +4,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index2.cjs');
|
|
6
6
|
const types = require('./index3.cjs');
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
7
|
+
const context = require('./index4.cjs');
|
|
8
|
+
const adapter = require('./index5.cjs');
|
|
9
|
+
const storage = require('./index6.cjs');
|
|
10
|
+
const overcontextDiscovery = require('./index7.cjs');
|
|
11
|
+
const discovery = require('./index8.cjs');
|
|
12
|
+
const helpers = require('./index9.cjs');
|
|
13
|
+
const company = require('./index10.cjs');
|
|
14
|
+
const content = require('./index11.cjs');
|
|
15
|
+
const relationships = require('./index12.cjs');
|
|
16
|
+
const ignored = require('./index13.cjs');
|
|
17
|
+
const person = require('./index14.cjs');
|
|
18
|
+
const project = require('./index15.cjs');
|
|
19
|
+
const term = require('./index16.cjs');
|
|
14
20
|
|
|
15
21
|
|
|
16
22
|
|
|
@@ -18,6 +24,19 @@ exports.redaksjonPluralNames = index.redaksjonPluralNames;
|
|
|
18
24
|
exports.redaksjonSchemas = index.redaksjonSchemas;
|
|
19
25
|
exports.DIRECTORY_TO_TYPE = types.DIRECTORY_TO_TYPE;
|
|
20
26
|
exports.TYPE_TO_DIRECTORY = types.TYPE_TO_DIRECTORY;
|
|
27
|
+
exports.create = context.create;
|
|
28
|
+
exports.createStorage = adapter.create;
|
|
29
|
+
exports.createStandaloneStorage = storage.create;
|
|
30
|
+
exports.discoverConfigDirectories = overcontextDiscovery.discoverConfigDirectories;
|
|
31
|
+
exports.loadHierarchicalConfig = overcontextDiscovery.loadHierarchicalConfig;
|
|
32
|
+
exports.deepMerge = discovery.deepMerge;
|
|
33
|
+
exports.addProjectToTerm = helpers.addProjectToTerm;
|
|
34
|
+
exports.areSiblingProjects = helpers.areSiblingProjects;
|
|
35
|
+
exports.getProjectRelationshipDistance = helpers.getProjectRelationshipDistance;
|
|
36
|
+
exports.isChildProject = helpers.isChildProject;
|
|
37
|
+
exports.isParentProject = helpers.isParentProject;
|
|
38
|
+
exports.isTermAssociatedWithProject = helpers.isTermAssociatedWithProject;
|
|
39
|
+
exports.removeProjectFromTerm = helpers.removeProjectFromTerm;
|
|
21
40
|
exports.CompanySchema = company.CompanySchema;
|
|
22
41
|
exports.EntityContentItemSchema = content.EntityContentItemSchema;
|
|
23
42
|
exports.EntityContentSchema = content.EntityContentSchema;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export * from './schemas';
|
|
2
2
|
export * from './types';
|
|
3
|
+
export type { RedaksjonEntity as Entity, RedaksjonEntityType as EntityType } from './types';
|
|
4
|
+
export { create, type ContextInstance, type CreateOptions } from './runtime';
|
|
5
|
+
export { create as createStorage, createStandaloneStorage, type StorageInstance, type Entity as StorageEntity, type EntityType as StorageEntityType } from './storage';
|
|
6
|
+
export * from './discovery';
|
|
7
|
+
export * from './helpers';
|
|
3
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAGxB,YAAY,EAAE,eAAe,IAAI,MAAM,EAAE,mBAAmB,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAG5F,OAAO,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EACH,MAAM,IAAI,aAAa,EACvB,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,MAAM,IAAI,aAAa,EAC5B,KAAK,UAAU,IAAI,iBAAiB,EACvC,MAAM,WAAW,CAAC;AACnB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
export { redaksjonPluralNames, redaksjonSchemas } from './index2.js';
|
|
2
2
|
export { DIRECTORY_TO_TYPE, TYPE_TO_DIRECTORY } from './index3.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
3
|
+
export { create } from './index4.js';
|
|
4
|
+
export { create as createStorage } from './index5.js';
|
|
5
|
+
export { create as createStandaloneStorage } from './index6.js';
|
|
6
|
+
export { discoverConfigDirectories, loadHierarchicalConfig } from './index7.js';
|
|
7
|
+
export { deepMerge } from './index8.js';
|
|
8
|
+
export { addProjectToTerm, areSiblingProjects, getProjectRelationshipDistance, isChildProject, isParentProject, isTermAssociatedWithProject, removeProjectFromTerm } from './index9.js';
|
|
9
|
+
export { CompanySchema } from './index10.js';
|
|
10
|
+
export { EntityContentItemSchema, EntityContentSchema, createCodeContent, createDocumentContent, createMarkdownContent, createTextContent, createUrlContent } from './index11.js';
|
|
11
|
+
export { EntityRelationshipSchema, RelationshipsSchema, createEntityUri, createRelationship, parseEntityUri } from './index12.js';
|
|
12
|
+
export { IgnoredTermSchema } from './index13.js';
|
|
13
|
+
export { PersonSchema } from './index14.js';
|
|
14
|
+
export { ProjectClassificationSchema, ProjectRoutingSchema, ProjectSchema } from './index15.js';
|
|
15
|
+
export { TermSchema } from './index16.js';
|
|
10
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/dist/index10.cjs
CHANGED
|
@@ -4,25 +4,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const zod = require('zod');
|
|
6
6
|
const overcontext = require('@utilarium/overcontext');
|
|
7
|
-
const relationships = require('./
|
|
8
|
-
const content = require('./
|
|
7
|
+
const relationships = require('./index12.cjs');
|
|
8
|
+
const content = require('./index11.cjs');
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
type: zod.z.literal("
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
domain: zod.z.string().optional(),
|
|
15
|
-
// E.g., "engineering", "finance"
|
|
10
|
+
const CompanySchema = overcontext.BaseEntitySchema.merge(zod.z.object({
|
|
11
|
+
type: zod.z.literal("company"),
|
|
12
|
+
fullName: zod.z.string().optional(),
|
|
13
|
+
industry: zod.z.string().optional(),
|
|
16
14
|
sounds_like: zod.z.array(zod.z.string()).optional(),
|
|
17
|
-
projects: zod.z.array(zod.z.string()).optional(),
|
|
18
|
-
// DEPRECATED: Use relationships instead
|
|
19
|
-
description: zod.z.string().optional(),
|
|
20
|
-
topics: zod.z.array(zod.z.string()).optional(),
|
|
21
15
|
relationships: relationships.RelationshipsSchema,
|
|
22
16
|
// Relationships to other entities
|
|
23
17
|
content: content.EntityContentSchema
|
|
24
18
|
// Attached content (URLs, text, documents)
|
|
25
19
|
}));
|
|
26
20
|
|
|
27
|
-
exports.
|
|
21
|
+
exports.CompanySchema = CompanySchema;
|
|
28
22
|
//# sourceMappingURL=index10.cjs.map
|
package/dist/index10.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index10.cjs","sources":["../src/schemas/
|
|
1
|
+
{"version":3,"file":"index10.cjs","sources":["../src/schemas/company.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseEntitySchema } from '@utilarium/overcontext';\nimport { RelationshipsSchema } from './relationships';\nimport { EntityContentSchema } from './content';\n\n/**\n * Company entity - organizations referenced in notes.\n */\nexport const CompanySchema = BaseEntitySchema.merge(z.object({\n type: z.literal('company'),\n \n fullName: z.string().optional(),\n industry: z.string().optional(),\n sounds_like: z.array(z.string()).optional(),\n relationships: RelationshipsSchema, // Relationships to other entities\n content: EntityContentSchema, // Attached content (URLs, text, documents)\n}));\n"],"names":["BaseEntitySchema","z","RelationshipsSchema","EntityContentSchema"],"mappings":";;;;;;;;;AAQO,MAAM,aAAA,GAAgBA,4BAAA,CAAiB,KAAA,CAAMC,KAAA,CAAE,MAAA,CAAO;AAAA,EACzD,IAAA,EAAMA,KAAA,CAAE,OAAA,CAAQ,SAAS,CAAA;AAAA,EAEzB,QAAA,EAAUA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,QAAA,EAAUA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,aAAaA,KAAA,CAAE,KAAA,CAAMA,MAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,EAC1C,aAAA,EAAeC,iCAAA;AAAA;AAAA,EACf,OAAA,EAASC;AAAA;AACb,CAAC,CAAC;;;;"}
|
package/dist/index10.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { BaseEntitySchema } from '@utilarium/overcontext';
|
|
3
|
-
import { RelationshipsSchema } from './
|
|
4
|
-
import { EntityContentSchema } from './
|
|
3
|
+
import { RelationshipsSchema } from './index12.js';
|
|
4
|
+
import { EntityContentSchema } from './index11.js';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
type: z.literal("
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
domain: z.string().optional(),
|
|
11
|
-
// E.g., "engineering", "finance"
|
|
6
|
+
const CompanySchema = BaseEntitySchema.merge(z.object({
|
|
7
|
+
type: z.literal("company"),
|
|
8
|
+
fullName: z.string().optional(),
|
|
9
|
+
industry: z.string().optional(),
|
|
12
10
|
sounds_like: z.array(z.string()).optional(),
|
|
13
|
-
projects: z.array(z.string()).optional(),
|
|
14
|
-
// DEPRECATED: Use relationships instead
|
|
15
|
-
description: z.string().optional(),
|
|
16
|
-
topics: z.array(z.string()).optional(),
|
|
17
11
|
relationships: RelationshipsSchema,
|
|
18
12
|
// Relationships to other entities
|
|
19
13
|
content: EntityContentSchema
|
|
20
14
|
// Attached content (URLs, text, documents)
|
|
21
15
|
}));
|
|
22
16
|
|
|
23
|
-
export {
|
|
17
|
+
export { CompanySchema };
|
|
24
18
|
//# sourceMappingURL=index10.js.map
|
package/dist/index10.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index10.js","sources":["../src/schemas/
|
|
1
|
+
{"version":3,"file":"index10.js","sources":["../src/schemas/company.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseEntitySchema } from '@utilarium/overcontext';\nimport { RelationshipsSchema } from './relationships';\nimport { EntityContentSchema } from './content';\n\n/**\n * Company entity - organizations referenced in notes.\n */\nexport const CompanySchema = BaseEntitySchema.merge(z.object({\n type: z.literal('company'),\n \n fullName: z.string().optional(),\n industry: z.string().optional(),\n sounds_like: z.array(z.string()).optional(),\n relationships: RelationshipsSchema, // Relationships to other entities\n content: EntityContentSchema, // Attached content (URLs, text, documents)\n}));\n"],"names":[],"mappings":";;;;;AAQO,MAAM,aAAA,GAAgB,gBAAA,CAAiB,KAAA,CAAM,CAAA,CAAE,MAAA,CAAO;AAAA,EACzD,IAAA,EAAM,CAAA,CAAE,OAAA,CAAQ,SAAS,CAAA;AAAA,EAEzB,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,aAAa,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,EAC1C,aAAA,EAAe,mBAAA;AAAA;AAAA,EACf,OAAA,EAAS;AAAA;AACb,CAAC,CAAC;;;;"}
|
package/dist/index11.cjs
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const zod = require('zod');
|
|
6
|
+
|
|
7
|
+
const EntityContentItemSchema = zod.z.object({
|
|
8
|
+
/**
|
|
9
|
+
* Type of content
|
|
10
|
+
* Common types: url, text, markdown, html, document, image, video, code
|
|
11
|
+
*/
|
|
12
|
+
type: zod.z.string(),
|
|
13
|
+
/**
|
|
14
|
+
* Title or label for this content
|
|
15
|
+
*/
|
|
16
|
+
title: zod.z.string().optional(),
|
|
17
|
+
/**
|
|
18
|
+
* The actual content
|
|
19
|
+
* - For URLs: the URL string
|
|
20
|
+
* - For text: the text content
|
|
21
|
+
* - For documents: could be markdown, HTML, or plain text
|
|
22
|
+
* - For references: could be a file path or external reference
|
|
23
|
+
*/
|
|
24
|
+
content: zod.z.string(),
|
|
25
|
+
/**
|
|
26
|
+
* MIME type (optional)
|
|
27
|
+
* Examples: text/plain, text/markdown, text/html, application/pdf
|
|
28
|
+
*/
|
|
29
|
+
mimeType: zod.z.string().optional(),
|
|
30
|
+
/**
|
|
31
|
+
* Source or origin of this content
|
|
32
|
+
* Examples: "Company website", "LinkedIn profile", "Manual entry"
|
|
33
|
+
*/
|
|
34
|
+
source: zod.z.string().optional(),
|
|
35
|
+
/**
|
|
36
|
+
* When this content was added or last updated
|
|
37
|
+
*/
|
|
38
|
+
timestamp: zod.z.string().datetime().optional(),
|
|
39
|
+
/**
|
|
40
|
+
* Optional notes about this content
|
|
41
|
+
*/
|
|
42
|
+
notes: zod.z.string().optional(),
|
|
43
|
+
/**
|
|
44
|
+
* Optional metadata
|
|
45
|
+
*/
|
|
46
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
47
|
+
});
|
|
48
|
+
const EntityContentSchema = zod.z.array(EntityContentItemSchema).optional();
|
|
49
|
+
function createUrlContent(url, title, source, notes) {
|
|
50
|
+
return {
|
|
51
|
+
type: "url",
|
|
52
|
+
title: title || "Website",
|
|
53
|
+
content: url,
|
|
54
|
+
mimeType: "text/uri-list",
|
|
55
|
+
source,
|
|
56
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
57
|
+
notes
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function createTextContent(text, title, source, notes) {
|
|
61
|
+
return {
|
|
62
|
+
type: "text",
|
|
63
|
+
title: title || "Description",
|
|
64
|
+
content: text,
|
|
65
|
+
mimeType: "text/plain",
|
|
66
|
+
source,
|
|
67
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
68
|
+
notes
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function createMarkdownContent(markdown, title, source, notes) {
|
|
72
|
+
return {
|
|
73
|
+
type: "markdown",
|
|
74
|
+
title: title || "Document",
|
|
75
|
+
content: markdown,
|
|
76
|
+
mimeType: "text/markdown",
|
|
77
|
+
source,
|
|
78
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
79
|
+
notes
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function createCodeContent(code, language, title, source, notes) {
|
|
83
|
+
return {
|
|
84
|
+
type: "code",
|
|
85
|
+
title: title || `${language} code`,
|
|
86
|
+
content: code,
|
|
87
|
+
mimeType: `text/x-${language}`,
|
|
88
|
+
source,
|
|
89
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
90
|
+
notes,
|
|
91
|
+
metadata: { language }
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function createDocumentContent(path, title, mimeType, notes) {
|
|
95
|
+
return {
|
|
96
|
+
type: "document",
|
|
97
|
+
title: title || "Document",
|
|
98
|
+
content: path,
|
|
99
|
+
mimeType: mimeType || "application/octet-stream",
|
|
100
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
101
|
+
notes
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
exports.EntityContentItemSchema = EntityContentItemSchema;
|
|
106
|
+
exports.EntityContentSchema = EntityContentSchema;
|
|
107
|
+
exports.createCodeContent = createCodeContent;
|
|
108
|
+
exports.createDocumentContent = createDocumentContent;
|
|
109
|
+
exports.createMarkdownContent = createMarkdownContent;
|
|
110
|
+
exports.createTextContent = createTextContent;
|
|
111
|
+
exports.createUrlContent = createUrlContent;
|
|
112
|
+
//# sourceMappingURL=index11.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index11.cjs","sources":["../src/schemas/content.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Entity Content Item\n * \n * Represents structured content attached to an entity.\n * Can be URLs, text snippets, documents, or any other information.\n * \n * Examples:\n * - Company website URL\n * - Project description document\n * - Person's bio\n * - Term definition from external source\n */\nexport const EntityContentItemSchema = z.object({\n /**\n * Type of content\n * Common types: url, text, markdown, html, document, image, video, code\n */\n type: z.string(),\n \n /**\n * Title or label for this content\n */\n title: z.string().optional(),\n \n /**\n * The actual content\n * - For URLs: the URL string\n * - For text: the text content\n * - For documents: could be markdown, HTML, or plain text\n * - For references: could be a file path or external reference\n */\n content: z.string(),\n \n /**\n * MIME type (optional)\n * Examples: text/plain, text/markdown, text/html, application/pdf\n */\n mimeType: z.string().optional(),\n \n /**\n * Source or origin of this content\n * Examples: \"Company website\", \"LinkedIn profile\", \"Manual entry\"\n */\n source: z.string().optional(),\n \n /**\n * When this content was added or last updated\n */\n timestamp: z.string().datetime().optional(),\n \n /**\n * Optional notes about this content\n */\n notes: z.string().optional(),\n \n /**\n * Optional metadata\n */\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type EntityContentItem = z.infer<typeof EntityContentItemSchema>;\n\n/**\n * Content array for entities\n * Array of content items attached to an entity\n */\nexport const EntityContentSchema = z.array(EntityContentItemSchema).optional();\n\n/**\n * Helper function to create a URL content item\n */\nexport function createUrlContent(\n url: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'url',\n title: title || 'Website',\n content: url,\n mimeType: 'text/uri-list',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a text content item\n */\nexport function createTextContent(\n text: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'text',\n title: title || 'Description',\n content: text,\n mimeType: 'text/plain',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a markdown content item\n */\nexport function createMarkdownContent(\n markdown: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'markdown',\n title: title || 'Document',\n content: markdown,\n mimeType: 'text/markdown',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a code snippet content item\n */\nexport function createCodeContent(\n code: string,\n language: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'code',\n title: title || `${language} code`,\n content: code,\n mimeType: `text/x-${language}`,\n source,\n timestamp: new Date().toISOString(),\n notes,\n metadata: { language },\n };\n}\n\n/**\n * Helper function to create a document reference content item\n */\nexport function createDocumentContent(\n path: string,\n title?: string,\n mimeType?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'document',\n title: title || 'Document',\n content: path,\n mimeType: mimeType || 'application/octet-stream',\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n"],"names":["z"],"mappings":"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"}
|
package/dist/index11.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const EntityContentItemSchema = z.object({
|
|
4
|
+
/**
|
|
5
|
+
* Type of content
|
|
6
|
+
* Common types: url, text, markdown, html, document, image, video, code
|
|
7
|
+
*/
|
|
8
|
+
type: z.string(),
|
|
9
|
+
/**
|
|
10
|
+
* Title or label for this content
|
|
11
|
+
*/
|
|
12
|
+
title: z.string().optional(),
|
|
13
|
+
/**
|
|
14
|
+
* The actual content
|
|
15
|
+
* - For URLs: the URL string
|
|
16
|
+
* - For text: the text content
|
|
17
|
+
* - For documents: could be markdown, HTML, or plain text
|
|
18
|
+
* - For references: could be a file path or external reference
|
|
19
|
+
*/
|
|
20
|
+
content: z.string(),
|
|
21
|
+
/**
|
|
22
|
+
* MIME type (optional)
|
|
23
|
+
* Examples: text/plain, text/markdown, text/html, application/pdf
|
|
24
|
+
*/
|
|
25
|
+
mimeType: z.string().optional(),
|
|
26
|
+
/**
|
|
27
|
+
* Source or origin of this content
|
|
28
|
+
* Examples: "Company website", "LinkedIn profile", "Manual entry"
|
|
29
|
+
*/
|
|
30
|
+
source: z.string().optional(),
|
|
31
|
+
/**
|
|
32
|
+
* When this content was added or last updated
|
|
33
|
+
*/
|
|
34
|
+
timestamp: z.string().datetime().optional(),
|
|
35
|
+
/**
|
|
36
|
+
* Optional notes about this content
|
|
37
|
+
*/
|
|
38
|
+
notes: z.string().optional(),
|
|
39
|
+
/**
|
|
40
|
+
* Optional metadata
|
|
41
|
+
*/
|
|
42
|
+
metadata: z.record(z.string(), z.unknown()).optional()
|
|
43
|
+
});
|
|
44
|
+
const EntityContentSchema = z.array(EntityContentItemSchema).optional();
|
|
45
|
+
function createUrlContent(url, title, source, notes) {
|
|
46
|
+
return {
|
|
47
|
+
type: "url",
|
|
48
|
+
title: title || "Website",
|
|
49
|
+
content: url,
|
|
50
|
+
mimeType: "text/uri-list",
|
|
51
|
+
source,
|
|
52
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
53
|
+
notes
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function createTextContent(text, title, source, notes) {
|
|
57
|
+
return {
|
|
58
|
+
type: "text",
|
|
59
|
+
title: title || "Description",
|
|
60
|
+
content: text,
|
|
61
|
+
mimeType: "text/plain",
|
|
62
|
+
source,
|
|
63
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
64
|
+
notes
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function createMarkdownContent(markdown, title, source, notes) {
|
|
68
|
+
return {
|
|
69
|
+
type: "markdown",
|
|
70
|
+
title: title || "Document",
|
|
71
|
+
content: markdown,
|
|
72
|
+
mimeType: "text/markdown",
|
|
73
|
+
source,
|
|
74
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
75
|
+
notes
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function createCodeContent(code, language, title, source, notes) {
|
|
79
|
+
return {
|
|
80
|
+
type: "code",
|
|
81
|
+
title: title || `${language} code`,
|
|
82
|
+
content: code,
|
|
83
|
+
mimeType: `text/x-${language}`,
|
|
84
|
+
source,
|
|
85
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
86
|
+
notes,
|
|
87
|
+
metadata: { language }
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function createDocumentContent(path, title, mimeType, notes) {
|
|
91
|
+
return {
|
|
92
|
+
type: "document",
|
|
93
|
+
title: title || "Document",
|
|
94
|
+
content: path,
|
|
95
|
+
mimeType: mimeType || "application/octet-stream",
|
|
96
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
97
|
+
notes
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { EntityContentItemSchema, EntityContentSchema, createCodeContent, createDocumentContent, createMarkdownContent, createTextContent, createUrlContent };
|
|
102
|
+
//# sourceMappingURL=index11.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index11.js","sources":["../src/schemas/content.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Entity Content Item\n * \n * Represents structured content attached to an entity.\n * Can be URLs, text snippets, documents, or any other information.\n * \n * Examples:\n * - Company website URL\n * - Project description document\n * - Person's bio\n * - Term definition from external source\n */\nexport const EntityContentItemSchema = z.object({\n /**\n * Type of content\n * Common types: url, text, markdown, html, document, image, video, code\n */\n type: z.string(),\n \n /**\n * Title or label for this content\n */\n title: z.string().optional(),\n \n /**\n * The actual content\n * - For URLs: the URL string\n * - For text: the text content\n * - For documents: could be markdown, HTML, or plain text\n * - For references: could be a file path or external reference\n */\n content: z.string(),\n \n /**\n * MIME type (optional)\n * Examples: text/plain, text/markdown, text/html, application/pdf\n */\n mimeType: z.string().optional(),\n \n /**\n * Source or origin of this content\n * Examples: \"Company website\", \"LinkedIn profile\", \"Manual entry\"\n */\n source: z.string().optional(),\n \n /**\n * When this content was added or last updated\n */\n timestamp: z.string().datetime().optional(),\n \n /**\n * Optional notes about this content\n */\n notes: z.string().optional(),\n \n /**\n * Optional metadata\n */\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type EntityContentItem = z.infer<typeof EntityContentItemSchema>;\n\n/**\n * Content array for entities\n * Array of content items attached to an entity\n */\nexport const EntityContentSchema = z.array(EntityContentItemSchema).optional();\n\n/**\n * Helper function to create a URL content item\n */\nexport function createUrlContent(\n url: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'url',\n title: title || 'Website',\n content: url,\n mimeType: 'text/uri-list',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a text content item\n */\nexport function createTextContent(\n text: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'text',\n title: title || 'Description',\n content: text,\n mimeType: 'text/plain',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a markdown content item\n */\nexport function createMarkdownContent(\n markdown: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'markdown',\n title: title || 'Document',\n content: markdown,\n mimeType: 'text/markdown',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a code snippet content item\n */\nexport function createCodeContent(\n code: string,\n language: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'code',\n title: title || `${language} code`,\n content: code,\n mimeType: `text/x-${language}`,\n source,\n timestamp: new Date().toISOString(),\n notes,\n metadata: { language },\n };\n}\n\n/**\n * Helper function to create a document reference content item\n */\nexport function createDocumentContent(\n path: string,\n title?: string,\n mimeType?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'document',\n title: title || 'Document',\n content: path,\n mimeType: mimeType || 'application/octet-stream',\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n"],"names":[],"mappings":";;AAcO,MAAM,uBAAA,GAA0B,EAAE,MAAA,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA;AAAA;AAAA;AAAA,EAKf,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS3B,OAAA,EAAS,EAAE,MAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlB,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK5B,WAAW,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK1C,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK3B,QAAA,EAAU,CAAA,CAAE,MAAA,CAAO,CAAA,CAAE,MAAA,IAAU,CAAA,CAAE,OAAA,EAAS,CAAA,CAAE,QAAA;AAChD,CAAC;AAQM,MAAM,mBAAA,GAAsB,CAAA,CAAE,KAAA,CAAM,uBAAuB,EAAE,QAAA;AAK7D,SAAS,gBAAA,CACZ,GAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,KAAA;AAAA,IACN,OAAO,KAAA,IAAS,SAAA;AAAA,IAChB,OAAA,EAAS,GAAA;AAAA,IACT,QAAA,EAAU,eAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,iBAAA,CACZ,IAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,MAAA;AAAA,IACN,OAAO,KAAA,IAAS,aAAA;AAAA,IAChB,OAAA,EAAS,IAAA;AAAA,IACT,QAAA,EAAU,YAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,qBAAA,CACZ,QAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,UAAA;AAAA,IACN,OAAO,KAAA,IAAS,UAAA;AAAA,IAChB,OAAA,EAAS,QAAA;AAAA,IACT,QAAA,EAAU,eAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,iBAAA,CACZ,IAAA,EACA,QAAA,EACA,KAAA,EACA,QACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,MAAA;AAAA,IACN,KAAA,EAAO,KAAA,IAAS,CAAA,EAAG,QAAQ,CAAA,KAAA,CAAA;AAAA,IAC3B,OAAA,EAAS,IAAA;AAAA,IACT,QAAA,EAAU,UAAU,QAAQ,CAAA,CAAA;AAAA,IAC5B,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC,KAAA;AAAA,IACA,QAAA,EAAU,EAAE,QAAA;AAAS,GACzB;AACJ;AAKO,SAAS,qBAAA,CACZ,IAAA,EACA,KAAA,EACA,QAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,UAAA;AAAA,IACN,OAAO,KAAA,IAAS,UAAA;AAAA,IAChB,OAAA,EAAS,IAAA;AAAA,IACT,UAAU,QAAA,IAAY,0BAAA;AAAA,IACtB,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;;;;"}
|
package/dist/index12.cjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const zod = require('zod');
|
|
6
|
+
|
|
7
|
+
const EntityRelationshipSchema = zod.z.object({
|
|
8
|
+
/**
|
|
9
|
+
* The URI of the related entity
|
|
10
|
+
* Format: redaksjon://{type}/{id}
|
|
11
|
+
*/
|
|
12
|
+
uri: zod.z.string().regex(
|
|
13
|
+
/^redaksjon:\/\/[a-z]+\/[a-zA-Z0-9._-]+$/,
|
|
14
|
+
{ message: "URI must be in format: redaksjon://{type}/{id}" }
|
|
15
|
+
),
|
|
16
|
+
/**
|
|
17
|
+
* The type of relationship (freeform)
|
|
18
|
+
* Examples: "works_at", "manages", "related_to", "depends_on", "part_of"
|
|
19
|
+
*/
|
|
20
|
+
relationship: zod.z.string(),
|
|
21
|
+
/**
|
|
22
|
+
* Optional notes about this relationship
|
|
23
|
+
*/
|
|
24
|
+
notes: zod.z.string().optional(),
|
|
25
|
+
/**
|
|
26
|
+
* Optional metadata
|
|
27
|
+
*/
|
|
28
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
29
|
+
});
|
|
30
|
+
const RelationshipsSchema = zod.z.array(EntityRelationshipSchema).optional();
|
|
31
|
+
function createEntityUri(type, id) {
|
|
32
|
+
return `redaksjon://${type}/${id}`;
|
|
33
|
+
}
|
|
34
|
+
function parseEntityUri(uri) {
|
|
35
|
+
const match = uri.match(/^redaksjon:\/\/([a-z]+)\/([a-zA-Z0-9._-]+)$/);
|
|
36
|
+
if (!match) return null;
|
|
37
|
+
return {
|
|
38
|
+
type: match[1],
|
|
39
|
+
id: match[2]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function createRelationship(targetType, targetId, relationship, notes, metadata) {
|
|
43
|
+
return {
|
|
44
|
+
uri: createEntityUri(targetType, targetId),
|
|
45
|
+
relationship,
|
|
46
|
+
notes,
|
|
47
|
+
metadata
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
exports.EntityRelationshipSchema = EntityRelationshipSchema;
|
|
52
|
+
exports.RelationshipsSchema = RelationshipsSchema;
|
|
53
|
+
exports.createEntityUri = createEntityUri;
|
|
54
|
+
exports.createRelationship = createRelationship;
|
|
55
|
+
exports.parseEntityUri = parseEntityUri;
|
|
56
|
+
//# sourceMappingURL=index12.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index12.cjs","sources":["../src/schemas/relationships.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Entity Relationship\n * \n * Represents a typed relationship between entities using URIs as coordinates.\n * URIs follow the pattern: redaksjon://{type}/{id}\n * \n * Examples:\n * - redaksjon://person/pete_wagner\n * - redaksjon://company/acme-corp\n * - redaksjon://term/kubernetes\n * - redaksjon://project/protokoll\n */\nexport const EntityRelationshipSchema = z.object({\n /**\n * The URI of the related entity\n * Format: redaksjon://{type}/{id}\n */\n uri: z.string().regex(\n /^redaksjon:\\/\\/[a-z]+\\/[a-zA-Z0-9._-]+$/,\n { message: 'URI must be in format: redaksjon://{type}/{id}' }\n ),\n \n /**\n * The type of relationship (freeform)\n * Examples: \"works_at\", \"manages\", \"related_to\", \"depends_on\", \"part_of\"\n */\n relationship: z.string(),\n \n /**\n * Optional notes about this relationship\n */\n notes: z.string().optional(),\n \n /**\n * Optional metadata\n */\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type EntityRelationship = z.infer<typeof EntityRelationshipSchema>;\n\n/**\n * Relationships field for all entities\n * Array of typed relationships to other entities\n */\nexport const RelationshipsSchema = z.array(EntityRelationshipSchema).optional();\n\n/**\n * Helper function to create a relationship URI\n */\nexport function createEntityUri(type: string, id: string): string {\n return `redaksjon://${type}/${id}`;\n}\n\n/**\n * Helper function to parse a relationship URI\n */\nexport function parseEntityUri(uri: string): { type: string; id: string } | null {\n const match = uri.match(/^redaksjon:\\/\\/([a-z]+)\\/([a-zA-Z0-9._-]+)$/);\n if (!match) return null;\n return {\n type: match[1],\n id: match[2],\n };\n}\n\n/**\n * Helper function to create a relationship\n */\nexport function createRelationship(\n targetType: string,\n targetId: string,\n relationship: string,\n notes?: string,\n metadata?: Record<string, unknown>\n): EntityRelationship {\n return {\n uri: createEntityUri(targetType, targetId),\n relationship,\n notes,\n metadata,\n };\n}\n"],"names":["z"],"mappings":";;;;;;AAcO,MAAM,wBAAA,GAA2BA,MAAE,MAAA,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7C,GAAA,EAAKA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA;AAAA,IACZ,yCAAA;AAAA,IACA,EAAE,SAAS,gDAAA;AAAiD,GAChE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAA,EAAcA,MAAE,MAAA,EAAO;AAAA;AAAA;AAAA;AAAA,EAKvB,KAAA,EAAOA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK3B,QAAA,EAAUA,KAAA,CAAE,MAAA,CAAOA,KAAA,CAAE,MAAA,IAAUA,KAAA,CAAE,OAAA,EAAS,CAAA,CAAE,QAAA;AAChD,CAAC;AAQM,MAAM,mBAAA,GAAsBA,KAAA,CAAE,KAAA,CAAM,wBAAwB,EAAE,QAAA;AAK9D,SAAS,eAAA,CAAgB,MAAc,EAAA,EAAoB;AAC9D,EAAA,OAAO,CAAA,YAAA,EAAe,IAAI,CAAA,CAAA,EAAI,EAAE,CAAA,CAAA;AACpC;AAKO,SAAS,eAAe,GAAA,EAAkD;AAC7E,EAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,KAAA,CAAM,6CAA6C,CAAA;AACrE,EAAA,IAAI,CAAC,OAAO,OAAO,IAAA;AACnB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,MAAM,CAAC,CAAA;AAAA,IACb,EAAA,EAAI,MAAM,CAAC;AAAA,GACf;AACJ;AAKO,SAAS,kBAAA,CACZ,UAAA,EACA,QAAA,EACA,YAAA,EACA,OACA,QAAA,EACkB;AAClB,EAAA,OAAO;AAAA,IACH,GAAA,EAAK,eAAA,CAAgB,UAAA,EAAY,QAAQ,CAAA;AAAA,IACzC,YAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACJ;AACJ;;;;;;;;"}
|