@nxisai/agent-harness 0.4.0 → 0.5.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 +4 -2
- package/dist/harness/harness.d.ts.map +1 -1
- package/dist/harness/harness.js +31 -9
- package/dist/harness/harness.js.map +1 -1
- package/dist/harness/tools/action-tools.d.ts.map +1 -1
- package/dist/harness/tools/action-tools.js +7 -5
- package/dist/harness/tools/action-tools.js.map +1 -1
- package/dist/harness/tools/bridge.d.ts.map +1 -1
- package/dist/harness/tools/bridge.js +33 -12
- package/dist/harness/tools/bridge.js.map +1 -1
- package/dist/harness/tools/local-context.d.ts +49 -9
- package/dist/harness/tools/local-context.d.ts.map +1 -1
- package/dist/harness/tools/local-context.js +377 -22
- package/dist/harness/tools/local-context.js.map +1 -1
- package/dist/harness/tools/open-page.d.ts +47 -1
- package/dist/harness/tools/open-page.d.ts.map +1 -1
- package/dist/harness/tools/open-page.js +119 -33
- package/dist/harness/tools/open-page.js.map +1 -1
- package/dist/harness/tools/retry.d.ts +53 -0
- package/dist/harness/tools/retry.d.ts.map +1 -0
- package/dist/harness/tools/retry.js +96 -0
- package/dist/harness/tools/retry.js.map +1 -0
- package/dist/harness/tools/schema.d.ts +18 -0
- package/dist/harness/tools/schema.d.ts.map +1 -1
- package/dist/harness/tools/schema.js +38 -0
- package/dist/harness/tools/schema.js.map +1 -1
- package/dist/harness/tools/site-actions.d.ts.map +1 -1
- package/dist/harness/tools/site-actions.js +3 -2
- package/dist/harness/tools/site-actions.js.map +1 -1
- package/dist/harness/tools/site-nav.d.ts +168 -0
- package/dist/harness/tools/site-nav.d.ts.map +1 -0
- package/dist/harness/tools/site-nav.js +316 -0
- package/dist/harness/tools/site-nav.js.map +1 -0
- package/dist/harness/tools/site-pages.d.ts +9 -4
- package/dist/harness/tools/site-pages.d.ts.map +1 -1
- package/dist/harness/tools/site-pages.js +46 -7
- package/dist/harness/tools/site-pages.js.map +1 -1
- package/dist/harness/tools/source.d.ts +11 -2
- package/dist/harness/tools/source.d.ts.map +1 -1
- package/dist/harness/tools/source.js +55 -15
- package/dist/harness/tools/source.js.map +1 -1
- package/dist/harness/tools/webmcp.d.ts +39 -3
- package/dist/harness/tools/webmcp.d.ts.map +1 -1
- package/dist/harness/tools/webmcp.js +93 -14
- package/dist/harness/tools/webmcp.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/agent-fullscreen.d.ts.map +1 -1
- package/dist/ui/agent-fullscreen.js +13 -2
- package/dist/ui/agent-fullscreen.js.map +1 -1
- package/dist/ui/tailwind.generated.d.ts +1 -1
- package/dist/ui/tailwind.generated.d.ts.map +1 -1
- package/dist/ui/tailwind.generated.js +1 -1
- package/dist/ui/tailwind.generated.js.map +1 -1
- package/package.json +2 -1
- package/src/a2ui/cards.ts +177 -0
- package/src/a2ui/emit.ts +147 -0
- package/src/a2ui/form.ts +117 -0
- package/src/a2ui/host.ts +73 -0
- package/src/a2ui/index.ts +22 -0
- package/src/a2ui/stepper.ts +211 -0
- package/src/a2ui/theme.ts +134 -0
- package/src/a2ui/to-v09.ts +118 -0
- package/src/engine.ts +701 -0
- package/src/harness/harness.ts +956 -0
- package/src/harness/plan.ts +91 -0
- package/src/harness/policy.ts +59 -0
- package/src/harness/renderer.ts +208 -0
- package/src/harness/router/coordinator.ts +220 -0
- package/src/harness/router/rules.ts +65 -0
- package/src/harness/slots.ts +117 -0
- package/src/harness/steps.ts +156 -0
- package/src/harness/tools/action-tools.ts +870 -0
- package/src/harness/tools/bridge.ts +393 -0
- package/src/harness/tools/client.ts +26 -0
- package/src/harness/tools/discovery.ts +55 -0
- package/src/harness/tools/local-context.ts +480 -0
- package/src/harness/tools/open-page.ts +273 -0
- package/src/harness/tools/pending-action.ts +232 -0
- package/src/harness/tools/resume.ts +134 -0
- package/src/harness/tools/retry.ts +117 -0
- package/src/harness/tools/schema.ts +245 -0
- package/src/harness/tools/site-actions.ts +356 -0
- package/src/harness/tools/site-nav.ts +432 -0
- package/src/harness/tools/site-pages.ts +288 -0
- package/src/harness/tools/source.ts +353 -0
- package/src/harness/tools/webmcp.ts +200 -0
- package/src/index.ts +193 -0
- package/src/providers/capability.ts +167 -0
- package/src/providers/proxy.ts +191 -0
- package/src/providers/types.ts +150 -0
- package/src/types.ts +258 -0
- package/src/ui/agent-fullscreen.ts +3984 -0
- package/src/ui/agent.tw.css +49 -0
- package/src/ui/config.ts +138 -0
- package/src/ui/index.ts +32 -0
- package/src/ui/journey.ts +57 -0
- package/src/ui/tailwind.generated.ts +2 -0
- package/src/webmcp-contract.ts +65 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Tailwind for the agent's shadow DOM.
|
|
3
|
+
*
|
|
4
|
+
* Imported with `?inline` and injected into the shadow root — Tailwind's
|
|
5
|
+
* normal delivery (a stylesheet in document.head) cannot cross a shadow
|
|
6
|
+
* boundary, so utility classes on the agent's markup would otherwise do
|
|
7
|
+
* nothing at all.
|
|
8
|
+
*
|
|
9
|
+
* `@source` is explicit because the class names live inside TypeScript
|
|
10
|
+
* template literals rather than .html files; Tailwind's default detection
|
|
11
|
+
* would find none of them.
|
|
12
|
+
*/
|
|
13
|
+
@import "tailwindcss";
|
|
14
|
+
|
|
15
|
+
@source "./agent-fullscreen.ts";
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* The theme is the NxisAI design system (design.md §1–2), not Tailwind's
|
|
19
|
+
* defaults. Utilities therefore resolve to the brand palette — `bg-surface` is
|
|
20
|
+
* Soft Gray, `text-blue` is Signal Blue — and a stray `bg-blue-500` is
|
|
21
|
+
* visibly not part of the system rather than quietly close to it.
|
|
22
|
+
*/
|
|
23
|
+
@theme {
|
|
24
|
+
--color-bg: #FFFFFF;
|
|
25
|
+
--color-surface: #F5F7FB;
|
|
26
|
+
--color-surface-2: #EDF1F9;
|
|
27
|
+
--color-border-hair: #E4E9F2;
|
|
28
|
+
--color-border-strong: #CFD8E8;
|
|
29
|
+
--color-ink: #0F172A;
|
|
30
|
+
--color-ink-2: #475569;
|
|
31
|
+
--color-ink-3: #8A97AC;
|
|
32
|
+
--color-blue: #2563EB;
|
|
33
|
+
--color-blue-strong: #1D4ED8;
|
|
34
|
+
--color-blue-tint: #EEF3FF;
|
|
35
|
+
--color-green: #22C55E;
|
|
36
|
+
--color-green-strong: #16A34A;
|
|
37
|
+
--color-green-tint: #E8FAEF;
|
|
38
|
+
--color-red: #B91C1C;
|
|
39
|
+
|
|
40
|
+
--font-display: 'Manrope', system-ui, sans-serif;
|
|
41
|
+
--font-sans: 'Inter', system-ui, sans-serif;
|
|
42
|
+
--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
43
|
+
|
|
44
|
+
--radius-card: 14px;
|
|
45
|
+
--radius-btn: 10px;
|
|
46
|
+
|
|
47
|
+
--shadow-resting: 0 1px 2px rgba(15, 23, 42, .05);
|
|
48
|
+
--shadow-raised: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .06);
|
|
49
|
+
}
|
package/src/ui/config.ts
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defaults for the packaged UI.
|
|
3
|
+
*
|
|
4
|
+
* Nothing here is specific to any site. Every value is a starting point the
|
|
5
|
+
* host overrides through the element's properties or attributes.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { NXIS_LOGO_SVG } from '../engine.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The default system prompt, used when the host sets none.
|
|
13
|
+
*
|
|
14
|
+
* Two instructions should survive any rewrite. Calling the tool with partial
|
|
15
|
+
* arguments is what allows the harness to collect the rest as fields, since a
|
|
16
|
+
* model told to ask in prose will do so. And insisting on the schema's exact
|
|
17
|
+
* parameter names keeps a model from renaming them, which would leave the
|
|
18
|
+
* arguments unmatched.
|
|
19
|
+
*/
|
|
20
|
+
export const DEFAULT_SYSTEM_PROMPT = [
|
|
21
|
+
'You are an assistant embedded in a web page.',
|
|
22
|
+
"Use the available tools to answer the user's questions and to fill and submit forms on this page.",
|
|
23
|
+
'Use parameter names EXACTLY as defined in the tool schema — do not rename, translate, or add suffixes.',
|
|
24
|
+
'Only include fields the user provided or that are clearly implied; never invent emails, names, or dates.',
|
|
25
|
+
'Call the tool as soon as you know which one is right, even if some required fields are still unknown —',
|
|
26
|
+
'include the fields you do have and simply omit the rest.',
|
|
27
|
+
'Never ask the user to supply a missing field in prose. Leave it out of the call; the page will collect it.',
|
|
28
|
+
'Answer only from tool results — never invent facts the tools did not return.',
|
|
29
|
+
'Call at most one tool per turn.',
|
|
30
|
+
].join(' ');
|
|
31
|
+
|
|
32
|
+
/** Empty-state chips. Replace with prompts that suit the host's tools. */
|
|
33
|
+
export const DEFAULT_SUGGESTIONS: string[] = [
|
|
34
|
+
'What can you do on this page?',
|
|
35
|
+
'What information is available here?',
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The line shown above the suggestions before a conversation starts.
|
|
40
|
+
*
|
|
41
|
+
* Only the host knows what the agent can do on their site, so the default
|
|
42
|
+
* describes the mechanism rather than the subject.
|
|
43
|
+
*/
|
|
44
|
+
export const DEFAULT_EMPTY_STATE =
|
|
45
|
+
'Ask a question about this page — the agent answers with typed records and ' +
|
|
46
|
+
'can fill forms for you, right here in the chat.';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The agent's name.
|
|
50
|
+
*
|
|
51
|
+
* Shown in the header, and used in the launcher's title and the dialog's
|
|
52
|
+
* accessible name, so it is announced by a screen reader.
|
|
53
|
+
*/
|
|
54
|
+
export const DEFAULT_AGENT_NAME = 'Nxis Agent';
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The mark shown on the launcher, in both headers, above the empty state, and
|
|
58
|
+
* on result cards.
|
|
59
|
+
*
|
|
60
|
+
* Either inline SVG markup (any value starting with `<`) or an image URL.
|
|
61
|
+
*
|
|
62
|
+
* Markup is injected as written, at the same trust level as the rest of the
|
|
63
|
+
* host page, so never pass a value a visitor can influence.
|
|
64
|
+
*/
|
|
65
|
+
export const DEFAULT_LOGO = NXIS_LOGO_SVG;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Brand overrides, applied as custom properties on the host element.
|
|
69
|
+
*
|
|
70
|
+
* Every key is optional and anything omitted keeps its default. Colours accept
|
|
71
|
+
* any CSS colour; fonts accept a full font stack.
|
|
72
|
+
*/
|
|
73
|
+
export interface AgentTheme {
|
|
74
|
+
/** Primary action colour — buttons, focus rings, links. */
|
|
75
|
+
accent?: string;
|
|
76
|
+
/** Pressed/hover state for `accent`. */
|
|
77
|
+
accentStrong?: string;
|
|
78
|
+
/** Faint wash of `accent` behind tags and chips. */
|
|
79
|
+
accentTint?: string;
|
|
80
|
+
/** Body text. */
|
|
81
|
+
ink?: string;
|
|
82
|
+
/** Secondary text. */
|
|
83
|
+
inkSoft?: string;
|
|
84
|
+
/** Labels, timestamps, placeholders. */
|
|
85
|
+
inkMuted?: string;
|
|
86
|
+
/** The surface the agent's own panels sit on. */
|
|
87
|
+
bg?: string;
|
|
88
|
+
/** Panels raised off `bg` — assistant bubbles, chips. */
|
|
89
|
+
surface?: string;
|
|
90
|
+
/** Hairlines. */
|
|
91
|
+
border?: string;
|
|
92
|
+
/** Corner radius of cards, as a CSS length. */
|
|
93
|
+
radius?: string;
|
|
94
|
+
/** Headings. */
|
|
95
|
+
fontDisplay?: string;
|
|
96
|
+
/** Body copy and controls. */
|
|
97
|
+
fontSans?: string;
|
|
98
|
+
/** Status lines, labels, code. */
|
|
99
|
+
fontMono?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The custom properties each {@link AgentTheme} key writes.
|
|
104
|
+
*
|
|
105
|
+
* Each key writes two names: the element's hand-written CSS resolves the short
|
|
106
|
+
* form, while its Tailwind utilities resolve the theme form. Both style parts
|
|
107
|
+
* of the same surface, so writing only one would leave the element partly
|
|
108
|
+
* unbranded.
|
|
109
|
+
*/
|
|
110
|
+
export const THEME_TOKENS: Record<keyof AgentTheme, readonly string[]> = {
|
|
111
|
+
accent: ['--blue', '--color-blue'],
|
|
112
|
+
accentStrong: ['--blue-strong', '--color-blue-strong'],
|
|
113
|
+
accentTint: ['--blue-tint', '--color-blue-tint'],
|
|
114
|
+
ink: ['--ink', '--color-ink'],
|
|
115
|
+
inkSoft: ['--ink-2', '--color-ink-2'],
|
|
116
|
+
inkMuted: ['--ink-3', '--color-ink-3'],
|
|
117
|
+
bg: ['--bg', '--color-bg'],
|
|
118
|
+
surface: ['--surface', '--color-surface'],
|
|
119
|
+
border: ['--border', '--color-border-hair'],
|
|
120
|
+
radius: ['--radius', '--radius-card'],
|
|
121
|
+
fontDisplay: ['--display', '--font-display'],
|
|
122
|
+
fontSans: ['--sans', '--font-sans'],
|
|
123
|
+
fontMono: ['--mono', '--font-mono'],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* How stored preference keys map onto schema field names.
|
|
128
|
+
*
|
|
129
|
+
* Schemas name the same field differently (`full_name`, `fullname`, `name`), so
|
|
130
|
+
* each preference lists the aliases it satisfies. Extend this to add a new
|
|
131
|
+
* stored preference.
|
|
132
|
+
*/
|
|
133
|
+
export const PROFILE_ALIASES: Record<string, string[]> = {
|
|
134
|
+
name: ['full_name', 'name', 'fullname'],
|
|
135
|
+
email: ['email', 'email_address', 'emailaddress'],
|
|
136
|
+
phone: ['phone', 'phone_number', 'phonenumber', 'tel', 'mobile'],
|
|
137
|
+
address: ['address', 'street_address', 'streetaddress', 'street'],
|
|
138
|
+
};
|
package/src/ui/index.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The packaged chat element.
|
|
3
|
+
*
|
|
4
|
+
* Importing this module registers the `<nxis-agent-fullscreen>` custom element.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import '@nxisai/agent-harness/ui';
|
|
9
|
+
* ```
|
|
10
|
+
* ```html
|
|
11
|
+
* <nxis-agent-fullscreen></nxis-agent-fullscreen>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import './agent-fullscreen.js';
|
|
17
|
+
|
|
18
|
+
export type { AgentPreferences, AgentDefinition } from './agent-fullscreen.js';
|
|
19
|
+
export {
|
|
20
|
+
DEFAULT_SYSTEM_PROMPT,
|
|
21
|
+
DEFAULT_SUGGESTIONS,
|
|
22
|
+
DEFAULT_EMPTY_STATE,
|
|
23
|
+
DEFAULT_AGENT_NAME,
|
|
24
|
+
DEFAULT_LOGO,
|
|
25
|
+
THEME_TOKENS,
|
|
26
|
+
PROFILE_ALIASES,
|
|
27
|
+
} from './config.js';
|
|
28
|
+
export type { AgentTheme } from './config.js';
|
|
29
|
+
export type { PreloadMode, ProgressDetail } from '../engine.js';
|
|
30
|
+
export { A2UI_THEME_CSS, NXIS_PRIMARY } from '../a2ui/theme.js';
|
|
31
|
+
export { viewJourney } from './journey.js';
|
|
32
|
+
export type { JourneyView } from './journey.js';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a journey reads, for a surface that shows one.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from the element so the reading — what the card is called,
|
|
5
|
+
* whether it is still running, what one line says once it is done — can be
|
|
6
|
+
* tested without a browser, and reused by a surface the host builds itself.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentStep } from '../harness/steps.js';
|
|
11
|
+
|
|
12
|
+
/** A journey, reduced to what a card needs. */
|
|
13
|
+
export interface JourneyView {
|
|
14
|
+
/** The journey's id. */
|
|
15
|
+
id: string;
|
|
16
|
+
/** What it is: the name of the thing the agent used. */
|
|
17
|
+
title: string;
|
|
18
|
+
/** The steps worth a line each. The choice of tool is the title instead. */
|
|
19
|
+
steps: AgentStep[];
|
|
20
|
+
/** Still going, finished, or stopped short. */
|
|
21
|
+
outcome: 'running' | 'done' | 'failed';
|
|
22
|
+
/** The step in progress, while there is one. */
|
|
23
|
+
active?: AgentStep;
|
|
24
|
+
/** One line for the folded card, or for a status bar while running. */
|
|
25
|
+
summary: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Read a journey's steps as a card.
|
|
30
|
+
*
|
|
31
|
+
* @param steps - The journey's steps, oldest first.
|
|
32
|
+
* @returns The card's reading, or null for a journey with nothing in it.
|
|
33
|
+
*/
|
|
34
|
+
export function viewJourney(steps: AgentStep[]): JourneyView | null {
|
|
35
|
+
if (!steps.length) return null;
|
|
36
|
+
const id = steps.find((s) => s.journey)?.journey ?? '';
|
|
37
|
+
const choose = steps.find((s) => s.id === 'choose');
|
|
38
|
+
const title = choose?.label || 'Working on it';
|
|
39
|
+
const listed = steps.filter((s) => s.id !== 'choose');
|
|
40
|
+
|
|
41
|
+
const failed = listed.find((s) => s.status === 'failed');
|
|
42
|
+
const submitted = listed.find((s) => s.id === 'submit' && s.status === 'done');
|
|
43
|
+
const outcome: JourneyView['outcome'] = failed ? 'failed' : submitted ? 'done' : 'running';
|
|
44
|
+
// The latest active step, not the first: collect can reopen after navigate.
|
|
45
|
+
const active = [...listed].reverse().find((s) => s.status === 'active');
|
|
46
|
+
|
|
47
|
+
const summary =
|
|
48
|
+
outcome === 'done'
|
|
49
|
+
? `${title} · ${lower(submitted!.label)}`
|
|
50
|
+
: outcome === 'failed'
|
|
51
|
+
? `${title} · ${lower(failed!.label)}`
|
|
52
|
+
: (active?.label ?? title);
|
|
53
|
+
|
|
54
|
+
return { id, title, steps: listed, outcome, active, summary };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const lower = (s: string): string => (s ? s.charAt(0).toLowerCase() + s.slice(1) : s);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* GENERATED by scripts/css-to-ts.mjs — do not edit. Source: src/ui/agent.tw.css */
|
|
2
|
+
export const TAILWIND_CSS = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:\"Inter\", system-ui, sans-serif;--font-mono:\"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-2xl:1rem;--shadow-sm:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#fff;--color-surface:#f5f7fb;--color-border-hair:#e4e9f2;--color-ink:#0f172a;--color-ink-2:#475569;--color-ink-3:#8a97ac;--color-blue:#2563eb;--color-blue-strong:#1d4ed8;--color-blue-tint:#eef3ff;--color-green-strong:#16a34a;--color-red:#b91c1c;--font-display:\"Manrope\", system-ui, sans-serif;--radius-card:14px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mt-1{margin-top:var(--spacing)}.block{display:block}.contents{display:contents}.flex{display:flex}.hidden{display:none}.inline{display:inline}.table{display:table}.w-full{width:100%}.max-w-\\[76\\%\\]{max-width:76%}.max-w-\\[420px\\]{max-width:420px}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-card{border-radius:var(--radius-card)}.rounded-br-md{border-bottom-right-radius:var(--radius-md)}.rounded-bl-md{border-bottom-left-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-border-hair{border-color:var(--color-border-hair)}.border-red{border-color:var(--color-red)}.border-red\\/25{border-color:#b91c1c40}@supports (color:color-mix(in lab, red, red)){.border-red\\/25{border-color:color-mix(in oklab, var(--color-red) 25%, transparent)}}.bg-blue{background-color:var(--color-blue)}.bg-surface{background-color:var(--color-surface)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[0\\.14em\\]{--tw-tracking:.14em;letter-spacing:.14em}.break-words{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-green-strong{color:var(--color-green-strong)}.text-ink{color:var(--color-ink)}.text-ink-2{color:var(--color-ink-2)}.text-red{color:var(--color-red)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-resting{--tw-shadow:0 1px 2px var(--tw-shadow-color,#0f172a0d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow\\/border{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\!ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)!important}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-blur{syntax:\"*\";inherits:false}@property --tw-brightness{syntax:\"*\";inherits:false}@property --tw-contrast{syntax:\"*\";inherits:false}@property --tw-grayscale{syntax:\"*\";inherits:false}@property --tw-hue-rotate{syntax:\"*\";inherits:false}@property --tw-invert{syntax:\"*\";inherits:false}@property --tw-opacity{syntax:\"*\";inherits:false}@property --tw-saturate{syntax:\"*\";inherits:false}@property --tw-sepia{syntax:\"*\";inherits:false}@property --tw-drop-shadow{syntax:\"*\";inherits:false}@property --tw-drop-shadow-color{syntax:\"*\";inherits:false}@property --tw-drop-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The part of the WebMCP action contract this package consumes.
|
|
3
|
+
*
|
|
4
|
+
* Declared here rather than imported, so that type-only information does not
|
|
5
|
+
* require a runtime dependency. These shapes mirror the WebMCP SDK's exports
|
|
6
|
+
* and can be widened as that contract grows.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The value types a property specification may declare.
|
|
13
|
+
*
|
|
14
|
+
* The crawler folds time inputs into `date`, and marks file inputs `file`.
|
|
15
|
+
*/
|
|
16
|
+
export type NxisValueType = 'string' | 'number' | 'integer' | 'boolean' | 'date' | 'file';
|
|
17
|
+
|
|
18
|
+
/** One choice in a property's enumerated options. */
|
|
19
|
+
export interface NxisValueOption {
|
|
20
|
+
'@type'?: 'nxis:ValueOption';
|
|
21
|
+
value: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A Schema.org `PropertyValueSpecification`: one input of an action. */
|
|
26
|
+
export interface NxisPropertyValueSpecification {
|
|
27
|
+
'@type'?: string;
|
|
28
|
+
valueName: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
valueRequired?: boolean;
|
|
31
|
+
defaultValue?: string;
|
|
32
|
+
valueMinLength?: number;
|
|
33
|
+
valueMaxLength?: number;
|
|
34
|
+
minValue?: number;
|
|
35
|
+
maxValue?: number;
|
|
36
|
+
stepValue?: number;
|
|
37
|
+
valuePattern?: string;
|
|
38
|
+
multipleValues?: boolean;
|
|
39
|
+
readonlyValue?: boolean;
|
|
40
|
+
'nxis:valueType'?: NxisValueType;
|
|
41
|
+
'nxis:valueOption'?: NxisValueOption[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** How an action is submitted: its URL, method and encoding. */
|
|
45
|
+
export interface NxisEntryPoint {
|
|
46
|
+
'@type'?: 'EntryPoint';
|
|
47
|
+
httpMethod: string;
|
|
48
|
+
urlTemplate?: string;
|
|
49
|
+
encodingType?: string;
|
|
50
|
+
'nxis:targetKind'?: 'selfPage' | 'clientSide';
|
|
51
|
+
'nxis:pageUrl'?: string;
|
|
52
|
+
'nxis:jsHandled'?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** A Schema.org action extracted from a page's JSON-LD. */
|
|
56
|
+
export interface NxisAction {
|
|
57
|
+
'@context'?: unknown;
|
|
58
|
+
'@type': string;
|
|
59
|
+
'@id': string;
|
|
60
|
+
name: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
target: NxisEntryPoint;
|
|
63
|
+
input?: NxisPropertyValueSpecification[];
|
|
64
|
+
'nxis:extractedAt'?: string;
|
|
65
|
+
}
|