@jini-ai/agentic 0.4.3 → 0.4.4
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/core/handle.d.ts +13 -0
- package/dist/core/handle.js +19 -0
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.js +2 -1
- package/dist/core/site-guide/index.d.ts +4 -0
- package/dist/core/site-guide/index.js +4 -0
- package/dist/core/site-guide/site-guide.d.ts +18 -0
- package/dist/core/site-guide/site-guide.js +144 -0
- package/dist/core/site-guide/topic-schema.d.ts +16 -0
- package/dist/core/site-guide/topic-schema.js +68 -0
- package/dist/core/site-guide/types.d.ts +83 -0
- package/dist/core/site-guide/types.js +2 -0
- package/dist/skills/install/archive.js +1 -0
- package/dist/skills/install/index.d.ts +1 -0
- package/dist/skills/install/index.js +1 -0
- package/dist/skills/install/install-service.d.ts +20 -1
- package/dist/skills/install/install-service.js +23 -11
- package/dist/skills/install/layout.d.ts +8 -0
- package/dist/skills/install/layout.js +26 -1
- package/dist/skills/install/live-registration.js +1 -0
- package/dist/skills/install/validation.d.ts +5 -1
- package/dist/skills/install/validation.js +2 -2
- package/dist/skills/install/yauzl-archive-reader.d.ts +29 -0
- package/dist/skills/install/yauzl-archive-reader.js +31 -0
- package/package.json +4 -4
- package/dist/a2ui/agent-to-renderer.d.ts +0 -613
- package/dist/a2ui/agent-to-renderer.js +0 -191
- package/dist/a2ui/catalog.d.ts +0 -73
- package/dist/a2ui/catalog.js +0 -304
- package/dist/a2ui/common-types.d.ts +0 -401
- package/dist/a2ui/common-types.js +0 -130
- package/dist/a2ui/index.d.ts +0 -16
- package/dist/a2ui/index.js +0 -16
- package/dist/a2ui/interpreter.d.ts +0 -71
- package/dist/a2ui/interpreter.js +0 -337
- package/dist/a2ui/json-pointer.d.ts +0 -48
- package/dist/a2ui/json-pointer.js +0 -174
- package/dist/a2ui/renderer-to-agent.d.ts +0 -342
- package/dist/a2ui/renderer-to-agent.js +0 -111
- package/dist/a2ui/resolve.d.ts +0 -28
- package/dist/a2ui/resolve.js +0 -144
- package/dist/a2ui/tree.d.ts +0 -66
- package/dist/a2ui/tree.js +0 -74
- package/dist/ag-ui.d.ts +0 -82
- package/dist/ag-ui.js +0 -85
- package/dist/agui/encoder.d.ts +0 -50
- package/dist/agui/encoder.js +0 -97
- package/dist/agui/events.d.ts +0 -59
- package/dist/agui/events.js +0 -15
- package/dist/capability.d.ts +0 -81
- package/dist/capability.js +0 -79
- package/dist/dom/dom-page-driver.d.ts +0 -36
- package/dist/dom/dom-page-driver.js +0 -601
- package/dist/dom/index.d.ts +0 -17
- package/dist/dom/index.js +0 -17
- package/dist/dom/model-context.d.ts +0 -69
- package/dist/dom/model-context.js +0 -44
- package/dist/element-handles.d.ts +0 -120
- package/dist/element-handles.js +0 -39
- package/dist/gen-ui/encoder.d.ts +0 -50
- package/dist/gen-ui/encoder.js +0 -97
- package/dist/gen-ui/events.d.ts +0 -59
- package/dist/gen-ui/events.js +0 -15
- package/dist/gen-ui/index.d.ts +0 -18
- package/dist/gen-ui/index.js +0 -17
- package/dist/guards.d.ts +0 -96
- package/dist/guards.js +0 -186
- package/dist/handle.d.ts +0 -41
- package/dist/handle.js +0 -41
- package/dist/mcp-ui-apps.d.ts +0 -223
- package/dist/mcp-ui-apps.js +0 -252
- package/dist/mcp-ui.d.ts +0 -133
- package/dist/mcp-ui.js +0 -134
- package/dist/page-capabilities.d.ts +0 -14
- package/dist/page-capabilities.js +0 -129
- package/dist/page-driver.d.ts +0 -120
- package/dist/page-driver.js +0 -2
- package/dist/page-executor.d.ts +0 -94
- package/dist/page-executor.js +0 -320
- package/dist/webmcp.d.ts +0 -202
- package/dist/webmcp.js +0 -173
package/dist/capability.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module capability
|
|
3
|
-
*
|
|
4
|
-
* The vocabulary every agent-drivable surface shares: what an outside caller may ask a
|
|
5
|
-
* frontend to do, described as pure data with no transport, DOM, or framework attached.
|
|
6
|
-
*
|
|
7
|
-
* One noun, deliberately: **capability**. The chat pane's first draft used `tool` in its
|
|
8
|
-
* type names and `capability` in its ids, which forked the vocabulary across four files.
|
|
9
|
-
* `tool` stays reserved for the engine's own `ToolRegistry`/`ToolExecutor` nouns; anything
|
|
10
|
-
* an outside caller asks a *frontend* to do is a capability. Transports may of course
|
|
11
|
-
* present capabilities as MCP tools — that is a projection, not a rename.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Looks a capability up by id.
|
|
15
|
-
*
|
|
16
|
-
* @param capabilities - The manifest to search.
|
|
17
|
-
* @param id - Capability id to resolve.
|
|
18
|
-
* @returns The definition, or `undefined` when the id is not in the manifest.
|
|
19
|
-
*/
|
|
20
|
-
export function findCapability(capabilities, id) {
|
|
21
|
-
return capabilities.find((capability) => capability.id === id);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Checks caller input against a capability's declared schema.
|
|
25
|
-
*
|
|
26
|
-
* Manifests advertise `additionalProperties: false` and a `required` list, but nothing was
|
|
27
|
-
* enforcing either — handlers read the fields they knew about and ignored the rest, so a
|
|
28
|
-
* misnamed argument silently became a missing one. This closes that for any surface that calls
|
|
29
|
-
* it. Intentionally a shallow check, not a JSON Schema engine: these schemas are flat by
|
|
30
|
-
* construction, and a real validator is a dependency this package will not take.
|
|
31
|
-
*
|
|
32
|
-
* @param capability - The capability being invoked.
|
|
33
|
-
* @param input - Raw caller-supplied arguments.
|
|
34
|
-
* @returns An error message, or `null` when the input is acceptable.
|
|
35
|
-
*/
|
|
36
|
-
export function findCapabilityInputError(capability, input) {
|
|
37
|
-
const { properties, required, additionalProperties } = capability.inputSchema;
|
|
38
|
-
for (const name of required ?? []) {
|
|
39
|
-
if (input[name] === undefined)
|
|
40
|
-
return `"${name}" is required`;
|
|
41
|
-
}
|
|
42
|
-
if (additionalProperties === false) {
|
|
43
|
-
// `key in properties` walks the whole prototype chain, so a key that happens to be inherited
|
|
44
|
-
// from Object.prototype (`__proto__`, `constructor`, `toString`, `valueOf`, …) reads as
|
|
45
|
-
// "known" regardless of whether the schema actually lists it — `'constructor' in {}` is
|
|
46
|
-
// true even on an empty object. `JSON.parse('{"__proto__":...}')` creates a real own data
|
|
47
|
-
// property (not the accessor), so this was a live way for such a key to escape the
|
|
48
|
-
// "unknown argument" refusal entirely. hasOwnProperty ignores the prototype chain, so only
|
|
49
|
-
// keys the schema actually declares count as known.
|
|
50
|
-
const unknown = Object.keys(input)
|
|
51
|
-
.filter((key) => !Object.prototype.hasOwnProperty.call(properties, key));
|
|
52
|
-
if (unknown.length > 0) {
|
|
53
|
-
return `unknown ${unknown.length === 1 ? 'argument' : 'arguments'}: ${unknown.sort().join(', ')}`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
for (const [name, schema] of Object.entries(properties)) {
|
|
57
|
-
const value = input[name];
|
|
58
|
-
if (value === undefined)
|
|
59
|
-
continue;
|
|
60
|
-
const actual = Array.isArray(value) ? 'array' : typeof value;
|
|
61
|
-
if (actual !== schema.type)
|
|
62
|
-
return `"${name}" must be a ${schema.type}, received ${actual}`;
|
|
63
|
-
if (schema.enum !== undefined && !schema.enum.includes(value)) {
|
|
64
|
-
return `"${name}" must be one of: ${schema.enum.join(', ')}`;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* The capabilities a caller may use given what is currently connected.
|
|
71
|
-
*
|
|
72
|
-
* @param capabilities - The full manifest.
|
|
73
|
-
* @param hasSession - Whether a live frontend session is attached.
|
|
74
|
-
* @returns Only the capabilities that can actually be satisfied right now.
|
|
75
|
-
*/
|
|
76
|
-
export function availableCapabilities(capabilities, hasSession) {
|
|
77
|
-
return hasSession ? capabilities : capabilities.filter((c) => c.surface === 'server');
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=capability.js.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { PageDriver } from '../page-driver.js';
|
|
2
|
-
/** One page a host allows navigation to: its human label, and how to actually get there. */
|
|
3
|
-
export interface DomPageDriverPage {
|
|
4
|
-
/** Shown to a caller by `page.find_elements`/`page.navigate`'s refusal message — see
|
|
5
|
-
* `PageSummary.label` for why this exists at all. */
|
|
6
|
-
readonly label: string;
|
|
7
|
-
readonly navigate: () => void;
|
|
8
|
-
}
|
|
9
|
-
export interface DomPageDriverOptions {
|
|
10
|
-
/** The subtree to expose. Never pass `document`. */
|
|
11
|
-
readonly root: ParentNode & {
|
|
12
|
-
querySelector: Element['querySelector'];
|
|
13
|
-
};
|
|
14
|
-
/** Page ids this driver may navigate to, each with its label and how to get there. */
|
|
15
|
-
readonly pages: Readonly<Record<string, DomPageDriverPage>>;
|
|
16
|
-
/**
|
|
17
|
-
* The id of the page currently shown, reported on every element.
|
|
18
|
-
*
|
|
19
|
-
* Omit it in a single-page app that swaps views: the driver then reads `data-agent-page` from
|
|
20
|
-
* the live DOM on every call, so navigating actually changes what elements report. A value
|
|
21
|
-
* captured here is fixed for the driver's whole lifetime, which is right only for a surface that
|
|
22
|
-
* never changes view — and silently wrong for one that does, since the driver outlives any one
|
|
23
|
-
* view (it is bound to the connection, not the render).
|
|
24
|
-
*/
|
|
25
|
-
readonly currentPage?: string | undefined;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Builds a driver over `root`.
|
|
29
|
-
*
|
|
30
|
-
* @param options - The subtree, the navigable pages, and the current page id.
|
|
31
|
-
* @returns A driver ready to hand to `executePageCapability`.
|
|
32
|
-
*/
|
|
33
|
-
export declare function createDomPageDriver(options: DomPageDriverOptions): PageDriver;
|
|
34
|
-
/** Reads the current page's `data-agent-page`, for hosts that tag the body. */
|
|
35
|
-
export declare function currentAgentPage(root: ParentNode): string | undefined;
|
|
36
|
-
//# sourceMappingURL=dom-page-driver.d.ts.map
|