Skip to content

Commit

Permalink
Updated deprecation packages
Browse files Browse the repository at this point in the history
Updated deprecation packages
  • Loading branch information
dustinwloring1988 committed Nov 30, 2024
1 parent fe45651 commit 602b7c9
Show file tree
Hide file tree
Showing 5 changed files with 25,546 additions and 17 deletions.
21 changes: 8 additions & 13 deletions app/lib/runtime/action-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ export class ActionRunner {
this.#shellTerminal = getShellTerminal;
}

addAction(data: ActionCallbackData) {
addAction(data: ActionCallbackData): string {
const { actionId } = data;

const actions = this.actions.get();
const action = actions[actionId];

if (action) {
// action already added
return;
return actionId;
}

const abortController = new AbortController();
Expand All @@ -73,22 +73,16 @@ export class ActionRunner {
this.#currentExecutionPromise.then(() => {
this.#updateAction(actionId, { status: 'running' });
});

return actionId;
}

async runAction(data: ActionCallbackData, isStreaming: boolean = false) {
const { actionId } = data;
const actionId = this.addAction(data);
const action = this.actions.get()[actionId];

if (!action) {
unreachable(`Action ${actionId} not found`);
}

if (action.executed) {
return;
}

if (isStreaming && action.type !== 'file') {
return;
return Promise.resolve();
}

this.#updateAction(actionId, { ...action, ...data.action, executed: !isStreaming });
Expand All @@ -100,7 +94,8 @@ export class ActionRunner {
.catch((error) => {
console.error('Action failed:', error);
});
return this.#currentExecutionPromise;

return this.#currentExecutionPromise;
}

async #executeAction(actionId: string, isStreaming: boolean = false) {
Expand Down
8 changes: 5 additions & 3 deletions app/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,11 @@ const getOllamaBaseUrl = () => {
};

async function getOllamaModels(): Promise<ModelInfo[]> {
//if (typeof window === 'undefined') {
//return [];
//}
/*
* if (typeof window === 'undefined') {
* return [];
* }
*/

try {
const baseUrl = getOllamaBaseUrl();
Expand Down
2 changes: 1 addition & 1 deletion app/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Logger {
setLevel: (level: DebugLevel) => void;
}

let currentLevel: DebugLevel = import.meta.env.VITE_LOG_LEVEL ?? import.meta.env.DEV ? 'debug' : 'info';
let currentLevel: DebugLevel = (import.meta.env.VITE_LOG_LEVEL ?? import.meta.env.DEV) ? 'debug' : 'info';

const isWorker = 'HTMLRewriter' in globalThis;
const supportsColor = !isWorker;
Expand Down
Loading

0 comments on commit 602b7c9

Please sign in to comment.