canicode 0.11.0 → 0.11.1

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { GetFileResponse, Node } from '@figma/rest-api-spec';
3
3
 
4
- var version = "0.11.0";
4
+ var version = "0.11.1";
5
5
 
6
6
  declare const SeveritySchema: z.ZodEnum<{
7
7
  blocking: "blocking";
@@ -1094,25 +1094,28 @@ declare const GotchaSurveySchema: z.ZodObject<{
1094
1094
  }, z.core.$strip>;
1095
1095
  type GotchaSurvey = z.infer<typeof GotchaSurveySchema>;
1096
1096
 
1097
- /**
1098
- * Acknowledgment marker — surfaced from a Figma Dev Mode annotation that
1099
- * canicode itself wrote during a roundtrip. When the analysis pipeline
1100
- * receives a list of acknowledgments, matching `(nodeId, ruleId)` issues are
1101
- * flagged `acknowledged: true` and contribute half their normal weight to
1102
- * the density score (#371).
1103
- *
1104
- * This contract is consumed by:
1105
- * - The MCP `analyze` tool (`acknowledgments?: Acknowledgment[]` input)
1106
- * - The CLI `analyze --acknowledgments <path>` flag
1107
- * - `RuleEngineOptions.acknowledgments`
1108
- *
1109
- * It is produced by the Plugin-API helper
1110
- * `extractAcknowledgmentsFromNode` / `readCanicodeAcknowledgments`
1111
- * (see `src/core/roundtrip/read-acknowledgments.ts`).
1112
- */
1113
1097
  declare const AcknowledgmentSchema: z.ZodObject<{
1114
1098
  nodeId: z.ZodString;
1115
1099
  ruleId: z.ZodString;
1100
+ intent: z.ZodOptional<z.ZodObject<{
1101
+ field: z.ZodString;
1102
+ value: z.ZodUnknown;
1103
+ scope: z.ZodEnum<{
1104
+ instance: "instance";
1105
+ definition: "definition";
1106
+ }>;
1107
+ }, z.core.$strip>>;
1108
+ sceneWriteOutcome: z.ZodOptional<z.ZodObject<{
1109
+ result: z.ZodEnum<{
1110
+ unknown: "unknown";
1111
+ succeeded: "succeeded";
1112
+ "silent-ignored": "silent-ignored";
1113
+ "api-rejected": "api-rejected";
1114
+ "user-declined-propagation": "user-declined-propagation";
1115
+ }>;
1116
+ reason: z.ZodOptional<z.ZodString>;
1117
+ }, z.core.$strip>>;
1118
+ codegenDirective: z.ZodOptional<z.ZodString>;
1116
1119
  }, z.core.$strip>;
1117
1120
  type Acknowledgment = z.infer<typeof AcknowledgmentSchema>;
1118
1121
 
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import 'crypto';
6
6
  import { homedir } from 'os';
7
7
 
8
8
  // package.json
9
- var version = "0.11.0";
9
+ var version = "0.11.1";
10
10
  var SeveritySchema = z.enum([
11
11
  "blocking",
12
12
  "risk",
@@ -791,9 +791,27 @@ function defineRule(rule) {
791
791
  ruleRegistry.register(rule);
792
792
  return rule;
793
793
  }
794
+ var AcknowledgmentIntentSchema = z.object({
795
+ field: z.string(),
796
+ value: z.unknown(),
797
+ scope: z.enum(["instance", "definition"])
798
+ });
799
+ var AcknowledgmentSceneWriteOutcomeSchema = z.object({
800
+ result: z.enum([
801
+ "succeeded",
802
+ "silent-ignored",
803
+ "api-rejected",
804
+ "user-declined-propagation",
805
+ "unknown"
806
+ ]),
807
+ reason: z.string().optional()
808
+ });
794
809
  var AcknowledgmentSchema = z.object({
795
810
  nodeId: z.string(),
796
- ruleId: z.string()
811
+ ruleId: z.string(),
812
+ intent: AcknowledgmentIntentSchema.optional(),
813
+ sceneWriteOutcome: AcknowledgmentSceneWriteOutcomeSchema.optional(),
814
+ codegenDirective: z.string().optional()
797
815
  });
798
816
  z.array(AcknowledgmentSchema);
799
817
  function normalizeNodeId(id) {