@toon-protocol/views 0.2.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/dist/a2ui/A2UIRenderer.d.ts +47 -0
- package/dist/a2ui/A2UIRenderer.d.ts.map +1 -0
- package/dist/a2ui/A2UIRenderer.js +106 -0
- package/dist/a2ui/A2UIRenderer.js.map +1 -0
- package/dist/a2ui/binding.d.ts +46 -0
- package/dist/a2ui/binding.d.ts.map +1 -0
- package/dist/a2ui/binding.js +111 -0
- package/dist/a2ui/binding.js.map +1 -0
- package/dist/a2ui/index.d.ts +17 -0
- package/dist/a2ui/index.d.ts.map +1 -0
- package/dist/a2ui/index.js +17 -0
- package/dist/a2ui/index.js.map +1 -0
- package/dist/a2ui/types.d.ts +101 -0
- package/dist/a2ui/types.d.ts.map +1 -0
- package/dist/a2ui/types.js +64 -0
- package/dist/a2ui/types.js.map +1 -0
- package/dist/a2ui/validate.d.ts +55 -0
- package/dist/a2ui/validate.d.ts.map +1 -0
- package/dist/a2ui/validate.js +117 -0
- package/dist/a2ui/validate.js.map +1 -0
- package/dist/app/index.html +246 -0
- package/dist/app-bridge/ext-apps-bridge.d.ts +16 -0
- package/dist/app-bridge/ext-apps-bridge.d.ts.map +1 -0
- package/dist/app-bridge/ext-apps-bridge.js +66 -0
- package/dist/app-bridge/ext-apps-bridge.js.map +1 -0
- package/dist/app-bridge/types.d.ts +41 -0
- package/dist/app-bridge/types.d.ts.map +1 -0
- package/dist/app-bridge/types.js +10 -0
- package/dist/app-bridge/types.js.map +1 -0
- package/dist/app-entry.d.ts +13 -0
- package/dist/app-entry.d.ts.map +1 -0
- package/dist/app-entry.js +45 -0
- package/dist/app-entry.js.map +1 -0
- package/dist/atoms/defi.d.ts +3 -0
- package/dist/atoms/defi.d.ts.map +1 -0
- package/dist/atoms/defi.js +80 -0
- package/dist/atoms/defi.js.map +1 -0
- package/dist/atoms/fallback.d.ts +4 -0
- package/dist/atoms/fallback.d.ts.map +1 -0
- package/dist/atoms/fallback.js +15 -0
- package/dist/atoms/fallback.js.map +1 -0
- package/dist/atoms/forge.d.ts +3 -0
- package/dist/atoms/forge.d.ts.map +1 -0
- package/dist/atoms/forge.js +50 -0
- package/dist/atoms/forge.js.map +1 -0
- package/dist/atoms/interactive.d.ts +3 -0
- package/dist/atoms/interactive.d.ts.map +1 -0
- package/dist/atoms/interactive.js +99 -0
- package/dist/atoms/interactive.js.map +1 -0
- package/dist/atoms/layout.d.ts +3 -0
- package/dist/atoms/layout.d.ts.map +1 -0
- package/dist/atoms/layout.js +22 -0
- package/dist/atoms/layout.js.map +1 -0
- package/dist/atoms/media.d.ts +3 -0
- package/dist/atoms/media.d.ts.map +1 -0
- package/dist/atoms/media.js +92 -0
- package/dist/atoms/media.js.map +1 -0
- package/dist/atoms/onboard.d.ts +3 -0
- package/dist/atoms/onboard.d.ts.map +1 -0
- package/dist/atoms/onboard.js +26 -0
- package/dist/atoms/onboard.js.map +1 -0
- package/dist/atoms/registry.d.ts +35 -0
- package/dist/atoms/registry.d.ts.map +1 -0
- package/dist/atoms/registry.js +77 -0
- package/dist/atoms/registry.js.map +1 -0
- package/dist/atoms/social.d.ts +3 -0
- package/dist/atoms/social.d.ts.map +1 -0
- package/dist/atoms/social.js +52 -0
- package/dist/atoms/social.js.map +1 -0
- package/dist/atoms/types.d.ts +72 -0
- package/dist/atoms/types.d.ts.map +1 -0
- package/dist/atoms/types.js +11 -0
- package/dist/atoms/types.js.map +1 -0
- package/dist/catalog.d.ts +27 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +121 -0
- package/dist/catalog.js.map +1 -0
- package/dist/components/mono-id.d.ts +16 -0
- package/dist/components/mono-id.d.ts.map +1 -0
- package/dist/components/mono-id.js +18 -0
- package/dist/components/mono-id.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +25 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +37 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +8 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +9 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +8 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/examples.d.ts +39 -0
- package/dist/examples.d.ts.map +1 -0
- package/dist/examples.js +168 -0
- package/dist/examples.js.map +1 -0
- package/dist/filters.d.ts +40 -0
- package/dist/filters.d.ts.map +1 -0
- package/dist/filters.js +84 -0
- package/dist/filters.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +7 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +7 -0
- package/dist/main.js.map +1 -0
- package/dist/mcp-ui/ConsentPrompt.d.ts +41 -0
- package/dist/mcp-ui/ConsentPrompt.d.ts.map +1 -0
- package/dist/mcp-ui/ConsentPrompt.js +45 -0
- package/dist/mcp-ui/ConsentPrompt.js.map +1 -0
- package/dist/mcp-ui/SandboxedAppRenderer.d.ts +54 -0
- package/dist/mcp-ui/SandboxedAppRenderer.d.ts.map +1 -0
- package/dist/mcp-ui/SandboxedAppRenderer.js +74 -0
- package/dist/mcp-ui/SandboxedAppRenderer.js.map +1 -0
- package/dist/mcp-ui/index.d.ts +18 -0
- package/dist/mcp-ui/index.d.ts.map +1 -0
- package/dist/mcp-ui/index.js +18 -0
- package/dist/mcp-ui/index.js.map +1 -0
- package/dist/mcp-ui/sandbox.d.ts +62 -0
- package/dist/mcp-ui/sandbox.d.ts.map +1 -0
- package/dist/mcp-ui/sandbox.js +78 -0
- package/dist/mcp-ui/sandbox.js.map +1 -0
- package/dist/parsers/media.d.ts +68 -0
- package/dist/parsers/media.d.ts.map +1 -0
- package/dist/parsers/media.js +124 -0
- package/dist/parsers/media.js.map +1 -0
- package/dist/parsers/nip34.d.ts +75 -0
- package/dist/parsers/nip34.d.ts.map +1 -0
- package/dist/parsers/nip34.js +142 -0
- package/dist/parsers/nip34.js.map +1 -0
- package/dist/parsers/social.d.ts +89 -0
- package/dist/parsers/social.d.ts.map +1 -0
- package/dist/parsers/social.js +136 -0
- package/dist/parsers/social.js.map +1 -0
- package/dist/render/node-shims/node-builtins.d.ts +30 -0
- package/dist/render/node-shims/node-builtins.d.ts.map +1 -0
- package/dist/render/node-shims/node-builtins.js +38 -0
- package/dist/render/node-shims/node-builtins.js.map +1 -0
- package/dist/render/resolve.d.ts +72 -0
- package/dist/render/resolve.d.ts.map +1 -0
- package/dist/render/resolve.js +115 -0
- package/dist/render/resolve.js.map +1 -0
- package/dist/runtime.d.ts +17 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +218 -0
- package/dist/runtime.js.map +1 -0
- package/dist/server/apps-server.d.ts +32 -0
- package/dist/server/apps-server.d.ts.map +1 -0
- package/dist/server/apps-server.js +163 -0
- package/dist/server/apps-server.js.map +1 -0
- package/dist/server/backend.d.ts +148 -0
- package/dist/server/backend.d.ts.map +1 -0
- package/dist/server/backend.js +11 -0
- package/dist/server/backend.js.map +1 -0
- package/dist/server/daemon-backend.d.ts +113 -0
- package/dist/server/daemon-backend.d.ts.map +1 -0
- package/dist/server/daemon-backend.js +79 -0
- package/dist/server/daemon-backend.js.map +1 -0
- package/dist/server/daemon-main.d.ts +25 -0
- package/dist/server/daemon-main.d.ts.map +1 -0
- package/dist/server/daemon-main.js +165 -0
- package/dist/server/daemon-main.js.map +1 -0
- package/dist/server/fake-backend.d.ts +53 -0
- package/dist/server/fake-backend.d.ts.map +1 -0
- package/dist/server/fake-backend.js +157 -0
- package/dist/server/fake-backend.js.map +1 -0
- package/dist/server/fake-main.d.ts +15 -0
- package/dist/server/fake-main.d.ts.map +1 -0
- package/dist/server/fake-main.js +39 -0
- package/dist/server/fake-main.js.map +1 -0
- package/dist/spec.d.ts +67 -0
- package/dist/spec.d.ts.map +1 -0
- package/dist/spec.js +221 -0
- package/dist/spec.js.map +1 -0
- package/dist/tool-names.d.ts +27 -0
- package/dist/tool-names.d.ts.map +1 -0
- package/dist/tool-names.js +32 -0
- package/dist/tool-names.js.map +1 -0
- package/dist/types.d.ts +39 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +20 -0
- package/dist/types.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* MonoId — renders a protocol address (pubkey, event ID, channel ID) as a
|
|
4
|
+
* bold·dim·bold split so the head and tail read as distinct identity markers.
|
|
5
|
+
*
|
|
6
|
+
* npub1abc1234…ef56 → [bold: npub1abc] [dim: …] [bold: ef56]
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { cn } from '@/lib/utils.js';
|
|
10
|
+
export function MonoId({ value, prefixLen = 8, suffixLen = 4, className }) {
|
|
11
|
+
if (value.length <= prefixLen + suffixLen + 1) {
|
|
12
|
+
return _jsx("span", { className: cn('font-mono text-xs', className), children: value });
|
|
13
|
+
}
|
|
14
|
+
const prefix = value.slice(0, prefixLen);
|
|
15
|
+
const suffix = value.slice(-suffixLen);
|
|
16
|
+
return (_jsxs("span", { className: cn('font-mono text-xs', className), children: [_jsx("span", { className: "font-semibold", children: prefix }), _jsx("span", { className: "text-muted-foreground select-none", children: "\u2026" }), _jsx("span", { className: "font-semibold", children: suffix })] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=mono-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mono-id.js","sourceRoot":"","sources":["../../src/components/mono-id.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AASpC,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,SAAS,EAAe;IACpF,IAAI,KAAK,CAAC,MAAM,IAAI,SAAS,GAAG,SAAS,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO,eAAM,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,YAAG,KAAK,GAAQ,CAAC;IAC7E,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC;IACvC,OAAO,CACL,gBAAM,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,aACjD,eAAM,SAAS,EAAC,eAAe,YAAE,MAAM,GAAQ,EAC/C,eAAM,SAAS,EAAC,mCAAmC,uBAAS,EAC5D,eAAM,SAAS,EAAC,eAAe,YAAE,MAAM,GAAQ,IAC1C,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
3
|
+
declare function Avatar({ className, size, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
4
|
+
size?: "default" | "sm" | "lg";
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): React.JSX.Element;
|
|
7
|
+
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): React.JSX.Element;
|
|
8
|
+
declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
9
|
+
declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
|
|
12
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAAG;IACrD,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;CAC/B,qBAYA;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAWpD;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC,qBAWvD;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAczE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWxE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAW7B;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,WAAW,GACZ,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
function Avatar({ className, size = "default", ...props }) {
|
|
7
|
+
return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function AvatarImage({ className, ...props }) {
|
|
10
|
+
return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn("aspect-square size-full rounded-full object-cover", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function AvatarFallback({ className, ...props }) {
|
|
13
|
+
return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function AvatarBadge({ className, ...props }) {
|
|
16
|
+
return (_jsx("span", { "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function AvatarGroup({ className, ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "avatar-group", className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function AvatarGroupCount({ className, ...props }) {
|
|
22
|
+
return (_jsx("div", { "data-slot": "avatar-group-count", className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
|
|
25
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,E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2BACY,oBAAoB,EAC9B,SAAS,EAAE,EAAE,CACX,0VAA0V,EAC1V,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,WAAW,GACZ,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
10
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,aAAa;;8EAqBlB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAmB,EACnB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAC7B,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,qBAW3D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { Slot } from "radix-ui";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
10
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
11
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
12
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
function Badge({ className, variant = "default", asChild = false, ...props }) {
|
|
22
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
23
|
+
return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
export { Badge, badgeVariants };
|
|
26
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,aAAa,GAAG,GAAG,CACvB,4eAA4e,EAC5e;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,4DAA4D;YACrE,SAAS,EACP,kEAAkE;YACpE,WAAW,EACT,gKAAgK;YAClK,OAAO,EACL,kFAAkF;YACpF,KAAK,EACH,mEAAmE;YACrE,IAAI,EAAE,iDAAiD;SACxD;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAA;AAED,SAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EAEkD;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAA;IAEzC,OAAO,CACL,KAAC,IAAI,iBACO,OAAO,kBACH,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
11
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,cAAc;;;8EAmCnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,qBAYF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { Slot } from "radix-ui";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
10
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
13
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
18
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
19
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
20
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
21
|
+
icon: "size-8",
|
|
22
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
23
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
24
|
+
"icon-lg": "size-9",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default",
|
|
29
|
+
size: "default",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
33
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
34
|
+
return (_jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
35
|
+
}
|
|
36
|
+
export { Button, buttonVariants };
|
|
37
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,cAAc,GAAG,GAAG,CACxB,4lBAA4lB,EAC5lB;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,wDAAwD;YACjE,OAAO,EACL,iLAAiL;YACnL,SAAS,EACP,gLAAgL;YAClL,KAAK,EACH,kHAAkH;YACpH,WAAW,EACT,6NAA6N;YAC/N,IAAI,EAAE,iDAAiD;SACxD;QACD,IAAI,EAAE;YACJ,OAAO,EACL,sFAAsF;YACxF,EAAE,EAAE,+MAA+M;YACnN,EAAE,EAAE,yNAAyN;YAC7N,EAAE,EAAE,sFAAsF;YAC1F,IAAI,EAAE,QAAQ;YACd,SAAS,EACP,yHAAyH;YAC3H,SAAS,EACP,oFAAoF;YACtF,SAAS,EAAE,QAAQ;SACpB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAA;AAED,SAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EAIP;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3C,OAAO,CACL,KAAC,IAAI,iBACO,QAAQ,kBACJ,OAAO,eACV,IAAI,EACf,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KACvD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBAY1E;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
function Input({ className, type, ...props }) {
|
|
5
|
+
return (_jsx("input", { type: type, "data-slot": "input", className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
export { Input };
|
|
8
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiC;IACzE,OAAO,CACL,gBACE,IAAI,EAAE,IAAI,eACA,OAAO,EACjB,SAAS,EAAE,EAAE,CACX,6oBAA6oB,EAC7oB,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
export { Separator };
|
|
5
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../src/components/ui/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAI1D,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAA0B,EAC1B,UAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,qBAatD;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
6
|
+
return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
export { Separator };
|
|
9
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","sourceRoot":"","sources":["../../../src/components/ui/separator.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE1D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,SAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,UAAU,GAAG,IAAI,EACjB,GAAG,KAAK,EAC6C;IACrD,OAAO,CACL,KAAC,kBAAkB,CAAC,IAAI,iBACZ,WAAW,EACrB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CACX,8GAA8G,EAC9G,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/ui/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,qBAW1E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
function Textarea({ className, ...props }) {
|
|
5
|
+
return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
export { Textarea };
|
|
8
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/ui/textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoC;IACzE,OAAO,CACL,gCACY,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,whBAAwhB,EACxhB,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example ViewSpecs — reference compositions the agent can learn from (surfaced
|
|
3
|
+
* in the `toon_atoms` tool result) and reuse as journey starting points.
|
|
4
|
+
*
|
|
5
|
+
* These are plain data (Node-safe). They demonstrate the grammar: layout atoms
|
|
6
|
+
* arranging domain atoms, `bind` for free reads, `kindAuto` feeds, and `actions`
|
|
7
|
+
* wiring write tools.
|
|
8
|
+
*/
|
|
9
|
+
import { type ViewSpec } from './spec.js';
|
|
10
|
+
/** A social feed: composer to post + a kindAuto note feed. */
|
|
11
|
+
export declare function feedView(): ViewSpec;
|
|
12
|
+
/**
|
|
13
|
+
* The headline pay-to-write journey: a `pay-confirm` atom that previews the
|
|
14
|
+
* note, shows the live fee + settlement chain (pulled from `toon_status`), and
|
|
15
|
+
* on Confirm fires `toon_publish_unsigned` and renders the receipt with the real
|
|
16
|
+
* eventId — "the message is the money". Below it, the live note feed so the
|
|
17
|
+
* just-posted note shows up.
|
|
18
|
+
*/
|
|
19
|
+
export declare function payToWriteView(): ViewSpec;
|
|
20
|
+
/** A profile page: header + follow button + that author's notes. */
|
|
21
|
+
export declare function profileView(pubkey: string): ViewSpec;
|
|
22
|
+
/** A thread: the root note, its replies, and a reply composer. */
|
|
23
|
+
export declare function threadView(rootId: string): ViewSpec;
|
|
24
|
+
/** A forge view: repo list, then issues for a repo. */
|
|
25
|
+
export declare function forgeView(ownerPubkey: string, repoId: string): ViewSpec;
|
|
26
|
+
/** A media gallery + uploader. */
|
|
27
|
+
export declare function mediaView(): ViewSpec;
|
|
28
|
+
/** An onboarding journey: get-started card + the new user's profile header. */
|
|
29
|
+
export declare function onboardView(pubkey: string): ViewSpec;
|
|
30
|
+
/** A DeFi panel: pre-open a channel, run a swap, show the settlement receipt. */
|
|
31
|
+
export declare function swapView(): ViewSpec;
|
|
32
|
+
export interface ExampleView {
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
spec: ViewSpec;
|
|
36
|
+
}
|
|
37
|
+
/** Concrete examples (with placeholder ids) for the agent to pattern-match on. */
|
|
38
|
+
export declare const EXAMPLE_VIEWSPECS: ExampleView[];
|
|
39
|
+
//# sourceMappingURL=examples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"examples.d.ts","sourceRoot":"","sources":["../src/examples.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAY1C,8DAA8D;AAC9D,wBAAgB,QAAQ,IAAI,QAAQ,CAWnC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CAezC;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAgBpD;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAgBnD;AAED,uDAAuD;AACvD,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAsBvE;AAED,kCAAkC;AAClC,wBAAgB,SAAS,IAAI,QAAQ,CAWpC;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAepD;AAED,iFAAiF;AACjF,wBAAgB,QAAQ,IAAI,QAAQ,CAiBnC;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,EAAE,WAAW,EAS1C,CAAC"}
|
package/dist/examples.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example ViewSpecs — reference compositions the agent can learn from (surfaced
|
|
3
|
+
* in the `toon_atoms` tool result) and reuse as journey starting points.
|
|
4
|
+
*
|
|
5
|
+
* These are plain data (Node-safe). They demonstrate the grammar: layout atoms
|
|
6
|
+
* arranging domain atoms, `bind` for free reads, `kindAuto` feeds, and `actions`
|
|
7
|
+
* wiring write tools.
|
|
8
|
+
*/
|
|
9
|
+
import {} from './spec.js';
|
|
10
|
+
import { buildFeedFilter, buildProfileFilter, buildRepoListFilter, buildIssueListFilter, buildCommentFilter, buildEventByIdFilter, buildMediaFeedFilter, } from './filters.js';
|
|
11
|
+
import { OPEN_CHANNEL_TOOL, PUBLISH_TOOL, SWAP_TOOL, UPLOAD_TOOL } from './tool-names.js';
|
|
12
|
+
/** A social feed: composer to post + a kindAuto note feed. */
|
|
13
|
+
export function feedView() {
|
|
14
|
+
return {
|
|
15
|
+
title: 'Feed',
|
|
16
|
+
root: {
|
|
17
|
+
atom: 'stack',
|
|
18
|
+
children: [
|
|
19
|
+
{ atom: 'composer', actions: { post: { tool: PUBLISH_TOOL, args: { kind: 1 } } } },
|
|
20
|
+
{ atom: 'note-card', bind: { query: buildFeedFilter(undefined, 50), kindAuto: true } },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The headline pay-to-write journey: a `pay-confirm` atom that previews the
|
|
27
|
+
* note, shows the live fee + settlement chain (pulled from `toon_status`), and
|
|
28
|
+
* on Confirm fires `toon_publish_unsigned` and renders the receipt with the real
|
|
29
|
+
* eventId — "the message is the money". Below it, the live note feed so the
|
|
30
|
+
* just-posted note shows up.
|
|
31
|
+
*/
|
|
32
|
+
export function payToWriteView() {
|
|
33
|
+
return {
|
|
34
|
+
title: 'Pay to write',
|
|
35
|
+
root: {
|
|
36
|
+
atom: 'stack',
|
|
37
|
+
children: [
|
|
38
|
+
{
|
|
39
|
+
atom: 'pay-confirm',
|
|
40
|
+
props: { label: 'Pay to post' },
|
|
41
|
+
actions: { confirm: { tool: PUBLISH_TOOL, args: { kind: 1 } } },
|
|
42
|
+
},
|
|
43
|
+
{ atom: 'note-card', bind: { query: buildFeedFilter(undefined, 50), kindAuto: true } },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** A profile page: header + follow button + that author's notes. */
|
|
49
|
+
export function profileView(pubkey) {
|
|
50
|
+
return {
|
|
51
|
+
title: 'Profile',
|
|
52
|
+
root: {
|
|
53
|
+
atom: 'stack',
|
|
54
|
+
children: [
|
|
55
|
+
{ atom: 'profile-header', bind: { query: buildProfileFilter([pubkey]) } },
|
|
56
|
+
{
|
|
57
|
+
atom: 'follow-button',
|
|
58
|
+
props: { label: 'Follow' },
|
|
59
|
+
actions: { follow: { tool: PUBLISH_TOOL, args: { kind: 3, tags: [['p', pubkey]] } } },
|
|
60
|
+
},
|
|
61
|
+
{ atom: 'note-card', bind: { query: buildFeedFilter([pubkey], 50), kindAuto: true } },
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** A thread: the root note, its replies, and a reply composer. */
|
|
67
|
+
export function threadView(rootId) {
|
|
68
|
+
return {
|
|
69
|
+
title: 'Thread',
|
|
70
|
+
root: {
|
|
71
|
+
atom: 'stack',
|
|
72
|
+
children: [
|
|
73
|
+
{ atom: 'note-card', bind: { query: buildEventByIdFilter([rootId]), kindAuto: true } },
|
|
74
|
+
{ atom: 'note-card', bind: { query: buildCommentFilter([rootId]), kindAuto: true } },
|
|
75
|
+
{
|
|
76
|
+
atom: 'composer',
|
|
77
|
+
props: { placeholder: 'Reply…', label: 'Reply' },
|
|
78
|
+
actions: { post: { tool: PUBLISH_TOOL, args: { kind: 1, tags: [['e', rootId, '', 'root']] } } },
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** A forge view: repo list, then issues for a repo. */
|
|
85
|
+
export function forgeView(ownerPubkey, repoId) {
|
|
86
|
+
return {
|
|
87
|
+
title: 'Forge',
|
|
88
|
+
root: {
|
|
89
|
+
atom: 'tabs',
|
|
90
|
+
props: { labels: ['Repos', 'Issues'] },
|
|
91
|
+
children: [
|
|
92
|
+
{
|
|
93
|
+
atom: 'section',
|
|
94
|
+
props: { title: 'Repositories' },
|
|
95
|
+
children: [{ atom: 'repo-card', bind: { query: buildRepoListFilter(), kindAuto: true } }],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
atom: 'section',
|
|
99
|
+
props: { title: 'Issues' },
|
|
100
|
+
children: [
|
|
101
|
+
{ atom: 'issue-card', bind: { query: buildIssueListFilter(ownerPubkey, repoId), kindAuto: true } },
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** A media gallery + uploader. */
|
|
109
|
+
export function mediaView() {
|
|
110
|
+
return {
|
|
111
|
+
title: 'Media',
|
|
112
|
+
root: {
|
|
113
|
+
atom: 'stack',
|
|
114
|
+
children: [
|
|
115
|
+
{ atom: 'media-uploader', props: { label: 'Post a picture' }, actions: { upload: { tool: UPLOAD_TOOL, args: { kind: 20 }, spendy: true } } },
|
|
116
|
+
{ atom: 'media-embed', bind: { query: buildMediaFeedFilter(undefined, 30), kindAuto: true } },
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** An onboarding journey: get-started card + the new user's profile header. */
|
|
122
|
+
export function onboardView(pubkey) {
|
|
123
|
+
return {
|
|
124
|
+
title: 'Get started',
|
|
125
|
+
root: {
|
|
126
|
+
atom: 'stack',
|
|
127
|
+
children: [
|
|
128
|
+
{
|
|
129
|
+
atom: 'onboard-card',
|
|
130
|
+
props: { pubkey, label: 'Publish profile' },
|
|
131
|
+
actions: { publish: { tool: PUBLISH_TOOL, args: { kind: 0 } } },
|
|
132
|
+
},
|
|
133
|
+
{ atom: 'profile-header', bind: { query: buildProfileFilter([pubkey]) } },
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/** A DeFi panel: pre-open a channel, run a swap, show the settlement receipt. */
|
|
139
|
+
export function swapView() {
|
|
140
|
+
return {
|
|
141
|
+
title: 'Swap',
|
|
142
|
+
root: {
|
|
143
|
+
atom: 'tabs',
|
|
144
|
+
props: { labels: ['Channel', 'Swap', 'Receipt'] },
|
|
145
|
+
children: [
|
|
146
|
+
{ atom: 'channel-card', actions: { open: { tool: OPEN_CHANNEL_TOOL } } },
|
|
147
|
+
{
|
|
148
|
+
atom: 'swap-form',
|
|
149
|
+
props: { label: 'Swap' },
|
|
150
|
+
actions: { swap: { tool: SWAP_TOOL, spendy: true, confirmLabel: 'Confirm swap' } },
|
|
151
|
+
},
|
|
152
|
+
{ atom: 'settlement-receipt' },
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/** Concrete examples (with placeholder ids) for the agent to pattern-match on. */
|
|
158
|
+
export const EXAMPLE_VIEWSPECS = [
|
|
159
|
+
{ name: 'feed', description: 'Social feed with a post composer.', spec: feedView() },
|
|
160
|
+
{ name: 'pay-to-write', description: 'Compose → confirm fee/chain → publish → receipt (the message is the money).', spec: payToWriteView() },
|
|
161
|
+
{ name: 'profile', description: 'A profile header, follow button, and the author’s notes.', spec: profileView('<pubkey-hex>') },
|
|
162
|
+
{ name: 'thread', description: 'A note with its replies and a reply composer.', spec: threadView('<root-event-id>') },
|
|
163
|
+
{ name: 'forge', description: 'Tabbed repos + issues (NIP-34).', spec: forgeView('<owner-pubkey>', '<repo-id>') },
|
|
164
|
+
{ name: 'media', description: 'Media gallery with an uploader.', spec: mediaView() },
|
|
165
|
+
{ name: 'onboard', description: 'Get-started card + the new user’s profile header.', spec: onboardView('<pubkey-hex>') },
|
|
166
|
+
{ name: 'swap', description: 'Open a channel, run a swap, show the settlement receipt.', spec: swapView() },
|
|
167
|
+
];
|
|
168
|
+
//# sourceMappingURL=examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"examples.js","sourceRoot":"","sources":["../src/examples.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiB,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE1F,8DAA8D;AAC9D,MAAM,UAAU,QAAQ;IACtB,OAAO;QACL,KAAK,EAAE,MAAM;QACb,IAAI,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;gBAClF,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;aACvF;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;oBAC/B,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,EA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xH,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0DAA0D,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;CAC5G,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NIP-01 filter builders for the read side (all reads are free via `toon_read`).
|
|
3
|
+
*
|
|
4
|
+
* The forge builders are promoted from rig's `web/relay-client.ts`; the social
|
|
5
|
+
* and media builders are new. Pure functions returning {@link NostrFilter}.
|
|
6
|
+
*/
|
|
7
|
+
import { type NostrFilter } from './types.js';
|
|
8
|
+
/** kind:30617 repository announcements. */
|
|
9
|
+
export declare function buildRepoListFilter(): NostrFilter;
|
|
10
|
+
/** kind:30618 repository refs/state for one repo. */
|
|
11
|
+
export declare function buildRepoRefsFilter(pubkey: string, repoId: string): NostrFilter;
|
|
12
|
+
/** kind:1621 issues for a repository. */
|
|
13
|
+
export declare function buildIssueListFilter(ownerPubkey: string, repoId: string): NostrFilter;
|
|
14
|
+
/** kind:1617 patches/PRs for a repository. */
|
|
15
|
+
export declare function buildPRListFilter(ownerPubkey: string, repoId: string): NostrFilter;
|
|
16
|
+
/** kind:1622 comments by parent event id(s). */
|
|
17
|
+
export declare function buildCommentFilter(eventIds: string[]): NostrFilter;
|
|
18
|
+
/** kind:1630-1633 status events by referenced event id(s). */
|
|
19
|
+
export declare function buildStatusFilter(eventIds: string[]): NostrFilter;
|
|
20
|
+
/** kind:1632 issue-close events by issue event id(s). */
|
|
21
|
+
export declare function buildIssueCloseFilter(eventIds: string[]): NostrFilter;
|
|
22
|
+
/** Fetch specific events by id. */
|
|
23
|
+
export declare function buildEventByIdFilter(eventIds: string[]): NostrFilter;
|
|
24
|
+
/** kind:0 profile metadata for the given pubkeys. */
|
|
25
|
+
export declare function buildProfileFilter(pubkeys: string[]): NostrFilter;
|
|
26
|
+
/** kind:1 text-note feed, optionally scoped to authors. */
|
|
27
|
+
export declare function buildFeedFilter(authors?: string[], limit?: number): NostrFilter;
|
|
28
|
+
/** kind:1 replies referencing the given note id(s) (NIP-10 thread). */
|
|
29
|
+
export declare function buildRepliesFilter(eventIds: string[]): NostrFilter;
|
|
30
|
+
/** kind:3 follow list for a pubkey. */
|
|
31
|
+
export declare function buildFollowListFilter(pubkey: string): NostrFilter;
|
|
32
|
+
/** kind:7 reactions targeting the given event id(s). */
|
|
33
|
+
export declare function buildReactionFilter(eventIds: string[]): NostrFilter;
|
|
34
|
+
/** kind:6/16 reposts targeting the given event id(s). */
|
|
35
|
+
export declare function buildRepostFilter(eventIds: string[]): NostrFilter;
|
|
36
|
+
/** kind:20/21/22 media posts, optionally scoped to authors. */
|
|
37
|
+
export declare function buildMediaFeedFilter(authors?: string[], limit?: number): NostrFilter;
|
|
38
|
+
/** kind:1063 NIP-94 file metadata, optionally scoped to authors. */
|
|
39
|
+
export declare function buildFileMetadataFilter(authors?: string[], limit?: number): NostrFilter;
|
|
40
|
+
//# sourceMappingURL=filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../src/filters.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,2CAA2C;AAC3C,wBAAgB,mBAAmB,IAAI,WAAW,CAEjD;AAED,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAE/E;AAED,yCAAyC;AACzC,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAErF;AAED,8CAA8C;AAC9C,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAElF;AAED,gDAAgD;AAChD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAElE;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAEjE;AAED,yDAAyD;AACzD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAErE;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAEpE;AAID,qDAAqD;AACrD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,CAEjE;AAED,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,SAAM,GAAG,WAAW,CAI5E;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAElE;AAED,uCAAuC;AACvC,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAEjE;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAEnE;AAED,yDAAyD;AACzD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAEjE;AAID,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,SAAM,GAAG,WAAW,CAIjF;AAED,oEAAoE;AACpE,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,SAAM,GAAG,WAAW,CAIpF"}
|
package/dist/filters.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NIP-01 filter builders for the read side (all reads are free via `toon_read`).
|
|
3
|
+
*
|
|
4
|
+
* The forge builders are promoted from rig's `web/relay-client.ts`; the social
|
|
5
|
+
* and media builders are new. Pure functions returning {@link NostrFilter}.
|
|
6
|
+
*/
|
|
7
|
+
import {} from './types.js';
|
|
8
|
+
// ── NIP-34 forge ───────────────────────────────────────────────────────────
|
|
9
|
+
/** kind:30617 repository announcements. */
|
|
10
|
+
export function buildRepoListFilter() {
|
|
11
|
+
return { kinds: [30617] };
|
|
12
|
+
}
|
|
13
|
+
/** kind:30618 repository refs/state for one repo. */
|
|
14
|
+
export function buildRepoRefsFilter(pubkey, repoId) {
|
|
15
|
+
return { kinds: [30618], authors: [pubkey], '#d': [repoId] };
|
|
16
|
+
}
|
|
17
|
+
/** kind:1621 issues for a repository. */
|
|
18
|
+
export function buildIssueListFilter(ownerPubkey, repoId) {
|
|
19
|
+
return { kinds: [1621], '#a': [`30617:${ownerPubkey}:${repoId}`], limit: 100 };
|
|
20
|
+
}
|
|
21
|
+
/** kind:1617 patches/PRs for a repository. */
|
|
22
|
+
export function buildPRListFilter(ownerPubkey, repoId) {
|
|
23
|
+
return { kinds: [1617], '#a': [`30617:${ownerPubkey}:${repoId}`], limit: 100 };
|
|
24
|
+
}
|
|
25
|
+
/** kind:1622 comments by parent event id(s). */
|
|
26
|
+
export function buildCommentFilter(eventIds) {
|
|
27
|
+
return { kinds: [1622], '#e': eventIds, limit: 500 };
|
|
28
|
+
}
|
|
29
|
+
/** kind:1630-1633 status events by referenced event id(s). */
|
|
30
|
+
export function buildStatusFilter(eventIds) {
|
|
31
|
+
return { kinds: [1630, 1631, 1632, 1633], '#e': eventIds, limit: 500 };
|
|
32
|
+
}
|
|
33
|
+
/** kind:1632 issue-close events by issue event id(s). */
|
|
34
|
+
export function buildIssueCloseFilter(eventIds) {
|
|
35
|
+
return { kinds: [1632], '#e': eventIds, limit: 500 };
|
|
36
|
+
}
|
|
37
|
+
/** Fetch specific events by id. */
|
|
38
|
+
export function buildEventByIdFilter(eventIds) {
|
|
39
|
+
return { ids: eventIds };
|
|
40
|
+
}
|
|
41
|
+
// ── Social (NIP-01/02/10/18/25) ──────────────────────────────────────────────
|
|
42
|
+
/** kind:0 profile metadata for the given pubkeys. */
|
|
43
|
+
export function buildProfileFilter(pubkeys) {
|
|
44
|
+
return { kinds: [0], authors: pubkeys };
|
|
45
|
+
}
|
|
46
|
+
/** kind:1 text-note feed, optionally scoped to authors. */
|
|
47
|
+
export function buildFeedFilter(authors, limit = 100) {
|
|
48
|
+
const f = { kinds: [1], limit };
|
|
49
|
+
if (authors && authors.length > 0)
|
|
50
|
+
f.authors = authors;
|
|
51
|
+
return f;
|
|
52
|
+
}
|
|
53
|
+
/** kind:1 replies referencing the given note id(s) (NIP-10 thread). */
|
|
54
|
+
export function buildRepliesFilter(eventIds) {
|
|
55
|
+
return { kinds: [1], '#e': eventIds, limit: 500 };
|
|
56
|
+
}
|
|
57
|
+
/** kind:3 follow list for a pubkey. */
|
|
58
|
+
export function buildFollowListFilter(pubkey) {
|
|
59
|
+
return { kinds: [3], authors: [pubkey], limit: 1 };
|
|
60
|
+
}
|
|
61
|
+
/** kind:7 reactions targeting the given event id(s). */
|
|
62
|
+
export function buildReactionFilter(eventIds) {
|
|
63
|
+
return { kinds: [7], '#e': eventIds, limit: 1000 };
|
|
64
|
+
}
|
|
65
|
+
/** kind:6/16 reposts targeting the given event id(s). */
|
|
66
|
+
export function buildRepostFilter(eventIds) {
|
|
67
|
+
return { kinds: [6, 16], '#e': eventIds, limit: 500 };
|
|
68
|
+
}
|
|
69
|
+
// ── Media (NIP-68/71/94) ─────────────────────────────────────────────────────
|
|
70
|
+
/** kind:20/21/22 media posts, optionally scoped to authors. */
|
|
71
|
+
export function buildMediaFeedFilter(authors, limit = 100) {
|
|
72
|
+
const f = { kinds: [20, 21, 22], limit };
|
|
73
|
+
if (authors && authors.length > 0)
|
|
74
|
+
f.authors = authors;
|
|
75
|
+
return f;
|
|
76
|
+
}
|
|
77
|
+
/** kind:1063 NIP-94 file metadata, optionally scoped to authors. */
|
|
78
|
+
export function buildFileMetadataFilter(authors, limit = 100) {
|
|
79
|
+
const f = { kinds: [1063], limit };
|
|
80
|
+
if (authors && authors.length > 0)
|
|
81
|
+
f.authors = authors;
|
|
82
|
+
return f;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=filters.js.map
|