Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/BaselineOfMCP/BaselineOfMCP.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ BaselineOfMCP >> defineDependencies: spec [

spec
baseline: 'PharoCompatibility' with: [
spec
repository: 'github://Evref-BL/PharoCompatibility:main/src';
loads: #( 'Pharo13Surface' ) ];
spec
repository: 'github://Evref-BL/PharoCompatibility:main/src';
loads: #( 'Pharo13Surface' ) ];
baseline: 'JRPC' with: [
spec
repository: 'github://juliendelplanque/JRPC:v3.2.1/src';
loads: #( 'Deployment' ) ].
spec
repository: 'github://juliendelplanque/JRPC:v3.2.1/src';
loads: #( 'Deployment' ) ].
spec baseline: 'TinyLogger' with: [
spec
repository: 'github://jecisc/TinyLogger:v1.x.x/src';
loads: #( 'Core' ) ]
spec
repository: 'github://jecisc/TinyLogger:v1.x.x/src';
loads: #( 'Core' ) ]
]

{ #category : 'baselines' }
Expand Down
12 changes: 6 additions & 6 deletions src/MCP-Spec-Tests/MCPMonitoringStateTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ MCPMonitoringStateTest >> testOutlierExplanationUsesPriorAverage [
stats := MCPToolCallStats forToolNamed: 'slow-tool'.
start := DateAndTime now.
1 to: 3 do: [ :index |
record := MCPToolCallRecord
id: index
toolName: 'slow-tool'
startedAt: start.
record finishAt: start durationMilliseconds: 10 status: 'ok'.
stats recordCall: record ].
record := MCPToolCallRecord
id: index
toolName: 'slow-tool'
startedAt: start.
record finishAt: start durationMilliseconds: 10 status: 'ok'.
stats recordCall: record ].

explanation := state
outlierExplanationForDurationMilliseconds: 25
Expand Down
71 changes: 36 additions & 35 deletions src/MCP-Spec/MCPDashboardPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ MCPDashboardPresenter >> addSectionLayout: aSectionLayout expanded: expanded to:
MCPDashboardPresenter >> applyConfiguration [

[
| newPort |
newPort := self readPortFromInput.
self model configurePort: newPort debugMode: debugCheckBox state ]
| newPort |
newPort := self readPortFromInput.
self model configurePort: newPort debugMode: debugCheckBox state ]
on: Error
do: [ :error | UIManager default alert: error messageText ].

Expand Down Expand Up @@ -121,9 +121,9 @@ MCPDashboardPresenter >> autoRefreshIntervalSeconds [
MCPDashboardPresenter >> autoRefreshLoop [

[
[ self shouldAutoRefresh ] whileTrue: [
(Delay forSeconds: self autoRefreshIntervalSeconds) wait.
self shouldAutoRefresh ifTrue: [ self defer: [ self refreshView ] ] ] ]
[ self shouldAutoRefresh ] whileTrue: [
(Delay forSeconds: self autoRefreshIntervalSeconds) wait.
self shouldAutoRefresh ifTrue: [ self defer: [ self refreshView ] ] ] ]
ensure: [ autoRefreshProcess := nil ]
]

Expand Down Expand Up @@ -195,11 +195,11 @@ MCPDashboardPresenter >> dashboardWidgetsLayout [

(self isToolsSectionExpanded and: [
self hasExpandedMonitoringSection ]) ifTrue: [
^ SpPanedLayout newTopToBottom
positionOfSlider: 42 percent;
first: self toolsWidgetLayout;
second: self monitoringWidgetsLayout;
yourself ].
^ SpPanedLayout newTopToBottom
positionOfSlider: 42 percent;
first: self toolsWidgetLayout;
second: self monitoringWidgetsLayout;
yourself ].
^ self dashboardWidgetsBoxLayout
]

Expand All @@ -226,14 +226,14 @@ MCPDashboardPresenter >> defaultLayout [
MCPDashboardPresenter >> disclosureLabelFor: title count: count expanded: expanded [

^ String streamContents: [ :stream |
stream
nextPutAll: (expanded
ifTrue: [ '[-] ' ]
ifFalse: [ '[+] ' ]);
nextPutAll: title;
nextPutAll: ' (';
print: count;
nextPut: $) ]
stream
nextPutAll: (expanded
ifTrue: [ '[-] ' ]
ifFalse: [ '[+] ' ]);
nextPutAll: title;
nextPutAll: ' (';
print: count;
nextPut: $) ]
]

{ #category : 'collapsing' }
Expand Down Expand Up @@ -535,7 +535,8 @@ MCPDashboardPresenter >> monitoringSectionsLayout [
second: self logsWidgetLayout;
yourself);
yourself ].
self expandedMonitoringSectionCount = 2 ifTrue: [ ^ self twoExpandedMonitoringSectionsLayout ].
self expandedMonitoringSectionCount = 2 ifTrue: [
^ self twoExpandedMonitoringSectionsLayout ].
^ self monitoringWidgetsBoxLayout
]

Expand Down Expand Up @@ -670,9 +671,9 @@ MCPDashboardPresenter >> restartServer [
MCPDashboardPresenter >> serverStatusIconNameForRunning: isRunning listening: isListening [

isRunning ifFalse: [
^ isListening
ifTrue: [ #testRed ]
ifFalse: [ #testNotRun ] ].
^ isListening
ifTrue: [ #testRed ]
ifFalse: [ #testNotRun ] ].
^ isListening
ifTrue: [ #testGreen ]
ifFalse: [ #testRed ]
Expand All @@ -690,9 +691,9 @@ MCPDashboardPresenter >> serverStatusLabelForRunning: isRunning listening: isLis
MCPDashboardPresenter >> serverStatusValueForRunning: isRunning listening: isListening [

isRunning ifFalse: [
^ isListening
ifTrue: [ 'stopped, socket still listening' ]
ifFalse: [ 'stopped' ] ].
^ isListening
ifTrue: [ 'stopped, socket still listening' ]
ifFalse: [ 'stopped' ] ].
^ isListening
ifTrue: [ 'running' ]
ifFalse: [ 'running, socket not listening' ]
Expand Down Expand Up @@ -731,9 +732,9 @@ MCPDashboardPresenter >> statusRowLayout [
vAlignCenter;
add: statusLabel expand: false;
add: statusIcon withConstraints: [ :constraints |
constraints
width: 18;
height: 18 ];
constraints
width: 18;
height: 18 ];
add: statusValueLabel expand: false;
yourself
]
Expand Down Expand Up @@ -814,12 +815,12 @@ MCPDashboardPresenter >> tracesContextMenu [

^ self newMenu
addGroup: [ :group |
group addItem: [ :item |
item
name: 'Inspect';
description: 'Inspect the selected trace record';
enabled: [ tracesTable selectedItem isNotNil ];
action: [ self inspectSelectedTraceRecord ] ] ];
group addItem: [ :item |
item
name: 'Inspect';
description: 'Inspect the selected trace record';
enabled: [ tracesTable selectedItem isNotNil ];
action: [ self inspectSelectedTraceRecord ] ] ];
yourself
]

Expand Down
24 changes: 12 additions & 12 deletions src/MCP-Spec/MCPToolsCatalogPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ MCPToolsCatalogPresenter >> addToolCatalogGroup: group to: contentLayout [
displayBold: [ :ignored | true ].
contentLayout add: heading expand: false.
group value do: [ :toolClass |
contentLayout
add: (self toolCatalogCardFor: toolClass)
withConstraints: [ :constraints |
constraints
expand: false;
fill: true ] ]
contentLayout
add: (self toolCatalogCardFor: toolClass)
withConstraints: [ :constraints |
constraints
expand: false;
fill: true ] ]
]

{ #category : 'layout' }
Expand Down Expand Up @@ -87,9 +87,9 @@ MCPToolsCatalogPresenter >> toolCatalogCardFor: toolClass [
width: self toolCatalogLeftColumnWidth;
add: (self toolCatalogDescriptionPresenterFor: tool)
withConstraints: [ :constraints |
constraints
expand: true;
fill: true ].
constraints
expand: true;
fill: true ].
card layout: cardLayout.
^ card
]
Expand All @@ -114,9 +114,9 @@ MCPToolsCatalogPresenter >> toolCatalogDescriptionPresenterFor: tool [
withoutScrollBars.
descriptionLayout := SpBoxLayout newTopToBottom yourself.
descriptionLayout add: description withConstraints: [ :constraints |
constraints
expand: true;
fill: true ].
constraints
expand: true;
fill: true ].
descriptionCell layout: descriptionLayout.
^ descriptionCell
]
Expand Down
10 changes: 5 additions & 5 deletions src/MCP-Tests/MCPChangeClassCommentCommandTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ MCPChangeClassCommentCommandTest >> ensureTargetClass [
slots: #( )
classSlots: #( ).
self withoutEpiceaDuring: [
(self classNamed: self commentTargetClassName) comment:
'original comment' ]
(self classNamed: self commentTargetClassName) comment:
'original comment' ]
]

{ #category : 'private' }
Expand Down Expand Up @@ -67,9 +67,9 @@ MCPChangeClassCommentCommandTest >> testMissingClassSignalsCommandError [

| error |
error := self captureCommandError: [
(MCPChangeClassCommentCommand
className: 'MCPChangeClassCommentCommandTestMissing'
classComment: 'ignored') execute ].
(MCPChangeClassCommentCommand
className: 'MCPChangeClassCommentCommandTestMissing'
classComment: 'ignored') execute ].
self assert: error errorCode equals: #ClassNotFound.
self
assert: (error structuredDetails at: #className)
Expand Down
39 changes: 18 additions & 21 deletions src/MCP-Tests/MCPClassMutationRequestTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ MCPClassMutationRequestTest >> testCreateRequestParsesDefinitionArguments [
| context request |
request := MCPClassCreateRequest
fromRequest: (MCPToolRequest new
tool: MCPToolCreateClass new;
arguments: {
(#className -> 'MCPGeneratedClass').
(#superclassName -> 'Object').
(#packageName -> 'MCP-Generated').
(#tag -> 'Models').
(#classComment -> 'Generated comment.').
(#force -> true).
(#slots -> #( 'firstName' 'lastName' )).
(#classSlots -> #( 'defaultName' )).
(#traits -> #( 'TComparable' )).
(#classTraits -> #( 'TComparable classTrait' )).
(#sharedVariables -> #( 'Current' )).
(#sharedPools -> #( 'ChronologyConstants' )).
(#layout -> 'WeakLayout') } asDictionary;
yourself)
tool: MCPToolCreateClass new;
arguments: {
(#className -> 'MCPGeneratedClass').
(#superclassName -> 'Object').
(#packageName -> 'MCP-Generated').
(#tag -> 'Models').
(#classComment -> 'Generated comment.').
(#force -> true).
(#slots -> #( 'firstName' 'lastName' )).
(#classSlots -> #( 'defaultName' )).
(#traits -> #( 'TComparable' )).
(#classTraits -> #( 'TComparable classTrait' )).
(#sharedVariables -> #( 'Current' )).
(#sharedPools -> #( 'ChronologyConstants' )).
(#layout -> 'WeakLayout') } asDictionary;
yourself)
tool: MCPToolCreateClass new.
self assert: request className equals: 'MCPGeneratedClass'.
self assert: request superclassName equals: 'Object'.
Expand Down Expand Up @@ -63,8 +63,8 @@ MCPClassMutationRequestTest >> testUpdateCommandResolvesOmittedMovePackageName [
request := MCPToolRequest new
tool: tool;
arguments: {
(#className -> self class name asString).
(#tag -> 'Requests') } asDictionary;
(#className -> self class name asString).
(#tag -> 'Requests') } asDictionary;
yourself.
mutationRequest := tool parsedRequestFromToolRequest: request.
command := tool commandForRequest: mutationRequest.
Expand Down Expand Up @@ -107,7 +107,6 @@ MCPClassMutationRequestTest >> testUpdateRequestParsesSlotArguments [
self assert: (context at: #slotName) equals: 'oldName'.
self assert: (context at: #newSlotName) equals: 'newName'.
self assert: (context at: #classSide)

]

{ #category : 'tests' }
Expand Down Expand Up @@ -139,7 +138,6 @@ MCPClassMutationRequestTest >> testUpdateRequestTracksSuppliedProperties [
self assert: (context at: #classComment) equals: ''.
self assert: (context at: #slots) equals: #( ).
self deny: (context includesKey: #classSlots)

]

{ #category : 'tests' }
Expand All @@ -157,7 +155,6 @@ MCPClassMutationRequestTest >> testUpdateRequestWithNoPatchArgumentsHasNoUpdates
context := request requestedContext.
self assert: context size equals: 1.
self assert: (context at: #className) equals: 'ExistingClass'

]

{ #category : 'private' }
Expand Down
32 changes: 16 additions & 16 deletions src/MCP-Tests/MCPCommandErrorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Class {
MCPCommandErrorTest >> capture: aBlock [

^ [
aBlock value.
self fail: 'Expected MCPCommandError' ]
aBlock value.
self fail: 'Expected MCPCommandError' ]
on: MCPCommandError
do: [ :error | error ]
]
Expand All @@ -24,8 +24,8 @@ MCPCommandErrorTest >> testClassAlreadyExistsErrorCarriesClassName [

| details error |
error := self capture: [
MCPCommandError signalClassAlreadyExistsNamed:
'MCPCommandErrorTestExisting' ].
MCPCommandError signalClassAlreadyExistsNamed:
'MCPCommandErrorTestExisting' ].
details := error structuredDetails.
self assert: error errorCode equals: #ClassAlreadyExists.
self
Expand Down Expand Up @@ -64,11 +64,11 @@ MCPCommandErrorTest >> testMissingMethodErrorCarriesClassSideAndSelector [

| details error |
error := self capture: [
MCPCommandError
signalMissingMethodInClassName:
'MCPCommandErrorTestTarget'
classSide: true
selector: 'value' ].
MCPCommandError
signalMissingMethodInClassName:
'MCPCommandErrorTestTarget'
classSide: true
selector: 'value' ].
details := error structuredDetails.
self assert: error errorCode equals: #MethodNotFound.
self assert: (details at: #errorClass) equals: 'MCPCommandError'.
Expand Down Expand Up @@ -108,9 +108,9 @@ MCPCommandErrorTest >> testMissingSuperclassErrorCarriesSuperclassName [

| details error |
error := self capture: [
MCPCommandError
signalMissingSuperclassNamed: 'MCPMissingSuperclass'
forClassNamed: 'MCPNewClass' ].
MCPCommandError
signalMissingSuperclassNamed: 'MCPMissingSuperclass'
forClassNamed: 'MCPNewClass' ].
details := error structuredDetails.
self assert: error errorCode equals: #SuperclassNotFound.
self assert: (details at: #className) equals: 'MCPNewClass'.
Expand All @@ -124,10 +124,10 @@ MCPCommandErrorTest >> testMissingTagErrorCarriesTagAndClassName [

| details error |
error := self capture: [
MCPCommandError
signalMissingTag: 'MissingTag'
packageName: 'MCP-Tests'
forClassNamed: 'MCPCommandErrorTestTarget' ].
MCPCommandError
signalMissingTag: 'MissingTag'
packageName: 'MCP-Tests'
forClassNamed: 'MCPCommandErrorTestTarget' ].
details := error structuredDetails.
self assert: error errorCode equals: #TagNotFound.
self
Expand Down
Loading
Loading