Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@
"build": "tsc && node scripts/sync-dist-manifest.mjs",
"test": "npm run build && node dist/__tests__/memory-context-format.test.js && node dist/__tests__/company-brain-tools.test.js && node dist/__tests__/company-brain-context-format.test.js && node dist/__tests__/core-entity-graph-tools.test.js && node dist/__tests__/plugin-manifest-parity.test.js && node dist/__tests__/owner-context.test.js",
"company-brain:canary": "node scripts/company-brain-canary.mjs",
"deploy:local": "bash scripts/deploy-local-extension.sh",
"runtime:smoke": "node scripts/cortex-runtime-smoke.mjs",
"prepublishOnly": "npm run build"
},
"files": [
"dist/",
"openclaw.plugin.json"
],
"openclaw": {
"extensions": [
"./dist/index.js"
]
},
"dependencies": {
"@sinclair/typebox": "^0.32.0"
},
Expand Down
37 changes: 37 additions & 0 deletions scripts/deploy-local-extension.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
TARGET_DIR="${OPENCLAW_CORTEX_EXTENSION_DIR:-$HOME/.openclaw/extensions/cortex}"

cd "$ROOT_DIR"
npm run build

mkdir -p "$TARGET_DIR"
rsync -a --delete dist/ "$TARGET_DIR/dist/"
cp openclaw.plugin.json package.json package-lock.json README.md "$TARGET_DIR/"

SOURCE_COMMIT="$(git rev-parse HEAD 2>/dev/null || echo unknown)"
DEPLOYED_AT="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
DIST_HASH="$(shasum -a 256 dist/index.js | awk '{print $1}')"
MANIFEST_HASH="$(shasum -a 256 openclaw.plugin.json | awk '{print $1}')"
PACKAGE_HASH="$(shasum -a 256 package.json | awk '{print $1}')"
PACKAGE_LOCK_HASH="$(shasum -a 256 package-lock.json | awk '{print $1}')"

cat > "$TARGET_DIR/.deploy-manifest.json" <<JSON
{
"deployed_at": "$DEPLOYED_AT",
"source_repo": "$ROOT_DIR",
"source_commit": "$SOURCE_COMMIT",
"target": "$TARGET_DIR",
"files": {
"dist/index.js": "$DIST_HASH",
"openclaw.plugin.json": "$MANIFEST_HASH",
"package.json": "$PACKAGE_HASH",
"package-lock.json": "$PACKAGE_LOCK_HASH"
}
}
JSON

echo "Deployed Cortex plugin to $TARGET_DIR"
cat "$TARGET_DIR/.deploy-manifest.json"
Loading