@builder.io/dev-tools 1.24.0-dev.202602060949.9613162d0 → 1.24.0-dev.202602061409.e623db468
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/cli/index.cjs +339 -108
- package/cli/index.cjs.map +2 -2
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +3 -3
- package/server/index.cjs +2 -2
- package/server/index.mjs +2 -2
- package/types/_tests_/utils.d.ts +48 -35
- package/types/cli/abort-signal-any.d.ts +3 -1
- package/types/cli/auth/auth-utils.d.ts +3 -1
- package/types/cli/auth/auth.d.ts +5 -1
- package/types/cli/backup.d.ts +114 -60
- package/types/cli/builder-add/interface.d.ts +21 -4
- package/types/cli/code-file-utils.d.ts +11 -8
- package/types/cli/code.d.ts +13 -3
- package/types/cli/codegen.d.ts +8 -0
- package/types/cli/credentials.d.ts +61 -45
- package/types/cli/detectors/nextjs.d.ts +4 -1
- package/types/cli/detectors/svelte.d.ts +4 -1
- package/types/cli/detectors/vue.d.ts +4 -1
- package/types/cli/download.d.ts +9 -4
- package/types/cli/dsi-mcp.d.ts +4 -1
- package/types/cli/fetch.d.ts +7 -2
- package/types/cli/figma-publish.d.ts +34 -17
- package/types/cli/figma-utils.d.ts +51 -21
- package/types/cli/figma.d.ts +9 -2
- package/types/cli/generate.d.ts +14 -11
- package/types/cli/incremental-tsc.d.ts +19 -7
- package/types/cli/index.d.ts +154 -154
- package/types/cli/launch/InitStateMachine.d.ts +156 -89
- package/types/cli/launch/config.d.ts +13 -3
- package/types/cli/launch/dry-run-backup.d.ts +14 -7
- package/types/cli/launch/errors.d.ts +7 -2
- package/types/cli/launch/grafana.d.ts +5 -1
- package/types/cli/launch/helpers.d.ts +19 -10
- package/types/cli/launch/machine-health.d.ts +8 -3
- package/types/cli/launch/proxy.d.ts +11 -4
- package/types/cli/launch/server.d.ts +19 -12
- package/types/cli/launch/vscode-tunnel-manager.d.ts +77 -68
- package/types/cli/launch.d.ts +109 -106
- package/types/cli/prettier.d.ts +9 -2
- package/types/cli/repo-connect/env-collector.d.ts +16 -11
- package/types/cli/repo-connect/file-collector.d.ts +22 -15
- package/types/cli/repo-connect/git-detector.d.ts +13 -11
- package/types/cli/repo-connect/install-runner.d.ts +8 -5
- package/types/cli/repo-connect/package-detector.d.ts +12 -8
- package/types/cli/repo-connect/repo-connect.d.ts +4 -1
- package/types/cli/repo-indexing/component-discovery.d.ts +30 -17
- package/types/cli/repo-indexing/icons.d.ts +36 -24
- package/types/cli/repo-indexing/installation.d.ts +22 -14
- package/types/cli/repo-indexing/repo-indexing-utils.d.ts +138 -79
- package/types/cli/repo-indexing/repo-indexing.d.ts +37 -17
- package/types/cli/repo-indexing/repo-indexing.mock.d.ts +3 -3
- package/types/cli/repo-indexing/tokens.d.ts +44 -25
- package/types/cli/repo-indexing/types.d.ts +2 -0
- package/types/cli/repo-metrics-utils.d.ts +13 -5
- package/types/cli/repo-metrics.d.ts +4 -1
- package/types/cli/report/figma-report.d.ts +63 -36
- package/types/cli/server-ws.d.ts +40 -32
- package/types/cli/spinner.d.ts +4 -4
- package/types/cli/track.d.ts +4 -1
- package/types/cli/utils/agent-discovery.d.ts +10 -5
- package/types/cli/utils/codegen-utils.d.ts +9 -0
- package/types/cli/utils/component-group-mdx-prompt.d.ts +2 -1
- package/types/cli/utils/discovery-test-utils.d.ts +3 -1
- package/types/cli/utils/env-capture.d.ts +21 -15
- package/types/cli/utils/env-substitution.d.ts +4 -1
- package/types/cli/utils/feature-flags.d.ts +3 -1
- package/types/cli/utils/file-overrides-manager.d.ts +39 -23
- package/types/cli/utils/git.d.ts +28 -16
- package/types/cli/utils/hosts-file-manager.d.ts +7 -4
- package/types/cli/utils/lock-file.d.ts +10 -7
- package/types/cli/utils/parseGitDiff.d.ts +4 -1
- package/types/cli/utils/process-tracker.d.ts +85 -51
- package/types/cli/utils/repo-indexing-agent-prompt.d.ts +1 -1
- package/types/cli/utils/rules-discovery.d.ts +10 -5
- package/types/cli/utils/rules-parser.d.ts +5 -1
- package/types/cli/utils/terminal-buffer.d.ts +23 -23
- package/types/cli/utils/workspace-path-resolver.d.ts +23 -16
- package/types/cli/utils/yaml-frontmatter.d.ts +10 -6
- package/types/client/client-api.d.ts +42 -10
- package/types/client/edit-button/document-listeners.d.ts +3 -1
- package/types/client/edit-button/index.d.ts +6 -6
- package/types/client/menu/index.d.ts +3 -3
- package/types/client/menu/pages/component-detail.d.ts +8 -2
- package/types/client/menu/pages/component-input.d.ts +5 -1
- package/types/client/menu/pages/component-list.d.ts +4 -1
- package/types/client/menu/toggle/menu-toggle.d.ts +4 -1
- package/types/client/setup-ui/overview.d.ts +2 -2
- package/types/client/tracking.d.ts +11 -11
- package/types/client/utils.d.ts +5 -3
- package/types/common/ast/app-dependencies.d.ts +8 -2
- package/types/common/ast/component-info.d.ts +26 -6
- package/types/common/ast/component-input-types.d.ts +28 -9
- package/types/common/ast/component-registry.d.ts +23 -8
- package/types/common/ast/convert-values.d.ts +40 -8
- package/types/common/ast/ensure-array-statement.d.ts +7 -3
- package/types/common/ast/ensure-comments.d.ts +5 -1
- package/types/common/ast/ensure-imports.d.ts +10 -5
- package/types/common/ast/exported-statements.d.ts +8 -4
- package/types/common/ast/imported-statements.d.ts +5 -1
- package/types/common/ast/normalize-statements.d.ts +12 -3
- package/types/common/ast/remove-unused-imports.d.ts +4 -1
- package/types/common/ast/transform.d.ts +13 -3
- package/types/common/ast/utils.d.ts +42 -19
- package/types/common/builder/builder-api.d.ts +32 -23
- package/types/common/builder/builder-sdks.d.ts +10 -8
- package/types/common/builder/content-generation.d.ts +10 -7
- package/types/common/builder/content-ids.d.ts +2 -1
- package/types/common/cache.d.ts +4 -1
- package/types/common/constants.d.ts +2 -1
- package/types/common/dotenv.d.ts +24 -5
- package/types/common/errors.d.ts +50 -22
- package/types/common/fs.d.ts +17 -4
- package/types/common/interactive-select-files.d.ts +16 -2
- package/types/common/mem-sys.d.ts +7 -5
- package/types/common/node-request.d.ts +4 -4
- package/types/common/path.d.ts +1 -3
- package/types/common/test-utils.d.ts +21 -7
- package/types/common/typescript.d.ts +26 -7
- package/types/common/utils.d.ts +36 -8
- package/types/core/adapters/angular/angular-api-key.d.ts +29 -6
- package/types/core/adapters/angular/angular-app-module-imports.d.ts +12 -2
- package/types/core/adapters/angular/angular-app-routes-update.d.ts +6 -1
- package/types/core/adapters/angular/angular-components.d.ts +40 -12
- package/types/core/adapters/angular/angular-ensure-builder-setup.d.ts +9 -3
- package/types/core/adapters/angular/angular-ensure-config-plugin.d.ts +16 -4
- package/types/core/adapters/angular/angular-fix-tsconfig.d.ts +3 -1
- package/types/core/adapters/angular/angular-registry-parse.d.ts +22 -10
- package/types/core/adapters/angular/angular-registry.d.ts +15 -2
- package/types/core/adapters/angular/angular-test-utils.d.ts +8 -4
- package/types/core/adapters/angular/index.d.ts +20 -12
- package/types/core/adapters/angular/types.d.ts +5 -5
- package/types/core/adapters/next/index.d.ts +26 -18
- package/types/core/adapters/next/next-api-key.d.ts +4 -1
- package/types/core/adapters/next/next-component-info.d.ts +9 -2
- package/types/core/adapters/next/next-components.d.ts +4 -1
- package/types/core/adapters/next/next-ensure-builder-setup.d.ts +6 -2
- package/types/core/adapters/next/next-ensure-config-plugin.d.ts +5 -1
- package/types/core/adapters/next/next-registry-parse.d.ts +21 -8
- package/types/core/adapters/next/next-registry.d.ts +15 -2
- package/types/core/adapters/next/next-test-utils.d.ts +21 -11
- package/types/core/adapters/qwik-city/index.d.ts +14 -6
- package/types/core/adapters/qwik-city/qwik-api-key.d.ts +4 -1
- package/types/core/adapters/qwik-city/qwik-component-source-inputs.d.ts +4 -1
- package/types/core/adapters/qwik-city/qwik-components.d.ts +23 -8
- package/types/core/adapters/qwik-city/qwik-ensure-builder-setup.d.ts +6 -2
- package/types/core/adapters/qwik-city/qwik-ensure-config-plugin.d.ts +5 -1
- package/types/core/adapters/qwik-city/qwik-registry-parse.d.ts +22 -10
- package/types/core/adapters/qwik-city/qwik-registry.d.ts +15 -2
- package/types/core/adapters/qwik-city/qwik-test-utils.d.ts +8 -4
- package/types/core/adapters/qwik-city/qwik-ts-program.d.ts +3 -1
- package/types/core/adapters/react/index.d.ts +19 -11
- package/types/core/adapters/react/react-api-key.d.ts +4 -1
- package/types/core/adapters/react/react-builder-sdk-setup.d.ts +3 -1
- package/types/core/adapters/react/react-component-info.d.ts +9 -2
- package/types/core/adapters/react/react-components.d.ts +37 -11
- package/types/core/adapters/react/react-ensure-builder-setup.d.ts +6 -2
- package/types/core/adapters/react/react-registry-parse.d.ts +21 -8
- package/types/core/adapters/react/react-registry.d.ts +15 -2
- package/types/core/adapters/react/react-test-utils.d.ts +11 -5
- package/types/core/adapters/react/react-ts-program.d.ts +3 -1
- package/types/core/adapters/remix/index.d.ts +19 -11
- package/types/core/adapters/remix/remix-api-key.d.ts +4 -1
- package/types/core/adapters/remix/remix-components.d.ts +4 -1
- package/types/core/adapters/remix/remix-ensure-builder-setup.d.ts +9 -3
- package/types/core/adapters/remix/remix-ensure-config-plugin.d.ts +5 -1
- package/types/core/adapters/remix/remix-registry-parse.d.ts +22 -10
- package/types/core/adapters/remix/remix-registry.d.ts +15 -2
- package/types/core/adapters/remix/remix-test-utils.d.ts +11 -5
- package/types/core/adapters/vite/vite-ensure-config-plugin.d.ts +12 -2
- package/types/core/adapters/vue/index.d.ts +20 -12
- package/types/core/adapters/vue/vue-api-key.d.ts +4 -1
- package/types/core/adapters/vue/vue-components.d.ts +10 -2
- package/types/core/adapters/vue/vue-ensure-builder-setup.d.ts +7 -3
- package/types/core/adapters/vue/vue-registry-parse.d.ts +19 -9
- package/types/core/adapters/vue/vue-registry.d.ts +6 -3
- package/types/core/adapters/webpack/webpack-config-helpers.d.ts +8 -3
- package/types/core/adapters/webpack/webpack-ensure-config-plugin.d.ts +5 -1
- package/types/core/create-dev-tools.d.ts +4 -1
- package/types/core/detect-frameworks.d.ts +7 -2
- package/types/core/ensure-config-plugin.d.ts +6 -2
- package/types/core/find-dependencies.d.ts +6 -3
- package/types/core/import-export-registry.d.ts +9 -2
- package/types/core/index.d.ts +18 -3
- package/types/figma/index.d.ts +95 -64
- package/types/node/node-sys.d.ts +13 -6
- package/types/remix/index.d.ts +5 -3
- package/types/server/auth.d.ts +4 -1
- package/types/server/builder-connect.d.ts +21 -6
- package/types/server/client-script.d.ts +6 -2
- package/types/server/create-dev-tools-server.d.ts +3 -1
- package/types/server/dev-tools-api.d.ts +4 -1
- package/types/server/dev-tools-http-server.d.ts +3 -1
- package/types/server/index.d.ts +28 -1
- package/types/server/request-handler.d.ts +6 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types/codegen-server.d.ts +1 -1
- package/types/types/connection-tracker.d.ts +34 -34
- package/types/types/proxy-middleware.d.ts +25 -15
- package/types/types/websocket-types.d.ts +9 -7
- package/types/types.d.ts +387 -358
- package/types/vite/main.d.ts +1 -1
- package/types/webpack/main.d.ts +5 -5
- package/types/cli/code-tools.test.d.ts +0 -1
- package/types/cli/github-cli.test.d.ts +0 -1
- package/vendors/darwin-arm64/complete/rg.bash +0 -783
- package/vendors/darwin-arm64/complete/rg.fish +0 -175
- package/vendors/darwin-arm64/doc/rg.1 +0 -2178
- package/vendors/darwin-arm64/rg +0 -0
- package/vendors/darwin-x64/complete/rg.bash +0 -783
- package/vendors/darwin-x64/complete/rg.fish +0 -175
- package/vendors/darwin-x64/doc/rg.1 +0 -2178
- package/vendors/darwin-x64/rg +0 -0
- package/vendors/linux-arm64/complete/rg.bash +0 -783
- package/vendors/linux-arm64/complete/rg.fish +0 -175
- package/vendors/linux-arm64/doc/rg.1 +0 -2178
- package/vendors/linux-arm64/rg +0 -0
- package/vendors/linux-x64/complete/rg.bash +0 -783
- package/vendors/linux-x64/complete/rg.fish +0 -175
- package/vendors/linux-x64/doc/rg.1 +0 -2178
- package/vendors/linux-x64/rg +0 -0
- package/vendors/win32-x64/rg.exe +0 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/COPYING +0 -3
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/LICENSE-MIT +0 -21
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/README.md +0 -516
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/UNLICENSE +0 -24
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/_rg +0 -665
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/_rg.ps1 +0 -213
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/rg.bash +0 -783
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/rg.fish +0 -175
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/CHANGELOG.md +0 -1689
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/FAQ.md +0 -1046
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/GUIDE.md +0 -1022
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/rg.1 +0 -2178
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/rg.exe +0 -0
|
@@ -1,74 +1,105 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../../core";
|
|
2
2
|
import { type Credentials } from "../credentials";
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
DesignSystem,
|
|
5
|
+
GenerateUserMessage,
|
|
6
|
+
WorkspaceConfiguration,
|
|
7
|
+
UpdateDesignSystemInput,
|
|
8
|
+
DesignSystemScope,
|
|
9
|
+
DisplayDesignSystem,
|
|
10
|
+
IndexDocumentV1,
|
|
11
|
+
AclPolicy,
|
|
12
|
+
PrivacyMode,
|
|
13
|
+
} from "$/ai-utils";
|
|
4
14
|
export declare const AGENT_FILE = "AGENTS.md";
|
|
5
15
|
export declare const ICONS_FILE = "icons.mdx";
|
|
6
16
|
export declare const TOKENS_FILE = "tokens.mdx";
|
|
7
17
|
export declare const INSTALLATION_FILE = "installation.md";
|
|
8
18
|
export declare const REPO_INDEXING_FOLDER = "repo-indexing";
|
|
9
19
|
export interface UserSettings {
|
|
10
|
-
|
|
11
|
-
|
|
20
|
+
isAdminInOrganization: boolean;
|
|
21
|
+
email: string;
|
|
12
22
|
}
|
|
13
23
|
interface GetAllDesignSystemsOpts {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
/**
|
|
25
|
+
* If true, only design systems that the user has permission to edit will be
|
|
26
|
+
* returned. If false, all design systems that the user has permission to edit
|
|
27
|
+
* as well as design systems that the user has permission to read but not edit
|
|
28
|
+
* will be returned. Defaults to false.
|
|
29
|
+
*/
|
|
30
|
+
onlyEditAccess?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* If true, design systems that are scoped to the global space will be included.
|
|
33
|
+
* Defaults to false.
|
|
34
|
+
*/
|
|
35
|
+
includeGlobalScopeDesignSystems?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* If true, the # of component docs in each design system will also be returned.
|
|
38
|
+
* Defaults to false.
|
|
39
|
+
*/
|
|
40
|
+
includeDocumentCount?: boolean;
|
|
31
41
|
}
|
|
32
|
-
export declare const promptForDesignSystemScope: (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
export declare const promptForDesignSystemScope: (
|
|
43
|
+
credentials: Credentials,
|
|
44
|
+
userSettings: UserSettings | null,
|
|
45
|
+
selectedScope?: DesignSystemScope,
|
|
46
|
+
) => Promise<DesignSystemScope | undefined>;
|
|
47
|
+
export declare const parseDesignSystem: (
|
|
48
|
+
sys: DevToolsSys,
|
|
49
|
+
designSystemPackage?: string,
|
|
50
|
+
) => Promise<{
|
|
51
|
+
name: any;
|
|
52
|
+
version: string | undefined;
|
|
36
53
|
}>;
|
|
37
|
-
export declare const storeComponentDocs: (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
export declare const storeComponentDocs: (
|
|
55
|
+
credentials: Credentials,
|
|
56
|
+
body: IndexDocumentV1,
|
|
57
|
+
debug?: boolean,
|
|
58
|
+
) => Promise<any>;
|
|
59
|
+
export declare const runCodeGen: (
|
|
60
|
+
sys: DevToolsSys,
|
|
61
|
+
credentials: Credentials,
|
|
62
|
+
sessionId: string,
|
|
63
|
+
message: GenerateUserMessage,
|
|
64
|
+
debug?: boolean,
|
|
65
|
+
designSystemPackage?: string,
|
|
66
|
+
workspaceConfig?: WorkspaceConfiguration,
|
|
67
|
+
opts?: {
|
|
68
|
+
tags?: object;
|
|
69
|
+
maxTokens?: number;
|
|
70
|
+
retriesAllowed?: number;
|
|
71
|
+
/**
|
|
72
|
+
* What kind of file to expect from the LLM.
|
|
73
|
+
* `'tool'`: The LLM will use the Write tool to output the file. We will intercept that
|
|
74
|
+
* and keep the file contents in-memory. File is not written to disk.
|
|
75
|
+
* `string`: The LLM will write the file directly to the file system. We will read the
|
|
76
|
+
* contents into memory and then delete the file from the file system. This is useful
|
|
77
|
+
* for writing large files that would otherwise consume a lot of tokens.
|
|
78
|
+
*/
|
|
79
|
+
expectFile?: "tool" | string;
|
|
80
|
+
/**
|
|
81
|
+
* Glob pattern(s) to include for access control.
|
|
82
|
+
* When specified, only these patterns will be accessible by default.
|
|
83
|
+
* Can be a single string or array of strings.
|
|
84
|
+
*/
|
|
85
|
+
include?: string | string[];
|
|
86
|
+
/**
|
|
87
|
+
* Glob pattern(s) to exclude for access control.
|
|
88
|
+
* These patterns will be denied access even if included.
|
|
89
|
+
* Can be a single string or array of strings.
|
|
90
|
+
*/
|
|
91
|
+
exclude?: string | string[];
|
|
92
|
+
/**
|
|
93
|
+
* Extra instructions to be taken into account during repo indexing.
|
|
94
|
+
*/
|
|
95
|
+
instructions?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Privacy mode settings for encryption key handling.
|
|
98
|
+
*/
|
|
99
|
+
privacyMode?: PrivacyMode;
|
|
100
|
+
},
|
|
101
|
+
metadata?: any,
|
|
102
|
+
) => Promise<string>;
|
|
72
103
|
/**
|
|
73
104
|
* Generates an ACL policy for repo indexing based on include/exclude patterns.
|
|
74
105
|
*
|
|
@@ -90,24 +121,52 @@ export declare const runCodeGen: (sys: DevToolsSys, credentials: Credentials, se
|
|
|
90
121
|
* const policy2 = generateRepoIndexingAclPolicy("src/**\/*", "dist/**");
|
|
91
122
|
* ```
|
|
92
123
|
*/
|
|
93
|
-
export declare const generateRepoIndexingAclPolicy: (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
export declare function getAllDesignSystems(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
export declare const
|
|
112
|
-
|
|
124
|
+
export declare const generateRepoIndexingAclPolicy: (
|
|
125
|
+
include?: string | string[],
|
|
126
|
+
exclude?: string | string[],
|
|
127
|
+
) => AclPolicy;
|
|
128
|
+
export declare function getAllDesignSystems(
|
|
129
|
+
credentials: Credentials,
|
|
130
|
+
opts: {
|
|
131
|
+
includeDocumentCount: true;
|
|
132
|
+
} & Omit<GetAllDesignSystemsOpts, "includeDocumentCount">,
|
|
133
|
+
): Promise<DisplayDesignSystem[]>;
|
|
134
|
+
export declare function getAllDesignSystems(
|
|
135
|
+
credentials: Credentials,
|
|
136
|
+
opts?: GetAllDesignSystemsOpts,
|
|
137
|
+
): Promise<DesignSystem[]>;
|
|
138
|
+
export declare const getDesignSystemsByScope: (
|
|
139
|
+
scope: DesignSystemScope,
|
|
140
|
+
designSystems: DesignSystem[],
|
|
141
|
+
) => DesignSystem[];
|
|
142
|
+
export declare const getDesignSystemByName: (
|
|
143
|
+
designSystemName: string,
|
|
144
|
+
designSystems: DesignSystem[],
|
|
145
|
+
) => DesignSystem | null;
|
|
146
|
+
export declare const getDesignSystemByNameAndScope: (
|
|
147
|
+
credentials: Credentials,
|
|
148
|
+
designSystemName: string,
|
|
149
|
+
scope: DesignSystemScope,
|
|
150
|
+
designSystems: DesignSystem[],
|
|
151
|
+
) => DesignSystem | null;
|
|
152
|
+
export declare const addDesignSystem: (
|
|
153
|
+
credentials: Credentials,
|
|
154
|
+
body: {
|
|
155
|
+
designSystemName: string;
|
|
156
|
+
designSystemVersion?: string;
|
|
157
|
+
designSystemPackage?: string;
|
|
158
|
+
status: string;
|
|
159
|
+
scope: DesignSystemScope;
|
|
160
|
+
gitOriginUrl: string | undefined;
|
|
161
|
+
gitRelativePath: string | undefined;
|
|
162
|
+
cliArgs: string[];
|
|
163
|
+
},
|
|
164
|
+
) => Promise<any>;
|
|
165
|
+
export declare const updateDesignSystem: (
|
|
166
|
+
credentials: Credentials,
|
|
167
|
+
body: UpdateDesignSystemInput,
|
|
168
|
+
) => Promise<any>;
|
|
169
|
+
export declare const checkRepoIndexingFolder: (
|
|
170
|
+
sys: DevToolsSys,
|
|
171
|
+
) => Promise<boolean>;
|
|
113
172
|
export {};
|
|
@@ -2,23 +2,43 @@ import type { DevToolsSys } from "../../types";
|
|
|
2
2
|
import type { CLIArgs } from "../index";
|
|
3
3
|
import { type Credentials } from "../credentials";
|
|
4
4
|
import type { ComponentTask, TokenTask } from "./types";
|
|
5
|
-
export declare const displayComponentLibrarySummary: (
|
|
5
|
+
export declare const displayComponentLibrarySummary: (
|
|
6
|
+
components: ComponentTask[],
|
|
7
|
+
indexedComponents: ComponentTask[],
|
|
8
|
+
startTime: number,
|
|
9
|
+
failedComponents: string[] | undefined,
|
|
10
|
+
isForce: boolean | undefined,
|
|
11
|
+
designSystemName: string,
|
|
12
|
+
designSystemId?: string,
|
|
13
|
+
numIconsIndexed?: number,
|
|
14
|
+
tokenGroupsFound?: TokenTask[],
|
|
15
|
+
tokenGroupsToIndex?: TokenTask[],
|
|
16
|
+
tokenGroupsFailed?: string[],
|
|
17
|
+
) => void;
|
|
6
18
|
export interface RepoIndexingDoc {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
name: string;
|
|
20
|
+
content:
|
|
21
|
+
| string
|
|
22
|
+
| {
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
components: string[];
|
|
26
|
+
relevantFiles: string[];
|
|
27
|
+
}[];
|
|
28
|
+
createdDate: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
ownerId: string;
|
|
32
|
+
userId: string;
|
|
19
33
|
}
|
|
20
|
-
export declare const runRepoIndexing: (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
export declare const runRepoIndexing: (
|
|
35
|
+
sys: DevToolsSys,
|
|
36
|
+
args: CLIArgs,
|
|
37
|
+
) => Promise<void>;
|
|
38
|
+
export declare const isFeatureAllowed: (
|
|
39
|
+
credentials: Credentials,
|
|
40
|
+
debug?: boolean,
|
|
41
|
+
) => Promise<{
|
|
42
|
+
isAllowed: boolean;
|
|
43
|
+
reason?: string;
|
|
24
44
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const mockDeps: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
getStoredComponentDocs: () => Promise<never[]>;
|
|
3
|
+
storeComponentDocs: () => Promise<{}>;
|
|
4
|
+
runCodeGen: () => Promise<string>;
|
|
5
5
|
};
|
|
@@ -1,28 +1,47 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../../types";
|
|
2
2
|
import type { TokenTask } from "./types";
|
|
3
3
|
import type { Credentials } from "../credentials";
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
4
|
+
import type {
|
|
5
|
+
WorkspaceConfiguration,
|
|
6
|
+
TokenDocument,
|
|
7
|
+
PrivacyMode,
|
|
8
|
+
} from "$/ai-utils";
|
|
9
|
+
export declare const discoverTokens: (
|
|
10
|
+
sys: DevToolsSys,
|
|
11
|
+
credentials: Credentials,
|
|
12
|
+
sessionId: string,
|
|
13
|
+
remoteTokens: TokenDocument[],
|
|
14
|
+
opts?: {
|
|
15
|
+
force?: boolean;
|
|
16
|
+
designSystemPackage?: string;
|
|
17
|
+
workspaceConfig?: WorkspaceConfiguration;
|
|
18
|
+
debug?: boolean;
|
|
19
|
+
include?: string | string[];
|
|
20
|
+
exclude?: string | string[];
|
|
21
|
+
instructions?: string;
|
|
22
|
+
privacyMode?: PrivacyMode;
|
|
23
|
+
},
|
|
24
|
+
) => Promise<
|
|
25
|
+
| {
|
|
26
|
+
tokenGroupsToIndex: TokenTask[];
|
|
27
|
+
discoveredTokenGroups: TokenTask[];
|
|
28
|
+
}
|
|
29
|
+
| undefined
|
|
30
|
+
>;
|
|
31
|
+
export declare const processTokens: (
|
|
32
|
+
sys: DevToolsSys,
|
|
33
|
+
credentials: Credentials,
|
|
34
|
+
sessionId: string,
|
|
35
|
+
group: TokenTask,
|
|
36
|
+
opts: {
|
|
37
|
+
designSystemId: string;
|
|
38
|
+
designSystemPackage?: string;
|
|
39
|
+
designSystemVersion?: string;
|
|
40
|
+
debug?: boolean;
|
|
41
|
+
workspaceConfig?: WorkspaceConfiguration;
|
|
42
|
+
include?: string | string[];
|
|
43
|
+
exclude?: string | string[];
|
|
44
|
+
instructions?: string;
|
|
45
|
+
privacyMode?: PrivacyMode;
|
|
46
|
+
},
|
|
47
|
+
) => Promise<void>;
|
|
@@ -15,6 +15,8 @@ export interface TokenTask extends BaseTask {
|
|
|
15
15
|
type: "token";
|
|
16
16
|
relevantFiles: string[];
|
|
17
17
|
tokens: string[];
|
|
18
|
+
/** Map of token name to its default value (e.g., "--spacing-1": "4px") */
|
|
19
|
+
tokenValues?: Record<string, string>;
|
|
18
20
|
hash: string;
|
|
19
21
|
}
|
|
20
22
|
export interface IconTask extends BaseTask {
|
|
@@ -10,14 +10,16 @@ export declare function safeReadFile(filePath: string): string | null;
|
|
|
10
10
|
* Package manager information
|
|
11
11
|
*/
|
|
12
12
|
export interface PackageManagerInfo {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
manager: "npm" | "yarn" | "pnpm" | "bun";
|
|
14
|
+
setupCommand: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Detect the package manager at the root level based on lock files
|
|
18
18
|
* Returns the specific package manager command for setup
|
|
19
19
|
*/
|
|
20
|
-
export declare function detectRootPackageManager(
|
|
20
|
+
export declare function detectRootPackageManager(
|
|
21
|
+
files: string[],
|
|
22
|
+
): PackageManagerInfo | null;
|
|
21
23
|
/**
|
|
22
24
|
* Check if a file exists at the root level
|
|
23
25
|
*/
|
|
@@ -25,8 +27,14 @@ export declare function hasRootFile(files: string[], fileName: string): boolean;
|
|
|
25
27
|
/**
|
|
26
28
|
* Check if any file matches a pattern at the root level
|
|
27
29
|
*/
|
|
28
|
-
export declare function hasRootFileMatching(
|
|
30
|
+
export declare function hasRootFileMatching(
|
|
31
|
+
files: string[],
|
|
32
|
+
predicate: (fileName: string) => boolean,
|
|
33
|
+
): boolean;
|
|
29
34
|
/**
|
|
30
35
|
* Check if a directory exists at the root level
|
|
31
36
|
*/
|
|
32
|
-
export declare function hasRootDirectory(
|
|
37
|
+
export declare function hasRootDirectory(
|
|
38
|
+
files: string[],
|
|
39
|
+
directoryName: string,
|
|
40
|
+
): boolean;
|
|
@@ -15,4 +15,7 @@ export declare function isExactVersion(version: string | undefined): boolean;
|
|
|
15
15
|
* @param basePath - Absolute path to the repository root
|
|
16
16
|
* @param rootPath - Relative path within the repository to analyze (default: "/" for entire repo)
|
|
17
17
|
*/
|
|
18
|
-
export declare function collectRepoMetrics(
|
|
18
|
+
export declare function collectRepoMetrics(
|
|
19
|
+
sys: DevToolsSys,
|
|
20
|
+
basePath: string,
|
|
21
|
+
): Promise<RepoMetrics>;
|
|
@@ -1,54 +1,81 @@
|
|
|
1
1
|
import type { FigmaComponentInfo } from "$/ai-utils";
|
|
2
2
|
import type { CLIArgs } from "..";
|
|
3
3
|
import type { DevToolsSys } from "../../core";
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
PublishedComponent,
|
|
6
|
+
PublishedComponentSet,
|
|
7
|
+
} from "@figma/rest-api-spec";
|
|
5
8
|
type Context = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
sys: DevToolsSys;
|
|
10
|
+
args: CLIArgs;
|
|
11
|
+
debug: (msg: unknown) => void;
|
|
12
|
+
figmaAuth: {
|
|
13
|
+
access_token: string;
|
|
14
|
+
oauth: boolean;
|
|
15
|
+
};
|
|
13
16
|
};
|
|
14
17
|
/**
|
|
15
18
|
* A component or component set
|
|
16
19
|
*/
|
|
17
20
|
type FigmaTeamComponent = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
/** The unique identifier for the component. */
|
|
22
|
+
key: string;
|
|
23
|
+
/** The unique identifier of the Figma file that contains the component. */
|
|
24
|
+
file_key: string;
|
|
25
|
+
/** The unique identifier of the component node within the Figma file. */
|
|
26
|
+
node_id: string;
|
|
27
|
+
/** A URL to a thumbnail image of the component. */
|
|
28
|
+
thumbnail_url?: string;
|
|
29
|
+
/** The name of the component. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** The description of the component as entered by the publisher. */
|
|
32
|
+
description: string;
|
|
33
|
+
/** The component data. */
|
|
34
|
+
componentData?: FigmaComponentInfo;
|
|
35
|
+
/** Whether the component is published. */
|
|
36
|
+
isPublished?: boolean;
|
|
34
37
|
};
|
|
35
38
|
export declare function extractFigmaIds(url: string): {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
teamId?: string;
|
|
40
|
+
fileKey?: string;
|
|
41
|
+
nodeId?: string;
|
|
39
42
|
};
|
|
40
|
-
export declare function fetchTeamComponents(
|
|
41
|
-
|
|
43
|
+
export declare function fetchTeamComponents(
|
|
44
|
+
context: Context,
|
|
45
|
+
teamId: string,
|
|
46
|
+
onProgress: () => void,
|
|
47
|
+
): Promise<PublishedComponent[]>;
|
|
48
|
+
export declare function fetchTeamComponentSets(
|
|
49
|
+
context: Context,
|
|
50
|
+
teamId: string,
|
|
51
|
+
onProgress: () => void,
|
|
52
|
+
): Promise<PublishedComponentSet[]>;
|
|
42
53
|
/**
|
|
43
54
|
* Returns a list of components and component sets that are present in the file or selection as
|
|
44
55
|
* well as a set of remote keys for components that are referenced but not present.
|
|
45
56
|
*/
|
|
46
|
-
export declare function processFileOrSelection(
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
export declare function processFileOrSelection(
|
|
58
|
+
context: Context,
|
|
59
|
+
fileKey: string,
|
|
60
|
+
nodeId?: string,
|
|
61
|
+
): Promise<{
|
|
62
|
+
fileComponents: FigmaTeamComponent[];
|
|
63
|
+
remoteKeys: Set<string>;
|
|
49
64
|
}>;
|
|
50
|
-
export declare function fetchRemoteComponentData(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
export declare function fetchRemoteComponentData(
|
|
66
|
+
context: Context,
|
|
67
|
+
remoteKeys: Set<string>,
|
|
68
|
+
): Promise<(FigmaTeamComponent | undefined)[]>;
|
|
69
|
+
export declare function resolveComponentData(
|
|
70
|
+
context: Context,
|
|
71
|
+
components: FigmaTeamComponent[],
|
|
72
|
+
): Promise<FigmaTeamComponent[]>;
|
|
73
|
+
export declare function generateComponentReport(
|
|
74
|
+
component: FigmaTeamComponent,
|
|
75
|
+
baseDir: string,
|
|
76
|
+
): Promise<void>;
|
|
77
|
+
export declare const runFigmaReport: (
|
|
78
|
+
sys: DevToolsSys,
|
|
79
|
+
args: CLIArgs,
|
|
80
|
+
) => Promise<void>;
|
|
54
81
|
export {};
|
package/types/cli/server-ws.d.ts
CHANGED
|
@@ -3,48 +3,56 @@ import type { IncomingMessage } from "node:http";
|
|
|
3
3
|
import type { ServerOptions } from "ws";
|
|
4
4
|
import type { WebSocket } from "ws";
|
|
5
5
|
export interface SocketRequest {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
id: number;
|
|
7
|
+
jsonrpc: string;
|
|
8
|
+
method: string;
|
|
9
|
+
params: any;
|
|
10
10
|
}
|
|
11
11
|
export interface SocketResponse<T = any> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
id?: number | null;
|
|
13
|
+
jsonrpc: string;
|
|
14
|
+
result?: T;
|
|
15
|
+
notification?: string;
|
|
16
|
+
params?: any;
|
|
17
|
+
error?: {
|
|
18
|
+
code: number;
|
|
19
|
+
message: string;
|
|
20
|
+
data?: any;
|
|
21
|
+
};
|
|
22
22
|
}
|
|
23
23
|
export interface SocketSendOptions {
|
|
24
|
-
|
|
24
|
+
timeout?: number;
|
|
25
25
|
}
|
|
26
26
|
export interface SocketQueue {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
type: "request" | "notification";
|
|
28
|
+
result?: SocketResponse["result"];
|
|
29
|
+
error?: SocketResponse["error"];
|
|
30
30
|
}
|
|
31
31
|
type RegisterFn<T = any> = (params: T, socketId: string) => Promise<any> | any;
|
|
32
32
|
interface SocketEvents {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
listening: () => Promise<void> | void;
|
|
34
|
+
connection: (socket: WebSocket, socketId: string) => Promise<void> | void;
|
|
35
|
+
disconnection: (socketId: string) => Promise<void> | void;
|
|
36
|
+
error: (error: Error) => Promise<void> | void;
|
|
37
|
+
"socket-error": (socketId: string, error: Error) => Promise<void> | void;
|
|
38
|
+
close: () => Promise<void> | void;
|
|
39
39
|
}
|
|
40
40
|
export declare function RPCWebSocketServer(opts: ServerOptions): {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
on: <EventKey extends keyof SocketEvents>(
|
|
42
|
+
event: EventKey,
|
|
43
|
+
cb: SocketEvents[EventKey],
|
|
44
|
+
) => void;
|
|
45
|
+
event: (e: string) => void;
|
|
46
|
+
handleUpgrade: (
|
|
47
|
+
req: IncomingMessage,
|
|
48
|
+
socket: Duplex,
|
|
49
|
+
upgradeHead: Buffer,
|
|
50
|
+
callback?: (client: WebSocket, request: IncomingMessage) => void,
|
|
51
|
+
) => Promise<void>;
|
|
52
|
+
clients: () => Map<string, WebSocket>;
|
|
53
|
+
register: <T = any>(method: string, fn: RegisterFn<T>) => void;
|
|
54
|
+
emit: (name: string, ...params: any[]) => void;
|
|
55
|
+
notify: (name: string, socketId: string, ...params: any[]) => void;
|
|
56
|
+
close: () => Promise<unknown>;
|
|
49
57
|
};
|
|
50
58
|
export {};
|