@krak-stack/registry 0.1.34 → 0.1.36
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 +39 -1
- package/dist/components/ui/data-table.js +1 -1
- package/dist/components/ui/effect-form.d.ts +1 -1
- package/dist/components/ui/effect-form.js +62 -59
- package/dist/components/ui/error-component.js +1 -1
- package/dist/components/ui/form.js +61 -58
- package/dist/components/ui/icon-input.js +66 -63
- package/dist/components/ui/sidebar-layout.js +2 -2
- package/dist/components/ui/virtualized-combobox.js +61 -58
- package/dist/lib/docs.js +3 -3
- package/dist/lib/docs.server.js +2 -2
- package/dist/lib/documentation-toolkit.d.ts +1 -1
- package/dist/lib/documentation-toolkit.js +3 -3
- package/dist/lib/httpapi-cli.d.ts +2 -2
- package/dist/lib/httpapi-cli.js +15 -15
- package/dist/lib/httpapi-client.d.ts +3 -3
- package/dist/lib/httpapi-client.js +2 -2
- package/dist/lib/httpapi-helpers.d.ts +1 -1
- package/dist/lib/httpapi-helpers.js +1 -1
- package/dist/lib/httpapi-mcp.d.ts +2 -2
- package/dist/lib/httpapi-mcp.js +4 -4
- package/dist/lib/httpapi-toolkit.d.ts +1 -1
- package/dist/lib/httpapi-toolkit.js +4 -4
- package/dist/lib/query.js +2 -2
- package/dist/lib/webfetch-toolkit.d.ts +2 -2
- package/dist/lib/webfetch-toolkit.js +4 -4
- package/dist/services/agent/client/atom.d.ts +1 -1
- package/dist/services/agent/client/index.js +4 -4
- package/dist/services/agent/index.d.ts +1 -1
- package/dist/services/agent/index.js +1 -1
- package/dist/services/agent/schema.d.ts +1 -1
- package/dist/services/agent/schema.js +3 -3
- package/dist/services/health/api.builder.d.ts +10 -10
- package/dist/services/health/api.group.d.ts +1 -1
- package/dist/services/health/index.js +2 -2
- package/dist/services/notification/channels/ses/index.js +4 -4
- package/dist/services/opentelemetry/api.d.ts +2 -2
- package/dist/services/opentelemetry/api.js +13 -4
- package/dist/services/opentelemetry/browser.d.ts +15 -7
- package/dist/services/opentelemetry/browser.js +62 -13
- package/dist/services/s3/index.js +6 -6
- package/package.json +7 -5
- package/patches/@lucas-barake%2Feffect-form-react@0.26.0-beta.5.patch +66 -0
- package/patches/@lucas-barake%2Feffect-form@0.25.0-beta.6.patch +86 -0
- package/patches/README.md +31 -0
|
@@ -117,7 +117,7 @@ function InputGroupInput({
|
|
|
117
117
|
|
|
118
118
|
// ../../src/components/ui/virtualized-combobox.tsx
|
|
119
119
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
120
|
-
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
120
|
+
import { jsx as jsx4, jsxs, Fragment } from "react/jsx-runtime";
|
|
121
121
|
"use client";
|
|
122
122
|
var messages = {
|
|
123
123
|
en: {
|
|
@@ -194,65 +194,68 @@ var VirtualizedComboboxList = ({
|
|
|
194
194
|
if (element)
|
|
195
195
|
virtualizer.measure();
|
|
196
196
|
}, [virtualizer]);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
197
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
198
|
+
children: [
|
|
199
|
+
filteredItems.length === 0 && /* @__PURE__ */ jsx4("div", {
|
|
200
|
+
className: "text-muted-foreground flex min-h-0 flex-1 flex-col items-center justify-center overflow-auto py-6 text-center text-sm",
|
|
201
|
+
children: emptyLabel
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ jsx4(ComboboxPrimitive.List, {
|
|
204
|
+
className: "min-h-0 flex-1 scroll-py-1 overflow-auto overscroll-contain p-1",
|
|
205
|
+
hidden: filteredItems.length === 0,
|
|
206
|
+
ref: handleScrollElementRef,
|
|
207
|
+
style: {
|
|
208
|
+
height: Math.min(virtualizer.getTotalSize() + 8, 288),
|
|
209
|
+
maxHeight: "var(--available-height)"
|
|
210
|
+
},
|
|
211
|
+
children: /* @__PURE__ */ jsx4("div", {
|
|
212
|
+
className: "relative w-full",
|
|
213
|
+
role: "presentation",
|
|
214
|
+
style: { height: virtualizer.getTotalSize() },
|
|
215
|
+
children: virtualizer.getVirtualItems().map((virtualItem) => {
|
|
216
|
+
const entry = entries[virtualItem.index];
|
|
217
|
+
if (!entry)
|
|
218
|
+
return null;
|
|
219
|
+
const style = {
|
|
220
|
+
height: virtualItem.size,
|
|
221
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
222
|
+
};
|
|
223
|
+
if (entry.kind === "group") {
|
|
224
|
+
return /* @__PURE__ */ jsx4(ComboboxPrimitive.Group, {
|
|
225
|
+
className: "contents",
|
|
226
|
+
children: /* @__PURE__ */ jsx4(ComboboxPrimitive.GroupLabel, {
|
|
227
|
+
className: "text-muted-foreground absolute top-0 left-0 w-full px-2 pt-3 pb-1 text-xs",
|
|
228
|
+
"data-index": virtualItem.index,
|
|
229
|
+
ref: virtualizer.measureElement,
|
|
230
|
+
style,
|
|
231
|
+
children: entry.label
|
|
232
|
+
})
|
|
233
|
+
}, entry.key);
|
|
234
|
+
}
|
|
235
|
+
return /* @__PURE__ */ jsxs(ComboboxPrimitive.Item, {
|
|
236
|
+
"aria-posinset": entry.index + 1,
|
|
237
|
+
"aria-setsize": filteredItems.length,
|
|
238
|
+
className: "data-highlighted:bg-accent data-highlighted:text-accent-foreground absolute top-0 left-0 flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
227
239
|
"data-index": virtualItem.index,
|
|
240
|
+
index: entry.index,
|
|
228
241
|
ref: virtualizer.measureElement,
|
|
229
242
|
style,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
renderItem?.(entry.item) ?? /* @__PURE__ */ jsx4("span", {
|
|
245
|
-
className: "min-w-0 truncate",
|
|
246
|
-
children: entry.item.label
|
|
247
|
-
}),
|
|
248
|
-
/* @__PURE__ */ jsx4(ComboboxPrimitive.ItemIndicator, {
|
|
249
|
-
className: "absolute right-2 flex size-4 items-center justify-center",
|
|
250
|
-
children: /* @__PURE__ */ jsx4(Check, {})
|
|
251
|
-
})
|
|
252
|
-
]
|
|
253
|
-
}, entry.item.value);
|
|
243
|
+
value: entry.item,
|
|
244
|
+
children: [
|
|
245
|
+
renderItem?.(entry.item) ?? /* @__PURE__ */ jsx4("span", {
|
|
246
|
+
className: "min-w-0 truncate",
|
|
247
|
+
children: entry.item.label
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ jsx4(ComboboxPrimitive.ItemIndicator, {
|
|
250
|
+
className: "absolute right-2 flex size-4 items-center justify-center",
|
|
251
|
+
children: /* @__PURE__ */ jsx4(Check, {})
|
|
252
|
+
})
|
|
253
|
+
]
|
|
254
|
+
}, entry.item.value);
|
|
255
|
+
})
|
|
256
|
+
})
|
|
254
257
|
})
|
|
255
|
-
|
|
258
|
+
]
|
|
256
259
|
});
|
|
257
260
|
};
|
|
258
261
|
var VirtualizedComboboxContent = ({
|
|
@@ -274,10 +277,10 @@ var VirtualizedComboboxContent = ({
|
|
|
274
277
|
side: "bottom",
|
|
275
278
|
sideOffset: 6,
|
|
276
279
|
children: /* @__PURE__ */ jsxs(ComboboxPrimitive.Popup, {
|
|
277
|
-
className: cn("relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-in-95", contentClassName),
|
|
280
|
+
className: cn("relative flex max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) flex-col overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-in-95", contentClassName),
|
|
278
281
|
children: [
|
|
279
282
|
/* @__PURE__ */ jsx4("div", {
|
|
280
|
-
className: "min-w-0 p-1 pb-0",
|
|
283
|
+
className: "min-w-0 shrink-0 p-1 pb-0",
|
|
281
284
|
children: /* @__PURE__ */ jsx4(InputGroup, {
|
|
282
285
|
className: "border-input/30 bg-input/30 h-8 w-full min-w-0 shadow-none",
|
|
283
286
|
children: /* @__PURE__ */ jsx4(ComboboxPrimitive.Input, {
|
package/dist/lib/docs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createIsomorphicFn } from "@tanstack/react-start";
|
|
3
3
|
import { getCookie } from "@tanstack/react-start/server";
|
|
4
4
|
import { Option as Option2, Schema as Schema3 } from "effect";
|
|
5
|
-
import { Cookies as Cookies2 } from "effect/
|
|
5
|
+
import { Cookies as Cookies2 } from "effect/http";
|
|
6
6
|
import {
|
|
7
7
|
forwardRef,
|
|
8
8
|
useDeferredValue,
|
|
@@ -801,7 +801,7 @@ function SearchMenu({
|
|
|
801
801
|
// ../../src/components/ui/sidebar-layout.tsx
|
|
802
802
|
import { Link as Link2, Outlet, useRouterState } from "@tanstack/react-router";
|
|
803
803
|
import { Option, Schema as Schema2 } from "effect";
|
|
804
|
-
import { Cookies } from "effect/
|
|
804
|
+
import { Cookies } from "effect/http";
|
|
805
805
|
import { useState as useState5 } from "react";
|
|
806
806
|
|
|
807
807
|
// ../../src/components/ui/sidebar.tsx
|
|
@@ -1416,7 +1416,7 @@ function SidebarLayout({
|
|
|
1416
1416
|
]
|
|
1417
1417
|
}),
|
|
1418
1418
|
/* @__PURE__ */ jsx13("div", {
|
|
1419
|
-
className: contentClassName ?? "flex flex-col gap-6 px-5 py-6 md:px-8",
|
|
1419
|
+
className: cn("isolate", contentClassName ?? "flex flex-col gap-6 px-5 py-6 md:px-8"),
|
|
1420
1420
|
children: children ?? /* @__PURE__ */ jsx13(Outlet, {})
|
|
1421
1421
|
})
|
|
1422
1422
|
]
|
package/dist/lib/docs.server.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Schema as Schema4 } from "effect";
|
|
|
6
6
|
import { createIsomorphicFn } from "@tanstack/react-start";
|
|
7
7
|
import { getCookie } from "@tanstack/react-start/server";
|
|
8
8
|
import { Option as Option2, Schema as Schema3 } from "effect";
|
|
9
|
-
import { Cookies as Cookies2 } from "effect/
|
|
9
|
+
import { Cookies as Cookies2 } from "effect/http";
|
|
10
10
|
import {
|
|
11
11
|
forwardRef,
|
|
12
12
|
useDeferredValue,
|
|
@@ -121,7 +121,7 @@ import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/
|
|
|
121
121
|
// ../../src/components/ui/sidebar-layout.tsx
|
|
122
122
|
import { Link as Link2, Outlet, useRouterState } from "@tanstack/react-router";
|
|
123
123
|
import { Option, Schema as Schema2 } from "effect";
|
|
124
|
-
import { Cookies } from "effect/
|
|
124
|
+
import { Cookies } from "effect/http";
|
|
125
125
|
import { useState as useState5 } from "react";
|
|
126
126
|
|
|
127
127
|
// ../../src/components/ui/sidebar.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { Tool, Toolkit } from "effect/
|
|
2
|
+
import { Tool, Toolkit } from "effect/ai";
|
|
3
3
|
import { type DocsCatalog, type DocsLocale } from "./docs.js";
|
|
4
4
|
export declare const DocumentationToolkit: Toolkit.Toolkit<{
|
|
5
5
|
readonly readDocumentation: Tool.Tool<"readDocumentation", {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// ../../src/lib/documentation-toolkit.ts
|
|
2
2
|
import { Effect, Schema as Schema4 } from "effect";
|
|
3
|
-
import { Tool, Toolkit } from "effect/
|
|
3
|
+
import { Tool, Toolkit } from "effect/ai";
|
|
4
4
|
|
|
5
5
|
// ../../src/lib/docs.tsx
|
|
6
6
|
import { createIsomorphicFn } from "@tanstack/react-start";
|
|
7
7
|
import { getCookie } from "@tanstack/react-start/server";
|
|
8
8
|
import { Option as Option2, Schema as Schema3 } from "effect";
|
|
9
|
-
import { Cookies as Cookies2 } from "effect/
|
|
9
|
+
import { Cookies as Cookies2 } from "effect/http";
|
|
10
10
|
import {
|
|
11
11
|
forwardRef,
|
|
12
12
|
useDeferredValue,
|
|
@@ -121,7 +121,7 @@ import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/
|
|
|
121
121
|
// ../../src/components/ui/sidebar-layout.tsx
|
|
122
122
|
import { Link as Link2, Outlet, useRouterState } from "@tanstack/react-router";
|
|
123
123
|
import { Option, Schema as Schema2 } from "effect";
|
|
124
|
-
import { Cookies } from "effect/
|
|
124
|
+
import { Cookies } from "effect/http";
|
|
125
125
|
import { useState as useState5 } from "react";
|
|
126
126
|
|
|
127
127
|
// ../../src/components/ui/sidebar.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cause, Context, Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect";
|
|
2
|
-
import { Command } from "effect/
|
|
3
|
-
import { ChildProcessSpawner } from "effect/
|
|
2
|
+
import { Command } from "effect/cli";
|
|
3
|
+
import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner";
|
|
4
4
|
import { ApiClient, type ApiClientService } from "./httpapi-client.js";
|
|
5
5
|
import { HttpApiSpec, type HttpApiOperationEntry } from "./httpapi-helpers.js";
|
|
6
6
|
declare const HttpApiCli_base: Context.ServiceClass<HttpApiCli, "HttpApiCli", {
|
package/dist/lib/httpapi-cli.js
CHANGED
|
@@ -14,17 +14,17 @@ import {
|
|
|
14
14
|
Stream,
|
|
15
15
|
Terminal
|
|
16
16
|
} from "effect";
|
|
17
|
-
import { Argument, Command, Flag } from "effect/
|
|
18
|
-
import { ChildProcessSpawner } from "effect/
|
|
17
|
+
import { Argument, Command, Flag } from "effect/cli";
|
|
18
|
+
import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner";
|
|
19
19
|
|
|
20
20
|
// ../../src/lib/httpapi-client.ts
|
|
21
21
|
import { Context, Effect, Layer, Schema, SchemaTransformation } from "effect";
|
|
22
|
-
import { HttpClient } from "effect/
|
|
22
|
+
import { HttpClient } from "effect/http";
|
|
23
23
|
import {
|
|
24
24
|
HttpApi,
|
|
25
25
|
HttpApiClient as EffectHttpApiClient,
|
|
26
26
|
OpenApi
|
|
27
|
-
} from "effect/
|
|
27
|
+
} from "effect/http-api";
|
|
28
28
|
var UndefinedFromNull = Schema.Null.pipe(Schema.decodeTo(Schema.Undefined, SchemaTransformation.transform({
|
|
29
29
|
decode: () => {
|
|
30
30
|
return;
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
Schema as Schema2,
|
|
135
135
|
SchemaRepresentation
|
|
136
136
|
} from "effect";
|
|
137
|
-
import { HttpApi as HttpApi2, OpenApi as OpenApi2 } from "effect/
|
|
137
|
+
import { HttpApi as HttpApi2, OpenApi as OpenApi2 } from "effect/http-api";
|
|
138
138
|
var JsonObjectSchema = Schema2.Record(Schema2.String, Schema2.Json).annotate({
|
|
139
139
|
identifier: "HttpJsonObject",
|
|
140
140
|
title: "HTTP JSON object",
|
|
@@ -514,23 +514,23 @@ var isBooleanSchema = (schema) => {
|
|
|
514
514
|
const values = schemaEnum(schema);
|
|
515
515
|
return schemaType(schema) === "boolean" || values.includes("true") && values.includes("false");
|
|
516
516
|
};
|
|
517
|
-
var jsonFlag = (name) => Flag.
|
|
517
|
+
var jsonFlag = (name) => Flag.String(name).pipe(Flag.mapTryCatch((value) => Schema3.decodeUnknownSync(JsonFromString)(value), () => `--${name} must be valid JSON`));
|
|
518
518
|
var primitiveFlag = (name, schema, required) => {
|
|
519
519
|
const type = schemaType(schema);
|
|
520
520
|
const choices = schemaEnum(schema);
|
|
521
521
|
let flag;
|
|
522
522
|
if (isBooleanSchema(schema)) {
|
|
523
|
-
flag = required ? Flag.
|
|
523
|
+
flag = required ? Flag.Literals(name, ["true", "false"]).pipe(Flag.map((value) => value === "true")) : Flag.Boolean(name);
|
|
524
524
|
} else if (choices.length > 0) {
|
|
525
|
-
flag = Flag.
|
|
525
|
+
flag = Flag.Literals(name, choices);
|
|
526
526
|
} else if (type === "integer") {
|
|
527
|
-
flag = Flag.
|
|
527
|
+
flag = Flag.Int(name);
|
|
528
528
|
} else if (type === "number" || hasNumericPattern(schema)) {
|
|
529
|
-
flag = Flag.
|
|
529
|
+
flag = Flag.Finite(name);
|
|
530
530
|
} else if (type === "object" || type === "array") {
|
|
531
531
|
flag = jsonFlag(name);
|
|
532
532
|
} else {
|
|
533
|
-
flag = Flag.
|
|
533
|
+
flag = Flag.String(name);
|
|
534
534
|
}
|
|
535
535
|
const documented = flag.pipe(Flag.withMetavar(type === "object" || type === "array" ? "JSON" : name.toUpperCase()));
|
|
536
536
|
const described = schema.description ? documented.pipe(Flag.withDescription(schema.description)) : documented;
|
|
@@ -541,13 +541,13 @@ var primitiveArgument = (name, schema) => {
|
|
|
541
541
|
const choices = schemaEnum(schema);
|
|
542
542
|
let argument;
|
|
543
543
|
if (choices.length > 0) {
|
|
544
|
-
argument = Argument.
|
|
544
|
+
argument = Argument.Literals(name, choices);
|
|
545
545
|
} else if (type === "integer") {
|
|
546
|
-
argument = Argument.
|
|
546
|
+
argument = Argument.Int(name);
|
|
547
547
|
} else if (type === "number" || hasNumericPattern(schema)) {
|
|
548
|
-
argument = Argument.
|
|
548
|
+
argument = Argument.Finite(name);
|
|
549
549
|
} else {
|
|
550
|
-
argument = Argument.
|
|
550
|
+
argument = Argument.String(name);
|
|
551
551
|
}
|
|
552
552
|
const documented = argument.pipe(Argument.withMetavar(name.toUpperCase()));
|
|
553
553
|
return schema.description ? documented.pipe(Argument.withDescription(schema.description)) : documented;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
-
import { HttpClient } from "effect/
|
|
3
|
-
import { HttpApi, HttpApiGroup } from "effect/
|
|
2
|
+
import { HttpClient } from "effect/http";
|
|
3
|
+
import { HttpApi, HttpApiGroup } from "effect/http-api";
|
|
4
4
|
import type { HttpApiOperationEntry, HttpApiOperationInput } from "./httpapi-helpers.js";
|
|
5
5
|
import type { Json } from "effect/Schema";
|
|
6
6
|
export type ApiClientConfig<Id extends string, Groups extends HttpApiGroup.Constraint> = {
|
|
@@ -25,6 +25,6 @@ export type ApiClientService = {
|
|
|
25
25
|
};
|
|
26
26
|
declare const ApiClient_base: Context.ServiceClass<ApiClient, "ApiClient", ApiClientService>;
|
|
27
27
|
export declare class ApiClient extends ApiClient_base {
|
|
28
|
-
static readonly layer: <Id extends string, Groups extends HttpApiGroup.Constraint>(config: ApiClientConfig<Id, Groups>) => Layer.Layer<ApiClient, never, HttpClient.HttpClient | Exclude<import("effect/
|
|
28
|
+
static readonly layer: <Id extends string, Groups extends HttpApiGroup.Constraint>(config: ApiClientConfig<Id, Groups>) => Layer.Layer<ApiClient, never, HttpClient.HttpClient | Exclude<import("effect/http-api/HttpApiMiddleware").MiddlewareClient<import("effect/http-api/HttpApiEndpoint").Middleware<HttpApiGroup.Endpoints<Groups>>>, import("effect/Scope").Scope>>;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// ../../src/lib/httpapi-client.ts
|
|
2
2
|
import { Context, Effect, Layer, Schema, SchemaTransformation } from "effect";
|
|
3
|
-
import { HttpClient } from "effect/
|
|
3
|
+
import { HttpClient } from "effect/http";
|
|
4
4
|
import {
|
|
5
5
|
HttpApi,
|
|
6
6
|
HttpApiClient as EffectHttpApiClient,
|
|
7
7
|
OpenApi
|
|
8
|
-
} from "effect/
|
|
8
|
+
} from "effect/http-api";
|
|
9
9
|
var UndefinedFromNull = Schema.Null.pipe(Schema.decodeTo(Schema.Undefined, SchemaTransformation.transform({
|
|
10
10
|
decode: () => {
|
|
11
11
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Effect, JsonSchema, Layer, Schema } from "effect";
|
|
2
2
|
import type { Json } from "effect/Schema";
|
|
3
|
-
import { HttpApi, OpenApi } from "effect/
|
|
3
|
+
import { HttpApi, OpenApi } from "effect/http-api";
|
|
4
4
|
export declare const JsonObjectSchema: Schema.$Record<Schema.String, Schema.Codec<Json, Json, never, never>>;
|
|
5
5
|
export type JsonObject = typeof JsonObjectSchema.Type;
|
|
6
6
|
type HttpBoundaryError = ErrorOptions["cause"];
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Schema,
|
|
9
9
|
SchemaRepresentation
|
|
10
10
|
} from "effect";
|
|
11
|
-
import { HttpApi, OpenApi } from "effect/
|
|
11
|
+
import { HttpApi, OpenApi } from "effect/http-api";
|
|
12
12
|
var JsonObjectSchema = Schema.Record(Schema.String, Schema.Json).annotate({
|
|
13
13
|
identifier: "HttpJsonObject",
|
|
14
14
|
title: "HTTP JSON object",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
import { McpSchema, McpServer } from "effect/
|
|
2
|
+
import { McpSchema, McpServer } from "effect/ai";
|
|
3
3
|
import { ApiClient } from "./httpapi-client.js";
|
|
4
4
|
import { HttpApiSpec } from "./httpapi-helpers.js";
|
|
5
5
|
export type HttpApiMcpConfig = {
|
|
@@ -16,5 +16,5 @@ export declare class HttpApiMcp extends HttpApiMcp_base {
|
|
|
16
16
|
static readonly layer: (config: HttpApiMcpConfig) => Layer.Layer<HttpApiMcp, never, ApiClient | HttpApiSpec>;
|
|
17
17
|
}
|
|
18
18
|
export declare const httpApiMcpToolsLayer: Layer.Layer<never, Error, HttpApiMcp | McpServer.McpServer>;
|
|
19
|
-
export declare const httpApiMcpServerLayer: (path: Parameters<typeof McpServer.layerHttp>[0]["path"]) => Layer.Layer<McpServer.McpServer | McpSchema.McpServerClient, import("effect/Cause").IllegalArgumentError, HttpApiSpec | import("effect/
|
|
19
|
+
export declare const httpApiMcpServerLayer: (path: Parameters<typeof McpServer.layerHttp>[0]["path"]) => Layer.Layer<McpServer.McpServer | McpSchema.McpServerClient, import("effect/Cause").IllegalArgumentError, HttpApiSpec | import("effect/http/HttpRouter").HttpRouter>;
|
|
20
20
|
export {};
|
package/dist/lib/httpapi-mcp.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// ../../src/lib/httpapi-mcp.ts
|
|
2
2
|
import { Context as Context3, Effect as Effect3, Layer as Layer3, Option as Option2, Schema as Schema3 } from "effect";
|
|
3
|
-
import { McpProtocol, McpSchema, McpServer } from "effect/
|
|
3
|
+
import { McpProtocol, McpSchema, McpServer } from "effect/ai";
|
|
4
4
|
|
|
5
5
|
// ../../src/lib/httpapi-client.ts
|
|
6
6
|
import { Context, Effect, Layer, Schema, SchemaTransformation } from "effect";
|
|
7
|
-
import { HttpClient } from "effect/
|
|
7
|
+
import { HttpClient } from "effect/http";
|
|
8
8
|
import {
|
|
9
9
|
HttpApi,
|
|
10
10
|
HttpApiClient as EffectHttpApiClient,
|
|
11
11
|
OpenApi
|
|
12
|
-
} from "effect/
|
|
12
|
+
} from "effect/http-api";
|
|
13
13
|
var UndefinedFromNull = Schema.Null.pipe(Schema.decodeTo(Schema.Undefined, SchemaTransformation.transform({
|
|
14
14
|
decode: () => {
|
|
15
15
|
return;
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
Schema as Schema2,
|
|
120
120
|
SchemaRepresentation
|
|
121
121
|
} from "effect";
|
|
122
|
-
import { HttpApi as HttpApi2, OpenApi as OpenApi2 } from "effect/
|
|
122
|
+
import { HttpApi as HttpApi2, OpenApi as OpenApi2 } from "effect/http-api";
|
|
123
123
|
var JsonObjectSchema = Schema2.Record(Schema2.String, Schema2.Json).annotate({
|
|
124
124
|
identifier: "HttpJsonObject",
|
|
125
125
|
title: "HTTP JSON object",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Layer, Schema } from "effect";
|
|
2
2
|
import type { Json } from "effect/Schema";
|
|
3
|
-
import { Tool, Toolkit } from "effect/
|
|
3
|
+
import { Tool, Toolkit } from "effect/ai";
|
|
4
4
|
import { ApiClient } from "./httpapi-client.js";
|
|
5
5
|
import { HttpApiSpec, type HttpApiOperationEntry } from "./httpapi-helpers.js";
|
|
6
6
|
export type HttpApiToolkitConfig = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// ../../src/lib/httpapi-toolkit.ts
|
|
2
2
|
import { Effect as Effect3, Layer as Layer3, Schema as Schema3 } from "effect";
|
|
3
|
-
import { Tool, Toolkit } from "effect/
|
|
3
|
+
import { Tool, Toolkit } from "effect/ai";
|
|
4
4
|
|
|
5
5
|
// ../../src/lib/httpapi-client.ts
|
|
6
6
|
import { Context, Effect, Layer, Schema, SchemaTransformation } from "effect";
|
|
7
|
-
import { HttpClient } from "effect/
|
|
7
|
+
import { HttpClient } from "effect/http";
|
|
8
8
|
import {
|
|
9
9
|
HttpApi,
|
|
10
10
|
HttpApiClient as EffectHttpApiClient,
|
|
11
11
|
OpenApi
|
|
12
|
-
} from "effect/
|
|
12
|
+
} from "effect/http-api";
|
|
13
13
|
var UndefinedFromNull = Schema.Null.pipe(Schema.decodeTo(Schema.Undefined, SchemaTransformation.transform({
|
|
14
14
|
decode: () => {
|
|
15
15
|
return;
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
Schema as Schema2,
|
|
120
120
|
SchemaRepresentation
|
|
121
121
|
} from "effect";
|
|
122
|
-
import { HttpApi as HttpApi2, OpenApi as OpenApi2 } from "effect/
|
|
122
|
+
import { HttpApi as HttpApi2, OpenApi as OpenApi2 } from "effect/http-api";
|
|
123
123
|
var JsonObjectSchema = Schema2.Record(Schema2.String, Schema2.Json).annotate({
|
|
124
124
|
identifier: "HttpJsonObject",
|
|
125
125
|
title: "HTTP JSON object",
|
package/dist/lib/query.js
CHANGED
|
@@ -25,7 +25,7 @@ var SortParam = Schema.Struct({
|
|
|
25
25
|
description: "Decoded sort parameter with a field id and direction.",
|
|
26
26
|
examples: [{ id: "publicName", direction: "asc" }]
|
|
27
27
|
}));
|
|
28
|
-
var SortParamFromString = Schema.String.pipe(Schema.decodeTo(SortParam, SchemaTransformation.
|
|
28
|
+
var SortParamFromString = Schema.String.pipe(Schema.decodeTo(SortParam, SchemaTransformation.transformEffect({
|
|
29
29
|
decode: (sort) => {
|
|
30
30
|
const sortParam = parseSortParam(sort);
|
|
31
31
|
if (!sortParam) {
|
|
@@ -40,7 +40,7 @@ var SortParamFromString = Schema.String.pipe(Schema.decodeTo(SortParam, SchemaTr
|
|
|
40
40
|
description: 'URL encoded single sort parameter where descending fields are prefixed with "-".',
|
|
41
41
|
examples: [{ id: "publicName", direction: "asc" }]
|
|
42
42
|
}));
|
|
43
|
-
var SortParamsFromString = Schema.String.pipe(Schema.decodeTo(Schema.Array(SortParam), SchemaTransformation.
|
|
43
|
+
var SortParamsFromString = Schema.String.pipe(Schema.decodeTo(Schema.Array(SortParam), SchemaTransformation.transformEffect({
|
|
44
44
|
decode: (sort) => {
|
|
45
45
|
if (sort === "")
|
|
46
46
|
return Effect.succeed([]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { HttpClient } from "effect/
|
|
3
|
-
import { Tool, Toolkit } from "effect/
|
|
2
|
+
import { HttpClient } from "effect/http";
|
|
3
|
+
import { Tool, Toolkit } from "effect/ai";
|
|
4
4
|
import { FileExtractionService } from "../services/file-extraction/index.js";
|
|
5
5
|
export declare const WebFetchToolkitOptions: Schema.Struct<{
|
|
6
6
|
readonly maxResponseBytes: Schema.Int;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ../../src/lib/webfetch-toolkit.ts
|
|
2
2
|
import { Effect as Effect2, Option, Schema as Schema2 } from "effect";
|
|
3
|
-
import { HttpClient, HttpClientRequest } from "effect/
|
|
4
|
-
import { Tool, Toolkit } from "effect/
|
|
3
|
+
import { HttpClient, HttpClientRequest } from "effect/http";
|
|
4
|
+
import { Tool, Toolkit } from "effect/ai";
|
|
5
5
|
|
|
6
6
|
// ../../src/services/file-extraction/index.ts
|
|
7
7
|
import { extractBatch, ExtractInputKind, OutputFormat } from "@xberg-io/xberg";
|
|
@@ -174,7 +174,7 @@ var WebFetchRequest = Schema2.Struct({
|
|
|
174
174
|
var WebFetchResponse = Schema2.Struct({
|
|
175
175
|
url: WebFetchUrl,
|
|
176
176
|
contentType: SupportedMediaType,
|
|
177
|
-
content: Schema2.String.check(Schema2.
|
|
177
|
+
content: Schema2.String.check(Schema2.isBetweenLength(1, MAX_CONTENT_CHARACTERS)),
|
|
178
178
|
truncated: Schema2.Boolean
|
|
179
179
|
}).annotate({
|
|
180
180
|
identifier: "WebFetchResponse",
|
|
@@ -188,7 +188,7 @@ var WebFetchFailure = Schema2.Struct({
|
|
|
188
188
|
"unavailable",
|
|
189
189
|
"unsupported-content"
|
|
190
190
|
]),
|
|
191
|
-
message: Schema2.String.check(Schema2.
|
|
191
|
+
message: Schema2.String.check(Schema2.isBetweenLength(1, 500))
|
|
192
192
|
}).annotate({
|
|
193
193
|
identifier: "WebFetchFailure",
|
|
194
194
|
title: "Web fetch failure",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Option, Stream } from "effect";
|
|
2
|
-
import { Atom, Reactivity } from "effect/
|
|
2
|
+
import { Atom, Reactivity } from "effect/reactivity";
|
|
3
3
|
import type { AgentErrorCode, AgentEvent, AgentReference, AgentRequest } from "../schema.js";
|
|
4
4
|
export type AgentToolStatus = "running" | "approval-required" | "approved" | "denied" | "completed" | "failed";
|
|
5
5
|
export type AgentToolActivity = Extract<AgentEvent, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// ../../src/services/agent/client/atom.ts
|
|
2
2
|
import { Effect, Layer, Option, Schema, Stream } from "effect";
|
|
3
|
-
import { Atom } from "effect/
|
|
3
|
+
import { Atom } from "effect/reactivity";
|
|
4
4
|
var initialAgentState = {
|
|
5
5
|
context: undefined,
|
|
6
6
|
contextLocked: false,
|
|
@@ -1136,13 +1136,13 @@ import {
|
|
|
1136
1136
|
HttpApiGroup,
|
|
1137
1137
|
HttpApiSchema,
|
|
1138
1138
|
OpenApi
|
|
1139
|
-
} from "effect/
|
|
1140
|
-
var AgentMessageText = Schema2.String.check(Schema2.
|
|
1139
|
+
} from "effect/http-api";
|
|
1140
|
+
var AgentMessageText = Schema2.String.check(Schema2.isBetweenLength(1, 4000)).annotate({
|
|
1141
1141
|
identifier: "AgentMessageText",
|
|
1142
1142
|
title: "Agent message",
|
|
1143
1143
|
description: "A user message sent to the agent."
|
|
1144
1144
|
});
|
|
1145
|
-
var AgentReferenceLabel = Schema2.String.check(Schema2.
|
|
1145
|
+
var AgentReferenceLabel = Schema2.String.check(Schema2.isBetweenLength(1, 500));
|
|
1146
1146
|
var AGENT_REFERENCE_LIMIT = 20;
|
|
1147
1147
|
var AgentToolMetadata = Schema2.Struct({
|
|
1148
1148
|
title: Schema2.optional(Schema2.String),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Schema, Stream } from "effect";
|
|
2
|
-
import { LanguageModel, Tool, Toolkit } from "effect/
|
|
2
|
+
import { LanguageModel, Tool, Toolkit } from "effect/ai";
|
|
3
3
|
import type { AgentAction } from "./schema.js";
|
|
4
4
|
export type AgentStreamOptions<Tools extends Record<string, Tool.Any>> = {
|
|
5
5
|
readonly action: AgentAction;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
LanguageModel,
|
|
15
15
|
Prompt,
|
|
16
16
|
Tool
|
|
17
|
-
} from "effect/
|
|
17
|
+
} from "effect/ai";
|
|
18
18
|
|
|
19
19
|
// ../../src/lib/markdown/server.ts
|
|
20
20
|
var escapeHtml = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, HttpApiSchema } from "effect/
|
|
2
|
+
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
3
3
|
export declare const AGENT_REFERENCE_LIMIT = 20;
|
|
4
4
|
export type AgentReference<Resource> = {
|
|
5
5
|
readonly label: string;
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
HttpApiGroup,
|
|
7
7
|
HttpApiSchema,
|
|
8
8
|
OpenApi
|
|
9
|
-
} from "effect/
|
|
10
|
-
var AgentMessageText = Schema.String.check(Schema.
|
|
9
|
+
} from "effect/http-api";
|
|
10
|
+
var AgentMessageText = Schema.String.check(Schema.isBetweenLength(1, 4000)).annotate({
|
|
11
11
|
identifier: "AgentMessageText",
|
|
12
12
|
title: "Agent message",
|
|
13
13
|
description: "A user message sent to the agent."
|
|
14
14
|
});
|
|
15
|
-
var AgentReferenceLabel = Schema.String.check(Schema.
|
|
15
|
+
var AgentReferenceLabel = Schema.String.check(Schema.isBetweenLength(1, 500));
|
|
16
16
|
var AGENT_REFERENCE_LIMIT = 20;
|
|
17
17
|
var makeAgentReference = (resource) => Schema.Struct({
|
|
18
18
|
label: AgentReferenceLabel,
|