diff --git a/executor/src/core/Ad4mCore.ts b/executor/src/core/Ad4mCore.ts index ae6294a67..57b0b5327 100644 --- a/executor/src/core/Ad4mCore.ts +++ b/executor/src/core/Ad4mCore.ts @@ -1,21 +1,26 @@ -import type { Address, PublicSharing, PerspectiveHandle, Perspective, LanguageLanguageInput, LanguageExpression, LanguageMetaInput, AgentExpression, Language, NeighbourhoodExpression } from '@coasys/ad4m' -import { parseExprUrl, LanguageRef, Neighbourhood, PerspectiveState } from '@coasys/ad4m' - -import * as Config from './Config' -import * as Db from './db' -import type { Ad4mDb } from './db' -import HolochainService, { HolochainConfiguration } from './storage-services/Holochain/HolochainService'; +import type { + AgentExpression, + Language, + LanguageExpression, + LanguageLanguageInput, + LanguageMetaInput, + PublicSharing +} from '@coasys/ad4m' +import { LanguageRef } from '@coasys/ad4m' +import { AgentInfoResponse } from '@holochain/client' +import fs from 'node:fs' +import { v4 as uuidv4 } from 'uuid' import AgentService from './agent/AgentService' -import LanguageController from './LanguageController' -import * as DIDs from './agent/DIDs' import type { DIDResolver } from './agent/DIDs' -import * as PubSubDefinitions from './graphQL-interface/SubscriptionDefinitions' -import fs from 'node:fs' -import { AgentInfoResponse } from '@holochain/client' -import { v4 as uuidv4 } from 'uuid'; +import * as DIDs from './agent/DIDs' +import * as Config from './Config' import { MainConfig } from './Config' -import { getPubSub, sleep } from "./utils"; - +import type { Ad4mDb } from './db' +import * as Db from './db' +import * as PubSubDefinitions from './graphQL-interface/SubscriptionDefinitions' +import LanguageController from './LanguageController' +import HolochainService, { HolochainConfiguration } from './storage-services/Holochain/HolochainService' +import { getPubSub } from './utils' export interface InitServicesParams { agentService: AgentService, } @@ -285,4 +290,4 @@ export default class Ad4mCore { export function create(config: Config.CoreConfig): Ad4mCore { return new Ad4mCore(config) -} \ No newline at end of file +} diff --git a/executor/src/languages_extension.d.ts b/executor/src/languages_extension.d.ts index 60bc4eb26..9ef68f3c2 100644 --- a/executor/src/languages_extension.d.ts +++ b/executor/src/languages_extension.d.ts @@ -1,9 +1,4 @@ -export interface LinkExpression { - author: string; - timestamp: string; - data: Triple; - proof: ExpressionProof; -} +import type { LinkExpression, PerspectiveDiff, PerspectiveExpression, PerspectiveState } from '@coasys/ad4m'; export interface Triple { source?: string; @@ -16,25 +11,10 @@ export interface ExpressionProof { signature: string; } -export interface PerspectiveDiff { - additions: LinkExpression[]; - removals: LinkExpression[]; -} - -export interface PerspectiveExpression { - author: string; - timestamp: string; - data: Perspective; - proof: ExpressionProof; -} - export interface Perspective { links: LinkExpression[]; } -// PerspectiveState is an enum in Rust, which can be represented as a union type in TypeScript -export type PerspectiveState = 'PRIVATE' | 'NEIGHBOURHOOD_JOIN_INITIATED' | 'LINK_LANGUAGE_FAILED_TO_INSTALL' | 'LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED' | 'SYNCED'; - declare global { interface RustLanguages { perspectiveDiffReceived: (diff: PerspectiveDiff, languageAddress: string) => void; @@ -42,5 +22,5 @@ declare global { telepresenceSignalReceived: (signal: PerspectiveExpression, languageAddress: string) => void; } - const LANGUAGES: RustLanguages; -} \ No newline at end of file + const LANGUAGE_CONTROLLER: RustLanguages; +}