11// Load .env file
2- import { parseArgs } from "jsr: @std/cli/parse-args" ;
2+ import { parseArgs } from "@std/cli/parse-args" ;
33import { CharmManager , setBobbyServerUrl , storage } from "@commontools/charm" ;
44import { Cell , getEntityId , isStream } from "@commontools/runner" ;
55import { Charm } from "@commontools/charm" ;
@@ -11,9 +11,13 @@ function showHelp() {
1111 console . log ( "Usage: deno run main.ts [options]" ) ;
1212 console . log ( "" ) ;
1313 console . log ( "Options:" ) ;
14- console . log ( " --space=<space> Space to watch (default: common-knowledge)" ) ;
14+ console . log (
15+ " --space=<space> Space to watch (default: common-knowledge)" ,
16+ ) ;
1517 console . log ( " --charmId=<id> Specific charm ID to watch" ) ;
16- console . log ( " --interval=<seconds> Update interval in seconds (default: 30)" ) ;
18+ console . log (
19+ " --interval=<seconds> Update interval in seconds (default: 30)" ,
20+ ) ;
1721 console . log ( " --help Show this help message" ) ;
1822 console . log ( " --version Show version information" ) ;
1923 Deno . exit ( 0 ) ;
@@ -31,7 +35,8 @@ const { space, charmId, interval } = flags;
3135
3236// Configuration
3337const CHECK_INTERVAL = parseInt ( interval as string ) * 1000 ;
34- const toolshedUrl = Deno . env . get ( "TOOLSHED_API_URL" ) ?? "https://toolshed.saga-castor.ts.net/" ;
38+ const toolshedUrl = Deno . env . get ( "TOOLSHED_API_URL" ) ??
39+ "https://toolshed.saga-castor.ts.net/" ;
3540
3641// Initialize storage and Bobby server
3742storage . setRemoteStorage ( new URL ( toolshedUrl ) ) ;
@@ -90,7 +95,10 @@ async function refreshAuthToken(auth: Cell<any>, charm: Cell<Charm>) {
9095 authCellId . space = space as string ;
9196 log ( charm , `token expired, refreshing: ${ authCellId } ` ) ;
9297
93- const refresh_url = new URL ( "/api/integrations/google-oauth/refresh" , toolshedUrl ) ;
98+ const refresh_url = new URL (
99+ "/api/integrations/google-oauth/refresh" ,
100+ toolshedUrl ,
101+ ) ;
94102 const refresh_response = await fetch ( refresh_url , {
95103 method : "POST" ,
96104 body : JSON . stringify ( { authCellId } ) ,
@@ -149,7 +157,9 @@ async function watchCharm(charmId: string | undefined) {
149157}
150158
151159function getId ( charmId : string | Cell < Charm > | undefined ) : string | undefined {
152- const realCharmId = typeof charmId === "string" ? charmId : getEntityId ( charmId ) ?. [ "/" ] ;
160+ const realCharmId = typeof charmId === "string"
161+ ? charmId
162+ : getEntityId ( charmId ) ?. [ "/" ] ;
153163 if ( ! realCharmId ) {
154164 log ( undefined , "charmId not found" , JSON . stringify ( charmId ) ) ;
155165 return undefined ;
0 commit comments