Add apache2 SPDX headers to all source files (#48)

This commit is contained in:
Tyler 2025-04-18 17:44:24 -07:00 committed by GitHub
parent e75f0722e7
commit 4354458cad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
46 changed files with 276 additions and 0 deletions

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import eslint from '@eslint/js'; import eslint from '@eslint/js';
import tseslint from 'typescript-eslint'; import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react'; import reactPlugin from 'eslint-plugin-react';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import yargs from 'yargs/yargs'; import yargs from 'yargs/yargs';
import { hideBin } from 'yargs/helpers'; import { hideBin } from 'yargs/helpers';
import * as dotenv from 'dotenv'; import * as dotenv from 'dotenv';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { import {
GenerateContentConfig, GenerateContentConfig,
GoogleGenAI, GoogleGenAI,

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { ToolCallEvent, HistoryItem } from '../ui/types.js'; import { ToolCallEvent, HistoryItem } from '../ui/types.js';
import { Part } from '@google/genai'; import { Part } from '@google/genai';
import { import {

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Part } from '@google/genai'; import { Part } from '@google/genai';
import { toolRegistry } from '../tools/tool-registry.js'; import { toolRegistry } from '../tools/tool-registry.js';
import { import {

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { ReadFileTool } from '../tools/read-file.tool.js'; import { ReadFileTool } from '../tools/read-file.tool.js';
import { TerminalTool } from '../tools/terminal.tool.js'; import { TerminalTool } from '../tools/terminal.tool.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { render } from 'ink'; import { render } from 'ink';
import { App } from './ui/App.js'; import { App } from './ui/App.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import * as Diff from 'diff'; import * as Diff from 'diff';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import fg from 'fast-glob'; import fg from 'fast-glob';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'fs'; // Used for sync checks in validation import fs from 'fs'; // Used for sync checks in validation
import fsPromises from 'fs/promises'; // Used for async operations in fallback import fsPromises from 'fs/promises'; // Used for async operations in fallback
import path from 'path'; import path from 'path';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import { BaseTool, ToolResult } from './tools.js'; import { BaseTool, ToolResult } from './tools.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import { SchemaValidator } from '../utils/schemaValidator.js'; import { SchemaValidator } from '../utils/schemaValidator.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { import {
spawn, spawn,
SpawnOptions, SpawnOptions,

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { ToolListUnion, FunctionDeclaration } from '@google/genai'; import { ToolListUnion, FunctionDeclaration } from '@google/genai';
import { Tool } from './tools.js'; import { Tool } from './tools.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { FunctionDeclaration, Schema } from '@google/genai'; import { FunctionDeclaration, Schema } from '@google/genai';
import { ToolCallConfirmationDetails } from '../ui/types.js'; import { ToolCallConfirmationDetails } from '../ui/types.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { SchemaValidator } from '../utils/schemaValidator.js'; import { SchemaValidator } from '../utils/schemaValidator.js';
import { BaseTool, ToolResult } from './tools.js'; import { BaseTool, ToolResult } from './tools.js';
import { ToolCallConfirmationDetails } from '../ui/types.js'; // Added for shouldConfirmExecute import { ToolCallConfirmationDetails } from '../ui/types.js'; // Added for shouldConfirmExecute

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import { BaseTool, ToolResult } from './tools.js'; import { BaseTool, ToolResult } from './tools.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import type { HistoryItem } from './types.js'; import type { HistoryItem } from './types.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { UI_WIDTH, BOX_PADDING_X } from '../constants.js'; import { UI_WIDTH, BOX_PADDING_X } from '../constants.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box } from 'ink'; import { Box } from 'ink';
import type { HistoryItem } from '../types.js'; import type { HistoryItem } from '../types.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import TextInput from 'ink-text-input'; import TextInput from 'ink-text-input';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import Spinner from 'ink-spinner'; import Spinner from 'ink-spinner';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { UI_WIDTH } from '../constants.js'; import { UI_WIDTH } from '../constants.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Text, Box } from 'ink'; import { Text, Box } from 'ink';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Text, Box } from 'ink'; import { Text, Box } from 'ink';
import { MarkdownRenderer } from '../../utils/MarkdownRenderer.js'; import { MarkdownRenderer } from '../../utils/MarkdownRenderer.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Text, Box } from 'ink'; import { Text, Box } from 'ink';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text, useInput } from 'ink'; import { Box, Text, useInput } from 'ink';
import SelectInput from 'ink-select-input'; import SelectInput from 'ink-select-input';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box } from 'ink'; import { Box } from 'ink';
import { IndividualToolCallDisplay, ToolCallStatus } from '../../types.js'; import { IndividualToolCallDisplay, ToolCallStatus } from '../../types.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import Spinner from 'ink-spinner'; import Spinner from 'ink-spinner';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Text, Box } from 'ink'; import { Text, Box } from 'ink';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
const EstimatedArtWidth = 59; const EstimatedArtWidth = 59;
const BoxBorderWidth = 1; const BoxBorderWidth = 1;
export const BOX_PADDING_X = 1; export const BOX_PADDING_X = 1;

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { useEffect } from 'react'; import { useEffect } from 'react';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { useState, useRef, useCallback, useEffect } from 'react'; import { useState, useRef, useCallback, useEffect } from 'react';
import { useInput } from 'ink'; import { useInput } from 'ink';
import { GeminiClient } from '../../core/gemini-client.js'; import { GeminiClient } from '../../core/gemini-client.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { useState, useEffect, useRef } from 'react'; import { useState, useEffect, useRef } from 'react';
import { import {
WITTY_LOADING_PHRASES, WITTY_LOADING_PHRASES,

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { ToolResultDisplay } from '../tools/tools.js'; import { ToolResultDisplay } from '../tools/tools.js';
export enum ToolCallStatus { export enum ToolCallStatus {

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Text, Box } from 'ink'; import { Text, Box } from 'ink';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react'; import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { promises as fs } from 'fs'; import { promises as fs } from 'fs';
import { Content, SchemaUnion, Type } from '@google/genai'; // Assuming these types exist import { Content, SchemaUnion, Type } from '@google/genai'; // Assuming these types exist
import { GeminiClient } from '../core/gemini-client.js'; // Assuming this path import { GeminiClient } from '../core/gemini-client.js'; // Assuming this path

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export function isNodeError(error: unknown): error is NodeJS.ErrnoException { export function isNodeError(error: unknown): error is NodeJS.ErrnoException {
return error instanceof Error && 'code' in error; return error instanceof Error && 'code' in error;
} }

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as fs from 'fs/promises'; import * as fs from 'fs/promises';
import * as path from 'path'; import * as path from 'path';
import { getErrorMessage, isNodeError } from './errors.js'; import { getErrorMessage, isNodeError } from './errors.js';

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import path from 'node:path'; // Import the 'path' module import path from 'node:path'; // Import the 'path' module
/** /**

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/** /**
* Simple utility to validate objects against JSON Schemas * Simple utility to validate objects against JSON Schemas
* In a real implementation, you would use a library like Ajv * In a real implementation, you would use a library like Ajv

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export function helloServer() { export function helloServer() {
// TODO: add more things in this package // TODO: add more things in this package
} }

View File

@ -1,3 +1,9 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/* eslint-disable no-undef */ /* eslint-disable no-undef */
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';