Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## UNRELEASED - CLI 0.14.0

- fix: Lookup of 'latest' SDK when no Modus SDK is referenced [#625](https://github.com/hypermodeinc/modus/pull/625)

## UNRELEASED - AssemblyScript SDK 0.14.2

- chore: Export base Message class in OpenAI chat SDK [#616](https://github.com/hypermodeinc/modus/pull/616)
Expand Down
17 changes: 17 additions & 0 deletions cli/src/util/appinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import semver from "semver";
import * as fs from "./fs.js";
import * as vi from "./versioninfo.js";
import { SDK } from "../custom/globals.js";
import { isOnline } from "./index.js";

export type ModusAppInfo = {
name: string;
Expand All @@ -20,6 +21,22 @@ export type ModusAppInfo = {
};

export async function getAppInfo(appPath: string): Promise<ModusAppInfo> {
const appInfo = await getInfoFromApp(appPath);

if (appInfo.sdkVersion == "latest") {
const online = await isOnline();
const version = online ? await vi.getLatestSdkVersion(appInfo.sdk, false) : await vi.getLatestInstalledSdkVersion(appInfo.sdk, false);
if (version) {
appInfo.sdkVersion = version;
} else {
throw new Error(`Could not determine the latest version of the ${appInfo.sdk} SDK`);
}
}

return appInfo;
}

async function getInfoFromApp(appPath: string): Promise<ModusAppInfo> {
if (await fs.exists(path.join(appPath, "package.json"))) {
return await getAssemblyScriptAppInfo(appPath);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/go/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* SPDX-License-Identifier: Apache-2.0
*/

package main
package modus
2 changes: 2 additions & 0 deletions sdk/go/templates/default/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module my-modus-app

go 1.23.0

require github.com/hypermodeinc/modus/sdk/go v0.14.2
2 changes: 2 additions & 0 deletions sdk/go/templates/default/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/hypermodeinc/modus/sdk/go v0.14.2 h1:u8apLIaxQlE9sGVmhWNwWQCuvFIctZyse83nJiGB1/A=
github.com/hypermodeinc/modus/sdk/go v0.14.2/go.mod h1:VDL2kAYHQtNEr7lxPynbchZ6HizLSSQ9cG4LrDnq3Vg=
6 changes: 5 additions & 1 deletion sdk/go/templates/default/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package main

import "fmt"
import (
"fmt"

_ "github.com/hypermodeinc/modus/sdk/go"
)

func SayHello(name *string) string {

Expand Down
Loading