@ekanos/harness 0.23.0 → 0.24.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.
- package/README.md +5 -4
- package/dist/internal/components/approvals-tray.js +5 -5
- package/dist/internal/components/ask-assistant-bridge.js +6 -6
- package/dist/internal/components/connect-panel.js +16 -9
- package/dist/internal/components/connection-chip.js +2 -2
- package/dist/internal/components/dashboard-grid.js +1 -1
- package/dist/internal/components/dev-toolbar.js +5 -5
- package/dist/internal/components/docs-link.js +3 -3
- package/dist/internal/components/events-panel.js +11 -11
- package/dist/internal/components/health-panel.js +3 -10
- package/dist/internal/components/integration-badge.js +3 -3
- package/dist/internal/components/local-oauth-panel.js +14 -14
- package/dist/internal/components/operation-runner-panel.d.ts +3 -1
- package/dist/internal/components/operation-runner-panel.js +22 -44
- package/dist/internal/components/provenance-banner.js +3 -3
- package/dist/internal/components/run-log.js +13 -13
- package/dist/internal/components/runtime-strip.js +4 -4
- package/dist/internal/components/schema-form.js +8 -8
- package/dist/internal/components/scrollable-nav.d.ts +1 -1
- package/dist/internal/components/scrollable-nav.js +1 -1
- package/dist/internal/components/surface-nav.js +26 -26
- package/dist/internal/components/viewport-frame.js +1 -1
- package/dist/internal/components/widget-boundary.js +3 -3
- package/dist/internal/components/widget-surface.d.ts +5 -0
- package/dist/internal/components/widget-surface.js +12 -3
- package/dist/internal/components/workflow-runner.js +6 -6
- package/dist/internal/lib/console-context.js +2 -1
- package/dist/internal/lib/console-types.d.ts +4 -3
- package/dist/internal/lib/experience-runtime.d.ts +9 -1
- package/dist/internal/lib/experience-runtime.js +35 -7
- package/dist/internal/lib/run-log-view.js +5 -3
- package/dist/internal/routes/activation-page.js +17 -17
- package/dist/internal/routes/console-home-page.js +1 -1
- package/dist/internal/routes/experience-connect-page.js +12 -12
- package/dist/internal/routes/experience-layout-page.js +6 -6
- package/dist/internal/routes/experience-page-host.js +4 -4
- package/dist/internal/routes/experience-review-queue-page.js +7 -7
- package/dist/internal/routes/experience-runs-page.js +2 -2
- package/dist/internal/routes/experience-summary-page.js +4 -4
- package/dist/internal/routes/experience-widget-page.js +6 -3
- package/dist/internal/routes/experience-widgets-page.js +2 -2
- package/dist/internal/routes/experience-workflow-page.js +3 -3
- package/dist/internal/routes/experience-workflows-page.js +6 -6
- package/dist/internal/routes/integration-layout.js +1 -1
- package/dist/internal/routes/integrations-layout.js +2 -2
- package/dist/internal/routes/integrations-list-page.js +8 -8
- package/dist/internal/routes/integrations-operations-page.js +5 -5
- package/dist/internal/routes/integrations-overview-page.js +4 -4
- package/dist/internal/routes/integrations-runs-page.js +1 -1
- package/dist/internal/routes/integrations-scope.js +2 -2
- package/dist/internal/routes/repo-home-page.js +19 -19
- package/dist/internal/routes/repo-layout.js +4 -4
- package/dist/internal/routes/repo-package-layouts.js +2 -2
- package/dist/internal/routes/root-layout.js +1 -1
- package/dist/internal/routes/single-widget-page.js +5 -2
- package/dist/internal/routes/tile-page.js +8 -8
- package/dist/internal/routes/triggers-page.js +31 -31
- package/dist/internal/routes/widgets-page.js +1 -1
- package/dist/internal/server/ekanos-api-router.js +2 -2
- package/dist/internal/server/integration-resolver.d.ts +6 -0
- package/dist/internal/server/integration-resolver.js +5 -1
- package/dist/internal/server/local-secrets.d.ts +6 -5
- package/dist/internal/server/operation-runner.d.ts +7 -5
- package/dist/internal/server/operation-runner.js +23 -2
- package/dist/internal/surfaces.js +4 -4
- package/dist/registry.d.ts +9 -2
- package/package.json +6 -6
|
@@ -40,26 +40,26 @@ function OutcomePanel({ outcome }) {
|
|
|
40
40
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", "data-test": "trigger-outcome", children: [
|
|
41
41
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
42
42
|
/* @__PURE__ */ jsx(Badge, { variant: outcome.ok ? "default" : "destructive", children: outcome.summary }),
|
|
43
|
-
outcome.detail ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-
|
|
43
|
+
outcome.detail ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: outcome.detail }) : null
|
|
44
44
|
] }),
|
|
45
45
|
outcome.agentEvents ? /* @__PURE__ */ jsx(RaisedAgentEvents, { events: outcome.agentEvents }) : null,
|
|
46
46
|
outcome.logs.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
47
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-
|
|
48
|
-
/* @__PURE__ */ jsx("pre", { className: "bg-muted
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: "Handler logs" }),
|
|
48
|
+
/* @__PURE__ */ jsx("pre", { className: "bg-muted max-h-48 overflow-auto rounded-md p-3 text-xs", children: outcome.logs.map((log) => `[${log.level}] ${log.message}`).join("\n") })
|
|
49
49
|
] }) : null,
|
|
50
50
|
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: ["account", "user"].map((scope) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
51
|
-
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-
|
|
51
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
|
|
52
52
|
scope === "account" ? "Account" : "User",
|
|
53
53
|
" storage after this run",
|
|
54
54
|
Object.keys(outcome.storage[scope]).length === 0 ? "(empty)" : ""
|
|
55
55
|
] }),
|
|
56
|
-
/* @__PURE__ */ jsx("pre", { className: "bg-muted
|
|
56
|
+
/* @__PURE__ */ jsx("pre", { className: "bg-muted max-h-64 overflow-auto rounded-md p-3 text-xs", children: JSON.stringify(outcome.storage[scope], null, 2) })
|
|
57
57
|
] }, scope)) })
|
|
58
58
|
] });
|
|
59
59
|
}
|
|
60
60
|
function RaisedAgentEvents({ events }) {
|
|
61
61
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", "data-test": "raised-agent-events", children: [
|
|
62
|
-
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-
|
|
62
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
|
|
63
63
|
"Agent events raised (",
|
|
64
64
|
events.length,
|
|
65
65
|
") \u2014 the host records these and starts every agent whose trigger matches"
|
|
@@ -70,22 +70,22 @@ function RaisedAgentEvents({ events }) {
|
|
|
70
70
|
className: "flex flex-col gap-1 rounded-md border p-3",
|
|
71
71
|
children: [
|
|
72
72
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
73
|
-
/* @__PURE__ */ jsx("code", { className: "text-
|
|
73
|
+
/* @__PURE__ */ jsx("code", { className: "text-sm", children: event.id }),
|
|
74
74
|
/* @__PURE__ */ jsx(Badge, { variant: event.problem ? "destructive" : "secondary", children: event.problem ? "dropped" : "would be recorded" }),
|
|
75
|
-
event.dedupeKey ? /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-
|
|
75
|
+
event.dedupeKey ? /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
|
|
76
76
|
"dedupe ",
|
|
77
77
|
/* @__PURE__ */ jsx("code", { children: event.dedupeKey })
|
|
78
78
|
] }) : null
|
|
79
79
|
] }),
|
|
80
|
-
event.problem ? /* @__PURE__ */ jsx("p", { className: "text-destructive text-
|
|
81
|
-
event.conversation ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-
|
|
80
|
+
event.problem ? /* @__PURE__ */ jsx("p", { className: "text-destructive text-xs", children: event.problem }) : null,
|
|
81
|
+
event.conversation ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-xs", children: [
|
|
82
82
|
"A run it starts answers in ",
|
|
83
83
|
/* @__PURE__ */ jsx("code", { children: event.conversation.key })
|
|
84
84
|
] }) : null,
|
|
85
85
|
event.routes?.map((route) => /* @__PURE__ */ jsxs(
|
|
86
86
|
"p",
|
|
87
87
|
{
|
|
88
|
-
className: route.problem ? "text-destructive text-
|
|
88
|
+
className: route.problem ? "text-destructive text-xs" : "text-muted-foreground text-xs",
|
|
89
89
|
"data-test": `raised-agent-event-route-${route.key}`,
|
|
90
90
|
children: [
|
|
91
91
|
route.value === null ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -105,7 +105,7 @@ function RaisedAgentEvents({ events }) {
|
|
|
105
105
|
},
|
|
106
106
|
route.key
|
|
107
107
|
)),
|
|
108
|
-
/* @__PURE__ */ jsx("pre", { className: "bg-muted
|
|
108
|
+
/* @__PURE__ */ jsx("pre", { className: "bg-muted max-h-40 overflow-auto rounded-md p-2 text-xs", children: JSON.stringify(event.payload, null, 2) })
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
111
|
`${event.id}:${event.dedupeKey}:${index}`
|
|
@@ -126,7 +126,7 @@ function AgentEventsCard({
|
|
|
126
126
|
"data-test": "agent-events",
|
|
127
127
|
children: [
|
|
128
128
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
129
|
-
/* @__PURE__ */ jsx("h3", { className: "text-
|
|
129
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: "Agent events" }),
|
|
130
130
|
/* @__PURE__ */ jsx(Badge, { variant: "outline", children: "agents" }),
|
|
131
131
|
channel ? /* @__PURE__ */ jsxs(Badge, { variant: "secondary", children: [
|
|
132
132
|
"replies with ",
|
|
@@ -134,12 +134,12 @@ function AgentEventsCard({
|
|
|
134
134
|
] }) : /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: "no channel \u2014 runs answer in Ekanos" }),
|
|
135
135
|
definition.sourceConnection ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: "Source connection" }) : null
|
|
136
136
|
] }),
|
|
137
|
-
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-
|
|
137
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
138
138
|
"A team picks one of these as an agent trigger and fills in its filter. Your webhooks raise them through ",
|
|
139
139
|
/* @__PURE__ */ jsx("code", { children: "WebhookResult.events" }),
|
|
140
140
|
"; deliver a webhook above to see what it raises."
|
|
141
141
|
] }),
|
|
142
|
-
definition.routing ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-
|
|
142
|
+
definition.routing ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
143
143
|
"On a Source connection, events are routed to a team by",
|
|
144
144
|
" ",
|
|
145
145
|
definition.routing.keys.map((key, index) => /* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -164,15 +164,15 @@ function AgentEventsCard({
|
|
|
164
164
|
children: [
|
|
165
165
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
166
166
|
/* @__PURE__ */ jsx("span", { className: "font-medium", children: event.label }),
|
|
167
|
-
/* @__PURE__ */ jsx("code", { className: "text-muted-foreground text-
|
|
167
|
+
/* @__PURE__ */ jsx("code", { className: "text-muted-foreground text-xs", children: event.id }),
|
|
168
168
|
event.conversation ? /* @__PURE__ */ jsx(Badge, { variant: "outline", children: "answers in place" }) : null,
|
|
169
169
|
Object.keys(event.routeKeys ?? {}).map((key) => /* @__PURE__ */ jsxs(Badge, { variant: "outline", children: [
|
|
170
170
|
"routes by ",
|
|
171
171
|
/* @__PURE__ */ jsx("code", { children: key })
|
|
172
172
|
] }, key))
|
|
173
173
|
] }),
|
|
174
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-
|
|
175
|
-
event.filter?.fields.length ? /* @__PURE__ */ jsx("ul", { className: "text-muted-foreground
|
|
174
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: event.description }),
|
|
175
|
+
event.filter?.fields.length ? /* @__PURE__ */ jsx("ul", { className: "text-muted-foreground list-disc pl-5 text-xs", children: event.filter.fields.map((field) => /* @__PURE__ */ jsxs("li", { children: [
|
|
176
176
|
/* @__PURE__ */ jsx("code", { children: field.key }),
|
|
177
177
|
" \u2014 ",
|
|
178
178
|
field.label,
|
|
@@ -180,7 +180,7 @@ function AgentEventsCard({
|
|
|
180
180
|
field.type,
|
|
181
181
|
field.required ? ", required" : "",
|
|
182
182
|
")"
|
|
183
|
-
] }, field.key)) }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-
|
|
183
|
+
] }, field.key)) }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "No filter: every event of this kind starts the agent." })
|
|
184
184
|
]
|
|
185
185
|
},
|
|
186
186
|
event.id
|
|
@@ -223,7 +223,7 @@ function WebhookCard({
|
|
|
223
223
|
"data-test": `webhook-${webhook.id}`,
|
|
224
224
|
children: [
|
|
225
225
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
226
|
-
/* @__PURE__ */ jsx("h3", { className: "text-
|
|
226
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: /* @__PURE__ */ jsx("code", { children: webhook.id }) }),
|
|
227
227
|
/* @__PURE__ */ jsx(Badge, { variant: "outline", children: "webhook" }),
|
|
228
228
|
webhook.signature === "none" ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: "unsigned" }) : /* @__PURE__ */ jsxs(Badge, { variant: "secondary", children: [
|
|
229
229
|
"signed: ",
|
|
@@ -234,10 +234,10 @@ function WebhookCard({
|
|
|
234
234
|
] }),
|
|
235
235
|
webhook.signature !== "none" && webhook.signature.scheme ? /* @__PURE__ */ jsx(Badge, { variant: "outline", "data-test": `webhook-${webhook.id}-scheme`, children: describeSignatureScheme(webhook.signature.scheme) }) : null
|
|
236
236
|
] }),
|
|
237
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-
|
|
238
|
-
webhook.signature !== "none" ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-
|
|
237
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: webhook.description }),
|
|
238
|
+
webhook.signature !== "none" ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "Signature verification is the transport's job \u2014 the harness skips it (and says so in the handler logs); the host ingress will enforce it before your handler ever runs." }) : null,
|
|
239
239
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
240
|
-
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-
|
|
240
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
|
|
241
241
|
"Payload (validated against ",
|
|
242
242
|
/* @__PURE__ */ jsx("code", { children: "payloadSchema" }),
|
|
243
243
|
" before the handler runs)"
|
|
@@ -248,7 +248,7 @@ function WebhookCard({
|
|
|
248
248
|
value: state.payload,
|
|
249
249
|
onChange: (event) => setState((s) => ({ ...s, payload: event.target.value })),
|
|
250
250
|
rows: 10,
|
|
251
|
-
className: "
|
|
251
|
+
className: "font-mono text-xs",
|
|
252
252
|
"data-test": `webhook-payload-${webhook.id}`
|
|
253
253
|
}
|
|
254
254
|
)
|
|
@@ -285,12 +285,12 @@ function ScheduleCard({
|
|
|
285
285
|
"data-test": `schedule-${schedule.id}`,
|
|
286
286
|
children: [
|
|
287
287
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
288
|
-
/* @__PURE__ */ jsx("h3", { className: "text-
|
|
288
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: /* @__PURE__ */ jsx("code", { children: schedule.id }) }),
|
|
289
289
|
/* @__PURE__ */ jsx(Badge, { variant: "outline", children: "schedule" }),
|
|
290
290
|
/* @__PURE__ */ jsx(Badge, { variant: "secondary", children: /* @__PURE__ */ jsx("code", { children: schedule.cron }) })
|
|
291
291
|
] }),
|
|
292
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-
|
|
293
|
-
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-
|
|
292
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: schedule.description }),
|
|
293
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-xs", children: [
|
|
294
294
|
"The host scheduler fires this cron with",
|
|
295
295
|
" ",
|
|
296
296
|
/* @__PURE__ */ jsx("code", { children: "trigger: 'schedule'" }),
|
|
@@ -338,10 +338,10 @@ function OAuthCard({
|
|
|
338
338
|
"data-test": "oauth-declaration",
|
|
339
339
|
children: [
|
|
340
340
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
341
|
-
/* @__PURE__ */ jsx("h3", { className: "text-
|
|
341
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: "OAuth declaration" }),
|
|
342
342
|
/* @__PURE__ */ jsx(Badge, { variant: "outline", children: "oauth" })
|
|
343
343
|
] }),
|
|
344
|
-
/* @__PURE__ */ jsxs("dl", { className: "
|
|
344
|
+
/* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-x-6 gap-y-2 text-sm sm:grid-cols-[auto_1fr]", children: [
|
|
345
345
|
rows.map(([label, value]) => /* @__PURE__ */ jsxs("div", { className: "contents", children: [
|
|
346
346
|
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: label }),
|
|
347
347
|
/* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx("code", { className: "break-all", children: value }) })
|
|
@@ -448,14 +448,14 @@ function TriggersPage() {
|
|
|
448
448
|
] })
|
|
449
449
|
] })
|
|
450
450
|
] }),
|
|
451
|
-
!definition ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-
|
|
451
|
+
!definition ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
452
452
|
"This harness entry does not link its ",
|
|
453
453
|
/* @__PURE__ */ jsx("code", { children: "defineIntegration()" }),
|
|
454
454
|
" ",
|
|
455
455
|
"output. Add ",
|
|
456
456
|
/* @__PURE__ */ jsx("code", { children: "definition: integration" }),
|
|
457
457
|
" to the entry in your harness config to light this surface up."
|
|
458
|
-
] }) : !declaresAnything ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-
|
|
458
|
+
] }) : !declaresAnything ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
459
459
|
/* @__PURE__ */ jsx("code", { children: definition.slug }),
|
|
460
460
|
" declares no webhooks, schedules, or OAuth \u2014 which is a perfectly good answer for an integration that only reads. The ",
|
|
461
461
|
/* @__PURE__ */ jsx("code", { children: "@ekanos/sdk" }),
|
|
@@ -6,7 +6,7 @@ import { useHarnessIntegration } from "../registry-context.js";
|
|
|
6
6
|
function WidgetsPage() {
|
|
7
7
|
const integration = useHarnessIntegration();
|
|
8
8
|
if (!integration) notFound();
|
|
9
|
-
return /* @__PURE__ */ jsx("div", { className: "min-w-0", "data-test": "widgets", children: integration.widgets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-
|
|
9
|
+
return /* @__PURE__ */ jsx("div", { className: "min-w-0", "data-test": "widgets", children: integration.widgets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This integration registers no widgets." }) : /* @__PURE__ */ jsx(
|
|
10
10
|
WidgetSurface,
|
|
11
11
|
{
|
|
12
12
|
widgets: integration.widgets,
|
|
@@ -66,7 +66,7 @@ const RunBodySchema = z.preprocess(
|
|
|
66
66
|
integration: z.string().min(1),
|
|
67
67
|
op: z.string().min(1),
|
|
68
68
|
input: z.unknown().optional(),
|
|
69
|
-
channel: z.enum(["http", "rsc", "workflow"]),
|
|
69
|
+
channel: z.enum(["http", "rsc", "workflow", "interactive"]),
|
|
70
70
|
mode: z.enum(["fixtures", "live"]).optional(),
|
|
71
71
|
scenario: z.enum(["default", "empty", "error"]).optional(),
|
|
72
72
|
origin: z.string().max(200).optional()
|
|
@@ -115,7 +115,7 @@ function toIntegrationView(integration, runtime) {
|
|
|
115
115
|
function createEkanosApiRouter(partial = {}) {
|
|
116
116
|
const env = partial.env ?? process.env;
|
|
117
117
|
const root = partial.projectRoot ? { ok: true, root: partial.projectRoot } : resolveProjectRoot({ env, cwd: partial.cwd ?? process.cwd() });
|
|
118
|
-
const httpWrites = partial.httpWrites ?? (env.EKANOS_HARNESS_HTTP_WRITES === "
|
|
118
|
+
const httpWrites = partial.httpWrites ?? (env.EKANOS_HARNESS_HTTP_WRITES === "approval" ? "approval" : "refuse");
|
|
119
119
|
const approvals = createApprovalsTray({
|
|
120
120
|
...partial.now ? { now: partial.now } : {}
|
|
121
121
|
});
|
|
@@ -27,6 +27,12 @@ import { type EnsureResult } from './registry-cache.js';
|
|
|
27
27
|
* Nothing here throws for a per-integration problem — problems come back as
|
|
28
28
|
* `errors` so the harness can start, print them, and refuse only that integration.
|
|
29
29
|
*/
|
|
30
|
+
/**
|
|
31
|
+
* The mode a slot runs in when nothing overrides it: the first declared mode
|
|
32
|
+
* the host serves (`team`, `invoker`), in declared order, as the host does.
|
|
33
|
+
* A slot that declares only `user` (lent) keeps it and is refused at run time.
|
|
34
|
+
*/
|
|
35
|
+
export declare function defaultBindingMode(modes: readonly BindingMode[]): BindingMode;
|
|
30
36
|
export interface ResolvedIntegration {
|
|
31
37
|
integration: string;
|
|
32
38
|
version: string;
|
|
@@ -30,6 +30,9 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
ensurePublishedIntegration
|
|
32
32
|
} from "./registry-cache.js";
|
|
33
|
+
function defaultBindingMode(modes) {
|
|
34
|
+
return modes.find((mode) => mode === "team" || mode === "invoker") ?? modes[0] ?? "team";
|
|
35
|
+
}
|
|
33
36
|
function repoOf(projectRoot, notices) {
|
|
34
37
|
const root = findRepoRoot(projectRoot);
|
|
35
38
|
if (!root) return null;
|
|
@@ -148,7 +151,7 @@ async function resolveIntegrations(options) {
|
|
|
148
151
|
const snapshotDir = path.resolve(options.projectRoot, manifest.contractsDir);
|
|
149
152
|
for (const entry of manifest.integrations) {
|
|
150
153
|
const override = overrideByIntegration.get(entry.name);
|
|
151
|
-
const bindingMode = overridesInfo.bindingMode[entry.name] ?? entry.modes
|
|
154
|
+
const bindingMode = overridesInfo.bindingMode[entry.name] ?? defaultBindingMode(entry.modes);
|
|
152
155
|
const repoPackage = override ? null : sameRepoPackage(repo, options.projectRoot, entry.name);
|
|
153
156
|
try {
|
|
154
157
|
const resolved = override ? await resolveLocal(
|
|
@@ -608,6 +611,7 @@ function formatProvenanceLines(resolution) {
|
|
|
608
611
|
}
|
|
609
612
|
export {
|
|
610
613
|
compatLine,
|
|
614
|
+
defaultBindingMode,
|
|
611
615
|
formatProvenanceLines,
|
|
612
616
|
repoOf,
|
|
613
617
|
resolveIntegrations,
|
|
@@ -28,11 +28,12 @@ export declare const LOCAL_SECRETS_RELATIVE_PATH: string;
|
|
|
28
28
|
/**
|
|
29
29
|
* The block key holding what the activation form submitted in live mode.
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
31
|
+
* Every STRING field of the submitted `activationData` becomes
|
|
32
|
+
* `ctx.secrets.get('<field name>')` for that account, under the exact field
|
|
33
|
+
* name (non-strings do not). On the host the fields `activation.fields` marks
|
|
34
|
+
* `secret: true` are vaulted and the rest stay readable through the same call;
|
|
35
|
+
* the harness has no connection record to keep them out of, so it keeps them
|
|
36
|
+
* all here. They are not declared secret names (the admin tier). They are persisted here verbatim as the account tier,
|
|
36
37
|
* beside (never among) the admin-tier names the operator fills in.
|
|
37
38
|
*/
|
|
38
39
|
export declare const ACTIVATION_BLOCK_KEY = "activationData";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ContractOperation, type OperationKind } from '@ekanos/integration-schema';
|
|
2
2
|
import type { ExecutionChannel, FixtureScenario, InternalWriteGate, OperationResult, RunMode, RunOperationRequest, RunRecord } from '../../api-types.js';
|
|
3
3
|
import type { ApprovalsTray } from './approvals.js';
|
|
4
4
|
import type { ResolvedIntegration } from './integration-resolver.js';
|
|
@@ -23,10 +23,12 @@ import { type ExecutorLimits } from './semantics.js';
|
|
|
23
23
|
* 8 output validates, FAIL-CLOSED + cap output_invalid / output_too_large
|
|
24
24
|
* 9 a run-log row, always
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* Channels, as in the host: a widget or page write arrives on `interactive`
|
|
27
|
+
* (a person's click) and runs directly, with the `confirmed: true` rule; a
|
|
28
|
+
* workflow write runs only behind its approval gate (the approvals tray); an
|
|
29
|
+
* `http` or `rsc` write is refused. `channels.httpWrites` defaults to
|
|
30
|
+
* `'refuse'`; `'approval'` is an opt-in for testing that holds an `http` write
|
|
31
|
+
* in the tray, which the host never does.
|
|
30
32
|
*/
|
|
31
33
|
export type HttpWritePolicy = 'refuse' | 'approval';
|
|
32
34
|
export interface FixtureSource {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isConfirmed,
|
|
3
|
+
requiresConfirmation
|
|
4
|
+
} from "@ekanos/integration-schema";
|
|
1
5
|
import * as fs from "node:fs";
|
|
2
6
|
import * as path from "node:path";
|
|
3
7
|
import { redactSensitive } from "../lib/redact.js";
|
|
@@ -8,6 +12,16 @@ import {
|
|
|
8
12
|
validateInput,
|
|
9
13
|
validateOutput
|
|
10
14
|
} from "./semantics.js";
|
|
15
|
+
function servesBindingMode(integration, channel) {
|
|
16
|
+
switch (integration.bindingMode) {
|
|
17
|
+
case "team":
|
|
18
|
+
return true;
|
|
19
|
+
case "invoker":
|
|
20
|
+
return channel !== "workflow" || integration.modes.includes("team");
|
|
21
|
+
case "user":
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
11
25
|
const OP_KEY = /^(tool|action)\/([a-z][a-z0-9_-]*)$/;
|
|
12
26
|
class DeadlineError extends Error {
|
|
13
27
|
constructor() {
|
|
@@ -112,10 +126,17 @@ async function runOperation(request, deps) {
|
|
|
112
126
|
operation = integration.contract.operations.find((candidate) => candidate.id === id) ?? null;
|
|
113
127
|
if (!operation) return refuse("operation_not_in_contract");
|
|
114
128
|
mode = request.mode ?? await deps.defaultModeFor?.(integration, operation.effect) ?? integration.defaultMode;
|
|
115
|
-
if (!integration.modes.includes(integration.bindingMode) || !integration.runModes.includes(mode)) {
|
|
129
|
+
if (!integration.modes.includes(integration.bindingMode) || !integration.runModes.includes(mode) || !servesBindingMode(integration, request.channel)) {
|
|
116
130
|
return refuse("mode_not_permitted");
|
|
117
131
|
}
|
|
118
|
-
if (
|
|
132
|
+
if (request.channel === "interactive") {
|
|
133
|
+
if (operation.effect !== "write") {
|
|
134
|
+
return refuse("operation_not_in_contract");
|
|
135
|
+
}
|
|
136
|
+
if (requiresConfirmation(operation) && !isConfirmed(request.input)) {
|
|
137
|
+
return refuse("confirmation_required");
|
|
138
|
+
}
|
|
139
|
+
} else if (operation.effect === "write" && !request.gate) {
|
|
119
140
|
const gated = request.channel === "workflow" || deps.channels.httpWrites === "approval";
|
|
120
141
|
if (!gated) return refuse("write_refused_on_channel");
|
|
121
142
|
const pending = deps.approvals.request(
|
|
@@ -3,25 +3,25 @@ const HARNESS_SURFACES = [
|
|
|
3
3
|
segment: "widgets",
|
|
4
4
|
label: "Widgets",
|
|
5
5
|
shortLabel: "Widgets",
|
|
6
|
-
icon: "fa-
|
|
6
|
+
icon: "fa-table-cells-large"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
segment: "tile",
|
|
10
10
|
label: "Marketplace tile",
|
|
11
11
|
shortLabel: "Tile",
|
|
12
|
-
icon: "fa-
|
|
12
|
+
icon: "fa-store"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
segment: "activation",
|
|
16
16
|
label: "Activation",
|
|
17
17
|
shortLabel: "Activation",
|
|
18
|
-
icon: "fa-
|
|
18
|
+
icon: "fa-plug"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
segment: "triggers",
|
|
22
22
|
label: "Triggers",
|
|
23
23
|
shortLabel: "Triggers",
|
|
24
|
-
icon: "fa-
|
|
24
|
+
icon: "fa-bolt"
|
|
25
25
|
}
|
|
26
26
|
];
|
|
27
27
|
export {
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { WidgetLayouts } from '@ekanos/integration-schema';
|
|
2
3
|
import type { ActivationFormProps, IntegrationComponentProps, IntegrationConnection, IntegrationFetch, IntegrationRouting, MarketplaceTileProps, StorageSchemas } from '@ekanos/sdk';
|
|
3
4
|
import type { IntegrationDefinition } from '@ekanos/sdk/integration';
|
|
4
5
|
import type { MockFetchHandler } from '@ekanos/sdk/testing';
|
|
@@ -75,9 +76,15 @@ export interface HarnessWidget {
|
|
|
75
76
|
component: ComponentType<IntegrationComponentProps>;
|
|
76
77
|
/**
|
|
77
78
|
* Column span in the dashboard grid. `full` gets its own row; runs of
|
|
78
|
-
* `half` widgets are balanced across two columns
|
|
79
|
+
* `half` widgets are balanced across two columns; `compact` is a figure
|
|
80
|
+
* tile. Defaults to `half`. Precedence: `size`, then `layouts.lg.w`, then
|
|
81
|
+
* `width`.
|
|
79
82
|
*/
|
|
80
|
-
width?: 'half' | 'full';
|
|
83
|
+
width?: 'compact' | 'half' | 'full';
|
|
84
|
+
/** Same as an integration widget's `size`; wins over `layouts` and `width`. */
|
|
85
|
+
size?: 'compact' | 'half' | 'full';
|
|
86
|
+
/** Same as an integration widget's `layouts`; the grid reads `lg.w` and `lg.maxHeight`. */
|
|
87
|
+
layouts?: WidgetLayouts;
|
|
81
88
|
isCollapsible?: boolean;
|
|
82
89
|
isPinnable?: boolean;
|
|
83
90
|
/** Renders the "Ask about this" AI footer bar. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekanos/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.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.24.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.24.0",
|
|
83
|
+
"@ekanos/ui": "0.24.0",
|
|
84
84
|
"@kit/tsconfig": "0.1.0",
|
|
85
85
|
"@tailwindcss/postcss": "4.3.4",
|
|
86
86
|
"@tanstack/react-query": "5.105.3",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"vitest": "5.1.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"@ekanos/sdk": "^0.
|
|
103
|
-
"@ekanos/ui": "^0.
|
|
102
|
+
"@ekanos/sdk": "^0.24.0",
|
|
103
|
+
"@ekanos/ui": "^0.24.0",
|
|
104
104
|
"@tanstack/react-query": "^5.101.4",
|
|
105
105
|
"next": "^16.0.0",
|
|
106
106
|
"next-intl": "^4.14.7",
|