unoverse 0.1.141 → 0.1.143
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/lib/create/download.mjs +7 -2
- package/lib/create/index.mjs +16 -5
- package/operator/.env.example +6 -0
- package/operator/lib/db-verify.sh +12 -1
- package/operator/lib/deploy.sh +43 -0
- package/package.json +1 -1
package/lib/create/download.mjs
CHANGED
|
@@ -7,11 +7,16 @@ import { spawnSync } from "node:child_process";
|
|
|
7
7
|
export const STARTER_TARBALL =
|
|
8
8
|
"https://codeload.github.com/unoverse-platform/starter/tar.gz/refs/heads/main";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// The CLIENT STARTER has its own public repo. It used to be a folder inside the starter,
|
|
11
|
+
// which meant handing someone the whole operator kit to give them one web page.
|
|
12
|
+
export const CLIENT_TARBALL =
|
|
13
|
+
"https://codeload.github.com/unoverse-platform/client/tar.gz/refs/heads/main";
|
|
14
|
+
|
|
15
|
+
export function download(dir, stripComponents = 1, filter = "", tarball = STARTER_TARBALL) {
|
|
11
16
|
mkdirSync(dir, { recursive: true });
|
|
12
17
|
const r = spawnSync(
|
|
13
18
|
"sh",
|
|
14
|
-
["-c", `curl -fsSL '${
|
|
19
|
+
["-c", `curl -fsSL '${tarball}' | tar -xz --strip-components=${stripComponents} -C '${dir}' ${filter}`],
|
|
15
20
|
{ stdio: ["ignore", "inherit", "inherit"] },
|
|
16
21
|
);
|
|
17
22
|
if (r.status !== 0) throw new Error("download failed");
|
package/lib/create/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { spawnSync } from "node:child_process";
|
|
|
15
15
|
import { cyan, dim, ok, fail, ask, select } from "../ui.mjs";
|
|
16
16
|
import { parseCredential, validateRegistryToken, dockerUp, dockerLogin } from "./credential.mjs";
|
|
17
17
|
import { resolveTarget, label } from "./target.mjs";
|
|
18
|
-
import { download } from "./download.mjs";
|
|
18
|
+
import { download, CLIENT_TARBALL } from "./download.mjs";
|
|
19
19
|
|
|
20
20
|
export async function create(nameArg) {
|
|
21
21
|
console.log(`\n ${cyan("⬡ What are you building?")}\n`);
|
|
@@ -137,10 +137,21 @@ export async function create(nameArg) {
|
|
|
137
137
|
|
|
138
138
|
if (choice === "3") {
|
|
139
139
|
const name = resolveTarget(nameArg);
|
|
140
|
-
//
|
|
141
|
-
download(name,
|
|
142
|
-
ok(`client
|
|
143
|
-
console.log(
|
|
140
|
+
// Its own public repo, so the whole tree IS the project: one strip level, no filter.
|
|
141
|
+
download(name, 1, "", CLIENT_TARBALL);
|
|
142
|
+
ok(`client scaffolded in ${label(name)}`);
|
|
143
|
+
console.log(`
|
|
144
|
+
Next:${name === "." ? "" : `
|
|
145
|
+
cd ${name}`}
|
|
146
|
+
npm install
|
|
147
|
+
cp .env.example .env ${dim("# your universe, and which app to load")}
|
|
148
|
+
npm run dev
|
|
149
|
+
|
|
150
|
+
The README documents every option: the script tag's attributes, how to hand it
|
|
151
|
+
your login, and how to open it from your own buttons.
|
|
152
|
+
|
|
153
|
+
${cyan("Docs:")} https://docs.unoverse.ai
|
|
154
|
+
`);
|
|
144
155
|
return;
|
|
145
156
|
}
|
|
146
157
|
|
package/operator/.env.example
CHANGED
|
@@ -67,3 +67,9 @@ AUTH_AUDIENCE=gravity-api
|
|
|
67
67
|
|
|
68
68
|
# Quick no-login mode (local only — production refuses to start with it):
|
|
69
69
|
# AUTH_ENABLED=false
|
|
70
|
+
|
|
71
|
+
# Node memoization (docs/unoverseCopilot/EXECUTION_EFFICIENCY.md §3). OFF by default.
|
|
72
|
+
# Cacheable nodes (capabilities.cacheable in the node YAML) reuse a prior run's output when
|
|
73
|
+
# the fingerprint matches — saves re-running expensive parses/scrapes across test cycles.
|
|
74
|
+
# WORKFLOW_NODE_MEMOIZATION=true
|
|
75
|
+
# WORKFLOW_NODE_MEMOIZATION_TTL_MS=21600000
|
|
@@ -96,7 +96,18 @@ cmd_db_verify() {
|
|
|
96
96
|
dictionary_clusters: [
|
|
97
97
|
"cluster_id", "workflow_id", "parent_id", "depth", "name", "description",
|
|
98
98
|
"name_embedding", "medoid_id", "terms", "member_count", "umap_x", "umap_y",
|
|
99
|
-
"umap_z", "radius", "created_at", "updated_at"
|
|
99
|
+
"umap_z", "radius", "created_at", "updated_at",
|
|
100
|
+
"region_id", "carried_overlap", "derived_from", "name_locked", "locked_at",
|
|
101
|
+
"locked_by", "member_ids"
|
|
102
|
+
],
|
|
103
|
+
user_region_events: [
|
|
104
|
+
"id", "workflow_id", "user_id", "region_id", "region_name", "stage",
|
|
105
|
+
"source", "evidence", "occurred_at"
|
|
106
|
+
],
|
|
107
|
+
dictionary_regions: [
|
|
108
|
+
"region_id", "workflow_id", "depth", "name", "description", "name_locked",
|
|
109
|
+
"locked_at", "locked_by", "stage", "stage_set_by", "needs_review",
|
|
110
|
+
"derived_from", "first_seen", "last_seen", "closed_at"
|
|
100
111
|
],
|
|
101
112
|
dictionary_content_chunks: [
|
|
102
113
|
"chunk_id", "text", "source_url", "source_type", "metadata",
|
package/operator/lib/deploy.sh
CHANGED
|
@@ -918,6 +918,49 @@ EOF
|
|
|
918
918
|
|
|
919
919
|
rm -f "$tmp_inventory"
|
|
920
920
|
|
|
921
|
+
# ── POST-DEPLOY SMOKE ───────────────────────────────────────────────────────
|
|
922
|
+
# The deployed stack, probed from the outside. SELF-CONTAINED (curl only): this script
|
|
923
|
+
# is vendored into the operator CLI and runs in a universe folder, so it can lean on no
|
|
924
|
+
# repo test suite. Every check is an outage that shipped and was found by hand: the
|
|
925
|
+
# blank canvas (uncompressed/uncached bundle, 2026-08-15), the no-login boot (empty
|
|
926
|
+
# auth config, 2026-08-14), and the engine→Postgres 500 behind a healthy-looking stack
|
|
927
|
+
# (Trusted Sources, 2026-08-13). The repo twin with more detail lives at
|
|
928
|
+
# apps/canvas/tests/smoke/deployed.test.ts.
|
|
929
|
+
# Runs on the plain deploy only — init/db/harden are not "the site is live" moments.
|
|
930
|
+
if [ -z "$subcommand" ] || [ "$subcommand" = "deploy" ]; then
|
|
931
|
+
local smoke_canvas smoke_api smoke_fail=0
|
|
932
|
+
smoke_canvas=$(terraform -chdir="$ROOT/infra/$cloud" output -raw canvas_url 2>/dev/null)
|
|
933
|
+
smoke_api=$(terraform -chdir="$ROOT/infra/$cloud" output -raw api_url 2>/dev/null)
|
|
934
|
+
if [ -n "$smoke_api" ]; then
|
|
935
|
+
echo ""
|
|
936
|
+
info "Smoke-testing the deployed stack ${DIM}($smoke_api)${NC}"
|
|
937
|
+
_smoke() { # name, then the test itself as "$@"
|
|
938
|
+
local name="$1"; shift
|
|
939
|
+
if "$@" >/dev/null 2>&1; then echo -e " ${GREEN}ok${NC} $name"
|
|
940
|
+
else echo -e " ${RED}FAIL${NC} $name"; smoke_fail=1; fi
|
|
941
|
+
}
|
|
942
|
+
# Universe discovery answers (the connector's first question).
|
|
943
|
+
_smoke "universe discovery" curl -sf -m 10 "$smoke_api/.well-known/unoverse-universe" -o /dev/null
|
|
944
|
+
# Embed doorway is served AND compressed (identity-encoded JS was a live outage).
|
|
945
|
+
_smoke "embed.js gzipped" sh -c "curl -sf -m 10 -H 'accept-encoding: gzip' -D - '$smoke_api/embed.js' -o /dev/null | grep -qi '^content-encoding: gzip'"
|
|
946
|
+
# MCP lane accepts an initialize (every external connector dies here first).
|
|
947
|
+
_smoke "MCP initialize" sh -c "curl -sf -m 10 -X POST '$smoke_api/mcp' -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{},\"clientInfo\":{\"name\":\"smoke\",\"version\":\"0\"}}}' -o /dev/null"
|
|
948
|
+
# Engine → Postgres canary: 200 (auth off) or 401 (auth on) prove the chain; a 500
|
|
949
|
+
# is the DB-unreachable incident that hides behind an otherwise healthy stack.
|
|
950
|
+
_smoke "engine reaches database" sh -c "code=\$(curl -s -m 10 -o /dev/null -w '%{http_code}' '$smoke_api/marketplace'); [ \"\$code\" = 200 ] || [ \"\$code\" = 401 ]"
|
|
951
|
+
if [ -n "$smoke_canvas" ]; then
|
|
952
|
+
# The canvas page and the hashed bundle it names: present, compressed, cacheable.
|
|
953
|
+
_smoke "canvas page + compressed bundle" sh -c "asset=\$(curl -sf -m 10 '$smoke_canvas/' | grep -o '/assets/index-[^\"]*\.js' | head -1); [ -n \"\$asset\" ] && curl -sf -m 20 -H 'accept-encoding: gzip' -D - \"$smoke_canvas\$asset\" -o /dev/null | grep -qi '^content-encoding: gzip'"
|
|
954
|
+
# Empty auth values in config.js = the no-login boot where every call 401s.
|
|
955
|
+
_smoke "canvas auth config present" sh -c "! curl -sf -m 10 '$smoke_canvas/config.js' | grep -qE '(issuer|clientId): *\"\"'"
|
|
956
|
+
fi
|
|
957
|
+
if [ "$smoke_fail" = 1 ]; then
|
|
958
|
+
fail "Deploy finished but the smoke test FAILED — the stack above is live and misbehaving. Fix forward or roll back."
|
|
959
|
+
exit 1
|
|
960
|
+
fi
|
|
961
|
+
fi
|
|
962
|
+
fi
|
|
963
|
+
|
|
921
964
|
echo ""
|
|
922
965
|
echo -e " ${GREEN}${BOLD}Done${NC} ${DIM}in $(timer_elapsed)${NC}"
|
|
923
966
|
echo ""
|
package/package.json
CHANGED