File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 330330 const isStackActiveQuery = $derived (claudeCodeService .isStackActive (projectId , stackId ));
331331 const isStackActive = $derived (isStackActiveQuery ?.response || false );
332332 const events = $derived (claudeCodeService .messages ({ projectId , stackId }));
333+ const sessionId = $derived (rulesService .aiSessionId (projectId , stackId ));
333334 const hasRulesToClear = $derived (rulesService .hasRulesToClear (projectId , stackId ));
334335 const permissionRequests = $derived (claudeCodeService .permissionRequests ({ projectId }));
335336 const attachments = $derived (attachmentService .getByBranch (branchName ));
678679 permissionRequests ={permissionRequests .response || []}
679680 onSubmit ={sendMessage }
680681 onChange ={(prompt ) => messageSender ?.setPrompt (prompt )}
682+ sessionId ={sessionId .response }
681683 {isStackActive }
682684 {hasRulesToClear }
683685 />
Original file line number Diff line number Diff line change @@ -61,6 +61,24 @@ export default class RulesService {
6161 ) ;
6262 }
6363
64+ aiSessionId ( projectId : string , stackId ?: string ) {
65+ return this . api . endpoints . listWorkspaceRules . useQuery (
66+ { projectId } ,
67+ {
68+ transform : ( result ) => {
69+ const allRules = workspaceRulesSelectors . selectAll ( result ) ;
70+ const rule = allRules . find (
71+ ( r ) => isAiRule ( r ) && r . action . subject . subject . target . subject === stackId
72+ ) ;
73+ const sessionId = rule ?. filters . at ( 0 ) ?. subject ;
74+ if ( typeof sessionId === 'string' ) {
75+ return sessionId ;
76+ }
77+ }
78+ }
79+ ) ;
80+ }
81+
6482 async fetchListWorkspaceRules ( projectId : string ) {
6583 return await this . api . endpoints . listWorkspaceRules . fetch (
6684 { projectId } ,
You can’t perform that action at this time.
0 commit comments