Send directive & span definitions to extension - #2000
Open
JosephVolosin wants to merge 1 commit into
Open
JosephVolosin wants to merge 1 commit into
JosephVolosin wants to merge 1 commit into
Conversation
Contributor
Author
|
Some things I'd like to discuss on this:
|
|
JosephVolosin
marked this pull request as ready for review
September 18, 2026 15:30
JosephVolosin
had a problem deploying
to
test-workflow
September 18, 2026 15:46 — with
GitHub Actions
Error
Contributor
1+2. I'd have to go back and look but it is quite possible that some folks rely on this ID right now. I'd recommend retaining the ID for backwards compatibility. export type ExtensionPayload = {
version: 1; // would be nice to finally version this
planId: number;
simulationDatasetId: number | null;
selection: {
primary: ExtensionPrimarySelection | null;
activityDirectives: ExtensionActivityDirective[]; // could just throw the whole object in here, same with below, though they can change over time..
simulatedActivities: ExtensionSimulatedActivity[];
externalEvents: ExtensionExternalEvent[];
};
/** @deprecated but here for compatibility */
selectedActivityDirectiveId: number | null;
gateway?: string;
hasura?: string;
};
// for directives/spans - indicate which is selected and also optionally include the associated span/directive
export type ExtensionPrimarySelection =
| {
kind: 'activityDirective';
activityDirective: ExtensionActivityDirective;
simulatedActivity: ExtensionSimulatedActivity | null;
}
| {
kind: 'simulatedActivity';
simulatedActivity: ExtensionSimulatedActivity;
activityDirective: ExtensionActivityDirective | null;
}
| {
kind: 'externalEvent';
externalEvent: ExtensionExternalEvent;
};We'd need to make a few changes to support getting a list of directives, spans, and external events here:
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Based on an issue I opened, #1999, this PR updates the request sent by
callExtensiontwo ways:selectedSimulatedActivity, is sentselectedSimulatedActivityrepresents the span that is either selected in the UI, or the span that is tied to the selected directive. This lets users directly send simulated activities to their extension, as well as including the simulated activity if it exists even when the directive is selected.The directive ID was changed to the full definition to remove the extra hop of having the extension receive the ID and have to request the directive's definition
These two changes should compress extension workflows - for example, the current workflow used for an extension I'm building is:
callExtension-> passesdirective.idto my API -> API requests directive definition from PlanDev + API requests simulated activity definition from PlanDevTesting
Small Python server to work as an extension is included as an artifact: mock-extension-server.py
python3 mock_extension.pyData->ui->extension->Insert Rowurlto be set tohttp://localhost:8000(default port for the test extension)Saveui->extension_roles->Insert Rowadmin(or your role) needs access to the extension we just created via. theextension_idExtensionsand select the example extensionExtensionsand select the example