@lmctl-ai/lmctl 0.2.111 → 0.2.112

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/build-info.json CHANGED
@@ -1 +1 @@
1
- {"sha": "2f3f5d6f3314589fb46293508497dbeca2b5150a", "dirty": false, "builtAt": "2026-10-06T12:30:34.000Z"}
1
+ {"sha": "14363e14c3dcefe4daa2fc9b41da74a74e6b2e19", "dirty": false, "builtAt": "2026-10-06T13:30:10.000Z"}
package/modules/gh.lms ADDED
@@ -0,0 +1,68 @@
1
+ // GitHub GraphQL CLI wrapper; import declares functions only.
2
+ // gh.gh_graphql(query, vars) returns the parsed response map.
3
+ // Strings use raw -f; null/booleans/safe integers use -F. No floats,
4
+ // compound variables, pagination, schema lint or JSON-body transport.
5
+ // gh owns authentication/host configuration. All execution is argv, no shell.
6
+ // Completed failures and GraphQL errors stop with require (exit 2), naming
7
+ // gh api graphql and stderr tail/messages. Missing executable and invalid JSON
8
+ // remain located native errors (exit 1); no synthetic child exit is invented.
9
+ package gh;
10
+
11
+ fn _text(value, label) {
12
+ require(is_string(value), "gh: " + label + " must be a string");
13
+ require(index_of(value, from_char_code(0)) < 0, "gh: " + label + " must be NUL-free");
14
+ return value;
15
+ }
16
+ fn _variable(name, value) {
17
+ _text(name, "variable name");
18
+ require(regex_test(name, "^[_A-Za-z][_0-9A-Za-z]*$") && name != "query" && name != "operationName",
19
+ "gh: invalid or reserved variable name");
20
+ flag = "-f";
21
+ encoded = "";
22
+ if (is_string(value)) {
23
+ encoded = _text(value, "variable " + name);
24
+ } else if (value == null || type(value) == "boolean") {
25
+ flag = "-F";
26
+ encoded = json_stringify(value);
27
+ } else {
28
+ require(is_number(value) && value >= -9007199254740991 && value <= 9007199254740991 && floor(value) == value,
29
+ "gh: variable " + name + " must be a string, boolean, null or safe integer; floats and compound values are not supported");
30
+ flag = "-F";
31
+ encoded = str(value);
32
+ }
33
+ return [flag, name + "=" + encoded];
34
+ }
35
+ fn _checked(result) {
36
+ text = result.stderr;
37
+ if (ends_with(text, "\n")) { text = slice(text, 0, len(text)-1); }
38
+ tail = join(slice(split(text, "\n"), -20), "\n");
39
+ require(result.code == 0 && result.signal == null && !result.timed_out,
40
+ "gh api graphql failed (exit " + str(result.code) + ", signal " + str(result.signal) + "): " + tail);
41
+ response = json_parse(result.stdout);
42
+ require(is_map(response) && (has_key(response, "data") || has_key(response, "errors")),
43
+ "gh api graphql: expected a response map with data or errors");
44
+ if (has_key(response, "errors") && response.errors != null) {
45
+ require(is_array(response.errors), "gh api graphql: errors must be an array");
46
+ messages = [];
47
+ for (problem in response.errors) {
48
+ require(is_map(problem) && is_string(problem.message), "gh api graphql: error entry must contain a message");
49
+ push(messages, problem.message);
50
+ }
51
+ require(len(messages) == 0, "gh api graphql: " + join(messages, "; "));
52
+ }
53
+ return response;
54
+ }
55
+ fn gh_graphql(query, vars) {
56
+ _text(query, "query");
57
+ require(is_map(vars), "gh: variables must be a map");
58
+ flags = [];
59
+ for (name in keys(vars)) { flags = concat(flags, _variable(name, vars[name])); }
60
+ result = null;
61
+ if (len(flags) == 0) {
62
+ result = system gh api graphql -f query=${query};
63
+ } else {
64
+ argv = cmd gh api graphql -f query=${query};
65
+ result = system(concat(argv, flags));
66
+ }
67
+ return _checked(result);
68
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmctl-ai/lmctl",
3
- "version": "0.2.111",
3
+ "version": "0.2.112",
4
4
  "description": "A provider-agnostic control plane for teams of AI coding agents — across providers, with independent review and durable memory.",
5
5
  "type": "module",
6
6
  "homepage": "https://lmctl.com",
@@ -34,7 +34,8 @@
34
34
  "README.md",
35
35
  "CHANGELOG.md",
36
36
  "examples/",
37
- "modules/git.lms"
37
+ "modules/git.lms",
38
+ "modules/gh.lms"
38
39
  ],
39
40
  "engines": {
40
41
  "node": ">=24.15.0"