dxcomplete 0.2.1 → 0.2.2

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 (47) hide show
  1. package/.env.example +0 -7
  2. package/README.md +17 -45
  3. package/dist/cli.js +0 -22
  4. package/dist/validate.js +10 -26
  5. package/docs/model.md +3 -3
  6. package/docs/taxonomy.md +1 -1
  7. package/package.json +23 -23
  8. package/templates/process/README.md +1 -1
  9. package/dist/http/service.d.ts +0 -7
  10. package/dist/http/service.js +0 -725
  11. package/dist/mcp/docs.d.ts +0 -114
  12. package/dist/mcp/docs.js +0 -626
  13. package/dist/mcp/server.d.ts +0 -20
  14. package/dist/mcp/server.js +0 -3059
  15. package/dist/runtime/auth.d.ts +0 -162
  16. package/dist/runtime/auth.js +0 -394
  17. package/dist/runtime/check.d.ts +0 -7
  18. package/dist/runtime/check.js +0 -16
  19. package/dist/runtime/config.d.ts +0 -17
  20. package/dist/runtime/config.js +0 -93
  21. package/dist/runtime/mongo.d.ts +0 -9
  22. package/dist/runtime/mongo.js +0 -56
  23. package/dist/runtime/records.d.ts +0 -427
  24. package/dist/runtime/records.js +0 -2092
  25. package/scripts/check-env-surface.mjs +0 -136
  26. package/scripts/check-public-copy.mjs +0 -263
  27. package/scripts/check-service-boundary.mjs +0 -63
  28. package/scripts/runtime-work-order.mjs +0 -506
  29. package/scripts/smoke-mcp-http.mjs +0 -4026
  30. package/src/cli.ts +0 -268
  31. package/src/http/server.ts +0 -314
  32. package/src/http/service.ts +0 -934
  33. package/src/init.ts +0 -262
  34. package/src/install-manifest.ts +0 -144
  35. package/src/mcp/docs.ts +0 -777
  36. package/src/mcp/server.ts +0 -4580
  37. package/src/package-root.ts +0 -31
  38. package/src/runtime/actor.ts +0 -61
  39. package/src/runtime/auth.ts +0 -673
  40. package/src/runtime/check.ts +0 -18
  41. package/src/runtime/config.ts +0 -128
  42. package/src/runtime/mongo.ts +0 -89
  43. package/src/runtime/records.ts +0 -3205
  44. package/src/runtime/workspace.ts +0 -155
  45. package/src/upgrade.ts +0 -356
  46. package/src/validate.ts +0 -141
  47. package/src/version.ts +0 -16
@@ -1,31 +0,0 @@
1
- import { constants as fsConstants } from "node:fs";
2
- import { access } from "node:fs/promises";
3
- import path from "node:path";
4
- import { fileURLToPath } from "node:url";
5
-
6
- export async function resolvePackageRoot(): Promise<string> {
7
- const currentFile = fileURLToPath(import.meta.url);
8
- const currentDir = path.dirname(currentFile);
9
- const candidates = [
10
- path.resolve(currentDir, ".."),
11
- path.resolve(currentDir, "..", ".."),
12
- process.cwd()
13
- ];
14
-
15
- for (const candidate of candidates) {
16
- if (await fileExists(path.join(candidate, "templates", "process", "README.md"))) {
17
- return candidate;
18
- }
19
- }
20
-
21
- throw new Error("Unable to locate dxcomplete templates directory.");
22
- }
23
-
24
- export async function fileExists(filePath: string): Promise<boolean> {
25
- try {
26
- await access(filePath, fsConstants.F_OK);
27
- return true;
28
- } catch {
29
- return false;
30
- }
31
- }
@@ -1,61 +0,0 @@
1
- import { hostname, userInfo } from "node:os";
2
-
3
- export type ActorContext = {
4
- actorId: string;
5
- provider: "local" | "google";
6
- displayName: string;
7
- email?: string;
8
- providerSubject?: string;
9
- };
10
-
11
- export function createLocalActorContext(): ActorContext {
12
- const username = readUsername();
13
- const host = hostname() || "local";
14
-
15
- return {
16
- actorId: `local:${encodeActorPart(username)}@${encodeActorPart(host)}`,
17
- provider: "local",
18
- displayName: `${username}@${host}`
19
- };
20
- }
21
-
22
- export function createGoogleActorContext(input: {
23
- email: string;
24
- subject: string;
25
- displayName?: string;
26
- }): ActorContext {
27
- const email = normalizeEmail(input.email);
28
- const subject = input.subject.trim();
29
-
30
- if (!subject) {
31
- throw new Error("Google actor subject is required.");
32
- }
33
-
34
- return {
35
- actorId: `google:${encodeActorPart(subject)}`,
36
- provider: "google",
37
- providerSubject: subject,
38
- displayName: input.displayName?.trim() || email,
39
- email
40
- };
41
- }
42
-
43
- export function normalizeEmail(value: string): string {
44
- const normalized = value.trim().toLowerCase();
45
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(normalized)) {
46
- throw new Error("Expected a valid email address.");
47
- }
48
- return normalized;
49
- }
50
-
51
- function readUsername(): string {
52
- try {
53
- return userInfo().username || "unknown";
54
- } catch {
55
- return "unknown";
56
- }
57
- }
58
-
59
- function encodeActorPart(value: string): string {
60
- return encodeURIComponent(value.trim() || "unknown");
61
- }