Skip to content

Commit fd59a85

Browse files
Merge pull request #327 from campfirein/proj/git-semantics
Proj/git semantics
2 parents 22cb828 + 8b87577 commit fd59a85

34 files changed

Lines changed: 609 additions & 378 deletions

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
BRV_API_BASE_URL=http://localhost:3000/api/v1
66
BRV_AUTHORIZATION_URL=http://localhost:3000/api/v1/oidc/authorize
77
BRV_COGIT_API_BASE_URL=http://localhost:3001/api/v1
8-
BRV_GIT_API_BASE_URL=http://localhost:3001
98
BRV_GIT_REMOTE_BASE_URL=http://localhost:8080
109
BRV_ISSUER_URL=http://localhost:3000/api/v1/oidc
1110
BRV_LLM_API_BASE_URL=http://localhost:3002

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@
147147
],
148148
"topicSeparator": " ",
149149
"topics": {
150-
"vc": {
151-
"description": "Version control commands for the context tree"
152-
},
153150
"hub": {
154151
"description": "Browse and manage skills & bundles registry",
155152
"subtopics": {

src/oclif/commands/init.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-unreachable */
12
import {Command, Flags} from '@oclif/core'
23

34
import {InitEvents, type InitLocalResponse} from '../../shared/transport/events/init-events.js'
@@ -14,12 +15,16 @@ export default class Init extends Command {
1415
description: 'Force re-initialization even if already initialized',
1516
}),
1617
}
18+
public static hidden = true
1719

1820
protected getDaemonOptions(): DaemonClientOptions {
1921
return {projectPath: process.cwd()}
2022
}
2123

2224
public async run(): Promise<void> {
25+
this.log('The init command is not available. Use: brv vc init')
26+
return
27+
2328
const {flags} = await this.parse(Init)
2429
const daemonOptions = this.getDaemonOptions()
2530

src/oclif/commands/vc/commit.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ export default class VcCommit extends Command {
1212
description: 'Commit message',
1313
}),
1414
}
15+
public static strict = false
1516

1617
public async run(): Promise<void> {
17-
const {flags} = await this.parse(VcCommit)
18+
const {argv, flags} = await this.parse(VcCommit)
1819

19-
const {message} = flags
20+
// Support unquoted multi-word messages: brv vc commit -m hello world
21+
const extra = (argv as string[]).join(' ')
22+
const message = flags.message
23+
? (extra ? `${flags.message} ${extra}` : flags.message)
24+
: (extra || undefined)
2025
if (!message) {
2126
this.error('Usage: brv vc commit -m "<message>"')
2227
}

src/oclif/commands/vc/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import {Command} from '@oclif/core'
2+
3+
export default class Vc extends Command {
4+
public static description = 'Version control commands for the context tree'
5+
public static examples = ['<%= config.bin %> <%= command.id %> --help']
6+
7+
public async run(): Promise<void> {
8+
await this.config.runCommand('help', ['vc'])
9+
}
10+
}

src/oclif/commands/vc/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {type IVcInitResponse, VcEvents} from '../../../shared/transport/events/v
55
import {formatConnectionError, withDaemonRetry} from '../../lib/daemon-client.js'
66

77
export default class VcInit extends Command {
8-
public static description = 'Initialize ByteRover version control'
8+
public static description = 'Initialize ByteRover version control for context tree'
99
public static examples = ['<%= config.bin %> <%= command.id %>']
1010

1111
public async run(): Promise<void> {

src/oclif/hooks/init/validate-brv-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import {getProjectDataDir} from '../../../server/utils/path-utils.js'
1717
export const SKIP_COMMANDS = new Set<string>([
1818
'--help',
1919
'help',
20-
'init',
2120
'login',
2221
'logout',
2322
'main',
2423
'restart',
24+
'vc',
2525
'vc:clone',
2626
'vc:init',
2727
])

src/server/config/environment.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ type EnvironmentConfig = {
2121
authorizationUrl: string
2222
clientId: string
2323
cogitApiBaseUrl: string
24-
gitApiBaseUrl: string
2524
gitRemoteBaseUrl: string
2625
hubRegistryUrl: string
2726
issuerUrl: string
@@ -57,7 +56,6 @@ export const getCurrentConfig = (): EnvironmentConfig => ({
5756
authorizationUrl: readRequiredEnv('BRV_AUTHORIZATION_URL'),
5857
clientId: DEFAULTS.clientId,
5958
cogitApiBaseUrl: readRequiredEnv('BRV_COGIT_API_BASE_URL'),
60-
gitApiBaseUrl: readRequiredEnv('BRV_GIT_API_BASE_URL'),
6159
gitRemoteBaseUrl: readRequiredEnv('BRV_GIT_REMOTE_BASE_URL'),
6260
hubRegistryUrl: DEFAULTS.hubRegistryUrl,
6361
issuerUrl: readRequiredEnv('BRV_ISSUER_URL'),

src/server/core/domain/entities/space.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ interface SpaceParams {
55
id: string
66
isDefault: boolean
77
name: string
8+
slug?: string
89
teamId: string
910
teamName: string
11+
teamSlug?: string
1012
}
1113

1214
/**
@@ -17,8 +19,10 @@ export class Space {
1719
public readonly id: string
1820
public readonly isDefault: boolean
1921
public readonly name: string
22+
public readonly slug: string
2023
public readonly teamId: string
2124
public readonly teamName: string
25+
public readonly teamSlug: string
2226

2327
public constructor(params: SpaceParams) {
2428
if (params.id.trim().length === 0) {
@@ -40,8 +44,10 @@ export class Space {
4044
this.id = params.id
4145
this.isDefault = params.isDefault
4246
this.name = params.name
47+
this.slug = params.slug ?? params.name
4348
this.teamId = params.teamId
4449
this.teamName = params.teamName
50+
this.teamSlug = params.teamSlug ?? params.teamName
4551
}
4652

4753
/**
@@ -72,8 +78,10 @@ export class Space {
7278
id: json.id,
7379
isDefault: json.is_default,
7480
name: json.name,
81+
slug: typeof json.slug === 'string' ? json.slug : json.name,
7582
teamId: json.team_id,
7683
teamName: json.team_name,
84+
teamSlug: typeof json.team_slug === 'string' ? json.team_slug : json.team_name,
7785
})
7886
}
7987

@@ -93,8 +101,10 @@ export class Space {
93101
id: this.id,
94102
isDefault: this.isDefault,
95103
name: this.name,
104+
slug: this.slug,
96105
teamId: this.teamId,
97106
teamName: this.teamName,
107+
teamSlug: this.teamSlug,
98108
}
99109
}
100110
}

src/server/core/domain/entities/team.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface TeamParams {
1010
isActive: boolean
1111
isDefault: boolean
1212
name: string
13+
slug: string
1314
updatedAt: Date
1415
}
1516

@@ -26,6 +27,7 @@ export class Team {
2627
public readonly isActive: boolean
2728
public readonly isDefault: boolean
2829
public readonly name: string
30+
public readonly slug: string
2931
public readonly updatedAt: Date
3032

3133
public constructor(params: TeamParams) {
@@ -49,6 +51,7 @@ export class Team {
4951
this.isActive = params.isActive
5052
this.isDefault = params.isDefault
5153
this.name = params.name
54+
this.slug = params.slug
5255
this.updatedAt = params.updatedAt
5356
}
5457

@@ -94,6 +97,7 @@ export class Team {
9497
isActive: json.is_active,
9598
isDefault: json.is_default,
9699
name: json.name,
100+
slug: typeof json.slug === 'string' ? json.slug : json.name,
97101
updatedAt: new Date(json.updated_at),
98102
})
99103
}
@@ -119,6 +123,7 @@ export class Team {
119123
isActive: this.isActive,
120124
isDefault: this.isDefault,
121125
name: this.name,
126+
slug: this.slug,
122127
updatedAt: this.updatedAt.toISOString(),
123128
}
124129
}

0 commit comments

Comments
 (0)