Skip to content

Commit 9f70ba2

Browse files
committed
Merge branch 'development' into feature/sqs
# Conflicts: # Modules/Intent.Modules.NET.isln # Modules/Intent.Modules.NET.sln
2 parents 127c75f + 3240d18 commit 9f70ba2

File tree

2,002 files changed

+237175
-10633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,002 files changed

+237175
-10633
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ignoredFiles>
3+
<files>
4+
<file relativePath="../../Intent.Modules.AzureFunctions.Dispatch.Services/release-notes.md" />
5+
<file relativePath="../Intent.Modules.AzureFunctions.Dispatch.Services/release-notes.md" />
6+
<file relativePath="Intent.Modules.AzureFunctions.Dispatch.Services/release-notes.md" />
7+
</files>
8+
</ignoredFiles>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<outputFiles>
3+
<files>
4+
<file relativePath="Intent.Modules.AzureFunctions.Dispatch.Services/release-notes.md" state="ignored;once-off-generated" />
5+
</files>
6+
</outputFiles>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<outputLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<ApplicationId>dd606e23-930e-465c-bad1-9922641967b0</ApplicationId>
4+
<FileLogs>
5+
<FileLog>
6+
<OverwriteBehaviour>always</OverwriteBehaviour>
7+
<ApplicationRelativeFilePath>../../../../Intent.Modules.AzureFunctions.Dispatch.Services/release-notes.md</ApplicationRelativeFilePath>
8+
<IsIgnored>true</IsIgnored>
9+
</FileLog>
10+
<FileLog>
11+
<OverwriteBehaviour>always</OverwriteBehaviour>
12+
<ApplicationRelativeFilePath>../../../Intent.Modules.AzureFunctions.Dispatch.Services/release-notes.md</ApplicationRelativeFilePath>
13+
<IsIgnored>true</IsIgnored>
14+
</FileLog>
15+
<FileLog>
16+
<ProjectId>4c832ff3-49a4-47fa-b114-75b7f37e3d32</ProjectId>
17+
<CorrelationId>Intent.ModuleBuilder.Templates.FactoryExtension#549d57c1-113f-45c3-85a7-460bc18872f5</CorrelationId>
18+
<OverwriteBehaviour>always</OverwriteBehaviour>
19+
<ApplicationRelativeFilePath>../../Intent.Modules.AzureFunctions.Dispatch.Services/FactoryExtensions/ContractDispatchExtension.cs</ApplicationRelativeFilePath>
20+
<IsIgnored>false</IsIgnored>
21+
</FileLog>
22+
<FileLog>
23+
<ProjectId>a5e2fbde-b680-478d-9dbe-11e798d5fdc3</ProjectId>
24+
<CorrelationId>Intent.ModuleBuilder.IModSpecFile</CorrelationId>
25+
<OverwriteBehaviour>always</OverwriteBehaviour>
26+
<ApplicationRelativeFilePath>../../Intent.Modules.AzureFunctions.Dispatch.Services/Intent.AzureFunctions.Dispatch.Services.imodspec</ApplicationRelativeFilePath>
27+
<IsIgnored>false</IsIgnored>
28+
</FileLog>
29+
<FileLog>
30+
<ProjectId>a5e2fbde-b680-478d-9dbe-11e798d5fdc3</ProjectId>
31+
<CorrelationId>Intent.VisualStudio.Projects.CSharpProject#a5e2fbde-b680-478d-9dbe-11e798d5fdc3</CorrelationId>
32+
<OverwriteBehaviour>always</OverwriteBehaviour>
33+
<ApplicationRelativeFilePath>../../Intent.Modules.AzureFunctions.Dispatch.Services/Intent.Modules.AzureFunctions.Dispatch.Services.csproj</ApplicationRelativeFilePath>
34+
<IsIgnored>false</IsIgnored>
35+
</FileLog>
36+
<FileLog>
37+
<ProjectId>a5e2fbde-b680-478d-9dbe-11e798d5fdc3</ProjectId>
38+
<CorrelationId>Intent.ModuleBuilder.Templates.ReleaseNotes</CorrelationId>
39+
<OverwriteBehaviour>once-off</OverwriteBehaviour>
40+
<ApplicationRelativeFilePath>../../Intent.Modules.AzureFunctions.Dispatch.Services/release-notes.md</ApplicationRelativeFilePath>
41+
<IsIgnored>true</IsIgnored>
42+
</FileLog>
43+
<FileLog>
44+
<CorrelationId>Intent.VisualStudio.Projects.VisualStudioSolution#05345d7b-3b4c-4e2d-8fff-07059a542948</CorrelationId>
45+
<OverwriteBehaviour>always</OverwriteBehaviour>
46+
<ApplicationRelativeFilePath>../../Intent.Modules.NET.sln</ApplicationRelativeFilePath>
47+
<IsIgnored>false</IsIgnored>
48+
</FileLog>
49+
</FileLogs>
50+
</outputLog>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<outputFiles>
3+
<files>
4+
<file relativePath="Intent.Modules.AzureFunctions.EntityFrameworkCore/release-notes.md" state="once-off-generated" />
5+
</files>
6+
</outputFiles>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<outputLog>
3+
<ApplicationId>64c2d3e6-16f0-4df3-978c-fd75c0a0dd3e</ApplicationId>
4+
<FileLogs>
5+
<FileLog>
6+
<ProjectId>8a85d5be-c6d3-42f3-b9a7-eaa57590f085</ProjectId>
7+
<CorrelationId>Intent.ModuleBuilder.Templates.FactoryExtension#2ac9f629-04b0-4095-bdcd-7f13fef1d468</CorrelationId>
8+
<OverwriteBehaviour>always</OverwriteBehaviour>
9+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/FactoryExtensions/AzureFunctionExtension.cs</ApplicationRelativeFilePath>
10+
<ProjectRelativeFilePath>AzureFunctionExtension.cs</ProjectRelativeFilePath>
11+
<IsIgnored>false</IsIgnored>
12+
</FileLog>
13+
<FileLog>
14+
<ProjectId>c17533ef-8a8d-48f7-ab64-67f73dee9d64</ProjectId>
15+
<CorrelationId>Intent.ModuleBuilder.IModSpecFile</CorrelationId>
16+
<OverwriteBehaviour>always</OverwriteBehaviour>
17+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/Intent.AzureFunctions.EntityFrameworkCore.imodspec</ApplicationRelativeFilePath>
18+
<ProjectRelativeFilePath>Intent.AzureFunctions.EntityFrameworkCore.imodspec</ProjectRelativeFilePath>
19+
<IsIgnored>false</IsIgnored>
20+
</FileLog>
21+
<FileLog>
22+
<ProjectId>c17533ef-8a8d-48f7-ab64-67f73dee9d64</ProjectId>
23+
<CorrelationId>Intent.VisualStudio.Projects.CSharpProject#c17533ef-8a8d-48f7-ab64-67f73dee9d64</CorrelationId>
24+
<OverwriteBehaviour>always</OverwriteBehaviour>
25+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/Intent.Modules.AzureFunctions.EntityFrameworkCore.csproj</ApplicationRelativeFilePath>
26+
<ProjectRelativeFilePath>Intent.Modules.AzureFunctions.EntityFrameworkCore.csproj</ProjectRelativeFilePath>
27+
<IsIgnored>false</IsIgnored>
28+
</FileLog>
29+
<FileLog>
30+
<ProjectId>c17533ef-8a8d-48f7-ab64-67f73dee9d64</ProjectId>
31+
<CorrelationId>Intent.ModuleBuilder.Templates.ReleaseNotes</CorrelationId>
32+
<OverwriteBehaviour>once-off</OverwriteBehaviour>
33+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/release-notes.md</ApplicationRelativeFilePath>
34+
<ProjectRelativeFilePath>release-notes.md</ProjectRelativeFilePath>
35+
<IsIgnored>false</IsIgnored>
36+
</FileLog>
37+
<FileLog>
38+
<ProjectId>54021c70-f23f-408a-9839-69fbd00ab5ba</ProjectId>
39+
<CorrelationId>Intent.ModuleBuilder.CSharp.Templates.CSharpTemplate.T4Template.PreProcessed#5a71ddc3-2d31-4dbb-95aa-479d69569824</CorrelationId>
40+
<OverwriteBehaviour>always</OverwriteBehaviour>
41+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/Templates/DbInitializationService/DbInitializationServiceTemplate.cs</ApplicationRelativeFilePath>
42+
<ProjectRelativeFilePath>DbInitializationService/DbInitializationServiceTemplate.cs</ProjectRelativeFilePath>
43+
<IsIgnored>false</IsIgnored>
44+
</FileLog>
45+
<FileLog>
46+
<ProjectId>54021c70-f23f-408a-9839-69fbd00ab5ba</ProjectId>
47+
<CorrelationId>Intent.ModuleBuilder.CSharp.Templates.CSharpT4Template#5a71ddc3-2d31-4dbb-95aa-479d69569824</CorrelationId>
48+
<OverwriteBehaviour>always</OverwriteBehaviour>
49+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/Templates/DbInitializationService/DbInitializationServiceTemplate.tt</ApplicationRelativeFilePath>
50+
<ProjectRelativeFilePath>DbInitializationService/DbInitializationServiceTemplate.tt</ProjectRelativeFilePath>
51+
<IsIgnored>false</IsIgnored>
52+
</FileLog>
53+
<FileLog>
54+
<ProjectId>54021c70-f23f-408a-9839-69fbd00ab5ba</ProjectId>
55+
<CorrelationId>Intent.ModuleBuilder.CSharp.Templates.CSharpTemplatePartial#5a71ddc3-2d31-4dbb-95aa-479d69569824</CorrelationId>
56+
<OverwriteBehaviour>always</OverwriteBehaviour>
57+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/Templates/DbInitializationService/DbInitializationServiceTemplatePartial.cs</ApplicationRelativeFilePath>
58+
<ProjectRelativeFilePath>DbInitializationService/DbInitializationServiceTemplatePartial.cs</ProjectRelativeFilePath>
59+
<IsIgnored>false</IsIgnored>
60+
</FileLog>
61+
<FileLog>
62+
<ProjectId>54021c70-f23f-408a-9839-69fbd00ab5ba</ProjectId>
63+
<CorrelationId>Intent.ModuleBuilder.TemplateRegistration.Custom#5a71ddc3-2d31-4dbb-95aa-479d69569824</CorrelationId>
64+
<OverwriteBehaviour>always</OverwriteBehaviour>
65+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/Templates/DbInitializationService/DbInitializationServiceTemplateRegistration.cs</ApplicationRelativeFilePath>
66+
<ProjectRelativeFilePath>DbInitializationService/DbInitializationServiceTemplateRegistration.cs</ProjectRelativeFilePath>
67+
<IsIgnored>false</IsIgnored>
68+
</FileLog>
69+
<FileLog>
70+
<ProjectId>54021c70-f23f-408a-9839-69fbd00ab5ba</ProjectId>
71+
<CorrelationId>Intent.ModuleBuilder.Templates.TemplateExtensions</CorrelationId>
72+
<OverwriteBehaviour>always</OverwriteBehaviour>
73+
<ApplicationRelativeFilePath>../Intent.Modules.AzureFunctions.EntityFrameworkCore/Templates/TemplateExtensions.cs</ApplicationRelativeFilePath>
74+
<ProjectRelativeFilePath>TemplateExtensions.cs</ProjectRelativeFilePath>
75+
<IsIgnored>false</IsIgnored>
76+
</FileLog>
77+
<FileLog>
78+
<CorrelationId>Intent.VisualStudio.Projects.VisualStudioSolution#0f486cac-953c-43a4-a846-b1827462e544</CorrelationId>
79+
<OverwriteBehaviour>always</OverwriteBehaviour>
80+
<ApplicationRelativeFilePath>../Intent.Modules.NET.sln</ApplicationRelativeFilePath>
81+
<IsIgnored>false</IsIgnored>
82+
</FileLog>
83+
</FileLogs>
84+
</outputLog>
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
interface IModelRecord {
2+
providerId: string;
3+
modelName: string;
4+
providerName: string;
5+
thinkingType: ThinkingType;
6+
}
7+
8+
type ThinkingType = "None" | "Unknown" | "ThinkingLevels";
9+
10+
interface IProviderModelsResult {
11+
providerModels: IModelRecord[];
12+
modelLookup: { [key: string]: IModelRecord };
13+
}
14+
15+
interface ICollectedAiSettings {
16+
providerId: string;
17+
modelId: string;
18+
thinkingLevel: string | null;
19+
}
20+
21+
async function getAiProviderModels(): Promise<IProviderModelsResult> {
22+
const moduleTaskResult = await executeModuleTask("Intent.Modules.Common.AI.Tasks.ProviderModelsTask");
23+
24+
const providerModels = JSON.parse(moduleTaskResult) as IModelRecord[];
25+
const modelLookup = providerModels.reduce((acc: any, item) => {
26+
acc[`${item.providerId}--${item.modelName}`] = item;
27+
return acc;
28+
}, {});
29+
30+
return { providerModels, modelLookup };
31+
}
32+
33+
async function getAiModelSelectionFields(providerModelsResult: IProviderModelsResult, aiSettingKeyPrefix: string): Promise<MacroApi.Context.IDynamicFormFieldConfig[]> {
34+
const globalSettings = await userSettings.loadGlobalAsync();
35+
const settingModelId = globalSettings.get(`${aiSettingKeyPrefix}.ModelId`);
36+
const settingThinkingLevel = globalSettings.get(`${aiSettingKeyPrefix}.ThinkingLevel`);
37+
38+
const { providerModels, modelLookup } = providerModelsResult;
39+
const initialThinkingType = modelLookup[settingModelId]?.thinkingType;
40+
41+
return [
42+
{
43+
id: "model",
44+
fieldType: "select",
45+
label: "Model",
46+
isRequired: true,
47+
hint: getModelHint(providerModels, initialThinkingType),
48+
selectOptions:
49+
Object.entries(modelLookup)
50+
.map(([key, value]: [string, IModelRecord]) => {
51+
return {
52+
id: key,
53+
description: value.modelName,
54+
additionalInfo: value.providerName
55+
};
56+
}),
57+
value: settingModelId,
58+
onChange: async (config) => {
59+
const curThinkingType = modelLookup[config.getField("model").value as string].thinkingType;
60+
const thinkingField = config.getField("thinking");
61+
62+
thinkingField.isHidden = curThinkingType === "None";
63+
thinkingField.selectOptions = getApplicableThinkingOptions(curThinkingType);
64+
thinkingField.hint = getModelHint(providerModels, curThinkingType);
65+
66+
if (curThinkingType === "ThinkingLevels") {
67+
thinkingField.value = "low";
68+
} else if (curThinkingType === "Unknown") {
69+
thinkingField.value = "none";
70+
} else {
71+
thinkingField.value = null;
72+
}
73+
}
74+
},
75+
{
76+
id: "thinking",
77+
fieldType: "select",
78+
label: "Thinking/reasoning mode",
79+
isHidden: settingThinkingLevel == null || providerModels.length === 0,
80+
value: settingThinkingLevel,
81+
selectOptions: getApplicableThinkingOptions(initialThinkingType)
82+
}
83+
];
84+
85+
function getModelHint(providerModels: IModelRecord[], thinkingType: ThinkingType | null): string {
86+
if (providerModels.length === 0) {
87+
return "Not seeing any AI Models? Learn how to configure or add models [here](https://docs.intentarchitect.com/articles/modules-common/intent-common-ai/intent-common-ai.html).";
88+
} else if (thinkingType == "Unknown") {
89+
return "Thinking level for model is unknown; none is selected by default.";
90+
} else {
91+
return "";
92+
}
93+
}
94+
95+
function getApplicableThinkingOptions(thinkingType: ThinkingType | null): MacroApi.Context.IDynamicFormFieldSelectOption[] {
96+
if (thinkingType === "ThinkingLevels") {
97+
return [
98+
{
99+
id: "low",
100+
description: "Low",
101+
additionalInfo: "Thinks less, quicker"
102+
},
103+
{
104+
id: "high",
105+
description: "High",
106+
additionalInfo: "Thinks more, slower"
107+
}
108+
];
109+
} else if (thinkingType === "Unknown") {
110+
return [
111+
{
112+
id: "none",
113+
description: "None",
114+
additionalInfo: "No thinking/reasoning"
115+
},
116+
{
117+
id: "low",
118+
description: "Low",
119+
additionalInfo: "Thinks less, quicker"
120+
},
121+
{
122+
id: "high",
123+
description: "High",
124+
additionalInfo: "Thinks more, slower"
125+
}
126+
];
127+
} else {
128+
return [];
129+
}
130+
}
131+
}
132+
133+
async function collectAndPersistAiSettingsFromPromptResult(promptResult: any, providerModelsResult: IProviderModelsResult, aiSettingKeyPrefix: string): Promise<ICollectedAiSettings> {
134+
const providerId = providerModelsResult.modelLookup[promptResult.model].providerId;
135+
const modelId = providerModelsResult.modelLookup[promptResult.model].modelName;
136+
const thinkingLevel = promptResult.thinking;
137+
138+
const globalSettings = await userSettings.loadGlobalAsync();
139+
globalSettings.set(`${aiSettingKeyPrefix}.ModelId`, `${providerId}--${modelId}`);
140+
globalSettings.set(`${aiSettingKeyPrefix}.ThinkingLevel`, thinkingLevel);
141+
142+
return { providerId, modelId, thinkingLevel: thinkingLevel };
143+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
async function execute(taskId: string): Promise<void> {
2+
3+
const providerModelsResult = await getAiProviderModels();
4+
const settingName = "AI.AutoImplementation";
5+
6+
// Open a dialog for the user to enter an AI prompt
7+
let promptResult = await dialogService.openForm({
8+
title: "AI: Auto-Implement Handler for " + element.getName(),
9+
icon: Icons.AiImplement,
10+
fields: [
11+
{
12+
id: "prompt",
13+
fieldType: "textarea",
14+
label: "Provide any additional context",
15+
placeholder: "Leave blank if you wish to provide no additional context.",
16+
hint: "NOTE: Additional context will be combined with the Intent Architect auto-generated prompt to guide the AI Agent."
17+
},
18+
...await getAiModelSelectionFields(providerModelsResult, settingName)
19+
],
20+
submitButtonText: "Execute",
21+
minWidth: "750px"
22+
});
23+
24+
// Check if the user cancelled
25+
if (!promptResult) {
26+
return;
27+
}
28+
29+
const { providerId, modelId, thinkingLevel: thinkingLevel } = await collectAndPersistAiSettingsFromPromptResult(
30+
promptResult, providerModelsResult, settingName);
31+
32+
await launchHostedModuleTask(taskId,
33+
[
34+
application.id,
35+
element.id,
36+
promptResult.prompt ?? "",
37+
providerId,
38+
modelId,
39+
thinkingLevel
40+
],
41+
{
42+
taskName: "AI: Handler for " + element.getName()
43+
});
44+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$tsconfig = Join-Path $PSScriptRoot 'tsconfig.json'
2+
tsc -p $tsconfig
3+
4+
if ($LASTEXITCODE -ne 0) {
5+
Write-Host "Exited early as build failed for $tsconfig"
6+
exit
7+
}

0 commit comments

Comments
 (0)