@fa-software/semi2-dsh 0.0.13 → 0.0.14-preview.20260922051239

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.
@@ -26,12 +26,18 @@ export type Scalars = {
26
26
  input: string;
27
27
  output: string;
28
28
  };
29
- /** 自由形状的脱敏数据:仅审查日志的 detail 使用(服务端写入前已脱敏,只读不参与计算)。 */
29
+ /** 自由形状的脱敏数据:仅日志事实的 detail 使用(服务端写入前已脱敏,只读不参与计算)。 */
30
30
  JSON: {
31
31
  input: unknown;
32
32
  output: unknown;
33
33
  };
34
34
  };
35
+ /** 动作码选项:某本日志筛选下拉的选项来源(服务端注册表,前端不复制)。 */
36
+ export type ActionOption = {
37
+ __typename?: 'ActionOption';
38
+ action: Scalars['String']['output'];
39
+ label: Scalars['String']['output'];
40
+ };
35
41
  export type Activation = {
36
42
  __typename?: 'Activation';
37
43
  expiresAt: Scalars['DateTime']['output'];
@@ -41,13 +47,6 @@ export type AddCnbUsersInput = {
41
47
  /** 要预建账户的上游成员 CNB 用户 ID;本轮上游没返回的会被跳过。 */
42
48
  externalUserIds: Array<Scalars['String']['input']>;
43
49
  };
44
- /** 动作码选项:筛选下拉的选项来源(服务端注册表,前端不复制)。 */
45
- export type AuditActionOption = {
46
- __typename?: 'AuditActionOption';
47
- action: Scalars['String']['output'];
48
- category: AuditCategory;
49
- label: Scalars['String']['output'];
50
- };
51
50
  /** 身份来源:会话 / 用户密钥 / 接入密钥 / 匿名(登录失败、无效密钥)。 */
52
51
  export declare enum AuditActorKind {
53
52
  AccessKey = "ACCESS_KEY",
@@ -55,13 +54,6 @@ export declare enum AuditActorKind {
55
54
  Session = "SESSION",
56
55
  UserKey = "USER_KEY"
57
56
  }
58
- /** 审查类别:读 / 写 / 身份凭据 / 运行面生命周期。 */
59
- export declare enum AuditCategory {
60
- Auth = "AUTH",
61
- Read = "READ",
62
- Runtime = "RUNTIME",
63
- Write = "WRITE"
64
- }
65
57
  /** 来源面:控制台 / NPC / 云开发工作站 / 容器 Web / 宿主直跑 / 未标注。 */
66
58
  export declare enum AuditChannel {
67
59
  Console = "CONSOLE",
@@ -71,58 +63,103 @@ export declare enum AuditChannel {
71
63
  Unknown = "UNKNOWN",
72
64
  Workstation = "WORKSTATION"
73
65
  }
74
- export type AuditEvent = {
75
- __typename?: 'AuditEvent';
76
- /** 动作码,例 `write.project.delete`;闭集与中文文案由服务端的注册表给出。 */
66
+ /** 结果:SUCCESS = 完成;DENIED = 身份 / 权限 / 来源被拒;ERROR = 领域校验或冲突失败。 */
67
+ export declare enum AuditOutcome {
68
+ Denied = "DENIED",
69
+ Error = "ERROR",
70
+ Success = "SUCCESS"
71
+ }
72
+ /** 无会话事件筛选:被拒 / 失败的运行面读取与起会话之前的整体失败。 */
73
+ export type ClientEventFilter = {
74
+ /** 精确匹配动作码;选项清单走 clientActionOptions。 */
75
+ action?: InputMaybe<Scalars['String']['input']>;
76
+ actorUserId?: InputMaybe<Scalars['ID']['input']>;
77
+ channel?: InputMaybe<AuditChannel>;
78
+ from?: InputMaybe<Scalars['DateTime']['input']>;
79
+ outcome?: InputMaybe<AuditOutcome>;
80
+ to?: InputMaybe<Scalars['DateTime']['input']>;
81
+ };
82
+ /**
83
+ * 客户端会话:一次运行面会话一行(dsh 会话创建时建行、销毁时回填结束)。
84
+ * NPC 的一次任务先按任务引用建行,会话创建后再把 dsh 会话 id 补上。
85
+ */
86
+ export type ClientSession = {
87
+ __typename?: 'ClientSession';
88
+ actorDisplayName?: Maybe<Scalars['String']['output']>;
89
+ actorId?: Maybe<Scalars['ID']['output']>;
90
+ actorKind: AuditActorKind;
91
+ actorUsername?: Maybe<Scalars['String']['output']>;
92
+ channel: AuditChannel;
93
+ /** 运行面实例标识:同名 dsh 会话在不同容器里靠它分开。 */
94
+ clientId?: Maybe<Scalars['String']['output']>;
95
+ clientIp?: Maybe<Scalars['String']['output']>;
96
+ code?: Maybe<Scalars['String']['output']>;
97
+ /** 结束原因码(例 `dispose`)。 */
98
+ endReason?: Maybe<Scalars['String']['output']>;
99
+ /** 没有结束行(进程被强杀 / 容器停止)时为空。 */
100
+ endedAt?: Maybe<Scalars['DateTime']['output']>;
101
+ /** 本会话已记下的事件条数。 */
102
+ eventCount: Scalars['Int']['output'];
103
+ /** 行的稳定身份:优先任务引用,其次「客户端实例 + dsh 会话 id」。 */
104
+ key: Scalars['ID']['output'];
105
+ modelId?: Maybe<Scalars['String']['output']>;
106
+ /** 会话当下的结果:取最后一条事件的结果。 */
107
+ outcome: AuditOutcome;
108
+ /** 按工作区 / 任务引用解析出的项目;不可读时为空、只留展示名。 */
109
+ projectId?: Maybe<Scalars['ID']['output']>;
110
+ projectLabel?: Maybe<Scalars['String']['output']>;
111
+ reasoningLevel?: Maybe<Scalars['String']['output']>;
112
+ /** 任务引用 `<repo>#<issue|pr>#<iid>`。 */
113
+ runRef?: Maybe<Scalars['String']['output']>;
114
+ /** dsh 会话 id;会话尚未创建时为空(例:NPC 拒绝运行)。 */
115
+ sessionId?: Maybe<Scalars['String']['output']>;
116
+ startedAt: Scalars['DateTime']['output'];
117
+ workspacePath?: Maybe<Scalars['String']['output']>;
118
+ /** 会话 cwd 与命中的已登记工作区 slug。 */
119
+ workspaceSlug?: Maybe<Scalars['String']['output']>;
120
+ };
121
+ /** 会话时间线上的一条事件;`sessionKey` 为空 = 无会话归属的异常事实。 */
122
+ export type ClientSessionEvent = {
123
+ __typename?: 'ClientSessionEvent';
77
124
  action: Scalars['String']['output'];
78
- /** 动作码的中文文案(筛选下拉同样取自服务端,前端不复制这张表)。 */
79
125
  actionLabel: Scalars['String']['output'];
80
126
  actorDisplayName?: Maybe<Scalars['String']['output']>;
81
127
  actorId?: Maybe<Scalars['ID']['output']>;
82
128
  actorKind: AuditActorKind;
83
129
  actorUsername?: Maybe<Scalars['String']['output']>;
84
- category: AuditCategory;
85
130
  channel: AuditChannel;
86
131
  clientIp?: Maybe<Scalars['String']['output']>;
87
- /** 领域错误码或运行面原因码;成功(或被拒且无码)时为空。 */
88
132
  code?: Maybe<Scalars['String']['output']>;
89
- /** 脱敏快照:before / after、请求元信息、原因文本等。 */
90
133
  detail: Scalars['JSON']['output'];
91
134
  durationMs?: Maybe<Scalars['Int']['output']>;
92
135
  id: Scalars['ID']['output'];
93
136
  occurredAt: Scalars['DateTime']['output'];
94
137
  outcome: AuditOutcome;
138
+ sessionKey?: Maybe<Scalars['ID']['output']>;
95
139
  targetId?: Maybe<Scalars['String']['output']>;
96
- /** 目标当时的展示名(目标已删除时仍可读)。 */
97
140
  targetLabel?: Maybe<Scalars['String']['output']>;
98
- /** 目标类型,例 user / project / model / connection / skill / access-key / run。 */
99
141
  targetType?: Maybe<Scalars['String']['output']>;
100
142
  };
101
- /** 筛选:各条件并列(AND);from/to 为闭区间。 */
102
- export type AuditEventFilter = {
103
- /** 精确匹配动作码;选项清单走 auditActionOptions。 */
104
- action?: InputMaybe<Scalars['String']['input']>;
143
+ export type ClientSessionEventPage = {
144
+ __typename?: 'ClientSessionEventPage';
145
+ items: Array<ClientSessionEvent>;
146
+ total: Scalars['Int']['output'];
147
+ };
148
+ /** 客户端会话筛选:各条件并列(AND);from/to 为闭区间。 */
149
+ export type ClientSessionFilter = {
105
150
  actorUserId?: InputMaybe<Scalars['ID']['input']>;
106
- category?: InputMaybe<AuditCategory>;
107
151
  channel?: InputMaybe<AuditChannel>;
108
152
  from?: InputMaybe<Scalars['DateTime']['input']>;
109
153
  outcome?: InputMaybe<AuditOutcome>;
110
- targetId?: InputMaybe<Scalars['String']['input']>;
111
- targetType?: InputMaybe<Scalars['String']['input']>;
112
154
  to?: InputMaybe<Scalars['DateTime']['input']>;
155
+ /** 已登记工作区 slug(大小写不敏感,精确匹配)。 */
156
+ workspaceSlug?: InputMaybe<Scalars['String']['input']>;
113
157
  };
114
- export type AuditEventPage = {
115
- __typename?: 'AuditEventPage';
116
- items: Array<AuditEvent>;
117
- /** 与本次 filter 同口径的记录总数。 */
158
+ export type ClientSessionPage = {
159
+ __typename?: 'ClientSessionPage';
160
+ items: Array<ClientSession>;
118
161
  total: Scalars['Int']['output'];
119
162
  };
120
- /** 结果:SUCCESS = 完成;DENIED = 身份 / 权限 / 来源被拒;ERROR = 领域校验或冲突失败。 */
121
- export declare enum AuditOutcome {
122
- Denied = "DENIED",
123
- Error = "ERROR",
124
- Success = "SUCCESS"
125
- }
126
163
  /** CNB 接入密钥(Hub 生成、经 secret import 注入 CNB 环境;服务端只存摘要)。 */
127
164
  export type CnbAccessKey = {
128
165
  __typename?: 'CnbAccessKey';
@@ -232,6 +269,8 @@ export type EffectiveModelDefaults = {
232
269
  export type GlobalConfiguration = {
233
270
  __typename?: 'GlobalConfiguration';
234
271
  preferences: Preferences;
272
+ /** 组织共用的 Redmine 实例地址;null = 未配置(运行面不挂 Redmine 只读工具)。 */
273
+ redmineBaseUrl?: Maybe<Scalars['String']['output']>;
235
274
  revision: Scalars['Int']['output'];
236
275
  };
237
276
  export type ImportBuiltinModelsInput = {
@@ -414,10 +453,10 @@ export type Mutation = {
414
453
  /** 吊销接入密钥。 */
415
454
  revokeCnbAccessKey: Scalars['ID']['output'];
416
455
  /**
417
- * 回报一条运行面生命周期事实(会话启停 / 拒绝 / 交付分支与核对)。
456
+ * 回报一条运行面生命周期事实(会话起手 / 创建 / 销毁 / 拒绝 / 交付分支与核对)。
418
457
  * 上报失败不改变运行面行为:运行面按「只 warn 降级」处理,事件缺失不影响交付闭环。
419
458
  */
420
- runtimeReportEvent: AuditEvent;
459
+ runtimeReportEvent: ClientSessionEvent;
421
460
  saveGlobalConfiguration: GlobalConfiguration;
422
461
  saveModel: Model;
423
462
  saveModelConnection: ModelConnection;
@@ -538,6 +577,48 @@ export type MutationUpdateMyConfigurationArgs = {
538
577
  export type MutationWriteSkillFilesArgs = {
539
578
  input: WriteSkillFilesInput;
540
579
  };
580
+ /** 操作日志的一条事实:控制台的写操作与控制台敏感读。 */
581
+ export type OperationEvent = {
582
+ __typename?: 'OperationEvent';
583
+ /** 动作码,例 `write.project.delete`;闭集与中文文案由服务端的注册表给出。 */
584
+ action: Scalars['String']['output'];
585
+ /** 动作码的中文文案(筛选下拉同样取自服务端,前端不复制这张表)。 */
586
+ actionLabel: Scalars['String']['output'];
587
+ actorDisplayName?: Maybe<Scalars['String']['output']>;
588
+ actorId?: Maybe<Scalars['ID']['output']>;
589
+ actorKind: AuditActorKind;
590
+ actorUsername?: Maybe<Scalars['String']['output']>;
591
+ /** 领域错误码;成功(或被拒且无码)时为空。 */
592
+ code?: Maybe<Scalars['String']['output']>;
593
+ /** 脱敏快照:before / after、请求元信息、原因文本等。 */
594
+ detail: Scalars['JSON']['output'];
595
+ durationMs?: Maybe<Scalars['Int']['output']>;
596
+ id: Scalars['ID']['output'];
597
+ occurredAt: Scalars['DateTime']['output'];
598
+ outcome: AuditOutcome;
599
+ targetId?: Maybe<Scalars['String']['output']>;
600
+ /** 目标当时的展示名(目标已删除时仍可读)。 */
601
+ targetLabel?: Maybe<Scalars['String']['output']>;
602
+ /** 目标类型,例 user / project / model / connection / skill / access-key / run。 */
603
+ targetType?: Maybe<Scalars['String']['output']>;
604
+ };
605
+ /** 操作日志筛选:各条件并列(AND);from/to 为闭区间。 */
606
+ export type OperationEventFilter = {
607
+ /** 精确匹配动作码;选项清单走 operationActionOptions。 */
608
+ action?: InputMaybe<Scalars['String']['input']>;
609
+ actorUserId?: InputMaybe<Scalars['ID']['input']>;
610
+ from?: InputMaybe<Scalars['DateTime']['input']>;
611
+ outcome?: InputMaybe<AuditOutcome>;
612
+ targetId?: InputMaybe<Scalars['String']['input']>;
613
+ targetType?: InputMaybe<Scalars['String']['input']>;
614
+ to?: InputMaybe<Scalars['DateTime']['input']>;
615
+ };
616
+ export type OperationEventPage = {
617
+ __typename?: 'OperationEventPage';
618
+ items: Array<OperationEvent>;
619
+ /** 与本次 filter 同口径的记录总数。 */
620
+ total: Scalars['Int']['output'];
621
+ };
541
622
  export type Preferences = {
542
623
  __typename?: 'Preferences';
543
624
  defaultModelId?: Maybe<Scalars['ID']['output']>;
@@ -611,14 +692,16 @@ export type ProjectPage = {
611
692
  };
612
693
  export type Query = {
613
694
  __typename?: 'Query';
614
- /** 审查动作码清单(管理员):筛选下拉的选项来源。 */
615
- auditActionOptions: Array<AuditActionOption>;
616
- /** 审查日志(管理员):读取 / 写操作 / 身份凭据 / 运行面生命周期四类事实。 */
617
- auditEvents: AuditEventPage;
618
695
  /** 该用户可用模型(连接启用 + 模型启用 + 存在性 + 密钥齐备)。 */
619
696
  availableModels: Array<Model>;
620
697
  /** 该连接的内置目录模型清单;不需要密钥,上游读不到时的出路。 */
621
698
  builtinModelCatalog: Array<UpstreamModel>;
699
+ /** 客户端动作码清单(管理员):筛选下拉的选项来源。 */
700
+ clientActionOptions: Array<ActionOption>;
701
+ /** 某个会话的时间线(管理员):按时间正序的全部事件。 */
702
+ clientSessionTimeline: Array<ClientSessionEvent>;
703
+ /** 客户端会话(管理员):运行面会话,一会话一行。 */
704
+ clientSessions: ClientSessionPage;
622
705
  /** 全部 CNB 环境接入密钥(明文不回读)。密钥不绑用户,属部署级环境凭据。 */
623
706
  cnbAccessKeys: Array<CnbAccessKey>;
624
707
  /** 当前登录账户自己的 CNB 连接。 */
@@ -631,6 +714,10 @@ export type Query = {
631
714
  models: ModelPage;
632
715
  /** 登录者本人可访问的项目。 */
633
716
  myProjects: ProjectPage;
717
+ /** 操作动作码清单(管理员):筛选下拉的选项来源。 */
718
+ operationActionOptions: Array<ActionOption>;
719
+ /** 操作日志(管理员):控制台写操作与控制台敏感读。 */
720
+ operationEvents: OperationEventPage;
634
721
  /** 单项目详情;无访问权即 ACCESS_DENIED。 */
635
722
  project: Project;
636
723
  /** 全部项目;成员视角用 myProjects。 */
@@ -652,6 +739,11 @@ export type Query = {
652
739
  * 工作区逐个项目要,不必把整个项目表拉回本地。
653
740
  */
654
741
  runtimeProjects?: Maybe<Array<RuntimeProject>>;
742
+ /**
743
+ * 本面可用的 Redmine 地址与本人密钥;块内任一 null = 权威未配置(运行面不挂 Redmine 工具),
744
+ * 本次读取失败为 null。
745
+ */
746
+ runtimeRedmine?: Maybe<RuntimeRedmine>;
655
747
  /**
656
748
  * 自画像正文(agent 会话开头注入的人设);未配置为空串,本次读取失败为 null。
657
749
  * 全局一份,与读取者身份无关。
@@ -669,6 +761,10 @@ export type Query = {
669
761
  runtimeSkills?: Maybe<Array<RuntimeSkill>>;
670
762
  /** 本次读取者(服务器里当前用户);失败为 null。 */
671
763
  runtimeViewer?: Maybe<RuntimeViewer>;
764
+ /** 身份动作码清单(管理员):筛选下拉的选项来源。 */
765
+ securityActionOptions: Array<ActionOption>;
766
+ /** 身份安全(管理员):控制台身份与凭据事件。 */
767
+ securityEvents: SecurityEventPage;
672
768
  /** 自画像的当前版本(全局一份 agent 人设)。 */
673
769
  selfPortrait: SelfPortrait;
674
770
  /** 自画像的历史快照(新在前,最多 50 条)。 */
@@ -681,6 +777,8 @@ export type Query = {
681
777
  skillVersions: Array<SkillVersion>;
682
778
  /** 技能头版本列表;filter 决定作用域与状态。 */
683
779
  skills: SkillPage;
780
+ /** 无会话事件(管理员):被拒 / 失败的运行面读取与起会话之前的整体失败。 */
781
+ unassignedClientEvents: ClientSessionEventPage;
684
782
  /** 读令牌可见的 CNB 组织成员但不写库:返回列表供同步勾选;失败按 DomainError 码回。 */
685
783
  upstreamCnbMembers: Array<UpstreamCnbMember>;
686
784
  /** 读令牌可见的 CNB 仓库但不写库:返回列表供同步勾选;失败按 DomainError 码回。 */
@@ -696,17 +794,20 @@ export type Query = {
696
794
  users: UserPage;
697
795
  viewer: User;
698
796
  };
699
- export type QueryAuditEventsArgs = {
700
- filter?: InputMaybe<AuditEventFilter>;
701
- first?: InputMaybe<Scalars['Int']['input']>;
702
- offset?: InputMaybe<Scalars['Int']['input']>;
703
- };
704
797
  export type QueryAvailableModelsArgs = {
705
798
  userId?: InputMaybe<Scalars['ID']['input']>;
706
799
  };
707
800
  export type QueryBuiltinModelCatalogArgs = {
708
801
  connectionId: Scalars['ID']['input'];
709
802
  };
803
+ export type QueryClientSessionTimelineArgs = {
804
+ sessionKey: Scalars['ID']['input'];
805
+ };
806
+ export type QueryClientSessionsArgs = {
807
+ filter?: InputMaybe<ClientSessionFilter>;
808
+ first?: InputMaybe<Scalars['Int']['input']>;
809
+ offset?: InputMaybe<Scalars['Int']['input']>;
810
+ };
710
811
  export type QueryEffectiveModelDefaultsArgs = {
711
812
  userId?: InputMaybe<Scalars['ID']['input']>;
712
813
  };
@@ -728,6 +829,11 @@ export type QueryMyProjectsArgs = {
728
829
  first?: InputMaybe<Scalars['Int']['input']>;
729
830
  offset?: InputMaybe<Scalars['Int']['input']>;
730
831
  };
832
+ export type QueryOperationEventsArgs = {
833
+ filter?: InputMaybe<OperationEventFilter>;
834
+ first?: InputMaybe<Scalars['Int']['input']>;
835
+ offset?: InputMaybe<Scalars['Int']['input']>;
836
+ };
731
837
  export type QueryProjectArgs = {
732
838
  id: Scalars['ID']['input'];
733
839
  };
@@ -745,6 +851,11 @@ export type QueryRuntimeProjectsArgs = {
745
851
  export type QueryRuntimeSkillFilesArgs = {
746
852
  skillId: Scalars['ID']['input'];
747
853
  };
854
+ export type QuerySecurityEventsArgs = {
855
+ filter?: InputMaybe<SecurityEventFilter>;
856
+ first?: InputMaybe<Scalars['Int']['input']>;
857
+ offset?: InputMaybe<Scalars['Int']['input']>;
858
+ };
748
859
  export type QuerySkillArgs = {
749
860
  id: Scalars['ID']['input'];
750
861
  version?: InputMaybe<Scalars['Int']['input']>;
@@ -761,6 +872,11 @@ export type QuerySkillsArgs = {
761
872
  first?: InputMaybe<Scalars['Int']['input']>;
762
873
  offset?: InputMaybe<Scalars['Int']['input']>;
763
874
  };
875
+ export type QueryUnassignedClientEventsArgs = {
876
+ filter?: InputMaybe<ClientEventFilter>;
877
+ first?: InputMaybe<Scalars['Int']['input']>;
878
+ offset?: InputMaybe<Scalars['Int']['input']>;
879
+ };
764
880
  export type QueryUpstreamModelCatalogArgs = {
765
881
  connectionId: Scalars['ID']['input'];
766
882
  };
@@ -822,25 +938,39 @@ export type RuntimeConnection = {
822
938
  export declare enum RuntimeEventAction {
823
939
  DeliveryReady = "DELIVERY_READY",
824
940
  DeliveryVerified = "DELIVERY_VERIFIED",
825
- SessionEnd = "SESSION_END",
941
+ SessionCreated = "SESSION_CREATED",
942
+ SessionDisposed = "SESSION_DISPOSED",
826
943
  SessionFailed = "SESSION_FAILED",
827
944
  SessionRefused = "SESSION_REFUSED",
828
945
  SessionStart = "SESSION_START"
829
946
  }
830
947
  /**
831
948
  * 运行面上报:只接受用户密钥身份,动作码限闭集;detail 由服务端脱敏后落库。
832
- * 目标项目按 slug 解析:命中可读项目时 targetId 是项目 id,否则只留 slug 快照。
949
+ * 目标项目按 slug 解析:命中可读项目时挂项目 id,否则只留 slug 快照。
950
+ * 带会话身份(runRef 或 sessionId + clientId)的事件会折叠进同一行客户端会话。
833
951
  */
834
952
  export type RuntimeEventInput = {
835
953
  action: RuntimeEventAction;
836
- /** 原因码 / 交付状态码(例 SETUP_FAILED、delivered)。 */
954
+ /** 运行面实例标识(插件进程内生成):同名 dsh 会话在不同容器里靠它分开。 */
955
+ clientId?: InputMaybe<Scalars['String']['input']>;
956
+ /** 原因码 / 交付状态码(例 SETUP_FAILED、delivered、dispose)。 */
837
957
  code?: InputMaybe<Scalars['String']['input']>;
838
958
  detail?: InputMaybe<Scalars['JSON']['input']>;
959
+ /** 会话使用的模型与档位(拿不到留空)。 */
960
+ modelId?: InputMaybe<Scalars['String']['input']>;
839
961
  outcome: AuditOutcome;
840
- /** 项目 slug(CNB 仓库 slug 或工作区目录名),用于把事件挂到项目上。 */
962
+ /** 项目 slug(CNB 仓库 slug 或已登记工作区 slug),用于把事件挂到项目上。 */
841
963
  projectSlug?: InputMaybe<Scalars['String']['input']>;
964
+ reasoningLevel?: InputMaybe<Scalars['String']['input']>;
965
+ /** 任务引用 `<repo>#<issue|pr>#<iid>`:NPC 一次任务的稳定身份,会话尚未创建也带。 */
966
+ runRef?: InputMaybe<Scalars['String']['input']>;
967
+ /** dsh 会话 id(会话创建 / 销毁事件给出)。 */
968
+ sessionId?: InputMaybe<Scalars['String']['input']>;
842
969
  /** 目标展示名(例 `issue-12` / `PR #34`)。 */
843
970
  targetLabel?: InputMaybe<Scalars['String']['input']>;
971
+ /** 本次会话的 cwd 与命中的已登记工作区 slug。 */
972
+ workspacePath?: InputMaybe<Scalars['String']['input']>;
973
+ workspaceSlug?: InputMaybe<Scalars['String']['input']>;
844
974
  };
845
975
  /** 全局 headless 角色默认(plan / execute);读取失败时整个块为 null。 */
846
976
  export type RuntimeHeadlessModels = {
@@ -880,6 +1010,17 @@ export type RuntimeProject = {
880
1010
  planReasoningLevel?: Maybe<ReasoningLevel>;
881
1011
  slug: Scalars['String']['output'];
882
1012
  };
1013
+ /**
1014
+ * 运行面看到的 Redmine 事实:地址来自全局配置、密钥来自本人配置。
1015
+ * 块内任一为 null 即权威「未配置」;整块为 null 表示本次读取失败。
1016
+ */
1017
+ export type RuntimeRedmine = {
1018
+ __typename?: 'RuntimeRedmine';
1019
+ /** 本人 API Key;null = 本人还没配。运行面拿它起 Redmine 只读 MCP 服务。 */
1020
+ apiKey?: Maybe<Scalars['String']['output']>;
1021
+ /** 组织共用的 Redmine 地址;null = 管理员还没配。 */
1022
+ baseUrl?: Maybe<Scalars['String']['output']>;
1023
+ };
883
1024
  /** 运行面技能目录条目:此刻对读取者生效的未归档 head。 */
884
1025
  export type RuntimeSkill = {
885
1026
  __typename?: 'RuntimeSkill';
@@ -926,6 +1067,8 @@ export type RuntimeViewer = {
926
1067
  export type SaveGlobalInput = {
927
1068
  expectedRevision: Scalars['Int']['input'];
928
1069
  preferences?: InputMaybe<PreferencesInput>;
1070
+ /** 组织共用的 Redmine 地址;省略 = 不改,null = 清除(必须是 https,development 下允许回环 http)。 */
1071
+ redmineBaseUrl?: InputMaybe<Scalars['String']['input']>;
929
1072
  };
930
1073
  export type SaveModelConnectionInput = {
931
1074
  apiKey?: InputMaybe<SecretInput>;
@@ -983,6 +1126,8 @@ export type SaveSkillInput = {
983
1126
  export type SaveUserInput = {
984
1127
  expectedRevision: Scalars['Int']['input'];
985
1128
  modelCredentials?: InputMaybe<Array<ModelCredentialInput>>;
1129
+ /** 本人 / 代设用户的 Redmine API Key:value 与 clear 二选一,省略 = 不改;设置时 hub 先验证。 */
1130
+ redmineApiKey?: InputMaybe<SecretInput>;
986
1131
  userId: Scalars['ID']['input'];
987
1132
  };
988
1133
  /** value / clear / reuse 严格三选一。reuse 仅连接密钥场景有意义。 */
@@ -991,6 +1136,38 @@ export type SecretInput = {
991
1136
  reuse?: InputMaybe<Scalars['Boolean']['input']>;
992
1137
  value?: InputMaybe<Scalars['String']['input']>;
993
1138
  };
1139
+ /** 身份安全的一条事实:控制台的身份与凭据事件。 */
1140
+ export type SecurityEvent = {
1141
+ __typename?: 'SecurityEvent';
1142
+ action: Scalars['String']['output'];
1143
+ actionLabel: Scalars['String']['output'];
1144
+ actorDisplayName?: Maybe<Scalars['String']['output']>;
1145
+ actorId?: Maybe<Scalars['ID']['output']>;
1146
+ actorKind: AuditActorKind;
1147
+ actorUsername?: Maybe<Scalars['String']['output']>;
1148
+ clientIp?: Maybe<Scalars['String']['output']>;
1149
+ /** 身份 / 权限 / 凭据错误码;成功时为空。 */
1150
+ code?: Maybe<Scalars['String']['output']>;
1151
+ detail: Scalars['JSON']['output'];
1152
+ id: Scalars['ID']['output'];
1153
+ occurredAt: Scalars['DateTime']['output'];
1154
+ outcome: AuditOutcome;
1155
+ userAgent?: Maybe<Scalars['String']['output']>;
1156
+ };
1157
+ /** 身份安全筛选:各条件并列(AND);from/to 为闭区间。 */
1158
+ export type SecurityEventFilter = {
1159
+ /** 精确匹配动作码;选项清单走 securityActionOptions。 */
1160
+ action?: InputMaybe<Scalars['String']['input']>;
1161
+ actorUserId?: InputMaybe<Scalars['ID']['input']>;
1162
+ from?: InputMaybe<Scalars['DateTime']['input']>;
1163
+ outcome?: InputMaybe<AuditOutcome>;
1164
+ to?: InputMaybe<Scalars['DateTime']['input']>;
1165
+ };
1166
+ export type SecurityEventPage = {
1167
+ __typename?: 'SecurityEventPage';
1168
+ items: Array<SecurityEvent>;
1169
+ total: Scalars['Int']['output'];
1170
+ };
994
1171
  /** 自画像的当前版本;从未配置过时 version = 0、content 为空串。 */
995
1172
  export type SelfPortrait = {
996
1173
  __typename?: 'SelfPortrait';
@@ -1003,7 +1180,7 @@ export type SelfPortrait = {
1003
1180
  /** 当前版本号;保存时作为 CAS 令牌(0 = 从未配置过)。 */
1004
1181
  version: Scalars['Int']['output'];
1005
1182
  };
1006
- /** 一个不可变历史快照;作者用扁平字段(同 AuditEvent 口径)。 */
1183
+ /** 一个不可变历史快照;作者用扁平字段(同日志事实口径)。 */
1007
1184
  export type SelfPortraitVersion = {
1008
1185
  __typename?: 'SelfPortraitVersion';
1009
1186
  content: Scalars['String']['output'];
@@ -1107,7 +1284,7 @@ export type SkillPage = {
1107
1284
  /** 与本次 filter 同口径的技能总数。 */
1108
1285
  total: Scalars['Int']['output'];
1109
1286
  };
1110
- /** 一个不可变历史快照。作者用扁平字段(同 AuditEvent 口径),不构造完整 User。 */
1287
+ /** 一个不可变历史快照。作者用扁平字段(同日志事实口径),不构造完整 User。 */
1111
1288
  export type SkillVersion = {
1112
1289
  __typename?: 'SkillVersion';
1113
1290
  archived: Scalars['Boolean']['output'];
@@ -1136,6 +1313,8 @@ export type UpdateCnbTokenInput = {
1136
1313
  export type UpdateMyConfigurationInput = {
1137
1314
  expectedRevision: Scalars['Int']['input'];
1138
1315
  modelCredentials?: InputMaybe<Array<ModelCredentialInput>>;
1316
+ /** 本人 Redmine API Key:value 与 clear 二选一,省略 = 不改;设置时 hub 先验证。 */
1317
+ redmineApiKey?: InputMaybe<SecretInput>;
1139
1318
  };
1140
1319
  /** 令牌可见组织树里的一个成员:只读快照,不落库,供同步弹层勾选要添加的用户。 */
1141
1320
  export type UpstreamCnbMember = {
@@ -1183,7 +1362,8 @@ export type User = {
1183
1362
  createdAt: Scalars['DateTime']['output'];
1184
1363
  displayName: Scalars['String']['output'];
1185
1364
  id: Scalars['ID']['output'];
1186
- lastReadAt?: Maybe<Scalars['DateTime']['output']>;
1365
+ /** 该用户最近一次客户端会话的开始时间;从没开过会话时为 null。 */
1366
+ lastActivityAt?: Maybe<Scalars['DateTime']['output']>;
1187
1367
  /** users 行 revision;状态与角色集合修改都用它做 CAS。 */
1188
1368
  revision: Scalars['Int']['output'];
1189
1369
  /** 服务端聚合(计数 / 最近时间);仅管理员查询有值。 */
@@ -1197,6 +1377,8 @@ export type User = {
1197
1377
  /** user_configuration 一行的领域读模型。 */
1198
1378
  export type UserConfiguration = {
1199
1379
  __typename?: 'UserConfiguration';
1380
+ /** 本人是否已配置 Redmine API Key;明文永不回读。 */
1381
+ redmineApiKeyConfigured: Scalars['Boolean']['output'];
1200
1382
  revision: Scalars['Int']['output'];
1201
1383
  userId: Scalars['ID']['output'];
1202
1384
  };
@@ -29,7 +29,7 @@ export interface Semi2Api {
29
29
  }>;
30
30
  /** 密码登录换无会话用户密钥(密码只在本次请求内存里)。 */
31
31
  loginToConsole(input: ConsoleLoginInput): Promise<ConsoleLoginOutcome>;
32
- /** 运行面生命周期上报(会话启停 / 拒绝 / 交付);失败不改变运行面行为。 */
32
+ /** 运行面生命周期上报(会话起手 / 创建 / 销毁 / 拒绝 / 交付);失败不改变运行面行为。 */
33
33
  reportEvent(event: RuntimeEventReport): Promise<DomainOutcome<RuntimeReportedEvent>>;
34
34
  }
35
35
  /**
@@ -43,6 +43,18 @@ export interface RuntimeEventReport {
43
43
  projectSlug?: string;
44
44
  targetLabel?: string;
45
45
  detail?: Record<string, unknown>;
46
+ /** dsh 会话 id:会话创建 / 销毁事件给出,hub 按它折叠会话行。 */
47
+ sessionId?: string;
48
+ /** 运行面实例标识:同名 dsh 会话在不同容器里靠它分开。 */
49
+ clientId?: string;
50
+ /** 任务引用:NPC 一次任务的稳定身份(会话尚未创建的事件也带)。 */
51
+ runRef?: string;
52
+ /** 本面工作区:会话 cwd 与命中的已登记工作区 slug。 */
53
+ workspacePath?: string;
54
+ workspaceSlug?: string;
55
+ /** 会话使用的模型与档位。 */
56
+ modelId?: string;
57
+ reasoningLevel?: string;
46
58
  }
47
59
  export type RuntimeReportedEvent = RuntimeReportEventMutation['runtimeReportEvent'];
48
60
  export interface Semi2ApiOptions {
@@ -31,6 +31,11 @@ export interface Semi2Runtime {
31
31
  face: Semi2Face;
32
32
  /** semi2-hub 连接凭据;缺省 = 回落 dsh credentials 登录存储。 */
33
33
  credentials?: Semi2Credentials;
34
+ /**
35
+ * 本次运行的稳定引用(NPC 面 = `<仓库>#<issue|pr>#<号>`),由适配器解析触发后填。
36
+ * 客户端的会话日志按它把「起手 → 交付 → 会话 → 核对」并成一条:会话尚未创建的事件也带得上。
37
+ */
38
+ taskRef?: string;
34
39
  }
35
40
  /** cordis 服务名(适配器 provide / 插件 get 共用同一常量)。 */
36
41
  export declare const SEMI2_RUNTIME_SERVICE = "semi2Runtime";
@@ -0,0 +1,59 @@
1
+ import type { DomainHost, DomainService, LoadRun, RevertRun } from '../types.js';
2
+ import type { Semi2ConfigState } from '../../hub/facts.js';
3
+ /** MCP 服务的命名空间(工具名 = `mcp__redmine__<tool>`)。 */
4
+ export declare const REDMINE_SERVER_NAME = "redmine";
5
+ /** 一次挂载的完整配置(形状由官方 mcp-client 的 Config 决定,这里逐字段收口)。 */
6
+ export interface RedmineMcpConfig {
7
+ transport: 'stdio';
8
+ serverName: string;
9
+ command: string;
10
+ args: string[];
11
+ env: Record<string, string>;
12
+ cwd: string;
13
+ toolCallTimeoutMs: number;
14
+ failOnStartupError: boolean;
15
+ }
16
+ /** 挂载句柄:就绪面(激活 + 首次连接与工具发现)+ 官方 fiber 的卸载面。 */
17
+ export interface MountedServer {
18
+ /** true = 工具已注册;false = 到上限仍未就绪或激活失败(光纤留着,官方那边会自己重连)。 */
19
+ ready: Promise<boolean>;
20
+ dispose(): Promise<void>;
21
+ }
22
+ /** 领域依赖的运行面能力(插件上下文与 process.env 都在 index.ts 里收口,领域自己不认识 cordis)。 */
23
+ export interface RedmineFaces {
24
+ /** 挂一根官方 mcp-client 光纤;缺闭包 / 配置不合法时 reject(只 warn 降级)。 */
25
+ mount(config: RedmineMcpConfig): Promise<MountedServer>;
26
+ /** 起进程的命令与工作目录(env 覆盖、已登记工作区)。 */
27
+ command(): string;
28
+ cwd(): string;
29
+ }
30
+ /** boot 事实 → 挂载配置;密钥只进子进程 env,不落盘、不进日志。 */
31
+ export declare function redmineMcpConfig(baseUrl: string, apiKey: string, faces: Pick<RedmineFaces, 'command' | 'cwd'>): RedmineMcpConfig;
32
+ export declare class RedmineDomain implements DomainService {
33
+ private readonly host;
34
+ private readonly faces;
35
+ readonly id: "redmine";
36
+ private mounted;
37
+ private degraded;
38
+ private pending;
39
+ constructor(host: DomainHost, faces: RedmineFaces);
40
+ /**
41
+ * boot 事实落地:
42
+ * - 块缺失 / null(读取失败)→ 只 warn,保持现状(不动已挂的服务);
43
+ * - 两项齐备 → 配置没变就不重挂,变了先卸再挂;
44
+ * - 任一项 null(权威未配置)→ 卸载。
45
+ */
46
+ applyBoot(run: LoadRun): Promise<void>;
47
+ /** 登出 / 服务端整体撤下:Redmine 工具随身份一起收走。 */
48
+ revert(_run: RevertRun): Promise<void>;
49
+ private unmount;
50
+ statusFields(state: Semi2ConfigState): Record<string, string>;
51
+ summary(state: Semi2ConfigState): string | null;
52
+ health(): {
53
+ state: "ok";
54
+ note: string;
55
+ } | {
56
+ state: "degraded";
57
+ note: string;
58
+ };
59
+ }
@@ -0,0 +1,10 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { DomainPlugin } from '../types.js';
3
+ import { type RedmineFaces } from './domain.js';
4
+ /** 起进程的命令:镜像里在 PATH 上;npm 消费者可用 `SEMI2_REDMINE_MCP_BIN` 指到别处(同 CodeGraph 口径)。 */
5
+ export declare function redmineMcpCommand(env: NodeJS.ProcessEnv): string;
6
+ /** 子进程工作目录 = 本面工作目录(同 CodeGraph 挂载行)。 */
7
+ export declare function redmineMcpCwd(env: NodeJS.ProcessEnv): string;
8
+ /** 运行面能力:动态 import 官方包 + 在本领域的 ctx 上挂一根光纤(dispose 由领域持有)。 */
9
+ export declare function createRedmineFaces(ctx: Context): RedmineFaces;
10
+ export declare const redmineDomain: DomainPlugin;