@nodaro/prompts 1.0.1 → 1.1.0
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.cjs +14242 -3773
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -46
- package/dist/index.d.ts +8 -46
- package/dist/index.js +14242 -3773
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/ref-only-references.test.ts +63 -0
- package/src/__tests__/variant-role-separation.test.ts +92 -0
- package/src/__tests__/video-reference-resolver.test.ts +5 -4
- package/src/picker-analyzer-registry.ts +4 -8
- package/src/prompt-builder.ts +11 -4
- package/src/video-reference-resolver.ts +12 -6
package/dist/index.d.cts
CHANGED
|
@@ -734,8 +734,8 @@ interface ReferenceCounts {
|
|
|
734
734
|
* `stripVideoImageTokens` strip behavior: drop the token, keep the label text.
|
|
735
735
|
* - in range, label present → `REF_BINDING[kind](label, N)`
|
|
736
736
|
* (e.g. `the person from @image_2`).
|
|
737
|
-
* - in range, no label →
|
|
738
|
-
* lands
|
|
737
|
+
* - in range, no label → the bare `@${kind}_${N}` (the ref-only default): the
|
|
738
|
+
* binding lands with no descriptive wrapper.
|
|
739
739
|
*
|
|
740
740
|
* Runs of 2+ HORIZONTAL whitespace (left behind by a dropped label-less token)
|
|
741
741
|
* collapse to one space, the result is trimmed, and an empty result becomes
|
|
@@ -1637,10 +1637,10 @@ interface PickerAnalyzerSpec {
|
|
|
1637
1637
|
declare function buildPickerAnalyzerSpec(pickerType: PickerType): PickerAnalyzerSpec;
|
|
1638
1638
|
/** Zod object: each dimension is an optional enum (single) or capped enum array
|
|
1639
1639
|
* (multi). `.strict()` blocks unknown keys. Mirrors the field cardinality. */
|
|
1640
|
-
declare function buildPickerZodSchema(spec: PickerAnalyzerSpec): z.ZodType<Record<string, string | string[]>,
|
|
1640
|
+
declare function buildPickerZodSchema(spec: PickerAnalyzerSpec): z.ZodType<Record<string, string | string[]>, unknown>;
|
|
1641
1641
|
interface PickerAnalyzer {
|
|
1642
1642
|
readonly spec: PickerAnalyzerSpec;
|
|
1643
|
-
readonly schema: z.ZodType<Record<string, string | string[]>,
|
|
1643
|
+
readonly schema: z.ZodType<Record<string, string | string[]>, unknown>;
|
|
1644
1644
|
readonly legend: string;
|
|
1645
1645
|
}
|
|
1646
1646
|
/** Memoized analyzer build: spec → Zod schema → legend, computed once per
|
|
@@ -1653,51 +1653,13 @@ declare const GAPS_SCHEMA: z.ZodDefault<z.ZodObject<{
|
|
|
1653
1653
|
picker: z.ZodString;
|
|
1654
1654
|
dimension: z.ZodString;
|
|
1655
1655
|
observed: z.ZodString;
|
|
1656
|
-
},
|
|
1657
|
-
picker: string;
|
|
1658
|
-
dimension: string;
|
|
1659
|
-
observed: string;
|
|
1660
|
-
}, {
|
|
1661
|
-
picker: string;
|
|
1662
|
-
dimension: string;
|
|
1663
|
-
observed: string;
|
|
1664
|
-
}>, "many">>;
|
|
1656
|
+
}, z.core.$strip>>>;
|
|
1665
1657
|
missingCategories: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1666
1658
|
picker: z.ZodString;
|
|
1667
1659
|
suggestedDimension: z.ZodString;
|
|
1668
1660
|
observed: z.ZodString;
|
|
1669
|
-
},
|
|
1670
|
-
|
|
1671
|
-
observed: string;
|
|
1672
|
-
suggestedDimension: string;
|
|
1673
|
-
}, {
|
|
1674
|
-
picker: string;
|
|
1675
|
-
observed: string;
|
|
1676
|
-
suggestedDimension: string;
|
|
1677
|
-
}>, "many">>;
|
|
1678
|
-
}, "strip", z.ZodTypeAny, {
|
|
1679
|
-
missingItems: {
|
|
1680
|
-
picker: string;
|
|
1681
|
-
dimension: string;
|
|
1682
|
-
observed: string;
|
|
1683
|
-
}[];
|
|
1684
|
-
missingCategories: {
|
|
1685
|
-
picker: string;
|
|
1686
|
-
observed: string;
|
|
1687
|
-
suggestedDimension: string;
|
|
1688
|
-
}[];
|
|
1689
|
-
}, {
|
|
1690
|
-
missingItems?: {
|
|
1691
|
-
picker: string;
|
|
1692
|
-
dimension: string;
|
|
1693
|
-
observed: string;
|
|
1694
|
-
}[] | undefined;
|
|
1695
|
-
missingCategories?: {
|
|
1696
|
-
picker: string;
|
|
1697
|
-
observed: string;
|
|
1698
|
-
suggestedDimension: string;
|
|
1699
|
-
}[] | undefined;
|
|
1700
|
-
}>>;
|
|
1661
|
+
}, z.core.$strip>>>;
|
|
1662
|
+
}, z.core.$strip>>;
|
|
1701
1663
|
interface PickerGaps {
|
|
1702
1664
|
readonly missingItems: ReadonlyArray<{
|
|
1703
1665
|
picker: string;
|
|
@@ -1711,7 +1673,7 @@ interface PickerGaps {
|
|
|
1711
1673
|
}>;
|
|
1712
1674
|
}
|
|
1713
1675
|
interface MultiPickerAnalyzerSpec {
|
|
1714
|
-
readonly schema: z.ZodType<Record<string, unknown>,
|
|
1676
|
+
readonly schema: z.ZodType<Record<string, unknown>, unknown>;
|
|
1715
1677
|
readonly toolName: string;
|
|
1716
1678
|
readonly legend: string;
|
|
1717
1679
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -734,8 +734,8 @@ interface ReferenceCounts {
|
|
|
734
734
|
* `stripVideoImageTokens` strip behavior: drop the token, keep the label text.
|
|
735
735
|
* - in range, label present → `REF_BINDING[kind](label, N)`
|
|
736
736
|
* (e.g. `the person from @image_2`).
|
|
737
|
-
* - in range, no label →
|
|
738
|
-
* lands
|
|
737
|
+
* - in range, no label → the bare `@${kind}_${N}` (the ref-only default): the
|
|
738
|
+
* binding lands with no descriptive wrapper.
|
|
739
739
|
*
|
|
740
740
|
* Runs of 2+ HORIZONTAL whitespace (left behind by a dropped label-less token)
|
|
741
741
|
* collapse to one space, the result is trimmed, and an empty result becomes
|
|
@@ -1637,10 +1637,10 @@ interface PickerAnalyzerSpec {
|
|
|
1637
1637
|
declare function buildPickerAnalyzerSpec(pickerType: PickerType): PickerAnalyzerSpec;
|
|
1638
1638
|
/** Zod object: each dimension is an optional enum (single) or capped enum array
|
|
1639
1639
|
* (multi). `.strict()` blocks unknown keys. Mirrors the field cardinality. */
|
|
1640
|
-
declare function buildPickerZodSchema(spec: PickerAnalyzerSpec): z.ZodType<Record<string, string | string[]>,
|
|
1640
|
+
declare function buildPickerZodSchema(spec: PickerAnalyzerSpec): z.ZodType<Record<string, string | string[]>, unknown>;
|
|
1641
1641
|
interface PickerAnalyzer {
|
|
1642
1642
|
readonly spec: PickerAnalyzerSpec;
|
|
1643
|
-
readonly schema: z.ZodType<Record<string, string | string[]>,
|
|
1643
|
+
readonly schema: z.ZodType<Record<string, string | string[]>, unknown>;
|
|
1644
1644
|
readonly legend: string;
|
|
1645
1645
|
}
|
|
1646
1646
|
/** Memoized analyzer build: spec → Zod schema → legend, computed once per
|
|
@@ -1653,51 +1653,13 @@ declare const GAPS_SCHEMA: z.ZodDefault<z.ZodObject<{
|
|
|
1653
1653
|
picker: z.ZodString;
|
|
1654
1654
|
dimension: z.ZodString;
|
|
1655
1655
|
observed: z.ZodString;
|
|
1656
|
-
},
|
|
1657
|
-
picker: string;
|
|
1658
|
-
dimension: string;
|
|
1659
|
-
observed: string;
|
|
1660
|
-
}, {
|
|
1661
|
-
picker: string;
|
|
1662
|
-
dimension: string;
|
|
1663
|
-
observed: string;
|
|
1664
|
-
}>, "many">>;
|
|
1656
|
+
}, z.core.$strip>>>;
|
|
1665
1657
|
missingCategories: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1666
1658
|
picker: z.ZodString;
|
|
1667
1659
|
suggestedDimension: z.ZodString;
|
|
1668
1660
|
observed: z.ZodString;
|
|
1669
|
-
},
|
|
1670
|
-
|
|
1671
|
-
observed: string;
|
|
1672
|
-
suggestedDimension: string;
|
|
1673
|
-
}, {
|
|
1674
|
-
picker: string;
|
|
1675
|
-
observed: string;
|
|
1676
|
-
suggestedDimension: string;
|
|
1677
|
-
}>, "many">>;
|
|
1678
|
-
}, "strip", z.ZodTypeAny, {
|
|
1679
|
-
missingItems: {
|
|
1680
|
-
picker: string;
|
|
1681
|
-
dimension: string;
|
|
1682
|
-
observed: string;
|
|
1683
|
-
}[];
|
|
1684
|
-
missingCategories: {
|
|
1685
|
-
picker: string;
|
|
1686
|
-
observed: string;
|
|
1687
|
-
suggestedDimension: string;
|
|
1688
|
-
}[];
|
|
1689
|
-
}, {
|
|
1690
|
-
missingItems?: {
|
|
1691
|
-
picker: string;
|
|
1692
|
-
dimension: string;
|
|
1693
|
-
observed: string;
|
|
1694
|
-
}[] | undefined;
|
|
1695
|
-
missingCategories?: {
|
|
1696
|
-
picker: string;
|
|
1697
|
-
observed: string;
|
|
1698
|
-
suggestedDimension: string;
|
|
1699
|
-
}[] | undefined;
|
|
1700
|
-
}>>;
|
|
1661
|
+
}, z.core.$strip>>>;
|
|
1662
|
+
}, z.core.$strip>>;
|
|
1701
1663
|
interface PickerGaps {
|
|
1702
1664
|
readonly missingItems: ReadonlyArray<{
|
|
1703
1665
|
picker: string;
|
|
@@ -1711,7 +1673,7 @@ interface PickerGaps {
|
|
|
1711
1673
|
}>;
|
|
1712
1674
|
}
|
|
1713
1675
|
interface MultiPickerAnalyzerSpec {
|
|
1714
|
-
readonly schema: z.ZodType<Record<string, unknown>,
|
|
1676
|
+
readonly schema: z.ZodType<Record<string, unknown>, unknown>;
|
|
1715
1677
|
readonly toolName: string;
|
|
1716
1678
|
readonly legend: string;
|
|
1717
1679
|
}
|