@miadi/episodic-memory-schema 0.1.1 → 0.3.0
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 +47 -2
- package/dist/adapters/common.d.ts +14 -0
- package/dist/adapters/common.d.ts.map +1 -0
- package/dist/adapters/common.js +99 -0
- package/dist/adapters/common.js.map +1 -0
- package/dist/adapters/composition.d.ts +7 -0
- package/dist/adapters/composition.d.ts.map +1 -0
- package/dist/adapters/composition.js +431 -0
- package/dist/adapters/composition.js.map +1 -0
- package/dist/adapters/directory.d.ts +7 -0
- package/dist/adapters/directory.d.ts.map +1 -0
- package/dist/adapters/directory.js +175 -0
- package/dist/adapters/directory.js.map +1 -0
- package/dist/adapters/episode-yaml.d.ts +9 -0
- package/dist/adapters/episode-yaml.d.ts.map +1 -0
- package/dist/adapters/episode-yaml.js +326 -0
- package/dist/adapters/episode-yaml.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/observation.d.ts +125 -0
- package/dist/observation.d.ts.map +1 -0
- package/dist/observation.js +9 -0
- package/dist/observation.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility-first observations of heterogeneous episode sources.
|
|
3
|
+
*
|
|
4
|
+
* An observation describes source material without requiring it to satisfy the
|
|
5
|
+
* authored EpisodicMemory schema. Consumers can inspect the diagnostics and
|
|
6
|
+
* decide whether a later, explicit projection is appropriate.
|
|
7
|
+
*/
|
|
8
|
+
export type EpisodeSourceZone = "composition-intake" | "chronicle" | "runtime-projection";
|
|
9
|
+
export type EpisodeSourceFormat = "composition-json" | "episode-yaml" | "directory-inferred" | "episodic-memory";
|
|
10
|
+
export interface SourceDocumentRef {
|
|
11
|
+
format: EpisodeSourceFormat;
|
|
12
|
+
relativePath: string;
|
|
13
|
+
}
|
|
14
|
+
export interface EpisodeIdentityCandidate {
|
|
15
|
+
kind: "episode-number" | "slug" | "title" | "path";
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
export type ArtifactKind = "audio" | "transcript" | "image" | "text" | "midi" | "video" | "other";
|
|
19
|
+
export interface ArtifactReference {
|
|
20
|
+
id: string;
|
|
21
|
+
kind: ArtifactKind;
|
|
22
|
+
relativePath: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
sourceArtifact?: string;
|
|
25
|
+
metadata: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export type EpisodeRelationKind = "related-to" | "branch-of" | "continues-from";
|
|
28
|
+
export interface EpisodeRelation {
|
|
29
|
+
id: string;
|
|
30
|
+
kind: EpisodeRelationKind;
|
|
31
|
+
target: EpisodeIdentityCandidate;
|
|
32
|
+
metadata?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export interface CompatibilityDiagnostic {
|
|
35
|
+
level: "info" | "warning" | "error";
|
|
36
|
+
code: string;
|
|
37
|
+
message: string;
|
|
38
|
+
path?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface EpisodeSourceMetadata {
|
|
41
|
+
title?: string;
|
|
42
|
+
slug?: string;
|
|
43
|
+
created?: string;
|
|
44
|
+
updated?: string;
|
|
45
|
+
notes?: string;
|
|
46
|
+
skillSeeds?: string[];
|
|
47
|
+
date?: string;
|
|
48
|
+
status?: string;
|
|
49
|
+
sessionTitle?: string;
|
|
50
|
+
primaryIssue?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* One movement of a composition — the song-form unit a musician edits.
|
|
54
|
+
*
|
|
55
|
+
* `chords` is deliberately typed as a union: the current editor writes an
|
|
56
|
+
* array, older manifests and the documented schema write a delimited string.
|
|
57
|
+
* Both are real in the corpus, so neither is normalized away here.
|
|
58
|
+
*/
|
|
59
|
+
export interface CompositionSection {
|
|
60
|
+
name?: string;
|
|
61
|
+
chords?: string[] | string;
|
|
62
|
+
bpm?: number;
|
|
63
|
+
lyrics?: string;
|
|
64
|
+
strum?: string;
|
|
65
|
+
/** Per-note MIDI arrays are summarized; the raw array stays in unmappedFields. */
|
|
66
|
+
midi?: {
|
|
67
|
+
source?: string;
|
|
68
|
+
noteCount?: number;
|
|
69
|
+
duration?: number;
|
|
70
|
+
};
|
|
71
|
+
unmappedFields: Record<string, unknown>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The songwriting layer of a composition manifest.
|
|
75
|
+
*
|
|
76
|
+
* Present only when the source carried musical fields. Absent is meaningful —
|
|
77
|
+
* it distinguishes a hand-authored manifest that never had them from one whose
|
|
78
|
+
* musician left them at defaults.
|
|
79
|
+
*/
|
|
80
|
+
export interface CompositionMusicalMetadata {
|
|
81
|
+
/** Derived by the writer as the flat union of every section's chords. */
|
|
82
|
+
chords?: string[];
|
|
83
|
+
sections?: CompositionSection[];
|
|
84
|
+
rhythm?: string;
|
|
85
|
+
bpm?: number | null;
|
|
86
|
+
bpmDetected?: boolean;
|
|
87
|
+
key?: string;
|
|
88
|
+
capo?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface EpisodeObservation {
|
|
91
|
+
id: string;
|
|
92
|
+
zone: EpisodeSourceZone;
|
|
93
|
+
sourceDocuments: SourceDocumentRef[];
|
|
94
|
+
identityCandidates: EpisodeIdentityCandidate[];
|
|
95
|
+
sourceMetadata: EpisodeSourceMetadata;
|
|
96
|
+
artifacts: ArtifactReference[];
|
|
97
|
+
relations: EpisodeRelation[];
|
|
98
|
+
diagnostics: CompatibilityDiagnostic[];
|
|
99
|
+
/** Present only for sources carrying musical metadata. */
|
|
100
|
+
musical?: CompositionMusicalMetadata;
|
|
101
|
+
/** Source fields that were preserved but not structurally projected. */
|
|
102
|
+
unmappedFields: Record<string, unknown>;
|
|
103
|
+
}
|
|
104
|
+
export interface ObserveCompositionManifestOptions {
|
|
105
|
+
relativePath: string;
|
|
106
|
+
zone?: "composition-intake";
|
|
107
|
+
}
|
|
108
|
+
export interface ObserveEpisodeYamlManifestOptions {
|
|
109
|
+
relativePath: string;
|
|
110
|
+
zone?: "chronicle";
|
|
111
|
+
}
|
|
112
|
+
export interface EpisodeDirectoryEntry {
|
|
113
|
+
relativePath: string;
|
|
114
|
+
type?: "file" | "directory";
|
|
115
|
+
size?: number;
|
|
116
|
+
modifiedAt?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface EpisodeDirectorySnapshot {
|
|
119
|
+
entries: readonly (string | EpisodeDirectoryEntry)[];
|
|
120
|
+
}
|
|
121
|
+
export interface ObserveEpisodeDirectoryOptions {
|
|
122
|
+
relativePath: string;
|
|
123
|
+
zone?: "chronicle";
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=observation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../src/observation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,iBAAiB,GACzB,oBAAoB,GACpB,WAAW,GACX,oBAAoB,CAAA;AAExB,MAAM,MAAM,mBAAmB,GAC3B,kBAAkB,GAClB,cAAc,GACd,oBAAoB,GACpB,iBAAiB,CAAA;AAErB,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,mBAAmB,CAAA;IAC3B,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;IAClD,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,YAAY,GACZ,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,CAAA;AAEX,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,YAAY,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,E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,WAAW,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,qBAAqB,CAAC,EAAE,CAAA;CACrD;AAED,MAAM,WAAW,8BAA8B;IAC7C,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,WAAW,CAAA;CACnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility-first observations of heterogeneous episode sources.
|
|
3
|
+
*
|
|
4
|
+
* An observation describes source material without requiring it to satisfy the
|
|
5
|
+
* authored EpisodicMemory schema. Consumers can inspect the diagnostics and
|
|
6
|
+
* decide whether a later, explicit projection is appropriate.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=observation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation.js","sourceRoot":"","sources":["../src/observation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miadi/episodic-memory-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "TypeScript types and JSON Schema for episodic memory — the durable session-to-session memory layer in the Miadi orchestration kit. Narrative layer is NCP-aligned; provenance layer is W3C PROV-DM and OAIS-informed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"miadi",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"homepage": "https://github.com/jgwill/Miadi/tree/main/packages/episodic-memory-schema",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/jgwill/Miadi.git",
|
|
21
|
+
"url": "git+https://github.com/jgwill/Miadi.git",
|
|
22
22
|
"directory": "packages/episodic-memory-schema"
|
|
23
23
|
},
|
|
24
24
|
"type": "module",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"README.md",
|
|
40
40
|
"LICENSE"
|
|
41
41
|
],
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "tsc",
|
|
44
|
-
"type-check": "tsc --noEmit",
|
|
45
|
-
"prepublishOnly": "pnpm build"
|
|
46
|
-
},
|
|
47
42
|
"devDependencies": {
|
|
48
43
|
"typescript": "^5.4.0"
|
|
49
44
|
},
|
|
50
45
|
"publishConfig": {
|
|
51
46
|
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsc",
|
|
50
|
+
"type-check": "tsc --noEmit",
|
|
51
|
+
"test": "npm run build && node --test test/*.test.mjs"
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|