@trackunit/iris-app-api 2.13.9-alpha-2f5decf56c8.0 → 2.13.9

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.13.9 (2026-11-06)
2
+
3
+ This was a version bump only for iris-app-api to align it with other projects, there were no code changes.
4
+
1
5
  ## 2.13.8 (2026-11-05)
2
6
 
3
7
  This was a version bump only for iris-app-api to align it with other projects, there were no code changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-api",
3
- "version": "2.13.9-alpha-2f5decf56c8.0",
3
+ "version": "2.13.9",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
package/src/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from "./types/aiNavigableExtension";
2
2
  export * from "./types/defaultValidHosts";
3
3
  export * from "./types/extensions/adminExtensionManifest";
4
- export * from "./types/extensions/aiToolsExtensionManifest";
5
4
  export * from "./types/extensions/assetEventsActionsExtensionManifest";
6
5
  export * from "./types/extensions/assetHomeExtensionManifest";
7
6
  export * from "./types/extensions/customerHomeExtensionManifest";
@@ -18,8 +17,6 @@ export * from "./types/iconImage";
18
17
  export * from "./types/icons.generated";
19
18
  export * from "./types/irisAiNavigation";
20
19
  export * from "./types/irisAiNavigationValidation";
21
- export * from "./types/irisAiTools";
22
- export * from "./types/irisAiToolsValidation";
23
20
  export * from "./types/irisAppCspInput";
24
21
  export * from "./types/irisAppCustomFields";
25
22
  export * from "./types/irisAppExtensionManifest";
package/src/index.js CHANGED
@@ -4,7 +4,6 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./types/aiNavigableExtension"), exports);
5
5
  tslib_1.__exportStar(require("./types/defaultValidHosts"), exports);
6
6
  tslib_1.__exportStar(require("./types/extensions/adminExtensionManifest"), exports);
7
- tslib_1.__exportStar(require("./types/extensions/aiToolsExtensionManifest"), exports);
8
7
  tslib_1.__exportStar(require("./types/extensions/assetEventsActionsExtensionManifest"), exports);
9
8
  tslib_1.__exportStar(require("./types/extensions/assetHomeExtensionManifest"), exports);
10
9
  tslib_1.__exportStar(require("./types/extensions/customerHomeExtensionManifest"), exports);
@@ -21,8 +20,6 @@ tslib_1.__exportStar(require("./types/iconImage"), exports);
21
20
  tslib_1.__exportStar(require("./types/icons.generated"), exports);
22
21
  tslib_1.__exportStar(require("./types/irisAiNavigation"), exports);
23
22
  tslib_1.__exportStar(require("./types/irisAiNavigationValidation"), exports);
24
- tslib_1.__exportStar(require("./types/irisAiTools"), exports);
25
- tslib_1.__exportStar(require("./types/irisAiToolsValidation"), exports);
26
23
  tslib_1.__exportStar(require("./types/irisAppCspInput"), exports);
27
24
  tslib_1.__exportStar(require("./types/irisAppCustomFields"), exports);
28
25
  tslib_1.__exportStar(require("./types/irisAppExtensionManifest"), exports);
@@ -1,9 +1,7 @@
1
- export declare const irisAppExtensionTypes: readonly ["REPORT_EXTENSION", "IRIS_APP_SETTINGS_EXTENSION", "ADMIN_EXTENSION", "FLEET_EXTENSION", "WIDGET_EXTENSION", "ASSET_HOME_EXTENSION", "ASSET_EVENTS_ACTIONS_EXTENSION", "CUSTOMER_HOME_EXTENSION", "SITE_HOME_EXTENSION", "LIFECYCLE_EXTENSION", "SERVERSIDE_API_EXTENSION", "AI_TOOLS_EXTENSION"];
1
+ export declare const irisAppExtensionTypes: readonly ["REPORT_EXTENSION", "IRIS_APP_SETTINGS_EXTENSION", "ADMIN_EXTENSION", "FLEET_EXTENSION", "WIDGET_EXTENSION", "ASSET_HOME_EXTENSION", "ASSET_EVENTS_ACTIONS_EXTENSION", "CUSTOMER_HOME_EXTENSION", "SITE_HOME_EXTENSION", "LIFECYCLE_EXTENSION", "SERVERSIDE_API_EXTENSION"];
2
2
  export type IrisAppExtensionType = (typeof irisAppExtensionTypes)[number];
3
3
  export declare const nonUiExtensionTypes: Array<IrisAppExtensionType>;
4
4
  export declare const serverSideExtensionTypes: Array<IrisAppExtensionType>;
5
- /** Serverside extensions the platform deploys as their own function (Lambda), served behind `/invoke`. */
6
- export declare const functionExtensionTypes: Array<IrisAppExtensionType>;
7
5
  export type RegExpType = {
8
6
  pattern: string | RegExp;
9
7
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.languageKeys = exports.functionExtensionTypes = exports.serverSideExtensionTypes = exports.nonUiExtensionTypes = exports.irisAppExtensionTypes = void 0;
3
+ exports.languageKeys = exports.serverSideExtensionTypes = exports.nonUiExtensionTypes = exports.irisAppExtensionTypes = void 0;
4
4
  exports.irisAppExtensionTypes = [
5
5
  "REPORT_EXTENSION",
6
6
  "IRIS_APP_SETTINGS_EXTENSION",
@@ -13,21 +13,16 @@ exports.irisAppExtensionTypes = [
13
13
  "SITE_HOME_EXTENSION",
14
14
  "LIFECYCLE_EXTENSION",
15
15
  "SERVERSIDE_API_EXTENSION",
16
- "AI_TOOLS_EXTENSION",
17
16
  ];
18
17
  exports.nonUiExtensionTypes = [
19
18
  "REPORT_EXTENSION",
20
19
  "LIFECYCLE_EXTENSION",
21
20
  "SERVERSIDE_API_EXTENSION",
22
- "AI_TOOLS_EXTENSION",
23
21
  ];
24
22
  exports.serverSideExtensionTypes = [
25
23
  "LIFECYCLE_EXTENSION",
26
24
  "SERVERSIDE_API_EXTENSION",
27
- "AI_TOOLS_EXTENSION",
28
25
  ];
29
- /** Serverside extensions the platform deploys as their own function (Lambda), served behind `/invoke`. */
30
- exports.functionExtensionTypes = ["SERVERSIDE_API_EXTENSION", "AI_TOOLS_EXTENSION"];
31
26
  exports.languageKeys = [
32
27
  "en",
33
28
  "da",
@@ -1,5 +1,4 @@
1
1
  import { CSPDirectives } from "./cspDirectives";
2
- import { AiToolsExtensionManifest } from "./extensions/aiToolsExtensionManifest";
3
2
  import { AdminExtensionManifest } from "./extensions/adminExtensionManifest";
4
3
  import { AssetEventsActionsExtensionManifest } from "./extensions/assetEventsActionsExtensionManifest";
5
4
  import { AssetHomeExtensionManifest } from "./extensions/assetHomeExtensionManifest";
@@ -92,7 +91,7 @@ export type RequiredOrOptionalScope = {
92
91
  scope: Scope;
93
92
  optional?: boolean;
94
93
  };
95
- export declare type IrisAppExtension = AssetHomeExtensionManifest | IrisAppSettingsExtensionManifest | AdminExtensionManifest | FleetExtensionManifest | SiteHomeExtensionManifest | WidgetExtensionManifest | ReportExtensionManifest | CustomerHomeExtensionManifest | AssetEventsActionsExtensionManifest | LifecycleExtensionManifest | ServersideApiExtensionManifest | AiToolsExtensionManifest;
94
+ export declare type IrisAppExtension = AssetHomeExtensionManifest | IrisAppSettingsExtensionManifest | AdminExtensionManifest | FleetExtensionManifest | SiteHomeExtensionManifest | WidgetExtensionManifest | ReportExtensionManifest | CustomerHomeExtensionManifest | AssetEventsActionsExtensionManifest | LifecycleExtensionManifest | ServersideApiExtensionManifest;
96
95
  export declare type CustomFieldDefinition = BooleanFieldDefinition | DecimalNumberFieldDefinition | IntegerNumberFieldDefinition | DateFieldDefinition | DropDownFieldDefinition | StringFieldDefinition | StringListFieldDefinition | EmailFieldDefinition | PhoneNumberFieldDefinition | WebAddressFieldDefinition | JsonFieldDefinition | MonetaryFieldDefinition | FileFieldDefinition;
97
96
  /**
98
97
  * @deprecated
@@ -1,17 +0,0 @@
1
- import { IrisExtensionAiTools } from "../irisAiTools";
2
- import { AbstractExtensionManifest } from "../irisAppExtensionManifest";
3
- /**
4
- * Serves the app's AI tools on `POST /mcp`, built with `@trackunit/serverside-ai-tools`.
5
- * When the app version is approved, the platform makes the tools available to AI clients
6
- * for accounts that have the app. At most one per app.
7
- */
8
- export interface AiToolsExtensionManifest extends AbstractExtensionManifest {
9
- type: "AI_TOOLS_EXTENSION";
10
- runtime: "DENO";
11
- id: string;
12
- name: string;
13
- description?: string;
14
- main: `${string}.ts` | `${string}.js`;
15
- dependencyDefinitionFile: string;
16
- aiTools: IrisExtensionAiTools;
17
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=aiToolsExtensionManifest.js.map
@@ -1,32 +0,0 @@
1
- /**
2
- * MCP tool annotation hints. All four are required so the AI assistant never
3
- * has to guess whether a tool writes, overwrites, can be retried or leaves
4
- * Trackunit. A tool with `readOnlyHint: false` is shown to the user for approval.
5
- */
6
- export type IrisAiToolAnnotations = {
7
- readonly readOnlyHint: boolean;
8
- readonly destructiveHint: boolean;
9
- readonly idempotentHint: boolean;
10
- readonly openWorldHint: boolean;
11
- };
12
- /** A JSON Schema with `type: "object"`, as MCP requires for tool input and output. */
13
- export type IrisAiToolJsonSchema = Readonly<Record<string, unknown>> & {
14
- readonly type: "object";
15
- };
16
- export type IrisAiTool = {
17
- /** `verb_noun` in snake_case, e.g. `update_fault_priorities`. */
18
- readonly name: string;
19
- readonly title: string;
20
- readonly description: string;
21
- readonly inputSchema: IrisAiToolJsonSchema;
22
- readonly outputSchema?: IrisAiToolJsonSchema;
23
- readonly annotations: IrisAiToolAnnotations;
24
- };
25
- export type IrisExtensionAiTools = {
26
- /**
27
- * Kebab-case prefix of the tool names AI clients see (`<namespace>_<tool>`).
28
- * Must not be reserved or used by another app or service.
29
- */
30
- readonly namespace: string;
31
- readonly tools: ReadonlyArray<IrisAiTool>;
32
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=irisAiTools.js.map
@@ -1,26 +0,0 @@
1
- import { IrisAppExtensionType } from "./irisAppExtensionManifest";
2
- import type { IrisAppExtension } from "./irisAppManifest";
3
- /** Clients see `<namespace>_<tool>`; the MCP Tool Guidelines cap that at 60 characters. */
4
- export declare const AI_TOOLS_MAX_EXPOSED_NAME_LENGTH = 60;
5
- export declare const AI_TOOLS_MAX_TOOLS = 50;
6
- export declare const AI_TOOLS_MAX_TITLE_LENGTH = 80;
7
- export declare const AI_TOOLS_MAX_DESCRIPTION_LENGTH = 2000;
8
- /** Keeps the registry entry well below Kafka's default 1 MB message limit. */
9
- export declare const AI_TOOLS_MAX_DECLARATION_BYTES: number;
10
- export type AiToolsValidationInput = {
11
- /** Untrusted at the server choke point: comes from a published manifest. */
12
- readonly extensions: ReadonlyArray<{
13
- readonly id: string;
14
- readonly type: IrisAppExtensionType;
15
- readonly aiTools: unknown;
16
- }>;
17
- };
18
- /**
19
- * Structural validation of `aiTools` across a manifest's extensions. Returns
20
- * human-readable errors; an empty array means valid. Shared by the build
21
- * (`updateExtensions`) and the server (`manifest-validator.ts`). Whether the
22
- * namespace is free is checked by the server only.
23
- */
24
- export declare const validateIrisAiTools: ({ extensions }: AiToolsValidationInput) => ReadonlyArray<string>;
25
- /** `validateIrisAiTools` for a manifest's extensions, reading `aiTools` from any type that has it. */
26
- export declare const validateManifestAiTools: (extensions: ReadonlyArray<IrisAppExtension>) => ReadonlyArray<string>;
@@ -1,140 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateManifestAiTools = exports.validateIrisAiTools = exports.AI_TOOLS_MAX_DECLARATION_BYTES = exports.AI_TOOLS_MAX_DESCRIPTION_LENGTH = exports.AI_TOOLS_MAX_TITLE_LENGTH = exports.AI_TOOLS_MAX_TOOLS = exports.AI_TOOLS_MAX_EXPOSED_NAME_LENGTH = void 0;
4
- /** Clients see `<namespace>_<tool>`; the MCP Tool Guidelines cap that at 60 characters. */
5
- exports.AI_TOOLS_MAX_EXPOSED_NAME_LENGTH = 60;
6
- exports.AI_TOOLS_MAX_TOOLS = 50;
7
- exports.AI_TOOLS_MAX_TITLE_LENGTH = 80;
8
- exports.AI_TOOLS_MAX_DESCRIPTION_LENGTH = 2000;
9
- /** Keeps the registry entry well below Kafka's default 1 MB message limit. */
10
- exports.AI_TOOLS_MAX_DECLARATION_BYTES = 256 * 1024;
11
- const AI_TOOLS_EXTENSION_TYPE = "AI_TOOLS_EXTENSION";
12
- const NAMESPACE_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
13
- /** The id becomes a segment of the registered `/invoke/<appId>/<extensionId>/mcp` path. */
14
- const EXTENSION_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
15
- const TOOL_NAME_PATTERN = /^[a-z][a-z0-9]*(_[a-z0-9]+)+$/;
16
- const ANNOTATION_HINTS = ["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"];
17
- const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
18
- /** UTF-8 size of the JSON form, or `undefined` when the value cannot be serialized. */
19
- const serializedBytes = (value) => {
20
- try {
21
- return new TextEncoder().encode(JSON.stringify(value)).length;
22
- }
23
- catch {
24
- return undefined;
25
- }
26
- };
27
- const TEXT_MAX_LENGTH = { title: exports.AI_TOOLS_MAX_TITLE_LENGTH, description: exports.AI_TOOLS_MAX_DESCRIPTION_LENGTH };
28
- const validateText = (value, field, label, errors) => {
29
- if (typeof value !== "string" || value.trim().length === 0) {
30
- errors.push(`${label}: '${field}' is required and must be a non-empty string.`);
31
- }
32
- else if (value.length > TEXT_MAX_LENGTH[field]) {
33
- errors.push(`${label}: '${field}' must be at most ${TEXT_MAX_LENGTH[field]} characters.`);
34
- }
35
- };
36
- const validateSchema = (value, field, label, errors) => {
37
- if (!isRecord(value) || value.type !== "object") {
38
- errors.push(`${label}: '${field}' must be a JSON Schema object with type "object".`);
39
- }
40
- };
41
- const validateAnnotations = (value, label, errors) => {
42
- if (!isRecord(value)) {
43
- errors.push(`${label}: 'annotations' is required and must declare ${ANNOTATION_HINTS.join(", ")}.`);
44
- return;
45
- }
46
- ANNOTATION_HINTS.forEach(hint => {
47
- if (typeof value[hint] !== "boolean") {
48
- errors.push(`${label}: annotation '${hint}' is required and must be a boolean.`);
49
- }
50
- });
51
- };
52
- const validateTool = (tool, index, namespace, prefix, errors) => {
53
- if (!isRecord(tool)) {
54
- errors.push(`${prefix} tool #${index}: must be an object.`);
55
- return;
56
- }
57
- const label = `${prefix} tool #${index} (${typeof tool.name === "string" ? tool.name : "unknown name"})`;
58
- if (typeof tool.name !== "string" || !TOOL_NAME_PATTERN.test(tool.name)) {
59
- errors.push(`${label}: 'name' must be verb_noun in snake_case, e.g. 'update_fault_priorities'.`);
60
- }
61
- else if (namespace.length + 1 + tool.name.length > exports.AI_TOOLS_MAX_EXPOSED_NAME_LENGTH) {
62
- errors.push(`${label}: '${namespace}_${tool.name}' must be at most ${exports.AI_TOOLS_MAX_EXPOSED_NAME_LENGTH} characters.`);
63
- }
64
- validateText(tool.title, "title", label, errors);
65
- validateText(tool.description, "description", label, errors);
66
- validateSchema(tool.inputSchema, "inputSchema", label, errors);
67
- if (tool.outputSchema !== undefined) {
68
- validateSchema(tool.outputSchema, "outputSchema", label, errors);
69
- }
70
- validateAnnotations(tool.annotations, label, errors);
71
- };
72
- const validateExtensionAiTools = (extensionId, aiTools, errors) => {
73
- const prefix = `aiTools (extension '${extensionId}')`;
74
- if (!isRecord(aiTools)) {
75
- errors.push(`${prefix}: must be an object.`);
76
- return;
77
- }
78
- const bytes = serializedBytes(aiTools);
79
- if (bytes === undefined) {
80
- errors.push(`${prefix}: must be serializable.`);
81
- return;
82
- }
83
- if (bytes > exports.AI_TOOLS_MAX_DECLARATION_BYTES) {
84
- errors.push(`${prefix}: must be at most ${exports.AI_TOOLS_MAX_DECLARATION_BYTES} bytes as JSON, found ${bytes}.`);
85
- return;
86
- }
87
- const { namespace, tools } = aiTools;
88
- const validNamespace = typeof namespace === "string" && NAMESPACE_PATTERN.test(namespace);
89
- if (!validNamespace) {
90
- errors.push(`${prefix}: 'namespace' must be kebab-case (lowercase letters, digits, single dashes).`);
91
- }
92
- if (!Array.isArray(tools) || tools.length === 0) {
93
- errors.push(`${prefix}: 'tools' must declare at least one tool.`);
94
- return;
95
- }
96
- if (tools.length > exports.AI_TOOLS_MAX_TOOLS) {
97
- errors.push(`${prefix}: 'tools' must declare at most ${exports.AI_TOOLS_MAX_TOOLS} tools.`);
98
- return;
99
- }
100
- tools.forEach((tool, index) => validateTool(tool, index, validNamespace ? namespace : "", prefix, errors));
101
- const names = tools.map((tool) => (isRecord(tool) ? tool.name : undefined));
102
- const duplicates = names.filter((name, index) => typeof name === "string" && names.indexOf(name) !== index);
103
- if (duplicates.length > 0) {
104
- errors.push(`${prefix}: duplicate tool names: ${[...new Set(duplicates)].join(", ")}.`);
105
- }
106
- };
107
- /**
108
- * Structural validation of `aiTools` across a manifest's extensions. Returns
109
- * human-readable errors; an empty array means valid. Shared by the build
110
- * (`updateExtensions`) and the server (`manifest-validator.ts`). Whether the
111
- * namespace is free is checked by the server only.
112
- */
113
- const validateIrisAiTools = ({ extensions }) => {
114
- const aiToolsExtensions = extensions.filter(extension => extension.type === AI_TOOLS_EXTENSION_TYPE);
115
- const errors = [];
116
- if (aiToolsExtensions.length > 1) {
117
- errors.push(`aiTools: at most one ${AI_TOOLS_EXTENSION_TYPE} per app, found ${aiToolsExtensions.map(extension => extension.id).join(", ")}.`);
118
- }
119
- extensions
120
- .filter(extension => extension.type !== AI_TOOLS_EXTENSION_TYPE && extension.aiTools !== undefined)
121
- .forEach(extension => errors.push(`aiTools (extension '${extension.id}'): only ${AI_TOOLS_EXTENSION_TYPE} may declare aiTools, not '${extension.type}'.`));
122
- aiToolsExtensions.forEach(extension => {
123
- if (!EXTENSION_ID_PATTERN.test(extension.id)) {
124
- errors.push(`aiTools (extension '${extension.id}'): the ${AI_TOOLS_EXTENSION_TYPE} id may contain only letters, digits, '-' and '_'.`);
125
- }
126
- validateExtensionAiTools(extension.id, extension.aiTools, errors);
127
- });
128
- return errors;
129
- };
130
- exports.validateIrisAiTools = validateIrisAiTools;
131
- /** `validateIrisAiTools` for a manifest's extensions, reading `aiTools` from any type that has it. */
132
- const validateManifestAiTools = (extensions) => (0, exports.validateIrisAiTools)({
133
- extensions: extensions.map(extension => ({
134
- id: extension.id,
135
- type: extension.type,
136
- aiTools: "aiTools" in extension ? extension.aiTools : undefined,
137
- })),
138
- });
139
- exports.validateManifestAiTools = validateManifestAiTools;
140
- //# sourceMappingURL=irisAiToolsValidation.js.map