@crewx/memory 0.1.23-rc.257 → 0.1.23-rc.259
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/src/native-adapter.d.ts +1 -1
- package/dist/src/native-adapter.js +1 -1
- package/go/bin/crewx-memory-darwin-amd64 +0 -0
- package/go/bin/crewx-memory-darwin-arm64 +0 -0
- package/go/bin/crewx-memory-linux-amd64 +0 -0
- package/go/bin/crewx-memory-linux-arm64 +0 -0
- package/go/bin/crewx-memory-windows-amd64.exe +0 -0
- package/go/native-manifest.json +7 -7
- package/package.json +9 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var w=exports&&exports.__createBinding||(Object.create?(function(e,r,i,t){if(t===void 0)t=i;var n=Object.getOwnPropertyDescriptor(r,i);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[i]}}}Object.defineProperty(e,t,n)}):(function(e,r,i,t){if(t===void 0)t=i;e[t]=r[i]}));var
|
|
1
|
+
"use strict";var w=exports&&exports.__createBinding||(Object.create?(function(e,r,i,t){if(t===void 0)t=i;var n=Object.getOwnPropertyDescriptor(r,i);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[i]}}}Object.defineProperty(e,t,n)}):(function(e,r,i,t){if(t===void 0)t=i;e[t]=r[i]}));var b=exports&&exports.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}):function(e,r){e["default"]=r});var y=exports&&exports.__importStar||(function(){var e=function(r){e=Object.getOwnPropertyNames||function(i){var t=[];for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n))t[t.length]=n;return t};return e(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null){for(var t=e(r),n=0;n<t.length;n++)if(t[n]!=="default")w(i,r,t[n])}b(i,r);return i}})();Object.defineProperty(exports,"__esModule",{value:true});exports.NATIVE_API_CAPABILITY=void 0;exports.getNativeMemoryArtifact=v;exports.nativeRuntimeMode=_;exports.isNativeAdapterAvailable=R;exports.callNativeRpc=u;exports.writeNativeOutput=B;exports.hostFor=m;exports.nativeLoadAllEntries=M;exports.nativeGetRecentEntries=j;exports.nativeRunCommand=C;exports.nativeRunHostCommand=T;exports.nativeGenerateSummary=$;const o=y(require("fs"));const s=y(require("path"));const g=require("child_process");const A=require("./native-host");exports.NATIVE_API_CAPABILITY="memory.api.v1";const N=5;const E=512*1024*1024;let l;function I(){const e=[];if(process.env.CREWX_SHELL_NATIVE_DIR){e.push(s.join(process.env.CREWX_SHELL_NATIVE_DIR,"@crewx","memory"))}const r=process.resourcesPath;if(typeof r==="string"){e.push(s.join(r,"shell-native","node_modules","@crewx","memory"))}let i=__dirname;for(let t=0;t<4;t++){e.push(i);const n=s.dirname(i);if(n===i)break;i=n}return e}function O(e){try{return JSON.parse(o.readFileSync(s.join(e,"package.json"),"utf8"))}catch{return null}}function P(e){const r=O(e);if(!r||r.name!=="@crewx/memory")return null;const i=s.join(e,"go","native-manifest.json");if(!o.existsSync(i))return null;const t=JSON.parse(o.readFileSync(i,"utf8"));if(typeof t.nativeBuildId!=="string"||!/^[0-9a-f]{64}$/u.test(t.nativeBuildId))return null;const n=Number(t.protocol);if(n!==N)return null;if(!Array.isArray(t.capabilities)||!t.capabilities.includes(exports.NATIVE_API_CAPABILITY))return null;const a={darwin:"darwin",linux:"linux",win32:"windows"}[process.platform];const p={arm64:"arm64",x64:"amd64"}[process.arch];if(!a||!p)return null;const c=t.targets?.[`${a}-${p}`];if(!c||typeof c.file!=="string")return null;const f=s.resolve(e,...c.file.split("/"));if(!o.existsSync(f))return null;if(process.platform!=="win32"){try{const d=o.statSync(f);if((d.mode&73)===0)o.chmodSync(f,d.mode|493)}catch{}}const h=Array.isArray(c.capabilities)?c.capabilities.filter(d=>typeof d==="string"):t.capabilities;return{executablePath:f,packageRoot:e,nativeBuildId:t.nativeBuildId,protocol:n,capabilities:h}}function v(){if(l!==void 0)return l;l=null;for(const e of I()){try{const r=P(e);if(r){l=r;break}}catch{}}return l}function _(){const e=process.env.CREWX_MEMORY_RUNTIME??"auto";return e==="go"||e==="node"?e:"auto"}function R(){if(_()==="node")return false;return v()!==null}function S(){const e=v();if(!e){throw new Error("Native memory executable is unavailable. Reinstall @crewx/memory, or set CREWX_MEMORY_RUNTIME=node to use the existing implementation.")}return e}function u(e,r={}){const i=S();const t=(0,g.spawnSync)(i.executablePath,[`--crewx-memory-protocol=${i.protocol}`,`--crewx-memory-build=${i.nativeBuildId}`,"api","rpc"],{input:JSON.stringify({version:1,...e}),encoding:"utf8",env:r.env??process.env,maxBuffer:E,windowsHide:true});if(t.error)throw t.error;const n=(t.stderr??"").trim();let a;try{a=JSON.parse(t.stdout??"")}catch{if(t.status===null){throw new Error(`Native memory was terminated${t.signal?` (${t.signal})`:""}.`)}throw new Error(`Native memory returned an invalid response (exit ${t.status})${n?`: ${n}`:""}`)}if(t.status!==0||!a.ok){throw new Error(a.error??(n||`Native memory failed (exit ${t.status})`))}return a}function B(e){if(e.stdout)process.stdout.write(e.stdout);if(e.stderr)process.stderr.write(e.stderr)}function m(e){return(0,A.prepareNativeHost)(e)}function M(e,r,i=false){const t=u({op:"entries",dataDir:e,args:[r],includeBody:i});return t.result??[]}function j(e,r,i=30,t={}){const n=u({op:"recent",dataDir:e,args:[r],days:i,includeBody:Boolean(t.includeBody)});return n.result??[]}function C(e,r,i,t={},n={}){return u({op:"command",dataDir:e,command:r,args:i,flags:t,...n.body===void 0?{}:{body:n.body},...n.rawSave?{rawSave:true}:{}})}function T(e,r,i,t={}){const n=m(e);return u({op:"command",dataDir:e.dataDir,command:r,args:i,flags:t,host:n.request},{env:n.env})}function $(e,r,i){const t=m(e);const n=u({op:"summary",dataDir:e.dataDir,args:[r],flags:{force:i},host:t.request},{env:t.env});if(n.stderr)process.stderr.write(n.stderr);return n.result}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/go/native-manifest.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"formatVersion": 1,
|
|
3
|
-
"protocol":
|
|
3
|
+
"protocol": 5,
|
|
4
|
+
"nativeBuildId": "2a332e15b5379bad6d2b5482b0f9c092236c1b43c14b9aea121dba794b8832bd",
|
|
4
5
|
"capabilities": [
|
|
5
6
|
"memory.read.basic.v1",
|
|
6
7
|
"memory.read.ordinary.v1",
|
|
@@ -8,11 +9,10 @@
|
|
|
8
9
|
"memory.api.v1",
|
|
9
10
|
"memory.summary.v1"
|
|
10
11
|
],
|
|
11
|
-
"packageVersion": "0.1.23-rc.257",
|
|
12
12
|
"targets": {
|
|
13
13
|
"darwin-arm64": {
|
|
14
14
|
"file": "go/bin/crewx-memory-darwin-arm64",
|
|
15
|
-
"sha256": "
|
|
15
|
+
"sha256": "86c557bf6660a295b22cf5292f97e48b0802f1cd322a2cb59e9ecd82f2681fdf",
|
|
16
16
|
"capabilities": [
|
|
17
17
|
"memory.read.basic.v1",
|
|
18
18
|
"memory.read.ordinary.v1",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"darwin-amd64": {
|
|
26
26
|
"file": "go/bin/crewx-memory-darwin-amd64",
|
|
27
|
-
"sha256": "
|
|
27
|
+
"sha256": "f9f8ceec93d0cd923be63cb68425c0b3db8721e0672c9f59329e8a8ba0b7894e",
|
|
28
28
|
"capabilities": [
|
|
29
29
|
"memory.read.basic.v1",
|
|
30
30
|
"memory.read.ordinary.v1",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"linux-amd64": {
|
|
38
38
|
"file": "go/bin/crewx-memory-linux-amd64",
|
|
39
|
-
"sha256": "
|
|
39
|
+
"sha256": "25abea426cd108558bc9a939918a225ab567972b1158cf6453c094f23d6ac5f5",
|
|
40
40
|
"capabilities": [
|
|
41
41
|
"memory.read.basic.v1",
|
|
42
42
|
"memory.read.ordinary.v1",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"linux-arm64": {
|
|
50
50
|
"file": "go/bin/crewx-memory-linux-arm64",
|
|
51
|
-
"sha256": "
|
|
51
|
+
"sha256": "5f56a2a2963d6107edcfdcf27f67c4d4c5445c1a0325c80fa42d2411295f27db",
|
|
52
52
|
"capabilities": [
|
|
53
53
|
"memory.read.basic.v1",
|
|
54
54
|
"memory.read.ordinary.v1",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"windows-amd64": {
|
|
62
62
|
"file": "go/bin/crewx-memory-windows-amd64.exe",
|
|
63
|
-
"sha256": "
|
|
63
|
+
"sha256": "4a5ca65d798250dc39bdf21de4ccad05bec329ce1686ac851a98c2b6e32a2f4a",
|
|
64
64
|
"capabilities": [
|
|
65
65
|
"memory.read.basic.v1",
|
|
66
66
|
"memory.read.ordinary.v1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewx/memory",
|
|
3
|
-
"version": "0.1.23-rc.
|
|
3
|
+
"version": "0.1.23-rc.259",
|
|
4
4
|
"description": "Memory engine for CrewX - markdown + frontmatter based long-term memory",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/src/engine.js",
|
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"bin": {
|
|
22
|
-
"memory": "./dist/cli.js"
|
|
22
|
+
"memory": "./dist/cli.js",
|
|
23
|
+
"crewx-memory-darwin-arm64": "./go/bin/crewx-memory-darwin-arm64",
|
|
24
|
+
"crewx-memory-darwin-amd64": "./go/bin/crewx-memory-darwin-amd64",
|
|
25
|
+
"crewx-memory-linux-arm64": "./go/bin/crewx-memory-linux-arm64",
|
|
26
|
+
"crewx-memory-linux-amd64": "./go/bin/crewx-memory-linux-amd64"
|
|
23
27
|
},
|
|
24
28
|
"files": [
|
|
25
29
|
"dist",
|
|
@@ -38,9 +42,9 @@
|
|
|
38
42
|
"gray-matter": "^4.0.3",
|
|
39
43
|
"js-yaml": "^4.1.0",
|
|
40
44
|
"nanoid": "^3.3.11",
|
|
41
|
-
"@crewx/sdk": "0.9.0-rc.
|
|
42
|
-
"@crewx/shared": "0.0.6-rc.
|
|
43
|
-
"@crewx/knowledge-core": "0.1.17-rc.
|
|
45
|
+
"@crewx/sdk": "0.9.0-rc.241",
|
|
46
|
+
"@crewx/shared": "0.0.6-rc.156",
|
|
47
|
+
"@crewx/knowledge-core": "0.1.17-rc.252"
|
|
44
48
|
},
|
|
45
49
|
"devDependencies": {
|
|
46
50
|
"@types/js-yaml": "^4.0.9",
|