Frontend Enhancements: - Complete React TypeScript frontend with modern UI components - Distributed workflows management interface with real-time updates - Socket.IO integration for live agent status monitoring - Agent management dashboard with cluster visualization - Project management interface with metrics and task tracking - Responsive design with proper error handling and loading states Backend Infrastructure: - Distributed coordinator for multi-agent workflow orchestration - Cluster management API with comprehensive agent operations - Enhanced database models for agents and projects - Project service for filesystem-based project discovery - Performance monitoring and metrics collection - Comprehensive API documentation and error handling Documentation: - Complete distributed development guide (README_DISTRIBUTED.md) - Comprehensive development report with architecture insights - System configuration templates and deployment guides The platform now provides a complete web interface for managing the distributed AI cluster with real-time monitoring, workflow orchestration, and agent coordination capabilities. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
113 lines
3.2 KiB
JavaScript
113 lines
3.2 KiB
JavaScript
'use strict';
|
|
|
|
var cstScalar = require('./cst-scalar.js');
|
|
var cstStringify = require('./cst-stringify.js');
|
|
var cstVisit = require('./cst-visit.js');
|
|
|
|
/** The byte order mark */
|
|
const BOM = '\u{FEFF}';
|
|
/** Start of doc-mode */
|
|
const DOCUMENT = '\x02'; // C0: Start of Text
|
|
/** Unexpected end of flow-mode */
|
|
const FLOW_END = '\x18'; // C0: Cancel
|
|
/** Next token is a scalar value */
|
|
const SCALAR = '\x1f'; // C0: Unit Separator
|
|
/** @returns `true` if `token` is a flow or block collection */
|
|
const isCollection = (token) => !!token && 'items' in token;
|
|
/** @returns `true` if `token` is a flow or block scalar; not an alias */
|
|
const isScalar = (token) => !!token &&
|
|
(token.type === 'scalar' ||
|
|
token.type === 'single-quoted-scalar' ||
|
|
token.type === 'double-quoted-scalar' ||
|
|
token.type === 'block-scalar');
|
|
/* istanbul ignore next */
|
|
/** Get a printable representation of a lexer token */
|
|
function prettyToken(token) {
|
|
switch (token) {
|
|
case BOM:
|
|
return '<BOM>';
|
|
case DOCUMENT:
|
|
return '<DOC>';
|
|
case FLOW_END:
|
|
return '<FLOW_END>';
|
|
case SCALAR:
|
|
return '<SCALAR>';
|
|
default:
|
|
return JSON.stringify(token);
|
|
}
|
|
}
|
|
/** Identify the type of a lexer token. May return `null` for unknown tokens. */
|
|
function tokenType(source) {
|
|
switch (source) {
|
|
case BOM:
|
|
return 'byte-order-mark';
|
|
case DOCUMENT:
|
|
return 'doc-mode';
|
|
case FLOW_END:
|
|
return 'flow-error-end';
|
|
case SCALAR:
|
|
return 'scalar';
|
|
case '---':
|
|
return 'doc-start';
|
|
case '...':
|
|
return 'doc-end';
|
|
case '':
|
|
case '\n':
|
|
case '\r\n':
|
|
return 'newline';
|
|
case '-':
|
|
return 'seq-item-ind';
|
|
case '?':
|
|
return 'explicit-key-ind';
|
|
case ':':
|
|
return 'map-value-ind';
|
|
case '{':
|
|
return 'flow-map-start';
|
|
case '}':
|
|
return 'flow-map-end';
|
|
case '[':
|
|
return 'flow-seq-start';
|
|
case ']':
|
|
return 'flow-seq-end';
|
|
case ',':
|
|
return 'comma';
|
|
}
|
|
switch (source[0]) {
|
|
case ' ':
|
|
case '\t':
|
|
return 'space';
|
|
case '#':
|
|
return 'comment';
|
|
case '%':
|
|
return 'directive-line';
|
|
case '*':
|
|
return 'alias';
|
|
case '&':
|
|
return 'anchor';
|
|
case '!':
|
|
return 'tag';
|
|
case "'":
|
|
return 'single-quoted-scalar';
|
|
case '"':
|
|
return 'double-quoted-scalar';
|
|
case '|':
|
|
case '>':
|
|
return 'block-scalar-header';
|
|
}
|
|
return null;
|
|
}
|
|
|
|
exports.createScalarToken = cstScalar.createScalarToken;
|
|
exports.resolveAsScalar = cstScalar.resolveAsScalar;
|
|
exports.setScalarValue = cstScalar.setScalarValue;
|
|
exports.stringify = cstStringify.stringify;
|
|
exports.visit = cstVisit.visit;
|
|
exports.BOM = BOM;
|
|
exports.DOCUMENT = DOCUMENT;
|
|
exports.FLOW_END = FLOW_END;
|
|
exports.SCALAR = SCALAR;
|
|
exports.isCollection = isCollection;
|
|
exports.isScalar = isScalar;
|
|
exports.prettyToken = prettyToken;
|
|
exports.tokenType = tokenType;
|