chompyy 0.1.0 → 0.4.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/README.md +82 -8
- package/THIRD_PARTY_NOTICES.md +29 -1
- package/dist/appstate.js +121 -4
- package/dist/away.js +191 -25
- package/dist/blueprint.js +102 -7
- package/dist/board.js +143 -15
- package/dist/catalog.js +81 -0
- package/dist/claudesettings.js +23 -0
- package/dist/cli.js +804 -55
- package/dist/coldstart.js +208 -0
- package/dist/config.js +43 -8
- package/dist/costs.js +162 -0
- package/dist/deps.js +124 -0
- package/dist/dream.js +422 -0
- package/dist/duration.js +3 -3
- package/dist/gate.js +40 -5
- package/dist/history.js +308 -0
- package/dist/live.js +255 -0
- package/dist/livequota.js +42 -5
- package/dist/macapp.js +25 -2
- package/dist/pacing.js +189 -0
- package/dist/permissions.js +106 -0
- package/dist/picture.js +124 -0
- package/dist/picturetype.js +208 -0
- package/dist/preflight.js +168 -0
- package/dist/projects.js +5 -4
- package/dist/quota.js +31 -5
- package/dist/refresh.js +290 -0
- package/dist/report.js +41 -21
- package/dist/review.js +111 -11
- package/dist/runner.js +318 -10
- package/dist/taste.js +528 -0
- package/dist/tokens.js +75 -0
- package/dist/tokenstore.js +61 -0
- package/dist/trace.js +284 -0
- package/dist/triggers.js +193 -0
- package/dist/usage.js +467 -0
- package/dist/vendor/codeburn/prices.js +45 -0
- package/dist/verify.js +150 -0
- package/dist/verifycard.js +146 -0
- package/dist/workspace.js +132 -18
- package/package.json +4 -2
- package/skills/taste/SKILL.md +4 -1
- package/vendor/diagram-design/LICENSE +21 -0
- package/vendor/diagram-design/SKILL.md +399 -0
- package/vendor/diagram-design/UPSTREAM.md +18 -0
- package/vendor/diagram-design/assets/example-arc-diagram.html +111 -0
- package/vendor/diagram-design/assets/example-architecture-containment.html +205 -0
- package/vendor/diagram-design/assets/example-architecture-delta.html +193 -0
- package/vendor/diagram-design/assets/example-architecture.html +183 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-campus.html +108 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-coffee-shop.html +121 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-warehouse.html +127 -0
- package/vendor/diagram-design/assets/example-axonometric-plan.html +114 -0
- package/vendor/diagram-design/assets/example-bar.html +129 -0
- package/vendor/diagram-design/assets/example-beeswarm.html +384 -0
- package/vendor/diagram-design/assets/example-box-plot.html +127 -0
- package/vendor/diagram-design/assets/example-bubble.html +147 -0
- package/vendor/diagram-design/assets/example-bump.html +142 -0
- package/vendor/diagram-design/assets/example-data-flow.html +143 -0
- package/vendor/diagram-design/assets/example-datalake.html +269 -0
- package/vendor/diagram-design/assets/example-db-schema.html +302 -0
- package/vendor/diagram-design/assets/example-dependency.html +224 -0
- package/vendor/diagram-design/assets/example-deployment.html +190 -0
- package/vendor/diagram-design/assets/example-dp-integration.html +81 -0
- package/vendor/diagram-design/assets/example-dp-security-matrix.html +88 -0
- package/vendor/diagram-design/assets/example-er.html +202 -0
- package/vendor/diagram-design/assets/example-event-modeling.html +64 -0
- package/vendor/diagram-design/assets/example-exploded-ai-stack.html +85 -0
- package/vendor/diagram-design/assets/example-exploded-keyboard.html +84 -0
- package/vendor/diagram-design/assets/example-exploded-phone.html +83 -0
- package/vendor/diagram-design/assets/example-exploded-unboxing.html +84 -0
- package/vendor/diagram-design/assets/example-exploded.html +83 -0
- package/vendor/diagram-design/assets/example-fishbone.html +152 -0
- package/vendor/diagram-design/assets/example-flowchart.html +163 -0
- package/vendor/diagram-design/assets/example-gantt.html +137 -0
- package/vendor/diagram-design/assets/example-heatmap.html +224 -0
- package/vendor/diagram-design/assets/example-high-level-vertical.html +325 -0
- package/vendor/diagram-design/assets/example-high-level.html +301 -0
- package/vendor/diagram-design/assets/example-import-drawio.html +185 -0
- package/vendor/diagram-design/assets/example-import-excalidraw.html +70 -0
- package/vendor/diagram-design/assets/example-import-mermaid.html +70 -0
- package/vendor/diagram-design/assets/example-import-plantuml.html +107 -0
- package/vendor/diagram-design/assets/example-it-state.html +128 -0
- package/vendor/diagram-design/assets/example-journey.html +148 -0
- package/vendor/diagram-design/assets/example-kanban.html +174 -0
- package/vendor/diagram-design/assets/example-layers.html +123 -0
- package/vendor/diagram-design/assets/example-line.html +111 -0
- package/vendor/diagram-design/assets/example-loop.html +100 -0
- package/vendor/diagram-design/assets/example-marimekko.html +148 -0
- package/vendor/diagram-design/assets/example-medallion.html +159 -0
- package/vendor/diagram-design/assets/example-nested.html +136 -0
- package/vendor/diagram-design/assets/example-org-chart.html +45 -0
- package/vendor/diagram-design/assets/example-polar.html +116 -0
- package/vendor/diagram-design/assets/example-process.html +64 -0
- package/vendor/diagram-design/assets/example-pyramid.html +119 -0
- package/vendor/diagram-design/assets/example-quadrant-consultant.html +166 -0
- package/vendor/diagram-design/assets/example-quadrant.html +135 -0
- package/vendor/diagram-design/assets/example-radar.html +139 -0
- package/vendor/diagram-design/assets/example-requirement-traceability.html +122 -0
- package/vendor/diagram-design/assets/example-ridgeline.html +104 -0
- package/vendor/diagram-design/assets/example-sankey.html +150 -0
- package/vendor/diagram-design/assets/example-sbgn.html +213 -0
- package/vendor/diagram-design/assets/example-scatter.html +141 -0
- package/vendor/diagram-design/assets/example-sequence-oauth.html +227 -0
- package/vendor/diagram-design/assets/example-sequence.html +222 -0
- package/vendor/diagram-design/assets/example-service-blueprint.html +185 -0
- package/vendor/diagram-design/assets/example-slopegraph.html +119 -0
- package/vendor/diagram-design/assets/example-state-lifecycle.html +92 -0
- package/vendor/diagram-design/assets/example-state.html +147 -0
- package/vendor/diagram-design/assets/example-steps.html +78 -0
- package/vendor/diagram-design/assets/example-story-map.html +184 -0
- package/vendor/diagram-design/assets/example-streamgraph.html +99 -0
- package/vendor/diagram-design/assets/example-swimlane.html +172 -0
- package/vendor/diagram-design/assets/example-timeline.html +135 -0
- package/vendor/diagram-design/assets/example-tree-block-decomposition.html +151 -0
- package/vendor/diagram-design/assets/example-tree.html +173 -0
- package/vendor/diagram-design/assets/example-treemap.html +107 -0
- package/vendor/diagram-design/assets/example-uml-class.html +188 -0
- package/vendor/diagram-design/assets/example-unit-grid.html +141 -0
- package/vendor/diagram-design/assets/example-venn.html +110 -0
- package/vendor/diagram-design/assets/example-wardley.html +153 -0
- package/vendor/diagram-design/assets/example-waterfall.html +129 -0
- package/vendor/diagram-design/assets/template-dark.html +99 -0
- package/vendor/diagram-design/assets/template.html +100 -0
- package/vendor/diagram-design/references/layout-budget.md +103 -0
- package/vendor/diagram-design/references/output-spec.md +277 -0
- package/vendor/diagram-design/references/primitive-annotation.md +36 -0
- package/vendor/diagram-design/references/primitive-sketchy.md +43 -0
- package/vendor/diagram-design/references/primitives-core.md +146 -0
- package/vendor/diagram-design/references/semantic-patterns.md +154 -0
- package/vendor/diagram-design/references/style-guide.md +234 -0
- package/vendor/diagram-design/references/type-architecture-delta.md +143 -0
- package/vendor/diagram-design/references/type-architecture.md +117 -0
- package/vendor/diagram-design/references/type-axonometric-plan.md +83 -0
- package/vendor/diagram-design/references/type-bar.md +108 -0
- package/vendor/diagram-design/references/type-data-flow.md +371 -0
- package/vendor/diagram-design/references/type-db-schema.md +48 -0
- package/vendor/diagram-design/references/type-dependency.md +113 -0
- package/vendor/diagram-design/references/type-deployment.md +45 -0
- package/vendor/diagram-design/references/type-dp-integration.md +407 -0
- package/vendor/diagram-design/references/type-dp-security-matrix.md +379 -0
- package/vendor/diagram-design/references/type-er.md +25 -0
- package/vendor/diagram-design/references/type-event-modeling.md +36 -0
- package/vendor/diagram-design/references/type-exploded.md +115 -0
- package/vendor/diagram-design/references/type-fishbone.md +75 -0
- package/vendor/diagram-design/references/type-flowchart.md +23 -0
- package/vendor/diagram-design/references/type-gantt.md +45 -0
- package/vendor/diagram-design/references/type-heatmap.md +80 -0
- package/vendor/diagram-design/references/type-high-level.md +470 -0
- package/vendor/diagram-design/references/type-it-state.md +468 -0
- package/vendor/diagram-design/references/type-journey.md +55 -0
- package/vendor/diagram-design/references/type-kanban.md +49 -0
- package/vendor/diagram-design/references/type-layers.md +26 -0
- package/vendor/diagram-design/references/type-line.md +337 -0
- package/vendor/diagram-design/references/type-loop.md +223 -0
- package/vendor/diagram-design/references/type-medallion.md +356 -0
- package/vendor/diagram-design/references/type-nested.md +22 -0
- package/vendor/diagram-design/references/type-org-chart.md +44 -0
- package/vendor/diagram-design/references/type-polar.md +136 -0
- package/vendor/diagram-design/references/type-process.md +490 -0
- package/vendor/diagram-design/references/type-pyramid.md +33 -0
- package/vendor/diagram-design/references/type-quadrant.md +81 -0
- package/vendor/diagram-design/references/type-radar.md +82 -0
- package/vendor/diagram-design/references/type-requirement-traceability.md +45 -0
- package/vendor/diagram-design/references/type-sankey.md +75 -0
- package/vendor/diagram-design/references/type-sbgn.md +80 -0
- package/vendor/diagram-design/references/type-scatter.md +276 -0
- package/vendor/diagram-design/references/type-sequence.md +130 -0
- package/vendor/diagram-design/references/type-service-blueprint.md +103 -0
- package/vendor/diagram-design/references/type-state.md +30 -0
- package/vendor/diagram-design/references/type-steps.md +180 -0
- package/vendor/diagram-design/references/type-story-map.md +46 -0
- package/vendor/diagram-design/references/type-swimlane.md +22 -0
- package/vendor/diagram-design/references/type-timeline.md +20 -0
- package/vendor/diagram-design/references/type-tree.md +24 -0
- package/vendor/diagram-design/references/type-treemap.md +137 -0
- package/vendor/diagram-design/references/type-uml-class.md +65 -0
- package/vendor/diagram-design/references/type-unit-grid.md +63 -0
- package/vendor/diagram-design/references/type-venn.md +26 -0
- package/vendor/diagram-design/references/type-wardley.md +39 -0
- package/vendor/diagram-design/references/type-waterfall.md +75 -0
- package/vendor/diagram-design/scripts/self_check.py +1177 -0
- package/vendor/diagram-design/scripts/verify_geometry.py +696 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
const FILE = /\b[\w./-]+\.(?:ts|tsx|js|mjs|swift|py|go|rs|rb|java|kt|md|json|yaml|yml|toml|sql|sh|css|html)\b/g;
|
|
2
|
+
const count = (text, re) => (text.match(re) ?? []).length;
|
|
3
|
+
const RULES = [
|
|
4
|
+
{
|
|
5
|
+
type: 'State machine', ref: 'type-state.md', weight: 1.3,
|
|
6
|
+
phrases: ['status(?:es)?', 'states?', 'transitions?', 'moves? (?:from|to|into|back)', 'lifecycle', 'retr(?:y|ies)', 'cancel(?:led|s)?', 'pending', 'stale', 'expires?', 'resets?', 'becomes?', 'column'],
|
|
7
|
+
min: 2,
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: 'Architecture delta', ref: 'type-architecture-delta.md', weight: 1.2,
|
|
11
|
+
phrases: ['adds?', 'replaces?', 'removes?', 'renames?', 'moves? .{0,20} (?:to|into) ', 'splits?', 'new (?:module|file|component|service|command)', 'refactor', 'migrat(?:e|ion)'],
|
|
12
|
+
min: 2,
|
|
13
|
+
structure: (t) => {
|
|
14
|
+
const files = new Set(t.match(FILE) ?? []);
|
|
15
|
+
return files.size >= 3 ? [files.size * 0.5, `${files.size} files touched`] : null;
|
|
16
|
+
},
|
|
17
|
+
structureNeedsPhrases: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'Steps', ref: 'type-steps.md',
|
|
21
|
+
phrases: ['first', 'then', 'next', 'finally', 'step \\d', 'after that'],
|
|
22
|
+
min: 2,
|
|
23
|
+
structure: (t) => {
|
|
24
|
+
const n = count(t, /^\s*\d+[.)]\s/gm);
|
|
25
|
+
return n >= 3 ? [n * 0.4, `${n} numbered steps`] : null;
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 'Flowchart', ref: 'type-flowchart.md', weight: 1.1,
|
|
30
|
+
phrases: ['if', 'else', 'otherwise', 'unless', 'when .{0,30} (?:fails?|missing|empty)', 'fall ?back', 'refuses?', 'decides?', 'either', 'or else', 'only when', 'in that case'],
|
|
31
|
+
min: 2,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'Data flow', ref: 'type-data-flow.md',
|
|
35
|
+
phrases: ['inputs?', 'outputs?', 'reads?', 'writes?', 'parses?', 'transforms?', 'computes?', 'derives?', 'pipeline', 'feeds?', 'turns .{0,30} into', '→|->', 'formula', '= .{1,40} ÷'],
|
|
36
|
+
min: 3,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'Sequence', ref: 'type-sequence.md', weight: 1.2,
|
|
40
|
+
phrases: ['requests?', 'responses?', 'calls?', 'sends?', 'replies', 'api', 'endpoint', 'hooks?', 'client', 'server', 'handshake', 'webhook', 'round[- ]trip'],
|
|
41
|
+
min: 3,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'Timeline', ref: 'type-timeline.md',
|
|
45
|
+
phrases: ['timeline', 'milestones?', 'deadline', 'by (?:mon|tues|wednes|thurs|fri|satur|sun)day', 'q[1-4]', '\\d{4}-\\d{2}-\\d{2}', 'week \\d', 'phase \\d', 'release'],
|
|
46
|
+
min: 2,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'Gantt', ref: 'type-gantt.md', weight: 1.2,
|
|
50
|
+
phrases: ['schedule', 'durations?', '\\d+ (?:days?|weeks?|hours?)', 'in parallel', 'overlap', 'blocks? on', 'critical path'],
|
|
51
|
+
min: 3,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'Bar chart', ref: 'type-bar.md', weight: 1.1,
|
|
55
|
+
phrases: ['benchmarks?', 'compare .{0,20}(?:numbers|results|cost|tokens)', 'per (?:model|tool|project|day)', 'top \\d+', 'ranking', 'measure(?:d|s)?'],
|
|
56
|
+
min: 1,
|
|
57
|
+
structure: (t) => {
|
|
58
|
+
const n = count(t, /\b\d+(?:\.\d+)?\s?%/g);
|
|
59
|
+
return n >= 3 ? [n / 2, `${n} percentages`] : null;
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'Line chart', ref: 'type-line.md', weight: 1.1,
|
|
64
|
+
phrases: ['over time', 'trends?', 'per (?:day|week|month)', 'before and after', 'growth', 'declin(?:e|ing)', 'history of'],
|
|
65
|
+
min: 2,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'Quadrant', ref: 'type-quadrant.md', weight: 1.2,
|
|
69
|
+
phrases: ['vs\\.?', 'versus', 'trade-?offs?', 'options?', 'compare', 'priorit(?:y|ize|ise)', 'effort', 'impact'],
|
|
70
|
+
min: 3,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'Tree', ref: 'type-tree.md',
|
|
74
|
+
phrases: ['hierarchy', 'folders?', 'director(?:y|ies)', 'parent', 'children', 'sub-?(?:folder|section|task)s?', 'nested'],
|
|
75
|
+
min: 2,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'Layer stack', ref: 'type-layers.md',
|
|
79
|
+
phrases: ['layers?', 'stack', 'tiers?', 'levels? of', 'on top of', 'underneath', 'abstraction'],
|
|
80
|
+
min: 2,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: 'Swimlane', ref: 'type-swimlane.md', weight: 1.2,
|
|
84
|
+
phrases: ['hand ?offs?', 'you (?:approve|review|answer)', 'the agent', 'the user', 'reviewer', 'owner', 'who does'],
|
|
85
|
+
min: 3,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'ER / data model', ref: 'type-er.md', weight: 1.2,
|
|
89
|
+
phrases: ['tables?', 'schema', 'fields?', 'entit(?:y|ies)', 'records?', 'foreign key', 'relations?(?:hip)?s?', 'json shape', 'interface \\w+'],
|
|
90
|
+
min: 3,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: 'Dependency graph', ref: 'type-dependency.md', weight: 1.2,
|
|
94
|
+
phrases: ['depends on', 'dependenc(?:y|ies)', 'imports?', 'requires', 'cycles?', 'circular'],
|
|
95
|
+
min: 2,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: 'Loop', ref: 'type-loop.md', weight: 1.3,
|
|
99
|
+
phrases: ['loop', 'cycle', 'feedback', 'feeds back', 'again and again', 'learns? from', 'closed loop', 'repeat(?:s|ed)?'],
|
|
100
|
+
min: 2,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: 'User journey', ref: 'type-journey.md', weight: 1.2,
|
|
104
|
+
phrases: ['user journey', 'experience', 'onboarding', 'first (?:run|time|launch)', 'feels?', 'frustrat', 'delight', 'tester'],
|
|
105
|
+
min: 2,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: 'Fishbone', ref: 'type-fishbone.md', weight: 1.3,
|
|
109
|
+
phrases: ['root cause', 'why (?:it|does|did)', 'causes?', 'diagnos', 'investigat', 'bug', 'regression'],
|
|
110
|
+
min: 3,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: 'Sankey', ref: 'type-sankey.md', weight: 1.3,
|
|
114
|
+
phrases: ['split(?:s)? into', 'share of', 'breakdown', 'where .{0,20} goes', 'budget', 'allocation', 'flows? into'],
|
|
115
|
+
min: 2,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: 'Waterfall', ref: 'type-waterfall.md', weight: 1.3,
|
|
119
|
+
phrases: ['bridge', 'adds up', 'from \\d+.{0,20} to \\d+', 'net (?:change|effect)', 'deltas?'],
|
|
120
|
+
min: 2,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
type: 'Treemap', ref: 'type-treemap.md', weight: 1.2,
|
|
124
|
+
phrases: ['part of (?:the )?whole', 'biggest', 'proportion', 'what .{0,20} is made of', 'sizes?'],
|
|
125
|
+
min: 2,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: 'Deployment', ref: 'type-deployment.md', weight: 1.2,
|
|
129
|
+
phrases: ['deploy', 'hosts?', 'containers?', 'launchagent', 'daemon', 'release zip', 'install(?:er|s)?', 'ports?', 'runs on'],
|
|
130
|
+
min: 2,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: 'Requirement traceability', ref: 'type-requirement-traceability.md', weight: 1.2,
|
|
134
|
+
phrases: ['requirements?', 'acceptance', 'covered by', 'test(?:s)? for each', 'spec §', 'traceab'],
|
|
135
|
+
min: 2,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
type: 'Unit Grid', ref: 'type-unit-grid.md', weight: 1.2,
|
|
139
|
+
phrases: ['out of 100', 'percent of', 'share left', 'used of', 'window left'],
|
|
140
|
+
min: 2,
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
/** Blueprint sections that say what *not* to do or how it's checked: their words would mislead the signals. */
|
|
144
|
+
const SKIP_SECTION = /^(?:out of scope|won'?t touch|non-?goals|how it'?s checked|checks?|done when|questions)\b/i;
|
|
145
|
+
/** Card text the signals read: title, idea and the blueprint's goal/scope/shape, without code blocks. */
|
|
146
|
+
export function cardText(card) {
|
|
147
|
+
const kept = [];
|
|
148
|
+
let skip = false;
|
|
149
|
+
for (const line of (card.blueprint ?? '').split('\n')) {
|
|
150
|
+
const h = line.match(/^#{1,6}\s+(.*)/);
|
|
151
|
+
if (h)
|
|
152
|
+
skip = SKIP_SECTION.test(h[1].trim());
|
|
153
|
+
else if (!skip)
|
|
154
|
+
kept.push(line);
|
|
155
|
+
}
|
|
156
|
+
return [card.title, card.idea, kept.join('\n')].join('\n').replace(/```[\s\S]*?```/g, ' ');
|
|
157
|
+
}
|
|
158
|
+
/** Rank the visual types for a card, strongest first. Empty when nothing points anywhere. */
|
|
159
|
+
export function suggestTypes(card, max = 3) {
|
|
160
|
+
const text = cardText(card);
|
|
161
|
+
const out = [];
|
|
162
|
+
for (const rule of RULES) {
|
|
163
|
+
const evidence = [];
|
|
164
|
+
let hits = 0;
|
|
165
|
+
for (const p of rule.phrases) {
|
|
166
|
+
const m = text.match(new RegExp(`(?<![\\w])(?:${p})(?![\\w])`, 'gi'));
|
|
167
|
+
if (!m)
|
|
168
|
+
continue;
|
|
169
|
+
hits += m.length;
|
|
170
|
+
evidence.push(`"${m[0].trim().toLowerCase()}"${m.length > 1 ? ` ×${m.length}` : ''}`);
|
|
171
|
+
}
|
|
172
|
+
const distinct = evidence.length;
|
|
173
|
+
let score = distinct >= (rule.min ?? 1) ? distinct + Math.min(hits - distinct, distinct) * 0.25 : 0;
|
|
174
|
+
const s = rule.structureNeedsPhrases && score === 0 ? null : rule.structure?.(text);
|
|
175
|
+
if (s) {
|
|
176
|
+
score += s[0];
|
|
177
|
+
evidence.unshift(s[1]);
|
|
178
|
+
}
|
|
179
|
+
if (score > 0)
|
|
180
|
+
out.push({ type: rule.type, ref: rule.ref, score: Math.round(score * (rule.weight ?? 1) * 10) / 10, evidence: evidence.slice(0, 5) });
|
|
181
|
+
}
|
|
182
|
+
out.sort((a, b) => b.score - a.score);
|
|
183
|
+
return out.slice(0, max);
|
|
184
|
+
}
|
|
185
|
+
/** The suggestion block for the drawing prompt. */
|
|
186
|
+
export function typeHint(suggestions) {
|
|
187
|
+
const tail = 'HTML comment on the line right after <!DOCTYPE html>: <!-- type: <Type>; why: <one short reason> -->';
|
|
188
|
+
if (!suggestions.length) {
|
|
189
|
+
return [
|
|
190
|
+
'No strong signal. Choose from the full visual-type guide in SKILL.md §3 by what the task produces; a',
|
|
191
|
+
'flowchart only when there is real branching. If the task writes a document, picture what the document',
|
|
192
|
+
`explains, not its headings. Put an ${tail}`,
|
|
193
|
+
].join('\n');
|
|
194
|
+
}
|
|
195
|
+
const [top, ...rest] = suggestions;
|
|
196
|
+
const line = (s) => `${s.type} (references/${s.ref}), because the card mentions ${s.evidence.join(', ')}`;
|
|
197
|
+
return [
|
|
198
|
+
`Suggested type: ${line(top)}.`,
|
|
199
|
+
...(rest.length ? [`Also considered: ${rest.map(line).join('; ')}.`] : []),
|
|
200
|
+
'Use the suggested type unless the task clearly fits another one in SKILL.md §3. Whichever you pick, put an',
|
|
201
|
+
tail,
|
|
202
|
+
].join('\n');
|
|
203
|
+
}
|
|
204
|
+
/** The type and reason the drawing agent wrote in its leading comment, if any. */
|
|
205
|
+
export function chosenType(html) {
|
|
206
|
+
const m = html.match(/<!--\s*type:\s*([^;>]+?)\s*;\s*why:\s*([\s\S]*?)\s*-->/i);
|
|
207
|
+
return m ? { type: m[1].trim(), why: m[2].trim() } : null;
|
|
208
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// Preflight (research/away-readiness.md, steps 1–2): before cards run in a repo, run the repo's own checks on
|
|
2
|
+
// clean latest main, in the same box an away run uses AND outside it. The difference is the verdict:
|
|
3
|
+
// passes in the box → ready
|
|
4
|
+
// fails only in the box → a box problem (the catalog says which, and how to fix it)
|
|
5
|
+
// fails outside the box too → main itself is broken (not the box, and not any card's fault)
|
|
6
|
+
// Outside-the-box runs only ever execute your own code on main, never an agent's change.
|
|
7
|
+
import { execFileSync } from 'node:child_process';
|
|
8
|
+
import { createHash } from 'node:crypto';
|
|
9
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync } from 'node:fs';
|
|
10
|
+
import { basename, join, relative } from 'node:path';
|
|
11
|
+
import { cacheEnv } from './away.js';
|
|
12
|
+
import { diagnose } from './catalog.js';
|
|
13
|
+
import { hostsInErrors } from './permissions.js';
|
|
14
|
+
import { homePath, readJson, writeJson } from './home.js';
|
|
15
|
+
import { detectCheck, run, sandboxProfile } from './verify.js';
|
|
16
|
+
import { setupDependencies } from './deps.js';
|
|
17
|
+
import { latestMain } from './workspace.js';
|
|
18
|
+
export { latestMain };
|
|
19
|
+
const SKIP = new Set(['node_modules', '.git', '.build', 'dist', 'build', 'vendor', 'Pods', 'DerivedData', '.venv', 'venv', 'target']);
|
|
20
|
+
/** Every check the repo has, from what's in its folders (up to 3 levels deep). */
|
|
21
|
+
/**
|
|
22
|
+
* `swift build` as it can run in the away box: SwiftPM's own sandbox off (the box already sandboxes it; macOS
|
|
23
|
+
* forbids nesting) and its caches inside the box. Proven by preflight on 2026-11-18.
|
|
24
|
+
*/
|
|
25
|
+
export function swiftBuildArgv(cacheDir) {
|
|
26
|
+
return ['swift', 'build', '--disable-sandbox', '--cache-path', `${cacheDir}/swiftpm/cache`, '--config-path', `${cacheDir}/swiftpm/config`, '--security-path', `${cacheDir}/swiftpm/security`];
|
|
27
|
+
}
|
|
28
|
+
export function detectChecks(root, cacheDir, maxDepth = 3) {
|
|
29
|
+
const checks = [];
|
|
30
|
+
const walk = (dir, depth) => {
|
|
31
|
+
const rel = relative(root, dir);
|
|
32
|
+
const test = detectCheck(dir);
|
|
33
|
+
if (test)
|
|
34
|
+
checks.push({ dir: rel, label: test.label, argv: test.argv, kind: 'test' });
|
|
35
|
+
const pkgPath = join(dir, 'package.json');
|
|
36
|
+
if (existsSync(pkgPath)) {
|
|
37
|
+
try {
|
|
38
|
+
const scripts = JSON.parse(readFileSync(pkgPath, 'utf8')).scripts ?? {};
|
|
39
|
+
if (scripts.typecheck)
|
|
40
|
+
checks.push({ dir: rel, label: 'npm run typecheck', argv: ['npm', 'run', 'typecheck'], kind: 'typecheck' });
|
|
41
|
+
}
|
|
42
|
+
catch { }
|
|
43
|
+
}
|
|
44
|
+
if (existsSync(join(dir, 'Package.swift'))) {
|
|
45
|
+
const argv = swiftBuildArgv(cacheDir);
|
|
46
|
+
checks.push({ dir: rel, label: argv.join(' '), argv, kind: 'build' });
|
|
47
|
+
}
|
|
48
|
+
if (depth >= maxDepth)
|
|
49
|
+
return;
|
|
50
|
+
let subdirs = [];
|
|
51
|
+
try {
|
|
52
|
+
subdirs = readdirSync(dir, { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith('.') && !SKIP.has(d.name)).map((d) => d.name);
|
|
53
|
+
}
|
|
54
|
+
catch { }
|
|
55
|
+
for (const name of subdirs)
|
|
56
|
+
walk(join(dir, name), depth + 1);
|
|
57
|
+
};
|
|
58
|
+
walk(root, 0);
|
|
59
|
+
return checks;
|
|
60
|
+
}
|
|
61
|
+
const git = (cwd, args) => execFileSync('git', ['-C', cwd, ...args], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }).trim();
|
|
62
|
+
const tryGit = (cwd, args) => {
|
|
63
|
+
try {
|
|
64
|
+
return git(cwd, args);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
/** Where a repo's profile lives: ~/.chompyy/repos/<name>-<hash>.json. */
|
|
71
|
+
export function profilePath(root) {
|
|
72
|
+
const hash = createHash('sha256').update(root).digest('hex').slice(0, 8);
|
|
73
|
+
return homePath('repos', `${basename(root)}-${hash}.json`);
|
|
74
|
+
}
|
|
75
|
+
export const loadProfile = (root) => readJson(profilePath(root), null);
|
|
76
|
+
export const saveProfile = (p) => writeJson(profilePath(p.root), p);
|
|
77
|
+
const clean = (text, lines = 12) => text.replace(/\u001b\[[0-9;]*[A-Za-z]/g, '').trimEnd().split('\n').slice(-lines).join('\n').slice(-1500);
|
|
78
|
+
/** Run the repo's checks on a clean copy of the latest main, in the box and outside it. Never touches your checkout. */
|
|
79
|
+
export async function preflight(root, opts) {
|
|
80
|
+
const now = opts.now ?? (() => new Date());
|
|
81
|
+
const base = opts.ref ? { ref: opts.ref, commit: git(root, ['rev-parse', '--verify', `${opts.ref}^{commit}`]) } : latestMain(root, opts.fetch ?? true);
|
|
82
|
+
const dir = homePath('preflight', basename(profilePath(root), '.json'));
|
|
83
|
+
if (existsSync(dir)) {
|
|
84
|
+
tryGit(root, ['worktree', 'remove', '--force', dir]);
|
|
85
|
+
rmSync(dir, { recursive: true, force: true });
|
|
86
|
+
}
|
|
87
|
+
mkdirSync(opts.cacheDir, { recursive: true });
|
|
88
|
+
git(root, ['worktree', 'add', '--detach', '--quiet', dir, base.commit]);
|
|
89
|
+
const results = [];
|
|
90
|
+
try {
|
|
91
|
+
setupDependencies(root, dir, basename(profilePath(root), '.json'), { env: cacheEnv(opts.cacheDir) });
|
|
92
|
+
const checks = detectChecks(dir, opts.cacheDir);
|
|
93
|
+
const env = { ...process.env, ...cacheEnv(opts.cacheDir), CI: '1', NO_COLOR: '1', FORCE_COLOR: '0' };
|
|
94
|
+
const exec = opts.exec ?? ((argv, cwd, e, t, boxed) => run(boxed ? ['/usr/bin/sandbox-exec', '-p', sandboxProfile({ writable: [dir, opts.cacheDir], denyRead: opts.denyRead }), ...argv] : argv, cwd, e, t));
|
|
95
|
+
const boxAvailable = opts.exec !== undefined || (process.platform === 'darwin' && existsSync('/usr/bin/sandbox-exec'));
|
|
96
|
+
for (const check of checks) {
|
|
97
|
+
const started = Date.now();
|
|
98
|
+
const cwd = join(dir, check.dir);
|
|
99
|
+
if (!boxAvailable) {
|
|
100
|
+
results.push({ check, verdict: 'not-run', why: 'needs the macOS sandbox (sandbox-exec)', ms: 0 });
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
let inBox;
|
|
104
|
+
try {
|
|
105
|
+
inBox = await exec(check.argv, cwd, env, opts.timeoutMs, true);
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
results.push({ check, verdict: 'not-run', why: `couldn't start: ${err instanceof Error ? err.message : err}`, ms: Date.now() - started });
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (inBox.code === 0 && !inBox.timedOut) {
|
|
112
|
+
results.push({ check, verdict: 'ready', why: 'passes in the box', ms: Date.now() - started });
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
// Failed in the box: is it the box, or main itself? Run the same check on the same code outside it.
|
|
116
|
+
const outside = await exec(check.argv, cwd, env, opts.timeoutMs, false).catch((err) => ({ code: null, output: String(err), timedOut: false }));
|
|
117
|
+
const ms = Date.now() - started;
|
|
118
|
+
if (outside.code === 0 && !outside.timedOut) {
|
|
119
|
+
const diagnoses = diagnose(inBox.output).map((d) => ({ id: d.entry.id, title: d.entry.title, cause: d.entry.cause, fix: d.entry.fix, remedy: d.entry.remedy, evidence: d.evidence }));
|
|
120
|
+
results.push({
|
|
121
|
+
check,
|
|
122
|
+
verdict: 'box',
|
|
123
|
+
why: diagnoses.length
|
|
124
|
+
? `passes outside the box, fails inside: ${diagnoses.map((d) => d.title.toLowerCase()).join('; ')}`
|
|
125
|
+
: "passes outside the box, fails inside, and the cause isn't in the catalog yet",
|
|
126
|
+
diagnoses,
|
|
127
|
+
tail: clean(inBox.output),
|
|
128
|
+
ms,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
results.push({ check, verdict: 'broken', why: inBox.timedOut && outside.timedOut ? 'times out on main, in and outside the box' : 'fails on main outside the box too: main itself is broken', tail: clean(outside.output), ms });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
tryGit(root, ['worktree', 'remove', '--force', dir]);
|
|
138
|
+
rmSync(dir, { recursive: true, force: true });
|
|
139
|
+
}
|
|
140
|
+
return { at: now().toISOString(), root, base, ready: results.length > 0 && results.every((r) => r.verdict === 'ready'), results };
|
|
141
|
+
}
|
|
142
|
+
/** Preflight as you'd read it. */
|
|
143
|
+
export function formatPreflight(p) {
|
|
144
|
+
const mark = { ready: '✓', box: '✗', broken: '!', 'not-run': '·' };
|
|
145
|
+
const lines = [`Preflight for ${basename(p.root)} (${p.base.ref} @ ${p.base.commit.slice(0, 7)})${p.base.note ? `\n note: ${p.base.note}` : ''}`];
|
|
146
|
+
if (!p.results.length)
|
|
147
|
+
lines.push(' No checks found (tests, typecheck or build). Away cards here can\'t be checked.');
|
|
148
|
+
for (const r of p.results) {
|
|
149
|
+
lines.push(` ${mark[r.verdict]} ${r.check.dir || '.'}: ${r.check.label} — ${r.why} (${Math.round(r.ms / 1000)}s)`);
|
|
150
|
+
for (const d of r.diagnoses ?? []) {
|
|
151
|
+
lines.push(` ${d.title}. ${d.cause}`);
|
|
152
|
+
lines.push(` fix (${d.fix}): ${d.remedy}`);
|
|
153
|
+
lines.push(` seen: ${d.evidence}`);
|
|
154
|
+
}
|
|
155
|
+
if (r.verdict !== 'ready' && !r.diagnoses?.length && r.tail)
|
|
156
|
+
lines.push(...r.tail.split('\n').slice(-4).map((l) => ` | ${l}`));
|
|
157
|
+
}
|
|
158
|
+
const box = p.results.filter((r) => r.verdict === 'box').length;
|
|
159
|
+
const broken = p.results.filter((r) => r.verdict === 'broken').length;
|
|
160
|
+
lines.push(p.ready
|
|
161
|
+
? 'Away-ready: yes. Every check passes in the box, so a card\'s "checks fail" will mean its change.'
|
|
162
|
+
: `Away-ready: no${box ? ` · ${box} check(s) blocked by the box` : ''}${broken ? ` · ${broken} failing on main itself` : ''}.`);
|
|
163
|
+
return lines.join('\n');
|
|
164
|
+
}
|
|
165
|
+
/** Hosts the repo's own checks tried to reach in the box (for the permission plan). */
|
|
166
|
+
export function preflightHosts(p) {
|
|
167
|
+
return [...new Set((p?.preflight?.results ?? []).filter((r) => r.verdict === 'box').flatMap((r) => (r.diagnoses ?? []).filter((d) => d.id === 'network').flatMap((d) => hostsInErrors(d.evidence))))];
|
|
168
|
+
}
|
package/dist/projects.js
CHANGED
|
@@ -4,7 +4,7 @@ import { closeSync, existsSync, openSync, readSync, readdirSync, realpathSync, s
|
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { basename, dirname, join } from 'node:path';
|
|
6
6
|
/** Walk up to the folder holding .git, without starting git (fast enough for hundreds of folders). */
|
|
7
|
-
function findGitRoot(dir) {
|
|
7
|
+
export function findGitRoot(dir) {
|
|
8
8
|
let d = dir;
|
|
9
9
|
for (let i = 0; i < 30; i++) {
|
|
10
10
|
if (existsSync(join(d, '.git')))
|
|
@@ -18,7 +18,7 @@ function findGitRoot(dir) {
|
|
|
18
18
|
}
|
|
19
19
|
/** Folders people usually keep code in; scanned two levels deep for git repos. */
|
|
20
20
|
const CODE_FOLDERS = ['orca', 'Desktop', 'Developer', 'code', 'Code', 'projects', 'Projects', 'src', 'dev', 'repos', 'GitHub', 'Documents/GitHub'];
|
|
21
|
-
const isTemp = (p) => /^\/(private\/)?(var|tmp)\//.test(p) || p.includes('/.chompyy/') || p.includes('/node_modules/');
|
|
21
|
+
export const isTemp = (p) => /^\/(private\/)?(var|tmp)\//.test(p) || p.includes('/.chompyy/') || p.includes('/node_modules/');
|
|
22
22
|
/** The first "cwd" in the first 64 KB of a transcript. */
|
|
23
23
|
function cwdOf(file) {
|
|
24
24
|
let fd = null;
|
|
@@ -38,13 +38,14 @@ function cwdOf(file) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
export function recentProjects(board, opts = {}) {
|
|
41
|
+
const temp = opts.isTemp ?? isTemp;
|
|
41
42
|
const claudeDir = opts.claudeDir ?? join(homedir(), '.claude', 'projects');
|
|
42
43
|
const seen = new Map();
|
|
43
44
|
const add = (dir, at) => {
|
|
44
|
-
if (!dir ||
|
|
45
|
+
if (!dir || temp(dir) || !existsSync(dir))
|
|
45
46
|
return;
|
|
46
47
|
const root = findGitRoot(dir);
|
|
47
|
-
if (!root || root === homedir() ||
|
|
48
|
+
if (!root || root === homedir() || temp(root))
|
|
48
49
|
return; // cards run best in git repos
|
|
49
50
|
let path = root;
|
|
50
51
|
try {
|
package/dist/quota.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// message: if no window is active, the first message would start a new 5-hour window.
|
|
3
3
|
import { formatDuration } from './duration.js';
|
|
4
4
|
import { homePath, readJson, writeJson } from './home.js';
|
|
5
|
+
import { FIVE_HOURS, WEEK, dailyAllowance, forecastWindow, formatAllowance, formatDelta, formatForecast, formatForecastShort, paceDelta, recordSample } from './pacing.js';
|
|
5
6
|
function num(v) {
|
|
6
7
|
if (typeof v === 'number' && Number.isFinite(v))
|
|
7
8
|
return v;
|
|
@@ -57,6 +58,7 @@ export function mergeSnapshot(prev, next) {
|
|
|
57
58
|
...(next.source ? { source: next.source } : {}),
|
|
58
59
|
fiveHour: next.fiveHour ?? prev?.fiveHour,
|
|
59
60
|
sevenDay: next.sevenDay ?? prev?.sevenDay,
|
|
61
|
+
...(next.models ?? prev?.models ? { models: next.models ?? prev?.models } : {}),
|
|
60
62
|
};
|
|
61
63
|
}
|
|
62
64
|
/** % left, time left and pace for one window. Past resets_at the window has reset: unknown. */
|
|
@@ -71,20 +73,27 @@ export function windowView(w, now) {
|
|
|
71
73
|
return { known: true, usedPct: w.usedPct, leftPct, msLeft, pacePerHour: leftPct / hoursLeft, resetsAt: w.resetsAt };
|
|
72
74
|
}
|
|
73
75
|
const pct = (n) => `${Math.round(n)}%`;
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
+
/**
|
|
77
|
+
* One short line for Claude Code's status bar:
|
|
78
|
+
* "🍪 5h 62% left ⇣15% · 1h40m · ~40% unused at 18:20 | 7d 41% used ⇡3%".
|
|
79
|
+
* ⇣ = headroom against an even pace, ⇡ = burning faster (coloured when `color`).
|
|
80
|
+
*/
|
|
81
|
+
export function statusLineText(snap, now, opts = {}) {
|
|
76
82
|
const five = windowView(snap.fiveHour, now);
|
|
77
83
|
const week = windowView(snap.sevenDay, now);
|
|
84
|
+
const d5 = formatDelta(paceDelta(snap.fiveHour, FIVE_HOURS, now), opts.color);
|
|
85
|
+
const forecast = formatForecastShort(forecastWindow(snap.fiveHour, FIVE_HOURS, opts.samples ?? [], (s) => s.five, now));
|
|
78
86
|
const fivePart = five.known
|
|
79
|
-
? `5h ${pct(five.leftPct)} left · ${formatDuration(five.msLeft)} ·
|
|
87
|
+
? `5h ${pct(five.leftPct)} left${d5 ? ` ${d5}` : ''} · ${formatDuration(five.msLeft)} · ${forecast || `~${pct(five.pacePerHour)}/h`}`
|
|
80
88
|
: five.reason === 'stale'
|
|
81
89
|
? '5h reset'
|
|
82
90
|
: '5h ?';
|
|
83
|
-
const
|
|
91
|
+
const d7 = formatDelta(paceDelta(snap.sevenDay, WEEK, now), opts.color);
|
|
92
|
+
const weekPart = week.known ? ` | 7d ${pct(week.usedPct)} used${d7 ? ` ${d7}` : ''}` : '';
|
|
84
93
|
return `🍪 ${fivePart}${weekPart}`;
|
|
85
94
|
}
|
|
86
95
|
/** Multi-line `chompyy status` text. */
|
|
87
|
-
export function statusText(snap, now) {
|
|
96
|
+
export function statusText(snap, now, opts = {}) {
|
|
88
97
|
if (!snap || (!snap.fiveHour && !snap.sevenDay)) {
|
|
89
98
|
return [
|
|
90
99
|
'No quota snapshot yet.',
|
|
@@ -111,6 +120,19 @@ export function statusText(snap, now) {
|
|
|
111
120
|
else {
|
|
112
121
|
lines.push(`7d window unknown${week.reason === 'stale' ? ' (snapshot is from before the weekly reset)' : ''}`);
|
|
113
122
|
}
|
|
123
|
+
for (const [name, w] of Object.entries(snap.models ?? {})) {
|
|
124
|
+
const v = windowView(w, now);
|
|
125
|
+
if (v.known)
|
|
126
|
+
lines.push(`${`7d ${name}`.padEnd(10)} ${pct(v.usedPct)} used ${formatDelta(paceDelta(w, WEEK, now))}`.trimEnd());
|
|
127
|
+
}
|
|
128
|
+
const d5 = formatDelta(paceDelta(snap.fiveHour, FIVE_HOURS, now));
|
|
129
|
+
const d7 = formatDelta(paceDelta(snap.sevenDay, WEEK, now));
|
|
130
|
+
if (d5 || d7)
|
|
131
|
+
lines.push(`pace ${[d5 && `5h ${d5}`, d7 && `7d ${d7}`].filter(Boolean).join(' · ')} (⇣ headroom, ⇡ faster than an even pace)`);
|
|
132
|
+
if (five.known)
|
|
133
|
+
lines.push(`forecast ${formatForecast(forecastWindow(snap.fiveHour, FIVE_HOURS, opts.samples ?? [], (s) => s.five, now))}`);
|
|
134
|
+
if (week.known)
|
|
135
|
+
lines.push(formatAllowance(dailyAllowance(snap.sevenDay, opts.samples ?? [], now, opts.bedtime ?? null)));
|
|
114
136
|
const age = now.getTime() - Date.parse(snap.capturedAt);
|
|
115
137
|
const stale = !five.known;
|
|
116
138
|
lines.push(`snapshot taken ${formatDuration(age)} ago${stale ? ' · STALE' : ''}`);
|
|
@@ -124,4 +146,8 @@ export function loadSnapshot() {
|
|
|
124
146
|
}
|
|
125
147
|
export function saveSnapshot(snap) {
|
|
126
148
|
writeJson(snapshotPath(), snap);
|
|
149
|
+
try {
|
|
150
|
+
recordSample(snap); // the burn-rate history behind the forecast and the daily allowance
|
|
151
|
+
}
|
|
152
|
+
catch { }
|
|
127
153
|
}
|