@x12i/memorix-client-api 0.0.0-stage → 0.16.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.
Files changed (108) hide show
  1. package/HANDOVER.md +97 -0
  2. package/dist/app.d.ts +64 -0
  3. package/dist/app.d.ts.map +1 -0
  4. package/dist/app.js +412 -0
  5. package/dist/app.js.map +1 -0
  6. package/dist/authix.d.ts +9 -0
  7. package/dist/authix.d.ts.map +1 -0
  8. package/dist/authix.js +26 -0
  9. package/dist/authix.js.map +1 -0
  10. package/dist/catalog.d.ts +160 -0
  11. package/dist/catalog.d.ts.map +1 -0
  12. package/dist/catalog.js +371 -0
  13. package/dist/catalog.js.map +1 -0
  14. package/dist/cli.d.ts +2 -0
  15. package/dist/cli.d.ts.map +1 -0
  16. package/dist/cli.js +102 -0
  17. package/dist/cli.js.map +1 -0
  18. package/dist/config.d.ts +33 -0
  19. package/dist/config.d.ts.map +1 -0
  20. package/dist/config.js +109 -0
  21. package/dist/config.js.map +1 -0
  22. package/dist/derived.d.ts +2 -0
  23. package/dist/derived.d.ts.map +1 -0
  24. package/dist/derived.js +35 -0
  25. package/dist/derived.js.map +1 -0
  26. package/dist/errors.d.ts +11 -0
  27. package/dist/errors.d.ts.map +1 -0
  28. package/dist/errors.js +21 -0
  29. package/dist/errors.js.map +1 -0
  30. package/dist/fetch.d.ts +17 -0
  31. package/dist/fetch.d.ts.map +1 -0
  32. package/dist/fetch.js +741 -0
  33. package/dist/fetch.js.map +1 -0
  34. package/dist/index.d.ts +4 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +4 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/live-ops-nav.d.ts +2 -0
  39. package/dist/live-ops-nav.d.ts.map +1 -0
  40. package/dist/live-ops-nav.js +42 -0
  41. package/dist/live-ops-nav.js.map +1 -0
  42. package/dist/live.d.ts +20 -0
  43. package/dist/live.d.ts.map +1 -0
  44. package/dist/live.js +8 -0
  45. package/dist/live.js.map +1 -0
  46. package/dist/markdown.d.ts +19 -0
  47. package/dist/markdown.d.ts.map +1 -0
  48. package/dist/markdown.js +102 -0
  49. package/dist/markdown.js.map +1 -0
  50. package/dist/peers.d.ts +51 -0
  51. package/dist/peers.d.ts.map +1 -0
  52. package/dist/peers.js +127 -0
  53. package/dist/peers.js.map +1 -0
  54. package/dist/processed.d.ts +22 -0
  55. package/dist/processed.d.ts.map +1 -0
  56. package/dist/processed.js +397 -0
  57. package/dist/processed.js.map +1 -0
  58. package/dist/project.d.ts +25 -0
  59. package/dist/project.d.ts.map +1 -0
  60. package/dist/project.js +76 -0
  61. package/dist/project.js.map +1 -0
  62. package/dist/reads-live-routes.d.ts +4 -0
  63. package/dist/reads-live-routes.d.ts.map +1 -0
  64. package/dist/reads-live-routes.js +56 -0
  65. package/dist/reads-live-routes.js.map +1 -0
  66. package/dist/reads-live-ui.d.ts +3 -0
  67. package/dist/reads-live-ui.d.ts.map +1 -0
  68. package/dist/reads-live-ui.js +204 -0
  69. package/dist/reads-live-ui.js.map +1 -0
  70. package/dist/reads-ring.d.ts +29 -0
  71. package/dist/reads-ring.d.ts.map +1 -0
  72. package/dist/reads-ring.js +44 -0
  73. package/dist/reads-ring.js.map +1 -0
  74. package/dist/refs.d.ts +24 -0
  75. package/dist/refs.d.ts.map +1 -0
  76. package/dist/refs.js +354 -0
  77. package/dist/refs.js.map +1 -0
  78. package/dist/request-countex.d.ts +53 -0
  79. package/dist/request-countex.d.ts.map +1 -0
  80. package/dist/request-countex.js +171 -0
  81. package/dist/request-countex.js.map +1 -0
  82. package/dist/scope.d.ts +13 -0
  83. package/dist/scope.d.ts.map +1 -0
  84. package/dist/scope.js +46 -0
  85. package/dist/scope.js.map +1 -0
  86. package/dist/scoper.d.ts +75 -0
  87. package/dist/scoper.d.ts.map +1 -0
  88. package/dist/scoper.js +475 -0
  89. package/dist/scoper.js.map +1 -0
  90. package/dist/shaped-refs.d.ts +23 -0
  91. package/dist/shaped-refs.d.ts.map +1 -0
  92. package/dist/shaped-refs.js +395 -0
  93. package/dist/shaped-refs.js.map +1 -0
  94. package/dist/skills.d.ts +102 -0
  95. package/dist/skills.d.ts.map +1 -0
  96. package/dist/skills.js +609 -0
  97. package/dist/skills.js.map +1 -0
  98. package/dist/story.d.ts +43 -0
  99. package/dist/story.d.ts.map +1 -0
  100. package/dist/story.js +121 -0
  101. package/dist/story.js.map +1 -0
  102. package/dist/upstream.d.ts +13 -0
  103. package/dist/upstream.d.ts.map +1 -0
  104. package/dist/upstream.js +58 -0
  105. package/dist/upstream.js.map +1 -0
  106. package/openapi/openapi.json +480 -0
  107. package/package.json +60 -6
  108. package/README.md +0 -3
@@ -0,0 +1,480 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "Memorix client API",
5
+ "version": "0.16.0",
6
+ "description": "Read API for smart clients. Agents come from x-memorix-agent-ids. The org comes from x-memorix-org-id, or from an Authix bearer token when MEMORIX_AUTH=authix. x-memorix-caller names the calling app. Descriptors are the effective object-type fields for those agents. GET /api/v1/memorix/{path} forwards Memorix read routes. Agent functions are under /api/v1/agent-functions. Nexum subjects and canvas are under /api/v1/nexum. Scoper 2.3.0 is hosted at /api/v1/scoper. MCP is /api/v1/mcp/nexum, /api/v1/mcp/scoper, and /api/v1/mcp/mgc. Aligned with memorix-service 3.17.0 and memorix-skills 0.6.0."
7
+ },
8
+ "paths": {
9
+ "/health": {
10
+ "get": {
11
+ "operationId": "health",
12
+ "summary": "Liveness",
13
+ "responses": { "200": { "description": "Process is up" } }
14
+ }
15
+ },
16
+ "/api/v1/catalog": {
17
+ "get": {
18
+ "operationId": "catalog",
19
+ "summary": "Object types, content types, and field descriptors for the agent ids",
20
+ "description": "Each content type has derived true or false. derived true is a processing result stored on the subject. Source content is false. Metadata derived on the content type wins; otherwise the platform result types are used. A field may include mixed and shapes. shapes name a grammar and resolvesTo (objectType, contentTypes, recordId). recordId is value, paired-<sourceProperty>, or a template containing {value}. When every value shape names one object type, refersTo is that object type. A content type may also carry presentation (label, order, tab always|whenPresent|hidden, values[] with value, label, order, origin) and origin (producer model|code|mixed, use always|conditional, record). Both are optional, display metadata only, and absent when the pack has not stamped them. An object type may include functions (id, question, page, composes, pageStory, reads, optional template and kind spine|threads). template is the story template id, the same string as data.template and as presentation.values[].value on content type story. A malformed function is dropped.",
21
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
22
+ "responses": { "200": { "description": "Catalog" } }
23
+ }
24
+ },
25
+ "/api/v1/object-types/{objectType}": {
26
+ "get": {
27
+ "operationId": "objectType",
28
+ "summary": "One object type and its content-type descriptors",
29
+ "parameters": [
30
+ { "$ref": "#/components/parameters/ScopeHeaders" },
31
+ { "$ref": "#/components/parameters/ObjectType" }
32
+ ],
33
+ "responses": { "200": { "description": "Object type" }, "404": { "description": "Unknown object type" } }
34
+ }
35
+ },
36
+ "/api/v1/object-types/{objectType}/content-types": {
37
+ "get": {
38
+ "operationId": "contentTypes",
39
+ "summary": "Content types allowed on an object type, with descriptors and the leading content type",
40
+ "parameters": [
41
+ { "$ref": "#/components/parameters/ScopeHeaders" },
42
+ { "$ref": "#/components/parameters/ObjectType" }
43
+ ],
44
+ "responses": { "200": { "description": "Content types" } }
45
+ }
46
+ },
47
+ "/api/v1/object-types/{objectType}/content-types/{contentType}": {
48
+ "get": {
49
+ "operationId": "contentType",
50
+ "summary": "Descriptors for one content type",
51
+ "parameters": [
52
+ { "$ref": "#/components/parameters/ScopeHeaders" },
53
+ { "$ref": "#/components/parameters/ObjectType" },
54
+ { "$ref": "#/components/parameters/ContentType" }
55
+ ],
56
+ "responses": { "200": { "description": "Content type" }, "404": { "description": "Unknown content type" } }
57
+ }
58
+ },
59
+ "/api/v1/object-types/{objectType}/records": {
60
+ "get": {
61
+ "operationId": "listRecords",
62
+ "summary": "Paginated subjects, driven by a leading content type",
63
+ "description": "Filter, sort, and cursor apply to the leading content type. Sibling content types are attached on each row. leadingContentType defaults to the content type marked leading in metadata, or the first content type that is not relationships. contentTypes defaults to every content type on the object type except relationships. representation is json, markdown, or both (default both). pageInfo.nextCursor is the Memorix cursor. Fields with refersTo are record ids; json and rendered markdown replace them with the records they point at.",
64
+ "parameters": [
65
+ { "$ref": "#/components/parameters/ScopeHeaders" },
66
+ { "$ref": "#/components/parameters/ObjectType" },
67
+ { "name": "leadingContentType", "in": "query", "schema": { "type": "string" } },
68
+ { "name": "contentTypes", "in": "query", "schema": { "type": "string" }, "description": "Comma-separated content type ids" },
69
+ { "name": "representation", "in": "query", "schema": { "type": "string", "enum": ["json", "markdown", "both"] } },
70
+ { "name": "filter", "in": "query", "schema": { "type": "string" }, "description": "JSON SafeFilter" },
71
+ { "name": "sort", "in": "query", "schema": { "type": "string" }, "description": "JSON sort" },
72
+ { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } },
73
+ { "name": "cursor", "in": "query", "schema": { "type": "string" } }
74
+ ],
75
+ "responses": { "200": { "description": "Page of subjects" } }
76
+ }
77
+ },
78
+ "/api/v1/records/{recordId}": {
79
+ "get": {
80
+ "operationId": "getRecord",
81
+ "summary": "One subject with all stored content types, or a named subset",
82
+ "description": "recordId may contain slashes; send them as extra path segments. Omit contentTypes to load every content type registered on the subject. representation is json, markdown, or both (default both). Each instance includes descriptor.fields, descriptorCoverage (complete, partial, none), and undeclaredPaths. Markdown stored with source ai or content is returned as stored. Otherwise it is rendered from .data with source rendered. Fields with refersTo are record ids; json and rendered markdown replace them with { recordId, objectType, contentType, data }. A data.<key> field is expanded at every key of that name. Unmatched ids stay strings. Prose is not parsed back into fields.",
83
+ "parameters": [
84
+ { "$ref": "#/components/parameters/ScopeHeaders" },
85
+ { "name": "recordId", "in": "path", "required": true, "schema": { "type": "string" } },
86
+ { "name": "contentTypes", "in": "query", "schema": { "type": "string" } },
87
+ { "name": "representation", "in": "query", "schema": { "type": "string", "enum": ["json", "markdown", "both"] } },
88
+ { "name": "objectType", "in": "query", "schema": { "type": "string" }, "description": "When set, must match the directory" }
89
+ ],
90
+ "responses": { "200": { "description": "Subject" }, "404": { "description": "Subject is not reserved" } }
91
+ }
92
+ },
93
+ "/api/v1/processed-subjects": {
94
+ "get": {
95
+ "operationId": "processedSubjects",
96
+ "summary": "Distinct subjects that have a derived content row on that same record",
97
+ "description": "rule.id caller-or-preserved opens every catalog content type except relationships. A subject counts when a row on that record has datasource basis caller or preserved. Declared and backfill rows do not count. The process keeps the answer for the org and agent ids. checking stays true until every included collection is read with no nextCursor. A later read returns that answer. continue=true keeps those subjects and reads empty collections again. A new rule.id drops the kept answer. count is the number of distinct subjects, not the page size. pageInfo.nextCursor is omitted on the last page. A working/ record id is not a subject. An unregistered content type is skipped.",
98
+ "parameters": [
99
+ { "$ref": "#/components/parameters/ScopeHeaders" },
100
+ { "name": "objectType", "in": "query", "schema": { "type": "string" }, "description": "Only subjects of this object type. Absent means every object type in the catalog." },
101
+ { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } },
102
+ { "name": "cursor", "in": "query", "schema": { "type": "string" } },
103
+ { "name": "continue", "in": "query", "schema": { "type": "boolean" }, "description": "Keep the saved subjects and read collections again, including ones kept as empty." }
104
+ ],
105
+ "responses": {
106
+ "200": { "description": "Kept subjects. saved is true once a pass has finished. checking is true while a pass is still reading." },
107
+ "404": { "description": "Unknown object type" }
108
+ }
109
+ },
110
+ "delete": {
111
+ "operationId": "deleteProcessedSubjects",
112
+ "summary": "Drop the kept processed-subject answer for this org and these agent ids",
113
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
114
+ "responses": { "200": { "description": "The kept answer is gone. The next GET reads again." } }
115
+ }
116
+ },
117
+ "/api/v1/refs/resolve": {
118
+ "post": {
119
+ "operationId": "resolveRefs",
120
+ "summary": "Resolve ref strings from the shapes declared on catalog fields",
121
+ "description": "Body is { values: string[] }, at most 200. Each string is classified by the first shape grammar that matches the whole value. value loads that reserved record. paired-<sourceProperty> attaches to the sibling subject that publishes matchProperty, or looks up data.<matchProperty>. A template attaches to a subject in the batch that publishes sourceProperty, its plural Ids field, or displayName, title, or name. The template record is loaded when that object type is in the catalog. A lookup runs only when the batch resolved no record-id subjects, on the object types named by sibling value shapes, or across the catalog when the template shape has none. Strings that do not resolve are returned in unresolved. getRecord of a non-reserved id stays 404.",
122
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
123
+ "requestBody": {
124
+ "required": true,
125
+ "content": {
126
+ "application/json": {
127
+ "schema": {
128
+ "type": "object",
129
+ "required": ["values"],
130
+ "properties": {
131
+ "values": { "type": "array", "maxItems": 200, "items": { "type": "string" } }
132
+ }
133
+ }
134
+ }
135
+ }
136
+ },
137
+ "responses": {
138
+ "200": { "description": "subjects in first-seen order, plus unresolved strings in input order" },
139
+ "400": { "description": "values is not an array of strings, or it exceeds 200" }
140
+ }
141
+ }
142
+ },
143
+ "/api/v1/records/{recordId}/content-types": {
144
+ "get": {
145
+ "operationId": "recordContentTypes",
146
+ "summary": "Content types stored on one record, joined with descriptors",
147
+ "parameters": [
148
+ { "$ref": "#/components/parameters/ScopeHeaders" },
149
+ { "name": "recordId", "in": "path", "required": true, "schema": { "type": "string" } }
150
+ ],
151
+ "responses": { "200": { "description": "Stored content types" }, "404": { "description": "Subject is not reserved" } }
152
+ }
153
+ },
154
+ "/api/v1/memorix/{path}": {
155
+ "get": {
156
+ "operationId": "memorixGet",
157
+ "summary": "Forward a Memorix GET under /api",
158
+ "description": "path is the remainder of the Memorix path, including extra segments (data/content, memory/sources, pipelines/runs/{runId}, analytics/indexes, metadata/effective, connectors, jobs/v1/work, hooks/v1/subscriptions, data-journey/journeys, relationships/query). Query strings are forwarded. Relationship links and restricted-store break-glass content are refused. data/content: when the content type has a discriminator in the catalog, recordId plus discriminatorValue (or a filter eq clause on the discriminator path) returns that instance in the single-record shape, read from a recordId list on that content type; no match is 404 READ_NOT_FOUND naming the stored values. Without recordId, discriminatorValue is added to filter as an eq clause. recordId plus an eq filter on data.template returns the newest revision of that template, including when the content type has no discriminator. count=true is forwarded unchanged. metadata/effective and metadata/raw are forwarded unchanged, including objectTypes[].functions.",
159
+ "parameters": [
160
+ { "$ref": "#/components/parameters/ScopeHeaders" },
161
+ { "name": "path", "in": "path", "required": true, "schema": { "type": "string" } }
162
+ ],
163
+ "responses": {
164
+ "200": { "description": "Memorix response" },
165
+ "403": { "description": "Path is not a fetch route" }
166
+ }
167
+ }
168
+ },
169
+ "/api/v1/data/story": {
170
+ "get": {
171
+ "operationId": "readStory",
172
+ "summary": "AI-first story for one subject and template",
173
+ "description": "variant defaults to auto. auto serves a usable story-ai row, otherwise the code story. ai and code read only that content type. A usable AI row is active, has data.input, and _metadata.aiExecution.status outside CODE_ONLY, SKIPPED, FAILED, and DEFERRED. 200 matches a content read (scope, addressing, record, currentRevision) and adds story (template, served ai|code, fallbackReason AI_MISSING|AI_UNUSABLE when auto served code, ai, code). ai.stale is true when ai.basedOnRevision is behind code.revision; a stale AI row is still served. ai or code is null when that content type is not declared. 404 STORY_NOT_FOUND includes the same story block. An unknown object type or a template that is not on story presentation.values is answered as GET data/content.",
174
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
175
+ "responses": {
176
+ "200": { "description": "Served story" },
177
+ "404": { "description": "STORY_NOT_FOUND, or the content read for an undeclared template" }
178
+ }
179
+ }
180
+ },
181
+ "/api/v1/data/stories": {
182
+ "get": {
183
+ "operationId": "readStories",
184
+ "summary": "One AI-first story per template",
185
+ "description": "One readStory result per value in story presentation.values, in that order. Each item is template, label, story, and record or null.",
186
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
187
+ "responses": { "200": { "description": "Stories for the subject" } }
188
+ }
189
+ },
190
+ "/api/v1/data/compose": {
191
+ "post": {
192
+ "operationId": "compose",
193
+ "summary": "Read compose of one subject",
194
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
195
+ "responses": { "200": { "description": "Composition" } }
196
+ }
197
+ },
198
+ "/api/v1/data/compose/data": {
199
+ "post": {
200
+ "operationId": "composeData",
201
+ "summary": "Read compose projected to content-type .data",
202
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
203
+ "responses": { "200": { "description": "Data projection" } }
204
+ }
205
+ },
206
+ "/api/v1/data/compose/data/list": {
207
+ "post": {
208
+ "operationId": "composeDataList",
209
+ "summary": "Read a page of subjects as content-type .data",
210
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
211
+ "responses": { "200": { "description": "Page" } }
212
+ }
213
+ },
214
+ "/api/v1/data/lists": {
215
+ "post": {
216
+ "operationId": "runList",
217
+ "summary": "Run a declared list or an abstract property page",
218
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
219
+ "responses": { "200": { "description": "List page" } }
220
+ }
221
+ },
222
+ "/api/v1/data/items": {
223
+ "post": {
224
+ "operationId": "getItem",
225
+ "summary": "Read one item view",
226
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
227
+ "responses": { "200": { "description": "Item" } }
228
+ }
229
+ },
230
+ "/api/v1/nexum/status": {
231
+ "get": {
232
+ "operationId": "nexumStatus",
233
+ "summary": "Nexum canvas health and the gateway MCP URL",
234
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
235
+ "responses": { "200": { "description": "Canvas status. mcpUrl points at this API." } }
236
+ }
237
+ },
238
+ "/api/v1/nexum/snapshots": {
239
+ "get": {
240
+ "operationId": "nexumListSnapshots",
241
+ "summary": "List content/snapshots subjects",
242
+ "description": "Same read as nexum_list_snapshots. knowledgeGraphOnly keeps data.kind=knowledge-graph. limit is 1–200, default 50.",
243
+ "parameters": [
244
+ { "$ref": "#/components/parameters/ScopeHeaders" },
245
+ { "name": "limit", "in": "query", "schema": { "type": "integer" } },
246
+ { "name": "cursor", "in": "query", "schema": { "type": "string" } },
247
+ { "name": "knowledgeGraphOnly", "in": "query", "schema": { "type": "boolean" } }
248
+ ],
249
+ "responses": { "200": { "description": "Snapshot page" } }
250
+ }
251
+ },
252
+ "/api/v1/nexum/snapshots/{recordId}": {
253
+ "get": {
254
+ "operationId": "nexumGetSnapshot",
255
+ "summary": "One content/snapshots subject",
256
+ "description": "recordId may contain slashes as extra path segments. A suffix /connected is nexumGetConnectedContent.",
257
+ "parameters": [
258
+ { "$ref": "#/components/parameters/ScopeHeaders" },
259
+ { "name": "recordId", "in": "path", "required": true, "schema": { "type": "string" } }
260
+ ],
261
+ "responses": { "200": { "description": "Snapshot" }, "404": { "description": "Snapshot is not stored" } }
262
+ }
263
+ },
264
+ "/api/v1/nexum/entities": {
265
+ "get": {
266
+ "operationId": "nexumListEntities",
267
+ "summary": "List or search Nexum canvas entities",
268
+ "parameters": [
269
+ { "$ref": "#/components/parameters/ScopeHeaders" },
270
+ { "name": "graphId", "in": "query", "schema": { "type": "string" } },
271
+ { "name": "q", "in": "query", "schema": { "type": "string" } },
272
+ { "name": "limit", "in": "query", "schema": { "type": "string" } }
273
+ ],
274
+ "responses": {
275
+ "200": { "description": "Canvas entities" },
276
+ "502": { "description": "NEXUM_UPSTREAM_UNREACHABLE: the Memorix host cannot reach Nexum explore REST" }
277
+ }
278
+ }
279
+ },
280
+ "/api/v1/nexum/entities/{entityId}": {
281
+ "get": {
282
+ "operationId": "nexumGetEntity",
283
+ "summary": "One Nexum canvas entity",
284
+ "parameters": [
285
+ { "$ref": "#/components/parameters/ScopeHeaders" },
286
+ { "name": "entityId", "in": "path", "required": true, "schema": { "type": "string" } },
287
+ { "name": "graphId", "in": "query", "schema": { "type": "string" } }
288
+ ],
289
+ "responses": {
290
+ "200": { "description": "Canvas entity" },
291
+ "502": { "description": "NEXUM_UPSTREAM_UNREACHABLE: the Memorix host cannot reach Nexum explore REST" }
292
+ }
293
+ }
294
+ },
295
+ "/api/v1/nexum/query": {
296
+ "post": {
297
+ "operationId": "nexumQuery",
298
+ "summary": "Neighbor query on the Nexum canvas",
299
+ "description": "Body is { nodeId, graphId?, depth? } or { seeds, depth? }. Same read as nexum_query.",
300
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
301
+ "responses": {
302
+ "200": { "description": "Neighbors" },
303
+ "502": { "description": "NEXUM_UPSTREAM_UNREACHABLE: the Memorix host cannot reach Nexum explore REST" }
304
+ }
305
+ }
306
+ },
307
+ "/api/v1/mcp": {
308
+ "get": {
309
+ "operationId": "listMcp",
310
+ "summary": "MCP servers this API can call",
311
+ "description": "memorix-nexum and memorix-scoper are always listed. memorix-mgc is listed when its URL is configured or discovered from Memorix connectors.",
312
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
313
+ "responses": { "200": { "description": "MCP servers" } }
314
+ }
315
+ },
316
+ "/api/v1/mcp/nexum": {
317
+ "get": {
318
+ "operationId": "nexumMcpAdvertise",
319
+ "summary": "Advertise memorix-nexum",
320
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
321
+ "responses": { "200": { "description": "Advertise document. mcpUrl is this API." } }
322
+ },
323
+ "post": {
324
+ "operationId": "nexumMcpCall",
325
+ "summary": "JSON-RPC for memorix-nexum",
326
+ "description": "Methods: initialize, ping, tools/list, tools/call, notifications. Tools: nexum_list_snapshots, nexum_get_snapshot, nexum_get_connected_content, nexum_knowledge_status, nexum_list_entities, nexum_get_entity, nexum_query.",
327
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
328
+ "responses": { "200": { "description": "JSON-RPC result" } }
329
+ }
330
+ },
331
+ "/api/v1/skills": {
332
+ "get": {
333
+ "operationId": "skillsInfo",
334
+ "summary": "Which process answers agent functions",
335
+ "description": "mode is embedded or external. source is this process or skill-api. baseUrl is present only when mode is external. The choice is fixed for the process lifetime.",
336
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
337
+ "responses": { "200": { "description": "Skills backend" } }
338
+ }
339
+ },
340
+ "/api/v1/agent-functions/agents/{agentId}/functions": {
341
+ "get": {
342
+ "operationId": "listAgentFunctions",
343
+ "summary": "List functions for one agent",
344
+ "description": "agentId must be one of x-memorix-agent-ids. Each item has origin agent or database. Embedded mode reads the pack catalog. External mode proxies skill-api.",
345
+ "parameters": [
346
+ { "$ref": "#/components/parameters/ScopeHeaders" },
347
+ { "name": "agentId", "in": "path", "required": true, "schema": { "type": "string" } }
348
+ ],
349
+ "responses": { "200": { "description": "Function catalog" }, "403": { "description": "FORBIDDEN" } }
350
+ }
351
+ },
352
+ "/api/v1/agent-functions/agents/{agentId}/functions/{functionId}/run": {
353
+ "post": {
354
+ "operationId": "runAgentFunction",
355
+ "summary": "Run one function for a stored subject",
356
+ "description": "Body is objectType and recordId. Subject rows are read through @x12i/memorix-client when this process hosts the function. A storyInput result is written as content type story.",
357
+ "parameters": [
358
+ { "$ref": "#/components/parameters/ScopeHeaders" },
359
+ { "name": "agentId", "in": "path", "required": true, "schema": { "type": "string" } },
360
+ { "name": "functionId", "in": "path", "required": true, "schema": { "type": "string" } }
361
+ ],
362
+ "responses": {
363
+ "200": { "description": "FunctionResult with structured and text" },
364
+ "404": { "description": "NOT_FOUND" },
365
+ "502": { "description": "MEMORIX_UNREACHABLE or MEMORIX_READ_FAILED" }
366
+ }
367
+ }
368
+ },
369
+ "/api/v1/agent-functions/agents/{agentId}/functions/{functionId}": {
370
+ "put": {
371
+ "operationId": "saveAgentFunction",
372
+ "summary": "Save a Python function override",
373
+ "description": "Body is source, and optional question, page, and objectTypes. source must define generate_text. Without ASSISTANT_MONGO_URI or MONGO_URI the embedded host returns 503 PERSISTENCE.",
374
+ "parameters": [
375
+ { "$ref": "#/components/parameters/ScopeHeaders" },
376
+ { "name": "agentId", "in": "path", "required": true, "schema": { "type": "string" } },
377
+ { "name": "functionId", "in": "path", "required": true, "schema": { "type": "string" } }
378
+ ],
379
+ "responses": { "200": { "description": "Saved override" }, "503": { "description": "PERSISTENCE" } }
380
+ },
381
+ "delete": {
382
+ "operationId": "removeAgentFunction",
383
+ "summary": "Delete a saved function override",
384
+ "parameters": [
385
+ { "$ref": "#/components/parameters/ScopeHeaders" },
386
+ { "name": "agentId", "in": "path", "required": true, "schema": { "type": "string" } },
387
+ { "name": "functionId", "in": "path", "required": true, "schema": { "type": "string" } }
388
+ ],
389
+ "responses": { "200": { "description": "origin agent or removed" }, "503": { "description": "PERSISTENCE" } }
390
+ }
391
+ },
392
+ "/api/v1/scoper": {
393
+ "get": {
394
+ "operationId": "scoperInfo",
395
+ "summary": "Hosted Scoper release",
396
+ "description": "Reports @x12i/memorix-scoper 2.3.0, the SDK 2.1.2, whether saved functions are attached, mode embedded or external, and the aligned memorix-service 3.17.0, memorix-skills 0.6.0, memorix-client 3.16.3, and ai-dispatcher 2.4.1. Subject reads use @x12i/memorix-client.",
397
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
398
+ "responses": { "200": { "description": "Scoper host" } }
399
+ }
400
+ },
401
+ "/api/v1/scoper/scope": {
402
+ "post": {
403
+ "operationId": "scoperScope",
404
+ "summary": "Run a scope",
405
+ "description": "Body is a ScopeRequest: profileId, question, and optional focus, budgets, options, hints. Org, agents, and caller come from the call headers. The same fields in the body are ignored. Saved query and scope functions run when SCOPER_FUNCTIONS_DIR is set; otherwise the reasoner answers.",
406
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
407
+ "responses": {
408
+ "200": { "description": "Evidence bundle" },
409
+ "400": { "description": "INVALID_REQUEST" }
410
+ }
411
+ }
412
+ },
413
+ "/api/v1/scoper/subject-data": {
414
+ "post": {
415
+ "operationId": "scoperSubjectData",
416
+ "summary": "Read one subject's content through Scoper",
417
+ "description": "Body is recordId, objectType, and contentType. Optional alsoContentTypes, sourceContentTypes, include, properties, exclude, and useMarkdown. Scope headers select the org and agents.",
418
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
419
+ "responses": {
420
+ "200": { "description": "Subject data" },
421
+ "400": { "description": "INVALID_REQUEST" },
422
+ "404": { "description": "READ_NOT_FOUND" }
423
+ }
424
+ }
425
+ },
426
+ "/api/v1/mcp/scoper": {
427
+ "get": {
428
+ "operationId": "scoperMcpAdvertise",
429
+ "summary": "Advertise memorix-scoper",
430
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
431
+ "responses": { "200": { "description": "Advertise document. mcpUrl is this API." } }
432
+ },
433
+ "post": {
434
+ "operationId": "scoperMcpCall",
435
+ "summary": "JSON-RPC for memorix-scoper",
436
+ "description": "Methods: initialize, ping, tools/list, tools/call, notifications. Tools: catalog, subjects_list, subjects_query, subject_data, scope.",
437
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
438
+ "responses": { "200": { "description": "JSON-RPC result" } }
439
+ }
440
+ },
441
+ "/api/v1/mcp/mgc": {
442
+ "get": {
443
+ "operationId": "mgcMcpAdvertise",
444
+ "summary": "Advertise memorix-mgc",
445
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
446
+ "responses": { "200": { "description": "MGC advertise" }, "404": { "description": "MGC URL is not configured" } }
447
+ },
448
+ "post": {
449
+ "operationId": "mgcMcpCall",
450
+ "summary": "JSON-RPC for the MGC connector MCP",
451
+ "description": "Forwards to the MGC source host /mcp. Stable fetch tools include mgc_list_connectors, mgc_describe_connector, and mgc_fetch.",
452
+ "parameters": [{ "$ref": "#/components/parameters/ScopeHeaders" }],
453
+ "responses": { "200": { "description": "JSON-RPC result" }, "404": { "description": "MGC URL is not configured" } }
454
+ }
455
+ }
456
+ },
457
+ "components": {
458
+ "parameters": {
459
+ "ScopeHeaders": {
460
+ "name": "scope",
461
+ "in": "header",
462
+ "required": true,
463
+ "description": "Send x-memorix-org-id, x-memorix-agent-ids (comma-separated), and x-memorix-caller on every /api/v1 call.",
464
+ "schema": { "type": "string" }
465
+ },
466
+ "ObjectType": {
467
+ "name": "objectType",
468
+ "in": "path",
469
+ "required": true,
470
+ "schema": { "type": "string" }
471
+ },
472
+ "ContentType": {
473
+ "name": "contentType",
474
+ "in": "path",
475
+ "required": true,
476
+ "schema": { "type": "string" }
477
+ }
478
+ }
479
+ }
480
+ }
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
- {
2
- "name": "@x12i/memorix-client-api",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@x12i/memorix-client-api",
3
+ "version": "0.16.0",
4
+ "description": "Smart-client read API over Memorix, including agent functions, Nexum, Scoper, and MCP. See HANDOVER.md.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "openapi",
17
+ "HANDOVER.md"
18
+ ],
19
+ "scripts": {
20
+ "prebuild": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
21
+ "build": "tsc -p tsconfig.build.json",
22
+ "dev": "tsx src/cli.ts",
23
+ "start": "node dist/cli.js",
24
+ "test": "vitest run",
25
+ "typecheck": "tsc --noEmit"
26
+ },
27
+ "engines": {
28
+ "node": ">=20"
29
+ },
30
+ "dependencies": {
31
+ "@x12i/ai-dispatcher": "^2.4.1",
32
+ "@x12i/api-live-view": "^1.4.0",
33
+ "@x12i/authix-sdk": "1.0.1",
34
+ "@x12i/core-service": "^1.0.1",
35
+ "@x12i/memorix-agent-assistants": "0.2.0",
36
+ "@x12i/memorix-client": "^3.16.3",
37
+ "@x12i/memorix-scoper": "^2.3.0",
38
+ "@x12i/memorix-scoper-functions": "^0.2.0",
39
+ "@x12i/memorix-scoper-pagx": "^1.1.0",
40
+ "@x12i/memorix-scoper-sdk": "^2.1.2",
41
+ "fastify": "^5.1.0",
42
+ "mongodb": "^7.7.0"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "^20.14.0",
46
+ "tsx": "^4.19.0",
47
+ "typescript": "^5.6.0",
48
+ "vitest": "^2.1.0"
49
+ },
50
+ "license": "exellix-license",
51
+ "publishConfig": {
52
+ "access": "public",
53
+ "registry": "https://registry.npmjs.org/"
54
+ },
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+ssh://git@github.com/x12i/memorix-client-api.git",
58
+ "directory": "memorix-client-api"
59
+ }
60
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.