@jini-ai/agentic 0.4.3 → 0.4.5

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/core/a2ui/json-pointer.js +94 -73
  3. package/dist/core/a2ui/resolve.js +45 -23
  4. package/dist/core/a2ui/tree.js +8 -5
  5. package/dist/core/capability.js +21 -12
  6. package/dist/core/dom/dom-page-driver.js +89 -74
  7. package/dist/core/gen-ui/encoder.js +31 -31
  8. package/dist/core/guards.js +13 -6
  9. package/dist/core/handle.d.ts +13 -0
  10. package/dist/core/handle.js +19 -0
  11. package/dist/core/index.d.ts +2 -1
  12. package/dist/core/index.js +2 -1
  13. package/dist/core/mcp-ui-apps.js +12 -6
  14. package/dist/core/page-executor.js +131 -111
  15. package/dist/core/site-guide/index.d.ts +4 -0
  16. package/dist/core/site-guide/index.js +4 -0
  17. package/dist/core/site-guide/site-guide.d.ts +18 -0
  18. package/dist/core/site-guide/site-guide.js +162 -0
  19. package/dist/core/site-guide/topic-schema.d.ts +16 -0
  20. package/dist/core/site-guide/topic-schema.js +68 -0
  21. package/dist/core/site-guide/types.d.ts +83 -0
  22. package/dist/core/site-guide/types.js +2 -0
  23. package/dist/skills/install/archive.js +42 -30
  24. package/dist/skills/install/github.js +102 -63
  25. package/dist/skills/install/index.d.ts +1 -0
  26. package/dist/skills/install/index.js +1 -0
  27. package/dist/skills/install/install-service.d.ts +20 -1
  28. package/dist/skills/install/install-service.js +23 -11
  29. package/dist/skills/install/layout.d.ts +8 -0
  30. package/dist/skills/install/layout.js +26 -1
  31. package/dist/skills/install/live-registration.js +1 -0
  32. package/dist/skills/install/node-filesystem.js +3 -1
  33. package/dist/skills/install/state.js +18 -7
  34. package/dist/skills/install/validation.d.ts +5 -1
  35. package/dist/skills/install/validation.js +85 -52
  36. package/dist/skills/install/yauzl-archive-reader.d.ts +29 -0
  37. package/dist/skills/install/yauzl-archive-reader.js +31 -0
  38. package/package.json +4 -4
  39. package/dist/a2ui/agent-to-renderer.d.ts +0 -613
  40. package/dist/a2ui/agent-to-renderer.js +0 -191
  41. package/dist/a2ui/catalog.d.ts +0 -73
  42. package/dist/a2ui/catalog.js +0 -304
  43. package/dist/a2ui/common-types.d.ts +0 -401
  44. package/dist/a2ui/common-types.js +0 -130
  45. package/dist/a2ui/index.d.ts +0 -16
  46. package/dist/a2ui/index.js +0 -16
  47. package/dist/a2ui/interpreter.d.ts +0 -71
  48. package/dist/a2ui/interpreter.js +0 -337
  49. package/dist/a2ui/json-pointer.d.ts +0 -48
  50. package/dist/a2ui/json-pointer.js +0 -174
  51. package/dist/a2ui/renderer-to-agent.d.ts +0 -342
  52. package/dist/a2ui/renderer-to-agent.js +0 -111
  53. package/dist/a2ui/resolve.d.ts +0 -28
  54. package/dist/a2ui/resolve.js +0 -144
  55. package/dist/a2ui/tree.d.ts +0 -66
  56. package/dist/a2ui/tree.js +0 -74
  57. package/dist/ag-ui.d.ts +0 -82
  58. package/dist/ag-ui.js +0 -85
  59. package/dist/agui/encoder.d.ts +0 -50
  60. package/dist/agui/encoder.js +0 -97
  61. package/dist/agui/events.d.ts +0 -59
  62. package/dist/agui/events.js +0 -15
  63. package/dist/capability.d.ts +0 -81
  64. package/dist/capability.js +0 -79
  65. package/dist/dom/dom-page-driver.d.ts +0 -36
  66. package/dist/dom/dom-page-driver.js +0 -601
  67. package/dist/dom/index.d.ts +0 -17
  68. package/dist/dom/index.js +0 -17
  69. package/dist/dom/model-context.d.ts +0 -69
  70. package/dist/dom/model-context.js +0 -44
  71. package/dist/element-handles.d.ts +0 -120
  72. package/dist/element-handles.js +0 -39
  73. package/dist/gen-ui/encoder.d.ts +0 -50
  74. package/dist/gen-ui/encoder.js +0 -97
  75. package/dist/gen-ui/events.d.ts +0 -59
  76. package/dist/gen-ui/events.js +0 -15
  77. package/dist/gen-ui/index.d.ts +0 -18
  78. package/dist/gen-ui/index.js +0 -17
  79. package/dist/guards.d.ts +0 -96
  80. package/dist/guards.js +0 -186
  81. package/dist/handle.d.ts +0 -41
  82. package/dist/handle.js +0 -41
  83. package/dist/mcp-ui-apps.d.ts +0 -223
  84. package/dist/mcp-ui-apps.js +0 -252
  85. package/dist/mcp-ui.d.ts +0 -133
  86. package/dist/mcp-ui.js +0 -134
  87. package/dist/page-capabilities.d.ts +0 -14
  88. package/dist/page-capabilities.js +0 -129
  89. package/dist/page-driver.d.ts +0 -120
  90. package/dist/page-driver.js +0 -2
  91. package/dist/page-executor.d.ts +0 -94
  92. package/dist/page-executor.js +0 -320
  93. package/dist/webmcp.d.ts +0 -202
  94. package/dist/webmcp.js +0 -173
@@ -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