@company-semantics/contracts 0.35.0 → 0.36.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -120,8 +120,20 @@ export type {
120
120
  OrganizationInfo,
121
121
  OwnershipTransferRequest,
122
122
  OwnershipTransferStatus,
123
+ // Workspace visibility DTOs (Phase 2)
124
+ // @see ADR-CONT-030 for design rationale
125
+ WorkspaceRole,
126
+ WorkspaceOverview,
127
+ WorkspaceMember,
128
+ AuthMethodConfig,
129
+ WorkspaceAuthConfig,
130
+ IntegrationStatus,
131
+ WorkspaceIntegration,
132
+ WorkspaceAuditEvent,
123
133
  } from './org/index'
124
134
 
135
+ export { ROLE_DISPLAY_MAP } from './org/index'
136
+
125
137
  // MCP tool discovery types
126
138
  // @see company-semantics-backend/src/interfaces/mcp/ for implementation
127
139
  export type {
package/src/org/index.ts CHANGED
@@ -11,4 +11,15 @@ export type {
11
11
  OrganizationInfo,
12
12
  OwnershipTransferRequest,
13
13
  OwnershipTransferStatus,
14
+ // Workspace visibility DTOs (Phase 2)
15
+ WorkspaceRole,
16
+ WorkspaceOverview,
17
+ WorkspaceMember,
18
+ AuthMethodConfig,
19
+ WorkspaceAuthConfig,
20
+ IntegrationStatus,
21
+ WorkspaceIntegration,
22
+ WorkspaceAuditEvent,
14
23
  } from './types';
24
+
25
+ export { ROLE_DISPLAY_MAP } from './types';
package/src/org/types.ts CHANGED
@@ -47,3 +47,110 @@ export interface OwnershipTransferStatus {
47
47
  requestedAt?: string;
48
48
  expiresAt?: string;
49
49
  }
50
+
51
+ // =============================================================================
52
+ // Workspace Visibility DTOs (Phase 2)
53
+ // @see ADR-CONT-030 for design rationale
54
+ // =============================================================================
55
+
56
+ /**
57
+ * Display role for workspace members.
58
+ * Presentation-layer simplification of the internal RBAC roles.
59
+ */
60
+ export type WorkspaceRole = 'owner' | 'admin' | 'member';
61
+
62
+ /**
63
+ * RBAC → UI role mapping (presentation only).
64
+ * Maps internal system roles to user-facing display roles.
65
+ */
66
+ export const ROLE_DISPLAY_MAP = {
67
+ org_owner: 'owner',
68
+ org_admin: 'admin',
69
+ // All other roles → 'member'
70
+ } as const satisfies Partial<Record<string, WorkspaceRole>>;
71
+
72
+ /**
73
+ * Workspace overview for the control plane UI.
74
+ * Read-only projection of organization state.
75
+ */
76
+ export interface WorkspaceOverview {
77
+ id: string;
78
+ name: string;
79
+ type: OrgType;
80
+ owner: {
81
+ id: string;
82
+ name: string;
83
+ email: string;
84
+ };
85
+ createdAt: string;
86
+ memberCount: number;
87
+ claimable: boolean;
88
+ }
89
+
90
+ /**
91
+ * Workspace member for the members list.
92
+ * Human users only (no agent actors).
93
+ */
94
+ export interface WorkspaceMember {
95
+ id: string;
96
+ name: string;
97
+ email: string;
98
+ role: WorkspaceRole;
99
+ joinedAt: string;
100
+ }
101
+
102
+ /**
103
+ * Authentication method configuration.
104
+ */
105
+ export interface AuthMethodConfig {
106
+ enabled: boolean;
107
+ provider?: string;
108
+ }
109
+
110
+ /**
111
+ * Workspace authentication configuration.
112
+ * Enabled auth methods and provider metadata.
113
+ */
114
+ export interface WorkspaceAuthConfig {
115
+ emailOtp: AuthMethodConfig;
116
+ googleSso: AuthMethodConfig;
117
+ microsoftSso: AuthMethodConfig;
118
+ okta: AuthMethodConfig;
119
+ }
120
+
121
+ /**
122
+ * Integration connection status.
123
+ */
124
+ export type IntegrationStatus = 'active' | 'expired' | 'revoked';
125
+
126
+ /**
127
+ * Workspace integration for the integrations list.
128
+ * Shows connections visible to workspace admins.
129
+ */
130
+ export interface WorkspaceIntegration {
131
+ id: string;
132
+ provider: string;
133
+ status: IntegrationStatus;
134
+ connectedBy: {
135
+ id: string;
136
+ name: string;
137
+ };
138
+ executionScope: ExecutionScope;
139
+ lastActivity: string | null;
140
+ }
141
+
142
+ /**
143
+ * Audit event for the workspace audit log.
144
+ * Filtered to spec events only (server-side).
145
+ */
146
+ export interface WorkspaceAuditEvent {
147
+ id: string;
148
+ timestamp: string;
149
+ actor: {
150
+ id: string;
151
+ name: string;
152
+ type: 'user' | 'system';
153
+ };
154
+ action: string;
155
+ summary: string;
156
+ }