@ekanos/harness 0.21.0 → 0.22.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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validateAgainstSchema } from "@ekanos/integration-schema";
|
|
2
|
+
import fs from "node:fs";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { deriveConnectionFacts } from "../lib/connection-facts.js";
|
|
@@ -90,6 +91,11 @@ const ActivationBodySchema = z.object({
|
|
|
90
91
|
});
|
|
91
92
|
const RuntimeModeBodySchema = z.object({ mode: z.enum(["auto", "fixtures"]) });
|
|
92
93
|
const DisconnectBodySchema = z.object({ clearKeys: z.boolean().optional() });
|
|
94
|
+
const RESOLUTION_INPUTS = [
|
|
95
|
+
"ekanos.json",
|
|
96
|
+
"ekanos.lock.json",
|
|
97
|
+
"ekanos.local.json"
|
|
98
|
+
];
|
|
93
99
|
function toIntegrationView(integration, runtime) {
|
|
94
100
|
return {
|
|
95
101
|
runtime,
|
|
@@ -118,11 +124,29 @@ function createEkanosApiRouter(partial = {}) {
|
|
|
118
124
|
const loadExp = partial.loadExperience ?? loadExperience;
|
|
119
125
|
let resolution = null;
|
|
120
126
|
let experience = null;
|
|
127
|
+
let inputsKey = null;
|
|
128
|
+
function refreshIfInputsChanged() {
|
|
129
|
+
const dir = projectRoot();
|
|
130
|
+
const key = RESOLUTION_INPUTS.map((name) => {
|
|
131
|
+
try {
|
|
132
|
+
const stat = fs.statSync(path.join(dir, name));
|
|
133
|
+
return `${stat.mtimeMs}:${stat.size}`;
|
|
134
|
+
} catch {
|
|
135
|
+
return "-";
|
|
136
|
+
}
|
|
137
|
+
}).join("|");
|
|
138
|
+
if (inputsKey !== null && key !== inputsKey) {
|
|
139
|
+
resolution = null;
|
|
140
|
+
experience = null;
|
|
141
|
+
}
|
|
142
|
+
inputsKey = key;
|
|
143
|
+
}
|
|
121
144
|
function projectRoot() {
|
|
122
145
|
if (!root.ok) throw new Error(root.message);
|
|
123
146
|
return root.root;
|
|
124
147
|
}
|
|
125
148
|
function getResolution() {
|
|
149
|
+
refreshIfInputsChanged();
|
|
126
150
|
resolution ??= (async () => {
|
|
127
151
|
const dir = projectRoot();
|
|
128
152
|
const contractsDir = partial.contractsDir ?? env.EKANOS_CONTRACTS_DIR?.trim();
|
|
@@ -138,6 +162,7 @@ function createEkanosApiRouter(partial = {}) {
|
|
|
138
162
|
return resolution;
|
|
139
163
|
}
|
|
140
164
|
function getExperience() {
|
|
165
|
+
refreshIfInputsChanged();
|
|
141
166
|
experience ??= loadExp(projectRoot());
|
|
142
167
|
return experience;
|
|
143
168
|
}
|
|
@@ -95,7 +95,13 @@ async function runOperation(request, deps) {
|
|
|
95
95
|
...approvalId ? { approvalId } : {}
|
|
96
96
|
};
|
|
97
97
|
};
|
|
98
|
-
if (!integration)
|
|
98
|
+
if (!integration) {
|
|
99
|
+
const known = deps.integrations.map((candidate) => candidate.integration);
|
|
100
|
+
return refuse(
|
|
101
|
+
"slot_unknown",
|
|
102
|
+
`"${request.integration}" is not a resolved integration. Known: ${known.length > 0 ? known.join(", ") : "(none)"}.`
|
|
103
|
+
);
|
|
104
|
+
}
|
|
99
105
|
const parsedKey = OP_KEY.exec(request.op);
|
|
100
106
|
if (!parsedKey) return refuse("operation_not_declared");
|
|
101
107
|
const kind = parsedKey[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekanos/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Ekanos integration dev harness — every surface of an integration rendered in real Ekanos chrome, from fixtures, with no Supabase or auth; and, in live mode, a real localhost OAuth loop over your own dev-app credentials.",
|
|
6
6
|
"homepage": "https://sdk.ekanos.dev/harness/overview",
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@ekanos/integration-schema": "0.
|
|
75
|
+
"@ekanos/integration-schema": "0.22.0",
|
|
76
76
|
"@fortawesome/fontawesome-free": "^7.3.1",
|
|
77
77
|
"next-themes": "0.4.6",
|
|
78
78
|
"tw-animate-css": "1.4.0",
|
|
79
79
|
"zod": "4.6.7"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@ekanos/sdk": "0.
|
|
83
|
-
"@ekanos/ui": "0.
|
|
82
|
+
"@ekanos/sdk": "0.22.0",
|
|
83
|
+
"@ekanos/ui": "0.22.0",
|
|
84
84
|
"@kit/tsconfig": "0.1.0",
|
|
85
85
|
"@tailwindcss/postcss": "4.3.3",
|
|
86
86
|
"@tanstack/react-query": "5.104.4",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"vitest": "4.1.10"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"@ekanos/sdk": "^0.
|
|
103
|
-
"@ekanos/ui": "^0.
|
|
102
|
+
"@ekanos/sdk": "^0.22.0",
|
|
103
|
+
"@ekanos/ui": "^0.22.0",
|
|
104
104
|
"@tanstack/react-query": "^5.101.4",
|
|
105
105
|
"next": "^16.0.0",
|
|
106
106
|
"next-intl": "^4.14.7",
|