@loxtep/sdk 0.7.29 → 0.9.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 (126) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +2 -1
  3. package/dist/cli/commands/clone-cmd.d.ts +39 -0
  4. package/dist/cli/commands/clone-cmd.d.ts.map +1 -0
  5. package/dist/cli/commands/clone-cmd.js +291 -0
  6. package/dist/cli/commands/clone-cmd.js.map +1 -0
  7. package/dist/cli/commands/connectors-cmd.d.ts +13 -1
  8. package/dist/cli/commands/connectors-cmd.d.ts.map +1 -1
  9. package/dist/cli/commands/connectors-cmd.js +47 -1
  10. package/dist/cli/commands/connectors-cmd.js.map +1 -1
  11. package/dist/cli/commands/deploy-cmd.d.ts.map +1 -1
  12. package/dist/cli/commands/deploy-cmd.js +51 -19
  13. package/dist/cli/commands/deploy-cmd.js.map +1 -1
  14. package/dist/cli/commands/init-cmd.d.ts.map +1 -1
  15. package/dist/cli/commands/init-cmd.js +12 -1
  16. package/dist/cli/commands/init-cmd.js.map +1 -1
  17. package/dist/cli/commands/link-cmd.d.ts +33 -0
  18. package/dist/cli/commands/link-cmd.d.ts.map +1 -0
  19. package/dist/cli/commands/link-cmd.js +145 -0
  20. package/dist/cli/commands/link-cmd.js.map +1 -0
  21. package/dist/cli/commands/projects-cmd.d.ts +39 -1
  22. package/dist/cli/commands/projects-cmd.d.ts.map +1 -1
  23. package/dist/cli/commands/projects-cmd.js +231 -4
  24. package/dist/cli/commands/projects-cmd.js.map +1 -1
  25. package/dist/cli/commands/projects-github-cmd.d.ts +24 -0
  26. package/dist/cli/commands/projects-github-cmd.d.ts.map +1 -0
  27. package/dist/cli/commands/projects-github-cmd.js +108 -0
  28. package/dist/cli/commands/projects-github-cmd.js.map +1 -0
  29. package/dist/cli/commands/push-cmd.d.ts +3 -7
  30. package/dist/cli/commands/push-cmd.d.ts.map +1 -1
  31. package/dist/cli/commands/push-cmd.js +10 -39
  32. package/dist/cli/commands/push-cmd.js.map +1 -1
  33. package/dist/cli/commands/status-cmd.d.ts +21 -0
  34. package/dist/cli/commands/status-cmd.d.ts.map +1 -0
  35. package/dist/cli/commands/status-cmd.js +127 -0
  36. package/dist/cli/commands/status-cmd.js.map +1 -0
  37. package/dist/cli/help.d.ts.map +1 -1
  38. package/dist/cli/help.js +23 -3
  39. package/dist/cli/help.js.map +1 -1
  40. package/dist/cli/index.js +82 -5
  41. package/dist/cli/index.js.map +1 -1
  42. package/dist/cli/known-locals-registry.d.ts +51 -0
  43. package/dist/cli/known-locals-registry.d.ts.map +1 -0
  44. package/dist/cli/known-locals-registry.js +94 -0
  45. package/dist/cli/known-locals-registry.js.map +1 -0
  46. package/dist/cli/project-context.d.ts +9 -0
  47. package/dist/cli/project-context.d.ts.map +1 -1
  48. package/dist/cli/project-context.js +21 -0
  49. package/dist/cli/project-context.js.map +1 -1
  50. package/dist/client/connectors-types.d.ts +11 -0
  51. package/dist/client/connectors-types.d.ts.map +1 -1
  52. package/dist/client/connectors.d.ts +3 -2
  53. package/dist/client/connectors.d.ts.map +1 -1
  54. package/dist/client/connectors.js +9 -1
  55. package/dist/client/connectors.js.map +1 -1
  56. package/dist/client/deployments-types.d.ts +40 -0
  57. package/dist/client/deployments-types.d.ts.map +1 -0
  58. package/dist/client/deployments-types.js +6 -0
  59. package/dist/client/deployments-types.js.map +1 -0
  60. package/dist/client/deployments.d.ts +13 -0
  61. package/dist/client/deployments.d.ts.map +1 -0
  62. package/dist/client/deployments.js +48 -0
  63. package/dist/client/deployments.js.map +1 -0
  64. package/dist/client/index.d.ts +11 -1
  65. package/dist/client/index.d.ts.map +1 -1
  66. package/dist/client/index.js +6 -0
  67. package/dist/client/index.js.map +1 -1
  68. package/dist/client/loxtep-client.d.ts.map +1 -1
  69. package/dist/client/loxtep-client.js +9 -18
  70. package/dist/client/loxtep-client.js.map +1 -1
  71. package/dist/client/project-workspace-inventory.d.ts +61 -0
  72. package/dist/client/project-workspace-inventory.d.ts.map +1 -0
  73. package/dist/client/project-workspace-inventory.js +300 -0
  74. package/dist/client/project-workspace-inventory.js.map +1 -0
  75. package/dist/client/project-workspace-status-types.d.ts +644 -0
  76. package/dist/client/project-workspace-status-types.d.ts.map +1 -0
  77. package/dist/client/project-workspace-status-types.js +265 -0
  78. package/dist/client/project-workspace-status-types.js.map +1 -0
  79. package/dist/client/project-workspace-status.d.ts +76 -0
  80. package/dist/client/project-workspace-status.d.ts.map +1 -0
  81. package/dist/client/project-workspace-status.js +368 -0
  82. package/dist/client/project-workspace-status.js.map +1 -0
  83. package/dist/client/projects.d.ts +53 -0
  84. package/dist/client/projects.d.ts.map +1 -1
  85. package/dist/client/projects.js +18 -0
  86. package/dist/client/projects.js.map +1 -1
  87. package/dist/client/versions-types.d.ts +3 -4
  88. package/dist/client/versions-types.d.ts.map +1 -1
  89. package/dist/client/versions-types.js +3 -4
  90. package/dist/client/versions-types.js.map +1 -1
  91. package/dist/client/workflows-types.d.ts +16 -3
  92. package/dist/client/workflows-types.d.ts.map +1 -1
  93. package/dist/client/workflows-types.js +47 -1
  94. package/dist/client/workflows-types.js.map +1 -1
  95. package/dist/client/workflows.d.ts.map +1 -1
  96. package/dist/client/workflows.js +2 -1
  97. package/dist/client/workflows.js.map +1 -1
  98. package/dist/client/workspace-package.d.ts +26 -0
  99. package/dist/client/workspace-package.d.ts.map +1 -0
  100. package/dist/client/workspace-package.js +85 -0
  101. package/dist/client/workspace-package.js.map +1 -0
  102. package/dist/client/workspace.d.ts +5 -1
  103. package/dist/client/workspace.d.ts.map +1 -1
  104. package/dist/client/workspace.js +3 -1
  105. package/dist/client/workspace.js.map +1 -1
  106. package/dist/config/index.d.ts +2 -2
  107. package/dist/config/index.d.ts.map +1 -1
  108. package/dist/config/index.js +2 -2
  109. package/dist/config/index.js.map +1 -1
  110. package/dist/config/paths.d.ts +2 -0
  111. package/dist/config/paths.d.ts.map +1 -1
  112. package/dist/config/paths.js +6 -0
  113. package/dist/config/paths.js.map +1 -1
  114. package/dist/config/platform-request-url.d.ts +2 -2
  115. package/dist/config/platform-request-url.js +4 -4
  116. package/dist/config/workspace-config.d.ts +5 -0
  117. package/dist/config/workspace-config.d.ts.map +1 -1
  118. package/dist/config/workspace-config.js +22 -0
  119. package/dist/config/workspace-config.js.map +1 -1
  120. package/docs/code-first-cli.md +28 -2
  121. package/docs/project-workspace-status.md +161 -0
  122. package/docs/sdk-mcp-mapping.md +4 -2
  123. package/package.json +1 -1
  124. package/schemas/entity-json-schemas/SCHEMA_SYNC.md +4 -3
  125. package/schemas/entity-json-schemas/data-product.json +1 -1
  126. package/schemas/entity-json-schemas/odps-product.json +1 -1
@@ -0,0 +1,161 @@
1
+ # Project workspace status (three layers)
2
+
3
+ Stable snake_case payload for **local / cloud / deployed** visibility.
4
+
5
+ Canonical TypeScript + Zod: `src/client/project-workspace-status-types.ts`
6
+ (exported from `@loxtep/sdk`).
7
+
8
+ ## Layers
9
+
10
+ | Layer | Meaning | Source of truth |
11
+ | --- | --- | --- |
12
+ | `local` | CWD / known-locals + `.loxtep/project.json` | Disk |
13
+ | `cloud` | Org project + Studio/S3 workspace | `project_id` + workspace APIs |
14
+ | `deployed` | Instance bindings after `deploy` | Deployments |
15
+
16
+ **Unpublished** = deltas between layers (not a draft flag):
17
+
18
+ - `unpublished.local_to_cloud` — Local → Cloud (not pushed / workspace out of date)
19
+ - `unpublished.cloud_to_deployed` — Cloud → Deployed (pushed but not deployed, or stale)
20
+
21
+ `dirty: null` means **not computed** at this `population_depth`. Do not treat null as clean.
22
+
23
+ ## Consumers
24
+
25
+ | Surface | Uses |
26
+ | --- | --- |
27
+ | CLI `loxtep status` | Full `ProjectWorkspaceStatus` (`population_depth: "status"`) |
28
+ | CLI `loxtep status --unpublished` / `projects changes` | Same payload at `population_depth: "unpublished"` with file/entity lists |
29
+ | CLI `loxtep projects list\|get` | `ProjectListStatusEnrichment` fields |
30
+ | CLI `loxtep projects link` / `loxtep link` | Local bind + `~/.loxtep/workspaces.json` |
31
+ | MCP `get_project_workspace_status` | Full `ProjectWorkspaceStatus` (planned) |
32
+ | MCP `list_projects` / `get_project` | Enrich with summary fields when cheap (planned) |
33
+
34
+ Producer helpers live in `src/client/project-workspace-status.ts`
35
+ (`buildProjectWorkspaceStatus`, `formatProjectWorkspaceStatusLines`,
36
+ `enrichProjectListSummary`) and `src/client/project-workspace-inventory.ts`
37
+ (push discovery + `.loxtep/push-manifest.json` compare).
38
+
39
+ Do **not** invent a second list command; enrich the existing `projects` plural group.
40
+
41
+ Distinct from CLI/MCP **`observe status`** (runtime bots/queues).
42
+
43
+ ## Link vs attach (Phase C)
44
+
45
+ | Command | Binds | Writes |
46
+ | --- | --- | --- |
47
+ | `loxtep projects link` / `loxtep link` | Cloud **project** ↔ local directory | `.loxtep/project.json` (`project_id`) + `~/.loxtep/workspaces.json` |
48
+ | `loxtep attach` | Local project ↔ runtime **Instance** | `instance_id` + `api_url` (+ streams) in `.loxtep/project.json` |
49
+ | `loxtep init --project-id` | Same project bind as `link`, plus scaffold dirs | project.json + known-locals upsert |
50
+
51
+ Canonical flow for an existing unbound cloud project:
52
+
53
+ ```text
54
+ loxtep projects link <project_id|name> [--path .]
55
+ loxtep attach --instance <instance-id>
56
+ # edit local package
57
+ loxtep push
58
+ loxtep deploy
59
+ ```
60
+
61
+ GitHub is optional for `link` (`cloud.github.state` may remain `unbound`).
62
+
63
+ ## Population cost (keep list snappy)
64
+
65
+ Field costs live in `PROJECT_WORKSPACE_STATUS_FIELD_COST`. Depth ceilings:
66
+
67
+ | `population_depth` | Cost ceiling | Typical use |
68
+ | --- | --- | --- |
69
+ | `summary` | `cheap` | Every list row: local path presence, github linked\|unbound, attach |
70
+ | `status` | `moderate` | `loxtep status` / MCP get: last deploy id/status/age, dirty **booleans** |
71
+ | `unpublished` | `expensive` | `--unpublished` / `list_project_changes`: entity/file inventories + counts |
72
+
73
+ **Cheap (list-safe):** cwd / known-locals FS checks; columns already on the cloud
74
+ project list row (`project_id`, `name`, `github_repo_*`).
75
+
76
+ **Moderate (status/get):** one deploy lookup (or cached join) per project;
77
+ Local→Cloud dirty boolean via package vs `.loxtep/push-manifest.json`
78
+ (same discovery as `loxtep push`) without attaching per-file lists.
79
+
80
+ **Expensive (opt-in):** `loxtep status --unpublished` / `loxtep projects changes` —
81
+ walk local package vs push manifest (+ optional cloud workflow id escalate),
82
+ attach `unpublished.*.changes` entity/file inventory and counts.
83
+
84
+ Producers SHOULD omit or set `null` rather than stall list enrichment on moderate/expensive work.
85
+
86
+ ## GitHub linked vs unbound
87
+
88
+ `cloud.github.state`:
89
+
90
+ - `linked` — project has GitHub binding (`github_repo_url` / name)
91
+ - `unbound` — no GitHub; Studio/S3 + `loxtep push` path
92
+
93
+ Attach (`local.attach_state`) is **instance** binding (`loxtep attach`), not GitHub.
94
+
95
+ ## Deploy age / status
96
+
97
+ `deployed.state`: `never_deployed` | `deployed` | `stale` | `unknown`.
98
+
99
+ When known: `deployment_id`, `deployment_status`, `last_deployed_at`,
100
+ `age_seconds` (derived). Prefer `unknown` over inventing success when the deploy
101
+ API is unavailable.
102
+
103
+ ## Example (status depth)
104
+
105
+ ```json
106
+ {
107
+ "schema_version": 1,
108
+ "population_depth": "status",
109
+ "project_id": "11111111-1111-1111-1111-111111111111",
110
+ "display_name": "shopify-ingest",
111
+ "local": {
112
+ "presence": "present",
113
+ "path": "/home/you/proj",
114
+ "project_file": "/home/you/proj/.loxtep/project.json",
115
+ "known_local": true,
116
+ "attach_state": "attached",
117
+ "instance_id": "22222222-2222-2222-2222-222222222222",
118
+ "api_url": "https://apidev.loxtep.io",
119
+ "project_id": "11111111-1111-1111-1111-111111111111"
120
+ },
121
+ "cloud": {
122
+ "presence": "present",
123
+ "project_id": "11111111-1111-1111-1111-111111111111",
124
+ "organization_id": "33333333-3333-3333-3333-333333333333",
125
+ "name": "shopify-ingest",
126
+ "status": "active",
127
+ "github": {
128
+ "state": "unbound",
129
+ "url": null,
130
+ "name": null,
131
+ "branch": null,
132
+ "last_sync_at": null
133
+ },
134
+ "workspace_revision": null,
135
+ "workspace_updated_at": null
136
+ },
137
+ "deployed": {
138
+ "presence": "absent",
139
+ "state": "never_deployed",
140
+ "instance_id": "22222222-2222-2222-2222-222222222222",
141
+ "deployment_id": null,
142
+ "deployment_status": null,
143
+ "last_deployed_at": null,
144
+ "age_seconds": null
145
+ },
146
+ "unpublished": {
147
+ "local_to_cloud": {
148
+ "dirty": true,
149
+ "summary": "Local package has changes not pushed",
150
+ "changed_count": null
151
+ },
152
+ "cloud_to_deployed": {
153
+ "dirty": false,
154
+ "summary": "Never deployed",
155
+ "changed_count": null
156
+ }
157
+ },
158
+ "next_action": "push",
159
+ "notes": []
160
+ }
161
+ ```
@@ -12,7 +12,7 @@ deprecation aliases.
12
12
  | --- | --- | --- |
13
13
  | `loxtep_session` | `client.session` | `get_current_user`, `get_current_organization`, `logout` |
14
14
  | `loxtep_connect` | `client.connect` | `.connectors.*`, `.templates.*` |
15
- | `loxtep_workspace` | `client.workspace` | `.projects.*`, `.instances.*`, `.versions` (REST pending) |
15
+ | `loxtep_workspace` | `client.workspace` | `.projects.*`, `.instances.*`, `.versions` (REST pending); planned MCP `get_project_workspace_status` → `ProjectWorkspaceStatus` ([docs](./project-workspace-status.md)) |
16
16
  | `loxtep_build` | `client.build` | `.workflows.*`, `.triggers.*`, `.data_products.*`, `.targets.*`, deploy writes, `.get_writer({ bot_id, queue })` escape hatch |
17
17
  | `loxtep_define` | `client.define` | `.schemas.*`, `.quality.*`, `.standards.*`, `.data_contracts.*`, `.domains.*` |
18
18
  | `loxtep_meaning` | `client.meaning` | `.thesaurus.*` (ontology/semantic REST split pending) |
@@ -35,7 +35,9 @@ Same on Python: `client.get_writer("orders_raw")`, `client.get_reader("orders_ra
35
35
  Low-level workflow writer escape hatch: `client.build.get_writer(workflow_id, { bot_id, output_queue_name, … })`.
36
36
 
37
37
  Vocabulary: MCP `loxtep_build` trigger operations (backend: connections) and target operations
38
- (backend: consumptions). Connector OAuth uses `get_oauth_url`; sample capture uses `capture_samples`.
38
+ (backend: consumptions). Connector OAuth uses `get_oauth_url`; connectivity
39
+ probe uses `test_connector` / `loxtep connectors test <id>`; sample capture uses
40
+ `capture_samples` / `loxtep connectors capture-samples <id> --entity-type <name>`.
39
41
 
40
42
  When unsure: **MCP for provisioning and agent tool calls**; **SDK for runtime**
41
43
  services running in your infrastructure or CI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loxtep/sdk",
3
- "version": "0.7.29",
3
+ "version": "0.9.0",
4
4
  "description": "Loxtep SDK for Node.js — the Enterprise Context Layer: data products, workflows, projects, queues, and machine-usable context for AI",
5
5
  "author": "Loxtep <engineering@loxtep.io>",
6
6
  "homepage": "https://loxtep.io",
@@ -3,8 +3,9 @@
3
3
  These JSON Schema draft-07 files are a copy of the Loxtep platform schemas used
4
4
  for customer workspace entity validation.
5
5
 
6
- **Source (canonical):**
7
- `loxtep/platform-backend/_core/src/customer-workspace/entity-json-schemas/`
6
+ **Source (canonical):** Loxtep platform customer-workspace entity JSON schemas
7
+ (private platform monorepo). Sync from a local checkout when those schemas
8
+ change.
8
9
 
9
10
  **Sync command** (from `nodejs/`):
10
11
 
@@ -15,4 +16,4 @@ node scripts/sync-entity-schemas.mjs /path/to/loxtep
15
16
  When platform schemas change, re-run the sync script and note the date/source
16
17
  commit in the SDK CHANGELOG.
17
18
 
18
- **Last synced:** 2026-07-24 (from local loxtep checkout)
19
+ **Last synced:** 2026-07-24 (from local Loxtep platform checkout)
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://loxtep.io/schemas/entity/data-product.json",
4
4
  "title": "Data Product Entity",
5
- "description": "JSON Schema for Data Product entity in customer workspace (Studio / S3 graph). Flow-graph fields (workflow_id, upstream_entity_id, etc.) describe placement in the workflow canvas. The canonical interoperable catalog and API representation is ODPS v4.1 (Open Data Products Standard): include `odps_document` aligned with https://opendataproducts.org/v4.1/schema/odps.json — see `odps-product.json` and .kiro/specs/odps-data-product-standard in the Loxtep repo.",
5
+ "description": "JSON Schema for Data Product entity in customer workspace (Studio / S3 graph). Flow-graph fields (workflow_id, upstream_entity_id, etc.) describe placement in the workflow canvas. The canonical interoperable catalog and API representation is ODPS v4.1 (Open Data Products Standard): include `odps_document` aligned with https://opendataproducts.org/v4.1/schema/odps.json — see `odps-product.json` in this package for the ODPS document shape.",
6
6
  "type": "object",
7
7
  "required": [
8
8
  "data_product_id",
@@ -3,7 +3,7 @@
3
3
  "$id": "https://loxtep.io/schemas/entity/odps-product.json",
4
4
  "title": "ODPS v4.1 Data Product Document",
5
5
  "x-canonical-json-schema": "https://opendataproducts.org/v4.1/schema/odps.json",
6
- "description": "Open Data Products Standard (ODPS) v4.1 root document (`product.*`). Authoritative JSON Schema: https://opendataproducts.org/v4.1/schema/odps.json . Loxtep platform types and mapping: platform-backend/_core/src/types/odps/ and .kiro/specs/odps-data-product-standard. Platform-specific fields live under `product.custom.loxtep` (medallion, storage, ingestion, organization_id, domain_id, project_id, workflow_id, etc.). For strict full-schema validation in toolchains that resolve remote $ref, compose with allOf + $ref to x-canonical-json-schema (requires network or bundled copy).",
6
+ "description": "Open Data Products Standard (ODPS) v4.1 root document (`product.*`). Authoritative JSON Schema: https://opendataproducts.org/v4.1/schema/odps.json . Platform-specific fields live under `product.custom.loxtep` (medallion, storage, ingestion, organization_id, domain_id, project_id, workflow_id, etc.). For strict full-schema validation in toolchains that resolve remote $ref, compose with allOf + $ref to x-canonical-json-schema (requires network or bundled copy).",
7
7
  "type": "object",
8
8
  "required": ["product"],
9
9
  "additionalProperties": false,