@crewx/sdk 0.9.0-rc.111 → 0.9.0-rc.113
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/esm/index.js +161 -159
- package/dist/esm/plugins/index.js +63 -62
- package/dist/esm/publish/index.js +2 -2
- package/dist/esm/repository/index.js +81 -80
- package/dist/index.d.ts +8 -7
- package/dist/index.js +162 -160
- package/dist/lifecycle/process-owner.d.ts +20 -0
- package/dist/mcp-app/index.d.ts +2 -0
- package/dist/mcp-app/sqlite-browse.d.ts +89 -0
- package/dist/mcp-app/workspace-snapshot.d.ts +2 -0
- package/dist/plugins/index.js +62 -61
- package/dist/provider/cli/adapter.types.d.ts +5 -1
- package/dist/provider/cli/adapters/codex-item.d.ts +1 -0
- package/dist/provider/cli/adapters/index.d.ts +4 -0
- package/dist/provider/cli/index.d.ts +3 -2
- package/dist/provider/cli/protocol-envelope.d.ts +1 -0
- package/dist/publish/index.js +2 -2
- package/dist/repository/index.js +81 -80
- package/dist/ui-plugin/types.d.ts +2 -1
- package/dist/utils/crewx-executable.d.ts +23 -1
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ProcessOwnerIdentity {
|
|
2
|
+
pid: number;
|
|
3
|
+
pidStartIdentity: string;
|
|
4
|
+
host: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ProcessOwnerProbe {
|
|
7
|
+
isAlive(pid: number): boolean | 'unknown';
|
|
8
|
+
getStartIdentity(pid: number): string | null;
|
|
9
|
+
}
|
|
10
|
+
export type ProcessOwnerAssessment = {
|
|
11
|
+
kind: 'live';
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'dead';
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'reused';
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'unknown';
|
|
18
|
+
reason: 'identity-unknown';
|
|
19
|
+
};
|
|
20
|
+
export declare function assessProcessOwner(recorded: ProcessOwnerIdentity, current: ProcessOwnerIdentity, probe: ProcessOwnerProbe): ProcessOwnerAssessment;
|
package/dist/mcp-app/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export { buildMcpAppsContext } from './apps-context.js';
|
|
|
12
12
|
export type { McpAppsContext } from './apps-context.js';
|
|
13
13
|
export { buildStateSetHandler, createStateSetHandler, } from './state-set.js';
|
|
14
14
|
export type { StateSetHandlerBuildInput } from './state-set.js';
|
|
15
|
+
export { SQLITE_BROWSE_ACTION_IDS, SQLITE_BROWSE_DB_IDS, SQLITE_BROWSE_HANDLER, SQLITE_BROWSE_PAGE_SIZE, SQLITE_BROWSE_PLUGIN_ID, SQLITE_BROWSE_RELATIVE_PATH, SQLITE_BROWSE_ROWID_KEY, SqliteBrowseError, buildSqliteBrowseHandler, isSqliteBrowseOrigin, planSqliteBrowse, projectSqliteBrowse, } from './sqlite-browse.js';
|
|
16
|
+
export type { SqliteBrowseActionId, SqliteBrowseCell, SqliteBrowseDbId, SqliteBrowseErrorCode, SqliteBrowseExecutePort, SqliteBrowseExecuteResult, SqliteBrowseHandlerBuildInput, SqliteBrowseOrigin, SqliteBrowseParameter, SqliteBrowsePlan, SqliteBrowsePlanInput, SqliteBrowseRawRow, SqliteBrowseState, } from './sqlite-browse.js';
|
|
15
17
|
export { MCP_APP_HOST_TOOL_ALLOWLIST, MCP_APP_LOCAL_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_URI_PREFIX, } from './types.js';
|
|
16
18
|
export type { McpAppActionDispatcherToolInput, McpAppActionToolDescriptor, McpAppActionToolInput, McpAppButtonDescriptor, McpAppButtonInput, McpAppDescriptor, McpAppDescriptorInput, McpAppInputSchema, McpAppTone, McpUiResourceCsp, McpAppRegistry, McpAppResource, McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppHostToolInput, McpAppHostToolName, McpAppReadToolInput, McpAppSingleActionToolInput, McpAppToolCommonInput, McpAppToolDescriptor, McpAppToolInput, McpAppToolMetadata, McpAppToolRegistration, McpAppToolResult, McpAppToolVisibility, McpAppInstanceResourceBinding, McpAppMcpResourceBinding, McpAppResourceBinding, McpAppLocalResource, McpAppLocalRegistrationInput, McpAppLocalReadToolDescriptor, McpAppLocalActionToolDescriptor, McpAppLocalToolDescriptor, McpAppLocalRegistration, McpAppBuiltinRegistration, McpAppResolvedRegistration, McpAppLocalLauncher, McpAppBuiltinLauncher, McpAppLauncher, WorkspaceAppLauncher, WorkspaceAppResolvedRegistration, McpAppWorkspaceRegistry, WorkspaceAppRegistry, McpAppWorkspaceRegistryInput, } from './types.js';
|
|
17
19
|
export { buildWorkspaceAppSnapshot, discoverWorkspaceAppSnapshot, reconfirmWorkspaceAppSnapshot, } from './workspace-snapshot.js';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { UiExternalActionHandlerRegistration } from '../ui-instance/types.js';
|
|
2
|
+
import type { UiPluginNormalizedManifestV2 } from '../ui-plugin/types.js';
|
|
3
|
+
export declare const SQLITE_BROWSE_HANDLER: "sqlite.browse";
|
|
4
|
+
export declare const SQLITE_BROWSE_PLUGIN_ID: "crewx-app-sqlite-browser";
|
|
5
|
+
export declare const SQLITE_BROWSE_RELATIVE_PATH: "apps/sqlite-browser";
|
|
6
|
+
export declare const SQLITE_BROWSE_PAGE_SIZE: 50;
|
|
7
|
+
export declare const SQLITE_BROWSE_ROWID_KEY: "__crewx_browse_rowid";
|
|
8
|
+
export declare const SQLITE_BROWSE_DB_IDS: readonly ["crewx", "cache", "sessions", "traces"];
|
|
9
|
+
export type SqliteBrowseDbId = typeof SQLITE_BROWSE_DB_IDS[number];
|
|
10
|
+
export declare const SQLITE_BROWSE_ACTION_IDS: readonly ["list_tables", "open_table", "next_page"];
|
|
11
|
+
export type SqliteBrowseActionId = typeof SQLITE_BROWSE_ACTION_IDS[number];
|
|
12
|
+
export type SqliteBrowseParameter = string | number | null;
|
|
13
|
+
export type SqliteBrowseRawRow = Readonly<Record<string, unknown>>;
|
|
14
|
+
export type SqliteBrowseErrorCode = 'INPUT_INVALID' | 'LIMIT_EXCEEDED' | 'ROWID_INVALID' | 'EXECUTION_FAILED';
|
|
15
|
+
export type SqliteBrowseExecuteResult = readonly SqliteBrowseRawRow[] | {
|
|
16
|
+
readonly rows: readonly SqliteBrowseRawRow[];
|
|
17
|
+
} | {
|
|
18
|
+
readonly error: string;
|
|
19
|
+
};
|
|
20
|
+
export type SqliteBrowsePlan = {
|
|
21
|
+
readonly kind: 'list_tables';
|
|
22
|
+
readonly dbId: SqliteBrowseDbId;
|
|
23
|
+
readonly sql: string;
|
|
24
|
+
readonly parameters: readonly [];
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'table_info';
|
|
27
|
+
readonly dbId: SqliteBrowseDbId;
|
|
28
|
+
readonly table: string;
|
|
29
|
+
readonly sql: string;
|
|
30
|
+
readonly parameters: readonly [];
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'page';
|
|
33
|
+
readonly dbId: SqliteBrowseDbId;
|
|
34
|
+
readonly table: string;
|
|
35
|
+
readonly afterRowid: number;
|
|
36
|
+
readonly sql: string;
|
|
37
|
+
readonly parameters: readonly [number];
|
|
38
|
+
};
|
|
39
|
+
export interface SqliteBrowseExecutePort {
|
|
40
|
+
execute(plan: SqliteBrowsePlan): SqliteBrowseExecuteResult | PromiseLike<SqliteBrowseExecuteResult>;
|
|
41
|
+
}
|
|
42
|
+
export interface SqliteBrowseOrigin {
|
|
43
|
+
readonly source: string;
|
|
44
|
+
readonly relativePath: string;
|
|
45
|
+
readonly pluginId: string;
|
|
46
|
+
readonly definitionId: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SqliteBrowseState {
|
|
49
|
+
readonly dbId: SqliteBrowseDbId;
|
|
50
|
+
readonly tables: readonly string[];
|
|
51
|
+
readonly selectedTable: string | null;
|
|
52
|
+
readonly columns: readonly string[];
|
|
53
|
+
readonly rows: readonly (readonly SqliteBrowseCell[])[];
|
|
54
|
+
readonly cursor: number | null;
|
|
55
|
+
readonly nextCursor: number | null;
|
|
56
|
+
readonly truncated: boolean;
|
|
57
|
+
readonly pageLimited: boolean;
|
|
58
|
+
readonly rowSkipped: boolean;
|
|
59
|
+
readonly error: string | null;
|
|
60
|
+
}
|
|
61
|
+
export type SqliteBrowseCell = string | number | boolean | null;
|
|
62
|
+
export declare class SqliteBrowseError extends Error {
|
|
63
|
+
readonly code: SqliteBrowseErrorCode;
|
|
64
|
+
readonly name = "SqliteBrowseError";
|
|
65
|
+
constructor(code: SqliteBrowseErrorCode, message?: string);
|
|
66
|
+
}
|
|
67
|
+
export type SqliteBrowsePlanInput = {
|
|
68
|
+
readonly kind: 'list_tables';
|
|
69
|
+
readonly dbId: unknown;
|
|
70
|
+
} | {
|
|
71
|
+
readonly kind: 'table_info';
|
|
72
|
+
readonly dbId: unknown;
|
|
73
|
+
readonly table: unknown;
|
|
74
|
+
} | {
|
|
75
|
+
readonly kind: 'page';
|
|
76
|
+
readonly dbId: unknown;
|
|
77
|
+
readonly table: unknown;
|
|
78
|
+
readonly afterRowid?: unknown;
|
|
79
|
+
};
|
|
80
|
+
export declare function planSqliteBrowse(input: SqliteBrowsePlanInput): SqliteBrowsePlan;
|
|
81
|
+
export declare function isSqliteBrowseOrigin(candidate: SqliteBrowseOrigin): boolean;
|
|
82
|
+
export declare function projectSqliteBrowse(plan: SqliteBrowsePlan, rows: readonly SqliteBrowseRawRow[], columns?: readonly string[], tables?: readonly string[]): SqliteBrowseState;
|
|
83
|
+
export interface SqliteBrowseHandlerBuildInput {
|
|
84
|
+
readonly normalized: UiPluginNormalizedManifestV2;
|
|
85
|
+
readonly actionId: string;
|
|
86
|
+
readonly execute: SqliteBrowseExecutePort;
|
|
87
|
+
}
|
|
88
|
+
export declare function buildSqliteBrowseHandler(normalized: UiPluginNormalizedManifestV2, actionId: string, execute: SqliteBrowseExecutePort): UiExternalActionHandlerRegistration | undefined;
|
|
89
|
+
export declare function buildSqliteBrowseHandler(input: SqliteBrowseHandlerBuildInput): UiExternalActionHandlerRegistration | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AppDiscoveryFileSystem, type WorkspaceAppDiagnostic, type WorkspaceAppDiscoveryOptions, type WorkspaceAppDiscoveryResult } from './discovery.js';
|
|
2
|
+
import { type SqliteBrowseExecutePort } from './sqlite-browse.js';
|
|
2
3
|
import type { JsonObject, UiActionHandlerRegistration, UiDefinition, UiDefinitionRef } from '../ui-instance/types.js';
|
|
3
4
|
import type { McpAppLauncher, McpAppLocalResource, McpAppRegistry, McpAppWorkspaceRegistry } from './types.js';
|
|
4
5
|
export interface WorkspaceAppSnapshotResource extends McpAppLocalResource {
|
|
@@ -17,6 +18,7 @@ export interface WorkspaceAppSnapshotBuildOptions {
|
|
|
17
18
|
readonly builtins?: McpAppRegistry;
|
|
18
19
|
readonly builtin?: McpAppRegistry;
|
|
19
20
|
readonly registry?: McpAppRegistry;
|
|
21
|
+
readonly sqliteBrowse?: SqliteBrowseExecutePort;
|
|
20
22
|
}
|
|
21
23
|
export type WorkspaceAppSnapshotOptions = WorkspaceAppDiscoveryOptions & WorkspaceAppSnapshotBuildOptions;
|
|
22
24
|
export interface WorkspaceAppSnapshot {
|