@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/README.md +1 -1
- package/dist/agent/adapters.d.ts +6 -0
- package/dist/agent/adapters.d.ts.map +1 -1
- package/dist/agent/adapters.js +5 -1
- package/dist/agent/adapters.js.map +1 -1
- package/dist/agent/tools.d.ts +11 -2
- package/dist/agent/tools.d.ts.map +1 -1
- package/dist/agent/tools.js +11 -6
- package/dist/agent/tools.js.map +1 -1
- package/dist/cli.d.ts +3 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +7 -4
- package/dist/cli.js.map +1 -1
- package/dist/conversation.js +9 -9
- package/dist/conversation.js.map +1 -1
- package/dist/decide.d.ts +1 -1
- package/dist/derive.js +2 -2
- package/dist/figure.d.ts +2 -2
- package/dist/figure.d.ts.map +1 -1
- package/dist/figure.js +2 -2
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +2 -2
- package/dist/local.d.ts +1 -1
- package/dist/local.js +5 -5
- package/dist/local.js.map +1 -1
- package/dist/mcp-http.js +1 -1
- package/dist/providers/schema.js +2 -2
- package/dist/providers/structure.d.ts +1 -1
- package/dist/providers/structure.js +23 -23
- package/dist/providers/structure.js.map +1 -1
- package/dist/questions.d.ts +1 -1
- package/dist/questions.js +12 -12
- package/dist/rungs.d.ts +1 -1
- package/dist/space.d.ts +2 -2
- package/dist/space.js +2 -2
- package/package.json +3 -3
package/dist/questions.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fieldWriters, formFields,
|
|
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 ?? `${
|
|
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 ${
|
|
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,
|
|
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 ${
|
|
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: `${
|
|
55
|
-
criteria: { true: `${
|
|
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
|
-
? `${
|
|
66
|
+
? `${humanizeField(field.name)} ${level} of ${field.max}: the least.`
|
|
67
67
|
: level === field.max
|
|
68
|
-
? `${
|
|
69
|
-
: `${
|
|
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 ${
|
|
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 ??
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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.
|
|
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/
|
|
27
|
-
"@graview/
|
|
26
|
+
"@graview/ship": "0.1.16",
|
|
27
|
+
"@graview/core": "0.1.16"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@modelcontextprotocol/sdk": "^1.32.0",
|