@tuned-tensor/cli 0.28.1 → 0.30.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.
Files changed (99) hide show
  1. package/README.md +76 -180
  2. package/dist/chunk-6CETSU2H.js +260 -0
  3. package/dist/chunk-6CETSU2H.js.map +1 -0
  4. package/dist/chunk-B2O6P7EX.js +1623 -0
  5. package/dist/chunk-B2O6P7EX.js.map +1 -0
  6. package/dist/{chunk-7CO5DBCY.js → chunk-GMBZ2FE6.js} +5046 -5014
  7. package/dist/chunk-GMBZ2FE6.js.map +1 -0
  8. package/dist/chunk-MM75IAY3.js +138 -0
  9. package/dist/chunk-MM75IAY3.js.map +1 -0
  10. package/dist/chunk-ST6ZSEUH.js +1272 -0
  11. package/dist/chunk-ST6ZSEUH.js.map +1 -0
  12. package/dist/contracts-SHBUXEOQ.js +72 -0
  13. package/dist/dataset-Y5NEUKI5.js +22 -0
  14. package/dist/dataset-Y5NEUKI5.js.map +1 -0
  15. package/dist/index.js +4530 -9349
  16. package/dist/index.js.map +1 -1
  17. package/dist/local-runtime.js +84 -467
  18. package/dist/local-runtime.js.map +1 -1
  19. package/dist/model-server-IWCRFAOO.js +18 -0
  20. package/dist/model-server-IWCRFAOO.js.map +1 -0
  21. package/dist/{prefetch-LBIOO7ZO.js → prefetch-Q2ZA3SJ7.js} +3 -2
  22. package/dist/prefetch-Q2ZA3SJ7.js.map +1 -0
  23. package/docs/local-runtime/architecture.md +4 -4
  24. package/docs/local-runtime/aws-gpu.md +4 -5
  25. package/docs/local-runtime/decision.md +2 -2
  26. package/docs/local-runtime/hosting.md +103 -92
  27. package/docs/local-runtime/model-quality.md +103 -0
  28. package/docs/local-runtime/serving.md +1 -6
  29. package/docs/local-runtime/spark.md +2 -3
  30. package/docs/spec-architecture.html +2 -26
  31. package/docs/spec-workflow.md +9 -0
  32. package/node_modules/@isaacs/nonrecursive-glob-match/LICENSE.md +55 -0
  33. package/node_modules/@isaacs/nonrecursive-glob-match/README.md +364 -0
  34. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts +123 -0
  35. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts.map +1 -0
  36. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js +778 -0
  37. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js.map +1 -0
  38. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js +3 -0
  39. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js.map +7 -0
  40. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/numeric-range.d.ts +15 -0
  41. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/numeric-range.d.ts.map +1 -0
  42. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/numeric-range.js +76 -0
  43. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/numeric-range.js.map +1 -0
  44. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/package.json +3 -0
  45. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts +4 -0
  46. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts.map +1 -0
  47. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js +142 -0
  48. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js.map +1 -0
  49. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts +123 -0
  50. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts.map +1 -0
  51. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js +774 -0
  52. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js.map +1 -0
  53. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js +3 -0
  54. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js.map +7 -0
  55. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/numeric-range.d.ts +15 -0
  56. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/numeric-range.d.ts.map +1 -0
  57. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/numeric-range.js +72 -0
  58. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/numeric-range.js.map +1 -0
  59. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/package.json +3 -0
  60. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts +4 -0
  61. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts.map +1 -0
  62. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js +138 -0
  63. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js.map +1 -0
  64. package/node_modules/@isaacs/nonrecursive-glob-match/package.json +56 -0
  65. package/node_modules/@isaacs/nonrecursive-glob-match/src/index.ts +932 -0
  66. package/node_modules/@isaacs/nonrecursive-glob-match/src/numeric-range.ts +79 -0
  67. package/node_modules/@isaacs/nonrecursive-glob-match/src/parse-class.ts +158 -0
  68. package/node_modules/minimatch/README.md +125 -107
  69. package/node_modules/minimatch/dist/commonjs/index.d.ts +49 -38
  70. package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -1
  71. package/node_modules/minimatch/dist/commonjs/index.js +782 -359
  72. package/node_modules/minimatch/dist/commonjs/index.js.map +1 -1
  73. package/node_modules/minimatch/dist/esm/index.d.ts +49 -38
  74. package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -1
  75. package/node_modules/minimatch/dist/esm/index.js +781 -356
  76. package/node_modules/minimatch/dist/esm/index.js.map +1 -1
  77. package/node_modules/minimatch/package.json +5 -4
  78. package/package.json +4 -5
  79. package/training/adapter/src/train.py +16 -1
  80. package/dist/chunk-7CO5DBCY.js.map +0 -1
  81. package/dist/chunk-FSVTMX4L.js +0 -2820
  82. package/dist/chunk-FSVTMX4L.js.map +0 -1
  83. package/node_modules/minimatch/dist/commonjs/ast.d.ts +0 -22
  84. package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +0 -1
  85. package/node_modules/minimatch/dist/commonjs/ast.js +0 -845
  86. package/node_modules/minimatch/dist/commonjs/ast.js.map +0 -1
  87. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +0 -8
  88. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +0 -1
  89. package/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
  90. package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +0 -1
  91. package/node_modules/minimatch/dist/esm/ast.d.ts +0 -22
  92. package/node_modules/minimatch/dist/esm/ast.d.ts.map +0 -1
  93. package/node_modules/minimatch/dist/esm/ast.js +0 -841
  94. package/node_modules/minimatch/dist/esm/ast.js.map +0 -1
  95. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +0 -8
  96. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +0 -1
  97. package/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
  98. package/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
  99. /package/dist/{prefetch-LBIOO7ZO.js.map → contracts-SHBUXEOQ.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-class.js","sourceRoot":"","sources":["../../src/parse-class.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,wCAAwC;;;AAExC,4CAA4C;AAC5C,MAAM,YAAY,GAA8C;IAC9D,WAAW,EAAE,CAAC,sBAAsB,CAAC;IACrC,WAAW,EAAE,CAAC,eAAe,CAAC;IAC9B,WAAW,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC;IACtC,WAAW,EAAE,CAAC,YAAY,CAAC;IAC3B,WAAW,EAAE,CAAC,SAAS,CAAC;IACxB,WAAW,EAAE,CAAC,SAAS,CAAC;IACxB,WAAW,EAAE,CAAC,cAAc,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CAAC,CAAA;IAEV,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,CAAA;AAC9D,CAAC,CAAA;AAvHY,QAAA,UAAU,cAuHtB","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { <posix class>: [<translation>, negated]\nconst posixClasses: { [k: string]: [e: string, n?: boolean] } = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}'],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}'],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f'],\n '[:blank:]': ['\\\\p{Zs}\\\\t'],\n '[:cntrl:]': ['\\\\p{Cc}'],\n '[:digit:]': ['\\\\p{Nd}'],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true],\n '[:lower:]': ['\\\\p{Ll}'],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}\\\\p{S}'],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f'],\n '[:upper:]': ['\\\\p{Lu}'],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}'],\n '[:xdigit:]': ['A-Fa-f0-9'],\n}\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n\nexport type ParseClassResult = [re: RegExp, consumed: number]\n\nexport type Form = 'NFC' | 'NFD' | 'NFKC' | 'NFKD'\n\nconst noMatch = /$./\n\n// Takes a glob string at a posix brace expression. Returns a RegExp\n// that tests one character, and the number of glob chars consumed.\n// If the class is not closed, consumed is 0, and the `[` must be\n// treated as a literal character.\n// Out of order ranges are removed. If nothing is left, the RegExp\n// is `/$./`, and the rest of the glob is consumed, so that the\n// whole glob cannot match.\nexport const parseClass = (\n glob: string,\n position: number,\n nocase: boolean = false,\n form?: Form,\n): ParseClassResult => {\n // normalize one class member, if it stays one code point\n const norm = (c: string) => {\n const n = form ? c.normalize(form) : c\n return [...n].length === 1 ? n : c\n }\n const pos = position\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression')\n }\n /* c8 ignore stop */\n const ranges: string[] = []\n const negs: string[] = []\n\n let i = pos + 1\n let sawStart = false\n let escaping = false\n let negate = false\n let endPos = pos\n let rangeStart = ''\n WHILE: while (i < glob.length) {\n const c = String.fromCodePoint(glob.codePointAt(i)!)\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true\n i++\n continue\n }\n\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1\n break\n }\n\n sawStart = true\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true\n i++\n continue\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return [noMatch, glob.length - pos]\n }\n i += cls.length\n if (neg) negs.push(unip)\n else ranges.push(unip)\n continue WHILE\n }\n }\n }\n\n // now it's just a normal character, effectively\n escaping = false\n const n = norm(c)\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (n.codePointAt(0)! > rangeStart.codePointAt(0)!) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(n))\n } else if (n === rangeStart) {\n ranges.push(braceEscape(n))\n }\n rangeStart = ''\n i += c.length\n continue\n }\n\n // now might be the start of a range.\n // can be either c-d or c-] or c<more...>] or c] at this point\n if (glob.startsWith('-]', i + c.length)) {\n ranges.push(braceEscape(n + '-'))\n i += c.length + 1\n continue\n }\n if (glob.startsWith('-', i + c.length)) {\n rangeStart = n\n i += c.length + 1\n continue\n }\n\n // not the start of a range, just a single character\n ranges.push(braceEscape(n))\n i += c.length\n }\n\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return [noMatch, 0]\n }\n\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return [noMatch, glob.length - pos]\n }\n\n const sranges = '[' + (negate ? '^' : '') + ranges.join('') + ']'\n const snegs = '[' + (negate ? '' : '^') + negs.join('') + ']'\n const comb =\n '^' +\n (ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs)\n\n return [new RegExp(comb, nocase ? 'iu' : 'u'), endPos - pos]\n}\n"]}
@@ -0,0 +1,123 @@
1
+ import { type Form } from './parse-class.js';
2
+ export type { Form };
3
+ export type MatcherOptions = {
4
+ /** perform a case-insensitive match */
5
+ nocase?: boolean;
6
+ /** do not treat strings starting with `.` specially */
7
+ dot?: boolean;
8
+ /** do not match extglobs (treat them as normal strings) */
9
+ noext?: boolean;
10
+ /**
11
+ * normalize unicode in the pattern and the tested strings, with
12
+ * this form. `true` means `'NFC'`.
13
+ */
14
+ normalize?: boolean | Form;
15
+ /**
16
+ * A char that marks a numeric range in the pattern, as
17
+ * `<mark><lo>..<hi><mark>`, where `lo` and `hi` are integers. It
18
+ * matches the strings that the bash brace expansion `{<lo>..<hi>}`
19
+ * makes, such as `{1..100}` or `{001..100}`, without making each
20
+ * one. A mark is never escaped by a `\` before it. Inside a `[...]`
21
+ * class, a mark is a char of the class.
22
+ */
23
+ rangeMark?: string;
24
+ };
25
+ export type Item = {
26
+ t: 'lit';
27
+ ch: string;
28
+ } | {
29
+ t: 'any' | 'star';
30
+ } | {
31
+ t: 'class';
32
+ re: RegExp;
33
+ } | {
34
+ t: 'ext';
35
+ type: string;
36
+ alts: Item[][];
37
+ };
38
+ export type Token = Item | {
39
+ t: 'open';
40
+ type: string;
41
+ } | {
42
+ t: 'bar';
43
+ } | {
44
+ t: 'close';
45
+ };
46
+ export type NegNode = {
47
+ t: 'neg';
48
+ id: number;
49
+ sub: Node;
50
+ next: Node;
51
+ };
52
+ export type SplitNode = {
53
+ t: 'split';
54
+ id: number;
55
+ out: Node[];
56
+ };
57
+ export type Node = ({
58
+ t: 'lit';
59
+ id: number;
60
+ next: Node;
61
+ } & Lit) | {
62
+ t: 'any' | 'star';
63
+ id: number;
64
+ next: Node;
65
+ } | {
66
+ t: 'class';
67
+ id: number;
68
+ re: RegExp;
69
+ next: Node;
70
+ } | SplitNode | NegNode | {
71
+ t: 'match';
72
+ id: number;
73
+ };
74
+ /**
75
+ * A literal char. With `nocase:true`, `re` folds case, and `ascii`
76
+ * holds its results for ASCII chars, by char code: 1 for a match,
77
+ * and 2 for not.
78
+ */
79
+ export type Lit = {
80
+ ch: string;
81
+ re?: RegExp;
82
+ ascii?: Uint8Array;
83
+ };
84
+ /**
85
+ * For each node id, the gen of the last state that has the node as
86
+ * a thread, and of the last state that walked through it. A state is
87
+ * built to the end before the states around it go on, and the nodes
88
+ * of a negated sub-pattern are only in its states (other than the
89
+ * match node, which is never marked). So one mark for each node is
90
+ * enough to know if the state being built has it. The Sims of a
91
+ * matcher never run at the same time, so they share one Marks.
92
+ */
93
+ export type Marks = {
94
+ has: Float64Array;
95
+ seen: Float64Array;
96
+ gen: number;
97
+ };
98
+ /**
99
+ * A node in a graph with no splits or negations. Such a graph is a
100
+ * chain of nodes that each match one char, or a `*`.
101
+ */
102
+ export type LinearNode = Exclude<Node, SplitNode | NegNode | {
103
+ t: 'match';
104
+ }>;
105
+ export declare class Matcher {
106
+ #private;
107
+ pattern: string;
108
+ options: MatcherOptions;
109
+ constructor(pattern: string, options?: MatcherOptions);
110
+ test(s: string): boolean;
111
+ /**
112
+ * The same as {@link Matcher#test}, but the string is not checked
113
+ * for `/` chars, so the result for a string that has one is not
114
+ * defined. Only use it for a string that is known to be one path
115
+ * portion, such as a part of a path that was split on `/`. It can
116
+ * be faster, because some patterns do not need to look at each char
117
+ * of the string.
118
+ */
119
+ testUnchecked(s: string): boolean;
120
+ /** a readable listing of the state machine */
121
+ toString(): string;
122
+ }
123
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,kBAAkB,CAAA;AAExD,YAAY,EAAE,IAAI,EAAE,CAAA;AAEpB,MAAM,MAAM,cAAc,GAAG;IAC3B,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uDAAuD;IACvD,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAC1B;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAGD,MAAM,MAAM,IAAI,GACZ;IAAE,CAAC,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACxB;IAAE,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,GACrB;IAAE,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAA;CAAE,CAAA;AAI9C,MAAM,MAAM,KAAK,GACf,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAGpE,MAAM,MAAM,OAAO,GAAG;IAAE,CAAC,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAA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