@ancplua/qyl-api-schema 0.2.2 → 0.3.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 +10 -7
- package/VERSIONING.md +8 -8
- package/common/types.tsp +9 -2
- package/generated/README.md +17 -8
- package/generated/otel-keys.gen.tsp +605 -64
- package/intelligence/main.tsp +0 -2
- package/intelligence/seed/patterns.tsp +1 -2
- package/intelligence/seed/rules.tsp +1 -2
- package/intelligence/seed/strategies.tsp +1 -2
- package/models/agent/agent-run.tsp +1 -1
- package/models/agent/tool-call.tsp +1 -1
- package/models/agent/workflow-checkpoint.tsp +1 -1
- package/models/agent/workflow-execution.tsp +1 -1
- package/models/db.tsp +3 -3
- package/models/deployment.tsp +1 -1
- package/models/error.tsp +1 -1
- package/models/genai.tsp +8 -54
- package/models/http.tsp +3 -3
- package/models/identity.tsp +1 -1
- package/models/log.tsp +1 -1
- package/models/messaging.tsp +1 -1
- package/models/otel-config.tsp +1 -1
- package/models/rpc.tsp +1 -1
- package/models/session.tsp +1 -1
- package/models/system.tsp +1 -1
- package/models/test.tsp +1 -1
- package/otel/enums.tsp +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -9,11 +9,12 @@ owned by qyl.
|
|
|
9
9
|
## Contract pipeline
|
|
10
10
|
|
|
11
11
|
```text
|
|
12
|
-
open-telemetry/semantic-conventions @ v1.
|
|
12
|
+
open-telemetry/semantic-conventions @ v1.43.0 + semantic-conventions-genai (dev registry)
|
|
13
13
|
|
|
|
14
|
-
| Weaver
|
|
14
|
+
| Weaver (Qyl.OpenTelemetry.SemanticConventions repo:
|
|
15
|
+
| generate.sh -> resolved-registry.json -> emit_typespec_keys.py)
|
|
15
16
|
v
|
|
16
|
-
|
|
17
|
+
generated/otel-keys.gen.tsp
|
|
17
18
|
|
|
|
18
19
|
| TypeSpec import / lockstep key projection
|
|
19
20
|
v
|
|
@@ -27,10 +28,12 @@ OpenAPI JSON + JSON Schema + Qyl.Api.Contracts + TS contract types
|
|
|
27
28
|
qyl services, dashboard, tools, and generated clients
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
The generic OpenTelemetry key projection
|
|
31
|
-
|
|
32
|
-
`ANcpLua.OpenTelemetry.SemanticConventions.Keys
|
|
33
|
-
|
|
31
|
+
The generic OpenTelemetry key projection is the checked-in
|
|
32
|
+
`generated/otel-keys.gen.tsp` under
|
|
33
|
+
`ANcpLua.OpenTelemetry.SemanticConventions.Keys.*`, regenerated by the
|
|
34
|
+
`Qyl.OpenTelemetry.SemanticConventions` repo's Weaver pipeline.
|
|
35
|
+
This repo defines qyl domain models, routes, and response contracts under
|
|
36
|
+
`Qyl.Api.Contracts.*`.
|
|
34
37
|
|
|
35
38
|
## Published artifacts
|
|
36
39
|
|
package/VERSIONING.md
CHANGED
|
@@ -40,14 +40,6 @@ enum GenAiVersions {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
model GenAiSpanAttributes {
|
|
43
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.System)
|
|
44
|
-
@removed(GenAiVersions.v1_37)
|
|
45
|
-
system?: string;
|
|
46
|
-
|
|
47
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.UsagePromptTokens)
|
|
48
|
-
@removed(GenAiVersions.v1_28)
|
|
49
|
-
usagePromptTokens?: TokenCount;
|
|
50
|
-
|
|
51
43
|
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.UsageInputTokens)
|
|
52
44
|
usageInputTokens?: TokenCount;
|
|
53
45
|
|
|
@@ -57,6 +49,14 @@ model GenAiSpanAttributes {
|
|
|
57
49
|
}
|
|
58
50
|
```
|
|
59
51
|
|
|
52
|
+
Note (v0.3.0): the pre-migration `gen_ai.*` fields that carried upstream-deleted
|
|
53
|
+
wire keys (`gen_ai.system`, `gen_ai.prompt`, `gen_ai.completion`,
|
|
54
|
+
`gen_ai.usage.prompt_tokens` / `.completion_tokens`, and the
|
|
55
|
+
`gen_ai.openai.*` vendor keys) were **removed from the contract surface**
|
|
56
|
+
when the OTel 1.42 GenAI-registry split was adopted. Old-key telemetry is a
|
|
57
|
+
collector *ingestion normalization* concern (mapping below), not a contract
|
|
58
|
+
field.
|
|
59
|
+
|
|
60
60
|
## Ingestion mapping (deprecated -> current)
|
|
61
61
|
|
|
62
62
|
Consumers can keep ingestion backward-compatible by normalizing deprecated attribute keys. Keep any downstream mapping aligned with the TypeSpec history.
|
package/common/types.tsp
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// qyl common types and scalars
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// Foundational types used across qyl API contracts and OTel-compatible models.
|
|
5
|
-
// OpenTelemetry semantic-convention references are pinned to v1.
|
|
5
|
+
// OpenTelemetry semantic-convention references are pinned to core v1.43.0
|
|
6
|
+
// (GenAI keys come from the dedicated GenAI registry since the 1.42 split).
|
|
6
7
|
// =============================================================================
|
|
7
8
|
|
|
8
9
|
import "@typespec/versioning";
|
|
@@ -42,8 +43,14 @@ enum OTelVersion {
|
|
|
42
43
|
@doc("OTel Semconv v1.40 - Oracle DB split, RPC cleanup, GenAI cache tokens")
|
|
43
44
|
v1_40: "1.40.0",
|
|
44
45
|
|
|
45
|
-
@doc("OTel Semconv v1.41 -
|
|
46
|
+
@doc("OTel Semconv v1.41 - GraphQL doc opt-in, RPC server client.* removal")
|
|
46
47
|
v1_41: "1.41.0",
|
|
48
|
+
|
|
49
|
+
@doc("OTel Semconv v1.42 - GenAI conventions moved to the dedicated GenAI registry; k8s/container registry attrs stable")
|
|
50
|
+
v1_42: "1.42.0",
|
|
51
|
+
|
|
52
|
+
@doc("OTel Semconv v1.43 - Current compatibility pin (core; GenAI keys from the GenAI dev registry)")
|
|
53
|
+
v1_43: "1.43.0",
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
// =============================================================================
|
package/generated/README.md
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
# generated
|
|
2
2
|
|
|
3
|
-
This directory holds
|
|
3
|
+
This directory holds the semconv TypeSpec key projection and the emitter
|
|
4
|
+
outputs. `otel-keys.gen.tsp` is Weaver-generated — **do not edit by hand**.
|
|
4
5
|
|
|
5
6
|
## Files
|
|
6
7
|
|
|
7
8
|
| File | Source | Regenerate via |
|
|
8
9
|
| --- | --- | --- |
|
|
9
|
-
| `otel-keys.gen.tsp` | OpenTelemetry semantic-conventions v1.
|
|
10
|
+
| `otel-keys.gen.tsp` | OpenTelemetry semantic-conventions core **v1.43.0** + the GenAI dev registry (`open-telemetry/semantic-conventions-genai`, pinned commit), merged and projected by the `Qyl.OpenTelemetry.SemanticConventions` repo's Weaver pipeline | In that repo: `src/…SourceGeneration/scripts/generate.sh` (refresh `Resources/resolved-registry.json`), then `src/…SourceGeneration/scripts/emit_typespec_keys.py --write <path-to-this-file>` |
|
|
10
11
|
|
|
11
|
-
## What
|
|
12
|
+
## What the key files provide
|
|
12
13
|
|
|
13
14
|
One TypeSpec namespace per OpenTelemetry root group, each declaring `const <Name>: string = "<dotted.key>"`. Extracted `.tsp` models reference these consts inside `@encodedName(...)` instead of hand-typing dotted attribute keys.
|
|
14
15
|
|
|
15
16
|
```tsp
|
|
16
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.
|
|
17
|
-
|
|
17
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.ProviderName)
|
|
18
|
+
providerName?: string;
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
Deprecated upstream attributes are emitted with `#deprecated "..."` so models that reference them produce a TypeSpec compiler warning matching upstream's own deprecation notes.
|
|
21
22
|
|
|
22
23
|
## Pin
|
|
23
24
|
|
|
24
|
-
The checked-in projection is pinned to
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
The checked-in projection is pinned to core semantic-conventions **v1.43.0**
|
|
26
|
+
(commit in the file header) plus the GenAI dev registry commit pinned in the
|
|
27
|
+
SemanticConventions repo's `generate.sh` (`SEMCONV_GENAI_REF`). The
|
|
28
|
+
`VerifyKeysLockstep` Nuke target asserts the header pin matches the
|
|
29
|
+
`OtelKeysVersion` parameter (`.nuke/parameters.json`).
|
|
30
|
+
|
|
31
|
+
Bumping the pin: update the refs in that repo's `generate.sh`, re-run it plus
|
|
32
|
+
`emit_typespec_keys.py --write`, replace this checked-in projection, and keep
|
|
33
|
+
`SemConvSchemaVersion` in that repo's `Version.props` in lockstep — the .NET
|
|
34
|
+
constants and this TypeSpec projection must cite the same registry versions.
|
|
35
|
+
Direction is one-way: this repo never invokes Weaver directly.
|