diff --git a/index.ts b/index.ts index 3d36a98..b1c2420 100644 --- a/index.ts +++ b/index.ts @@ -101,6 +101,32 @@ const INVOKE_SAMPLES: Record< }, }; +const REGISTERED_APP_NAMES: Record< + LanguageKey, + Partial> +> = { + [LANGUAGE_TYPESCRIPT]: { + [TEMPLATE_SAMPLE_APP]: + 'ts-basic', + [TEMPLATE_STAGEHAND]: + 'ts-stagehand', + [TEMPLATE_PERSISTENT_BROWSER]: + 'ts-persistent-browser', + [TEMPLATE_COMPUTER_USE]: + 'ts-cu', + }, + [LANGUAGE_PYTHON]: { + [TEMPLATE_SAMPLE_APP]: + 'python-basic', + [TEMPLATE_BROWSER_USE]: + 'python-bu', + [TEMPLATE_PERSISTENT_BROWSER]: + 'python-persistent-browser', + [TEMPLATE_COMPUTER_USE]: + 'python-cu', + }, +}; + const CONFIG = { templateBasePath: path.resolve(__dirname, "../templates"), defaultAppName: "my-kernel-app", @@ -330,6 +356,7 @@ function printNextSteps( Next steps: cd ${appName} + # Request early access for an API key: https://waitlist.onkernel.com/r/mZW2zz export KERNEL_API_KEY= ${ language === LANGUAGE_PYTHON @@ -338,6 +365,7 @@ Next steps: } ${deployCommand} ${INVOKE_SAMPLES[language][template]} + kernel logs ${REGISTERED_APP_NAMES[language][template]} --follow `) ); } diff --git a/templates/python/computer-use/run_local.py b/templates/python/computer-use/run_local.py deleted file mode 100644 index d9f4d01..0000000 --- a/templates/python/computer-use/run_local.py +++ /dev/null @@ -1,38 +0,0 @@ -import asyncio -import json -from pathlib import Path -import sys - -from dotenv import load_dotenv - -# Ensure project root is on the import path when executing directly -project_root = Path(__file__).parent -if str(project_root) not in sys.path: - sys.path.append(str(project_root)) - -# Load environment variables from .env.local if present -load_dotenv('.env.local') - -from main import cu_task - -class KernelContext: # Minimal stub to satisfy the cu_task signature - def __init__(self, invocation_id: str): - self.invocation_id = invocation_id - - -async def _main() -> None: - context: KernelContextProtocol = KernelContext(invocation_id="local-test") - - payload = { - "query": "what is the weather in nyc today?" - } - - try: - result = await cu_task(context, payload) - print("Result:", json.dumps(result, indent=2)) - except Exception as exc: - print("Error:", str(exc)) - - -if __name__ == "__main__": - asyncio.run(_main()) \ No newline at end of file