@voxgig/sdkgen 4.41.1 → 4.42.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/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/ReadmeTop.js +3 -7
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/helpers/alongside.d.ts +3 -0
- package/dist/helpers/alongside.js +38 -0
- package/dist/helpers/alongside.js.map +1 -0
- package/dist/sdkgen.d.ts +2 -1
- package/dist/sdkgen.js +3 -1
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/project/.sdk/src/cmp/c/ReadmeIntro_c.ts +2 -5
- package/project/.sdk/src/cmp/clojure/ReadmeIntro_clojure.ts +2 -5
- package/project/.sdk/src/cmp/cpp/ReadmeIntro_cpp.ts +2 -5
- package/project/.sdk/src/cmp/csharp/ReadmeIntro_csharp.ts +2 -5
- package/project/.sdk/src/cmp/elixir/ReadmeIntro_elixir.ts +2 -5
- package/project/.sdk/src/cmp/java/ReadmeIntro_java.ts +2 -5
- package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +2 -5
- package/project/.sdk/src/cmp/kotlin/ReadmeIntro_kotlin.ts +2 -5
- package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +2 -5
- package/project/.sdk/src/cmp/ocaml/ReadmeIntro_ocaml.ts +2 -5
- package/project/.sdk/src/cmp/perl/ReadmeIntro_perl.ts +2 -5
- package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +2 -5
- package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +2 -5
- package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +2 -5
- package/project/.sdk/src/cmp/rust/ReadmeIntro_rust.ts +2 -5
- package/project/.sdk/src/cmp/scala/ReadmeIntro_scala.ts +2 -5
- package/project/.sdk/src/cmp/swift/ReadmeIntro_swift.ts +2 -5
- package/project/.sdk/src/cmp/zig/ReadmeIntro_zig.ts +2 -5
- package/project/.sdk/tm/c/tests/feature_harness.h +19 -0
- package/project/.sdk/tm/c/tests/feature_test.c +2 -2
- package/project/.sdk/tm/c/tests/primary_utility_test.c +3 -3
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +20 -3
- package/project/.sdk/tm/perl/t/primary_utility.t +2 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +8 -1
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/ReadmeTop.ts +1 -8
- package/src/helpers/alongside.ts +46 -0
- package/src/sdkgen.ts +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -55,10 +55,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
55
55
|
paths and query strings. You work with named resources and verbs, which
|
|
56
56
|
keeps the cognitive load low.
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
> the [top-level README](../README.md).
|
|
60
|
-
|
|
61
|
-
`)
|
|
58
|
+
${alongsideNote(model, target.name)}`)
|
|
62
59
|
})
|
|
63
60
|
|
|
64
61
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -54,10 +54,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
54
54
|
paths and query strings. You work with named resources and verbs, which
|
|
55
55
|
keeps the cognitive load low.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
> the [top-level README](../README.md).
|
|
59
|
-
|
|
60
|
-
`)
|
|
57
|
+
${alongsideNote(model, target.name)}`)
|
|
61
58
|
})
|
|
62
59
|
|
|
63
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -57,10 +57,7 @@ keeps the cognitive load low. Every value flows through a single dynamic
|
|
|
57
57
|
\`sdk::Value\` type (a JSON-like variant), so there is no schema-driven code to
|
|
58
58
|
regenerate when the API changes.
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
> the [top-level README](../README.md).
|
|
62
|
-
|
|
63
|
-
`)
|
|
60
|
+
${alongsideNote(model, target.name)}`)
|
|
64
61
|
})
|
|
65
62
|
|
|
66
63
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -53,10 +53,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
53
53
|
paths and query strings. You work with named resources and verbs, which
|
|
54
54
|
keeps the cognitive load low.
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
> the [top-level README](../README.md).
|
|
58
|
-
|
|
59
|
-
`)
|
|
56
|
+
${alongsideNote(model, target.name)}`)
|
|
60
57
|
})
|
|
61
58
|
|
|
62
59
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, elixirAccessor, entityCollection, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, elixirAccessor, entityCollection, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -54,10 +54,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
54
54
|
paths and query strings. You work with named resources and verbs, which
|
|
55
55
|
keeps the cognitive load low.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
> the [top-level README](../README.md).
|
|
59
|
-
|
|
60
|
-
`)
|
|
57
|
+
${alongsideNote(model, target.name)}`)
|
|
61
58
|
})
|
|
62
59
|
|
|
63
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -54,10 +54,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
54
54
|
paths and query strings. You work with named resources and verbs, which
|
|
55
55
|
keeps the cognitive load low.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
> the [top-level README](../README.md).
|
|
59
|
-
|
|
60
|
-
`)
|
|
57
|
+
${alongsideNote(model, target.name)}`)
|
|
61
58
|
})
|
|
62
59
|
|
|
63
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -44,10 +44,7 @@ The API is exposed as capitalised, semantic **Entities** — e.g.
|
|
|
44
44
|
instead of raw URL paths and query parameters. This keeps the surface
|
|
45
45
|
predictable and low-friction for both humans and AI agents.
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
> the [top-level README](../README.md).
|
|
49
|
-
|
|
50
|
-
`)
|
|
47
|
+
${alongsideNote(model, target.name)}`)
|
|
51
48
|
})
|
|
52
49
|
|
|
53
50
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -54,10 +54,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
54
54
|
paths and query strings. You work with named resources and verbs, which
|
|
55
55
|
keeps the cognitive load low.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
> the [top-level README](../README.md).
|
|
59
|
-
|
|
60
|
-
`)
|
|
57
|
+
${alongsideNote(model, target.name)}`)
|
|
61
58
|
})
|
|
62
59
|
|
|
63
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -43,10 +43,7 @@ The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
|
|
|
43
43
|
|
|
44
44
|
It exposes the API as capitalised, semantic **Entities** — e.g. \`client:${eName}()\` — each with the same small set of operations (${opList}) instead of raw URL paths and query strings. You call meaning, not endpoints, which keeps the cognitive load low.
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
> the [top-level README](../README.md).
|
|
48
|
-
|
|
49
|
-
`)
|
|
46
|
+
${alongsideNote(model, target.name)}`)
|
|
50
47
|
})
|
|
51
48
|
|
|
52
49
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -56,10 +56,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
56
56
|
paths and query strings. You work with named resources and verbs, which
|
|
57
57
|
keeps the cognitive load low.
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
> the [top-level README](../README.md).
|
|
61
|
-
|
|
62
|
-
`)
|
|
59
|
+
${alongsideNote(model, target.name)}`)
|
|
63
60
|
})
|
|
64
61
|
|
|
65
62
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -54,10 +54,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
54
54
|
paths and query strings. You work with named resources and verbs, which
|
|
55
55
|
keeps the cognitive load low.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
> the [top-level README](../README.md).
|
|
59
|
-
|
|
60
|
-
`)
|
|
57
|
+
${alongsideNote(model, target.name)}`)
|
|
61
58
|
})
|
|
62
59
|
|
|
63
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, phpEntityAccessor, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, phpEntityAccessor, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -45,10 +45,7 @@ ${tagline}
|
|
|
45
45
|
|
|
46
46
|
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using PHP conventions.
|
|
47
47
|
|
|
48
|
-
${semantic}
|
|
49
|
-
> the [top-level README](../README.md).
|
|
50
|
-
|
|
51
|
-
`)
|
|
48
|
+
${semantic}${alongsideNote(model, target.name)}`)
|
|
52
49
|
})
|
|
53
50
|
|
|
54
51
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -53,10 +53,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
53
53
|
paths and query strings. You work with named resources and verbs, which
|
|
54
54
|
keeps the cognitive load low.
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
> the [top-level README](../README.md).
|
|
58
|
-
|
|
59
|
-
`)
|
|
56
|
+
${alongsideNote(model, target.name)}`)
|
|
60
57
|
})
|
|
61
58
|
|
|
62
59
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -45,10 +45,7 @@ ${tagline}
|
|
|
45
45
|
|
|
46
46
|
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using idiomatic Ruby conventions.
|
|
47
47
|
|
|
48
|
-
${semantic}
|
|
49
|
-
> the [top-level README](../README.md).
|
|
50
|
-
|
|
51
|
-
`)
|
|
48
|
+
${semantic}${alongsideNote(model, target.name)}`)
|
|
52
49
|
})
|
|
53
50
|
|
|
54
51
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -54,10 +54,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
54
54
|
paths and query strings. You work with named resources and verbs, which
|
|
55
55
|
keeps the cognitive load low.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
> the [top-level README](../README.md).
|
|
59
|
-
|
|
60
|
-
`)
|
|
57
|
+
${alongsideNote(model, target.name)}`)
|
|
61
58
|
})
|
|
62
59
|
|
|
63
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -54,10 +54,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
54
54
|
paths and query strings. You work with named resources and verbs, which
|
|
55
55
|
keeps the cognitive load low.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
> the [top-level README](../README.md).
|
|
59
|
-
|
|
60
|
-
`)
|
|
57
|
+
${alongsideNote(model, target.name)}`)
|
|
61
58
|
})
|
|
62
59
|
|
|
63
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -52,10 +52,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
52
52
|
paths and query strings. You work with named resources and verbs, which
|
|
53
53
|
keeps the cognitive load low.
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
> the [top-level README](../README.md).
|
|
57
|
-
|
|
58
|
-
`)
|
|
55
|
+
${alongsideNote(model, target.name)}`)
|
|
59
56
|
})
|
|
60
57
|
|
|
61
58
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, modelText } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, modelText, alongsideNote } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -54,10 +54,7 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
54
54
|
paths and query strings. You work with named resources and verbs, which
|
|
55
55
|
keeps the cognitive load low.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
> the [top-level README](../README.md).
|
|
59
|
-
|
|
60
|
-
`)
|
|
57
|
+
${alongsideNote(model, target.name)}`)
|
|
61
58
|
})
|
|
62
59
|
|
|
63
60
|
|
|
@@ -21,6 +21,25 @@
|
|
|
21
21
|
|
|
22
22
|
#define FH __attribute__((unused)) static
|
|
23
23
|
|
|
24
|
+
// ---- environment ------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
// MinGW declares neither setenv nor unsetenv.
|
|
27
|
+
FH void fh_setenv(const char* key, const char* val) {
|
|
28
|
+
#ifdef _WIN32
|
|
29
|
+
_putenv_s(key, val);
|
|
30
|
+
#else
|
|
31
|
+
setenv(key, val, 1);
|
|
32
|
+
#endif
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
FH void fh_unsetenv(const char* key) {
|
|
36
|
+
#ifdef _WIN32
|
|
37
|
+
_putenv_s(key, "");
|
|
38
|
+
#else
|
|
39
|
+
unsetenv(key);
|
|
40
|
+
#endif
|
|
41
|
+
}
|
|
42
|
+
|
|
24
43
|
// ---- feature presence -------------------------------------------------------
|
|
25
44
|
|
|
26
45
|
FH bool fh_has_feature(const char* name) {
|
|
@@ -1059,14 +1059,14 @@ static void test_proxy_bypasses_noproxy_hosts(void) {
|
|
|
1059
1059
|
|
|
1060
1060
|
static void test_proxy_fromenv_reads_https_proxy(void) {
|
|
1061
1061
|
if (!fh_present("proxy")) return;
|
|
1062
|
-
|
|
1062
|
+
fh_setenv("HTTPS_PROXY", "http://env-proxy:8080");
|
|
1063
1063
|
voxgig_value* calls;
|
|
1064
1064
|
Fetcher* srv = fh_recorder(NULL, NULL, &calls);
|
|
1065
1065
|
Feature* f = feature_proxy_new();
|
|
1066
1066
|
FhFeat feats[] = {{f, cmap(1, "fromEnv", v_bool(true))}};
|
|
1067
1067
|
FhHarness h = fh_make(srv, feats, 1);
|
|
1068
1068
|
fh_op(&h, op_load());
|
|
1069
|
-
|
|
1069
|
+
fh_unsetenv("HTTPS_PROXY");
|
|
1070
1070
|
CHECK_STR_EQ(get_str(rec_fetchdef(calls, 0), "proxy"), "http://env-proxy:8080",
|
|
1071
1071
|
"proxy: env proxy");
|
|
1072
1072
|
}
|
|
@@ -540,7 +540,7 @@ static void test_primary_fetcher_getonly_guard(void) {
|
|
|
540
540
|
const char* url = "http://127.0.0.1:9/planet/p1?apikey=GUARDKEY01";
|
|
541
541
|
const char* prior = getenv("VOXGIG_GETONLY_GUARD");
|
|
542
542
|
char* saved = NULL == prior ? NULL : strdup(prior);
|
|
543
|
-
|
|
543
|
+
fh_setenv("VOXGIG_GETONLY_GUARD", "TRUE");
|
|
544
544
|
|
|
545
545
|
PNError* err = NULL;
|
|
546
546
|
utility_fetch(util, ctx, url, cmap(2, "method", v_str("POST"), "headers", v_map()), &err);
|
|
@@ -556,9 +556,9 @@ static void test_primary_fetcher_getonly_guard(void) {
|
|
|
556
556
|
"fetcher getonly: a GET reaches the closed port");
|
|
557
557
|
|
|
558
558
|
if (NULL == saved) {
|
|
559
|
-
|
|
559
|
+
fh_unsetenv("VOXGIG_GETONLY_GUARD");
|
|
560
560
|
} else {
|
|
561
|
-
|
|
561
|
+
fh_setenv("VOXGIG_GETONLY_GUARD", saved);
|
|
562
562
|
free(saved);
|
|
563
563
|
}
|
|
564
564
|
}
|
|
@@ -366,6 +366,23 @@ static void fetcherBlockedTestMode() {
|
|
|
366
366
|
ASSERT_TRUE(msg.find("blocked") != std::string::npos, "expected error containing 'blocked'");
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
+
// MinGW declares neither setenv nor unsetenv.
|
|
370
|
+
static void setEnv(const char* key, const char* val) {
|
|
371
|
+
#ifdef _WIN32
|
|
372
|
+
_putenv_s(key, val);
|
|
373
|
+
#else
|
|
374
|
+
setenv(key, val, 1);
|
|
375
|
+
#endif
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
static void unsetEnv(const char* key) {
|
|
379
|
+
#ifdef _WIN32
|
|
380
|
+
_putenv_s(key, "");
|
|
381
|
+
#else
|
|
382
|
+
unsetenv(key);
|
|
383
|
+
#endif
|
|
384
|
+
}
|
|
385
|
+
|
|
369
386
|
// Nothing listens on port 9; this target has no transport of its own, so a
|
|
370
387
|
// request the guard let through fails as fetch_no_transport.
|
|
371
388
|
static void fetcherGetOnlyGuard() {
|
|
@@ -379,7 +396,7 @@ static void fetcherGetOnlyGuard() {
|
|
|
379
396
|
std::string url = "http://127.0.0.1:9/planet/p1?apikey=GUARDKEY01";
|
|
380
397
|
const char* prior = std::getenv("VOXGIG_GETONLY_GUARD");
|
|
381
398
|
std::string saved = nullptr == prior ? "" : prior;
|
|
382
|
-
|
|
399
|
+
setEnv("VOXGIG_GETONLY_GUARD", "TRUE");
|
|
383
400
|
|
|
384
401
|
std::string codes[2];
|
|
385
402
|
std::string msg;
|
|
@@ -392,8 +409,8 @@ static void fetcherGetOnlyGuard() {
|
|
|
392
409
|
if (0 == i) msg = e->getMessage();
|
|
393
410
|
}
|
|
394
411
|
}
|
|
395
|
-
if (nullptr == prior)
|
|
396
|
-
else
|
|
412
|
+
if (nullptr == prior) unsetEnv("VOXGIG_GETONLY_GUARD");
|
|
413
|
+
else setEnv("VOXGIG_GETONLY_GUARD", saved.c_str());
|
|
397
414
|
|
|
398
415
|
ASSERT_TRUE(codes[0] == "fetch_getonly_block", "expected the POST to be refused");
|
|
399
416
|
ASSERT_TRUE(msg.find("[GET-ONLY GUARD] blocked POST /planet/p1") != std::string::npos, "expected the path");
|
|
@@ -455,7 +455,8 @@ SKIP: {
|
|
|
455
455
|
. 'Content-Length: ' . length($body) . "\r\nConnection: close\r\n\r\n" . $body;
|
|
456
456
|
close $sock;
|
|
457
457
|
}
|
|
458
|
-
|
|
458
|
+
# Windows forks a thread, where _exit ends the whole test process.
|
|
459
|
+
$^O eq 'MSWin32' ? exit(0) : POSIX::_exit(0);
|
|
459
460
|
}
|
|
460
461
|
close $seen_w;
|
|
461
462
|
my $base = 'http://127.0.0.1:' . $server->sockport;
|
|
@@ -438,7 +438,14 @@ final class PrimaryUtilityTest: XCTestCase {
|
|
|
438
438
|
addr.sin_addr.s_addr = inet_addr("127.0.0.1")
|
|
439
439
|
var len = socklen_t(MemoryLayout<sockaddr_in>.size)
|
|
440
440
|
_ = withUnsafeMutablePointer(to: &addr) {
|
|
441
|
-
$0.withMemoryRebound(to: sockaddr.self, capacity: 1) {
|
|
441
|
+
$0.withMemoryRebound(to: sockaddr.self, capacity: 1) { sa -> Int32 in
|
|
442
|
+
#if os(Linux)
|
|
443
|
+
return bind(fd, sa, len)
|
|
444
|
+
#else
|
|
445
|
+
// A bare bind here names an instance method XCTestCase inherits.
|
|
446
|
+
return Darwin.bind(fd, sa, len)
|
|
447
|
+
#endif
|
|
448
|
+
}
|
|
442
449
|
}
|
|
443
450
|
listen(fd, 8)
|
|
444
451
|
_ = withUnsafeMutablePointer(to: &addr) {
|
package/src/cmp/ReadmeTop.ts
CHANGED
|
@@ -21,6 +21,7 @@ import type { ExampleLang, PrimaryCall } from '../helpers/opExample'
|
|
|
21
21
|
import { canonScalarKey } from '../helpers/canonType'
|
|
22
22
|
import { safeVarName, exampleVarName, jsKey } from '../helpers/naming'
|
|
23
23
|
import { modelText } from '../helpers/text'
|
|
24
|
+
import { isConsumer } from '../helpers/alongside'
|
|
24
25
|
|
|
25
26
|
import {
|
|
26
27
|
installCommand as pkgInstall,
|
|
@@ -64,14 +65,6 @@ function pickLeadTarget(sdkTargets: any[]): any | undefined {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
|
|
67
|
-
const PHASES = ['entity', 'feature', 'readme', 'agentguide', 'test']
|
|
68
|
-
|
|
69
|
-
// A consumer (py-data) switches every phase off and has no ReadmeTop components.
|
|
70
|
-
function isConsumer(target: any): boolean {
|
|
71
|
-
return PHASES.every((name: string) => false === target.phase?.[name]?.active)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
68
|
const EXAMPLE_FENCE: Record<string, string> = {
|
|
76
69
|
ts: 'ts', js: 'js', py: 'python', go: 'go', php: 'php', rb: 'ruby', lua: 'lua',
|
|
77
70
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { KIT } from '@voxgig/apidef'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const PHASES = ['entity', 'feature', 'readme', 'agentguide', 'test']
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// A consumer (py-data) switches every phase off and has no ReadmeTop components.
|
|
8
|
+
function isConsumer(target: any): boolean {
|
|
9
|
+
return PHASES.every((name: string) => false === target?.phase?.[name]?.active)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// Names only the active surfaces, so a project with go-mcp off is not promised one.
|
|
14
|
+
function alongsideNote(model: any, self: string): string {
|
|
15
|
+
const target = model?.main?.[KIT]?.target || {}
|
|
16
|
+
const others = Object.entries(target)
|
|
17
|
+
.filter(([name, t]: [string, any]) => name !== self && null != t && false !== t.active)
|
|
18
|
+
|
|
19
|
+
const has = (name: string) => others.some(([other]) => other === name)
|
|
20
|
+
const cli = has('go-cli')
|
|
21
|
+
const mcp = has('go-mcp')
|
|
22
|
+
const langs = others.some(([name, t]: [string, any]) =>
|
|
23
|
+
'go-cli' !== name && 'go-mcp' !== name && !isConsumer(t))
|
|
24
|
+
|
|
25
|
+
const parts: string[] = []
|
|
26
|
+
if (langs) parts.push('Other languages')
|
|
27
|
+
if (cli) parts.push('the CLI')
|
|
28
|
+
if (mcp) parts.push(cli ? 'MCP server' : 'the MCP server')
|
|
29
|
+
if (0 === parts.length) return ''
|
|
30
|
+
|
|
31
|
+
const list = 1 === parts.length ? parts[0]
|
|
32
|
+
: 2 === parts.length ? parts.join(' and ')
|
|
33
|
+
: parts.slice(0, -1).join(', ') + ', and ' + parts[parts.length - 1]
|
|
34
|
+
const verb = 1 === parts.length && !langs ? 'lives' : 'live'
|
|
35
|
+
|
|
36
|
+
return `> ${list[0].toUpperCase() + list.slice(1)} ${verb} alongside this one — see
|
|
37
|
+
> the [top-level README](../README.md).
|
|
38
|
+
|
|
39
|
+
`
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
isConsumer,
|
|
45
|
+
alongsideNote,
|
|
46
|
+
}
|
package/src/sdkgen.ts
CHANGED
|
@@ -158,6 +158,7 @@ import {
|
|
|
158
158
|
GENERATOR_URL,
|
|
159
159
|
} from './helpers/packageMeta'
|
|
160
160
|
import { modelText } from './helpers/text'
|
|
161
|
+
import { alongsideNote } from './helpers/alongside'
|
|
161
162
|
import {
|
|
162
163
|
npmScriptRm,
|
|
163
164
|
npmScriptEnv,
|
|
@@ -1327,6 +1328,7 @@ export {
|
|
|
1327
1328
|
SECURITY_EMAIL,
|
|
1328
1329
|
GENERATOR_URL,
|
|
1329
1330
|
modelText,
|
|
1331
|
+
alongsideNote,
|
|
1330
1332
|
npmScriptRm,
|
|
1331
1333
|
npmScriptEnv,
|
|
1332
1334
|
npmScriptTestSome,
|