@crewx/sdk 0.9.0-rc.181 → 0.9.0-rc.182
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/app/app.d.ts +1 -0
- package/dist/app/index.js +8 -8
- package/dist/esm/app/index.js +7 -7
- package/dist/esm/index.js +294 -280
- package/dist/esm/publish/index.js +2 -2
- package/dist/esm/skills/index.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +296 -282
- package/dist/mcp-app/agent-access.d.ts +8 -1
- package/dist/mcp-app/index.d.ts +1 -0
- package/dist/mcp-app/view-call.d.ts +7 -0
- package/dist/mcp-app/workspace-snapshot.d.ts +2 -1
- package/dist/publish/index.js +2 -2
- package/dist/skills/index.js +2 -2
- package/dist/ui-instance/index.d.ts +2 -2
- package/dist/ui-instance/store.d.ts +2 -1
- package/dist/ui-instance/types.d.ts +39 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { ActionReceipt, ActionReceiptResultSummary, ActionExecutionReceipt, ActionReceiptOutcome, CreateUiInstanceInput, JsonObject, JsonPrimitive, JsonValue, UiActionHandlerContext, UiActionHandlerRegistration, UiActionHandlerResult, UiActionEnvelope, UiActionConfirmation, UiSkillBackendEnvironmentKey, UiActor, UiDefinition, UiDefinitionAction, UiDefinitionDisplayMode, UiDefinitionInput, UiDefinitionLegacyMetadata, UiDefinitionRef, UiDefinitionUsage, UiProjectionPolicy, UiExecutionContext, UiAuthenticatedActor, UiTaskActorSnapshot, UiAuthenticatedExecutionContext, UiApprovalRequestContext, UiTaskExecutionContext, UiApprovalDecisionProvenance, UiApprovalPendingReceipt, UiApprovalRequestReceiptResult, UiAuthenticatedGrantPolicy, UiServerRuntimeFacade, UiServerRuntimeOptions, UiAgentContextProjection, UiExternalActionHandlerRegistration, UiAgentOpenReason, UiAgentOpenRequest, UiInstance, UiInstanceStatus, UiLocalGrantPolicy, UiRuntimeFacade, UiRuntimeOptions, UiStateActionHandlerRegistration, } from './types.js';
|
|
2
|
-
export { isUiAuthenticatedActor, resolveUiEffectiveCapabilities } from './types.js';
|
|
1
|
+
export type { ActionReceipt, ActionReceiptResultSummary, ActionExecutionReceipt, ActionReceiptOutcome, CreateUiInstanceInput, JsonObject, JsonPrimitive, JsonValue, UiActionHandlerContext, UiActionHandlerRegistration, UiActionHandlerResult, UiActionImageDescriptor, UiActionEnvelope, UiActionConfirmation, UiSkillBackendEnvironmentKey, UiActor, UiDefinition, UiDefinitionAction, UiDefinitionDisplayMode, UiDefinitionInput, UiDefinitionLegacyMetadata, UiDefinitionRef, UiDefinitionUsage, UiProjectionPolicy, UiExecutionContext, UiAuthenticatedActor, UiTaskActorSnapshot, UiAuthenticatedExecutionContext, UiApprovalRequestContext, UiTaskExecutionContext, UiApprovalDecisionProvenance, UiApprovalPendingReceipt, UiApprovalRequestReceiptResult, UiAuthenticatedGrantPolicy, UiServerRuntimeFacade, UiServerRuntimeOptions, UiAgentContextProjection, UiExternalActionHandlerRegistration, UiAgentOpenReason, UiAgentOpenRequest, UiInstance, UiInstanceStatus, UiLocalGrantPolicy, UiRuntimeFacade, UiRuntimeOptions, UiStateActionHandlerRegistration, UiViewCallActionResult, UiViewCallHandler, UiViewCallHandlerContext, UiViewCallHandlerRegistration, UiViewCallHandlerResponse, } from './types.js';
|
|
2
|
+
export { DEFAULT_UI_DEFINITION_USAGE, UI_VIEW_CALL_HANDLER_NAME, UI_VIEW_CALL_IMAGE_RESULT_KEY, isUiAuthenticatedActor, resolveUiEffectiveCapabilities, } from './types.js';
|
|
3
3
|
export { UiRuntimeError } from './errors.js';
|
|
4
4
|
export type { UiRuntimeErrorCode } from './errors.js';
|
|
5
5
|
export { projectSafeJsonObject, redactJsonPaths } from './json.js';
|
|
@@ -197,7 +197,7 @@ export declare class UiInstanceStore {
|
|
|
197
197
|
settleApprovalPendingReceipt(receiptId: string, outcome: 'rejected' | 'expired' | 'conflicted', provenance: UiApprovalDecisionProvenance, now: number): ActionReceipt | null;
|
|
198
198
|
getLatestReceiptForInstance(instanceId: string): ActionReceipt | null;
|
|
199
199
|
runStateOnly(reservation: ReservationInput, handler: StateHandlerExecution['handle']): ActionReceipt;
|
|
200
|
-
reserveExternal(reservation: ReservationInput): ExternalReservation;
|
|
200
|
+
reserveExternal(reservation: ReservationInput, readOnly?: boolean): ExternalReservation;
|
|
201
201
|
reserveApprovalPendingReceipt(reservation: ReservationInput, receiptId: string, provenance: UiApprovalDecisionProvenance): ApprovalPendingReservationResult;
|
|
202
202
|
settleExternal(input: {
|
|
203
203
|
reservation: ReservationInput;
|
|
@@ -207,6 +207,7 @@ export declare class UiInstanceStore {
|
|
|
207
207
|
state: JsonObject;
|
|
208
208
|
resultSummary: JsonObject | null;
|
|
209
209
|
errorCode: string | null;
|
|
210
|
+
readOnly?: boolean;
|
|
210
211
|
apply?: () => ReturnType<StateHandlerExecution['handle']>;
|
|
211
212
|
restoreRevisionOnFailure?: boolean;
|
|
212
213
|
now: number;
|
|
@@ -6,6 +6,19 @@ export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
|
6
6
|
export interface JsonObject {
|
|
7
7
|
[key: string]: JsonValue;
|
|
8
8
|
}
|
|
9
|
+
export declare const UI_VIEW_CALL_HANDLER_NAME: "view.call";
|
|
10
|
+
export declare const UI_VIEW_CALL_IMAGE_RESULT_KEY: "crewxImage";
|
|
11
|
+
export type UiActionImageDescriptor = JsonObject & {
|
|
12
|
+
readonly ref: string;
|
|
13
|
+
readonly mediaType: 'image/png';
|
|
14
|
+
readonly width: number;
|
|
15
|
+
readonly height: number;
|
|
16
|
+
readonly bytes: number;
|
|
17
|
+
readonly sha256: string;
|
|
18
|
+
};
|
|
19
|
+
export type UiViewCallActionResult = JsonObject & {
|
|
20
|
+
readonly [UI_VIEW_CALL_IMAGE_RESULT_KEY]: UiActionImageDescriptor;
|
|
21
|
+
};
|
|
9
22
|
export type UiInstanceStatus = 'active' | 'completed' | 'expired' | 'revoked' | 'unsupported';
|
|
10
23
|
export interface UiDefinitionRef {
|
|
11
24
|
id: string;
|
|
@@ -20,6 +33,7 @@ export type UiSkillBackendEnvironmentKey = 'CREWX_APP_INSTANCE_ID' | 'CREWX_THRE
|
|
|
20
33
|
export interface UiDefinitionAction {
|
|
21
34
|
readonly capabilities: readonly string[];
|
|
22
35
|
readonly inputKeys?: readonly string[];
|
|
36
|
+
readonly mutation?: boolean;
|
|
23
37
|
readonly dataInputs?: readonly string[];
|
|
24
38
|
readonly confirmation?: UiActionConfirmation;
|
|
25
39
|
readonly resultProjection?: UiProjectionPolicy;
|
|
@@ -249,6 +263,27 @@ export interface UiActionHandlerContext {
|
|
|
249
263
|
};
|
|
250
264
|
schedule?: AppScheduleSnapshot;
|
|
251
265
|
}
|
|
266
|
+
export interface UiViewCallHandlerContext extends UiActionHandlerContext {
|
|
267
|
+
readonly actionId: string;
|
|
268
|
+
}
|
|
269
|
+
export type UiViewCallHandlerResponse = {
|
|
270
|
+
readonly result: JsonObject;
|
|
271
|
+
readonly image: UiActionImageDescriptor;
|
|
272
|
+
readonly outcome?: never;
|
|
273
|
+
readonly errorCode?: never;
|
|
274
|
+
readonly state?: never;
|
|
275
|
+
readonly content?: never;
|
|
276
|
+
readonly schedule?: never;
|
|
277
|
+
} | {
|
|
278
|
+
readonly outcome: 'rejected' | 'failed';
|
|
279
|
+
readonly errorCode: string;
|
|
280
|
+
readonly result?: never;
|
|
281
|
+
readonly image?: never;
|
|
282
|
+
readonly state?: never;
|
|
283
|
+
readonly content?: never;
|
|
284
|
+
readonly schedule?: never;
|
|
285
|
+
};
|
|
286
|
+
export type UiViewCallHandler = (context: UiViewCallHandlerContext) => Promise<UiViewCallHandlerResponse>;
|
|
252
287
|
export type UiActionHandlerResult = {
|
|
253
288
|
state?: JsonObject;
|
|
254
289
|
result?: JsonObject;
|
|
@@ -274,7 +309,11 @@ export interface UiExternalActionHandlerRegistration {
|
|
|
274
309
|
actionId: string;
|
|
275
310
|
kind: 'external';
|
|
276
311
|
handle: (context: UiActionHandlerContext) => Promise<UiActionHandlerResult>;
|
|
312
|
+
readonly viewCallHandler?: UiViewCallHandler;
|
|
277
313
|
}
|
|
314
|
+
export type UiViewCallHandlerRegistration = UiExternalActionHandlerRegistration & {
|
|
315
|
+
readonly viewCallHandler: UiViewCallHandler;
|
|
316
|
+
};
|
|
278
317
|
export type UiActionHandlerRegistration = UiStateActionHandlerRegistration | UiExternalActionHandlerRegistration;
|
|
279
318
|
export interface UiRuntimeOptions {
|
|
280
319
|
dbPath?: string;
|