pi-mono-figma 0.2.1 → 0.2.2

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,5 +1,13 @@
1
1
  # pi-mono-figma
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ ### Maintenance
8
+
9
+ - Update pi core imports and peer dependencies to the new `@earendil-works` package scope.
10
+
3
11
  ## 0.2.1
4
12
 
5
13
  ### Patch Changes
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  import { registerFigmaTools } from "./src/figma-tools.js";
3
3
 
4
4
  export default function figmaExtension(pi: ExtensionAPI): void {
@@ -15,8 +15,8 @@
15
15
  "./tool-result": "./src/tool-result.ts"
16
16
  },
17
17
  "peerDependencies": {
18
- "@mariozechner/pi-coding-agent": "*",
19
- "@mariozechner/pi-tui": "*",
18
+ "@earendil-works/pi-coding-agent": "*",
19
+ "@earendil-works/pi-tui": "*",
20
20
  "@sinclair/typebox": "*"
21
21
  }
22
22
  }
@@ -3,8 +3,8 @@ import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { homedir } from "node:os";
4
4
  import { dirname, resolve } from "node:path";
5
5
  import { promisify } from "node:util";
6
- import type { ExtensionAPI, ExtensionCommandContext, ExtensionContext } from "@mariozechner/pi-coding-agent";
7
- import { Key, matchesKey } from "@mariozechner/pi-tui";
6
+ import type { ExtensionAPI, ExtensionCommandContext, ExtensionContext } from "@earendil-works/pi-coding-agent";
7
+ import { Key, matchesKey } from "@earendil-works/pi-tui";
8
8
  import { Type } from "@sinclair/typebox";
9
9
  import { ApiError } from "./errors.js";
10
10
  import { MissingAuthTokenError, readAuthToken, setAuthTokenOverride, type ReadAuthTokenOptions } from "./auth.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mono-figma",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Pi extension and skill for Figma design context tools",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -16,7 +16,7 @@
16
16
  "pi-common"
17
17
  ],
18
18
  "peerDependencies": {
19
- "@mariozechner/pi-coding-agent": "*",
19
+ "@earendil-works/pi-coding-agent": "*",
20
20
  "@sinclair/typebox": "*"
21
21
  },
22
22
  "pi": {
@@ -36,10 +36,17 @@ const FigmaNodeProcessingOptions = {
36
36
  includeComponentInternals: Type.Optional(Type.Boolean({ description: "Expand component instance internals. Defaults to false." })),
37
37
  };
38
38
 
39
+ const RenderFormatSchema = Type.Union([Type.Literal("png"), Type.Literal("jpg"), Type.Literal("svg"), Type.Literal("pdf")], {
40
+ description: "Rendered asset format",
41
+ });
42
+ const FrameworkSchema = Type.Union([Type.Literal("react"), Type.Literal("html"), Type.Literal("vue"), Type.Literal("angular"), Type.Literal("react-native")]);
43
+ const StylingSchema = Type.Union([Type.Literal("css"), Type.Literal("css-modules"), Type.Literal("styled-components"), Type.Literal("tailwind"), Type.Literal("inline")]);
44
+ const AssetTypeSchema = Type.Union([Type.Literal("svgIcons"), Type.Literal("nodeRenders"), Type.Literal("imageFills")]);
45
+
39
46
  const FigmaOptionalRenderOptions = {
40
47
  renderImage: Type.Optional(Type.Boolean({ description: "Render the node and include image URL/local path in the response. Defaults to false." })),
41
48
  outputDir: Type.Optional(Type.String({ description: "Optional directory for downloaded rendered image files. Omit unless the user requested persistent files; by default downloads go to an OS temp directory." })),
42
- format: Type.Optional(Type.Unsafe<"png" | "jpg" | "svg" | "pdf">({ type: "string", enum: ["png", "jpg", "svg", "pdf"] })),
49
+ format: Type.Optional(RenderFormatSchema),
43
50
  scale: Type.Optional(Type.Number({ description: "Render scale for bitmap formats", minimum: 0.01, maximum: 4 })),
44
51
  };
45
52
 
@@ -63,8 +70,8 @@ export const FigmaImplementationContextParams = Type.Object({
63
70
  nodeId: NodeIdSchema,
64
71
  ...FigmaNodeProcessingOptions,
65
72
  ...FigmaOptionalRenderOptions,
66
- framework: Type.Optional(Type.Unsafe<"react" | "html" | "vue" | "angular" | "react-native">({ type: "string", enum: ["react", "html", "vue", "angular", "react-native"] })),
67
- styling: Type.Optional(Type.Unsafe<"css" | "css-modules" | "styled-components" | "tailwind" | "inline">({ type: "string", enum: ["css", "css-modules", "styled-components", "tailwind", "inline"] })),
73
+ framework: Type.Optional(FrameworkSchema),
74
+ styling: Type.Optional(StylingSchema),
68
75
  resolveTokens: Type.Optional(Type.Boolean({ description: "Resolve style and variable IDs into token names when possible. Defaults to true." })),
69
76
  includeCodeSnippets: Type.Optional(Type.Boolean({ description: "Include compact starter snippets for the selected framework/styling target. Defaults to false." })),
70
77
  maxResponseChars: MaxResponseCharsSchema,
@@ -96,7 +103,7 @@ export const FigmaRenderNodesParams = Type.Object({
96
103
  fileKey: FileKeySchema,
97
104
  nodeIds: NodeIdsSchema,
98
105
  outputDir: Type.Optional(Type.String({ description: "Optional directory for downloaded image files. Omit unless the user requested persistent files; if omitted, an OS temp directory is created." })),
99
- format: Type.Optional(Type.Unsafe<"png" | "jpg" | "svg" | "pdf">({ type: "string", enum: ["png", "jpg", "svg", "pdf"] })),
106
+ format: Type.Optional(RenderFormatSchema),
100
107
  scale: Type.Optional(Type.Number({ description: "Render scale for bitmap formats", minimum: 0.01, maximum: 4 })),
101
108
  download: Type.Optional(Type.Boolean({ description: "Download rendered assets locally. Defaults to true." })),
102
109
  maxResponseChars: MaxResponseCharsSchema,
@@ -106,7 +113,7 @@ export const FigmaExtractAssetsParams = Type.Object({
106
113
  fileKey: FileKeySchema,
107
114
  nodeId: NodeIdSchema,
108
115
  depth: Type.Optional(Type.Number({ description: "How many levels of node hierarchy to inspect for assets. Defaults to 3 and is capped at 4.", minimum: 1, maximum: 4 })),
109
- assetTypes: Type.Optional(Type.Array(Type.Unsafe<"svgIcons" | "nodeRenders" | "imageFills">({ type: "string", enum: ["svgIcons", "nodeRenders", "imageFills"] }), { description: "Asset categories to extract. Defaults to all supported categories." })),
116
+ assetTypes: Type.Optional(Type.Array(AssetTypeSchema, { description: "Asset categories to extract. Defaults to all supported categories." })),
110
117
  outputDir: Type.Optional(Type.String({ description: "Optional directory for downloaded asset files. Omit unless the user requested persistent files; by default files go to an OS temp directory." })),
111
118
  includeHidden: Type.Optional(Type.Boolean({ description: "Include hidden nodes while discovering assets. Defaults to false." })),
112
119
  maxAssets: Type.Optional(Type.Number({ description: "Maximum assets to include in the manifest. Defaults to 80.", minimum: 1, maximum: 500 })),
@@ -126,8 +133,8 @@ export const FigmaComponentImplementationHintsParams = Type.Object({
126
133
  fileKey: FileKeySchema,
127
134
  nodeId: NodeIdSchema,
128
135
  ...FigmaNodeProcessingOptions,
129
- framework: Type.Optional(Type.Unsafe<"react" | "html" | "vue" | "angular" | "react-native">({ type: "string", enum: ["react", "html", "vue", "angular", "react-native"] })),
130
- styling: Type.Optional(Type.Unsafe<"css" | "css-modules" | "styled-components" | "tailwind" | "inline">({ type: "string", enum: ["css", "css-modules", "styled-components", "tailwind", "inline"] })),
136
+ framework: Type.Optional(FrameworkSchema),
137
+ styling: Type.Optional(StylingSchema),
131
138
  includeCodeConnect: Type.Optional(Type.Boolean({ description: "Scan the local repo for Figma Code Connect mappings. Defaults to true." })),
132
139
  includeSnippet: Type.Optional(Type.Boolean({ description: "Include starter framework snippet. Defaults to false." })),
133
140
  rootDir: Type.Optional(Type.String({ description: "Optional local repo subdirectory for Code Connect scanning." })),
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
1
+ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
2
2
  import { registerAuthConfigurator, runWithAuthRetry, type AuthConfiguratorOptions } from "pi-common/auth-config";
3
3
  import { jsonToolResult, textToolResult } from "pi-common/tool-result";
4
4
  import { FigmaClient, parseFigmaUrl } from "./figma-client.js";