@crewx/sdk 0.9.0-rc.136 → 0.9.0-rc.137

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.
@@ -0,0 +1,59 @@
1
+ import type { JsonValue } from '../ui-instance/types.js';
2
+ import type { UiPluginManifestMode, UiPluginManifestV2, UiPluginValidationErrorCode } from './types.js';
3
+ export declare const APP_MANIFEST_FILE = "manifest.json";
4
+ export declare const LEGACY_APP_MANIFEST_FILE = "ui-plugin.json";
5
+ export declare const APP_MANIFEST_FILES: readonly ["manifest.json", "ui-plugin.json"];
6
+ export type AppManifestFileName = (typeof APP_MANIFEST_FILES)[number];
7
+ export declare const MCPB_MANIFEST_VERSION = "0.3";
8
+ export declare const CREWX_META_NAMESPACE = "dev.crewx";
9
+ export declare const MCPB_MANIFEST_KEYS: readonly ["manifest_version", "name", "display_name", "version", "description", "long_description", "author", "repository", "homepage", "documentation", "support", "icon", "icons", "screenshots", "localization", "server", "tools", "tools_generated", "prompts", "prompts_generated", "keywords", "license", "privacy_policies", "compatibility", "user_config", "_meta"];
10
+ export declare const APP_MANIFEST_REQUIRED_KEYS: readonly ["manifest_version", "name", "display_name", "version", "description", "_meta"];
11
+ export declare const APP_MANIFEST_PASSTHROUGH_KEYS: readonly ("name" | "description" | "tools" | "server" | "version" | "_meta" | "icon" | "manifest_version" | "display_name" | "long_description" | "author" | "repository" | "homepage" | "documentation" | "support" | "icons" | "screenshots" | "localization" | "tools_generated" | "prompts" | "prompts_generated" | "keywords" | "license" | "privacy_policies" | "compatibility" | "user_config")[];
12
+ export declare const CREWX_META_REQUIRED_KEYS: readonly ["entry", "surfaces", "size", "stateProjection", "actions"];
13
+ export declare const CREWX_META_OPTIONAL_KEYS: readonly ["definitionId", "definitionVersion", "icon", "tone", "entryHash", "runtime", "initialState", "usage", "detailPanel", "displayModes", "summaryProjection", "dataPaths", "focusedAiDataPaths", "csp"];
14
+ export declare function isAppSemver(value: unknown): value is string;
15
+ export interface AppManifestReason {
16
+ readonly path: string;
17
+ readonly rule: string;
18
+ readonly message?: string;
19
+ readonly file?: AppManifestFileName;
20
+ }
21
+ export type AppManifestRejectionCode = UiPluginValidationErrorCode | 'MANIFEST_DUAL_MISMATCH';
22
+ export interface AppManifestRejection {
23
+ readonly code: AppManifestRejectionCode;
24
+ readonly reason: AppManifestReason;
25
+ readonly files: readonly AppManifestFileName[];
26
+ }
27
+ export interface AppManifestIdentity {
28
+ readonly pluginId: string;
29
+ readonly definitionId?: string;
30
+ readonly definitionVersion?: number;
31
+ }
32
+ export interface AppManifestFileResult {
33
+ readonly file: AppManifestFileName;
34
+ readonly manifest: UiPluginManifestV2;
35
+ readonly v2Input: Readonly<Record<string, unknown>>;
36
+ readonly releaseVersion?: string;
37
+ readonly mcpb?: Readonly<Record<string, JsonValue>>;
38
+ }
39
+ export interface AppManifestSource extends AppManifestFileResult {
40
+ readonly ok: true;
41
+ readonly identity: AppManifestIdentity;
42
+ readonly files: readonly AppManifestFileName[];
43
+ }
44
+ export interface AppManifestFailure {
45
+ readonly ok: false;
46
+ readonly rejection: AppManifestRejection;
47
+ readonly parseFailure: boolean;
48
+ readonly identity?: AppManifestIdentity;
49
+ readonly builtinOnly: boolean;
50
+ }
51
+ export type AppManifestResult = AppManifestSource | AppManifestFailure;
52
+ export interface AppManifestOptions {
53
+ readonly mode?: UiPluginManifestMode;
54
+ readonly maxBytes?: number;
55
+ }
56
+ export type AppManifestFileBytes = Partial<Record<AppManifestFileName, Uint8Array>>;
57
+ export declare function claimsCrewxNamespace(bytes: Uint8Array): boolean;
58
+ export declare function appManifestDefinitionHash(manifest: UiPluginManifestV2): string;
59
+ export declare function resolveAppManifest(files: AppManifestFileBytes, options?: AppManifestOptions): AppManifestResult;
@@ -1,4 +1,6 @@
1
1
  export { canonicalManifestJson, manifestHash } from './manifest.js';
2
+ export { APP_MANIFEST_FILE, APP_MANIFEST_FILES, APP_MANIFEST_PASSTHROUGH_KEYS, APP_MANIFEST_REQUIRED_KEYS, CREWX_META_NAMESPACE, CREWX_META_OPTIONAL_KEYS, CREWX_META_REQUIRED_KEYS, LEGACY_APP_MANIFEST_FILE, MCPB_MANIFEST_KEYS, MCPB_MANIFEST_VERSION, appManifestDefinitionHash, claimsCrewxNamespace, isAppSemver, resolveAppManifest, } from './app-manifest.js';
3
+ export type { AppManifestFailure, AppManifestFileBytes, AppManifestFileName, AppManifestFileResult, AppManifestIdentity, AppManifestOptions, AppManifestReason, AppManifestRejection, AppManifestRejectionCode, AppManifestResult, AppManifestSource, } from './app-manifest.js';
2
4
  export { UiPluginValidationError, normalizeManifest, validateInitialState, validateManifest, validatePayload, } from './validator.js';
3
5
  export { UI_PLUGIN_CAPABILITY_PATTERN, UI_PLUGIN_HANDLER_PATTERN, UI_PLUGIN_IDENTIFIER_PATTERN, UI_PLUGIN_MAX_ACTIONS, UI_PLUGIN_MAX_ARRAY_LENGTH, UI_PLUGIN_MAX_CANDIDATE_DEPTH, UI_PLUGIN_MAX_COMMAND_LENGTH, UI_PLUGIN_MAX_COMMAND_PARTS, UI_PLUGIN_MAX_DISCOVERED_APPS, UI_PLUGIN_MAX_DISCOVERY_TIME_MS, UI_PLUGIN_MAX_HEIGHT, UI_PLUGIN_MAX_INITIAL_STATE_BYTES, UI_PLUGIN_MAX_JSON_DEPTH, UI_PLUGIN_MAX_MANIFEST_BYTES, UI_PLUGIN_MAX_PROJECTION_PATHS, UI_PLUGIN_MAX_SCHEMA_DEPTH, UI_PLUGIN_MAX_SCHEMA_PROPERTIES, UI_PLUGIN_MAX_STRING_LENGTH, UI_PLUGIN_MAX_SUBTREE_BYTES, UI_PLUGIN_MAX_SURFACES, UI_PLUGIN_RESERVED_STATE_KEYS, UI_PLUGIN_SAFE_PATH_PATTERN, UI_PLUGIN_SAFE_PATH_SEGMENT_PATTERN, UI_PLUGIN_SKILL_TOKEN_PATTERN, UI_PLUGIN_SURFACES, UI_PLUGIN_TONES, isUiPluginReservedStateKey, } from './limits.js';
4
6
  export type { UiPluginActivation, UiPluginAction, UiPluginBackend, UiPluginCardShellNode, UiPluginCoreBackend, UiPluginFieldSchema, UiPluginHeadingNode, UiPluginInputSchema, UiPluginJsonSchema, UiPluginJsonSchemaType, UiPluginLabeledTextNode, UiPluginLayoutNode, UiPluginLayout, UiPluginManifest, UiPluginManifestMode, UiPluginManifestV1, UiPluginManifestV2, UiPluginRuntimeRequest, UiPluginMetaBannerNode, UiPluginNormalizedManifestV2, UiPluginNormalizedV2, UiPluginPayload, UiPluginPayloadValue, UiPluginPrimitive, UiPluginProjectionPolicy, UiPluginResourceMetadata, UiPluginResourceRef, UiPluginSchemaType, UiPluginSchema, UiPluginSize, UiPluginSkillBackend, UiPluginStep, UiPluginStepFlowNode, UiPluginStepListSchema, UiPluginTextListNode, UiPluginTextListSchema, UiPluginTextSchema, UiPluginSurface, UiPluginTone, UiPluginHandlerMetadata, UiPluginValidationErrorCode, UiPluginValidationOptions, } from './types.js';
@@ -2,8 +2,11 @@ import type { UiPluginManifest, UiPluginManifestV1, UiPluginManifestV2, UiPlugin
2
2
  import type { JsonObject } from '../ui-instance/types.js';
3
3
  export declare class UiPluginValidationError extends Error {
4
4
  readonly code: UiPluginValidationErrorCode;
5
+ readonly path?: string | undefined;
6
+ readonly rule?: string | undefined;
5
7
  readonly name = "UiPluginValidationError";
6
- constructor(code: UiPluginValidationErrorCode, message?: string);
8
+ constructor(code: UiPluginValidationErrorCode, message?: string, path?: string | undefined, rule?: string | undefined);
9
+ withPathPrefix(prefix: string): UiPluginValidationError;
7
10
  }
8
11
  export declare function validateInitialState(value: unknown, dataPaths?: readonly string[]): JsonObject;
9
12
  export declare function validateManifest(input: UiPluginManifestV1, options?: UiPluginValidationOptions): UiPluginManifestV1;
@@ -1,4 +1,5 @@
1
1
  import { type CrewxExecutableResolution } from './crewx-executable';
2
+ export declare function resolveCrewxCliDisplay(env?: Readonly<Record<string, string | undefined>>): string;
2
3
  export declare function resolveCrewxCli(): string;
3
4
  export declare function resolveCrewxCliArgv(): CrewxExecutableResolution;
4
5
  export declare function resolveCrewxWorkspace(): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/sdk",
3
- "version": "0.9.0-rc.136",
3
+ "version": "0.9.0-rc.137",
4
4
  "license": "UNLICENSED",
5
5
  "engines": {
6
6
  "node": ">=20.19.0"
@@ -83,6 +83,11 @@
83
83
  "import": "./dist/account/index.js",
84
84
  "require": "./dist/account/index.js"
85
85
  },
86
+ "./app": {
87
+ "types": "./dist/app/index.d.ts",
88
+ "import": "./dist/app/index.js",
89
+ "require": "./dist/app/index.js"
90
+ },
86
91
  "./package.json": "./package.json"
87
92
  },
88
93
  "browser": {
@@ -102,6 +107,8 @@
102
107
  "./dist/esm/publish/index.js": false,
103
108
  "./dist/account/index.js": false,
104
109
  "./dist/esm/account/index.js": false,
110
+ "./dist/app/index.js": false,
111
+ "./dist/esm/app/index.js": false,
105
112
  "./dist/skills/index.js": false,
106
113
  "./dist/esm/skills/index.js": false
107
114
  },
@@ -163,7 +170,7 @@
163
170
  "vitest": "3.2.4"
164
171
  },
165
172
  "scripts": {
166
- "prebuild": "node scripts/generate-pricing.mjs && node scripts/generate-models.mjs",
173
+ "prebuild": "node ../../scripts/check-sdk-app-imports.mjs && node scripts/generate-pricing.mjs && node scripts/generate-models.mjs",
167
174
  "build:cjs": "tsup --config tsup.cjs.js",
168
175
  "build:esm": "tsup --config tsup.esm.js",
169
176
  "build:browser": "tsup --config tsup.browser.js",
@@ -287,15 +287,20 @@ layouts:
287
287
  {{env.CREWX_CLI}} notify "<title>" [--level=info|warning|critical] [--body="..."]
288
288
  ```
289
289
  ### App (`{{env.CREWX_CLI}} app`)
290
- Open CrewX Apps in this conversation and run allowed actions. Never click the screen instead.
290
+ CrewX Apps are screens that you and the user work on together (tables, boards, planners, viewers). When an App fits the request, put the result in the App instead of writing a long chat answer.
291
+
292
+ Drill down in this order. Do NOT guess action names or inputs.
291
293
  ```bash
292
- {{env.CREWX_CLI}} app list
293
- {{env.CREWX_CLI}} app open <appId>
294
- {{env.CREWX_CLI}} app state <instanceId>
294
+ {{env.CREWX_CLI}} app list # 1. which Apps exist{{#if apps.availableRendered}} (the same list is in <available_apps> below){{/if}}
295
+ {{env.CREWX_CLI}} app usage <appId> # 2. that App's manual and action table. Read it before the first run
296
+ {{env.CREWX_CLI}} app open <appId> # 3. open it in this conversation -> instanceId
295
297
  {{env.CREWX_CLI}} app run <instanceId|appId> <actionId> [--input <JSON>|-] [--request-id <id>]
298
+ {{env.CREWX_CLI}} app state <instanceId> # 4. confirm what actually changed
296
299
  {{env.CREWX_CLI}} app receipt <receiptId>
297
300
  ```
298
- Cite the receiptId in your report. On exit 3, 9, 10, or 11, do not work around it; report that you could not use the App route.
301
+ Never click the screen instead. Exit 8 = waiting for the user's one-time approval in the App window: keep this turn running and wait with `{{env.CREWX_CLI}} app receipt <receiptId> --wait=60` (repeat on exit 124); ending the turn cancels the request.
302
+ On exit 3, 9, 10, or 11, do not work around it; report that you could not use the App route. Cite the receiptId in your report.
303
+ → Full usage: `{{env.CREWX_CLI}} app usage`
299
304
  </builtin_tools>
300
305
  {{/if}}
301
306
 
@@ -318,6 +323,10 @@ layouts:
318
323
  {{/if}}
319
324
  {{/if}}
320
325
 
326
+ {{#if apps.availableRendered}}
327
+ {{{apps.availableRendered}}}
328
+ {{/if}}
329
+
321
330
  {{#if props.showCREWXMDHint}}
322
331
  <important>
323
332
  **AGENTS.md contains user's project information.**
@@ -429,6 +438,9 @@ layouts:
429
438
  </messages>
430
439
  {{/if}}
431
440
  {{#if apps.rendered}}
441
+ {{#if apps.guidanceRendered}}
442
+ {{{apps.guidanceRendered}}}
443
+ {{/if}}
432
444
  {{{apps.rendered}}}
433
445
  {{/if}}
434
446
  {{#if (eq platform 'channel/slack')}}