@graview/tools 0.1.14 → 0.1.16

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/questions.js CHANGED
@@ -1,4 +1,4 @@
1
- import { fieldWriters, formFields, humaniseField, nounOf, labelOf, readableFields, withArticle, defOf, descriptionOf, } from "@graview/core";
1
+ import { fieldWriters, formFields, humanizeField, nounOf, labelOf, readableFields, withArticle, defOf, descriptionOf, } from "@graview/core";
2
2
  /** Node-typed values a decision provider answers with, as declared. */
3
3
  const MAX_SCORE_LEVELS = 10;
4
4
  /** The description a zod field carries, through optional/default wrappers. */
@@ -12,7 +12,7 @@ function describedAs(schema) {
12
12
  }
13
13
  return undefined;
14
14
  }
15
- const say = (field, description, of) => description ?? `${humaniseField(field.name)} of ${of}.`;
15
+ const say = (field, description, of) => description ?? `${humanizeField(field.name)} of ${of}.`;
16
16
  /**
17
17
  * One scalar control as one question, or nothing when the control has no
18
18
  * typed answer (text, a date, a list). `describe` is the field's own
@@ -27,11 +27,11 @@ function questionFor(store, field, description, of) {
27
27
  const criteria = {};
28
28
  for (const option of field.options)
29
29
  criteria[option] = null;
30
- return { type: "choice", instructions: `Which ${humaniseField(field.name).toLowerCase()}? ${say(field, description, of)}`, criteria };
30
+ return { type: "choice", instructions: `Which ${humanizeField(field.name).toLowerCase()}? ${say(field, description, of)}`, criteria };
31
31
  }
32
32
  case "node": {
33
33
  /*
34
- * THE LIVE NODES OF THAT KIND, labelled by labelOf: the same word a
34
+ * THE LIVE NODES OF THAT KIND, labeled by labelOf: the same word a
35
35
  * card shows, a chat names and a tool describes. The option name is
36
36
  * the id, because the answer has to be a call's argument; the
37
37
  * meaning beside it is what the model reads.
@@ -46,13 +46,13 @@ function questionFor(store, field, description, of) {
46
46
  }
47
47
  if (Object.keys(criteria).length === 0)
48
48
  return undefined;
49
- return { type: "choice", instructions: `Which ${humaniseField(field.name).toLowerCase()}? ${say(field, description, of)}`, criteria };
49
+ return { type: "choice", instructions: `Which ${humanizeField(field.name).toLowerCase()}? ${say(field, description, of)}`, criteria };
50
50
  }
51
51
  case "boolean":
52
52
  return {
53
53
  type: "noul",
54
- instructions: `${humaniseField(field.name)}: ${description ?? `is this true of ${of}?`}`,
55
- criteria: { true: `${humaniseField(field.name)} holds.`, false: `${humaniseField(field.name)} does not hold.` },
54
+ instructions: `${humanizeField(field.name)}: ${description ?? `is this true of ${of}?`}`,
55
+ criteria: { true: `${humanizeField(field.name)} holds.`, false: `${humanizeField(field.name)} does not hold.` },
56
56
  };
57
57
  case "number": {
58
58
  if (field.min === undefined || field.max === undefined)
@@ -63,12 +63,12 @@ function questionFor(store, field, description, of) {
63
63
  const levels = [];
64
64
  for (let level = field.min; level <= field.max; level++) {
65
65
  levels.push(level === field.min
66
- ? `${humaniseField(field.name)} ${level} of ${field.max}: the least.`
66
+ ? `${humanizeField(field.name)} ${level} of ${field.max}: the least.`
67
67
  : level === field.max
68
- ? `${humaniseField(field.name)} ${level} of ${field.max}: the most.`
69
- : `${humaniseField(field.name)} ${level} of ${field.max}.`);
68
+ ? `${humanizeField(field.name)} ${level} of ${field.max}: the most.`
69
+ : `${humanizeField(field.name)} ${level} of ${field.max}.`);
70
70
  }
71
- return { type: "score", instructions: `How much ${humaniseField(field.name).toLowerCase()}? ${say(field, description, of)}`, criteria: levels };
71
+ return { type: "score", instructions: `How much ${humanizeField(field.name).toLowerCase()}? ${say(field, description, of)}`, criteria: levels };
72
72
  }
73
73
  default:
74
74
  return undefined;
@@ -155,7 +155,7 @@ export function questionsForInvariant(store, name, violation) {
155
155
  const invariant = store.allInvariants().find((candidate) => candidate.name === name);
156
156
  if (!invariant)
157
157
  return [];
158
- const rule = invariant.description ?? invariant.label ?? humaniseField(invariant.name);
158
+ const rule = invariant.description ?? invariant.label ?? humanizeField(invariant.name);
159
159
  const subject = violation?.subjectId;
160
160
  const suffix = subject ? `:${subject}` : "";
161
161
  const out = [
package/dist/rungs.d.ts CHANGED
@@ -11,7 +11,7 @@ import type { IntelligenceCapability } from "@graview/core";
11
11
  * a rung is choosing a config value, and whatever answers, its proposals
12
12
  * still travel the one validated path.
13
13
  *
14
- * The config is plain serialisable data in the BROWSER's storage, because
14
+ * The config is plain serializable data in the BROWSER's storage, because
15
15
  * an API key belongs to the person at the keyboard: it must never sit in a
16
16
  * repo, a bundle, or a declaration that ships.
17
17
  */
package/dist/space.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  * be drawn inside it and a thing must be placed inside the area it stands
12
12
  * in. Nothing looked. The answer came back as seven full-width horizontal
13
13
  * bands stacked down the page, every one of them lying across its
14
- * neighbours, and the app accepted it line for line and drew it.
14
+ * neighbors, and the app accepted it line for line and drew it.
15
15
  *
16
16
  * A stated rule nobody enforces is worse than no rule: it tells the model it
17
17
  * got away with something, and it tells the person the answer was checked.
@@ -31,7 +31,7 @@ export type Ring = readonly SpacePoint[];
31
31
  *
32
32
  * A point exactly ON an edge is decided by which edge the ray happens to
33
33
  * cross, so one side of a shape reads in and the other out. That is the
34
- * standard behaviour of this algorithm and it is fine for what this is for —
34
+ * standard behavior of this algorithm and it is fine for what this is for —
35
35
  * a model's coordinates are never exactly on a line — but it is not a thing
36
36
  * to build on.
37
37
  */
package/dist/space.js CHANGED
@@ -11,7 +11,7 @@
11
11
  * be drawn inside it and a thing must be placed inside the area it stands
12
12
  * in. Nothing looked. The answer came back as seven full-width horizontal
13
13
  * bands stacked down the page, every one of them lying across its
14
- * neighbours, and the app accepted it line for line and drew it.
14
+ * neighbors, and the app accepted it line for line and drew it.
15
15
  *
16
16
  * A stated rule nobody enforces is worse than no rule: it tells the model it
17
17
  * got away with something, and it tells the person the answer was checked.
@@ -26,7 +26,7 @@
26
26
  *
27
27
  * A point exactly ON an edge is decided by which edge the ray happens to
28
28
  * cross, so one side of a shape reads in and the other out. That is the
29
- * standard behaviour of this algorithm and it is fine for what this is for —
29
+ * standard behavior of this algorithm and it is fine for what this is for —
30
30
  * a model's coordinates are never exactly on a line — but it is not a thing
31
31
  * to build on.
32
32
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graview/tools",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@graview/core": "0.1.14",
27
- "@graview/ship": "0.1.14"
26
+ "@graview/ship": "0.1.16",
27
+ "@graview/core": "0.1.16"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@modelcontextprotocol/sdk": "^1.32.0",