@ancplua/qyl-api-schema 0.4.0 → 0.5.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.
Files changed (58) hide show
  1. package/README.md +50 -64
  2. package/api/routes.tsp +90 -943
  3. package/api/runner.tsp +74 -0
  4. package/api/streaming.tsp +13 -299
  5. package/common/errors.tsp +14 -1
  6. package/common/pagination.tsp +1 -1
  7. package/common/types.tsp +2 -6
  8. package/generated/ts-runtime/api.d.ts +734 -0
  9. package/generated/ts-runtime/api.js +219 -0
  10. package/index.tsp +7 -34
  11. package/models/health.tsp +22 -0
  12. package/models/runner-mcp.tsp +47 -0
  13. package/models/runner.tsp +37 -0
  14. package/models/session.tsp +1 -1
  15. package/otel/enums.tsp +1 -1
  16. package/otel/logs.tsp +1 -1
  17. package/otel/otel-conventions.tsp +0 -1
  18. package/otel/profiles.tsp +1 -1
  19. package/otel/resource.tsp +1 -1
  20. package/otel/span.tsp +1 -1
  21. package/package.json +46 -34
  22. package/VERSIONING.md +0 -88
  23. package/generated/README.md +0 -35
  24. package/intelligence/causal-rules.tsp +0 -34
  25. package/intelligence/diagnostic-patterns.tsp +0 -54
  26. package/intelligence/investigation-strategies.tsp +0 -37
  27. package/intelligence/main.tsp +0 -17
  28. package/intelligence/seed/patterns.tsp +0 -171
  29. package/intelligence/seed/rules.tsp +0 -43
  30. package/intelligence/seed/strategies.tsp +0 -55
  31. package/intelligence/signals.tsp +0 -60
  32. package/models/agent/agent-run.tsp +0 -154
  33. package/models/agent/tool-call.tsp +0 -122
  34. package/models/agent/workflow-checkpoint.tsp +0 -50
  35. package/models/agent/workflow-execution.tsp +0 -136
  36. package/models/alerting.tsp +0 -436
  37. package/models/configurator.tsp +0 -433
  38. package/models/control-graph.tsp +0 -197
  39. package/models/db.tsp +0 -767
  40. package/models/deployment.tsp +0 -365
  41. package/models/error.tsp +0 -433
  42. package/models/genai.tsp +0 -1305
  43. package/models/http.tsp +0 -547
  44. package/models/identity.tsp +0 -213
  45. package/models/issues.tsp +0 -484
  46. package/models/log.tsp +0 -140
  47. package/models/messaging.tsp +0 -304
  48. package/models/otel-config.tsp +0 -455
  49. package/models/retention.tsp +0 -240
  50. package/models/rpc.tsp +0 -309
  51. package/models/search.tsp +0 -243
  52. package/models/system.tsp +0 -400
  53. package/models/test.tsp +0 -346
  54. package/models/triage.tsp +0 -113
  55. package/models/workflow.tsp +0 -396
  56. package/models/workspace.tsp +0 -435
  57. package/otel/metrics.tsp +0 -358
  58. package/tspconfig.yaml +0 -49
package/README.md CHANGED
@@ -1,96 +1,82 @@
1
- # `@ancplua/qyl-api-schema`
1
+ # @ancplua/qyl-api-schema
2
2
 
3
- `qyl-api-schema` is the TypeSpec source of truth for qyl's public observability API.
4
-
5
- It is not an OpenTelemetry package and it is not a server implementation. OpenTelemetry is one
6
- compatibility layer for qyl ingestion and instrumentation; qyl's API contracts are product contracts
7
- owned by qyl.
3
+ The TypeSpec source of truth for Qyl's client-visible product API. This repository
4
+ emits the public schema and contract artifacts; it does not implement the server,
5
+ storage engine, or OTLP receiver.
8
6
 
9
7
  ## Contract pipeline
10
8
 
11
9
  ```text
12
- open-telemetry/semantic-conventions @ v1.43.0 + semantic-conventions-genai (dev registry)
10
+ Qyl.OpenTelemetry.SemanticConventions
13
11
  |
14
- | Weaver (Qyl.OpenTelemetry.SemanticConventions repo:
15
- | generate.sh -> resolved-registry.json -> emit_typespec_keys.py)
12
+ | generated semantic key projection
16
13
  v
17
14
  generated/otel-keys.gen.tsp
18
15
  |
19
- | TypeSpec import / lockstep key projection
20
- v
21
- @ancplua/qyl-api-schema
22
- |
23
- | TypeSpec emit
24
16
  v
25
- OpenAPI JSON + JSON Schema + Qyl.Api.Contracts + TS contract types
17
+ authored Qyl TypeSpec
26
18
  |
27
- v
28
- qyl services, dashboard, tools, and generated clients
19
+ +----> OpenAPI and JSON Schema
20
+ +----> Qyl.Api.Contracts
21
+ +----> generated TypeScript contracts
29
22
  ```
30
23
 
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.*`.
24
+ The semantic-key projection is generated from the sibling conventions repository's
25
+ pinned core and GenAI registries. It supplies typed names for telemetry attributes;
26
+ Qyl domain models, routes, responses, stream events, and errors are authored here.
37
27
 
38
- ## Published artifacts
28
+ ## Boundary
39
29
 
40
- | Ecosystem | Package | Purpose |
41
- | --- | --- | --- |
42
- | TypeSpec/npm | `@ancplua/qyl-api-schema` | Source schema for qyl API consumers and generators |
43
- | NuGet | `Qyl.Api.Contracts` | BCL-only generated C# DTOs for qyl services and consumers |
30
+ - Every client-visible Qyl request, response, stream event, and error is defined in
31
+ this repository.
32
+ - OTLP ingestion uses official OpenTelemetry protobuf messages in the runtime and is
33
+ not redefined here.
34
+ - Models under `otel/` used by Qyl routes are client-facing JSON projections, not
35
+ OTLP wire messages.
36
+ - Collector storage rows, ingest batches, query models, and internal projections do
37
+ not cross an HTTP, gRPC, MCP, streaming, or generated-client boundary.
44
38
 
45
- Client packages are intentionally not committed here. Generate clients from the OpenAPI document
46
- when needed, or add a dedicated `Qyl.Api.Client` package later. Do not generate a second C# model
47
- world through a client emitter.
39
+ If a runtime shape needs to become client-visible, add it to TypeSpec first,
40
+ regenerate the artifacts, and map the runtime model to the generated contract.
48
41
 
49
- ## Repository layout
42
+ ## Published artifacts
50
43
 
51
- | Path | Role |
52
- | --- | --- |
53
- | `main.tsp` | Local compile entry point. Includes build-only emit routing. |
54
- | `index.tsp` | Published TypeSpec entry point. Excludes local emitter wiring. |
55
- | `api/` | REST and streaming API operations. |
56
- | `common/`, `models/`, `otel/`, `intelligence/` | qyl contract models. |
57
- | `emitters/` | Local TypeSpec emitters for C#, TS types, and qyl schema linting. |
58
- | `generated/` | Generated artifacts from `npm run compile`; never edit by hand. |
59
- | `packaging/Qyl.Api.Contracts.csproj` | Packs `generated/contracts` as the `Qyl.Api.Contracts` NuGet. |
44
+ | Ecosystem | Artifact | Purpose |
45
+ | --- | --- | --- |
46
+ | npm/TypeSpec | `@ancplua/qyl-api-schema` | Authored schema for TypeSpec consumers |
47
+ | NuGet | `Qyl.Api.Contracts` | BCL-only generated .NET contracts |
48
+ | Generated | OpenAPI, JSON Schema, TypeScript | Client and validation inputs |
49
+
50
+ `main.tsp` is the local compile entry point and includes emitter routing. `index.tsp`
51
+ is the published TypeSpec entry point and contains only the client-facing contract.
60
52
 
61
- ## Local development
53
+ ## Develop
62
54
 
63
55
  ```bash
64
56
  npm ci
65
57
  npm run lint
66
58
  npm run lint:public
67
59
  npm run compile
68
- ./build.sh PackContractsNuget
60
+ ./build.sh Check
69
61
  ```
70
62
 
71
- `npm run compile` emits:
63
+ Important generated outputs include:
72
64
 
73
65
  - `generated/openapi/qyl.openapi.json`
74
- - `generated/json-schema/qyl-api-schema.json`
66
+ - `generated/json-schema/qyl-api-schema`
75
67
  - `generated/contracts/**/*.cs`
76
68
  - `generated/ts-types/**`
77
69
 
78
- ## Hard boundaries
79
-
80
- - Do not add TypeSpec C# server scaffold emitters.
81
- - Do not add DuckDB/storage schema emitters. Physical storage schema lives in qyl runtime mapping specs.
82
- - Do not commit generated ASP.NET projects, controllers, mocks, or starter
83
- docs that tell maintainers to fill in mock business logic.
84
- - Do not add compatibility shims for old package IDs or namespaces.
85
- - Do not hand-edit generated output. Fix TypeSpec, emitter code, or generator inputs, then regenerate.
86
- - Do not reintroduce legacy qyl API package IDs or namespaces.
87
-
88
- ## Publishing
89
-
90
- Publishing is fully automated via GitHub Actions OIDC **trusted publishing** — no stored secrets, no
91
- API keys. Publish a GitHub Release whose tag is `vMAJOR.MINOR.PATCH[-prerelease]`; `publish.yml` then,
92
- all-or-nothing, packs and validates the artifacts, stamps that single tag-derived version onto both,
93
- pushes `Qyl.Api.Contracts` to nuget.org (NuGet/login OIDC) and publishes `@ancplua/qyl-api-schema` to
94
- npmjs.org (npm trusted publishing + provenance). NuGet pushes first (idempotent) and npm last
95
- (immutable), so a partial failure re-runs cleanly. See [VERSIONING.md](VERSIONING.md) for how the
96
- version is derived from the tag. There are no long-lived publish tokens to manage or rotate.
70
+ Generated files are not editing surfaces. Change TypeSpec or the owning emitter and
71
+ regenerate.
72
+
73
+ ## Publish
74
+
75
+ GitHub Actions publishes both registries through OIDC trusted publishing. A release
76
+ tag supplies one version for npm and NuGet. The workflow validates and packs first,
77
+ publishes in an ordered restartable sequence, waits for indexed artifacts, and then
78
+ smokes clean consumers. No long-lived npm or NuGet token is stored.
79
+
80
+ ## License
81
+
82
+ Apache-2.0